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

Theorem curry1 7269
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 5988 . . . . 5 (𝐹 Fn (𝐴 × 𝐵) → Fun 𝐹)
2 2ndconst 7266 . . . . . 6 (𝐶𝐴 → (2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V)
3 dff1o3 6143 . . . . . . 7 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ↔ ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–onto→V ∧ Fun (2nd ↾ ({𝐶} × V))))
43simprbi 480 . . . . . 6 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V → Fun (2nd ↾ ({𝐶} × V)))
52, 4syl 17 . . . . 5 (𝐶𝐴 → Fun (2nd ↾ ({𝐶} × V)))
6 funco 5928 . . . . 5 ((Fun 𝐹 ∧ Fun (2nd ↾ ({𝐶} × V))) → Fun (𝐹(2nd ↾ ({𝐶} × V))))
71, 5, 6syl2an 494 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → Fun (𝐹(2nd ↾ ({𝐶} × V))))
8 dmco 5643 . . . . 5 dom (𝐹(2nd ↾ ({𝐶} × V))) = ((2nd ↾ ({𝐶} × V)) “ dom 𝐹)
9 fndm 5990 . . . . . . . 8 (𝐹 Fn (𝐴 × 𝐵) → dom 𝐹 = (𝐴 × 𝐵))
109adantr 481 . . . . . . 7 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → dom 𝐹 = (𝐴 × 𝐵))
1110imaeq2d 5466 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ dom 𝐹) = ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)))
12 imacnvcnv 5599 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵))
13 df-ima 5127 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ran ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵))
14 resres 5409 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵)) = (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
1514rneqi 5352 . . . . . . . . 9 ran ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵)) = ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
1612, 13, 153eqtri 2648 . . . . . . . 8 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
17 inxp 5254 . . . . . . . . . . . . 13 (({𝐶} × V) ∩ (𝐴 × 𝐵)) = (({𝐶} ∩ 𝐴) × (V ∩ 𝐵))
18 incom 3805 . . . . . . . . . . . . . . 15 (V ∩ 𝐵) = (𝐵 ∩ V)
19 inv1 3970 . . . . . . . . . . . . . . 15 (𝐵 ∩ V) = 𝐵
2018, 19eqtri 2644 . . . . . . . . . . . . . 14 (V ∩ 𝐵) = 𝐵
2120xpeq2i 5136 . . . . . . . . . . . . 13 (({𝐶} ∩ 𝐴) × (V ∩ 𝐵)) = (({𝐶} ∩ 𝐴) × 𝐵)
2217, 21eqtri 2644 . . . . . . . . . . . 12 (({𝐶} × V) ∩ (𝐴 × 𝐵)) = (({𝐶} ∩ 𝐴) × 𝐵)
23 snssi 4339 . . . . . . . . . . . . . 14 (𝐶𝐴 → {𝐶} ⊆ 𝐴)
24 df-ss 3588 . . . . . . . . . . . . . 14 ({𝐶} ⊆ 𝐴 ↔ ({𝐶} ∩ 𝐴) = {𝐶})
2523, 24sylib 208 . . . . . . . . . . . . 13 (𝐶𝐴 → ({𝐶} ∩ 𝐴) = {𝐶})
2625xpeq1d 5138 . . . . . . . . . . . 12 (𝐶𝐴 → (({𝐶} ∩ 𝐴) × 𝐵) = ({𝐶} × 𝐵))
2722, 26syl5eq 2668 . . . . . . . . . . 11 (𝐶𝐴 → (({𝐶} × V) ∩ (𝐴 × 𝐵)) = ({𝐶} × 𝐵))
2827reseq2d 5396 . . . . . . . . . 10 (𝐶𝐴 → (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = (2nd ↾ ({𝐶} × 𝐵)))
2928rneqd 5353 . . . . . . . . 9 (𝐶𝐴 → ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = ran (2nd ↾ ({𝐶} × 𝐵)))
30 2ndconst 7266 . . . . . . . . . 10 (𝐶𝐴 → (2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–1-1-onto𝐵)
31 f1ofo 6144 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–1-1-onto𝐵 → (2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–onto𝐵)
32 forn 6118 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–onto𝐵 → ran (2nd ↾ ({𝐶} × 𝐵)) = 𝐵)
3330, 31, 323syl 18 . . . . . . . . 9 (𝐶𝐴 → ran (2nd ↾ ({𝐶} × 𝐵)) = 𝐵)
3429, 33eqtrd 2656 . . . . . . . 8 (𝐶𝐴 → ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = 𝐵)
3516, 34syl5eq 2668 . . . . . . 7 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = 𝐵)
3635adantl 482 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = 𝐵)
3711, 36eqtrd 2656 . . . . 5 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ dom 𝐹) = 𝐵)
388, 37syl5eq 2668 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵)
39 curry1.1 . . . . . 6 𝐺 = (𝐹(2nd ↾ ({𝐶} × V)))
4039fneq1i 5985 . . . . 5 (𝐺 Fn 𝐵 ↔ (𝐹(2nd ↾ ({𝐶} × V))) Fn 𝐵)
41 df-fn 5891 . . . . 5 ((𝐹(2nd ↾ ({𝐶} × V))) Fn 𝐵 ↔ (Fun (𝐹(2nd ↾ ({𝐶} × V))) ∧ dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵))
4240, 41bitri 264 . . . 4 (𝐺 Fn 𝐵 ↔ (Fun (𝐹(2nd ↾ ({𝐶} × V))) ∧ dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵))
437, 38, 42sylanbrc 698 . . 3 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 Fn 𝐵)
44 dffn5 6241 . . 3 (𝐺 Fn 𝐵𝐺 = (𝑥𝐵 ↦ (𝐺𝑥)))
4543, 44sylib 208 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 = (𝑥𝐵 ↦ (𝐺𝑥)))
4639fveq1i 6192 . . . . 5 (𝐺𝑥) = ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥)
47 dff1o4 6145 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ↔ ((2nd ↾ ({𝐶} × V)) Fn ({𝐶} × V) ∧ (2nd ↾ ({𝐶} × V)) Fn V))
482, 47sylib 208 . . . . . . . 8 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V)) Fn ({𝐶} × V) ∧ (2nd ↾ ({𝐶} × V)) Fn V))
4948simprd 479 . . . . . . 7 (𝐶𝐴(2nd ↾ ({𝐶} × V)) Fn V)
50 vex 3203 . . . . . . . 8 𝑥 ∈ V
51 fvco2 6273 . . . . . . . 8 (((2nd ↾ ({𝐶} × V)) Fn V ∧ 𝑥 ∈ V) → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5250, 51mpan2 707 . . . . . . 7 ((2nd ↾ ({𝐶} × V)) Fn V → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5349, 52syl 17 . . . . . 6 (𝐶𝐴 → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5453ad2antlr 763 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5546, 54syl5eq 2668 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐺𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
562adantr 481 . . . . . . . . 9 ((𝐶𝐴𝑥𝐵) → (2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V)
57 snidg 4206 . . . . . . . . . . . 12 (𝐶𝐴𝐶 ∈ {𝐶})
5857, 50jctir 561 . . . . . . . . . . 11 (𝐶𝐴 → (𝐶 ∈ {𝐶} ∧ 𝑥 ∈ V))
59 opelxp 5146 . . . . . . . . . . 11 (⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V) ↔ (𝐶 ∈ {𝐶} ∧ 𝑥 ∈ V))
6058, 59sylibr 224 . . . . . . . . . 10 (𝐶𝐴 → ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V))
6160adantr 481 . . . . . . . . 9 ((𝐶𝐴𝑥𝐵) → ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V))
6256, 61jca 554 . . . . . . . 8 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ∧ ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V)))
63 fvres 6207 . . . . . . . . . . 11 (⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V) → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = (2nd ‘⟨𝐶, 𝑥⟩))
6460, 63syl 17 . . . . . . . . . 10 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = (2nd ‘⟨𝐶, 𝑥⟩))
65 op2ndg 7181 . . . . . . . . . . 11 ((𝐶𝐴𝑥 ∈ V) → (2nd ‘⟨𝐶, 𝑥⟩) = 𝑥)
6650, 65mpan2 707 . . . . . . . . . 10 (𝐶𝐴 → (2nd ‘⟨𝐶, 𝑥⟩) = 𝑥)
6764, 66eqtrd 2656 . . . . . . . . 9 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥)
6867adantr 481 . . . . . . . 8 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥)
69 f1ocnvfv 6534 . . . . . . . 8 (((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ∧ ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V)) → (((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥 → ((2nd ↾ ({𝐶} × V))‘𝑥) = ⟨𝐶, 𝑥⟩))
7062, 68, 69sylc 65 . . . . . . 7 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V))‘𝑥) = ⟨𝐶, 𝑥⟩)
7170fveq2d 6195 . . . . . 6 ((𝐶𝐴𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐹‘⟨𝐶, 𝑥⟩))
7271adantll 750 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐹‘⟨𝐶, 𝑥⟩))
73 df-ov 6653 . . . . 5 (𝐶𝐹𝑥) = (𝐹‘⟨𝐶, 𝑥⟩)
7472, 73syl6eqr 2674 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐶𝐹𝑥))
7555, 74eqtrd 2656 . . 3 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐺𝑥) = (𝐶𝐹𝑥))
7675mpteq2dva 4744 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → (𝑥𝐵 ↦ (𝐺𝑥)) = (𝑥𝐵 ↦ (𝐶𝐹𝑥)))
7745, 76eqtrd 2656 1 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 = (𝑥𝐵 ↦ (𝐶𝐹𝑥)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 384   = wceq 1483  wcel 1990  Vcvv 3200  cin 3573  wss 3574  {csn 4177  cop 4183  cmpt 4729   × cxp 5112  ccnv 5113  dom cdm 5114  ran crn 5115  cres 5116  cima 5117  ccom 5118  Fun wfun 5882   Fn wfn 5883  ontowfo 5886  1-1-ontowf1o 5887  cfv 5888  (class class class)co 6650  2nd c2nd 7167
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1722  ax-4 1737  ax-5 1839  ax-6 1888  ax-7 1935  ax-8 1992  ax-9 1999  ax-10 2019  ax-11 2034  ax-12 2047  ax-13 2246  ax-ext 2602  ax-sep 4781  ax-nul 4789  ax-pow 4843  ax-pr 4906  ax-un 6949
This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-3an 1039  df-tru 1486  df-ex 1705  df-nf 1710  df-sb 1881  df-eu 2474  df-mo 2475  df-clab 2609  df-cleq 2615  df-clel 2618  df-nfc 2753  df-ne 2795  df-ral 2917  df-rex 2918  df-rab 2921  df-v 3202  df-sbc 3436  df-csb 3534  df-dif 3577  df-un 3579  df-in 3581  df-ss 3588  df-nul 3916  df-if 4087  df-sn 4178  df-pr 4180  df-op 4184  df-uni 4437  df-iun 4522  df-br 4654  df-opab 4713  df-mpt 4730  df-id 5024  df-xp 5120  df-rel 5121  df-cnv 5122  df-co 5123  df-dm 5124  df-rn 5125  df-res 5126  df-ima 5127  df-iota 5851  df-fun 5890  df-fn 5891  df-f 5892  df-f1 5893  df-fo 5894  df-f1o 5895  df-fv 5896  df-ov 6653  df-1st 7168  df-2nd 7169
This theorem is referenced by:  curry1val  7270  curry1f  7271
  Copyright terms: Public domain W3C validator