% Double-negation translations and their proofs
% 1) (P | ~P)* = ~~(P* | ~(P*))
% = ~~(~~P | ~(~~P))
% However, we can prove
% ~~(A | ~A)
% for an arbitrary atomic proposition A, not just
% a double-negated atom. This is easier to read,
% and covers the case for a double-negated atom
% by substituting ~P for A.
proof lem : ~~(A | ~A) = begin
[ ~(A | ~A);
[ A;
A | ~A;
F ];
~A;
A | ~A;
F ];
~~(A | ~ A)
end;
% 2) (((P => Q) => P) => P)* = ((P* => Q*) => P*) => P*
% = ((~~P => Q*) => ~~P) => ~~P
% = ((~~P => ~~Q) => ~~P) => ~~P
% Again, we'll leave Q arbitrary:
proof peircelaw :((~~P => Q) => ~~P) => ~~P = begin
[ ((~~P => Q) => ~~P);
[~P;
[~~P;
F;
Q];
~~P => Q;
~~P;
F];
~~P];
((~~P => Q) => ~~P) => ~~P;
end;
% 3) (~(P & Q) => (~P | ~Q))* = (~(P* & Q*) => ~~(~(P*) | ~(Q*)))
% = (~(~~P & ~~Q) => ~~(~(~~P) | ~(~~Q)))
% But again we can prove the first line for arbitrary P and Q,
% which gives the result for double-negated atoms by substitution.
proof demorgan4 : ~(A & B) => ~~(~A | ~B) =
begin
[~(A & B);
[~(~A | ~B);
[A;
[B;
A & B;
F];
~B;
~A | ~B;
F];
~A;
~A | ~B;
F];
~~(~A | ~B)];
~(A & B) => ~~(~A | ~B);
end;
% 4) ((P => Q) => (~P | Q))* = ((P* => Q*) => ~~(~(P*) | (Q*)))
% = ((~~P => ~~Q) => ~~(~(~~P) | (~~Q)))
proof io : ((P => Q) => ~~(~P | Q)) =
begin
[(P => Q);
[~(~P | Q);
[P;
Q;
~P | Q;
F];
~P;
~P | Q;
F];
~~(~P | Q)];
((P => Q) => ~~(~P | Q));
end;
% 5) ( (P => (Q | R)) => ((P => Q) | (P => R)) )*
% = (P* => ~~(Q* | R*)) => ~~((P* => Q*) | (P* => R*))
% = (~~P => ~~(~~Q | ~~R)) => ~~((~~P => ~~Q) | (~~P => ~~R))
proof dist : (P => ~~(Q | R)) => ~~((P => Q) | (P => R)) =
begin
[(P => ~~(Q | R));
[~((P => Q) | (P => R));
[P;
~~(Q | R);
[Q | R;
[Q;
[P;
Q];
P => Q;
((P => Q) | (P => R));
F];
[R;
[P;
R];
P => R;
((P => Q) | (P => R));
F];
F];
~(Q | R);
F;
Q];
(P => Q);
((P => Q) | (P => R));
F];
~~((P => Q) | (P => R))];
(P => ~~(Q | R)) => ~~((P => Q) | (P => R));
end;
% 6) ((P => Q) | (Q => P))*
% = ~~ ((P* => Q*) | (Q* => P*))
% = ~~ ((~~P => ~~Q) | (~~Q => ~~P))
proof onewayortheother : ~~ ((P => Q) | (Q => P)) =
begin
[~ ((P => Q) | (Q => P));
[P;
[Q;
P];
Q => P;
((P => Q) | (Q => P));
F;
Q];
(P => Q);
((P => Q) | (Q => P));
F];
~~ ((P => Q) | (Q => P));
end;