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

Theorem curry2 7794
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 6446 . . . . 5 (𝐹 Fn (𝐴 × 𝐵) → Fun 𝐹)
2 1stconst 7787 . . . . . 6 (𝐶𝐵 → (1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V)
3 dff1o3 6614 . . . . . . 7 ((1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V ↔ ((1st ↾ (V × {𝐶})):(V × {𝐶})–onto→V ∧ Fun (1st ↾ (V × {𝐶}))))
43simprbi 499 . . . . . 6 ((1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V → Fun (1st ↾ (V × {𝐶})))
52, 4syl 17 . . . . 5 (𝐶𝐵 → Fun (1st ↾ (V × {𝐶})))
6 funco 6388 . . . . 5 ((Fun 𝐹 ∧ Fun (1st ↾ (V × {𝐶}))) → Fun (𝐹(1st ↾ (V × {𝐶}))))
71, 5, 6syl2an 597 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → Fun (𝐹(1st ↾ (V × {𝐶}))))
8 dmco 6100 . . . . 5 dom (𝐹(1st ↾ (V × {𝐶}))) = ((1st ↾ (V × {𝐶})) “ dom 𝐹)
9 fndm 6448 . . . . . . . 8 (𝐹 Fn (𝐴 × 𝐵) → dom 𝐹 = (𝐴 × 𝐵))
109adantr 483 . . . . . . 7 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → dom 𝐹 = (𝐴 × 𝐵))
1110imaeq2d 5922 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → ((1st ↾ (V × {𝐶})) “ dom 𝐹) = ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)))
12 imacnvcnv 6056 . . . . . . . . 9 ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)) = ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵))
13 df-ima 5561 . . . . . . . . 9 ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)) = ran ((1st ↾ (V × {𝐶})) ↾ (𝐴 × 𝐵))
14 resres 5859 . . . . . . . . . 10 ((1st ↾ (V × {𝐶})) ↾ (𝐴 × 𝐵)) = (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵)))
1514rneqi 5800 . . . . . . . . 9 ran ((1st ↾ (V × {𝐶})) ↾ (𝐴 × 𝐵)) = ran (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵)))
1612, 13, 153eqtri 2846 . . . . . . . 8 ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)) = ran (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵)))
17 inxp 5696 . . . . . . . . . . . . 13 ((V × {𝐶}) ∩ (𝐴 × 𝐵)) = ((V ∩ 𝐴) × ({𝐶} ∩ 𝐵))
18 incom 4176 . . . . . . . . . . . . . . 15 (V ∩ 𝐴) = (𝐴 ∩ V)
19 inv1 4346 . . . . . . . . . . . . . . 15 (𝐴 ∩ V) = 𝐴
2018, 19eqtri 2842 . . . . . . . . . . . . . 14 (V ∩ 𝐴) = 𝐴
2120xpeq1i 5574 . . . . . . . . . . . . 13 ((V ∩ 𝐴) × ({𝐶} ∩ 𝐵)) = (𝐴 × ({𝐶} ∩ 𝐵))
2217, 21eqtri 2842 . . . . . . . . . . . 12 ((V × {𝐶}) ∩ (𝐴 × 𝐵)) = (𝐴 × ({𝐶} ∩ 𝐵))
23 snssi 4733 . . . . . . . . . . . . . 14 (𝐶𝐵 → {𝐶} ⊆ 𝐵)
24 df-ss 3950 . . . . . . . . . . . . . 14 ({𝐶} ⊆ 𝐵 ↔ ({𝐶} ∩ 𝐵) = {𝐶})
2523, 24sylib 220 . . . . . . . . . . . . 13 (𝐶𝐵 → ({𝐶} ∩ 𝐵) = {𝐶})
2625xpeq2d 5578 . . . . . . . . . . . 12 (𝐶𝐵 → (𝐴 × ({𝐶} ∩ 𝐵)) = (𝐴 × {𝐶}))
2722, 26syl5eq 2866 . . . . . . . . . . 11 (𝐶𝐵 → ((V × {𝐶}) ∩ (𝐴 × 𝐵)) = (𝐴 × {𝐶}))
2827reseq2d 5846 . . . . . . . . . 10 (𝐶𝐵 → (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵))) = (1st ↾ (𝐴 × {𝐶})))
2928rneqd 5801 . . . . . . . . 9 (𝐶𝐵 → ran (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵))) = ran (1st ↾ (𝐴 × {𝐶})))
30 1stconst 7787 . . . . . . . . . 10 (𝐶𝐵 → (1st ↾ (𝐴 × {𝐶})):(𝐴 × {𝐶})–1-1-onto𝐴)
31 f1ofo 6615 . . . . . . . . . 10 ((1st ↾ (𝐴 × {𝐶})):(𝐴 × {𝐶})–1-1-onto𝐴 → (1st ↾ (𝐴 × {𝐶})):(𝐴 × {𝐶})–onto𝐴)
32 forn 6586 . . . . . . . . . 10 ((1st ↾ (𝐴 × {𝐶})):(𝐴 × {𝐶})–onto𝐴 → ran (1st ↾ (𝐴 × {𝐶})) = 𝐴)
3330, 31, 323syl 18 . . . . . . . . 9 (𝐶𝐵 → ran (1st ↾ (𝐴 × {𝐶})) = 𝐴)
3429, 33eqtrd 2854 . . . . . . . 8 (𝐶𝐵 → ran (1st ↾ ((V × {𝐶}) ∩ (𝐴 × 𝐵))) = 𝐴)
3516, 34syl5eq 2866 . . . . . . 7 (𝐶𝐵 → ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)) = 𝐴)
3635adantl 484 . . . . . 6 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → ((1st ↾ (V × {𝐶})) “ (𝐴 × 𝐵)) = 𝐴)
3711, 36eqtrd 2854 . . . . 5 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → ((1st ↾ (V × {𝐶})) “ dom 𝐹) = 𝐴)
388, 37syl5eq 2866 . . . 4 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → dom (𝐹(1st ↾ (V × {𝐶}))) = 𝐴)
39 curry2.1 . . . . . 6 𝐺 = (𝐹(1st ↾ (V × {𝐶})))
4039fneq1i 6443 . . . . 5 (𝐺 Fn 𝐴 ↔ (𝐹(1st ↾ (V × {𝐶}))) Fn 𝐴)
41 df-fn 6351 . . . . 5 ((𝐹(1st ↾ (V × {𝐶}))) Fn 𝐴 ↔ (Fun (𝐹(1st ↾ (V × {𝐶}))) ∧ dom (𝐹(1st ↾ (V × {𝐶}))) = 𝐴))
4240, 41bitri 277 . . . 4 (𝐺 Fn 𝐴 ↔ (Fun (𝐹(1st ↾ (V × {𝐶}))) ∧ dom (𝐹(1st ↾ (V × {𝐶}))) = 𝐴))
437, 38, 42sylanbrc 585 . . 3 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → 𝐺 Fn 𝐴)
44 dffn5 6717 . . 3 (𝐺 Fn 𝐴𝐺 = (𝑥𝐴 ↦ (𝐺𝑥)))
4543, 44sylib 220 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → 𝐺 = (𝑥𝐴 ↦ (𝐺𝑥)))
4639fveq1i 6664 . . . . 5 (𝐺𝑥) = ((𝐹(1st ↾ (V × {𝐶})))‘𝑥)
47 dff1o4 6616 . . . . . . . . 9 ((1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V ↔ ((1st ↾ (V × {𝐶})) Fn (V × {𝐶}) ∧ (1st ↾ (V × {𝐶})) Fn V))
482, 47sylib 220 . . . . . . . 8 (𝐶𝐵 → ((1st ↾ (V × {𝐶})) Fn (V × {𝐶}) ∧ (1st ↾ (V × {𝐶})) Fn V))
4948simprd 498 . . . . . . 7 (𝐶𝐵(1st ↾ (V × {𝐶})) Fn V)
50 vex 3496 . . . . . . 7 𝑥 ∈ V
51 fvco2 6751 . . . . . . 7 (((1st ↾ (V × {𝐶})) Fn V ∧ 𝑥 ∈ V) → ((𝐹(1st ↾ (V × {𝐶})))‘𝑥) = (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)))
5249, 50, 51sylancl 588 . . . . . 6 (𝐶𝐵 → ((𝐹(1st ↾ (V × {𝐶})))‘𝑥) = (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)))
5352ad2antlr 725 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) ∧ 𝑥𝐴) → ((𝐹(1st ↾ (V × {𝐶})))‘𝑥) = (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)))
5446, 53syl5eq 2866 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) ∧ 𝑥𝐴) → (𝐺𝑥) = (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)))
552adantr 483 . . . . . . . . 9 ((𝐶𝐵𝑥𝐴) → (1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V)
5650a1i 11 . . . . . . . . . 10 ((𝐶𝐵𝑥𝐴) → 𝑥 ∈ V)
57 snidg 4591 . . . . . . . . . . 11 (𝐶𝐵𝐶 ∈ {𝐶})
5857adantr 483 . . . . . . . . . 10 ((𝐶𝐵𝑥𝐴) → 𝐶 ∈ {𝐶})
5956, 58opelxpd 5586 . . . . . . . . 9 ((𝐶𝐵𝑥𝐴) → ⟨𝑥, 𝐶⟩ ∈ (V × {𝐶}))
6055, 59jca 514 . . . . . . . 8 ((𝐶𝐵𝑥𝐴) → ((1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V ∧ ⟨𝑥, 𝐶⟩ ∈ (V × {𝐶})))
6150a1i 11 . . . . . . . . . . . 12 (𝐶𝐵𝑥 ∈ V)
6261, 57opelxpd 5586 . . . . . . . . . . 11 (𝐶𝐵 → ⟨𝑥, 𝐶⟩ ∈ (V × {𝐶}))
6362fvresd 6683 . . . . . . . . . 10 (𝐶𝐵 → ((1st ↾ (V × {𝐶}))‘⟨𝑥, 𝐶⟩) = (1st ‘⟨𝑥, 𝐶⟩))
6463adantr 483 . . . . . . . . 9 ((𝐶𝐵𝑥𝐴) → ((1st ↾ (V × {𝐶}))‘⟨𝑥, 𝐶⟩) = (1st ‘⟨𝑥, 𝐶⟩))
65 op1stg 7693 . . . . . . . . . 10 ((𝑥𝐴𝐶𝐵) → (1st ‘⟨𝑥, 𝐶⟩) = 𝑥)
6665ancoms 461 . . . . . . . . 9 ((𝐶𝐵𝑥𝐴) → (1st ‘⟨𝑥, 𝐶⟩) = 𝑥)
6764, 66eqtrd 2854 . . . . . . . 8 ((𝐶𝐵𝑥𝐴) → ((1st ↾ (V × {𝐶}))‘⟨𝑥, 𝐶⟩) = 𝑥)
68 f1ocnvfv 7027 . . . . . . . 8 (((1st ↾ (V × {𝐶})):(V × {𝐶})–1-1-onto→V ∧ ⟨𝑥, 𝐶⟩ ∈ (V × {𝐶})) → (((1st ↾ (V × {𝐶}))‘⟨𝑥, 𝐶⟩) = 𝑥 → ((1st ↾ (V × {𝐶}))‘𝑥) = ⟨𝑥, 𝐶⟩))
6960, 67, 68sylc 65 . . . . . . 7 ((𝐶𝐵𝑥𝐴) → ((1st ↾ (V × {𝐶}))‘𝑥) = ⟨𝑥, 𝐶⟩)
7069fveq2d 6667 . . . . . 6 ((𝐶𝐵𝑥𝐴) → (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)) = (𝐹‘⟨𝑥, 𝐶⟩))
7170adantll 712 . . . . 5 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) ∧ 𝑥𝐴) → (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)) = (𝐹‘⟨𝑥, 𝐶⟩))
72 df-ov 7151 . . . . 5 (𝑥𝐹𝐶) = (𝐹‘⟨𝑥, 𝐶⟩)
7371, 72syl6eqr 2872 . . . 4 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) ∧ 𝑥𝐴) → (𝐹‘((1st ↾ (V × {𝐶}))‘𝑥)) = (𝑥𝐹𝐶))
7454, 73eqtrd 2854 . . 3 (((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) ∧ 𝑥𝐴) → (𝐺𝑥) = (𝑥𝐹𝐶))
7574mpteq2dva 5152 . 2 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → (𝑥𝐴 ↦ (𝐺𝑥)) = (𝑥𝐴 ↦ (𝑥𝐹𝐶)))
7645, 75eqtrd 2854 1 ((𝐹 Fn (𝐴 × 𝐵) ∧ 𝐶𝐵) → 𝐺 = (𝑥𝐴 ↦ (𝑥𝐹𝐶)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 398   = wceq 1531  wcel 2108  Vcvv 3493  cin 3933  wss 3934  {csn 4559  cop 4565  cmpt 5137   × cxp 5546  ccnv 5547  dom cdm 5548  ran crn 5549  cres 5550  cima 5551  ccom 5552  Fun wfun 6342   Fn wfn 6343  ontowfo 6346  1-1-ontowf1o 6347  cfv 6348  (class class class)co 7148  1st c1st 7679
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1790  ax-4 1804  ax-5 1905  ax-6 1964  ax-7 2009  ax-8 2110  ax-9 2118  ax-10 2139  ax-11 2154  ax-12 2170  ax-ext 2791  ax-sep 5194  ax-nul 5201  ax-pow 5257  ax-pr 5320  ax-un 7453
This theorem depends on definitions:  df-bi 209  df-an 399  df-or 844  df-3an 1084  df-tru 1534  df-ex 1775  df-nf 1779  df-sb 2064  df-mo 2616  df-eu 2648  df-clab 2798  df-cleq 2812  df-clel 2891  df-nfc 2961  df-ne 3015  df-ral 3141  df-rex 3142  df-rab 3145  df-v 3495  df-sbc 3771  df-csb 3882  df-dif 3937  df-un 3939  df-in 3941  df-ss 3950  df-nul 4290  df-if 4466  df-sn 4560  df-pr 4562  df-op 4566  df-uni 4831  df-iun 4912  df-br 5058  df-opab 5120  df-mpt 5138  df-id 5453  df-xp 5554  df-rel 5555  df-cnv 5556  df-co 5557  df-dm 5558  df-rn 5559  df-res 5560  df-ima 5561  df-iota 6307  df-fun 6350  df-fn 6351  df-f 6352  df-f1 6353  df-fo 6354  df-f1o 6355  df-fv 6356  df-ov 7151  df-1st 7681  df-2nd 7682
This theorem is referenced by:  curry2f  7795  curry2val  7796
  Copyright terms: Public domain W3C validator