Users' Mathboxes Mathbox for Thierry Arnoux < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  ballotlemsval Unicode version

Theorem ballotlemsval 23083
Description: Value of  S (Contributed by Thierry Arnoux, 12-Apr-2017.)
Hypotheses
Ref Expression
ballotth.m  |-  M  e.  NN
ballotth.n  |-  N  e.  NN
ballotth.o  |-  O  =  { c  e.  ~P ( 1 ... ( M  +  N )
)  |  ( # `  c )  =  M }
ballotth.p  |-  P  =  ( x  e.  ~P O  |->  ( ( # `  x )  /  ( # `
 O ) ) )
ballotth.f  |-  F  =  ( c  e.  O  |->  ( i  e.  ZZ  |->  ( ( # `  (
( 1 ... i
)  i^i  c )
)  -  ( # `  ( ( 1 ... i )  \  c
) ) ) ) )
ballotth.e  |-  E  =  { c  e.  O  |  A. i  e.  ( 1 ... ( M  +  N ) ) 0  <  ( ( F `  c ) `
 i ) }
ballotth.mgtn  |-  N  < 
M
ballotth.i  |-  I  =  ( c  e.  ( O  \  E ) 
|->  sup ( { k  e.  ( 1 ... ( M  +  N
) )  |  ( ( F `  c
) `  k )  =  0 } ,  RR ,  `'  <  ) )
ballotth.s  |-  S  =  ( c  e.  ( O  \  E ) 
|->  ( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  c
) ,  ( ( ( I `  c
)  +  1 )  -  i ) ,  i ) ) )
Assertion
Ref Expression
ballotlemsval  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( i  e.  ( 1 ... ( M  +  N )
)  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) ) )
Distinct variable groups:    M, c    N, c    O, c    i, M   
i, N    i, O    k, M    k, N    k, O    i, c, F, k    C, i, k    i, E, k    C, k    k, I, c    E, c    i, I, c
Allowed substitution hints:    C( x, c)    P( x, i, k, c)    S( x, i, k, c)    E( x)    F( x)    I( x)    M( x)    N( x)    O( x)

Proof of Theorem ballotlemsval
Dummy variable  d is distinct from all other variables.
StepHypRef Expression
1 simpl 443 . . . . . 6  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  d  =  C )
21fveq2d 5545 . . . . 5  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( I `  d )  =  ( I `  C ) )
32breq2d 4051 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( i  <_ 
( I `  d
)  <->  i  <_  (
I `  C )
) )
42oveq1d 5889 . . . . 5  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( I `
 d )  +  1 )  =  ( ( I `  C
)  +  1 ) )
54oveq1d 5889 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( ( I `  d )  +  1 )  -  i )  =  ( ( ( I `  C )  +  1 )  -  i ) )
6 eqidd 2297 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  i  =  i )
73, 5, 6ifbieq12d 3600 . . 3  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  if ( i  <_  ( I `  d ) ,  ( ( ( I `  d )  +  1 )  -  i ) ,  i )  =  if ( i  <_ 
( I `  C
) ,  ( ( ( I `  C
)  +  1 )  -  i ) ,  i ) )
87mpteq2dva 4122 . 2  |-  ( d  =  C  ->  (
i  e.  ( 1 ... ( M  +  N ) )  |->  if ( i  <_  (
I `  d ) ,  ( ( ( I `  d )  +  1 )  -  i ) ,  i ) )  =  ( i  e.  ( 1 ... ( M  +  N ) )  |->  if ( i  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) ) )
9 ballotth.s . . 3  |-  S  =  ( c  e.  ( O  \  E ) 
|->  ( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  c
) ,  ( ( ( I `  c
)  +  1 )  -  i ) ,  i ) ) )
10 nfcv 2432 . . . 4  |-  F/_ d
( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  c
) ,  ( ( ( I `  c
)  +  1 )  -  i ) ,  i ) )
11 nfcv 2432 . . . 4  |-  F/_ c
( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  d
) ,  ( ( ( I `  d
)  +  1 )  -  i ) ,  i ) )
12 simpl 443 . . . . . . . 8  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  c  =  d )
1312fveq2d 5545 . . . . . . 7  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( I `  c )  =  ( I `  d ) )
1413breq2d 4051 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( i  <_ 
( I `  c
)  <->  i  <_  (
I `  d )
) )
1513oveq1d 5889 . . . . . . 7  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( I `
 c )  +  1 )  =  ( ( I `  d
)  +  1 ) )
1615oveq1d 5889 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( ( I `  c )  +  1 )  -  i )  =  ( ( ( I `  d )  +  1 )  -  i ) )
17 eqidd 2297 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  i  =  i )
1814, 16, 17ifbieq12d 3600 . . . . 5  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  if ( i  <_  ( I `  c ) ,  ( ( ( I `  c )  +  1 )  -  i ) ,  i )  =  if ( i  <_ 
( I `  d
) ,  ( ( ( I `  d
)  +  1 )  -  i ) ,  i ) )
1918mpteq2dva 4122 . . . 4  |-  ( c  =  d  ->  (
i  e.  ( 1 ... ( M  +  N ) )  |->  if ( i  <_  (
I `  c ) ,  ( ( ( I `  c )  +  1 )  -  i ) ,  i ) )  =  ( i  e.  ( 1 ... ( M  +  N ) )  |->  if ( i  <_  (
I `  d ) ,  ( ( ( I `  d )  +  1 )  -  i ) ,  i ) ) )
2010, 11, 19cbvmpt 4126 . . 3  |-  ( c  e.  ( O  \  E )  |->  ( i  e.  ( 1 ... ( M  +  N
) )  |->  if ( i  <_  ( I `  c ) ,  ( ( ( I `  c )  +  1 )  -  i ) ,  i ) ) )  =  ( d  e.  ( O  \  E )  |->  ( i  e.  ( 1 ... ( M  +  N
) )  |->  if ( i  <_  ( I `  d ) ,  ( ( ( I `  d )  +  1 )  -  i ) ,  i ) ) )
219, 20eqtri 2316 . 2  |-  S  =  ( d  e.  ( O  \  E ) 
|->  ( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  d
) ,  ( ( ( I `  d
)  +  1 )  -  i ) ,  i ) ) )
22 ovex 5899 . . 3  |-  ( 1 ... ( M  +  N ) )  e. 
_V
2322mptex 5762 . 2  |-  ( i  e.  ( 1 ... ( M  +  N
) )  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) )  e.  _V
248, 21, 23fvmpt 5618 1  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( i  e.  ( 1 ... ( M  +  N )
)  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 358    = wceq 1632    e. wcel 1696   A.wral 2556   {crab 2560    \ cdif 3162    i^i cin 3164   ifcif 3578   ~Pcpw 3638   class class class wbr 4039    e. cmpt 4093   `'ccnv 4704   ` cfv 5271  (class class class)co 5874   supcsup 7209   RRcr 8752   0cc0 8753   1c1 8754    + caddc 8756    < clt 8883    <_ cle 8884    - cmin 9053    / cdiv 9439   NNcn 9762   ZZcz 10040   ...cfz 10798   #chash 11353
This theorem is referenced by:  ballotlemsv  23084  ballotlemsf1o  23088  ballotlemieq  23091
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-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-rep 4147  ax-sep 4157  ax-nul 4165  ax-pr 4230
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-reu 2563  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
  Copyright terms: Public domain W3C validator