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

Theorem sadval 16670
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 16666 . . 3 (𝜑 → (𝐴 sadd 𝐵) = {𝑘 ∈ ℕ0 ∣ hadd(𝑘 ∈ 𝐴, 𝑘 ∈ 𝐵, ∅ ∈ (𝐶‘𝑘))})
54eleq2d 2850 . 2 (𝜑 → (𝑁 ∈ (𝐴 sadd 𝐵) ↔ 𝑁 ∈ {𝑘 ∈ ℕ0 ∣ hadd(𝑘 ∈ 𝐴, 𝑘 ∈ 𝐵, ∅ ∈ (𝐶‘𝑘))}))
6 sadcp1.n . . 3 (𝜑 → 𝑁 ∈ ℕ0)
7 eleq1 2852 . . . . 5 (𝑘 = 𝑁 → (𝑘 ∈ 𝐴 ↔ 𝑁 ∈ 𝐴))
8 eleq1 2852 . . . . 5 (𝑘 = 𝑁 → (𝑘 ∈ 𝐵 ↔ 𝑁 ∈ 𝐵))
9 fveq2 6916 . . . . . 6 (𝑘 = 𝑁 → (𝐶‘𝑘) = (𝐶‘𝑁))
109eleq2d 2850 . . . . 5 (𝑘 = 𝑁 → (∅ ∈ (𝐶‘𝑘) ↔ ∅ ∈ (𝐶‘𝑁)))
117, 8, 10hadbi123d 1625 . . . 4 (𝑘 = 𝑁 → (hadd(𝑘 ∈ 𝐴, 𝑘 ∈ 𝐵, ∅ ∈ (𝐶‘𝑘)) ↔ hadd(𝑁 ∈ 𝐴, 𝑁 ∈ 𝐵, ∅ ∈ (𝐶‘𝑁))))
1211elrab3 3649 . . 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 2147  {crab 3416   ⊆ wss 3900  ∅c0 4281  ifcif 4485   ↦ cmpt 5192  ‘cfv 6566  (class class class)co 7451   ∈ cmpo 7453  1oc1o 8507  2oc2o 8508  0cc0 11239  1c1 11240   − cmin 11580  ℕ0cn0 12646  seqcseq 14184   sadd csad 16634
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 1945  ax-6 2002  ax-7 2043  ax-8 2149  ax-9 2157  ax-10 2180  ax-11 2197  ax-12 2216  ax-ext 2735  ax-sep 5255  ax-nul 5266  ax-pr 5398  ax-un 7783  ax-cnex 11295  ax-1cn 11297  ax-addcl 11299
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 2102  df-mo 2567  df-eu 2597  df-clab 2742  df-cleq 2755  df-clel 2839  df-nfc 2913  df-ne 2960  df-ral 3081  df-rex 3091  df-reu 3370  df-rab 3417  df-v 3456  df-sbc 3743  df-csb 3852  df-ss 3901  df-pss 4017  df-dif 4050  df-in 4094  df-un 4154  df-nul 4282  df-if 4486  df-pw 4562  df-sn 4589  df-pr 4591  df-op 4841  df-uni 4873  df-iun 4958  df-br 5109  df-opab 5174  df-mpt 5193  df-tr 5219  df-id 5553  df-eprel 5558  df-po 5566  df-so 5567  df-fr 5611  df-we 5613  df-xp 5664  df-rel 5665  df-cnv 5666  df-co 5667  df-dm 5668  df-rn 5669  df-res 5670  df-ima 5671  df-pred 6330  df-ord 6391  df-on 6392  df-lim 6393  df-suc 6394  df-iota 6520  df-fun 6568  df-fn 6569  df-f 6570  df-f1 6571  df-fo 6572  df-f1o 6573  df-fv 6574  df-ov 7454  df-oprab 7455  df-mpo 7456  df-om 7912  df-2nd 8036  df-frecs 8337  df-wrecs 8368  df-recs 8417  df-rdg 8456  df-nn 12376  df-n0 12647  df-seq 14185  df-sad 16665
This theorem is used by:  sadadd2lem  16673  saddisjlem  16678
  Copyright terms: Public domain W3C validator