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

Theorem curry2 6441
Description: Composition with  `' ( 1st  |`  ( _V  X.  { C } ) ) turns any binary operation  F with a constant second operand into a function  G 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  |-  G  =  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )
Assertion
Ref Expression
curry2  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  G  =  ( x  e.  A  |->  ( x F C ) ) )
Distinct variable groups:    x, A    x, B    x, C    x, F    x, G

Proof of Theorem curry2
StepHypRef Expression
1 fnfun 5542 . . . . 5  |-  ( F  Fn  ( A  X.  B )  ->  Fun  F )
2 1stconst 6435 . . . . . 6  |-  ( C  e.  B  ->  ( 1st  |`  ( _V  X.  { C } ) ) : ( _V  X.  { C } ) -1-1-onto-> _V )
3 dff1o3 5680 . . . . . . 7  |-  ( ( 1st  |`  ( _V  X.  { C } ) ) : ( _V 
X.  { C }
)
-1-1-onto-> _V 
<->  ( ( 1st  |`  ( _V  X.  { C }
) ) : ( _V  X.  { C } ) -onto-> _V  /\  Fun  `' ( 1st  |`  ( _V  X.  { C }
) ) ) )
43simprbi 451 . . . . . 6  |-  ( ( 1st  |`  ( _V  X.  { C } ) ) : ( _V 
X.  { C }
)
-1-1-onto-> _V  ->  Fun  `' ( 1st  |`  ( _V  X.  { C } ) ) )
52, 4syl 16 . . . . 5  |-  ( C  e.  B  ->  Fun  `' ( 1st  |`  ( _V  X.  { C }
) ) )
6 funco 5491 . . . . 5  |-  ( ( Fun  F  /\  Fun  `' ( 1st  |`  ( _V  X.  { C }
) ) )  ->  Fun  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) ) )
71, 5, 6syl2an 464 . . . 4  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  Fun  ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) ) )
8 dmco 5378 . . . . 5  |-  dom  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )  =  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " dom  F )
9 fndm 5544 . . . . . . . 8  |-  ( F  Fn  ( A  X.  B )  ->  dom  F  =  ( A  X.  B ) )
109adantr 452 . . . . . . 7  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  dom  F  =  ( A  X.  B ) )
1110imaeq2d 5203 . . . . . 6  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( `' `' ( 1st  |`  ( _V  X.  { C } ) ) " dom  F
)  =  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) ) )
12 imacnvcnv 5334 . . . . . . . . 9  |-  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) )  =  ( ( 1st  |`  ( _V  X.  { C } ) ) "
( A  X.  B
) )
13 df-ima 4891 . . . . . . . . 9  |-  ( ( 1st  |`  ( _V  X.  { C } ) ) " ( A  X.  B ) )  =  ran  ( ( 1st  |`  ( _V  X.  { C } ) )  |`  ( A  X.  B ) )
14 resres 5159 . . . . . . . . . 10  |-  ( ( 1st  |`  ( _V  X.  { C } ) )  |`  ( A  X.  B ) )  =  ( 1st  |`  (
( _V  X.  { C } )  i^i  ( A  X.  B ) ) )
1514rneqi 5096 . . . . . . . . 9  |-  ran  (
( 1st  |`  ( _V 
X.  { C }
) )  |`  ( A  X.  B ) )  =  ran  ( 1st  |`  ( ( _V  X.  { C } )  i^i  ( A  X.  B
) ) )
1612, 13, 153eqtri 2460 . . . . . . . 8  |-  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) )  =  ran  ( 1st  |`  ( ( _V  X.  { C } )  i^i  ( A  X.  B
) ) )
17 inxp 5007 . . . . . . . . . . . . 13  |-  ( ( _V  X.  { C } )  i^i  ( A  X.  B ) )  =  ( ( _V 
i^i  A )  X.  ( { C }  i^i  B ) )
18 incom 3533 . . . . . . . . . . . . . . 15  |-  ( _V 
i^i  A )  =  ( A  i^i  _V )
19 inv1 3654 . . . . . . . . . . . . . . 15  |-  ( A  i^i  _V )  =  A
2018, 19eqtri 2456 . . . . . . . . . . . . . 14  |-  ( _V 
i^i  A )  =  A
2120xpeq1i 4898 . . . . . . . . . . . . 13  |-  ( ( _V  i^i  A )  X.  ( { C }  i^i  B ) )  =  ( A  X.  ( { C }  i^i  B ) )
2217, 21eqtri 2456 . . . . . . . . . . . 12  |-  ( ( _V  X.  { C } )  i^i  ( A  X.  B ) )  =  ( A  X.  ( { C }  i^i  B ) )
23 snssi 3942 . . . . . . . . . . . . . 14  |-  ( C  e.  B  ->  { C }  C_  B )
24 df-ss 3334 . . . . . . . . . . . . . 14  |-  ( { C }  C_  B  <->  ( { C }  i^i  B )  =  { C } )
2523, 24sylib 189 . . . . . . . . . . . . 13  |-  ( C  e.  B  ->  ( { C }  i^i  B
)  =  { C } )
2625xpeq2d 4902 . . . . . . . . . . . 12  |-  ( C  e.  B  ->  ( A  X.  ( { C }  i^i  B ) )  =  ( A  X.  { C } ) )
2722, 26syl5eq 2480 . . . . . . . . . . 11  |-  ( C  e.  B  ->  (
( _V  X.  { C } )  i^i  ( A  X.  B ) )  =  ( A  X.  { C } ) )
2827reseq2d 5146 . . . . . . . . . 10  |-  ( C  e.  B  ->  ( 1st  |`  ( ( _V 
X.  { C }
)  i^i  ( A  X.  B ) ) )  =  ( 1st  |`  ( A  X.  { C }
) ) )
2928rneqd 5097 . . . . . . . . 9  |-  ( C  e.  B  ->  ran  ( 1st  |`  ( ( _V  X.  { C }
)  i^i  ( A  X.  B ) ) )  =  ran  ( 1st  |`  ( A  X.  { C } ) ) )
30 1stconst 6435 . . . . . . . . . 10  |-  ( C  e.  B  ->  ( 1st  |`  ( A  X.  { C } ) ) : ( A  X.  { C } ) -1-1-onto-> A )
31 f1ofo 5681 . . . . . . . . . 10  |-  ( ( 1st  |`  ( A  X.  { C } ) ) : ( A  X.  { C }
)
-1-1-onto-> A  ->  ( 1st  |`  ( A  X.  { C }
) ) : ( A  X.  { C } ) -onto-> A )
32 forn 5656 . . . . . . . . . 10  |-  ( ( 1st  |`  ( A  X.  { C } ) ) : ( A  X.  { C }
) -onto-> A  ->  ran  ( 1st  |`  ( A  X.  { C } ) )  =  A )
3330, 31, 323syl 19 . . . . . . . . 9  |-  ( C  e.  B  ->  ran  ( 1st  |`  ( A  X.  { C } ) )  =  A )
3429, 33eqtrd 2468 . . . . . . . 8  |-  ( C  e.  B  ->  ran  ( 1st  |`  ( ( _V  X.  { C }
)  i^i  ( A  X.  B ) ) )  =  A )
3516, 34syl5eq 2480 . . . . . . 7  |-  ( C  e.  B  ->  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) )  =  A )
3635adantl 453 . . . . . 6  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( `' `' ( 1st  |`  ( _V  X.  { C } ) ) " ( A  X.  B ) )  =  A )
3711, 36eqtrd 2468 . . . . 5  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( `' `' ( 1st  |`  ( _V  X.  { C } ) ) " dom  F
)  =  A )
388, 37syl5eq 2480 . . . 4  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  dom  ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) )  =  A )
39 curry2.1 . . . . . 6  |-  G  =  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )
4039fneq1i 5539 . . . . 5  |-  ( G  Fn  A  <->  ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) )  Fn  A )
41 df-fn 5457 . . . . 5  |-  ( ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )  Fn  A  <->  ( Fun  ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) )  /\  dom  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )  =  A ) )
4240, 41bitri 241 . . . 4  |-  ( G  Fn  A  <->  ( Fun  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )  /\  dom  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )  =  A ) )
437, 38, 42sylanbrc 646 . . 3  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  G  Fn  A )
44 dffn5 5772 . . 3  |-  ( G  Fn  A  <->  G  =  ( x  e.  A  |->  ( G `  x
) ) )
4543, 44sylib 189 . 2  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  G  =  ( x  e.  A  |->  ( G `
 x ) ) )
