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

Theorem curry2 6213
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 5341 . . . . 5  |-  ( F  Fn  ( A  X.  B )  ->  Fun  F )
2 1stconst 6207 . . . . . 6  |-  ( C  e.  B  ->  ( 1st  |`  ( _V  X.  { C } ) ) : ( _V  X.  { C } ) -1-1-onto-> _V )
3 dff1o3 5478 . . . . . . 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 5292 . . . . 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 5181 . . . . 5  |-  dom  ( F  o.  `' ( 1st  |`  ( _V  X.  { C } ) ) )  =  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " dom  F )
9 fndm 5343 . . . . . . . 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 5012 . . . . . 6  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( `' `' ( 1st  |`  ( _V  X.  { C } ) ) " dom  F
)  =  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) ) )
12 imacnvcnv 5137 . . . . . . . . 9  |-  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) )  =  ( ( 1st  |`  ( _V  X.  { C } ) ) "
( A  X.  B
) )
13 df-ima 4702 . . . . . . . . 9  |-  ( ( 1st  |`  ( _V  X.  { C } ) ) " ( A  X.  B ) )  =  ran  ( ( 1st  |`  ( _V  X.  { C } ) )  |`  ( A  X.  B ) )
14 resres 4968 . . . . . . . . . 10  |-  ( ( 1st  |`  ( _V  X.  { C } ) )  |`  ( A  X.  B ) )  =  ( 1st  |`  (
( _V  X.  { C } )  i^i  ( A  X.  B ) ) )
1514rneqi 4905 . . . . . . . . 9  |-  ran  (
( 1st  |`  ( _V 
X.  { C }
) )  |`  ( A  X.  B ) )  =  ran  ( 1st  |`  ( ( _V  X.  { C } )  i^i  ( A  X.  B
) ) )
1612, 13, 153eqtri 2307 . . . . . . . 8  |-  ( `' `' ( 1st  |`  ( _V  X.  { C }
) ) " ( A  X.  B ) )  =  ran  ( 1st  |`  ( ( _V  X.  { C } )  i^i  ( A  X.  B
) ) )
17 inxp 4818 . . . . . . . . . . . . 13  |-  ( ( _V  X.  { C } )  i^i  ( A  X.  B ) )  =  ( ( _V 
i^i  A )  X.  ( { C }  i^i  B ) )
18 incom 3361 . . . . . . . . . . . . . . 15  |-  ( _V 
i^i  A )  =  ( A  i^i  _V )
19 inv1 3481 . . . . . . . . . . . . . . 15  |-  ( A  i^i  _V )  =  A
2018, 19eqtri 2303 . . . . . . . . . . . . . 14  |-  ( _V 
i^i  A )  =  A
2120xpeq1i 4709 . . . . . . . . . . . . 13  |-  ( ( _V  i^i  A )  X.  ( { C }  i^i  B ) )  =  ( A  X.  ( { C }  i^i  B ) )
2217, 21eqtri 2303 . . . . . . . . . . . 12  |-  ( ( _V  X.  { C } )  i^i  ( A  X.  B ) )  =  ( A  X.  ( { C }  i^i  B ) )
23 snssi 3759 . . . . . . . . . . . . . 14  |-  ( C  e.  B  ->  { C }  C_  B )
24 df-ss 3166 . . . . . . . . . . . . . 14  |-  ( { C }  C_  B  <->  ( { C }  i^i  B )  =  { C } )
2523, 24sylib 188 . . . . . . . . . . . . 13  |-  ( C  e.  B  ->  ( { C }  i^i  B
)  =  { C } )
2625xpeq2d 4713 . . . . . . . . . . . 12  |-  ( C  e.  B  ->  ( A  X.  ( { C }  i^i  B ) )  =  ( A  X.  { C } ) )
2722, 26syl5eq 2327 . . . . . . . . . . 11  |-  ( C  e.  B  ->  (
( _V  X.  { C } )  i^i  ( A  X.  B ) )  =  ( A  X.  { C } ) )
2827reseq2d 4955 . . . . . . . . . 10  |-  ( C  e.  B  ->  ( 1st  |`  ( ( _V 
X.  { C }
)  i^i  ( A  X.  B ) ) )  =  ( 1st  |`  ( A  X.  { C }
) ) )
2928rneqd 4906 . . . . . . . . 9  |-  ( C  e.  B  ->  ran  ( 1st  |`  ( ( _V  X.  { C }
)  i^i  ( A  X.  B ) ) )  =  ran  ( 1st  |`  ( A  X.  { C } ) ) )
30 1stconst 6207 . . . . . . . . . 10  |-  ( C  e.  B  ->  ( 1st  |`  ( A  X.  { C } ) ) : ( A  X.  { C } ) -1-1-onto-> A )
31 f1ofo 5479 . . . . . . . . . 10  |-  ( ( 1st  |`  ( A  X.  { C } ) ) : ( A  X.  { C }
)
-1-1-onto-> A  ->  ( 1st  |`  ( A  X.  { C }
) ) : ( A  X.  { C } ) -onto-> A )
32 forn 5454 . . . . . . . . . 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 2315 . . . . . . . 8  |-  ( C  e.  B  ->  ran  ( 1st  |`  ( ( _V  X.  { C }
)  i^i  ( A  X.  B ) ) )  =  A )
3516, 34syl5eq 2327 . . . . . . 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 2315 . . . . 5  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( `' `' ( 1st  |`  ( _V  X.  { C } ) ) " dom  F
)  =  A )
388, 37syl5eq 2327 . . . 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 5338 . . . . 5  |-  ( G  Fn  A  <->  ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) )  Fn  A )
41 df-fn 5258 . . . . 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 5568 . . 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 5526 . . . . 5  |-  ( G `
 x )  =  ( ( F  o.  `' ( 1st  |`  ( _V  X.  { C }
) ) ) `  x )
47 dff1o4 5480 . . . . . . . . 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 2791 . . . . . . 7  |-  x  e. 
_V
51 fvco2 5594 . . . . . . 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 2327 . . . 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 3665 . . . . . . . . . . 11  |-  ( C  e.  B  ->  C  e.  { C } )
5857adantr 451 . . . . . . . . . 10  |-  ( ( C  e.  B  /\  x  e.  A )  ->  C  e.  { C } )
59 opelxp 4719 . . . . . . . . . 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 5542 . . . . . . . . . . 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 6132 . . . . . . . . . 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 2315 . . . . . . . 8  |-  ( ( C  e.  B  /\  x  e.  A )  ->  ( ( 1st  |`  ( _V  X.  { C }
) ) `  <. x ,  C >. )  =  x )
70 f1ocnvfv 5794 . . . . . . . 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 5529 . . . . . 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 5861 . . . . 5  |-  ( x F C )  =  ( F `  <. x ,  C >. )
7573, 74syl6eqr 2333 . . . 4  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( F `  ( `' ( 1st  |`  ( _V  X.  { C } ) ) `  x ) )  =  ( x F C ) )
7654, 75eqtrd 2315 . . 3  |-  ( ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  /\  x  e.  A
)  ->  ( G `  x )  =  ( x F C ) )
7776mpteq2dva 4106 . 2  |-  ( ( F  Fn  ( A  X.  B )  /\  C  e.  B )  ->  ( x  e.  A  |->  ( G `  x
) )  =  ( x  e.  A  |->  ( x F C ) ) )
7845, 77eqtrd 2315 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 1623    e. wcel 1684   _Vcvv 2788    i^i cin 3151    C_ wss 3152   {csn 3640   <.cop 3643    e. cmpt 4077    X. cxp 4687   `'ccnv 4688   dom cdm 4689   ran crn 4690    |` cres 4691   "cima 4692    o. ccom 4693   Fun wfun 5249    Fn wfn 5250   -onto->wfo 5253   -1-1-onto->wf1o 5254   ` cfv 5255  (class class class)co 5858   1stc1st 6120
This theorem is referenced by:  curry2f  6214  curry2val  6215
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-sep 4141  ax-nul 4149  ax-pow 4188  ax-pr 4214  ax-un 4512
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3an 936  df-tru 1310  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-ral 2548  df-rex 2549  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-nul 3456  df-if 3566  df-sn 3646  df-pr 3647  df-op 3649  df-uni 3828  df-iun 3907  df-br 4024  df-opab 4078  df-mpt 4079  df-id 4309  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-ov 5861  df-1st 6122  df-2nd 6123
  Copyright terms: Public domain W3C validator