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

Theorem curry1 8118
Description: Composition with ◡(2nd ↾ ({𝐶} × V)) turns any binary operation 𝐹 with a constant first operand into a function 𝐺 of the second operand only. This transformation is called "currying". (Contributed by NM, 28-Mar-2008.) (Revised by Mario Carneiro, 26-Dec-2014.)
Hypothesis
Ref Expression
curry1.1 𝐺 = (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V)))
Assertion
Ref Expression
curry1 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → 𝐺 = (𝑥 ∈ 𝐵 ↦ (𝐶𝐹𝑥)))
Distinct variable groups:   𝑥,𝐴   𝑥,𝐵   𝑥,𝐶   𝑥,𝐹   𝑥,𝐺

Proof of Theorem curry1
StepHypRef Expression
1 fnfun 6640 . . . . 5 (𝐹 Fn (𝐴 × 𝐵) → Fun 𝐹)
2 2ndconst 8115 . . . . . 6 (𝐶 ∈ 𝐴 → (2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V)
3 dff1o3 6832 . . . . . . 7 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ↔ ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–onto→V ∧ Fun ◡(2nd ↾ ({𝐶} × V))))
43simprbi 503 . . . . . 6 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V → Fun ◡(2nd ↾ ({𝐶} × V)))
52, 4syl 18 . . . . 5 (𝐶 ∈ 𝐴 → Fun ◡(2nd ↾ ({𝐶} × V)))
6 funco 6581 . . . . 5 ((Fun 𝐹 ∧ Fun ◡(2nd ↾ ({𝐶} × V))) → Fun (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V))))
71, 5, 6syl2an 608 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → Fun (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V))))
8 dmco 6256 . . . . 5 dom (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V))) = (◡◡(2nd ↾ ({𝐶} × V)) “ dom 𝐹)
9 fndm 6643 . . . . . . . 8 (𝐹 Fn (𝐴 × 𝐵) → dom 𝐹 = (𝐴 × 𝐵))
109adantr 486 . . . . . . 7 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → dom 𝐹 = (𝐴 × 𝐵))
1110imaeq2d 6051 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → (◡◡(2nd ↾ ({𝐶} × V)) “ dom 𝐹) = (◡◡(2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)))
12 imacnvcnv 6207 . . . . . . . . 9 (◡◡(2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵))
13 df-ima 5663 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ran ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵))
14 resres 5982 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵)) = (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
1514rneqi 5918 . . . . . . . . 9 ran ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵)) = ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
1612, 13, 153eqtri 2787 . . . . . . . 8 (◡◡(2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
17 inxp 5808 . . . . . . . . . . . . 13 (({𝐶} × V) ∩ (𝐴 × 𝐵)) = (({𝐶} ∩ 𝐴) × (V ∩ 𝐵))
18 incom 4106 . . . . . . . . . . . . . . 15 (V ∩ 𝐵) = (𝐵 ∩ V)
19 inv1 4347 . . . . . . . . . . . . . . 15 (𝐵 ∩ V) = 𝐵
2018, 19eqtri 2783 . . . . . . . . . . . . . 14 (V ∩ 𝐵) = 𝐵
2120xpeq2i 5677 . . . . . . . . . . . . 13 (({𝐶} ∩ 𝐴) × (V ∩ 𝐵)) = (({𝐶} ∩ 𝐴) × 𝐵)
2217, 21eqtri 2783 . . . . . . . . . . . 12 (({𝐶} × V) ∩ (𝐴 × 𝐵)) = (({𝐶} ∩ 𝐴) × 𝐵)
23 snssi 4742 . . . . . . . . . . . . . 14 (𝐶 ∈ 𝐴 → {𝐶} ⊆ 𝐴)
24 dfss2 4094 . . . . . . . . . . . . . 14 ({𝐶} ⊆ 𝐴 ↔ ({𝐶} ∩ 𝐴) = {𝐶})
2523, 24sylib 221 . . . . . . . . . . . . 13 (𝐶 ∈ 𝐴 → ({𝐶} ∩ 𝐴) = {𝐶})
2625xpeq1d 5679 . . . . . . . . . . . 12 (𝐶 ∈ 𝐴 → (({𝐶} ∩ 𝐴) × 𝐵) = ({𝐶} × 𝐵))
2722, 26eqtrid 2807 . . . . . . . . . . 11 (𝐶 ∈ 𝐴 → (({𝐶} × V) ∩ (𝐴 × 𝐵)) = ({𝐶} × 𝐵))
2827reseq2d 5969 . . . . . . . . . 10 (𝐶 ∈ 𝐴 → (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = (2nd ↾ ({𝐶} × 𝐵)))
2928rneqd 5919 . . . . . . . . 9 (𝐶 ∈ 𝐴 → ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = ran (2nd ↾ ({𝐶} × 𝐵)))
30 2ndconst 8115 . . . . . . . . . 10 (𝐶 ∈ 𝐴 → (2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–1-1-onto→𝐵)
31 f1ofo 6833 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–1-1-onto→𝐵 → (2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–onto→𝐵)
32 forn 6800 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–onto→𝐵 → ran (2nd ↾ ({𝐶} × 𝐵)) = 𝐵)
3330, 31, 323syl 19 . . . . . . . . 9 (𝐶 ∈ 𝐴 → ran (2nd ↾ ({𝐶} × 𝐵)) = 𝐵)
3429, 33eqtrd 2795 . . . . . . . 8 (𝐶 ∈ 𝐴 → ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = 𝐵)
3516, 34eqtrid 2807 . . . . . . 7 (𝐶 ∈ 𝐴 → (◡◡(2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = 𝐵)
3635adantl 487 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → (◡◡(2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = 𝐵)
3711, 36eqtrd 2795 . . . . 5 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → (◡◡(2nd ↾ ({𝐶} × V)) “ dom 𝐹) = 𝐵)
388, 37eqtrid 2807 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → dom (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V))) = 𝐵)
39 curry1.1 . . . . . 6 𝐺 = (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V)))
4039fneq1i 6637 . . . . 5 (𝐺 Fn 𝐵 ↔ (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V))) Fn 𝐵)
41 df-fn 6542 . . . . 5 ((𝐹 ∘ ◡(2nd ↾ ({𝐶} × V))) Fn 𝐵 ↔ (Fun (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V))) ∧ dom (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V))) = 𝐵))
4240, 41bitri 278 . . . 4 (𝐺 Fn 𝐵 ↔ (Fun (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V))) ∧ dom (𝐹 ∘ ◡(2nd ↾ ({𝐶} × V))) = 𝐵))
437, 38, 42sylanbrc 595 . . 3 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → 𝐺 Fn 𝐵)
44 dffn5 6944 . . 3 (𝐺 Fn 𝐵 ↔ 𝐺 = (𝑥 ∈ 𝐵 ↦ (𝐺‘𝑥)))
4543, 44sylib 221 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → 𝐺 = (𝑥 ∈ 𝐵 ↦ (𝐺‘𝑥)))
4639fveq1i 6887 . . . . 5 (𝐺‘𝑥) = ((𝐹 ∘ ◡(2nd ↾ ({𝐶} × V)))‘𝑥)
47 dff1o4 6834 . . . . . . . 8 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ↔ ((2nd ↾ ({𝐶} × V)) Fn ({𝐶} × V) ∧ ◡(2nd ↾ ({𝐶} × V)) Fn V))
482, 47sylib 221 . . . . . . 7 (𝐶 ∈ 𝐴 → ((2nd ↾ ({𝐶} × V)) Fn ({𝐶} × V) ∧ ◡(2nd ↾ ({𝐶} × V)) Fn V))
49 fvco2 6983 . . . . . . . 8 ((◡(2nd ↾ ({𝐶} × V)) Fn V ∧ 𝑥 ∈ V) → ((𝐹 ∘ ◡(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘(◡(2nd ↾ ({𝐶} × V))‘𝑥)))
5049elvd 3456 . . . . . . 7 (◡(2nd ↾ ({𝐶} × V)) Fn V → ((𝐹 ∘ ◡(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘(◡(2nd ↾ ({𝐶} × V))‘𝑥)))
5148, 50simpl2im 513 . . . . . 6 (𝐶 ∈ 𝐴 → ((𝐹 ∘ ◡(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘(◡(2nd ↾ ({𝐶} × V))‘𝑥)))
5251ad2antlr 740 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) ∧ 𝑥 ∈ 𝐵) → ((𝐹 ∘ ◡(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘(◡(2nd ↾ ({𝐶} × V))‘𝑥)))
5346, 52eqtrid 2807 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) ∧ 𝑥 ∈ 𝐵) → (𝐺‘𝑥) = (𝐹‘(◡(2nd ↾ ({𝐶} × V))‘𝑥)))
542adantr 486 . . . . . . . . 9 ((𝐶 ∈ 𝐴 ∧ 𝑥 ∈ 𝐵) → (2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V)
55 snidg 4617 . . . . . . . . . . 11 (𝐶 ∈ 𝐴 → 𝐶 ∈ {𝐶})
56 vex 3454 . . . . . . . . . . 11 𝑥 ∈ V
57 opelxp 5686 . . . . . . . . . . 11 (⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V) ↔ (𝐶 ∈ {𝐶} ∧ 𝑥 ∈ V))
5855, 56, 57sylanblrc 602 . . . . . . . . . 10 (𝐶 ∈ 𝐴 → ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V))
5958adantr 486 . . . . . . . . 9 ((𝐶 ∈ 𝐴 ∧ 𝑥 ∈ 𝐵) → ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V))
6054, 59jca 521 . . . . . . . 8 ((𝐶 ∈ 𝐴 ∧ 𝑥 ∈ 𝐵) → ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ∧ ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V)))
6158fvresd 6906 . . . . . . . . . 10 (𝐶 ∈ 𝐴 → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = (2nd ‘⟨𝐶, 𝑥⟩))
62 op2ndg 8015 . . . . . . . . . . 11 ((𝐶 ∈ 𝐴 ∧ 𝑥 ∈ V) → (2nd ‘⟨𝐶, 𝑥⟩) = 𝑥)
6362elvd 3456 . . . . . . . . . 10 (𝐶 ∈ 𝐴 → (2nd ‘⟨𝐶, 𝑥⟩) = 𝑥)
6461, 63eqtrd 2795 . . . . . . . . 9 (𝐶 ∈ 𝐴 → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥)
6564adantr 486 . . . . . . . 8 ((𝐶 ∈ 𝐴 ∧ 𝑥 ∈ 𝐵) → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥)
66 f1ocnvfv 7287 . . . . . . . 8 (((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ∧ ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V)) → (((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥 → (◡(2nd ↾ ({𝐶} × V))‘𝑥) = ⟨𝐶, 𝑥⟩))
6760, 65, 66sylc 66 . . . . . . 7 ((𝐶 ∈ 𝐴 ∧ 𝑥 ∈ 𝐵) → (◡(2nd ↾ ({𝐶} × V))‘𝑥) = ⟨𝐶, 𝑥⟩)
6867fveq2d 6890 . . . . . 6 ((𝐶 ∈ 𝐴 ∧ 𝑥 ∈ 𝐵) → (𝐹‘(◡(2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐹‘⟨𝐶, 𝑥⟩))
6968adantll 727 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) ∧ 𝑥 ∈ 𝐵) → (𝐹‘(◡(2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐹‘⟨𝐶, 𝑥⟩))
70 df-ov 7424 . . . . 5 (𝐶𝐹𝑥) = (𝐹‘⟨𝐶, 𝑥⟩)
7169, 70eqtr4di 2813 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) ∧ 𝑥 ∈ 𝐵) → (𝐹‘(◡(2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐶𝐹𝑥))
7253, 71eqtrd 2795 . . 3 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) ∧ 𝑥 ∈ 𝐵) → (𝐺‘𝑥) = (𝐶𝐹𝑥))
7372mpteq2dva 5197 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → (𝑥 ∈ 𝐵 ↦ (𝐺‘𝑥)) = (𝑥 ∈ 𝐵 ↦ (𝐶𝐹𝑥)))
7445, 73eqtrd 2795 1 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶 ∈ 𝐴) → 𝐺 = (𝑥 ∈ 𝐵 ↦ (𝐶𝐹𝑥)))
Colors of variables:    wff setvar class
This proof depends on syntax axioms:   → wi 4   ∧ wa 401   = wceq 1569   ∈ wcel 2144  Vcvv 3450   ⊆ wss 3895   ∩ cin 4089  {csn 4584  ⟨cop 4834   ↦ cmpt 5185   × cxp 5648  ◡ccnv 5649  dom cdm 5650  ran crn 5651   ↾ cres 5652   “ cima 5653   ∘ ccom 5654  Fun wfun 6533   Fn wfn 6534  –onto→wfo 6537  –1-1-onto→wf1o 6538  ‘cfv 6539  (class class class)co 7421  2nd c2nd 8001
This proof depends on axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1827  ax-4 1841  ax-5 1942  ax-6 1999  ax-7 2040  ax-8 2146  ax-9 2154  ax-10 2177  ax-11 2193  ax-12 2212  ax-ext 2732  ax-sep 5248  ax-nul 5259  ax-pr 5390  ax-un 7752
This proof depends on definitions:  df-bi 210  df-an 402  df-or 862  df-3an 1105  df-tru 1572  df-fal 1582  df-ex 1812  df-nf 1816  df-sb 2099  df-mo 2564  df-eu 2594  df-clab 2739  df-cleq 2752  df-clel 2835  df-nfc 2909  df-ne 2956  df-ral 3077  df-rex 3087  df-rab 3413  df-v 3452  df-sbc 3739  df-csb 3847  df-ss 3896  df-dif 4047  df-in 4091  df-un 4151  df-nul 4279  df-if 4482  df-sn 4585  df-pr 4587  df-op 4835  df-uni 4867  df-iun 4952  df-br 5103  df-opab 5167  df-mpt 5186  df-id 5545  df-xp 5656  df-rel 5657  df-cnv 5658  df-co 5659  df-dm 5660  df-rn 5661  df-res 5662  df-ima 5663  df-iota 6494  df-fun 6541  df-fn 6542  df-f 6543  df-f1 6544  df-fo 6545  df-f1o 6546  df-fv 6547  df-ov 7424  df-1st 8002  df-2nd 8003
This theorem is used by:  curry1val  8119  curry1f  8120
  Copyright terms: Public domain W3C validator