let n be Nat; for epsilon being Real
for a being non empty positive at_most_one FinSequence of REAL st n is odd & len a = n & epsilon = 1 / (n + 1) & ( for i being Nat st i in Seg n holds
( ( i is odd implies a . i = 2 * epsilon ) & ( i is even implies a . i = 1 - epsilon ) ) ) holds
n = (2 * (Opt a)) - 1
let epsilon be Real; for a being non empty positive at_most_one FinSequence of REAL st n is odd & len a = n & epsilon = 1 / (n + 1) & ( for i being Nat st i in Seg n holds
( ( i is odd implies a . i = 2 * epsilon ) & ( i is even implies a . i = 1 - epsilon ) ) ) holds
n = (2 * (Opt a)) - 1
let a be non empty positive at_most_one FinSequence of REAL ; ( n is odd & len a = n & epsilon = 1 / (n + 1) & ( for i being Nat st i in Seg n holds
( ( i is odd implies a . i = 2 * epsilon ) & ( i is even implies a . i = 1 - epsilon ) ) ) implies n = (2 * (Opt a)) - 1 )
assume that
L010:
n is odd
and
L030:
len a = n
and
L040:
epsilon = 1 / (n + 1)
and
L050:
for i being Nat st i in Seg n holds
( ( i is odd implies a . i = 2 * epsilon ) & ( i is even implies a . i = 1 - epsilon ) )
; n = (2 * (Opt a)) - 1
L020:
1 <= n
by L010, NF992;
L060:
(n + 1) div 2 = (n + 1) / 2
by L010, NF992;
ex g being non empty FinSequence of NAT st
( dom g = dom a & ( for j being Nat st j in rng g holds
SumBin (a,g,{j}) <= 1 ) & (n + 1) div 2 = card (rng g) & ( for f being non empty FinSequence of NAT st dom f = dom a & ( for j being Nat st j in rng f holds
SumBin (a,f,{j}) <= 1 ) holds
(n + 1) div 2 <= card (rng f) ) )
proof
defpred S1[
Nat,
object ]
means ( ( $1 is
odd implies $2
= 1 ) & ( $1 is
even implies $2
= ($1 div 2) + 1 ) );
L100:
for
i being
Nat st
i in Seg n holds
ex
x being
object st
S1[
i,
x]
consider g0 being
FinSequence such that L200:
dom g0 = Seg n
and L210:
for
i being
Nat st
i in Seg n holds
S1[
i,
g0 . i]
from FINSEQ_1:sch 1(L100);
for
i being
Nat st
i in dom g0 holds
g0 . i in NAT
then reconsider g0 =
g0 as non
empty FinSequence of
NAT by NF315, L010, L200;
take
g0
;
( dom g0 = dom a & ( for j being Nat st j in rng g0 holds
SumBin (a,g0,{j}) <= 1 ) & (n + 1) div 2 = card (rng g0) & ( for f being non empty FinSequence of NAT st dom f = dom a & ( for j being Nat st j in rng f holds
SumBin (a,f,{j}) <= 1 ) holds
(n + 1) div 2 <= card (rng f) ) )
L379:
dom a = Seg n
by FINSEQ_1:def 3, L030;
thus
dom g0 = dom a
by FINSEQ_1:def 3, L030, L200;
( ( for j being Nat st j in rng g0 holds
SumBin (a,g0,{j}) <= 1 ) & (n + 1) div 2 = card (rng g0) & ( for f being non empty FinSequence of NAT st dom f = dom a & ( for j being Nat st j in rng f holds
SumBin (a,f,{j}) <= 1 ) holds
(n + 1) div 2 <= card (rng f) ) )
thus
for
j being
Nat st
j in rng g0 holds
SumBin (
a,
g0,
{j})
<= 1
by L010, L030, L040, L050, L379, L200, L210, NF996;
( (n + 1) div 2 = card (rng g0) & ( for f being non empty FinSequence of NAT st dom f = dom a & ( for j being Nat st j in rng f holds
SumBin (a,f,{j}) <= 1 ) holds
(n + 1) div 2 <= card (rng f) ) )
set npd2 =
(n + 1) div 2;
1
+ 1
<= n + 1
by L010, NF992, XREAL_1:6;
then L388:
2
/ 2
<= (n + 1) / 2
by XREAL_1:72;
reconsider npd2 =
(n + 1) div 2 as
Nat by L010, L060;
for
y being
object holds
(
y in Seg npd2 iff ex
x being
object st
(
x in dom g0 &
y = g0 . x ) )
proof
let y be
object ;
( y in Seg npd2 iff ex x being object st
( x in dom g0 & y = g0 . x ) )
given x0 being
object such that L440:
x0 in dom g0
and L442:
y = g0 . x0
;
y in Seg npd2
reconsider x0 =
x0 as
Nat by L440;
per cases
( x0 is odd or x0 is even )
;
suppose L470:
x0 is
even
;
y in Seg npd2then
g0 . x0 = (x0 div 2) + 1
by L440, L200, L210;
then L472:
y = (x0 / 2) + 1
by L442, L470, NAT_6:4;
reconsider y0 =
y as
Nat by L442;
L4725:
0 + 1
<= (x0 / 2) + 1
by XREAL_1:6;
L474:
x0 <= n
by L440, L200, FINSEQ_1:1;
(
x0 + 1
<= n or not
x0 + 1
<= n + 1 )
by L010, L470, NAT_1:8;
then
(x0 + 1) + 1
<= n + 1
by L474, XREAL_1:6;
then
(x0 + 2) / 2
<= (n + 1) / 2
by XREAL_1:72;
hence
y in Seg npd2
by L4725, L442, L060, L472;
verum end; end;
end;
then
rng g0 = Seg npd2
by FUNCT_1:def 3;
hence
(n + 1) div 2
= card (rng g0)
by FINSEQ_1:57;
for f being non empty FinSequence of NAT st dom f = dom a & ( for j being Nat st j in rng f holds
SumBin (a,f,{j}) <= 1 ) holds
(n + 1) div 2 <= card (rng f)
reconsider i0 =
(n + 1) / 2 as
Integer by L010;
reconsider r =
(1 / (n + 1)) - (1 / 2) as
Real ;
L810:
Sum a =
(((n + 1) / 2) + (1 / (n + 1))) - (1 / 2)
by L010, L030, L040, L050, NF994
.=
r + i0
;
1
+ 1
<= n + 1
by L010, NF992, XREAL_1:6;
then
1
* 2
<= 1
* (n + 1)
;
then
1
/ (n + 1) <= 1
/ 2
by XREAL_1:102;
then L820:
r <= 0
by XREAL_1:47;
0 < (1 / (n + 1)) + (1 / 2)
by XREAL_1:34;
then
0 < r + 1
;
then L835:
[/r\] = 0
by L820, INT_1:def 7;
[/(r + i0)\] =
[/r\] + i0
by INT_1:33
.=
i0
by L835
;
then
[/(Sum a)\] = (n + 1) div 2
by L810, L010, NF992;
hence
for
f being non
empty FinSequence of
NAT st
dom f = dom a & ( for
j being
Nat st
j in rng f holds
SumBin (
a,
f,
{j})
<= 1 ) holds
(n + 1) div 2
<= card (rng f)
by NF320;
verum
end;
then
Opt a = (n + 1) div 2
by defOpt;
hence
n = (2 * (Opt a)) - 1
by L060; verum