Metamath Proof Explorer


Theorem psrbagaddcl

Description: The sum of two finite bags is a finite bag. (Contributed by Mario Carneiro, 9-Jan-2015) Shorten proof and remove a sethood antecedent. (Revised by SN, 7-Aug-2024)

Ref Expression
Hypothesis psrbag.d 𝐷 = { 𝑓 ∈ ( ℕ0m 𝐼 ) ∣ ( 𝑓 “ ℕ ) ∈ Fin }
Assertion psrbagaddcl ( ( 𝐹𝐷𝐺𝐷 ) → ( 𝐹f + 𝐺 ) ∈ 𝐷 )

Proof

Step Hyp Ref Expression
1 psrbag.d 𝐷 = { 𝑓 ∈ ( ℕ0m 𝐼 ) ∣ ( 𝑓 “ ℕ ) ∈ Fin }
2 nn0addcl ( ( 𝑥 ∈ ℕ0𝑦 ∈ ℕ0 ) → ( 𝑥 + 𝑦 ) ∈ ℕ0 )
3 2 adantl ( ( ( 𝐹𝐷𝐺𝐷 ) ∧ ( 𝑥 ∈ ℕ0𝑦 ∈ ℕ0 ) ) → ( 𝑥 + 𝑦 ) ∈ ℕ0 )
4 1 psrbagf ( 𝐹𝐷𝐹 : 𝐼 ⟶ ℕ0 )
5 4 adantr ( ( 𝐹𝐷𝐺𝐷 ) → 𝐹 : 𝐼 ⟶ ℕ0 )
6 1 psrbagf ( 𝐺𝐷𝐺 : 𝐼 ⟶ ℕ0 )
7 6 adantl ( ( 𝐹𝐷𝐺𝐷 ) → 𝐺 : 𝐼 ⟶ ℕ0 )
8 simpl ( ( 𝐹𝐷𝐺𝐷 ) → 𝐹𝐷 )
9 5 ffnd ( ( 𝐹𝐷𝐺𝐷 ) → 𝐹 Fn 𝐼 )
10 8 9 fndmexd ( ( 𝐹𝐷𝐺𝐷 ) → 𝐼 ∈ V )
11 inidm ( 𝐼𝐼 ) = 𝐼
12 3 5 7 10 10 11 off ( ( 𝐹𝐷𝐺𝐷 ) → ( 𝐹f + 𝐺 ) : 𝐼 ⟶ ℕ0 )
13 ovex ( 𝐹f + 𝐺 ) ∈ V
14 frnnn0suppg ( ( ( 𝐹f + 𝐺 ) ∈ V ∧ ( 𝐹f + 𝐺 ) : 𝐼 ⟶ ℕ0 ) → ( ( 𝐹f + 𝐺 ) supp 0 ) = ( ( 𝐹f + 𝐺 ) “ ℕ ) )
15 13 12 14 sylancr ( ( 𝐹𝐷𝐺𝐷 ) → ( ( 𝐹f + 𝐺 ) supp 0 ) = ( ( 𝐹f + 𝐺 ) “ ℕ ) )
16 1 psrbagfsupp ( 𝐹𝐷𝐹 finSupp 0 )
17 16 adantr ( ( 𝐹𝐷𝐺𝐷 ) → 𝐹 finSupp 0 )
18 1 psrbagfsupp ( 𝐺𝐷𝐺 finSupp 0 )
19 18 adantl ( ( 𝐹𝐷𝐺𝐷 ) → 𝐺 finSupp 0 )
20 17 19 fsuppunfi ( ( 𝐹𝐷𝐺𝐷 ) → ( ( 𝐹 supp 0 ) ∪ ( 𝐺 supp 0 ) ) ∈ Fin )
21 0nn0 0 ∈ ℕ0
22 21 a1i ( ( 𝐹𝐷𝐺𝐷 ) → 0 ∈ ℕ0 )
23 00id ( 0 + 0 ) = 0
24 23 a1i ( ( 𝐹𝐷𝐺𝐷 ) → ( 0 + 0 ) = 0 )
25 10 22 5 7 24 suppofssd ( ( 𝐹𝐷𝐺𝐷 ) → ( ( 𝐹f + 𝐺 ) supp 0 ) ⊆ ( ( 𝐹 supp 0 ) ∪ ( 𝐺 supp 0 ) ) )
26 20 25 ssfid ( ( 𝐹𝐷𝐺𝐷 ) → ( ( 𝐹f + 𝐺 ) supp 0 ) ∈ Fin )
27 15 26 eqeltrrd ( ( 𝐹𝐷𝐺𝐷 ) → ( ( 𝐹f + 𝐺 ) “ ℕ ) ∈ Fin )
28 1 psrbag ( 𝐼 ∈ V → ( ( 𝐹f + 𝐺 ) ∈ 𝐷 ↔ ( ( 𝐹f + 𝐺 ) : 𝐼 ⟶ ℕ0 ∧ ( ( 𝐹f + 𝐺 ) “ ℕ ) ∈ Fin ) ) )
29 10 28 syl ( ( 𝐹𝐷𝐺𝐷 ) → ( ( 𝐹f + 𝐺 ) ∈ 𝐷 ↔ ( ( 𝐹f + 𝐺 ) : 𝐼 ⟶ ℕ0 ∧ ( ( 𝐹f + 𝐺 ) “ ℕ ) ∈ Fin ) ) )
30 12 27 29 mpbir2and ( ( 𝐹𝐷𝐺𝐷 ) → ( 𝐹f + 𝐺 ) ∈ 𝐷 )