MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  f1ofvswap Structured version   Visualization version   GIF version

Theorem f1ofvswap 7158
Description: Swapping two values in a bijection between two classes yields another bijection between those classes. (Contributed by BTernaryTau, 31-Aug-2024.)
Assertion
Ref Expression
f1ofvswap ((𝐹:𝐴1-1-onto𝐵𝑋𝐴𝑌𝐴) → ((𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}):𝐴1-1-onto𝐵)

Proof of Theorem f1ofvswap
StepHypRef Expression
1 f1oi 6737 . . . . . 6 ( I ↾ (𝐴 ∖ {𝑋, 𝑌})):(𝐴 ∖ {𝑋, 𝑌})–1-1-onto→(𝐴 ∖ {𝑋, 𝑌})
2 f1oprswap 6743 . . . . . 6 ((𝑋𝐴𝑌𝐴) → {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}:{𝑋, 𝑌}–1-1-onto→{𝑋, 𝑌})
3 disjdifr 4403 . . . . . . 7 ((𝐴 ∖ {𝑋, 𝑌}) ∩ {𝑋, 𝑌}) = ∅
4 f1oun 6719 . . . . . . 7 (((( I ↾ (𝐴 ∖ {𝑋, 𝑌})):(𝐴 ∖ {𝑋, 𝑌})–1-1-onto→(𝐴 ∖ {𝑋, 𝑌}) ∧ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}:{𝑋, 𝑌}–1-1-onto→{𝑋, 𝑌}) ∧ (((𝐴 ∖ {𝑋, 𝑌}) ∩ {𝑋, 𝑌}) = ∅ ∧ ((𝐴 ∖ {𝑋, 𝑌}) ∩ {𝑋, 𝑌}) = ∅)) → (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})–1-1-onto→((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}))
53, 3, 4mpanr12 701 . . . . . 6 ((( I ↾ (𝐴 ∖ {𝑋, 𝑌})):(𝐴 ∖ {𝑋, 𝑌})–1-1-onto→(𝐴 ∖ {𝑋, 𝑌}) ∧ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}:{𝑋, 𝑌}–1-1-onto→{𝑋, 𝑌}) → (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})–1-1-onto→((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}))
61, 2, 5sylancr 586 . . . . 5 ((𝑋𝐴𝑌𝐴) → (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})–1-1-onto→((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}))
7 prssi 4751 . . . . . . 7 ((𝑋𝐴𝑌𝐴) → {𝑋, 𝑌} ⊆ 𝐴)
8 undif 4412 . . . . . . . 8 ({𝑋, 𝑌} ⊆ 𝐴 ↔ ({𝑋, 𝑌} ∪ (𝐴 ∖ {𝑋, 𝑌})) = 𝐴)
9 uncom 4083 . . . . . . . . 9 ({𝑋, 𝑌} ∪ (𝐴 ∖ {𝑋, 𝑌})) = ((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})
109eqeq1i 2743 . . . . . . . 8 (({𝑋, 𝑌} ∪ (𝐴 ∖ {𝑋, 𝑌})) = 𝐴 ↔ ((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) = 𝐴)
118, 10bitri 274 . . . . . . 7 ({𝑋, 𝑌} ⊆ 𝐴 ↔ ((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) = 𝐴)
127, 11sylib 217 . . . . . 6 ((𝑋𝐴𝑌𝐴) → ((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) = 𝐴)
13 f1oeq23 6691 . . . . . 6 ((((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) = 𝐴 ∧ ((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) = 𝐴) → ((( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})–1-1-onto→((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) ↔ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):𝐴1-1-onto𝐴))
1412, 12, 13syl2anc 583 . . . . 5 ((𝑋𝐴𝑌𝐴) → ((( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})–1-1-onto→((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) ↔ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):𝐴1-1-onto𝐴))
156, 14mpbid 231 . . . 4 ((𝑋𝐴𝑌𝐴) → (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):𝐴1-1-onto𝐴)
16 f1oco 6722 . . . 4 ((𝐹:𝐴1-1-onto𝐵 ∧ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):𝐴1-1-onto𝐴) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})):𝐴1-1-onto𝐵)
1715, 16sylan2 592 . . 3 ((𝐹:𝐴1-1-onto𝐵 ∧ (𝑋𝐴𝑌𝐴)) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})):𝐴1-1-onto𝐵)
18173impb 1113 . 2 ((𝐹:𝐴1-1-onto𝐵𝑋𝐴𝑌𝐴) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})):𝐴1-1-onto𝐵)
19 f1ofn 6701 . . . 4 (𝐹:𝐴1-1-onto𝐵𝐹 Fn 𝐴)
20 coundi 6140 . . . . . 6 (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})) = ((𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) ∪ (𝐹 ∘ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}))
21 fcoconst 6988 . . . . . . . . . . 11 ((𝐹 Fn 𝐴𝑌𝐴) → (𝐹 ∘ ({𝑋} × {𝑌})) = ({𝑋} × {(𝐹𝑌)}))
22213adant2 1129 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑋} × {𝑌})) = ({𝑋} × {(𝐹𝑌)}))
23 xpsng 6993 . . . . . . . . . . . 12 ((𝑋𝐴𝑌𝐴) → ({𝑋} × {𝑌}) = {⟨𝑋, 𝑌⟩})
2423coeq2d 5760 . . . . . . . . . . 11 ((𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑋} × {𝑌})) = (𝐹 ∘ {⟨𝑋, 𝑌⟩}))
25243adant1 1128 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑋} × {𝑌})) = (𝐹 ∘ {⟨𝑋, 𝑌⟩}))
26 fvex 6769 . . . . . . . . . . . 12 (𝐹𝑌) ∈ V
27 xpsng 6993 . . . . . . . . . . . 12 ((𝑋𝐴 ∧ (𝐹𝑌) ∈ V) → ({𝑋} × {(𝐹𝑌)}) = {⟨𝑋, (𝐹𝑌)⟩})
2826, 27mpan2 687 . . . . . . . . . . 11 (𝑋𝐴 → ({𝑋} × {(𝐹𝑌)}) = {⟨𝑋, (𝐹𝑌)⟩})
29283ad2ant2 1132 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → ({𝑋} × {(𝐹𝑌)}) = {⟨𝑋, (𝐹𝑌)⟩})
3022, 25, 293eqtr3d 2786 . . . . . . . . 9 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ {⟨𝑋, 𝑌⟩}) = {⟨𝑋, (𝐹𝑌)⟩})
31 fcoconst 6988 . . . . . . . . . . 11 ((𝐹 Fn 𝐴𝑋𝐴) → (𝐹 ∘ ({𝑌} × {𝑋})) = ({𝑌} × {(𝐹𝑋)}))
32313adant3 1130 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑌} × {𝑋})) = ({𝑌} × {(𝐹𝑋)}))
33 xpsng 6993 . . . . . . . . . . . . 13 ((𝑌𝐴𝑋𝐴) → ({𝑌} × {𝑋}) = {⟨𝑌, 𝑋⟩})
3433coeq2d 5760 . . . . . . . . . . . 12 ((𝑌𝐴𝑋𝐴) → (𝐹 ∘ ({𝑌} × {𝑋})) = (𝐹 ∘ {⟨𝑌, 𝑋⟩}))
3534ancoms 458 . . . . . . . . . . 11 ((𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑌} × {𝑋})) = (𝐹 ∘ {⟨𝑌, 𝑋⟩}))
36353adant1 1128 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑌} × {𝑋})) = (𝐹 ∘ {⟨𝑌, 𝑋⟩}))
37 fvex 6769 . . . . . . . . . . . 12 (𝐹𝑋) ∈ V
38 xpsng 6993 . . . . . . . . . . . 12 ((𝑌𝐴 ∧ (𝐹𝑋) ∈ V) → ({𝑌} × {(𝐹𝑋)}) = {⟨𝑌, (𝐹𝑋)⟩})
3937, 38mpan2 687 . . . . . . . . . . 11 (𝑌𝐴 → ({𝑌} × {(𝐹𝑋)}) = {⟨𝑌, (𝐹𝑋)⟩})
40393ad2ant3 1133 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → ({𝑌} × {(𝐹𝑋)}) = {⟨𝑌, (𝐹𝑋)⟩})
4132, 36, 403eqtr3d 2786 . . . . . . . . 9 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ {⟨𝑌, 𝑋⟩}) = {⟨𝑌, (𝐹𝑋)⟩})
4230, 41uneq12d 4094 . . . . . . . 8 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → ((𝐹 ∘ {⟨𝑋, 𝑌⟩}) ∪ (𝐹 ∘ {⟨𝑌, 𝑋⟩})) = ({⟨𝑋, (𝐹𝑌)⟩} ∪ {⟨𝑌, (𝐹𝑋)⟩}))
43 df-pr 4561 . . . . . . . . . 10 {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩} = ({⟨𝑋, 𝑌⟩} ∪ {⟨𝑌, 𝑋⟩})
4443coeq2i 5758 . . . . . . . . 9 (𝐹 ∘ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}) = (𝐹 ∘ ({⟨𝑋, 𝑌⟩} ∪ {⟨𝑌, 𝑋⟩}))
45 coundi 6140 . . . . . . . . 9 (𝐹 ∘ ({⟨𝑋, 𝑌⟩} ∪ {⟨𝑌, 𝑋⟩})) = ((𝐹 ∘ {⟨𝑋, 𝑌⟩}) ∪ (𝐹 ∘ {⟨𝑌, 𝑋⟩}))
4644, 45eqtri 2766 . . . . . . . 8 (𝐹 ∘ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}) = ((𝐹 ∘ {⟨𝑋, 𝑌⟩}) ∪ (𝐹 ∘ {⟨𝑌, 𝑋⟩}))
47 df-pr 4561 . . . . . . . 8 {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩} = ({⟨𝑋, (𝐹𝑌)⟩} ∪ {⟨𝑌, (𝐹𝑋)⟩})
4842, 46, 473eqtr4g 2804 . . . . . . 7 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}) = {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩})
4948uneq2d 4093 . . . . . 6 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → ((𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) ∪ (𝐹 ∘ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})) = ((𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}))
5020, 49eqtrid 2790 . . . . 5 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})) = ((𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}))
51 coires1 6157 . . . . . 6 (𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) = (𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌}))
5251uneq1i 4089 . . . . 5 ((𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}) = ((𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩})
5350, 52eqtrdi 2795 . . . 4 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})) = ((𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}))
5419, 53syl3an1 1161 . . 3 ((𝐹:𝐴1-1-onto𝐵𝑋𝐴𝑌𝐴) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})) = ((𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}))
5554f1oeq1d 6695 . 2 ((𝐹:𝐴1-1-onto𝐵𝑋𝐴𝑌𝐴) → ((𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})):𝐴1-1-onto𝐵 ↔ ((𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}):𝐴1-1-onto𝐵))
5618, 55mpbid 231 1 ((𝐹:𝐴1-1-onto𝐵𝑋𝐴𝑌𝐴) → ((𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}):𝐴1-1-onto𝐵)
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 205  wa 395  w3a 1085   = wceq 1539  wcel 2108  Vcvv 3422  cdif 3880  cun 3881  cin 3882  wss 3883  c0 4253  {csn 4558  {cpr 4560  cop 4564   I cid 5479   × cxp 5578  cres 5582  ccom 5584   Fn wfn 6413  1-1-ontowf1o 6417  cfv 6418
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1799  ax-4 1813  ax-5 1914  ax-6 1972  ax-7 2012  ax-8 2110  ax-9 2118  ax-10 2139  ax-11 2156  ax-12 2173  ax-ext 2709  ax-sep 5218  ax-nul 5225  ax-pr 5347
This theorem depends on definitions:  df-bi 206  df-an 396  df-or 844  df-3an 1087  df-tru 1542  df-fal 1552  df-ex 1784  df-nf 1788  df-sb 2069  df-mo 2540  df-eu 2569  df-clab 2716  df-cleq 2730  df-clel 2817  df-nfc 2888  df-ne 2943  df-ral 3068  df-rex 3069  df-reu 3070  df-rab 3072  df-v 3424  df-sbc 3712  df-csb 3829  df-dif 3886  df-un 3888  df-in 3890  df-ss 3900  df-nul 4254  df-if 4457  df-sn 4559  df-pr 4561  df-op 4565  df-uni 4837  df-br 5071  df-opab 5133  df-mpt 5154  df-id 5480  df-xp 5586  df-rel 5587  df-cnv 5588  df-co 5589  df-dm 5590  df-rn 5591  df-res 5592  df-ima 5593  df-iota 6376  df-fun 6420  df-fn 6421  df-f 6422  df-f1 6423  df-fo 6424  df-f1o 6425  df-fv 6426
This theorem is referenced by:  dif1en  8907
  Copyright terms: Public domain W3C validator