% Proof examples from Recitation 1 in Tutch
% Text following '%' are comments that are not
% needed when you write your own proofs
proof example1 : (A => B => C) => (B => A => C) =
begin
[ A => B => C; % H1
[ B; % H2
[ A; % H3
B => C; % C1: =>E on H1 and H3
C ]; % C2: =>E on on C1 and H2
A => C ]; % C3: =>I on H3..C2
B => A => C ]; % C4: =>I on H2..C3
(A => B => C) => (B => A => C); % C5: =>I on H1..C4
end;
proof example2 : ((A & B) => C) => A => B => C =
begin
[ (A & B) => C; % H1
[ A; % H2
[ B; % H3
A & B; % C1: &I on H2 and H3
C; ]; % C2: =>E on H1 and C1
B => C ]; % C3: =>I on H3..C2
A => B => C ]; % C4: =>I on H2..C3
((A & B) => C) => A => B => C; % C5: =>I on H1..C4
end;
proof example3 : ((A & B) & C) => (A & (B & C)) =
begin
[ (A & B) & C; % H1
A & B; % C1: &E1 on H1
A; % C2: &E1 on C1
B; % C3: &E2 on C2
C; % C4: &E2 on H1
B & C; % C5: &I on C3 and C4
A & (B & C) ]; % C5: &I on C2 and C5
((A & B) & C) => (A & (B & C)); % C6: =>I on H1..C5
end;
proof example4 : (A => (B & C)) => ((A => B) & (A => C)) =
begin
[ A => (B & C); % H1
[ A; % H2
B & C; % C1: =>E on H1 and H2
B ]; % C2: &E1 on C1
A => B; % C3: =>I on H2..C2
[ A; % H3
B & C; % C4: =>E on H1 and H3
C ]; % C5: &E2 on C4
A => C; % C6: =>I on H3..C5
(A => B) & (A => C) ] ; % C7: &I on C3 and C6
(A => (B & C)) => ((A => B) & (A => C)); % C8: =>I on H1..C7
end;