let p1, p2 be FinSequence; :: thesis: for q1, q2 being FinSubsequence st q1 c= p1 & q2 c= p2 holds
ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) )

let q1, q2 be FinSubsequence; :: thesis: ( q1 c= p1 & q2 c= p2 implies ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) ) )

assume A1: ( q1 c= p1 & q2 c= p2 ) ; :: thesis: ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) )

then consider ss being FinSubsequence such that
A2: ss = q1 \/ ((len p1) Shift q2) and
A3: dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) by Th80;
per cases ( ( q1 = {} & q2 = {} ) or ( q1 = {} & q2 <> {} ) or ( q1 <> {} & q2 = {} ) or ( q1 <> {} & q2 <> {} ) ) ;
suppose A4: ( q1 = {} & q2 = {} ) ; :: thesis: ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) )

then (len p1) Shift q2 = {} by Th55;
then A5: ( Seq ss = {} & Seq q1 = {} & Seq q2 = {} ) by A2, A4, Th2;
then (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) = {} by Th55;
hence ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) ) by A2, A3, A5; :: thesis: verum
end;
suppose A6: ( q1 = {} & q2 <> {} ) ; :: thesis: ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) )

then A7: Seq ss = Seq q2 by A2, Th77;
A8: Seq q1 = {} by A6, Th2;
then len (Seq q1) = 0 ;
then (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) = Seq q2 by A8, Th52;
hence ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) ) by A2, A3, A7; :: thesis: verum
end;
suppose A9: ( q1 <> {} & q2 = {} ) ; :: thesis: ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) )

then A10: (len p1) Shift q2 = {} by Th55;
Seq q2 = {} by A9, Th2;
then (len (Seq q1)) Shift (Seq q2) = {} by Th55;
hence ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) ) by A2, A3, A10; :: thesis: verum
end;
suppose A11: ( q1 <> {} & q2 <> {} ) ; :: thesis: ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) )

