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

Theorem ballotlemsval 24758
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 5724 . . . . 5  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( I `  d )  =  ( I `  C ) )
32breq2d 4216 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( i  <_ 
( I `  d
)  <->  i  <_  (
I `  C )
) )
42oveq1d 6088 . . . . 5  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( I `
 d )  +  1 )  =  ( ( I `  C
)  +  1 ) )
54oveq1d 6088 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( ( I `  d )  +  1 )  -  i )  =  ( ( ( I `  C )  +  1 )  -  i ) )
6 eqidd 2436 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  i  =  i )
73, 5, 6ifbieq12d 3753 . . 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 4287 . 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 5724 . . . . . . 7  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( I `  c )  =  ( I `  d ) )
1211breq2d 4216 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( i  <_ 
( I `  c
)  <->  i  <_  (
I `  d )
) )
1311oveq1d 6088 . . . . . . 7  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( I `
 c )  +  1 )  =  ( ( I `  d
)  +  1 ) )
1413oveq1d 6088 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( ( I `  c )  +  1 )  -  i )  =  ( ( ( I `  d )  +  1 )  -  i ) )
15 eqidd 2436 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  i  =  i )
1612, 14, 15ifbieq12d 3753 . . . . 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 4287 . . . 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 4292 . . 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 2455 . 2  |-  S  =  ( d  e.  ( O  \  E ) 
|->  ( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  d
) ,  ( ( ( I `  d
)  +  1 )  -  i ) ,  i ) ) )
20 ovex 6098 . . 3  |-  ( 1 ... ( M  +  N ) )  e. 
_V
2120mptex 5958 . 2  |-  ( i  e.  ( 1 ... ( M  +  N
) )  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) )  e.  _V
228, 19, 21fvmpt 5798 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 1652    e. wcel 1725   A.wral 2697   {crab 2701    \ cdif 3309    i^i cin 3311   ifcif 3731   ~Pcpw 3791   class class class wbr 4204    e. cmpt 4258   `'ccnv 4869   ` cfv 5446  (class class class)co 6073   supcsup 7437   RRcr 8981   0cc0 8982   1c1 8983    + caddc 8985    < clt 9112    <_ cle 9113    - cmin 9283    / cdiv 9669   NNcn 9992   ZZcz 10274   ...cfz 11035   #chash 11610
This theorem is referenced by:  ballotlemsv  24759  ballotlemsf1o  24763  ballotlemieq  24766
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-14 1729  ax-6 1744  ax-7 1749  ax-11 1761  ax-12 1950  ax-ext 2416  ax-rep 4312  ax-sep 4322  ax-nul 4330  ax-pr 4395
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 2284  df-mo 2285  df-clab 2422  df-cleq 2428  df-clel 2431  df-nfc 2560  df-ne 2600  df-ral 2702  df-rex 2703  df-reu 2704  df-rab 2706  df-v 2950  df-sbc 3154  df-csb 3244  df-dif 3315  df-un 3317  df-in 3319  df-ss 3326  df-nul 3621  df-if 3732  df-sn 3812  df-pr 3813  df-op 3815  df-uni 4008  df-iun 4087  df-br 4205  df-opab 4259  df-mpt 4260  df-id 4490  df-xp 4876  df-rel 4877  df-cnv 4878  df-co 4879  df-dm 4880  df-rn 4881  df-res 4882  df-ima 4883  df-iota 5410  df-fun 5448  df-fn 5449  df-f 5450  df-f1 5451  df-fo 5452  df-f1o 5453  df-fv 5454  df-ov 6076
  Copyright terms: Public domain W3C validator