MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  sadval Structured version   Visualization version   GIF version

Theorem sadval 16619
Description: The full adder sequence is the half adder function applied to the inputs and the carry sequence. (Contributed by Mario Carneiro, 5-Sep-2016.)
Hypotheses
Ref Expression
sadval.a (𝜑 → 𝐴 ⊆ ℕ0)
sadval.b (𝜑 → 𝐵 ⊆ ℕ0)
sadval.c 𝐶 = seq0((𝑐 ∈ 2o, 𝑚 ∈ ℕ0 ↦ if(cadd(𝑚 ∈ 𝐴, 𝑚 ∈ 𝐵, ∅ ∈ 𝑐), 1o, ∅)), (𝑛 ∈ ℕ0 ↦ if(𝑛 = 0, ∅, (𝑛 − 1))))
sadcp1.n (𝜑 → 𝑁 ∈ ℕ0)
Assertion
Ref Expression
sadval (𝜑 → (𝑁 ∈ (𝐴 sadd 𝐵) ↔ hadd(𝑁 ∈ 𝐴, 𝑁 ∈ 𝐵, ∅ ∈ (𝐶‘𝑁))))
Distinct variable groups:   𝑚,𝑐,𝑛   𝐴,𝑐,𝑚   𝐵,𝑐,𝑚   𝑛,𝑁
Allowed substitution hints:   𝜑(𝑚, 𝑛, 𝑐)   𝐴(𝑛)   𝐵(𝑛)   𝐶(𝑚, 𝑛, 𝑐)   𝑁(𝑚, 𝑐)

