Metamath Proof Explorer


Theorem had0

Description: If the first input is false, then the adder sum is equivalent to the exclusive disjunction of the other two inputs, and conversely. (Contributed by Mario Carneiro, 4-Sep-2016) (Proof shortened by Wolf Lammen, 12-Jul-2020) Strengthen to a biconditional. (Revised by BJ, 10-Aug-2026)

Ref Expression
Assertion had0
|- ( -. ph <-> ( hadd ( ph , ps , ch ) <-> ( ps \/_ ch ) ) )

Proof

Step Hyp Ref Expression
1 hadrot
 |-  ( hadd ( ph , ps , ch ) <-> hadd ( ps , ch , ph ) )
2 df-had
 |-  ( hadd ( ps , ch , ph ) <-> ( ( ps \/_ ch ) \/_ ph ) )
3 df-xor
 |-  ( ( ( ps \/_ ch ) \/_ ph ) <-> -. ( ( ps \/_ ch ) <-> ph ) )
4 xor3
 |-  ( -. ( ( ps \/_ ch ) <-> ph ) <-> ( ( ps \/_ ch ) <-> -. ph ) )
5 3 4 bitri
 |-  ( ( ( ps \/_ ch ) \/_ ph ) <-> ( ( ps \/_ ch ) <-> -. ph ) )
6 2 5 bitri
 |-  ( hadd ( ps , ch , ph ) <-> ( ( ps \/_ ch ) <-> -. ph ) )
7 1 6 bitri
 |-  ( hadd ( ph , ps , ch ) <-> ( ( ps \/_ ch ) <-> -. ph ) )
8 biass
 |-  ( ( ( hadd ( ph , ps , ch ) <-> ( ps \/_ ch ) ) <-> -. ph ) <-> ( hadd ( ph , ps , ch ) <-> ( ( ps \/_ ch ) <-> -. ph ) ) )
9 7 8 mpbir
 |-  ( ( hadd ( ph , ps , ch ) <-> ( ps \/_ ch ) ) <-> -. ph )
10 9 bicomi
 |-  ( -. ph <-> ( hadd ( ph , ps , ch ) <-> ( ps \/_ ch ) ) )