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

Theorem curry2 6229
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 5357 . . . . 5  |-  ( F  Fn  ( A  X.  B )  ->  Fun  F )
2 1stconst 6223 . . . . . 6  |-  ( C  e.  B  ->  ( 1st  |`  ( _V  X.  { C } ) ) : ( _V  X.  { C } ) -1-1-onto-> _V )
3 dff1o3 5494 . . . . . . 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 450 . . . . . 6  |-  ( ( 1st  |`  ( _V  X.  { C } ) ) : ( _V 
X.  { C }
)
-1-1-onto-> _V  ->  Fun  `' ( 1st  |`  ( _V  X.  { C } ) ) )
52, 4syl 15 . . . . 5  |-  ( C  e.  B  ->  Fun  `' ( 1st  |`  ( _V  X.  { C }
) ) )
6 funco 5308 . . . . 5  |-  ( ( Fun  F  /\  Fun  `' ( 1st  |`  ( _V  X.  { C }
) ) )  ->  Fun  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) ) )
71, 5, 6syl2an 463 . . . 4  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  Fun  ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) ) )
8 dmco 5197 . . . . 5  |-  dom  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )  =  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " dom  F )
9 fndm 5359 . . . . . . . 8  |-  ( F  Fn  ( A  X.  B )  ->  dom  F  =  ( A  X.  B ) )
109adantr 451 . . . . . . 7  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  dom  F  =  ( A  X.  B ) )
1110imaeq2d 5028 . . . . . 6  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( `' `' ( 1st  |`  ( _V  X.  { C } ) ) " dom  F
)  =  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) ) )
12 imacnvcnv 5153 . . . . . . . . 9  |-  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) )  =  ( ( 1st  |`  ( _V  X.  { C } ) ) "
( A  X.  B
) )
13 df-ima 4718 . . . . . . . . 9  |-  ( ( 1st  |`  ( _V  X.  { C } ) ) " ( A  X.  B ) )  =  ran  ( ( 1st  |`  ( _V  X.  { C } ) )  |`  ( A  X.  B ) )
14 resres 4984 . . . . . . . . . 10  |-  ( ( 1st  |`  ( _V  X.  { C } ) )  |`  ( A  X.  B ) )  =  ( 1st  |`  (
( _V  X.  { C } )  i^i  ( A  X.  B ) ) )
1514rneqi 4921 . . . . . . . . 9  |-  ran  (
( 1st  |`  ( _V 
X.  { C }
) )  |`  ( A  X.  B ) )  =  ran  ( 1st  |`  ( ( _V  X.  { C } )  i^i  ( A  X.  B
) ) )
1612, 13, 153eqtri 2320 . . . . . . . 8  |-  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) )  =  ran  ( 1st  |`  ( ( _V  X.  { C } )  i^i  ( A  X.  B
) ) )
17 inxp 4834 . . . . . . . . . . . . 13  |-  ( ( _V  X.  { C } )  i^i  ( A  X.  B ) )  =  ( ( _V 
i^i  A )  X.  ( { C }  i^i  B ) )
18 incom 3374 . . . . . . . . . . . . . . 15  |-  ( _V 
i^i  A )  =  ( A  i^i  _V )
19 inv1 3494 . . . . . . . . . . . . . . 15  |-  ( A  i^i  _V )  =  A
2018, 19eqtri 2316 . . . . . . . . . . . . . 14  |-  ( _V 
i^i  A )  =  A
2120xpeq1i 4725 . . . . . . . . . . . . 13  |-  ( ( _V  i^i  A )  X.  ( { C }  i^i  B ) )  =  ( A  X.  ( { C }  i^i  B ) )
2217, 21eqtri 2316 . . . . . . . . . . . 12  |-  ( ( _V  X.  { C } )  i^i  ( A  X.  B ) )  =  ( A  X.  ( { C }  i^i  B ) )
23 snssi 3775 . . . . . . . . . . . . . 14  |-  ( C  e.  B  ->  { C }  C_  B )
24 df-ss 3179 . . . . . . . . . . . . . 14  |-  ( { C }  C_  B  <->  ( { C }  i^i  B )  =  { C } )
2523, 24sylib 188 . . . . . . . . . . . . 13  |-  ( C  e.  B  ->  ( { C }  i^i  B
)  =  { C } )
2625xpeq2d 4729 . . . . . . . . . . . 12  |-  ( C  e.  B  ->  ( A  X.  ( { C }  i^i  B ) )  =  ( A  X.  { C } ) )
2722, 26syl5eq 2340 . . . . . . . . . . 11  |-  ( C  e.  B  ->  (
( _V  X.  { C } )  i^i  ( A  X.  B ) )  =  ( A  X.  { C } ) )
2827reseq2d 4971 . . . . . . . . . 10  |-  ( C  e.  B  ->  ( 1st  |`  ( ( _V 
X.  { C }
)  i^i  ( A  X.  B ) ) )  =  ( 1st  |`  ( A  X.  { C }
) ) )
2928rneqd 4922 . . . . . . . . 9  |-  ( C  e.  B  ->  ran  ( 1st  |`  ( ( _V  X.  { C }
)  i^i  ( A  X.  B ) ) )  =  ran  ( 1st  |`  ( A  X.  { C } ) ) )
30 1stconst 6223 . . . . . . . . . 10  |-  ( C  e.  B  ->  ( 1st  |`  ( A  X.  { C } ) ) : ( A  X.  { C } ) -1-1-onto-> A )
31 f1ofo 5495 . . . . . . . . . 10  |-  ( ( 1st  |`  ( A  X.  { C } ) ) : ( A  X.  { C }
)
-1-1-onto-> A  ->  ( 1st  |`  ( A  X.  { C }
) ) : ( A  X.  { C } ) -onto-> A )
32 forn 5470 . . . . . . . . . 10  |-  ( ( 1st  |`  ( A  X.  { C } ) ) : ( A  X.  { C }
) -onto-> A  ->  ran  ( 1st  |`  ( A  X.  { C } ) )  =  A )
3330, 31, 323syl 18 . . . . . . . . 9  |-  ( C  e.  B  ->  ran  ( 1st  |`  ( A  X.  { C } ) )  =  A )
3429, 33eqtrd 2328 . . . . . . . 8  |-  ( C  e.  B  ->  ran  ( 1st  |`  ( ( _V  X.  { C }
)  i^i  ( A  X.  B ) ) )  =  A )
3516, 34syl5eq 2340 . . . . . . 7  |-  ( C  e.  B  ->  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) )  =  A )
3635adantl 452 . . . . . 6  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( `' `' ( 1st  |`  ( _V  X.  { C } ) ) " ( A  X.  B ) )  =  A )
3711, 36eqtrd 2328 . . . . 5  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( `' `' ( 1st  |`  ( _V  X.  { C } ) ) " dom  F
)  =  A )
388, 37syl5eq 2340 . . . 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 5354 . . . . 5  |-  ( G  Fn  A  <->  ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) )  Fn  A )
41 df-fn 5274 . . . . 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 240 . . . 4  |-  ( G  Fn  A  <->  ( Fun  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )  /\  dom  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )  =  A ) )
437, 38, 42sylanbrc 645 . . 3  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  G  Fn  A )
44 dffn5 5584 . . 3  |-  ( G  Fn  A  <->  G  =  ( x  e.  A  |->  ( G `  x
) ) )
4543, 44sylib 188 . 2  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  G  =  ( x  e.  A  |->  ( G `
 x ) ) )