Proof of Theorem sadval
Dummy variable 𝑘 is distinct from all other variables.
StepHypRef Expression
1 sadval.a . . . 4 (𝜑 → 𝐴 ⊆ ℕ0)
2 sadval.b . . . 4 (𝜑 → 𝐵 ⊆ ℕ0)
3 sadval.c . . . 4 𝐶 = seq0((𝑐 ∈ 2o, 𝑚 ∈ ℕ0 ↦ if(cadd(𝑚 ∈ 𝐴, 𝑚 ∈ 𝐵, ∅ ∈ 𝑐), 1o, ∅)), (𝑛 ∈ ℕ0 ↦ if(𝑛 = 0, ∅, (𝑛 − 1))))
41, 2, 3sadfval 16615 . . 3 (𝜑 → (𝐴 sadd 𝐵) = {𝑘 ∈ ℕ0 ∣ hadd(𝑘 ∈ 𝐴, 𝑘 ∈ 𝐵, ∅ ∈ (𝐶‘𝑘))})
54eleq2d 2847 . 2 (𝜑 → (𝑁 ∈ (𝐴 sadd 𝐵) ↔ 𝑁 ∈ {𝑘 ∈ ℕ0 ∣ hadd(𝑘 ∈ 𝐴, 𝑘 ∈ 𝐵, ∅ ∈ (𝐶‘𝑘))}))
6 sadcp1.n . . 3 (𝜑 → 𝑁 ∈ ℕ0)
7 eleq1 2849 . . . . 5 (𝑘 = 𝑁 → (𝑘 ∈ 𝐴 ↔ 𝑁 ∈ 𝐴))
8 eleq1 2849 . . . . 5 (𝑘 = 𝑁 → (𝑘 ∈ 𝐵 ↔ 𝑁 ∈ 𝐵))
9 fveq2 6883 . . . . . 6 (𝑘 = 𝑁 → (𝐶‘𝑘) = (𝐶‘𝑁))
109eleq2d 2847 . . . . 5 (𝑘 = 𝑁 → (∅ ∈ (𝐶‘𝑘) ↔ ∅ ∈ (𝐶‘𝑁)))
117, 8, 10hadbi123d 1625 . . . 4 (𝑘 = 𝑁 → (hadd(𝑘 ∈ 𝐴, 𝑘 ∈ 𝐵, ∅ ∈ (𝐶‘𝑘)) ↔ hadd(𝑁 ∈ 𝐴, 𝑁 ∈ 𝐵, ∅ ∈ (𝐶‘𝑁))))
1211elrab3 3646 . . 3 (𝑁 ∈ ℕ0 → (𝑁 ∈ {𝑘 ∈ ℕ0 ∣ hadd(𝑘 ∈ 𝐴, 𝑘 ∈ 𝐵, ∅ ∈ (𝐶‘𝑘))} ↔ hadd(𝑁 ∈ 𝐴, 𝑁 ∈ 𝐵, ∅ ∈ (𝐶‘𝑁))))
136, 12syl 18 . 2 (𝜑 → (𝑁 ∈ {𝑘 ∈ ℕ0 ∣ hadd(𝑘 ∈ 𝐴, 𝑘 ∈ 𝐵, ∅ ∈ (𝐶‘𝑘))} ↔ hadd(𝑁 ∈ 𝐴, 𝑁 ∈ 𝐵, ∅ ∈ (𝐶‘𝑁))))
145, 13bitrd 282 1 (𝜑 → (𝑁 ∈ (𝐴 sadd 𝐵) ↔ hadd(𝑁 ∈ 𝐴, 𝑁 ∈ 𝐵, ∅ ∈ (𝐶‘𝑁))))
Colors of variables:    wff setvar class
This proof depends on syntax axioms:   → wi 4   ↔ wb 209   = wceq 1570  haddwhad 1623  caddwcad 1639   ∈ wcel 2145  {crab 3413   ⊆ wss 3899  ∅c0 4279  ifcif 4482   ↦ cmpt 5186  ‘cfv 6537  (class class class)co 7418   ∈ cmpo 7420  1oc1o 8462  2oc2o 8463  0cc0 11193  1c1 11194   − cmin 11534  ℕ0cn0 12599  seqcseq 14137   sadd csad 16583
This proof depends on axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1828  ax-4 1842  ax-5 1943  ax-6 2000  ax-7 2041  ax-8 2147  ax-9 2155  ax-10 2178  ax-11 2194  ax-12 2213  ax-ext 2733  ax-sep 5249  ax-nul 5260  ax-pr 5391  ax-un 7749  ax-cnex 11249  ax-1cn 11251  ax-addcl 11253
This proof depends on definitions:  df-bi 210  df-an 402  df-or 862  df-3or 1104  df-3an 1105  df-xor 1542  df-tru 1573  df-fal 1583  df-had 1624  df-cad 1640  df-ex 1813  df-nf 1817  df-sb 2100  df-mo 2565  df-eu 2595  df-clab 2740  df-cleq 2753  df-clel 2836  df-nfc 2910  df-ne 2957  df-ral 3078  df-rex 3088  df-reu 3367  df-rab 3414  df-v 3453  df-sbc 3740  df-csb 3848  df-dif 3902  df-un 3904  df-in 3906  df-ss 3916  df-pss 3919  df-nul 4280  df-if 4483  df-pw 4559  df-sn 4585  df-pr 4587  df-op 4591  df-uni 4868  df-iun 4953  df-br 5104  df-opab 5168  df-mpt 5187  df-tr 5213  df-id 5546  df-eprel 5551  df-po 5559  df-so 5560  df-fr 5604  df-we 5606  df-xp 5657  df-rel 5658  df-cnv 5659  df-co 5660  df-dm 5661  df-rn 5662  df-res 5663  df-ima 5664  df-pred 6303  df-ord 6364  df-on 6365  df-lim 6366  df-suc 6367  df-iota 6493  df-fun 6539  df-fn 6540  df-f 6541  df-f1 6542  df-fo 6543  df-f1o 6544  df-fv 6545  df-ov 7421  df-oprab 7422  df-mpo 7423  df-om 7876  df-2nd 8000  df-frecs 8292  df-wrecs 8323  df-recs 8372  df-rdg 8411  df-nn 12329  df-n0 12600  df-seq 14138  df-sad 16614
This theorem is used by:  sadadd2lem  16622  saddisjlem  16627
  Copyright terms: Public domain W3C validator