consider p being FinSequence such that
A1:
rng p = B
by FINSEQ_1:52;
defpred S1[ Nat] means ( $1 <= len p implies ex a being Nat ex A being bag of n st
( a in dom p & a <= $1 & p . a = A & ( for c being Nat
for C being bag of n st c in dom p & c <= $1 & p . c = C holds
C <= A,T ) ) );
A2:
for k being non zero Nat st S1[k] holds
S1[k + 1]
proof
let k be non
zero Nat;
( S1[k] implies S1[k + 1] )
assume A3:
S1[
k]
;
S1[k + 1]
per cases
( k < len p or k >= len p )
;
suppose A4:
k < len p
;
S1[k + 1]A5:
1
<= k + 1
by CHORD:1;
k + 1
<= len p
by A4, NAT_1:13;
then A6:
k + 1
in dom p
by A5, FINSEQ_3:25;
then
p . (k + 1) in B
by A1, FUNCT_1:def 3;
then reconsider Ck =
p . (k + 1) as
bag of
n ;
consider a being
Nat,
A being
bag of
n such that A7:
a in dom p
and A8:
a <= k
and A9:
p . a = A
and A10:
for
c being
Nat for
C being
bag of
n st
c in dom p &
c <= k &
p . c = C holds
C <= A,
T
by A3, A4;
set m =
max (
A,
Ck,
T);
A11:
A <= max (
A,
Ck,
T),
T
by TERMORD:14;
per cases
( max (A,Ck,T) = A or max (A,Ck,T) = Ck )
by TERMORD:12;
suppose A12:
max (
A,
Ck,
T)
= A
;
S1[k + 1]A13:
now for c being Nat
for C being bag of n st c in dom p & c <= k + 1 & p . c = C holds
C <= max (A,Ck,T),Tlet c be
Nat;
for C being bag of n st c in dom p & c <= k + 1 & p . c = C holds
b3 <= max (A,Ck,T),Tlet C be
bag of
n;
( c in dom p & c <= k + 1 & p . c = C implies b2 <= max (A,Ck,T),T )assume that A14:
c in dom p
and A15:
c <= k + 1
and A16:
p . c = C
;
b2 <= max (A,Ck,T),T end;
a <= k + 1
by A8, NAT_1:13;
hence
S1[
k + 1]
by A7, A9, A12, A13;
verum end; suppose A17:
max (
A,
Ck,
T)
= Ck
;
S1[k + 1]now for c being Nat
for C being bag of n st c in dom p & c <= k + 1 & p . c = C holds
C <= max (A,Ck,T),Tlet c be
Nat;
for C being bag of n st c in dom p & c <= k + 1 & p . c = C holds
b3 <= max (A,Ck,T),Tlet C be
bag of
n;
( c in dom p & c <= k + 1 & p . c = C implies b2 <= max (A,Ck,T),T )assume that A18:
c in dom p
and A19:
c <= k + 1
and A20:
p . c = C
;
b2 <= max (A,Ck,T),T end; hence
S1[
k + 1]
by A6, A17;
verum end; end; end; end;
end;
A21:
p <> {}
by A1;
A22:
S1[1]
for k being non zero Nat holds S1[k]
from NAT_1:sch 10(A22, A2);
then consider a being Nat, A being bag of n such that
A27:
a in dom p
and
a <= len p
and
A28:
p . a = A
and
A29:
for c being Nat
for C being bag of n st c in dom p & c <= len p & p . c = C holds
C <= A,T
by A21;
take
A
; ( A in B & ( for x being bag of n st x in B holds
x <= A,T ) )
thus
A in B
by A1, A27, A28, FUNCT_1:def 3; for x being bag of n st x in B holds
x <= A,T
now for x being bag of n st x in B holds
x <= A,Tend;
hence
for x being bag of n st x in B holds
x <= A,T
; verum