:: CATALAN2 semantic presentation
begin
definition
let p, q be XFinSequence of ;
:: original: ^
redefine funcp ^ q -> XFinSequence of ;
coherence
p ^ q is XFinSequence of ;
end;
theorem Th1: :: CATALAN2:1
for D being set
for n being Nat
for pd being XFinSequence of ex qd being XFinSequence of st pd = (pd | n) ^ qd
proof
let D be set ; ::_thesis: for n being Nat
for pd being XFinSequence of ex qd being XFinSequence of st pd = (pd | n) ^ qd
let n be Nat; ::_thesis: for pd being XFinSequence of ex qd being XFinSequence of st pd = (pd | n) ^ qd
let pd be XFinSequence of ; ::_thesis: ex qd being XFinSequence of st pd = (pd | n) ^ qd
consider q9 being XFinSequence such that
A1: pd = (pd | n) ^ q9 by AFINSQ_1:60;
rng q9 c= rng pd by A1, AFINSQ_1:25;
then rng q9 c= D by XBOOLE_1:1;
then q9 is XFinSequence of by RELAT_1:def_19;
hence ex qd being XFinSequence of st pd = (pd | n) ^ qd by A1; ::_thesis: verum
end;
definition
let p be XFinSequence of ;
attrp is dominated_by_0 means :Def1: :: CATALAN2:def 1
( rng p c= {0,1} & ( for k being Nat st k <= dom p holds
2 * (Sum (p | k)) <= k ) );
end;
:: deftheorem Def1 defines dominated_by_0 CATALAN2:def_1_:_
for p being XFinSequence of holds
( p is dominated_by_0 iff ( rng p c= {0,1} & ( for k being Nat st k <= dom p holds
2 * (Sum (p | k)) <= k ) ) );
theorem Th2: :: CATALAN2:2
for k being Nat
for p being XFinSequence of st p is dominated_by_0 holds
2 * (Sum (p | k)) <= k
proof
let k be Nat; ::_thesis: for p being XFinSequence of st p is dominated_by_0 holds
2 * (Sum (p | k)) <= k
let p be XFinSequence of ; ::_thesis: ( p is dominated_by_0 implies 2 * (Sum (p | k)) <= k )
assume A1: p is dominated_by_0 ; ::_thesis: 2 * (Sum (p | k)) <= k
now__::_thesis:_2_*_(Sum_(p_|_k))_<=_k
percases ( k <= dom p or k > dom p ) ;
suppose k <= dom p ; ::_thesis: 2 * (Sum (p | k)) <= k
hence 2 * (Sum (p | k)) <= k by A1, Def1; ::_thesis: verum
end;
supposeA2: k > dom p ; ::_thesis: 2 * (Sum (p | k)) <= k
then dom p c= k by NAT_1:39;
then A3: p | k = p by RELAT_1:68;
( 2 * (Sum (p | (len p))) <= dom p & p | (len p) = p ) by A1, Def1, RELAT_1:68;
hence 2 * (Sum (p | k)) <= k by A2, A3, XXREAL_0:2; ::_thesis: verum
end;
end;
end;
hence 2 * (Sum (p | k)) <= k ; ::_thesis: verum
end;
theorem Th3: :: CATALAN2:3
for p being XFinSequence of st p is dominated_by_0 holds
p . 0 = 0
proof
let p be XFinSequence of ; ::_thesis: ( p is dominated_by_0 implies p . 0 = 0 )
assume A1: p is dominated_by_0 ; ::_thesis: p . 0 = 0
now__::_thesis:_p_._0_=_0
percases ( not 0 in dom p or 0 in dom p ) ;
suppose not 0 in dom p ; ::_thesis: p . 0 = 0
hence p . 0 = 0 by FUNCT_1:def_2; ::_thesis: verum
end;
suppose 0 in dom p ; ::_thesis: p . 0 = 0
then len p >= 1 by NAT_1:14;
then A2: 1 c= len p by NAT_1:39;
0 in 1 by NAT_1:44;
then 0 in (dom p) /\ 1 by A2, XBOOLE_0:def_4;
then A3: (p | 1) . 0 = p . 0 by FUNCT_1:48;
A4: Sum <%(p . 0)%> = addnat "**" <%(p . 0)%> by AFINSQ_2:51
.= p . 0 by AFINSQ_2:37 ;
len (p | 1) = 1 by A2, RELAT_1:62;
then p | 1 = <%(p . 0)%> by A3, AFINSQ_1:34;
then 2 * (p . 0) <= 1 + 0 by A1, A4, Th2;
then ( 2 * (p . 0) = 1 or 2 * (p . 0) = 0 ) by NAT_1:9;
hence p . 0 = 0 by NAT_1:15; ::_thesis: verum
end;
end;
end;
hence p . 0 = 0 ; ::_thesis: verum
end;
registration
let x be set ;
let k be Nat;
clusterx --> k -> NAT -valued ;
coherence
x --> k is NAT -valued
proof
k in NAT by ORDINAL1:def_12;
then ( rng (x --> k) c= {k} & {k} c= NAT ) by ZFMISC_1:31;
then rng (x --> k) c= NAT by XBOOLE_1:1;
hence x --> k is NAT -valued by RELAT_1:def_19; ::_thesis: verum
end;
end;
Lm1: for n, m, k being Nat st n <= m holds
(m --> k) | n = n --> k
proof
let n, m, k be Nat; ::_thesis: ( n <= m implies (m --> k) | n = n --> k )
assume n <= m ; ::_thesis: (m --> k) | n = n --> k
then n c= m by NAT_1:39;
then n /\ m = n by XBOOLE_1:28;
hence (m --> k) | n = n --> k by FUNCOP_1:12; ::_thesis: verum
end;
Lm2: for k being Nat holds k --> 0 is dominated_by_0
proof
let k be Nat; ::_thesis: k --> 0 is dominated_by_0
A1: dom (k --> 0) = k by FUNCOP_1:13;
( rng (k --> 0) c= {0} & {0} c= {0,1} ) by FUNCOP_1:13, ZFMISC_1:7;
hence rng (k --> 0) c= {0,1} by XBOOLE_1:1; :: according to CATALAN2:def_1 ::_thesis: for k being Nat st k <= dom (k --> 0) holds
2 * (Sum ((k --> 0) | k)) <= k
let n be Nat; ::_thesis: ( n <= dom (k --> 0) implies 2 * (Sum ((k --> 0) | n)) <= n )
assume n <= dom (k --> 0) ; ::_thesis: 2 * (Sum ((k --> 0) | n)) <= n
then A2: (k --> 0) | n = n --> 0 by A1, Lm1;
Sum (n --> 0) = 0 * n by AFINSQ_2:58;
hence 2 * (Sum ((k --> 0) | n)) <= n by A2; ::_thesis: verum
end;
registration
cluster empty T-Sequence-like Relation-like NAT -defined NAT -valued Function-like V35() V36() V37() V38() finite nonnegative-yielding V213() dominated_by_0 for set ;
existence
ex b1 being XFinSequence of st
( b1 is empty & b1 is dominated_by_0 )
proof
0 --> 0 is dominated_by_0 by Lm2;
hence ex b1 being XFinSequence of st
( b1 is empty & b1 is dominated_by_0 ) ; ::_thesis: verum
end;
cluster non empty T-Sequence-like Relation-like NAT -defined NAT -valued Function-like V35() V36() V37() V38() finite nonnegative-yielding V213() dominated_by_0 for set ;
existence
ex b1 being XFinSequence of st
( not b1 is empty & b1 is dominated_by_0 )
proof
1 --> 0 is dominated_by_0 by Lm2;
hence ex b1 being XFinSequence of st
( not b1 is empty & b1 is dominated_by_0 ) ; ::_thesis: verum
end;
end;
theorem :: CATALAN2:4
for n being Nat holds n --> 0 is dominated_by_0 by Lm2;
theorem Th5: :: CATALAN2:5
for n, m being Nat st n >= m holds
(n --> 0) ^ (m --> 1) is dominated_by_0
proof
let n, m be Nat; ::_thesis: ( n >= m implies (n --> 0) ^ (m --> 1) is dominated_by_0 )
assume A1: n >= m ; ::_thesis: (n --> 0) ^ (m --> 1) is dominated_by_0
set p = (n --> 0) ^ (m --> 1);
( rng (m --> 1) c= {1} & {1} c= {0,1} ) by FUNCOP_1:13, ZFMISC_1:7;
then A2: rng (m --> 1) c= {0,1} by XBOOLE_1:1;
( rng (n --> 0) c= {0} & {0} c= {0,1} ) by FUNCOP_1:13, ZFMISC_1:7;
then rng (n --> 0) c= {0,1} by XBOOLE_1:1;
then (rng (n --> 0)) \/ (rng (m --> 1)) c= {0,1} by A2, XBOOLE_1:8;
hence rng ((n --> 0) ^ (m --> 1)) c= {0,1} by AFINSQ_1:26; :: according to CATALAN2:def_1 ::_thesis: for k being Nat st k <= dom ((n --> 0) ^ (m --> 1)) holds
2 * (Sum (((n --> 0) ^ (m --> 1)) | k)) <= k
let k be Nat; ::_thesis: ( k <= dom ((n --> 0) ^ (m --> 1)) implies 2 * (Sum (((n --> 0) ^ (m --> 1)) | k)) <= k )
assume A3: k <= dom ((n --> 0) ^ (m --> 1)) ; ::_thesis: 2 * (Sum (((n --> 0) ^ (m --> 1)) | k)) <= k
now__::_thesis:_2_*_(Sum_(((n_-->_0)_^_(m_-->_1))_|_k))_<=_k
percases ( k <= dom (n --> 0) or k > dom (n --> 0) ) ;
supposeA4: k <= dom (n --> 0) ; ::_thesis: 2 * (Sum (((n --> 0) ^ (m --> 1)) | k)) <= k
dom (n --> 0) = n by FUNCOP_1:13;
then A5: (n --> 0) | k = k --> 0 by A4, Lm1;
A6: Sum (k --> 0) = 0 * k by AFINSQ_2:58;
((n --> 0) ^ (m --> 1)) | k = (n --> 0) | k by A4, AFINSQ_1:58;
hence 2 * (Sum (((n --> 0) ^ (m --> 1)) | k)) <= k by A5, A6; ::_thesis: verum
end;
suppose k > dom (n --> 0) ; ::_thesis: 2 * (Sum (((n --> 0) ^ (m --> 1)) | k)) <= k
then reconsider kd = k - (dom (n --> 0)) as Element of NAT by NAT_1:21;
A7: dom (n --> 0) = n by FUNCOP_1:13;
dom ((n --> 0) ^ (m --> 1)) = len ((n --> 0) ^ (m --> 1)) ;
then k <= (len (n --> 0)) + (len (m --> 1)) by A3, AFINSQ_1:17;
then k - (len (n --> 0)) <= ((len (m --> 1)) + (len (n --> 0))) - (len (n --> 0)) by XREAL_1:9;
then kd <= m by FUNCOP_1:13;
then A8: (m --> 1) | kd = kd --> 1 by Lm1;
reconsider m1 = m --> 1 as XFinSequence of ;
k = kd + (dom (n --> 0)) ;
then ((n --> 0) ^ (m --> 1)) | k = (n --> 0) ^ (m1 | kd) by AFINSQ_1:59;
then A9: Sum (((n --> 0) ^ (m --> 1)) | k) = (Sum (n --> 0)) + (Sum (kd --> 1)) by A8, AFINSQ_2:55;
( dom ((n --> 0) ^ (m --> 1)) = (len (n --> 0)) + (len (m --> 1)) & dom (m --> 1) = m ) by AFINSQ_1:def_3, FUNCOP_1:13;
then k - n <= (m + n) - n by A3, A7, XREAL_1:9;
then k - n <= n by A1, XXREAL_0:2;
then A10: (k - n) + (k - n) <= n + (k - n) by XREAL_1:6;
( Sum (n --> 0) = n * 0 & Sum (kd --> 1) = kd * 1 ) by AFINSQ_2:58;
hence 2 * (Sum (((n --> 0) ^ (m --> 1)) | k)) <= k by A9, A7, A10; ::_thesis: verum
end;
end;
end;
hence 2 * (Sum (((n --> 0) ^ (m --> 1)) | k)) <= k ; ::_thesis: verum
end;
theorem Th6: :: CATALAN2:6
for n being Nat
for p being XFinSequence of st p is dominated_by_0 holds
p | n is dominated_by_0
proof
let n be Nat; ::_thesis: for p being XFinSequence of st p is dominated_by_0 holds
p | n is dominated_by_0
let p be XFinSequence of ; ::_thesis: ( p is dominated_by_0 implies p | n is dominated_by_0 )
assume A1: p is dominated_by_0 ; ::_thesis: p | n is dominated_by_0
A2: for k being Nat st k <= dom (p | n) holds
2 * (Sum ((p | n) | k)) <= k
proof
let k be Nat; ::_thesis: ( k <= dom (p | n) implies 2 * (Sum ((p | n) | k)) <= k )
assume k <= dom (p | n) ; ::_thesis: 2 * (Sum ((p | n) | k)) <= k
then A3: k c= dom (p | n) by NAT_1:39;
dom (p | n) = (dom p) /\ n by RELAT_1:61;
then (p | n) | k = p | k by A3, RELAT_1:74, XBOOLE_1:18;
hence 2 * (Sum ((p | n) | k)) <= k by A1, Th2; ::_thesis: verum
end;
( rng (p | n) c= rng p & rng p c= {0,1} ) by A1, Def1, RELAT_1:70;
then rng (p | n) c= {0,1} by XBOOLE_1:1;
hence p | n is dominated_by_0 by A2, Def1; ::_thesis: verum
end;
theorem Th7: :: CATALAN2:7
for p, q being XFinSequence of st p is dominated_by_0 & q is dominated_by_0 holds
p ^ q is dominated_by_0
proof
let p, q be XFinSequence of ; ::_thesis: ( p is dominated_by_0 & q is dominated_by_0 implies p ^ q is dominated_by_0 )
assume that
A1: p is dominated_by_0 and
A2: q is dominated_by_0 ; ::_thesis: p ^ q is dominated_by_0
( rng p c= {0,1} & rng q c= {0,1} ) by A1, A2, Def1;
then (rng p) \/ (rng q) c= {0,1} by XBOOLE_1:8;
hence rng (p ^ q) c= {0,1} by AFINSQ_1:26; :: according to CATALAN2:def_1 ::_thesis: for k being Nat st k <= dom (p ^ q) holds
2 * (Sum ((p ^ q) | k)) <= k
let k be Nat; ::_thesis: ( k <= dom (p ^ q) implies 2 * (Sum ((p ^ q) | k)) <= k )
assume k <= dom (p ^ q) ; ::_thesis: 2 * (Sum ((p ^ q) | k)) <= k
now__::_thesis:_2_*_(Sum_((p_^_q)_|_k))_<=_k
percases ( k <= dom p or k > dom p ) ;
supposeA3: k <= dom p ; ::_thesis: 2 * (Sum ((p ^ q) | k)) <= k
then (p ^ q) | k = p | k by AFINSQ_1:58;
hence 2 * (Sum ((p ^ q) | k)) <= k by A1, A3, Def1; ::_thesis: verum
end;
suppose k > dom p ; ::_thesis: 2 * (Sum ((p ^ q) | k)) <= k
then reconsider kd = k - (dom p) as Element of NAT by NAT_1:21;
A4: p | (dom p) = p ;
k = kd + (dom p) ;
then (p ^ q) | k = p ^ (q | kd) by AFINSQ_1:59;
then A5: Sum ((p ^ q) | k) = (Sum p) + (Sum (q | kd)) by AFINSQ_2:55;
( 2 * (Sum (p | (len p))) <= len p & 2 * (Sum (q | kd)) <= kd ) by A1, A2, Th2;
then (2 * (Sum p)) + (2 * (Sum (q | kd))) <= (dom p) + kd by A4, XREAL_1:7;
hence 2 * (Sum ((p ^ q) | k)) <= k by A5; ::_thesis: verum
end;
end;
end;
hence 2 * (Sum ((p ^ q) | k)) <= k ; ::_thesis: verum
end;
theorem Th8: :: CATALAN2:8
for n being Nat
for p being XFinSequence of st p is dominated_by_0 holds
2 * (Sum (p | ((2 * n) + 1))) < (2 * n) + 1
proof
let n be Nat; ::_thesis: for p being XFinSequence of st p is dominated_by_0 holds
2 * (Sum (p | ((2 * n) + 1))) < (2 * n) + 1
let p be XFinSequence of ; ::_thesis: ( p is dominated_by_0 implies 2 * (Sum (p | ((2 * n) + 1))) < (2 * n) + 1 )
assume p is dominated_by_0 ; ::_thesis: 2 * (Sum (p | ((2 * n) + 1))) < (2 * n) + 1
then A1: 2 * (Sum (p | ((2 * n) + 1))) <= (2 * n) + 1 by Th2;
assume 2 * (Sum (p | ((2 * n) + 1))) >= (2 * n) + 1 ; ::_thesis: contradiction
then 2 * (Sum (p | ((2 * n) + 1))) = (2 * n) + 1 by A1, XXREAL_0:1;
then 2 * ((Sum (p | ((2 * n) + 1))) - n) = 1 ;
hence contradiction by INT_1:9; ::_thesis: verum
end;
theorem Th9: :: CATALAN2:9
for n being Nat
for p being XFinSequence of st p is dominated_by_0 & n <= (len p) - (2 * (Sum p)) holds
p ^ (n --> 1) is dominated_by_0
proof
let n be Nat; ::_thesis: for p being XFinSequence of st p is dominated_by_0 & n <= (len p) - (2 * (Sum p)) holds
p ^ (n --> 1) is dominated_by_0
let p be XFinSequence of ; ::_thesis: ( p is dominated_by_0 & n <= (len p) - (2 * (Sum p)) implies p ^ (n --> 1) is dominated_by_0 )
set q = n --> 1;
assume that
A1: p is dominated_by_0 and
A2: n <= (len p) - (2 * (Sum p)) ; ::_thesis: p ^ (n --> 1) is dominated_by_0
( rng (n --> 1) c= {1} & {1} c= {0,1} ) by FUNCOP_1:13, ZFMISC_1:7;
then A3: rng (n --> 1) c= {0,1} by XBOOLE_1:1;
rng p c= {0,1} by A1, Def1;
then (rng p) \/ (rng (n --> 1)) c= {0,1} by A3, XBOOLE_1:8;
hence rng (p ^ (n --> 1)) c= {0,1} by AFINSQ_1:26; :: according to CATALAN2:def_1 ::_thesis: for k being Nat st k <= dom (p ^ (n --> 1)) holds
2 * (Sum ((p ^ (n --> 1)) | k)) <= k
let m be Nat; ::_thesis: ( m <= dom (p ^ (n --> 1)) implies 2 * (Sum ((p ^ (n --> 1)) | m)) <= m )
assume A4: m <= dom (p ^ (n --> 1)) ; ::_thesis: 2 * (Sum ((p ^ (n --> 1)) | m)) <= m
now__::_thesis:_2_*_(Sum_((p_^_(n_-->_1))_|_m))_<=_m
percases ( m <= dom p or m > dom p ) ;
suppose m <= dom p ; ::_thesis: 2 * (Sum ((p ^ (n --> 1)) | m)) <= m
then (p ^ (n --> 1)) | m = p | m by AFINSQ_1:58;
hence 2 * (Sum ((p ^ (n --> 1)) | m)) <= m by A1, Th2; ::_thesis: verum
end;
suppose m > dom p ; ::_thesis: 2 * (Sum ((p ^ (n --> 1)) | m)) <= m
then reconsider md = m - (dom p) as Element of NAT by NAT_1:21;
A5: m = (dom p) + md ;
Sum (md --> 1) = md * 1 by AFINSQ_2:58;
then A6: Sum (p ^ (md --> 1)) = (Sum p) + md by AFINSQ_2:55;
( dom (n --> 1) = n & len (n --> 1) = dom (n --> 1) ) by FUNCOP_1:13;
then dom (p ^ (n --> 1)) = (len p) + n by AFINSQ_1:def_3;
then md + (dom p) <= n + (dom p) by A4;
then A7: md <= n by XREAL_1:6;
then (n --> 1) | md = md --> 1 by Lm1;
then (p ^ (n --> 1)) | m = p ^ (md --> 1) by A5, AFINSQ_1:59;
then 2 * (Sum ((p ^ (n --> 1)) | m)) = (((2 * (Sum p)) + m) - (dom p)) + md by A6;
then A8: 2 * (Sum ((p ^ (n --> 1)) | m)) <= (((2 * (Sum p)) + m) - (dom p)) + n by A7, XREAL_1:6;
n - n <= ((len p) - (2 * (Sum p))) - n by A2, XREAL_1:9;
then m - (((len p) - (2 * (Sum p))) - n) <= m - 0 by XREAL_1:10;
hence 2 * (Sum ((p ^ (n --> 1)) | m)) <= m by A8, XXREAL_0:2; ::_thesis: verum
end;
end;
end;
hence 2 * (Sum ((p ^ (n --> 1)) | m)) <= m ; ::_thesis: verum
end;
theorem Th10: :: CATALAN2:10
for n, k being Nat
for p being XFinSequence of st p is dominated_by_0 & n <= (k + (len p)) - (2 * (Sum p)) holds
((k --> 0) ^ p) ^ (n --> 1) is dominated_by_0
proof
let n, k be Nat; ::_thesis: for p being XFinSequence of st p is dominated_by_0 & n <= (k + (len p)) - (2 * (Sum p)) holds
((k --> 0) ^ p) ^ (n --> 1) is dominated_by_0
let p be XFinSequence of ; ::_thesis: ( p is dominated_by_0 & n <= (k + (len p)) - (2 * (Sum p)) implies ((k --> 0) ^ p) ^ (n --> 1) is dominated_by_0 )
assume that
A1: p is dominated_by_0 and
A2: n <= (k + (len p)) - (2 * (Sum p)) ; ::_thesis: ((k --> 0) ^ p) ^ (n --> 1) is dominated_by_0
set q = k --> 0;
( dom (k --> 0) = k & len (k --> 0) = dom (k --> 0) ) by FUNCOP_1:13;
then A3: len ((k --> 0) ^ p) = k + (len p) by AFINSQ_1:17;
Sum (k --> 0) = k * 0 by AFINSQ_2:58;
then A4: Sum ((k --> 0) ^ p) = 0 + (Sum p) by AFINSQ_2:55;
k --> 0 is dominated_by_0 by Lm2;
then (k --> 0) ^ p is dominated_by_0 by A1, Th7;
hence ((k --> 0) ^ p) ^ (n --> 1) is dominated_by_0 by A2, A3, A4, Th9; ::_thesis: verum
end;
theorem Th11: :: CATALAN2:11
for k being Nat
for p being XFinSequence of st p is dominated_by_0 & 2 * (Sum (p | k)) = k holds
( k <= len p & len (p | k) = k )
proof
let k be Nat; ::_thesis: for p being XFinSequence of st p is dominated_by_0 & 2 * (Sum (p | k)) = k holds
( k <= len p & len (p | k) = k )
let p be XFinSequence of ; ::_thesis: ( p is dominated_by_0 & 2 * (Sum (p | k)) = k implies ( k <= len p & len (p | k) = k ) )
assume A1: ( p is dominated_by_0 & 2 * (Sum (p | k)) = k ) ; ::_thesis: ( k <= len p & len (p | k) = k )
A2: k <= len p
proof
A3: p | (len p) = p by RELAT_1:68;
assume A4: k > len p ; ::_thesis: contradiction
then len p c= k by NAT_1:39;
then p | k = p by RELAT_1:68;
hence contradiction by A1, A4, A3, Th2; ::_thesis: verum
end;
then k c= len p by NAT_1:39;
then (dom p) /\ k = k by XBOOLE_1:28;
hence ( k <= len p & len (p | k) = k ) by A2, RELAT_1:61; ::_thesis: verum
end;
theorem Th12: :: CATALAN2:12
for k being Nat
for p, q being XFinSequence of st p is dominated_by_0 & 2 * (Sum (p | k)) = k & p = (p | k) ^ q holds
q is dominated_by_0
proof
let k be Nat; ::_thesis: for p, q being XFinSequence of st p is dominated_by_0 & 2 * (Sum (p | k)) = k & p = (p | k) ^ q holds
q is dominated_by_0
let p, q be XFinSequence of ; ::_thesis: ( p is dominated_by_0 & 2 * (Sum (p | k)) = k & p = (p | k) ^ q implies q is dominated_by_0 )
assume that
A1: p is dominated_by_0 and
A2: 2 * (Sum (p | k)) = k and
A3: p = (p | k) ^ q ; ::_thesis: q is dominated_by_0
A4: len (p | k) = k by A1, A2, Th11;
( rng q c= rng p & rng p c= {0,1} ) by A1, A3, Def1, AFINSQ_1:25;
hence rng q c= {0,1} by XBOOLE_1:1; :: according to CATALAN2:def_1 ::_thesis: for k being Nat st k <= dom q holds
2 * (Sum (q | k)) <= k
let n be Nat; ::_thesis: ( n <= dom q implies 2 * (Sum (q | n)) <= n )
assume n <= dom q ; ::_thesis: 2 * (Sum (q | n)) <= n
p | ((len (p | k)) + n) = (p | k) ^ (q | n) by A3, AFINSQ_1:59;
then A5: Sum (p | ((len (p | k)) + n)) = (Sum (p | k)) + (Sum (q | n)) by AFINSQ_2:55;
2 * (Sum (p | ((len (p | k)) + n))) <= (len (p | k)) + n by A1, Th2;
then k + (2 * (Sum (q | n))) <= (len (p | k)) + n by A2, A5;
hence 2 * (Sum (q | n)) <= n by A4, XREAL_1:6; ::_thesis: verum
end;
theorem Th13: :: CATALAN2:13
for k, n being Nat
for p being XFinSequence of st p is dominated_by_0 & 2 * (Sum (p | k)) = k & k = n + 1 holds
p | k = (p | n) ^ (1 --> 1)
proof
let k, n be Nat; ::_thesis: for p being XFinSequence of st p is dominated_by_0 & 2 * (Sum (p | k)) = k & k = n + 1 holds
p | k = (p | n) ^ (1 --> 1)
let p be XFinSequence of ; ::_thesis: ( p is dominated_by_0 & 2 * (Sum (p | k)) = k & k = n + 1 implies p | k = (p | n) ^ (1 --> 1) )
assume that
A1: p is dominated_by_0 and
A2: 2 * (Sum (p | k)) = k and
A3: k = n + 1 ; ::_thesis: p | k = (p | n) ^ (1 --> 1)
reconsider q = p | k as XFinSequence of ;
q . n = 1
proof
Sum (p | k) <> 0 by A2, A3;
then reconsider s = (Sum (p | k)) - 1 as Element of NAT by NAT_1:14, NAT_1:21;
A4: q is dominated_by_0 by A1, Th6;
then A5: rng q c= {0,1} by Def1;
(2 * s) + 1 = n by A2, A3;
then A6: ( Sum <%0%> = 0 & 2 * (Sum (q | n)) < n ) by A4, Th8, AFINSQ_2:53;
A7: len q = n + 1 by A1, A2, A3, Th11;
then A8: q = (q | n) ^ <%(q . n)%> by AFINSQ_1:56;
n < n + 1 by NAT_1:13;
then n in n + 1 by NAT_1:44;
then A9: q . n in rng q by A7, FUNCT_1:3;
assume q . n <> 1 ; ::_thesis: contradiction
then q . n = 0 by A5, A9, TARSKI:def_2;
then Sum q = (Sum (q | n)) + (Sum <%0%>) by A8, AFINSQ_2:55;
hence contradiction by A2, A3, A6, NAT_1:13; ::_thesis: verum
end;
then A10: ( dom <%(q . n)%> = 1 & rng <%(q . n)%> = {1} ) by AFINSQ_1:33;
n <= n + 1 by NAT_1:11;
then n c= k by A3, NAT_1:39;
then A11: q | n = p | n by RELAT_1:74;
len q = n + 1 by A1, A2, A3, Th11;
then q = (q | n) ^ <%(q . n)%> by AFINSQ_1:56;
hence p | k = (p | n) ^ (1 --> 1) by A11, A10, FUNCOP_1:9; ::_thesis: verum
end;
theorem Th14: :: CATALAN2:14
for m being Nat
for p being XFinSequence of st m = min* { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } & m > 0 & p is dominated_by_0 holds
ex q being XFinSequence of st
( p | m = ((1 --> 0) ^ q) ^ (1 --> 1) & q is dominated_by_0 )
proof
A1: ( dom <%0%> = 1 & rng <%0%> = {0} ) by AFINSQ_1:33;
set q1 = 1 --> 1;
set q0 = 1 --> 0;
let m be Nat; ::_thesis: for p being XFinSequence of st m = min* { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } & m > 0 & p is dominated_by_0 holds
ex q being XFinSequence of st
( p | m = ((1 --> 0) ^ q) ^ (1 --> 1) & q is dominated_by_0 )
let p be XFinSequence of ; ::_thesis: ( m = min* { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } & m > 0 & p is dominated_by_0 implies ex q being XFinSequence of st
( p | m = ((1 --> 0) ^ q) ^ (1 --> 1) & q is dominated_by_0 ) )
assume that
A2: ( m = min* { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } & m > 0 ) and
A3: p is dominated_by_0 ; ::_thesis: ex q being XFinSequence of st
( p | m = ((1 --> 0) ^ q) ^ (1 --> 1) & q is dominated_by_0 )
reconsider M = { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } as non empty Subset of NAT by A2, NAT_1:def_1;
min* M in M by NAT_1:def_1;
then consider n being Element of NAT such that
A4: n = min* M and
A5: 2 * (Sum (p | n)) = n and
A6: n > 0 ;
reconsider n1 = n - 1 as Element of NAT by A6, NAT_1:20;
Sum (p | n) <> 0 by A5, A6;
then n >= 2 * 1 by A5, NAT_1:14, XREAL_1:64;
then A7: n1 >= 2 - 1 by XREAL_1:9;
then A8: 1 c= n1 by NAT_1:39;
then A9: (p | n1) | 1 = p | 1 by RELAT_1:74;
A10: n1 < n1 + 1 by NAT_1:13;
n <= len p by A3, A5, Th11;
then A11: n1 < len p by A10, XXREAL_0:2;
then 1 < len p by A7, XXREAL_0:2;
then len (p | 1) = 1 by AFINSQ_1:11;
then A12: p | 1 = <%((p | 1) . 0)%> by AFINSQ_1:34;
p | 1 is dominated_by_0 by A3, Th6;
then (p | 1) . 0 = 0 by Th3;
then A13: p | 1 = 1 --> 0 by A12, A1, FUNCOP_1:9;
consider q being XFinSequence of such that
A14: p | n1 = ((p | n1) | 1) ^ q by Th1;
set qq = ((1 --> 0) ^ q) ^ (1 --> 1);
take q ; ::_thesis: ( p | m = ((1 --> 0) ^ q) ^ (1 --> 1) & q is dominated_by_0 )
A15: p | (n1 + 1) = (p | n1) ^ (1 --> 1) by A3, A5, Th13;
hence p | m = ((1 --> 0) ^ q) ^ (1 --> 1) by A2, A4, A14, A8, A13, RELAT_1:74; ::_thesis: q is dominated_by_0
( rng q c= rng ((1 --> 0) ^ q) & rng ((1 --> 0) ^ q) c= rng (((1 --> 0) ^ q) ^ (1 --> 1)) ) by AFINSQ_1:24, AFINSQ_1:25;
then A16: rng q c= rng (((1 --> 0) ^ q) ^ (1 --> 1)) by XBOOLE_1:1;
p | m is dominated_by_0 by A3, Th6;
then rng (((1 --> 0) ^ q) ^ (1 --> 1)) c= {0,1} by A2, A4, A14, A13, A9, A15, Def1;
hence rng q c= {0,1} by A16, XBOOLE_1:1; :: according to CATALAN2:def_1 ::_thesis: for k being Nat st k <= dom q holds
2 * (Sum (q | k)) <= k
A17: dom (1 --> 0) = 1 by FUNCOP_1:13;
len (p | n1) = n1 by A11, AFINSQ_1:11;
then A18: n1 = (len (1 --> 0)) + (len q) by A14, A13, A9, AFINSQ_1:17;
let k be Nat; ::_thesis: ( k <= dom q implies 2 * (Sum (q | k)) <= k )
assume k <= dom q ; ::_thesis: 2 * (Sum (q | k)) <= k
then A19: (len (1 --> 0)) + k <= n1 by A18, XREAL_1:6;
then (len (1 --> 0)) + k c= n1 by NAT_1:39;
then A20: (p | n1) | (1 + k) = p | (1 + k) by A17, RELAT_1:74;
A21: 1 + k < n by A15, A19, A17, NAT_1:13;
A22: 2 * (Sum (p | (1 + k))) < 1 + k
proof
assume A23: 2 * (Sum (p | (1 + k))) >= 1 + k ; ::_thesis: contradiction
2 * (Sum (p | (k + 1))) <= k + 1 by A3, Th2;
then 2 * (Sum (p | (1 + k))) = 1 + k by A23, XXREAL_0:1;
then 1 + k in M ;
hence contradiction by A4, A21, NAT_1:def_1; ::_thesis: verum
end;
(p | n1) | (1 + k) = (1 --> 0) ^ (q | k) by A14, A13, A9, A17, AFINSQ_1:59;
then A24: Sum (p | (1 + k)) = (Sum (1 --> 0)) + (Sum (q | k)) by A20, AFINSQ_2:55;
Sum (1 --> 0) = 0 * 1 by AFINSQ_2:58;
hence 2 * (Sum (q | k)) <= k by A24, A22, NAT_1:13; ::_thesis: verum
end;
theorem Th15: :: CATALAN2:15
for p being XFinSequence of st rng p c= {0,1} & not p is dominated_by_0 holds
ex k being Nat st
( (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } & (2 * k) + 1 <= dom p & k = Sum (p | (2 * k)) & p . (2 * k) = 1 )
proof
let p be XFinSequence of ; ::_thesis: ( rng p c= {0,1} & not p is dominated_by_0 implies ex k being Nat st
( (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } & (2 * k) + 1 <= dom p & k = Sum (p | (2 * k)) & p . (2 * k) = 1 ) )
assume that
A1: rng p c= {0,1} and
A2: not p is dominated_by_0 ; ::_thesis: ex k being Nat st
( (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } & (2 * k) + 1 <= dom p & k = Sum (p | (2 * k)) & p . (2 * k) = 1 )
set M = { N where N is Element of NAT : 2 * (Sum (p | N)) > N } ;
{ N where N is Element of NAT : 2 * (Sum (p | N)) > N } c= NAT
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { N where N is Element of NAT : 2 * (Sum (p | N)) > N } or x in NAT )
assume x in { N where N is Element of NAT : 2 * (Sum (p | N)) > N } ; ::_thesis: x in NAT
then ex N being Element of NAT st
( x = N & 2 * (Sum (p | N)) > N ) ;
hence x in NAT ; ::_thesis: verum
end;
then reconsider M = { N where N is Element of NAT : 2 * (Sum (p | N)) > N } as Subset of NAT ;
consider k being Nat such that
A3: k <= dom p and
A4: 2 * (Sum (p | k)) > k by A1, A2, Def1;
reconsider k = k as Element of NAT by ORDINAL1:def_12;
k in M by A4;
then reconsider M = M as non empty Subset of NAT ;
min* M in M by NAT_1:def_1;
then consider n being Element of NAT such that
A5: min* M = n and
A6: 2 * (Sum (p | n)) > n ;
n > 0 by A6;
then reconsider n1 = n - 1 as Element of NAT by NAT_1:20;
reconsider S = Sum (p | n1) as Element of NAT by ORDINAL1:def_12;
take S ; ::_thesis: ( (2 * S) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } & (2 * S) + 1 <= dom p & S = Sum (p | (2 * S)) & p . (2 * S) = 1 )
k in M by A4;
then A7: k >= n by A5, NAT_1:def_1;
then A8: dom p >= n by A3, XXREAL_0:2;
A9: 2 * (Sum (p | n1)) = n1
proof
A10: n1 < n1 + 1 by NAT_1:13;
then n1 c= n1 + 1 by NAT_1:39;
then A11: (p | n) | n1 = p | n1 by RELAT_1:74;
( ( n = len p & p | (dom p) = p ) or n < len p ) by A8, XXREAL_0:1;
then A12: len (p | n) = n1 + 1 by AFINSQ_1:11;
then n1 in len (p | n) by A10, NAT_1:44;
then A13: (p | n) . n1 in rng (p | n) by FUNCT_1:3;
p | n = ((p | n) | n1) ^ <%((p | n) . n1)%> by A12, AFINSQ_1:56;
then Sum (p | n) = (Sum (p | n1)) + (Sum <%((p | n) . n1)%>) by A11, AFINSQ_2:55;
then A14: (2 * (Sum (p | n1))) + (2 * (Sum <%((p | n) . n1)%>)) >= n + 1 by A6, NAT_1:13;
n1 < n1 + 1 by NAT_1:13;
then not n1 in M by A5, NAT_1:def_1;
then A15: 2 * (Sum (p | n1)) <= n1 ;
rng (p | n) c= rng p by RELAT_1:70;
then (p | n) . n1 in {0,1} by A1, A13, TARSKI:def_3;
then A16: ( (p | n) . n1 = 0 or (p | n) . n1 = 1 ) by TARSKI:def_2;
assume 2 * (Sum (p | n1)) <> n1 ; ::_thesis: contradiction
then ( Sum <%((p | n) . n1)%> = (p | n) . n1 & 2 * (Sum (p | n1)) < n1 ) by A15, AFINSQ_2:53, XXREAL_0:1;
then (2 * (Sum (p | n1))) + (2 * (Sum <%((p | n) . n1)%>)) < n1 + 2 by A16, XREAL_1:8;
hence contradiction by A14; ::_thesis: verum
end;
p . n1 = 1
proof
n c= len p by A8, NAT_1:39;
then A17: dom (p | n) = n1 + 1 by RELAT_1:62;
dom (p | n) = len (p | n) ;
then A18: ( Sum <%0%> = 0 & p | n = ((p | n) | n1) ^ <%((p | n) . n1)%> ) by A17, AFINSQ_1:56, AFINSQ_2:53;
assume A19: p . n1 <> 1 ; ::_thesis: contradiction
A20: n1 < n1 + 1 by NAT_1:13;
then n1 < dom p by A8, XXREAL_0:2;
then A21: n1 in dom p by NAT_1:44;
n1 c= n by A20, NAT_1:39;
then A22: (p | n) | n1 = p | n1 by RELAT_1:74;
n1 in n by A20, NAT_1:44;
then n1 in (dom p) /\ n by A21, XBOOLE_0:def_4;
then A23: (p | n) . n1 = p . n1 by FUNCT_1:48;
A24: n1 < n1 + 1 by NAT_1:13;
p . n1 in rng p by A21, FUNCT_1:3;
then p . n1 = 0 by A1, A19, TARSKI:def_2;
then Sum (p | n) = (Sum (p | n1)) + 0 by A18, A23, A22, AFINSQ_2:55;
hence contradiction by A6, A9, A24; ::_thesis: verum
end;
hence ( (2 * S) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } & (2 * S) + 1 <= dom p & S = Sum (p | (2 * S)) & p . (2 * S) = 1 ) by A3, A5, A7, A9, XXREAL_0:2; ::_thesis: verum
end;
theorem Th16: :: CATALAN2:16
for p, q being XFinSequence of
for k being Nat st p | ((2 * k) + (len q)) = ((k --> 0) ^ q) ^ (k --> 1) & q is dominated_by_0 & 2 * (Sum q) = len q & k > 0 holds
min* { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } = (2 * k) + (len q)
proof
let p, q be XFinSequence of ; ::_thesis: for k being Nat st p | ((2 * k) + (len q)) = ((k --> 0) ^ q) ^ (k --> 1) & q is dominated_by_0 & 2 * (Sum q) = len q & k > 0 holds
min* { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } = (2 * k) + (len q)
let k be Nat; ::_thesis: ( p | ((2 * k) + (len q)) = ((k --> 0) ^ q) ^ (k --> 1) & q is dominated_by_0 & 2 * (Sum q) = len q & k > 0 implies min* { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } = (2 * k) + (len q) )
assume that
A1: p | ((2 * k) + (len q)) = ((k --> 0) ^ q) ^ (k --> 1) and
A2: q is dominated_by_0 and
A3: 2 * (Sum q) = len q and
A4: k > 0 ; ::_thesis: min* { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } = (2 * k) + (len q)
set k0 = k --> 0;
A5: Sum (k --> 0) = k * 0 by AFINSQ_2:58;
then A6: 2 * k > 0 by A4, XREAL_1:68;
reconsider k1 = k --> 1 as XFinSequence of ;
set M = { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } ;
set kqk = ((k --> 0) ^ q) ^ k1;
Sum (((k --> 0) ^ q) ^ k1) = (Sum ((k --> 0) ^ q)) + (Sum k1) by AFINSQ_2:55;
then A7: Sum (((k --> 0) ^ q) ^ k1) = ((Sum (k --> 0)) + (Sum q)) + (Sum k1) by AFINSQ_2:55;
Sum k1 = k * 1 by AFINSQ_2:58;
then 2 * (Sum (p | ((2 * k) + (len q)))) = (len q) + (2 * k) by A1, A3, A7, A5;
then A8: (2 * k) + (len q) in { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } by A6;
{ N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } c= NAT
proof
let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } or y in NAT )
assume y in { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } ; ::_thesis: y in NAT
then ex i being Element of NAT st
( i = y & 2 * (Sum (p | i)) = i & i > 0 ) ;
hence y in NAT ; ::_thesis: verum
end;
then reconsider M = { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } as non empty Subset of NAT by A8;
min* M = (2 * k) + (len q)
proof
((k --> 0) ^ q) ^ k1 = (k --> 0) ^ (q ^ k1) by AFINSQ_1:27;
then A9: len (((k --> 0) ^ q) ^ k1) = (len (k --> 0)) + (len (q ^ k1)) by AFINSQ_1:17;
dom (k --> 0) = k by FUNCOP_1:13;
then A10: len (((k --> 0) ^ q) ^ k1) = k + ((len q) + (len k1)) by A9, AFINSQ_1:17;
assume A11: min* M <> (2 * k) + (len q) ; ::_thesis: contradiction
min* M in M by NAT_1:def_1;
then A12: ex i being Element of NAT st
( i = min* M & 2 * (Sum (p | i)) = i & i > 0 ) ;
A13: dom k1 = k by FUNCOP_1:13;
A14: (2 * k) + (len q) >= min* M by A8, NAT_1:def_1;
then A15: min* M c= (2 * k) + (len q) by NAT_1:39;
then A16: p | (min* M) = (((k --> 0) ^ q) ^ k1) | (min* M) by A1, RELAT_1:74;
now__::_thesis:_contradiction
percases ( min* M <= k or min* M > k ) ;
supposeA17: min* M <= k ; ::_thesis: contradiction
( k = dom (k --> 0) & ((k --> 0) ^ q) ^ k1 = (k --> 0) ^ (q ^ k1) ) by AFINSQ_1:27, FUNCOP_1:13;
then A18: (((k --> 0) ^ q) ^ k1) | (min* M) = (k --> 0) | (min* M) by A17, AFINSQ_1:58;
A19: Sum ((min* M) --> 0) = (min* M) * 0 by AFINSQ_2:58;
(k --> 0) | (min* M) = (min* M) --> 0 by A17, Lm1;
then Sum (p | (min* M)) = Sum ((min* M) --> 0) by A1, A15, A18, RELAT_1:74;
hence contradiction by A12, A19; ::_thesis: verum
end;
suppose min* M > k ; ::_thesis: contradiction
then reconsider mk = (min* M) - k as Element of NAT by NAT_1:21;
now__::_thesis:_contradiction
percases ( min* M <= k + (len q) or min* M > k + (len q) ) ;
supposeA20: min* M <= k + (len q) ; ::_thesis: contradiction
A21: dom (k --> 0) = k by FUNCOP_1:13;
min* M = mk + k ;
then A22: ((k --> 0) ^ q) | (min* M) = (k --> 0) ^ (q | mk) by A21, AFINSQ_1:59;
dom ((k --> 0) ^ q) = (len (k --> 0)) + (len q) by AFINSQ_1:def_3;
then (((k --> 0) ^ q) ^ k1) | (min* M) = ((k --> 0) ^ q) | (min* M) by A20, A21, AFINSQ_1:58;
then A23: Sum (p | (min* M)) = (Sum (k --> 0)) + (Sum (q | mk)) by A16, A22, AFINSQ_2:55;
A24: 1 <= k by A4, NAT_1:14;
Sum (k --> 0) = k * 0 by AFINSQ_2:58;
then mk + k <= mk by A2, A12, A23, Th2;
hence contradiction by A24, NAT_1:19; ::_thesis: verum
end;
suppose min* M > k + (len q) ; ::_thesis: contradiction
then reconsider mkL = (min* M) - (k + (len q)) as Element of NAT by NAT_1:21;
A25: 2 * (Sum (p | (min* M))) = min* M by A12;
( dom ((k --> 0) ^ q) = (len (k --> 0)) + (len q) & dom (k --> 0) = k ) by AFINSQ_1:def_3, FUNCOP_1:13;
then min* M = (dom ((k --> 0) ^ q)) + mkL ;
then (((k --> 0) ^ q) ^ k1) | (min* M) = ((k --> 0) ^ q) ^ (k1 | mkL) by AFINSQ_1:59;
then A26: Sum (p | (min* M)) = (Sum ((k --> 0) ^ q)) + (Sum (k1 | mkL)) by A16, AFINSQ_2:55;
min* M < len (((k --> 0) ^ q) ^ k1) by A11, A10, A13, A14, XXREAL_0:1;
then mkL < ((2 * k) + (len q)) - (k + (len q)) by A10, A13, XREAL_1:9;
then k1 | mkL = mkL --> 1 by Lm1;
then A27: Sum (k1 | mkL) = mkL * 1 by AFINSQ_2:58;
( Sum ((k --> 0) ^ q) = (Sum (k --> 0)) + (Sum q) & Sum (k --> 0) = k * 0 ) by AFINSQ_2:55, AFINSQ_2:58;
hence contradiction by A3, A11, A26, A27, A25; ::_thesis: verum
end;
end;
end;
hence contradiction ; ::_thesis: verum
end;
end;
end;
hence contradiction ; ::_thesis: verum
end;
hence min* { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } = (2 * k) + (len q) ; ::_thesis: verum
end;
theorem Th17: :: CATALAN2:17
for p being XFinSequence of st p is dominated_by_0 & { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } = {} & len p > 0 holds
ex q being XFinSequence of st
( p = <%0%> ^ q & q is dominated_by_0 )
proof
let p be XFinSequence of ; ::_thesis: ( p is dominated_by_0 & { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } = {} & len p > 0 implies ex q being XFinSequence of st
( p = <%0%> ^ q & q is dominated_by_0 ) )
assume that
A1: p is dominated_by_0 and
A2: ( { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } = {} & len p > 0 ) ; ::_thesis: ex q being XFinSequence of st
( p = <%0%> ^ q & q is dominated_by_0 )
set M = { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } ;
consider q being XFinSequence of such that
A3: p = (p | 1) ^ q by Th1;
take q ; ::_thesis: ( p = <%0%> ^ q & q is dominated_by_0 )
A4: rng p c= {0,1} by A1, Def1;
rng q c= rng p by A3, AFINSQ_1:25;
then A5: rng q c= {0,1} by A4, XBOOLE_1:1;
len p >= 1 by A2, NAT_1:14;
then 1 c= dom p by NAT_1:39;
then A6: dom (p | 1) = 1 by RELAT_1:62;
len (p | 1) = dom (p | 1) ;
then A7: p | 1 = <%((p | 1) . 0)%> by A6, AFINSQ_1:34;
0 in 1 by NAT_1:44;
then A8: (p | 1) . 0 = p . 0 by A6, FUNCT_1:47;
hence p = <%0%> ^ q by A1, A3, A7, Th3; ::_thesis: q is dominated_by_0
assume not q is dominated_by_0 ; ::_thesis: contradiction
then consider i being Nat such that
i <= dom q and
A9: 2 * (Sum (q | i)) > i by A5, Def1;
reconsider i = i as Element of NAT by ORDINAL1:def_12;
p | (1 + i) = (p | 1) ^ (q | i) by A3, A6, AFINSQ_1:59;
then A10: Sum (p | (1 + i)) = (Sum <%(p . 0)%>) + (Sum (q | i)) by A7, A8, AFINSQ_2:55;
A11: 2 * (Sum (q | i)) >= i + 1 by A9, NAT_1:13;
Sum <%(p . 0)%> = p . 0 by AFINSQ_2:53;
then A12: Sum (p | (1 + i)) = 0 + (Sum (q | i)) by A1, A10, Th3;
then 1 + i >= 2 * (Sum (q | i)) by A1, Th2;
then 1 + i = 2 * (Sum (q | i)) by A11, XXREAL_0:1;
then 1 + i in { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } by A12;
hence contradiction by A2; ::_thesis: verum
end;
theorem Th18: :: CATALAN2:18
for p being XFinSequence of st p is dominated_by_0 holds
( <%0%> ^ p is dominated_by_0 & { N where N is Element of NAT : ( 2 * (Sum ((<%0%> ^ p) | N)) = N & N > 0 ) } = {} )
proof
let p be XFinSequence of ; ::_thesis: ( p is dominated_by_0 implies ( <%0%> ^ p is dominated_by_0 & { N where N is Element of NAT : ( 2 * (Sum ((<%0%> ^ p) | N)) = N & N > 0 ) } = {} ) )
reconsider q = 1 --> 0 as XFinSequence of ;
assume A1: p is dominated_by_0 ; ::_thesis: ( <%0%> ^ p is dominated_by_0 & { N where N is Element of NAT : ( 2 * (Sum ((<%0%> ^ p) | N)) = N & N > 0 ) } = {} )
( dom q = 1 & len q = dom q ) by FUNCOP_1:13;
then A2: q = <%(q . 0)%> by AFINSQ_1:34;
q is dominated_by_0 by Lm2;
then ( q is dominated_by_0 & q . 0 = 0 ) by Th3;
hence <%0%> ^ p is dominated_by_0 by A1, A2, Th7; ::_thesis: { N where N is Element of NAT : ( 2 * (Sum ((<%0%> ^ p) | N)) = N & N > 0 ) } = {}
set M = { N where N is Element of NAT : ( 2 * (Sum ((<%0%> ^ p) | N)) = N & N > 0 ) } ;
assume { N where N is Element of NAT : ( 2 * (Sum ((<%0%> ^ p) | N)) = N & N > 0 ) } <> {} ; ::_thesis: contradiction
then consider x being set such that
A3: x in { N where N is Element of NAT : ( 2 * (Sum ((<%0%> ^ p) | N)) = N & N > 0 ) } by XBOOLE_0:def_1;
consider i being Element of NAT such that
x = i and
A4: 2 * (Sum ((<%0%> ^ p) | i)) = i and
A5: i > 0 by A3;
reconsider i1 = i - 1 as Element of NAT by A5, NAT_1:20;
dom <%0%> = 1 by AFINSQ_1:33;
then i = (dom <%0%>) + i1 ;
then (<%0%> ^ p) | i = <%0%> ^ (p | i1) by AFINSQ_1:59;
then A6: Sum ((<%0%> ^ p) | i) = (Sum <%0%>) + (Sum (p | i1)) by AFINSQ_2:55;
( Sum <%0%> = 0 & i1 < i1 + 1 ) by AFINSQ_2:53, NAT_1:13;
hence contradiction by A1, A4, A6, Th2; ::_thesis: verum
end;
theorem :: CATALAN2:19
for k being Nat
for p being XFinSequence of st rng p c= {0,1} & (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } holds
p | (2 * k) is dominated_by_0
proof
let k be Nat; ::_thesis: for p being XFinSequence of st rng p c= {0,1} & (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } holds
p | (2 * k) is dominated_by_0
let p be XFinSequence of ; ::_thesis: ( rng p c= {0,1} & (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } implies p | (2 * k) is dominated_by_0 )
set M = { N where N is Element of NAT : 2 * (Sum (p | N)) > N } ;
set q = p | (2 * k);
assume that
A1: rng p c= {0,1} and
A2: (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } ; ::_thesis: p | (2 * k) is dominated_by_0
rng (p | (2 * k)) c= rng p by RELAT_1:70;
hence rng (p | (2 * k)) c= {0,1} by A1, XBOOLE_1:1; :: according to CATALAN2:def_1 ::_thesis: for k being Nat st k <= dom (p | (2 * k)) holds
2 * (Sum ((p | (2 * k)) | k)) <= k
reconsider M = { N where N is Element of NAT : 2 * (Sum (p | N)) > N } as non empty Subset of NAT by A2, NAT_1:def_1;
let m be Nat; ::_thesis: ( m <= dom (p | (2 * k)) implies 2 * (Sum ((p | (2 * k)) | m)) <= m )
assume m <= dom (p | (2 * k)) ; ::_thesis: 2 * (Sum ((p | (2 * k)) | m)) <= m
then A3: m c= dom (p | (2 * k)) by NAT_1:39;
m c= 2 * k by A3, XBOOLE_1:1;
then m <= 2 * k by NAT_1:39;
then A4: m < (2 * k) + 1 by NAT_1:13;
assume A5: 2 * (Sum ((p | (2 * k)) | m)) > m ; ::_thesis: contradiction
reconsider m = m as Element of NAT by ORDINAL1:def_12;
( (p | (2 * k)) | m = p | m & m in NAT ) by A3, RELAT_1:74, XBOOLE_1:1;
then m in M by A5;
hence contradiction by A2, A4, NAT_1:def_1; ::_thesis: verum
end;
begin
definition
let n, m be Nat;
func Domin_0 (n,m) -> Subset of ({0,1} ^omega) means :Def2: :: CATALAN2:def 2
for x being set holds
( x in it iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) );
existence
ex b1 being Subset of ({0,1} ^omega) st
for x being set holds
( x in b1 iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) )
proof
defpred S1[ set ] means ex p being XFinSequence of st
( p = $1 & p is dominated_by_0 & dom p = n & Sum p = m );
consider X being set such that
A1: for x being set holds
( x in X iff ( x in bool [:NAT,NAT:] & S1[x] ) ) from XBOOLE_0:sch_1();
X c= {0,1} ^omega
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in X or x in {0,1} ^omega )
assume x in X ; ::_thesis: x in {0,1} ^omega
then consider p being XFinSequence of such that
A2: p = x and
A3: p is dominated_by_0 and
dom p = n and
Sum p = m by A1;
rng p c= {0,1} by A3, Def1;
then p is XFinSequence of by RELAT_1:def_19;
hence x in {0,1} ^omega by A2, AFINSQ_1:42; ::_thesis: verum
end;
then reconsider X = X as Subset of ({0,1} ^omega) ;
take X ; ::_thesis: for x being set holds
( x in X iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) )
let x be set ; ::_thesis: ( x in X iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) )
thus ( x in X implies S1[x] ) by A1; ::_thesis: ( ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) implies x in X )
given p being XFinSequence of such that A4: ( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) ; ::_thesis: x in X
( p c= [:(dom p),(rng p):] & [:(dom p),(rng p):] c= [:NAT,NAT:] ) by RELAT_1:7, ZFMISC_1:96;
then p c= [:NAT,NAT:] by XBOOLE_1:1;
hence x in X by A1, A4; ::_thesis: verum
end;
uniqueness
for b1, b2 being Subset of ({0,1} ^omega) st ( for x being set holds
( x in b1 iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) ) ) & ( for x being set holds
( x in b2 iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) ) ) holds
b1 = b2
proof
let X1, X2 be Subset of ({0,1} ^omega); ::_thesis: ( ( for x being set holds
( x in X1 iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) ) ) & ( for x being set holds
( x in X2 iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) ) ) implies X1 = X2 )
assume that
A5: for x being set holds
( x in X1 iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) ) and
A6: for x being set holds
( x in X2 iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) ) ; ::_thesis: X1 = X2
for x being set holds
( x in X1 iff x in X2 )
proof
let x be set ; ::_thesis: ( x in X1 iff x in X2 )
( x in X1 iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) ) by A5;
hence ( x in X1 iff x in X2 ) by A6; ::_thesis: verum
end;
hence X1 = X2 by TARSKI:1; ::_thesis: verum
end;
end;
:: deftheorem Def2 defines Domin_0 CATALAN2:def_2_:_
for n, m being Nat
for b3 being Subset of ({0,1} ^omega) holds
( b3 = Domin_0 (n,m) iff for x being set holds
( x in b3 iff ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = n & Sum p = m ) ) );
theorem Th20: :: CATALAN2:20
for n, m being Nat
for p being XFinSequence of holds
( p in Domin_0 (n,m) iff ( p is dominated_by_0 & dom p = n & Sum p = m ) )
proof
let n, m be Nat; ::_thesis: for p being XFinSequence of holds
( p in Domin_0 (n,m) iff ( p is dominated_by_0 & dom p = n & Sum p = m ) )
let p be XFinSequence of ; ::_thesis: ( p in Domin_0 (n,m) iff ( p is dominated_by_0 & dom p = n & Sum p = m ) )
thus ( p in Domin_0 (n,m) implies ( p is dominated_by_0 & dom p = n & Sum p = m ) ) ::_thesis: ( p is dominated_by_0 & dom p = n & Sum p = m implies p in Domin_0 (n,m) )
proof
assume p in Domin_0 (n,m) ; ::_thesis: ( p is dominated_by_0 & dom p = n & Sum p = m )
then ex q being XFinSequence of st
( q = p & q is dominated_by_0 & dom q = n & Sum q = m ) by Def2;
hence ( p is dominated_by_0 & dom p = n & Sum p = m ) ; ::_thesis: verum
end;
thus ( p is dominated_by_0 & dom p = n & Sum p = m implies p in Domin_0 (n,m) ) by Def2; ::_thesis: verum
end;
theorem Th21: :: CATALAN2:21
for n, m being Nat holds Domin_0 (n,m) c= Choose (n,m,1,0)
proof
let n, m be Nat; ::_thesis: Domin_0 (n,m) c= Choose (n,m,1,0)
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in Domin_0 (n,m) or x in Choose (n,m,1,0) )
assume x in Domin_0 (n,m) ; ::_thesis: x in Choose (n,m,1,0)
then consider p being XFinSequence of such that
A1: p = x and
A2: p is dominated_by_0 and
A3: ( dom p = n & Sum p = m ) by Def2;
rng p c= {0,1} by A2, Def1;
hence x in Choose (n,m,1,0) by A1, A3, CARD_FIN:40; ::_thesis: verum
end;
registration
let n, m be Nat;
cluster Domin_0 (n,m) -> finite ;
coherence
Domin_0 (n,m) is finite
proof
Domin_0 (n,m) c= Choose (n,m,1,0) by Th21;
hence Domin_0 (n,m) is finite ; ::_thesis: verum
end;
end;
theorem Th22: :: CATALAN2:22
for n, m being Nat holds
( Domin_0 (n,m) is empty iff 2 * m > n )
proof
let n, m be Nat; ::_thesis: ( Domin_0 (n,m) is empty iff 2 * m > n )
thus ( Domin_0 (n,m) is empty implies 2 * m > n ) ::_thesis: ( 2 * m > n implies Domin_0 (n,m) is empty )
proof
set q = m --> 1;
assume A1: Domin_0 (n,m) is empty ; ::_thesis: 2 * m > n
assume A2: 2 * m <= n ; ::_thesis: contradiction
m <= m + m by NAT_1:12;
then reconsider nm = n - m as Element of NAT by A2, NAT_1:21, XXREAL_0:2;
set p = nm --> 0;
(2 * m) - m <= nm by A2, XREAL_1:9;
then A3: (nm --> 0) ^ (m --> 1) is dominated_by_0 by Th5;
( dom ((nm --> 0) ^ (m --> 1)) = (len (nm --> 0)) + (len (m --> 1)) & dom (nm --> 0) = nm ) by AFINSQ_1:def_3, FUNCOP_1:13;
then A4: dom ((nm --> 0) ^ (m --> 1)) = nm + m by FUNCOP_1:13;
A5: Sum ((nm --> 0) ^ (m --> 1)) = (Sum (nm --> 0)) + (Sum (m --> 1)) by AFINSQ_2:55;
( Sum (nm --> 0) = 0 * nm & Sum (m --> 1) = 1 * m ) by AFINSQ_2:58;
hence contradiction by A1, A5, A4, A3, Def2; ::_thesis: verum
end;
assume A6: 2 * m > n ; ::_thesis: Domin_0 (n,m) is empty
assume not Domin_0 (n,m) is empty ; ::_thesis: contradiction
then consider x being set such that
A7: x in Domin_0 (n,m) by XBOOLE_0:def_1;
consider p being XFinSequence of such that
p = x and
A8: p is dominated_by_0 and
A9: dom p = n and
A10: Sum p = m by A7, Def2;
p | n = p by A9, RELAT_1:69;
hence contradiction by A6, A8, A10, Th2; ::_thesis: verum
end;
theorem Th23: :: CATALAN2:23
for n being Nat holds Domin_0 (n,0) = {(n --> 0)}
proof
let n be Nat; ::_thesis: Domin_0 (n,0) = {(n --> 0)}
set p = n --> 0;
A1: Domin_0 (n,0) c= {(n --> 0)}
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in Domin_0 (n,0) or x in {(n --> 0)} )
assume x in Domin_0 (n,0) ; ::_thesis: x in {(n --> 0)}
then consider q being XFinSequence of such that
A2: x = q and
q is dominated_by_0 and
A3: dom q = n and
A4: Sum q = 0 by Def2;
( len q = n & q is nonnegative-yielding ) by A3;
then ( q = n --> 0 or ( q = {} & n = 0 ) ) by A4, AFINSQ_2:62;
then q = n --> 0 ;
hence x in {(n --> 0)} by A2, TARSKI:def_1; ::_thesis: verum
end;
{(n --> 0)} c= Domin_0 (n,0)
proof
A5: n --> 0 is dominated_by_0 by Lm2;
( dom (n --> 0) = n & Sum (n --> 0) = n * 0 ) by AFINSQ_2:58, FUNCOP_1:13;
then A6: n --> 0 in Domin_0 (n,0) by A5, Def2;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in {(n --> 0)} or x in Domin_0 (n,0) )
assume x in {(n --> 0)} ; ::_thesis: x in Domin_0 (n,0)
hence x in Domin_0 (n,0) by A6, TARSKI:def_1; ::_thesis: verum
end;
hence Domin_0 (n,0) = {(n --> 0)} by A1, XBOOLE_0:def_10; ::_thesis: verum
end;
theorem Th24: :: CATALAN2:24
for n being Nat holds card (Domin_0 (n,0)) = 1
proof
let n be Nat; ::_thesis: card (Domin_0 (n,0)) = 1
Domin_0 (n,0) = {(n --> 0)} by Th23;
hence card (Domin_0 (n,0)) = 1 by CARD_1:30; ::_thesis: verum
end;
theorem Th25: :: CATALAN2:25
for p being XFinSequence of
for n being Nat st rng p c= {0,n} holds
ex q being XFinSequence of st
( len p = len q & rng q c= {0,n} & ( for k being Nat st k <= len p holds
(Sum (p | k)) + (Sum (q | k)) = n * k ) & ( for k being Nat st k in len p holds
q . k = n - (p . k) ) )
proof
let p be XFinSequence of ; ::_thesis: for n being Nat st rng p c= {0,n} holds
ex q being XFinSequence of st
( len p = len q & rng q c= {0,n} & ( for k being Nat st k <= len p holds
(Sum (p | k)) + (Sum (q | k)) = n * k ) & ( for k being Nat st k in len p holds
q . k = n - (p . k) ) )
let n be Nat; ::_thesis: ( rng p c= {0,n} implies ex q being XFinSequence of st
( len p = len q & rng q c= {0,n} & ( for k being Nat st k <= len p holds
(Sum (p | k)) + (Sum (q | k)) = n * k ) & ( for k being Nat st k in len p holds
q . k = n - (p . k) ) ) )
assume A1: rng p c= {0,n} ; ::_thesis: ex q being XFinSequence of st
( len p = len q & rng q c= {0,n} & ( for k being Nat st k <= len p holds
(Sum (p | k)) + (Sum (q | k)) = n * k ) & ( for k being Nat st k in len p holds
q . k = n - (p . k) ) )
reconsider nn = n as Element of NAT by ORDINAL1:def_12;
defpred S1[ set , set ] means for k being Nat st k = $1 holds
$2 = n - (p . k);
A2: for k being Nat st k in len p holds
ex x being Element of {0,n} st S1[k,x]
proof
let k be Nat; ::_thesis: ( k in len p implies ex x being Element of {0,n} st S1[k,x] )
assume k in len p ; ::_thesis: ex x being Element of {0,n} st S1[k,x]
then p . k in rng p by FUNCT_1:3;
then ( p . k = 0 or p . k = n ) by A1, TARSKI:def_2;
then A3: n - (p . k) in {0,n} by TARSKI:def_2;
S1[k,n - (p . k)] ;
hence ex x being Element of {0,n} st S1[k,x] by A3; ::_thesis: verum
end;
consider q being XFinSequence of such that
A4: ( dom q = len p & ( for k being Nat st k in len p holds
S1[k,q . k] ) ) from STIRL2_1:sch_5(A2);
rng q c= {0,nn} ;
then rng q c= NAT by XBOOLE_1:1;
then reconsider q = q as XFinSequence of by RELAT_1:def_19;
defpred S2[ Nat] means ( $1 <= len p implies (Sum (p | $1)) + (Sum (q | $1)) = n * $1 );
A5: for k being Nat st S2[k] holds
S2[k + 1]
proof
let k be Nat; ::_thesis: ( S2[k] implies S2[k + 1] )
assume A6: S2[k] ; ::_thesis: S2[k + 1]
set k1 = k + 1;
A7: k < k + 1 by NAT_1:13;
then A8: k c= k + 1 by NAT_1:39;
then A9: (p | (k + 1)) | k = p | k by RELAT_1:74;
A10: (q | (k + 1)) | k = q | k by A8, RELAT_1:74;
assume A11: k + 1 <= len p ; ::_thesis: (Sum (p | (k + 1))) + (Sum (q | (k + 1))) = n * (k + 1)
then A12: k + 1 c= len p by NAT_1:39;
then A13: len (q | (k + 1)) = k + 1 by A4, RELAT_1:62;
then A14: q | (k + 1) = ((q | (k + 1)) | k) ^ <%((q | (k + 1)) . k)%> by AFINSQ_1:56;
dom (p | (k + 1)) = k + 1 by A12, RELAT_1:62;
then A15: k in dom (p | (k + 1)) by A7, NAT_1:44;
then A16: (p | (k + 1)) . k = p . k by FUNCT_1:47;
len (p | (k + 1)) = k + 1 by A12, RELAT_1:62;
then p | (k + 1) = ((p | (k + 1)) | k) ^ <%((p | (k + 1)) . k)%> by AFINSQ_1:56;
then Sum (p | (k + 1)) = (Sum (p | k)) + (Sum <%(p . k)%>) by A16, A9, AFINSQ_2:55;
then A17: Sum (p | (k + 1)) = (Sum (p | k)) + (p . k) by AFINSQ_2:53;
k < len p by A11, NAT_1:13;
then k in len p by NAT_1:44;
then A18: q . k = n - (p . k) by A4;
(q | (k + 1)) . k = q . k by A13, A15, FUNCT_1:47;
then Sum (q | (k + 1)) = (Sum (q | k)) + (Sum <%(q . k)%>) by A14, A10, AFINSQ_2:55;
then Sum (q | (k + 1)) = (Sum (q | k)) + (n - (p . k)) by A18, AFINSQ_2:53;
hence (Sum (p | (k + 1))) + (Sum (q | (k + 1))) = n * (k + 1) by A6, A11, A17, NAT_1:13; ::_thesis: verum
end;
take q ; ::_thesis: ( len p = len q & rng q c= {0,n} & ( for k being Nat st k <= len p holds
(Sum (p | k)) + (Sum (q | k)) = n * k ) & ( for k being Nat st k in len p holds
q . k = n - (p . k) ) )
thus len p = len q by A4; ::_thesis: ( rng q c= {0,n} & ( for k being Nat st k <= len p holds
(Sum (p | k)) + (Sum (q | k)) = n * k ) & ( for k being Nat st k in len p holds
q . k = n - (p . k) ) )
thus rng q c= {0,n} by RELAT_1:def_19; ::_thesis: ( ( for k being Nat st k <= len p holds
(Sum (p | k)) + (Sum (q | k)) = n * k ) & ( for k being Nat st k in len p holds
q . k = n - (p . k) ) )
A19: S2[ 0 ] ;
for k being Nat holds S2[k] from NAT_1:sch_2(A19, A5);
hence ( ( for k being Nat st k <= len p holds
(Sum (p | k)) + (Sum (q | k)) = n * k ) & ( for k being Nat st k in len p holds
q . k = n - (p . k) ) ) by A4; ::_thesis: verum
end;
theorem Th26: :: CATALAN2:26
for m, n being Nat st m <= n holds
n choose m > 0
proof
let m, n be Nat; ::_thesis: ( m <= n implies n choose m > 0 )
assume A1: m <= n ; ::_thesis: n choose m > 0
then reconsider nm = n - m as Nat by NAT_1:21;
A2: (m !) * (nm !) > (m !) * 0 by XREAL_1:68;
n ! > 0 * ((m !) * (nm !)) ;
then (n !) / ((m !) * (nm !)) > 0 by A2, XREAL_1:81;
hence n choose m > 0 by A1, NEWTON:def_3; ::_thesis: verum
end;
theorem Th27: :: CATALAN2:27
for m, n being Nat st 2 * (m + 1) <= n holds
card ((Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1)))) = card (Choose (n,m,1,0))
proof
let m, n be Nat; ::_thesis: ( 2 * (m + 1) <= n implies card ((Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1)))) = card (Choose (n,m,1,0)) )
defpred S1[ set , set ] means for p being XFinSequence of
for k being Nat st $1 = p & (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } holds
ex r1, r2 being XFinSequence of st
( $2 = r1 ^ r2 & len r1 = (2 * k) + 1 & len r1 = len (p | ((2 * k) + 1)) & p = (p | ((2 * k) + 1)) ^ r2 & ( for o being Nat st o < (2 * k) + 1 holds
r1 . o = 1 - (p . o) ) );
assume A1: 2 * (m + 1) <= n ; ::_thesis: card ((Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1)))) = card (Choose (n,m,1,0))
A2: card n = n by CARD_1:def_2;
A3: m <= m + m by XREAL_1:31;
m <= m + 1 by NAT_1:13;
then 2 * m <= 2 * (m + 1) by XREAL_1:64;
then 2 * m <= n by A1, XXREAL_0:2;
then m <= n by A3, XXREAL_0:2;
then (card n) choose m > 0 by A2, Th26;
then reconsider W = Choose (n,m,1,0) as non empty finite set by CARD_1:27, CARD_FIN:16;
set Z = Domin_0 (n,(m + 1));
set CH = Choose (n,(m + 1),1,0);
A4: for x being set st x in (Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1))) holds
ex y being set st
( y in W & S1[x,y] )
proof
let x be set ; ::_thesis: ( x in (Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1))) implies ex y being set st
( y in W & S1[x,y] ) )
assume A5: x in (Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1))) ; ::_thesis: ex y being set st
( y in W & S1[x,y] )
x in Choose (n,(m + 1),1,0) by A5, XBOOLE_0:def_5;
then consider p being XFinSequence of such that
A6: p = x and
A7: dom p = n and
A8: rng p c= {0,1} and
A9: Sum p = m + 1 by CARD_FIN:40;
not p in Domin_0 (n,(m + 1)) by A5, A6, XBOOLE_0:def_5;
then not p is dominated_by_0 by A7, A9, Def2;
then consider o being Nat such that
A10: ( (2 * o) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } & (2 * o) + 1 <= dom p & o = Sum (p | (2 * o)) & p . (2 * o) = 1 ) by A8, Th15;
set q = p | ((2 * o) + 1);
consider r2 being XFinSequence of such that
A11: p = (p | ((2 * o) + 1)) ^ r2 by Th1;
rng (p | ((2 * o) + 1)) c= rng p by RELAT_1:70;
then rng (p | ((2 * o) + 1)) c= {0,1} by A8, XBOOLE_1:1;
then consider r1 being XFinSequence of such that
A12: len (p | ((2 * o) + 1)) = len r1 and
A13: rng r1 c= {0,1} and
A14: for i being Nat st i <= len (p | ((2 * o) + 1)) holds
(Sum ((p | ((2 * o) + 1)) | i)) + (Sum (r1 | i)) = 1 * i and
A15: for i being Nat st i in len (p | ((2 * o) + 1)) holds
r1 . i = 1 - ((p | ((2 * o) + 1)) . i) by Th25;
take R = r1 ^ r2; ::_thesis: ( R in W & S1[x,R] )
len p = (len r1) + (len r2) by A12, A11, AFINSQ_1:17;
then A16: dom R = n by A7, AFINSQ_1:def_3;
rng r2 c= rng p by A11, AFINSQ_1:25;
then rng r2 c= {0,1} by A8, XBOOLE_1:1;
then (rng r1) \/ (rng r2) c= {0,1} by A13, XBOOLE_1:8;
then A17: rng R c= {0,1} by AFINSQ_1:26;
( (p | ((2 * o) + 1)) | (dom (p | ((2 * o) + 1))) = p | ((2 * o) + 1) & r1 | (dom r1) = r1 ) ;
then A18: (Sum (p | ((2 * o) + 1))) + (Sum r1) = 1 * (len (p | ((2 * o) + 1))) by A12, A14;
A19: 2 * o < (2 * o) + 1 by NAT_1:13;
then 2 * o c= (2 * o) + 1 by NAT_1:39;
then A20: (p | ((2 * o) + 1)) | (2 * o) = p | (2 * o) by RELAT_1:74;
A21: (2 * o) + 1 c= dom p by A10, NAT_1:39;
then A22: dom (p | ((2 * o) + 1)) = (2 * o) + 1 by RELAT_1:62;
A23: len (p | ((2 * o) + 1)) = (2 * o) + 1 by A21, RELAT_1:62;
then A24: p | ((2 * o) + 1) = ((p | ((2 * o) + 1)) | (2 * o)) ^ <%((p | ((2 * o) + 1)) . (2 * o))%> by AFINSQ_1:56;
2 * o in (2 * o) + 1 by A19, NAT_1:44;
then (p | ((2 * o) + 1)) . (2 * o) = p . (2 * o) by A23, FUNCT_1:47;
then Sum (p | ((2 * o) + 1)) = (Sum (p | (2 * o))) + (Sum <%(p . (2 * o))%>) by A24, A20, AFINSQ_2:55;
then A25: Sum (p | ((2 * o) + 1)) = o + 1 by A10, AFINSQ_2:53;
m + 1 = (Sum (p | ((2 * o) + 1))) + (Sum r2) by A9, A11, AFINSQ_2:55;
then (Sum r1) + (Sum r2) = ((m + 1) - ((2 * o) + 1)) + (2 * o) by A18, A22, A25;
then Sum (r1 ^ r2) = m by AFINSQ_2:55;
hence R in W by A16, A17, CARD_FIN:40; ::_thesis: S1[x,R]
thus S1[x,R] ::_thesis: verum
proof
let p9 be XFinSequence of ; ::_thesis: for k being Nat st x = p9 & (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p9 | N)) > N } holds
ex r1, r2 being XFinSequence of st
( R = r1 ^ r2 & len r1 = (2 * k) + 1 & len r1 = len (p9 | ((2 * k) + 1)) & p9 = (p9 | ((2 * k) + 1)) ^ r2 & ( for o being Nat st o < (2 * k) + 1 holds
r1 . o = 1 - (p9 . o) ) )
let k be Nat; ::_thesis: ( x = p9 & (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p9 | N)) > N } implies ex r1, r2 being XFinSequence of st
( R = r1 ^ r2 & len r1 = (2 * k) + 1 & len r1 = len (p9 | ((2 * k) + 1)) & p9 = (p9 | ((2 * k) + 1)) ^ r2 & ( for o being Nat st o < (2 * k) + 1 holds
r1 . o = 1 - (p9 . o) ) ) )
assume A26: ( x = p9 & (2 * k) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p9 | N)) > N } ) ; ::_thesis: ex r1, r2 being XFinSequence of st
( R = r1 ^ r2 & len r1 = (2 * k) + 1 & len r1 = len (p9 | ((2 * k) + 1)) & p9 = (p9 | ((2 * k) + 1)) ^ r2 & ( for o being Nat st o < (2 * k) + 1 holds
r1 . o = 1 - (p9 . o) ) )
set q9 = p9 | ((2 * k) + 1);
take r1 ; ::_thesis: ex r2 being XFinSequence of st
( R = r1 ^ r2 & len r1 = (2 * k) + 1 & len r1 = len (p9 | ((2 * k) + 1)) & p9 = (p9 | ((2 * k) + 1)) ^ r2 & ( for o being Nat st o < (2 * k) + 1 holds
r1 . o = 1 - (p9 . o) ) )
take r2 ; ::_thesis: ( R = r1 ^ r2 & len r1 = (2 * k) + 1 & len r1 = len (p9 | ((2 * k) + 1)) & p9 = (p9 | ((2 * k) + 1)) ^ r2 & ( for o being Nat st o < (2 * k) + 1 holds
r1 . o = 1 - (p9 . o) ) )
thus ( R = r1 ^ r2 & len r1 = (2 * k) + 1 & len r1 = len (p9 | ((2 * k) + 1)) & p9 = (p9 | ((2 * k) + 1)) ^ r2 ) by A6, A10, A12, A11, A21, A26, RELAT_1:62; ::_thesis: for o being Nat st o < (2 * k) + 1 holds
r1 . o = 1 - (p9 . o)
thus for i being Nat st i < (2 * k) + 1 holds
r1 . i = 1 - (p9 . i) ::_thesis: verum
proof
let i be Nat; ::_thesis: ( i < (2 * k) + 1 implies r1 . i = 1 - (p9 . i) )
assume i < (2 * k) + 1 ; ::_thesis: r1 . i = 1 - (p9 . i)
then A27: i in len (p | ((2 * o) + 1)) by A6, A10, A22, A26, NAT_1:44;
then r1 . i = 1 - ((p | ((2 * o) + 1)) . i) by A15;
hence r1 . i = 1 - (p9 . i) by A6, A26, A27, FUNCT_1:47; ::_thesis: verum
end;
end;
end;
consider F being Function of ((Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1)))),W such that
A28: for x being set st x in (Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1))) holds
S1[x,F . x] from FUNCT_2:sch_1(A4);
W c= rng F
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in W or x in rng F )
assume x in W ; ::_thesis: x in rng F
then consider p being XFinSequence of such that
A29: p = x and
A30: dom p = n and
A31: rng p c= {0,1} and
A32: Sum p = m by CARD_FIN:40;
set M = { N where N is Element of NAT : 2 * (Sum (p | N)) < N } ;
m < m + 1 by NAT_1:13;
then 2 * m < 2 * (m + 1) by XREAL_1:68;
then 2 * m < n by A1, XXREAL_0:2;
then ( 2 * (Sum (p | n)) < n & n in NAT ) by A30, A32, ORDINAL1:def_12, RELAT_1:69;
then A33: n in { N where N is Element of NAT : 2 * (Sum (p | N)) < N } ;
{ N where N is Element of NAT : 2 * (Sum (p | N)) < N } c= NAT
proof
let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in { N where N is Element of NAT : 2 * (Sum (p | N)) < N } or y in NAT )
assume y in { N where N is Element of NAT : 2 * (Sum (p | N)) < N } ; ::_thesis: y in NAT
then ex i being Element of NAT st
( i = y & 2 * (Sum (p | i)) < i ) ;
hence y in NAT ; ::_thesis: verum
end;
then reconsider M = { N where N is Element of NAT : 2 * (Sum (p | N)) < N } as non empty Subset of NAT by A33;
ex k being Nat st
( (2 * k) + 1 = min* M & Sum (p | ((2 * k) + 1)) = k & (2 * k) + 1 <= dom p )
proof
set mm = min* M;
min* M in M by NAT_1:def_1;
then A34: ex o being Element of NAT st
( min* M = o & 2 * (Sum (p | o)) < o ) ;
then reconsider m1 = (min* M) - 1 as Element of NAT by NAT_1:20;
A35: 2 * (Sum (p | (min* M))) < m1 + 1 by A34;
A36: m1 < m1 + 1 by NAT_1:13;
then m1 c= min* M by NAT_1:39;
then A37: (p | (min* M)) | m1 = p | m1 by RELAT_1:74;
min* M <= dom p by A30, A33, NAT_1:def_1;
then A38: min* M c= dom p by NAT_1:39;
then dom (p | (min* M)) = min* M by RELAT_1:62;
then m1 in dom (p | (min* M)) by A36, NAT_1:44;
then A39: (p | (min* M)) . m1 = p . m1 by FUNCT_1:47;
m1 < m1 + 1 by NAT_1:13;
then not m1 in M by NAT_1:def_1;
then 2 * (Sum (p | m1)) >= m1 ;
then A40: ( Sum <%(p . m1)%> = p . m1 & (2 * (Sum (p | m1))) + (2 * (p . m1)) >= m1 + 0 ) by AFINSQ_2:53, XREAL_1:7;
reconsider S = Sum (p | (min* M)) as Element of NAT by ORDINAL1:def_12;
take S ; ::_thesis: ( (2 * S) + 1 = min* M & Sum (p | ((2 * S) + 1)) = S & (2 * S) + 1 <= dom p )
A41: min* M <= dom p by A30, A33, NAT_1:def_1;
len (p | (min* M)) = m1 + 1 by A38, RELAT_1:62;
then p | (min* M) = ((p | (min* M)) | m1) ^ <%((p | (min* M)) . m1)%> by AFINSQ_1:56;
then Sum (p | (min* M)) = (Sum (p | m1)) + (Sum <%(p . m1)%>) by A39, A37, AFINSQ_2:55;
hence ( (2 * S) + 1 = min* M & Sum (p | ((2 * S) + 1)) = S & (2 * S) + 1 <= dom p ) by A41, A40, A35, NAT_1:9; ::_thesis: verum
end;
then consider k being Nat such that
A42: (2 * k) + 1 = min* M and
A43: Sum (p | ((2 * k) + 1)) = k and
A44: (2 * k) + 1 <= dom p ;
set k1 = (2 * k) + 1;
consider q being XFinSequence of such that
A45: p = (p | ((2 * k) + 1)) ^ q by Th1;
rng (p | ((2 * k) + 1)) c= rng p by RELAT_1:70;
then rng (p | ((2 * k) + 1)) c= {0,1} by A31, XBOOLE_1:1;
then consider r being XFinSequence of such that
A46: len r = len (p | ((2 * k) + 1)) and
A47: rng r c= {0,1} and
A48: for i being Nat st i <= len (p | ((2 * k) + 1)) holds
(Sum ((p | ((2 * k) + 1)) | i)) + (Sum (r | i)) = 1 * i and
A49: for i being Nat st i in len (p | ((2 * k) + 1)) holds
r . i = 1 - ((p | ((2 * k) + 1)) . i) by Th25;
set rq = r ^ q;
A50: dom (r ^ q) = (len (p | ((2 * k) + 1))) + (len q) by A46, AFINSQ_1:def_3;
A51: m = k + (Sum q) by A32, A43, A45, AFINSQ_2:55;
dom (r ^ q) = (len (p | ((2 * k) + 1))) + (len q) by A46, AFINSQ_1:def_3;
then A52: dom (r ^ q) = dom p by A45, AFINSQ_1:def_3;
( (p | ((2 * k) + 1)) | (dom (p | ((2 * k) + 1))) = p | ((2 * k) + 1) & r | (dom r) = r ) ;
then A53: (Sum (p | ((2 * k) + 1))) + (Sum r) = 1 * (len (p | ((2 * k) + 1))) by A46, A48;
rng q c= rng p by A45, AFINSQ_1:25;
then rng q c= {0,1} by A31, XBOOLE_1:1;
then (rng r) \/ (rng q) c= {0,1} by A47, XBOOLE_1:8;
then A54: rng (r ^ q) c= {0,1} by AFINSQ_1:26;
A55: (2 * k) + 1 c= dom p by A44, NAT_1:39;
then A56: len (p | ((2 * k) + 1)) = (2 * k) + 1 by RELAT_1:62;
then A57: (r ^ q) | ((2 * k) + 1) = r by A46, AFINSQ_1:57;
A58: ((2 * k) + 1) + 1 > (2 * k) + 1 by NAT_1:13;
then A59: (2 * k) + 1 < 2 * (Sum r) by A43, A53, A56;
A60: 2 * (Sum r) > (2 * k) + 1 by A43, A53, A56, A58;
then consider j being Nat such that
A61: ( (2 * j) + 1 = min* { N where N is Element of NAT : 2 * (Sum ((r ^ q) | N)) > N } & (2 * j) + 1 <= dom (r ^ q) & j = Sum ((r ^ q) | (2 * j)) & (r ^ q) . (2 * j) = 1 ) by A54, A57, Th2, Th15;
set j1 = (2 * j) + 1;
A62: len ((p | ((2 * k) + 1)) ^ q) = (len (p | ((2 * k) + 1))) + (len q) by AFINSQ_1:def_3;
not r ^ q is dominated_by_0 by A60, A57, Th2;
then A63: not r ^ q in Domin_0 (n,(m + 1)) by Th20;
set rqj = (r ^ q) | ((2 * j) + 1);
Sum (r ^ q) = (Sum r) + (Sum q) by AFINSQ_2:55;
then r ^ q in Choose (n,(m + 1),1,0) by A30, A43, A53, A56, A52, A54, A51, CARD_FIN:40;
then A64: r ^ q in (Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1))) by A63, XBOOLE_0:def_5;
then consider r1, r2 being XFinSequence of such that
A65: F . (r ^ q) = r1 ^ r2 and
A66: len r1 = (2 * j) + 1 and
A67: ( len r1 = len ((r ^ q) | ((2 * j) + 1)) & r ^ q = ((r ^ q) | ((2 * j) + 1)) ^ r2 ) and
A68: for i being Nat st i < (2 * j) + 1 holds
r1 . i = 1 - ((r ^ q) . i) by A28, A61;
A69: dom (r ^ q) = (len r1) + (len r2) by A67, AFINSQ_1:def_3;
then A70: len (r1 ^ r2) = len ((p | ((2 * k) + 1)) ^ q) by A50, A62, AFINSQ_1:17;
reconsider K = { N where N is Element of NAT : 2 * (Sum ((r ^ q) | N)) > N } as non empty Subset of NAT by A61, NAT_1:def_1;
(r ^ q) | ((2 * k) + 1) = r by A46, A56, AFINSQ_1:57;
then (2 * k) + 1 in K by A59;
then A71: (2 * k) + 1 >= (2 * j) + 1 by A61, NAT_1:def_1;
then (2 * j) + 1 c= (2 * k) + 1 by NAT_1:39;
then A72: (p | ((2 * k) + 1)) | ((2 * j) + 1) = p | ((2 * j) + 1) by RELAT_1:74;
(2 * j) + 1 in K by A61, NAT_1:def_1;
then A73: ex N being Element of NAT st
( N = (2 * j) + 1 & 2 * (Sum ((r ^ q) | N)) > N ) ;
(Sum ((p | ((2 * k) + 1)) | ((2 * j) + 1))) + (Sum (r | ((2 * j) + 1))) = ((2 * j) + 1) * 1 by A48, A56, A71;
then 2 * (Sum (r | ((2 * j) + 1))) = (2 * ((2 * j) + 1)) - (2 * (Sum (p | ((2 * j) + 1)))) by A72;
then ((2 * j) + 1) + (((2 * j) + 1) - (2 * (Sum (p | ((2 * j) + 1))))) > (2 * (Sum (p | ((2 * j) + 1)))) + (((2 * j) + 1) - (2 * (Sum (p | ((2 * j) + 1))))) by A46, A56, A71, A73, AFINSQ_1:58;
then (2 * j) + 1 > 2 * (Sum (p | ((2 * j) + 1))) by XREAL_1:6;
then (2 * j) + 1 in M ;
then (2 * j) + 1 >= (2 * k) + 1 by A42, NAT_1:def_1;
then A74: (2 * j) + 1 = (2 * k) + 1 by A71, XXREAL_0:1;
A75: len ((p | ((2 * k) + 1)) ^ q) = len (r ^ q) by A50, AFINSQ_1:def_3;
now__::_thesis:_for_i_being_Nat_st_i_<_len_(r1_^_r2)_holds_
(r1_^_r2)_._i_=_((p_|_((2_*_k)_+_1))_^_q)_._i
let i be Nat; ::_thesis: ( i < len (r1 ^ r2) implies (r1 ^ r2) . i = ((p | ((2 * k) + 1)) ^ q) . i )
assume A76: i < len (r1 ^ r2) ; ::_thesis: (r1 ^ r2) . i = ((p | ((2 * k) + 1)) ^ q) . i
now__::_thesis:_(r1_^_r2)_._i_=_((p_|_((2_*_k)_+_1))_^_q)_._i
percases ( i < len r1 or i >= len r1 ) ;
supposeA77: i < len r1 ; ::_thesis: (r1 ^ r2) . i = ((p | ((2 * k) + 1)) ^ q) . i
then A78: ( i in dom r1 & r1 . i = 1 - ((r ^ q) . i) ) by A66, A68, NAT_1:44;
A79: i in len r1 by A77, NAT_1:44;
A80: ( len r1 = len (p | ((2 * k) + 1)) & i in NAT ) by A55, A66, A74, ORDINAL1:def_12, RELAT_1:62;
then A81: r . i = 1 - ((p | ((2 * k) + 1)) . i) by A49, A79;
( ((p | ((2 * k) + 1)) ^ q) . i = (p | ((2 * k) + 1)) . i & (r ^ q) . i = r . i ) by A46, A79, A80, AFINSQ_1:def_3;
hence (r1 ^ r2) . i = ((p | ((2 * k) + 1)) ^ q) . i by A81, A78, AFINSQ_1:def_3; ::_thesis: verum
end;
supposeA82: i >= len r1 ; ::_thesis: (r1 ^ r2) . i = ((p | ((2 * k) + 1)) ^ q) . i
then A83: ((p | ((2 * k) + 1)) ^ q) . i = q . (i - (len r)) by A46, A56, A66, A74, A70, A76, AFINSQ_1:19;
( (r1 ^ r2) . i = r2 . (i - (len r1)) & (r ^ q) . i = q . (i - (len r)) ) by A46, A56, A66, A74, A70, A75, A76, A82, AFINSQ_1:19;
hence (r1 ^ r2) . i = ((p | ((2 * k) + 1)) ^ q) . i by A67, A70, A75, A76, A82, A83, AFINSQ_1:19; ::_thesis: verum
end;
end;
end;
hence (r1 ^ r2) . i = ((p | ((2 * k) + 1)) ^ q) . i ; ::_thesis: verum
end;
then A84: r1 ^ r2 = (p | ((2 * k) + 1)) ^ q by A69, A50, A62, AFINSQ_1:9, AFINSQ_1:17;
r ^ q in dom F by A64, FUNCT_2:def_1;
hence x in rng F by A29, A45, A65, A84, FUNCT_1:3; ::_thesis: verum
end;
then A85: rng F = W by XBOOLE_0:def_10;
A86: F is one-to-one
proof
let x be set ; :: according to FUNCT_1:def_4 ::_thesis: for b1 being set holds
( not x in dom F or not b1 in dom F or not F . x = F . b1 or x = b1 )
let y be set ; ::_thesis: ( not x in dom F or not y in dom F or not F . x = F . y or x = y )
assume that
A87: x in dom F and
A88: y in dom F and
A89: F . x = F . y ; ::_thesis: x = y
x in Choose (n,(m + 1),1,0) by A87, XBOOLE_0:def_5;
then consider p being XFinSequence of such that
A90: p = x and
A91: dom p = n and
A92: rng p c= {0,1} and
A93: Sum p = m + 1 by CARD_FIN:40;
not p in Domin_0 (n,(m + 1)) by A87, A90, XBOOLE_0:def_5;
then not p is dominated_by_0 by A91, A93, Def2;
then consider k1 being Nat such that
A94: ( (2 * k1) + 1 = min* { N where N is Element of NAT : 2 * (Sum (p | N)) > N } & (2 * k1) + 1 <= dom p & k1 = Sum (p | (2 * k1)) & p . (2 * k1) = 1 ) by A92, Th15;
y in Choose (n,(m + 1),1,0) by A88, XBOOLE_0:def_5;
then consider q being XFinSequence of such that
A95: q = y and
A96: dom q = n and
A97: rng q c= {0,1} and
A98: Sum q = m + 1 by CARD_FIN:40;
not q in Domin_0 (n,(m + 1)) by A88, A95, XBOOLE_0:def_5;
then not q is dominated_by_0 by A96, A98, Def2;
then consider k2 being Nat such that
A99: ( (2 * k2) + 1 = min* { N where N is Element of NAT : 2 * (Sum (q | N)) > N } & (2 * k2) + 1 <= dom q & k2 = Sum (q | (2 * k2)) & q . (2 * k2) = 1 ) by A97, Th15;
A100: len q = n by A96;
reconsider M = { N where N is Element of NAT : 2 * (Sum (q | N)) > N } as non empty Subset of NAT by A99, NAT_1:def_1;
set qk = q | ((2 * k2) + 1);
consider s1, s2 being XFinSequence of such that
A101: F . y = s1 ^ s2 and
A102: len s1 = (2 * k2) + 1 and
A103: len s1 = len (q | ((2 * k2) + 1)) and
A104: q = (q | ((2 * k2) + 1)) ^ s2 and
A105: for i being Nat st i < (2 * k2) + 1 holds
s1 . i = 1 - (q . i) by A28, A88, A95, A99;
A106: len q = (len (q | ((2 * k2) + 1))) + (len s2) by A104, AFINSQ_1:17;
then A107: len q = len (s1 ^ s2) by A103, AFINSQ_1:17;
reconsider K = { N where N is Element of NAT : 2 * (Sum (p | N)) > N } as non empty Subset of NAT by A94, NAT_1:def_1;
set pk = p | ((2 * k1) + 1);
consider r1, r2 being XFinSequence of such that
A108: F . x = r1 ^ r2 and
A109: len r1 = (2 * k1) + 1 and
A110: len r1 = len (p | ((2 * k1) + 1)) and
A111: p = (p | ((2 * k1) + 1)) ^ r2 and
A112: for i being Nat st i < (2 * k1) + 1 holds
r1 . i = 1 - (p . i) by A28, A87, A90, A94;
assume x <> y ; ::_thesis: contradiction
then consider i being Nat such that
A113: i < len p and
A114: p . i <> q . i by A90, A91, A95, A96, A106, AFINSQ_1:9;
A115: len p = (len (p | ((2 * k1) + 1))) + (len r2) by A111, AFINSQ_1:17;
then A116: len p = len (r1 ^ r2) by A110, AFINSQ_1:17;
now__::_thesis:_contradiction
percases ( k1 = k2 or k1 > k2 or k1 < k2 ) by XXREAL_0:1;
supposeA117: k1 = k2 ; ::_thesis: contradiction
now__::_thesis:_contradiction
percases ( i < len (p | ((2 * k1) + 1)) or i >= len (p | ((2 * k1) + 1)) ) ;
supposeA118: i < len (p | ((2 * k1) + 1)) ; ::_thesis: contradiction
then i in len (p | ((2 * k1) + 1)) by NAT_1:44;
then A119: ( r1 . i = (r1 ^ r2) . i & s1 . i = (s1 ^ s2) . i ) by A109, A110, A102, A117, AFINSQ_1:def_3;
( r1 . i = 1 - (p . i) & s1 . i = 1 - (q . i) ) by A109, A110, A112, A105, A117, A118;
hence contradiction by A89, A108, A101, A114, A119; ::_thesis: verum
end;
supposeA120: i >= len (p | ((2 * k1) + 1)) ; ::_thesis: contradiction
then A121: (s1 ^ s2) . i = s2 . (i - (len (p | ((2 * k1) + 1)))) by A91, A109, A110, A96, A102, A107, A113, A117, AFINSQ_1:19;
( p . i = r2 . (i - (len (p | ((2 * k1) + 1)))) & q . i = s2 . (i - (len (p | ((2 * k1) + 1)))) ) by A91, A109, A110, A111, A102, A103, A104, A100, A113, A117, A120, AFINSQ_1:19;
hence contradiction by A89, A108, A110, A101, A116, A113, A114, A120, A121, AFINSQ_1:19; ::_thesis: verum
end;
end;
end;
hence contradiction ; ::_thesis: verum
end;
supposeA122: k1 > k2 ; ::_thesis: contradiction
len s1 <= len p by A91, A96, A103, A106, NAT_1:11;
then A123: len s1 c= dom p by NAT_1:39;
2 * k2 < 2 * k1 by A122, XREAL_1:68;
then A124: len s1 < len r1 by A109, A102, XREAL_1:6;
then (s1 ^ s2) | (len s1) = r1 | (len s1) by A89, A108, A101, AFINSQ_1:58;
then A125: s1 = r1 | (len s1) by AFINSQ_1:57;
A126: for k being Nat st k < len (q | ((2 * k2) + 1)) holds
(q | ((2 * k2) + 1)) . k = (p | (len (q | ((2 * k2) + 1)))) . k
proof
let k be Nat; ::_thesis: ( k < len (q | ((2 * k2) + 1)) implies (q | ((2 * k2) + 1)) . k = (p | (len (q | ((2 * k2) + 1)))) . k )
assume A127: k < len (q | ((2 * k2) + 1)) ; ::_thesis: (q | ((2 * k2) + 1)) . k = (p | (len (q | ((2 * k2) + 1)))) . k
A128: k in len s1 by A103, A127, NAT_1:44;
then A129: k in (dom q) /\ (len s1) by A91, A96, A123, XBOOLE_0:def_4;
k in (dom p) /\ (len s1) by A123, A128, XBOOLE_0:def_4;
then A130: p . k = (p | (len (q | ((2 * k2) + 1)))) . k by A103, FUNCT_1:48;
A131: k < len r1 by A103, A124, A127, XXREAL_0:2;
then A132: r1 . k = 1 - (p . k) by A109, A112;
k in dom r1 by A131, NAT_1:44;
then k in (dom r1) /\ (len s1) by A128, XBOOLE_0:def_4;
then A133: r1 . k = (r1 | (len s1)) . k by FUNCT_1:48;
s1 . k = 1 - (q . k) by A102, A103, A105, A127;
hence (q | ((2 * k2) + 1)) . k = (p | (len (q | ((2 * k2) + 1)))) . k by A102, A125, A132, A133, A129, A130, FUNCT_1:48; ::_thesis: verum
end;
(2 * k2) + 1 in M by A99, NAT_1:def_1;
then A134: ex N being Element of NAT st
( (2 * k2) + 1 = N & 2 * (Sum (q | N)) > N ) ;
len (q | ((2 * k2) + 1)) = len (p | (len (q | ((2 * k2) + 1)))) by A103, A123, RELAT_1:62;
then q | ((2 * k2) + 1) = p | (len (q | ((2 * k2) + 1))) by A126, AFINSQ_1:9;
then len (q | ((2 * k2) + 1)) in K by A102, A103, A134;
hence contradiction by A94, A109, A103, A124, NAT_1:def_1; ::_thesis: verum
end;
supposeA135: k1 < k2 ; ::_thesis: contradiction
len r1 <= len q by A91, A110, A96, A115, NAT_1:11;
then A136: len r1 c= dom q by NAT_1:39;
2 * k1 < 2 * k2 by A135, XREAL_1:68;
then A137: len r1 < len s1 by A109, A102, XREAL_1:6;
then (r1 ^ r2) | (len r1) = s1 | (len r1) by A89, A108, A101, AFINSQ_1:58;
then A138: r1 = s1 | (len r1) by AFINSQ_1:57;
A139: for k being Nat st k < len (p | ((2 * k1) + 1)) holds
(p | ((2 * k1) + 1)) . k = (q | (len (p | ((2 * k1) + 1)))) . k
proof
let k be Nat; ::_thesis: ( k < len (p | ((2 * k1) + 1)) implies (p | ((2 * k1) + 1)) . k = (q | (len (p | ((2 * k1) + 1)))) . k )
assume A140: k < len (p | ((2 * k1) + 1)) ; ::_thesis: (p | ((2 * k1) + 1)) . k = (q | (len (p | ((2 * k1) + 1)))) . k
A141: k in len r1 by A110, A140, NAT_1:44;
then A142: k in (dom p) /\ (len r1) by A91, A96, A136, XBOOLE_0:def_4;
k in (dom q) /\ (len r1) by A136, A141, XBOOLE_0:def_4;
then A143: q . k = (q | (len (p | ((2 * k1) + 1)))) . k by A110, FUNCT_1:48;
A144: k < len s1 by A110, A137, A140, XXREAL_0:2;
then A145: s1 . k = 1 - (q . k) by A102, A105;
k in dom s1 by A144, NAT_1:44;
then k in (dom s1) /\ (len r1) by A141, XBOOLE_0:def_4;
then A146: s1 . k = (s1 | (len r1)) . k by FUNCT_1:48;
r1 . k = 1 - (p . k) by A109, A110, A112, A140;
hence (p | ((2 * k1) + 1)) . k = (q | (len (p | ((2 * k1) + 1)))) . k by A109, A138, A145, A146, A142, A143, FUNCT_1:48; ::_thesis: verum
end;
(2 * k1) + 1 in K by A94, NAT_1:def_1;
then A147: ex N being Element of NAT st
( (2 * k1) + 1 = N & 2 * (Sum (p | N)) > N ) ;
len (p | ((2 * k1) + 1)) = len (q | (len (p | ((2 * k1) + 1)))) by A110, A136, RELAT_1:62;
then p | ((2 * k1) + 1) = q | (len (p | ((2 * k1) + 1))) by A139, AFINSQ_1:9;
then len (p | ((2 * k1) + 1)) in M by A109, A110, A147;
hence contradiction by A110, A99, A102, A137, NAT_1:def_1; ::_thesis: verum
end;
end;
end;
hence contradiction ; ::_thesis: verum
end;
dom F = (Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1))) by FUNCT_2:def_1;
then (Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1))),W are_equipotent by A86, A85, WELLORD2:def_4;
hence card ((Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1)))) = card (Choose (n,m,1,0)) by CARD_1:5; ::_thesis: verum
end;
theorem Th28: :: CATALAN2:28
for m, n being Nat st 2 * (m + 1) <= n holds
card (Domin_0 (n,(m + 1))) = (n choose (m + 1)) - (n choose m)
proof
let m, n be Nat; ::_thesis: ( 2 * (m + 1) <= n implies card (Domin_0 (n,(m + 1))) = (n choose (m + 1)) - (n choose m) )
set CH = Choose (n,(m + 1),1,0);
set Z = Domin_0 (n,(m + 1));
set W = Choose (n,m,1,0);
A1: ( card (Choose (n,(m + 1),1,0)) = (card n) choose (m + 1) & card n = n ) by CARD_1:def_2, CARD_FIN:16;
card ((Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1)))) = (card (Choose (n,(m + 1),1,0))) - (card (Domin_0 (n,(m + 1)))) by Th21, CARD_2:44;
then A2: card (Domin_0 (n,(m + 1))) = (card (Choose (n,(m + 1),1,0))) - (card ((Choose (n,(m + 1),1,0)) \ (Domin_0 (n,(m + 1))))) ;
assume 2 * (m + 1) <= n ; ::_thesis: card (Domin_0 (n,(m + 1))) = (n choose (m + 1)) - (n choose m)
then card (Domin_0 (n,(m + 1))) = (card (Choose (n,(m + 1),1,0))) - (card (Choose (n,m,1,0))) by A2, Th27;
hence card (Domin_0 (n,(m + 1))) = (n choose (m + 1)) - (n choose m) by A1, CARD_FIN:16; ::_thesis: verum
end;
theorem Th29: :: CATALAN2:29
for m, n being Nat st 2 * m <= n holds
card (Domin_0 (n,m)) = (((n + 1) - (2 * m)) / ((n + 1) - m)) * (n choose m)
proof
let m, n be Nat; ::_thesis: ( 2 * m <= n implies card (Domin_0 (n,m)) = (((n + 1) - (2 * m)) / ((n + 1) - m)) * (n choose m) )
assume A1: 2 * m <= n ; ::_thesis: card (Domin_0 (n,m)) = (((n + 1) - (2 * m)) / ((n + 1) - m)) * (n choose m)
now__::_thesis:_card_(Domin_0_(n,m))_=_(((n_+_1)_-_(2_*_m))_/_((n_+_1)_-_m))_*_(n_choose_m)
percases ( m = 0 or m > 0 ) ;
supposeA2: m = 0 ; ::_thesis: card (Domin_0 (n,m)) = (((n + 1) - (2 * m)) / ((n + 1) - m)) * (n choose m)
then n choose m = 1 by NEWTON:19;
then (((n + 1) - (2 * m)) / ((n + 1) - m)) * (n choose m) = 1 by A2, XCMPLX_1:60;
hence card (Domin_0 (n,m)) = (((n + 1) - (2 * m)) / ((n + 1) - m)) * (n choose m) by A2, Th24; ::_thesis: verum
end;
supposeA3: m > 0 ; ::_thesis: card (Domin_0 (n,m)) = (((n + 1) - (2 * m)) / ((n + 1) - m)) * (n choose m)
A4: m <= m + m by NAT_1:11;
then reconsider nm = n - m as Element of NAT by A1, NAT_1:21, XXREAL_0:2;
reconsider m1 = m - 1 as Element of NAT by A3, NAT_1:20;
set n9 = n ! ;
set m9 = m ! ;
set nm19 = (nm + 1) ! ;
set nm9 = nm ! ;
m <= n by A1, A4, XXREAL_0:2;
then A5: n choose m = (n !) / ((m !) * (nm !)) by NEWTON:def_3;
A6: 2 * (m1 + 1) <= n by A1;
set m19 = m1 ! ;
A7: 1 / ((m1 !) * ((nm + 1) !)) = ((m1 + 1) * 1) / (((m1 !) * ((nm + 1) !)) * (m1 + 1)) by XCMPLX_1:91
.= m / (((nm + 1) !) * ((m1 !) * (m1 + 1)))
.= m / (((nm + 1) !) * ((m1 + 1) !)) by NEWTON:15
.= - ((- m) / (((nm + 1) !) * (m !))) by XCMPLX_1:190 ;
1 / ((m !) * (nm !)) = ((nm + 1) * 1) / (((m !) * (nm !)) * (nm + 1)) by XCMPLX_1:91
.= (nm + 1) / ((m !) * ((nm !) * (nm + 1)))
.= (nm + 1) / ((m !) * ((nm + 1) !)) by NEWTON:15 ;
then A8: (1 / ((m !) * (nm !))) - (1 / ((m1 !) * ((nm + 1) !))) = ((nm + 1) / ((m !) * ((nm + 1) !))) + ((- m) / ((m !) * ((nm + 1) !))) by A7
.= ((nm + 1) + (- m)) / ((m !) * ((nm + 1) !)) by XCMPLX_1:62
.= ((n + 1) - (2 * m)) / ((m !) * ((nm !) * (nm + 1))) by NEWTON:15
.= (1 * ((n + 1) - (2 * m))) / (((m !) * (nm !)) * (nm + 1))
.= (1 / ((m !) * (nm !))) * (((n + 1) - (2 * m)) / (nm + 1)) by XCMPLX_1:76 ;
m1 <= m1 + ((1 + m1) + 1) by NAT_1:11;
then A9: m1 <= n by A1, XXREAL_0:2;
n - m1 = nm + 1 ;
then A10: n choose m1 = (n !) / ((m1 !) * ((nm + 1) !)) by A9, NEWTON:def_3;
((n !) / ((m !) * (nm !))) - ((n !) / ((m1 !) * ((nm + 1) !))) = ((n !) * (1 / ((m !) * (nm !)))) - ((n !) / ((m1 !) * ((nm + 1) !))) by XCMPLX_1:99
.= ((n !) * (1 / ((m !) * (nm !)))) - ((n !) * (1 / ((m1 !) * ((nm + 1) !)))) by XCMPLX_1:99
.= (n !) * ((1 / ((m !) * (nm !))) - (1 / ((m1 !) * ((nm + 1) !))))
.= (n !) * ((1 / ((m !) * (nm !))) * (((n + 1) - (2 * m)) / (nm + 1))) by A8
.= ((n !) * (1 / ((m !) * (nm !)))) * (((n + 1) - (2 * m)) / (nm + 1))
.= (((n !) * 1) / ((m !) * (nm !))) * (((n + 1) - (2 * m)) / (nm + 1)) by XCMPLX_1:74 ;
hence card (Domin_0 (n,m)) = (((n + 1) - (2 * m)) / ((n + 1) - m)) * (n choose m) by A5, A10, A6, Th28; ::_thesis: verum
end;
end;
end;
hence card (Domin_0 (n,m)) = (((n + 1) - (2 * m)) / ((n + 1) - m)) * (n choose m) ; ::_thesis: verum
end;
theorem Th30: :: CATALAN2:30
for k being Nat holds card (Domin_0 ((2 + k),1)) = k + 1
proof
let k be Nat; ::_thesis: card (Domin_0 ((2 + k),1)) = k + 1
card (Domin_0 ((2 + k),1)) = ((((2 + k) + 1) - (2 * 1)) / (((2 + k) + 1) - 1)) * ((2 + k) choose 1) by Th29, NAT_1:11
.= ((k + 1) / (2 + k)) * (2 + k) by STIRL2_1:51
.= k + 1 by XCMPLX_1:87 ;
hence card (Domin_0 ((2 + k),1)) = k + 1 ; ::_thesis: verum
end;
theorem :: CATALAN2:31
for k being Nat holds card (Domin_0 ((4 + k),2)) = ((k + 1) * (k + 4)) / 2
proof
let k be Nat; ::_thesis: card (Domin_0 ((4 + k),2)) = ((k + 1) * (k + 4)) / 2
card (Domin_0 ((4 + k),2)) = ((((4 + k) + 1) - (2 * 2)) / (((4 + k) + 1) - 2)) * ((4 + k) choose 2) by Th29, NAT_1:11
.= ((k + 1) / (k + 3)) * (((4 + k) * ((4 + k) - 1)) / 2) by STIRL2_1:51
.= ((((k + 1) / (k + 3)) * (3 + k)) * (4 + k)) / 2
.= ((k + 1) * (4 + k)) / 2 by XCMPLX_1:87 ;
hence card (Domin_0 ((4 + k),2)) = ((k + 1) * (k + 4)) / 2 ; ::_thesis: verum
end;
theorem :: CATALAN2:32
for k being Nat holds card (Domin_0 ((6 + k),3)) = (((k + 1) * (k + 5)) * (k + 6)) / 6
proof
let k be Nat; ::_thesis: card (Domin_0 ((6 + k),3)) = (((k + 1) * (k + 5)) * (k + 6)) / 6
card (Domin_0 ((6 + k),3)) = ((((6 + k) + 1) - (2 * 3)) / (((6 + k) + 1) - 3)) * ((6 + k) choose 3) by Th29, NAT_1:11
.= ((k + 1) / (k + 4)) * ((((6 + k) * ((6 + k) - 1)) * ((6 + k) - 2)) / 6) by STIRL2_1:51
.= (((((k + 1) / (k + 4)) * (4 + k)) * (5 + k)) * (6 + k)) / 6
.= (((k + 1) * (5 + k)) * (6 + k)) / 6 by XCMPLX_1:87 ;
hence card (Domin_0 ((6 + k),3)) = (((k + 1) * (k + 5)) * (k + 6)) / 6 ; ::_thesis: verum
end;
theorem Th33: :: CATALAN2:33
for n being Nat holds card (Domin_0 ((2 * n),n)) = ((2 * n) choose n) / (n + 1)
proof
let n be Nat; ::_thesis: card (Domin_0 ((2 * n),n)) = ((2 * n) choose n) / (n + 1)
card (Domin_0 ((2 * n),n)) = ((((2 * n) + 1) - (2 * n)) / (((2 * n) + 1) - n)) * ((2 * n) choose n) by Th29
.= (1 * ((2 * n) choose n)) / (n + 1) by XCMPLX_1:74 ;
hence card (Domin_0 ((2 * n),n)) = ((2 * n) choose n) / (n + 1) ; ::_thesis: verum
end;
theorem Th34: :: CATALAN2:34
for n being Nat holds card (Domin_0 ((2 * n),n)) = Catalan (n + 1)
proof
let n be Nat; ::_thesis: card (Domin_0 ((2 * n),n)) = Catalan (n + 1)
A1: Catalan (n + 1) = (((2 * (n + 1)) -' 2) choose ((n + 1) -' 1)) / (n + 1) by CATALAN1:def_1;
( ((2 * n) + 2) -' 2 = ((2 * n) + 2) - 2 & (n + 1) -' 1 = (n + 1) - 1 ) by XREAL_0:def_2;
hence card (Domin_0 ((2 * n),n)) = Catalan (n + 1) by A1, Th33; ::_thesis: verum
end;
definition
let D be set ;
mode OMEGA of D -> non empty functional set means :Def3: :: CATALAN2:def 3
for x being set st x in it holds
x is XFinSequence of ;
existence
ex b1 being non empty functional set st
for x being set st x in b1 holds
x is XFinSequence of
proof
reconsider D9OMEGA = D ^omega as non empty functional set ;
take D9OMEGA ; ::_thesis: for x being set st x in D9OMEGA holds
x is XFinSequence of
thus for x being set st x in D9OMEGA holds
x is XFinSequence of by AFINSQ_1:def_7; ::_thesis: verum
end;
end;
:: deftheorem Def3 defines OMEGA CATALAN2:def_3_:_
for D being set
for b2 being non empty functional set holds
( b2 is OMEGA of D iff for x being set st x in b2 holds
x is XFinSequence of );
definition
let D be set ;
:: original: ^omega
redefine funcD ^omega -> OMEGA of D;
coherence
D ^omega is OMEGA of D
proof
( D ^omega is functional & ( for x being set st x in D ^omega holds
x is XFinSequence of ) ) by AFINSQ_1:def_7;
hence D ^omega is OMEGA of D by Def3; ::_thesis: verum
end;
end;
registration
let D be set ;
let F be OMEGA of D;
cluster -> T-Sequence-like D -valued finite for Element of F;
coherence
for b1 being Element of F holds
( b1 is finite & b1 is D -valued & b1 is T-Sequence-like ) by Def3;
end;
theorem :: CATALAN2:35
for n being Nat holds card { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) } = (2 * n) choose n
proof
let n be Nat; ::_thesis: card { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) } = (2 * n) choose n
set D = bool ({0,1} ^omega);
set 2n = 2 * n;
defpred S1[ set , set ] means for i being Nat st i = $1 holds
$2 = Domin_0 ((2 * n),i);
set Z = { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) } ;
A1: for k being Nat st k in n + 1 holds
ex x being Element of bool ({0,1} ^omega) st S1[k,x]
proof
let k be Nat; ::_thesis: ( k in n + 1 implies ex x being Element of bool ({0,1} ^omega) st S1[k,x] )
assume k in n + 1 ; ::_thesis: ex x being Element of bool ({0,1} ^omega) st S1[k,x]
reconsider Z = Domin_0 ((2 * n),k) as Element of bool ({0,1} ^omega) ;
take Z ; ::_thesis: S1[k,Z]
thus S1[k,Z] ; ::_thesis: verum
end;
consider r being XFinSequence of such that
A2: ( dom r = n + 1 & ( for k being Nat st k in n + 1 holds
S1[k,r . k] ) ) from STIRL2_1:sch_5(A1);
A3: { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) } c= union (rng r)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) } or x in union (rng r) )
assume x in { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) } ; ::_thesis: x in union (rng r)
then consider pN being Element of NAT ^omega such that
A4: x = pN and
A5: ( dom pN = 2 * n & pN is dominated_by_0 ) ;
pN in Domin_0 ((2 * n),(Sum pN)) by A5, Th20;
then 2 * (Sum pN) <= 2 * n by Th22;
then (1 / 2) * (2 * (Sum pN)) <= (1 / 2) * (2 * n) by XREAL_1:64;
then Sum pN < n + 1 by NAT_1:13;
then A6: Sum pN in n + 1 by NAT_1:44;
then r . (Sum pN) = Domin_0 ((2 * n),(Sum pN)) by A2;
then A7: pN in r . (Sum pN) by A5, Th20;
r . (Sum pN) in rng r by A2, A6, FUNCT_1:3;
hence x in union (rng r) by A4, A7, TARSKI:def_4; ::_thesis: verum
end;
A8: union (rng r) c= { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) }
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in union (rng r) or x in { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) } )
assume x in union (rng r) ; ::_thesis: x in { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) }
then consider y being set such that
A9: x in y and
A10: y in rng r by TARSKI:def_4;
consider i being set such that
A11: i in dom r and
A12: y = r . i by A10, FUNCT_1:def_3;
reconsider i = i as Element of NAT by A11;
y = Domin_0 ((2 * n),i) by A2, A11, A12;
then consider p being XFinSequence of such that
A13: ( p = x & p is dominated_by_0 & dom p = 2 * n ) and
Sum p = i by A9, Def2;
p is Element of NAT ^omega by AFINSQ_1:def_7;
hence x in { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) } by A13; ::_thesis: verum
end;
A14: for i, j being Nat st i in dom r & j in dom r & i <> j holds
r . i misses r . j
proof
let i, j be Nat; ::_thesis: ( i in dom r & j in dom r & i <> j implies r . i misses r . j )
assume that
A15: i in dom r and
A16: j in dom r and
A17: i <> j ; ::_thesis: r . i misses r . j
assume r . i meets r . j ; ::_thesis: contradiction
then (r . i) /\ (r . j) <> {} by XBOOLE_0:def_7;
then consider x being set such that
A18: x in (r . i) /\ (r . j) by XBOOLE_0:def_1;
A19: x in r . j by A18, XBOOLE_0:def_4;
r . j = Domin_0 ((2 * n),j) by A2, A16;
then A20: ex q being XFinSequence of st
( q = x & q is dominated_by_0 & dom q = 2 * n & Sum q = j ) by A19, Def2;
A21: x in r . i by A18, XBOOLE_0:def_4;
r . i = Domin_0 ((2 * n),i) by A2, A15;
then ex p being XFinSequence of st
( p = x & p is dominated_by_0 & dom p = 2 * n & Sum p = i ) by A21, Def2;
hence contradiction by A17, A20; ::_thesis: verum
end;
A22: for i being Nat st i in dom r holds
r . i is finite
proof
let i be Nat; ::_thesis: ( i in dom r implies r . i is finite )
assume i in dom r ; ::_thesis: r . i is finite
then r . i = Domin_0 ((2 * n),i) by A2;
hence r . i is finite ; ::_thesis: verum
end;
consider Cardr being XFinSequence of such that
A23: dom Cardr = dom r and
A24: for i being Nat st i in dom Cardr holds
Cardr . i = card (r . i) and
A25: card (union (rng r)) = Sum Cardr by A22, A14, STIRL2_1:66;
A26: ( n < dom Cardr & Cardr | (n + 1) = Cardr ) by A2, A23, NAT_1:13, RELAT_1:69;
defpred S2[ Nat] means ( $1 < dom Cardr implies Sum (Cardr | ($1 + 1)) = (2 * n) choose $1 );
A27: S2[ 0 ]
proof
0 in n + 1 by NAT_1:44;
then r . 0 = Domin_0 ((2 * n),0) by A2;
then A28: card (r . 0) = 1 by Th24;
A29: 0 in 1 by NAT_1:44;
assume A30: 0 < dom Cardr ; ::_thesis: Sum (Cardr | (0 + 1)) = (2 * n) choose 0
then 1 <= len Cardr by NAT_1:14;
then A31: 1 c= dom Cardr by NAT_1:39;
then A32: len (Cardr | 1) = 1 by RELAT_1:62;
dom (Cardr | 1) = 1 by A31, RELAT_1:62;
then (Cardr | 1) . 0 = Cardr . 0 by A29, FUNCT_1:47;
then A33: Cardr | 1 = <%(Cardr . 0)%> by A32, AFINSQ_1:34;
0 in len Cardr by A30, NAT_1:44;
then Cardr . 0 = card (r . 0) by A24;
then Sum (Cardr | 1) = 1 by A33, A28, AFINSQ_2:53;
hence Sum (Cardr | (0 + 1)) = (2 * n) choose 0 by NEWTON:19; ::_thesis: verum
end;
A34: for i being Nat st S2[i] holds
S2[i + 1]
proof
let i be Nat; ::_thesis: ( S2[i] implies S2[i + 1] )
assume A35: S2[i] ; ::_thesis: S2[i + 1]
set i1 = i + 1;
assume A36: i + 1 < dom Cardr ; ::_thesis: Sum (Cardr | ((i + 1) + 1)) = (2 * n) choose (i + 1)
then A37: i + 1 in dom Cardr by NAT_1:44;
then A38: ( (Sum (Cardr | (i + 1))) + (Cardr . (i + 1)) = Sum (Cardr | ((i + 1) + 1)) & Cardr . (i + 1) = card (r . (i + 1)) ) by A24, AFINSQ_2:65;
i + 1 <= n by A2, A23, A36, NAT_1:13;
then A39: 2 * (i + 1) <= 2 * n by XREAL_1:64;
r . (i + 1) = Domin_0 ((2 * n),(i + 1)) by A2, A23, A37;
then Sum (Cardr | ((i + 1) + 1)) = ((2 * n) choose i) + (((2 * n) choose (i + 1)) - ((2 * n) choose i)) by A35, A36, A38, A39, Th28, NAT_1:13;
hence Sum (Cardr | ((i + 1) + 1)) = (2 * n) choose (i + 1) ; ::_thesis: verum
end;
for i being Nat holds S2[i] from NAT_1:sch_2(A27, A34);
then Sum Cardr = (2 * n) choose n by A26;
hence card { pN where pN is Element of NAT ^omega : ( dom pN = 2 * n & pN is dominated_by_0 ) } = (2 * n) choose n by A25, A3, A8, XBOOLE_0:def_10; ::_thesis: verum
end;
theorem Th36: :: CATALAN2:36
for n, m, k, j, l being Nat st j = n - (2 * (k + 1)) & l = m - (k + 1) holds
card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } = (card (Domin_0 ((2 * k),k))) * (card (Domin_0 (j,l)))
proof
set q1 = 1 --> 1;
set q0 = 1 --> 0;
let n, m, k, j, l be Nat; ::_thesis: ( j = n - (2 * (k + 1)) & l = m - (k + 1) implies card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } = (card (Domin_0 ((2 * k),k))) * (card (Domin_0 (j,l))) )
assume A1: ( j = n - (2 * (k + 1)) & l = m - (k + 1) ) ; ::_thesis: card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } = (card (Domin_0 ((2 * k),k))) * (card (Domin_0 (j,l)))
defpred S1[ set , set ] means ex r1, r2 being XFinSequence of st
( $1 = (((1 --> 0) ^ r1) ^ (1 --> 1)) ^ r2 & len (((1 --> 0) ^ r1) ^ (1 --> 1)) = 2 * (k + 1) & $2 = [r1,r2] );
set Z2 = Domin_0 (j,l);
set Z1 = Domin_0 ((2 * k),k);
set F = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } ;
set 2k1 = 2 * (k + 1);
A2: for x being set st x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } holds
ex y being set st
( y in [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] & S1[x,y] )
proof
A3: ( dom (1 --> 0) = 1 & Sum (1 --> 0) = 0 * 1 ) by AFINSQ_2:58, FUNCOP_1:13;
let x be set ; ::_thesis: ( x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } implies ex y being set st
( y in [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] & S1[x,y] ) )
assume x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } ; ::_thesis: ex y being set st
( y in [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] & S1[x,y] )
then consider pN being Element of NAT ^omega such that
A4: ( pN = x & pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) ;
2 * (k + 1) > 2 * 0 by XREAL_1:68;
then reconsider M = { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } as non empty Subset of NAT by A4, NAT_1:def_1;
consider r2 being XFinSequence of such that
A5: pN = (pN | (2 * (k + 1))) ^ r2 by Th1;
( 2 * (k + 1) > 2 * 0 & pN is dominated_by_0 ) by A4, Th20, XREAL_1:68;
then consider r1 being XFinSequence of such that
A6: pN | (2 * (k + 1)) = ((1 --> 0) ^ r1) ^ (1 --> 1) and
A7: r1 is dominated_by_0 by A4, Th14;
A8: Sum (1 --> 1) = 1 * 1 by AFINSQ_2:58;
2 * (k + 1) in M by A4, NAT_1:def_1;
then A9: ex o being Element of NAT st
( o = 2 * (k + 1) & 2 * (Sum (pN | o)) = o & o > 0 ) ;
then k + 1 = (Sum ((1 --> 0) ^ r1)) + (Sum (1 --> 1)) by A6, AFINSQ_2:55;
then A10: k = (Sum (1 --> 0)) + (Sum r1) by A8, AFINSQ_2:55;
pN is dominated_by_0 by A4, Th20;
then A11: r2 is dominated_by_0 by A5, A9, Th12;
pN is dominated_by_0 by A4, Th20;
then A12: len (pN | (2 * (k + 1))) = 2 * (k + 1) by A9, Th11;
Sum pN = m by A4, Th20;
then A13: m = (k + 1) + (Sum r2) by A5, A9, AFINSQ_2:55;
take [r1,r2] ; ::_thesis: ( [r1,r2] in [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] & S1[x,[r1,r2]] )
A14: dom (1 --> 1) = 1 by FUNCOP_1:13;
dom pN = n by A4, Th20;
then n = (2 * (k + 1)) + (len r2) by A5, A12, AFINSQ_1:def_3;
then A15: r2 in Domin_0 (j,l) by A1, A13, A11, Th20;
2 * (k + 1) = (len ((1 --> 0) ^ r1)) + (len (1 --> 1)) by A6, A12, AFINSQ_1:17;
then (2 * k) + 1 = (len (1 --> 0)) + (len r1) by A14, AFINSQ_1:17;
then r1 in Domin_0 ((2 * k),k) by A7, A10, A3, Th20;
hence ( [r1,r2] in [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] & S1[x,[r1,r2]] ) by A4, A5, A6, A12, A15, ZFMISC_1:def_2; ::_thesis: verum
end;
consider f being Function of { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } ,[:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] such that
A16: for x being set st x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } holds
S1[x,f . x] from FUNCT_2:sch_1(A2);
A17: ( [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] = {} implies { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } = {} )
proof
assume [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] = {} ; ::_thesis: { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } = {}
then ( Domin_0 ((2 * k),k) = {} or Domin_0 (j,l) = {} ) ;
then 2 * l > j by Th22;
then (2 * m) - (2 * (k + 1)) > n - (2 * (k + 1)) by A1;
then A18: 2 * m > n by XREAL_1:9;
assume { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } <> {} ; ::_thesis: contradiction
then consider x being set such that
A19: x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } by XBOOLE_0:def_1;
ex pN being Element of NAT ^omega st
( pN = x & pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) by A19;
hence contradiction by A18, Th22; ::_thesis: verum
end;
then A20: dom f = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } by FUNCT_2:def_1;
A21: rng f = [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):]
proof
A22: ( Sum (1 --> 0) = 1 * 0 & Sum (1 --> 1) = 1 * 1 ) by AFINSQ_2:58;
thus rng f c= [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] ; :: according to XBOOLE_0:def_10 ::_thesis: [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] c= rng f
A23: dom (1 --> 0) = 1 by FUNCOP_1:13;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] or x in rng f )
assume x in [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] ; ::_thesis: x in rng f
then consider x1, x2 being set such that
A24: x1 in Domin_0 ((2 * k),k) and
A25: x2 in Domin_0 (j,l) and
A26: x = [x1,x2] by ZFMISC_1:def_2;
consider p being XFinSequence of such that
A27: p = x1 and
A28: p is dominated_by_0 and
A29: dom p = 2 * k and
A30: Sum p = k by A24, Def2;
consider q being XFinSequence of such that
A31: q = x2 and
A32: q is dominated_by_0 and
A33: dom q = j and
A34: Sum q = l by A25, Def2;
set 0p1 = ((1 --> 0) ^ p) ^ (1 --> 1);
A35: dom ((((1 --> 0) ^ p) ^ (1 --> 1)) ^ q) = (len (((1 --> 0) ^ p) ^ (1 --> 1))) + (len q) by AFINSQ_1:def_3;
( dom (((1 --> 0) ^ p) ^ (1 --> 1)) = (len ((1 --> 0) ^ p)) + (len (1 --> 1)) & dom (1 --> 1) = 1 ) by AFINSQ_1:def_3, FUNCOP_1:13;
then A36: dom (((1 --> 0) ^ p) ^ (1 --> 1)) = ((len (1 --> 0)) + (len p)) + 1 by AFINSQ_1:17;
then ((((1 --> 0) ^ p) ^ (1 --> 1)) ^ q) | ((2 * 1) + (len p)) = ((1 --> 0) ^ p) ^ (1 --> 1) by A23, AFINSQ_1:57;
then A37: min* { N where N is Element of NAT : ( 2 * (Sum (((((1 --> 0) ^ p) ^ (1 --> 1)) ^ q) | N)) = N & N > 0 ) } = (2 * 1) + (len p) by A28, A29, A30, Th16;
1 <= (1 + (len p)) - (2 * (Sum p)) by A29, A30;
then ((1 --> 0) ^ p) ^ (1 --> 1) is dominated_by_0 by A28, Th10;
then A38: (((1 --> 0) ^ p) ^ (1 --> 1)) ^ q is dominated_by_0 by A32, Th7;
A39: (((1 --> 0) ^ p) ^ (1 --> 1)) ^ q is Element of NAT ^omega by AFINSQ_1:def_7;
((1 --> 0) ^ p) ^ (1 --> 1) = (1 --> 0) ^ (p ^ (1 --> 1)) by AFINSQ_1:27;
then Sum (((1 --> 0) ^ p) ^ (1 --> 1)) = (Sum (1 --> 0)) + (Sum (p ^ (1 --> 1))) by AFINSQ_2:55;
then Sum (((1 --> 0) ^ p) ^ (1 --> 1)) = 0 + ((Sum p) + 1) by A22, AFINSQ_2:55;
then Sum ((((1 --> 0) ^ p) ^ (1 --> 1)) ^ q) = (k + 1) + l by A30, A34, AFINSQ_2:55;
then (((1 --> 0) ^ p) ^ (1 --> 1)) ^ q in Domin_0 (n,m) by A1, A29, A33, A38, A36, A23, A35, Th20;
then A40: (((1 --> 0) ^ p) ^ (1 --> 1)) ^ q in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } by A29, A37, A39;
then consider r1, r2 being XFinSequence of such that
A41: (((1 --> 0) ^ p) ^ (1 --> 1)) ^ q = (((1 --> 0) ^ r1) ^ (1 --> 1)) ^ r2 and
A42: len (((1 --> 0) ^ r1) ^ (1 --> 1)) = 2 * (k + 1) and
A43: f . ((((1 --> 0) ^ p) ^ (1 --> 1)) ^ q) = [r1,r2] by A16;
A44: ((((1 --> 0) ^ p) ^ (1 --> 1)) ^ q) | (2 * (k + 1)) = ((1 --> 0) ^ p) ^ (1 --> 1) by A29, A36, A23, AFINSQ_1:57;
then (1 --> 0) ^ p = (1 --> 0) ^ r1 by A41, A42, AFINSQ_1:28, AFINSQ_1:57;
then A45: p = r1 by AFINSQ_1:28;
((((1 --> 0) ^ r1) ^ (1 --> 1)) ^ r2) | (2 * (k + 1)) = ((1 --> 0) ^ r1) ^ (1 --> 1) by A42, AFINSQ_1:57;
then q = r2 by A41, A44, AFINSQ_1:28;
hence x in rng f by A20, A26, A27, A31, A40, A43, A45, FUNCT_1:3; ::_thesis: verum
end;
for x, y being set st x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } & y in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } & f . x = f . y holds
x = y
proof
let x, y be set ; ::_thesis: ( x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } & y in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } & f . x = f . y implies x = y )
assume that
A46: x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } and
A47: y in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } and
A48: f . x = f . y ; ::_thesis: x = y
consider y1, y2 being XFinSequence of such that
A49: y = (((1 --> 0) ^ y1) ^ (1 --> 1)) ^ y2 and
len (((1 --> 0) ^ y1) ^ (1 --> 1)) = 2 * (k + 1) and
A50: f . y = [y1,y2] by A16, A47;
consider x1, x2 being XFinSequence of such that
A51: x = (((1 --> 0) ^ x1) ^ (1 --> 1)) ^ x2 and
len (((1 --> 0) ^ x1) ^ (1 --> 1)) = 2 * (k + 1) and
A52: f . x = [x1,x2] by A16, A46;
x1 = y1 by A48, A52, A50, XTUPLE_0:1;
hence x = y by A48, A51, A52, A49, A50, XTUPLE_0:1; ::_thesis: verum
end;
then f is one-to-one by A17, FUNCT_2:19;
then { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } ,[:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] are_equipotent by A20, A21, WELLORD2:def_4;
then card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } = card [:(Domin_0 ((2 * k),k)),(Domin_0 (j,l)):] by CARD_1:5;
hence card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } = (card (Domin_0 ((2 * k),k))) * (card (Domin_0 (j,l))) by CARD_2:46; ::_thesis: verum
end;
theorem Th37: :: CATALAN2:37
for n, m being Nat st 2 * m <= n holds
ex CardF being XFinSequence of st
( card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } = Sum CardF & dom CardF = m & ( for j being Nat st j < m holds
CardF . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) ) )
proof
let n, m be Nat; ::_thesis: ( 2 * m <= n implies ex CardF being XFinSequence of st
( card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } = Sum CardF & dom CardF = m & ( for j being Nat st j < m holds
CardF . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) ) ) )
assume A1: 2 * m <= n ; ::_thesis: ex CardF being XFinSequence of st
( card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } = Sum CardF & dom CardF = m & ( for j being Nat st j < m holds
CardF . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) ) )
set Z = Domin_0 (n,m);
defpred S1[ set , set ] means for j being Nat st j = $1 holds
$2 = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (j + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } ;
set W = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } ;
A2: for k being Nat st k in m holds
ex x being Element of bool (Domin_0 (n,m)) st S1[k,x]
proof
let k be Nat; ::_thesis: ( k in m implies ex x being Element of bool (Domin_0 (n,m)) st S1[k,x] )
assume k in m ; ::_thesis: ex x being Element of bool (Domin_0 (n,m)) st S1[k,x]
set NN = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } ;
{ pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } c= Domin_0 (n,m)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } or x in Domin_0 (n,m) )
assume x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } ; ::_thesis: x in Domin_0 (n,m)
then ex pN being Element of NAT ^omega st
( x = pN & pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) ;
hence x in Domin_0 (n,m) ; ::_thesis: verum
end;
then reconsider NN = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (k + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } as Element of bool (Domin_0 (n,m)) ;
take NN ; ::_thesis: S1[k,NN]
thus S1[k,NN] ; ::_thesis: verum
end;
consider C being XFinSequence of such that
A3: ( dom C = m & ( for k being Nat st k in m holds
S1[k,C . k] ) ) from STIRL2_1:sch_5(A2);
A4: { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } c= union (rng C)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } or x in union (rng C) )
assume x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } ; ::_thesis: x in union (rng C)
then consider pN being Element of NAT ^omega such that
A5: ( x = pN & pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) ;
set I = { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ;
{ N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } c= NAT
proof
let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } or y in NAT )
assume y in { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ; ::_thesis: y in NAT
then ex i being Element of NAT st
( i = y & 2 * (Sum (pN | i)) = i & i > 0 ) ;
hence y in NAT ; ::_thesis: verum
end;
then reconsider I = { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } as non empty Subset of NAT by A5;
min* I in I by NAT_1:def_1;
then consider M being Element of NAT such that
A6: min* I = M and
A7: 2 * (Sum (pN | M)) = M and
A8: M > 0 ;
Sum (pN | M) > 0 by A7, A8;
then reconsider Sum1 = (Sum (pN | M)) - 1 as Nat by NAT_1:20;
consider q being XFinSequence of such that
A9: pN = (pN | M) ^ q by Th1;
Sum pN = (Sum (pN | M)) + (Sum q) by A9, AFINSQ_2:55;
then m = (Sum (pN | M)) + (Sum q) by A5, Th20;
then A10: m >= Sum (pN | M) by NAT_1:11;
Sum1 + 1 > Sum1 by NAT_1:13;
then m > Sum1 by A10, XXREAL_0:2;
then A11: Sum1 in m by NAT_1:44;
then C . Sum1 = { qN where qN is Element of NAT ^omega : ( qN in Domin_0 (n,m) & 2 * (Sum1 + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (qN | N)) = N & N > 0 ) } ) } by A3;
then A12: pN in C . Sum1 by A5, A6, A7;
C . Sum1 in rng C by A3, A11, FUNCT_1:3;
hence x in union (rng C) by A5, A12, TARSKI:def_4; ::_thesis: verum
end;
A13: for i, j being Nat st i in dom C & j in dom C & i <> j holds
C . i misses C . j
proof
let i, j be Nat; ::_thesis: ( i in dom C & j in dom C & i <> j implies C . i misses C . j )
assume that
A14: i in dom C and
A15: j in dom C and
A16: i <> j ; ::_thesis: C . i misses C . j
assume C . i meets C . j ; ::_thesis: contradiction
then (C . i) /\ (C . j) <> {} by XBOOLE_0:def_7;
then consider x being set such that
A17: x in (C . i) /\ (C . j) by XBOOLE_0:def_1;
A18: x in C . j by A17, XBOOLE_0:def_4;
C . j = { qN where qN is Element of NAT ^omega : ( qN in Domin_0 (n,m) & 2 * (j + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (qN | N)) = N & N > 0 ) } ) } by A3, A15;
then A19: ex qN being Element of NAT ^omega st
( x = qN & qN in Domin_0 (n,m) & 2 * (j + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (qN | N)) = N & N > 0 ) } ) by A18;
A20: x in C . i by A17, XBOOLE_0:def_4;
C . i = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (i + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } by A3, A14;
then ex pN being Element of NAT ^omega st
( x = pN & pN in Domin_0 (n,m) & 2 * (i + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) by A20;
hence contradiction by A16, A19; ::_thesis: verum
end;
A21: for k being Nat st k in dom C holds
C . k is finite
proof
let k be Nat; ::_thesis: ( k in dom C implies C . k is finite )
assume k in dom C ; ::_thesis: C . k is finite
then A22: C . k in rng C by FUNCT_1:3;
thus C . k is finite by A22; ::_thesis: verum
end;
consider CardC being XFinSequence of such that
A23: dom CardC = dom C and
A24: for i being Nat st i in dom CardC holds
CardC . i = card (C . i) and
A25: card (union (rng C)) = Sum CardC by A21, A13, STIRL2_1:66;
take CardC ; ::_thesis: ( card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } = Sum CardC & dom CardC = m & ( for j being Nat st j < m holds
CardC . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) ) )
union (rng C) c= { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) }
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in union (rng C) or x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } )
assume x in union (rng C) ; ::_thesis: x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) }
then consider y being set such that
A26: x in y and
A27: y in rng C by TARSKI:def_4;
consider j being set such that
A28: j in dom C and
A29: C . j = y by A27, FUNCT_1:def_3;
reconsider j = j as Element of NAT by A28;
y = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (j + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } by A3, A28, A29;
then consider pN being Element of NAT ^omega such that
A30: ( x = pN & pN in Domin_0 (n,m) & 2 * (j + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) by A26;
2 * (j + 1) <> 0 ;
then { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} by A30, NAT_1:def_1;
hence x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } by A30; ::_thesis: verum
end;
hence ( card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } = Sum CardC & dom CardC = m ) by A3, A23, A25, A4, XBOOLE_0:def_10; ::_thesis: for j being Nat st j < m holds
CardC . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1)))))
let j be Nat; ::_thesis: ( j < m implies CardC . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) )
assume A31: j < m ; ::_thesis: CardC . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1)))))
A32: m >= j + 1 by A31, NAT_1:13;
then A33: m -' (j + 1) = m - (j + 1) by XREAL_1:233;
set P = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (j + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } ;
A34: j in dom C by A3, A31, NAT_1:44;
then A35: C . j = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & 2 * (j + 1) = min* { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ) } by A3;
2 * (j + 1) <= 2 * m by A32, XREAL_1:64;
then A36: n -' (2 * (j + 1)) = n - (2 * (j + 1)) by A1, XREAL_1:233, XXREAL_0:2;
CardC . j = card (C . j) by A23, A24, A34;
hence CardC . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) by A36, A33, A35, Th36; ::_thesis: verum
end;
theorem Th38: :: CATALAN2:38
for n being Nat st n > 0 holds
Domin_0 ((2 * n),n) = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) }
proof
let n be Nat; ::_thesis: ( n > 0 implies Domin_0 ((2 * n),n) = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } )
assume A1: n > 0 ; ::_thesis: Domin_0 ((2 * n),n) = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) }
set P = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } ;
thus Domin_0 ((2 * n),n) c= { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } :: according to XBOOLE_0:def_10 ::_thesis: { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } c= Domin_0 ((2 * n),n)
proof
A2: n + n > 0 + 0 by A1;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in Domin_0 ((2 * n),n) or x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } )
assume A3: x in Domin_0 ((2 * n),n) ; ::_thesis: x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) }
consider p being XFinSequence of such that
A4: x = p and
p is dominated_by_0 and
A5: ( dom p = 2 * n & Sum p = n ) by A3, Def2;
A6: p in NAT ^omega by AFINSQ_1:def_7;
2 * (Sum (p | (2 * n))) = 2 * n by A5, RELAT_1:69;
then 2 * n in { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } by A2;
hence x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } by A3, A4, A6; ::_thesis: verum
end;
thus { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } c= Domin_0 ((2 * n),n) ::_thesis: verum
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } or x in Domin_0 ((2 * n),n) )
assume x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } ; ::_thesis: x in Domin_0 ((2 * n),n)
then ex pN being Element of NAT ^omega st
( x = pN & pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) ;
hence x in Domin_0 ((2 * n),n) ; ::_thesis: verum
end;
end;
theorem Th39: :: CATALAN2:39
for n being Nat st n > 0 holds
ex Catal being XFinSequence of st
( Sum Catal = Catalan (n + 1) & dom Catal = n & ( for j being Nat st j < n holds
Catal . j = (Catalan (j + 1)) * (Catalan (n -' j)) ) )
proof
let n be Nat; ::_thesis: ( n > 0 implies ex Catal being XFinSequence of st
( Sum Catal = Catalan (n + 1) & dom Catal = n & ( for j being Nat st j < n holds
Catal . j = (Catalan (j + 1)) * (Catalan (n -' j)) ) ) )
assume A1: n > 0 ; ::_thesis: ex Catal being XFinSequence of st
( Sum Catal = Catalan (n + 1) & dom Catal = n & ( for j being Nat st j < n holds
Catal . j = (Catalan (j + 1)) * (Catalan (n -' j)) ) )
consider CardF being XFinSequence of such that
A2: card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((2 * n),n) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } = Sum CardF and
A3: dom CardF = n and
A4: for j being Nat st j < n holds
CardF . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 (((2 * n) -' (2 * (j + 1))),(n -' (j + 1))))) by Th37;
take CardF ; ::_thesis: ( Sum CardF = Catalan (n + 1) & dom CardF = n & ( for j being Nat st j < n holds
CardF . j = (Catalan (j + 1)) * (Catalan (n -' j)) ) )
Sum CardF = card (Domin_0 ((2 * n),n)) by A1, A2, Th38;
hence ( Sum CardF = Catalan (n + 1) & dom CardF = n ) by A3, Th34; ::_thesis: for j being Nat st j < n holds
CardF . j = (Catalan (j + 1)) * (Catalan (n -' j))
let j be Nat; ::_thesis: ( j < n implies CardF . j = (Catalan (j + 1)) * (Catalan (n -' j)) )
assume A5: j < n ; ::_thesis: CardF . j = (Catalan (j + 1)) * (Catalan (n -' j))
n - j > j - j by A5, XREAL_1:9;
then n -' j > 0 by A5, XREAL_1:233;
then reconsider nj = (n -' j) - 1 as Element of NAT by NAT_1:20;
j + 1 <= n by A5, NAT_1:13;
then A6: ( (2 * n) -' (2 * (j + 1)) = (2 * n) - (2 * (j + 1)) & n -' (j + 1) = n - (j + 1) ) by XREAL_1:64, XREAL_1:233;
A7: card (Domin_0 ((2 * j),j)) = Catalan (j + 1) by Th34;
n - j = n -' j by A5, XREAL_1:233;
then card (Domin_0 (((2 * n) -' (2 * (j + 1))),(n -' (j + 1)))) = card (Domin_0 ((2 * nj),nj)) by A6
.= Catalan (nj + 1) by Th34 ;
hence CardF . j = (Catalan (j + 1)) * (Catalan (n -' j)) by A4, A5, A7; ::_thesis: verum
end;
theorem Th40: :: CATALAN2:40
for n, m being Nat holds card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } = card (Domin_0 (n,m))
proof
let n, m be Nat; ::_thesis: card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } = card (Domin_0 (n,m))
defpred S1[ set , set ] means ex p being XFinSequence of st
( $1 = <%0%> ^ p & $2 = p );
set F = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } ;
set Z = Domin_0 (n,m);
A1: for x being set st x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } holds
ex y being set st
( y in Domin_0 (n,m) & S1[x,y] )
proof
A2: len <%0%> = 1 by AFINSQ_1:33;
let x be set ; ::_thesis: ( x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } implies ex y being set st
( y in Domin_0 (n,m) & S1[x,y] ) )
A3: Sum <%0%> = 0 by AFINSQ_2:53;
assume x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } ; ::_thesis: ex y being set st
( y in Domin_0 (n,m) & S1[x,y] )
then consider pN being Element of NAT ^omega such that
A4: ( x = pN & pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) ;
A5: len pN = dom pN ;
( pN is dominated_by_0 & dom pN = n + 1 ) by A4, Th20;
then consider q being XFinSequence of such that
A6: pN = <%0%> ^ q and
A7: q is dominated_by_0 by A4, A5, Th17;
dom pN = (len <%0%>) + (len q) by A6, AFINSQ_1:def_3;
then A8: n + 1 = (len q) + 1 by A4, A2, Th20;
take q ; ::_thesis: ( q in Domin_0 (n,m) & S1[x,q] )
Sum pN = (Sum <%0%>) + (Sum q) by A6, AFINSQ_2:55;
then Sum q = m by A4, A3, Th20;
hence ( q in Domin_0 (n,m) & S1[x,q] ) by A4, A6, A7, A8, Th20; ::_thesis: verum
end;
consider f being Function of { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } ,(Domin_0 (n,m)) such that
A9: for x being set st x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } holds
S1[x,f . x] from FUNCT_2:sch_1(A1);
A10: ( Domin_0 (n,m) = {} implies { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } = {} )
proof
assume Domin_0 (n,m) = {} ; ::_thesis: { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } = {}
then 2 * m > n by Th22;
then A11: 2 * m >= n + 1 by NAT_1:13;
assume { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } <> {} ; ::_thesis: contradiction
then consider x being set such that
A12: x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } by XBOOLE_0:def_1;
consider pN being Element of NAT ^omega such that
A13: ( x = pN & pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) by A12;
dom pN = n + 1 by A13, Th20;
then pN | (n + 1) = pN by RELAT_1:69;
then A14: Sum (pN | (n + 1)) = m by A13, Th20;
pN is dominated_by_0 by A13, Th20;
then 2 * m <= n + 1 by A14, Th2;
then 2 * (Sum (pN | (n + 1))) = n + 1 by A14, A11, XXREAL_0:1;
then n + 1 in { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } ;
hence contradiction by A13; ::_thesis: verum
end;
then A15: dom f = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } by FUNCT_2:def_1;
A16: rng f = Domin_0 (n,m)
proof
thus rng f c= Domin_0 (n,m) ; :: according to XBOOLE_0:def_10 ::_thesis: Domin_0 (n,m) c= rng f
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in Domin_0 (n,m) or x in rng f )
assume x in Domin_0 (n,m) ; ::_thesis: x in rng f
then consider p being XFinSequence of such that
A17: p = x and
A18: p is dominated_by_0 and
A19: dom p = n and
A20: Sum p = m by Def2;
set q = <%0%> ^ p;
A21: { N where N is Element of NAT : ( 2 * (Sum ((<%0%> ^ p) | N)) = N & N > 0 ) } = {} by A18, Th18;
Sum (<%0%> ^ p) = (Sum <%0%>) + (Sum p) by AFINSQ_2:55;
then A22: Sum (<%0%> ^ p) = 0 + m by A20, AFINSQ_2:53;
A23: <%0%> ^ p in NAT ^omega by AFINSQ_1:def_7;
dom (<%0%> ^ p) = (len <%0%>) + (len p) by AFINSQ_1:def_3;
then A24: dom (<%0%> ^ p) = 1 + n by A19, AFINSQ_1:33;
<%0%> ^ p is dominated_by_0 by A18, Th18;
then <%0%> ^ p in Domin_0 ((n + 1),m) by A24, A22, Th20;
then A25: <%0%> ^ p in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } by A21, A23;
then consider r being XFinSequence of such that
A26: <%0%> ^ p = <%0%> ^ r and
A27: f . (<%0%> ^ p) = r by A9;
r = p by A26, AFINSQ_1:28;
hence x in rng f by A15, A17, A25, A27, FUNCT_1:3; ::_thesis: verum
end;
for x, y being set st x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } & y in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } & f . x = f . y holds
x = y
proof
let x, y be set ; ::_thesis: ( x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } & y in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } & f . x = f . y implies x = y )
assume that
A28: ( x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } & y in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } ) and
A29: f . x = f . y ; ::_thesis: x = y
( ex p being XFinSequence of st
( x = <%0%> ^ p & f . x = p ) & ex q being XFinSequence of st
( y = <%0%> ^ q & f . y = q ) ) by A9, A28;
hence x = y by A29; ::_thesis: verum
end;
then f is one-to-one by A10, FUNCT_2:19;
then { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } , Domin_0 (n,m) are_equipotent by A15, A16, WELLORD2:def_4;
hence card { pN where pN is Element of NAT ^omega : ( pN in Domin_0 ((n + 1),m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } = card (Domin_0 (n,m)) by CARD_1:5; ::_thesis: verum
end;
theorem :: CATALAN2:41
for n, m being Nat st 2 * m <= n holds
ex CardF being XFinSequence of st
( card (Domin_0 (n,m)) = (Sum CardF) + (card (Domin_0 ((n -' 1),m))) & dom CardF = m & ( for j being Nat st j < m holds
CardF . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) ) )
proof
let n, m be Nat; ::_thesis: ( 2 * m <= n implies ex CardF being XFinSequence of st
( card (Domin_0 (n,m)) = (Sum CardF) + (card (Domin_0 ((n -' 1),m))) & dom CardF = m & ( for j being Nat st j < m holds
CardF . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) ) ) )
assume A1: 2 * m <= n ; ::_thesis: ex CardF being XFinSequence of st
( card (Domin_0 (n,m)) = (Sum CardF) + (card (Domin_0 ((n -' 1),m))) & dom CardF = m & ( for j being Nat st j < m holds
CardF . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) ) )
set Z = Domin_0 (n,m);
set Zne = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } ;
A2: { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } c= Domin_0 (n,m)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } or x in Domin_0 (n,m) )
assume x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } ; ::_thesis: x in Domin_0 (n,m)
then ex pN being Element of NAT ^omega st
( x = pN & pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) ;
hence x in Domin_0 (n,m) ; ::_thesis: verum
end;
set Ze = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } ;
A3: { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } c= Domin_0 (n,m)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } or x in Domin_0 (n,m) )
assume x in { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } ; ::_thesis: x in Domin_0 (n,m)
then ex pN being Element of NAT ^omega st
( x = pN & pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) ;
hence x in Domin_0 (n,m) ; ::_thesis: verum
end;
reconsider Zne = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) } as finite set by A2;
consider C being XFinSequence of such that
A4: card Zne = Sum C and
A5: dom C = m and
A6: for j being Nat st j < m holds
C . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) by A1, Th37;
reconsider Ze = { pN where pN is Element of NAT ^omega : ( pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } = {} ) } as finite set by A3;
take C ; ::_thesis: ( card (Domin_0 (n,m)) = (Sum C) + (card (Domin_0 ((n -' 1),m))) & dom C = m & ( for j being Nat st j < m holds
C . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) ) )
A7: Ze misses Zne
proof
assume Ze meets Zne ; ::_thesis: contradiction
then consider x being set such that
A8: x in Ze and
A9: x in Zne by XBOOLE_0:3;
A10: ex qN being Element of NAT ^omega st
( qN = x & qN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (qN | N)) = N & N > 0 ) } = {} ) by A8;
ex pN being Element of NAT ^omega st
( pN = x & pN in Domin_0 (n,m) & { N where N is Element of NAT : ( 2 * (Sum (pN | N)) = N & N > 0 ) } <> {} ) by A9;
hence contradiction by A10; ::_thesis: verum
end;
A11: Domin_0 (n,m) c= Ze \/ Zne
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in Domin_0 (n,m) or x in Ze \/ Zne )
assume A12: x in Domin_0 (n,m) ; ::_thesis: x in Ze \/ Zne
consider p being XFinSequence of such that
A13: p = x and
p is dominated_by_0 and
dom p = n and
Sum p = m by A12, Def2;
reconsider p = p as Element of NAT ^omega by AFINSQ_1:def_7;
set I = { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } ;
now__::_thesis:_x_in_Ze_\/_Zne
percases ( { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } = {} or { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } <> {} ) ;
suppose { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } = {} ; ::_thesis: x in Ze \/ Zne
then p in Ze by A12, A13;
hence x in Ze \/ Zne by A13, XBOOLE_0:def_3; ::_thesis: verum
end;
suppose { N where N is Element of NAT : ( 2 * (Sum (p | N)) = N & N > 0 ) } <> {} ; ::_thesis: x in Ze \/ Zne
then p in Zne by A12, A13;
hence x in Ze \/ Zne by A13, XBOOLE_0:def_3; ::_thesis: verum
end;
end;
end;
hence x in Ze \/ Zne ; ::_thesis: verum
end;
Ze \/ Zne c= Domin_0 (n,m) by A3, A2, XBOOLE_1:8;
then A14: Ze \/ Zne = Domin_0 (n,m) by A11, XBOOLE_0:def_10;
now__::_thesis:_card_(Domin_0_(n,m))_=_(Sum_C)_+_(card_(Domin_0_((n_-'_1),m)))
percases ( n = 0 or n > 0 ) ;
supposeA15: n = 0 ; ::_thesis: card (Domin_0 (n,m)) = (Sum C) + (card (Domin_0 ((n -' 1),m)))
then 2 * m = 0 by A1;
then C = {} by A5;
then A16: Sum C = 0 ;
n - 1 < 1 - 1 by A15;
hence card (Domin_0 (n,m)) = (Sum C) + (card (Domin_0 ((n -' 1),m))) by A15, A16, XREAL_0:def_2; ::_thesis: verum
end;
supposeA17: n > 0 ; ::_thesis: card (Domin_0 (n,m)) = (Sum C) + (card (Domin_0 ((n -' 1),m)))
then reconsider n1 = n - 1 as Element of NAT by NAT_1:20;
n = n1 + 1 ;
then A18: card Ze = card (Domin_0 (n1,m)) by Th40;
n1 = n -' 1 by A17, NAT_1:14, XREAL_1:233;
hence card (Domin_0 (n,m)) = (Sum C) + (card (Domin_0 ((n -' 1),m))) by A7, A14, A4, A18, CARD_2:40; ::_thesis: verum
end;
end;
end;
hence ( card (Domin_0 (n,m)) = (Sum C) + (card (Domin_0 ((n -' 1),m))) & dom C = m & ( for j being Nat st j < m holds
C . j = (card (Domin_0 ((2 * j),j))) * (card (Domin_0 ((n -' (2 * (j + 1))),(m -' (j + 1))))) ) ) by A5, A6; ::_thesis: verum
end;
theorem :: CATALAN2:42
for n, k being Nat ex p being XFinSequence of st
( Sum p = card (Domin_0 ((((2 * n) + 2) + k),(n + 1))) & dom p = k + 1 & ( for i being Nat st i <= k holds
p . i = card (Domin_0 ((((2 * n) + 1) + i),n)) ) )
proof
let n, k be Nat; ::_thesis: ex p being XFinSequence of st
( Sum p = card (Domin_0 ((((2 * n) + 2) + k),(n + 1))) & dom p = k + 1 & ( for i being Nat st i <= k holds
p . i = card (Domin_0 ((((2 * n) + 1) + i),n)) ) )
defpred S1[ set , set ] means for j being Nat st $1 = j holds
$2 = card (Domin_0 ((((2 * n) + 1) + j),n));
A1: for i being Nat st i in k + 1 holds
ex x being Element of NAT st S1[i,x]
proof
let i be Nat; ::_thesis: ( i in k + 1 implies ex x being Element of NAT st S1[i,x] )
assume i in k + 1 ; ::_thesis: ex x being Element of NAT st S1[i,x]
S1[i, card (Domin_0 ((((2 * n) + 1) + i),n))] ;
hence ex x being Element of NAT st S1[i,x] ; ::_thesis: verum
end;
consider p being XFinSequence of such that
A2: dom p = k + 1 and
A3: for i being Nat st i in k + 1 holds
S1[i,p . i] from STIRL2_1:sch_5(A1);
take p ; ::_thesis: ( Sum p = card (Domin_0 ((((2 * n) + 2) + k),(n + 1))) & dom p = k + 1 & ( for i being Nat st i <= k holds
p . i = card (Domin_0 ((((2 * n) + 1) + i),n)) ) )
A4: for i being Nat st i <= k holds
p . i = card (Domin_0 ((((2 * n) + 1) + i),n))
proof
let i be Nat; ::_thesis: ( i <= k implies p . i = card (Domin_0 ((((2 * n) + 1) + i),n)) )
assume i <= k ; ::_thesis: p . i = card (Domin_0 ((((2 * n) + 1) + i),n))
then i < k + 1 by NAT_1:13;
then i in k + 1 by NAT_1:44;
hence p . i = card (Domin_0 ((((2 * n) + 1) + i),n)) by A3; ::_thesis: verum
end;
now__::_thesis:_Sum_p_=_card_(Domin_0_((((2_*_n)_+_2)_+_k),(n_+_1)))
percases ( n = 0 or n > 0 ) ;
supposeA5: n = 0 ; ::_thesis: Sum p = card (Domin_0 ((((2 * n) + 2) + k),(n + 1)))
for x being set st x in dom p holds
p . x = 1
proof
let x be set ; ::_thesis: ( x in dom p implies p . x = 1 )
assume A6: x in dom p ; ::_thesis: p . x = 1
reconsider i = x as Element of NAT by A6;
p . i = card (Domin_0 ((((2 * n) + 1) + i),n)) by A2, A3, A6;
hence p . x = 1 by A5, Th24; ::_thesis: verum
end;
then p = (k + 1) --> 1 by A2, FUNCOP_1:11;
then Sum p = (k + 1) * 1 by AFINSQ_2:58;
hence Sum p = card (Domin_0 ((((2 * n) + 2) + k),(n + 1))) by A5, Th30; ::_thesis: verum
end;
suppose n > 0 ; ::_thesis: Sum p = card (Domin_0 ((((2 * n) + 2) + k),(n + 1)))
then reconsider n1 = n - 1 as Element of NAT by NAT_1:20;
defpred S2[ Nat] means for q being XFinSequence of st dom q = $1 + 1 & ( for i being Nat st i <= $1 holds
q . i = card (Domin_0 ((((2 * n) + 1) + i),n)) ) holds
Sum q = card (Domin_0 ((((2 * n) + 2) + $1),(n + 1)));
A7: for j being Nat st S2[j] holds
S2[j + 1]
proof
let j be Nat; ::_thesis: ( S2[j] implies S2[j + 1] )
assume A8: S2[j] ; ::_thesis: S2[j + 1]
set CH2 = (((2 * n) + 2) + j) choose (n1 + 1);
set CH1 = (((2 * n) + 2) + j) choose (n + 1);
set j1 = j + 1;
let q be XFinSequence of ; ::_thesis: ( dom q = (j + 1) + 1 & ( for i being Nat st i <= j + 1 holds
q . i = card (Domin_0 ((((2 * n) + 1) + i),n)) ) implies Sum q = card (Domin_0 ((((2 * n) + 2) + (j + 1)),(n + 1))) )
assume that
A9: dom q = (j + 1) + 1 and
A10: for i being Nat st i <= j + 1 holds
q . i = card (Domin_0 ((((2 * n) + 1) + i),n)) ; ::_thesis: Sum q = card (Domin_0 ((((2 * n) + 2) + (j + 1)),(n + 1)))
A11: 2 * (n + 1) <= (2 * (n + 1)) + (j + 1) by NAT_1:11;
j + 1 <= (j + 1) + 1 by NAT_1:11;
then j + 1 c= (j + 1) + 1 by NAT_1:39;
then A12: dom (q | (j + 1)) = j + 1 by A9, RELAT_1:62;
A13: for i being Nat st i <= j holds
(q | (j + 1)) . i = card (Domin_0 ((((2 * n) + 1) + i),n))
proof
let i be Nat; ::_thesis: ( i <= j implies (q | (j + 1)) . i = card (Domin_0 ((((2 * n) + 1) + i),n)) )
assume i <= j ; ::_thesis: (q | (j + 1)) . i = card (Domin_0 ((((2 * n) + 1) + i),n))
then i < j + 1 by NAT_1:13;
then ( i in dom (q | (j + 1)) & q . i = card (Domin_0 ((((2 * n) + 1) + i),n)) ) by A10, A12, NAT_1:44;
hence (q | (j + 1)) . i = card (Domin_0 ((((2 * n) + 1) + i),n)) by FUNCT_1:47; ::_thesis: verum
end;
set CH4 = (((2 * n) + 1) + (j + 1)) choose n1;
set CH3 = (((2 * n) + 1) + (j + 1)) choose n;
A14: ( 2 * n <= (2 * n) + (1 + (j + 1)) & n1 + 1 = n ) by NAT_1:11;
q . (j + 1) = card (Domin_0 ((((2 * n) + 1) + (j + 1)),n)) by A10;
then A15: q . (j + 1) = ((((2 * n) + 1) + (j + 1)) choose n) - ((((2 * n) + 1) + (j + 1)) choose n1) by A14, Th28;
j + 1 < (j + 1) + 1 by NAT_1:13;
then j + 1 in dom q by A9, NAT_1:44;
then A16: Sum (q | ((j + 1) + 1)) = (Sum (q | (j + 1))) + (q . (j + 1)) by AFINSQ_2:65;
2 * (n + 1) <= ((2 * n) + 2) + j by NAT_1:11;
then card (Domin_0 ((((2 * n) + 2) + j),(n + 1))) = ((((2 * n) + 2) + j) choose (n + 1)) - ((((2 * n) + 2) + j) choose (n1 + 1)) by Th28;
then Sum (q | (j + 1)) = ((((2 * n) + 2) + j) choose (n + 1)) - ((((2 * n) + 2) + j) choose (n1 + 1)) by A8, A12, A13;
then (Sum (q | (j + 1))) + (q . (j + 1)) = (((((2 * n) + 2) + j) choose (n + 1)) + ((((2 * n) + 2) + j) choose (n1 + 1))) - (((((2 * n) + 1) + (j + 1)) choose n) + ((((2 * n) + 1) + (j + 1)) choose n1)) by A15
.= (((((2 * n) + 2) + j) + 1) choose (n + 1)) - (((((2 * n) + 1) + (j + 1)) choose n) + ((((2 * n) + 1) + (j + 1)) choose n1)) by NEWTON:22
.= ((((2 * n) + 2) + (j + 1)) choose (n + 1)) - ((((2 * n) + 2) + (j + 1)) choose (n1 + 1)) by NEWTON:22
.= card (Domin_0 ((((2 * n) + 2) + (j + 1)),(n + 1))) by A11, Th28 ;
hence Sum q = card (Domin_0 ((((2 * n) + 2) + (j + 1)),(n + 1))) by A9, A16, RELAT_1:69; ::_thesis: verum
end;
A17: S2[ 0 ]
proof
reconsider 2n1 = (2 * n) + 1 as Element of NAT ;
set 2CHn = ((2 * n) + 2) choose n;
set 2CHn91 = ((2 * n) + 2) choose (n + 1);
set CHn91 = 2n1 choose (n + 1);
set CHn1 = 2n1 choose n1;
set CHn = 2n1 choose n;
let q be XFinSequence of ; ::_thesis: ( dom q = 0 + 1 & ( for i being Nat st i <= 0 holds
q . i = card (Domin_0 ((((2 * n) + 1) + i),n)) ) implies Sum q = card (Domin_0 ((((2 * n) + 2) + 0),(n + 1))) )
assume ( dom q = 0 + 1 & ( for i being Nat st i <= 0 holds
q . i = card (Domin_0 ((((2 * n) + 1) + i),n)) ) ) ; ::_thesis: Sum q = card (Domin_0 ((((2 * n) + 2) + 0),(n + 1)))
then A18: ( q . 0 = card (Domin_0 ((((2 * n) + 1) + 0),n)) & len q = 1 ) ;
A19: (2 * n) + 2 = ((2 * n) + 1) + 1 ;
then A20: ((2 * n) + 2) choose (n + 1) = (2n1 choose (n + 1)) + (2n1 choose n) by NEWTON:22;
n1 + 1 = n ;
then A21: ((2 * n) + 2) choose n = (2n1 choose n) + (2n1 choose n1) by A19, NEWTON:22;
( n <= n + (n + 1) & ((2 * n) + 1) - n = n + 1 ) by NAT_1:11;
then A22: 2n1 choose n = 2n1 choose (n + 1) by NEWTON:20;
2 * (n + 1) = (2 * n) + 2 ;
then A23: card (Domin_0 (((2 * n) + 2),(n + 1))) = (((2 * n) + 2) choose (n + 1)) - (((2 * n) + 2) choose n) by Th28;
( card (Domin_0 (2n1,(n1 + 1))) = (2n1 choose n) - (2n1 choose n1) & Sum <%(q . 0)%> = q . 0 ) by Th28, AFINSQ_2:53, NAT_1:11;
hence Sum q = card (Domin_0 ((((2 * n) + 2) + 0),(n + 1))) by A20, A21, A22, A23, A18, AFINSQ_1:34; ::_thesis: verum
end;
for j being Nat holds S2[j] from NAT_1:sch_2(A17, A7);
hence Sum p = card (Domin_0 ((((2 * n) + 2) + k),(n + 1))) by A2, A4; ::_thesis: verum
end;
end;
end;
hence ( Sum p = card (Domin_0 ((((2 * n) + 2) + k),(n + 1))) & dom p = k + 1 & ( for i being Nat st i <= k holds
p . i = card (Domin_0 ((((2 * n) + 1) + i),n)) ) ) by A2, A4; ::_thesis: verum
end;
begin
Lm3: for Fr being XFinSequence of st ( dom Fr = 1 or len Fr = 1 ) holds
Sum Fr = Fr . 0
proof
let Fr be XFinSequence of ; ::_thesis: ( ( dom Fr = 1 or len Fr = 1 ) implies Sum Fr = Fr . 0 )
assume ( dom Fr = 1 or len Fr = 1 ) ; ::_thesis: Sum Fr = Fr . 0
then len Fr = 1 ;
then Fr = <%(Fr . 0)%> by AFINSQ_1:34;
hence Sum Fr = Fr . 0 by AFINSQ_2:53; ::_thesis: verum
end;
Lm4: for Fr1, Fr2 being XFinSequence of st dom Fr1 = dom Fr2 & ( for n being Nat st n in len Fr1 holds
Fr1 . n = Fr2 . ((len Fr1) -' (1 + n)) ) holds
Sum Fr1 = Sum Fr2
proof
let Fr1, Fr2 be XFinSequence of ; ::_thesis: ( dom Fr1 = dom Fr2 & ( for n being Nat st n in len Fr1 holds
Fr1 . n = Fr2 . ((len Fr1) -' (1 + n)) ) implies Sum Fr1 = Sum Fr2 )
assume that
A1: dom Fr1 = dom Fr2 and
A2: for n being Nat st n in len Fr1 holds
Fr1 . n = Fr2 . ((len Fr1) -' (1 + n)) ; ::_thesis: Sum Fr1 = Sum Fr2
defpred S1[ set , set ] means for i being Nat st i = $1 holds
$2 = (len Fr1) -' (1 + i);
A3: card (len Fr1) = card (len Fr1) ;
A4: for x being set st x in len Fr1 holds
ex y being set st
( y in len Fr1 & S1[x,y] )
proof
let x be set ; ::_thesis: ( x in len Fr1 implies ex y being set st
( y in len Fr1 & S1[x,y] ) )
assume A5: x in len Fr1 ; ::_thesis: ex y being set st
( y in len Fr1 & S1[x,y] )
len Fr1 is Subset of NAT by STIRL2_1:8;
then reconsider k = x as Element of NAT by A5;
k < len Fr1 by A5, NAT_1:44;
then k + 1 <= len Fr1 by NAT_1:13;
then A6: (len Fr1) -' (1 + k) = (len Fr1) - (1 + k) by XREAL_1:233;
take (len Fr1) -' (1 + k) ; ::_thesis: ( (len Fr1) -' (1 + k) in len Fr1 & S1[x,(len Fr1) -' (1 + k)] )
(len Fr1) + 0 < (len Fr1) + (1 + k) by XREAL_1:8;
then (len Fr1) - (1 + k) < ((len Fr1) + (1 + k)) - (1 + k) by XREAL_1:9;
hence ( (len Fr1) -' (1 + k) in len Fr1 & S1[x,(len Fr1) -' (1 + k)] ) by A6, NAT_1:44; ::_thesis: verum
end;
consider P being Function of (len Fr1),(len Fr1) such that
A7: for x being set st x in len Fr1 holds
S1[x,P . x] from FUNCT_2:sch_1(A4);
A8: for x1, x2 being set st x1 in len Fr1 & x2 in len Fr1 & P . x1 = P . x2 holds
x1 = x2
proof
let x1, x2 be set ; ::_thesis: ( x1 in len Fr1 & x2 in len Fr1 & P . x1 = P . x2 implies x1 = x2 )
assume that
A9: x1 in len Fr1 and
A10: x2 in len Fr1 and
A11: P . x1 = P . x2 ; ::_thesis: x1 = x2
len Fr1 is Subset of NAT by STIRL2_1:8;
then reconsider i = x1, j = x2 as Element of NAT by A9, A10;
j < len Fr1 by A10, NAT_1:44;
then j + 1 <= len Fr1 by NAT_1:13;
then (len Fr1) -' (1 + j) = (len Fr1) - (1 + j) by XREAL_1:233;
then A12: P . x2 = (len Fr1) - (1 + j) by A7, A10;
i < len Fr1 by A9, NAT_1:44;
then i + 1 <= len Fr1 by NAT_1:13;
then (len Fr1) -' (1 + i) = (len Fr1) - (1 + i) by XREAL_1:233;
then P . x1 = (len Fr1) - (1 + i) by A7, A9;
hence x1 = x2 by A11, A12; ::_thesis: verum
end;
then A13: P is one-to-one by FUNCT_2:56;
P is one-to-one by A8, FUNCT_2:56;
then P is onto by A3, STIRL2_1:60;
then reconsider P = P as Permutation of (dom Fr1) by A13;
A14: now__::_thesis:_for_x_being_set_st_x_in_dom_Fr1_holds_
Fr1_._x_=_Fr2_._(P_._x)
let x be set ; ::_thesis: ( x in dom Fr1 implies Fr1 . x = Fr2 . (P . x) )
assume A15: x in dom Fr1 ; ::_thesis: Fr1 . x = Fr2 . (P . x)
reconsider k = x as Element of NAT by A15;
P . k = (len Fr1) -' (1 + k) by A7, A15;
hence Fr1 . x = Fr2 . (P . x) by A2, A15; ::_thesis: verum
end;
A16: for x being set st x in dom Fr1 holds
( x in dom P & P . x in dom Fr2 ) by A1, FUNCT_2:52;
for x being set st x in dom P & P . x in dom Fr2 holds
x in dom Fr1 ;
then Fr1 = Fr2 * P by A16, A14, FUNCT_1:10;
then addreal "**" Fr1 = addreal "**" Fr2 by A1, AFINSQ_2:45
.= Sum Fr2 by AFINSQ_2:48 ;
hence Sum Fr1 = Sum Fr2 by AFINSQ_2:48; ::_thesis: verum
end;
definition
let seq1, seq2 be Real_Sequence;
funcseq1 (##) seq2 -> Real_Sequence means :Def4: :: CATALAN2:def 4
for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = it . k );
existence
ex b1 being Real_Sequence st
for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = b1 . k )
proof
defpred S1[ set , set ] means for k being Nat st k = $1 holds
ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = $2 );
A1: for x being set st x in NAT holds
ex y being set st
( y in REAL & S1[x,y] )
proof
let x be set ; ::_thesis: ( x in NAT implies ex y being set st
( y in REAL & S1[x,y] ) )
assume x in NAT ; ::_thesis: ex y being set st
( y in REAL & S1[x,y] )
then reconsider k = x as Element of NAT ;
defpred S2[ set , set ] means for i being Nat st i = $1 holds
$2 = (seq1 . i) * (seq2 . (k -' i));
A2: for i being Nat st i in k + 1 holds
ex z being Element of REAL st S2[i,z]
proof
let i be Nat; ::_thesis: ( i in k + 1 implies ex z being Element of REAL st S2[i,z] )
assume i in k + 1 ; ::_thesis: ex z being Element of REAL st S2[i,z]
take (seq1 . i) * (seq2 . (k -' i)) ; ::_thesis: S2[i,(seq1 . i) * (seq2 . (k -' i))]
thus S2[i,(seq1 . i) * (seq2 . (k -' i))] ; ::_thesis: verum
end;
consider Fr being XFinSequence of such that
A3: dom Fr = k + 1 and
A4: for i being Nat st i in k + 1 holds
S2[i,Fr . i] from STIRL2_1:sch_5(A2);
take Sum Fr ; ::_thesis: ( Sum Fr in REAL & S1[x, Sum Fr] )
for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) by A4;
hence ( Sum Fr in REAL & S1[x, Sum Fr] ) by A3, XREAL_0:def_1; ::_thesis: verum
end;
consider seq3 being Real_Sequence such that
A5: for x being set st x in NAT holds
S1[x,seq3 . x] from FUNCT_2:sch_1(A1);
for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = seq3 . k )
proof
let k be Nat; ::_thesis: ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = seq3 . k )
k in NAT by ORDINAL1:def_12;
hence ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = seq3 . k ) by A5; ::_thesis: verum
end;
hence ex b1 being Real_Sequence st
for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = b1 . k ) ; ::_thesis: verum
end;
uniqueness
for b1, b2 being Real_Sequence st ( for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = b1 . k ) ) & ( for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = b2 . k ) ) holds
b1 = b2
proof
let seq3, seq4 be Real_Sequence; ::_thesis: ( ( for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = seq3 . k ) ) & ( for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = seq4 . k ) ) implies seq3 = seq4 )
assume that
A6: for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = seq3 . k ) and
A7: for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = seq4 . k ) ; ::_thesis: seq3 = seq4
now__::_thesis:_for_x_being_set_st_x_in_NAT_holds_
seq3_._x_=_seq4_._x
let x be set ; ::_thesis: ( x in NAT implies seq3 . x = seq4 . x )
assume x in NAT ; ::_thesis: seq3 . x = seq4 . x
then reconsider k = x as Element of NAT ;
consider Fr1 being XFinSequence of such that
A8: dom Fr1 = k + 1 and
A9: for n being Nat st n in k + 1 holds
Fr1 . n = (seq1 . n) * (seq2 . (k -' n)) and
A10: Sum Fr1 = seq3 . k by A6;
consider Fr2 being XFinSequence of such that
A11: dom Fr2 = k + 1 and
A12: for n being Nat st n in k + 1 holds
Fr2 . n = (seq1 . n) * (seq2 . (k -' n)) and
A13: Sum Fr2 = seq4 . k by A7;
now__::_thesis:_for_n_being_Nat_st_n_in_dom_Fr1_holds_
Fr1_._n_=_Fr2_._n
let n be Nat; ::_thesis: ( n in dom Fr1 implies Fr1 . n = Fr2 . n )
assume A14: n in dom Fr1 ; ::_thesis: Fr1 . n = Fr2 . n
Fr1 . n = (seq1 . n) * (seq2 . (k -' n)) by A8, A9, A14;
hence Fr1 . n = Fr2 . n by A8, A12, A14; ::_thesis: verum
end;
hence seq3 . x = seq4 . x by A8, A10, A11, A13, AFINSQ_1:8; ::_thesis: verum
end;
hence seq3 = seq4 by FUNCT_2:12; ::_thesis: verum
end;
commutativity
for b1, seq1, seq2 being Real_Sequence st ( for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = b1 . k ) ) holds
for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq2 . n) * (seq1 . (k -' n)) ) & Sum Fr = b1 . k )
proof
let seq3, seq1, seq2 be Real_Sequence; ::_thesis: ( ( for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = seq3 . k ) ) implies for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq2 . n) * (seq1 . (k -' n)) ) & Sum Fr = seq3 . k ) )
assume A15: for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = seq3 . k ) ; ::_thesis: for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq2 . n) * (seq1 . (k -' n)) ) & Sum Fr = seq3 . k )
let k be Nat; ::_thesis: ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq2 . n) * (seq1 . (k -' n)) ) & Sum Fr = seq3 . k )
consider Fr1 being XFinSequence of such that
A16: dom Fr1 = k + 1 and
A17: for n being Nat st n in k + 1 holds
Fr1 . n = (seq1 . n) * (seq2 . (k -' n)) and
A18: Sum Fr1 = seq3 . k by A15;
defpred S1[ set , set ] means for i being Nat st i = $1 holds
$2 = (seq2 . i) * (seq1 . (k -' i));
reconsider k9 = k as Element of NAT by ORDINAL1:def_12;
A19: for i being Nat st i in k9 + 1 holds
ex z being Element of REAL st S1[i,z]
proof
let i be Nat; ::_thesis: ( i in k9 + 1 implies ex z being Element of REAL st S1[i,z] )
assume i in k9 + 1 ; ::_thesis: ex z being Element of REAL st S1[i,z]
take (seq2 . i) * (seq1 . (k -' i)) ; ::_thesis: S1[i,(seq2 . i) * (seq1 . (k -' i))]
thus S1[i,(seq2 . i) * (seq1 . (k -' i))] ; ::_thesis: verum
end;
consider Fr2 being XFinSequence of such that
A20: dom Fr2 = k9 + 1 and
A21: for i being Nat st i in k9 + 1 holds
S1[i,Fr2 . i] from STIRL2_1:sch_5(A19);
take Fr2 ; ::_thesis: ( dom Fr2 = k + 1 & ( for n being Nat st n in k + 1 holds
Fr2 . n = (seq2 . n) * (seq1 . (k -' n)) ) & Sum Fr2 = seq3 . k )
thus ( dom Fr2 = k + 1 & ( for n being Nat st n in k + 1 holds
Fr2 . n = (seq2 . n) * (seq1 . (k -' n)) ) ) by A20, A21; ::_thesis: Sum Fr2 = seq3 . k
now__::_thesis:_for_n_being_Nat_st_n_in_len_Fr1_holds_
Fr1_._n_=_Fr2_._((len_Fr1)_-'_(1_+_n))
let n be Nat; ::_thesis: ( n in len Fr1 implies Fr1 . n = Fr2 . ((len Fr1) -' (1 + n)) )
assume A22: n in len Fr1 ; ::_thesis: Fr1 . n = Fr2 . ((len Fr1) -' (1 + n))
A23: n < k + 1 by A16, A22, NAT_1:44;
then n <= k by NAT_1:13;
then A24: k -' n = k - n by XREAL_1:233;
k -' n <= (k -' n) + n by NAT_1:11;
then A25: k -' (k -' n) = k - (k -' n) by A24, XREAL_1:233;
n + 1 <= len Fr2 by A20, A23, NAT_1:13;
then A26: (len Fr2) -' (n + 1) = (k + 1) - (n + 1) by A20, XREAL_1:233;
( k - n <= k & k < k + 1 ) by NAT_1:13, XREAL_1:43;
then k - n < k + 1 by XXREAL_0:2;
then (len Fr2) -' (n + 1) in k + 1 by A26, NAT_1:44;
then Fr2 . ((len Fr2) -' (n + 1)) = (seq2 . (k -' n)) * (seq1 . n) by A21, A26, A24, A25;
hence Fr1 . n = Fr2 . ((len Fr1) -' (1 + n)) by A16, A17, A20, A22; ::_thesis: verum
end;
hence Sum Fr2 = seq3 . k by A16, A18, A20, Lm4; ::_thesis: verum
end;
end;
:: deftheorem Def4 defines (##) CATALAN2:def_4_:_
for seq1, seq2, b3 being Real_Sequence holds
( b3 = seq1 (##) seq2 iff for k being Nat ex Fr being XFinSequence of st
( dom Fr = k + 1 & ( for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * (seq2 . (k -' n)) ) & Sum Fr = b3 . k ) );
theorem :: CATALAN2:43
for Fr1, Fr2 being XFinSequence of st dom Fr1 = dom Fr2 & ( for n being Nat st n in len Fr1 holds
Fr1 . n = Fr2 . ((len Fr1) -' (1 + n)) ) holds
Sum Fr1 = Sum Fr2 by Lm4;
theorem Th44: :: CATALAN2:44
for r being real number
for Fr1, Fr2 being XFinSequence of st dom Fr1 = dom Fr2 & ( for n being Nat st n in len Fr1 holds
Fr1 . n = r * (Fr2 . n) ) holds
Sum Fr1 = r * (Sum Fr2)
proof
let r be real number ; ::_thesis: for Fr1, Fr2 being XFinSequence of st dom Fr1 = dom Fr2 & ( for n being Nat st n in len Fr1 holds
Fr1 . n = r * (Fr2 . n) ) holds
Sum Fr1 = r * (Sum Fr2)
let Fr1, Fr2 be XFinSequence of ; ::_thesis: ( dom Fr1 = dom Fr2 & ( for n being Nat st n in len Fr1 holds
Fr1 . n = r * (Fr2 . n) ) implies Sum Fr1 = r * (Sum Fr2) )
assume that
A1: dom Fr1 = dom Fr2 and
A2: for n being Nat st n in len Fr1 holds
Fr1 . n = r * (Fr2 . n) ; ::_thesis: Sum Fr1 = r * (Sum Fr2)
A3: ( Fr1 | (dom Fr1) = Fr1 & Fr2 | (dom Fr1) = Fr2 ) by A1, RELAT_1:69;
defpred S1[ Nat] means ( $1 <= len Fr1 implies Sum (Fr1 | $1) = r * (Sum (Fr2 | $1)) );
A4: for i being Nat st S1[i] holds
S1[i + 1]
proof
let i be Nat; ::_thesis: ( S1[i] implies S1[i + 1] )
assume A5: S1[i] ; ::_thesis: S1[i + 1]
assume A6: i + 1 <= len Fr1 ; ::_thesis: Sum (Fr1 | (i + 1)) = r * (Sum (Fr2 | (i + 1)))
then i < len Fr1 by NAT_1:13;
then A7: i in len Fr1 by NAT_1:44;
then A8: Fr1 . i = r * (Fr2 . i) by A2;
( Sum (Fr1 | (i + 1)) = (Fr1 . i) + (Sum (Fr1 | i)) & Sum (Fr2 | (i + 1)) = (Fr2 . i) + (Sum (Fr2 | i)) ) by A1, A7, AFINSQ_2:65;
hence Sum (Fr1 | (i + 1)) = r * (Sum (Fr2 | (i + 1))) by A5, A6, A8, NAT_1:13; ::_thesis: verum
end;
A9: S1[ 0 ] ;
for i being Nat holds S1[i] from NAT_1:sch_2(A9, A4);
hence Sum Fr1 = r * (Sum Fr2) by A3; ::_thesis: verum
end;
theorem :: CATALAN2:45
for seq1, seq2 being Real_Sequence
for r being real number holds seq1 (##) (r (#) seq2) = r (#) (seq1 (##) seq2)
proof
let seq1, seq2 be Real_Sequence; ::_thesis: for r being real number holds seq1 (##) (r (#) seq2) = r (#) (seq1 (##) seq2)
let r be real number ; ::_thesis: seq1 (##) (r (#) seq2) = r (#) (seq1 (##) seq2)
set RS = r (#) seq2;
set S = seq1 (##) seq2;
now__::_thesis:_for_x_being_set_st_x_in_NAT_holds_
(seq1_(##)_(r_(#)_seq2))_._x_=_(r_(#)_(seq1_(##)_seq2))_._x
let x be set ; ::_thesis: ( x in NAT implies (seq1 (##) (r (#) seq2)) . x = (r (#) (seq1 (##) seq2)) . x )
assume x in NAT ; ::_thesis: (seq1 (##) (r (#) seq2)) . x = (r (#) (seq1 (##) seq2)) . x
then reconsider k = x as Element of NAT ;
consider Fr1 being XFinSequence of such that
A1: dom Fr1 = k + 1 and
A2: for n being Nat st n in k + 1 holds
Fr1 . n = (seq1 . n) * ((r (#) seq2) . (k -' n)) and
A3: Sum Fr1 = (seq1 (##) (r (#) seq2)) . k by Def4;
consider Fr2 being XFinSequence of such that
A4: dom Fr2 = k + 1 and
A5: for n being Nat st n in k + 1 holds
Fr2 . n = (seq1 . n) * (seq2 . (k -' n)) and
A6: Sum Fr2 = (seq1 (##) seq2) . k by Def4;
now__::_thesis:_for_n_being_Nat_st_n_in_len_Fr1_holds_
Fr1_._n_=_r_*_(Fr2_._n)
let n be Nat; ::_thesis: ( n in len Fr1 implies Fr1 . n = r * (Fr2 . n) )
assume n in len Fr1 ; ::_thesis: Fr1 . n = r * (Fr2 . n)
then A7: ( Fr1 . n = (seq1 . n) * ((r (#) seq2) . (k -' n)) & Fr2 . n = (seq1 . n) * (seq2 . (k -' n)) ) by A1, A2, A5;
(r (#) seq2) . (k -' n) = r * (seq2 . (k -' n)) by SEQ_1:9;
hence Fr1 . n = r * (Fr2 . n) by A7; ::_thesis: verum
end;
then Sum Fr1 = r * (Sum Fr2) by A1, A4, Th44;
hence (seq1 (##) (r (#) seq2)) . x = (r (#) (seq1 (##) seq2)) . x by A3, A6, SEQ_1:9; ::_thesis: verum
end;
hence seq1 (##) (r (#) seq2) = r (#) (seq1 (##) seq2) by FUNCT_2:12; ::_thesis: verum
end;
theorem :: CATALAN2:46
for seq1, seq2, seq3 being Real_Sequence holds seq1 (##) (seq2 + seq3) = (seq1 (##) seq2) + (seq1 (##) seq3)
proof
let seq1, seq2, seq3 be Real_Sequence; ::_thesis: seq1 (##) (seq2 + seq3) = (seq1 (##) seq2) + (seq1 (##) seq3)
set S = seq2 + seq3;
set S2 = seq1 (##) seq2;
set S3 = seq1 (##) seq3;
now__::_thesis:_for_x_being_set_st_x_in_NAT_holds_
(seq1_(##)_(seq2_+_seq3))_._x_=_((seq1_(##)_seq2)_+_(seq1_(##)_seq3))_._x
let x be set ; ::_thesis: ( x in NAT implies (seq1 (##) (seq2 + seq3)) . x = ((seq1 (##) seq2) + (seq1 (##) seq3)) . x )
assume x in NAT ; ::_thesis: (seq1 (##) (seq2 + seq3)) . x = ((seq1 (##) seq2) + (seq1 (##) seq3)) . x
then reconsider k = x as Element of NAT ;
consider Fr being XFinSequence of such that
A1: dom Fr = k + 1 and
A2: for n being Nat st n in k + 1 holds
Fr . n = (seq1 . n) * ((seq2 + seq3) . (k -' n)) and
A3: Sum Fr = (seq1 (##) (seq2 + seq3)) . k by Def4;
consider Fr1 being XFinSequence of such that
A4: dom Fr1 = k + 1 and
A5: for n being Nat st n in k + 1 holds
Fr1 . n = (seq1 . n) * (seq2 . (k -' n)) and
A6: Sum Fr1 = (seq1 (##) seq2) . k by Def4;
A7: len Fr1 = len Fr by A1, A4;
consider Fr2 being XFinSequence of such that
A8: dom Fr2 = k + 1 and
A9: for n being Nat st n in k + 1 holds
Fr2 . n = (seq1 . n) * (seq3 . (k -' n)) and
A10: Sum Fr2 = (seq1 (##) seq3) . k by Def4;
A11: for n being Nat st n in dom Fr holds
Fr . n = addreal . ((Fr1 . n),(Fr2 . n))
proof
let n be Nat; ::_thesis: ( n in dom Fr implies Fr . n = addreal . ((Fr1 . n),(Fr2 . n)) )
assume A12: n in dom Fr ; ::_thesis: Fr . n = addreal . ((Fr1 . n),(Fr2 . n))
A13: Fr . n = (seq1 . n) * ((seq2 + seq3) . (k -' n)) by A1, A2, A12;
A14: (seq2 + seq3) . (k -' n) = (seq2 . (k -' n)) + (seq3 . (k -' n)) by SEQ_1:7;
( Fr1 . n = (seq1 . n) * (seq2 . (k -' n)) & Fr2 . n = (seq1 . n) * (seq3 . (k -' n)) ) by A1, A5, A9, A12;
then Fr . n = (Fr1 . n) + (Fr2 . n) by A13, A14;
hence Fr . n = addreal . ((Fr1 . n),(Fr2 . n)) by BINOP_2:def_9; ::_thesis: verum
end;
len Fr1 = len Fr2 by A4, A8;
then addreal "**" (Fr1 ^ Fr2) = addreal "**" Fr by A11, A7, AFINSQ_2:46;
then Sum Fr = addreal "**" (Fr1 ^ Fr2) by AFINSQ_2:48;
then Sum Fr = Sum (Fr1 ^ Fr2) by AFINSQ_2:48;
then Sum Fr = (Sum Fr1) + (Sum Fr2) by AFINSQ_2:55;
hence (seq1 (##) (seq2 + seq3)) . x = ((seq1 (##) seq2) + (seq1 (##) seq3)) . x by A3, A6, A10, SEQ_1:7; ::_thesis: verum
end;
hence seq1 (##) (seq2 + seq3) = (seq1 (##) seq2) + (seq1 (##) seq3) by FUNCT_2:12; ::_thesis: verum
end;
theorem Th47: :: CATALAN2:47
for seq1, seq2 being Real_Sequence holds (seq1 (##) seq2) . 0 = (seq1 . 0) * (seq2 . 0)
proof
let seq1, seq2 be Real_Sequence; ::_thesis: (seq1 (##) seq2) . 0 = (seq1 . 0) * (seq2 . 0)
set S = (seq1 . 0) * (seq2 . 0);
consider Fr being XFinSequence of such that
A1: dom Fr = 0 + 1 and
A2: for n being Nat st n in 0 + 1 holds
Fr . n = (seq1 . n) * (seq2 . (0 -' n)) and
A3: Sum Fr = (seq1 (##) seq2) . 0 by Def4;
A4: ( 0 -' 0 = 0 & len Fr = 1 ) by A1, XREAL_1:232;
0 in 1 by NAT_1:44;
then Fr . 0 = (seq1 . 0) * (seq2 . (0 -' 0)) by A2;
then Fr = <%((seq1 . 0) * (seq2 . 0))%> by A4, AFINSQ_1:34;
hence (seq1 (##) seq2) . 0 = (seq1 . 0) * (seq2 . 0) by A3, AFINSQ_2:53; ::_thesis: verum
end;
theorem Th48: :: CATALAN2:48
for seq1, seq2 being Real_Sequence
for n being Nat ex Fr being XFinSequence of st
( (Partial_Sums (seq1 (##) seq2)) . n = Sum Fr & dom Fr = n + 1 & ( for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (n -' i)) ) )
proof
let seq1, seq2 be Real_Sequence; ::_thesis: for n being Nat ex Fr being XFinSequence of st
( (Partial_Sums (seq1 (##) seq2)) . n = Sum Fr & dom Fr = n + 1 & ( for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (n -' i)) ) )
let n be Nat; ::_thesis: ex Fr being XFinSequence of st
( (Partial_Sums (seq1 (##) seq2)) . n = Sum Fr & dom Fr = n + 1 & ( for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (n -' i)) ) )
set S = seq1 (##) seq2;
set P = Partial_Sums seq2;
defpred S1[ Nat] means ex Fr being XFinSequence of st
( (Partial_Sums (seq1 (##) seq2)) . $1 = Sum Fr & dom Fr = $1 + 1 & ( for i being Nat st i in $1 + 1 holds
Fr . i = (seq1 . i) * ((Partial_Sums seq2) . ($1 -' i)) ) );
A1: for n being Nat st S1[n] holds
S1[n + 1]
proof
set A = addreal ;
let n be Nat; ::_thesis: ( S1[n] implies S1[n + 1] )
set n1 = n + 1;
defpred S2[ set , set ] means for i being Nat st i = $1 holds
$2 = (seq1 . i) * ((Partial_Sums seq2) . ((n + 1) -' i));
A2: ( (n + 1) -' (n + 1) = 0 & (Partial_Sums seq2) . 0 = seq2 . 0 ) by SERIES_1:def_1, XREAL_1:232;
A3: for i being Nat st i in (n + 1) + 1 holds
ex x being Element of REAL st S2[i,x]
proof
let i be Nat; ::_thesis: ( i in (n + 1) + 1 implies ex x being Element of REAL st S2[i,x] )
assume i in (n + 1) + 1 ; ::_thesis: ex x being Element of REAL st S2[i,x]
take (seq1 . i) * ((Partial_Sums seq2) . ((n + 1) -' i)) ; ::_thesis: S2[i,(seq1 . i) * ((Partial_Sums seq2) . ((n + 1) -' i))]
thus S2[i,(seq1 . i) * ((Partial_Sums seq2) . ((n + 1) -' i))] ; ::_thesis: verum
end;
consider Fr2 being XFinSequence of such that
A4: dom Fr2 = (n + 1) + 1 and
A5: for i being Nat st i in (n + 1) + 1 holds
S2[i,Fr2 . i] from STIRL2_1:sch_5(A3);
assume S1[n] ; ::_thesis: S1[n + 1]
then consider Fr being XFinSequence of such that
A6: (Partial_Sums (seq1 (##) seq2)) . n = Sum Fr and
A7: dom Fr = n + 1 and
A8: for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (n -' i)) ;
consider Fr1 being XFinSequence of such that
A9: dom Fr1 = (n + 1) + 1 and
A10: for i being Nat st i in (n + 1) + 1 holds
Fr1 . i = (seq1 . i) * (seq2 . ((n + 1) -' i)) and
A11: Sum Fr1 = (seq1 (##) seq2) . (n + 1) by Def4;
A12: Fr1 | ((n + 1) + 1) = Fr1 by A9, RELAT_1:69;
A13: for i being Nat st i in dom (Fr2 | (n + 1)) holds
(Fr2 | (n + 1)) . i = addreal . ((Fr . i),((Fr1 | (n + 1)) . i))
proof
let i be Nat; ::_thesis: ( i in dom (Fr2 | (n + 1)) implies (Fr2 | (n + 1)) . i = addreal . ((Fr . i),((Fr1 | (n + 1)) . i)) )
assume A14: i in dom (Fr2 | (n + 1)) ; ::_thesis: (Fr2 | (n + 1)) . i = addreal . ((Fr . i),((Fr1 | (n + 1)) . i))
A15: i in (dom Fr2) /\ (n + 1) by A14, RELAT_1:61;
then i in dom (Fr1 | (n + 1)) by A9, A4, RELAT_1:61;
then A16: Fr1 . i = (Fr1 | (n + 1)) . i by FUNCT_1:47;
A17: i in n + 1 by A15, XBOOLE_0:def_4;
then A18: i < n + 1 by NAT_1:44;
then i <= n by NAT_1:13;
then A19: n -' i = n - i by XREAL_1:233;
( i in (n + 1) + 1 & i in NAT ) by A4, A15, XBOOLE_0:def_4;
then A20: ( Fr1 . i = (seq1 . i) * (seq2 . ((n + 1) -' i)) & Fr2 . i = (seq1 . i) * ((Partial_Sums seq2) . ((n + 1) -' i)) ) by A10, A5;
A21: Fr2 . i = (Fr2 | (n + 1)) . i by A14, FUNCT_1:47;
(n + 1) -' i = (n + 1) - i by A18, XREAL_1:233;
then (n -' i) + 1 = (n + 1) -' i by A19;
then A22: (Partial_Sums seq2) . ((n + 1) -' i) = ((Partial_Sums seq2) . (n -' i)) + (seq2 . ((n + 1) -' i)) by SERIES_1:def_1;
Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (n -' i)) by A8, A17;
then Fr2 . i = (Fr . i) + (Fr1 . i) by A20, A22;
hence (Fr2 | (n + 1)) . i = addreal . ((Fr . i),((Fr1 | (n + 1)) . i)) by A16, A21, BINOP_2:def_9; ::_thesis: verum
end;
n + 1 <= (n + 1) + 1 by NAT_1:11;
then A23: n + 1 c= (n + 1) + 1 by NAT_1:39;
then A24: len (Fr1 | (n + 1)) = len Fr by A7, A9, RELAT_1:62;
n + 1 < (n + 1) + 1 by NAT_1:13;
then A25: n + 1 in (n + 1) + 1 by NAT_1:44;
then A26: ( Fr1 . (n + 1) = (seq1 . (n + 1)) * (seq2 . ((n + 1) -' (n + 1))) & Sum (Fr1 | ((n + 1) + 1)) = (Fr1 . (n + 1)) + (Sum (Fr1 | (n + 1))) ) by A9, A10, AFINSQ_2:65;
len (Fr2 | (n + 1)) = len Fr by A7, A4, A23, RELAT_1:62;
then addreal "**" (Fr2 | (n + 1)) = addreal "**" (Fr ^ (Fr1 | (n + 1))) by A13, A24, AFINSQ_2:46
.= Sum (Fr ^ (Fr1 | (n + 1))) by AFINSQ_2:48
.= (Sum Fr) + (Sum (Fr1 | (n + 1))) by AFINSQ_2:55 ;
then A27: Sum (Fr2 | (n + 1)) = (Sum Fr) + (Sum (Fr1 | (n + 1))) by AFINSQ_2:48;
take Fr2 ; ::_thesis: ( (Partial_Sums (seq1 (##) seq2)) . (n + 1) = Sum Fr2 & dom Fr2 = (n + 1) + 1 & ( for i being Nat st i in (n + 1) + 1 holds
Fr2 . i = (seq1 . i) * ((Partial_Sums seq2) . ((n + 1) -' i)) ) )
( Fr2 . (n + 1) = (seq1 . (n + 1)) * ((Partial_Sums seq2) . ((n + 1) -' (n + 1))) & Sum (Fr2 | ((n + 1) + 1)) = (Fr2 . (n + 1)) + (Sum (Fr2 | (n + 1))) ) by A4, A5, A25, AFINSQ_2:65;
then ( Sum Fr2 = ((Partial_Sums (seq1 (##) seq2)) . n) + ((seq1 (##) seq2) . (n + 1)) & n in NAT & n + 1 in NAT ) by A6, A11, A4, A27, A2, A26, A12, ORDINAL1:def_12, RELAT_1:69;
hence ( (Partial_Sums (seq1 (##) seq2)) . (n + 1) = Sum Fr2 & dom Fr2 = (n + 1) + 1 & ( for i being Nat st i in (n + 1) + 1 holds
Fr2 . i = (seq1 . i) * ((Partial_Sums seq2) . ((n + 1) -' i)) ) ) by A4, A5, SERIES_1:def_1; ::_thesis: verum
end;
A28: S1[ 0 ]
proof
set Fr = 1 --> ((seq1 . 0) * (seq2 . 0));
reconsider Fr = 1 --> ((seq1 . 0) * (seq2 . 0)) as XFinSequence of ;
take Fr ; ::_thesis: ( (Partial_Sums (seq1 (##) seq2)) . 0 = Sum Fr & dom Fr = 0 + 1 & ( for i being Nat st i in 0 + 1 holds
Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (0 -' i)) ) )
A29: dom Fr = 1 by FUNCOP_1:13;
then A30: ( dom (Fr | 0) = 0 & Fr | 1 = Fr ) by RELAT_1:69;
A31: 0 in 1 by NAT_1:44;
then A32: Fr . 0 = (seq1 . 0) * (seq2 . 0) by FUNCOP_1:7;
(Sum (Fr | 0)) + (Fr . 0) = Sum (Fr | (0 + 1)) by A29, A31, AFINSQ_2:65;
then Sum Fr = (seq1 (##) seq2) . 0 by Th47, A32, A30;
hence ( (Partial_Sums (seq1 (##) seq2)) . 0 = Sum Fr & dom Fr = 0 + 1 ) by FUNCOP_1:13, SERIES_1:def_1; ::_thesis: for i being Nat st i in 0 + 1 holds
Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (0 -' i))
let i be Nat; ::_thesis: ( i in 0 + 1 implies Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (0 -' i)) )
assume A33: i in 0 + 1 ; ::_thesis: Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (0 -' i))
i < 1 by A33, NAT_1:44;
then A34: i = 0 by NAT_1:14;
then 0 -' i = 0 by XREAL_1:232;
then (Partial_Sums seq2) . (0 -' i) = seq2 . 0 by SERIES_1:def_1;
hence Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (0 -' i)) by A33, A34, FUNCOP_1:7; ::_thesis: verum
end;
for i being Nat holds S1[i] from NAT_1:sch_2(A28, A1);
hence ex Fr being XFinSequence of st
( (Partial_Sums (seq1 (##) seq2)) . n = Sum Fr & dom Fr = n + 1 & ( for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * ((Partial_Sums seq2) . (n -' i)) ) ) ; ::_thesis: verum
end;
theorem Th49: :: CATALAN2:49
for seq1, seq2 being Real_Sequence
for n being Nat st seq2 is summable holds
ex Fr being XFinSequence of st
( (Partial_Sums (seq1 (##) seq2)) . n = ((Sum seq2) * ((Partial_Sums seq1) . n)) - (Sum Fr) & dom Fr = n + 1 & ( for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * (Sum (seq2 ^\ ((n -' i) + 1))) ) )
proof
let seq1, seq2 be Real_Sequence; ::_thesis: for n being Nat st seq2 is summable holds
ex Fr being XFinSequence of st
( (Partial_Sums (seq1 (##) seq2)) . n = ((Sum seq2) * ((Partial_Sums seq1) . n)) - (Sum Fr) & dom Fr = n + 1 & ( for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * (Sum (seq2 ^\ ((n -' i) + 1))) ) )
let n be Nat; ::_thesis: ( seq2 is summable implies ex Fr being XFinSequence of st
( (Partial_Sums (seq1 (##) seq2)) . n = ((Sum seq2) * ((Partial_Sums seq1) . n)) - (Sum Fr) & dom Fr = n + 1 & ( for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * (Sum (seq2 ^\ ((n -' i) + 1))) ) ) )
assume A1: seq2 is summable ; ::_thesis: ex Fr being XFinSequence of st
( (Partial_Sums (seq1 (##) seq2)) . n = ((Sum seq2) * ((Partial_Sums seq1) . n)) - (Sum Fr) & dom Fr = n + 1 & ( for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * (Sum (seq2 ^\ ((n -' i) + 1))) ) )
defpred S1[ set , set ] means for i being Nat st i = $1 holds
$2 = (seq1 . i) * (Sum (seq2 ^\ ((n -' i) + 1)));
set P2 = Partial_Sums seq2;
set P1 = Partial_Sums seq1;
set S = seq1 (##) seq2;
A2: for i being Nat st i in n + 1 holds
ex x being Element of REAL st S1[i,x]
proof
let i be Nat; ::_thesis: ( i in n + 1 implies ex x being Element of REAL st S1[i,x] )
assume i in n + 1 ; ::_thesis: ex x being Element of REAL st S1[i,x]
take (seq1 . i) * (Sum (seq2 ^\ ((n -' i) + 1))) ; ::_thesis: S1[i,(seq1 . i) * (Sum (seq2 ^\ ((n -' i) + 1)))]
thus S1[i,(seq1 . i) * (Sum (seq2 ^\ ((n -' i) + 1)))] ; ::_thesis: verum
end;
consider Fr being XFinSequence of such that
A3: dom Fr = n + 1 and
A4: for i being Nat st i in n + 1 holds
S1[i,Fr . i] from STIRL2_1:sch_5(A2);
consider Fr1 being XFinSequence of such that
A5: (Partial_Sums (seq1 (##) seq2)) . n = Sum Fr1 and
A6: dom Fr1 = n + 1 and
A7: for i being Nat st i in n + 1 holds
Fr1 . i = (seq1 . i) * ((Partial_Sums seq2) . (n -' i)) by Th48;
A8: 0 in n + 1 by NAT_1:44;
then A9: ( Fr1 . 0 = (seq1 . 0) * ((Partial_Sums seq2) . (n -' 0)) & Sum (Fr1 | (0 + 1)) = (Fr1 . 0) + (Sum (Fr1 | 0)) ) by A6, A7, AFINSQ_2:65;
defpred S2[ Nat] means ( $1 + 1 <= n + 1 implies (Sum (Fr1 | ($1 + 1))) + (Sum (Fr | ($1 + 1))) = (Sum seq2) * ((Partial_Sums seq1) . $1) );
A10: for k being Nat st S2[k] holds
S2[k + 1]
proof
let k be Nat; ::_thesis: ( S2[k] implies S2[k + 1] )
assume A11: S2[k] ; ::_thesis: S2[k + 1]
reconsider k1 = k + 1 as Element of NAT ;
assume A12: (k + 1) + 1 <= n + 1 ; ::_thesis: (Sum (Fr1 | ((k + 1) + 1))) + (Sum (Fr | ((k + 1) + 1))) = (Sum seq2) * ((Partial_Sums seq1) . (k + 1))
then k1 < n + 1 by NAT_1:13;
then A13: k1 in n + 1 by NAT_1:44;
then A14: ( Fr . k1 = (seq1 . k1) * (Sum (seq2 ^\ ((n -' k1) + 1))) & Sum (Fr1 | (k1 + 1)) = (Fr1 . k1) + (Sum (Fr1 | k1)) ) by A4, A6, AFINSQ_2:65;
A15: (Sum (Fr1 | k1)) + (Sum (Fr | k1)) = (Sum seq2) * ((Partial_Sums seq1) . k) by A12, A11, NAT_1:13;
A16: k in NAT by ORDINAL1:def_12;
( Sum (Fr | (k1 + 1)) = (Fr . k1) + (Sum (Fr | k1)) & Fr1 . k1 = (seq1 . k1) * ((Partial_Sums seq2) . (n -' k1)) ) by A3, A7, A13, AFINSQ_2:65;
then (Sum (Fr | (k1 + 1))) + (Sum (Fr1 | (k1 + 1))) = ((seq1 . k1) * ((Sum (seq2 ^\ ((n -' k1) + 1))) + ((Partial_Sums seq2) . (n -' k1)))) + ((Sum seq2) * ((Partial_Sums seq1) . k)) by A15, A14
.= ((seq1 . k1) * (Sum seq2)) + ((Sum seq2) * ((Partial_Sums seq1) . k)) by A1, SERIES_1:15
.= (Sum seq2) * (((Partial_Sums seq1) . k) + (seq1 . k1))
.= ((Partial_Sums seq1) . k1) * (Sum seq2) by A16, SERIES_1:def_1 ;
hence (Sum (Fr1 | ((k + 1) + 1))) + (Sum (Fr | ((k + 1) + 1))) = (Sum seq2) * ((Partial_Sums seq1) . (k + 1)) ; ::_thesis: verum
end;
( Sum (Fr | (0 + 1)) = (Fr . 0) + (Sum (Fr | 0)) & Fr . 0 = (seq1 . 0) * (Sum (seq2 ^\ ((n -' 0) + 1))) ) by A3, A4, A8, AFINSQ_2:65;
then (Sum (Fr | (0 + 1))) + (Sum (Fr1 | (0 + 1))) = (seq1 . 0) * ((Sum (seq2 ^\ ((n -' 0) + 1))) + ((Partial_Sums seq2) . (n -' 0))) by A9
.= (seq1 . 0) * (Sum seq2) by A1, SERIES_1:15 ;
then A17: S2[ 0 ] by SERIES_1:def_1;
A18: for k being Nat holds S2[k] from NAT_1:sch_2(A17, A10);
take Fr ; ::_thesis: ( (Partial_Sums (seq1 (##) seq2)) . n = ((Sum seq2) * ((Partial_Sums seq1) . n)) - (Sum Fr) & dom Fr = n + 1 & ( for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * (Sum (seq2 ^\ ((n -' i) + 1))) ) )
A19: Fr1 | (n + 1) = Fr1 by A6, RELAT_1:69;
Fr | (n + 1) = Fr by A3, RELAT_1:69;
then (Sum Fr1) + (Sum Fr) = (Sum seq2) * ((Partial_Sums seq1) . n) by A18, A19;
hence ( (Partial_Sums (seq1 (##) seq2)) . n = ((Sum seq2) * ((Partial_Sums seq1) . n)) - (Sum Fr) & dom Fr = n + 1 & ( for i being Nat st i in n + 1 holds
Fr . i = (seq1 . i) * (Sum (seq2 ^\ ((n -' i) + 1))) ) ) by A3, A4, A5; ::_thesis: verum
end;
theorem Th50: :: CATALAN2:50
for Fr being XFinSequence of ex absFr being XFinSequence of st
( dom absFr = dom Fr & abs (Sum Fr) <= Sum absFr & ( for i being Nat st i in dom absFr holds
absFr . i = abs (Fr . i) ) )
proof
let Fr be XFinSequence of ; ::_thesis: ex absFr being XFinSequence of st
( dom absFr = dom Fr & abs (Sum Fr) <= Sum absFr & ( for i being Nat st i in dom absFr holds
absFr . i = abs (Fr . i) ) )
defpred S1[ set , set ] means $2 = abs (Fr . $1);
A1: Fr | (dom Fr) = Fr ;
A2: for i being Nat st i in len Fr holds
ex x being Element of REAL st S1[i,x] ;
consider absFr being XFinSequence of such that
A3: dom absFr = len Fr and
A4: for i being Nat st i in len Fr holds
S1[i,absFr . i] from STIRL2_1:sch_5(A2);
defpred S2[ Nat] means ( $1 <= len Fr implies abs (Sum (Fr | $1)) <= Sum (absFr | $1) );
A5: for i being Nat st S2[i] holds
S2[i + 1]
proof
let i be Nat; ::_thesis: ( S2[i] implies S2[i + 1] )
assume A6: S2[i] ; ::_thesis: S2[i + 1]
set i1 = i + 1;
assume A7: i + 1 <= len Fr ; ::_thesis: abs (Sum (Fr | (i + 1))) <= Sum (absFr | (i + 1))
then i < len Fr by NAT_1:13;
then A8: i in dom Fr by NAT_1:44;
then ( Sum (Fr | (i + 1)) = (Fr . i) + (Sum (Fr | i)) & absFr . i = abs (Fr . i) ) by A4, AFINSQ_2:65;
then A9: abs (Sum (Fr | (i + 1))) <= (absFr . i) + (abs (Sum (Fr | i))) by COMPLEX1:56;
Sum (absFr | (i + 1)) = (absFr . i) + (Sum (absFr | i)) by A3, A8, AFINSQ_2:65;
then (absFr . i) + (abs (Sum (Fr | i))) <= Sum (absFr | (i + 1)) by A6, A7, NAT_1:13, XREAL_1:7;
hence abs (Sum (Fr | (i + 1))) <= Sum (absFr | (i + 1)) by A9, XXREAL_0:2; ::_thesis: verum
end;
take absFr ; ::_thesis: ( dom absFr = dom Fr & abs (Sum Fr) <= Sum absFr & ( for i being Nat st i in dom absFr holds
absFr . i = abs (Fr . i) ) )
A10: S2[ 0 ] by COMPLEX1:44;
for i being Nat holds S2[i] from NAT_1:sch_2(A10, A5);
then abs (Sum (Fr | (len Fr))) <= Sum (absFr | (len Fr)) ;
hence ( dom absFr = dom Fr & abs (Sum Fr) <= Sum absFr & ( for i being Nat st i in dom absFr holds
absFr . i = abs (Fr . i) ) ) by A3, A4, A1, RELAT_1:69; ::_thesis: verum
end;
theorem Th51: :: CATALAN2:51
for seq1 being Real_Sequence st seq1 is summable holds
ex r being real number st
( 0 < r & ( for k being Nat holds abs (Sum (seq1 ^\ k)) < r ) )
proof
let seq1 be Real_Sequence; ::_thesis: ( seq1 is summable implies ex r being real number st
( 0 < r & ( for k being Nat holds abs (Sum (seq1 ^\ k)) < r ) ) )
assume A1: seq1 is summable ; ::_thesis: ex r being real number st
( 0 < r & ( for k being Nat holds abs (Sum (seq1 ^\ k)) < r ) )
defpred S1[ Nat] means ex r being real number st
( r >= 0 & ( for i being Nat st i <= $1 holds
abs (Sum (seq1 ^\ i)) <= r ) );
A2: for k being Nat st S1[k] holds
S1[k + 1]
proof
let k be Nat; ::_thesis: ( S1[k] implies S1[k + 1] )
assume S1[k] ; ::_thesis: S1[k + 1]
then consider r being real number such that
A3: r >= 0 and
A4: for i being Nat st i <= k holds
abs (Sum (seq1 ^\ i)) <= r ;
take M = max (r,(abs (Sum (seq1 ^\ (k + 1))))); ::_thesis: ( M >= 0 & ( for i being Nat st i <= k + 1 holds
abs (Sum (seq1 ^\ i)) <= M ) )
thus M >= 0 by A3, XXREAL_0:25; ::_thesis: for i being Nat st i <= k + 1 holds
abs (Sum (seq1 ^\ i)) <= M
let i be Nat; ::_thesis: ( i <= k + 1 implies abs (Sum (seq1 ^\ i)) <= M )
assume A5: i <= k + 1 ; ::_thesis: abs (Sum (seq1 ^\ i)) <= M
now__::_thesis:_abs_(Sum_(seq1_^\_i))_<=_M
percases ( i = k + 1 or i <= k ) by A5, NAT_1:8;
suppose i = k + 1 ; ::_thesis: abs (Sum (seq1 ^\ i)) <= M
hence abs (Sum (seq1 ^\ i)) <= M by XXREAL_0:25; ::_thesis: verum
end;
supposeA6: i <= k ; ::_thesis: abs (Sum (seq1 ^\ i)) <= M
A7: r <= M by XXREAL_0:25;
abs (Sum (seq1 ^\ i)) <= r by A4, A6;
hence abs (Sum (seq1 ^\ i)) <= M by A7, XXREAL_0:2; ::_thesis: verum
end;
end;
end;
hence abs (Sum (seq1 ^\ i)) <= M ; ::_thesis: verum
end;
set P = Partial_Sums seq1;
A8: lim (Partial_Sums seq1) = Sum seq1 by SERIES_1:def_3;
Partial_Sums seq1 is convergent by A1, SERIES_1:def_2;
then consider n being Element of NAT such that
A9: for m being Element of NAT st n <= m holds
abs (((Partial_Sums seq1) . m) - (Sum seq1)) < 1 by A8, SEQ_2:def_7;
A10: S1[ 0 ]
proof
take abs (Sum seq1) ; ::_thesis: ( abs (Sum seq1) >= 0 & ( for i being Nat st i <= 0 holds
abs (Sum (seq1 ^\ i)) <= abs (Sum seq1) ) )
thus abs (Sum seq1) >= 0 by COMPLEX1:46; ::_thesis: for i being Nat st i <= 0 holds
abs (Sum (seq1 ^\ i)) <= abs (Sum seq1)
let i be Nat; ::_thesis: ( i <= 0 implies abs (Sum (seq1 ^\ i)) <= abs (Sum seq1) )
assume i <= 0 ; ::_thesis: abs (Sum (seq1 ^\ i)) <= abs (Sum seq1)
then i = 0 ;
hence abs (Sum (seq1 ^\ i)) <= abs (Sum seq1) by NAT_1:47; ::_thesis: verum
end;
for k being Nat holds S1[k] from NAT_1:sch_2(A10, A2);
then consider r being real number such that
A11: r >= 0 and
A12: for i being Nat st i <= n holds
abs (Sum (seq1 ^\ i)) <= r ;
take r1 = r + 1; ::_thesis: ( 0 < r1 & ( for k being Nat holds abs (Sum (seq1 ^\ k)) < r1 ) )
thus r1 > 0 by A11; ::_thesis: for k being Nat holds abs (Sum (seq1 ^\ k)) < r1
let k be Nat; ::_thesis: abs (Sum (seq1 ^\ k)) < r1
now__::_thesis:_abs_(Sum_(seq1_^\_k))_<_r1
percases ( k <= n or k > n ) ;
supposeA13: k <= n ; ::_thesis: abs (Sum (seq1 ^\ k)) < r1
A14: 0 + r < r1 by XREAL_1:8;
abs (Sum (seq1 ^\ k)) <= r by A12, A13;
hence abs (Sum (seq1 ^\ k)) < r1 by A14, XXREAL_0:2; ::_thesis: verum
end;
supposeA15: k > n ; ::_thesis: abs (Sum (seq1 ^\ k)) < r1
then reconsider k1 = k - 1 as Element of NAT by NAT_1:20;
k1 + 1 > n by A15;
then k1 >= n by NAT_1:13;
then A16: abs (((Partial_Sums seq1) . k1) - (Sum seq1)) < 1 by A9;
Sum seq1 = ((Partial_Sums seq1) . k1) + (Sum (seq1 ^\ (k1 + 1))) by A1, SERIES_1:15;
then abs (- (Sum (seq1 ^\ (k1 + 1)))) < 1 by A16;
then A17: abs (Sum (seq1 ^\ (k1 + 1))) < 1 by COMPLEX1:52;
1 + 0 <= r1 by A11, XREAL_1:6;
hence abs (Sum (seq1 ^\ k)) < r1 by A17, XXREAL_0:2; ::_thesis: verum
end;
end;
end;
hence abs (Sum (seq1 ^\ k)) < r1 ; ::_thesis: verum
end;
theorem Th52: :: CATALAN2:52
for seq1 being Real_Sequence
for n, m being Nat st n <= m & ( for i being Nat holds seq1 . i >= 0 ) holds
(Partial_Sums seq1) . n <= (Partial_Sums seq1) . m
proof
let seq1 be Real_Sequence; ::_thesis: for n, m being Nat st n <= m & ( for i being Nat holds seq1 . i >= 0 ) holds
(Partial_Sums seq1) . n <= (Partial_Sums seq1) . m
let n, m be Nat; ::_thesis: ( n <= m & ( for i being Nat holds seq1 . i >= 0 ) implies (Partial_Sums seq1) . n <= (Partial_Sums seq1) . m )
assume that
A1: n <= m and
A2: for i being Nat holds seq1 . i >= 0 ; ::_thesis: (Partial_Sums seq1) . n <= (Partial_Sums seq1) . m
set S = Partial_Sums seq1;
defpred S1[ Nat] means (Partial_Sums seq1) . n <= (Partial_Sums seq1) . (n + $1);
A3: for i being Nat st S1[i] holds
S1[i + 1]
proof
let i be Nat; ::_thesis: ( S1[i] implies S1[i + 1] )
assume A4: S1[i] ; ::_thesis: S1[i + 1]
set ni = n + i;
( (Partial_Sums seq1) . ((n + i) + 1) = ((Partial_Sums seq1) . (n + i)) + (seq1 . ((n + i) + 1)) & seq1 . ((n + i) + 1) >= 0 ) by A2, SERIES_1:def_1;
then (Partial_Sums seq1) . ((n + i) + 1) >= ((Partial_Sums seq1) . (n + i)) + 0 by XREAL_1:6;
hence S1[i + 1] by A4, XXREAL_0:2; ::_thesis: verum
end;
A5: S1[ 0 ] ;
A6: for i being Nat holds S1[i] from NAT_1:sch_2(A5, A3);
reconsider m9 = m, n9 = n as Nat ;
A7: n9 + (m9 - n9) = m9 ;
m9 - n9 is Element of NAT by A1, NAT_1:21;
hence (Partial_Sums seq1) . n <= (Partial_Sums seq1) . m by A6, A7; ::_thesis: verum
end;
theorem Th53: :: CATALAN2:53
for seq1, seq2 being Real_Sequence st seq1 is absolutely_summable & seq2 is summable holds
( seq1 (##) seq2 is summable & Sum (seq1 (##) seq2) = (Sum seq1) * (Sum seq2) )
proof
let seq1, seq2 be Real_Sequence; ::_thesis: ( seq1 is absolutely_summable & seq2 is summable implies ( seq1 (##) seq2 is summable & Sum (seq1 (##) seq2) = (Sum seq1) * (Sum seq2) ) )
assume that
A1: seq1 is absolutely_summable and
A2: seq2 is summable ; ::_thesis: ( seq1 (##) seq2 is summable & Sum (seq1 (##) seq2) = (Sum seq1) * (Sum seq2) )
set S2 = Sum seq2;
set S1 = Sum seq1;
set PA = Partial_Sums (abs seq1);
set P2 = Partial_Sums seq2;
set P1 = Partial_Sums seq1;
set S = seq1 (##) seq2;
set P = Partial_Sums (seq1 (##) seq2);
A3: for e being real number st 0 < e holds
ex n being Element of NAT st
for m being Element of NAT st n <= m holds
abs (((Partial_Sums (seq1 (##) seq2)) . m) - ((Sum seq1) * (Sum seq2))) < e
proof
seq1 is summable by A1;
then A4: Partial_Sums seq1 is convergent by SERIES_1:def_2;
let e be real number ; ::_thesis: ( 0 < e implies ex n being Element of NAT st
for m being Element of NAT st n <= m holds
abs (((Partial_Sums (seq1 (##) seq2)) . m) - ((Sum seq1) * (Sum seq2))) < e )
assume A5: 0 < e ; ::_thesis: ex n being Element of NAT st
for m being Element of NAT st n <= m holds
abs (((Partial_Sums (seq1 (##) seq2)) . m) - ((Sum seq1) * (Sum seq2))) < e
set e1 = e / (3 * ((abs (Sum seq2)) + 1));
(abs (Sum seq2)) + 1 > 0 + 0 by COMPLEX1:46, XREAL_1:8;
then A6: 3 * ((abs (Sum seq2)) + 1) > 3 * 0 by XREAL_1:68;
then ( lim (Partial_Sums seq1) = Sum seq1 & e / (3 * ((abs (Sum seq2)) + 1)) > 0 ) by A5, SERIES_1:def_3, XREAL_1:139;
then consider n0 being Element of NAT such that
A7: for n being Element of NAT st n0 <= n holds
abs (((Partial_Sums seq1) . n) - (Sum seq1)) < e / (3 * ((abs (Sum seq2)) + 1)) by A4, SEQ_2:def_7;
set e3 = e / (3 * ((Sum (abs seq1)) + 1));
A8: ( max (1,n0) = 1 or max (1,n0) = n0 ) by XXREAL_0:16;
(abs (Sum seq2)) + 1 > 0 + 0 by COMPLEX1:46, XREAL_1:8;
then A9: (e / (3 * ((abs (Sum seq2)) + 1))) * ((abs (Sum seq2)) + 1) = e / 3 by XCMPLX_1:92;
A10: ( Partial_Sums seq2 is convergent & lim (Partial_Sums seq2) = Sum seq2 ) by A2, SERIES_1:def_2, SERIES_1:def_3;
consider r being real number such that
A11: 0 < r and
A12: for k being Nat holds abs (Sum (seq2 ^\ k)) < r by A2, Th51;
set e2 = e / (3 * r);
A13: (abs (Sum seq2)) + 1 > (abs (Sum seq2)) + 0 by XREAL_1:8;
A14: now__::_thesis:_for_n_being_Nat_holds_(abs_seq1)_._n_>=_0
let n be Nat; ::_thesis: (abs seq1) . n >= 0
n in NAT by ORDINAL1:def_12;
then abs (seq1 . n) = (abs seq1) . n by SEQ_1:12;
hence (abs seq1) . n >= 0 by COMPLEX1:46; ::_thesis: verum
end;
then A15: for n being Element of NAT holds (abs seq1) . n >= 0 ;
A16: abs seq1 is summable by A1, SERIES_1:def_4;
then Sum (abs seq1) >= 0 by A15, SERIES_1:18;
then A17: ((Sum (abs seq1)) + 1) * (e / (3 * ((Sum (abs seq1)) + 1))) = e / 3 by XCMPLX_1:92;
A18: Sum (abs seq1) >= 0 by A16, A15, SERIES_1:18;
then 3 * ((Sum (abs seq1)) + 1) > 0 * 3 by XREAL_1:68;
then e / (3 * ((Sum (abs seq1)) + 1)) > 0 by A5, XREAL_1:139;
then consider n2 being Element of NAT such that
A19: for n being Element of NAT st n2 <= n holds
abs (((Partial_Sums seq2) . n) - (Sum seq2)) < e / (3 * ((Sum (abs seq1)) + 1)) by A10, SEQ_2:def_7;
3 * r > 0 * 3 by A11, XREAL_1:68;
then e / (3 * r) > 0 by A5, XREAL_1:139;
then consider n1 being Element of NAT such that
A20: for n being Element of NAT st n1 <= n holds
abs (((Partial_Sums (abs seq1)) . n) - ((Partial_Sums (abs seq1)) . n1)) < e / (3 * r) by A16, SERIES_1:21;
( max ((n1 + 1),n2) = n1 + 1 or max ((n1 + 1),n2) = n2 ) by XXREAL_0:16;
then reconsider M = max ((max (1,n0)),(max ((n1 + 1),n2))) as Element of NAT by A8, XXREAL_0:16;
A21: max ((n1 + 1),n2) <= M by XXREAL_0:25;
take 2M = M * 2; ::_thesis: for m being Element of NAT st 2M <= m holds
abs (((Partial_Sums (seq1 (##) seq2)) . m) - ((Sum seq1) * (Sum seq2))) < e
let m be Element of NAT ; ::_thesis: ( 2M <= m implies abs (((Partial_Sums (seq1 (##) seq2)) . m) - ((Sum seq1) * (Sum seq2))) < e )
assume A22: 2M <= m ; ::_thesis: abs (((Partial_Sums (seq1 (##) seq2)) . m) - ((Sum seq1) * (Sum seq2))) < e
A23: max (1,n0) <= M by XXREAL_0:25;
then 0 < M by XXREAL_0:25;
then reconsider M1 = M - 1 as Element of NAT by NAT_1:20;
A24: M = M1 + 1 ;
A25: n1 + 1 <= max ((n1 + 1),n2) by XXREAL_0:25;
then M1 + 1 >= n1 + 1 by A21, XXREAL_0:2;
then M1 >= n1 by XREAL_1:8;
then (Partial_Sums (abs seq1)) . M1 >= (Partial_Sums (abs seq1)) . n1 by A14, Th52;
then ((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . M1) <= ((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . n1) by XREAL_1:10;
then A26: r * (((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . M1)) <= r * (((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . n1)) by A11, XREAL_1:64;
consider Fr being XFinSequence of such that
A27: (Partial_Sums (seq1 (##) seq2)) . m = ((Sum seq2) * ((Partial_Sums seq1) . m)) - (Sum Fr) and
A28: dom Fr = m + 1 and
A29: for i being Nat st i in m + 1 holds
Fr . i = (seq1 . i) * (Sum (seq2 ^\ ((m -' i) + 1))) by A2, Th49;
consider absFr being XFinSequence of such that
A30: dom absFr = dom Fr and
A31: abs (Sum Fr) <= Sum absFr and
A32: for i being Nat st i in dom absFr holds
absFr . i = abs (Fr . i) by Th50;
A33: M <= M + M by NAT_1:11;
then A34: M <= m by A22, XXREAL_0:2;
then M < len absFr by A28, A30, NAT_1:13;
then A35: len (absFr | M) = M by AFINSQ_1:11;
n1 + 1 <= M by A25, A21, XXREAL_0:2;
then n1 + 1 <= m by A34, XXREAL_0:2;
then A36: n1 <= m by NAT_1:13;
then (Partial_Sums (abs seq1)) . m >= (Partial_Sums (abs seq1)) . n1 by A14, Th52;
then ((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . n1) >= ((Partial_Sums (abs seq1)) . n1) - ((Partial_Sums (abs seq1)) . n1) by XREAL_1:9;
then A37: abs (((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . n1)) = ((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . n1) by ABSVALUE:def_1;
consider Fr1 being XFinSequence of such that
A38: absFr = (absFr | M) ^ Fr1 by Th1;
A39: m + 1 = (len (absFr | M)) + (len Fr1) by A28, A30, A38, AFINSQ_1:def_3;
then A40: Fr1 | ((m - M) + 1) = Fr1 by A35, RELAT_1:69;
A41: n2 <= max ((n1 + 1),n2) by XXREAL_0:25;
then n2 <= M by A21, XXREAL_0:2;
then n2 <= 2M by A33, XXREAL_0:2;
then ( n2 <= m & m in NAT ) by A22, XXREAL_0:2;
then A42: abs (((Partial_Sums seq2) . m) - (Sum seq2)) < e / (3 * ((Sum (abs seq1)) + 1)) by A19;
defpred S1[ Nat] means ( (M + $1) + 1 <= m + 1 implies Sum (Fr1 | ($1 + 1)) <= r * (((Partial_Sums (abs seq1)) . (M + $1)) - ((Partial_Sums (abs seq1)) . M1)) );
A43: for k being Nat st S1[k] holds
S1[k + 1]
proof
let k be Nat; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A44: S1[k] ; ::_thesis: S1[k + 1]
set k1 = k + 1;
set Mk1 = M + (k + 1);
A45: abs (seq1 . (M + (k + 1))) = (abs seq1) . (M + (k + 1)) by SEQ_1:12;
assume A46: (M + (k + 1)) + 1 <= m + 1 ; ::_thesis: Sum (Fr1 | ((k + 1) + 1)) <= r * (((Partial_Sums (abs seq1)) . (M + (k + 1))) - ((Partial_Sums (abs seq1)) . M1))
then A47: M + (k + 1) < m + 1 by NAT_1:13;
then A48: M + (k + 1) in m + 1 by NAT_1:44;
then Fr . (M + (k + 1)) = (seq1 . (M + (k + 1))) * (Sum (seq2 ^\ ((m -' (M + (k + 1))) + 1))) by A29;
then A49: abs (Fr . (M + (k + 1))) = (abs (seq1 . (M + (k + 1)))) * (abs (Sum (seq2 ^\ ((m -' (M + (k + 1))) + 1)))) by COMPLEX1:65;
M + (k + 1) < m + 1 by A46, NAT_1:13;
then k + 1 < len Fr1 by A39, A35, XREAL_1:7;
then k + 1 in len Fr1 by NAT_1:44;
then A50: Sum (Fr1 | ((k + 1) + 1)) = (Fr1 . (k + 1)) + (Sum (Fr1 | (k + 1))) by AFINSQ_2:65;
m + 1 = len absFr by A28, A30;
then absFr . (M + (k + 1)) = Fr1 . ((M + (k + 1)) - M) by A38, A35, A47, AFINSQ_1:19, NAT_1:11;
then A51: Fr1 . (k + 1) = abs (Fr . (M + (k + 1))) by A28, A30, A32, A48;
( abs (seq1 . (M + (k + 1))) >= 0 & abs (Sum (seq2 ^\ ((m -' (M + (k + 1))) + 1))) < r ) by A12, COMPLEX1:46;
then Fr1 . (k + 1) <= r * (abs (seq1 . (M + (k + 1)))) by A51, A49, XREAL_1:64;
then Sum (Fr1 | ((k + 1) + 1)) <= (r * ((abs seq1) . (M + (k + 1)))) + (r * (((Partial_Sums (abs seq1)) . (M + k)) - ((Partial_Sums (abs seq1)) . M1))) by A44, A46, A50, A45, NAT_1:13, XREAL_1:7;
then Sum (Fr1 | ((k + 1) + 1)) <= r * ((((abs seq1) . (M + (k + 1))) + ((Partial_Sums (abs seq1)) . (M + k))) - ((Partial_Sums (abs seq1)) . M1)) ;
then Sum (Fr1 | ((k + 1) + 1)) <= r * (((Partial_Sums (abs seq1)) . ((M + k) + 1)) - ((Partial_Sums (abs seq1)) . M1)) by SERIES_1:def_1;
hence Sum (Fr1 | ((k + 1) + 1)) <= r * (((Partial_Sums (abs seq1)) . (M + (k + 1))) - ((Partial_Sums (abs seq1)) . M1)) ; ::_thesis: verum
end;
abs (((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . n1)) < e / (3 * r) by A20, A36;
then r * (((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . n1)) <= r * (e / (3 * r)) by A11, A37, XREAL_1:64;
then A52: r * (((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . M1)) <= r * (e / (3 * r)) by A26, XXREAL_0:2;
A53: ( m = M + (m - M) & m - M = m -' M ) by A22, A33, XREAL_1:233, XXREAL_0:2;
A54: S1[ 0 ]
proof
assume A55: (M + 0) + 1 <= m + 1 ; ::_thesis: Sum (Fr1 | (0 + 1)) <= r * (((Partial_Sums (abs seq1)) . (M + 0)) - ((Partial_Sums (abs seq1)) . M1))
then A56: M < m + 1 by NAT_1:13;
then A57: M in m + 1 by NAT_1:44;
then A58: Fr . M = (seq1 . M) * (Sum (seq2 ^\ ((m -' M) + 1))) by A29;
(M + 1) - M <= (m + 1) - M by A55, XREAL_1:9;
then 1 c= len Fr1 by A39, A35, NAT_1:39;
then A59: dom (Fr1 | 1) = 1 by RELAT_1:62;
m + 1 = len absFr by A28, A30;
then absFr . M = Fr1 . (M - M) by A38, A35, A56, AFINSQ_1:19;
then Fr1 . 0 = abs (Fr . M) by A28, A30, A32, A57;
then A60: Fr1 . 0 = (abs (seq1 . M)) * (abs (Sum (seq2 ^\ ((m -' M) + 1)))) by A58, COMPLEX1:65;
A61: ( abs (seq1 . M) >= 0 & r > abs (Sum (seq2 ^\ ((m -' M) + 1))) ) by A12, COMPLEX1:46;
0 in 1 by NAT_1:44;
then A62: (Fr1 | 1) . 0 = Fr1 . 0 by A59, FUNCT_1:47;
((Partial_Sums (abs seq1)) . M1) + ((abs seq1) . (M1 + 1)) = (Partial_Sums (abs seq1)) . (M1 + 1) by SERIES_1:def_1;
then A63: ((Partial_Sums (abs seq1)) . M) - ((Partial_Sums (abs seq1)) . M1) = abs (seq1 . M) by SEQ_1:12;
Sum (Fr1 | 1) = (Fr1 | 1) . 0 by A59, Lm3;
hence Sum (Fr1 | (0 + 1)) <= r * (((Partial_Sums (abs seq1)) . (M + 0)) - ((Partial_Sums (abs seq1)) . M1)) by A62, A60, A63, A61, XREAL_1:64; ::_thesis: verum
end;
for k being Nat holds S1[k] from NAT_1:sch_2(A54, A43);
then Sum Fr1 <= r * (((Partial_Sums (abs seq1)) . m) - ((Partial_Sums (abs seq1)) . M1)) by A40, A53;
then Sum Fr1 <= r * (e / (3 * r)) by A52, XXREAL_0:2;
then A64: Sum Fr1 <= e / 3 by A11, XCMPLX_1:92;
(abs seq1) . 0 >= 0 by A14;
then A65: ((abs seq1) . 0) * (abs (((Partial_Sums seq2) . m) - (Sum seq2))) <= (e / (3 * ((Sum (abs seq1)) + 1))) * ((abs seq1) . 0) by A42, XREAL_1:64;
A66: 0 in m + 1 by NAT_1:44;
then A67: Fr . 0 = (seq1 . 0) * (Sum (seq2 ^\ ((m -' 0) + 1))) by A29;
(Partial_Sums (abs seq1)) . M1 <= Sum (abs seq1) by A15, A16, RSSPACE2:3;
then A68: (e / (3 * ((Sum (abs seq1)) + 1))) * ((Partial_Sums (abs seq1)) . M1) <= (e / (3 * ((Sum (abs seq1)) + 1))) * (Sum (abs seq1)) by A5, A18, XREAL_1:64;
( Sum seq2 = ((Partial_Sums seq2) . (m -' 0)) + (Sum (seq2 ^\ ((m -' 0) + 1))) & m -' 0 = m ) by A2, NAT_D:40, SERIES_1:15;
then A69: Sum (seq2 ^\ ((m -' 0) + 1)) = (Sum seq2) - ((Partial_Sums seq2) . m) ;
n0 <= max (1,n0) by XXREAL_0:25;
then n0 <= M by A23, XXREAL_0:2;
then ( n0 <= m & m in NAT ) by A34, XXREAL_0:2;
then A70: abs (((Partial_Sums seq1) . m) - (Sum seq1)) < e / (3 * ((abs (Sum seq2)) + 1)) by A7;
( abs ((Sum seq2) * (((Partial_Sums seq1) . m) - (Sum seq1))) = (abs (Sum seq2)) * (abs (((Partial_Sums seq1) . m) - (Sum seq1))) & abs (Sum seq2) >= 0 ) by COMPLEX1:46, COMPLEX1:65;
then A71: abs ((Sum seq2) * (((Partial_Sums seq1) . m) - (Sum seq1))) <= (abs (Sum seq2)) * (e / (3 * ((abs (Sum seq2)) + 1))) by A70, XREAL_1:64;
A72: Sum absFr = (Sum (absFr | M)) + (Sum Fr1) by A38, AFINSQ_2:55;
defpred S2[ Nat] means ( $1 + 1 <= M implies Sum (absFr | ($1 + 1)) <= (e / (3 * ((Sum (abs seq1)) + 1))) * ((Partial_Sums (abs seq1)) . $1) );
A73: n2 <= M by A41, A21, XXREAL_0:2;
A74: for k being Nat st S2[k] holds
S2[k + 1]
proof
let k be Nat; ::_thesis: ( S2[k] implies S2[k + 1] )
assume A75: S2[k] ; ::_thesis: S2[k + 1]
reconsider k1 = k + 1 as Element of NAT ;
A76: abs (seq1 . k1) = (abs seq1) . k1 by SEQ_1:12;
A77: m - M >= 2M - M by A22, XREAL_1:9;
assume A78: (k + 1) + 1 <= M ; ::_thesis: Sum (absFr | ((k + 1) + 1)) <= (e / (3 * ((Sum (abs seq1)) + 1))) * ((Partial_Sums (abs seq1)) . (k + 1))
then A79: k1 < M by NAT_1:13;
then m - k1 >= m - M by XREAL_1:10;
then m - k1 >= M by A77, XXREAL_0:2;
then A80: m - k1 >= n2 by A73, XXREAL_0:2;
((e / (3 * ((Sum (abs seq1)) + 1))) * (abs (seq1 . k1))) + (Sum (absFr | k1)) <= ((e / (3 * ((Sum (abs seq1)) + 1))) * (abs (seq1 . k1))) + ((e / (3 * ((Sum (abs seq1)) + 1))) * ((Partial_Sums (abs seq1)) . k)) by A75, A78, NAT_1:13, XREAL_1:6;
then ( ((e / (3 * ((Sum (abs seq1)) + 1))) * (abs (seq1 . k1))) + (Sum (absFr | k1)) <= (e / (3 * ((Sum (abs seq1)) + 1))) * (((abs seq1) . k1) + ((Partial_Sums (abs seq1)) . k)) & k in NAT ) by A76, ORDINAL1:def_12;
then A81: ((e / (3 * ((Sum (abs seq1)) + 1))) * (abs (seq1 . k1))) + (Sum (absFr | k1)) <= (e / (3 * ((Sum (abs seq1)) + 1))) * ((Partial_Sums (abs seq1)) . k1) by SERIES_1:def_1;
k1 < m by A34, A79, XXREAL_0:2;
then k1 < m + 1 by NAT_1:13;
then A82: k1 in m + 1 by NAT_1:44;
then A83: Sum (absFr | (k1 + 1)) = (absFr . k1) + (Sum (absFr | k1)) by A28, A30, AFINSQ_2:65;
m - k1 = m -' k1 by A34, A79, XREAL_1:233, XXREAL_0:2;
then abs (((Partial_Sums seq2) . (m -' k1)) - (Sum seq2)) < e / (3 * ((Sum (abs seq1)) + 1)) by A19, A80;
then A84: abs ((Sum seq2) - ((Partial_Sums seq2) . (m -' k1))) < e / (3 * ((Sum (abs seq1)) + 1)) by COMPLEX1:60;
A85: Sum seq2 = ((Partial_Sums seq2) . (m -' k1)) + (Sum (seq2 ^\ ((m -' k1) + 1))) by A2, SERIES_1:15;
abs (seq1 . k1) >= 0 by COMPLEX1:46;
then (abs ((Sum seq2) - ((Partial_Sums seq2) . (m -' k1)))) * (abs (seq1 . k1)) <= (e / (3 * ((Sum (abs seq1)) + 1))) * (abs (seq1 . k1)) by A84, XREAL_1:64;
then A86: abs ((seq1 . k1) * (Sum (seq2 ^\ ((m -' k1) + 1)))) <= (e / (3 * ((Sum (abs seq1)) + 1))) * (abs (seq1 . k1)) by A85, COMPLEX1:65;
( Fr . k1 = (seq1 . k1) * (Sum (seq2 ^\ ((m -' k1) + 1))) & abs (Fr . k1) = absFr . k1 ) by A28, A29, A30, A32, A82;
then Sum (absFr | (k1 + 1)) <= ((e / (3 * ((Sum (abs seq1)) + 1))) * (abs (seq1 . k1))) + (Sum (absFr | k1)) by A83, A86, XREAL_1:6;
hence Sum (absFr | ((k + 1) + 1)) <= (e / (3 * ((Sum (abs seq1)) + 1))) * ((Partial_Sums (abs seq1)) . (k + 1)) by A81, XXREAL_0:2; ::_thesis: verum
end;
( Sum (absFr | (0 + 1)) = (absFr . 0) + (Sum (absFr | 0)) & absFr . 0 = abs (Fr . 0) ) by A28, A30, A32, A66, AFINSQ_2:65;
then Sum (absFr | (0 + 1)) = (abs (seq1 . 0)) * (abs (Sum (seq2 ^\ ((m -' 0) + 1)))) by A67, COMPLEX1:65
.= ((abs seq1) . 0) * (abs (Sum (seq2 ^\ ((m -' 0) + 1)))) by SEQ_1:12
.= ((abs seq1) . 0) * (abs (((Partial_Sums seq2) . m) - (Sum seq2))) by A69, COMPLEX1:60 ;
then A87: S2[ 0 ] by A65, SERIES_1:def_1;
for k being Nat holds S2[k] from NAT_1:sch_2(A87, A74);
then A88: Sum (absFr | M) <= (e / (3 * ((Sum (abs seq1)) + 1))) * ((Partial_Sums (abs seq1)) . M1) by A24;
(Sum (abs seq1)) + 1 > (Sum (abs seq1)) + 0 by XREAL_1:8;
then (e / (3 * ((Sum (abs seq1)) + 1))) * ((Sum (abs seq1)) + 1) >= (e / (3 * ((Sum (abs seq1)) + 1))) * (Sum (abs seq1)) by A5, A18, XREAL_1:64;
then (e / (3 * ((Sum (abs seq1)) + 1))) * ((Partial_Sums (abs seq1)) . M1) <= e / 3 by A68, A17, XXREAL_0:2;
then Sum (absFr | M) <= e / 3 by A88, XXREAL_0:2;
then (Sum (absFr | M)) + (Sum Fr1) <= (e / 3) + (e / 3) by A64, XREAL_1:7;
then A89: abs (Sum Fr) <= (e / 3) + (e / 3) by A31, A72, XXREAL_0:2;
((Partial_Sums (seq1 (##) seq2)) . m) - ((Sum seq1) * (Sum seq2)) = ((Sum seq2) * (((Partial_Sums seq1) . m) - (Sum seq1))) - (Sum Fr) by A27;
then A90: abs (((Partial_Sums (seq1 (##) seq2)) . m) - ((Sum seq1) * (Sum seq2))) <= (abs ((Sum seq2) * (((Partial_Sums seq1) . m) - (Sum seq1)))) + (abs (Sum Fr)) by COMPLEX1:57;
e / (3 * ((abs (Sum seq2)) + 1)) > 0 by A5, A6, XREAL_1:139;
then (e / (3 * ((abs (Sum seq2)) + 1))) * ((abs (Sum seq2)) + 1) > (e / (3 * ((abs (Sum seq2)) + 1))) * (abs (Sum seq2)) by A13, XREAL_1:68;
then abs ((Sum seq2) * (((Partial_Sums seq1) . m) - (Sum seq1))) < e / 3 by A9, A71, XXREAL_0:2;
then (abs ((Sum seq2) * (((Partial_Sums seq1) . m) - (Sum seq1)))) + (abs (Sum Fr)) < (e / 3) + ((e / 3) + (e / 3)) by A89, XREAL_1:8;
hence abs (((Partial_Sums (seq1 (##) seq2)) . m) - ((Sum seq1) * (Sum seq2))) < e by A90, XXREAL_0:2; ::_thesis: verum
end;
then A91: Partial_Sums (seq1 (##) seq2) is convergent by SEQ_2:def_6;
hence seq1 (##) seq2 is summable by SERIES_1:def_2; ::_thesis: Sum (seq1 (##) seq2) = (Sum seq1) * (Sum seq2)
lim (Partial_Sums (seq1 (##) seq2)) = (Sum seq1) * (Sum seq2) by A3, A91, SEQ_2:def_7;
hence Sum (seq1 (##) seq2) = (Sum seq1) * (Sum seq2) by SERIES_1:def_3; ::_thesis: verum
end;
begin
theorem :: CATALAN2:54
for r being real number ex Catal being Real_Sequence st
( ( for n being Nat holds Catal . n = (Catalan (n + 1)) * (r |^ n) ) & ( abs r < 1 / 4 implies ( Catal is absolutely_summable & Sum Catal = 1 + (r * ((Sum Catal) |^ 2)) & Sum Catal = 2 / (1 + (sqrt (1 - (4 * r)))) & ( r <> 0 implies Sum Catal = (1 - (sqrt (1 - (4 * r)))) / (2 * r) ) ) ) )
proof
defpred S1[ set , set ] means for r being real number st $1 = r holds
ex Catal being Real_Sequence st
( ( for n being Nat holds Catal . n = (Catalan (n + 1)) * (r |^ n) ) & ( abs r < 1 / 4 implies ( Catal is absolutely_summable & Sum Catal = 1 + (r * ((Sum Catal) |^ 2)) & $2 = Sum Catal ) ) );
A1: for x being set st x in REAL holds
ex y being set st
( y in REAL & S1[x,y] )
proof
let x be set ; ::_thesis: ( x in REAL implies ex y being set st
( y in REAL & S1[x,y] ) )
A2: abs 1 = 1 by ABSVALUE:def_1;
assume x in REAL ; ::_thesis: ex y being set st
( y in REAL & S1[x,y] )
then reconsider r = x as Real ;
set a = 4 * (abs r);
deffunc H1( Element of NAT ) -> Element of REAL = (Catalan ($1 + 1)) * (r |^ $1);
consider Cat being Real_Sequence such that
A3: for n being Element of NAT holds Cat . n = H1(n) from FUNCT_2:sch_4();
set G = (4 * (abs r)) GeoSeq ;
defpred S2[ Nat] means (abs Cat) . $1 <= ((4 * (abs r)) GeoSeq) . $1;
A4: for n being Nat st S2[n] holds
S2[n + 1]
proof
A5: abs r >= 0 by COMPLEX1:46;
let n be Nat; ::_thesis: ( S2[n] implies S2[n + 1] )
assume S2[n] ; ::_thesis: S2[n + 1]
then A6: (4 * (abs r)) * ((abs Cat) . n) <= (4 * (abs r)) * (((4 * (abs r)) GeoSeq) . n) by A5, XREAL_1:64;
set n1 = n + 1;
A7: ( n in NAT & n + 1 in NAT ) by ORDINAL1:def_12;
A8: ( abs (r |^ (n + 1)) >= 0 & r |^ (n + 1) = r * (r |^ n) ) by COMPLEX1:46, NEWTON:6;
Catalan ((n + 1) + 1) >= 0 by CATALAN1:17;
then A9: abs (Catalan ((n + 1) + 1)) = Catalan ((n + 1) + 1) by ABSVALUE:def_1;
Catalan (n + 1) >= 0 by CATALAN1:17;
then abs (Catalan (n + 1)) = Catalan (n + 1) by ABSVALUE:def_1;
then abs (Catalan ((n + 1) + 1)) < 4 * (abs (Catalan (n + 1))) by A9, CATALAN1:21;
then A10: (abs (r |^ (n + 1))) * (abs (Catalan ((n + 1) + 1))) <= (4 * (abs (Catalan (n + 1)))) * (abs (r * (r |^ n))) by A8, XREAL_1:64;
abs (r * (r |^ n)) = (abs r) * (abs (r |^ n)) by COMPLEX1:65;
then abs ((r |^ (n + 1)) * (Catalan ((n + 1) + 1))) <= (4 * (abs r)) * ((abs (Catalan (n + 1))) * (abs (r |^ n))) by A10, COMPLEX1:65;
then abs (Cat . (n + 1)) <= (4 * (abs r)) * ((abs (Catalan (n + 1))) * (abs (r |^ n))) by A3;
then ( abs (Cat . (n + 1)) <= (4 * (abs r)) * (abs ((Catalan (n + 1)) * (r |^ n))) & n in NAT ) by COMPLEX1:65, ORDINAL1:def_12;
then A11: abs (Cat . (n + 1)) <= (4 * (abs r)) * (abs (Cat . n)) by A3;
abs (Cat . n) = (abs Cat) . n by A7, SEQ_1:12;
then (abs Cat) . (n + 1) <= (4 * (abs r)) * ((abs Cat) . n) by A11, SEQ_1:12;
then (abs Cat) . (n + 1) <= (4 * (abs r)) * (((4 * (abs r)) GeoSeq) . n) by A6, XXREAL_0:2;
hence S2[n + 1] by A7, PREPOWER:3; ::_thesis: verum
end;
Cat . 0 = (Catalan (0 + 1)) * (r |^ 0) by A3;
then A12: (abs Cat) . 0 = abs (r |^ 0) by CATALAN1:11, SEQ_1:12;
( r |^ 0 = 1 & (4 * (abs r)) |^ 0 = 1 ) by NEWTON:4;
then A13: S2[ 0 ] by A12, A2, PREPOWER:def_1;
for n being Nat holds S2[n] from NAT_1:sch_2(A13, A4);
then A14: for n being Element of NAT holds S2[n] ;
A15: now__::_thesis:_for_n_being_Element_of_NAT_holds_(abs_Cat)_._n_>=_0
let n be Element of NAT ; ::_thesis: (abs Cat) . n >= 0
(abs Cat) . n = abs (Cat . n) by SEQ_1:12;
hence (abs Cat) . n >= 0 by COMPLEX1:46; ::_thesis: verum
end;
take Sum Cat ; ::_thesis: ( Sum Cat in REAL & S1[x, Sum Cat] )
thus Sum Cat in REAL ; ::_thesis: S1[x, Sum Cat]
let s be real number ; ::_thesis: ( x = s implies ex Catal being Real_Sequence st
( ( for n being Nat holds Catal . n = (Catalan (n + 1)) * (s |^ n) ) & ( abs s < 1 / 4 implies ( Catal is absolutely_summable & Sum Catal = 1 + (s * ((Sum Catal) |^ 2)) & Sum Cat = Sum Catal ) ) ) )
assume A16: x = s ; ::_thesis: ex Catal being Real_Sequence st
( ( for n being Nat holds Catal . n = (Catalan (n + 1)) * (s |^ n) ) & ( abs s < 1 / 4 implies ( Catal is absolutely_summable & Sum Catal = 1 + (s * ((Sum Catal) |^ 2)) & Sum Cat = Sum Catal ) ) )
for y being set st y in NAT holds
(Cat ^\ 1) . y = (Cat (##) (r (#) Cat)) . y
proof
let y be set ; ::_thesis: ( y in NAT implies (Cat ^\ 1) . y = (Cat (##) (r (#) Cat)) . y )
assume y in NAT ; ::_thesis: (Cat ^\ 1) . y = (Cat (##) (r (#) Cat)) . y
then reconsider n = y as Element of NAT ;
set n1 = n + 1;
consider Fr1 being XFinSequence of such that
A17: dom Fr1 = n + 1 and
A18: for i being Nat st i in n + 1 holds
Fr1 . i = (Cat . i) * ((r (#) Cat) . (n -' i)) and
A19: Sum Fr1 = (Cat (##) (r (#) Cat)) . n by Def4;
consider Catal being XFinSequence of such that
A20: Sum Catal = Catalan ((n + 1) + 1) and
A21: dom Catal = n + 1 and
A22: for j being Nat st j < n + 1 holds
Catal . j = (Catalan (j + 1)) * (Catalan ((n + 1) -' j)) by Th39;
rng Catal c= REAL by XBOOLE_1:1;
then reconsider CatalR = Catal as XFinSequence of by RELAT_1:def_19;
defpred S3[ set , set ] means for k being Nat st k = $1 holds
$2 = (r |^ (n + 1)) * (Catal . k);
A23: for k being Nat st k in n + 1 holds
ex x being Element of REAL st S3[k,x]
proof
let k be Nat; ::_thesis: ( k in n + 1 implies ex x being Element of REAL st S3[k,x] )
assume k in n + 1 ; ::_thesis: ex x being Element of REAL st S3[k,x]
take (r |^ (n + 1)) * (Catal . k) ; ::_thesis: S3[k,(r |^ (n + 1)) * (Catal . k)]
thus S3[k,(r |^ (n + 1)) * (Catal . k)] ; ::_thesis: verum
end;
consider Fr2 being XFinSequence of such that
A24: dom Fr2 = n + 1 and
A25: for k being Nat st k in n + 1 holds
S3[k,Fr2 . k] from STIRL2_1:sch_5(A23);
A26: now__::_thesis:_for_k_being_Nat_st_k_in_dom_Fr2_holds_
Fr1_._k_=_Fr2_._k
let k be Nat; ::_thesis: ( k in dom Fr2 implies Fr1 . k = Fr2 . k )
assume A27: k in dom Fr2 ; ::_thesis: Fr1 . k = Fr2 . k
A28: k in NAT by ORDINAL1:def_12;
A29: k < n + 1 by A24, A27, NAT_1:44;
then A30: (n + 1) -' k = (n + 1) - k by XREAL_1:233;
A31: n = k + (n - k) ;
k <= n by A29, NAT_1:13;
then A32: n -' k = n - k by XREAL_1:233;
then Fr1 . k = (Cat . k) * ((r (#) Cat) . (n - k)) by A18, A24, A27
.= ((Catalan (k + 1)) * (r |^ k)) * ((r (#) Cat) . (n - k)) by A3, A28
.= ((Catalan (k + 1)) * (r |^ k)) * (r * (Cat . (n - k))) by A32, SEQ_1:9
.= ((Catalan (k + 1)) * (r |^ k)) * (r * ((Catalan ((n -' k) + 1)) * (r |^ (n -' k)))) by A3, A32
.= (((Catalan (k + 1)) * (Catalan ((n + 1) -' k))) * r) * ((r |^ k) * (r |^ (n -' k))) by A32, A30
.= (((Catalan (k + 1)) * (Catalan ((n + 1) -' k))) * r) * (r |^ n) by A32, A31, NEWTON:8
.= ((Catal . k) * r) * (r |^ n) by A22, A29
.= (Catal . k) * (r * (r |^ n))
.= (Catal . k) * (r |^ (n + 1)) by NEWTON:6
.= Fr2 . k by A24, A25, A27 ;
hence Fr1 . k = Fr2 . k ; ::_thesis: verum
end;
for k being Nat st k in len Fr2 holds
Fr2 . k = (r |^ (n + 1)) * (CatalR . k) by A24, A25;
then Sum Fr2 = (r |^ (n + 1)) * (Sum CatalR) by A21, A24, Th44
.= Cat . (n + 1) by A3, A20
.= (Cat ^\ 1) . n by NAT_1:def_3 ;
hence (Cat ^\ 1) . y = (Cat (##) (r (#) Cat)) . y by A17, A19, A24, A26, AFINSQ_1:8; ::_thesis: verum
end;
then A33: Cat ^\ 1 = Cat (##) (r (#) Cat) by FUNCT_2:12;
abs r >= 0 by COMPLEX1:46;
then A34: abs (4 * (abs r)) = 4 * (abs r) by ABSVALUE:def_1;
take Cat ; ::_thesis: ( ( for n being Nat holds Cat . n = (Catalan (n + 1)) * (s |^ n) ) & ( abs s < 1 / 4 implies ( Cat is absolutely_summable & Sum Cat = 1 + (s * ((Sum Cat) |^ 2)) & Sum Cat = Sum Cat ) ) )
hereby ::_thesis: ( abs s < 1 / 4 implies ( Cat is absolutely_summable & Sum Cat = 1 + (s * ((Sum Cat) |^ 2)) & Sum Cat = Sum Cat ) )
let n be Nat; ::_thesis: Cat . n = (Catalan (n + 1)) * (s |^ n)
n in NAT by ORDINAL1:def_12;
hence Cat . n = (Catalan (n + 1)) * (s |^ n) by A3, A16; ::_thesis: verum
end;
A35: r |^ 0 = 1 by NEWTON:4;
Cat . 0 = (Catalan (0 + 1)) * (r |^ 0) by A3;
then A36: (Partial_Sums Cat) . 0 = 1 by A35, CATALAN1:11, SERIES_1:def_1;
assume abs s < 1 / 4 ; ::_thesis: ( Cat is absolutely_summable & Sum Cat = 1 + (s * ((Sum Cat) |^ 2)) & Sum Cat = Sum Cat )
then 4 * (abs r) < 4 * (1 / 4) by A16, XREAL_1:68;
then (4 * (abs r)) GeoSeq is summable by A34, SERIES_1:24;
then abs Cat is summable by A15, A14, SERIES_1:20;
hence A37: Cat is absolutely_summable by SERIES_1:def_4; ::_thesis: ( Sum Cat = 1 + (s * ((Sum Cat) |^ 2)) & Sum Cat = Sum Cat )
then Cat is summable ;
then ( r (#) Cat is summable & Sum (r (#) Cat) = r * (Sum Cat) ) by SERIES_1:10;
then Sum (Cat ^\ (0 + 1)) = (Sum Cat) * (r * (Sum Cat)) by A37, A33, Th53;
then Sum Cat = 1 + (r * ((Sum Cat) * (Sum Cat))) by A37, A36, SERIES_1:15;
hence ( Sum Cat = 1 + (s * ((Sum Cat) |^ 2)) & Sum Cat = Sum Cat ) by A16, WSIERP_1:1; ::_thesis: verum
end;
consider SumC being Function of REAL,REAL such that
A38: for x being set st x in REAL holds
S1[x,SumC . x] from FUNCT_2:sch_1(A1);
A39: for r, s being real number st 0 < s & s <= r & r < 1 / 4 holds
SumC . s <= SumC . r
proof
let r, s be real number ; ::_thesis: ( 0 < s & s <= r & r < 1 / 4 implies SumC . s <= SumC . r )
assume that
A40: 0 < s and
A41: s <= r and
A42: r < 1 / 4 ; ::_thesis: SumC . s <= SumC . r
r is Real by XREAL_0:def_1;
then consider Cr being Real_Sequence such that
A43: for n being Nat holds Cr . n = (Catalan (n + 1)) * (r |^ n) and
A44: ( abs r < 1 / 4 implies ( Cr is absolutely_summable & Sum Cr = 1 + (r * ((Sum Cr) |^ 2)) & SumC . r = Sum Cr ) ) by A38;
s is Real by XREAL_0:def_1;
then consider Cs being Real_Sequence such that
A45: for n being Nat holds Cs . n = (Catalan (n + 1)) * (s |^ n) and
A46: ( abs s < 1 / 4 implies ( Cs is absolutely_summable & Sum Cs = 1 + (s * ((Sum Cs) |^ 2)) & SumC . s = Sum Cs ) ) by A38;
A47: now__::_thesis:_for_n_being_Element_of_NAT_holds_Cs_._n_<=_Cr_._n
let n be Element of NAT ; ::_thesis: Cs . n <= Cr . n
( s |^ n <= r |^ n & Catalan (n + 1) >= 0 ) by A40, A41, CATALAN1:17, PREPOWER:9;
then A48: (Catalan (n + 1)) * (s |^ n) <= (Catalan (n + 1)) * (r |^ n) by XREAL_1:64;
(Catalan (n + 1)) * (r |^ n) = Cr . n by A43;
hence Cs . n <= Cr . n by A45, A48; ::_thesis: verum
end;
A49: s < 1 / 4 by A41, A42, XXREAL_0:2;
thus SumC . s <= SumC . r by A40, A41, A42, A49, A46, A44, A47, ABSVALUE:def_1, TIETZE:5; ::_thesis: verum
end;
set R = { r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } ;
A50: for r being real number st r <> 0 & abs r < 1 / 4 & not SumC . r = (1 - (sqrt (1 - (4 * r)))) / (2 * r) holds
SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r)
proof
let r be real number ; ::_thesis: ( r <> 0 & abs r < 1 / 4 & not SumC . r = (1 - (sqrt (1 - (4 * r)))) / (2 * r) implies SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) )
assume that
A51: r <> 0 and
A52: abs r < 1 / 4 ; ::_thesis: ( SumC . r = (1 - (sqrt (1 - (4 * r)))) / (2 * r) or SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) )
r <= 1 / 4 by A52, ABSVALUE:5;
then 4 * r <= (1 / 4) * 4 by XREAL_1:64;
then A53: (4 * r) - (4 * r) <= 1 - (4 * r) by XREAL_1:9;
r is Real by XREAL_0:def_1;
then consider Catal being Real_Sequence such that
for n being Nat holds Catal . n = (Catalan (n + 1)) * (r |^ n) and
A54: ( abs r < 1 / 4 implies ( Catal is absolutely_summable & Sum Catal = 1 + (r * ((Sum Catal) |^ 2)) & SumC . r = Sum Catal ) ) by A38;
set S = Sum Catal;
Sum Catal = 1 + (r * ((Sum Catal) ^2)) by A52, A54, WSIERP_1:1;
then A55: ((r * ((Sum Catal) ^2)) + ((- 1) * (Sum Catal))) + 1 = 0 ;
( delta (r,(- 1),1) = 1 - (4 * r) & - (- 1) = 1 ) ;
hence ( SumC . r = (1 - (sqrt (1 - (4 * r)))) / (2 * r) or SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) by A51, A52, A54, A55, A53, FIB_NUM:6; ::_thesis: verum
end;
A56: for r, s being real number st 0 < r & r < s & s < 1 / 4 holds
(1 + (sqrt (1 - (4 * r)))) / (2 * r) > (1 + (sqrt (1 - (4 * s)))) / (2 * s)
proof
let r, s be real number ; ::_thesis: ( 0 < r & r < s & s < 1 / 4 implies (1 + (sqrt (1 - (4 * r)))) / (2 * r) > (1 + (sqrt (1 - (4 * s)))) / (2 * s) )
assume that
A57: 0 < r and
A58: r < s and
A59: s < 1 / 4 ; ::_thesis: (1 + (sqrt (1 - (4 * r)))) / (2 * r) > (1 + (sqrt (1 - (4 * s)))) / (2 * s)
4 * s < 4 * (1 / 4) by A59, XREAL_1:68;
then A60: (4 * s) - (4 * s) < 1 - (4 * s) by XREAL_1:9;
then A61: sqrt (1 - (4 * s)) > 0 by SQUARE_1:25;
4 * r < 4 * s by A58, XREAL_1:68;
then 1 - (4 * r) >= 1 - (4 * s) by XREAL_1:10;
then sqrt (1 - (4 * r)) >= sqrt (1 - (4 * s)) by A60, SQUARE_1:26;
then 1 + (sqrt (1 - (4 * r))) >= 1 + (sqrt (1 - (4 * s))) by XREAL_1:7;
then A62: (1 + (sqrt (1 - (4 * r)))) / (2 * r) >= (1 + (sqrt (1 - (4 * s)))) / (2 * r) by A57, XREAL_1:72;
( 2 * r > 2 * 0 & 2 * r < 2 * s ) by A57, A58, XREAL_1:68;
then (1 + (sqrt (1 - (4 * s)))) / (2 * r) > (1 + (sqrt (1 - (4 * s)))) / (2 * s) by A61, XREAL_1:76;
hence (1 + (sqrt (1 - (4 * r)))) / (2 * r) > (1 + (sqrt (1 - (4 * s)))) / (2 * s) by A62, XXREAL_0:2; ::_thesis: verum
end;
A63: { r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } = {}
proof
assume { r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } <> {} ; ::_thesis: contradiction
then consider x being set such that
A64: x in { r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } by XBOOLE_0:def_1;
consider r being Real such that
x = r and
A65: 0 < r and
A66: r < 1 / 4 and
A67: SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) by A64;
consider s being real number such that
A68: r < s and
A69: s < 1 / 4 by A66, XREAL_1:5;
A70: abs s = s by A65, A68, ABSVALUE:def_1;
4 * s < 4 * (1 / 4) by A69, XREAL_1:68;
then (4 * s) - (4 * s) < 1 - (4 * s) by XREAL_1:9;
then sqrt (1 - (4 * s)) > 0 by SQUARE_1:25;
then 1 - (sqrt (1 - (4 * s))) <= 1 - 0 by XREAL_1:10;
then A71: (1 - (sqrt (1 - (4 * s)))) / (2 * s) <= 1 / (2 * s) by A65, A68, XREAL_1:72;
A72: 2 * r > 2 * 0 by A65, XREAL_1:68;
A73: s is Real by XREAL_0:def_1;
{ r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } c= {r}
proof
assume not { r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } c= {r} ; ::_thesis: contradiction
then { r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } \ {r} <> {} by XBOOLE_1:37;
then consider y being set such that
A74: y in { r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } \ {r} by XBOOLE_0:def_1;
y in { r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } by A74;
then consider s being Real such that
A75: y = s and
A76: 0 < s and
A77: s < 1 / 4 and
A78: SumC . s = (1 + (sqrt (1 - (4 * s)))) / (2 * s) ;
A79: r <> s by A74, A75, ZFMISC_1:56;
now__::_thesis:_contradiction
percases ( r > s or r < s ) by A79, XXREAL_0:1;
supposeA80: r > s ; ::_thesis: contradiction
then SumC . s > SumC . r by A56, A66, A67, A76, A78;
hence contradiction by A39, A66, A76, A80; ::_thesis: verum
end;
supposeA81: r < s ; ::_thesis: contradiction
then SumC . r > SumC . s by A56, A65, A67, A77, A78;
hence contradiction by A39, A65, A77, A81; ::_thesis: verum
end;
end;
end;
hence contradiction ; ::_thesis: verum
end;
then not s in { r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } by A68, TARSKI:def_1;
then SumC . s <> (1 + (sqrt (1 - (4 * s)))) / (2 * s) by A65, A68, A69, A73;
then A82: SumC . s = (1 - (sqrt (1 - (4 * s)))) / (2 * s) by A50, A65, A68, A69, A70;
4 * r < 4 * (1 / 4) by A66, XREAL_1:68;
then (4 * r) - (4 * r) < 1 - (4 * r) by XREAL_1:9;
then sqrt (1 - (4 * r)) > 0 by SQUARE_1:25;
then 1 + 0 < 1 + (sqrt (1 - (4 * r))) by XREAL_1:8;
then A83: 1 / (2 * r) < SumC . r by A67, A72, XREAL_1:74;
2 * r < 2 * s by A68, XREAL_1:68;
then 1 / (2 * s) < 1 / (2 * r) by A72, XREAL_1:76;
then SumC . s < 1 / (2 * r) by A82, A71, XXREAL_0:2;
then SumC . s < SumC . r by A83, XXREAL_0:2;
hence contradiction by A39, A65, A68, A69; ::_thesis: verum
end;
A84: for r being real number st 0 < r & abs r < 1 / 4 holds
SumC . r = (1 - (sqrt (1 - (4 * r)))) / (2 * r)
proof
let r be real number ; ::_thesis: ( 0 < r & abs r < 1 / 4 implies SumC . r = (1 - (sqrt (1 - (4 * r)))) / (2 * r) )
assume that
A85: 0 < r and
A86: abs r < 1 / 4 ; ::_thesis: SumC . r = (1 - (sqrt (1 - (4 * r)))) / (2 * r)
assume SumC . r <> (1 - (sqrt (1 - (4 * r)))) / (2 * r) ; ::_thesis: contradiction
then A87: SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) by A50, A85, A86;
abs r = r by A85, ABSVALUE:def_1;
then r in { r where r is Real : ( 0 < r & r < 1 / 4 & SumC . r = (1 + (sqrt (1 - (4 * r)))) / (2 * r) ) } by A85, A86, A87;
hence contradiction by A63; ::_thesis: verum
end;
A88: for r being real number st r < 0 & abs r < 1 / 4 holds
SumC . r = (1 - (sqrt (1 - (4 * r)))) / (2 * r)
proof
let r be real number ; ::_thesis: ( r < 0 & abs r < 1 / 4 implies SumC . r = (1 - (sqrt (1 - (4 * r)))) / (2 * r) )
assume that
A89: r < 0 and
A90: abs r < 1 / 4 ; ::_thesis: SumC . r = (1 - (sqrt (1 - (4 * r)))) / (2 * r)
2 * r < 2 * 0 by A89, XREAL_1:68;
then A91: ( abs (2 * r) = - (2 * r) & 0 - (2 * r) > 0 - 0 ) by ABSVALUE:def_1;
A92: abs (- r) < 1 / 4 by A90, COMPLEX1:52;
then 1 / 4 >= - r by ABSVALUE:5;
then 4 * (1 / 4) >= 4 * (- r) by XREAL_1:64;
then 1 - (4 * (- r)) >= (4 * (- r)) - (4 * (- r)) by XREAL_1:9;
then sqrt (1 - (4 * (- r))) >= 0 by SQUARE_1:def_2;
then A93: 1 - (sqrt (1 - (4 * (- r)))) <= 1 - 0 by XREAL_1:10;
A94: sqrt (1 - (4 * r)) > 0 by A89, SQUARE_1:25;
then 1 + (sqrt (1 - (4 * r))) > 1 + 0 by XREAL_1:8;
then A95: 1 - (sqrt (1 - (4 * (- r)))) < 1 + (sqrt (1 - (4 * r))) by A93, XXREAL_0:2;
1 + (sqrt (1 - (4 * r))) = abs (1 + (sqrt (1 - (4 * r)))) by A94, ABSVALUE:def_1;
then A96: (1 - (sqrt (1 - (4 * (- r))))) / (2 * (- r)) < (abs (1 + (sqrt (1 - (4 * r))))) / (abs (2 * r)) by A95, A91, XREAL_1:74;
consider CR being Real_Sequence such that
A97: for n being Nat holds CR . n = (Catalan (n + 1)) * ((- r) |^ n) and
A98: ( abs (- r) < 1 / 4 implies ( CR is absolutely_summable & Sum CR = 1 + ((- r) * ((Sum CR) |^ 2)) & SumC . (- r) = Sum CR ) ) by A38;
assume A99: SumC . r <> (1 - (sqrt (1 - (4 * r)))) / (2 * r) ; ::_thesis: contradiction
r is Real by XREAL_0:def_1;
then consider Cr being Real_Sequence such that
A100: for n being Nat holds Cr . n = (Catalan (n + 1)) * (r |^ n) and
A101: ( abs r < 1 / 4 implies ( Cr is absolutely_summable & Sum Cr = 1 + (r * ((Sum Cr) |^ 2)) & SumC . r = Sum Cr ) ) by A38;
now__::_thesis:_for_x_being_set_st_x_in_NAT_holds_
(abs_Cr)_._x_=_CR_._x
let x be set ; ::_thesis: ( x in NAT implies (abs Cr) . x = CR . x )
assume x in NAT ; ::_thesis: (abs Cr) . x = CR . x
then reconsider n = x as Element of NAT ;
(- r) |^ n = ((- 1) * r) |^ n
.= ((- 1) |^ n) * (r |^ n) by NEWTON:7 ;
then A102: abs ((- r) |^ n) = (abs ((- 1) |^ n)) * (abs (r |^ n)) by COMPLEX1:65
.= 1 * (abs (r |^ n)) by SERIES_2:1 ;
Catalan (n + 1) >= 0 by CATALAN1:17;
then A103: abs (Catalan (n + 1)) = Catalan (n + 1) by ABSVALUE:def_1;
(- r) |^ n >= 0 by A89, POWER:3;
then abs ((- r) |^ n) = (- r) |^ n by ABSVALUE:def_1;
then CR . n = (abs (r |^ n)) * (abs (Catalan (n + 1))) by A97, A102, A103
.= abs ((r |^ n) * (Catalan (n + 1))) by COMPLEX1:65
.= abs (Cr . n) by A100
.= (abs Cr) . n by SEQ_1:12 ;
hence (abs Cr) . x = CR . x ; ::_thesis: verum
end;
then A104: abs Cr = CR by FUNCT_2:12;
0 - r > 0 - 0 by A89;
then A105: Sum CR = (1 - (sqrt (1 - (4 * (- r))))) / (2 * (- r)) by A84, A98, A92;
abs (Sum Cr) <= Sum (abs Cr) by A90, A101, TIETZE:6;
then abs ((1 + (sqrt (1 - (4 * r)))) / (2 * r)) <= Sum CR by A50, A89, A90, A101, A104, A99;
hence contradiction by A105, A96, COMPLEX1:67; ::_thesis: verum
end;
let r be real number ; ::_thesis: ex Catal being Real_Sequence st
( ( for n being Nat holds Catal . n = (Catalan (n + 1)) * (r |^ n) ) & ( abs r < 1 / 4 implies ( Catal is absolutely_summable & Sum Catal = 1 + (r * ((Sum Catal) |^ 2)) & Sum Catal = 2 / (1 + (sqrt (1 - (4 * r)))) & ( r <> 0 implies Sum Catal = (1 - (sqrt (1 - (4 * r)))) / (2 * r) ) ) ) )
r is Real by XREAL_0:def_1;
then consider Cat being Real_Sequence such that
A106: for n being Nat holds Cat . n = (Catalan (n + 1)) * (r |^ n) and
A107: ( abs r < 1 / 4 implies ( Cat is absolutely_summable & Sum Cat = 1 + (r * ((Sum Cat) |^ 2)) & SumC . r = Sum Cat ) ) by A38;
set s = sqrt (1 - (4 * r));
take Cat ; ::_thesis: ( ( for n being Nat holds Cat . n = (Catalan (n + 1)) * (r |^ n) ) & ( abs r < 1 / 4 implies ( Cat is absolutely_summable & Sum Cat = 1 + (r * ((Sum Cat) |^ 2)) & Sum Cat = 2 / (1 + (sqrt (1 - (4 * r)))) & ( r <> 0 implies Sum Cat = (1 - (sqrt (1 - (4 * r)))) / (2 * r) ) ) ) )
thus for n being Nat holds Cat . n = (Catalan (n + 1)) * (r |^ n) by A106; ::_thesis: ( abs r < 1 / 4 implies ( Cat is absolutely_summable & Sum Cat = 1 + (r * ((Sum Cat) |^ 2)) & Sum Cat = 2 / (1 + (sqrt (1 - (4 * r)))) & ( r <> 0 implies Sum Cat = (1 - (sqrt (1 - (4 * r)))) / (2 * r) ) ) )
assume A108: abs r < 1 / 4 ; ::_thesis: ( Cat is absolutely_summable & Sum Cat = 1 + (r * ((Sum Cat) |^ 2)) & Sum Cat = 2 / (1 + (sqrt (1 - (4 * r)))) & ( r <> 0 implies Sum Cat = (1 - (sqrt (1 - (4 * r)))) / (2 * r) ) )
hence ( Cat is absolutely_summable & Sum Cat = 1 + (r * ((Sum Cat) |^ 2)) ) by A107; ::_thesis: ( Sum Cat = 2 / (1 + (sqrt (1 - (4 * r)))) & ( r <> 0 implies Sum Cat = (1 - (sqrt (1 - (4 * r)))) / (2 * r) ) )
A109: ( r <> 0 implies Sum Cat = (1 - (sqrt (1 - (4 * r)))) / (2 * r) )
proof
assume r <> 0 ; ::_thesis: Sum Cat = (1 - (sqrt (1 - (4 * r)))) / (2 * r)
then ( r > 0 or r < 0 ) ;
hence Sum Cat = (1 - (sqrt (1 - (4 * r)))) / (2 * r) by A84, A88, A107, A108; ::_thesis: verum
end;
now__::_thesis:_2_/_(1_+_(sqrt_(1_-_(4_*_r))))_=_Sum_Cat
percases ( r = 0 or r <> 0 ) ;
suppose r = 0 ; ::_thesis: 2 / (1 + (sqrt (1 - (4 * r)))) = Sum Cat
hence 2 / (1 + (sqrt (1 - (4 * r)))) = Sum Cat by A107, A108, SQUARE_1:18; ::_thesis: verum
end;
supposeA110: r <> 0 ; ::_thesis: Sum Cat = 2 / (1 + (sqrt (1 - (4 * r))))
then A111: 2 * r <> 0 ;
r <= 1 / 4 by A108, ABSVALUE:5;
then 4 * r <= 4 * (1 / 4) by XREAL_1:64;
then A112: 1 - (4 * r) >= (4 * r) - (4 * r) by XREAL_1:9;
then sqrt (1 - (4 * r)) >= 0 by SQUARE_1:def_2;
then (1 + (sqrt (1 - (4 * r)))) / (1 + (sqrt (1 - (4 * r)))) = 1 by XCMPLX_1:60;
then (1 - (sqrt (1 - (4 * r)))) / (2 * r) = ((1 - (sqrt (1 - (4 * r)))) / (2 * r)) * ((1 + (sqrt (1 - (4 * r)))) / (1 + (sqrt (1 - (4 * r)))))
.= ((1 - (sqrt (1 - (4 * r)))) * (1 + (sqrt (1 - (4 * r))))) / ((2 * r) * (1 + (sqrt (1 - (4 * r))))) by XCMPLX_1:76
.= ((1 ^2) - ((sqrt (1 - (4 * r))) ^2)) / ((2 * r) * (1 + (sqrt (1 - (4 * r)))))
.= (1 - (1 - (4 * r))) / ((2 * r) * (1 + (sqrt (1 - (4 * r))))) by A112, SQUARE_1:def_2
.= ((2 * r) * 2) / ((2 * r) * (1 + (sqrt (1 - (4 * r)))))
.= ((2 * r) / (2 * r)) * (2 / (1 + (sqrt (1 - (4 * r))))) by XCMPLX_1:76
.= 1 * (2 / (1 + (sqrt (1 - (4 * r))))) by A111, XCMPLX_1:60 ;
hence Sum Cat = 2 / (1 + (sqrt (1 - (4 * r)))) by A109, A110; ::_thesis: verum
end;
end;
end;
hence ( Sum Cat = 2 / (1 + (sqrt (1 - (4 * r)))) & ( r <> 0 implies Sum Cat = (1 - (sqrt (1 - (4 * r)))) / (2 * r) ) ) by A109; ::_thesis: verum
end;