Metamath Proof Explorer


Theorem ltbval

Description: Value of the well-order on finite bags. (Contributed by Mario Carneiro, 8-Feb-2015)

Ref Expression
Hypotheses ltbval.c 𝐶 = ( 𝑇 <bag 𝐼 )
ltbval.d 𝐷 = { ∈ ( ℕ0m 𝐼 ) ∣ ( “ ℕ ) ∈ Fin }
ltbval.i ( 𝜑𝐼𝑉 )
ltbval.t ( 𝜑𝑇𝑊 )
Assertion ltbval ( 𝜑𝐶 = { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( { 𝑥 , 𝑦 } ⊆ 𝐷 ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } )

Proof

Step Hyp Ref Expression
1 ltbval.c 𝐶 = ( 𝑇 <bag 𝐼 )
2 ltbval.d 𝐷 = { ∈ ( ℕ0m 𝐼 ) ∣ ( “ ℕ ) ∈ Fin }
3 ltbval.i ( 𝜑𝐼𝑉 )
4 ltbval.t ( 𝜑𝑇𝑊 )
5 elex ( 𝑇𝑊𝑇 ∈ V )
6 elex ( 𝐼𝑉𝐼 ∈ V )
7 simpr ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → 𝑖 = 𝐼 )
8 7 oveq2d ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → ( ℕ0m 𝑖 ) = ( ℕ0m 𝐼 ) )
9 rabeq ( ( ℕ0m 𝑖 ) = ( ℕ0m 𝐼 ) → { ∈ ( ℕ0m 𝑖 ) ∣ ( “ ℕ ) ∈ Fin } = { ∈ ( ℕ0m 𝐼 ) ∣ ( “ ℕ ) ∈ Fin } )
10 8 9 syl ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → { ∈ ( ℕ0m 𝑖 ) ∣ ( “ ℕ ) ∈ Fin } = { ∈ ( ℕ0m 𝐼 ) ∣ ( “ ℕ ) ∈ Fin } )
11 10 2 eqtr4di ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → { ∈ ( ℕ0m 𝑖 ) ∣ ( “ ℕ ) ∈ Fin } = 𝐷 )
12 11 sseq2d ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → ( { 𝑥 , 𝑦 } ⊆ { ∈ ( ℕ0m 𝑖 ) ∣ ( “ ℕ ) ∈ Fin } ↔ { 𝑥 , 𝑦 } ⊆ 𝐷 ) )
13 simpl ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → 𝑟 = 𝑇 )
14 13 breqd ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → ( 𝑧 𝑟 𝑤𝑧 𝑇 𝑤 ) )
15 14 imbi1d ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → ( ( 𝑧 𝑟 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ↔ ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) )
16 7 15 raleqbidv ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → ( ∀ 𝑤𝑖 ( 𝑧 𝑟 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ↔ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) )
17 16 anbi2d ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → ( ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝑖 ( 𝑧 𝑟 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ↔ ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) )
18 7 17 rexeqbidv ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → ( ∃ 𝑧𝑖 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝑖 ( 𝑧 𝑟 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ↔ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) )
19 12 18 anbi12d ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → ( ( { 𝑥 , 𝑦 } ⊆ { ∈ ( ℕ0m 𝑖 ) ∣ ( “ ℕ ) ∈ Fin } ∧ ∃ 𝑧𝑖 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝑖 ( 𝑧 𝑟 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) ↔ ( { 𝑥 , 𝑦 } ⊆ 𝐷 ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) ) )
20 19 opabbidv ( ( 𝑟 = 𝑇𝑖 = 𝐼 ) → { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( { 𝑥 , 𝑦 } ⊆ { ∈ ( ℕ0m 𝑖 ) ∣ ( “ ℕ ) ∈ Fin } ∧ ∃ 𝑧𝑖 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝑖 ( 𝑧 𝑟 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } = { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( { 𝑥 , 𝑦 } ⊆ 𝐷 ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } )
21 df-ltbag <bag = ( 𝑟 ∈ V , 𝑖 ∈ V ↦ { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( { 𝑥 , 𝑦 } ⊆ { ∈ ( ℕ0m 𝑖 ) ∣ ( “ ℕ ) ∈ Fin } ∧ ∃ 𝑧𝑖 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝑖 ( 𝑧 𝑟 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } )
22 vex 𝑥 ∈ V
23 vex 𝑦 ∈ V
24 22 23 prss ( ( 𝑥𝐷𝑦𝐷 ) ↔ { 𝑥 , 𝑦 } ⊆ 𝐷 )
25 24 anbi1i ( ( ( 𝑥𝐷𝑦𝐷 ) ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) ↔ ( { 𝑥 , 𝑦 } ⊆ 𝐷 ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) )
26 25 opabbii { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( ( 𝑥𝐷𝑦𝐷 ) ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } = { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( { 𝑥 , 𝑦 } ⊆ 𝐷 ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) }
27 ovex ( ℕ0m 𝐼 ) ∈ V
28 2 27 rabex2 𝐷 ∈ V
29 28 28 xpex ( 𝐷 × 𝐷 ) ∈ V
30 opabssxp { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( ( 𝑥𝐷𝑦𝐷 ) ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } ⊆ ( 𝐷 × 𝐷 )
31 29 30 ssexi { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( ( 𝑥𝐷𝑦𝐷 ) ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } ∈ V
32 26 31 eqeltrri { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( { 𝑥 , 𝑦 } ⊆ 𝐷 ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } ∈ V
33 20 21 32 ovmpoa ( ( 𝑇 ∈ V ∧ 𝐼 ∈ V ) → ( 𝑇 <bag 𝐼 ) = { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( { 𝑥 , 𝑦 } ⊆ 𝐷 ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } )
34 5 6 33 syl2an ( ( 𝑇𝑊𝐼𝑉 ) → ( 𝑇 <bag 𝐼 ) = { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( { 𝑥 , 𝑦 } ⊆ 𝐷 ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } )
35 4 3 34 syl2anc ( 𝜑 → ( 𝑇 <bag 𝐼 ) = { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( { 𝑥 , 𝑦 } ⊆ 𝐷 ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } )
36 1 35 syl5eq ( 𝜑𝐶 = { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( { 𝑥 , 𝑦 } ⊆ 𝐷 ∧ ∃ 𝑧𝐼 ( ( 𝑥𝑧 ) < ( 𝑦𝑧 ) ∧ ∀ 𝑤𝐼 ( 𝑧 𝑇 𝑤 → ( 𝑥𝑤 ) = ( 𝑦𝑤 ) ) ) ) } )