4639fveq1i 5729 . . . . 5  |-  ( G `
 x )  =  ( ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) ) `  x )
47 dff1o4 5682 . . . . . . . . 9  |-  ( ( 1st  |`  ( _V  X.  { C } ) ) : ( _V 
X.  { C }
)
-1-1-onto-> _V 
<->  ( ( 1st  |`  ( _V  X.  { C }
) )  Fn  ( _V  X.  { C }
)  /\  `' ( 1st  |`  ( _V  X.  { C } ) )  Fn  _V ) )
482, 47sylib 189 . . . . . . . 8  |-  ( C  e.  B  ->  (
( 1st  |`  ( _V 
X.  { C }
) )  Fn  ( _V  X.  { C }
)  /\  `' ( 1st  |`  ( _V  X.  { C } ) )  Fn  _V ) )
4948simprd 450 . . . . . . 7  |-  ( C  e.  B  ->  `' ( 1st  |`  ( _V  X.  { C } ) )  Fn  _V )
50 vex 2959 . . . . . . 7  |-  x  e. 
_V
51 fvco2 5798 . . . . . . 7  |-  ( ( `' ( 1st  |`  ( _V  X.  { C }
) )  Fn  _V  /\  x  e.  _V )  ->  ( ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) ) `  x )  =  ( F `  ( `' ( 1st  |`  ( _V  X.  { C }
) ) `  x
) ) )
5249, 50, 51sylancl 644 . . . . . 6  |-  ( C  e.  B  ->  (
( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) ) `  x
)  =  ( F `
 ( `' ( 1st  |`  ( _V  X.  { C } ) ) `  x ) ) )
5352ad2antlr 708 . . . . 5  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) ) `  x )  =  ( F `  ( `' ( 1st  |`  ( _V  X.  { C }
) ) `  x
) ) )
5446, 53syl5eq 2480 . . . 4  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( G `  x )  =  ( F `  ( `' ( 1st  |`  ( _V  X.  { C }
) ) `  x
) ) )
552adantr 452 . . . . . . . . 9  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( 1st  |`  ( _V  X.  { C }
) ) : ( _V  X.  { C } ) -1-1-onto-> _V )
5650a1i 11 . . . . . . . . . 10  |-  ( ( C  e.  B  /\  x  e.  A )  ->  x  e.  _V )
57 snidg 3839 . . . . . . . . . . 11  |-  ( C  e.  B  ->  C  e.  { C } )
5857adantr 452 . . . . . . . . . 10  |-  ( ( C  e.  B  /\  x  e.  A )  ->  C  e.  { C } )
59 opelxp 4908 . . . . . . . . . 10  |-  ( <.
x ,  C >.  e.  ( _V  X.  { C } )  <->  ( x  e.  _V  /\  C  e. 
{ C } ) )
6056, 58, 59sylanbrc 646 . . . . . . . . 9  |-  ( ( C  e.  B  /\  x  e.  A )  -> 
<. x ,  C >.  e.  ( _V  X.  { C } ) )
6155, 60jca 519 . . . . . . . 8  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( ( 1st  |`  ( _V  X.  { C }
) ) : ( _V  X.  { C } ) -1-1-onto-> _V  /\  <. x ,  C >.  e.  ( _V  X.  { C }
) ) )
6250a1i 11 . . . . . . . . . . . 12  |-  ( C  e.  B  ->  x  e.  _V )
6362, 57, 59sylanbrc 646 . . . . . . . . . . 11  |-  ( C  e.  B  ->  <. x ,  C >.  e.  ( _V  X.  { C }
) )
64 fvres 5745 . . . . . . . . . . 11  |-  ( <.
x ,  C >.  e.  ( _V  X.  { C } )  ->  (
( 1st  |`  ( _V 
X.  { C }
) ) `  <. x ,  C >. )  =  ( 1st `  <. x ,  C >. )
)
6563, 64syl 16 . . . . . . . . . 10  |-  ( C  e.  B  ->  (
( 1st  |`  ( _V 
X.  { C }
) ) `  <. x ,  C >. )  =  ( 1st `  <. x ,  C >. )
)
6665adantr 452 . . . . . . . . 9  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( ( 1st  |`  ( _V  X.  { C }
) ) `  <. x ,  C >. )  =  ( 1st `  <. x ,  C >. )
)
67 op1stg 6359 . . . . . . . . . 10  |-  ( ( x  e.  A  /\  C  e.  B )  ->  ( 1st `  <. x ,  C >. )  =  x )
6867ancoms 440 . . . . . . . . 9  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( 1st `  <. x ,  C >. )  =  x )
6966, 68eqtrd 2468 . . . . . . . 8  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( ( 1st  |`  ( _V  X.  { C }
) ) `  <. x ,  C >. )  =  x )
70 f1ocnvfv 6016 . . . . . . . 8  |-  ( ( ( 1st  |`  ( _V  X.  { C }
) ) : ( _V  X.  { C } ) -1-1-onto-> _V  /\  <. x ,  C >.  e.  ( _V  X.  { C }
) )  ->  (
( ( 1st  |`  ( _V  X.  { C }
) ) `  <. x ,  C >. )  =  x  ->  ( `' ( 1st  |`  ( _V  X.  { C }
) ) `  x
)  =  <. x ,  C >. ) )
7161, 69, 70sylc 58 . . . . . . 7  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( `' ( 1st  |`  ( _V  X.  { C } ) ) `  x )  =  <. x ,  C >. )
7271fveq2d 5732 . . . . . 6  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( F `  ( `' ( 1st  |`  ( _V  X.  { C }
) ) `  x
) )  =  ( F `  <. x ,  C >. ) )
7372adantll 695 . . . . 5  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( F `  ( `' ( 1st  |`  ( _V  X.  { C } ) ) `  x ) )  =  ( F `  <. x ,  C >. )
)
74 df-ov 6084 . . . . 5  |-  ( x F C )  =  ( F `  <. x ,  C >. )
7573, 74syl6eqr 2486 . . . 4  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( F `  ( `' ( 1st  |`  ( _V  X.  { C } ) ) `  x ) )  =  ( x F C ) )
7654, 75eqtrd 2468 . . 3  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( G `  x )  =  ( x F C ) )
7776mpteq2dva 4295 . 2  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( x  e.  A  |->  ( G `  x
) )  =  ( x  e.  A  |->  ( x F C ) ) )
7845, 77eqtrd 2468 1  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  G  =  ( x  e.  A  |->  ( x F C ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 359    = wceq 1652    e. wcel 1725   _Vcvv 2956    i^i cin 3319    C_ wss 3320   {csn 3814   <.cop 3817    e. cmpt 4266    X. cxp 4876   `'ccnv 4877   dom cdm 4878   ran crn 4879    |` cres 4880   "cima 4881    o. ccom 4882   Fun wfun 5448    Fn wfn 5449   -onto->wfo 5452   -1-1-onto->wf1o 5453   ` cfv 5454  (class class class)co 6081   1stc1st 6347
This theorem is referenced by:  curry2f  6442  curry2val  6443
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1555  ax-5 1566  ax-17 1626  ax-9 1666  ax-8 1687  ax-13 1727  ax-14 1729  ax-6 1744  ax-7 1749  ax-11 1761  ax-12 1950  ax-ext 2417  ax-sep 4330  ax-nul 4338  ax-pow 4377  ax-pr 4403  ax-un 4701
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3an 938  df-tru 1328  df-ex 1551  df-nf 1554  df-sb 1659  df-eu 2285  df-mo 2286  df-clab 2423  df-cleq 2429  df-clel 2432  df-nfc 2561  df-ne 2601  df-ral 2710  df-rex 2711  df-rab 2714  df-v 2958  df-sbc 3162  df-csb 3252  df-dif 3323  df-un 3325  df-in 3327  df-ss 3334  df-nul 3629  df-if 3740  df-sn 3820  df-pr 3821  df-op 3823  df-uni 4016  df-iun 4095  df-br 4213  df-opab 4267  df-mpt 4268  df-id 4498  df-xp 4884  df-rel 4885  df-cnv 4886  df-co 4887  df-dm 4888  df-rn 4889  df-res 4890  df-ima 4891  df-iota 5418  df-fun 5456  df-fn 5457  df-f 5458  df-f1 5459  df-fo 5460  df-f1o 5461  df-fv 5462  df-ov 6084  df-1st 6349  df-2nd 6350
  Copyright terms: Public domain W3C validator