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

Theorem sadval 14108
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  |-  ( ph  ->  A  C_  NN0 )
sadval.b  |-  ( ph  ->  B  C_  NN0 )
sadval.c  |-  C  =  seq 0 ( ( c  e.  2o ,  m  e.  NN0  |->  if (cadd ( m  e.  A ,  m  e.  B ,  (/)  e.  c ) ,  1o ,  (/) ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  - 
1 ) ) ) )
sadcp1.n  |-  ( ph  ->  N  e.  NN0 )
Assertion
Ref Expression
sadval  |-  ( ph  ->  ( N  e.  ( A sadd  B )  <-> hadd ( N  e.  A ,  N  e.  B ,  (/)  e.  ( C `  N ) ) ) )
Distinct variable groups:    m, c, n    A, c, m    B, c, m    n, N
Allowed substitution hints:    ph( m, n, c)    A( n)    B( n)    C( m, n, c)    N( m, c)

Proof of Theorem sadval
Dummy variable  k is distinct from all other variables.
StepHypRef Expression
1 sadval.a . . . 4  |-  ( ph  ->  A  C_  NN0 )
2 sadval.b . . . 4  |-  ( ph  ->  B  C_  NN0 )
3 sadval.c . . . 4  |-  C  =  seq 0 ( ( c  e.  2o ,  m  e.  NN0  |->  if (cadd ( m  e.  A ,  m  e.  B ,  (/)  e.  c ) ,  1o ,  (/) ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  - 
1 ) ) ) )
41, 2, 3sadfval 14104 . . 3  |-  ( ph  ->  ( A sadd  B )  =  { k  e. 
NN0  | hadd ( k  e.  A ,  k  e.  B ,  (/)  e.  ( C `  k ) ) } )
54eleq2d 2452 . 2  |-  ( ph  ->  ( N  e.  ( A sadd  B )  <->  N  e.  { k  e.  NN0  | hadd ( k  e.  A ,  k  e.  B ,  (/)  e.  ( C `
 k ) ) } ) )
6 sadcp1.n . . 3  |-  ( ph  ->  N  e.  NN0 )
7 eleq1 2454 . . . . 5  |-  ( k  =  N  ->  (
k  e.  A  <->  N  e.  A ) )
8 eleq1 2454 . . . . 5  |-  ( k  =  N  ->  (
k  e.  B  <->  N  e.  B ) )
9 fveq2 5774 . . . . . 6  |-  ( k  =  N  ->  ( C `  k )  =  ( C `  N ) )
109eleq2d 2452 . . . . 5  |-  ( k  =  N  ->  ( (/) 
e.  ( C `  k )  <->  (/)  e.  ( C `  N ) ) )
117, 8, 10hadbi123d 1456 . . . 4  |-  ( k  =  N  ->  (hadd ( k  e.  A ,  k  e.  B ,  (/)  e.  ( C `
 k ) )  <-> hadd ( N  e.  A ,  N  e.  B ,  (/)  e.  ( C `
 N ) ) ) )
1211elrab3 3183 . . 3  |-  ( N  e.  NN0  ->  ( N  e.  { k  e. 
NN0  | hadd ( k  e.  A ,  k  e.  B ,  (/)  e.  ( C `  k ) ) }  <-> hadd ( N  e.  A ,  N  e.  B ,  (/)  e.  ( C `  N ) ) ) )
136, 12syl 16 . 2  |-  ( ph  ->  ( N  e.  {
k  e.  NN0  | hadd ( k  e.  A ,  k  e.  B ,  (/)  e.  ( C `
 k ) ) }  <-> hadd ( N  e.  A ,  N  e.  B ,  (/)  e.  ( C `
 N ) ) ) )
145, 13bitrd 253 1  |-  ( ph  ->  ( N  e.  ( A sadd  B )  <-> hadd ( N  e.  A ,  N  e.  B ,  (/)  e.  ( C `  N ) ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    = wceq 1399  haddwhad 1452  caddwcad 1453    e. wcel 1826   {crab 2736    C_ wss 3389   (/)c0 3711   ifcif 3857    |-> cmpt 4425   ` cfv 5496  (class class class)co 6196    |-> cmpt2 6198   1oc1o 7041   2oc2o 7042   0cc0 9403   1c1 9404    - cmin 9718   NN0cn0 10712    seqcseq 12010   sadd csad 14072
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1626  ax-4 1639  ax-5 1712  ax-6 1755  ax-7 1798  ax-8 1828  ax-9 1830  ax-10 1845  ax-11 1850  ax-12 1862  ax-13 2006  ax-ext 2360  ax-sep 4488  ax-nul 4496  ax-pow 4543  ax-pr 4601  ax-un 6491  ax-cnex 9459  ax-resscn 9460  ax-1cn 9461  ax-icn 9462  ax-addcl 9463  ax-addrcl 9464  ax-mulcl 9465  ax-mulrcl 9466  ax-i2m1 9471  ax-1ne0 9472  ax-rrecex 9475  ax-cnre 9476
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 972  df-3an 973  df-xor 1363  df-tru 1402  df-had 1454  df-cad 1455  df-ex 1621  df-nf 1625  df-sb 1748  df-eu 2222  df-mo 2223  df-clab 2368  df-cleq 2374  df-clel 2377  df-nfc 2532  df-ne 2579  df-ral 2737  df-rex 2738  df-reu 2739  df-rab 2741  df-v 3036  df-sbc 3253  df-csb 3349  df-dif 3392  df-un 3394  df-in 3396  df-ss 3403  df-pss 3405  df-nul 3712  df-if 3858  df-pw 3929  df-sn 3945  df-pr 3947  df-tp 3949  df-op 3951  df-uni 4164  df-iun 4245  df-br 4368  df-opab 4426  df-mpt 4427  df-tr 4461  df-eprel 4705  df-id 4709  df-po 4714  df-so 4715  df-fr 4752  df-we 4754  df-ord 4795  df-on 4796  df-lim 4797  df-suc 4798  df-xp 4919  df-rel 4920  df-cnv 4921  df-co 4922  df-dm 4923  df-rn 4924  df-res 4925  df-ima 4926  df-iota 5460  df-fun 5498  df-fn 5499  df-f 5500  df-f1 5501  df-fo 5502  df-f1o 5503  df-fv 5504  df-ov 6199  df-oprab 6200  df-mpt2 6201  df-om 6600  df-recs 6960  df-rdg 6994  df-nn 10453  df-n0 10713  df-seq 12011  df-sad 14103
This theorem is referenced by:  sadadd2lem  14111  saddisjlem  14116
  Copyright terms: Public domain W3C validator