Metamath Proof Explorer


Theorem gsumbagdiaglem

Description: Lemma for gsumbagdiag . (Contributed by Mario Carneiro, 5-Jan-2015) Remove a sethood hypothesis. (Revised by SN, 6-Aug-2024)

Ref Expression
Hypotheses gsumbagdiag.d 𝐷 = { 𝑓 ∈ ( ℕ0m 𝐼 ) ∣ ( 𝑓 “ ℕ ) ∈ Fin }
gsumbagdiag.s 𝑆 = { 𝑦𝐷𝑦r𝐹 }
gsumbagdiag.f ( 𝜑𝐹𝐷 )
Assertion gsumbagdiaglem ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝑌𝑆𝑋 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑌 ) } ) )

Proof

Step Hyp Ref Expression
1 gsumbagdiag.d 𝐷 = { 𝑓 ∈ ( ℕ0m 𝐼 ) ∣ ( 𝑓 “ ℕ ) ∈ Fin }
2 gsumbagdiag.s 𝑆 = { 𝑦𝐷𝑦r𝐹 }
3 gsumbagdiag.f ( 𝜑𝐹𝐷 )
4 simprr ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } )
5 breq1 ( 𝑥 = 𝑌 → ( 𝑥r ≤ ( 𝐹f𝑋 ) ↔ 𝑌r ≤ ( 𝐹f𝑋 ) ) )
6 5 elrab ( 𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ↔ ( 𝑌𝐷𝑌r ≤ ( 𝐹f𝑋 ) ) )
7 4 6 sylib ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝑌𝐷𝑌r ≤ ( 𝐹f𝑋 ) ) )
8 7 simpld ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑌𝐷 )
9 7 simprd ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑌r ≤ ( 𝐹f𝑋 ) )
10 3 adantr ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝐹𝐷 )
11 simprl ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑋𝑆 )
12 breq1 ( 𝑦 = 𝑋 → ( 𝑦r𝐹𝑋r𝐹 ) )
13 12 2 elrab2 ( 𝑋𝑆 ↔ ( 𝑋𝐷𝑋r𝐹 ) )
14 11 13 sylib ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝑋𝐷𝑋r𝐹 ) )
15 14 simpld ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑋𝐷 )
16 1 psrbagf ( 𝑋𝐷𝑋 : 𝐼 ⟶ ℕ0 )
17 15 16 syl ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑋 : 𝐼 ⟶ ℕ0 )
18 14 simprd ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑋r𝐹 )
19 1 psrbagcon ( ( 𝐹𝐷𝑋 : 𝐼 ⟶ ℕ0𝑋r𝐹 ) → ( ( 𝐹f𝑋 ) ∈ 𝐷 ∧ ( 𝐹f𝑋 ) ∘r𝐹 ) )
20 10 17 18 19 syl3anc ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( ( 𝐹f𝑋 ) ∈ 𝐷 ∧ ( 𝐹f𝑋 ) ∘r𝐹 ) )
21 20 simprd ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝐹f𝑋 ) ∘r𝐹 )
22 1 psrbagf ( 𝐹𝐷𝐹 : 𝐼 ⟶ ℕ0 )
23 10 22 syl ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝐹 : 𝐼 ⟶ ℕ0 )
24 23 ffnd ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝐹 Fn 𝐼 )
25 10 24 fndmexd ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝐼 ∈ V )
26 1 psrbagf ( 𝑌𝐷𝑌 : 𝐼 ⟶ ℕ0 )
27 8 26 syl ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑌 : 𝐼 ⟶ ℕ0 )
28 20 simpld ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝐹f𝑋 ) ∈ 𝐷 )
29 1 psrbagf ( ( 𝐹f𝑋 ) ∈ 𝐷 → ( 𝐹f𝑋 ) : 𝐼 ⟶ ℕ0 )
30 28 29 syl ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝐹f𝑋 ) : 𝐼 ⟶ ℕ0 )
31 nn0re ( 𝑢 ∈ ℕ0𝑢 ∈ ℝ )
32 nn0re ( 𝑣 ∈ ℕ0𝑣 ∈ ℝ )
33 nn0re ( 𝑤 ∈ ℕ0𝑤 ∈ ℝ )
34 letr ( ( 𝑢 ∈ ℝ ∧ 𝑣 ∈ ℝ ∧ 𝑤 ∈ ℝ ) → ( ( 𝑢𝑣𝑣𝑤 ) → 𝑢𝑤 ) )
35 31 32 33 34 syl3an ( ( 𝑢 ∈ ℕ0𝑣 ∈ ℕ0𝑤 ∈ ℕ0 ) → ( ( 𝑢𝑣𝑣𝑤 ) → 𝑢𝑤 ) )
36 35 adantl ( ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) ∧ ( 𝑢 ∈ ℕ0𝑣 ∈ ℕ0𝑤 ∈ ℕ0 ) ) → ( ( 𝑢𝑣𝑣𝑤 ) → 𝑢𝑤 ) )
37 25 27 30 23 36 caoftrn ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( ( 𝑌r ≤ ( 𝐹f𝑋 ) ∧ ( 𝐹f𝑋 ) ∘r𝐹 ) → 𝑌r𝐹 ) )
38 9 21 37 mp2and ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑌r𝐹 )
39 breq1 ( 𝑦 = 𝑌 → ( 𝑦r𝐹𝑌r𝐹 ) )
40 39 2 elrab2 ( 𝑌𝑆 ↔ ( 𝑌𝐷𝑌r𝐹 ) )
41 8 38 40 sylanbrc ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑌𝑆 )
42 breq1 ( 𝑥 = 𝑋 → ( 𝑥r ≤ ( 𝐹f𝑌 ) ↔ 𝑋r ≤ ( 𝐹f𝑌 ) ) )
43 17 ffvelrnda ( ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) ∧ 𝑧𝐼 ) → ( 𝑋𝑧 ) ∈ ℕ0 )
44 27 ffvelrnda ( ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) ∧ 𝑧𝐼 ) → ( 𝑌𝑧 ) ∈ ℕ0 )
45 23 ffvelrnda ( ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) ∧ 𝑧𝐼 ) → ( 𝐹𝑧 ) ∈ ℕ0 )
46 nn0re ( ( 𝑋𝑧 ) ∈ ℕ0 → ( 𝑋𝑧 ) ∈ ℝ )
47 nn0re ( ( 𝑌𝑧 ) ∈ ℕ0 → ( 𝑌𝑧 ) ∈ ℝ )
48 nn0re ( ( 𝐹𝑧 ) ∈ ℕ0 → ( 𝐹𝑧 ) ∈ ℝ )
49 leaddsub2 ( ( ( 𝑋𝑧 ) ∈ ℝ ∧ ( 𝑌𝑧 ) ∈ ℝ ∧ ( 𝐹𝑧 ) ∈ ℝ ) → ( ( ( 𝑋𝑧 ) + ( 𝑌𝑧 ) ) ≤ ( 𝐹𝑧 ) ↔ ( 𝑌𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑋𝑧 ) ) ) )
50 leaddsub ( ( ( 𝑋𝑧 ) ∈ ℝ ∧ ( 𝑌𝑧 ) ∈ ℝ ∧ ( 𝐹𝑧 ) ∈ ℝ ) → ( ( ( 𝑋𝑧 ) + ( 𝑌𝑧 ) ) ≤ ( 𝐹𝑧 ) ↔ ( 𝑋𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑌𝑧 ) ) ) )
51 49 50 bitr3d ( ( ( 𝑋𝑧 ) ∈ ℝ ∧ ( 𝑌𝑧 ) ∈ ℝ ∧ ( 𝐹𝑧 ) ∈ ℝ ) → ( ( 𝑌𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑋𝑧 ) ) ↔ ( 𝑋𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑌𝑧 ) ) ) )
52 46 47 48 51 syl3an ( ( ( 𝑋𝑧 ) ∈ ℕ0 ∧ ( 𝑌𝑧 ) ∈ ℕ0 ∧ ( 𝐹𝑧 ) ∈ ℕ0 ) → ( ( 𝑌𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑋𝑧 ) ) ↔ ( 𝑋𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑌𝑧 ) ) ) )
53 43 44 45 52 syl3anc ( ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) ∧ 𝑧𝐼 ) → ( ( 𝑌𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑋𝑧 ) ) ↔ ( 𝑋𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑌𝑧 ) ) ) )
54 53 ralbidva ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( ∀ 𝑧𝐼 ( 𝑌𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑋𝑧 ) ) ↔ ∀ 𝑧𝐼 ( 𝑋𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑌𝑧 ) ) ) )
55 ovexd ( ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) ∧ 𝑧𝐼 ) → ( ( 𝐹𝑧 ) − ( 𝑋𝑧 ) ) ∈ V )
56 27 feqmptd ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑌 = ( 𝑧𝐼 ↦ ( 𝑌𝑧 ) ) )
57 17 ffnd ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑋 Fn 𝐼 )
58 inidm ( 𝐼𝐼 ) = 𝐼
59 eqidd ( ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) ∧ 𝑧𝐼 ) → ( 𝐹𝑧 ) = ( 𝐹𝑧 ) )
60 eqidd ( ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) ∧ 𝑧𝐼 ) → ( 𝑋𝑧 ) = ( 𝑋𝑧 ) )
61 24 57 25 25 58 59 60 offval ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝐹f𝑋 ) = ( 𝑧𝐼 ↦ ( ( 𝐹𝑧 ) − ( 𝑋𝑧 ) ) ) )
62 25 44 55 56 61 ofrfval2 ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝑌r ≤ ( 𝐹f𝑋 ) ↔ ∀ 𝑧𝐼 ( 𝑌𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑋𝑧 ) ) ) )
63 ovexd ( ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) ∧ 𝑧𝐼 ) → ( ( 𝐹𝑧 ) − ( 𝑌𝑧 ) ) ∈ V )
64 17 feqmptd ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑋 = ( 𝑧𝐼 ↦ ( 𝑋𝑧 ) ) )
65 27 ffnd ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑌 Fn 𝐼 )
66 eqidd ( ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) ∧ 𝑧𝐼 ) → ( 𝑌𝑧 ) = ( 𝑌𝑧 ) )
67 24 65 25 25 58 59 66 offval ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝐹f𝑌 ) = ( 𝑧𝐼 ↦ ( ( 𝐹𝑧 ) − ( 𝑌𝑧 ) ) ) )
68 25 43 63 64 67 ofrfval2 ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝑋r ≤ ( 𝐹f𝑌 ) ↔ ∀ 𝑧𝐼 ( 𝑋𝑧 ) ≤ ( ( 𝐹𝑧 ) − ( 𝑌𝑧 ) ) ) )
69 54 62 68 3bitr4d ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝑌r ≤ ( 𝐹f𝑋 ) ↔ 𝑋r ≤ ( 𝐹f𝑌 ) ) )
70 9 69 mpbid ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑋r ≤ ( 𝐹f𝑌 ) )
71 42 15 70 elrabd ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → 𝑋 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑌 ) } )
72 41 71 jca ( ( 𝜑 ∧ ( 𝑋𝑆𝑌 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑋 ) } ) ) → ( 𝑌𝑆𝑋 ∈ { 𝑥𝐷𝑥r ≤ ( 𝐹f𝑌 ) } ) )