Metamath Proof Explorer


Theorem tgjustr

Description: Given any equivalence relation R , one can define a function f such that all elements of an equivalence classe of R have the same image by f . (Contributed by Thierry Arnoux, 25-Jan-2023)

Ref Expression
Assertion tgjustr ( ( 𝐴𝑉𝑅 Er 𝐴 ) → ∃ 𝑓 ( 𝑓 Fn 𝐴 ∧ ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( 𝑓𝑥 ) = ( 𝑓𝑦 ) ) ) )

Proof

Step Hyp Ref Expression
1 erex ( 𝑅 Er 𝐴 → ( 𝐴𝑉𝑅 ∈ V ) )
2 1 impcom ( ( 𝐴𝑉𝑅 Er 𝐴 ) → 𝑅 ∈ V )
3 ecexg ( 𝑅 ∈ V → [ 𝑢 ] 𝑅 ∈ V )
4 2 3 syl ( ( 𝐴𝑉𝑅 Er 𝐴 ) → [ 𝑢 ] 𝑅 ∈ V )
5 4 adantr ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑢𝐴 ) → [ 𝑢 ] 𝑅 ∈ V )
6 5 ralrimiva ( ( 𝐴𝑉𝑅 Er 𝐴 ) → ∀ 𝑢𝐴 [ 𝑢 ] 𝑅 ∈ V )
7 eqid ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) = ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 )
8 7 fnmpt ( ∀ 𝑢𝐴 [ 𝑢 ] 𝑅 ∈ V → ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) Fn 𝐴 )
9 6 8 syl ( ( 𝐴𝑉𝑅 Er 𝐴 ) → ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) Fn 𝐴 )
10 simpllr ( ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) ∧ 𝑦𝐴 ) → 𝑅 Er 𝐴 )
11 simpr ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) → 𝑥𝐴 )
12 11 adantr ( ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) ∧ 𝑦𝐴 ) → 𝑥𝐴 )
13 10 12 erth ( ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) ∧ 𝑦𝐴 ) → ( 𝑥 𝑅 𝑦 ↔ [ 𝑥 ] 𝑅 = [ 𝑦 ] 𝑅 ) )
14 eceq1 ( 𝑢 = 𝑥 → [ 𝑢 ] 𝑅 = [ 𝑥 ] 𝑅 )
15 ecelqsg ( ( 𝑅 ∈ V ∧ 𝑥𝐴 ) → [ 𝑥 ] 𝑅 ∈ ( 𝐴 / 𝑅 ) )
16 2 15 sylan ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) → [ 𝑥 ] 𝑅 ∈ ( 𝐴 / 𝑅 ) )
17 7 14 11 16 fvmptd3 ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) → ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = [ 𝑥 ] 𝑅 )
18 17 adantr ( ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) ∧ 𝑦𝐴 ) → ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = [ 𝑥 ] 𝑅 )
19 eceq1 ( 𝑢 = 𝑦 → [ 𝑢 ] 𝑅 = [ 𝑦 ] 𝑅 )
20 simpr ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑦𝐴 ) → 𝑦𝐴 )
21 ecelqsg ( ( 𝑅 ∈ V ∧ 𝑦𝐴 ) → [ 𝑦 ] 𝑅 ∈ ( 𝐴 / 𝑅 ) )
22 2 21 sylan ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑦𝐴 ) → [ 𝑦 ] 𝑅 ∈ ( 𝐴 / 𝑅 ) )
23 7 19 20 22 fvmptd3 ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑦𝐴 ) → ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) = [ 𝑦 ] 𝑅 )
24 23 adantlr ( ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) ∧ 𝑦𝐴 ) → ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) = [ 𝑦 ] 𝑅 )
25 18 24 eqeq12d ( ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) ∧ 𝑦𝐴 ) → ( ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) ↔ [ 𝑥 ] 𝑅 = [ 𝑦 ] 𝑅 ) )
26 13 25 bitr4d ( ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) ∧ 𝑦𝐴 ) → ( 𝑥 𝑅 𝑦 ↔ ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) ) )
27 26 ralrimiva ( ( ( 𝐴𝑉𝑅 Er 𝐴 ) ∧ 𝑥𝐴 ) → ∀ 𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) ) )
28 27 ralrimiva ( ( 𝐴𝑉𝑅 Er 𝐴 ) → ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) ) )
29 mptexg ( 𝐴𝑉 → ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ∈ V )
30 29 adantr ( ( 𝐴𝑉𝑅 Er 𝐴 ) → ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ∈ V )
31 fneq1 ( 𝑓 = ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) → ( 𝑓 Fn 𝐴 ↔ ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) Fn 𝐴 ) )
32 simpl ( ( 𝑓 = ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ∧ ( 𝑥𝐴𝑦𝐴 ) ) → 𝑓 = ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) )
33 32 fveq1d ( ( 𝑓 = ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ∧ ( 𝑥𝐴𝑦𝐴 ) ) → ( 𝑓𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) )
34 32 fveq1d ( ( 𝑓 = ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ∧ ( 𝑥𝐴𝑦𝐴 ) ) → ( 𝑓𝑦 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) )
35 33 34 eqeq12d ( ( 𝑓 = ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ∧ ( 𝑥𝐴𝑦𝐴 ) ) → ( ( 𝑓𝑥 ) = ( 𝑓𝑦 ) ↔ ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) ) )
36 35 bibi2d ( ( 𝑓 = ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ∧ ( 𝑥𝐴𝑦𝐴 ) ) → ( ( 𝑥 𝑅 𝑦 ↔ ( 𝑓𝑥 ) = ( 𝑓𝑦 ) ) ↔ ( 𝑥 𝑅 𝑦 ↔ ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) ) ) )
37 36 2ralbidva ( 𝑓 = ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) → ( ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( 𝑓𝑥 ) = ( 𝑓𝑦 ) ) ↔ ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) ) ) )
38 31 37 anbi12d ( 𝑓 = ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) → ( ( 𝑓 Fn 𝐴 ∧ ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( 𝑓𝑥 ) = ( 𝑓𝑦 ) ) ) ↔ ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) Fn 𝐴 ∧ ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) ) ) ) )
39 38 spcegv ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ∈ V → ( ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) Fn 𝐴 ∧ ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) ) ) → ∃ 𝑓 ( 𝑓 Fn 𝐴 ∧ ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( 𝑓𝑥 ) = ( 𝑓𝑦 ) ) ) ) )
40 30 39 syl ( ( 𝐴𝑉𝑅 Er 𝐴 ) → ( ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) Fn 𝐴 ∧ ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑥 ) = ( ( 𝑢𝐴 ↦ [ 𝑢 ] 𝑅 ) ‘ 𝑦 ) ) ) → ∃ 𝑓 ( 𝑓 Fn 𝐴 ∧ ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( 𝑓𝑥 ) = ( 𝑓𝑦 ) ) ) ) )
41 9 28 40 mp2and ( ( 𝐴𝑉𝑅 Er 𝐴 ) → ∃ 𝑓 ( 𝑓 Fn 𝐴 ∧ ∀ 𝑥𝐴𝑦𝐴 ( 𝑥 𝑅 𝑦 ↔ ( 𝑓𝑥 ) = ( 𝑓𝑦 ) ) ) )