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

Theorem ballotlemsv 24215
Description: Value of  S evaluated at  J for a given counting  C. (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
ballotlemsv  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( S `
 C ) `  J )  =  if ( J  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J
) )
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)    J( x, i, k, c)    M( x)    N( x)    O( x)

Proof of Theorem ballotlemsv
Dummy variable  j is distinct from all other variables.
StepHypRef Expression
1 ballotth.m . . . . 5  |-  M  e.  NN
2 ballotth.n . . . . 5  |-  N  e.  NN
3 ballotth.o . . . . 5  |-  O  =  { c  e.  ~P ( 1 ... ( M  +  N )
)  |  ( # `  c )  =  M }
4 ballotth.p . . . . 5  |-  P  =  ( x  e.  ~P O  |->  ( ( # `  x )  /  ( # `
 O ) ) )
5 ballotth.f . . . . 5  |-  F  =  ( c  e.  O  |->  ( i  e.  ZZ  |->  ( ( # `  (
( 1 ... i
)  i^i  c )
)  -  ( # `  ( ( 1 ... i )  \  c
) ) ) ) )
6 ballotth.e . . . . 5  |-  E  =  { c  e.  O  |  A. i  e.  ( 1 ... ( M  +  N ) ) 0  <  ( ( F `  c ) `
 i ) }
7 ballotth.mgtn . . . . 5  |-  N  < 
M
8 ballotth.i . . . . 5  |-  I  =  ( c  e.  ( O  \  E ) 
|->  sup ( { k  e.  ( 1 ... ( M  +  N
) )  |  ( ( F `  c
) `  k )  =  0 } ,  RR ,  `'  <  ) )
9 ballotth.s . . . . 5  |-  S  =  ( c  e.  ( O  \  E ) 
|->  ( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  c
) ,  ( ( ( I `  c
)  +  1 )  -  i ) ,  i ) ) )
101, 2, 3, 4, 5, 6, 7, 8, 9ballotlemsval 24214 . . . 4  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( i  e.  ( 1 ... ( M  +  N )
)  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) ) )
11 nfcv 2502 . . . . 5  |-  F/_ j if ( i  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i )
12 nfcv 2502 . . . . 5  |-  F/_ i if ( j  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j )
13 breq1 4128 . . . . . 6  |-  ( i  =  j  ->  (
i  <_  ( I `  C )  <->  j  <_  ( I `  C ) ) )
14 oveq2 5989 . . . . . 6  |-  ( i  =  j  ->  (
( ( I `  C )  +  1 )  -  i )  =  ( ( ( I `  C )  +  1 )  -  j ) )
15 id 19 . . . . . 6  |-  ( i  =  j  ->  i  =  j )
1613, 14, 15ifbieq12d 3676 . . . . 5  |-  ( i  =  j  ->  if ( i  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i )  =  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) )
1711, 12, 16cbvmpt 4212 . . . 4  |-  ( i  e.  ( 1 ... ( M  +  N
) )  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) )  =  ( j  e.  ( 1 ... ( M  +  N )
)  |->  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) )
1810, 17syl6eq 2414 . . 3  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( j  e.  ( 1 ... ( M  +  N )
)  |->  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) ) )
1918adantr 451 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  ( S `  C )  =  ( j  e.  ( 1 ... ( M  +  N ) )  |->  if ( j  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) ) )
20 simpr 447 . . . . 5  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  j  =  J )
2120breq1d 4135 . . . 4  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  ( j  <_  (
I `  C )  <->  J  <_  ( I `  C ) ) )
2220oveq2d 5997 . . . 4  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  ( ( ( I `
 C )  +  1 )  -  j
)  =  ( ( ( I `  C
)  +  1 )  -  J ) )
2321, 22, 20ifbieq12d 3676 . . 3  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  if ( j  <_ 
( I `  C
) ,  ( ( ( I `  C
)  +  1 )  -  j ) ,  j )  =  if ( J  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J
) )
2423adantlr 695 . 2  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  j  =  J )  ->  if ( j  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j )  =  if ( J  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J ) )
25 simpr 447 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  J  e.  ( 1 ... ( M  +  N ) ) )
26 ovex 6006 . . . 4  |-  ( ( ( I `  C
)  +  1 )  -  J )  e. 
_V
2726a1i 10 . . 3  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  J  <_ 
( I `  C
) )  ->  (
( ( I `  C )  +  1 )  -  J )  e.  _V )
28 simplr 731 . . . 4  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  -.  J  <_  ( I `  C
) )  ->  J  e.  ( 1 ... ( M  +  N )
) )
29 elex 2881 . . . 4  |-  ( J  e.  ( 1 ... ( M  +  N
) )  ->  J  e.  _V )
3028, 29syl 15 . . 3  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  -.  J  <_  ( I `  C
) )  ->  J  e.  _V )
3127, 30ifclda 3681 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  if ( J  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J )  e. 
_V )
3219, 24, 25, 31fvmptd 5713 1  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( S `
 C ) `  J )  =  if ( J  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J
) )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 358    = wceq 1647    e. wcel 1715   A.wral 2628   {crab 2632   _Vcvv 2873    \ cdif 3235    i^i cin 3237   ifcif 3654   ~Pcpw 3714   class class class wbr 4125    e. cmpt 4179   `'ccnv 4791   ` cfv 5358  (class class class)co 5981   supcsup 7340   RRcr 8883   0cc0 8884   1c1 8885    + caddc 8887    < clt 9014    <_ cle 9015    - cmin 9184    / cdiv 9570   NNcn 9893   ZZcz 10175   ...cfz 10935   #chash 11505
This theorem is referenced by:  ballotlemsgt1  24216  ballotlemsdom  24217  ballotlemsel1i  24218  ballotlemsf1o  24219  ballotlemsi  24220  ballotlemsima  24221  ballotlemrv  24225
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1551  ax-5 1562  ax-17 1621  ax-9 1659  ax-8 1680  ax-14 1719  ax-6 1734  ax-7 1739  ax-11 1751  ax-12 1937  ax-ext 2347  ax-rep 4233  ax-sep 4243  ax-nul 4251  ax-pr 4316
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3an 937  df-tru 1324  df-ex 1547  df-nf 1550  df-sb 1654  df-eu 2221  df-mo 2222  df-clab 2353  df-cleq 2359  df-clel 2362  df-nfc 2491  df-ne 2531  df-ral 2633  df-rex 2634  df-reu 2635  df-rab 2637  df-v 2875  df-sbc 3078  df-csb 3168  df-dif 3241  df-un 3243  df-in 3245  df-ss 3252  df-nul 3544  df-if 3655  df-sn 3735  df-pr 3736  df-op 3738  df-uni 3930  df-iun 4009  df-br 4126  df-opab 4180  df-mpt 4181  df-id 4412  df-xp 4798  df-rel 4799  df-cnv 4800  df-co 4801  df-dm 4802  df-rn 4803  df-res 4804  df-ima 4805  df-iota 5322  df-fun 5360  df-fn 5361  df-f 5362  df-f1 5363  df-fo 5364  df-f1o 5365  df-fv 5366  df-ov 5984
  Copyright terms: Public domain W3C validator