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

Theorem curry1 7785
 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 6424 . . . . 5 (𝐹 Fn (𝐴 × 𝐵) → Fun 𝐹)
2 2ndconst 7782 . . . . . 6 (𝐶𝐴 → (2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V)
3 dff1o3 6597 . . . . . . 7 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ↔ ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–onto→V ∧ Fun (2nd ↾ ({𝐶} × V))))
43simprbi 500 . . . . . 6 ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V → Fun (2nd ↾ ({𝐶} × V)))
52, 4syl 17 . . . . 5 (𝐶𝐴 → Fun (2nd ↾ ({𝐶} × V)))
6 funco 6365 . . . . 5 ((Fun 𝐹 ∧ Fun (2nd ↾ ({𝐶} × V))) → Fun (𝐹(2nd ↾ ({𝐶} × V))))
71, 5, 6syl2an 598 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → Fun (𝐹(2nd ↾ ({𝐶} × V))))
8 dmco 6075 . . . . 5 dom (𝐹(2nd ↾ ({𝐶} × V))) = ((2nd ↾ ({𝐶} × V)) “ dom 𝐹)
9 fndm 6426 . . . . . . . 8 (𝐹 Fn (𝐴 × 𝐵) → dom 𝐹 = (𝐴 × 𝐵))
109adantr 484 . . . . . . 7 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → dom 𝐹 = (𝐴 × 𝐵))
1110imaeq2d 5897 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ dom 𝐹) = ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)))
12 imacnvcnv 6031 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵))
13 df-ima 5533 . . . . . . . . 9 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ran ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵))
14 resres 5832 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵)) = (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
1514rneqi 5772 . . . . . . . . 9 ran ((2nd ↾ ({𝐶} × V)) ↾ (𝐴 × 𝐵)) = ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
1612, 13, 153eqtri 2825 . . . . . . . 8 ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵)))
17 inxp 5668 . . . . . . . . . . . . 13 (({𝐶} × V) ∩ (𝐴 × 𝐵)) = (({𝐶} ∩ 𝐴) × (V ∩ 𝐵))
18 incom 4128 . . . . . . . . . . . . . . 15 (V ∩ 𝐵) = (𝐵 ∩ V)
19 inv1 4302 . . . . . . . . . . . . . . 15 (𝐵 ∩ V) = 𝐵
2018, 19eqtri 2821 . . . . . . . . . . . . . 14 (V ∩ 𝐵) = 𝐵
2120xpeq2i 5547 . . . . . . . . . . . . 13 (({𝐶} ∩ 𝐴) × (V ∩ 𝐵)) = (({𝐶} ∩ 𝐴) × 𝐵)
2217, 21eqtri 2821 . . . . . . . . . . . 12 (({𝐶} × V) ∩ (𝐴 × 𝐵)) = (({𝐶} ∩ 𝐴) × 𝐵)
23 snssi 4701 . . . . . . . . . . . . . 14 (𝐶𝐴 → {𝐶} ⊆ 𝐴)
24 df-ss 3898 . . . . . . . . . . . . . 14 ({𝐶} ⊆ 𝐴 ↔ ({𝐶} ∩ 𝐴) = {𝐶})
2523, 24sylib 221 . . . . . . . . . . . . 13 (𝐶𝐴 → ({𝐶} ∩ 𝐴) = {𝐶})
2625xpeq1d 5549 . . . . . . . . . . . 12 (𝐶𝐴 → (({𝐶} ∩ 𝐴) × 𝐵) = ({𝐶} × 𝐵))
2722, 26syl5eq 2845 . . . . . . . . . . 11 (𝐶𝐴 → (({𝐶} × V) ∩ (𝐴 × 𝐵)) = ({𝐶} × 𝐵))
2827reseq2d 5819 . . . . . . . . . 10 (𝐶𝐴 → (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = (2nd ↾ ({𝐶} × 𝐵)))
2928rneqd 5773 . . . . . . . . 9 (𝐶𝐴 → ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = ran (2nd ↾ ({𝐶} × 𝐵)))
30 2ndconst 7782 . . . . . . . . . 10 (𝐶𝐴 → (2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–1-1-onto𝐵)
31 f1ofo 6598 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–1-1-onto𝐵 → (2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–onto𝐵)
32 forn 6569 . . . . . . . . . 10 ((2nd ↾ ({𝐶} × 𝐵)):({𝐶} × 𝐵)–onto𝐵 → ran (2nd ↾ ({𝐶} × 𝐵)) = 𝐵)
3330, 31, 323syl 18 . . . . . . . . 9 (𝐶𝐴 → ran (2nd ↾ ({𝐶} × 𝐵)) = 𝐵)
3429, 33eqtrd 2833 . . . . . . . 8 (𝐶𝐴 → ran (2nd ↾ (({𝐶} × V) ∩ (𝐴 × 𝐵))) = 𝐵)
3516, 34syl5eq 2845 . . . . . . 7 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = 𝐵)
3635adantl 485 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ (𝐴 × 𝐵)) = 𝐵)
3711, 36eqtrd 2833 . . . . 5 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → ((2nd ↾ ({𝐶} × V)) “ dom 𝐹) = 𝐵)
388, 37syl5eq 2845 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵)
39 curry1.1 . . . . . 6 𝐺 = (𝐹(2nd ↾ ({𝐶} × V)))
4039fneq1i 6421 . . . . 5 (𝐺 Fn 𝐵 ↔ (𝐹(2nd ↾ ({𝐶} × V))) Fn 𝐵)
41 df-fn 6328 . . . . 5 ((𝐹(2nd ↾ ({𝐶} × V))) Fn 𝐵 ↔ (Fun (𝐹(2nd ↾ ({𝐶} × V))) ∧ dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵))
4240, 41bitri 278 . . . 4 (𝐺 Fn 𝐵 ↔ (Fun (𝐹(2nd ↾ ({𝐶} × V))) ∧ dom (𝐹(2nd ↾ ({𝐶} × V))) = 𝐵))
437, 38, 42sylanbrc 586 . . 3 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 Fn 𝐵)
44 dffn5 6700 . . 3 (𝐺 Fn 𝐵𝐺 = (𝑥𝐵 ↦ (𝐺𝑥)))
4543, 44sylib 221 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 = (𝑥𝐵 ↦ (𝐺𝑥)))
4639fveq1i 6647 . . . . 5 (𝐺𝑥) = ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥)
47 dff1o4 6599 . . . . . . . 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 6736 . . . . . . . 8 (((2nd ↾ ({𝐶} × V)) Fn V ∧ 𝑥 ∈ V) → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5049elvd 3447 . . . . . . 7 ((2nd ↾ ({𝐶} × V)) Fn V → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5148, 50simpl2im 507 . . . . . 6 (𝐶𝐴 → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5251ad2antlr 726 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → ((𝐹(2nd ↾ ({𝐶} × V)))‘𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
5346, 52syl5eq 2845 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐺𝑥) = (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)))
542adantr 484 . . . . . . . . 9 ((𝐶𝐴𝑥𝐵) → (2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V)
55 snidg 4559 . . . . . . . . . . 11 (𝐶𝐴𝐶 ∈ {𝐶})
56 vex 3444 . . . . . . . . . . 11 𝑥 ∈ V
57 opelxp 5556 . . . . . . . . . . 11 (⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V) ↔ (𝐶 ∈ {𝐶} ∧ 𝑥 ∈ V))
5855, 56, 57sylanblrc 593 . . . . . . . . . 10 (𝐶𝐴 → ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V))
5958adantr 484 . . . . . . . . 9 ((𝐶𝐴𝑥𝐵) → ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V))
6054, 59jca 515 . . . . . . . 8 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ∧ ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V)))
6158fvresd 6666 . . . . . . . . . 10 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = (2nd ‘⟨𝐶, 𝑥⟩))
62 op2ndg 7687 . . . . . . . . . . 11 ((𝐶𝐴𝑥 ∈ V) → (2nd ‘⟨𝐶, 𝑥⟩) = 𝑥)
6362elvd 3447 . . . . . . . . . 10 (𝐶𝐴 → (2nd ‘⟨𝐶, 𝑥⟩) = 𝑥)
6461, 63eqtrd 2833 . . . . . . . . 9 (𝐶𝐴 → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥)
6564adantr 484 . . . . . . . 8 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥)
66 f1ocnvfv 7014 . . . . . . . 8 (((2nd ↾ ({𝐶} × V)):({𝐶} × V)–1-1-onto→V ∧ ⟨𝐶, 𝑥⟩ ∈ ({𝐶} × V)) → (((2nd ↾ ({𝐶} × V))‘⟨𝐶, 𝑥⟩) = 𝑥 → ((2nd ↾ ({𝐶} × V))‘𝑥) = ⟨𝐶, 𝑥⟩))
6760, 65, 66sylc 65 . . . . . . 7 ((𝐶𝐴𝑥𝐵) → ((2nd ↾ ({𝐶} × V))‘𝑥) = ⟨𝐶, 𝑥⟩)
6867fveq2d 6650 . . . . . 6 ((𝐶𝐴𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐹‘⟨𝐶, 𝑥⟩))
6968adantll 713 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐹‘⟨𝐶, 𝑥⟩))
70 df-ov 7139 . . . . 5 (𝐶𝐹𝑥) = (𝐹‘⟨𝐶, 𝑥⟩)
7169, 70eqtr4di 2851 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐹‘((2nd ↾ ({𝐶} × V))‘𝑥)) = (𝐶𝐹𝑥))
7253, 71eqtrd 2833 . . 3 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) ∧ 𝑥𝐵) → (𝐺𝑥) = (𝐶𝐹𝑥))
7372mpteq2dva 5126 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → (𝑥𝐵 ↦ (𝐺𝑥)) = (𝑥𝐵 ↦ (𝐶𝐹𝑥)))
7445, 73eqtrd 2833 1 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐴) → 𝐺 = (𝑥𝐵 ↦ (𝐶𝐹𝑥)))
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ∧ wa 399   = wceq 1538   ∈ wcel 2111  Vcvv 3441   ∩ cin 3880   ⊆ wss 3881  {csn 4525  ⟨cop 4531   ↦ cmpt 5111   × cxp 5518  ◡ccnv 5519  dom cdm 5520  ran crn 5521   ↾ cres 5522   “ cima 5523   ∘ ccom 5524  Fun wfun 6319   Fn wfn 6320  –onto→wfo 6323  –1-1-onto→wf1o 6324  ‘cfv 6325  (class class class)co 7136  2nd c2nd 7673 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1797  ax-4 1811  ax-5 1911  ax-6 1970  ax-7 2015  ax-8 2113  ax-9 2121  ax-10 2142  ax-11 2158  ax-12 2175  ax-ext 2770  ax-sep 5168  ax-nul 5175  ax-pow 5232  ax-pr 5296  ax-un 7444 This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  df-3an 1086  df-tru 1541  df-ex 1782  df-nf 1786  df-sb 2070  df-mo 2598  df-eu 2629  df-clab 2777  df-cleq 2791  df-clel 2870  df-nfc 2938  df-ne 2988  df-ral 3111  df-rex 3112  df-rab 3115  df-v 3443  df-sbc 3721  df-csb 3829  df-dif 3884  df-un 3886  df-in 3888  df-ss 3898  df-nul 4244  df-if 4426  df-sn 4526  df-pr 4528  df-op 4532  df-uni 4802  df-iun 4884  df-br 5032  df-opab 5094  df-mpt 5112  df-id 5426  df-xp 5526  df-rel 5527  df-cnv 5528  df-co 5529  df-dm 5530  df-rn 5531  df-res 5532  df-ima 5533  df-iota 6284  df-fun 6327  df-fn 6328  df-f 6329  df-f1 6330  df-fo 6331  df-f1o 6332  df-fv 6333  df-ov 7139  df-1st 7674  df-2nd 7675 This theorem is referenced by:  curry1val  7786  curry1f  7787
 Copyright terms: Public domain W3C validator