Metamath Proof Explorer


Theorem hashrepr

Description: Develop the number of representations of an integer M as a sum of nonnegative integers in set A . (Contributed by Thierry Arnoux, 14-Dec-2021)

Ref Expression
Hypotheses hashrepr.a ⊢ φ → A ⊆ ℕ
hashrepr.m ⊢ φ → M ∈ ℕ 0
hashrepr.s ⊢ φ → S ∈ ℕ 0
Assertion hashrepr ⊢ φ → A repr ⁡ S M = ∑ c ∈ ℕ repr ⁡ S M ∏ a ∈ 0 ..^ S 𝟙 ℕ ⁡ A ⁡ c ⁡ a

Proof

Step Hyp Ref Expression
1 hashrepr.a ⊢ φ → A ⊆ ℕ
2 hashrepr.m ⊢ φ → M ∈ ℕ 0
3 hashrepr.s ⊢ φ → S ∈ ℕ 0
4 2 nn0zd ⊢ φ → M ∈ ℤ
5 fzfid ⊢ φ → 1 … M ∈ Fin
6 fz1ssnn ⊢ 1 … M ⊆ ℕ
7 6 a1i ⊢ φ → 1 … M ⊆ ℕ
8 1 4 3 5 7 hashreprin ⊢ φ → A ∩ 1 … M repr ⁡ S M = ∑ c ∈ 1 … M repr ⁡ S M ∏ a ∈ 0 ..^ S 𝟙 ℕ ⁡ A ⁡ c ⁡ a
9 2 3 1 reprinfz1 ⊢ φ → A repr ⁡ S M = A ∩ 1 … M repr ⁡ S M
10 9 fveq2d ⊢ φ → A repr ⁡ S M = A ∩ 1 … M repr ⁡ S M
11 2 3 reprfz1 ⊢ φ → ℕ repr ⁡ S M = 1 … M repr ⁡ S M
12 11 sumeq1d ⊢ φ → ∑ c ∈ ℕ repr ⁡ S M ∏ a ∈ 0 ..^ S 𝟙 ℕ ⁡ A ⁡ c ⁡ a = ∑ c ∈ 1 … M repr ⁡ S M ∏ a ∈ 0 ..^ S 𝟙 ℕ ⁡ A ⁡ c ⁡ a
13 8 10 12 3eqtr4d ⊢ φ → A repr ⁡ S M = ∑ c ∈ ℕ repr ⁡ S M ∏ a ∈ 0 ..^ S 𝟙 ℕ ⁡ A ⁡ c ⁡ a