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

Theorem curry2 7159
Description: Composition with (1st ↾ (V × {𝐶})) turns any binary operation 𝐹 with a constant second operand into a function 𝐺 of the first operand only. This transformation is called "currying." (If this becomes frequently used, we can introduce a new notation for the hypothesis.) (Contributed by NM, 16-Dec-2008.)
Hypothesis
Ref Expression
curry2.1 𝐺 = (𝐹(1st ↾ (V × {𝐶})))
Assertion
Ref Expression
curry2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → 𝐺 = (𝑥𝐴 ↦ (𝑥𝐹𝐶)))
Distinct variable groups:   𝑥,𝐴   𝑥,𝐵   𝑥,𝐶   𝑥,𝐹   𝑥,𝐺

Proof of Theorem curry2
StepHypRef Expression
1 fnfun 5902 . . . . 5 (𝐹 Fn (𝐴 × 𝐵) → Fun 𝐹)
2 1stconst 7152 . . . . . 6 (𝐶𝐵 → (1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V)
3 dff1o3 6056 . . . . . . 7 ((1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V ↔ ((1st ↾ (V × {𝐶})):(V × {𝐶})–onto→V ∧ Fun (1st ↾ (V × {𝐶}))))
43simprbi 479 . . . . . 6 ((1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V → Fun (1st ↾ (V × {𝐶})))
52, 4syl 17 . . . . 5 (𝐶𝐵 → Fun (1st ↾ (V × {𝐶})))
6 funco 5842 . . . . 5 ((Fun 𝐹 ∧ Fun (1st ↾ (V × {𝐶}))) → Fun (𝐹(1st ↾ (V × {𝐶}))))
71, 5, 6syl2an 493 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → Fun (𝐹(1st ↾ (V × {𝐶}))))
8 dmco 5560 . . . . 5 dom (𝐹(1st ↾ (V × {𝐶}))) = ((1st ↾ (V × {𝐶})) “ dom 𝐹)
9 fndm 5904 . . . . . . . 8 (𝐹 Fn (𝐴 × 𝐵) → dom 𝐹 = (𝐴 × 𝐵))
109adantr 480 . . . . . . 7 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → dom 𝐹 = (𝐴 × 𝐵))
1110imaeq2d 5385 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → ((1st ↾ (V × {𝐶})) “ dom 𝐹) = ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)))
12 imacnvcnv 5517 . . . . . . . . 9 ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)) = ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵))
13 df-ima 5051 . . . . . . . . 9 ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)) = ran ((1st ↾ (V × {𝐶})) ↾ (𝐴 × 𝐵))
14 resres 5329 . . . . . . . . . 10 ((1st ↾ (V × {𝐶})) ↾ (𝐴 × 𝐵)) = (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵)))
1514rneqi 5273 . . . . . . . . 9 ran ((1st ↾ (V × {𝐶})) ↾ (𝐴 × 𝐵)) = ran (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵)))
1612, 13, 153eqtri 2636 . . . . . . . 8 ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)) = ran (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵)))
17 inxp 5176 . . . . . . . . . . . . 13 ((V × {𝐶}) ∩ (𝐴 × 𝐵)) = ((V ∩ 𝐴) × ({𝐶} ∩ 𝐵))
18 incom 3767 . . . . . . . . . . . . . . 15 (V ∩ 𝐴) = (𝐴 ∩ V)
19 inv1 3922 . . . . . . . . . . . . . . 15 (𝐴 ∩ V) = 𝐴
2018, 19eqtri 2632 . . . . . . . . . . . . . 14 (V ∩ 𝐴) = 𝐴
2120xpeq1i 5059 . . . . . . . . . . . . 13 ((V ∩ 𝐴) × ({𝐶} ∩ 𝐵)) = (𝐴 × ({𝐶} ∩ 𝐵))
2217, 21eqtri 2632 . . . . . . . . . . . 12 ((V × {𝐶}) ∩ (𝐴 × 𝐵)) = (𝐴 × ({𝐶} ∩ 𝐵))
23 snssi 4280 . . . . . . . . . . . . . 14 (𝐶𝐵 → {𝐶} ⊆ 𝐵)
24 df-ss 3554 . . . . . . . . . . . . . 14 ({𝐶} ⊆ 𝐵 ↔ ({𝐶} ∩ 𝐵) = {𝐶})
2523, 24sylib 207 . . . . . . . . . . . . 13 (𝐶𝐵 → ({𝐶} ∩ 𝐵) = {𝐶})
2625xpeq2d 5063 . . . . . . . . . . . 12 (𝐶𝐵 → (𝐴 × ({𝐶} ∩ 𝐵)) = (𝐴 × {𝐶}))
2722, 26syl5eq 2656 . . . . . . . . . . 11 (𝐶𝐵 → ((V × {𝐶}) ∩ (𝐴 × 𝐵)) = (𝐴 × {𝐶}))
2827reseq2d 5317 . . . . . . . . . 10 (𝐶𝐵 → (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵))) = (1st ↾ (𝐴 × {𝐶})))
2928rneqd 5274 . . . . . . . . 9 (𝐶𝐵 → ran (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵))) = ran (1st ↾ (𝐴 × {𝐶})))
30 1stconst 7152 . . . . . . . . . 10 (𝐶𝐵 → (1st ↾ (𝐴 × {𝐶})):(𝐴 × {𝐶})–1-1-onto𝐴)
31 f1ofo 6057 . . . . . . . . . 10 ((1st ↾ (𝐴 × {𝐶})):(𝐴 × {𝐶})–1-1-onto𝐴 → (1st ↾ (𝐴 × {𝐶})):(𝐴 × {𝐶})–onto𝐴)
32 forn 6031 . . . . . . . . . 10 ((1st ↾ (𝐴 × {𝐶})):(𝐴 × {𝐶})–onto𝐴 → ran (1st ↾ (𝐴 × {𝐶})) = 𝐴)
3330, 31, 323syl 18 . . . . . . . . 9 (𝐶𝐵 → ran (1st ↾ (𝐴 × {𝐶})) = 𝐴)
3429, 33eqtrd 2644 . . . . . . . 8 (𝐶𝐵 → ran (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵))) = 𝐴)
3516, 34syl5eq 2656 . . . . . . 7 (𝐶𝐵 → ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)) = 𝐴)
3635adantl 481 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)) = 𝐴)
3711, 36eqtrd 2644 . . . . 5 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → ((1st ↾ (V × {𝐶})) “ dom 𝐹) = 𝐴)
388, 37syl5eq 2656 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → dom (𝐹(1st ↾ (V × {𝐶}))) = 𝐴)
39 curry2.1 . . . . . 6 𝐺 = (𝐹(1st ↾ (V × {𝐶})))
4039fneq1i 5899 . . . . 5 (𝐺 Fn 𝐴 ↔ (𝐹(1st ↾ (V × {𝐶}))) Fn 𝐴)
41 df-fn 5807 . . . . 5 ((𝐹(1st ↾ (V × {𝐶}))) Fn 𝐴 ↔ (Fun (𝐹(1st ↾ (V × {𝐶}))) ∧ dom (𝐹(1st ↾ (V × {𝐶}))) = 𝐴))
4240, 41bitri 263 . . . 4 (𝐺 Fn 𝐴 ↔ (Fun (𝐹(1st ↾ (V × {𝐶}))) ∧ dom (𝐹(1st ↾ (V × {𝐶}))) = 𝐴))
437, 38, 42sylanbrc 695 . . 3 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → 𝐺 Fn 𝐴)
44 dffn5 6151 . . 3 (𝐺 Fn 𝐴𝐺 = (𝑥𝐴 ↦ (𝐺𝑥)))
4543, 44sylib 207 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → 𝐺 = (𝑥𝐴 ↦ (𝐺𝑥)))
4639fveq1i 6104 . . . . 5 (𝐺𝑥) = ((𝐹(1st ↾ (V × {𝐶})))‘𝑥)
47 dff1o4 6058 . . . . . . . . 9 ((1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V ↔ ((1st ↾ (V × {𝐶})) Fn (V × {𝐶}) ∧ (1st ↾ (V × {𝐶})) Fn V))
482, 47sylib 207 . . . . . . . 8 (𝐶𝐵 → ((1st ↾ (V × {𝐶})) Fn (V × {𝐶}) ∧ (1st ↾ (V × {𝐶})) Fn V))
4948simprd 478 . . . . . . 7 (𝐶𝐵(1st ↾ (V × {𝐶})) Fn V)
50 vex 3176 . . . . . . 7 𝑥 ∈ V
51 fvco2 6183 . . . . . . 7 (((1st ↾ (V × {𝐶})) Fn V ∧ 𝑥 ∈ V) → ((𝐹(1st ↾ (V × {𝐶})))‘𝑥) = (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)))
5249, 50, 51sylancl 693 . . . . . 6 (𝐶𝐵 → ((𝐹(1st ↾ (V × {𝐶})))‘𝑥) = (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)))
5352ad2antlr 759 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) ∧ 𝑥𝐴) → ((𝐹(1st ↾ (V × {𝐶})))‘𝑥) = (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)))
5446, 53syl5eq 2656 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) ∧ 𝑥𝐴) → (𝐺𝑥) = (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)))
552adantr 480 . . . . . . . . 9 ((𝐶𝐵𝑥𝐴) → (1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V)
5650a1i 11 . . . . . . . . . 10 ((𝐶𝐵𝑥𝐴) → 𝑥 ∈ V)
57 snidg 4153 . . . . . . . . . . 11 (𝐶𝐵𝐶 ∈ {𝐶})
5857adantr 480 . . . . . . . . . 10 ((𝐶𝐵𝑥𝐴) → 𝐶 ∈ {𝐶})
59 opelxp 5070 . . . . . . . . . 10 (⟨𝑥, 𝐶⟩ ∈ (V × {𝐶}) ↔ (𝑥 ∈ V ∧ 𝐶 ∈ {𝐶}))
6056, 58, 59sylanbrc 695 . . . . . . . . 9 ((𝐶𝐵𝑥𝐴) → ⟨𝑥, 𝐶⟩ ∈ (V × {𝐶}))
6155, 60jca 553 . . . . . . . 8 ((𝐶𝐵𝑥𝐴) → ((1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V ∧ ⟨𝑥, 𝐶⟩ ∈ (V × {𝐶})))
6250a1i 11 . . . . . . . . . . . 12 (𝐶𝐵𝑥 ∈ V)
6362, 57, 59sylanbrc 695 . . . . . . . . . . 11 (𝐶𝐵 → ⟨𝑥, 𝐶⟩ ∈ (V × {𝐶}))
64 fvres 6117 . . . . . . . . . . 11 (⟨𝑥, 𝐶⟩ ∈ (V × {𝐶}) → ((1st ↾ (V × {𝐶}))‘⟨𝑥, 𝐶⟩) = (1st ‘⟨𝑥, 𝐶⟩))
6563, 64syl 17 . . . . . . . . . 10 (𝐶𝐵 → ((1st ↾ (V × {𝐶}))‘⟨𝑥, 𝐶⟩) = (1st ‘⟨𝑥, 𝐶⟩))
6665adantr 480 . . . . . . . . 9 ((𝐶𝐵𝑥𝐴) → ((1st ↾ (V × {𝐶}))‘⟨𝑥, 𝐶⟩) = (1st ‘⟨𝑥, 𝐶⟩))
67 op1stg 7071 . . . . . . . . . 10 ((𝑥𝐴𝐶𝐵) → (1st ‘⟨𝑥, 𝐶⟩) = 𝑥)
6867ancoms 468 . . . . . . . . 9 ((𝐶𝐵𝑥𝐴) → (1st ‘⟨𝑥, 𝐶⟩) = 𝑥)
6966, 68eqtrd 2644 . . . . . . . 8 ((𝐶𝐵𝑥𝐴) → ((1st ↾ (V × {𝐶}))‘⟨𝑥, 𝐶⟩) = 𝑥)
70 f1ocnvfv 6434 . . . . . . . 8 (((1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V ∧ ⟨𝑥, 𝐶⟩ ∈ (V × {𝐶})) → (((1st ↾ (V × {𝐶}))‘⟨𝑥, 𝐶⟩) = 𝑥 → ((1st ↾ (V × {𝐶}))‘𝑥) = ⟨𝑥, 𝐶⟩))
7161, 69, 70sylc 63 . . . . . . 7 ((𝐶𝐵𝑥𝐴) → ((1st ↾ (V × {𝐶}))‘𝑥) = ⟨𝑥, 𝐶⟩)
7271fveq2d 6107 . . . . . 6 ((𝐶𝐵𝑥𝐴) → (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)) = (𝐹‘⟨𝑥, 𝐶⟩))
7372adantll 746 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) ∧ 𝑥𝐴) → (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)) = (𝐹‘⟨𝑥, 𝐶⟩))
74 df-ov 6552 . . . . 5 (𝑥𝐹𝐶) = (𝐹‘⟨𝑥, 𝐶⟩)
7573, 74syl6eqr 2662 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) ∧ 𝑥𝐴) → (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)) = (𝑥𝐹𝐶))
7654, 75eqtrd 2644 . . 3 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) ∧ 𝑥𝐴) → (𝐺𝑥) = (𝑥𝐹𝐶))
7776mpteq2dva 4672 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → (𝑥𝐴 ↦ (𝐺𝑥)) = (𝑥𝐴 ↦ (𝑥𝐹𝐶)))
7845, 77eqtrd 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  1st c1st 7057
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:  curry2f  7160  curry2val  7161
  Copyright terms: Public domain W3C validator