let n be Element of NAT ; :: thesis: len (Decomp n,2) = n + 1
consider A being finite Subset of (2 -tuples_on NAT ) such that
A1:
Decomp n,2 = SgmX (TuplesOrder 2),A
and
A2:
for p being Element of 2 -tuples_on NAT holds
( p in A iff Sum p = n )
by Def4;
A3:
A = { <*i,(n -' i)*> where i is Element of NAT : i <= n }
deffunc H1( Nat) -> set = <*$1,(n -' $1)*>;
consider q being FinSequence such that
A11:
len q = n
and
A12:
for k being Nat st k in dom q holds
q . k = H1(k)
from FINSEQ_1:sch 2();
A13:
dom q = Seg n
by A11, FINSEQ_1:def 3;
set q1 = q ^ <*<*0 ,n*>*>;
A14:
rng q c= rng (q ^ <*<*0 ,n*>*>)
by FINSEQ_1:42;
A15:
len (q ^ <*<*0 ,n*>*>) = n + 1
by A11, FINSEQ_2:19;
then A16:
dom (q ^ <*<*0 ,n*>*>) = Seg (n + 1)
by FINSEQ_1:def 3;
A17:
dom q = Seg n
by A11, FINSEQ_1:def 3;
A18:
rng (q ^ <*<*0 ,n*>*>) = { <*i,(n -' i)*> where i is Element of NAT : i <= n }
proof
thus
rng (q ^ <*<*0 ,n*>*>) c= { <*i,(n -' i)*> where i is Element of NAT : i <= n }
:: according to XBOOLE_0:def 10 :: thesis: { <*i,(n -' i)*> where i is Element of NAT : i <= n } c= rng (q ^ <*<*0 ,n*>*>)
let x be
set ;
:: according to TARSKI:def 3 :: thesis: ( not x in { <*i,(n -' i)*> where i is Element of NAT : i <= n } or x in rng (q ^ <*<*0 ,n*>*>) )
assume
x in { <*i,(n -' i)*> where i is Element of NAT : i <= n }
;
:: thesis: x in rng (q ^ <*<*0 ,n*>*>)
then consider i being
Element of
NAT such that A25:
x = <*i,(n -' i)*>
and A26:
i <= n
;
A27:
(
i = 0 or
i >= 0 + 1 )
by NAT_1:13;
hence
x in rng (q ^ <*<*0 ,n*>*>)
;
:: thesis: verum
end;
now let x1,
x2 be
set ;
:: thesis: ( x1 in dom (q ^ <*<*0 ,n*>*>) & x2 in dom (q ^ <*<*0 ,n*>*>) & (q ^ <*<*0 ,n*>*>) . x1 = (q ^ <*<*0 ,n*>*>) . x2 implies x1 = x2 )assume that A31:
x1 in dom (q ^ <*<*0 ,n*>*>)
and A32:
x2 in dom (q ^ <*<*0 ,n*>*>)
and A33:
(q ^ <*<*0 ,n*>*>) . x1 = (q ^ <*<*0 ,n*>*>) . x2
;
:: thesis: x1 = x2reconsider k1 =
x1,
k2 =
x2 as
Element of
NAT by A31, A32;
(
x1 in (Seg n) \/ {(n + 1)} &
x2 in (Seg n) \/ {(n + 1)} )
by A16, A31, A32, FINSEQ_1:11;
then A34:
( (
x1 in Seg n or
x1 in {(n + 1)} ) & (
x2 in Seg n or
x2 in {(n + 1)} ) )
by XBOOLE_0:def 3;
now per cases
( ( x1 in Seg n & x2 in Seg n ) or ( x1 in Seg n & x2 = n + 1 ) or ( x1 = n + 1 & x2 in Seg n ) or ( x1 = n + 1 & x2 = n + 1 ) )
by A34, TARSKI:def 1;
suppose A37:
(
x1 in Seg n &
x2 = n + 1 )
;
:: thesis: x1 = x2then A38:
(q ^ <*<*0 ,n*>*>) . k1 =
q . k1
by A17, FINSEQ_1:def 7
.=
<*k1,(n -' k1)*>
by A12, A37, A13
;
(q ^ <*<*0 ,n*>*>) . k2 = <*0 ,n*>
by A11, A37, FINSEQ_1:59;
then
k1 = 0
by A33, A38, GROUP_7:2;
hence
x1 = x2
by A37, FINSEQ_1:3;
:: thesis: verum end; suppose A39:
(
x1 = n + 1 &
x2 in Seg n )
;
:: thesis: x1 = x2then A40:
(q ^ <*<*0 ,n*>*>) . k2 =
q . k2
by A17, FINSEQ_1:def 7
.=
<*k2,(n -' k2)*>
by A12, A39, A13
;
(q ^ <*<*0 ,n*>*>) . k1 = <*0 ,n*>
by A11, A39, FINSEQ_1:59;
then
k2 = 0
by A33, A40, GROUP_7:2;
hence
x1 = x2
by A39, FINSEQ_1:3;
:: thesis: verum end; end; end; hence
x1 = x2
;
:: thesis: verum end;
then
q ^ <*<*0 ,n*>*> is one-to-one
by FUNCT_1:def 8;
then A41:
card (rng (q ^ <*<*0 ,n*>*>)) = n + 1
by A15, FINSEQ_4:77;
field (TuplesOrder 2) = 2 -tuples_on NAT
by ORDERS_1:100;
then
TuplesOrder 2 linearly_orders 2 -tuples_on NAT
by ORDERS_1:133;
hence
len (Decomp n,2) = n + 1
by A1, A3, A18, A41, ORDERS_1:134, TRIANG_1:9; :: thesis: verum