I will first present a simple solution where "and" conjoins the respective NPs/VPs in such a way that the resulting conjoined elements combine with the VP/subject NP in such as if there was just a single element of the same type as the non-conjoined version. Of course, this is a bit naive for reasons discussed below.
The semantic type of "and" is indeed ambiguous between contexts: Since "and" can be used to conjoin NPs, VPs, sentences or pretty much anything else, it will have a different type in each context.
To find out the type of an expression, I would always do "backwards engineering": See which type you need to get out - this will be the second component of the type - then check what types go in for the arguments - this will be the first comonent of your type - and then simply set (input,output).
For "John and Mary run": "run" is a one-place verb, it referes to a set of individuals and is therefore of type (e,t), so you need to make sure that "John and Mary" are of type "e" because that's the input to "run". So the second component/the output value of the type of "and" will be (...,e). Now "John" and Mary" are proper names, so they refer to individual elements and thus have the type e. These arguments/inputs are absored by "and" one after the other, so the first component must be (e,(e, ...)). Combined, you have that the full type of "and" for the first sentence is (e,(e,(e))). You put in an e "John", then another one ("Mary"), and you get out something of type "e" again ("John and Mary").
John and Mary run
| e | |(e,(e,e))| | e | |(e,t)|
| (e,e) | | e | |(e,t)|
| e | |(e,t)|
| t |
For "Mary runs and jumps": "runs and jumps" behaves like a one-place verb that takes an NP of type e and returns a truth value, so the output of "and" should be (...,(e,t)). The input arguments are one-place verbs themselves, so to (e,t)'s go in for the arguments. Thus, the type of "and" in the second sentenece is ((e,t),((e,t),(e,t))): You put in an (e,t) ("runs"), then another one ("jumps"), and end up with a new something of type (e,t) ("jumps and runs").
Mary runs and jumps
| e | |(e,t)| |((e,t),((e,t),(e,t)))| |(e,t)|
| e | | ((e,t),(e,t)) | |(e,t)|
| e | | (e,t) |
| t |
Obviously, the two different types have something in common: In both useage contexts, you have two inputs of the same type and an output of yet the same type. For NPs, the type works with e, for one-place verbs, the type goes with (e,t), and with propositions (for example "John runs and Mary jumps") you would have the same with type t. So you could generalize and say that "and" is of type (σ,(σ,σ)) for any type sigma. In polymorphic type theory, this can be expressed as ∀σ.(σ,(σ,σ)).
I have to disagree with Draconis' comment in this respect: It's not like the entire theory of semantic types breaks down over "and", it's just that simply typed expressions are not quite powerful enough to generalize over such observations. But there are of course type theories that can accuont for these kinds of phenomena. Another extension that allows to provide types where simply types fail is intersection types, where one expression can basically have two types simultaneously and you can pick out one of the types depending on which you need in a particular context.
Going back to my introductory remark, this analysis is of course a bit naive: You assume that "John and Mary" is of the same type as just "John", namely of type e. This is philosophically a bit questionable, because e is supposed to denote indivdiual entities, and "John and Mary" arguably are not one individual. This is maybe less severe for the conjunction of NPs, where the predication of singing and dancing indeed behaves like a one-place verb that denotes a set of individuals, but still one could argue that this is not the desired structure.
Under some analyses, but in particular if one were to formalize the two sentences in predicate logic, one would traditionally claim that in both of the sentence we have a so-called ellipsis: "John and Mary run" is actually "John runs and Mary runs", just with the first "run" not visible, and "Mary runs and jumps" is actually just a contraction of "Mary runs and Mary jumps". Under this analysis, "and" can only conjoin propositions, and is thus of type (t,(t,t)), the remaining sentence then needs to be re-analyzed accordingly.
This is precisely what you already assumed: λP[λQ[λx[P(x) ∧ Q(x)]]]
would be the proper formalization of (2), and (1) would be λP[λx[λy[P(x) ∧ Q(y)]]]
. In both cases, ^
is of type (t,(t,t)). The respective types of the composed expresions would be
λP [ λQ [ λx[P(x) ∧ Q(x)]]]
((e,t), ((e,t), (e, t )))
λP [ λx[ λy[P(x) ∧ Q(y)]]]
((e,t), (e, (e, t )))
(e(et))
s, and so on.