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

Theorem curry1 7156
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 5902 . . . . 5 (𝐹 Fn (𝐴 × 𝐵) → Fun 𝐹)
2 2ndconst 7153 . . . . . 6 (𝐶𝐴 → (2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V)
3 dff1o3 6056 . . . . . . 7 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ↔ ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–onto→V ∧ Fun (2nd ↾ ({𝐶} × V))))
43simprbi 479 . . . . . 6 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V → Fun (2nd ↾ ({𝐶} × V)))
52, 4syl 17 . . . . 5 (𝐶𝐴 → Fun (2nd ↾ ({𝐶} × V)))
6 funco 5842 . . . . 5 ((Fun 𝐹 ∧ Fun (2nd ↾ ({𝐶} × V))) → Fun (𝐹(2nd ↾ ({𝐶} × V))))
71, 5, 6syl2an 493 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → Fun (𝐹(2nd ↾ ({𝐶} × V))))
8 dmco 5560 . . . . 5 dom (𝐹(2nd ↾ ({𝐶} × V))) = ((2nd ↾ ({𝐶} × V)) “ dom 𝐹)
9 fndm 5904 . . . . . . . 8 (𝐹 Fn (𝐴 × 𝐵) → dom 𝐹 = (𝐴 × 𝐵))
109adantr 480 . . . . . . 7 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → dom 𝐹 = (𝐴 × 𝐵))
1110imaeq2d 5385 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ dom 𝐹) = ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)))
12 imacnvcnv 5517 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵))
13 df-ima 5051 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ran ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵))
14 resres 5329 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵)) = (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
1514rneqi 5273 . . . . . . . . 9 ran ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵)) = ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
1612, 13, 153eqtri 2636 . . . . . . . 8 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
17 inxp 5176 . . . . . . . . . . . . 13 (({𝐶} × V) ∩ (𝐴 × 𝐵)) = (({𝐶} ∩ 𝐴) × (V ∩ 𝐵))
18 incom 3767 . . . . . . . . . . . . . . 15 (V ∩ 𝐵) = (𝐵 ∩ V)
19 inv1 3922 . . . . . . . . . . . . . . 15 (𝐵 ∩ V) = 𝐵
2018, 19eqtri 2632 . . . . . . . . . . . . . 14 (V ∩ 𝐵) = 𝐵
2120xpeq2i 5060 . . . . . . . . . . . . 13 (({𝐶} ∩ 𝐴) × (V ∩ 𝐵)) = (({𝐶} ∩ 𝐴) × 𝐵)
2217, 21eqtri 2632 . . . . . . . . . . . 12 (({𝐶} × V) ∩ (𝐴 × 𝐵)) = (({𝐶} ∩ 𝐴) × 𝐵)
23 snssi 4280 . . . . . . . . . . . . . 14 (𝐶𝐴 → {𝐶} ⊆ 𝐴)
24 df-ss 3554 . . . . . . . . . . . . . 14 ({𝐶} ⊆ 𝐴 ↔ ({𝐶} ∩ 𝐴) = {𝐶})
2523, 24sylib 207 . . . . . . . . . . . . 13 (𝐶𝐴 → ({𝐶} ∩ 𝐴) = {𝐶})
2625xpeq1d 5062 . . . . . . . . . . . 12 (𝐶𝐴 → (({𝐶} ∩ 𝐴) × 𝐵) = ({𝐶} × 𝐵))
2722, 26syl5eq 2656 . . . . . . . . . . 11 (𝐶𝐴 → (({𝐶} × V) ∩ (𝐴 × 𝐵)) = ({𝐶} × 𝐵))
2827reseq2d 5317 . . . . . . . . . 10 (𝐶𝐴 → (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = (2nd ↾ ({𝐶} × 𝐵)))
2928rneqd 5274 . . . . . . . . 9 (𝐶𝐴 → ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = ran (2nd ↾ ({𝐶} × 𝐵)))
30 2ndconst 7153 . . . . . . . . . 10 (𝐶𝐴 → (2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–1-1-onto𝐵)
31 f1ofo 6057 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–1-1-onto𝐵 → (2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–onto𝐵)
32 forn 6031 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–onto𝐵 → ran (2nd ↾ ({𝐶} × 𝐵)) = 𝐵)
3330, 31, 323syl 18 . . . . . . . . 9 (𝐶𝐴 → ran (2nd ↾ ({𝐶} × 𝐵)) = 𝐵)
3429, 33eqtrd 2644 . . . . . . . 8 (𝐶𝐴 → ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = 𝐵)
3516, 34syl5eq 2656 . . . . . . 7 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = 𝐵)
3635adantl 481 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = 𝐵)
3711, 36eqtrd 2644 . . . . 5 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ dom 𝐹) = 𝐵)
388, 37syl5eq 2656 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵)
39 curry1.1 . . . . . 6 𝐺 = (𝐹(2nd ↾ ({𝐶} × V)))
4039fneq1i 5899 . . . . 5 (𝐺 Fn 𝐵 ↔ (𝐹(2nd ↾ ({𝐶} × V))) Fn 𝐵)
41 df-fn 5807 . . . . 5 ((𝐹(2nd ↾ ({𝐶} × V))) Fn 𝐵 ↔ (Fun (𝐹(2nd ↾ ({𝐶} × V))) ∧ dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵))
4240, 41bitri 263 . . . 4 (𝐺 Fn 𝐵 ↔ (Fun (𝐹(2nd ↾ ({𝐶} × V))) ∧ dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵))
437, 38, 42sylanbrc 695 . . 3 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 Fn 𝐵)
44 dffn5 6151 . . 3 (𝐺 Fn 𝐵𝐺 = (𝑥𝐵 ↦ (𝐺𝑥)))
4543, 44sylib 207 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 = (𝑥𝐵 ↦ (𝐺𝑥)))
4639fveq1i 6104 . . . . 5 (𝐺𝑥) = ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥)
47 dff1o4 6058 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ↔ ((2nd ↾ ({𝐶} × V)) Fn ({𝐶} × V) ∧ (2nd ↾ ({𝐶} × V)) Fn V))
482, 47sylib 207 . . . . . . . 8 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V)) Fn ({𝐶} × V) ∧ (2nd ↾ ({𝐶} × V)) Fn V))
4948simprd 478 . . . . . . 7 (𝐶𝐴(2nd ↾ ({𝐶} × V)) Fn V)
50 vex 3176 . . . . . . . 8 𝑥 ∈ V
51 fvco2 6183 . . . . . . . 8 (((2nd ↾ ({𝐶} × V)) Fn V ∧ 𝑥 ∈ V) → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5250, 51mpan2 703 . . . . . . 7 ((2nd ↾ ({𝐶} × V)) Fn V → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5349, 52syl 17 . . . . . 6 (𝐶𝐴 → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5453ad2antlr 759 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5546, 54syl5eq 2656 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐺𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
562adantr 480 . . . . . . . . 9 ((𝐶𝐴𝑥𝐵) → (2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V)
57 snidg 4153 . . . . . . . . . . . 12 (𝐶𝐴𝐶 ∈ {𝐶})
5857, 50jctir 559 . . . . . . . . . . 11 (𝐶𝐴 → (𝐶 ∈ {𝐶} ∧ 𝑥 ∈ V))
59 opelxp 5070 . . . . . . . . . . 11 (⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V) ↔ (𝐶 ∈ {𝐶} ∧ 𝑥 ∈ V))
6058, 59sylibr 223 . . . . . . . . . 10 (𝐶𝐴 → ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V))
6160adantr 480 . . . . . . . . 9 ((𝐶𝐴𝑥𝐵) → ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V))
6256, 61jca 553 . . . . . . . 8 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ∧ ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V)))
63 fvres 6117 . . . . . . . . . . 11 (⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V) → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = (2nd ‘⟨𝐶, 𝑥⟩))
6460, 63syl 17 . . . . . . . . . 10 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = (2nd ‘⟨𝐶, 𝑥⟩))
65 op2ndg 7072 . . . . . . . . . . 11 ((𝐶𝐴𝑥 ∈ V) → (2nd ‘⟨𝐶, 𝑥⟩) = 𝑥)
6650, 65mpan2 703 . . . . . . . . . 10 (𝐶𝐴 → (2nd ‘⟨𝐶, 𝑥⟩) = 𝑥)
6764, 66eqtrd 2644 . . . . . . . . 9 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥)
6867adantr 480 . . . . . . . 8 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥)
69 f1ocnvfv 6434 . . . . . . . 8 (((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ∧ ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V)) → (((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥 → ((2nd ↾ ({𝐶} × V))‘𝑥) = ⟨𝐶, 𝑥⟩))
7062, 68, 69sylc 63 . . . . . . 7 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V))‘𝑥) = ⟨𝐶, 𝑥⟩)
7170fveq2d 6107 . . . . . 6 ((𝐶𝐴𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐹‘⟨𝐶, 𝑥⟩))
7271adantll 746 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐹‘⟨𝐶, 𝑥⟩))
73 df-ov 6552 . . . . 5 (𝐶𝐹𝑥) = (𝐹‘⟨𝐶, 𝑥⟩)
7472, 73syl6eqr 2662 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐶𝐹𝑥))
7555, 74eqtrd 2644 . . 3 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐺𝑥) = (𝐶𝐹𝑥))
7675mpteq2dva 4672 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → (𝑥𝐵 ↦ (𝐺𝑥)) = (𝑥𝐵 ↦ (𝐶𝐹𝑥)))
7745, 76eqtrd 2644 1 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 = (𝑥𝐵 ↦ (𝐶𝐹𝑥)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 383   = wceq 1475  wcel 1977  Vcvv 3173  cin 3539  wss 3540  {csn 4125  cop 4131  cmpt 4643   × cxp 5036  ccnv 5037  dom cdm 5038  ran crn 5039  cres 5040  cima 5041  ccom 5042  Fun wfun 5798   Fn wfn 5799  ontowfo 5802  1-1-ontowf1o 5803  cfv 5804  (class class class)co 6549  2nd c2nd 7058
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1713  ax-4 1728  ax-5 1827  ax-6 1875  ax-7 1922  ax-8 1979  ax-9 1986  ax-10 2006  ax-11 2021  ax-12 2034  ax-13 2234  ax-ext 2590  ax-sep 4709  ax-nul 4717  ax-pow 4769  ax-pr 4833  ax-un 6847
This theorem depends on definitions:  df-bi 196  df-or 384  df-an 385  df-3an 1033  df-tru 1478  df-ex 1696  df-nf 1701  df-sb 1868  df-eu 2462  df-mo 2463  df-clab 2597  df-cleq 2603  df-clel 2606  df-nfc 2740  df-ne 2782  df-ral 2901  df-rex 2902  df-rab 2905  df-v 3175  df-sbc 3403  df-csb 3500  df-dif 3543  df-un 3545  df-in 3547  df-ss 3554  df-nul 3875  df-if 4037  df-sn 4126  df-pr 4128  df-op 4132  df-uni 4373  df-iun 4457  df-br 4584  df-opab 4644  df-mpt 4645  df-id 4953  df-xp 5044  df-rel 5045  df-cnv 5046  df-co 5047  df-dm 5048  df-rn 5049  df-res 5050  df-ima 5051  df-iota 5768  df-fun 5806  df-fn 5807  df-f 5808  df-f1 5809  df-fo 5810  df-f1o 5811  df-fv 5812  df-ov 6552  df-1st 7059  df-2nd 7060
This theorem is referenced by:  curry1val  7157  curry1f  7158
  Copyright terms: Public domain W3C validator