proof simple : !x:t.?y:t.P(x) => P(y) = begin [x:t; [P(x); P(x)]; P(x) => P(x); ?y:t.P(x) => P(y)]; !x:t.?y:t.P(x) => P(y) end; term simple : !x:t.?y:t.P(x) => P(y) = fn x => (x , fn u => u); proof compose : (!x:t.A(x) => B(x)) => (!x:t.B(x) => C(x)) => (!x:t.A(x) => C(x)) = begin [(!x:t.A(x) => B(x)); [(!x:t.B(x) => C(x)); [a : t; [A(a); A(a) => B(a); B(a); B(a) => C(a); C(a)]; A(a) => C(a)]; (!x:t.A(x) => C(x))]; (!x:t.B(x) => C(x)) => (!x:t.A(x) => C(x))]; (!x:t.A(x) => B(x)) => (!x:t.B(x) => C(x)) => (!x:t.A(x) => C(x)); end; term compose : (!x:t.A(x) => B(x)) => (!x:t.B(x) => C(x)) => (!x:t.A(x) => C(x)) = fn f => fn g => fn a => fn x => (g a) ((f a) x); proof dea1 : (?x:t.A(x) & B(x)) => (?x:t.A(x)) & (?x:t.B(x)) = begin [(?x:t.A(x) & B(x)); [x:t, A(x) & B(x); A(x); ?x:t.A(x)]; [x:t, A(x) & B(x); B(x); ?x:t.B(x)]; (?x:t.A(x)); (?x:t.B(x)); (?x:t.A(x)) & (?x:t.B(x))]; (?x:t.A(x) & B(x)) => (?x:t.A(x)) & (?x:t.B(x)); end; term dea1 : (?x:t.A(x) & B(x)) => (?x:t.A(x)) & (?x:t.B(x)) = fn e => let (x , u) = e in ( (x , fst u) , (x , snd u)); % proof dea2 : ((?x:t.A(x)) & (?x:t.B(x))) => (?x:t.A(x) & B(x)) = % begin % [((?x:t.A(x)) & (?x:t.B(x))); % (?x:t.A(x)); % (?x:t.B(x)); % [x : t, A(x); % A(x) & B (x); % UNJUSTIFIED % ?x:t.A(x) & B(x)]; % (?x:t.A(x) & B(x))]; % ((?x:t.A(x)) & (?x:t.B(x))) => (?x:t.A(x) & B(x)); % end; % proof dao1 : (!x:t.A(x) | B(x)) => (!x:t.A(x)) | (!x:t.B(x)) = % begin % [(!x:t.A(x) | B(x)); % [x:t; % A(x) | B(x); % [A(x); % A(x)]; % [B(x); % A(x)]; %% unjustified % A(x)]; % (!x:t.A(x)); % (!x:t.A(x)) | (!x:t.B(x))]; % (!x:t.A(x) | B(x)) => (!x:t.A(x)) | (!x:t.B(x)); % end; proof dao2 : ((!x:t.A(x)) | (!x:t.B(x))) => (!x:t.A(x) | B(x)) = begin [((!x:t.A(x)) | (!x:t.B(x))); [x:t; [(!x:t.A(x)); A(x); A(x) | B(x)]; [(!x:t.B(x)); B(x); A(x) | B(x)]; A(x) | B(x)]; (!x:t.A(x) | B(x))]; ((!x:t.A(x)) | (!x:t.B(x))) => (!x:t.A(x) | B(x)); end; term dao2 : ((!x:t.A(x)) | (!x:t.B(x))) => (!x:t.A(x) | B(x)) = fn u => fn x => case u of inl u1 => inl (u1 x) | inr u1 => inr (u1 x) end; proof daa1 : (!x:t.A(x) & B(x)) => (!x:t.A(x)) & (!x:t.B(x)) = begin [(!x:t.A(x) & B(x)); [x:t; A(x) & B(x); A(x)]; [x:t; A(x) & B(x); B(x)]; (!x:t.A(x)); (!x:t.B(x)); (!x:t.A(x)) & (!x:t.B(x))]; (!x:t.A(x) & B(x)) => (!x:t.A(x)) & (!x:t.B(x)); end; term daa1 : (!x:t.A(x) & B(x)) => (!x:t.A(x)) & (!x:t.B(x)) = fn f => (fn x => fst (f x) , fn x => snd (f x)); proof daa2 : ((!x:t.A(x)) & (!x:t.B(x))) => (!x:t.A(x) & B(x)) = begin [((!x:t.A(x)) & (!x:t.B(x))); (!x:t.A(x)); (!x:t.B(x)); [x:t; A(x); B(x); A(x) & B(x)]; (!x:t.A(x) & B(x))]; ((!x:t.A(x)) & (!x:t.B(x))) => (!x:t.A(x) & B(x)); end; term daa2 : ((!x:t.A(x)) & (!x:t.B(x))) => (!x:t.A(x) & B(x)) = fn p => fn x => ((fst p) x, (snd p) x); proof deo1 : (?x:t.A(x) | B(x)) => (?x:t.A(x)) | (?x:t.B(x)) = begin [(?x:t.A(x) | B(x)); [x : t, A(x) | B(x); [A(x); ?x:t.A(x); (?x:t.A(x)) | (?x:t.B(x))]; [B(x); ?x:t.B(x); (?x:t.A(x)) | (?x:t.B(x))]; (?x:t.A(x)) | (?x:t.B(x))]; (?x:t.A(x)) | (?x:t.B(x))]; (?x:t.A(x) | B(x)) => (?x:t.A(x)) | (?x:t.B(x)); end; term deo1 : (?x:t.A(x) | B(x)) => (?x:t.A(x)) | (?x:t.B(x)) = fn p => let (x, u) = p in case u of inl u1 => inl (x , u1) | inr u2 => inr (x , u2) end; proof deo2 : ((?x:t.A(x)) | (?x:t.B(x))) => (?x:t.A(x) | B(x)) = begin [((?x:t.A(x)) | (?x:t.B(x))); [(?x:t.A(x)); [x:t , A(x); A(x) | B(x); (?x:t.A(x) | B(x))]; (?x:t.A(x) | B(x))]; [(?x:t.B(x)); [x:t , B(x); A(x) | B(x); (?x:t.A(x) | B(x))]; (?x:t.A(x) | B(x))]; (?x:t.A(x) | B(x))]; ((?x:t.A(x)) | (?x:t.B(x))) => (?x:t.A(x) | B(x)); end; term deo2 : ((?x:t.A(x)) | (?x:t.B(x))) => (?x:t.A(x) | B(x)) = fn v => case v of inl p1 => let (x , u) = p1 in (x , inl u) | inr p2 => let (x , u) = p2 in (x , inr u) end; proof dm1 : ~(?x:t.A(x)) => !x:t.~A(x) = begin [~(?x:t.A(x)); [x:t; [A(x); ?x:t.A(x); F]; ~A(x)]; !x:t.~A(x)]; ~(?x:t.A(x)) => !x:t.~A(x); end; term dm1 : ~(?x:t.A(x)) => !x:t.~A(x) = fn k => fn x => fn u => k (x,u); proof dm2 : (!x:t.~A(x)) => ~(?x:t.A(x)) = begin [(!x:t.~A(x)); [(?x:t.A(x)); [x:t , A(x); ~A(x); F]; F]; ~(?x:t.A(x))]; (!x:t.~A(x)) => ~(?x:t.A(x)); end; term dm2 : (!x:t.~A(x)) => ~(?x:t.A(x)) = fn u => fn p => let (x , v) = p in u x v;