The Fallacy of the Undistributed Middle, Set Theoretic Approach

all p's are q's  (Major premise)
x is a q         (Minor premise)   
---------------
x is a p         (Conclusion)

Prove this is a fallacy.

Here, we use a set theoretic interpretation of the classical syllogism:

ALL(a):[a ε p => a ε q]  (Major premise)
x ε q                    (Minor premise)  
---------------------- 
x ε p                    (Conclusion)   


To prove this is a fallcy, we must construct sets p and q such that the major and minor 
premises are true, and the conclusion is false.

We start by postulating a set q with x in q. This immediately satisfies the minor premise.
Then there must exist as a subset p of q such that x is not in p. The above requirements of 
p and q then follow trivially.


Let q and x be such that...

1	Set(q) & x ε q
	Premise

2	Set(q)
	Split, 1

The minor premise is true.

3	x ε q
	Split, 1

Apply the subset axiom.

4	EXIST(s):[Set(s) & ALL(a):[a ε s <=> a ε q & ~a=x]]
	Subset, 2

Let p be a subset of q which excludes x.

5	Set(p) & ALL(a):[a ε p <=> a ε q & ~a=x]
	E Spec, 4

6	Set(p)
	Split, 5

7	ALL(a):[a ε p <=> a ε q & ~a=x]
	Split, 5

	Prove: k ε p => k ε q
	
	Suppose...

	8	k ε p
		Premise

	Apply the definition of p.

	9	k ε p <=> k ε q & ~k=x
		U Spec, 7

	10	[k ε p => k ε q & ~k=x] & [k ε q & ~k=x => k ε p]
		Iff-And, 9

	11	k ε p => k ε q & ~k=x
		Split, 10

	12	k ε q & ~k=x => k ε p
		Split, 10

	13	k ε q & ~k=x
		Detach, 11, 8

	14	k ε q
		Split, 13

As Required:

15	k ε p => k ε q
	Conclusion, 8
The major premise is true.

16	ALL(a):[a ε p => a ε q]
	U Gen, 15

	
	Prove: ~x ε p
	
	Suppose to the contrary...

	17	x ε p
		Premise

	Apply the definition of p.

	18	x ε p <=> x ε q & ~x=x
		U Spec, 7

	19	[x ε p => x ε q & ~x=x] & [x ε q & ~x=x => x ε p]
		Iff-And, 18

	20	x ε p => x ε q & ~x=x
		Split, 19

	21	x ε q & ~x=x => x ε p
		Split, 19

	22	x ε q & ~x=x
		Detach, 20, 17

	23	x ε q
		Split, 22

	24	~x=x
		Split, 22

	25	x=x
		Reflex

	We obtain the contradiction...

	26	x=x & ~x=x
		Join, 25, 24

The conclusion of the syllogism is false.

27	~x ε p
	Conclusion, 17