4639fveq1i 5542 . . . . 5  |-  ( G `
 x )  =  ( ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) ) `  x )
47 dff1o4 5496 . . . . . . . . 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 188 . . . . . . . 8  |-  ( C  e.  B  ->  (
( 1st  |`  ( _V 
X.  { C }
) )  Fn  ( _V  X.  { C }
)  /\  `' ( 1st  |`  ( _V  X.  { C } ) )  Fn  _V ) )
4948simprd 449 . . . . . . 7  |-  ( C  e.  B  ->  `' ( 1st  |`  ( _V  X.  { C } ) )  Fn  _V )
50 vex 2804 . . . . . . 7  |-  x  e. 
_V
51 fvco2 5610 . . . . . . 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 643 . . . . . 6  |-  ( C  e.  B  ->  (
( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) ) `  x
)  =  ( F `
 ( `' ( 1st  |`  ( _V  X.  { C } ) ) `  x ) ) )
5352ad2antlr 707 . . . . 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 2340 . . . 4  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( G `  x )  =  ( F `  ( `' ( 1st  |`  ( _V  X.  { C }
) ) `  x
) ) )
552adantr 451 . . . . . . . . 9  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( 1st  |`  ( _V  X.  { C }
) ) : ( _V  X.  { C } ) -1-1-onto-> _V )
5650a1i 10 . . . . . . . . . 10  |-  ( ( C  e.  B  /\  x  e.  A )  ->  x  e.  _V )
57 snidg 3678 . . . . . . . . . . 11  |-  ( C  e.  B  ->  C  e.  { C } )
5857adantr 451 . . . . . . . . . 10  |-  ( ( C  e.  B  /\  x  e.  A )  ->  C  e.  { C } )
59 opelxp 4735 . . . . . . . . . 10  |-  ( <.
x ,  C >.  e.  ( _V  X.  { C } )  <->  ( x  e.  _V  /\  C  e. 
{ C } ) )
6056, 58, 59sylanbrc 645 . . . . . . . . 9  |-  ( ( C  e.  B  /\  x  e.  A )  -> 
<. x ,  C >.  e.  ( _V  X.  { C } ) )
6155, 60jca 518 . . . . . . . 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 10 . . . . . . . . . . . 12  |-  ( C  e.  B  ->  x  e.  _V )
6362, 57, 59sylanbrc 645 . . . . . . . . . . 11  |-  ( C  e.  B  ->  <. x ,  C >.  e.  ( _V  X.  { C }
) )
64 fvres 5558 . . . . . . . . . . 11  |-  ( <.
x ,  C >.  e.  ( _V  X.  { C } )  ->  (
( 1st  |`  ( _V 
X.  { C }
) ) `  <. x ,  C >. )  =  ( 1st `  <. x ,  C >. )
)
6563, 64syl 15 . . . . . . . . . 10  |-  ( C  e.  B  ->  (
( 1st  |`  ( _V 
X.  { C }
) ) `  <. x ,  C >. )  =  ( 1st `  <. x ,  C >. )
)
6665adantr 451 . . . . . . . . 9  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( ( 1st  |`  ( _V  X.  { C }
) ) `  <. x ,  C >. )  =  ( 1st `  <. x ,  C >. )
)
67 op1stg 6148 . . . . . . . . . 10  |-  ( ( x  e.  A  /\  C  e.  B )  ->  ( 1st `  <. x ,  C >. )  =  x )
6867ancoms 439 . . . . . . . . 9  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( 1st `  <. x ,  C >. )  =  x )
6966, 68eqtrd 2328 . . . . . . . 8  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( ( 1st  |`  ( _V  X.  { C }
) ) `  <. x ,  C >. )  =  x )
70 f1ocnvfv 5810 . . . . . . . 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 56 . . . . . . 7  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( `' ( 1st  |`  ( _V  X.  { C } ) ) `  x )  =  <. x ,  C >. )
7271fveq2d 5545 . . . . . 6  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( F `  ( `' ( 1st  |`  ( _V  X.  { C }
) ) `  x
) )  =  ( F `  <. x ,  C >. ) )
7372adantll 694 . . . . 5  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( F `  ( `' ( 1st  |`  ( _V  X.  { C } ) ) `  x ) )  =  ( F `  <. x ,  C >. )
)
74 df-ov 5877 . . . . 5  |-  ( x F C )  =  ( F `  <. x ,  C >. )
7573, 74syl6eqr 2346 . . . 4  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( F `  ( `' ( 1st  |`  ( _V  X.  { C } ) ) `  x ) )  =  ( x F C ) )
7654, 75eqtrd 2328 . . 3  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( G `  x )  =  ( x F C ) )
7776mpteq2dva 4122 . 2  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( x  e.  A  |->  ( G `  x
) )  =  ( x  e.  A  |->  ( x F C ) ) )
7845, 77eqtrd 2328 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 358    = wceq 1632    e. wcel 1696   _Vcvv 2801    i^i cin 3164    C_ wss 3165   {csn 3653   <.cop 3656    e. cmpt 4093    X. cxp 4703   `'ccnv 4704   dom cdm 4705   ran crn 4706    |` cres 4707   "cima 4708    o. ccom 4709   Fun wfun 5265    Fn wfn 5266   -onto->wfo 5269   -1-1-onto->wf1o 5270   ` cfv 5271  (class class class)co 5874   1stc1st 6136
This theorem is referenced by:  curry2f  6230  curry2val  6231
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-13 1698  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-sep 4157  ax-nul 4165  ax-pow 4204  ax-pr 4230  ax-un 4528
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3an 936  df-tru 1310  df-ex 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-ral 2561  df-rex 2562  df-rab 2565  df-v 2803  df-sbc 3005  df-csb 3095  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-nul 3469  df-if 3579  df-sn 3659  df-pr 3660  df-op 3662  df-uni 3844  df-iun 3923  df-br 4040  df-opab 4094  df-mpt 4095  df-id 4325  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-rn 4716  df-res 4717  df-ima 4718  df-iota 5235  df-fun 5273  df-fn 5274  df-f 5275  df-f1 5276  df-fo 5277  df-f1o 5278  df-fv 5279  df-ov 5877  df-1st 6138  df-2nd 6139
  Copyright terms: Public domain W3C validator