proof demorgan3 : ~(A | B) => ~A & ~B = begin [~(A | B); [A; A | B; F]; [B; A | B; F]; ~A; ~B; ~A & ~B]; ~(A | B) => ~A & ~B; end; % proof demorgan4 : ~(A & B) => ~A | ~B = % begin % [~(A & B); % %%% Options: (1) prove A & B, but you can't. % %%% (2) prove ~A or prove ~B % [A; % %%% stuck, and ~B is symmetric % F]; % ~A; % ~A | ~B]; % ~(A & B) => ~A | ~B; % end; % proof imp1 : ((A => B) => C) => (A | C) & (B => C) = % begin % [(A => B) => C; % (A | C); %% UNJUSTIFIED % [B; % [A; % B]; % A => B; % C]; % (B => C); % (A | C) & (B => C)]; % ((A => B) => C) => (A | C) & (B => C) % end; proof imp2 : ((A | C) & (B => C)) => ((A => B) => C) = begin [((A | C) & (B => C)); A | C; B => C; [A => B; [C; C]; [A; B; C]; C]; ((A => B) => C)]; ((A | C) & (B => C)) => ((A => B) => C); end; proof orcomm : (A | B) => B | A = begin [A | B; [A; B | A]; [B; B | A]; B | A]; (A | B) => B | A; end; annotated proof orcomm : (A | B) => B | A = begin [x : A | B; [a : A; inr a : B | A]; [b : B; inl b : B | A]; case x of inl a => inr a | inr b => inl b end : B | A]; fn x => case x of inl a => inr a | inr b => inl b end : (A | B) => B | A; end; term orcomm : (A | B) => B | A = fn x => case x of inl a => inr a | inr b => inl b end; annotated proof curry : ((A & B) => C) => (A => (B => C)) = begin [f : A & B => C; [a : A; [b : B; (a , b) : A & B; f (a , b) : C]; fn b => f (a , b) : B => C]; fn a => fn b => f (a , b) : A => B => C]; fn f => fn a => fn b => f (a , b) : ((A & B) => C) => A => B => C; end; term curry : ((A & B) => C) => A => B => C = fn f => fn a => fn b => f (a , b) : ((A & B) => C) => A => B => C; term uncurry : (A => B => C) => ((A & B) => C) = fn g => fn p => g (fst p) (snd p);