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

Theorem ballotlemsval 30570
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 ) 
|-> inf ( { 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 473 . . . . . 6  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  d  =  C )
21fveq2d 6195 . . . . 5  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( I `  d )  =  ( I `  C ) )
32breq2d 4665 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( i  <_ 
( I `  d
)  <->  i  <_  (
I `  C )
) )
42oveq1d 6665 . . . . 5  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( I `
 d )  +  1 )  =  ( ( I `  C
)  +  1 ) )
54oveq1d 6665 . . . 4  |-  ( ( d  =  C  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( ( I `  d )  +  1 )  -  i )  =  ( ( ( I `  C )  +  1 )  -  i ) )
63, 5ifbieq1d 4109 . . 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 ) )
76mpteq2dva 4744 . 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 ) ) )
8 ballotth.s . . 3  |-  S  =  ( c  e.  ( O  \  E ) 
|->  ( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  c
) ,  ( ( ( I `  c
)  +  1 )  -  i ) ,  i ) ) )
9 simpl 473 . . . . . . . 8  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  c  =  d )
109fveq2d 6195 . . . . . . 7  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( I `  c )  =  ( I `  d ) )
1110breq2d 4665 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( i  <_ 
( I `  c
)  <->  i  <_  (
I `  d )
) )
1210oveq1d 6665 . . . . . . 7  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( I `
 c )  +  1 )  =  ( ( I `  d
)  +  1 ) )
1312oveq1d 6665 . . . . . 6  |-  ( ( c  =  d  /\  i  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( ( I `  c )  +  1 )  -  i )  =  ( ( ( I `  d )  +  1 )  -  i ) )
1411, 13ifbieq1d 4109 . . . . 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 ) )
1514mpteq2dva 4744 . . . 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 ) ) )
1615cbvmptv 4750 . . 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 ) ) )
178, 16eqtri 2644 . 2  |-  S  =  ( d  e.  ( O  \  E ) 
|->  ( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  d
) ,  ( ( ( I `  d
)  +  1 )  -  i ) ,  i ) ) )
18 ovex 6678 . . 3  |-  ( 1 ... ( M  +  N ) )  e. 
_V
1918mptex 6486 . 2  |-  ( i  e.  ( 1 ... ( M  +  N
) )  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) )  e.  _V
207, 17, 19fvmpt 6282 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 setvar class
Syntax hints:    -> wi 4    /\ wa 384    = wceq 1483    e. wcel 1990   A.wral 2912   {crab 2916    \ cdif 3571    i^i cin 3573   ifcif 4086   ~Pcpw 4158   class class class wbr 4653    |-> cmpt 4729   ` cfv 5888  (class class class)co 6650  infcinf 8347   RRcr 9935   0cc0 9936   1c1 9937    + caddc 9939    < clt 10074    <_ cle 10075    - cmin 10266    / cdiv 10684   NNcn 11020   ZZcz 11377   ...cfz 12326   #chash 13117
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1722  ax-4 1737  ax-5 1839  ax-6 1888  ax-7 1935  ax-9 1999  ax-10 2019  ax-11 2034  ax-12 2047  ax-13 2246  ax-ext 2602  ax-rep 4771  ax-sep 4781  ax-nul 4789  ax-pr 4906
This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-3an 1039  df-tru 1486  df-ex 1705  df-nf 1710  df-sb 1881  df-eu 2474  df-mo 2475  df-clab 2609  df-cleq 2615  df-clel 2618  df-nfc 2753  df-ne 2795  df-ral 2917  df-rex 2918  df-reu 2919  df-rab 2921  df-v 3202  df-sbc 3436  df-csb 3534  df-dif 3577  df-un 3579  df-in 3581  df-ss 3588  df-nul 3916  df-if 4087  df-sn 4178  df-pr 4180  df-op 4184  df-uni 4437  df-iun 4522  df-br 4654  df-opab 4713  df-mpt 4730  df-id 5024  df-xp 5120  df-rel 5121  df-cnv 5122  df-co 5123  df-dm 5124  df-rn 5125  df-res 5126  df-ima 5127  df-iota 5851  df-fun 5890  df-fn 5891  df-f 5892  df-f1 5893  df-fo 5894  df-f1o 5895  df-fv 5896  df-ov 6653
This theorem is referenced by:  ballotlemsv  30571  ballotlemsf1o  30575  ballotlemieq  30578
  Copyright terms: Public domain W3C validator