Metamath Proof Explorer


Theorem tposideq

Description: Two ways of expressing the swap function. (Contributed by Zhi Wang, 6-Oct-2025)

Ref Expression
Assertion tposideq ⊢ Rel ⁡ R → tpos I ↾ R = x ∈ R ⟼ ⋃ x -1

Proof

Step Hyp Ref Expression
1 tposres ⊢ Rel ⁡ R → tpos I ↾ R = tpos I ↾ R -1
2 relcnv ⊢ Rel ⁡ R -1
3 fnresi ⊢ I ↾ R -1 Fn R -1
4 tposfn2 ⊢ Rel ⁡ R -1 → I ↾ R -1 Fn R -1 → tpos I ↾ R -1 Fn R -1 -1
5 2 3 4 mp2 ⊢ tpos I ↾ R -1 Fn R -1 -1
6 dfrel2 ⊢ Rel ⁡ R ↔ R -1 -1 = R
7 6 biimpi ⊢ Rel ⁡ R → R -1 -1 = R
8 7 fneq2d ⊢ Rel ⁡ R → tpos I ↾ R -1 Fn R -1 -1 ↔ tpos I ↾ R -1 Fn R
9 5 8 mpbii ⊢ Rel ⁡ R → tpos I ↾ R -1 Fn R
10 vsnex ⊢ x ∈ V
11 10 cnvex ⊢ x -1 ∈ V
12 11 uniex ⊢ ⋃ x -1 ∈ V
13 eqid ⊢ x ∈ R ⟼ ⋃ x -1 = x ∈ R ⟼ ⋃ x -1
14 12 13 fnmpti ⊢ x ∈ R ⟼ ⋃ x -1 Fn R
15 14 a1i ⊢ Rel ⁡ R → x ∈ R ⟼ ⋃ x -1 Fn R
16 1st2nd ⊢ Rel ⁡ R ∧ y ∈ R → y = 1 st ⁡ y 2 nd ⁡ y
17 1st2ndb ⊢ y ∈ V × V ↔ y = 1 st ⁡ y 2 nd ⁡ y
18 17 biimpri ⊢ y = 1 st ⁡ y 2 nd ⁡ y → y ∈ V × V
19 2nd1st ⊢ y ∈ V × V → ⋃ y -1 = 2 nd ⁡ y 1 st ⁡ y
20 16 18 19 3syl ⊢ Rel ⁡ R ∧ y ∈ R → ⋃ y -1 = 2 nd ⁡ y 1 st ⁡ y
21 sneq ⊢ x = y → x = y
22 21 cnveqd ⊢ x = y → x -1 = y -1
23 22 unieqd ⊢ x = y → ⋃ x -1 = ⋃ y -1
24 23 13 12 fvmpt3i ⊢ y ∈ R → x ∈ R ⟼ ⋃ x -1 ⁡ y = ⋃ y -1
25 24 adantl ⊢ Rel ⁡ R ∧ y ∈ R → x ∈ R ⟼ ⋃ x -1 ⁡ y = ⋃ y -1
26 16 fveq2d ⊢ Rel ⁡ R ∧ y ∈ R → tpos I ↾ R -1 ⁡ y = tpos I ↾ R -1 ⁡ 1 st ⁡ y 2 nd ⁡ y
27 ovtpos ⊢ 1 st ⁡ y tpos I ↾ R -1 2 nd ⁡ y = 2 nd ⁡ y I ↾ R -1 1 st ⁡ y
28 df-ov ⊢ 1 st ⁡ y tpos I ↾ R -1 2 nd ⁡ y = tpos I ↾ R -1 ⁡ 1 st ⁡ y 2 nd ⁡ y
29 df-ov ⊢ 2 nd ⁡ y I ↾ R -1 1 st ⁡ y = I ↾ R -1 ⁡ 2 nd ⁡ y 1 st ⁡ y
30 27 28 29 3eqtr3i ⊢ tpos I ↾ R -1 ⁡ 1 st ⁡ y 2 nd ⁡ y = I ↾ R -1 ⁡ 2 nd ⁡ y 1 st ⁡ y
31 30 a1i ⊢ Rel ⁡ R ∧ y ∈ R → tpos I ↾ R -1 ⁡ 1 st ⁡ y 2 nd ⁡ y = I ↾ R -1 ⁡ 2 nd ⁡ y 1 st ⁡ y
32 simpr ⊢ Rel ⁡ R ∧ y ∈ R → y ∈ R
33 16 32 eqeltrrd ⊢ Rel ⁡ R ∧ y ∈ R → 1 st ⁡ y 2 nd ⁡ y ∈ R
34 fvex ⊢ 2 nd ⁡ y ∈ V
35 fvex ⊢ 1 st ⁡ y ∈ V
36 34 35 opelcnv ⊢ 2 nd ⁡ y 1 st ⁡ y ∈ R -1 ↔ 1 st ⁡ y 2 nd ⁡ y ∈ R
37 36 biimpri ⊢ 1 st ⁡ y 2 nd ⁡ y ∈ R → 2 nd ⁡ y 1 st ⁡ y ∈ R -1
38 fvresi ⊢ 2 nd ⁡ y 1 st ⁡ y ∈ R -1 → I ↾ R -1 ⁡ 2 nd ⁡ y 1 st ⁡ y = 2 nd ⁡ y 1 st ⁡ y
39 33 37 38 3syl ⊢ Rel ⁡ R ∧ y ∈ R → I ↾ R -1 ⁡ 2 nd ⁡ y 1 st ⁡ y = 2 nd ⁡ y 1 st ⁡ y
40 26 31 39 3eqtrd ⊢ Rel ⁡ R ∧ y ∈ R → tpos I ↾ R -1 ⁡ y = 2 nd ⁡ y 1 st ⁡ y
41 20 25 40 3eqtr4rd ⊢ Rel ⁡ R ∧ y ∈ R → tpos I ↾ R -1 ⁡ y = x ∈ R ⟼ ⋃ x -1 ⁡ y
42 9 15 41 eqfnfvd ⊢ Rel ⁡ R → tpos I ↾ R -1 = x ∈ R ⟼ ⋃ x -1
43 1 42 eqtrd ⊢ Rel ⁡ R → tpos I ↾ R = x ∈ R ⟼ ⋃ x -1