Rudolf Adamkovič Personal site


Proof

By the definitions of equivalence and implication,

\[\begin{align*}
  & \lnot (P \land Q) \iff \lnot P \lor \lnot Q
  \\[1ex]
  & \quad \equiv ((\lnot (P \land Q) ) \implies (\lnot P \lor \lnot Q))
  \land ((\lnot P \lor \lnot Q ) \implies (\lnot (P \land Q)))
  \\[1ex]
  & \quad \equiv (\lnot ( \lnot (P \land Q)) \lor (\lnot P \lor \lnot Q))
  \land (\lnot (\lnot P \lor \lnot Q) \lor (\lnot (P \land Q)))
  \\[2ex]
  & \lnot (P \lor Q) \iff \lnot P \land \lnot Q
  \\[1ex]
  & \quad \equiv ((\lnot (P \lor Q)) \implies (\lnot P \land \lnot Q))
  \land ((\lnot P \land \lnot Q) \implies (\lnot (P \lor Q)))
  \\[1ex]
  & \quad \equiv (\lnot (\lnot (P \lor Q)) \lor (\lnot P \land \lnot Q))
  \land (\lnot (\lnot P \land \lnot Q) \lor (\lnot (P \lor Q))),
\end{align*}
\]

and those are tautologies, per

(define (boolean-product length)
  "Return a list of all Boolean sequences of LENGTH."
  (let more-rows ((row (- (expt 2 length) 1)))
    (if (< row 0) (list)
        (cons (let more-columns ((column (- length 1)))
                (if (< column 0) (list)
                    (cons (even? (quotient row (expt 2 column)))
                          (more-columns (- column 1)))))
              (more-rows (- row 1))))))
(define (truth-table procedure arity)
  "Return a truth table for PROCEDURE with ARITY."
  (map (lambda (inputs)
         (append inputs (list (apply procedure inputs))))
       (boolean-product arity)))

(define (tautology? procedure arity)
  (not (member #f (map (lambda (row)
                         (car (reverse row)))
                       (truth-table procedure arity)))))
(and (tautology? (lambda (p q)
                   (and (or (not (not (and p q)))
                            (or (not p) (not q)))
                        (or (not (or (not p) (not q)))
                            (not (and p q)))))
                 2)
     (tautology? (lambda (p q)
                   (and (or (not (not (or p q)))
                            (and (not p) (not q)))
                        (or (not (and (not p) (not q)))
                            (not (or p q)))))
                 2))
#t

so De Morgan’s laws are always ‘true’. \(\blacksquare\)


© 2025 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and secret alien technologies of yesteryear.