Metamath Proof Explorer


Theorem cador

Description: The adder carry in disjunctive normal form. (Contributed by Mario Carneiro, 4-Sep-2016) (Proof shortened by Wolf Lammen, 11-Jul-2020)

Ref Expression
Assertion cador ( cadd ( 𝜑 , 𝜓 , 𝜒 ) ↔ ( ( 𝜑𝜓 ) ∨ ( 𝜑𝜒 ) ∨ ( 𝜓𝜒 ) ) )

Proof

Step Hyp Ref Expression
1 xor2 ( ( 𝜑𝜓 ) ↔ ( ( 𝜑𝜓 ) ∧ ¬ ( 𝜑𝜓 ) ) )
2 1 rbaib ( ¬ ( 𝜑𝜓 ) → ( ( 𝜑𝜓 ) ↔ ( 𝜑𝜓 ) ) )
3 2 anbi1d ( ¬ ( 𝜑𝜓 ) → ( ( ( 𝜑𝜓 ) ∧ 𝜒 ) ↔ ( ( 𝜑𝜓 ) ∧ 𝜒 ) ) )
4 ancom ( ( ( 𝜑𝜓 ) ∧ 𝜒 ) ↔ ( 𝜒 ∧ ( 𝜑𝜓 ) ) )
5 andir ( ( ( 𝜑𝜓 ) ∧ 𝜒 ) ↔ ( ( 𝜑𝜒 ) ∨ ( 𝜓𝜒 ) ) )
6 3 4 5 3bitr3g ( ¬ ( 𝜑𝜓 ) → ( ( 𝜒 ∧ ( 𝜑𝜓 ) ) ↔ ( ( 𝜑𝜒 ) ∨ ( 𝜓𝜒 ) ) ) )
7 6 pm5.74i ( ( ¬ ( 𝜑𝜓 ) → ( 𝜒 ∧ ( 𝜑𝜓 ) ) ) ↔ ( ¬ ( 𝜑𝜓 ) → ( ( 𝜑𝜒 ) ∨ ( 𝜓𝜒 ) ) ) )
8 df-or ( ( ( 𝜑𝜓 ) ∨ ( 𝜒 ∧ ( 𝜑𝜓 ) ) ) ↔ ( ¬ ( 𝜑𝜓 ) → ( 𝜒 ∧ ( 𝜑𝜓 ) ) ) )
9 df-or ( ( ( 𝜑𝜓 ) ∨ ( ( 𝜑𝜒 ) ∨ ( 𝜓𝜒 ) ) ) ↔ ( ¬ ( 𝜑𝜓 ) → ( ( 𝜑𝜒 ) ∨ ( 𝜓𝜒 ) ) ) )
10 7 8 9 3bitr4i ( ( ( 𝜑𝜓 ) ∨ ( 𝜒 ∧ ( 𝜑𝜓 ) ) ) ↔ ( ( 𝜑𝜓 ) ∨ ( ( 𝜑𝜒 ) ∨ ( 𝜓𝜒 ) ) ) )
11 df-cad ( cadd ( 𝜑 , 𝜓 , 𝜒 ) ↔ ( ( 𝜑𝜓 ) ∨ ( 𝜒 ∧ ( 𝜑𝜓 ) ) ) )
12 3orass ( ( ( 𝜑𝜓 ) ∨ ( 𝜑𝜒 ) ∨ ( 𝜓𝜒 ) ) ↔ ( ( 𝜑𝜓 ) ∨ ( ( 𝜑𝜒 ) ∨ ( 𝜓𝜒 ) ) ) )
13 10 11 12 3bitr4i ( cadd ( 𝜑 , 𝜓 , 𝜒 ) ↔ ( ( 𝜑𝜓 ) ∨ ( 𝜑𝜒 ) ∨ ( 𝜓𝜒 ) ) )