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

Theorem f1ofvswap 7178
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 6754 . . . . . 6 ( I ↾ (𝐴 ∖ {𝑋, 𝑌})):(𝐴 ∖ {𝑋, 𝑌})–1-1-onto→(𝐴 ∖ {𝑋, 𝑌})
2 f1oprswap 6760 . . . . . 6 ((𝑋𝐴𝑌𝐴) → {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}:{𝑋, 𝑌}–1-1-onto→{𝑋, 𝑌})
3 disjdifr 4406 . . . . . . 7 ((𝐴 ∖ {𝑋, 𝑌}) ∩ {𝑋, 𝑌}) = ∅
4 f1oun 6735 . . . . . . 7 (((( I ↾ (𝐴 ∖ {𝑋, 𝑌})):(𝐴 ∖ {𝑋, 𝑌})–1-1-onto→(𝐴 ∖ {𝑋, 𝑌}) ∧ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}:{𝑋, 𝑌}–1-1-onto→{𝑋, 𝑌}) ∧ (((𝐴 ∖ {𝑋, 𝑌}) ∩ {𝑋, 𝑌}) = ∅ ∧ ((𝐴 ∖ {𝑋, 𝑌}) ∩ {𝑋, 𝑌}) = ∅)) → (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})–1-1-onto→((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}))
53, 3, 4mpanr12 702 . . . . . 6 ((( I ↾ (𝐴 ∖ {𝑋, 𝑌})):(𝐴 ∖ {𝑋, 𝑌})–1-1-onto→(𝐴 ∖ {𝑋, 𝑌}) ∧ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}:{𝑋, 𝑌}–1-1-onto→{𝑋, 𝑌}) → (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})–1-1-onto→((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}))
61, 2, 5sylancr 587 . . . . 5 ((𝑋𝐴𝑌𝐴) → (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})–1-1-onto→((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}))
7 prssi 4754 . . . . . . 7 ((𝑋𝐴𝑌𝐴) → {𝑋, 𝑌} ⊆ 𝐴)
8 undif 4415 . . . . . . . 8 ({𝑋, 𝑌} ⊆ 𝐴 ↔ ({𝑋, 𝑌} ∪ (𝐴 ∖ {𝑋, 𝑌})) = 𝐴)
9 uncom 4087 . . . . . . . . 9 ({𝑋, 𝑌} ∪ (𝐴 ∖ {𝑋, 𝑌})) = ((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})
109eqeq1i 2743 . . . . . . . 8 (({𝑋, 𝑌} ∪ (𝐴 ∖ {𝑋, 𝑌})) = 𝐴 ↔ ((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) = 𝐴)
118, 10bitri 274 . . . . . . 7 ({𝑋, 𝑌} ⊆ 𝐴 ↔ ((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) = 𝐴)
127, 11sylib 217 . . . . . 6 ((𝑋𝐴𝑌𝐴) → ((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) = 𝐴)
13 f1oeq23 6707 . . . . . 6 ((((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) = 𝐴 ∧ ((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) = 𝐴) → ((( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})–1-1-onto→((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) ↔ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):𝐴1-1-onto𝐴))
1412, 12, 13syl2anc 584 . . . . 5 ((𝑋𝐴𝑌𝐴) → ((( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌})–1-1-onto→((𝐴 ∖ {𝑋, 𝑌}) ∪ {𝑋, 𝑌}) ↔ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):𝐴1-1-onto𝐴))
156, 14mpbid 231 . . . 4 ((𝑋𝐴𝑌𝐴) → (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):𝐴1-1-onto𝐴)
16 f1oco 6739 . . . 4 ((𝐹:𝐴1-1-onto𝐵 ∧ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}):𝐴1-1-onto𝐴) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})):𝐴1-1-onto𝐵)
1715, 16sylan2 593 . . 3 ((𝐹:𝐴1-1-onto𝐵 ∧ (𝑋𝐴𝑌𝐴)) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})):𝐴1-1-onto𝐵)
18173impb 1114 . 2 ((𝐹:𝐴1-1-onto𝐵𝑋𝐴𝑌𝐴) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})):𝐴1-1-onto𝐵)
19 f1ofn 6717 . . . 4 (𝐹:𝐴1-1-onto𝐵𝐹 Fn 𝐴)
20 coundi 6151 . . . . . 6 (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})) = ((𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) ∪ (𝐹 ∘ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}))
21 fcoconst 7006 . . . . . . . . . . 11 ((𝐹 Fn 𝐴𝑌𝐴) → (𝐹 ∘ ({𝑋} × {𝑌})) = ({𝑋} × {(𝐹𝑌)}))
22213adant2 1130 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑋} × {𝑌})) = ({𝑋} × {(𝐹𝑌)}))
23 xpsng 7011 . . . . . . . . . . . 12 ((𝑋𝐴𝑌𝐴) → ({𝑋} × {𝑌}) = {⟨𝑋, 𝑌⟩})
2423coeq2d 5771 . . . . . . . . . . 11 ((𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑋} × {𝑌})) = (𝐹 ∘ {⟨𝑋, 𝑌⟩}))
25243adant1 1129 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑋} × {𝑌})) = (𝐹 ∘ {⟨𝑋, 𝑌⟩}))
26 fvex 6787 . . . . . . . . . . . 12 (𝐹𝑌) ∈ V
27 xpsng 7011 . . . . . . . . . . . 12 ((𝑋𝐴 ∧ (𝐹𝑌) ∈ V) → ({𝑋} × {(𝐹𝑌)}) = {⟨𝑋, (𝐹𝑌)⟩})
2826, 27mpan2 688 . . . . . . . . . . 11 (𝑋𝐴 → ({𝑋} × {(𝐹𝑌)}) = {⟨𝑋, (𝐹𝑌)⟩})
29283ad2ant2 1133 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → ({𝑋} × {(𝐹𝑌)}) = {⟨𝑋, (𝐹𝑌)⟩})
3022, 25, 293eqtr3d 2786 . . . . . . . . 9 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ {⟨𝑋, 𝑌⟩}) = {⟨𝑋, (𝐹𝑌)⟩})
31 fcoconst 7006 . . . . . . . . . . 11 ((𝐹 Fn 𝐴𝑋𝐴) → (𝐹 ∘ ({𝑌} × {𝑋})) = ({𝑌} × {(𝐹𝑋)}))
32313adant3 1131 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑌} × {𝑋})) = ({𝑌} × {(𝐹𝑋)}))
33 xpsng 7011 . . . . . . . . . . . . 13 ((𝑌𝐴𝑋𝐴) → ({𝑌} × {𝑋}) = {⟨𝑌, 𝑋⟩})
3433coeq2d 5771 . . . . . . . . . . . 12 ((𝑌𝐴𝑋𝐴) → (𝐹 ∘ ({𝑌} × {𝑋})) = (𝐹 ∘ {⟨𝑌, 𝑋⟩}))
3534ancoms 459 . . . . . . . . . . 11 ((𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑌} × {𝑋})) = (𝐹 ∘ {⟨𝑌, 𝑋⟩}))
36353adant1 1129 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ ({𝑌} × {𝑋})) = (𝐹 ∘ {⟨𝑌, 𝑋⟩}))
37 fvex 6787 . . . . . . . . . . . 12 (𝐹𝑋) ∈ V
38 xpsng 7011 . . . . . . . . . . . 12 ((𝑌𝐴 ∧ (𝐹𝑋) ∈ V) → ({𝑌} × {(𝐹𝑋)}) = {⟨𝑌, (𝐹𝑋)⟩})
3937, 38mpan2 688 . . . . . . . . . . 11 (𝑌𝐴 → ({𝑌} × {(𝐹𝑋)}) = {⟨𝑌, (𝐹𝑋)⟩})
40393ad2ant3 1134 . . . . . . . . . 10 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → ({𝑌} × {(𝐹𝑋)}) = {⟨𝑌, (𝐹𝑋)⟩})
4132, 36, 403eqtr3d 2786 . . . . . . . . 9 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ {⟨𝑌, 𝑋⟩}) = {⟨𝑌, (𝐹𝑋)⟩})
4230, 41uneq12d 4098 . . . . . . . 8 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → ((𝐹 ∘ {⟨𝑋, 𝑌⟩}) ∪ (𝐹 ∘ {⟨𝑌, 𝑋⟩})) = ({⟨𝑋, (𝐹𝑌)⟩} ∪ {⟨𝑌, (𝐹𝑋)⟩}))
43 df-pr 4564 . . . . . . . . . 10 {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩} = ({⟨𝑋, 𝑌⟩} ∪ {⟨𝑌, 𝑋⟩})
4443coeq2i 5769 . . . . . . . . 9 (𝐹 ∘ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}) = (𝐹 ∘ ({⟨𝑋, 𝑌⟩} ∪ {⟨𝑌, 𝑋⟩}))
45 coundi 6151 . . . . . . . . 9 (𝐹 ∘ ({⟨𝑋, 𝑌⟩} ∪ {⟨𝑌, 𝑋⟩})) = ((𝐹 ∘ {⟨𝑋, 𝑌⟩}) ∪ (𝐹 ∘ {⟨𝑌, 𝑋⟩}))
4644, 45eqtri 2766 . . . . . . . 8 (𝐹 ∘ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}) = ((𝐹 ∘ {⟨𝑋, 𝑌⟩}) ∪ (𝐹 ∘ {⟨𝑌, 𝑋⟩}))
47 df-pr 4564 . . . . . . . 8 {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩} = ({⟨𝑋, (𝐹𝑌)⟩} ∪ {⟨𝑌, (𝐹𝑋)⟩})
4842, 46, 473eqtr4g 2803 . . . . . . 7 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩}) = {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩})
4948uneq2d 4097 . . . . . 6 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → ((𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) ∪ (𝐹 ∘ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})) = ((𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}))
5020, 49eqtrid 2790 . . . . 5 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})) = ((𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}))
51 coires1 6168 . . . . . 6 (𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) = (𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌}))
5251uneq1i 4093 . . . . 5 ((𝐹 ∘ ( I ↾ (𝐴 ∖ {𝑋, 𝑌}))) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}) = ((𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩})
5350, 52eqtrdi 2794 . . . 4 ((𝐹 Fn 𝐴𝑋𝐴𝑌𝐴) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})) = ((𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}))
5419, 53syl3an1 1162 . . 3 ((𝐹:𝐴1-1-onto𝐵𝑋𝐴𝑌𝐴) → (𝐹 ∘ (( I ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, 𝑌⟩, ⟨𝑌, 𝑋⟩})) = ((𝐹 ↾ (𝐴 ∖ {𝑋, 𝑌})) ∪ {⟨𝑋, (𝐹𝑌)⟩, ⟨𝑌, (𝐹𝑋)⟩}))
5554f1oeq1d 6711 . 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 396  w3a 1086   = wceq 1539  wcel 2106  Vcvv 3432  cdif 3884  cun 3885  cin 3886  wss 3887  c0 4256  {csn 4561  {cpr 4563  cop 4567   I cid 5488   × cxp 5587  cres 5591  ccom 5593   Fn wfn 6428  1-1-ontowf1o 6432  cfv 6433
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1798  ax-4 1812  ax-5 1913  ax-6 1971  ax-7 2011  ax-8 2108  ax-9 2116  ax-10 2137  ax-11 2154  ax-12 2171  ax-ext 2709  ax-sep 5223  ax-nul 5230  ax-pr 5352
This theorem depends on definitions:  df-bi 206  df-an 397  df-or 845  df-3an 1088  df-tru 1542  df-fal 1552  df-ex 1783  df-nf 1787  df-sb 2068  df-mo 2540  df-eu 2569  df-clab 2716  df-cleq 2730  df-clel 2816  df-nfc 2889  df-ne 2944  df-ral 3069  df-rex 3070  df-reu 3072  df-rab 3073  df-v 3434  df-sbc 3717  df-csb 3833  df-dif 3890  df-un 3892  df-in 3894  df-ss 3904  df-nul 4257  df-if 4460  df-sn 4562  df-pr 4564  df-op 4568  df-uni 4840  df-br 5075  df-opab 5137  df-mpt 5158  df-id 5489  df-xp 5595  df-rel 5596  df-cnv 5597  df-co 5598  df-dm 5599  df-rn 5600  df-res 5601  df-ima 5602  df-iota 6391  df-fun 6435  df-fn 6436  df-f 6437  df-f1 6438  df-fo 6439  df-f1o 6440  df-fv 6441
This theorem is referenced by:  dif1en  8945
  Copyright terms: Public domain W3C validator