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

Theorem ballotlemsv 24772
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 24771 . . . 4  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( i  e.  ( 1 ... ( M  +  N )
)  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) ) )
11 breq1 4218 . . . . . 6  |-  ( i  =  j  ->  (
i  <_  ( I `  C )  <->  j  <_  ( I `  C ) ) )
12 oveq2 6092 . . . . . 6  |-  ( i  =  j  ->  (
( ( I `  C )  +  1 )  -  i )  =  ( ( ( I `  C )  +  1 )  -  j ) )
13 id 21 . . . . . 6  |-  ( i  =  j  ->  i  =  j )
1411, 12, 13ifbieq12d 3763 . . . . 5  |-  ( i  =  j  ->  if ( i  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i )  =  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) )
1514cbvmptv 4303 . . . 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 ) )
1610, 15syl6eq 2486 . . 3  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( j  e.  ( 1 ... ( M  +  N )
)  |->  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) ) )
1716adantr 453 . 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 ) ) )
18 simpr 449 . . . . 5  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  j  =  J )
1918breq1d 4225 . . . 4  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  ( j  <_  (
I `  C )  <->  J  <_  ( I `  C ) ) )
2018oveq2d 6100 . . . 4  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  ( ( ( I `
 C )  +  1 )  -  j
)  =  ( ( ( I `  C
)  +  1 )  -  J ) )
2119, 20, 18ifbieq12d 3763 . . 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
) )
2221adantlr 697 . 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 ) )
23 simpr 449 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  J  e.  ( 1 ... ( M  +  N ) ) )
24 ovex 6109 . . . 4  |-  ( ( ( I `  C
)  +  1 )  -  J )  e. 
_V
2524a1i 11 . . 3  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  J  <_ 
( I `  C
) )  ->  (
( ( I `  C )  +  1 )  -  J )  e.  _V )
26 elex 2966 . . . 4  |-  ( J  e.  ( 1 ... ( M  +  N
) )  ->  J  e.  _V )
2726ad2antlr 709 . . 3  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  -.  J  <_  ( I `  C
) )  ->  J  e.  _V )
2825, 27ifclda 3768 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  if ( J  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J )  e. 
_V )
2917, 22, 23, 28fvmptd 5813 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 360    = wceq 1653    e. wcel 1726   A.wral 2707   {crab 2711   _Vcvv 2958    \ cdif 3319    i^i cin 3321   ifcif 3741   ~Pcpw 3801   class class class wbr 4215    e. cmpt 4269   `'ccnv 4880   ` cfv 5457  (class class class)co 6084   supcsup 7448   RRcr 8994   0cc0 8995   1c1 8996    + caddc 8998    < clt 9125    <_ cle 9126    - cmin 9296    / cdiv 9682   NNcn 10005   ZZcz 10287   ...cfz 11048   #chash 11623
This theorem is referenced by:  ballotlemsgt1  24773  ballotlemsdom  24774  ballotlemsel1i  24775  ballotlemsf1o  24776  ballotlemsi  24777  ballotlemsima  24778  ballotlemrv  24782
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1667  ax-8 1688  ax-14 1730  ax-6 1745  ax-7 1750  ax-11 1762  ax-12 1951  ax-ext 2419  ax-rep 4323  ax-sep 4333  ax-nul 4341  ax-pr 4406
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2287  df-mo 2288  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-ral 2712  df-rex 2713  df-reu 2714  df-rab 2716  df-v 2960  df-sbc 3164  df-csb 3254  df-dif 3325  df-un 3327  df-in 3329  df-ss 3336  df-nul 3631  df-if 3742  df-sn 3822  df-pr 3823  df-op 3825  df-uni 4018  df-iun 4097  df-br 4216  df-opab 4270  df-mpt 4271  df-id 4501  df-xp 4887  df-rel 4888  df-cnv 4889  df-co 4890  df-dm 4891  df-rn 4892  df-res 4893  df-ima 4894  df-iota 5421  df-fun 5459  df-fn 5460  df-f 5461  df-f1 5462  df-fo 5463  df-f1o 5464  df-fv 5465  df-ov 6087
  Copyright terms: Public domain W3C validator