Metamath Proof Explorer


Theorem deccarry

Description: Add 1 to a 2 digit number with carry. This is a special case of decsucc , but in closed form. As observed by ML, this theorem allows for carrying the 1 down multiple decimal constructors, so we can carry the 1 multiple times down a multi-digit number, e.g., by applying this theorem three times we get ( ; ; 9 9 9 + 1 ) = ; ; ; 1 0 0 0 . (Contributed by AV, 4-Aug-2020) (Revised by ML, 8-Aug-2020) (Proof shortened by AV, 10-Sep-2021)

Ref Expression
Assertion deccarry ( 𝐴 ∈ ℕ → ( 𝐴 9 + 1 ) = ( 𝐴 + 1 ) 0 )

Proof

Step Hyp Ref Expression
1 df-dec ( 𝐴 + 1 ) 0 = ( ( ( 9 + 1 ) · ( 𝐴 + 1 ) ) + 0 )
2 9nn 9 ∈ ℕ
3 peano2nn ( 9 ∈ ℕ → ( 9 + 1 ) ∈ ℕ )
4 2 3 ax-mp ( 9 + 1 ) ∈ ℕ
5 4 a1i ( 𝐴 ∈ ℕ → ( 9 + 1 ) ∈ ℕ )
6 peano2nn ( 𝐴 ∈ ℕ → ( 𝐴 + 1 ) ∈ ℕ )
7 5 6 nnmulcld ( 𝐴 ∈ ℕ → ( ( 9 + 1 ) · ( 𝐴 + 1 ) ) ∈ ℕ )
8 7 nncnd ( 𝐴 ∈ ℕ → ( ( 9 + 1 ) · ( 𝐴 + 1 ) ) ∈ ℂ )
9 8 addid1d ( 𝐴 ∈ ℕ → ( ( ( 9 + 1 ) · ( 𝐴 + 1 ) ) + 0 ) = ( ( 9 + 1 ) · ( 𝐴 + 1 ) ) )
10 4 nncni ( 9 + 1 ) ∈ ℂ
11 10 a1i ( 𝐴 ∈ ℕ → ( 9 + 1 ) ∈ ℂ )
12 nncn ( 𝐴 ∈ ℕ → 𝐴 ∈ ℂ )
13 1cnd ( 𝐴 ∈ ℕ → 1 ∈ ℂ )
14 11 12 13 adddid ( 𝐴 ∈ ℕ → ( ( 9 + 1 ) · ( 𝐴 + 1 ) ) = ( ( ( 9 + 1 ) · 𝐴 ) + ( ( 9 + 1 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