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

Theorem curry1 7915
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 6517 . . . . 5 (𝐹 Fn (𝐴 × 𝐵) → Fun 𝐹)
2 2ndconst 7912 . . . . . 6 (𝐶𝐴 → (2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V)
3 dff1o3 6706 . . . . . . 7 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ↔ ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–onto→V ∧ Fun (2nd ↾ ({𝐶} × V))))
43simprbi 496 . . . . . 6 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V → Fun (2nd ↾ ({𝐶} × V)))
52, 4syl 17 . . . . 5 (𝐶𝐴 → Fun (2nd ↾ ({𝐶} × V)))
6 funco 6458 . . . . 5 ((Fun 𝐹 ∧ Fun (2nd ↾ ({𝐶} × V))) → Fun (𝐹(2nd ↾ ({𝐶} × V))))
71, 5, 6syl2an 595 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → Fun (𝐹(2nd ↾ ({𝐶} × V))))
8 dmco 6147 . . . . 5 dom (𝐹(2nd ↾ ({𝐶} × V))) = ((2nd ↾ ({𝐶} × V)) “ dom 𝐹)
9 fndm 6520 . . . . . . . 8 (𝐹 Fn (𝐴 × 𝐵) → dom 𝐹 = (𝐴 × 𝐵))
109adantr 480 . . . . . . 7 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → dom 𝐹 = (𝐴 × 𝐵))
1110imaeq2d 5958 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ dom 𝐹) = ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)))
12 imacnvcnv 6098 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵))
13 df-ima 5593 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ran ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵))
14 resres 5893 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵)) = (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
1514rneqi 5835 . . . . . . . . 9 ran ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵)) = ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
1612, 13, 153eqtri 2770 . . . . . . . 8 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
17 inxp 5730 . . . . . . . . . . . . 13 (({𝐶} × V) ∩ (𝐴 × 𝐵)) = (({𝐶} ∩ 𝐴) × (V ∩ 𝐵))
18 incom 4131 . . . . . . . . . . . . . . 15 (V ∩ 𝐵) = (𝐵 ∩ V)
19 inv1 4325 . . . . . . . . . . . . . . 15 (𝐵 ∩ V) = 𝐵
2018, 19eqtri 2766 . . . . . . . . . . . . . 14 (V ∩ 𝐵) = 𝐵
2120xpeq2i 5607 . . . . . . . . . . . . 13 (({𝐶} ∩ 𝐴) × (V ∩ 𝐵)) = (({𝐶} ∩ 𝐴) × 𝐵)
2217, 21eqtri 2766 . . . . . . . . . . . 12 (({𝐶} × V) ∩ (𝐴 × 𝐵)) = (({𝐶} ∩ 𝐴) × 𝐵)
23 snssi 4738 . . . . . . . . . . . . . 14 (𝐶𝐴 → {𝐶} ⊆ 𝐴)
24 df-ss 3900 . . . . . . . . . . . . . 14 ({𝐶} ⊆ 𝐴 ↔ ({𝐶} ∩ 𝐴) = {𝐶})
2523, 24sylib 217 . . . . . . . . . . . . 13 (𝐶𝐴 → ({𝐶} ∩ 𝐴) = {𝐶})
2625xpeq1d 5609 . . . . . . . . . . . 12 (𝐶𝐴 → (({𝐶} ∩ 𝐴) × 𝐵) = ({𝐶} × 𝐵))
2722, 26eqtrid 2790 . . . . . . . . . . 11 (𝐶𝐴 → (({𝐶} × V) ∩ (𝐴 × 𝐵)) = ({𝐶} × 𝐵))
2827reseq2d 5880 . . . . . . . . . 10 (𝐶𝐴 → (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = (2nd ↾ ({𝐶} × 𝐵)))
2928rneqd 5836 . . . . . . . . 9 (𝐶𝐴 → ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = ran (2nd ↾ ({𝐶} × 𝐵)))
30 2ndconst 7912 . . . . . . . . . 10 (𝐶𝐴 → (2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–1-1-onto𝐵)
31 f1ofo 6707 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–1-1-onto𝐵 → (2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–onto𝐵)
32 forn 6675 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–onto𝐵 → ran (2nd ↾ ({𝐶} × 𝐵)) = 𝐵)
3330, 31, 323syl 18 . . . . . . . . 9 (𝐶𝐴 → ran (2nd ↾ ({𝐶} × 𝐵)) = 𝐵)
3429, 33eqtrd 2778 . . . . . . . 8 (𝐶𝐴 → ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = 𝐵)
3516, 34eqtrid 2790 . . . . . . 7 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = 𝐵)
3635adantl 481 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = 𝐵)
3711, 36eqtrd 2778 . . . . 5 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ dom 𝐹) = 𝐵)
388, 37eqtrid 2790 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵)
39 curry1.1 . . . . . 6 𝐺 = (𝐹(2nd ↾ ({𝐶} × V)))
4039fneq1i 6514 . . . . 5 (𝐺 Fn 𝐵 ↔ (𝐹(2nd ↾ ({𝐶} × V))) Fn 𝐵)
41 df-fn 6421 . . . . 5 ((𝐹(2nd ↾ ({𝐶} × V))) Fn 𝐵 ↔ (Fun (𝐹(2nd ↾ ({𝐶} × V))) ∧ dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵))
4240, 41bitri 274 . . . 4 (𝐺 Fn 𝐵 ↔ (Fun (𝐹(2nd ↾ ({𝐶} × V))) ∧ dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵))
437, 38, 42sylanbrc 582 . . 3 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 Fn 𝐵)
44 dffn5 6810 . . 3 (𝐺 Fn 𝐵𝐺 = (𝑥𝐵 ↦ (𝐺𝑥)))
4543, 44sylib 217 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 = (𝑥𝐵 ↦ (𝐺𝑥)))
4639fveq1i 6757 . . . . 5 (𝐺𝑥) = ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥)
47 dff1o4 6708 . . . . . . . 8 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ↔ ((2nd ↾ ({𝐶} × V)) Fn ({𝐶} × V) ∧ (2nd ↾ ({𝐶} × V)) Fn V))
482, 47sylib 217 . . . . . . 7 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V)) Fn ({𝐶} × V) ∧ (2nd ↾ ({𝐶} × V)) Fn V))
49 fvco2 6847 . . . . . . . 8 (((2nd ↾ ({𝐶} × V)) Fn V ∧ 𝑥 ∈ V) → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5049elvd 3429 . . . . . . 7 ((2nd ↾ ({𝐶} × V)) Fn V → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5148, 50simpl2im 503 . . . . . 6 (𝐶𝐴 → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5251ad2antlr 723 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5346, 52eqtrid 2790 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐺𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
542adantr 480 . . . . . . . . 9 ((𝐶𝐴𝑥𝐵) → (2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V)
55 snidg 4592 . . . . . . . . . . 11 (𝐶𝐴𝐶 ∈ {𝐶})
56 vex 3426 . . . . . . . . . . 11 𝑥 ∈ V
57 opelxp 5616 . . . . . . . . . . 11 (⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V) ↔ (𝐶 ∈ {𝐶} ∧ 𝑥 ∈ V))
5855, 56, 57sylanblrc 589 . . . . . . . . . 10 (𝐶𝐴 → ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V))
5958adantr 480 . . . . . . . . 9 ((𝐶𝐴𝑥𝐵) → ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V))
6054, 59jca 511 . . . . . . . 8 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ∧ ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V)))
6158fvresd 6776 . . . . . . . . . 10 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = (2nd ‘⟨𝐶, 𝑥⟩))
62 op2ndg 7817 . . . . . . . . . . 11 ((𝐶𝐴𝑥 ∈ V) → (2nd ‘⟨𝐶, 𝑥⟩) = 𝑥)
6362elvd 3429 . . . . . . . . . 10 (𝐶𝐴 → (2nd ‘⟨𝐶, 𝑥⟩) = 𝑥)
6461, 63eqtrd 2778 . . . . . . . . 9 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥)
6564adantr 480 . . . . . . . 8 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥)
66 f1ocnvfv 7131 . . . . . . . 8 (((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ∧ ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V)) → (((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥 → ((2nd ↾ ({𝐶} × V))‘𝑥) = ⟨𝐶, 𝑥⟩))
6760, 65, 66sylc 65 . . . . . . 7 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V))‘𝑥) = ⟨𝐶, 𝑥⟩)
6867fveq2d 6760 . . . . . 6 ((𝐶𝐴𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐹‘⟨𝐶, 𝑥⟩))
6968adantll 710 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐹‘⟨𝐶, 𝑥⟩))
70 df-ov 7258 . . . . 5 (𝐶𝐹𝑥) = (𝐹‘⟨𝐶, 𝑥⟩)
7169, 70eqtr4di 2797 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐶𝐹𝑥))
7253, 71eqtrd 2778 . . 3 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐺𝑥) = (𝐶𝐹𝑥))
7372mpteq2dva 5170 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → (𝑥𝐵 ↦ (𝐺𝑥)) = (𝑥𝐵 ↦ (𝐶𝐹𝑥)))
7445, 73eqtrd 2778 1 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 = (𝑥𝐵 ↦ (𝐶𝐹𝑥)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 395   = wceq 1539  wcel 2108  Vcvv 3422  cin 3882  wss 3883  {csn 4558  cop 4564  cmpt 5153   × cxp 5578  ccnv 5579  dom cdm 5580  ran crn 5581  cres 5582  cima 5583  ccom 5584  Fun wfun 6412   Fn wfn 6413  ontowfo 6416  1-1-ontowf1o 6417  cfv 6418  (class class class)co 7255  2nd c2nd 7803
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  ax-un 7566
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-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-iun 4923  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  df-ov 7258  df-1st 7804  df-2nd 7805
This theorem is referenced by:  curry1val  7916  curry1f  7917
  Copyright terms: Public domain W3C validator