Metamath Proof Explorer


Theorem sticksstones15

Description: Sticks and stones with almost collapsed definitions for positive integers. (Contributed by metakunt, 7-Oct-2024)

Ref Expression
Hypotheses sticksstones15.1 ( 𝜑𝑁 ∈ ℕ0 )
sticksstones15.2 ( 𝜑𝐾 ∈ ℕ0 )
sticksstones15.3 𝐴 = { 𝑔 ∣ ( 𝑔 : ( 1 ... ( 𝐾 + 1 ) ) ⟶ ℕ0 ∧ Σ 𝑖 ∈ ( 1 ... ( 𝐾 + 1 ) ) ( 𝑔𝑖 ) = 𝑁 ) }
Assertion sticksstones15 ( 𝜑 → ( ♯ ‘ 𝐴 ) = ( ( 𝑁 + 𝐾 ) C 𝐾 ) )

Proof

Step Hyp Ref Expression
1 sticksstones15.1 ( 𝜑𝑁 ∈ ℕ0 )
2 sticksstones15.2 ( 𝜑𝐾 ∈ ℕ0 )
3 sticksstones15.3 𝐴 = { 𝑔 ∣ ( 𝑔 : ( 1 ... ( 𝐾 + 1 ) ) ⟶ ℕ0 ∧ Σ 𝑖 ∈ ( 1 ... ( 𝐾 + 1 ) ) ( 𝑔𝑖 ) = 𝑁 ) }
4 eqid ( 𝑣𝐴 ↦ ( 𝑧 ∈ ( 1 ... 𝐾 ) ↦ ( 𝑧 + Σ 𝑡 ∈ ( 1 ... 𝑧 ) ( 𝑣𝑡 ) ) ) ) = ( 𝑣𝐴 ↦ ( 𝑧 ∈ ( 1 ... 𝐾 ) ↦ ( 𝑧 + Σ 𝑡 ∈ ( 1 ... 𝑧 ) ( 𝑣𝑡 ) ) ) )
5 eqid ( 𝑢 ∈ { 𝑙 ∣ ( 𝑙 : ( 1 ... 𝐾 ) ⟶ ( 1 ... ( 𝑁 + 𝐾 ) ) ∧ ∀ 𝑥 ∈ ( 1 ... 𝐾 ) ∀ 𝑦 ∈ ( 1 ... 𝐾 ) ( 𝑥 < 𝑦 → ( 𝑙𝑥 ) < ( 𝑙𝑦 ) ) ) } ↦ if ( 𝐾 = 0 , { ⟨ 1 , 𝑁 ⟩ } , ( 𝑤 ∈ ( 1 ... ( 𝐾 + 1 ) ) ↦ if ( 𝑤 = ( 𝐾 + 1 ) , ( ( 𝑁 + 𝐾 ) − ( 𝑢𝐾 ) ) , if ( 𝑤 = 1 , ( ( 𝑢 ‘ 1 ) − 1 ) , ( ( ( 𝑢𝑤 ) − ( 𝑢 ‘ ( 𝑤 − 1 ) ) ) − 1 ) ) ) ) ) ) = ( 𝑢 ∈ { 𝑙 ∣ ( 𝑙 : ( 1 ... 𝐾 ) ⟶ ( 1 ... ( 𝑁 + 𝐾 ) ) ∧ ∀ 𝑥 ∈ ( 1 ... 𝐾 ) ∀ 𝑦 ∈ ( 1 ... 𝐾 ) ( 𝑥 < 𝑦 → ( 𝑙𝑥 ) < ( 𝑙𝑦 ) ) ) } ↦ if ( 𝐾 = 0 , { ⟨ 1 , 𝑁 ⟩ } , ( 𝑤 ∈ ( 1 ... ( 𝐾 + 1 ) ) ↦ if ( 𝑤 = ( 𝐾 + 1 ) , ( ( 𝑁 + 𝐾 ) − ( 𝑢𝐾 ) ) , if ( 𝑤 = 1 , ( ( 𝑢 ‘ 1 ) − 1 ) , ( ( ( 𝑢𝑤 ) − ( 𝑢 ‘ ( 𝑤 − 1 ) ) ) − 1 ) ) ) ) ) )
6 feq1 ( 𝑙 = 𝑓 → ( 𝑙 : ( 1 ... 𝐾 ) ⟶ ( 1 ... ( 𝑁 + 𝐾 ) ) ↔ 𝑓 : ( 1 ... 𝐾 ) ⟶ ( 1 ... ( 𝑁 + 𝐾 ) ) ) )
7 fveq1 ( 𝑙 = 𝑓 → ( 𝑙𝑥 ) = ( 𝑓𝑥 ) )
8 fveq1 ( 𝑙 = 𝑓 → ( 𝑙𝑦 ) = ( 𝑓𝑦 ) )
9 7 8 breq12d ( 𝑙 = 𝑓 → ( ( 𝑙𝑥 ) < ( 𝑙𝑦 ) ↔ ( 𝑓𝑥 ) < ( 𝑓𝑦 ) ) )
10 9 imbi2d ( 𝑙 = 𝑓 → ( ( 𝑥 < 𝑦 → ( 𝑙𝑥 ) < ( 𝑙𝑦 ) ) ↔ ( 𝑥 < 𝑦 → ( 𝑓𝑥 ) < ( 𝑓𝑦 ) ) ) )
11 10 2ralbidv ( 𝑙 = 𝑓 → ( ∀ 𝑥 ∈ ( 1 ... 𝐾 ) ∀ 𝑦 ∈ ( 1 ... 𝐾 ) ( 𝑥 < 𝑦 → ( 𝑙𝑥 ) < ( 𝑙𝑦 ) ) ↔ ∀ 𝑥 ∈ ( 1 ... 𝐾 ) ∀ 𝑦 ∈ ( 1 ... 𝐾 ) ( 𝑥 < 𝑦 → ( 𝑓𝑥 ) < ( 𝑓𝑦 ) ) ) )
12 6 11 anbi12d ( 𝑙 = 𝑓 → ( ( 𝑙 : ( 1 ... 𝐾 ) ⟶ ( 1 ... ( 𝑁 + 𝐾 ) ) ∧ ∀ 𝑥 ∈ ( 1 ... 𝐾 ) ∀ 𝑦 ∈ ( 1 ... 𝐾 ) ( 𝑥 < 𝑦 → ( 𝑙𝑥 ) < ( 𝑙𝑦 ) ) ) ↔ ( 𝑓 : ( 1 ... 𝐾 ) ⟶ ( 1 ... ( 𝑁 + 𝐾 ) ) ∧ ∀ 𝑥 ∈ ( 1 ... 𝐾 ) ∀ 𝑦 ∈ ( 1 ... 𝐾 ) ( 𝑥 < 𝑦 → ( 𝑓𝑥 ) < ( 𝑓𝑦 ) ) ) ) )
13 12 cbvabv { 𝑙 ∣ ( 𝑙 : ( 1 ... 𝐾 ) ⟶ ( 1 ... ( 𝑁 + 𝐾 ) ) ∧ ∀ 𝑥 ∈ ( 1 ... 𝐾 ) ∀ 𝑦 ∈ ( 1 ... 𝐾 ) ( 𝑥 < 𝑦 → ( 𝑙𝑥 ) < ( 𝑙𝑦 ) ) ) } = { 𝑓 ∣ ( 𝑓 : ( 1 ... 𝐾 ) ⟶ ( 1 ... ( 𝑁 + 𝐾 ) ) ∧ ∀ 𝑥 ∈ ( 1 ... 𝐾 ) ∀ 𝑦 ∈ ( 1 ... 𝐾 ) ( 𝑥 < 𝑦 → ( 𝑓𝑥 ) < ( 𝑓𝑦 ) ) ) }
14 1 2 4 5 3 13 sticksstones14 ( 𝜑 → ( ♯ ‘ 𝐴 ) = ( ( 𝑁 + 𝐾 ) C 𝐾 ) )