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

Theorem ballotlemsval 24547
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 444 . . . . . 6  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  d  =  C )
21fveq2d 5674 . . . . 5  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( I `  d )  =  ( I `  C ) )
32breq2d 4167 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( i  <_ 
( I `  d
)  <->  i  <_  (
I `  C )
) )
42oveq1d 6037 . . . . 5  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( I `
 d )  +  1 )  =  ( ( I `  C
)  +  1 ) )
54oveq1d 6037 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( ( I `  d )  +  1 )  -  i )  =  ( ( ( I `  C )  +  1 )  -  i ) )
6 eqidd 2390 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  i  =  i )
73, 5, 6ifbieq12d 3706 . . 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 4238 . 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 simpl 444 . . . . . . . 8  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  c  =  d )
1110fveq2d 5674 . . . . . . 7  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( I `  c )  =  ( I `  d ) )
1211breq2d 4167 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( i  <_ 
( I `  c
)  <->  i  <_  (
I `  d )
) )
1311oveq1d 6037 . . . . . . 7  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( I `
 c )  +  1 )  =  ( ( I `  d
)  +  1 ) )
1413oveq1d 6037 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( ( I `  c )  +  1 )  -  i )  =  ( ( ( I `  d )  +  1 )  -  i ) )
15 eqidd 2390 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  i  =  i )
1612, 14, 15ifbieq12d 3706 . . . . 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 ) )
1716mpteq2dva 4238 . . . 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 ) ) )
1817cbvmptv 4243 . . 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 ) ) )
199, 18eqtri 2409 . 2  |-  S  =  ( d  e.  ( O  \  E ) 
|->  ( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  d
) ,  ( ( ( I `  d
)  +  1 )  -  i ) ,  i ) ) )
20 ovex 6047 . . 3  |-  ( 1 ... ( M  +  N ) )  e. 
_V
2120mptex 5907 . 2  |-  ( i  e.  ( 1 ... ( M  +  N
) )  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) )  e.  _V
228, 19, 21fvmpt 5747 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 359    = wceq 1649    e. wcel 1717   A.wral 2651   {crab 2655    \ cdif 3262    i^i cin 3264   ifcif 3684   ~Pcpw 3744   class class class wbr 4155    e. cmpt 4209   `'ccnv 4819   ` cfv 5396  (class class class)co 6022   supcsup 7382   RRcr 8924   0cc0 8925   1c1 8926    + caddc 8928    < clt 9055    <_ cle 9056    - cmin 9225    / cdiv 9611   NNcn 9934   ZZcz 10216   ...cfz 10977   #chash 11547
This theorem is referenced by:  ballotlemsv  24548  ballotlemsf1o  24552  ballotlemieq  24555
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1552  ax-5 1563  ax-17 1623  ax-9 1661  ax-8 1682  ax-14 1721  ax-6 1736  ax-7 1741  ax-11 1753  ax-12 1939  ax-ext 2370  ax-rep 4263  ax-sep 4273  ax-nul 4281  ax-pr 4346
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2244  df-mo 2245  df-clab 2376  df-cleq 2382  df-clel 2385  df-nfc 2514  df-ne 2554  df-ral 2656  df-rex 2657  df-reu 2658  df-rab 2660  df-v 2903  df-sbc 3107  df-csb 3197  df-dif 3268  df-un 3270  df-in 3272  df-ss 3279  df-nul 3574  df-if 3685  df-sn 3765  df-pr 3766  df-op 3768  df-uni 3960  df-iun 4039  df-br 4156  df-opab 4210  df-mpt 4211  df-id 4441  df-xp 4826  df-rel 4827  df-cnv 4828  df-co 4829  df-dm 4830  df-rn 4831  df-res 4832  df-ima 4833  df-iota 5360  df-fun 5398  df-fn 5399  df-f 5400  df-f1 5401  df-fo 5402  df-f1o 5403  df-fv 5404  df-ov 6025
  Copyright terms: Public domain W3C validator