Metamath Proof Explorer


Theorem psrbagcon

Description: The analogue of the statement " 0 <_ G <_ F implies 0 <_ F - G <_ F " for finite bags. (Contributed by Mario Carneiro, 29-Dec-2014) Remove a sethood antecedent. (Revised by SN, 5-Aug-2024)

Ref Expression
Hypothesis psrbag.d 𝐷 = { 𝑓 ∈ ( ℕ0m 𝐼 ) ∣ ( 𝑓 “ ℕ ) ∈ Fin }
Assertion psrbagcon ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( ( 𝐹f𝐺 ) ∈ 𝐷 ∧ ( 𝐹f𝐺 ) ∘r𝐹 ) )

Proof

Step Hyp Ref Expression
1 psrbag.d 𝐷 = { 𝑓 ∈ ( ℕ0m 𝐼 ) ∣ ( 𝑓 “ ℕ ) ∈ Fin }
2 1 psrbagf ( 𝐹𝐷𝐹 : 𝐼 ⟶ ℕ0 )
3 2 ffnd ( 𝐹𝐷𝐹 Fn 𝐼 )
4 3 3ad2ant1 ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → 𝐹 Fn 𝐼 )
5 simp2 ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → 𝐺 : 𝐼 ⟶ ℕ0 )
6 5 ffnd ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → 𝐺 Fn 𝐼 )
7 id ( 𝐹𝐷𝐹𝐷 )
8 7 3 fndmexd ( 𝐹𝐷𝐼 ∈ V )
9 8 3ad2ant1 ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → 𝐼 ∈ V )
10 inidm ( 𝐼𝐼 ) = 𝐼
11 4 6 9 9 10 offn ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( 𝐹f𝐺 ) Fn 𝐼 )
12 eqidd ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( 𝐹𝑥 ) = ( 𝐹𝑥 ) )
13 eqidd ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( 𝐺𝑥 ) = ( 𝐺𝑥 ) )
14 4 6 9 9 10 12 13 ofval ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( ( 𝐹f𝐺 ) ‘ 𝑥 ) = ( ( 𝐹𝑥 ) − ( 𝐺𝑥 ) ) )
15 simp3 ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → 𝐺r𝐹 )
16 6 4 9 9 10 13 12 ofrfval ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( 𝐺r𝐹 ↔ ∀ 𝑥𝐼 ( 𝐺𝑥 ) ≤ ( 𝐹𝑥 ) ) )
17 15 16 mpbid ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ∀ 𝑥𝐼 ( 𝐺𝑥 ) ≤ ( 𝐹𝑥 ) )
18 17 r19.21bi ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( 𝐺𝑥 ) ≤ ( 𝐹𝑥 ) )
19 5 ffvelrnda ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( 𝐺𝑥 ) ∈ ℕ0 )
20 2 3ad2ant1 ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → 𝐹 : 𝐼 ⟶ ℕ0 )
21 20 ffvelrnda ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( 𝐹𝑥 ) ∈ ℕ0 )
22 nn0sub ( ( ( 𝐺𝑥 ) ∈ ℕ0 ∧ ( 𝐹𝑥 ) ∈ ℕ0 ) → ( ( 𝐺𝑥 ) ≤ ( 𝐹𝑥 ) ↔ ( ( 𝐹𝑥 ) − ( 𝐺𝑥 ) ) ∈ ℕ0 ) )
23 19 21 22 syl2anc ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( ( 𝐺𝑥 ) ≤ ( 𝐹𝑥 ) ↔ ( ( 𝐹𝑥 ) − ( 𝐺𝑥 ) ) ∈ ℕ0 ) )
24 18 23 mpbid ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( ( 𝐹𝑥 ) − ( 𝐺𝑥 ) ) ∈ ℕ0 )
25 14 24 eqeltrd ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( ( 𝐹f𝐺 ) ‘ 𝑥 ) ∈ ℕ0 )
26 25 ralrimiva ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ∀ 𝑥𝐼 ( ( 𝐹f𝐺 ) ‘ 𝑥 ) ∈ ℕ0 )
27 ffnfv ( ( 𝐹f𝐺 ) : 𝐼 ⟶ ℕ0 ↔ ( ( 𝐹f𝐺 ) Fn 𝐼 ∧ ∀ 𝑥𝐼 ( ( 𝐹f𝐺 ) ‘ 𝑥 ) ∈ ℕ0 ) )
28 11 26 27 sylanbrc ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( 𝐹f𝐺 ) : 𝐼 ⟶ ℕ0 )
29 simp1 ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → 𝐹𝐷 )
30 1 psrbag ( 𝐼 ∈ V → ( 𝐹𝐷 ↔ ( 𝐹 : 𝐼 ⟶ ℕ0 ∧ ( 𝐹 “ ℕ ) ∈ Fin ) ) )
31 9 30 syl ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( 𝐹𝐷 ↔ ( 𝐹 : 𝐼 ⟶ ℕ0 ∧ ( 𝐹 “ ℕ ) ∈ Fin ) ) )
32 29 31 mpbid ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( 𝐹 : 𝐼 ⟶ ℕ0 ∧ ( 𝐹 “ ℕ ) ∈ Fin ) )
33 32 simprd ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( 𝐹 “ ℕ ) ∈ Fin )
34 19 nn0ge0d ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → 0 ≤ ( 𝐺𝑥 ) )
35 21 nn0red ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( 𝐹𝑥 ) ∈ ℝ )
36 19 nn0red ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( 𝐺𝑥 ) ∈ ℝ )
37 35 36 subge02d ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( 0 ≤ ( 𝐺𝑥 ) ↔ ( ( 𝐹𝑥 ) − ( 𝐺𝑥 ) ) ≤ ( 𝐹𝑥 ) ) )
38 34 37 mpbid ( ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) ∧ 𝑥𝐼 ) → ( ( 𝐹𝑥 ) − ( 𝐺𝑥 ) ) ≤ ( 𝐹𝑥 ) )
39 38 ralrimiva ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ∀ 𝑥𝐼 ( ( 𝐹𝑥 ) − ( 𝐺𝑥 ) ) ≤ ( 𝐹𝑥 ) )
40 11 4 9 9 10 14 12 ofrfval ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( ( 𝐹f𝐺 ) ∘r𝐹 ↔ ∀ 𝑥𝐼 ( ( 𝐹𝑥 ) − ( 𝐺𝑥 ) ) ≤ ( 𝐹𝑥 ) ) )
41 39 40 mpbird ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( 𝐹f𝐺 ) ∘r𝐹 )
42 1 psrbaglesupp ( ( 𝐹𝐷 ∧ ( 𝐹f𝐺 ) : 𝐼 ⟶ ℕ0 ∧ ( 𝐹f𝐺 ) ∘r𝐹 ) → ( ( 𝐹f𝐺 ) “ ℕ ) ⊆ ( 𝐹 “ ℕ ) )
43 29 28 41 42 syl3anc ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( ( 𝐹f𝐺 ) “ ℕ ) ⊆ ( 𝐹 “ ℕ ) )
44 33 43 ssfid ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( ( 𝐹f𝐺 ) “ ℕ ) ∈ Fin )
45 1 psrbag ( 𝐼 ∈ V → ( ( 𝐹f𝐺 ) ∈ 𝐷 ↔ ( ( 𝐹f𝐺 ) : 𝐼 ⟶ ℕ0 ∧ ( ( 𝐹f𝐺 ) “ ℕ ) ∈ Fin ) ) )
46 9 45 syl ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( ( 𝐹f𝐺 ) ∈ 𝐷 ↔ ( ( 𝐹f𝐺 ) : 𝐼 ⟶ ℕ0 ∧ ( ( 𝐹f𝐺 ) “ ℕ ) ∈ Fin ) ) )
47 28 44 46 mpbir2and ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( 𝐹f𝐺 ) ∈ 𝐷 )
48 47 41 jca ( ( 𝐹𝐷𝐺 : 𝐼 ⟶ ℕ0𝐺r𝐹 ) → ( ( 𝐹f𝐺 ) ∈ 𝐷 ∧ ( 𝐹f𝐺 ) ∘r𝐹 ) )