A12: Seg ((len (Seq q1)) + (len (Seq q2))) = { k where k is Element of NAT : ( 1 <= k & k <= (len (Seq q1)) + (len (Seq q2)) ) } by FINSEQ_1:def 1;
A13: dom (Seq q1) = Seg (len (Seq q1)) by FINSEQ_1:def 3
.= { k where k is Element of NAT : ( 1 <= k & k <= len (Seq q1) ) } by FINSEQ_1:def 1 ;
Seq q2 <> {} by A11, Th2;
then A14: dom ((len (Seq q1)) Shift (Seq q2)) = { k where k is Element of NAT : ( (len (Seq q1)) + 1 <= k & k <= (len (Seq q1)) + (len (Seq q2)) ) } by Th54;
A15: Seg ((len (Seq q1)) + (len (Seq q2))) = (dom (Seq q1)) \/ (dom ((len (Seq q1)) Shift (Seq q2)))
proof
thus Seg ((len (Seq q1)) + (len (Seq q2))) c= (dom (Seq q1)) \/ (dom ((len (Seq q1)) Shift (Seq q2))) :: according to XBOOLE_0:def 10 :: thesis: (dom (Seq q1)) \/ (dom ((len (Seq q1)) Shift (Seq q2))) c= Seg ((len (Seq q1)) + (len (Seq q2)))
proof
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in Seg ((len (Seq q1)) + (len (Seq q2))) or x in (dom (Seq q1)) \/ (dom ((len (Seq q1)) Shift (Seq q2))) )
assume x in Seg ((len (Seq q1)) + (len (Seq q2))) ; :: thesis: x in (dom (Seq q1)) \/ (dom ((len (Seq q1)) Shift (Seq q2)))
then consider k1 being Element of NAT such that
A16: ( x = k1 & 1 <= k1 & k1 <= (len (Seq q1)) + (len (Seq q2)) ) by A12;
A17: ( 1 <= k1 & k1 <= len (Seq q1) implies k1 in dom (Seq q1) ) by A13;
( (len (Seq q1)) + 1 <= k1 & k1 <= (len (Seq q1)) + (len (Seq q2)) implies k1 in dom ((len (Seq q1)) Shift (Seq q2)) ) by A14;
hence x in (dom (Seq q1)) \/ (dom ((len (Seq q1)) Shift (Seq q2))) by A16, A17, INT_1:20, XBOOLE_0:def 3; :: thesis: verum
end;
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in (dom (Seq q1)) \/ (dom ((len (Seq q1)) Shift (Seq q2))) or x in Seg ((len (Seq q1)) + (len (Seq q2))) )
assume A18: x in (dom (Seq q1)) \/ (dom ((len (Seq q1)) Shift (Seq q2))) ; :: thesis: x in Seg ((len (Seq q1)) + (len (Seq q2)))
A19: ( 0 <= len (Seq q1) & 0 <= len (Seq q2) ) by NAT_1:2;
A20: now
assume x in dom (Seq q1) ; :: thesis: x in Seg ((len (Seq q1)) + (len (Seq q2)))
then consider k1 being Element of NAT such that
A21: ( x = k1 & 1 <= k1 & k1 <= len (Seq q1) ) by A13;
(len (Seq q1)) + 0 <= (len (Seq q1)) + (len (Seq q2)) by A19, XREAL_1:9;
then k1 <= (len (Seq q1)) + (len (Seq q2)) by A21, XXREAL_0:2;
hence x in Seg ((len (Seq q1)) + (len (Seq q2))) by A12, A21; :: thesis: verum
end;
now
assume x in dom ((len (Seq q1)) Shift (Seq q2)) ; :: thesis: x in Seg ((len (Seq q1)) + (len (Seq q2)))
then consider k2 being Element of NAT such that
A22: ( x = k2 & (len (Seq q1)) + 1 <= k2 & k2 <= (len (Seq q1)) + (len (Seq q2)) ) by A14;
0 + 1 <= (len (Seq q1)) + 1 by A19, XREAL_1:9;
then 1 <= k2 by A22, XXREAL_0:2;
hence x in Seg ((len (Seq q1)) + (len (Seq q2))) by A12, A22; :: thesis: verum
end;
hence x in Seg ((len (Seq q1)) + (len (Seq q2))) by A18, A20, XBOOLE_0:def 3; :: thesis: verum
end;
A23: (dom (Seq q1)) \/ (dom ((len (Seq q1)) Shift (Seq q2))) = dom ((Seq q1) \/ ((len (Seq q1)) Shift (Seq q2))) by RELAT_1:13;
dom (Seq q1) misses dom ((len (Seq q1)) Shift (Seq q2)) by Th63;
then reconsider ss1 = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) as Function by GRFUNC_1:31;
for x being set st x in dom (Seq ss) holds
(Seq ss) . x = ss1 . x
proof
let x be set ; :: thesis: ( x in dom (Seq ss) implies (Seq ss) . x = ss1 . x )
assume A24: x in dom (Seq ss) ; :: thesis: (Seq ss) . x = ss1 . x
then A25: x in dom (ss * (Sgm (dom ss))) by FINSEQ_1:def 14;
A26: (Seq ss) . x = (ss * (Sgm (dom ss))) . x by FINSEQ_1:def 14
.= ss . ((Sgm (dom ss)) . x) by A25, FUNCT_1:22
.= ss . ((Sgm ((dom q1) \/ (dom ((len p1) Shift q2)))) . x) by A2, RELAT_1:13
.= ss . (((Sgm (dom q1)) ^ (Sgm (dom ((len p1) Shift q2)))) . x) by A1, A11, Lm11 ;
A27: now
assume A28: x in dom (Seq q1) ; :: thesis: (Seq ss) . x = ss1 . x
then A29: x in dom (Sgm (dom q1)) by Lm4;
then (Sgm (dom q1)) . x in rng (Sgm (dom q1)) by FUNCT_1:def 5;
then A30: (Sgm (dom q1)) . x in dom q1 by FINSEQ_1:71;
(Seq ss) . x = ss . ((Sgm (dom q1)) . x) by A26, A29, FINSEQ_1:def 7
.= q1 . ((Sgm (dom q1)) . x) by A2, A30, GRFUNC_1:35
.= (q1 * (Sgm (dom q1))) . x by A29, FUNCT_1:23
.= (Seq q1) . x by FINSEQ_1:def 14 ;
hence (Seq ss) . x = ss1 . x by A28, GRFUNC_1:35; :: thesis: verum
end;
now
assume A31: x in dom ((len (Seq q1)) Shift (Seq q2)) ; :: thesis: (Seq ss) . x = ss1 . x
dom ((len (Seq q1)) Shift (Seq q2)) = { ((len (Seq q1)) + j) where j is Element of NAT : j in dom (Seq q2) } by Def15;
then consider j being Element of NAT such that
A32: ( x = (len (Seq q1)) + j & j in dom (Seq q2) ) by A31;
A33: ss1 . x = ((len (Seq q1)) Shift (Seq q2)) . x by A31, GRFUNC_1:35
.= (Seq q2) . j by A32, Def15 ;
consider l1 being Nat such that
A34: dom q1 c= Seg l1 by FINSEQ_1:def 12;
consider l2 being Nat such that
A35: dom ((len p1) Shift q2) c= Seg l2 by FINSEQ_1:def 12;
card (dom q1) = len (Sgm (dom q1)) by A34, FINSEQ_3:44;
then A36: card q1 = len (Sgm (dom q1)) by CARD_1:104;
A37: len (Seq q1) = card q1 by Th7;
A38: dom (Seq q2) = Seg (len (Seq q2)) by FINSEQ_1:def 3;
card q2 = len (Seq q2) by Th7;
then card ((len p1) Shift q2) = len (Seq q2) by Th57;
then A39: card (dom ((len p1) Shift q2)) = len (Seq q2) by CARD_1:104;
A40: card (dom ((len p1) Shift q2)) = len (Sgm (dom ((len p1) Shift q2))) by A35, FINSEQ_3:44;
A41: len (Sgm (dom ((len p1) Shift q2))) = len (Seq q2) by A35, A39, FINSEQ_3:44;
A42: dom (Seq q2) = dom (Sgm (dom ((len p1) Shift q2))) by A38, A39, A40, FINSEQ_1:def 3;
A43: j in dom (Sgm (dom ((len p1) Shift q2))) by A32, A38, A41, FINSEQ_1:def 3;
(Sgm (dom ((len p1) Shift q2))) . j in rng (Sgm (dom ((len p1) Shift q2))) by A32, A42, FUNCT_1:def 5;
then A44: (Sgm (dom ((len p1) Shift q2))) . j in dom ((len p1) Shift q2) by FINSEQ_1:71;
(Seq ss) . x = ss . ((Sgm (dom ((len p1) Shift q2))) . j) by A26, A32, A36, A37, A43, FINSEQ_1:def 7
.= ((len p1) Shift q2) . ((Sgm (dom ((len p1) Shift q2))) . j) by A2, A44, GRFUNC_1:35
.= (((len p1) Shift q2) * (Sgm (dom ((len p1) Shift q2)))) . j by A32, A42, FUNCT_1:23
.= (Seq ((len p1) Shift q2)) . j by FINSEQ_1:def 14
.= (Seq q2) . j by A32, Th76 ;
hence (Seq ss) . x = ss1 . x by A33; :: thesis: verum
end;
hence (Seq ss) . x = ss1 . x by A3, A15, A24, A27, XBOOLE_0:def 3; :: thesis: verum
end;
then Seq ss = ss1 by A3, A15, A23, FUNCT_1:9;
hence ex ss being FinSubsequence st
( ss = q1 \/ ((len p1) Shift q2) & dom (Seq ss) = Seg ((len (Seq q1)) + (len (Seq q2))) & Seq ss = (Seq q1) \/ ((len (Seq q1)) Shift (Seq q2)) ) by A2, A3; :: thesis: verum
end;
end;