Metamath Proof Explorer


Theorem nn0mulfsum

Description: Trivial algorithm to calculate the product of two nonnegative integers a and b by adding b to itself a times. (Contributed by AV, 17-May-2020)

Ref Expression
Assertion nn0mulfsum A 0 B 0 A B = k = 1 A B

Proof

Step Hyp Ref Expression
1 fzfid A 0 1 A Fin
2 nn0cn B 0 B
3 fsumconst 1 A Fin B k = 1 A B = 1 A B
4 1 2 3 syl2an A 0 B 0 k = 1 A B = 1 A B
5 hashfz1 A 0 1 A = A
6 5 adantr A 0 B 0 1 A = A
7 6 oveq1d A 0 B 0 1 A B = A B
8 4 7 eqtr2d A 0 B 0 A B = k = 1 A B