:: GRAPH_2 semantic presentation
begin
theorem Th1: :: GRAPH_2:1
for m, k, n being Nat holds
( ( m + 1 <= k & k <= n ) iff ex i being Element of NAT st
( m <= i & i < n & k = i + 1 ) )
proof
let m, k, n be Nat; ::_thesis: ( ( m + 1 <= k & k <= n ) iff ex i being Element of NAT st
( m <= i & i < n & k = i + 1 ) )
hereby ::_thesis: ( ex i being Element of NAT st
( m <= i & i < n & k = i + 1 ) implies ( m + 1 <= k & k <= n ) )
reconsider a19 = 1 as Integer ;
reconsider k9 = k as Integer ;
assume that
A1: m + 1 <= k and
A2: k <= n ; ::_thesis: ex i being Element of NAT st
( m <= i & i < n & k = i + 1 )
1 <= m + 1 by NAT_1:11;
then reconsider i = k9 - a19 as Element of NAT by A1, INT_1:5, XXREAL_0:2;
take i = i; ::_thesis: ( m <= i & i < n & k = i + 1 )
(m + 1) - 1 <= k - 1 by A1, XREAL_1:9;
hence m <= i ; ::_thesis: ( i < n & k = i + 1 )
k < k + 1 by NAT_1:13;
then k - 1 < (k + 1) - 1 by XREAL_1:9;
hence i < n by A2, XXREAL_0:2; ::_thesis: k = i + 1
thus k = i + 1 ; ::_thesis: verum
end;
given i being Element of NAT such that A3: m <= i and
A4: i < n and
A5: k = i + 1 ; ::_thesis: ( m + 1 <= k & k <= n )
thus ( m + 1 <= k & k <= n ) by A3, A4, A5, NAT_1:13, XREAL_1:7; ::_thesis: verum
end;
theorem Th2: :: GRAPH_2:2
for q, p being FinSequence
for n being Element of NAT st q = p | (Seg n) holds
( len q <= len p & ( for i being Element of NAT st 1 <= i & i <= len q holds
p . i = q . i ) )
proof
let q, p be FinSequence; ::_thesis: for n being Element of NAT st q = p | (Seg n) holds
( len q <= len p & ( for i being Element of NAT st 1 <= i & i <= len q holds
p . i = q . i ) )
let n be Element of NAT ; ::_thesis: ( q = p | (Seg n) implies ( len q <= len p & ( for i being Element of NAT st 1 <= i & i <= len q holds
p . i = q . i ) ) )
assume A1: q = p | (Seg n) ; ::_thesis: ( len q <= len p & ( for i being Element of NAT st 1 <= i & i <= len q holds
p . i = q . i ) )
percases ( n <= len p or len p <= n ) ;
supposeA2: n <= len p ; ::_thesis: ( len q <= len p & ( for i being Element of NAT st 1 <= i & i <= len q holds
p . i = q . i ) )
hence len q <= len p by A1, FINSEQ_1:17; ::_thesis: for i being Element of NAT st 1 <= i & i <= len q holds
p . i = q . i
let i be Element of NAT ; ::_thesis: ( 1 <= i & i <= len q implies p . i = q . i )
assume that
A3: 1 <= i and
A4: i <= len q ; ::_thesis: p . i = q . i
len q = n by A1, A2, FINSEQ_1:17;
then i in Seg n by A3, A4;
hence p . i = q . i by A1, FUNCT_1:49; ::_thesis: verum
end;
supposeA5: len p <= n ; ::_thesis: ( len q <= len p & ( for i being Element of NAT st 1 <= i & i <= len q holds
p . i = q . i ) )
hence len q <= len p by A1, FINSEQ_2:20; ::_thesis: for i being Element of NAT st 1 <= i & i <= len q holds
p . i = q . i
let i be Element of NAT ; ::_thesis: ( 1 <= i & i <= len q implies p . i = q . i )
assume that
1 <= i and
i <= len q ; ::_thesis: p . i = q . i
thus p . i = q . i by A1, A5, FINSEQ_2:20; ::_thesis: verum
end;
end;
end;
theorem Th3: :: GRAPH_2:3
for X, Y being set
for k being Element of NAT st X c= Seg k & Y c= dom (Sgm X) holds
(Sgm X) * (Sgm Y) = Sgm (rng ((Sgm X) | Y))
proof
let X, Y be set ; ::_thesis: for k being Element of NAT st X c= Seg k & Y c= dom (Sgm X) holds
(Sgm X) * (Sgm Y) = Sgm (rng ((Sgm X) | Y))
let k be Element of NAT ; ::_thesis: ( X c= Seg k & Y c= dom (Sgm X) implies (Sgm X) * (Sgm Y) = Sgm (rng ((Sgm X) | Y)) )
assume that
A1: X c= Seg k and
A2: Y c= dom (Sgm X) ; ::_thesis: (Sgm X) * (Sgm Y) = Sgm (rng ((Sgm X) | Y))
reconsider Y9 = Y as finite set by A2;
set M = (Sgm X) * (Sgm Y);
set R = rng ((Sgm X) | Y);
A3: Y c= Seg (len (Sgm X)) by A2, FINSEQ_1:def_3;
then A4: rng (Sgm Y) = Y by FINSEQ_1:def_13;
dom (Sgm Y9) = Seg (card Y9) by A3, FINSEQ_3:40;
then A5: dom ((Sgm X) * (Sgm Y)) = Seg (card Y9) by A2, A4, RELAT_1:27;
A6: rng (Sgm X) c= Seg k by A1, FINSEQ_1:def_13;
then A7: rng (Sgm X) c= NAT by XBOOLE_1:1;
reconsider M = (Sgm X) * (Sgm Y) as FinSequence by A5, FINSEQ_1:def_2;
rng M c= rng (Sgm X) by RELAT_1:26;
then rng M c= NAT by A7, XBOOLE_1:1;
then reconsider L = (Sgm X) * (Sgm Y) as FinSequence of NAT by FINSEQ_1:def_4;
now__::_thesis:_for_y_being_set_holds_
(_(_y_in_rng_L_implies_y_in_rng_((Sgm_X)_|_Y)_)_&_(_y_in_rng_((Sgm_X)_|_Y)_implies_y_in_rng_L_)_)
let y be set ; ::_thesis: ( ( y in rng L implies y in rng ((Sgm X) | Y) ) & ( y in rng ((Sgm X) | Y) implies y in rng L ) )
hereby ::_thesis: ( y in rng ((Sgm X) | Y) implies y in rng L )
assume y in rng L ; ::_thesis: y in rng ((Sgm X) | Y)
then consider x being set such that
A8: x in dom L and
A9: y = L . x by FUNCT_1:def_3;
x in dom (Sgm Y) by A8, FUNCT_1:11;
then A10: (Sgm Y) . x in Y by A4, FUNCT_1:def_3;
y = (Sgm X) . ((Sgm Y) . x) by A8, A9, FUNCT_1:12;
hence y in rng ((Sgm X) | Y) by A2, A10, FUNCT_1:50; ::_thesis: verum
end;
assume y in rng ((Sgm X) | Y) ; ::_thesis: y in rng L
then consider x being set such that
A11: x in dom ((Sgm X) | Y) and
A12: y = ((Sgm X) | Y) . x by FUNCT_1:def_3;
A13: x in (dom (Sgm X)) /\ Y by A11, RELAT_1:61;
then A14: x in Y by XBOOLE_0:def_4;
then consider z being set such that
A15: z in dom (Sgm Y) and
A16: x = (Sgm Y) . z by A4, FUNCT_1:def_3;
x in dom (Sgm X) by A13, XBOOLE_0:def_4;
then A17: z in dom ((Sgm X) * (Sgm Y)) by A15, A16, FUNCT_1:11;
y = (Sgm X) . x by A12, A14, FUNCT_1:49;
then L . z = y by A16, A17, FUNCT_1:12;
hence y in rng L by A17, FUNCT_1:def_3; ::_thesis: verum
end;
then A18: rng L = rng ((Sgm X) | Y) by TARSKI:1;
A19: now__::_thesis:_for_l,_m,_k1,_k2_being_Nat_st_1_<=_l_&_l_<_m_&_m_<=_len_L_&_k1_=_L_._l_&_k2_=_L_._m_holds_
k1_<_k2
let l, m, k1, k2 be Nat; ::_thesis: ( 1 <= l & l < m & m <= len L & k1 = L . l & k2 = L . m implies k1 < k2 )
assume that
A20: 1 <= l and
A21: l < m and
A22: m <= len L and
A23: k1 = L . l and
A24: k2 = L . m ; ::_thesis: k1 < k2
l <= len L by A21, A22, XXREAL_0:2;
then A25: l in dom L by A20, FINSEQ_3:25;
then A26: L . l = (Sgm X) . ((Sgm Y) . l) by FUNCT_1:12;
1 <= m by A20, A21, XXREAL_0:2;
then A27: m in dom L by A22, FINSEQ_3:25;
then A28: L . m = (Sgm X) . ((Sgm Y) . m) by FUNCT_1:12;
A29: (Sgm Y) . l in dom (Sgm X) by A25, FUNCT_1:11;
m in dom (Sgm Y) by A27, FUNCT_1:11;
then A30: m <= len (Sgm Y) by FINSEQ_3:25;
A31: (Sgm Y) . m in dom (Sgm X) by A27, FUNCT_1:11;
reconsider l = l, m = m as Element of NAT by ORDINAL1:def_12;
reconsider K1 = (Sgm Y) . l, K2 = (Sgm Y) . m as Element of NAT ;
A32: 1 <= K1 by A29, FINSEQ_3:25;
A33: K2 <= len (Sgm X) by A31, FINSEQ_3:25;
K1 < K2 by A3, A20, A21, A30, FINSEQ_1:def_13;
hence k1 < k2 by A1, A23, A24, A26, A28, A32, A33, FINSEQ_1:def_13; ::_thesis: verum
end;
rng ((Sgm X) | Y) c= rng (Sgm X) by RELAT_1:70;
then rng ((Sgm X) | Y) c= Seg k by A6, XBOOLE_1:1;
hence (Sgm X) * (Sgm Y) = Sgm (rng ((Sgm X) | Y)) by A18, A19, FINSEQ_1:def_13; ::_thesis: verum
end;
Lm1: for m, n being Element of NAT
for F being finite set st F = { k where k is Element of NAT : ( m <= k & k <= m + n ) } holds
card F = n + 1
proof
let m be Element of NAT ; ::_thesis: for n being Element of NAT
for F being finite set st F = { k where k is Element of NAT : ( m <= k & k <= m + n ) } holds
card F = n + 1
defpred S1[ Element of NAT ] means for F being finite set st F = { k where k is Element of NAT : ( m <= k & k <= m + $1 ) } holds
card F = $1 + 1;
A1: now__::_thesis:_for_n_being_Element_of_NAT_st_S1[n]_holds_
S1[n_+_1]
let n be Element of NAT ; ::_thesis: ( S1[n] implies S1[n + 1] )
assume A2: S1[n] ; ::_thesis: S1[n + 1]
thus S1[n + 1] ::_thesis: verum
proof
reconsider F2 = { k where k is Element of NAT : k <= m + n } as finite set by CQC_THE1:2;
set F1 = { k where k is Element of NAT : ( m <= k & k <= m + n ) } ;
{ k where k is Element of NAT : ( m <= k & k <= m + n ) } c= F2
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { k where k is Element of NAT : ( m <= k & k <= m + n ) } or x in F2 )
assume x in { k where k is Element of NAT : ( m <= k & k <= m + n ) } ; ::_thesis: x in F2
then ex k being Element of NAT st
( x = k & m <= k & k <= m + n ) ;
hence x in F2 ; ::_thesis: verum
end;
then reconsider F1 = { k where k is Element of NAT : ( m <= k & k <= m + n ) } as finite set ;
let F be finite set ; ::_thesis: ( F = { k where k is Element of NAT : ( m <= k & k <= m + (n + 1) ) } implies card F = (n + 1) + 1 )
A3: not m + (n + 1) in { k where k is Element of NAT : ( m <= k & k <= m + n ) }
proof
assume m + (n + 1) in { k where k is Element of NAT : ( m <= k & k <= m + n ) } ; ::_thesis: contradiction
then ex k being Element of NAT st
( m + (n + 1) = k & m <= k & k <= m + n ) ;
then (m + n) + 1 <= (m + n) + 0 ;
hence contradiction by XREAL_1:6; ::_thesis: verum
end;
assume A4: F = { k where k is Element of NAT : ( m <= k & k <= m + (n + 1) ) } ; ::_thesis: card F = (n + 1) + 1
now__::_thesis:_for_x_being_set_holds_
(_(_x_in_F_implies_x_in_F1_\/_{(m_+_(n_+_1))}_)_&_(_x_in_F1_\/_{(m_+_(n_+_1))}_implies_x_in_F_)_)
let x be set ; ::_thesis: ( ( x in F implies x in F1 \/ {(m + (n + 1))} ) & ( x in F1 \/ {(m + (n + 1))} implies b1 in F ) )
hereby ::_thesis: ( x in F1 \/ {(m + (n + 1))} implies b1 in F )
assume x in F ; ::_thesis: x in F1 \/ {(m + (n + 1))}
then consider k being Element of NAT such that
A5: x = k and
A6: m <= k and
A7: k <= m + (n + 1) by A4;
k <= (m + n) + 1 by A7;
then ( k <= m + n or k = m + (n + 1) ) by NAT_1:8;
then ( k in F1 or k in {(m + (n + 1))} ) by A6, TARSKI:def_1;
hence x in F1 \/ {(m + (n + 1))} by A5, XBOOLE_0:def_3; ::_thesis: verum
end;
assume A8: x in F1 \/ {(m + (n + 1))} ; ::_thesis: b1 in F
percases ( x in F1 or x in {(m + (n + 1))} ) by A8, XBOOLE_0:def_3;
suppose x in F1 ; ::_thesis: b1 in F
then consider k being Element of NAT such that
A9: x = k and
A10: m <= k and
A11: k <= m + n ;
k <= (m + n) + 1 by A11, NAT_1:12;
hence x in F by A4, A9, A10; ::_thesis: verum
end;
supposeA12: x in {(m + (n + 1))} ; ::_thesis: b1 in F
then reconsider k = x as Element of NAT by TARSKI:def_1;
A13: x = m + (n + 1) by A12, TARSKI:def_1;
then m <= k by NAT_1:11;
hence x in F by A4, A13; ::_thesis: verum
end;
end;
end;
then A14: F = { k where k is Element of NAT : ( m <= k & k <= m + n ) } \/ {(m + (n + 1))} by TARSKI:1;
card F1 = n + 1 by A2;
hence card F = (n + 1) + 1 by A14, A3, CARD_2:41; ::_thesis: verum
end;
end;
A15: S1[ 0 ]
proof
let F be finite set ; ::_thesis: ( F = { k where k is Element of NAT : ( m <= k & k <= m + 0 ) } implies card F = 0 + 1 )
assume A16: F = { k where k is Element of NAT : ( m <= k & k <= m + 0 ) } ; ::_thesis: card F = 0 + 1
now__::_thesis:_for_x_being_set_holds_
(_(_x_in_F_implies_x_=_m_)_&_(_x_=_m_implies_x_in_F_)_)
let x be set ; ::_thesis: ( ( x in F implies x = m ) & ( x = m implies x in F ) )
hereby ::_thesis: ( x = m implies x in F )
assume x in F ; ::_thesis: x = m
then ex k being Element of NAT st
( x = k & m <= k & k <= m + 0 ) by A16;
hence x = m by XXREAL_0:1; ::_thesis: verum
end;
assume x = m ; ::_thesis: x in F
hence x in F by A16; ::_thesis: verum
end;
then F = {m} by TARSKI:def_1;
hence card F = 0 + 1 by CARD_1:30; ::_thesis: verum
end;
for n being Element of NAT holds S1[n] from NAT_1:sch_1(A15, A1);
hence for n being Element of NAT
for F being finite set st F = { k where k is Element of NAT : ( m <= k & k <= m + n ) } holds
card F = n + 1 ; ::_thesis: verum
end;
theorem Th4: :: GRAPH_2:4
for m, n being Element of NAT holds card { k where k is Element of NAT : ( m <= k & k <= m + n ) } = n + 1
proof
deffunc H1( Element of NAT ) -> Element of NAT = $1;
defpred S1[ Element of NAT ] means verum;
let m, n be Element of NAT ; ::_thesis: card { k where k is Element of NAT : ( m <= k & k <= m + n ) } = n + 1
set F = { H1(k) where k is Element of NAT : ( m <= k & k <= m + n & S1[k] ) } ;
{ H1(k) where k is Element of NAT : ( m <= k & k <= m + n & S1[k] ) } is finite from FINSEQ_1:sch_6();
then reconsider F = { H1(k) where k is Element of NAT : ( m <= k & k <= m + n & S1[k] ) } as finite set ;
F = { H1(k) where k is Element of NAT : ( m <= k & k <= m + n ) }
proof
thus F c= { H1(k) where k is Element of NAT : ( m <= k & k <= m + n ) } :: according to XBOOLE_0:def_10 ::_thesis: { H1(k) where k is Element of NAT : ( m <= k & k <= m + n ) } c= F
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in F or x in { H1(k) where k is Element of NAT : ( m <= k & k <= m + n ) } )
assume x in F ; ::_thesis: x in { H1(k) where k is Element of NAT : ( m <= k & k <= m + n ) }
then ex k1 being Element of NAT st
( x = H1(k1) & m <= k1 & k1 <= m + n ) ;
hence x in { H1(k) where k is Element of NAT : ( m <= k & k <= m + n ) } ; ::_thesis: verum
end;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { H1(k) where k is Element of NAT : ( m <= k & k <= m + n ) } or x in F )
assume x in { H1(k) where k is Element of NAT : ( m <= k & k <= m + n ) } ; ::_thesis: x in F
then ex k1 being Element of NAT st
( x = H1(k1) & m <= k1 & k1 <= m + n ) ;
hence x in F ; ::_thesis: verum
end;
then reconsider G = { H1(k) where k is Element of NAT : ( m <= k & k <= m + n ) } as finite set ;
card G = n + 1 by Lm1;
hence card { k where k is Element of NAT : ( m <= k & k <= m + n ) } = n + 1 ; ::_thesis: verum
end;
theorem Th5: :: GRAPH_2:5
for n, m, l being Element of NAT st 1 <= l & l <= n holds
(Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . l = m + l
proof
let n, m be Element of NAT ; ::_thesis: for l being Element of NAT st 1 <= l & l <= n holds
(Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . l = m + l
set F = Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ;
defpred S1[ Nat] means ( 1 <= $1 & $1 <= n & (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . $1 <> m + $1 );
set rF = { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ;
A1: { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } c= Seg (m + n)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } or x in Seg (m + n) )
assume x in { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ; ::_thesis: x in Seg (m + n)
then consider x9 being Element of NAT such that
A2: x9 = x and
A3: m + 1 <= x9 and
A4: x9 <= m + n ;
1 <= m + 1 by NAT_1:11;
then 1 <= x9 by A3, XXREAL_0:2;
hence x in Seg (m + n) by A2, A4; ::_thesis: verum
end;
then reconsider rF = { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } as finite set ;
assume ex l being Element of NAT st S1[l] ; ::_thesis: contradiction
then A5: ex l being Nat st S1[l] ;
consider k being Nat such that
A6: S1[k] and
A7: for nn being Nat st S1[nn] holds
k <= nn from NAT_1:sch_5(A5);
reconsider k = k as Element of NAT by ORDINAL1:def_12;
A8: m + k <= m + n by A6, XREAL_1:7;
reconsider Fk = (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . k as Element of NAT ;
A9: card rF = n
proof
percases ( n = 0 or 0 < n ) ;
supposeA10: n = 0 ; ::_thesis: card rF = n
rF = {}
proof
assume rF <> {} ; ::_thesis: contradiction
then consider x being set such that
A11: x in rF by XBOOLE_0:def_1;
ex x9 being Element of NAT st
( x9 = x & m + 1 <= x9 & x9 <= m + n ) by A11;
then m + 1 <= m + 0 by A10, XXREAL_0:2;
hence contradiction by XREAL_1:6; ::_thesis: verum
end;
hence card rF = n by A10; ::_thesis: verum
end;
suppose 0 < n ; ::_thesis: card rF = n
then 0 + 1 <= n by NAT_1:13;
then 1 - 1 <= n - 1 by XREAL_1:9;
then n -' 1 = n - 1 by XREAL_0:def_2;
then reconsider n1 = n - 1 as Element of NAT ;
(m + 1) + n1 = m + n ;
then card rF = n1 + 1 by Th4;
hence card rF = n ; ::_thesis: verum
end;
end;
end;
then A12: len (Sgm rF) = n by A1, FINSEQ_3:39;
A13: rng (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) = rF by A1, FINSEQ_1:def_13;
now__::_thesis:_for_k_being_Element_of_NAT_holds_S2[k]
defpred S2[ Nat] means for Fk being Element of NAT st 1 <= $1 & $1 <= n & Fk = (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . $1 holds
m + $1 <= Fk;
A14: for k being Element of NAT st S2[k] holds
S2[k + 1]
proof
let k be Element of NAT ; ::_thesis: ( S2[k] implies S2[k + 1] )
assume A15: S2[k] ; ::_thesis: S2[k + 1]
A16: k < k + 1 by NAT_1:13;
let Fk1 be Element of NAT ; ::_thesis: ( 1 <= k + 1 & k + 1 <= n & Fk1 = (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . (k + 1) implies m + (k + 1) <= Fk1 )
assume that
A17: 1 <= k + 1 and
A18: k + 1 <= n and
A19: Fk1 = (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . (k + 1) ; ::_thesis: m + (k + 1) <= Fk1
percases ( 1 < k + 1 or 1 = k + 1 ) by A17, XXREAL_0:1;
supposeA20: 1 < k + 1 ; ::_thesis: m + (k + 1) <= Fk1
reconsider Fk = (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . k as Element of NAT ;
A21: 1 <= k by A20, NAT_1:13;
k <= n by A18, NAT_1:13;
then A22: m + k <= Fk by A15, A21;
Fk < Fk1 by A1, A12, A18, A19, A16, A21, FINSEQ_1:def_13;
then m + k < Fk1 by A22, XXREAL_0:2;
then (m + k) + 1 <= Fk1 by NAT_1:13;
hence m + (k + 1) <= Fk1 ; ::_thesis: verum
end;
supposeA23: 1 = k + 1 ; ::_thesis: m + (k + 1) <= Fk1
then 1 in dom (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) by A12, A18, FINSEQ_3:25;
then (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . 1 in rng (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) by FUNCT_1:def_3;
then ex F1 being Element of NAT st
( F1 = (Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . 1 & m + 1 <= F1 & F1 <= m + n ) by A13;
hence m + (k + 1) <= Fk1 by A19, A23; ::_thesis: verum
end;
end;
end;
A24: S2[ 0 ] ;
thus for k being Element of NAT holds S2[k] from NAT_1:sch_1(A24, A14); ::_thesis: verum
end;
then A25: m + k <= Fk by A6;
m + 1 <= m + k by A6, XREAL_1:7;
then m + k in rF by A8;
then m + k in rng (Sgm rF) by A1, FINSEQ_1:def_13;
then consider x being set such that
A26: x in dom (Sgm rF) and
A27: m + k = (Sgm rF) . x by FUNCT_1:def_3;
reconsider x = x as Element of NAT by A26;
A28: dom (Sgm rF) = Seg n by A1, A9, FINSEQ_3:40;
then A29: 1 <= x by A26, FINSEQ_1:1;
A30: x <= n by A28, A26, FINSEQ_1:1;
percases ( k < x or k > x ) by A6, A27, XXREAL_0:1;
suppose k < x ; ::_thesis: contradiction
hence contradiction by A6, A1, A12, A27, A25, A30, FINSEQ_1:def_13; ::_thesis: verum
end;
supposeA31: k > x ; ::_thesis: contradiction
(Sgm { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= m + n ) } ) . x <> m + x by A6, A27, XCMPLX_1:2;
hence contradiction by A7, A29, A30, A31; ::_thesis: verum
end;
end;
end;
begin
definition
let p be FinSequence;
let m, n be Nat;
func(m,n) -cut p -> FinSequence means :Def1: :: GRAPH_2:def 1
( (len it) + m = n + 1 & ( for i being Nat st i < len it holds
it . (i + 1) = p . (m + i) ) ) if ( 1 <= m & m <= n & n <= len p )
otherwise it = {} ;
consistency
for b1 being FinSequence holds verum ;
existence
( ( 1 <= m & m <= n & n <= len p implies ex b1 being FinSequence st
( (len b1) + m = n + 1 & ( for i being Nat st i < len b1 holds
b1 . (i + 1) = p . (m + i) ) ) ) & ( ( not 1 <= m or not m <= n or not n <= len p ) implies ex b1 being FinSequence st b1 = {} ) )
proof
hereby ::_thesis: ( ( not 1 <= m or not m <= n or not n <= len p ) implies ex b1 being FinSequence st b1 = {} )
deffunc H1( Nat) -> set = p . (m + ($1 - 1));
assume that
1 <= m and
A1: m <= n and
n <= len p ; ::_thesis: ex s being FinSequence st
( (len s) + m = n + 1 & ( for k being Nat st k < len s holds
s . (k + 1) = p . (m + k) ) )
consider s being FinSequence such that
A2: ( len s = (n + 1) -' m & ( for k being Nat st k in dom s holds
s . k = H1(k) ) ) from FINSEQ_1:sch_2();
take s = s; ::_thesis: ( (len s) + m = n + 1 & ( for k being Nat st k < len s holds
s . (k + 1) = p . (m + k) ) )
n <= n + 1 by XREAL_1:29;
then m <= n + 1 by A1, XXREAL_0:2;
then m - m <= (n + 1) - m by XREAL_1:9;
then (len s) + m = ((n + 1) - m) + m by A2, XREAL_0:def_2;
hence (len s) + m = n + 1 ; ::_thesis: for k being Nat st k < len s holds
s . (k + 1) = p . (m + k)
let k be Nat; ::_thesis: ( k < len s implies s . (k + 1) = p . (m + k) )
assume k < len s ; ::_thesis: s . (k + 1) = p . (m + k)
then A3: k + 1 <= len s by NAT_1:13;
0 + 1 <= k + 1 by XREAL_1:7;
then k + 1 in dom s by A3, FINSEQ_3:25;
hence s . (k + 1) = p . (m + ((k + 1) - 1)) by A2
.= p . (m + k) ;
::_thesis: verum
end;
thus ( ( not 1 <= m or not m <= n or not n <= len p ) implies ex b1 being FinSequence st b1 = {} ) ; ::_thesis: verum
end;
uniqueness
for b1, b2 being FinSequence holds
( ( 1 <= m & m <= n & n <= len p & (len b1) + m = n + 1 & ( for i being Nat st i < len b1 holds
b1 . (i + 1) = p . (m + i) ) & (len b2) + m = n + 1 & ( for i being Nat st i < len b2 holds
b2 . (i + 1) = p . (m + i) ) implies b1 = b2 ) & ( ( not 1 <= m or not m <= n or not n <= len p ) & b1 = {} & b2 = {} implies b1 = b2 ) )
proof
let s1, s2 be FinSequence; ::_thesis: ( ( 1 <= m & m <= n & n <= len p & (len s1) + m = n + 1 & ( for i being Nat st i < len s1 holds
s1 . (i + 1) = p . (m + i) ) & (len s2) + m = n + 1 & ( for i being Nat st i < len s2 holds
s2 . (i + 1) = p . (m + i) ) implies s1 = s2 ) & ( ( not 1 <= m or not m <= n or not n <= len p ) & s1 = {} & s2 = {} implies s1 = s2 ) )
hereby ::_thesis: ( ( not 1 <= m or not m <= n or not n <= len p ) & s1 = {} & s2 = {} implies s1 = s2 )
assume that
1 <= m and
m <= n and
n <= len p ; ::_thesis: ( (len s1) + m = n + 1 & ( for i being Nat st i < len s1 holds
s1 . (i + 1) = p . (m + i) ) & (len s2) + m = n + 1 & ( for i being Nat st i < len s2 holds
s2 . (i + 1) = p . (m + i) ) implies s1 = s2 )
assume that
A4: (len s1) + m = n + 1 and
A5: for i being Nat st i < len s1 holds
s1 . (i + 1) = p . (m + i) ; ::_thesis: ( (len s2) + m = n + 1 & ( for i being Nat st i < len s2 holds
s2 . (i + 1) = p . (m + i) ) implies s1 = s2 )
assume that
A6: (len s2) + m = n + 1 and
A7: for i being Nat st i < len s2 holds
s2 . (i + 1) = p . (m + i) ; ::_thesis: s1 = s2
now__::_thesis:_(_len_s1_=_len_s1_&_len_s2_=_len_s1_&_(_for_i_being_Nat_st_i_in_dom_s1_holds_
s1_._i_=_s2_._i_)_)
thus len s1 = len s1 ; ::_thesis: ( len s2 = len s1 & ( for i being Nat st i in dom s1 holds
s1 . i = s2 . i ) )
thus len s2 = len s1 by A4, A6; ::_thesis: for i being Nat st i in dom s1 holds
s1 . i = s2 . i
let i be Nat; ::_thesis: ( i in dom s1 implies s1 . i = s2 . i )
assume A8: i in dom s1 ; ::_thesis: s1 . i = s2 . i
A9: dom s1 = Seg (len s1) by FINSEQ_1:def_3;
then A10: i <= len s1 by A8, FINSEQ_1:1;
0 + 1 <= i by A9, A8, FINSEQ_1:1;
then consider k being Element of NAT such that
0 <= k and
A11: k < len s1 and
A12: i = k + 1 by A10, Th1;
thus s1 . i = p . (m + k) by A5, A11, A12
.= s2 . i by A4, A6, A7, A11, A12 ; ::_thesis: verum
end;
hence s1 = s2 by FINSEQ_2:9; ::_thesis: verum
end;
thus ( ( not 1 <= m or not m <= n or not n <= len p ) & s1 = {} & s2 = {} implies s1 = s2 ) ; ::_thesis: verum
end;
end;
:: deftheorem Def1 defines -cut GRAPH_2:def_1_:_
for p being FinSequence
for m, n being Nat
for b4 being FinSequence holds
( ( 1 <= m & m <= n & n <= len p implies ( b4 = (m,n) -cut p iff ( (len b4) + m = n + 1 & ( for i being Nat st i < len b4 holds
b4 . (i + 1) = p . (m + i) ) ) ) ) & ( ( not 1 <= m or not m <= n or not n <= len p ) implies ( b4 = (m,n) -cut p iff b4 = {} ) ) );
Lm2: for p being FinSequence
for m, n being Element of NAT st 1 <= m & m <= n + 1 & n <= len p holds
( (len ((m,n) -cut p)) + m = n + 1 & ( for i being Element of NAT st i < len ((m,n) -cut p) holds
((m,n) -cut p) . (i + 1) = p . (m + i) ) )
proof
let p be FinSequence; ::_thesis: for m, n being Element of NAT st 1 <= m & m <= n + 1 & n <= len p holds
( (len ((m,n) -cut p)) + m = n + 1 & ( for i being Element of NAT st i < len ((m,n) -cut p) holds
((m,n) -cut p) . (i + 1) = p . (m + i) ) )
let m, n be Element of NAT ; ::_thesis: ( 1 <= m & m <= n + 1 & n <= len p implies ( (len ((m,n) -cut p)) + m = n + 1 & ( for i being Element of NAT st i < len ((m,n) -cut p) holds
((m,n) -cut p) . (i + 1) = p . (m + i) ) ) )
assume that
A1: 1 <= m and
A2: m <= n + 1 and
A3: n <= len p ; ::_thesis: ( (len ((m,n) -cut p)) + m = n + 1 & ( for i being Element of NAT st i < len ((m,n) -cut p) holds
((m,n) -cut p) . (i + 1) = p . (m + i) ) )
A4: ( m = n + 1 or m < n + 1 ) by A2, XXREAL_0:1;
percases ( m = n + 1 or m <= n ) by A4, NAT_1:13;
supposeA5: m = n + 1 ; ::_thesis: ( (len ((m,n) -cut p)) + m = n + 1 & ( for i being Element of NAT st i < len ((m,n) -cut p) holds
((m,n) -cut p) . (i + 1) = p . (m + i) ) )
then A6: n < m by XREAL_1:29;
then (m,n) -cut p = {} by Def1;
hence (len ((m,n) -cut p)) + m = n + 1 by A5, CARD_1:27; ::_thesis: for i being Element of NAT st i < len ((m,n) -cut p) holds
((m,n) -cut p) . (i + 1) = p . (m + i)
thus for i being Element of NAT st i < len ((m,n) -cut p) holds
((m,n) -cut p) . (i + 1) = p . (m + i) by A6, Def1, CARD_1:27; ::_thesis: verum
end;
suppose m <= n ; ::_thesis: ( (len ((m,n) -cut p)) + m = n + 1 & ( for i being Element of NAT st i < len ((m,n) -cut p) holds
((m,n) -cut p) . (i + 1) = p . (m + i) ) )
hence ( (len ((m,n) -cut p)) + m = n + 1 & ( for i being Element of NAT st i < len ((m,n) -cut p) holds
((m,n) -cut p) . (i + 1) = p . (m + i) ) ) by A1, A3, Def1; ::_thesis: verum
end;
end;
end;
theorem Th6: :: GRAPH_2:6
for p being FinSequence
for m being Element of NAT st 1 <= m & m <= len p holds
(m,m) -cut p = <*(p . m)*>
proof
let p be FinSequence; ::_thesis: for m being Element of NAT st 1 <= m & m <= len p holds
(m,m) -cut p = <*(p . m)*>
let m be Element of NAT ; ::_thesis: ( 1 <= m & m <= len p implies (m,m) -cut p = <*(p . m)*> )
assume that
A1: 1 <= m and
A2: m <= len p ; ::_thesis: (m,m) -cut p = <*(p . m)*>
set mp = (m,m) -cut p;
A3: (len ((m,m) -cut p)) + m = m + 1 by A1, A2, Def1;
then ((m,m) -cut p) . (0 + 1) = p . (m + 0) by A1, A2, Def1
.= p . m ;
hence (m,m) -cut p = <*(p . m)*> by A3, FINSEQ_1:40; ::_thesis: verum
end;
theorem Th7: :: GRAPH_2:7
for p being FinSequence holds (1,(len p)) -cut p = p
proof
let p be FinSequence; ::_thesis: (1,(len p)) -cut p = p
set cp = (1,(len p)) -cut p;
now__::_thesis:_(_len_((1,(len_p))_-cut_p)_=_len_p_&_len_p_=_len_p_&_(_for_i_being_Nat_st_i_in_dom_((1,(len_p))_-cut_p)_holds_
((1,(len_p))_-cut_p)_._i_=_p_._i_)_)
A1: 1 <= (len p) + 1 by NAT_1:11;
then A2: (len ((1,(len p)) -cut p)) + 1 = (len p) + 1 by Lm2;
hence len ((1,(len p)) -cut p) = len p ; ::_thesis: ( len p = len p & ( for i being Nat st i in dom ((1,(len p)) -cut p) holds
((1,(len p)) -cut p) . i = p . i ) )
thus len p = len p ; ::_thesis: for i being Nat st i in dom ((1,(len p)) -cut p) holds
((1,(len p)) -cut p) . i = p . i
let i be Nat; ::_thesis: ( i in dom ((1,(len p)) -cut p) implies ((1,(len p)) -cut p) . i = p . i )
assume A3: i in dom ((1,(len p)) -cut p) ; ::_thesis: ((1,(len p)) -cut p) . i = p . i
A4: dom ((1,(len p)) -cut p) = Seg (len p) by A2, FINSEQ_1:def_3;
then A5: i <= len p by A3, FINSEQ_1:1;
0 + 1 <= i by A4, A3, FINSEQ_1:1;
then ex k being Element of NAT st
( 0 <= k & k < len ((1,(len p)) -cut p) & i = k + 1 ) by A2, A5, Th1;
hence ((1,(len p)) -cut p) . i = p . i by A1, Lm2; ::_thesis: verum
end;
hence (1,(len p)) -cut p = p by FINSEQ_2:9; ::_thesis: verum
end;
theorem Th8: :: GRAPH_2:8
for p being FinSequence
for m, n, r being Element of NAT st m <= n & n <= r & r <= len p holds
(((m + 1),n) -cut p) ^ (((n + 1),r) -cut p) = ((m + 1),r) -cut p
proof
let p be FinSequence; ::_thesis: for m, n, r being Element of NAT st m <= n & n <= r & r <= len p holds
(((m + 1),n) -cut p) ^ (((n + 1),r) -cut p) = ((m + 1),r) -cut p
let m, n, r be Element of NAT ; ::_thesis: ( m <= n & n <= r & r <= len p implies (((m + 1),n) -cut p) ^ (((n + 1),r) -cut p) = ((m + 1),r) -cut p )
assume that
A1: m <= n and
A2: n <= r and
A3: r <= len p ; ::_thesis: (((m + 1),n) -cut p) ^ (((n + 1),r) -cut p) = ((m + 1),r) -cut p
set p3 = ((m + 1),r) -cut p;
set p2 = ((n + 1),r) -cut p;
set p1 = ((m + 1),n) -cut p;
set p12 = (((m + 1),n) -cut p) ^ (((n + 1),r) -cut p);
now__::_thesis:_(_len_((((m_+_1),n)_-cut_p)_^_(((n_+_1),r)_-cut_p))_=_len_((((m_+_1),n)_-cut_p)_^_(((n_+_1),r)_-cut_p))_&_len_(((m_+_1),r)_-cut_p)_=_len_((((m_+_1),n)_-cut_p)_^_(((n_+_1),r)_-cut_p))_&_(_for_i_being_Nat_st_i_in_dom_((((m_+_1),n)_-cut_p)_^_(((n_+_1),r)_-cut_p))_holds_
((((m_+_1),n)_-cut_p)_^_(((n_+_1),r)_-cut_p))_._i_=_(((m_+_1),r)_-cut_p)_._i_)_)
reconsider n9 = n as Integer ;
reconsider m9 = m as Integer ;
thus len ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) = len ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) ; ::_thesis: ( len (((m + 1),r) -cut p) = len ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) & ( for i being Nat st i in dom ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) holds
((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) . b2 = (((m + 1),r) -cut p) . b2 ) )
A4: dom ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) = Seg (len ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p))) by FINSEQ_1:def_3;
reconsider nm = n9 - m9 as Element of NAT by A1, INT_1:5;
A5: 1 <= m + 1 by NAT_1:11;
m <= r by A1, A2, XXREAL_0:2;
then A6: m + 1 <= r + 1 by XREAL_1:6;
A7: m + 1 <= n + 1 by A1, XREAL_1:6;
A8: n + 1 <= r + 1 by A2, XREAL_1:6;
then m + 1 <= r + 1 by A7, XXREAL_0:2;
then A9: (len (((m + 1),r) -cut p)) + (m + 1) = r + 1 by A3, A5, Lm2;
A10: n <= len p by A2, A3, XXREAL_0:2;
then A11: (len (((m + 1),n) -cut p)) + (m + 1) = n + 1 by A5, A7, Lm2;
A12: 1 <= n + 1 by NAT_1:11;
then (len (((n + 1),r) -cut p)) + (n + 1) = r + 1 by A3, A8, Lm2;
then A13: len ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) = (n - m) + (r + (- n)) by A11, FINSEQ_1:22
.= r - m ;
hence len (((m + 1),r) -cut p) = len ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) by A9; ::_thesis: for i being Nat st i in dom ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) holds
((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) . b2 = (((m + 1),r) -cut p) . b2
let i be Nat; ::_thesis: ( i in dom ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) implies ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) . b1 = (((m + 1),r) -cut p) . b1 )
assume A14: i in dom ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) ; ::_thesis: ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) . b1 = (((m + 1),r) -cut p) . b1
then A15: 1 <= i by A4, FINSEQ_1:1;
A16: i <= len ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) by A4, A14, FINSEQ_1:1;
percases ( i <= nm or nm + 1 <= i ) by NAT_1:13;
supposeA17: i <= nm ; ::_thesis: ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) . b1 = (((m + 1),r) -cut p) . b1
0 + 1 = 1 ;
then consider k being Element of NAT such that
0 <= k and
A18: k < nm and
A19: i = k + 1 by A15, A17, Th1;
nm <= r - m by A2, XREAL_1:9;
then A20: k < len (((m + 1),r) -cut p) by A9, A18, XXREAL_0:2;
i in dom (((m + 1),n) -cut p) by A11, A15, A17, FINSEQ_3:25;
hence ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) . i = (((m + 1),n) -cut p) . i by FINSEQ_1:def_7
.= p . ((m + 1) + k) by A5, A7, A10, A11, A18, A19, Lm2
.= (((m + 1),r) -cut p) . i by A3, A5, A6, A19, A20, Lm2 ;
::_thesis: verum
end;
suppose nm + 1 <= i ; ::_thesis: ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) . b1 = (((m + 1),r) -cut p) . b1
then consider k being Element of NAT such that
A21: nm <= k and
A22: k < len ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) and
A23: i = k + 1 by A16, Th1;
reconsider k99 = k as Integer ;
reconsider k9 = k99 - nm as Element of NAT by A21, INT_1:5;
A24: 1 <= k9 + 1 by NAT_1:11;
len ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) = (len (((n + 1),r) -cut p)) + (len (((m + 1),n) -cut p)) by FINSEQ_1:22;
then len (((n + 1),r) -cut p) = (len ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p))) - (len (((m + 1),n) -cut p)) ;
then A25: k9 < len (((n + 1),r) -cut p) by A11, A22, XREAL_1:9;
then k9 + 1 <= len (((n + 1),r) -cut p) by NAT_1:13;
then A26: k9 + 1 in dom (((n + 1),r) -cut p) by A24, FINSEQ_3:25;
A27: (n + 1) + k9 = (m + 1) + k ;
i = nm + (k9 + 1) by A23;
hence ((((m + 1),n) -cut p) ^ (((n + 1),r) -cut p)) . i = (((n + 1),r) -cut p) . (k9 + 1) by A11, A26, FINSEQ_1:def_7
.= p . ((n + 1) + k9) by A3, A12, A8, A25, Lm2
.= (((m + 1),r) -cut p) . i by A3, A5, A6, A13, A9, A22, A23, A27, Lm2 ;
::_thesis: verum
end;
end;
end;
hence (((m + 1),n) -cut p) ^ (((n + 1),r) -cut p) = ((m + 1),r) -cut p by FINSEQ_2:9; ::_thesis: verum
end;
theorem :: GRAPH_2:9
for p being FinSequence
for m being Element of NAT st m <= len p holds
((1,m) -cut p) ^ (((m + 1),(len p)) -cut p) = p
proof
let p be FinSequence; ::_thesis: for m being Element of NAT st m <= len p holds
((1,m) -cut p) ^ (((m + 1),(len p)) -cut p) = p
let m be Element of NAT ; ::_thesis: ( m <= len p implies ((1,m) -cut p) ^ (((m + 1),(len p)) -cut p) = p )
set cp1 = (1,m) -cut p;
set cpm = ((m + 1),(len p)) -cut p;
A1: 0 + 1 = 1 ;
assume m <= len p ; ::_thesis: ((1,m) -cut p) ^ (((m + 1),(len p)) -cut p) = p
hence ((1,m) -cut p) ^ (((m + 1),(len p)) -cut p) = (1,(len p)) -cut p by A1, Th8
.= p by Th7 ;
::_thesis: verum
end;
theorem :: GRAPH_2:10
for p being FinSequence
for m, n being Element of NAT st m <= n & n <= len p holds
(((1,m) -cut p) ^ (((m + 1),n) -cut p)) ^ (((n + 1),(len p)) -cut p) = p
proof
let p be FinSequence; ::_thesis: for m, n being Element of NAT st m <= n & n <= len p holds
(((1,m) -cut p) ^ (((m + 1),n) -cut p)) ^ (((n + 1),(len p)) -cut p) = p
let m, n be Element of NAT ; ::_thesis: ( m <= n & n <= len p implies (((1,m) -cut p) ^ (((m + 1),n) -cut p)) ^ (((n + 1),(len p)) -cut p) = p )
assume that
A1: m <= n and
A2: n <= len p ; ::_thesis: (((1,m) -cut p) ^ (((m + 1),n) -cut p)) ^ (((n + 1),(len p)) -cut p) = p
set cp3 = ((n + 1),(len p)) -cut p;
set cp2 = ((m + 1),n) -cut p;
set cp1 = (1,m) -cut p;
A3: 0 + 1 = 1 ;
hence (((1,m) -cut p) ^ (((m + 1),n) -cut p)) ^ (((n + 1),(len p)) -cut p) = ((1,n) -cut p) ^ (((n + 1),(len p)) -cut p) by A1, A2, Th8
.= (1,(len p)) -cut p by A2, A3, Th8
.= p by Th7 ;
::_thesis: verum
end;
theorem Th11: :: GRAPH_2:11
for p being FinSequence
for m, n being Element of NAT holds rng ((m,n) -cut p) c= rng p
proof
let p be FinSequence; ::_thesis: for m, n being Element of NAT holds rng ((m,n) -cut p) c= rng p
let m, n be Element of NAT ; ::_thesis: rng ((m,n) -cut p) c= rng p
set c = (m,n) -cut p;
A1: now__::_thesis:_(_1_<=_m_&_m_<=_n_&_n_<=_len_p_implies_rng_((m,n)_-cut_p)_c=_rng_p_)
assume that
A2: 1 <= m and
A3: m <= n and
A4: n <= len p ; ::_thesis: rng ((m,n) -cut p) c= rng p
n <= n + 1 by NAT_1:11;
then A5: m <= n + 1 by A3, XXREAL_0:2;
thus rng ((m,n) -cut p) c= rng p ::_thesis: verum
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng ((m,n) -cut p) or x in rng p )
assume x in rng ((m,n) -cut p) ; ::_thesis: x in rng p
then consider z being set such that
A6: z in dom ((m,n) -cut p) and
A7: x = ((m,n) -cut p) . z by FUNCT_1:def_3;
reconsider z = z as Element of NAT by A6;
A8: z <= len ((m,n) -cut p) by A6, FINSEQ_3:25;
0 + 1 <= z by A6, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A9: i < len ((m,n) -cut p) and
A10: z = i + 1 by A8, Th1;
m + i < (len ((m,n) -cut p)) + m by A9, XREAL_1:6;
then m + i < n + 1 by A2, A4, A5, Lm2;
then m + i <= n by NAT_1:13;
then A11: m + i <= len p by A4, XXREAL_0:2;
1 <= m + i by A2, NAT_1:12;
then A12: m + i in dom p by A11, FINSEQ_3:25;
((m,n) -cut p) . z = p . (m + i) by A2, A4, A5, A9, A10, Lm2;
hence x in rng p by A7, A12, FUNCT_1:def_3; ::_thesis: verum
end;
end;
now__::_thesis:_(_(_not_1_<=_m_or_not_m_<=_n_or_not_n_<=_len_p_)_implies_rng_((m,n)_-cut_p)_c=_rng_p_)
assume ( not 1 <= m or not m <= n or not n <= len p ) ; ::_thesis: rng ((m,n) -cut p) c= rng p
then (m,n) -cut p = {} by Def1;
then rng ((m,n) -cut p) = {} ;
hence rng ((m,n) -cut p) c= rng p by XBOOLE_1:2; ::_thesis: verum
end;
hence rng ((m,n) -cut p) c= rng p by A1; ::_thesis: verum
end;
definition
let D be set ;
let p be FinSequence of D;
let m, n be Nat;
:: original: -cut
redefine func(m,n) -cut p -> FinSequence of D;
coherence
(m,n) -cut p is FinSequence of D
proof
A1: rng p c= D by FINSEQ_1:def_4;
A2: n is Element of NAT by ORDINAL1:def_12;
m is Element of NAT by ORDINAL1:def_12;
then rng ((m,n) -cut p) c= rng p by A2, Th11;
then rng ((m,n) -cut p) c= D by A1, XBOOLE_1:1;
hence (m,n) -cut p is FinSequence of D by FINSEQ_1:def_4; ::_thesis: verum
end;
end;
theorem Th12: :: GRAPH_2:12
for p being FinSequence
for m, n being Element of NAT st 1 <= m & m <= n & n <= len p holds
( ((m,n) -cut p) . 1 = p . m & ((m,n) -cut p) . (len ((m,n) -cut p)) = p . n )
proof
let p be FinSequence; ::_thesis: for m, n being Element of NAT st 1 <= m & m <= n & n <= len p holds
( ((m,n) -cut p) . 1 = p . m & ((m,n) -cut p) . (len ((m,n) -cut p)) = p . n )
let m, n be Element of NAT ; ::_thesis: ( 1 <= m & m <= n & n <= len p implies ( ((m,n) -cut p) . 1 = p . m & ((m,n) -cut p) . (len ((m,n) -cut p)) = p . n ) )
set c = (m,n) -cut p;
assume that
A1: 1 <= m and
A2: m <= n and
A3: n <= len p ; ::_thesis: ( ((m,n) -cut p) . 1 = p . m & ((m,n) -cut p) . (len ((m,n) -cut p)) = p . n )
A4: m <= n + 1 by A2, NAT_1:12;
then A5: (len ((m,n) -cut p)) + m = n + 1 by A1, A3, Lm2;
A6: now__::_thesis:_not_len_((m,n)_-cut_p)_=_0
assume len ((m,n) -cut p) = 0 ; ::_thesis: contradiction
then n + 1 <= n + 0 by A2, A5;
hence contradiction by XREAL_1:6; ::_thesis: verum
end;
then 0 + 1 <= len ((m,n) -cut p) by NAT_1:13;
then consider i being Element of NAT such that
0 <= i and
A7: i < len ((m,n) -cut p) and
A8: len ((m,n) -cut p) = i + 1 by Th1;
0 + 1 = 1 ;
hence ((m,n) -cut p) . 1 = p . (m + 0) by A1, A3, A4, A6, Lm2
.= p . m ;
::_thesis: ((m,n) -cut p) . (len ((m,n) -cut p)) = p . n
m + i = n by A5, A8;
hence ((m,n) -cut p) . (len ((m,n) -cut p)) = p . n by A1, A3, A4, A7, A8, Lm2; ::_thesis: verum
end;
begin
definition
let p, q be FinSequence;
funcp ^' q -> FinSequence equals :: GRAPH_2:def 2
p ^ ((2,(len q)) -cut q);
correctness
coherence
p ^ ((2,(len q)) -cut q) is FinSequence;
;
end;
:: deftheorem defines ^' GRAPH_2:def_2_:_
for p, q being FinSequence holds p ^' q = p ^ ((2,(len q)) -cut q);
theorem Th13: :: GRAPH_2:13
for q, p being FinSequence st q <> {} holds
(len (p ^' q)) + 1 = (len p) + (len q)
proof
let q, p be FinSequence; ::_thesis: ( q <> {} implies (len (p ^' q)) + 1 = (len p) + (len q) )
set r = p ^' q;
set qc = (2,(len q)) -cut q;
assume q <> {} ; ::_thesis: (len (p ^' q)) + 1 = (len p) + (len q)
then 0 + 1 <= len q by NAT_1:13;
then 1 + 1 <= (len q) + 1 by XREAL_1:7;
then A1: (len ((2,(len q)) -cut q)) + (1 + 1) = (len q) + 1 by Lm2;
thus (len (p ^' q)) + 1 = ((len p) + (len ((2,(len q)) -cut q))) + 1 by FINSEQ_1:22
.= (len p) + (len q) by A1 ; ::_thesis: verum
end;
theorem Th14: :: GRAPH_2:14
for p, q being FinSequence
for k being Element of NAT st 1 <= k & k <= len p holds
(p ^' q) . k = p . k
proof
let p, q be FinSequence; ::_thesis: for k being Element of NAT st 1 <= k & k <= len p holds
(p ^' q) . k = p . k
let k be Element of NAT ; ::_thesis: ( 1 <= k & k <= len p implies (p ^' q) . k = p . k )
assume that
A1: 1 <= k and
A2: k <= len p ; ::_thesis: (p ^' q) . k = p . k
k in dom p by A1, A2, FINSEQ_3:25;
hence (p ^' q) . k = p . k by FINSEQ_1:def_7; ::_thesis: verum
end;
theorem Th15: :: GRAPH_2:15
for q, p being FinSequence
for k being Element of NAT st 1 <= k & k < len q holds
(p ^' q) . ((len p) + k) = q . (k + 1)
proof
let q, p be FinSequence; ::_thesis: for k being Element of NAT st 1 <= k & k < len q holds
(p ^' q) . ((len p) + k) = q . (k + 1)
let k be Element of NAT ; ::_thesis: ( 1 <= k & k < len q implies (p ^' q) . ((len p) + k) = q . (k + 1) )
set qc = (2,(len q)) -cut q;
assume that
A1: 1 <= k and
A2: k < len q ; ::_thesis: (p ^' q) . ((len p) + k) = q . (k + 1)
percases ( q = {} or q <> {} ) ;
suppose q = {} ; ::_thesis: (p ^' q) . ((len p) + k) = q . (k + 1)
hence (p ^' q) . ((len p) + k) = q . (k + 1) by A2; ::_thesis: verum
end;
suppose q <> {} ; ::_thesis: (p ^' q) . ((len p) + k) = q . (k + 1)
then 0 + 1 <= len q by NAT_1:13;
then A3: 1 + 1 <= (len q) + 1 by XREAL_1:7;
then (len ((2,(len q)) -cut q)) + (1 + 1) = (len q) + 1 by Lm2;
then ((len ((2,(len q)) -cut q)) + 1) + 1 = (len q) + 1 ;
then A4: k <= len ((2,(len q)) -cut q) by A2, NAT_1:13;
0 + 1 <= k by A1;
then consider i being Element of NAT such that
0 <= i and
A5: i < len ((2,(len q)) -cut q) and
A6: k = i + 1 by A4, Th1;
k in dom ((2,(len q)) -cut q) by A1, A4, FINSEQ_3:25;
hence (p ^' q) . ((len p) + k) = ((2,(len q)) -cut q) . k by FINSEQ_1:def_7
.= q . ((1 + 1) + i) by A3, A5, A6, Lm2
.= q . (k + 1) by A6 ;
::_thesis: verum
end;
end;
end;
theorem Th16: :: GRAPH_2:16
for q, p being FinSequence st 1 < len q holds
(p ^' q) . (len (p ^' q)) = q . (len q)
proof
let q, p be FinSequence; ::_thesis: ( 1 < len q implies (p ^' q) . (len (p ^' q)) = q . (len q) )
set r = p ^' q;
set qc = (2,(len q)) -cut q;
assume A1: 1 < len q ; ::_thesis: (p ^' q) . (len (p ^' q)) = q . (len q)
then 1 + 1 <= len q by NAT_1:13;
then A2: (1 + 1) - 1 <= (len q) - 1 by XREAL_1:9;
q <> {} by A1;
then ((len (p ^' q)) + 1) - 1 = ((len p) + (len q)) - 1 by Th13;
then A3: len (p ^' q) = (len p) + ((len q) - 1) ;
1 + 1 <= (len q) + 1 by A1, XREAL_1:7;
then (len ((2,(len q)) -cut q)) + (1 + 1) = (len q) + 1 by Lm2;
then A4: ((len ((2,(len q)) -cut q)) + 1) + 1 = (len q) + 1 ;
then len ((2,(len q)) -cut q) < len q by NAT_1:13;
hence (p ^' q) . (len (p ^' q)) = q . (len q) by A3, A4, A2, Th15; ::_thesis: verum
end;
theorem Th17: :: GRAPH_2:17
for p, q being FinSequence holds rng (p ^' q) c= (rng p) \/ (rng q)
proof
let p, q be FinSequence; ::_thesis: rng (p ^' q) c= (rng p) \/ (rng q)
set r = p ^' q;
set qc = (2,(len q)) -cut q;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng (p ^' q) or x in (rng p) \/ (rng q) )
assume x in rng (p ^' q) ; ::_thesis: x in (rng p) \/ (rng q)
then x in (rng p) \/ (rng ((2,(len q)) -cut q)) by FINSEQ_1:31;
then A1: ( x in rng p or x in rng ((2,(len q)) -cut q) ) by XBOOLE_0:def_3;
rng ((2,(len q)) -cut q) c= rng q by Th11;
hence x in (rng p) \/ (rng q) by A1, XBOOLE_0:def_3; ::_thesis: verum
end;
definition
let D be set ;
let p, q be FinSequence of D;
:: original: ^'
redefine funcp ^' q -> FinSequence of D;
coherence
p ^' q is FinSequence of D
proof
A1: rng (p ^' q) c= (rng p) \/ (rng q) by Th17;
A2: rng q c= D by FINSEQ_1:def_4;
rng p c= D by FINSEQ_1:def_4;
then (rng p) \/ (rng q) c= D by A2, XBOOLE_1:8;
then rng (p ^' q) c= D by A1, XBOOLE_1:1;
hence p ^' q is FinSequence of D by FINSEQ_1:def_4; ::_thesis: verum
end;
end;
theorem :: GRAPH_2:18
for p, q being FinSequence st p <> {} & q <> {} & p . (len p) = q . 1 holds
rng (p ^' q) = (rng p) \/ (rng q)
proof
let p, q be FinSequence; ::_thesis: ( p <> {} & q <> {} & p . (len p) = q . 1 implies rng (p ^' q) = (rng p) \/ (rng q) )
set r = p ^' q;
set qc = (2,(len q)) -cut q;
assume that
A1: p <> {} and
A2: q <> {} and
A3: p . (len p) = q . 1 ; ::_thesis: rng (p ^' q) = (rng p) \/ (rng q)
0 + 1 <= len q by A2, NAT_1:13;
then A4: 1 + 1 <= (len q) + 1 by XREAL_1:7;
then (len ((2,(len q)) -cut q)) + (1 + 1) = (len q) + 1 by Lm2;
then A5: ((len ((2,(len q)) -cut q)) + 1) + 1 = (len q) + 1 ;
now__::_thesis:_for_x_being_set_holds_
(_(_x_in_rng_(p_^'_q)_implies_x_in_(rng_p)_\/_(rng_q)_)_&_(_x_in_(rng_p)_\/_(rng_q)_implies_x_in_rng_(p_^'_q)_)_)
let x be set ; ::_thesis: ( ( x in rng (p ^' q) implies x in (rng p) \/ (rng q) ) & ( x in (rng p) \/ (rng q) implies x in rng (p ^' q) ) )
hereby ::_thesis: ( x in (rng p) \/ (rng q) implies x in rng (p ^' q) )
assume x in rng (p ^' q) ; ::_thesis: x in (rng p) \/ (rng q)
then x in (rng p) \/ (rng ((2,(len q)) -cut q)) by FINSEQ_1:31;
then A6: ( x in rng p or x in rng ((2,(len q)) -cut q) ) by XBOOLE_0:def_3;
rng ((2,(len q)) -cut q) c= rng q by Th11;
hence x in (rng p) \/ (rng q) by A6, XBOOLE_0:def_3; ::_thesis: verum
end;
assume x in (rng p) \/ (rng q) ; ::_thesis: x in rng (p ^' q)
then A7: ( x in rng p or x in rng q ) by XBOOLE_0:def_3;
assume not x in rng (p ^' q) ; ::_thesis: contradiction
then A8: not x in (rng p) \/ (rng ((2,(len q)) -cut q)) by FINSEQ_1:31;
then consider y being set such that
A9: y in dom q and
A10: x = q . y by A7, FUNCT_1:def_3, XBOOLE_0:def_3;
A11: not x in rng p by A8, XBOOLE_0:def_3;
reconsider y = y as Element of NAT by A9;
A12: 1 <= y by A9, FINSEQ_3:25;
A13: y <= len q by A9, FINSEQ_3:25;
A14: not x in rng ((2,(len q)) -cut q) by A8, XBOOLE_0:def_3;
percases ( y = 1 or 1 < y ) by A12, XXREAL_0:1;
supposeA15: y = 1 ; ::_thesis: contradiction
0 + 1 <= len p by A1, NAT_1:13;
then len p in dom p by FINSEQ_3:25;
hence contradiction by A3, A11, A10, A15, FUNCT_1:def_3; ::_thesis: verum
end;
suppose 1 < y ; ::_thesis: contradiction
then 1 + 1 <= y by NAT_1:13;
then consider i being Element of NAT such that
A16: 1 <= i and
A17: i < len q and
A18: y = i + 1 by A13, Th1;
A19: i <= len ((2,(len q)) -cut q) by A5, A17, NAT_1:13;
then A20: i in dom ((2,(len q)) -cut q) by A16, FINSEQ_3:25;
0 + 1 <= i by A16;
then consider j being Element of NAT such that
0 <= j and
A21: j < len ((2,(len q)) -cut q) and
A22: i = j + 1 by A19, Th1;
((2,(len q)) -cut q) . (j + 1) = q . ((1 + 1) + j) by A4, A21, Lm2
.= q . y by A18, A22 ;
hence contradiction by A14, A10, A22, A20, FUNCT_1:def_3; ::_thesis: verum
end;
end;
end;
hence rng (p ^' q) = (rng p) \/ (rng q) by TARSKI:1; ::_thesis: verum
end;
begin
definition
let f be FinSequence;
attrf is TwoValued means :Def3: :: GRAPH_2:def 3
card (rng f) = 2;
end;
:: deftheorem Def3 defines TwoValued GRAPH_2:def_3_:_
for f being FinSequence holds
( f is TwoValued iff card (rng f) = 2 );
Lm3: now__::_thesis:_(_len_<*1,2*>_>_1_&_1_<>_2_&_rng_<*1,2*>_=_{1,2}_)
set p = <*1,2*>;
2 > 1 ;
hence len <*1,2*> > 1 by FINSEQ_1:44; ::_thesis: ( 1 <> 2 & rng <*1,2*> = {1,2} )
thus 1 <> 2 ; ::_thesis: rng <*1,2*> = {1,2}
thus rng <*1,2*> = (rng <*1*>) \/ (rng <*2*>) by FINSEQ_1:31
.= {1} \/ (rng <*2*>) by FINSEQ_1:38
.= {1} \/ {2} by FINSEQ_1:38
.= {1,2} by ENUMSET1:1 ; ::_thesis: verum
end;
theorem Th19: :: GRAPH_2:19
for p being FinSequence holds
( p is TwoValued iff ( len p > 1 & ex x, y being set st
( x <> y & rng p = {x,y} ) ) )
proof
let p be FinSequence; ::_thesis: ( p is TwoValued iff ( len p > 1 & ex x, y being set st
( x <> y & rng p = {x,y} ) ) )
hereby ::_thesis: ( len p > 1 & ex x, y being set st
( x <> y & rng p = {x,y} ) implies p is TwoValued )
assume p is TwoValued ; ::_thesis: ( len p > 1 & ex x, y being set st
( x <> y & rng p = {x,y} ) )
then card (rng p) = 2 by Def3;
then consider x, y being set such that
A1: x <> y and
A2: rng p = {x,y} by CARD_2:60;
thus len p > 1 ::_thesis: ex x, y being set st
( x <> y & rng p = {x,y} )
proof
set l = len p;
assume A3: len p <= 1 ; ::_thesis: contradiction
percases ( len p = 0 or len p = 1 ) by A3, NAT_1:25;
suppose len p = 0 ; ::_thesis: contradiction
then p = {} ;
hence contradiction by A2; ::_thesis: verum
end;
supposeA4: len p = 1 ; ::_thesis: contradiction
then 1 in dom p by FINSEQ_3:25;
then consider z being set such that
A5: [1,z] in p by XTUPLE_0:def_12;
z = p . 1 by A5, FUNCT_1:1;
then p = <*z*> by A4, FINSEQ_1:40;
then A6: rng p = {z} by FINSEQ_1:39;
then z = x by A2, ZFMISC_1:4;
hence contradiction by A1, A2, A6, ZFMISC_1:4; ::_thesis: verum
end;
end;
end;
thus ex x, y being set st
( x <> y & rng p = {x,y} ) by A1, A2; ::_thesis: verum
end;
assume len p > 1 ; ::_thesis: ( for x, y being set holds
( not x <> y or not rng p = {x,y} ) or p is TwoValued )
given x, y being set such that A7: x <> y and
A8: rng p = {x,y} ; ::_thesis: p is TwoValued
card (rng p) = 2 by A7, A8, CARD_2:57;
hence p is TwoValued by Def3; ::_thesis: verum
end;
then Lm4: <*1,2*> is TwoValued
by Lm3;
Lm5: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_+_1_<=_len_<*1,2*>_holds_
<*1,2*>_._i_<>_<*1,2*>_._(i_+_1)
let i be Nat; ::_thesis: ( 1 <= i & i + 1 <= len <*1,2*> implies <*1,2*> . i <> <*1,2*> . (i + 1) )
set p = <*1,2*>;
assume that
A1: 1 <= i and
A2: i + 1 <= len <*1,2*> ; ::_thesis: <*1,2*> . i <> <*1,2*> . (i + 1)
i + 1 <= 1 + 1 by A2, FINSEQ_1:44;
then i <= 1 by XREAL_1:6;
then A3: i = 1 by A1, XXREAL_0:1;
then <*1,2*> . i = 1 by FINSEQ_1:44;
hence <*1,2*> . i <> <*1,2*> . (i + 1) by A3, FINSEQ_1:44; ::_thesis: verum
end;
definition
let f be FinSequence;
attrf is Alternating means :Def4: :: GRAPH_2:def 4
for i being Nat st 1 <= i & i + 1 <= len f holds
f . i <> f . (i + 1);
end;
:: deftheorem Def4 defines Alternating GRAPH_2:def_4_:_
for f being FinSequence holds
( f is Alternating iff for i being Nat st 1 <= i & i + 1 <= len f holds
f . i <> f . (i + 1) );
Lm6: <*1,2*> is Alternating
by Def4, Lm5;
registration
cluster Relation-like NAT -defined Function-like finite FinSequence-like FinSubsequence-like TwoValued Alternating for set ;
existence
ex b1 being FinSequence st
( b1 is TwoValued & b1 is Alternating ) by Lm4, Lm6;
end;
theorem Th20: :: GRAPH_2:20
for a1, a2 being TwoValued Alternating FinSequence st len a1 = len a2 & rng a1 = rng a2 & a1 . 1 = a2 . 1 holds
a1 = a2
proof
let a1, a2 be TwoValued Alternating FinSequence; ::_thesis: ( len a1 = len a2 & rng a1 = rng a2 & a1 . 1 = a2 . 1 implies a1 = a2 )
assume that
A1: len a1 = len a2 and
A2: rng a1 = rng a2 and
A3: a1 . 1 = a2 . 1 ; ::_thesis: a1 = a2
defpred S1[ Nat] means ( 1 <= $1 & $1 <= len a1 implies a1 . $1 = a2 . $1 );
A4: for k being Nat st S1[k] holds
S1[k + 1]
proof
let k be Nat; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A5: ( 1 <= k & k <= len a1 implies a1 . k = a2 . k ) ; ::_thesis: S1[k + 1]
A6: ( 0 = k or ( 0 < k & 0 + 1 = 1 ) ) ;
assume that
A7: 1 <= k + 1 and
A8: k + 1 <= len a1 ; ::_thesis: a1 . (k + 1) = a2 . (k + 1)
A9: k + 1 in dom a1 by A7, A8, FINSEQ_3:25;
percases ( 0 = k or 1 <= k ) by A6, NAT_1:13;
suppose 0 = k ; ::_thesis: a1 . (k + 1) = a2 . (k + 1)
hence a1 . (k + 1) = a2 . (k + 1) by A3; ::_thesis: verum
end;
supposeA10: 1 <= k ; ::_thesis: a1 . (k + 1) = a2 . (k + 1)
A11: dom a2 = Seg (len a2) by FINSEQ_1:def_3;
consider X, Y being set such that
X <> Y and
A12: rng a1 = {X,Y} by Th19;
a1 . (k + 1) in rng a1 by A9, FUNCT_1:def_3;
then A13: ( a1 . (k + 1) = X or a1 . (k + 1) = Y ) by A12, TARSKI:def_2;
dom a1 = Seg (len a1) by FINSEQ_1:def_3;
then a2 . (k + 1) in rng a2 by A1, A9, A11, FUNCT_1:def_3;
then A14: ( a2 . (k + 1) = X or a2 . (k + 1) = Y ) by A2, A12, TARSKI:def_2;
k <= len a1 by A8, NAT_1:13;
then k in dom a1 by A10, FINSEQ_3:25;
then a1 . k in rng a1 by FUNCT_1:def_3;
then ( a1 . k = X or a1 . k = Y ) by A12, TARSKI:def_2;
hence a1 . (k + 1) = a2 . (k + 1) by A1, A5, A8, A10, A13, A14, Def4, NAT_1:13; ::_thesis: verum
end;
end;
end;
A15: S1[ 0 ] ;
for i being Nat holds S1[i] from NAT_1:sch_2(A15, A4);
hence a1 = a2 by A1, FINSEQ_1:14; ::_thesis: verum
end;
theorem Th21: :: GRAPH_2:21
for a1, a2 being TwoValued Alternating FinSequence st a1 <> a2 & len a1 = len a2 & rng a1 = rng a2 holds
for i being Element of NAT st 1 <= i & i <= len a1 holds
a1 . i <> a2 . i
proof
let a1, a2 be TwoValued Alternating FinSequence; ::_thesis: ( a1 <> a2 & len a1 = len a2 & rng a1 = rng a2 implies for i being Element of NAT st 1 <= i & i <= len a1 holds
a1 . i <> a2 . i )
assume that
A1: a1 <> a2 and
A2: len a1 = len a2 and
A3: rng a1 = rng a2 ; ::_thesis: for i being Element of NAT st 1 <= i & i <= len a1 holds
a1 . i <> a2 . i
defpred S1[ Element of NAT ] means ( 1 <= $1 & $1 <= len a1 implies a1 . $1 <> a2 . $1 );
A4: for k being Element of NAT st S1[k] holds
S1[k + 1]
proof
let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A5: ( 1 <= k & k <= len a1 implies a1 . k <> a2 . k ) ; ::_thesis: S1[k + 1]
A6: ( 0 = k or ( 0 < k & 0 + 1 = 1 ) ) ;
assume that
A7: 1 <= k + 1 and
A8: k + 1 <= len a1 ; ::_thesis: a1 . (k + 1) <> a2 . (k + 1)
A9: k + 1 in dom a1 by A7, A8, FINSEQ_3:25;
percases ( 0 = k or 1 <= k ) by A6, NAT_1:13;
suppose 0 = k ; ::_thesis: a1 . (k + 1) <> a2 . (k + 1)
hence a1 . (k + 1) <> a2 . (k + 1) by A1, A2, A3, Th20; ::_thesis: verum
end;
supposeA10: 1 <= k ; ::_thesis: a1 . (k + 1) <> a2 . (k + 1)
k <= len a1 by A8, NAT_1:13;
then A11: k in dom a1 by A10, FINSEQ_3:25;
A12: dom a2 = Seg (len a2) by FINSEQ_1:def_3;
consider X, Y being set such that
X <> Y and
A13: rng a1 = {X,Y} by Th19;
a1 . (k + 1) in rng a1 by A9, FUNCT_1:def_3;
then A14: ( a1 . (k + 1) = X or a1 . (k + 1) = Y ) by A13, TARSKI:def_2;
dom a1 = Seg (len a1) by FINSEQ_1:def_3;
then a2 . k in rng a2 by A2, A11, A12, FUNCT_1:def_3;
then A15: ( a2 . k = X or a2 . k = Y ) by A3, A13, TARSKI:def_2;
a1 . k in rng a1 by A11, FUNCT_1:def_3;
then ( a1 . k = X or a1 . k = Y ) by A13, TARSKI:def_2;
hence a1 . (k + 1) <> a2 . (k + 1) by A2, A5, A8, A10, A15, A14, Def4, NAT_1:13; ::_thesis: verum
end;
end;
end;
A16: S1[ 0 ] ;
thus for i being Element of NAT holds S1[i] from NAT_1:sch_1(A16, A4); ::_thesis: verum
end;
theorem Th22: :: GRAPH_2:22
for a1, a2 being TwoValued Alternating FinSequence st a1 <> a2 & len a1 = len a2 & rng a1 = rng a2 holds
for a being TwoValued Alternating FinSequence st len a = len a1 & rng a = rng a1 & not a = a1 holds
a = a2
proof
let a1, a2 be TwoValued Alternating FinSequence; ::_thesis: ( a1 <> a2 & len a1 = len a2 & rng a1 = rng a2 implies for a being TwoValued Alternating FinSequence st len a = len a1 & rng a = rng a1 & not a = a1 holds
a = a2 )
assume that
A1: a1 <> a2 and
A2: len a1 = len a2 and
A3: rng a1 = rng a2 ; ::_thesis: for a being TwoValued Alternating FinSequence st len a = len a1 & rng a = rng a1 & not a = a1 holds
a = a2
let a be TwoValued Alternating FinSequence; ::_thesis: ( len a = len a1 & rng a = rng a1 & not a = a1 implies a = a2 )
assume that
A4: len a = len a1 and
A5: rng a = rng a1 ; ::_thesis: ( a = a1 or a = a2 )
assume A6: a <> a1 ; ::_thesis: a = a2
now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<=_len_a_holds_
a_._i_=_a2_._i
let i be Nat; ::_thesis: ( 1 <= i & i <= len a implies a . i = a2 . i )
assume that
A7: 1 <= i and
A8: i <= len a ; ::_thesis: a . i = a2 . i
consider X, Y being set such that
X <> Y and
A9: rng a = {X,Y} by Th19;
A10: i in dom a by A7, A8, FINSEQ_3:25;
then a . i in rng a by FUNCT_1:def_3;
then A11: ( a . i = X or a . i = Y ) by A9, TARSKI:def_2;
A12: dom a = Seg (len a) by FINSEQ_1:def_3;
dom a1 = Seg (len a1) by FINSEQ_1:def_3;
then a1 . i in rng a1 by A4, A10, A12, FUNCT_1:def_3;
then A13: ( a1 . i = X or a1 . i = Y ) by A5, A9, TARSKI:def_2;
dom a2 = Seg (len a2) by FINSEQ_1:def_3;
then a2 . i in rng a2 by A2, A4, A10, A12, FUNCT_1:def_3;
then ( a2 . i = X or a2 . i = Y ) by A3, A5, A9, TARSKI:def_2;
hence a . i = a2 . i by A1, A2, A3, A4, A5, A6, A7, A8, A10, A11, A13, Th21; ::_thesis: verum
end;
hence a = a2 by A2, A4, FINSEQ_1:14; ::_thesis: verum
end;
theorem Th23: :: GRAPH_2:23
for X, Y being set
for n being Element of NAT st X <> Y & n > 1 holds
ex a1 being TwoValued Alternating FinSequence st
( rng a1 = {X,Y} & len a1 = n & a1 . 1 = X )
proof
let X, Y be set ; ::_thesis: for n being Element of NAT st X <> Y & n > 1 holds
ex a1 being TwoValued Alternating FinSequence st
( rng a1 = {X,Y} & len a1 = n & a1 . 1 = X )
let n be Element of NAT ; ::_thesis: ( X <> Y & n > 1 implies ex a1 being TwoValued Alternating FinSequence st
( rng a1 = {X,Y} & len a1 = n & a1 . 1 = X ) )
deffunc H1( Nat, Nat) -> Element of NAT = 3 -' $2;
assume that
A1: X <> Y and
A2: n > 1 ; ::_thesis: ex a1 being TwoValued Alternating FinSequence st
( rng a1 = {X,Y} & len a1 = n & a1 . 1 = X )
set p = <*X,Y*>;
A3: <*X,Y*> . 1 = X by FINSEQ_1:44;
A4: 3 -' 2 = (1 + 2) - 2 by XREAL_0:def_2
.= 1 ;
A5: <*X,Y*> . 2 = Y by FINSEQ_1:44;
consider f1 being Function of NAT,NAT such that
A6: ( f1 . 0 = 2 & ( for n being Nat holds f1 . (n + 1) = H1(n,f1 . n) ) ) from NAT_1:sch_12();
defpred S1[ Element of NAT ] means ( ( f1 . $1 = 1 or f1 . $1 = 2 ) & f1 . $1 <> f1 . ($1 + 1) );
A7: 3 -' 1 = (2 + 1) - 1 by XREAL_0:def_2
.= 2 ;
A8: for i being Element of NAT st S1[i] holds
S1[i + 1]
proof
let i be Element of NAT ; ::_thesis: ( S1[i] implies S1[i + 1] )
assume that
A9: ( f1 . i = 1 or f1 . i = 2 ) and
f1 . i <> f1 . (i + 1) ; ::_thesis: S1[i + 1]
thus ( f1 . (i + 1) = 1 or f1 . (i + 1) = 2 ) by A6, A4, A7, A9; ::_thesis: f1 . (i + 1) <> f1 . ((i + 1) + 1)
hence f1 . (i + 1) <> f1 . ((i + 1) + 1) by A6, A4, A7; ::_thesis: verum
end;
A10: S1[ 0 ] by A6, A4;
A11: for i being Element of NAT holds S1[i] from NAT_1:sch_1(A10, A8);
deffunc H2( Nat) -> set = <*X,Y*> . (f1 . $1);
consider p1 being FinSequence such that
A12: ( len p1 = n & ( for k being Nat st k in dom p1 holds
p1 . k = H2(k) ) ) from FINSEQ_1:sch_2();
A13: f1 . (0 + 1) = 1 by A6, A4;
then A14: f1 . (1 + 1) = 2 by A6, A7;
A15: now__::_thesis:_for_y_being_set_holds_
(_(_y_in_{X,Y}_implies_ex_x_being_set_st_
(_x_in_dom_p1_&_y_=_p1_._x_)_)_&_(_ex_x_being_set_st_
(_x_in_dom_p1_&_y_=_p1_._x_)_implies_y_in_{X,Y}_)_)
let y be set ; ::_thesis: ( ( y in {X,Y} implies ex x being set st
( x in dom p1 & y = p1 . x ) ) & ( ex x being set st
( x in dom p1 & y = p1 . x ) implies y in {X,Y} ) )
hereby ::_thesis: ( ex x being set st
( x in dom p1 & y = p1 . x ) implies y in {X,Y} )
assume y in {X,Y} ; ::_thesis: ex x being set st
( x in dom p1 & y = p1 . x )
then A16: ( y = X or y = Y ) by TARSKI:def_2;
1 in dom p1 by A2, A12, FINSEQ_3:25;
then A17: p1 . 1 = X by A3, A13, A12;
A18: 1 in dom p1 by A2, A12, FINSEQ_3:25;
1 + 1 <= n by A2, NAT_1:13;
then A19: 2 in dom p1 by A12, FINSEQ_3:25;
then p1 . 2 = Y by A5, A14, A12;
hence ex x being set st
( x in dom p1 & y = p1 . x ) by A16, A19, A17, A18; ::_thesis: verum
end;
given x being set such that A20: x in dom p1 and
A21: y = p1 . x ; ::_thesis: y in {X,Y}
x in Seg (len p1) by A20, FINSEQ_1:def_3;
then consider x9 being Element of NAT such that
A22: x9 = x and
A23: 1 <= x9 and
A24: x9 <= len p1 ;
x9 in dom p1 by A23, A24, FINSEQ_3:25;
then A25: p1 . x9 = <*X,Y*> . (f1 . x9) by A12;
( f1 . x9 = 1 or f1 . x9 = 2 ) by A11;
hence y in {X,Y} by A3, A5, A21, A22, A25, TARSKI:def_2; ::_thesis: verum
end;
then rng p1 = {X,Y} by FUNCT_1:def_3;
then reconsider p1 = p1 as TwoValued FinSequence by A1, A2, A12, Th19;
now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_+_1_<=_len_p1_holds_
p1_._i_<>_p1_._(i_+_1)
let i be Nat; ::_thesis: ( 1 <= i & i + 1 <= len p1 implies p1 . i <> p1 . (i + 1) )
assume that
A26: 1 <= i and
A27: i + 1 <= len p1 ; ::_thesis: p1 . i <> p1 . (i + 1)
1 <= i + 1 by A26, NAT_1:13;
then i + 1 in dom p1 by A27, FINSEQ_3:25;
then A28: p1 . (i + 1) = <*X,Y*> . (f1 . (i + 1)) by A12;
A29: ( f1 . (i + 1) = 1 or f1 . (i + 1) = 2 ) by A11;
i <= n by A12, A27, NAT_1:13;
then A30: i in dom p1 by A12, A26, FINSEQ_3:25;
then p1 . i = <*X,Y*> . (f1 . i) by A12;
hence p1 . i <> p1 . (i + 1) by A1, A3, A5, A11, A30, A28, A29; ::_thesis: verum
end;
then reconsider p1 = p1 as TwoValued Alternating FinSequence by Def4;
take p1 ; ::_thesis: ( rng p1 = {X,Y} & len p1 = n & p1 . 1 = X )
thus rng p1 = {X,Y} by A15, FUNCT_1:def_3; ::_thesis: ( len p1 = n & p1 . 1 = X )
thus len p1 = n by A12; ::_thesis: p1 . 1 = X
1 in dom p1 by A2, A12, FINSEQ_3:25;
hence p1 . 1 = X by A3, A13, A12; ::_thesis: verum
end;
begin
registration
let X be set ;
let fs be FinSequence of X;
cluster -> FinSubsequence-like for Element of bool fs;
coherence
for b1 being Subset of fs holds b1 is FinSubsequence-like
proof
let IT be Subset of fs; ::_thesis: IT is FinSubsequence-like
take len fs ; :: according to FINSEQ_1:def_12 ::_thesis: dom IT c= Seg (len fs)
dom IT c= dom fs by RELAT_1:11;
hence dom IT c= Seg (len fs) by FINSEQ_1:def_3; ::_thesis: verum
end;
end;
theorem Th24: :: GRAPH_2:24
for f being FinSubsequence
for g, h, fg, fh, fgh being FinSequence st rng g c= dom f & rng h c= dom f & fg = f * g & fh = f * h & fgh = f * (g ^ h) holds
fgh = fg ^ fh
proof
let f be FinSubsequence; ::_thesis: for g, h, fg, fh, fgh being FinSequence st rng g c= dom f & rng h c= dom f & fg = f * g & fh = f * h & fgh = f * (g ^ h) holds
fgh = fg ^ fh
let g, h, fg, fh, fgh be FinSequence; ::_thesis: ( rng g c= dom f & rng h c= dom f & fg = f * g & fh = f * h & fgh = f * (g ^ h) implies fgh = fg ^ fh )
assume that
A1: rng g c= dom f and
A2: rng h c= dom f and
A3: fg = f * g and
A4: fh = f * h and
A5: fgh = f * (g ^ h) ; ::_thesis: fgh = fg ^ fh
now__::_thesis:_(_len_fgh_=_(len_g)_+_(len_h)_&_len_(fg_^_fh)_=_(len_g)_+_(len_h)_&_(_for_j_being_Nat_st_j_in_dom_fgh_holds_
fgh_._j_=_(fg_^_fh)_._j_)_)
rng (g ^ h) = (rng g) \/ (rng h) by FINSEQ_1:31;
hence len fgh = len (g ^ h) by A1, A2, A5, FINSEQ_2:29, XBOOLE_1:8
.= (len g) + (len h) by FINSEQ_1:22 ;
::_thesis: ( len (fg ^ fh) = (len g) + (len h) & ( for j being Nat st j in dom fgh holds
fgh . b2 = (fg ^ fh) . b2 ) )
then A6: dom fgh = Seg ((len g) + (len h)) by FINSEQ_1:def_3;
A7: dom fh = dom h by A2, A4, RELAT_1:27;
A8: dom fg = dom g by A1, A3, RELAT_1:27;
A9: len fg = len g by A1, A3, FINSEQ_2:29;
len fh = len h by A2, A4, FINSEQ_2:29;
hence len (fg ^ fh) = (len g) + (len h) by A9, FINSEQ_1:22; ::_thesis: for j being Nat st j in dom fgh holds
fgh . b2 = (fg ^ fh) . b2
let j be Nat; ::_thesis: ( j in dom fgh implies fgh . b1 = (fg ^ fh) . b1 )
assume A10: j in dom fgh ; ::_thesis: fgh . b1 = (fg ^ fh) . b1
then A11: 1 <= j by A6, FINSEQ_1:1;
A12: j <= (len g) + (len h) by A6, A10, FINSEQ_1:1;
percases ( j <= len g or len g < j ) ;
suppose j <= len g ; ::_thesis: fgh . b1 = (fg ^ fh) . b1
then A13: j in dom g by A11, FINSEQ_3:25;
thus fgh . j = f . ((g ^ h) . j) by A5, A10, FUNCT_1:12
.= f . (g . j) by A13, FINSEQ_1:def_7
.= fg . j by A3, A13, FUNCT_1:13
.= (fg ^ fh) . j by A8, A13, FINSEQ_1:def_7 ; ::_thesis: verum
end;
suppose len g < j ; ::_thesis: fgh . b1 = (fg ^ fh) . b1
then (len g) + 1 <= j by NAT_1:13;
then A14: 1 <= j - (len g) by XREAL_1:19;
then j -' (len g) = j - (len g) by XREAL_0:def_2;
then reconsider j9 = j - (len g) as Element of NAT ;
A15: j = (len g) + j9 ;
then j9 <= len h by A12, XREAL_1:6;
then A16: j9 in dom h by A14, FINSEQ_3:25;
thus fgh . j = f . ((g ^ h) . j) by A5, A10, FUNCT_1:12
.= f . (h . j9) by A15, A16, FINSEQ_1:def_7
.= fh . j9 by A4, A16, FUNCT_1:13
.= (fg ^ fh) . j by A9, A7, A15, A16, FINSEQ_1:def_7 ; ::_thesis: verum
end;
end;
end;
hence fgh = fg ^ fh by FINSEQ_2:9; ::_thesis: verum
end;
theorem :: GRAPH_2:25
for X being set
for fs being FinSequence of X
for fss being Subset of fs holds
( dom fss c= dom fs & rng fss c= rng fs ) by RELAT_1:11;
theorem Th26: :: GRAPH_2:26
for X being set
for fs being FinSequence of X holds fs is Subset of fs
proof
let X be set ; ::_thesis: for fs being FinSequence of X holds fs is Subset of fs
let fs be FinSequence of X; ::_thesis: fs is Subset of fs
fs c= fs ;
hence fs is Subset of fs ; ::_thesis: verum
end;
theorem Th27: :: GRAPH_2:27
for X, Y being set
for fs being FinSequence of X
for fss being Subset of fs holds fss | Y is Subset of fs
proof
let X, Y be set ; ::_thesis: for fs being FinSequence of X
for fss being Subset of fs holds fss | Y is Subset of fs
let fs be FinSequence of X; ::_thesis: for fss being Subset of fs holds fss | Y is Subset of fs
let fss be Subset of fs; ::_thesis: fss | Y is Subset of fs
reconsider f = fss | Y as FinSubsequence ;
f c= fss by RELAT_1:59;
hence fss | Y is Subset of fs by XBOOLE_1:1; ::_thesis: verum
end;
theorem Th28: :: GRAPH_2:28
for X being set
for fs, fs1, fs2 being FinSequence of X
for fss, fss2 being Subset of fs
for fss1 being Subset of fs1 st Seq fss = fs1 & Seq fss1 = fs2 & fss2 = fss | (rng ((Sgm (dom fss)) | (dom fss1))) holds
Seq fss2 = fs2
proof
let X be set ; ::_thesis: for fs, fs1, fs2 being FinSequence of X
for fss, fss2 being Subset of fs
for fss1 being Subset of fs1 st Seq fss = fs1 & Seq fss1 = fs2 & fss2 = fss | (rng ((Sgm (dom fss)) | (dom fss1))) holds
Seq fss2 = fs2
let fs, fs1, fs2 be FinSequence of X; ::_thesis: for fss, fss2 being Subset of fs
for fss1 being Subset of fs1 st Seq fss = fs1 & Seq fss1 = fs2 & fss2 = fss | (rng ((Sgm (dom fss)) | (dom fss1))) holds
Seq fss2 = fs2
let fss, fss2 be Subset of fs; ::_thesis: for fss1 being Subset of fs1 st Seq fss = fs1 & Seq fss1 = fs2 & fss2 = fss | (rng ((Sgm (dom fss)) | (dom fss1))) holds
Seq fss2 = fs2
let fss1 be Subset of fs1; ::_thesis: ( Seq fss = fs1 & Seq fss1 = fs2 & fss2 = fss | (rng ((Sgm (dom fss)) | (dom fss1))) implies Seq fss2 = fs2 )
assume that
A1: Seq fss = fs1 and
A2: Seq fss1 = fs2 and
A3: fss2 = fss | (rng ((Sgm (dom fss)) | (dom fss1))) ; ::_thesis: Seq fss2 = fs2
consider k being Nat such that
A4: dom fs = Seg k by FINSEQ_1:def_2;
reconsider d2 = dom fss2 as finite set ;
reconsider d1 = dom fss1 as finite set ;
A5: ex l being Nat st dom fs1 = Seg l by FINSEQ_1:def_2;
then A6: dom (Sgm d1) = Seg (card d1) by FINSEQ_3:40, RELAT_1:11;
reconsider k = k as Element of NAT by ORDINAL1:def_12;
A7: dom fss c= Seg k by A4, RELAT_1:11;
then rng (Sgm (dom fss)) c= dom fss by FINSEQ_1:def_13;
then A8: dom fs1 = dom (Sgm (dom fss)) by A1, RELAT_1:27;
dom fss2 c= Seg k by A4, RELAT_1:11;
then A9: rng (Sgm (dom fss2)) = dom fss2 by FINSEQ_1:def_13;
A10: (Sgm (dom fss)) | (dom fss1) c= Sgm (dom fss) by RELAT_1:59;
then A11: dom ((Sgm (dom fss)) | (dom fss1)) c= dom (Sgm (dom fss)) by RELAT_1:11;
rng ((Sgm (dom fss)) | (dom fss1)) c= rng (Sgm (dom fss)) by A10, RELAT_1:11;
then rng ((Sgm (dom fss)) | (dom fss1)) c= dom fss by A7, FINSEQ_1:def_13;
then A12: dom fss2 = rng ((Sgm (dom fss)) | (dom fss1)) by A3, RELAT_1:62;
A13: dom fss1 c= dom fs1 by RELAT_1:11;
now__::_thesis:_ex_Z_being_Element_of_bool_[:NAT,NAT:]_st_
(_(_for_x_being_set_st_x_in_d1_holds_
ex_y_being_set_st_
(_y_in_d2_&_[x,y]_in_Z_)_)_&_(_for_y_being_set_st_y_in_d2_holds_
ex_x_being_set_st_
(_x_in_d1_&_[x,y]_in_Z_)_)_&_(_for_x,_y,_z,_u_being_set_st_[x,y]_in_Z_&_[z,u]_in_Z_holds_
(_(_x_=_z_implies_y_=_u_)_&_(_y_=_u_implies_not_x_<>_z_)_)_)_)
take Z = (Sgm (dom fss)) | (dom fss1); ::_thesis: ( ( for x being set st x in d1 holds
ex y being set st
( y in d2 & [x,y] in Z ) ) & ( for y being set st y in d2 holds
ex x being set st
( x in d1 & [x,y] in Z ) ) & ( for x, y, z, u being set st [x,y] in Z & [z,u] in Z holds
( ( x = z implies y = u ) & ( y = u implies not x <> z ) ) ) )
A14: dom Z = dom fss1 by A8, RELAT_1:11, RELAT_1:62;
hereby ::_thesis: ( ( for y being set st y in d2 holds
ex x being set st
( x in d1 & [x,y] in Z ) ) & ( for x, y, z, u being set st [x,y] in Z & [z,u] in Z holds
( ( x = z implies y = u ) & ( y = u implies not x <> z ) ) ) )
let x be set ; ::_thesis: ( x in d1 implies ex y being set st
( y in d2 & [x,y] in Z ) )
assume A15: x in d1 ; ::_thesis: ex y being set st
( y in d2 & [x,y] in Z )
reconsider y = Z . x as set ;
take y = y; ::_thesis: ( y in d2 & [x,y] in Z )
thus y in d2 by A12, A14, A15, FUNCT_1:def_3; ::_thesis: [x,y] in Z
thus [x,y] in Z by A14, A15, FUNCT_1:1; ::_thesis: verum
end;
hereby ::_thesis: for x, y, z, u being set st [x,y] in Z & [z,u] in Z holds
( ( x = z implies y = u ) & ( y = u implies not x <> z ) )
let y be set ; ::_thesis: ( y in d2 implies ex x being set st
( x in d1 & [x,y] in Z ) )
assume y in d2 ; ::_thesis: ex x being set st
( x in d1 & [x,y] in Z )
then consider x being set such that
A16: x in dom Z and
A17: y = Z . x by A12, FUNCT_1:def_3;
take x = x; ::_thesis: ( x in d1 & [x,y] in Z )
thus ( x in d1 & [x,y] in Z ) by A13, A8, A16, A17, FUNCT_1:1, RELAT_1:62; ::_thesis: verum
end;
let x, y, z, u be set ; ::_thesis: ( [x,y] in Z & [z,u] in Z implies ( ( x = z implies y = u ) & ( y = u implies not x <> z ) ) )
assume that
A18: [x,y] in Z and
A19: [z,u] in Z ; ::_thesis: ( ( x = z implies y = u ) & ( y = u implies not x <> z ) )
A20: z in dom Z by A19, FUNCT_1:1;
A21: u = Z . z by A19, FUNCT_1:1;
A22: u = (Sgm (dom fss)) . z by A20, A21, FUNCT_1:47;
A23: y = Z . x by A18, FUNCT_1:1;
hence ( x = z implies y = u ) by A19, FUNCT_1:1; ::_thesis: ( y = u implies not x <> z )
A24: x in dom Z by A18, FUNCT_1:1;
then A25: y = (Sgm (dom fss)) . x by A23, FUNCT_1:47;
assume A26: y = u ; ::_thesis: not x <> z
assume A27: x <> z ; ::_thesis: contradiction
reconsider x = x, z = z as Element of NAT by A24, A20;
A28: x <= len (Sgm (dom fss)) by A11, A24, FINSEQ_3:25;
A29: z <= len (Sgm (dom fss)) by A11, A20, FINSEQ_3:25;
A30: 1 <= z by A11, A20, FINSEQ_3:25;
A31: 1 <= x by A11, A24, FINSEQ_3:25;
percases ( x < z or z < x ) by A27, XXREAL_0:1;
suppose x < z ; ::_thesis: contradiction
hence contradiction by A7, A25, A22, A26, A31, A29, FINSEQ_1:def_13; ::_thesis: verum
end;
suppose z < x ; ::_thesis: contradiction
hence contradiction by A7, A25, A22, A26, A28, A30, FINSEQ_1:def_13; ::_thesis: verum
end;
end;
end;
then d1,d2 are_equipotent by TARSKI:def_6;
then card d1 = card d2 by CARD_1:5;
then A32: dom (Sgm d2) = Seg (card d1) by A4, FINSEQ_3:40, RELAT_1:11;
A33: rng (Sgm (dom fss1)) = dom fss1 by A13, A5, FINSEQ_1:def_13;
now__::_thesis:_(_dom_fs2_=_dom_(Seq_fss2)_&_dom_fs2_=_dom_fs2_&_(_for_k_being_Nat_st_k_in_dom_fs2_holds_
(Seq_fss2)_._k_=_fs2_._k_)_)
now__::_thesis:_for_x_being_set_holds_
(_(_x_in_dom_fs2_implies_x_in_dom_(Seq_fss2)_)_&_(_x_in_dom_(Seq_fss2)_implies_x_in_dom_fs2_)_)
let x be set ; ::_thesis: ( ( x in dom fs2 implies x in dom (Seq fss2) ) & ( x in dom (Seq fss2) implies x in dom fs2 ) )
hereby ::_thesis: ( x in dom (Seq fss2) implies x in dom fs2 )
assume x in dom fs2 ; ::_thesis: x in dom (Seq fss2)
then A34: x in dom (Sgm (dom fss2)) by A2, A6, A32, FUNCT_1:11;
then (Sgm (dom fss2)) . x in dom fss2 by A9, FUNCT_1:def_3;
hence x in dom (Seq fss2) by A34, FUNCT_1:11; ::_thesis: verum
end;
assume x in dom (Seq fss2) ; ::_thesis: x in dom fs2
then A35: x in dom (Sgm (dom fss1)) by A6, A32, FUNCT_1:11;
then (Sgm (dom fss1)) . x in dom fss1 by A33, FUNCT_1:def_3;
hence x in dom fs2 by A2, A35, FUNCT_1:11; ::_thesis: verum
end;
hence A36: dom fs2 = dom (Seq fss2) by TARSKI:1; ::_thesis: ( dom fs2 = dom fs2 & ( for k being Nat st k in dom fs2 holds
(Seq fss2) . k = fs2 . k ) )
thus dom fs2 = dom fs2 ; ::_thesis: for k being Nat st k in dom fs2 holds
(Seq fss2) . k = fs2 . k
let k be Nat; ::_thesis: ( k in dom fs2 implies (Seq fss2) . k = fs2 . k )
assume A37: k in dom fs2 ; ::_thesis: (Seq fss2) . k = fs2 . k
then A38: (Sgm (dom fss1)) . k in dom fss1 by A2, FUNCT_1:11;
A39: (Sgm (dom fss2)) . k in dom fss2 by A36, A37, FUNCT_1:11;
A40: (Sgm (dom fss1)) . k in dom fss1 by A2, A37, FUNCT_1:11;
then A41: fss1 . ((Sgm (dom fss1)) . k) = (Seq fss) . ((Sgm (dom fss1)) . k) by A1, GRFUNC_1:2;
A42: (Sgm (dom fss2)) . k = ((Sgm (dom fss)) * (Sgm (dom fss1))) . k by A7, A12, A8, Th3, RELAT_1:11;
k in dom (Sgm (dom fss1)) by A2, A37, FUNCT_1:11;
then k in dom ((Sgm (dom fss)) * (Sgm (dom fss1))) by A13, A8, A38, FUNCT_1:11;
then A43: (Sgm (dom fss2)) . k = (Sgm (dom fss)) . ((Sgm (dom fss1)) . k) by A42, FUNCT_1:12;
A44: fss2 c= fss by A3, RELAT_1:59;
dom fss1 c= dom (Seq fss) by A1, RELAT_1:11;
then A45: (Sgm (dom fss1)) . k in dom (Sgm (dom fss)) by A40, FUNCT_1:11;
thus (Seq fss2) . k = fss2 . ((Sgm (dom fss2)) . k) by A36, A37, FUNCT_1:12
.= fss . ((Sgm (dom fss)) . ((Sgm (dom fss1)) . k)) by A43, A44, A39, GRFUNC_1:2
.= fss1 . ((Sgm (dom fss1)) . k) by A45, A41, FUNCT_1:13
.= fs2 . k by A2, A37, FUNCT_1:12 ; ::_thesis: verum
end;
hence Seq fss2 = fs2 by FINSEQ_1:13; ::_thesis: verum
end;
begin
theorem Th29: :: GRAPH_2:29
for G being Graph
for v1, v2 being Element of G
for e being set st e joins v1,v2 holds
e joins v2,v1
proof
let G be Graph; ::_thesis: for v1, v2 being Element of G
for e being set st e joins v1,v2 holds
e joins v2,v1
let v1, v2 be Element of G; ::_thesis: for e being set st e joins v1,v2 holds
e joins v2,v1
let e be set ; ::_thesis: ( e joins v1,v2 implies e joins v2,v1 )
assume e joins v1,v2 ; ::_thesis: e joins v2,v1
then ( ( the Source of G . e = v1 & the Target of G . e = v2 ) or ( the Source of G . e = v2 & the Target of G . e = v1 ) ) by GRAPH_1:def_12;
hence e joins v2,v1 by GRAPH_1:def_12; ::_thesis: verum
end;
theorem Th30: :: GRAPH_2:30
for G being Graph
for v1, v2, v3, v4 being Element of G
for e being set st e joins v1,v2 & e joins v3,v4 & not ( v1 = v3 & v2 = v4 ) holds
( v1 = v4 & v2 = v3 )
proof
let G be Graph; ::_thesis: for v1, v2, v3, v4 being Element of G
for e being set st e joins v1,v2 & e joins v3,v4 & not ( v1 = v3 & v2 = v4 ) holds
( v1 = v4 & v2 = v3 )
let v1, v2, v3, v4 be Element of G; ::_thesis: for e being set st e joins v1,v2 & e joins v3,v4 & not ( v1 = v3 & v2 = v4 ) holds
( v1 = v4 & v2 = v3 )
let e be set ; ::_thesis: ( e joins v1,v2 & e joins v3,v4 & not ( v1 = v3 & v2 = v4 ) implies ( v1 = v4 & v2 = v3 ) )
assume that
A1: e joins v1,v2 and
A2: e joins v3,v4 ; ::_thesis: ( ( v1 = v3 & v2 = v4 ) or ( v1 = v4 & v2 = v3 ) )
( ( the Source of G . e = v1 & the Target of G . e = v2 ) or ( the Source of G . e = v2 & the Target of G . e = v1 ) ) by A1, GRAPH_1:def_12;
hence ( ( v1 = v3 & v2 = v4 ) or ( v1 = v4 & v2 = v3 ) ) by A2, GRAPH_1:def_12; ::_thesis: verum
end;
definition
let G be Graph;
let X be set ;
funcG -VSet X -> set equals :: GRAPH_2:def 5
{ v where v is Element of G : ex e being Element of the carrier' of G st
( e in X & ( v = the Source of G . e or v = the Target of G . e ) ) } ;
correctness
coherence
{ v where v is Element of G : ex e being Element of the carrier' of G st
( e in X & ( v = the Source of G . e or v = the Target of G . e ) ) } is set ;
;
end;
:: deftheorem defines -VSet GRAPH_2:def_5_:_
for G being Graph
for X being set holds G -VSet X = { v where v is Element of G : ex e being Element of the carrier' of G st
( e in X & ( v = the Source of G . e or v = the Target of G . e ) ) } ;
definition
let G be Graph;
let vs be FinSequence of the carrier of G;
let c be FinSequence;
predvs is_vertex_seq_of c means :Def6: :: GRAPH_2:def 6
( len vs = (len c) + 1 & ( for n being Element of NAT st 1 <= n & n <= len c holds
c . n joins vs /. n,vs /. (n + 1) ) );
end;
:: deftheorem Def6 defines is_vertex_seq_of GRAPH_2:def_6_:_
for G being Graph
for vs being FinSequence of the carrier of G
for c being FinSequence holds
( vs is_vertex_seq_of c iff ( len vs = (len c) + 1 & ( for n being Element of NAT st 1 <= n & n <= len c holds
c . n joins vs /. n,vs /. (n + 1) ) ) );
theorem Th31: :: GRAPH_2:31
for G being Graph
for vs being FinSequence of the carrier of G
for c being Chain of G st c <> {} & vs is_vertex_seq_of c holds
G -VSet (rng c) = rng vs
proof
let G be Graph; ::_thesis: for vs being FinSequence of the carrier of G
for c being Chain of G st c <> {} & vs is_vertex_seq_of c holds
G -VSet (rng c) = rng vs
let vs be FinSequence of the carrier of G; ::_thesis: for c being Chain of G st c <> {} & vs is_vertex_seq_of c holds
G -VSet (rng c) = rng vs
let c be Chain of G; ::_thesis: ( c <> {} & vs is_vertex_seq_of c implies G -VSet (rng c) = rng vs )
assume that
A1: c <> {} and
A2: vs is_vertex_seq_of c ; ::_thesis: G -VSet (rng c) = rng vs
A3: len vs = (len c) + 1 by A2, Def6;
now__::_thesis:_for_y_being_set_holds_
(_(_y_in_G_-VSet_(rng_c)_implies_y_in_rng_vs_)_&_(_y_in_rng_vs_implies_y_in_G_-VSet_(rng_c)_)_)
let y be set ; ::_thesis: ( ( y in G -VSet (rng c) implies y in rng vs ) & ( y in rng vs implies b1 in G -VSet (rng c) ) )
hereby ::_thesis: ( y in rng vs implies b1 in G -VSet (rng c) )
assume y in G -VSet (rng c) ; ::_thesis: y in rng vs
then consider v being Element of G such that
A4: v = y and
A5: ex e being Element of the carrier' of G st
( e in rng c & ( v = the Source of G . e or v = the Target of G . e ) ) ;
consider e being Element of the carrier' of G such that
A6: e in rng c and
A7: ( v = the Source of G . e or v = the Target of G . e ) by A5;
consider x being set such that
A8: x in dom c and
A9: e = c . x by A6, FUNCT_1:def_3;
reconsider x = x as Element of NAT by A8;
A10: 1 <= x + 1 by NAT_1:12;
set v2 = vs /. (x + 1);
set v1 = vs /. x;
A11: x <= len c by A8, FINSEQ_3:25;
then x + 1 <= len vs by A3, XREAL_1:7;
then A12: x + 1 in dom vs by A10, FINSEQ_3:25;
A13: 1 <= x by A8, FINSEQ_3:25;
then c . x joins vs /. x,vs /. (x + 1) by A2, A11, Def6;
then A14: ( v = vs /. x or v = vs /. (x + 1) ) by A7, A9, GRAPH_1:def_12;
A15: x <= len vs by A3, A11, NAT_1:12;
then A16: vs /. x = vs . x by A13, FINSEQ_4:15;
A17: x in dom vs by A13, A15, FINSEQ_3:25;
vs /. (x + 1) = vs . (x + 1) by A3, A11, A10, FINSEQ_4:15, XREAL_1:7;
hence y in rng vs by A4, A16, A14, A17, A12, FUNCT_1:def_3; ::_thesis: verum
end;
assume y in rng vs ; ::_thesis: b1 in G -VSet (rng c)
then consider x being set such that
A18: x in dom vs and
A19: y = vs . x by FUNCT_1:def_3;
reconsider x = x as Element of NAT by A18;
A20: 1 <= x by A18, FINSEQ_3:25;
A21: x <= len vs by A18, FINSEQ_3:25;
percases ( x <= len c or x = (len c) + 1 ) by A3, A21, NAT_1:8;
supposeA22: x <= len c ; ::_thesis: b1 in G -VSet (rng c)
then x in dom c by A20, FINSEQ_3:25;
then A23: c . x in rng c by FUNCT_1:def_3;
rng c c= the carrier' of G by FINSEQ_1:def_4;
then reconsider e = c . x as Element of the carrier' of G by A23;
x in dom c by A20, A22, FINSEQ_3:25;
then A24: e in rng c by FUNCT_1:def_3;
set v2 = vs /. (x + 1);
set v1 = vs /. x;
c . x joins vs /. x,vs /. (x + 1) by A2, A20, A22, Def6;
then A25: ( ( vs /. x = the Source of G . e & vs /. (x + 1) = the Target of G . e ) or ( vs /. (x + 1) = the Source of G . e & vs /. x = the Target of G . e ) ) by GRAPH_1:def_12;
vs /. x = vs . x by A20, A21, FINSEQ_4:15;
hence y in G -VSet (rng c) by A19, A25, A24; ::_thesis: verum
end;
supposeA26: x = (len c) + 1 ; ::_thesis: b1 in G -VSet (rng c)
set l = len c;
A27: rng c c= the carrier' of G by FINSEQ_1:def_4;
0 + 1 = 1 ;
then A28: 1 <= len c by A1, NAT_1:13;
then len c in dom c by FINSEQ_3:25;
then c . (len c) in rng c by FUNCT_1:def_3;
then reconsider e = c . (len c) as Element of the carrier' of G by A27;
set v2 = vs /. ((len c) + 1);
set v1 = vs /. (len c);
len c in dom c by A28, FINSEQ_3:25;
then A29: e in rng c by FUNCT_1:def_3;
c . (len c) joins vs /. (len c),vs /. ((len c) + 1) by A2, A28, Def6;
then A30: ( ( vs /. (len c) = the Source of G . e & vs /. ((len c) + 1) = the Target of G . e ) or ( vs /. ((len c) + 1) = the Source of G . e & vs /. (len c) = the Target of G . e ) ) by GRAPH_1:def_12;
vs /. ((len c) + 1) = vs . ((len c) + 1) by A3, A20, A26, FINSEQ_4:15;
hence y in G -VSet (rng c) by A19, A26, A30, A29; ::_thesis: verum
end;
end;
end;
hence G -VSet (rng c) = rng vs by TARSKI:1; ::_thesis: verum
end;
theorem Th32: :: GRAPH_2:32
for G being Graph
for v being Element of G holds <*v*> is_vertex_seq_of {}
proof
let G be Graph; ::_thesis: for v being Element of G holds <*v*> is_vertex_seq_of {}
let v be Element of G; ::_thesis: <*v*> is_vertex_seq_of {}
thus len <*v*> = (len {}) + 1 by FINSEQ_1:40; :: according to GRAPH_2:def_6 ::_thesis: for n being Element of NAT st 1 <= n & n <= len {} holds
{} . n joins <*v*> /. n,<*v*> /. (n + 1)
thus for n being Element of NAT st 1 <= n & n <= len {} holds
{} . n joins <*v*> /. n,<*v*> /. (n + 1) ; ::_thesis: verum
end;
theorem Th33: :: GRAPH_2:33
for G being Graph
for c being Chain of G ex vs being FinSequence of the carrier of G st vs is_vertex_seq_of c
proof
let G be Graph; ::_thesis: for c being Chain of G ex vs being FinSequence of the carrier of G st vs is_vertex_seq_of c
let c be Chain of G; ::_thesis: ex vs being FinSequence of the carrier of G st vs is_vertex_seq_of c
consider p being FinSequence such that
A1: len p = (len c) + 1 and
A2: for n being Element of NAT st 1 <= n & n <= len p holds
p . n in the carrier of G and
A3: for n being Element of NAT st 1 <= n & n <= len c holds
ex v1, v2 being Element of G st
( v1 = p . n & v2 = p . (n + 1) & c . n joins v1,v2 ) by GRAPH_1:def_14;
rng p c= the carrier of G
proof
let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in rng p or y in the carrier of G )
assume y in rng p ; ::_thesis: y in the carrier of G
then consider x being set such that
A4: x in dom p and
A5: y = p . x by FUNCT_1:def_3;
reconsider n = x as Element of NAT by A4;
A6: n <= len p by A4, FINSEQ_3:25;
1 <= n by A4, FINSEQ_3:25;
hence y in the carrier of G by A2, A5, A6; ::_thesis: verum
end;
then reconsider p = p as FinSequence of the carrier of G by FINSEQ_1:def_4;
take p ; ::_thesis: p is_vertex_seq_of c
thus len p = (len c) + 1 by A1; :: according to GRAPH_2:def_6 ::_thesis: for n being Element of NAT st 1 <= n & n <= len c holds
c . n joins p /. n,p /. (n + 1)
let n be Element of NAT ; ::_thesis: ( 1 <= n & n <= len c implies c . n joins p /. n,p /. (n + 1) )
assume that
A7: 1 <= n and
A8: n <= len c ; ::_thesis: c . n joins p /. n,p /. (n + 1)
A9: n <= len p by A1, A8, NAT_1:12;
1 <= n + 1 by NAT_1:12;
then A10: p /. (n + 1) = p . (n + 1) by A1, A8, FINSEQ_4:15, XREAL_1:7;
ex v1, v2 being Element of G st
( v1 = p . n & v2 = p . (n + 1) & c . n joins v1,v2 ) by A3, A7, A8;
hence c . n joins p /. n,p /. (n + 1) by A7, A9, A10, FINSEQ_4:15; ::_thesis: verum
end;
theorem Th34: :: GRAPH_2:34
for G being Graph
for vs1, vs2 being FinSequence of the carrier of G
for c being Chain of G st c <> {} & vs1 is_vertex_seq_of c & vs2 is_vertex_seq_of c & vs1 <> vs2 holds
( vs1 . 1 <> vs2 . 1 & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) )
proof
let G be Graph; ::_thesis: for vs1, vs2 being FinSequence of the carrier of G
for c being Chain of G st c <> {} & vs1 is_vertex_seq_of c & vs2 is_vertex_seq_of c & vs1 <> vs2 holds
( vs1 . 1 <> vs2 . 1 & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) )
let vs1, vs2 be FinSequence of the carrier of G; ::_thesis: for c being Chain of G st c <> {} & vs1 is_vertex_seq_of c & vs2 is_vertex_seq_of c & vs1 <> vs2 holds
( vs1 . 1 <> vs2 . 1 & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) )
let c be Chain of G; ::_thesis: ( c <> {} & vs1 is_vertex_seq_of c & vs2 is_vertex_seq_of c & vs1 <> vs2 implies ( vs1 . 1 <> vs2 . 1 & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) ) )
assume that
A1: c <> {} and
A2: vs1 is_vertex_seq_of c and
A3: vs2 is_vertex_seq_of c ; ::_thesis: ( not vs1 <> vs2 or ( vs1 . 1 <> vs2 . 1 & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) ) )
A4: len vs1 = (len c) + 1 by A2, Def6;
defpred S1[ Nat] means ( $1 in dom vs1 & vs1 . $1 <> vs2 . $1 );
set TG = the Target of G;
set SG = the Source of G;
A5: Seg (len vs1) = dom vs1 by FINSEQ_1:def_3;
A6: Seg (len vs2) = dom vs2 by FINSEQ_1:def_3;
A7: len vs2 = (len c) + 1 by A3, Def6;
assume vs1 <> vs2 ; ::_thesis: ( vs1 . 1 <> vs2 . 1 & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) )
then A8: ex j being Nat st S1[j] by A4, A7, FINSEQ_2:9;
consider k being Nat such that
A9: S1[k] and
A10: for n being Nat st S1[n] holds
k <= n from NAT_1:sch_5(A8);
A11: 1 <= k by A9, FINSEQ_3:25;
percases ( k = 1 or 1 < k ) by A11, XXREAL_0:1;
supposeA12: k = 1 ; ::_thesis: ( vs1 . 1 <> vs2 . 1 & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) )
hence vs1 . 1 <> vs2 . 1 by A9; ::_thesis: for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 )
set v21 = vs2 /. 1;
set v12 = vs1 /. (1 + 1);
set v11 = vs1 /. 1;
let vs be FinSequence of the carrier of G; ::_thesis: ( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 )
set v1 = vs /. 1;
set v2 = vs /. (1 + 1);
assume A13: vs is_vertex_seq_of c ; ::_thesis: ( vs = vs1 or vs = vs2 )
then A14: len vs = (len c) + 1 by Def6;
0 + 1 = 1 ;
then A15: 1 <= len c by A1, NAT_1:13;
then A16: c . 1 joins vs /. 1,vs /. (1 + 1) by A13, Def6;
c . 1 joins vs1 /. 1,vs1 /. (1 + 1) by A2, A15, Def6;
then A17: ( ( vs /. 1 = vs1 /. 1 & vs /. (1 + 1) = vs1 /. (1 + 1) ) or ( vs /. 1 = vs1 /. (1 + 1) & vs /. (1 + 1) = vs1 /. 1 ) ) by A16, Th30;
A18: 1 <= len vs1 by A4, NAT_1:12;
then A19: vs1 /. 1 = vs1 . 1 by FINSEQ_4:15;
A20: vs2 /. 1 = vs2 . 1 by A4, A7, A18, FINSEQ_4:15;
A21: c . 1 joins vs2 /. 1,vs2 /. (1 + 1) by A3, A15, Def6;
thus ( vs = vs1 or vs = vs2 ) ::_thesis: verum
proof
percases ( vs /. 1 = vs1 /. 1 or vs /. 1 = vs2 /. 1 ) by A9, A12, A19, A20, A16, A21, A17, Th30;
supposeA22: vs /. 1 = vs1 /. 1 ; ::_thesis: ( vs = vs1 or vs = vs2 )
now__::_thesis:_(_len_vs_=_len_vs_&_len_vs1_=_len_vs_&_(_for_i_being_Nat_holds_S2[i]_)_)
defpred S2[ Nat] means ( $1 in dom vs implies vs . $1 = vs1 . $1 );
thus len vs = len vs ; ::_thesis: ( len vs1 = len vs & ( for i being Nat holds S2[i] ) )
thus len vs1 = len vs by A4, A13, Def6; ::_thesis: for i being Nat holds S2[i]
A23: for i being Nat st S2[i] holds
S2[i + 1]
proof
A24: 0 + 1 = 1 ;
let i be Nat; ::_thesis: ( S2[i] implies S2[i + 1] )
assume A25: ( i in dom vs implies vs . i = vs1 . i ) ; ::_thesis: S2[i + 1]
assume A26: i + 1 in dom vs ; ::_thesis: vs . (i + 1) = vs1 . (i + 1)
reconsider i = i as Element of NAT by ORDINAL1:def_12;
A27: 1 <= i + 1 by A26, FINSEQ_3:25;
A28: i + 1 <= len vs by A26, FINSEQ_3:25;
percases ( i = 0 or 1 <= i ) by A24, NAT_1:13;
suppose i = 0 ; ::_thesis: vs . (i + 1) = vs1 . (i + 1)
hence vs . (i + 1) = vs1 . (i + 1) by A4, A14, A18, A19, A22, FINSEQ_4:15; ::_thesis: verum
end;
supposeA29: 1 <= i ; ::_thesis: vs . (i + 1) = vs1 . (i + 1)
set v12 = vs1 /. (i + 1);
set v11 = vs1 /. i;
set v2 = vs /. (i + 1);
A30: vs /. (i + 1) = vs . (i + 1) by A27, A28, FINSEQ_4:15;
set v1 = vs /. i;
A31: i <= len c by A14, A28, XREAL_1:6;
then A32: c . i joins vs1 /. i,vs1 /. (i + 1) by A2, A29, Def6;
A33: i <= len vs by A14, A31, NAT_1:12;
then A34: vs /. i = vs . i by A29, FINSEQ_4:15;
c . i joins vs /. i,vs /. (i + 1) by A13, A29, A31, Def6;
then A35: ( ( vs /. i = vs1 /. i & vs /. (i + 1) = vs1 /. (i + 1) ) or ( vs /. i = vs1 /. (i + 1) & vs /. (i + 1) = vs1 /. i ) ) by A32, Th30;
vs1 /. i = vs1 . i by A4, A14, A29, A33, FINSEQ_4:15;
hence vs . (i + 1) = vs1 . (i + 1) by A4, A14, A25, A27, A28, A29, A33, A34, A30, A35, FINSEQ_3:25, FINSEQ_4:15; ::_thesis: verum
end;
end;
end;
A36: S2[ 0 ] by FINSEQ_3:25;
thus for i being Nat holds S2[i] from NAT_1:sch_2(A36, A23); ::_thesis: verum
end;
hence ( vs = vs1 or vs = vs2 ) by FINSEQ_2:9; ::_thesis: verum
end;
supposeA37: vs /. 1 = vs2 /. 1 ; ::_thesis: ( vs = vs1 or vs = vs2 )
now__::_thesis:_(_len_vs_=_len_vs_&_len_vs2_=_len_vs_&_(_for_i_being_Nat_holds_S2[i]_)_)
defpred S2[ Nat] means ( $1 in dom vs implies vs . $1 = vs2 . $1 );
thus len vs = len vs ; ::_thesis: ( len vs2 = len vs & ( for i being Nat holds S2[i] ) )
thus len vs2 = len vs by A7, A13, Def6; ::_thesis: for i being Nat holds S2[i]
A38: for i being Nat st S2[i] holds
S2[i + 1]
proof
A39: 0 + 1 = 1 ;
let i be Nat; ::_thesis: ( S2[i] implies S2[i + 1] )
assume A40: ( i in dom vs implies vs . i = vs2 . i ) ; ::_thesis: S2[i + 1]
assume A41: i + 1 in dom vs ; ::_thesis: vs . (i + 1) = vs2 . (i + 1)
then A42: 1 <= i + 1 by FINSEQ_3:25;
A43: i + 1 <= len vs by A41, FINSEQ_3:25;
reconsider i = i as Element of NAT by ORDINAL1:def_12;
percases ( i = 0 or 1 <= i ) by A39, NAT_1:13;
suppose i = 0 ; ::_thesis: vs . (i + 1) = vs2 . (i + 1)
hence vs . (i + 1) = vs2 . (i + 1) by A4, A14, A18, A20, A37, FINSEQ_4:15; ::_thesis: verum
end;
supposeA44: 1 <= i ; ::_thesis: vs . (i + 1) = vs2 . (i + 1)
set v12 = vs2 /. (i + 1);
set v11 = vs2 /. i;
set v2 = vs /. (i + 1);
A45: vs /. (i + 1) = vs . (i + 1) by A42, A43, FINSEQ_4:15;
set v1 = vs /. i;
A46: i <= len c by A14, A43, XREAL_1:6;
then A47: c . i joins vs2 /. i,vs2 /. (i + 1) by A3, A44, Def6;
A48: i <= len vs by A14, A46, NAT_1:12;
then A49: vs /. i = vs . i by A44, FINSEQ_4:15;
c . i joins vs /. i,vs /. (i + 1) by A13, A44, A46, Def6;
then A50: ( ( vs /. i = vs2 /. i & vs /. (i + 1) = vs2 /. (i + 1) ) or ( vs /. i = vs2 /. (i + 1) & vs /. (i + 1) = vs2 /. i ) ) by A47, Th30;
vs2 /. i = vs2 . i by A7, A14, A44, A48, FINSEQ_4:15;
hence vs . (i + 1) = vs2 . (i + 1) by A7, A14, A40, A42, A43, A44, A48, A49, A45, A50, FINSEQ_3:25, FINSEQ_4:15; ::_thesis: verum
end;
end;
end;
A51: S2[ 0 ] by FINSEQ_3:25;
thus for i being Nat holds S2[i] from NAT_1:sch_2(A51, A38); ::_thesis: verum
end;
hence ( vs = vs1 or vs = vs2 ) by FINSEQ_2:9; ::_thesis: verum
end;
end;
end;
end;
suppose 1 < k ; ::_thesis: ( vs1 . 1 <> vs2 . 1 & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) )
then 1 + 1 <= k by NAT_1:13;
then consider k1 being Element of NAT such that
A52: 1 <= k1 and
A53: k1 < k and
A54: k = k1 + 1 by Th1;
A55: k <= len vs1 by A9, FINSEQ_3:25;
then A56: k1 <= len vs1 by A53, XXREAL_0:2;
then A57: k1 in dom vs1 by A52, FINSEQ_3:25;
A58: vs1 /. k1 = vs1 . k1 by A52, A56, FINSEQ_4:15;
A59: vs2 /. k = vs2 . k by A4, A7, A5, A6, A9, PARTFUN1:def_6;
A60: vs1 /. k = vs1 . k by A9, PARTFUN1:def_6;
A61: k1 <= len c by A4, A54, A55, XREAL_1:6;
then c . k1 joins vs1 /. k1,vs1 /. (k1 + 1) by A2, A52, Def6;
then A62: ( ( the Source of G . (c . k1) = vs1 /. k1 & the Target of G . (c . k1) = vs1 /. k ) or ( the Source of G . (c . k1) = vs1 /. k & the Target of G . (c . k1) = vs1 /. k1 ) ) by A54, GRAPH_1:def_12;
c . k1 joins vs2 /. k1,vs2 /. (k1 + 1) by A3, A52, A61, Def6;
then A63: ( ( the Source of G . (c . k1) = vs2 /. k1 & the Target of G . (c . k1) = vs2 /. k ) or ( the Source of G . (c . k1) = vs2 /. k & the Target of G . (c . k1) = vs2 /. k1 ) ) by A54, GRAPH_1:def_12;
vs2 /. k1 = vs2 . k1 by A4, A7, A52, A56, FINSEQ_4:15;
hence ( vs1 . 1 <> vs2 . 1 & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) ) by A9, A10, A53, A57, A58, A60, A59, A62, A63; ::_thesis: verum
end;
end;
end;
definition
let G be Graph;
let c be FinSequence;
predc alternates_vertices_in G means :Def7: :: GRAPH_2:def 7
( len c >= 1 & card (G -VSet (rng c)) = 2 & ( for n being Element of NAT st n in dom c holds
the Source of G . (c . n) <> the Target of G . (c . n) ) );
end;
:: deftheorem Def7 defines alternates_vertices_in GRAPH_2:def_7_:_
for G being Graph
for c being FinSequence holds
( c alternates_vertices_in G iff ( len c >= 1 & card (G -VSet (rng c)) = 2 & ( for n being Element of NAT st n in dom c holds
the Source of G . (c . n) <> the Target of G . (c . n) ) ) );
theorem Th35: :: GRAPH_2:35
for G being Graph
for vs being FinSequence of the carrier of G
for c being Chain of G st c alternates_vertices_in G & vs is_vertex_seq_of c holds
for k being Element of NAT st k in dom c holds
vs . k <> vs . (k + 1)
proof
let G be Graph; ::_thesis: for vs being FinSequence of the carrier of G
for c being Chain of G st c alternates_vertices_in G & vs is_vertex_seq_of c holds
for k being Element of NAT st k in dom c holds
vs . k <> vs . (k + 1)
let vs be FinSequence of the carrier of G; ::_thesis: for c being Chain of G st c alternates_vertices_in G & vs is_vertex_seq_of c holds
for k being Element of NAT st k in dom c holds
vs . k <> vs . (k + 1)
let c be Chain of G; ::_thesis: ( c alternates_vertices_in G & vs is_vertex_seq_of c implies for k being Element of NAT st k in dom c holds
vs . k <> vs . (k + 1) )
assume that
A1: c alternates_vertices_in G and
A2: vs is_vertex_seq_of c ; ::_thesis: for k being Element of NAT st k in dom c holds
vs . k <> vs . (k + 1)
set TG = the Target of G;
set SG = the Source of G;
let k be Element of NAT ; ::_thesis: ( k in dom c implies vs . k <> vs . (k + 1) )
set px = vs /. k;
set px1 = vs /. (k + 1);
assume A3: k in dom c ; ::_thesis: vs . k <> vs . (k + 1)
then A4: k <= len c by FINSEQ_3:25;
A5: 1 <= k by A3, FINSEQ_3:25;
then c . k joins vs /. k,vs /. (k + 1) by A2, A4, Def6;
then A6: ( ( the Target of G . (c . k) = vs /. (k + 1) & the Source of G . (c . k) = vs /. k ) or ( the Target of G . (c . k) = vs /. k & the Source of G . (c . k) = vs /. (k + 1) ) ) by GRAPH_1:def_12;
A7: len vs = (len c) + 1 by A2, Def6;
then k <= len vs by A4, NAT_1:12;
then A8: vs /. k = vs . k by A5, FINSEQ_4:15;
1 <= k + 1 by NAT_1:12;
then vs /. (k + 1) = vs . (k + 1) by A4, A7, FINSEQ_4:15, XREAL_1:7;
hence vs . k <> vs . (k + 1) by A1, A3, A8, A6, Def7; ::_thesis: verum
end;
theorem Th36: :: GRAPH_2:36
for G being Graph
for vs being FinSequence of the carrier of G
for c being Chain of G st c alternates_vertices_in G & vs is_vertex_seq_of c holds
rng vs = {( the Source of G . (c . 1)),( the Target of G . (c . 1))}
proof
let G be Graph; ::_thesis: for vs being FinSequence of the carrier of G
for c being Chain of G st c alternates_vertices_in G & vs is_vertex_seq_of c holds
rng vs = {( the Source of G . (c . 1)),( the Target of G . (c . 1))}
let vs be FinSequence of the carrier of G; ::_thesis: for c being Chain of G st c alternates_vertices_in G & vs is_vertex_seq_of c holds
rng vs = {( the Source of G . (c . 1)),( the Target of G . (c . 1))}
let c be Chain of G; ::_thesis: ( c alternates_vertices_in G & vs is_vertex_seq_of c implies rng vs = {( the Source of G . (c . 1)),( the Target of G . (c . 1))} )
assume that
A1: c alternates_vertices_in G and
A2: vs is_vertex_seq_of c ; ::_thesis: rng vs = {( the Source of G . (c . 1)),( the Target of G . (c . 1))}
set px1 = vs /. (1 + 1);
set TG = the Target of G;
set SG = the Source of G;
set px = vs /. 1;
A3: len vs = (len c) + 1 by A2, Def6;
then A4: 1 <= len vs by NAT_1:12;
then A5: vs /. 1 = vs . 1 by FINSEQ_4:15;
c <> {} by A1, Def7, CARD_1:27;
then G -VSet (rng c) = rng vs by A2, Th31;
then card (rng vs) = 2 by A1, Def7;
then consider x, y being set such that
x <> y and
A6: rng vs = {x,y} by CARD_2:60;
1 in dom vs by A4, FINSEQ_3:25;
then vs . 1 in rng vs by FUNCT_1:def_3;
then A7: ( vs . 1 = x or vs . 1 = y ) by A6, TARSKI:def_2;
A8: 1 <= len c by A1, Def7;
then A9: 1 in dom c by FINSEQ_3:25;
A10: vs /. (1 + 1) = vs . (1 + 1) by A8, A3, FINSEQ_4:15, XREAL_1:7;
c . 1 joins vs /. 1,vs /. (1 + 1) by A2, A8, Def6;
then A11: ( ( the Target of G . (c . 1) = vs /. (1 + 1) & the Source of G . (c . 1) = vs /. 1 ) or ( the Target of G . (c . 1) = vs /. 1 & the Source of G . (c . 1) = vs /. (1 + 1) ) ) by GRAPH_1:def_12;
1 + 1 <= len vs by A8, A3, XREAL_1:7;
then 1 + 1 in dom vs by FINSEQ_3:25;
then vs . (1 + 1) in rng vs by FUNCT_1:def_3;
then ( vs . (1 + 1) = x or vs . (1 + 1) = y ) by A6, TARSKI:def_2;
hence rng vs = {( the Source of G . (c . 1)),( the Target of G . (c . 1))} by A1, A6, A5, A10, A11, A7, A9, Def7; ::_thesis: verum
end;
theorem Th37: :: GRAPH_2:37
for G being Graph
for vs being FinSequence of the carrier of G
for c being Chain of G st c alternates_vertices_in G & vs is_vertex_seq_of c holds
vs is TwoValued Alternating FinSequence
proof
let G be Graph; ::_thesis: for vs being FinSequence of the carrier of G
for c being Chain of G st c alternates_vertices_in G & vs is_vertex_seq_of c holds
vs is TwoValued Alternating FinSequence
let vs be FinSequence of the carrier of G; ::_thesis: for c being Chain of G st c alternates_vertices_in G & vs is_vertex_seq_of c holds
vs is TwoValued Alternating FinSequence
let c be Chain of G; ::_thesis: ( c alternates_vertices_in G & vs is_vertex_seq_of c implies vs is TwoValued Alternating FinSequence )
assume that
A1: c alternates_vertices_in G and
A2: vs is_vertex_seq_of c ; ::_thesis: vs is TwoValued Alternating FinSequence
A3: c <> {} by A1, Def7, CARD_1:27;
A4: len vs = (len c) + 1 by A2, Def6;
A5: now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_+_1_<=_len_vs_holds_
vs_._k_<>_vs_._(k_+_1)
let k be Nat; ::_thesis: ( 1 <= k & k + 1 <= len vs implies vs . k <> vs . (k + 1) )
assume that
A6: 1 <= k and
A7: k + 1 <= len vs ; ::_thesis: vs . k <> vs . (k + 1)
k <= len c by A4, A7, XREAL_1:6;
then k in dom c by A6, FINSEQ_3:25;
hence vs . k <> vs . (k + 1) by A1, A2, Th35; ::_thesis: verum
end;
card (G -VSet (rng c)) = 2 by A1, Def7;
then card (rng vs) = 2 by A2, A3, Th31;
hence vs is TwoValued Alternating FinSequence by A5, Def3, Def4; ::_thesis: verum
end;
theorem Th38: :: GRAPH_2:38
for G being Graph
for c being Chain of G st c alternates_vertices_in G holds
ex vs1, vs2 being FinSequence of the carrier of G st
( vs1 <> vs2 & vs1 is_vertex_seq_of c & vs2 is_vertex_seq_of c & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) )
proof
let G be Graph; ::_thesis: for c being Chain of G st c alternates_vertices_in G holds
ex vs1, vs2 being FinSequence of the carrier of G st
( vs1 <> vs2 & vs1 is_vertex_seq_of c & vs2 is_vertex_seq_of c & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) )
let c be Chain of G; ::_thesis: ( c alternates_vertices_in G implies ex vs1, vs2 being FinSequence of the carrier of G st
( vs1 <> vs2 & vs1 is_vertex_seq_of c & vs2 is_vertex_seq_of c & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) ) )
set X = the Source of G . (c . 1);
set Y = the Target of G . (c . 1);
consider p1 being FinSequence of the carrier of G such that
A1: p1 is_vertex_seq_of c by Th33;
assume A2: c alternates_vertices_in G ; ::_thesis: ex vs1, vs2 being FinSequence of the carrier of G st
( vs1 <> vs2 & vs1 is_vertex_seq_of c & vs2 is_vertex_seq_of c & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) ) )
then A3: 1 <= len c by Def7;
then A4: 1 in dom c by FINSEQ_3:25;
A5: 1 + 1 = 2 ;
then A6: p1 . 1 <> p1 . 2 by A2, A1, A4, Th35;
A7: rng p1 = {( the Source of G . (c . 1)),( the Target of G . (c . 1))} by A2, A1, Th36;
A8: len p1 = (len c) + 1 by A1, Def6;
then A9: len p1 > 1 by A3, NAT_1:13;
then consider p2 being TwoValued Alternating FinSequence such that
A10: rng p2 = {(p1 . 2),(p1 . 1)} and
A11: len p2 = len p1 and
A12: p2 . 1 = p1 . 2 by A6, Th23;
A13: dom p1 = dom p2 by A11, FINSEQ_3:29;
1 + 1 <= len p1 by A9, NAT_1:13;
then 2 in dom p1 by FINSEQ_3:25;
then p1 . 2 in rng p1 by FUNCT_1:def_3;
then A14: ( p1 . 2 = the Source of G . (c . 1) or p1 . 2 = the Target of G . (c . 1) ) by A7, TARSKI:def_2;
1 in dom p1 by A9, FINSEQ_3:25;
then p1 . 1 in rng p1 by FUNCT_1:def_3;
then A15: ( p1 . 1 = the Source of G . (c . 1) or p1 . 1 = the Target of G . (c . 1) ) by A7, TARSKI:def_2;
then reconsider p2 = p2 as FinSequence of the carrier of G by A2, A1, A7, A4, A5, A10, A14, Th35, FINSEQ_1:def_4;
take p1 ; ::_thesis: ex vs2 being FinSequence of the carrier of G st
( p1 <> vs2 & p1 is_vertex_seq_of c & vs2 is_vertex_seq_of c & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = p1 or vs = vs2 ) ) )
take p2 ; ::_thesis: ( p1 <> p2 & p1 is_vertex_seq_of c & p2 is_vertex_seq_of c & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = p1 or vs = p2 ) ) )
thus p1 <> p2 by A2, A1, A4, A5, A12, Th35; ::_thesis: ( p1 is_vertex_seq_of c & p2 is_vertex_seq_of c & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = p1 or vs = p2 ) ) )
thus p1 is_vertex_seq_of c by A1; ::_thesis: ( p2 is_vertex_seq_of c & ( for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = p1 or vs = p2 ) ) )
A16: p1 is TwoValued Alternating FinSequence by A2, A1, Th37;
now__::_thesis:_(_len_p2_=_(len_c)_+_1_&_(_for_n_being_Element_of_NAT_st_1_<=_n_&_n_<=_len_c_holds_
c_._n_joins_p2_/._n,p2_/._(n_+_1)_)_)
thus len p2 = (len c) + 1 by A1, A11, Def6; ::_thesis: for n being Element of NAT st 1 <= n & n <= len c holds
c . n joins p2 /. n,p2 /. (n + 1)
let n be Element of NAT ; ::_thesis: ( 1 <= n & n <= len c implies c . n joins p2 /. n,p2 /. (n + 1) )
assume that
A17: 1 <= n and
A18: n <= len c ; ::_thesis: c . n joins p2 /. n,p2 /. (n + 1)
A19: n <= len p1 by A8, A18, NAT_1:12;
then A20: p2 /. n = p2 . n by A11, A17, FINSEQ_4:15;
A21: n in dom p1 by A17, A19, FINSEQ_3:25;
then p2 . n in {( the Source of G . (c . 1)),( the Target of G . (c . 1))} by A2, A1, A4, A5, A10, A13, A15, A14, Th35, FUNCT_1:def_3;
then A22: ( p2 . n = the Source of G . (c . 1) or p2 . n = the Target of G . (c . 1) ) by TARSKI:def_2;
set x = p1 /. n;
set y = p1 /. (n + 1);
A23: c . n joins p1 /. n,p1 /. (n + 1) by A1, A17, A18, Def6;
A24: n + 1 <= len p1 by A8, A18, XREAL_1:6;
then A25: p2 /. (n + 1) = p2 . (n + 1) by A11, FINSEQ_4:15, NAT_1:12;
A26: 1 <= n + 1 by NAT_1:12;
then A27: n + 1 in dom p1 by A24, FINSEQ_3:25;
then p2 . (n + 1) in {( the Source of G . (c . 1)),( the Target of G . (c . 1))} by A2, A1, A4, A5, A10, A13, A15, A14, Th35, FUNCT_1:def_3;
then A28: ( p2 . (n + 1) = the Source of G . (c . 1) or p2 . (n + 1) = the Target of G . (c . 1) ) by TARSKI:def_2;
p1 . n in {( the Source of G . (c . 1)),( the Target of G . (c . 1))} by A7, A21, FUNCT_1:def_3;
then ( p1 . n = the Source of G . (c . 1) or p1 . n = the Target of G . (c . 1) ) by TARSKI:def_2;
then A29: p1 /. n = p2 . (n + 1) by A7, A16, A6, A10, A11, A12, A15, A14, A17, A19, A24, A22, A28, Def4, Th21, FINSEQ_4:15;
p1 . (n + 1) in {( the Source of G . (c . 1)),( the Target of G . (c . 1))} by A7, A27, FUNCT_1:def_3;
then ( p1 . (n + 1) = the Source of G . (c . 1) or p1 . (n + 1) = the Target of G . (c . 1) ) by TARSKI:def_2;
then p1 /. (n + 1) = p2 . n by A7, A16, A6, A10, A11, A12, A15, A14, A17, A26, A24, A22, A28, Def4, Th21, FINSEQ_4:15;
hence c . n joins p2 /. n,p2 /. (n + 1) by A23, A29, A20, A25, Th29; ::_thesis: verum
end;
hence p2 is_vertex_seq_of c by Def6; ::_thesis: for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = p1 or vs = p2 )
let p be FinSequence of the carrier of G; ::_thesis: ( not p is_vertex_seq_of c or p = p1 or p = p2 )
assume A30: p is_vertex_seq_of c ; ::_thesis: ( p = p1 or p = p2 )
then reconsider p9 = p as TwoValued Alternating FinSequence by A2, Th37;
A31: len p = (len c) + 1 by A30, Def6;
rng p = {( the Source of G . (c . 1)),( the Target of G . (c . 1))} by A2, A30, Th36;
then ( p9 = p1 or p9 = p2 ) by A8, A7, A16, A6, A10, A11, A12, A15, A14, A31, Th22;
hence ( p = p1 or p = p2 ) ; ::_thesis: verum
end;
Lm7: for D being non empty set st ( for x, y being set st x in D & y in D holds
x = y ) holds
card D = 1
proof
let D be non empty set ; ::_thesis: ( ( for x, y being set st x in D & y in D holds
x = y ) implies card D = 1 )
set x = the Element of D;
assume for x, y being set st x in D & y in D holds
x = y ; ::_thesis: card D = 1
then for y being set holds
( y in D iff y = the Element of D ) ;
then D = { the Element of D} by TARSKI:def_1;
hence card D = 1 by CARD_2:42; ::_thesis: verum
end;
theorem Th39: :: GRAPH_2:39
for G being Graph
for vs being FinSequence of the carrier of G
for c being Chain of G st vs is_vertex_seq_of c holds
( ( card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) ) iff for vs1 being FinSequence of the carrier of G st vs1 is_vertex_seq_of c holds
vs1 = vs )
proof
let G be Graph; ::_thesis: for vs being FinSequence of the carrier of G
for c being Chain of G st vs is_vertex_seq_of c holds
( ( card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) ) iff for vs1 being FinSequence of the carrier of G st vs1 is_vertex_seq_of c holds
vs1 = vs )
let vs be FinSequence of the carrier of G; ::_thesis: for c being Chain of G st vs is_vertex_seq_of c holds
( ( card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) ) iff for vs1 being FinSequence of the carrier of G st vs1 is_vertex_seq_of c holds
vs1 = vs )
let c be Chain of G; ::_thesis: ( vs is_vertex_seq_of c implies ( ( card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) ) iff for vs1 being FinSequence of the carrier of G st vs1 is_vertex_seq_of c holds
vs1 = vs ) )
assume A1: vs is_vertex_seq_of c ; ::_thesis: ( ( card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) ) iff for vs1 being FinSequence of the carrier of G st vs1 is_vertex_seq_of c holds
vs1 = vs )
hereby ::_thesis: ( ex vs1 being FinSequence of the carrier of G st
( vs1 is_vertex_seq_of c & not vs1 = vs ) or card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) )
assume A2: ( card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) ) ; ::_thesis: for vs1 being FinSequence of the carrier of G st vs1 is_vertex_seq_of c holds
not vs1 <> vs
percases ( card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) ) by A2;
supposeA3: card the carrier of G = 1 ; ::_thesis: for vs1 being FinSequence of the carrier of G st vs1 is_vertex_seq_of c holds
not vs1 <> vs
then reconsider tVG = the carrier of G as finite set ;
consider X being set such that
A4: tVG = {X} by A3, CARD_2:42;
A5: rng vs c= {X} by A4, FINSEQ_1:def_4;
A6: len vs = (len c) + 1 by A1, Def6;
let vs1 be FinSequence of the carrier of G; ::_thesis: ( vs1 is_vertex_seq_of c implies not vs1 <> vs )
A7: Seg (len vs) = dom vs by FINSEQ_1:def_3;
assume vs1 is_vertex_seq_of c ; ::_thesis: not vs1 <> vs
then A8: len vs1 = (len c) + 1 by Def6;
assume vs1 <> vs ; ::_thesis: contradiction
then consider j being Nat such that
A9: j in dom vs and
A10: vs1 . j <> vs . j by A8, A6, FINSEQ_2:9;
vs . j in rng vs by A9, FUNCT_1:def_3;
then A11: vs . j = X by A5, TARSKI:def_1;
A12: rng vs1 c= {X} by A4, FINSEQ_1:def_4;
Seg (len vs1) = dom vs1 by FINSEQ_1:def_3;
then vs1 . j in rng vs1 by A8, A6, A7, A9, FUNCT_1:def_3;
hence contradiction by A10, A12, A11, TARSKI:def_1; ::_thesis: verum
end;
supposeA13: ( c <> {} & not c alternates_vertices_in G ) ; ::_thesis: for vs1 being FinSequence of the carrier of G st vs1 is_vertex_seq_of c holds
vs1 = vs
thus for vs1 being FinSequence of the carrier of G st vs1 is_vertex_seq_of c holds
vs1 = vs ::_thesis: verum
proof
set TG = the Target of G;
set SG = the Source of G;
let vs1 be FinSequence of the carrier of G; ::_thesis: ( vs1 is_vertex_seq_of c implies vs1 = vs )
defpred S1[ Nat] means ( $1 in dom vs1 & vs1 . $1 <> vs . $1 );
assume A14: vs1 is_vertex_seq_of c ; ::_thesis: vs1 = vs
then A15: len vs1 = (len c) + 1 by Def6;
A16: len vs = (len c) + 1 by A1, Def6;
then A17: dom vs1 = dom vs by A15, FINSEQ_3:29;
assume vs1 <> vs ; ::_thesis: contradiction
then A18: ex i being Nat st S1[i] by A15, A16, FINSEQ_2:9;
consider k being Nat such that
A19: S1[k] and
A20: for n being Nat st S1[n] holds
k <= n from NAT_1:sch_5(A18);
A21: ( ( 0 + 1 = 1 & k = 0 ) or 0 + 1 <= k ) by NAT_1:13;
percases ( k = 0 or k = 1 or 1 < k ) by A21, XXREAL_0:1;
suppose k = 0 ; ::_thesis: contradiction
hence contradiction by A19, FINSEQ_3:25; ::_thesis: verum
end;
supposeA22: k = 1 ; ::_thesis: contradiction
thus contradiction ::_thesis: verum
proof
A23: 0 + 1 = 1 ;
percases ( len c = 0 or 1 <= len c ) by A23, NAT_1:13;
suppose len c = 0 ; ::_thesis: contradiction
hence contradiction by A13; ::_thesis: verum
end;
supposeA24: 1 <= len c ; ::_thesis: contradiction
defpred S2[ Element of NAT ] means ( $1 in dom c implies ( vs1 /. $1 <> vs /. $1 & vs1 /. ($1 + 1) <> vs /. ($1 + 1) & ( ( the Target of G . (c . $1) = the Target of G . (c . 1) & the Source of G . (c . $1) = the Source of G . (c . 1) ) or ( the Target of G . (c . $1) = the Source of G . (c . 1) & the Source of G . (c . $1) = the Target of G . (c . 1) ) ) ) );
A25: vs /. k = vs . k by A17, A19, PARTFUN1:def_6;
A26: vs1 /. k = vs1 . k by A19, PARTFUN1:def_6;
A27: now__::_thesis:_for_n_being_Element_of_NAT_st_S2[n]_holds_
S2[n_+_1]
let n be Element of NAT ; ::_thesis: ( S2[n] implies S2[n + 1] )
assume A28: S2[n] ; ::_thesis: S2[n + 1]
thus S2[n + 1] ::_thesis: verum
proof
assume A29: n + 1 in dom c ; ::_thesis: ( vs1 /. (n + 1) <> vs /. (n + 1) & vs1 /. ((n + 1) + 1) <> vs /. ((n + 1) + 1) & ( ( the Target of G . (c . (n + 1)) = the Target of G . (c . 1) & the Source of G . (c . (n + 1)) = the Source of G . (c . 1) ) or ( the Target of G . (c . (n + 1)) = the Source of G . (c . 1) & the Source of G . (c . (n + 1)) = the Target of G . (c . 1) ) ) )
then A30: 1 <= n + 1 by FINSEQ_3:25;
A31: n + 1 <= len c by A29, FINSEQ_3:25;
thus ( vs1 /. (n + 1) <> vs /. (n + 1) & vs1 /. ((n + 1) + 1) <> vs /. ((n + 1) + 1) & ( ( the Target of G . (c . (n + 1)) = the Target of G . (c . 1) & the Source of G . (c . (n + 1)) = the Source of G . (c . 1) ) or ( the Target of G . (c . (n + 1)) = the Source of G . (c . 1) & the Source of G . (c . (n + 1)) = the Target of G . (c . 1) ) ) ) ::_thesis: verum
proof
percases ( n = 0 or 0 < n ) ;
supposeA32: n = 0 ; ::_thesis: ( vs1 /. (n + 1) <> vs /. (n + 1) & vs1 /. ((n + 1) + 1) <> vs /. ((n + 1) + 1) & ( ( the Target of G . (c . (n + 1)) = the Target of G . (c . 1) & the Source of G . (c . (n + 1)) = the Source of G . (c . 1) ) or ( the Target of G . (c . (n + 1)) = the Source of G . (c . 1) & the Source of G . (c . (n + 1)) = the Target of G . (c . 1) ) ) )
hence vs1 /. (n + 1) <> vs /. (n + 1) by A17, A19, A22, A26, PARTFUN1:def_6; ::_thesis: ( vs1 /. ((n + 1) + 1) <> vs /. ((n + 1) + 1) & ( ( the Target of G . (c . (n + 1)) = the Target of G . (c . 1) & the Source of G . (c . (n + 1)) = the Source of G . (c . 1) ) or ( the Target of G . (c . (n + 1)) = the Source of G . (c . 1) & the Source of G . (c . (n + 1)) = the Target of G . (c . 1) ) ) )
A33: 1 <= len c by A30, A31, XXREAL_0:2;
then c . 1 joins vs /. 1,vs /. (1 + 1) by A1, Def6;
then A34: ( ( the Source of G . (c . 1) = vs /. 1 & the Target of G . (c . 1) = vs /. (1 + 1) ) or ( the Source of G . (c . 1) = vs /. (1 + 1) & the Target of G . (c . 1) = vs /. 1 ) ) by GRAPH_1:def_12;
c . 1 joins vs1 /. 1,vs1 /. (1 + 1) by A14, A33, Def6;
then ( ( the Source of G . (c . 1) = vs1 /. 1 & the Target of G . (c . 1) = vs1 /. (1 + 1) ) or ( the Source of G . (c . 1) = vs1 /. (1 + 1) & the Target of G . (c . 1) = vs1 /. 1 ) ) by GRAPH_1:def_12;
hence vs1 /. ((n + 1) + 1) <> vs /. ((n + 1) + 1) by A17, A19, A22, A26, A32, A34, PARTFUN1:def_6; ::_thesis: ( ( the Target of G . (c . (n + 1)) = the Target of G . (c . 1) & the Source of G . (c . (n + 1)) = the Source of G . (c . 1) ) or ( the Target of G . (c . (n + 1)) = the Source of G . (c . 1) & the Source of G . (c . (n + 1)) = the Target of G . (c . 1) ) )
thus ( ( the Target of G . (c . (n + 1)) = the Target of G . (c . 1) & the Source of G . (c . (n + 1)) = the Source of G . (c . 1) ) or ( the Target of G . (c . (n + 1)) = the Source of G . (c . 1) & the Source of G . (c . (n + 1)) = the Target of G . (c . 1) ) ) by A32; ::_thesis: verum
end;
supposeA35: 0 < n ; ::_thesis: ( vs1 /. (n + 1) <> vs /. (n + 1) & vs1 /. ((n + 1) + 1) <> vs /. ((n + 1) + 1) & ( ( the Target of G . (c . (n + 1)) = the Target of G . (c . 1) & the Source of G . (c . (n + 1)) = the Source of G . (c . 1) ) or ( the Target of G . (c . (n + 1)) = the Source of G . (c . 1) & the Source of G . (c . (n + 1)) = the Target of G . (c . 1) ) ) )
A36: n <= len c by A31, NAT_1:13;
A37: 0 + 1 <= n by A35, NAT_1:13;
hence vs1 /. (n + 1) <> vs /. (n + 1) by A28, A36, FINSEQ_3:25; ::_thesis: ( vs1 /. ((n + 1) + 1) <> vs /. ((n + 1) + 1) & ( ( the Target of G . (c . (n + 1)) = the Target of G . (c . 1) & the Source of G . (c . (n + 1)) = the Source of G . (c . 1) ) or ( the Target of G . (c . (n + 1)) = the Source of G . (c . 1) & the Source of G . (c . (n + 1)) = the Target of G . (c . 1) ) ) )
c . n joins vs1 /. n,vs1 /. (n + 1) by A14, A37, A36, Def6;
then A38: ( ( the Source of G . (c . n) = vs1 /. n & the Target of G . (c . n) = vs1 /. (n + 1) ) or ( the Source of G . (c . n) = vs1 /. (n + 1) & the Target of G . (c . n) = vs1 /. n ) ) by GRAPH_1:def_12;
c . (n + 1) joins vs /. (n + 1),vs /. ((n + 1) + 1) by A1, A30, A31, Def6;
then A39: ( ( the Source of G . (c . (n + 1)) = vs /. (n + 1) & the Target of G . (c . (n + 1)) = vs /. ((n + 1) + 1) ) or ( the Source of G . (c . (n + 1)) = vs /. ((n + 1) + 1) & the Target of G . (c . (n + 1)) = vs /. (n + 1) ) ) by GRAPH_1:def_12;
A40: c . (n + 1) joins vs1 /. (n + 1),vs1 /. ((n + 1) + 1) by A14, A30, A31, Def6;
then ( ( the Source of G . (c . (n + 1)) = vs1 /. (n + 1) & the Target of G . (c . (n + 1)) = vs1 /. ((n + 1) + 1) ) or ( the Source of G . (c . (n + 1)) = vs1 /. ((n + 1) + 1) & the Target of G . (c . (n + 1)) = vs1 /. (n + 1) ) ) by GRAPH_1:def_12;
hence vs1 /. ((n + 1) + 1) <> vs /. ((n + 1) + 1) by A28, A37, A36, A39, FINSEQ_3:25; ::_thesis: ( ( the Target of G . (c . (n + 1)) = the Target of G . (c . 1) & the Source of G . (c . (n + 1)) = the Source of G . (c . 1) ) or ( the Target of G . (c . (n + 1)) = the Source of G . (c . 1) & the Source of G . (c . (n + 1)) = the Target of G . (c . 1) ) )
c . n joins vs /. n,vs /. (n + 1) by A1, A37, A36, Def6;
hence ( ( the Target of G . (c . (n + 1)) = the Target of G . (c . 1) & the Source of G . (c . (n + 1)) = the Source of G . (c . 1) ) or ( the Target of G . (c . (n + 1)) = the Source of G . (c . 1) & the Source of G . (c . (n + 1)) = the Target of G . (c . 1) ) ) by A28, A37, A36, A38, A40, A39, FINSEQ_3:25, GRAPH_1:def_12; ::_thesis: verum
end;
end;
end;
end;
end;
A41: S2[ 0 ] by FINSEQ_3:25;
A42: for n being Element of NAT holds S2[n] from NAT_1:sch_1(A41, A27);
now__::_thesis:_for_x_being_set_holds_
(_(_x_in_G_-VSet_(rng_c)_implies_x_in_{(_the_Source_of_G_._(c_._1)),(_the_Target_of_G_._(c_._1))}_)_&_(_x_in_{(_the_Source_of_G_._(c_._1)),(_the_Target_of_G_._(c_._1))}_implies_x_in_G_-VSet_(rng_c)_)_)
let x be set ; ::_thesis: ( ( x in G -VSet (rng c) implies x in {( the Source of G . (c . 1)),( the Target of G . (c . 1))} ) & ( x in {( the Source of G . (c . 1)),( the Target of G . (c . 1))} implies x in G -VSet (rng c) ) )
hereby ::_thesis: ( x in {( the Source of G . (c . 1)),( the Target of G . (c . 1))} implies x in G -VSet (rng c) )
assume x in G -VSet (rng c) ; ::_thesis: x in {( the Source of G . (c . 1)),( the Target of G . (c . 1))}
then consider v being Element of G such that
A43: x = v and
A44: ex e being Element of the carrier' of G st
( e in rng c & ( v = the Source of G . e or v = the Target of G . e ) ) ;
consider e being set such that
A45: e in rng c and
A46: ( v = the Source of G . e or v = the Target of G . e ) by A44;
consider d being set such that
A47: d in dom c and
A48: e = c . d by A45, FUNCT_1:def_3;
reconsider d = d as Element of NAT by A47;
( ( the Target of G . (c . d) = the Target of G . (c . 1) & the Source of G . (c . d) = the Source of G . (c . 1) ) or ( the Target of G . (c . d) = the Source of G . (c . 1) & the Source of G . (c . d) = the Target of G . (c . 1) ) ) by A42, A47;
hence x in {( the Source of G . (c . 1)),( the Target of G . (c . 1))} by A43, A46, A48, TARSKI:def_2; ::_thesis: verum
end;
0 + 1 <= len c by A13, NAT_1:13;
then A49: 1 in dom c by FINSEQ_3:25;
then A50: c . 1 in rng c by FUNCT_1:def_3;
A51: rng c c= the carrier' of G by FINSEQ_1:def_4;
then reconsider e = c . 1 as Element of the carrier' of G by A50;
reconsider t = the Target of G . e as Element of G by A50, A51, FUNCT_2:5;
reconsider s = the Source of G . e as Element of G by A50, A51, FUNCT_2:5;
assume x in {( the Source of G . (c . 1)),( the Target of G . (c . 1))} ; ::_thesis: x in G -VSet (rng c)
then A52: ( x = s or x = t ) by TARSKI:def_2;
e in rng c by A49, FUNCT_1:def_3;
hence x in G -VSet (rng c) by A52; ::_thesis: verum
end;
then A53: G -VSet (rng c) = {( the Source of G . (c . 1)),( the Target of G . (c . 1))} by TARSKI:1;
c . k joins vs1 /. k,vs1 /. (k + 1) by A14, A22, A24, Def6;
then A54: ( ( the Source of G . (c . 1) = vs1 /. 1 & the Target of G . (c . 1) = vs1 /. (k + 1) ) or ( the Source of G . (c . 1) = vs1 /. (k + 1) & the Target of G . (c . 1) = vs1 /. 1 ) ) by A22, GRAPH_1:def_12;
A55: c . k joins vs /. k,vs /. (k + 1) by A1, A22, A24, Def6;
A56: now__::_thesis:_for_n_being_Element_of_NAT_st_n_in_dom_c_holds_
the_Source_of_G_._(c_._n)_<>_the_Target_of_G_._(c_._n)
let n be Element of NAT ; ::_thesis: ( n in dom c implies the Source of G . (c . n) <> the Target of G . (c . n) )
( not n in dom c or ( the Target of G . (c . n) = the Target of G . (c . 1) & the Source of G . (c . n) = the Source of G . (c . 1) ) or ( the Target of G . (c . n) = the Source of G . (c . 1) & the Source of G . (c . n) = the Target of G . (c . 1) ) ) by A42;
hence ( n in dom c implies the Source of G . (c . n) <> the Target of G . (c . n) ) by A19, A22, A26, A25, A55, A54, GRAPH_1:def_12; ::_thesis: verum
end;
( ( the Source of G . (c . 1) = vs /. 1 & the Target of G . (c . 1) = vs /. (k + 1) ) or ( the Source of G . (c . 1) = vs /. (k + 1) & the Target of G . (c . 1) = vs /. 1 ) ) by A22, A55, GRAPH_1:def_12;
then card (G -VSet (rng c)) = 2 by A19, A22, A26, A25, A54, A53, CARD_2:57;
hence contradiction by A13, A24, A56, Def7; ::_thesis: verum
end;
end;
end;
end;
suppose 1 < k ; ::_thesis: contradiction
then 1 + 1 <= k by NAT_1:13;
then consider k1 being Element of NAT such that
A57: 1 <= k1 and
A58: k1 < k and
A59: k = k1 + 1 by Th1;
A60: k <= len vs1 by A19, FINSEQ_3:25;
then A61: k1 <= len vs1 by A58, XXREAL_0:2;
then A62: k1 in dom vs1 by A57, FINSEQ_3:25;
A63: k1 <= len c by A15, A59, A60, XREAL_1:6;
then c . k1 joins vs1 /. k1,vs1 /. (k1 + 1) by A14, A57, Def6;
then A64: ( ( the Source of G . (c . k1) = vs1 /. k1 & the Target of G . (c . k1) = vs1 /. k ) or ( the Source of G . (c . k1) = vs1 /. k & the Target of G . (c . k1) = vs1 /. k1 ) ) by A59, GRAPH_1:def_12;
A65: vs1 /. k1 = vs1 . k1 by A57, A61, FINSEQ_4:15;
A66: vs1 /. k = vs1 . k by A19, PARTFUN1:def_6;
c . k1 joins vs /. k1,vs /. (k1 + 1) by A1, A57, A63, Def6;
then A67: ( ( the Source of G . (c . k1) = vs /. k1 & the Target of G . (c . k1) = vs /. k ) or ( the Source of G . (c . k1) = vs /. k & the Target of G . (c . k1) = vs /. k1 ) ) by A59, GRAPH_1:def_12;
A68: vs /. k = vs . k by A17, A19, PARTFUN1:def_6;
vs /. k1 = vs . k1 by A15, A16, A57, A61, FINSEQ_4:15;
hence contradiction by A19, A20, A58, A62, A65, A66, A68, A64, A67; ::_thesis: verum
end;
end;
end;
end;
end;
end;
assume A69: for vs1 being FinSequence of the carrier of G st vs1 is_vertex_seq_of c holds
vs1 = vs ; ::_thesis: ( card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) )
assume card the carrier of G <> 1 ; ::_thesis: ( c <> {} & not c alternates_vertices_in G )
then consider x, y being set such that
A70: x in the carrier of G and
A71: y in the carrier of G and
A72: x <> y by Lm7;
reconsider y = y as Element of G by A71;
reconsider x = x as Element of G by A70;
assume A73: ( c = {} or c alternates_vertices_in G ) ; ::_thesis: contradiction
thus contradiction ::_thesis: verum
proof
percases ( c = {} or c alternates_vertices_in G ) by A73;
supposeA74: c = {} ; ::_thesis: contradiction
then <*x*> = vs by A69, Th32;
then A75: vs . 1 = x by FINSEQ_1:40;
<*y*> = vs by A69, A74, Th32;
hence contradiction by A72, A75, FINSEQ_1:40; ::_thesis: verum
end;
suppose c alternates_vertices_in G ; ::_thesis: contradiction
then consider vs1, vs2 being FinSequence of the carrier of G such that
A76: vs1 <> vs2 and
A77: vs1 is_vertex_seq_of c and
A78: vs2 is_vertex_seq_of c and
for vs being FinSequence of the carrier of G holds
( not vs is_vertex_seq_of c or vs = vs1 or vs = vs2 ) by Th38;
vs1 = vs by A69, A77;
hence contradiction by A69, A76, A78; ::_thesis: verum
end;
end;
end;
end;
definition
let G be Graph;
let c be Chain of G;
assume A1: ( card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) ) ;
func vertex-seq c -> FinSequence of the carrier of G means :: GRAPH_2:def 8
it is_vertex_seq_of c;
existence
ex b1 being FinSequence of the carrier of G st b1 is_vertex_seq_of c by Th33;
uniqueness
for b1, b2 being FinSequence of the carrier of G st b1 is_vertex_seq_of c & b2 is_vertex_seq_of c holds
b1 = b2 by A1, Th39;
end;
:: deftheorem defines vertex-seq GRAPH_2:def_8_:_
for G being Graph
for c being Chain of G st ( card the carrier of G = 1 or ( c <> {} & not c alternates_vertices_in G ) ) holds
for b3 being FinSequence of the carrier of G holds
( b3 = vertex-seq c iff b3 is_vertex_seq_of c );
theorem Th40: :: GRAPH_2:40
for n being Element of NAT
for G being Graph
for vs, vs1 being FinSequence of the carrier of G
for c, c1 being Chain of G st vs is_vertex_seq_of c & c1 = c | (Seg n) & vs1 = vs | (Seg (n + 1)) holds
vs1 is_vertex_seq_of c1
proof
let n be Element of NAT ; ::_thesis: for G being Graph
for vs, vs1 being FinSequence of the carrier of G
for c, c1 being Chain of G st vs is_vertex_seq_of c & c1 = c | (Seg n) & vs1 = vs | (Seg (n + 1)) holds
vs1 is_vertex_seq_of c1
let G be Graph; ::_thesis: for vs, vs1 being FinSequence of the carrier of G
for c, c1 being Chain of G st vs is_vertex_seq_of c & c1 = c | (Seg n) & vs1 = vs | (Seg (n + 1)) holds
vs1 is_vertex_seq_of c1
let vs, vs1 be FinSequence of the carrier of G; ::_thesis: for c, c1 being Chain of G st vs is_vertex_seq_of c & c1 = c | (Seg n) & vs1 = vs | (Seg (n + 1)) holds
vs1 is_vertex_seq_of c1
let c, c1 be Chain of G; ::_thesis: ( vs is_vertex_seq_of c & c1 = c | (Seg n) & vs1 = vs | (Seg (n + 1)) implies vs1 is_vertex_seq_of c1 )
assume A1: vs is_vertex_seq_of c ; ::_thesis: ( not c1 = c | (Seg n) or not vs1 = vs | (Seg (n + 1)) or vs1 is_vertex_seq_of c1 )
then A2: len vs = (len c) + 1 by Def6;
assume that
A3: c1 = c | (Seg n) and
A4: vs1 = vs | (Seg (n + 1)) ; ::_thesis: vs1 is_vertex_seq_of c1
now__::_thesis:_(_len_vs1_=_(len_c1)_+_1_&_(_for_k_being_Element_of_NAT_st_1_<=_k_&_k_<=_len_c1_holds_
c1_._k_joins_vs1_/._k,vs1_/._(k_+_1)_)_)
percases ( n <= len c or len c <= n ) ;
supposeA5: n <= len c ; ::_thesis: ( len vs1 = (len c1) + 1 & ( for k being Element of NAT st 1 <= k & k <= len c1 holds
c1 . k joins vs1 /. k,vs1 /. (k + 1) ) )
then A6: n + 1 <= len vs by A2, XREAL_1:6;
then A7: len vs1 = n + 1 by A4, FINSEQ_1:17;
A8: len c1 = n by A3, A5, FINSEQ_1:17;
hence len vs1 = (len c1) + 1 by A4, A6, FINSEQ_1:17; ::_thesis: for k being Element of NAT st 1 <= k & k <= len c1 holds
c1 . k joins vs1 /. k,vs1 /. (k + 1)
let k be Element of NAT ; ::_thesis: ( 1 <= k & k <= len c1 implies c1 . k joins vs1 /. k,vs1 /. (k + 1) )
assume that
A9: 1 <= k and
A10: k <= len c1 ; ::_thesis: c1 . k joins vs1 /. k,vs1 /. (k + 1)
A11: 1 <= k + 1 by NAT_1:12;
then A12: vs1 /. (k + 1) = vs1 . (k + 1) by A8, A7, A10, FINSEQ_4:15, XREAL_1:7;
k + 1 <= (len c1) + 1 by A10, XREAL_1:7;
then k + 1 in Seg (n + 1) by A8, A11;
then A13: vs1 . (k + 1) = vs . (k + 1) by A4, FUNCT_1:49;
A14: k <= len c by A5, A8, A10, XXREAL_0:2;
then k <= len vs by A2, NAT_1:12;
then A15: vs /. k = vs . k by A9, FINSEQ_4:15;
A16: k <= n + 1 by A8, A10, NAT_1:12;
then A17: vs1 /. k = vs1 . k by A7, A9, FINSEQ_4:15;
k in Seg n by A8, A9, A10;
then A18: c1 . k = c . k by A3, FUNCT_1:49;
k in Seg (n + 1) by A9, A16;
then A19: vs1 . k = vs . k by A4, FUNCT_1:49;
vs /. (k + 1) = vs . (k + 1) by A2, A14, A11, FINSEQ_4:15, XREAL_1:7;
hence c1 . k joins vs1 /. k,vs1 /. (k + 1) by A1, A9, A14, A18, A19, A13, A15, A17, A12, Def6; ::_thesis: verum
end;
supposeA20: len c <= n ; ::_thesis: ( len vs1 = (len c1) + 1 & ( for k being Element of NAT st 1 <= k & k <= len c1 holds
c1 . k joins vs1 /. k,vs1 /. (k + 1) ) )
then len vs <= n + 1 by A2, XREAL_1:6;
then A21: vs1 = vs by A4, FINSEQ_2:20;
c1 = c by A3, A20, FINSEQ_2:20;
hence ( len vs1 = (len c1) + 1 & ( for k being Element of NAT st 1 <= k & k <= len c1 holds
c1 . k joins vs1 /. k,vs1 /. (k + 1) ) ) by A1, A21, Def6; ::_thesis: verum
end;
end;
end;
hence vs1 is_vertex_seq_of c1 by Def6; ::_thesis: verum
end;
theorem Th41: :: GRAPH_2:41
for q being FinSequence
for m, n being Element of NAT
for G being Graph
for c being Chain of G st 1 <= m & m <= n & n <= len c & q = (m,n) -cut c holds
q is Chain of G
proof
let q be FinSequence; ::_thesis: for m, n being Element of NAT
for G being Graph
for c being Chain of G st 1 <= m & m <= n & n <= len c & q = (m,n) -cut c holds
q is Chain of G
let m, n be Element of NAT ; ::_thesis: for G being Graph
for c being Chain of G st 1 <= m & m <= n & n <= len c & q = (m,n) -cut c holds
q is Chain of G
let G be Graph; ::_thesis: for c being Chain of G st 1 <= m & m <= n & n <= len c & q = (m,n) -cut c holds
q is Chain of G
let c be Chain of G; ::_thesis: ( 1 <= m & m <= n & n <= len c & q = (m,n) -cut c implies q is Chain of G )
assume that
A1: 1 <= m and
A2: m <= n and
A3: n <= len c ; ::_thesis: ( not q = (m,n) -cut c or q is Chain of G )
A4: m <= n + 1 by A2, NAT_1:12;
consider vs being FinSequence of the carrier of G such that
A5: vs is_vertex_seq_of c by Th33;
set p9 = (m,(n + 1)) -cut vs;
A6: now__::_thesis:_for_k_being_Element_of_NAT_st_1_<=_k_&_k_<=_len_((m,(n_+_1))_-cut_vs)_holds_
((m,(n_+_1))_-cut_vs)_._k_in_the_carrier_of_G
let k be Element of NAT ; ::_thesis: ( 1 <= k & k <= len ((m,(n + 1)) -cut vs) implies ((m,(n + 1)) -cut vs) . k in the carrier of G )
assume that
A7: 1 <= k and
A8: k <= len ((m,(n + 1)) -cut vs) ; ::_thesis: ((m,(n + 1)) -cut vs) . k in the carrier of G
k in dom ((m,(n + 1)) -cut vs) by A7, A8, FINSEQ_3:25;
then A9: ((m,(n + 1)) -cut vs) . k in rng ((m,(n + 1)) -cut vs) by FUNCT_1:def_3;
A10: rng vs c= the carrier of G by FINSEQ_1:def_4;
rng ((m,(n + 1)) -cut vs) c= rng vs by Th11;
then ((m,(n + 1)) -cut vs) . k in rng vs by A9;
hence ((m,(n + 1)) -cut vs) . k in the carrier of G by A10; ::_thesis: verum
end;
assume A11: q = (m,n) -cut c ; ::_thesis: q is Chain of G
then A12: ((len q) + m) - m = (n + 1) - m by A1, A3, A4, Lm2;
A13: len vs = (len c) + 1 by A5, Def6;
then A14: n + 1 <= len vs by A3, XREAL_1:6;
then A15: ((len ((m,(n + 1)) -cut vs)) + m) - m = ((n + 1) + 1) - m by A1, A4, Def1;
then A16: len ((m,(n + 1)) -cut vs) = ((n - m) + 1) + 1 ;
A17: now__::_thesis:_for_k_being_Element_of_NAT_st_1_<=_k_&_k_<=_len_q_holds_
ex_v1,_v2_being_Element_of_the_carrier_of_G_st_
(_v1_=_((m,(n_+_1))_-cut_vs)_._k_&_v2_=_((m,(n_+_1))_-cut_vs)_._(k_+_1)_&_q_._k_joins_v1,v2_)
1 - 1 <= m - 1 by A1, XREAL_1:9;
then m - 1 = m -' 1 by XREAL_0:def_2;
then reconsider m1 = m - 1 as Element of NAT ;
let k be Element of NAT ; ::_thesis: ( 1 <= k & k <= len q implies ex v1, v2 being Element of the carrier of G st
( v1 = ((m,(n + 1)) -cut vs) . k & v2 = ((m,(n + 1)) -cut vs) . (k + 1) & q . k joins v1,v2 ) )
reconsider i = m1 + k as Element of NAT ;
assume that
A18: 1 <= k and
A19: k <= len q ; ::_thesis: ex v1, v2 being Element of the carrier of G st
( v1 = ((m,(n + 1)) -cut vs) . k & v2 = ((m,(n + 1)) -cut vs) . (k + 1) & q . k joins v1,v2 )
0 + 1 <= k by A18;
then consider j being Element of NAT such that
0 <= j and
A20: j < len q and
A21: k = j + 1 by A19, Th1;
A22: j + 1 < len ((m,(n + 1)) -cut vs) by A12, A16, A20, XREAL_1:6;
i + 1 = m + (j + 1) by A21;
then A23: ((m,(n + 1)) -cut vs) . (k + 1) = vs . (i + 1) by A1, A4, A14, A22, Def1;
set v2 = vs /. (i + 1);
set v1 = vs /. i;
A24: 1 <= i + 1 by NAT_1:12;
A25: i = m + j by A21;
j < len ((m,(n + 1)) -cut vs) by A12, A16, A20, NAT_1:13;
then A26: ((m,(n + 1)) -cut vs) . k = vs . i by A1, A4, A14, A25, A22, Def1;
i <= (m - 1) + (n - (m - 1)) by A12, A19, XREAL_1:6;
then A27: i <= len c by A3, XXREAL_0:2;
then A28: i <= len vs by A13, NAT_1:12;
take v1 = vs /. i; ::_thesis: ex v2 being Element of the carrier of G st
( v1 = ((m,(n + 1)) -cut vs) . k & v2 = ((m,(n + 1)) -cut vs) . (k + 1) & q . k joins v1,v2 )
take v2 = vs /. (i + 1); ::_thesis: ( v1 = ((m,(n + 1)) -cut vs) . k & v2 = ((m,(n + 1)) -cut vs) . (k + 1) & q . k joins v1,v2 )
A29: i + 1 <= len vs by A13, A27, XREAL_1:7;
1 - 1 <= m - 1 by A1, XREAL_1:9;
then A30: 0 + 1 <= (m - 1) + k by A18, XREAL_1:7;
then c . i joins v1,v2 by A5, A27, Def6;
hence ( v1 = ((m,(n + 1)) -cut vs) . k & v2 = ((m,(n + 1)) -cut vs) . (k + 1) & q . k joins v1,v2 ) by A1, A3, A11, A4, A20, A21, A25, A30, A28, A24, A29, A26, A23, Lm2, FINSEQ_4:15; ::_thesis: verum
end;
thus q is Chain of G ::_thesis: verum
proof
hereby :: according to GRAPH_1:def_14 ::_thesis: ex b1 being set st
( len b1 = (len q) + 1 & ( for b2 being Element of NAT holds
( not 1 <= b2 or not b2 <= len b1 or b1 . b2 in the carrier of G ) ) & ( for b2 being Element of NAT holds
( not 1 <= b2 or not b2 <= len q or ex b3, b4 being Element of the carrier of G st
( b3 = b1 . b2 & b4 = b1 . (b2 + 1) & q . b2 joins b3,b4 ) ) ) )
let k be Element of NAT ; ::_thesis: ( 1 <= k & k <= len q implies q . k in the carrier' of G )
assume that
A31: 1 <= k and
A32: k <= len q ; ::_thesis: q . k in the carrier' of G
k in dom q by A31, A32, FINSEQ_3:25;
then A33: q . k in rng q by FUNCT_1:def_3;
rng q c= rng c by A11, Th11;
then A34: q . k in rng c by A33;
rng c c= the carrier' of G by FINSEQ_1:def_4;
hence q . k in the carrier' of G by A34; ::_thesis: verum
end;
take (m,(n + 1)) -cut vs ; ::_thesis: ( len ((m,(n + 1)) -cut vs) = (len q) + 1 & ( for b1 being Element of NAT holds
( not 1 <= b1 or not b1 <= len ((m,(n + 1)) -cut vs) or ((m,(n + 1)) -cut vs) . b1 in the carrier of G ) ) & ( for b1 being Element of NAT holds
( not 1 <= b1 or not b1 <= len q or ex b2, b3 being Element of the carrier of G st
( b2 = ((m,(n + 1)) -cut vs) . b1 & b3 = ((m,(n + 1)) -cut vs) . (b1 + 1) & q . b1 joins b2,b3 ) ) ) )
thus len ((m,(n + 1)) -cut vs) = (len q) + 1 by A12, A15; ::_thesis: ( ( for b1 being Element of NAT holds
( not 1 <= b1 or not b1 <= len ((m,(n + 1)) -cut vs) or ((m,(n + 1)) -cut vs) . b1 in the carrier of G ) ) & ( for b1 being Element of NAT holds
( not 1 <= b1 or not b1 <= len q or ex b2, b3 being Element of the carrier of G st
( b2 = ((m,(n + 1)) -cut vs) . b1 & b3 = ((m,(n + 1)) -cut vs) . (b1 + 1) & q . b1 joins b2,b3 ) ) ) )
thus for n being Element of NAT st 1 <= n & n <= len ((m,(n + 1)) -cut vs) holds
((m,(n + 1)) -cut vs) . n in the carrier of G by A6; ::_thesis: for b1 being Element of NAT holds
( not 1 <= b1 or not b1 <= len q or ex b2, b3 being Element of the carrier of G st
( b2 = ((m,(n + 1)) -cut vs) . b1 & b3 = ((m,(n + 1)) -cut vs) . (b1 + 1) & q . b1 joins b2,b3 ) )
thus for b1 being Element of NAT holds
( not 1 <= b1 or not b1 <= len q or ex b2, b3 being Element of the carrier of G st
( b2 = ((m,(n + 1)) -cut vs) . b1 & b3 = ((m,(n + 1)) -cut vs) . (b1 + 1) & q . b1 joins b2,b3 ) ) by A17; ::_thesis: verum
end;
end;
theorem Th42: :: GRAPH_2:42
for m, n being Element of NAT
for G being Graph
for vs, vs1 being FinSequence of the carrier of G
for c, c1 being Chain of G st 1 <= m & m <= n & n <= len c & c1 = (m,n) -cut c & vs is_vertex_seq_of c & vs1 = (m,(n + 1)) -cut vs holds
vs1 is_vertex_seq_of c1
proof
let m, n be Element of NAT ; ::_thesis: for G being Graph
for vs, vs1 being FinSequence of the carrier of G
for c, c1 being Chain of G st 1 <= m & m <= n & n <= len c & c1 = (m,n) -cut c & vs is_vertex_seq_of c & vs1 = (m,(n + 1)) -cut vs holds
vs1 is_vertex_seq_of c1
let G be Graph; ::_thesis: for vs, vs1 being FinSequence of the carrier of G
for c, c1 being Chain of G st 1 <= m & m <= n & n <= len c & c1 = (m,n) -cut c & vs is_vertex_seq_of c & vs1 = (m,(n + 1)) -cut vs holds
vs1 is_vertex_seq_of c1
let vs, vs1 be FinSequence of the carrier of G; ::_thesis: for c, c1 being Chain of G st 1 <= m & m <= n & n <= len c & c1 = (m,n) -cut c & vs is_vertex_seq_of c & vs1 = (m,(n + 1)) -cut vs holds
vs1 is_vertex_seq_of c1
let c, c1 be Chain of G; ::_thesis: ( 1 <= m & m <= n & n <= len c & c1 = (m,n) -cut c & vs is_vertex_seq_of c & vs1 = (m,(n + 1)) -cut vs implies vs1 is_vertex_seq_of c1 )
assume that
A1: 1 <= m and
A2: m <= n and
A3: n <= len c ; ::_thesis: ( not c1 = (m,n) -cut c or not vs is_vertex_seq_of c or not vs1 = (m,(n + 1)) -cut vs or vs1 is_vertex_seq_of c1 )
A4: m <= n + 1 by A2, NAT_1:12;
assume A5: c1 = (m,n) -cut c ; ::_thesis: ( not vs is_vertex_seq_of c or not vs1 = (m,(n + 1)) -cut vs or vs1 is_vertex_seq_of c1 )
then A6: (len c1) + m = n + 1 by A1, A3, A4, Lm2;
assume that
A7: vs is_vertex_seq_of c and
A8: vs1 = (m,(n + 1)) -cut vs ; ::_thesis: vs1 is_vertex_seq_of c1
A9: len vs = (len c) + 1 by A7, Def6;
then A10: n + 1 <= len vs by A3, XREAL_1:6;
then (len vs1) + m = (n + 1) + 1 by A1, A8, A4, Def1;
hence A11: len vs1 = (len c1) + 1 by A6; :: according to GRAPH_2:def_6 ::_thesis: for n being Element of NAT st 1 <= n & n <= len c1 holds
c1 . n joins vs1 /. n,vs1 /. (n + 1)
let k be Element of NAT ; ::_thesis: ( 1 <= k & k <= len c1 implies c1 . k joins vs1 /. k,vs1 /. (k + 1) )
assume that
A12: 1 <= k and
A13: k <= len c1 ; ::_thesis: c1 . k joins vs1 /. k,vs1 /. (k + 1)
0 + 1 <= k by A12;
then consider j being Element of NAT such that
0 <= j and
A14: j < len c1 and
A15: k = j + 1 by A13, Th1;
set i = m + j;
j < len vs1 by A11, A14, NAT_1:13;
then A16: vs1 . k = vs . (m + j) by A1, A8, A4, A10, A15, Def1;
m + k <= (len c1) + m by A13, XREAL_1:7;
then ((m + j) + 1) - 1 <= ((len c1) + m) - 1 by A15, XREAL_1:9;
then A17: m + j <= len c by A3, A6, XXREAL_0:2;
then m + j <= len vs by A9, NAT_1:12;
then A18: vs /. (m + j) = vs . (m + j) by A1, FINSEQ_4:15, NAT_1:12;
A19: k <= len c1 by A14, A15, NAT_1:13;
then A20: k <= len vs1 by A11, NAT_1:12;
1 <= k + 1 by NAT_1:12;
then A21: vs1 /. (k + 1) = vs1 . (k + 1) by A11, A19, FINSEQ_4:15, XREAL_1:7;
0 + 1 = 1 ;
then 1 <= k by A15, NAT_1:13;
then A22: vs1 /. k = vs1 . k by A20, FINSEQ_4:15;
set v2 = vs /. ((m + j) + 1);
set v1 = vs /. (m + j);
A23: (m + j) + 1 = m + (j + 1) ;
1 <= m + j by A1, NAT_1:12;
then A24: c . (m + j) joins vs /. (m + j),vs /. ((m + j) + 1) by A7, A17, Def6;
1 <= (m + j) + 1 by NAT_1:12;
then A25: vs /. ((m + j) + 1) = vs . ((m + j) + 1) by A9, A17, FINSEQ_4:15, XREAL_1:7;
j + 1 < len vs1 by A11, A14, XREAL_1:6;
then vs1 . (k + 1) = vs . ((m + j) + 1) by A1, A8, A4, A10, A15, A23, Def1;
hence c1 . k joins vs1 /. k,vs1 /. (k + 1) by A1, A3, A5, A4, A14, A15, A24, A16, A18, A25, A22, A21, Lm2; ::_thesis: verum
end;
theorem Th43: :: GRAPH_2:43
for G being Graph
for vs1, vs2 being FinSequence of the carrier of G
for c1, c2 being Chain of G st vs1 is_vertex_seq_of c1 & vs2 is_vertex_seq_of c2 & vs1 . (len vs1) = vs2 . 1 holds
c1 ^ c2 is Chain of G
proof
let G be Graph; ::_thesis: for vs1, vs2 being FinSequence of the carrier of G
for c1, c2 being Chain of G st vs1 is_vertex_seq_of c1 & vs2 is_vertex_seq_of c2 & vs1 . (len vs1) = vs2 . 1 holds
c1 ^ c2 is Chain of G
let vs1, vs2 be FinSequence of the carrier of G; ::_thesis: for c1, c2 being Chain of G st vs1 is_vertex_seq_of c1 & vs2 is_vertex_seq_of c2 & vs1 . (len vs1) = vs2 . 1 holds
c1 ^ c2 is Chain of G
let c1, c2 be Chain of G; ::_thesis: ( vs1 is_vertex_seq_of c1 & vs2 is_vertex_seq_of c2 & vs1 . (len vs1) = vs2 . 1 implies c1 ^ c2 is Chain of G )
assume that
A1: vs1 is_vertex_seq_of c1 and
A2: vs2 is_vertex_seq_of c2 and
A3: vs1 . (len vs1) = vs2 . 1 ; ::_thesis: c1 ^ c2 is Chain of G
set q = c1 ^ c2;
set p = vs1 ^' vs2;
A4: len vs2 = (len c2) + 1 by A2, Def6;
then vs2 <> {} ;
then A5: (len (vs1 ^' vs2)) + 1 = (len vs1) + (len vs2) by Th13;
A6: now__::_thesis:_for_n_being_Element_of_NAT_st_1_<=_n_&_n_<=_len_(vs1_^'_vs2)_holds_
(vs1_^'_vs2)_._n_in_the_carrier_of_G
let n be Element of NAT ; ::_thesis: ( 1 <= n & n <= len (vs1 ^' vs2) implies (vs1 ^' vs2) . b1 in the carrier of G )
assume that
A7: 1 <= n and
A8: n <= len (vs1 ^' vs2) ; ::_thesis: (vs1 ^' vs2) . b1 in the carrier of G
percases ( n <= len vs1 or n > len vs1 ) ;
supposeA9: n <= len vs1 ; ::_thesis: (vs1 ^' vs2) . b1 in the carrier of G
then A10: n in dom vs1 by A7, FINSEQ_3:25;
(vs1 ^' vs2) . n = vs1 . n by A7, A9, Th14;
hence (vs1 ^' vs2) . n in the carrier of G by A10, FINSEQ_2:11; ::_thesis: verum
end;
supposeA11: n > len vs1 ; ::_thesis: (vs1 ^' vs2) . b1 in the carrier of G
then consider m being Nat such that
A12: n = (len vs1) + m by NAT_1:10;
reconsider m = m as Element of NAT by ORDINAL1:def_12;
m <> 0 by A11, A12;
then A13: 0 + 1 <= m by NAT_1:13;
(len vs1) + m <= (len vs1) + ((len vs2) - 1) by A5, A8, A12;
then m <= (len vs2) - 1 by XREAL_1:6;
then A14: m + 1 <= ((len vs2) - 1) + 1 by XREAL_1:6;
1 <= m + 1 by NAT_1:12;
then A15: m + 1 in dom vs2 by A14, FINSEQ_3:25;
m < len vs2 by A14, NAT_1:13;
then (vs1 ^' vs2) . ((len vs1) + m) = vs2 . (m + 1) by A13, Th15;
hence (vs1 ^' vs2) . n in the carrier of G by A12, A15, FINSEQ_2:11; ::_thesis: verum
end;
end;
end;
A16: len vs1 = (len c1) + 1 by A1, Def6;
A17: now__::_thesis:_for_n_being_Element_of_NAT_st_1_<=_n_&_n_<=_len_(c1_^_c2)_holds_
ex_v1,_v2_being_Element_of_G_st_
(_v1_=_(vs1_^'_vs2)_._n_&_v2_=_(vs1_^'_vs2)_._(n_+_1)_&_(c1_^_c2)_._n_joins_v1,v2_)
let n be Element of NAT ; ::_thesis: ( 1 <= n & n <= len (c1 ^ c2) implies ex v1, v2 being Element of G st
( v2 = (vs1 ^' vs2) . v1 & b3 = (vs1 ^' vs2) . (v1 + 1) & (c1 ^ c2) . v1 joins v2,b3 ) )
assume that
A18: 1 <= n and
A19: n <= len (c1 ^ c2) ; ::_thesis: ex v1, v2 being Element of G st
( v2 = (vs1 ^' vs2) . v1 & b3 = (vs1 ^' vs2) . (v1 + 1) & (c1 ^ c2) . v1 joins v2,b3 )
A20: n in dom (c1 ^ c2) by A18, A19, FINSEQ_3:25;
percases ( n in dom c1 or ex k being Nat st
( k in dom c2 & n = (len c1) + k ) ) by A20, FINSEQ_1:25;
supposeA21: n in dom c1 ; ::_thesis: ex v1, v2 being Element of G st
( v2 = (vs1 ^' vs2) . v1 & b3 = (vs1 ^' vs2) . (v1 + 1) & (c1 ^ c2) . v1 joins v2,b3 )
set v2 = vs1 /. (n + 1);
set v1 = vs1 /. n;
A22: (c1 ^ c2) . n = c1 . n by A21, FINSEQ_1:def_7;
A23: 1 <= n by A21, FINSEQ_3:25;
A24: n <= len c1 by A21, FINSEQ_3:25;
then n + 1 <= (len c1) + 1 by XREAL_1:6;
then A25: n + 1 <= len vs1 by A1, Def6;
then A26: vs1 /. (n + 1) = vs1 . (n + 1) by FINSEQ_4:15, NAT_1:12;
A27: n <= len vs1 by A16, A24, NAT_1:12;
then A28: vs1 /. n = vs1 . n by A23, FINSEQ_4:15;
A29: (vs1 ^' vs2) . (n + 1) = vs1 . (n + 1) by A25, Th14, NAT_1:12;
A30: (vs1 ^' vs2) . n = vs1 . n by A23, A27, Th14;
c1 . n joins vs1 /. n,vs1 /. (n + 1) by A1, A23, A24, Def6;
hence ex v1, v2 being Element of G st
( v1 = (vs1 ^' vs2) . n & v2 = (vs1 ^' vs2) . (n + 1) & (c1 ^ c2) . n joins v1,v2 ) by A22, A28, A26, A30, A29; ::_thesis: verum
end;
suppose ex k being Nat st
( k in dom c2 & n = (len c1) + k ) ; ::_thesis: ex v1, v2 being Element of G st
( v2 = (vs1 ^' vs2) . v1 & b3 = (vs1 ^' vs2) . (v1 + 1) & (c1 ^ c2) . v1 joins v2,b3 )
then consider k being Nat such that
A31: k in dom c2 and
A32: n = (len c1) + k ;
A33: (c1 ^ c2) . n = c2 . k by A31, A32, FINSEQ_1:def_7;
A34: 1 <= k + 1 by NAT_1:12;
A35: 1 <= k by A31, FINSEQ_3:25;
A36: k <= len c2 by A31, FINSEQ_3:25;
then A37: k <= len vs2 by A4, NAT_1:12;
reconsider k = k as Element of NAT by A31;
A38: 0 + 1 <= k by A31, FINSEQ_3:25;
A39: vs2 /. (k + 1) = vs2 . (k + 1) by A4, A36, A34, FINSEQ_4:15, XREAL_1:7;
A40: k < len vs2 by A4, A36, NAT_1:13;
k <= len vs2 by A4, A36, NAT_1:12;
then consider j being Element of NAT such that
0 <= j and
A41: j < len vs2 and
A42: k = j + 1 by A38, Th1;
A43: (vs1 ^' vs2) . n = vs2 . k
proof
percases ( 1 = k or 1 < k ) by A35, XXREAL_0:1;
supposeA44: 1 = k ; ::_thesis: (vs1 ^' vs2) . n = vs2 . k
0 + 1 <= len vs1 by A16, NAT_1:13;
hence (vs1 ^' vs2) . n = vs2 . k by A3, A16, A32, A44, Th14; ::_thesis: verum
end;
suppose 1 < k ; ::_thesis: (vs1 ^' vs2) . n = vs2 . k
then A45: 1 <= j by A42, NAT_1:13;
thus (vs1 ^' vs2) . n = (vs1 ^' vs2) . ((len vs1) + j) by A16, A32, A42
.= vs2 . k by A41, A42, A45, Th15 ; ::_thesis: verum
end;
end;
end;
set v2 = vs2 /. (k + 1);
set v1 = vs2 /. k;
A46: c2 . k joins vs2 /. k,vs2 /. (k + 1) by A2, A35, A36, Def6;
A47: vs2 /. k = vs2 . k by A35, A37, FINSEQ_4:15;
(vs1 ^' vs2) . (n + 1) = (vs1 ^' vs2) . (((len c1) + 1) + k) by A32
.= vs2 . (k + 1) by A16, A35, A40, Th15 ;
hence ex v1, v2 being Element of G st
( v1 = (vs1 ^' vs2) . n & v2 = (vs1 ^' vs2) . (n + 1) & (c1 ^ c2) . n joins v1,v2 ) by A33, A47, A39, A46, A43; ::_thesis: verum
end;
end;
end;
A48: len (vs1 ^' vs2) = ((len c1) + (len c2)) + 1 by A16, A4, A5
.= (len (c1 ^ c2)) + 1 by FINSEQ_1:22 ;
thus c1 ^ c2 is Chain of G ::_thesis: verum
proof
hereby :: according to GRAPH_1:def_14 ::_thesis: ex b1 being set st
( len b1 = (len (c1 ^ c2)) + 1 & ( for b2 being Element of NAT holds
( not 1 <= b2 or not b2 <= len b1 or b1 . b2 in the carrier of G ) ) & ( for b2 being Element of NAT holds
( not 1 <= b2 or not b2 <= len (c1 ^ c2) or ex b3, b4 being Element of the carrier of G st
( b3 = b1 . b2 & b4 = b1 . (b2 + 1) & (c1 ^ c2) . b2 joins b3,b4 ) ) ) )
let n be Element of NAT ; ::_thesis: ( 1 <= n & n <= len (c1 ^ c2) implies (c1 ^ c2) . b1 in the carrier' of G )
assume that
A49: 1 <= n and
A50: n <= len (c1 ^ c2) ; ::_thesis: (c1 ^ c2) . b1 in the carrier' of G
A51: n in dom (c1 ^ c2) by A49, A50, FINSEQ_3:25;
percases ( n in dom c1 or ex k being Nat st
( k in dom c2 & n = (len c1) + k ) ) by A51, FINSEQ_1:25;
supposeA52: n in dom c1 ; ::_thesis: (c1 ^ c2) . b1 in the carrier' of G
then A53: (c1 ^ c2) . n = c1 . n by FINSEQ_1:def_7;
A54: n <= len c1 by A52, FINSEQ_3:25;
1 <= n by A52, FINSEQ_3:25;
hence (c1 ^ c2) . n in the carrier' of G by A54, A53, GRAPH_1:def_14; ::_thesis: verum
end;
suppose ex k being Nat st
( k in dom c2 & n = (len c1) + k ) ; ::_thesis: (c1 ^ c2) . b1 in the carrier' of G
then consider k being Nat such that
A55: k in dom c2 and
A56: n = (len c1) + k ;
A57: 1 <= k by A55, FINSEQ_3:25;
A58: k <= len c2 by A55, FINSEQ_3:25;
(c1 ^ c2) . n = c2 . k by A55, A56, FINSEQ_1:def_7;
hence (c1 ^ c2) . n in the carrier' of G by A55, A57, A58, GRAPH_1:def_14; ::_thesis: verum
end;
end;
end;
thus ex b1 being set st
( len b1 = (len (c1 ^ c2)) + 1 & ( for b2 being Element of NAT holds
( not 1 <= b2 or not b2 <= len b1 or b1 . b2 in the carrier of G ) ) & ( for b2 being Element of NAT holds
( not 1 <= b2 or not b2 <= len (c1 ^ c2) or ex b3, b4 being Element of the carrier of G st
( b3 = b1 . b2 & b4 = b1 . (b2 + 1) & (c1 ^ c2) . b2 joins b3,b4 ) ) ) ) by A48, A6, A17; ::_thesis: verum
end;
end;
theorem Th44: :: GRAPH_2:44
for G being Graph
for vs1, vs2, vs being FinSequence of the carrier of G
for c1, c2, c being Chain of G st vs1 is_vertex_seq_of c1 & vs2 is_vertex_seq_of c2 & vs1 . (len vs1) = vs2 . 1 & c = c1 ^ c2 & vs = vs1 ^' vs2 holds
vs is_vertex_seq_of c
proof
let G be Graph; ::_thesis: for vs1, vs2, vs being FinSequence of the carrier of G
for c1, c2, c being Chain of G st vs1 is_vertex_seq_of c1 & vs2 is_vertex_seq_of c2 & vs1 . (len vs1) = vs2 . 1 & c = c1 ^ c2 & vs = vs1 ^' vs2 holds
vs is_vertex_seq_of c
let vs1, vs2, vs be FinSequence of the carrier of G; ::_thesis: for c1, c2, c being Chain of G st vs1 is_vertex_seq_of c1 & vs2 is_vertex_seq_of c2 & vs1 . (len vs1) = vs2 . 1 & c = c1 ^ c2 & vs = vs1 ^' vs2 holds
vs is_vertex_seq_of c
let c1, c2, c be Chain of G; ::_thesis: ( vs1 is_vertex_seq_of c1 & vs2 is_vertex_seq_of c2 & vs1 . (len vs1) = vs2 . 1 & c = c1 ^ c2 & vs = vs1 ^' vs2 implies vs is_vertex_seq_of c )
assume that
A1: vs1 is_vertex_seq_of c1 and
A2: vs2 is_vertex_seq_of c2 and
A3: vs1 . (len vs1) = vs2 . 1 ; ::_thesis: ( not c = c1 ^ c2 or not vs = vs1 ^' vs2 or vs is_vertex_seq_of c )
set p = vs1 ^' vs2;
set q = c1 ^ c2;
assume that
A4: c = c1 ^ c2 and
A5: vs = vs1 ^' vs2 ; ::_thesis: vs is_vertex_seq_of c
A6: len vs1 = (len c1) + 1 by A1, Def6;
A7: len vs2 = (len c2) + 1 by A2, Def6;
then vs2 <> {} ;
then (len (vs1 ^' vs2)) + 1 = (len vs1) + (len vs2) by Th13;
then A8: len (vs1 ^' vs2) = ((len c1) + (len c2)) + 1 by A6, A7
.= (len (c1 ^ c2)) + 1 by FINSEQ_1:22 ;
reconsider p = vs1 ^' vs2 as FinSequence of the carrier of G ;
now__::_thesis:_for_n_being_Element_of_NAT_st_1_<=_n_&_n_<=_len_(c1_^_c2)_holds_
(c1_^_c2)_._n_joins_p_/._n,p_/._(n_+_1)
let n be Element of NAT ; ::_thesis: ( 1 <= n & n <= len (c1 ^ c2) implies (c1 ^ c2) . b1 joins p /. b1,p /. (b1 + 1) )
assume that
A9: 1 <= n and
A10: n <= len (c1 ^ c2) ; ::_thesis: (c1 ^ c2) . b1 joins p /. b1,p /. (b1 + 1)
A11: n in dom (c1 ^ c2) by A9, A10, FINSEQ_3:25;
n <= len p by A8, A10, NAT_1:12;
then A12: p /. n = p . n by A9, FINSEQ_4:15;
1 <= n + 1 by NAT_1:12;
then A13: p /. (n + 1) = p . (n + 1) by A8, A10, FINSEQ_4:15, XREAL_1:7;
percases ( n in dom c1 or ex k being Nat st
( k in dom c2 & n = (len c1) + k ) ) by A11, FINSEQ_1:25;
supposeA14: n in dom c1 ; ::_thesis: (c1 ^ c2) . b1 joins p /. b1,p /. (b1 + 1)
set v2 = vs1 /. (n + 1);
set v1 = vs1 /. n;
A15: 1 <= n by A14, FINSEQ_3:25;
A16: n <= len c1 by A14, FINSEQ_3:25;
then n + 1 <= (len c1) + 1 by XREAL_1:6;
then A17: n + 1 <= len vs1 by A1, Def6;
then A18: vs1 /. (n + 1) = vs1 . (n + 1) by FINSEQ_4:15, NAT_1:12;
A19: n <= len vs1 by A6, A16, NAT_1:12;
then A20: vs1 /. n = vs1 . n by A15, FINSEQ_4:15;
A21: p . (n + 1) = vs1 . (n + 1) by A17, Th14, NAT_1:12;
A22: p . n = vs1 . n by A15, A19, Th14;
c1 . n joins vs1 /. n,vs1 /. (n + 1) by A1, A15, A16, Def6;
hence (c1 ^ c2) . n joins p /. n,p /. (n + 1) by A12, A13, A14, A20, A18, A22, A21, FINSEQ_1:def_7; ::_thesis: verum
end;
suppose ex k being Nat st
( k in dom c2 & n = (len c1) + k ) ; ::_thesis: (c1 ^ c2) . b1 joins p /. b1,p /. (b1 + 1)
then consider k being Element of NAT such that
A23: k in dom c2 and
A24: n = (len c1) + k ;
A25: 0 + 1 <= k by A23, FINSEQ_3:25;
set v2 = vs2 /. (k + 1);
set v1 = vs2 /. k;
A26: k <= len c2 by A23, FINSEQ_3:25;
then A27: k < len vs2 by A7, NAT_1:13;
A28: 1 <= k by A23, FINSEQ_3:25;
then A29: c2 . k joins vs2 /. k,vs2 /. (k + 1) by A2, A26, Def6;
k <= len vs2 by A7, A26, NAT_1:12;
then consider j being Element of NAT such that
0 <= j and
A30: j < len vs2 and
A31: k = j + 1 by A25, Th1;
A32: p . n = vs2 . k
proof
percases ( 1 = k or 1 < k ) by A28, XXREAL_0:1;
supposeA33: 1 = k ; ::_thesis: p . n = vs2 . k
0 + 1 <= len vs1 by A6, NAT_1:13;
hence p . n = vs2 . k by A3, A6, A24, A33, Th14; ::_thesis: verum
end;
suppose 1 < k ; ::_thesis: p . n = vs2 . k
then A34: 1 <= j by A31, NAT_1:13;
thus p . n = p . ((len vs1) + j) by A6, A24, A31
.= vs2 . k by A30, A31, A34, Th15 ; ::_thesis: verum
end;
end;
end;
1 <= k + 1 by NAT_1:12;
then A35: vs2 /. (k + 1) = vs2 . (k + 1) by A7, A26, FINSEQ_4:15, XREAL_1:7;
k <= len vs2 by A7, A26, NAT_1:12;
then A36: vs2 /. k = vs2 . k by A28, FINSEQ_4:15;
p . (n + 1) = p . (((len c1) + 1) + k) by A24
.= vs2 . (k + 1) by A6, A28, A27, Th15 ;
hence (c1 ^ c2) . n joins p /. n,p /. (n + 1) by A12, A13, A23, A24, A36, A35, A29, A32, FINSEQ_1:def_7; ::_thesis: verum
end;
end;
end;
hence vs is_vertex_seq_of c by A4, A5, A8, Def6; ::_thesis: verum
end;
begin
Lm8: for G being Graph
for v being Element of G holds <*v*> is_vertex_seq_of {}
proof
let G be Graph; ::_thesis: for v being Element of G holds <*v*> is_vertex_seq_of {}
let v be Element of G; ::_thesis: <*v*> is_vertex_seq_of {}
set p = <*v*>;
set ec = {} ;
A1: for n being Element of NAT st 1 <= n & n <= len {} holds
{} . n joins <*v*> /. n,<*v*> /. (n + 1) ;
len <*v*> = 0 + 1 by FINSEQ_1:39
.= (len {}) + 1 ;
hence <*v*> is_vertex_seq_of {} by A1, Def6; ::_thesis: verum
end;
definition
let G be Graph;
let IT be Chain of G;
attrIT is simple means :Def9: :: GRAPH_2:def 9
ex vs being FinSequence of the carrier of G st
( vs is_vertex_seq_of IT & ( for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs ) ) );
end;
:: deftheorem Def9 defines simple GRAPH_2:def_9_:_
for G being Graph
for IT being Chain of G holds
( IT is simple iff ex vs being FinSequence of the carrier of G st
( vs is_vertex_seq_of IT & ( for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs ) ) ) );
registration
let G be Graph;
cluster Relation-like NAT -defined the carrier' of G -valued Function-like finite FinSequence-like FinSubsequence-like simple for Chain of G;
existence
ex b1 being Chain of G st b1 is simple
proof
set x = the Element of G;
set q = the empty Chain of G;
take the empty Chain of G ; ::_thesis: the empty Chain of G is simple
reconsider p = <* the Element of G*> as FinSequence of the carrier of G ;
take p ; :: according to GRAPH_2:def_9 ::_thesis: ( p is_vertex_seq_of the empty Chain of G & ( for n, m being Element of NAT st 1 <= n & n < m & m <= len p & p . n = p . m holds
( n = 1 & m = len p ) ) )
thus p is_vertex_seq_of the empty Chain of G by Lm8; ::_thesis: for n, m being Element of NAT st 1 <= n & n < m & m <= len p & p . n = p . m holds
( n = 1 & m = len p )
let n, m be Element of NAT ; ::_thesis: ( 1 <= n & n < m & m <= len p & p . n = p . m implies ( n = 1 & m = len p ) )
assume that
A1: 1 <= n and
A2: n < m and
A3: m <= len p and
p . n = p . m ; ::_thesis: ( n = 1 & m = len p )
1 < m by A1, A2, XXREAL_0:2;
hence ( n = 1 & m = len p ) by A3, FINSEQ_1:39; ::_thesis: verum
end;
end;
theorem :: GRAPH_2:45
for n being Element of NAT
for G being Graph
for sc being simple Chain of G holds sc | (Seg n) is simple Chain of G
proof
let n be Element of NAT ; ::_thesis: for G being Graph
for sc being simple Chain of G holds sc | (Seg n) is simple Chain of G
let G be Graph; ::_thesis: for sc being simple Chain of G holds sc | (Seg n) is simple Chain of G
let sc be simple Chain of G; ::_thesis: sc | (Seg n) is simple Chain of G
reconsider q9 = sc | (Seg n) as Chain of G by GRAPH_1:4;
consider vs being FinSequence of the carrier of G such that
A1: vs is_vertex_seq_of sc and
A2: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs ) by Def9;
reconsider p9 = vs | (Seg (n + 1)) as FinSequence of the carrier of G by FINSEQ_1:18;
now__::_thesis:_ex_p9_being_FinSequence_of_the_carrier_of_G_st_
(_p9_is_vertex_seq_of_q9_&_(_for_k,_m_being_Element_of_NAT_st_1_<=_k_&_k_<_m_&_m_<=_len_p9_&_p9_._k_=_p9_._m_holds_
(_k_=_1_&_m_=_len_p9_)_)_)
take p9 = p9; ::_thesis: ( p9 is_vertex_seq_of q9 & ( for k, m being Element of NAT st 1 <= k & k < m & m <= len p9 & p9 . k = p9 . m holds
( k = 1 & m = len p9 ) ) )
thus p9 is_vertex_seq_of q9 by A1, Th40; ::_thesis: for k, m being Element of NAT st 1 <= k & k < m & m <= len p9 & p9 . k = p9 . m holds
( k = 1 & m = len p9 )
let k, m be Element of NAT ; ::_thesis: ( 1 <= k & k < m & m <= len p9 & p9 . k = p9 . m implies ( k = 1 & m = len p9 ) )
assume that
A3: 1 <= k and
A4: k < m and
A5: m <= len p9 and
A6: p9 . k = p9 . m ; ::_thesis: ( k = 1 & m = len p9 )
k <= len p9 by A4, A5, XXREAL_0:2;
then A7: p9 . k = vs . k by A3, Th2;
1 <= m by A3, A4, XXREAL_0:2;
then A8: p9 . m = vs . m by A5, Th2;
A9: len p9 <= len vs by Th2;
then A10: m <= len vs by A5, XXREAL_0:2;
hence k = 1 by A2, A3, A4, A6, A7, A8; ::_thesis: m = len p9
( len p9 = len vs or len p9 < len vs ) by A9, XXREAL_0:1;
hence m = len p9 by A2, A3, A4, A5, A6, A7, A8, A10; ::_thesis: verum
end;
hence sc | (Seg n) is simple Chain of G by Def9; ::_thesis: verum
end;
theorem Th46: :: GRAPH_2:46
for G being Graph
for vs1, vs2 being FinSequence of the carrier of G
for sc being simple Chain of G st 2 < len sc & vs1 is_vertex_seq_of sc & vs2 is_vertex_seq_of sc holds
vs1 = vs2
proof
let G be Graph; ::_thesis: for vs1, vs2 being FinSequence of the carrier of G
for sc being simple Chain of G st 2 < len sc & vs1 is_vertex_seq_of sc & vs2 is_vertex_seq_of sc holds
vs1 = vs2
let vs1, vs2 be FinSequence of the carrier of G; ::_thesis: for sc being simple Chain of G st 2 < len sc & vs1 is_vertex_seq_of sc & vs2 is_vertex_seq_of sc holds
vs1 = vs2
let sc be simple Chain of G; ::_thesis: ( 2 < len sc & vs1 is_vertex_seq_of sc & vs2 is_vertex_seq_of sc implies vs1 = vs2 )
assume that
A1: 2 < len sc and
A2: vs1 is_vertex_seq_of sc and
A3: vs2 is_vertex_seq_of sc ; ::_thesis: vs1 = vs2
A4: len vs1 = (len sc) + 1 by A2, Def6;
defpred S1[ Nat] means ( $1 in dom vs1 & vs1 . $1 <> vs2 . $1 );
set TG = the Target of G;
set SG = the Source of G;
A5: Seg (len vs1) = dom vs1 by FINSEQ_1:def_3;
A6: Seg (len vs2) = dom vs2 by FINSEQ_1:def_3;
A7: len vs2 = (len sc) + 1 by A3, Def6;
assume A8: vs1 <> vs2 ; ::_thesis: contradiction
then A9: ex j being Nat st S1[j] by A4, A7, FINSEQ_2:9;
consider k being Nat such that
A10: S1[k] and
A11: for n being Nat st S1[n] holds
k <= n from NAT_1:sch_5(A9);
A12: 1 <= k by A10, FINSEQ_3:25;
percases ( k = 1 or 1 < k ) by A12, XXREAL_0:1;
supposeA13: k = 1 ; ::_thesis: contradiction
set v23 = vs2 /. ((1 + 1) + 1);
set v22 = vs2 /. (1 + 1);
set v21 = vs2 /. 1;
set v13 = vs1 /. ((1 + 1) + 1);
set v12 = vs1 /. (1 + 1);
set v11 = vs1 /. 1;
A14: (1 + 1) + 1 <= len vs1 by A1, A4, XREAL_1:6;
then A15: vs1 /. ((1 + 1) + 1) = vs1 . ((1 + 1) + 1) by FINSEQ_4:15;
A16: 1 <= len vs1 by A14, XXREAL_0:2;
then A17: vs1 /. 1 = vs1 . 1 by FINSEQ_4:15;
A18: 1 <= len sc by A1, XXREAL_0:2;
then A19: sc . 1 joins vs2 /. 1,vs2 /. (1 + 1) by A3, Def6;
sc . 1 joins vs1 /. 1,vs1 /. (1 + 1) by A2, A18, Def6;
then A20: ( ( vs1 /. 1 = vs2 /. 1 & vs1 /. (1 + 1) = vs2 /. (1 + 1) ) or ( vs1 /. 1 = vs2 /. (1 + 1) & vs1 /. (1 + 1) = vs2 /. 1 ) ) by A19, Th30;
A21: vs2 /. 1 = vs2 . 1 by A4, A7, A16, FINSEQ_4:15;
consider vs being FinSequence of the carrier of G such that
A22: vs is_vertex_seq_of sc and
A23: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs ) by Def9;
sc <> {} by A1;
then A24: ( vs = vs1 or vs = vs2 ) by A2, A3, A8, A22, Th34;
A25: vs2 /. ((1 + 1) + 1) = vs2 . ((1 + 1) + 1) by A4, A7, A14, FINSEQ_4:15;
A26: sc . 2 joins vs2 /. (1 + 1),vs2 /. ((1 + 1) + 1) by A1, A3, Def6;
A27: sc . 2 joins vs1 /. (1 + 1),vs1 /. ((1 + 1) + 1) by A1, A2, Def6;
then A28: vs2 /. 1 = vs2 /. ((1 + 1) + 1) by A10, A13, A17, A21, A26, A20, Th30;
vs1 /. 1 = vs1 /. ((1 + 1) + 1) by A10, A13, A17, A21, A27, A26, A20, Th30;
then (1 + 1) + 1 = len vs by A4, A7, A14, A17, A15, A21, A25, A28, A23, A24;
hence contradiction by A1, A4, A7, A24; ::_thesis: verum
end;
suppose 1 < k ; ::_thesis: contradiction
then 1 + 1 <= k by NAT_1:13;
then consider k1 being Element of NAT such that
A29: 1 <= k1 and
A30: k1 < k and
A31: k = k1 + 1 by Th1;
A32: k <= len vs1 by A10, FINSEQ_3:25;
then A33: k1 <= len vs1 by A30, XXREAL_0:2;
then A34: k1 in dom vs1 by A29, FINSEQ_3:25;
A35: vs1 /. k1 = vs1 . k1 by A29, A33, FINSEQ_4:15;
A36: vs2 /. k = vs2 . k by A4, A7, A5, A6, A10, PARTFUN1:def_6;
A37: vs1 /. k = vs1 . k by A10, PARTFUN1:def_6;
A38: k1 <= len sc by A4, A31, A32, XREAL_1:6;
then sc . k1 joins vs1 /. k1,vs1 /. (k1 + 1) by A2, A29, Def6;
then A39: ( ( the Source of G . (sc . k1) = vs1 /. k1 & the Target of G . (sc . k1) = vs1 /. k ) or ( the Source of G . (sc . k1) = vs1 /. k & the Target of G . (sc . k1) = vs1 /. k1 ) ) by A31, GRAPH_1:def_12;
sc . k1 joins vs2 /. k1,vs2 /. (k1 + 1) by A3, A29, A38, Def6;
then A40: ( ( the Source of G . (sc . k1) = vs2 /. k1 & the Target of G . (sc . k1) = vs2 /. k ) or ( the Source of G . (sc . k1) = vs2 /. k & the Target of G . (sc . k1) = vs2 /. k1 ) ) by A31, GRAPH_1:def_12;
vs2 /. k1 = vs2 . k1 by A4, A7, A29, A33, FINSEQ_4:15;
hence contradiction by A10, A11, A30, A34, A35, A37, A36, A39, A40; ::_thesis: verum
end;
end;
end;
theorem :: GRAPH_2:47
for G being Graph
for vs being FinSequence of the carrier of G
for sc being simple Chain of G st vs is_vertex_seq_of sc holds
for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs )
proof
let G be Graph; ::_thesis: for vs being FinSequence of the carrier of G
for sc being simple Chain of G st vs is_vertex_seq_of sc holds
for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs )
let vs be FinSequence of the carrier of G; ::_thesis: for sc being simple Chain of G st vs is_vertex_seq_of sc holds
for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs )
let sc be simple Chain of G; ::_thesis: ( vs is_vertex_seq_of sc implies for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs ) )
assume A1: vs is_vertex_seq_of sc ; ::_thesis: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs )
consider vs1 being FinSequence of the carrier of G such that
A2: vs1 is_vertex_seq_of sc and
A3: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs1 & vs1 . n = vs1 . m holds
( n = 1 & m = len vs1 ) by Def9;
percases ( len sc <= 2 or 2 < len sc ) ;
supposeA4: len sc <= 2 ; ::_thesis: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs )
thus for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs ) ::_thesis: verum
proof
percases ( len sc = 0 or len sc = 1 or len sc = 2 ) by A4, NAT_1:26;
supposeA5: len sc = 0 ; ::_thesis: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs )
let n, m be Element of NAT ; ::_thesis: ( 1 <= n & n < m & m <= len vs & vs . n = vs . m implies ( n = 1 & m = len vs ) )
len vs = 0 + 1 by A1, A5, Def6;
hence ( 1 <= n & n < m & m <= len vs & vs . n = vs . m implies ( n = 1 & m = len vs ) ) by XXREAL_0:2; ::_thesis: verum
end;
suppose len sc = 1 ; ::_thesis: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs )
then A6: len vs = 1 + 1 by A1, Def6;
let n, m be Element of NAT ; ::_thesis: ( 1 <= n & n < m & m <= len vs & vs . n = vs . m implies ( n = 1 & m = len vs ) )
assume that
A7: 1 <= n and
A8: n < m and
A9: m <= len vs and
vs . n = vs . m ; ::_thesis: ( n = 1 & m = len vs )
A10: n + 1 <= m by A8, NAT_1:13;
then n + 1 <= 1 + 1 by A6, A9, XXREAL_0:2;
then n <= 1 by XREAL_1:6;
then n = 1 by A7, XXREAL_0:1;
hence ( n = 1 & m = len vs ) by A6, A9, A10, XXREAL_0:1; ::_thesis: verum
end;
supposeA11: len sc = 2 ; ::_thesis: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs )
set v12 = vs1 /. (1 + 1);
set v2 = vs /. (1 + 1);
set v11 = vs1 /. 1;
A12: sc . 1 joins vs1 /. 1,vs1 /. (1 + 1) by A2, A11, Def6;
set v1 = vs /. 1;
sc . 1 joins vs /. 1,vs /. (1 + 1) by A1, A11, Def6;
then A13: ( ( vs /. 1 = vs1 /. 1 & vs /. (1 + 1) = vs1 /. (1 + 1) ) or ( vs /. 1 = vs1 /. (1 + 1) & vs /. (1 + 1) = vs1 /. 1 ) ) by A12, Th30;
A14: len vs = (1 + 1) + 1 by A1, A11, Def6;
then A15: vs /. (1 + 1) = vs . (1 + 1) by FINSEQ_4:15;
set v3 = vs /. ((1 + 1) + 1);
set v13 = vs1 /. ((1 + 1) + 1);
A16: sc . 2 joins vs1 /. (1 + 1),vs1 /. ((1 + 1) + 1) by A2, A11, Def6;
sc . 2 joins vs /. (1 + 1),vs /. ((1 + 1) + 1) by A1, A11, Def6;
then A17: ( ( vs /. (1 + 1) = vs1 /. (1 + 1) & vs /. ((1 + 1) + 1) = vs1 /. ((1 + 1) + 1) ) or ( vs /. (1 + 1) = vs1 /. ((1 + 1) + 1) & vs /. ((1 + 1) + 1) = vs1 /. (1 + 1) ) ) by A16, Th30;
A18: len vs1 = (1 + 1) + 1 by A2, A11, Def6;
then A19: vs1 /. 1 = vs1 . 1 by FINSEQ_4:15;
A20: vs1 /. ((1 + 1) + 1) = vs1 . ((1 + 1) + 1) by A18, FINSEQ_4:15;
A21: vs1 /. (1 + 1) = vs1 . (1 + 1) by A18, FINSEQ_4:15;
let n, m be Element of NAT ; ::_thesis: ( 1 <= n & n < m & m <= len vs & vs . n = vs . m implies ( n = 1 & m = len vs ) )
assume that
A22: 1 <= n and
A23: n < m and
A24: m <= len vs and
A25: vs . n = vs . m ; ::_thesis: ( n = 1 & m = len vs )
n + 1 <= m by A23, NAT_1:13;
then n + 1 <= (1 + 1) + 1 by A14, A24, XXREAL_0:2;
then A26: n <= 1 + 1 by XREAL_1:6;
A27: vs /. ((1 + 1) + 1) = vs . ((1 + 1) + 1) by A14, FINSEQ_4:15;
A28: vs /. 1 = vs . 1 by A14, FINSEQ_4:15;
thus ( n = 1 & m = len vs ) ::_thesis: verum
proof
percases ( n = 1 or n = 1 + 1 ) by A22, A26, NAT_1:9;
supposeA29: n = 1 ; ::_thesis: ( n = 1 & m = len vs )
1 < m by A22, A23, XXREAL_0:2;
then A30: 1 + 1 <= m by NAT_1:13;
thus ( n = 1 & m = len vs ) ::_thesis: verum
proof
percases ( m = 1 + 1 or m = (1 + 1) + 1 ) by A14, A24, A30, NAT_1:9;
suppose m = 1 + 1 ; ::_thesis: ( n = 1 & m = len vs )
hence ( n = 1 & m = len vs ) by A3, A18, A28, A15, A19, A21, A13, A25, A29; ::_thesis: verum
end;
suppose m = (1 + 1) + 1 ; ::_thesis: ( n = 1 & m = len vs )
hence ( n = 1 & m = len vs ) by A1, A11, A29, Def6; ::_thesis: verum
end;
end;
end;
end;
supposeA31: n = 1 + 1 ; ::_thesis: ( n = 1 & m = len vs )
then (1 + 1) + 1 <= m by A23, NAT_1:13;
then m = (1 + 1) + 1 by A14, A24, XXREAL_0:1;
hence ( n = 1 & m = len vs ) by A3, A18, A15, A27, A21, A20, A17, A25, A31; ::_thesis: verum
end;
end;
end;
end;
end;
end;
end;
suppose 2 < len sc ; ::_thesis: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs )
then vs = vs1 by A1, A2, Th46;
hence for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs ) by A3; ::_thesis: verum
end;
end;
end;
theorem Th48: :: GRAPH_2:48
for G being Graph
for vs being FinSequence of the carrier of G
for c being Chain of G st c is not simple Chain of G & vs is_vertex_seq_of c holds
ex fc being Subset of c ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
proof
let G be Graph; ::_thesis: for vs being FinSequence of the carrier of G
for c being Chain of G st c is not simple Chain of G & vs is_vertex_seq_of c holds
ex fc being Subset of c ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
let vs be FinSequence of the carrier of G; ::_thesis: for c being Chain of G st c is not simple Chain of G & vs is_vertex_seq_of c holds
ex fc being Subset of c ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
let c be Chain of G; ::_thesis: ( c is not simple Chain of G & vs is_vertex_seq_of c implies ex fc being Subset of c ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 ) )
assume that
A1: c is not simple Chain of G and
A2: vs is_vertex_seq_of c ; ::_thesis: ex fc being Subset of c ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
consider n, m being Element of NAT such that
A3: 1 <= n and
A4: n < m and
A5: m <= len vs and
A6: vs . n = vs . m and
A7: ( n <> 1 or m <> len vs ) by A1, A2, Def9;
A8: m - n > n - n by A4, XREAL_1:9;
A9: len vs = (len c) + 1 by A2, Def6;
reconsider n1 = n -' 1 as Element of NAT ;
A10: 1 - 1 <= n - 1 by A3, XREAL_1:9;
then A11: n - 1 = n -' 1 by XREAL_0:def_2;
then A12: n1 + 1 = n ;
percases ( ( n <> 1 & m <> len vs ) or ( n = 1 & m <> len vs ) or ( n <> 1 & m = len vs ) ) by A7;
supposeA13: ( n <> 1 & m <> len vs ) ; ::_thesis: ex fc being Subset of c ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
set DR = { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } ;
set DL = { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } ;
set domfvs = { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } ;
reconsider p2 = (m,((len c) + 1)) -cut vs as FinSequence of the carrier of G ;
reconsider pp = (1,n) -cut vs as FinSequence of the carrier of G ;
set p29 = ((m + 1),((len c) + 1)) -cut vs;
A14: 1 <= m + 1 by NAT_1:12;
A15: 1 <= m by A3, A4, XXREAL_0:2;
then 1 - 1 <= m - 1 by XREAL_1:9;
then m -' 1 = m - 1 by XREAL_0:def_2;
then reconsider m1 = m - 1 as Element of NAT ;
A16: m < len vs by A5, A13, XXREAL_0:1;
then A17: m <= len c by A9, NAT_1:13;
then reconsider c2 = (m,(len c)) -cut c as Chain of G by A15, Th41;
A18: (len c2) + m = (len c) + 1 by A15, A17, Def1;
deffunc H1( set ) -> set = c . $1;
set domfc = { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } ;
consider fc being Function such that
A19: dom fc = { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } and
A20: for x being set st x in { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } holds
fc . x = H1(x) from FUNCT_1:sch_3();
n < len vs by A4, A5, XXREAL_0:2;
then A21: n - 1 < ((len c) + 1) - 1 by A9, XREAL_1:9;
{ k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } c= Seg (len c)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } or x in Seg (len c) )
assume x in { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } ; ::_thesis: x in Seg (len c)
then consider kk being Element of NAT such that
A22: x = kk and
A23: ( ( 1 <= kk & kk <= n1 ) or ( m <= kk & kk <= len c ) ) ;
A24: 1 <= kk by A15, A23, XXREAL_0:2;
kk <= len c by A11, A21, A23, XXREAL_0:2;
hence x in Seg (len c) by A22, A24; ::_thesis: verum
end;
then reconsider fc = fc as FinSubsequence by A19, FINSEQ_1:def_12;
A25: fc c= c
proof
let p be set ; :: according to TARSKI:def_3 ::_thesis: ( not p in fc or p in c )
assume A26: p in fc ; ::_thesis: p in c
then consider x, y being set such that
A27: [x,y] = p by RELAT_1:def_1;
A28: x in dom fc by A26, A27, FUNCT_1:1;
then consider kk being Element of NAT such that
A29: x = kk and
A30: ( ( 1 <= kk & kk <= n1 ) or ( m <= kk & kk <= len c ) ) by A19;
A31: 1 <= kk by A15, A30, XXREAL_0:2;
kk <= len c by A11, A21, A30, XXREAL_0:2;
then A32: x in dom c by A29, A31, FINSEQ_3:25;
y = fc . x by A26, A27, FUNCT_1:1;
then y = c . kk by A19, A20, A28, A29;
hence p in c by A27, A29, A32, FUNCT_1:1; ::_thesis: verum
end;
1 < n by A3, A13, XXREAL_0:1;
then 1 + 1 <= n by NAT_1:13;
then A33: (1 + 1) - 1 <= n - 1 by XREAL_1:9;
then reconsider c1 = (1,n1) -cut c as Chain of G by A11, A21, Th41;
reconsider fc = fc as Subset of c by A25;
take fc ; ::_thesis: ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
A34: pp is_vertex_seq_of c1 by A2, A12, A33, A21, Th42;
then A35: len pp = (len c1) + 1 by Def6;
now__::_thesis:_for_x_being_set_holds_
(_(_x_in__{__k_where_k_is_Element_of_NAT_:_(_(_1_<=_k_&_k_<=_n1_)_or_(_m_<=_k_&_k_<=_len_c_)_)__}__implies_x_in__{__kk_where_kk_is_Element_of_NAT_:_(_1_<=_kk_&_kk_<=_n1_)__}__\/__{__kk_where_kk_is_Element_of_NAT_:_(_m_<=_kk_&_kk_<=_len_c_)__}__)_&_(_x_in__{__kk_where_kk_is_Element_of_NAT_:_(_1_<=_kk_&_kk_<=_n1_)__}__\/__{__kk_where_kk_is_Element_of_NAT_:_(_m_<=_kk_&_kk_<=_len_c_)__}__implies_x_in__{__k_where_k_is_Element_of_NAT_:_(_(_1_<=_k_&_k_<=_n1_)_or_(_m_<=_k_&_k_<=_len_c_)_)__}__)_)
let x be set ; ::_thesis: ( ( x in { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } implies x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } \/ { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } ) & ( x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } \/ { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } implies b1 in { b2 where k is Element of NAT : ( ( 1 <= b2 & b2 <= n1 ) or ( m <= b2 & b2 <= len c ) ) } ) )
hereby ::_thesis: ( x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } \/ { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } implies b1 in { b2 where k is Element of NAT : ( ( 1 <= b2 & b2 <= n1 ) or ( m <= b2 & b2 <= len c ) ) } )
assume x in { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } ; ::_thesis: x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } \/ { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) }
then ex k being Element of NAT st
( x = k & ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) ) ;
then ( x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } or x in { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } ) ;
hence x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } \/ { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } by XBOOLE_0:def_3; ::_thesis: verum
end;
assume A36: x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } \/ { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } ; ::_thesis: b1 in { b2 where k is Element of NAT : ( ( 1 <= b2 & b2 <= n1 ) or ( m <= b2 & b2 <= len c ) ) }
percases ( x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } or x in { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } ) by A36, XBOOLE_0:def_3;
suppose x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } ; ::_thesis: b1 in { b2 where k is Element of NAT : ( ( 1 <= b2 & b2 <= n1 ) or ( m <= b2 & b2 <= len c ) ) }
then ex k being Element of NAT st
( x = k & 1 <= k & k <= n1 ) ;
hence x in { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } ; ::_thesis: verum
end;
suppose x in { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } ; ::_thesis: b1 in { b2 where k is Element of NAT : ( ( 1 <= b2 & b2 <= n1 ) or ( m <= b2 & b2 <= len c ) ) }
then ex k being Element of NAT st
( x = k & m <= k & k <= len c ) ;
hence x in { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } ; ::_thesis: verum
end;
end;
end;
then A37: { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } = { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } \/ { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } by TARSKI:1;
A38: ( { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } c= Seg (len c) & { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } c= Seg (len c) )
proof
hereby :: according to TARSKI:def_3 ::_thesis: { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } c= Seg (len c)
let x be set ; ::_thesis: ( x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } implies x in Seg (len c) )
assume x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } ; ::_thesis: x in Seg (len c)
then consider k being Element of NAT such that
A39: x = k and
A40: 1 <= k and
A41: k <= n1 ;
k <= len c by A11, A21, A41, XXREAL_0:2;
hence x in Seg (len c) by A39, A40; ::_thesis: verum
end;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } or x in Seg (len c) )
assume x in { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } ; ::_thesis: x in Seg (len c)
then consider k being Element of NAT such that
A42: x = k and
A43: m <= k and
A44: k <= len c ;
1 <= k by A15, A43, XXREAL_0:2;
hence x in Seg (len c) by A42, A44; ::_thesis: verum
end;
then reconsider DR = { kk where kk is Element of NAT : ( m <= kk & kk <= len c ) } as finite set ;
rng (Sgm DR) = DR by A38, FINSEQ_1:def_13;
then A45: rng (Sgm DR) c= dom fc by A19, A37, XBOOLE_1:7;
reconsider DL = { kk where kk is Element of NAT : ( 1 <= kk & kk <= n1 ) } as finite set by A38;
set SL = Sgm DL;
A46: 1 <= m by A3, A4, XXREAL_0:2;
set SR = Sgm DR;
A47: len (Sgm DR) = card DR by A38, FINSEQ_3:39;
A48: m <= len c by A9, A16, NAT_1:13;
then A49: m - m <= (len c) - m by XREAL_1:9;
then (len c2) -' 1 = (len c2) - 1 by A18, XREAL_0:def_2;
then reconsider lc21 = (len c2) - 1 as Element of NAT ;
- (- (m - n)) = m - n ;
then A50: - (m - n) < 0 by A8;
A51: m = m1 + 1 ;
then m1 <= m by NAT_1:12;
then A52: p2 = (((m1 + 1),m) -cut vs) ^ (((m + 1),((len c) + 1)) -cut vs) by A5, A9, Th8;
A53: p2 is_vertex_seq_of c2 by A2, A15, A17, Th42;
then A54: len p2 = (len c2) + 1 by Def6;
then 1 <= len p2 by NAT_1:12;
then 1 - 1 <= (len p2) - 1 by XREAL_1:9;
then (len p2) -' 1 = (len p2) - 1 by XREAL_0:def_2;
then reconsider lp21 = (len p2) - 1 as Element of NAT ;
0 + 1 = 1 ;
then A55: 1 <= len p2 by A54, NAT_1:13;
m - m <= (len c) - m by A48, XREAL_1:9;
then 0 + 1 <= ((len c) - m) + 1 by XREAL_1:6;
then A56: 1 < len p2 by A54, A18, NAT_1:13;
lp21 -' 1 = lp21 - 1 by A54, A18, A49, XREAL_0:def_2;
then reconsider lp22 = lp21 - 1 as Element of NAT ;
A57: (m + 1) + lp22 = m + lp21 ;
m + lc21 = len c by A18;
then A58: card DR = ((len c2) + (- 1)) + 1 by Th4
.= len c2 ;
A59: m + lc21 = m1 + (len c2) ;
now__::_thesis:_for_p_being_set_holds_
(_(_p_in_c2_implies_p_in_fc_*_(Sgm_DR)_)_&_(_p_in_fc_*_(Sgm_DR)_implies_p_in_c2_)_)
let p be set ; ::_thesis: ( ( p in c2 implies p in fc * (Sgm DR) ) & ( p in fc * (Sgm DR) implies p in c2 ) )
hereby ::_thesis: ( p in fc * (Sgm DR) implies p in c2 )
assume A60: p in c2 ; ::_thesis: p in fc * (Sgm DR)
then consider x, y being set such that
A61: p = [x,y] by RELAT_1:def_1;
A62: y = c2 . x by A60, A61, FUNCT_1:1;
A63: x in dom c2 by A60, A61, FUNCT_1:1;
then reconsider k = x as Element of NAT ;
A64: k <= len c2 by A63, FINSEQ_3:25;
1 <= k by A63, FINSEQ_3:25;
then A65: m1 + k = (Sgm DR) . k by A51, A18, A59, A64, Th5;
0 + 1 <= k by A63, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A66: i < len c2 and
A67: k = i + 1 by A64, Th1;
A68: x in dom (Sgm DR) by A58, A47, A63, FINSEQ_3:29;
then A69: (Sgm DR) . k in rng (Sgm DR) by FUNCT_1:def_3;
then A70: x in dom (fc * (Sgm DR)) by A45, A68, FUNCT_1:11;
then (fc * (Sgm DR)) . x = fc . (m1 + k) by A65, FUNCT_1:12
.= c . (m + i) by A45, A65, A69, A67, GRFUNC_1:2
.= y by A15, A17, A62, A66, A67, Def1 ;
hence p in fc * (Sgm DR) by A61, A70, FUNCT_1:1; ::_thesis: verum
end;
assume A71: p in fc * (Sgm DR) ; ::_thesis: p in c2
then consider x, y being set such that
A72: p = [x,y] by RELAT_1:def_1;
A73: y = (fc * (Sgm DR)) . x by A71, A72, FUNCT_1:1;
A74: x in dom (fc * (Sgm DR)) by A71, A72, FUNCT_1:1;
then A75: x in dom (Sgm DR) by FUNCT_1:11;
then reconsider k = x as Element of NAT ;
A76: k <= len c2 by A58, A47, A75, FINSEQ_3:25;
1 <= k by A75, FINSEQ_3:25;
then A77: m1 + k = (Sgm DR) . k by A51, A18, A59, A76, Th5;
A78: k in dom c2 by A58, A47, A75, FINSEQ_3:29;
A79: (Sgm DR) . x in dom fc by A74, FUNCT_1:11;
0 + 1 <= k by A75, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A80: i < len c2 and
A81: k = i + 1 by A76, Th1;
c2 . k = c . ((m1 + 1) + i) by A15, A17, A80, A81, Def1
.= fc . ((Sgm DR) . k) by A79, A77, A81, GRFUNC_1:2
.= y by A73, A75, FUNCT_1:13 ;
hence p in c2 by A72, A78, FUNCT_1:1; ::_thesis: verum
end;
then A82: c2 = fc * (Sgm DR) by TARSKI:1;
now__::_thesis:_for_i,_j_being_Element_of_NAT_st_i_in_DL_&_j_in_DR_holds_
i_<_j
let i, j be Element of NAT ; ::_thesis: ( i in DL & j in DR implies i < j )
assume i in DL ; ::_thesis: ( j in DR implies i < j )
then consider k being Element of NAT such that
A83: k = i and
1 <= k and
A84: k <= n1 ;
assume j in DR ; ::_thesis: i < j
then A85: ex l being Element of NAT st
( l = j & m <= l & l <= len c ) ;
n1 < m by A4, A12, NAT_1:13;
then k < m by A84, XXREAL_0:2;
hence i < j by A83, A85, XXREAL_0:2; ::_thesis: verum
end;
then A86: Sgm (DL \/ DR) = (Sgm DL) ^ (Sgm DR) by A38, FINSEQ_3:42;
set DR = { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } ;
A87: 1 <= m + 1 by NAT_1:12;
deffunc H2( set ) -> set = vs . $1;
consider fvs being Function such that
A88: dom fvs = { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } and
A89: for x being set st x in { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } holds
fvs . x = H2(x) from FUNCT_1:sch_3();
A90: n <= len vs by A4, A5, XXREAL_0:2;
{ k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } c= Seg (len vs)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } or x in Seg (len vs) )
assume x in { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } ; ::_thesis: x in Seg (len vs)
then consider kk being Element of NAT such that
A91: x = kk and
A92: ( ( 1 <= kk & kk <= n ) or ( m + 1 <= kk & kk <= len vs ) ) ;
A93: kk <= len vs by A90, A92, XXREAL_0:2;
1 <= m + 1 by NAT_1:12;
then 1 <= kk by A92, XXREAL_0:2;
hence x in Seg (len vs) by A91, A93; ::_thesis: verum
end;
then reconsider fvs = fvs as FinSubsequence by A88, FINSEQ_1:def_12;
fvs c= vs
proof
let p be set ; :: according to TARSKI:def_3 ::_thesis: ( not p in fvs or p in vs )
assume A94: p in fvs ; ::_thesis: p in vs
then consider x, y being set such that
A95: [x,y] = p by RELAT_1:def_1;
A96: x in dom fvs by A94, A95, FUNCT_1:1;
then consider kk being Element of NAT such that
A97: x = kk and
A98: ( ( 1 <= kk & kk <= n ) or ( m + 1 <= kk & kk <= len vs ) ) by A88;
A99: kk <= len vs by A90, A98, XXREAL_0:2;
1 <= m + 1 by NAT_1:12;
then 1 <= kk by A98, XXREAL_0:2;
then A100: x in dom vs by A97, A99, FINSEQ_3:25;
y = fvs . x by A94, A95, FUNCT_1:1;
then y = vs . kk by A88, A89, A96, A97;
hence p in vs by A95, A97, A100, FUNCT_1:1; ::_thesis: verum
end;
then reconsider fvs = fvs as Subset of vs ;
A101: (len c) + 1 <= len vs by A2, Def6;
A102: m <= (len c) + 1 by A2, A5, Def6;
then A103: p2 . 1 = vs . m by A46, A101, Th12;
A104: pp . (len pp) = vs . n by A3, A90, Th12;
then reconsider c9 = c1 ^ c2 as Chain of G by A6, A34, A53, A103, Th43;
take fvs ; ::_thesis: ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
take c9 ; ::_thesis: ex vs1 being FinSequence of the carrier of G st
( len c9 < len c & vs1 is_vertex_seq_of c9 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c9 & Seq fvs = vs1 )
take p1 = pp ^' p2; ::_thesis: ( len c9 < len c & p1 is_vertex_seq_of c9 & len p1 < len vs & vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c9 & Seq fvs = p1 )
A105: 1 <= n1 + 1 by NAT_1:12;
then A106: (len c1) + 1 = n1 + 1 by A11, A21, Lm2;
then len c1 = n - 1 by A10, XREAL_0:def_2;
then len c9 = (n + (- 1)) + ((len c) + ((- m) + 1)) by A18, FINSEQ_1:22
.= (len c) + (n + (- m)) ;
hence A107: len c9 < len c by A50, XREAL_1:30; ::_thesis: ( p1 is_vertex_seq_of c9 & len p1 < len vs & vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c9 & Seq fvs = p1 )
A108: Sgm DL = idseq n1 by FINSEQ_3:48;
then A109: dom (Sgm DL) = Seg n1 by RELAT_1:45;
now__::_thesis:_for_p_being_set_holds_
(_(_p_in_c1_implies_p_in_fc_*_(Sgm_DL)_)_&_(_p_in_fc_*_(Sgm_DL)_implies_p_in_c1_)_)
let p be set ; ::_thesis: ( ( p in c1 implies p in fc * (Sgm DL) ) & ( p in fc * (Sgm DL) implies p in c1 ) )
hereby ::_thesis: ( p in fc * (Sgm DL) implies p in c1 )
assume A110: p in c1 ; ::_thesis: p in fc * (Sgm DL)
then consider x, y being set such that
A111: p = [x,y] by RELAT_1:def_1;
A112: y = c1 . x by A110, A111, FUNCT_1:1;
A113: x in dom c1 by A110, A111, FUNCT_1:1;
then reconsider k = x as Element of NAT ;
A114: k <= len c1 by A113, FINSEQ_3:25;
A115: 1 <= k by A113, FINSEQ_3:25;
then A116: k in { k where k is Element of NAT : ( ( 1 <= k & k <= n1 ) or ( m <= k & k <= len c ) ) } by A106, A114;
0 + 1 <= k by A113, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A117: i < n1 and
A118: k = i + 1 by A106, A114, Th1;
A119: x in dom (Sgm DL) by A106, A109, A115, A114;
then A120: k = (Sgm DL) . k by A108, A109, FUNCT_1:18;
then A121: x in dom (fc * (Sgm DL)) by A19, A119, A116, FUNCT_1:11;
then (fc * (Sgm DL)) . x = fc . k by A120, FUNCT_1:12
.= c . (1 + i) by A19, A116, A118, GRFUNC_1:2
.= y by A11, A21, A105, A106, A112, A117, A118, Lm2 ;
hence p in fc * (Sgm DL) by A111, A121, FUNCT_1:1; ::_thesis: verum
end;
assume A122: p in fc * (Sgm DL) ; ::_thesis: p in c1
then consider x, y being set such that
A123: p = [x,y] by RELAT_1:def_1;
A124: y = (fc * (Sgm DL)) . x by A122, A123, FUNCT_1:1;
A125: x in dom (fc * (Sgm DL)) by A122, A123, FUNCT_1:1;
then A126: (fc * (Sgm DL)) . x = fc . ((Sgm DL) . x) by FUNCT_1:12;
A127: x in dom (Sgm DL) by A125, FUNCT_1:11;
then consider k being Element of NAT such that
A128: k = x and
A129: 1 <= k and
A130: k <= n1 by A109;
A131: k in dom fc by A19, A129, A130;
A132: k in dom c1 by A106, A129, A130, FINSEQ_3:25;
A133: k = (Sgm DL) . k by A108, A109, A127, A128, FUNCT_1:18;
0 + 1 <= k by A129;
then ex i being Element of NAT st
( 0 <= i & i < n1 & k = i + 1 ) by A130, Th1;
then c1 . k = c . k by A11, A21, A105, A106, Lm2
.= y by A124, A126, A128, A131, A133, GRFUNC_1:2 ;
hence p in c1 by A123, A128, A132, FUNCT_1:1; ::_thesis: verum
end;
then A134: c1 = fc * (Sgm DL) by TARSKI:1;
thus p1 is_vertex_seq_of c9 by A6, A34, A53, A103, A104, Th44; ::_thesis: ( len p1 < len vs & vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c9 & Seq fvs = p1 )
then len p1 = (len c9) + 1 by Def6;
hence len p1 < len vs by A9, A107, XREAL_1:6; ::_thesis: ( vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c9 & Seq fvs = p1 )
1 <= 1 + (len c1) by NAT_1:12;
then 1 <= len pp by A34, Def6;
then p1 . 1 = pp . 1 by Th14;
hence vs . 1 = p1 . 1 by A3, A90, Th12; ::_thesis: ( vs . (len vs) = p1 . (len p1) & Seq fc = c9 & Seq fvs = p1 )
p2 . (len p2) = vs . ((len c) + 1) by A46, A102, A101, Th12;
hence vs . (len vs) = p1 . (len p1) by A9, A56, Th16; ::_thesis: ( Seq fc = c9 & Seq fvs = p1 )
A135: p2 = ((0 + 1),(len p2)) -cut p2 by Th7
.= (((0 + 1),1) -cut p2) ^ (((1 + 1),(len p2)) -cut p2) by A55, Th8 ;
rng (Sgm DL) = DL by A38, FINSEQ_1:def_13;
then rng (Sgm DL) c= dom fc by A19, A37, XBOOLE_1:7;
hence Seq fc = c9 by A19, A37, A86, A45, A134, A82, Th24; ::_thesis: Seq fvs = p1
set DL = { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } ;
A136: ( { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } c= Seg (len vs) & { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } c= Seg (len vs) )
proof
hereby :: according to TARSKI:def_3 ::_thesis: { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } c= Seg (len vs)
let x be set ; ::_thesis: ( x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } implies x in Seg (len vs) )
assume x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } ; ::_thesis: x in Seg (len vs)
then consider k being Element of NAT such that
A137: x = k and
A138: 1 <= k and
A139: k <= n ;
k <= len vs by A90, A139, XXREAL_0:2;
hence x in Seg (len vs) by A137, A138; ::_thesis: verum
end;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } or x in Seg (len vs) )
assume x in { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } ; ::_thesis: x in Seg (len vs)
then consider k being Element of NAT such that
A140: x = k and
A141: m + 1 <= k and
A142: k <= len vs ;
1 <= m + 1 by NAT_1:12;
then 1 <= k by A141, XXREAL_0:2;
hence x in Seg (len vs) by A140, A142; ::_thesis: verum
end;
now__::_thesis:_for_x_being_set_holds_
(_(_x_in__{__k_where_k_is_Element_of_NAT_:_(_(_1_<=_k_&_k_<=_n_)_or_(_m_+_1_<=_k_&_k_<=_len_vs_)_)__}__implies_x_in__{__kk_where_kk_is_Element_of_NAT_:_(_1_<=_kk_&_kk_<=_n_)__}__\/__{__kk_where_kk_is_Element_of_NAT_:_(_m_+_1_<=_kk_&_kk_<=_len_vs_)__}__)_&_(_x_in__{__kk_where_kk_is_Element_of_NAT_:_(_1_<=_kk_&_kk_<=_n_)__}__\/__{__kk_where_kk_is_Element_of_NAT_:_(_m_+_1_<=_kk_&_kk_<=_len_vs_)__}__implies_x_in__{__k_where_k_is_Element_of_NAT_:_(_(_1_<=_k_&_k_<=_n_)_or_(_m_+_1_<=_k_&_k_<=_len_vs_)_)__}__)_)
let x be set ; ::_thesis: ( ( x in { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } implies x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } \/ { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } ) & ( x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } \/ { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } implies b1 in { b2 where k is Element of NAT : ( ( 1 <= b2 & b2 <= n ) or ( m + 1 <= b2 & b2 <= len vs ) ) } ) )
hereby ::_thesis: ( x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } \/ { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } implies b1 in { b2 where k is Element of NAT : ( ( 1 <= b2 & b2 <= n ) or ( m + 1 <= b2 & b2 <= len vs ) ) } )
assume x in { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } ; ::_thesis: x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } \/ { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) }
then ex k being Element of NAT st
( x = k & ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) ) ;
then ( x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } or x in { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } ) ;
hence x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } \/ { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } by XBOOLE_0:def_3; ::_thesis: verum
end;
assume A143: x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } \/ { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } ; ::_thesis: b1 in { b2 where k is Element of NAT : ( ( 1 <= b2 & b2 <= n ) or ( m + 1 <= b2 & b2 <= len vs ) ) }
percases ( x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } or x in { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } ) by A143, XBOOLE_0:def_3;
suppose x in { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } ; ::_thesis: b1 in { b2 where k is Element of NAT : ( ( 1 <= b2 & b2 <= n ) or ( m + 1 <= b2 & b2 <= len vs ) ) }
then ex k being Element of NAT st
( x = k & 1 <= k & k <= n ) ;
hence x in { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } ; ::_thesis: verum
end;
suppose x in { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } ; ::_thesis: b1 in { b2 where k is Element of NAT : ( ( 1 <= b2 & b2 <= n ) or ( m + 1 <= b2 & b2 <= len vs ) ) }
then ex k being Element of NAT st
( x = k & m + 1 <= k & k <= len vs ) ;
hence x in { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } ; ::_thesis: verum
end;
end;
end;
then A144: { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } = { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } \/ { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } by TARSKI:1;
reconsider DR = { kk where kk is Element of NAT : ( m + 1 <= kk & kk <= len vs ) } as finite set by A136;
rng (Sgm DR) = DR by A136, FINSEQ_1:def_13;
then A145: rng (Sgm DR) c= dom fvs by A88, A144, XBOOLE_1:7;
reconsider DL = { kk where kk is Element of NAT : ( 1 <= kk & kk <= n ) } as finite set by A136;
A146: m + 1 <= ((len c) + 1) + 1 by A5, A9, XREAL_1:6;
A147: m <= ((len c) + 1) + 1 by A5, A9, NAT_1:12;
then A148: (len p2) + m = ((len c) + 1) + 1 by A9, A15, Lm2
.= (len (((m + 1),((len c) + 1)) -cut vs)) + (m + 1) by A9, A14, A146, Lm2
.= ((len (((m + 1),((len c) + 1)) -cut vs)) + 1) + m ;
set SL = Sgm DL;
A149: Sgm DL = idseq n by FINSEQ_3:48;
then A150: dom (Sgm DL) = Seg n by RELAT_1:45;
now__::_thesis:_for_p_being_set_holds_
(_(_p_in_pp_implies_p_in_fvs_*_(Sgm_DL)_)_&_(_p_in_fvs_*_(Sgm_DL)_implies_p_in_pp_)_)
let p be set ; ::_thesis: ( ( p in pp implies p in fvs * (Sgm DL) ) & ( p in fvs * (Sgm DL) implies p in pp ) )
hereby ::_thesis: ( p in fvs * (Sgm DL) implies p in pp )
assume A151: p in pp ; ::_thesis: p in fvs * (Sgm DL)
then consider x, y being set such that
A152: p = [x,y] by RELAT_1:def_1;
A153: y = pp . x by A151, A152, FUNCT_1:1;
A154: x in dom pp by A151, A152, FUNCT_1:1;
then reconsider k = x as Element of NAT ;
A155: k <= len pp by A154, FINSEQ_3:25;
A156: 1 <= k by A154, FINSEQ_3:25;
then A157: k in { k where k is Element of NAT : ( ( 1 <= k & k <= n ) or ( m + 1 <= k & k <= len vs ) ) } by A11, A35, A106, A155;
0 + 1 <= k by A154, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A158: i < n and
A159: k = i + 1 by A11, A35, A106, A155, Th1;
A160: x in dom (Sgm DL) by A11, A35, A106, A150, A156, A155;
then A161: k = (Sgm DL) . k by A149, A150, FUNCT_1:18;
then A162: x in dom (fvs * (Sgm DL)) by A88, A160, A157, FUNCT_1:11;
then (fvs * (Sgm DL)) . x = fvs . k by A161, FUNCT_1:12
.= vs . (1 + i) by A88, A157, A159, GRFUNC_1:2
.= y by A3, A11, A90, A35, A106, A153, A158, A159, Def1 ;
hence p in fvs * (Sgm DL) by A152, A162, FUNCT_1:1; ::_thesis: verum
end;
assume A163: p in fvs * (Sgm DL) ; ::_thesis: p in pp
then consider x, y being set such that
A164: p = [x,y] by RELAT_1:def_1;
A165: y = (fvs * (Sgm DL)) . x by A163, A164, FUNCT_1:1;
A166: x in dom (fvs * (Sgm DL)) by A163, A164, FUNCT_1:1;
then A167: (fvs * (Sgm DL)) . x = fvs . ((Sgm DL) . x) by FUNCT_1:12;
A168: x in dom (Sgm DL) by A166, FUNCT_1:11;
then consider k being Element of NAT such that
A169: k = x and
A170: 1 <= k and
A171: k <= n by A150;
A172: k in dom fvs by A88, A170, A171;
A173: k = (Sgm DL) . k by A149, A150, A168, A169, FUNCT_1:18;
A174: k in dom pp by A11, A35, A106, A170, A171, FINSEQ_3:25;
0 + 1 <= k by A170;
then ex i being Element of NAT st
( 0 <= i & i < n & k = i + 1 ) by A171, Th1;
then pp . k = vs . k by A3, A11, A90, A35, A106, Def1
.= y by A165, A167, A169, A172, A173, GRFUNC_1:2 ;
hence p in pp by A164, A169, A174, FUNCT_1:1; ::_thesis: verum
end;
then A175: pp = fvs * (Sgm DL) by TARSKI:1;
set SR = Sgm DR;
A176: len (Sgm DR) = card DR by A136, FINSEQ_3:39;
A177: (m + 1) + lp22 = m + ((lp21 - 1) + 1)
.= m + (((((len c) - m) + 1) + 1) - 1) by A53, A18, Def6
.= (len c) + 1 ;
then A178: card DR = (lp21 - 1) + 1 by A9, Th4
.= lp21 ;
A179: m + 1 <= ((len c) + 1) + 1 by A5, A9, XREAL_1:7;
now__::_thesis:_for_p_being_set_holds_
(_(_p_in_((m_+_1),((len_c)_+_1))_-cut_vs_implies_p_in_fvs_*_(Sgm_DR)_)_&_(_p_in_fvs_*_(Sgm_DR)_implies_p_in_((m_+_1),((len_c)_+_1))_-cut_vs_)_)
let p be set ; ::_thesis: ( ( p in ((m + 1),((len c) + 1)) -cut vs implies p in fvs * (Sgm DR) ) & ( p in fvs * (Sgm DR) implies p in ((m + 1),((len c) + 1)) -cut vs ) )
hereby ::_thesis: ( p in fvs * (Sgm DR) implies p in ((m + 1),((len c) + 1)) -cut vs )
assume A180: p in ((m + 1),((len c) + 1)) -cut vs ; ::_thesis: p in fvs * (Sgm DR)
then consider x, y being set such that
A181: p = [x,y] by RELAT_1:def_1;
A182: y = (((m + 1),((len c) + 1)) -cut vs) . x by A180, A181, FUNCT_1:1;
A183: x in dom (((m + 1),((len c) + 1)) -cut vs) by A180, A181, FUNCT_1:1;
then reconsider k = x as Element of NAT ;
A184: k <= len (((m + 1),((len c) + 1)) -cut vs) by A183, FINSEQ_3:25;
1 <= k by A183, FINSEQ_3:25;
then A185: m + k = (Sgm DR) . k by A9, A177, A148, A57, A184, Th5;
0 + 1 <= k by A183, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A186: i < len (((m + 1),((len c) + 1)) -cut vs) and
A187: k = i + 1 by A184, Th1;
A188: x in dom (Sgm DR) by A178, A148, A176, A183, FINSEQ_3:29;
then A189: (Sgm DR) . k in rng (Sgm DR) by FUNCT_1:def_3;
then A190: x in dom (fvs * (Sgm DR)) by A145, A188, FUNCT_1:11;
then (fvs * (Sgm DR)) . x = fvs . (m + k) by A185, FUNCT_1:12
.= vs . ((m + 1) + i) by A145, A185, A189, A187, GRFUNC_1:2
.= y by A9, A87, A179, A182, A186, A187, Lm2 ;
hence p in fvs * (Sgm DR) by A181, A190, FUNCT_1:1; ::_thesis: verum
end;
assume A191: p in fvs * (Sgm DR) ; ::_thesis: p in ((m + 1),((len c) + 1)) -cut vs
then consider x, y being set such that
A192: p = [x,y] by RELAT_1:def_1;
A193: y = (fvs * (Sgm DR)) . x by A191, A192, FUNCT_1:1;
A194: x in dom (fvs * (Sgm DR)) by A191, A192, FUNCT_1:1;
then A195: x in dom (Sgm DR) by FUNCT_1:11;
then reconsider k = x as Element of NAT ;
A196: k <= len (((m + 1),((len c) + 1)) -cut vs) by A178, A148, A176, A195, FINSEQ_3:25;
1 <= k by A195, FINSEQ_3:25;
then A197: m + k = (Sgm DR) . k by A9, A177, A148, A57, A196, Th5;
A198: k in dom (((m + 1),((len c) + 1)) -cut vs) by A178, A148, A176, A195, FINSEQ_3:29;
A199: (Sgm DR) . x in dom fvs by A194, FUNCT_1:11;
0 + 1 <= k by A195, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A200: i < len (((m + 1),((len c) + 1)) -cut vs) and
A201: k = i + 1 by A196, Th1;
(((m + 1),((len c) + 1)) -cut vs) . k = vs . ((m + 1) + i) by A9, A87, A179, A200, A201, Lm2
.= fvs . ((Sgm DR) . k) by A199, A197, A201, GRFUNC_1:2
.= y by A193, A195, FUNCT_1:13 ;
hence p in ((m + 1),((len c) + 1)) -cut vs by A192, A198, FUNCT_1:1; ::_thesis: verum
end;
then A202: ((m + 1),((len c) + 1)) -cut vs = fvs * (Sgm DR) by TARSKI:1;
now__::_thesis:_for_i,_j_being_Element_of_NAT_st_i_in_DL_&_j_in_DR_holds_
i_<_j
let i, j be Element of NAT ; ::_thesis: ( i in DL & j in DR implies i < j )
assume i in DL ; ::_thesis: ( j in DR implies i < j )
then consider k being Element of NAT such that
A203: k = i and
1 <= k and
A204: k <= n ;
A205: k < m by A4, A204, XXREAL_0:2;
assume j in DR ; ::_thesis: i < j
then consider l being Element of NAT such that
A206: l = j and
A207: m + 1 <= l and
l <= len vs ;
m <= m + 1 by NAT_1:12;
then m <= l by A207, XXREAL_0:2;
hence i < j by A203, A206, A205, XXREAL_0:2; ::_thesis: verum
end;
then A208: Sgm (DL \/ DR) = (Sgm DL) ^ (Sgm DR) by A136, FINSEQ_3:42;
(1,1) -cut p2 = <*(p2 . (0 + 1))*> by A55, Th6
.= <*(vs . (m + 0))*> by A9, A15, A54, A147, Lm2
.= (m,m) -cut vs by A5, A15, Th6 ;
then A209: p1 = pp ^ (((m + 1),((len c) + 1)) -cut vs) by A135, A52, FINSEQ_1:33;
rng (Sgm DL) = DL by A136, FINSEQ_1:def_13;
then rng (Sgm DL) c= dom fvs by A88, A144, XBOOLE_1:7;
hence Seq fvs = p1 by A88, A209, A144, A208, A145, A175, A202, Th24; ::_thesis: verum
end;
supposeA210: ( n = 1 & m <> len vs ) ; ::_thesis: ex fc being Subset of c ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
set domfvs = { k where k is Element of NAT : ( m <= k & k <= len vs ) } ;
deffunc H1( set ) -> set = c . $1;
set domfc = { k where k is Element of NAT : ( m <= k & k <= len c ) } ;
set p2 = (m,((len c) + 1)) -cut vs;
consider fc being Function such that
A211: dom fc = { k where k is Element of NAT : ( m <= k & k <= len c ) } and
A212: for x being set st x in { k where k is Element of NAT : ( m <= k & k <= len c ) } holds
fc . x = H1(x) from FUNCT_1:sch_3();
A213: 1 < m by A3, A4, XXREAL_0:2;
then 1 - 1 < m - 1 by XREAL_1:9;
then 0 < - (- (m - 1)) ;
then A214: - (m - 1) < 0 ;
1 - 1 <= m - 1 by A213, XREAL_1:9;
then m -' 1 = m - 1 by XREAL_0:def_2;
then reconsider m1 = m - 1 as Element of NAT ;
A215: m = m1 + 1 ;
{ k where k is Element of NAT : ( m <= k & k <= len c ) } c= Seg (len c)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { k where k is Element of NAT : ( m <= k & k <= len c ) } or x in Seg (len c) )
assume x in { k where k is Element of NAT : ( m <= k & k <= len c ) } ; ::_thesis: x in Seg (len c)
then consider kk being Element of NAT such that
A216: x = kk and
A217: m <= kk and
A218: kk <= len c ;
1 <= kk by A213, A217, XXREAL_0:2;
hence x in Seg (len c) by A216, A218; ::_thesis: verum
end;
then reconsider fc = fc as FinSubsequence by A211, FINSEQ_1:def_12;
fc c= c
proof
let p be set ; :: according to TARSKI:def_3 ::_thesis: ( not p in fc or p in c )
assume A219: p in fc ; ::_thesis: p in c
then consider x, y being set such that
A220: [x,y] = p by RELAT_1:def_1;
A221: x in dom fc by A219, A220, FUNCT_1:1;
then consider kk being Element of NAT such that
A222: x = kk and
A223: m <= kk and
A224: kk <= len c by A211;
1 <= kk by A213, A223, XXREAL_0:2;
then A225: x in dom c by A222, A224, FINSEQ_3:25;
y = fc . x by A219, A220, FUNCT_1:1;
then y = c . kk by A211, A212, A221, A222;
hence p in c by A220, A222, A225, FUNCT_1:1; ::_thesis: verum
end;
then reconsider fc = fc as Subset of c ;
take fc ; ::_thesis: ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
deffunc H2( set ) -> set = vs . $1;
consider fvs being Function such that
A226: dom fvs = { k where k is Element of NAT : ( m <= k & k <= len vs ) } and
A227: for x being set st x in { k where k is Element of NAT : ( m <= k & k <= len vs ) } holds
fvs . x = H2(x) from FUNCT_1:sch_3();
{ k where k is Element of NAT : ( m <= k & k <= len vs ) } c= Seg (len vs)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { k where k is Element of NAT : ( m <= k & k <= len vs ) } or x in Seg (len vs) )
assume x in { k where k is Element of NAT : ( m <= k & k <= len vs ) } ; ::_thesis: x in Seg (len vs)
then consider kk being Element of NAT such that
A228: x = kk and
A229: m <= kk and
A230: kk <= len vs ;
1 <= kk by A213, A229, XXREAL_0:2;
hence x in Seg (len vs) by A228, A230; ::_thesis: verum
end;
then reconsider fvs = fvs as FinSubsequence by A226, FINSEQ_1:def_12;
A231: fvs c= vs
proof
let p be set ; :: according to TARSKI:def_3 ::_thesis: ( not p in fvs or p in vs )
assume A232: p in fvs ; ::_thesis: p in vs
then consider x, y being set such that
A233: [x,y] = p by RELAT_1:def_1;
A234: x in dom fvs by A232, A233, FUNCT_1:1;
then consider kk being Element of NAT such that
A235: x = kk and
A236: m <= kk and
A237: kk <= len vs by A226;
1 <= kk by A213, A236, XXREAL_0:2;
then A238: x in dom vs by A235, A237, FINSEQ_3:25;
y = fvs . x by A232, A233, FUNCT_1:1;
then y = vs . kk by A226, A227, A234, A235;
hence p in vs by A233, A235, A238, FUNCT_1:1; ::_thesis: verum
end;
A239: m < len vs by A5, A210, XXREAL_0:1;
then A240: m <= len c by A9, NAT_1:13;
then reconsider c2 = (m,(len c)) -cut c as Chain of G by A213, Th41;
A241: m <= len c by A9, A239, NAT_1:13;
reconsider fvs = fvs as Subset of vs by A231;
take fvs ; ::_thesis: ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
take c1 = c2; ::_thesis: ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
take p1 = (m,((len c) + 1)) -cut vs; ::_thesis: ( len c1 < len c & p1 is_vertex_seq_of c1 & len p1 < len vs & vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c1 & Seq fvs = p1 )
A242: (len c2) + m = (len c) + 1 by A4, A5, A9, A210, Lm2;
then len c2 = (len c) + ((- m) + 1) ;
hence A243: len c1 < len c by A214, XREAL_1:30; ::_thesis: ( p1 is_vertex_seq_of c1 & len p1 < len vs & vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c1 & Seq fvs = p1 )
1 <= m by A3, A4, XXREAL_0:2;
hence p1 is_vertex_seq_of c1 by A2, A241, Th42; ::_thesis: ( len p1 < len vs & vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c1 & Seq fvs = p1 )
(m,((len c) + 1)) -cut vs is_vertex_seq_of c2 by A2, A240, A213, Th42;
then len p1 = (len c1) + 1 by Def6;
hence len p1 < len vs by A9, A243, XREAL_1:6; ::_thesis: ( vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c1 & Seq fvs = p1 )
thus vs . 1 = p1 . 1 by A4, A5, A6, A9, A210, Th12; ::_thesis: ( vs . (len vs) = p1 . (len p1) & Seq fc = c1 & Seq fvs = p1 )
thus vs . (len vs) = p1 . (len p1) by A4, A5, A9, A210, Th12; ::_thesis: ( Seq fc = c1 & Seq fvs = p1 )
A244: { k where k is Element of NAT : ( m <= k & k <= len vs ) } c= Seg (len vs)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { k where k is Element of NAT : ( m <= k & k <= len vs ) } or x in Seg (len vs) )
assume x in { k where k is Element of NAT : ( m <= k & k <= len vs ) } ; ::_thesis: x in Seg (len vs)
then consider k being Element of NAT such that
A245: x = k and
A246: m <= k and
A247: k <= len vs ;
1 <= k by A213, A246, XXREAL_0:2;
hence x in Seg (len vs) by A245, A247; ::_thesis: verum
end;
A248: { k where k is Element of NAT : ( m <= k & k <= len c ) } c= Seg (len c)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { k where k is Element of NAT : ( m <= k & k <= len c ) } or x in Seg (len c) )
assume x in { k where k is Element of NAT : ( m <= k & k <= len c ) } ; ::_thesis: x in Seg (len c)
then consider k being Element of NAT such that
A249: x = k and
A250: m <= k and
A251: k <= len c ;
1 <= k by A213, A250, XXREAL_0:2;
hence x in Seg (len c) by A249, A251; ::_thesis: verum
end;
then reconsider domfc = { k where k is Element of NAT : ( m <= k & k <= len c ) } as finite set ;
A252: len (Sgm domfc) = card domfc by A248, FINSEQ_3:39;
reconsider domfvs = { k where k is Element of NAT : ( m <= k & k <= len vs ) } as finite set by A244;
A253: rng (Sgm domfvs) c= dom fvs by A226, A244, FINSEQ_1:def_13;
set SR = Sgm domfc;
A254: (len c) + 1 <= len vs by A2, Def6;
A255: m - m <= (len c) - m by A240, XREAL_1:9;
then (len c2) -' 1 = (len c2) - 1 by A242, XREAL_0:def_2;
then reconsider lc21 = (len c2) - 1 as Element of NAT ;
A256: m + lc21 = m1 + (len c2) ;
(len c2) -' 1 = (len c2) - 1 by A242, A255, XREAL_0:def_2;
then reconsider lc21 = (len c2) - 1 as Element of NAT ;
m + lc21 = len c by A242;
then A257: card domfc = ((len c2) + (- 1)) + 1 by Th4
.= len c2 ;
A258: rng (Sgm domfc) c= dom fc by A211, A248, FINSEQ_1:def_13;
now__::_thesis:_for_p_being_set_holds_
(_(_p_in_c2_implies_p_in_fc_*_(Sgm_domfc)_)_&_(_p_in_fc_*_(Sgm_domfc)_implies_p_in_c2_)_)
let p be set ; ::_thesis: ( ( p in c2 implies p in fc * (Sgm domfc) ) & ( p in fc * (Sgm domfc) implies p in c2 ) )
hereby ::_thesis: ( p in fc * (Sgm domfc) implies p in c2 )
assume A259: p in c2 ; ::_thesis: p in fc * (Sgm domfc)
then consider x, y being set such that
A260: p = [x,y] by RELAT_1:def_1;
A261: y = c2 . x by A259, A260, FUNCT_1:1;
A262: x in dom c2 by A259, A260, FUNCT_1:1;
then reconsider k = x as Element of NAT ;
A263: k <= len c2 by A262, FINSEQ_3:25;
1 <= k by A262, FINSEQ_3:25;
then A264: m1 + k = (Sgm domfc) . k by A242, A215, A256, A263, Th5;
0 + 1 <= k by A262, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A265: i < len c2 and
A266: k = i + 1 by A263, Th1;
A267: x in dom (Sgm domfc) by A257, A252, A262, FINSEQ_3:29;
then A268: (Sgm domfc) . k in rng (Sgm domfc) by FUNCT_1:def_3;
then A269: x in dom (fc * (Sgm domfc)) by A258, A267, FUNCT_1:11;
then (fc * (Sgm domfc)) . x = fc . (m1 + k) by A264, FUNCT_1:12
.= c . (m + i) by A258, A264, A268, A266, GRFUNC_1:2
.= y by A4, A5, A9, A210, A261, A265, A266, Lm2 ;
hence p in fc * (Sgm domfc) by A260, A269, FUNCT_1:1; ::_thesis: verum
end;
assume A270: p in fc * (Sgm domfc) ; ::_thesis: p in c2
then consider x, y being set such that
A271: p = [x,y] by RELAT_1:def_1;
A272: y = (fc * (Sgm domfc)) . x by A270, A271, FUNCT_1:1;
A273: x in dom (fc * (Sgm domfc)) by A270, A271, FUNCT_1:1;
then A274: x in dom (Sgm domfc) by FUNCT_1:11;
then reconsider k = x as Element of NAT ;
A275: k <= len c2 by A257, A252, A274, FINSEQ_3:25;
1 <= k by A274, FINSEQ_3:25;
then A276: m1 + k = (Sgm domfc) . k by A242, A215, A256, A275, Th5;
A277: k in dom c2 by A257, A252, A274, FINSEQ_3:29;
A278: (Sgm domfc) . x in dom fc by A273, FUNCT_1:11;
0 + 1 <= k by A274, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A279: i < len c2 and
A280: k = i + 1 by A275, Th1;
c2 . k = c . ((m1 + 1) + i) by A4, A5, A9, A210, A279, A280, Lm2
.= fc . ((Sgm domfc) . k) by A278, A276, A280, GRFUNC_1:2
.= y by A272, A274, FUNCT_1:13 ;
hence p in c2 by A271, A277, FUNCT_1:1; ::_thesis: verum
end;
hence Seq fc = c1 by A211, TARSKI:1; ::_thesis: Seq fvs = p1
set SR = Sgm domfvs;
A281: len (Sgm domfvs) = card domfvs by A244, FINSEQ_3:39;
A282: m <= ((len c) + 1) + 1 by A5, A9, NAT_1:12;
then A283: (len ((m,((len c) + 1)) -cut vs)) + m = ((len c) + 1) + 1 by A4, A210, A254, Lm2;
then len ((m,((len c) + 1)) -cut vs) = (((len c) - m) + 1) + 1 ;
then 1 <= len ((m,((len c) + 1)) -cut vs) by A242, NAT_1:12;
then 1 - 1 <= (len ((m,((len c) + 1)) -cut vs)) - 1 by XREAL_1:9;
then (len ((m,((len c) + 1)) -cut vs)) -' 1 = (len ((m,((len c) + 1)) -cut vs)) - 1 by XREAL_0:def_2;
then reconsider lp21 = (len ((m,((len c) + 1)) -cut vs)) - 1 as Element of NAT ;
m + lp21 = (len c) + 1 by A283;
then A284: card domfvs = ((len ((m,((len c) + 1)) -cut vs)) + (- 1)) + 1 by A9, Th4
.= len ((m,((len c) + 1)) -cut vs) ;
A285: m + lp21 = m1 + (len ((m,((len c) + 1)) -cut vs)) ;
now__::_thesis:_for_p_being_set_holds_
(_(_p_in_(m,((len_c)_+_1))_-cut_vs_implies_p_in_fvs_*_(Sgm_domfvs)_)_&_(_p_in_fvs_*_(Sgm_domfvs)_implies_p_in_(m,((len_c)_+_1))_-cut_vs_)_)
let p be set ; ::_thesis: ( ( p in (m,((len c) + 1)) -cut vs implies p in fvs * (Sgm domfvs) ) & ( p in fvs * (Sgm domfvs) implies p in (m,((len c) + 1)) -cut vs ) )
hereby ::_thesis: ( p in fvs * (Sgm domfvs) implies p in (m,((len c) + 1)) -cut vs )
assume A286: p in (m,((len c) + 1)) -cut vs ; ::_thesis: p in fvs * (Sgm domfvs)
then consider x, y being set such that
A287: p = [x,y] by RELAT_1:def_1;
A288: y = ((m,((len c) + 1)) -cut vs) . x by A286, A287, FUNCT_1:1;
A289: x in dom ((m,((len c) + 1)) -cut vs) by A286, A287, FUNCT_1:1;
then reconsider k = x as Element of NAT ;
A290: k <= len ((m,((len c) + 1)) -cut vs) by A289, FINSEQ_3:25;
1 <= k by A289, FINSEQ_3:25;
then A291: m1 + k = (Sgm domfvs) . k by A9, A215, A283, A285, A290, Th5;
0 + 1 <= k by A289, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A292: i < len ((m,((len c) + 1)) -cut vs) and
A293: k = i + 1 by A290, Th1;
A294: x in dom (Sgm domfvs) by A284, A281, A289, FINSEQ_3:29;
then A295: (Sgm domfvs) . k in rng (Sgm domfvs) by FUNCT_1:def_3;
then A296: x in dom (fvs * (Sgm domfvs)) by A253, A294, FUNCT_1:11;
then (fvs * (Sgm domfvs)) . x = fvs . (m1 + k) by A291, FUNCT_1:12
.= vs . (m + i) by A253, A291, A295, A293, GRFUNC_1:2
.= y by A4, A210, A282, A254, A288, A292, A293, Lm2 ;
hence p in fvs * (Sgm domfvs) by A287, A296, FUNCT_1:1; ::_thesis: verum
end;
assume A297: p in fvs * (Sgm domfvs) ; ::_thesis: p in (m,((len c) + 1)) -cut vs
then consider x, y being set such that
A298: p = [x,y] by RELAT_1:def_1;
A299: y = (fvs * (Sgm domfvs)) . x by A297, A298, FUNCT_1:1;
A300: x in dom (fvs * (Sgm domfvs)) by A297, A298, FUNCT_1:1;
then A301: x in dom (Sgm domfvs) by FUNCT_1:11;
then reconsider k = x as Element of NAT ;
A302: k <= len ((m,((len c) + 1)) -cut vs) by A284, A281, A301, FINSEQ_3:25;
1 <= k by A301, FINSEQ_3:25;
then A303: m1 + k = (Sgm domfvs) . k by A9, A215, A283, A285, A302, Th5;
A304: k in dom ((m,((len c) + 1)) -cut vs) by A284, A281, A301, FINSEQ_3:29;
A305: (Sgm domfvs) . x in dom fvs by A300, FUNCT_1:11;
0 + 1 <= k by A301, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A306: i < len ((m,((len c) + 1)) -cut vs) and
A307: k = i + 1 by A302, Th1;
((m,((len c) + 1)) -cut vs) . k = vs . ((m1 + 1) + i) by A4, A210, A282, A254, A306, A307, Lm2
.= fvs . ((Sgm domfvs) . k) by A305, A303, A307, GRFUNC_1:2
.= y by A299, A301, FUNCT_1:13 ;
hence p in (m,((len c) + 1)) -cut vs by A298, A304, FUNCT_1:1; ::_thesis: verum
end;
hence Seq fvs = p1 by A226, TARSKI:1; ::_thesis: verum
end;
supposeA308: ( n <> 1 & m = len vs ) ; ::_thesis: ex fc being Subset of c ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
set domfvs = { k where k is Element of NAT : ( 1 <= k & k <= n ) } ;
set pp = (1,n) -cut vs;
deffunc H1( set ) -> set = c . $1;
reconsider domfc = { k where k is Element of NAT : ( 1 <= k & k <= n1 ) } as set ;
consider fc being Function such that
A309: dom fc = domfc and
A310: for x being set st x in domfc holds
fc . x = H1(x) from FUNCT_1:sch_3();
n < len vs by A4, A5, XXREAL_0:2;
then A311: n - 1 < ((len c) + 1) - 1 by A9, XREAL_1:9;
domfc c= Seg (len c)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in domfc or x in Seg (len c) )
assume x in domfc ; ::_thesis: x in Seg (len c)
then consider kk being Element of NAT such that
A312: x = kk and
A313: 1 <= kk and
A314: kk <= n1 ;
kk <= len c by A11, A311, A314, XXREAL_0:2;
hence x in Seg (len c) by A312, A313; ::_thesis: verum
end;
then reconsider fc = fc as FinSubsequence by A309, FINSEQ_1:def_12;
1 < n by A3, A308, XXREAL_0:1;
then 1 + 1 <= n by NAT_1:13;
then A315: (1 + 1) - 1 <= n - 1 by XREAL_1:9;
then reconsider c1 = (1,n1) -cut c as Chain of G by A11, A311, Th41;
A316: 1 <= n1 + 1 by NAT_1:12;
then A317: (len c1) + 1 = n1 + 1 by A11, A311, Lm2;
then A318: len c1 = n - 1 by A10, XREAL_0:def_2;
A319: fc c= c
proof
let p be set ; :: according to TARSKI:def_3 ::_thesis: ( not p in fc or p in c )
assume A320: p in fc ; ::_thesis: p in c
then consider x, y being set such that
A321: [x,y] = p by RELAT_1:def_1;
A322: x in dom fc by A320, A321, FUNCT_1:1;
then consider kk being Element of NAT such that
A323: x = kk and
A324: 1 <= kk and
A325: kk <= n1 by A309;
kk <= len c by A11, A311, A325, XXREAL_0:2;
then A326: x in dom c by A323, A324, FINSEQ_3:25;
y = fc . x by A320, A321, FUNCT_1:1;
then y = c . kk by A309, A310, A322, A323;
hence p in c by A321, A323, A326, FUNCT_1:1; ::_thesis: verum
end;
A327: domfc c= Seg (len c)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in domfc or x in Seg (len c) )
assume x in domfc ; ::_thesis: x in Seg (len c)
then consider k being Element of NAT such that
A328: x = k and
A329: 1 <= k and
A330: k <= n1 ;
k <= len c by A11, A311, A330, XXREAL_0:2;
hence x in Seg (len c) by A328, A329; ::_thesis: verum
end;
reconsider fc = fc as Subset of c by A319;
take fc ; ::_thesis: ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
reconsider domfc = domfc as finite set by A327;
set SL = Sgm domfc;
deffunc H2( set ) -> set = vs . $1;
consider fvs being Function such that
A331: dom fvs = { k where k is Element of NAT : ( 1 <= k & k <= n ) } and
A332: for x being set st x in { k where k is Element of NAT : ( 1 <= k & k <= n ) } holds
fvs . x = H2(x) from FUNCT_1:sch_3();
A333: n <= len vs by A4, A5, XXREAL_0:2;
{ k where k is Element of NAT : ( 1 <= k & k <= n ) } c= Seg (len vs)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { k where k is Element of NAT : ( 1 <= k & k <= n ) } or x in Seg (len vs) )
assume x in { k where k is Element of NAT : ( 1 <= k & k <= n ) } ; ::_thesis: x in Seg (len vs)
then consider kk being Element of NAT such that
A334: x = kk and
A335: 1 <= kk and
A336: kk <= n ;
kk <= len vs by A333, A336, XXREAL_0:2;
hence x in Seg (len vs) by A334, A335; ::_thesis: verum
end;
then reconsider fvs = fvs as FinSubsequence by A331, FINSEQ_1:def_12;
fvs c= vs
proof
let p be set ; :: according to TARSKI:def_3 ::_thesis: ( not p in fvs or p in vs )
assume A337: p in fvs ; ::_thesis: p in vs
then consider x, y being set such that
A338: [x,y] = p by RELAT_1:def_1;
A339: x in dom fvs by A337, A338, FUNCT_1:1;
then consider kk being Element of NAT such that
A340: x = kk and
A341: 1 <= kk and
A342: kk <= n by A331;
kk <= len vs by A333, A342, XXREAL_0:2;
then A343: x in dom vs by A340, A341, FINSEQ_3:25;
y = fvs . x by A337, A338, FUNCT_1:1;
then y = vs . kk by A331, A332, A339, A340;
hence p in vs by A338, A340, A343, FUNCT_1:1; ::_thesis: verum
end;
then reconsider fvs = fvs as Subset of vs ;
{ k where k is Element of NAT : ( 1 <= k & k <= n ) } c= Seg (len vs)
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { k where k is Element of NAT : ( 1 <= k & k <= n ) } or x in Seg (len vs) )
assume x in { k where k is Element of NAT : ( 1 <= k & k <= n ) } ; ::_thesis: x in Seg (len vs)
then consider k being Element of NAT such that
A344: x = k and
A345: 1 <= k and
A346: k <= n ;
k <= len vs by A333, A346, XXREAL_0:2;
hence x in Seg (len vs) by A344, A345; ::_thesis: verum
end;
then reconsider domfvs = { k where k is Element of NAT : ( 1 <= k & k <= n ) } as finite set ;
take fvs ; ::_thesis: ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( len c1 < len c & vs1 is_vertex_seq_of c1 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c1 & Seq fvs = vs1 )
take c9 = c1; ::_thesis: ex vs1 being FinSequence of the carrier of G st
( len c9 < len c & vs1 is_vertex_seq_of c9 & len vs1 < len vs & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & Seq fc = c9 & Seq fvs = vs1 )
take p1 = (1,n) -cut vs; ::_thesis: ( len c9 < len c & p1 is_vertex_seq_of c9 & len p1 < len vs & vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c9 & Seq fvs = p1 )
A347: (1,n) -cut vs is_vertex_seq_of c1 by A2, A12, A315, A311, Th42;
then A348: len ((1,n) -cut vs) = (len c1) + 1 by Def6;
thus len c9 < len c by A10, A311, A317, XREAL_0:def_2; ::_thesis: ( p1 is_vertex_seq_of c9 & len p1 < len vs & vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c9 & Seq fvs = p1 )
thus p1 is_vertex_seq_of c9 by A2, A12, A315, A311, Th42; ::_thesis: ( len p1 < len vs & vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c9 & Seq fvs = p1 )
len p1 = (len c1) + 1 by A347, Def6;
hence len p1 < len vs by A4, A5, A318, XXREAL_0:2; ::_thesis: ( vs . 1 = p1 . 1 & vs . (len vs) = p1 . (len p1) & Seq fc = c9 & Seq fvs = p1 )
thus vs . 1 = p1 . 1 by A3, A333, Th12; ::_thesis: ( vs . (len vs) = p1 . (len p1) & Seq fc = c9 & Seq fvs = p1 )
thus vs . (len vs) = p1 . (len p1) by A3, A4, A6, A308, Th12; ::_thesis: ( Seq fc = c9 & Seq fvs = p1 )
A349: Sgm domfc = idseq n1 by FINSEQ_3:48;
then A350: dom (Sgm domfc) = Seg n1 by RELAT_1:45;
now__::_thesis:_for_p_being_set_holds_
(_(_p_in_c1_implies_p_in_fc_*_(Sgm_domfc)_)_&_(_p_in_fc_*_(Sgm_domfc)_implies_p_in_c1_)_)
let p be set ; ::_thesis: ( ( p in c1 implies p in fc * (Sgm domfc) ) & ( p in fc * (Sgm domfc) implies p in c1 ) )
hereby ::_thesis: ( p in fc * (Sgm domfc) implies p in c1 )
assume A351: p in c1 ; ::_thesis: p in fc * (Sgm domfc)
then consider x, y being set such that
A352: p = [x,y] by RELAT_1:def_1;
A353: y = c1 . x by A351, A352, FUNCT_1:1;
A354: x in dom c1 by A351, A352, FUNCT_1:1;
then reconsider k = x as Element of NAT ;
A355: k <= len c1 by A354, FINSEQ_3:25;
A356: 1 <= k by A354, FINSEQ_3:25;
then x in dom (Sgm domfc) by A317, A350, A355;
then A357: k = (Sgm domfc) . k by A349, A350, FUNCT_1:18;
0 + 1 <= k by A354, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A358: i < n1 and
A359: k = i + 1 by A317, A355, Th1;
A360: k in domfc by A317, A356, A355;
then A361: x in dom (fc * (Sgm domfc)) by A309, A350, A357, FUNCT_1:11;
then (fc * (Sgm domfc)) . x = fc . k by A357, FUNCT_1:12
.= c . (1 + i) by A309, A360, A359, GRFUNC_1:2
.= y by A11, A311, A316, A317, A353, A358, A359, Lm2 ;
hence p in fc * (Sgm domfc) by A352, A361, FUNCT_1:1; ::_thesis: verum
end;
assume A362: p in fc * (Sgm domfc) ; ::_thesis: p in c1
then consider x, y being set such that
A363: p = [x,y] by RELAT_1:def_1;
A364: y = (fc * (Sgm domfc)) . x by A362, A363, FUNCT_1:1;
A365: x in dom (fc * (Sgm domfc)) by A362, A363, FUNCT_1:1;
then A366: (fc * (Sgm domfc)) . x = fc . ((Sgm domfc) . x) by FUNCT_1:12;
A367: x in dom (Sgm domfc) by A365, FUNCT_1:11;
then consider k being Element of NAT such that
A368: k = x and
A369: 1 <= k and
A370: k <= n1 by A350;
A371: k in dom fc by A309, A369, A370;
A372: k in dom c1 by A317, A369, A370, FINSEQ_3:25;
A373: k = (Sgm domfc) . k by A349, A350, A367, A368, FUNCT_1:18;
0 + 1 <= k by A369;
then ex i being Element of NAT st
( 0 <= i & i < n1 & k = i + 1 ) by A370, Th1;
then c1 . k = c . k by A11, A311, A316, A317, Lm2
.= y by A364, A366, A368, A371, A373, GRFUNC_1:2 ;
hence p in c1 by A363, A368, A372, FUNCT_1:1; ::_thesis: verum
end;
hence Seq fc = c9 by A309, TARSKI:1; ::_thesis: Seq fvs = p1
set SL = Sgm domfvs;
A374: Sgm domfvs = idseq n by FINSEQ_3:48;
then A375: dom (Sgm domfvs) = Seg n by RELAT_1:45;
now__::_thesis:_for_p_being_set_holds_
(_(_p_in_(1,n)_-cut_vs_implies_p_in_fvs_*_(Sgm_domfvs)_)_&_(_p_in_fvs_*_(Sgm_domfvs)_implies_p_in_(1,n)_-cut_vs_)_)
let p be set ; ::_thesis: ( ( p in (1,n) -cut vs implies p in fvs * (Sgm domfvs) ) & ( p in fvs * (Sgm domfvs) implies p in (1,n) -cut vs ) )
hereby ::_thesis: ( p in fvs * (Sgm domfvs) implies p in (1,n) -cut vs )
assume A376: p in (1,n) -cut vs ; ::_thesis: p in fvs * (Sgm domfvs)
then consider x, y being set such that
A377: p = [x,y] by RELAT_1:def_1;
A378: y = ((1,n) -cut vs) . x by A376, A377, FUNCT_1:1;
A379: x in dom ((1,n) -cut vs) by A376, A377, FUNCT_1:1;
then reconsider k = x as Element of NAT ;
A380: k <= len ((1,n) -cut vs) by A379, FINSEQ_3:25;
A381: 1 <= k by A379, FINSEQ_3:25;
then x in dom (Sgm domfvs) by A348, A318, A375, A380;
then A382: k = (Sgm domfvs) . k by A374, A375, FUNCT_1:18;
0 + 1 <= k by A379, FINSEQ_3:25;
then consider i being Element of NAT such that
0 <= i and
A383: i < n and
A384: k = i + 1 by A348, A318, A380, Th1;
A385: k in domfvs by A348, A318, A381, A380;
then A386: x in dom (fvs * (Sgm domfvs)) by A331, A375, A382, FUNCT_1:11;
then (fvs * (Sgm domfvs)) . x = fvs . k by A382, FUNCT_1:12
.= vs . (1 + i) by A331, A385, A384, GRFUNC_1:2
.= y by A3, A333, A348, A318, A378, A383, A384, Def1 ;
hence p in fvs * (Sgm domfvs) by A377, A386, FUNCT_1:1; ::_thesis: verum
end;
assume A387: p in fvs * (Sgm domfvs) ; ::_thesis: p in (1,n) -cut vs
then consider x, y being set such that
A388: p = [x,y] by RELAT_1:def_1;
A389: y = (fvs * (Sgm domfvs)) . x by A387, A388, FUNCT_1:1;
A390: x in dom (fvs * (Sgm domfvs)) by A387, A388, FUNCT_1:1;
then A391: (fvs * (Sgm domfvs)) . x = fvs . ((Sgm domfvs) . x) by FUNCT_1:12;
A392: x in dom (Sgm domfvs) by A390, FUNCT_1:11;
then consider k being Element of NAT such that
A393: k = x and
A394: 1 <= k and
A395: k <= n by A375;
A396: k in dom fvs by A331, A394, A395;
A397: k in dom ((1,n) -cut vs) by A348, A318, A394, A395, FINSEQ_3:25;
A398: k = (Sgm domfvs) . k by A374, A375, A392, A393, FUNCT_1:18;
0 + 1 <= k by A394;
then ex i being Element of NAT st
( 0 <= i & i < n & k = i + 1 ) by A395, Th1;
then ((1,n) -cut vs) . k = vs . k by A3, A333, A348, A318, Def1
.= y by A389, A391, A393, A396, A398, GRFUNC_1:2 ;
hence p in (1,n) -cut vs by A388, A393, A397, FUNCT_1:1; ::_thesis: verum
end;
hence Seq fvs = p1 by A331, TARSKI:1; ::_thesis: verum
end;
end;
end;
theorem :: GRAPH_2:49
for G being Graph
for vs being FinSequence of the carrier of G
for c being Chain of G st vs is_vertex_seq_of c holds
ex fc being Subset of c ex fvs being Subset of vs ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) )
proof
let G be Graph; ::_thesis: for vs being FinSequence of the carrier of G
for c being Chain of G st vs is_vertex_seq_of c holds
ex fc being Subset of c ex fvs being Subset of vs ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) )
let vs be FinSequence of the carrier of G; ::_thesis: for c being Chain of G st vs is_vertex_seq_of c holds
ex fc being Subset of c ex fvs being Subset of vs ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) )
let c be Chain of G; ::_thesis: ( vs is_vertex_seq_of c implies ex fc being Subset of c ex fvs being Subset of vs ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) ) )
assume A1: vs is_vertex_seq_of c ; ::_thesis: ex fc being Subset of c ex fvs being Subset of vs ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) )
percases ( c is simple Chain of G or not c is simple Chain of G ) ;
suppose c is simple Chain of G ; ::_thesis: ex fc being Subset of c ex fvs being Subset of vs ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) )
then reconsider sc = c as simple Chain of G ;
reconsider fvs = vs as Subset of vs by Th26;
reconsider fc = c as Subset of c by Th26;
take fc ; ::_thesis: ex fvs being Subset of vs ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) )
take fvs ; ::_thesis: ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) )
take sc ; ::_thesis: ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) )
take vs ; ::_thesis: ( Seq fc = sc & Seq fvs = vs & vs is_vertex_seq_of sc & vs . 1 = vs . 1 & vs . (len vs) = vs . (len vs) )
thus ( Seq fc = sc & Seq fvs = vs ) by FINSEQ_3:116; ::_thesis: ( vs is_vertex_seq_of sc & vs . 1 = vs . 1 & vs . (len vs) = vs . (len vs) )
thus vs is_vertex_seq_of sc by A1; ::_thesis: ( vs . 1 = vs . 1 & vs . (len vs) = vs . (len vs) )
thus ( vs . 1 = vs . 1 & vs . (len vs) = vs . (len vs) ) ; ::_thesis: verum
end;
supposeA2: c is not simple Chain of G ; ::_thesis: ex fc being Subset of c ex fvs being Subset of vs ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) )
defpred S1[ Nat] means ex fc being Subset of c ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = c1 & Seq fvs = vs1 & vs1 is_vertex_seq_of c1 & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & len c1 = $1 & c1 is not simple Chain of G );
S1[ len c]
proof
reconsider fvs = vs as Subset of vs by Th26;
reconsider fc = c as Subset of c by Th26;
take fc ; ::_thesis: ex fvs being Subset of vs ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = c1 & Seq fvs = vs1 & vs1 is_vertex_seq_of c1 & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & len c1 = len c & c1 is not simple Chain of G )
take fvs ; ::_thesis: ex c1 being Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = c1 & Seq fvs = vs1 & vs1 is_vertex_seq_of c1 & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & len c1 = len c & c1 is not simple Chain of G )
take c ; ::_thesis: ex vs1 being FinSequence of the carrier of G st
( Seq fc = c & Seq fvs = vs1 & vs1 is_vertex_seq_of c & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) & len c = len c & c is not simple Chain of G )
take vs ; ::_thesis: ( Seq fc = c & Seq fvs = vs & vs is_vertex_seq_of c & vs . 1 = vs . 1 & vs . (len vs) = vs . (len vs) & len c = len c & c is not simple Chain of G )
thus ( Seq fc = c & Seq fvs = vs ) by FINSEQ_3:116; ::_thesis: ( vs is_vertex_seq_of c & vs . 1 = vs . 1 & vs . (len vs) = vs . (len vs) & len c = len c & c is not simple Chain of G )
thus vs is_vertex_seq_of c by A1; ::_thesis: ( vs . 1 = vs . 1 & vs . (len vs) = vs . (len vs) & len c = len c & c is not simple Chain of G )
thus ( vs . 1 = vs . 1 & vs . (len vs) = vs . (len vs) ) ; ::_thesis: ( len c = len c & c is not simple Chain of G )
thus ( len c = len c & c is not simple Chain of G ) by A2; ::_thesis: verum
end;
then A3: ex k being Nat st S1[k] ;
consider k being Nat such that
A4: ( S1[k] & ( for n being Nat st S1[n] holds
k <= n ) ) from NAT_1:sch_5(A3);
consider fc being Subset of c, fvs being Subset of vs, c1 being Chain of G, vs1 being FinSequence of the carrier of G such that
A5: Seq fc = c1 and
A6: Seq fvs = vs1 and
A7: vs1 is_vertex_seq_of c1 and
A8: vs . 1 = vs1 . 1 and
A9: vs . (len vs) = vs1 . (len vs1) and
A10: len c1 = k and
A11: c1 is not simple Chain of G by A4;
consider fc1 being Subset of c1, fvs1 being Subset of vs1, c2 being Chain of G, vs2 being FinSequence of the carrier of G such that
A12: len c2 < len c1 and
A13: vs2 is_vertex_seq_of c2 and
len vs2 < len vs1 and
A14: vs1 . 1 = vs2 . 1 and
A15: vs1 . (len vs1) = vs2 . (len vs2) and
A16: Seq fc1 = c2 and
A17: Seq fvs1 = vs2 by A7, A11, Th48;
reconsider fc9 = fc | (rng ((Sgm (dom fc)) | (dom fc1))) as Subset of c by Th27;
reconsider fvs9 = fvs | (rng ((Sgm (dom fvs)) | (dom fvs1))) as Subset of vs by Th27;
A18: Seq fvs9 = vs2 by A6, A17, Th28;
A19: Seq fc9 = c2 by A5, A16, Th28;
then ( c2 is simple Chain of G implies ex fc being Subset of c ex fvs being Subset of vs ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) ) ) by A8, A9, A13, A14, A15, A18;
hence ex fc being Subset of c ex fvs being Subset of vs ex sc being simple Chain of G ex vs1 being FinSequence of the carrier of G st
( Seq fc = sc & Seq fvs = vs1 & vs1 is_vertex_seq_of sc & vs . 1 = vs1 . 1 & vs . (len vs) = vs1 . (len vs1) ) by A4, A8, A9, A10, A12, A13, A14, A15, A19, A18; ::_thesis: verum
end;
end;
end;
registration
let G be Graph;
cluster empty -> V14() for Chain of G;
correctness
coherence
for b1 being Chain of G st b1 is empty holds
b1 is V14();
;
end;
theorem :: GRAPH_2:50
for p being FinSequence
for n being Element of NAT
for G being Graph st p is Path of G holds
p | (Seg n) is Path of G
proof
let p be FinSequence; ::_thesis: for n being Element of NAT
for G being Graph st p is Path of G holds
p | (Seg n) is Path of G
let n be Element of NAT ; ::_thesis: for G being Graph st p is Path of G holds
p | (Seg n) is Path of G
let G be Graph; ::_thesis: ( p is Path of G implies p | (Seg n) is Path of G )
reconsider q = p | (Seg n) as FinSequence ;
assume A1: p is Path of G ; ::_thesis: p | (Seg n) is Path of G
now__::_thesis:_for_n1,_m1_being_Element_of_NAT_st_1_<=_n1_&_n1_<_m1_&_m1_<=_len_q_holds_
q_._n1_<>_q_._m1
let n1, m1 be Element of NAT ; ::_thesis: ( 1 <= n1 & n1 < m1 & m1 <= len q implies q . n1 <> q . m1 )
assume that
A2: 1 <= n1 and
A3: n1 < m1 and
A4: m1 <= len q ; ::_thesis: q . n1 <> q . m1
1 < m1 by A2, A3, XXREAL_0:2;
then m1 in dom q by A4, FINSEQ_3:25;
then A5: q . m1 = p . m1 by FUNCT_1:47;
n1 < len q by A3, A4, XXREAL_0:2;
then n1 in dom q by A2, FINSEQ_3:25;
then A6: q . n1 = p . n1 by FUNCT_1:47;
dom q c= dom p by RELAT_1:60;
then dom q c= Seg (len p) by FINSEQ_1:def_3;
then Seg (len q) c= Seg (len p) by FINSEQ_1:def_3;
then len q <= len p by FINSEQ_1:5;
then m1 <= len p by A4, XXREAL_0:2;
hence q . n1 <> q . m1 by A1, A2, A3, A5, A6, GRAPH_1:def_16; ::_thesis: verum
end;
hence p | (Seg n) is Path of G by A1, GRAPH_1:4, GRAPH_1:def_16; ::_thesis: verum
end;
registration
let G be Graph;
cluster Relation-like NAT -defined the carrier' of G -valued Function-like one-to-one finite FinSequence-like FinSubsequence-like simple for Chain of G;
existence
ex b1 being Path of G st b1 is simple
proof
set x = the Element of G;
set q = the empty Chain of G;
reconsider q = the empty Chain of G as V14() Chain of G ;
take q ; ::_thesis: q is simple
reconsider p = <* the Element of G*> as FinSequence of the carrier of G ;
take p ; :: according to GRAPH_2:def_9 ::_thesis: ( p is_vertex_seq_of q & ( for n, m being Element of NAT st 1 <= n & n < m & m <= len p & p . n = p . m holds
( n = 1 & m = len p ) ) )
thus p is_vertex_seq_of q by Lm8; ::_thesis: for n, m being Element of NAT st 1 <= n & n < m & m <= len p & p . n = p . m holds
( n = 1 & m = len p )
let n, m be Element of NAT ; ::_thesis: ( 1 <= n & n < m & m <= len p & p . n = p . m implies ( n = 1 & m = len p ) )
assume that
A1: 1 <= n and
A2: n < m and
A3: m <= len p and
p . n = p . m ; ::_thesis: ( n = 1 & m = len p )
1 < m by A1, A2, XXREAL_0:2;
hence ( n = 1 & m = len p ) by A3, FINSEQ_1:39; ::_thesis: verum
end;
end;
theorem :: GRAPH_2:51
for G being Graph
for sc being simple Chain of G st 2 < len sc holds
sc is Path of G
proof
let G be Graph; ::_thesis: for sc being simple Chain of G st 2 < len sc holds
sc is Path of G
let sc be simple Chain of G; ::_thesis: ( 2 < len sc implies sc is Path of G )
assume A1: 2 < len sc ; ::_thesis: sc is Path of G
assume sc is not Path of G ; ::_thesis: contradiction
then consider m, n being Element of NAT such that
A2: 1 <= m and
A3: m < n and
A4: n <= len sc and
A5: sc . m = sc . n by GRAPH_1:def_16;
consider vs being FinSequence of the carrier of G such that
A6: vs is_vertex_seq_of sc and
A7: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs ) by Def9;
A8: len vs = (len sc) + 1 by A6, Def6;
then A9: n + 1 <= len vs by A4, XREAL_1:6;
set v29 = vs /. (n + 1);
set v19 = vs /. n;
A10: 1 <= n by A2, A3, XXREAL_0:2;
then A11: sc . n joins vs /. n,vs /. (n + 1) by A4, A6, Def6;
A12: n <= len vs by A4, A8, NAT_1:12;
then A13: vs /. n = vs . n by A10, FINSEQ_4:15;
set v1 = vs /. m;
set v2 = vs /. (m + 1);
m <= len sc by A3, A4, XXREAL_0:2;
then A14: sc . m joins vs /. m,vs /. (m + 1) by A2, A6, Def6;
A15: n + 1 <= len vs by A4, A8, XREAL_1:6;
then A16: vs /. (n + 1) = vs . (n + 1) by FINSEQ_4:15, NAT_1:12;
A17: m + 1 < n + 1 by A3, XREAL_1:6;
then A18: m < n + 1 by NAT_1:12;
then m <= len vs by A15, XXREAL_0:2;
then A19: vs /. m = vs . m by A2, FINSEQ_4:15;
m + 1 <= len vs by A17, A15, XXREAL_0:2;
then A20: vs /. (m + 1) = vs . (m + 1) by FINSEQ_4:15, NAT_1:12;
percases ( ( vs /. m = vs /. n & vs /. (m + 1) = vs /. (n + 1) ) or ( vs /. m = vs /. (n + 1) & vs /. (m + 1) = vs /. n ) ) by A5, A14, A11, Th30;
supposeA21: ( vs /. m = vs /. n & vs /. (m + 1) = vs /. (n + 1) ) ; ::_thesis: contradiction
then m = 1 by A2, A3, A7, A12, A19, A13;
hence contradiction by A7, A17, A15, A20, A16, A21; ::_thesis: verum
end;
supposeA22: ( vs /. m = vs /. (n + 1) & vs /. (m + 1) = vs /. n ) ; ::_thesis: contradiction
then A23: n + 1 = len vs by A2, A7, A18, A9, A19, A16;
m = 1 by A2, A7, A18, A9, A19, A16, A22;
hence contradiction by A1, A7, A8, A12, A20, A13, A22, A23; ::_thesis: verum
end;
end;
end;
theorem :: GRAPH_2:52
for G being Graph
for sc being simple Chain of G holds
( sc is Path of G iff ( len sc = 0 or len sc = 1 or sc . 1 <> sc . 2 ) )
proof
let G be Graph; ::_thesis: for sc being simple Chain of G holds
( sc is Path of G iff ( len sc = 0 or len sc = 1 or sc . 1 <> sc . 2 ) )
let sc be simple Chain of G; ::_thesis: ( sc is Path of G iff ( len sc = 0 or len sc = 1 or sc . 1 <> sc . 2 ) )
hereby ::_thesis: ( ( len sc = 0 or len sc = 1 or sc . 1 <> sc . 2 ) implies sc is Path of G )
assume A1: sc is Path of G ; ::_thesis: ( not len sc = 0 & not len sc = 1 implies not sc . 1 = sc . 2 )
assume A2: not len sc = 0 ; ::_thesis: ( not len sc = 1 implies not sc . 1 = sc . 2 )
assume not len sc = 1 ; ::_thesis: not sc . 1 = sc . 2
then len sc > 1 by A2, NAT_1:25;
then A3: 1 + 1 <= len sc by NAT_1:13;
assume sc . 1 = sc . 2 ; ::_thesis: contradiction
hence contradiction by A1, A3, GRAPH_1:def_16; ::_thesis: verum
end;
assume A4: ( len sc = 0 or len sc = 1 or sc . 1 <> sc . 2 ) ; ::_thesis: sc is Path of G
percases ( len sc = 0 or len sc = 1 or sc . 1 <> sc . 2 ) by A4;
suppose len sc = 0 ; ::_thesis: sc is Path of G
then for n, m being Element of NAT st 1 <= n & n < m & m <= len sc holds
sc . n <> sc . m ;
hence sc is Path of G by GRAPH_1:def_16; ::_thesis: verum
end;
suppose len sc = 1 ; ::_thesis: sc is Path of G
then for n, m being Element of NAT st 1 <= n & n < m & m <= len sc holds
sc . n <> sc . m by XXREAL_0:2;
hence sc is Path of G by GRAPH_1:def_16; ::_thesis: verum
end;
supposeA5: sc . 1 <> sc . 2 ; ::_thesis: sc is Path of G
now__::_thesis:_for_n,_m_being_Element_of_NAT_st_1_<=_n_&_n_<_m_&_m_<=_len_sc_holds_
sc_._n_<>_sc_._m
let n, m be Element of NAT ; ::_thesis: ( 1 <= n & n < m & m <= len sc implies sc . n <> sc . m )
assume that
A6: 1 <= n and
A7: n < m and
A8: m <= len sc ; ::_thesis: sc . n <> sc . m
thus sc . n <> sc . m ::_thesis: verum
proof
consider vs being FinSequence of the carrier of G such that
A9: vs is_vertex_seq_of sc and
A10: for n, m being Element of NAT st 1 <= n & n < m & m <= len vs & vs . n = vs . m holds
( n = 1 & m = len vs ) by Def9;
set vm1 = vs /. (m + 1);
A11: len vs = (len sc) + 1 by A9, Def6;
then A12: m + 1 <= len vs by A8, XREAL_1:6;
then A13: vs /. (m + 1) = vs . (m + 1) by FINSEQ_4:15, NAT_1:12;
set vn1 = vs /. (n + 1);
set vn = vs /. n;
A14: n <= len sc by A7, A8, XXREAL_0:2;
then A15: sc . n joins vs /. n,vs /. (n + 1) by A6, A9, Def6;
n + 1 <= len vs by A11, A14, XREAL_1:6;
then A16: vs /. (n + 1) = vs . (n + 1) by FINSEQ_4:15, NAT_1:12;
n <= len vs by A11, A14, NAT_1:12;
then A17: vs /. n = vs . n by A6, FINSEQ_4:15;
set vm = vs /. m;
A18: 1 <= m by A6, A7, XXREAL_0:2;
then A19: sc . m joins vs /. m,vs /. (m + 1) by A8, A9, Def6;
A20: m <= len vs by A8, A11, NAT_1:12;
then A21: vs /. m = vs . m by A18, FINSEQ_4:15;
assume A22: not sc . n <> sc . m ; ::_thesis: contradiction
percases ( ( vs /. n = vs /. m & vs /. (n + 1) = vs /. (m + 1) ) or ( vs /. n = vs /. (m + 1) & vs /. (n + 1) = vs /. m ) ) by A22, A15, A19, Th30;
supposeA23: ( vs /. n = vs /. m & vs /. (n + 1) = vs /. (m + 1) ) ; ::_thesis: contradiction
A24: n + 1 < m + 1 by A7, XREAL_1:6;
n = 1 by A6, A7, A10, A20, A17, A21, A23;
hence contradiction by A10, A12, A16, A13, A23, A24; ::_thesis: verum
end;
supposeA25: ( vs /. n = vs /. (m + 1) & vs /. (n + 1) = vs /. m ) ; ::_thesis: contradiction
thus contradiction ::_thesis: verum
proof
A26: n + 1 <= m by A7, NAT_1:13;
A27: n + 0 < m + 1 by A7, XREAL_1:8;
percases ( n + 1 = m or n + 1 < m ) by A26, XXREAL_0:1;
supposeA28: n + 1 = m ; ::_thesis: contradiction
n = 1 by A6, A10, A12, A17, A13, A25, A27;
hence contradiction by A5, A22, A28; ::_thesis: verum
end;
supposeA29: n + 1 < m ; ::_thesis: contradiction
n = 1 by A6, A10, A12, A17, A13, A25, A27;
hence contradiction by A10, A20, A16, A21, A25, A29; ::_thesis: verum
end;
end;
end;
end;
end;
end;
end;
hence sc is Path of G by GRAPH_1:def_16; ::_thesis: verum
end;
end;
end;
registration
let G be Graph;
cluster empty -> oriented for Chain of G;
correctness
coherence
for b1 being Chain of G st b1 is empty holds
b1 is oriented ;
;
end;
definition
let G be Graph;
let oc be oriented Chain of G;
assume A1: oc <> {} ;
func vertex-seq oc -> FinSequence of the carrier of G means :: GRAPH_2:def 10
( it is_vertex_seq_of oc & it . 1 = the Source of G . (oc . 1) );
existence
ex b1 being FinSequence of the carrier of G st
( b1 is_vertex_seq_of oc & b1 . 1 = the Source of G . (oc . 1) )
proof
set TG = the Target of G;
set SG = the Source of G;
deffunc H1( Nat) -> set = the Source of G . (oc . $1);
consider z being FinSequence such that
A2: ( len z = len oc & ( for j being Nat st j in dom z holds
z . j = H1(j) ) ) from FINSEQ_1:sch_2();
set vs = z ^ <*( the Target of G . (oc . (len oc)))*>;
A3: len (z ^ <*( the Target of G . (oc . (len oc)))*>) = (len oc) + (len <*( the Target of G . (oc . (len oc)))*>) by A2, FINSEQ_1:22
.= (len oc) + 1 by FINSEQ_1:39 ;
A4: Seg (len z) = dom z by FINSEQ_1:def_3;
A5: Seg (len oc) = dom oc by FINSEQ_1:def_3;
0 + 1 = 1 ;
then A6: 1 <= len oc by A1, NAT_1:13;
rng (z ^ <*( the Target of G . (oc . (len oc)))*>) c= the carrier of G
proof
let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in rng (z ^ <*( the Target of G . (oc . (len oc)))*>) or y in the carrier of G )
assume y in rng (z ^ <*( the Target of G . (oc . (len oc)))*>) ; ::_thesis: y in the carrier of G
then consider x being set such that
A7: x in dom (z ^ <*( the Target of G . (oc . (len oc)))*>) and
A8: y = (z ^ <*( the Target of G . (oc . (len oc)))*>) . x by FUNCT_1:def_3;
reconsider x = x as Element of NAT by A7;
A9: 1 <= x by A7, FINSEQ_3:25;
A10: x <= len (z ^ <*( the Target of G . (oc . (len oc)))*>) by A7, FINSEQ_3:25;
percases ( x <= len oc or x = (len oc) + 1 ) by A3, A10, NAT_1:8;
supposeA11: x <= len oc ; ::_thesis: y in the carrier of G
A12: rng oc c= the carrier' of G by FINSEQ_1:def_4;
A13: x in dom oc by A9, A11, FINSEQ_3:25;
then A14: oc . x in rng oc by FUNCT_1:def_3;
then reconsider e = oc . x as Element of the carrier' of G by A12;
A15: the Source of G . e in rng the Source of G by A14, A12, FUNCT_2:4;
A16: rng the Source of G c= the carrier of G by RELAT_1:def_19;
(z ^ <*( the Target of G . (oc . (len oc)))*>) . x = z . x by A2, A5, A4, A13, FINSEQ_1:def_7
.= the Source of G . e by A2, A5, A4, A13 ;
hence y in the carrier of G by A8, A15, A16; ::_thesis: verum
end;
supposeA17: x = (len oc) + 1 ; ::_thesis: y in the carrier of G
len oc in dom oc by A6, FINSEQ_3:25;
then A18: oc . (len oc) in rng oc by FUNCT_1:def_3;
A19: rng oc c= the carrier' of G by FINSEQ_1:def_4;
then reconsider e = oc . (len oc) as Element of the carrier' of G by A18;
A20: rng the Target of G c= the carrier of G by RELAT_1:def_19;
the Target of G . e in rng the Target of G by A18, A19, FUNCT_2:4;
then y is Element of G by A2, A8, A17, A20, FINSEQ_1:42;
hence y in the carrier of G ; ::_thesis: verum
end;
end;
end;
then reconsider vs = z ^ <*( the Target of G . (oc . (len oc)))*> as FinSequence of the carrier of G by FINSEQ_1:def_4;
take vs ; ::_thesis: ( vs is_vertex_seq_of oc & vs . 1 = the Source of G . (oc . 1) )
now__::_thesis:_(_len_vs_=_(len_oc)_+_1_&_(_for_n_being_Element_of_NAT_st_1_<=_n_&_n_<=_len_oc_holds_
oc_._n_joins_vs_/._n,vs_/._(n_+_1)_)_)
thus len vs = (len oc) + 1 by A3; ::_thesis: for n being Element of NAT st 1 <= n & n <= len oc holds
oc . n joins vs /. n,vs /. (n + 1)
let n be Element of NAT ; ::_thesis: ( 1 <= n & n <= len oc implies oc . n joins vs /. n,vs /. (n + 1) )
assume that
A21: 1 <= n and
A22: n <= len oc ; ::_thesis: oc . n joins vs /. n,vs /. (n + 1)
A23: 1 <= n + 1 by NAT_1:12;
n + 1 <= len vs by A3, A22, XREAL_1:7;
then n + 1 in dom vs by A23, FINSEQ_3:25;
then reconsider vsn1 = vs . (n + 1) as Element of G by FINSEQ_2:11;
A24: vsn1 = vs /. (n + 1) by A3, A22, A23, FINSEQ_4:15, XREAL_1:7;
A25: vsn1 = the Target of G . (oc . n)
proof
percases ( n < len oc or n = len oc ) by A22, XXREAL_0:1;
supposeA26: n < len oc ; ::_thesis: vsn1 = the Target of G . (oc . n)
then n + 1 <= len oc by NAT_1:13;
then A27: n + 1 in dom oc by A23, FINSEQ_3:25;
hence vsn1 = z . (n + 1) by A2, A5, A4, FINSEQ_1:def_7
.= the Source of G . (oc . (n + 1)) by A2, A5, A4, A27
.= the Target of G . (oc . n) by A21, A26, GRAPH_1:def_15 ;
::_thesis: verum
end;
suppose n = len oc ; ::_thesis: vsn1 = the Target of G . (oc . n)
hence vsn1 = the Target of G . (oc . n) by A2, FINSEQ_1:42; ::_thesis: verum
end;
end;
end;
A28: n <= len vs by A3, A22, NAT_1:12;
then n in dom vs by A21, FINSEQ_3:25;
then reconsider vsn = vs . n as Element of G by FINSEQ_2:11;
A29: vsn = vs /. n by A21, A28, FINSEQ_4:15;
A30: n in dom oc by A21, A22, FINSEQ_3:25;
then vsn = z . n by A2, A5, A4, FINSEQ_1:def_7
.= the Source of G . (oc . n) by A2, A5, A4, A30 ;
hence oc . n joins vs /. n,vs /. (n + 1) by A25, A29, A24, GRAPH_1:def_12; ::_thesis: verum
end;
hence vs is_vertex_seq_of oc by Def6; ::_thesis: vs . 1 = the Source of G . (oc . 1)
A31: 1 in dom z by A2, A6, FINSEQ_3:25;
then z . 1 = the Source of G . (oc . 1) by A2;
hence vs . 1 = the Source of G . (oc . 1) by A31, FINSEQ_1:def_7; ::_thesis: verum
end;
uniqueness
for b1, b2 being FinSequence of the carrier of G st b1 is_vertex_seq_of oc & b1 . 1 = the Source of G . (oc . 1) & b2 is_vertex_seq_of oc & b2 . 1 = the Source of G . (oc . 1) holds
b1 = b2 by A1, Th34;
end;
:: deftheorem defines vertex-seq GRAPH_2:def_10_:_
for G being Graph
for oc being oriented Chain of G st oc <> {} holds
for b3 being FinSequence of the carrier of G holds
( b3 = vertex-seq oc iff ( b3 is_vertex_seq_of oc & b3 . 1 = the Source of G . (oc . 1) ) );
begin
theorem :: GRAPH_2:53
for D being non empty set
for f1 being non empty FinSequence of D
for f2 being FinSequence of D holds (f1 ^' f2) /. 1 = f1 /. 1
proof
let D be non empty set ; ::_thesis: for f1 being non empty FinSequence of D
for f2 being FinSequence of D holds (f1 ^' f2) /. 1 = f1 /. 1
let f1 be non empty FinSequence of D; ::_thesis: for f2 being FinSequence of D holds (f1 ^' f2) /. 1 = f1 /. 1
let f2 be FinSequence of D; ::_thesis: (f1 ^' f2) /. 1 = f1 /. 1
A1: 1 in dom f1 by FINSEQ_5:6;
1 in dom (f1 ^ ((2,(len f2)) -cut f2)) by FINSEQ_5:6;
hence (f1 ^' f2) /. 1 = (f1 ^ ((2,(len f2)) -cut f2)) . 1 by PARTFUN1:def_6
.= f1 . 1 by A1, FINSEQ_1:def_7
.= f1 /. 1 by A1, PARTFUN1:def_6 ;
::_thesis: verum
end;
theorem :: GRAPH_2:54
for D being non empty set
for f1 being FinSequence of D
for f2 being non trivial FinSequence of D holds (f1 ^' f2) /. (len (f1 ^' f2)) = f2 /. (len f2)
proof
let D be non empty set ; ::_thesis: for f1 being FinSequence of D
for f2 being non trivial FinSequence of D holds (f1 ^' f2) /. (len (f1 ^' f2)) = f2 /. (len f2)
let f1 be FinSequence of D; ::_thesis: for f2 being non trivial FinSequence of D holds (f1 ^' f2) /. (len (f1 ^' f2)) = f2 /. (len f2)
let f2 be non trivial FinSequence of D; ::_thesis: (f1 ^' f2) /. (len (f1 ^' f2)) = f2 /. (len f2)
A1: (len (f1 ^' f2)) + 1 = (len f1) + (len f2) by Th13;
2 <= len f2 by NAT_D:60;
then A2: 1 < len f2 by XXREAL_0:2;
then 1 + 0 < (len f1) + (len f2) by XREAL_1:8;
then 1 <= len (f1 ^' f2) by A1, NAT_1:13;
hence (f1 ^' f2) /. (len (f1 ^' f2)) = (f1 ^' f2) . (len (f1 ^' f2)) by FINSEQ_4:15
.= f2 . (len f2) by A2, Th16
.= f2 /. (len f2) by A2, FINSEQ_4:15 ;
::_thesis: verum
end;
theorem Th55: :: GRAPH_2:55
for f being FinSequence holds f ^' {} = f
proof
let f be FinSequence; ::_thesis: f ^' {} = f
thus f ^' {} = f ^ {} by Def1
.= f by FINSEQ_1:34 ; ::_thesis: verum
end;
theorem :: GRAPH_2:56
for x being set
for f being FinSequence holds f ^' <*x*> = f
proof
let x be set ; ::_thesis: for f being FinSequence holds f ^' <*x*> = f
let f be FinSequence; ::_thesis: f ^' <*x*> = f
len <*x*> = 1 by FINSEQ_1:39;
then (2,(len <*x*>)) -cut <*x*> = {} by Def1;
hence f ^' <*x*> = f by FINSEQ_1:34; ::_thesis: verum
end;
theorem :: GRAPH_2:57
for D being non empty set
for n being Element of NAT
for f1, f2 being FinSequence of D st 1 <= n & n <= len f1 holds
(f1 ^' f2) /. n = f1 /. n
proof
let D be non empty set ; ::_thesis: for n being Element of NAT
for f1, f2 being FinSequence of D st 1 <= n & n <= len f1 holds
(f1 ^' f2) /. n = f1 /. n
let n be Element of NAT ; ::_thesis: for f1, f2 being FinSequence of D st 1 <= n & n <= len f1 holds
(f1 ^' f2) /. n = f1 /. n
let f1, f2 be FinSequence of D; ::_thesis: ( 1 <= n & n <= len f1 implies (f1 ^' f2) /. n = f1 /. n )
assume that
A1: 1 <= n and
A2: n <= len f1 ; ::_thesis: (f1 ^' f2) /. n = f1 /. n
percases ( f2 = {} or f2 <> {} ) ;
suppose f2 = {} ; ::_thesis: (f1 ^' f2) /. n = f1 /. n
hence (f1 ^' f2) /. n = f1 /. n by Th55; ::_thesis: verum
end;
supposeA3: f2 <> {} ; ::_thesis: (f1 ^' f2) /. n = f1 /. n
then A4: (len f1) + 0 < (len f1) + (len f2) by XREAL_1:6;
(len (f1 ^' f2)) + 1 = (len f1) + (len f2) by A3, Th13;
then n < (len (f1 ^' f2)) + 1 by A2, A4, XXREAL_0:2;
then n <= len (f1 ^' f2) by NAT_1:13;
hence (f1 ^' f2) /. n = (f1 ^' f2) . n by A1, FINSEQ_4:15
.= f1 . n by A1, A2, Th14
.= f1 /. n by A1, A2, FINSEQ_4:15 ;
::_thesis: verum
end;
end;
end;
theorem :: GRAPH_2:58
for D being non empty set
for n being Element of NAT
for f1, f2 being FinSequence of D st 1 <= n & n < len f2 holds
(f1 ^' f2) /. ((len f1) + n) = f2 /. (n + 1)
proof
let D be non empty set ; ::_thesis: for n being Element of NAT
for f1, f2 being FinSequence of D st 1 <= n & n < len f2 holds
(f1 ^' f2) /. ((len f1) + n) = f2 /. (n + 1)
let n be Element of NAT ; ::_thesis: for f1, f2 being FinSequence of D st 1 <= n & n < len f2 holds
(f1 ^' f2) /. ((len f1) + n) = f2 /. (n + 1)
let f1, f2 be FinSequence of D; ::_thesis: ( 1 <= n & n < len f2 implies (f1 ^' f2) /. ((len f1) + n) = f2 /. (n + 1) )
assume that
A1: 1 <= n and
A2: n < len f2 ; ::_thesis: (f1 ^' f2) /. ((len f1) + n) = f2 /. (n + 1)
A3: n + 1 <= len f2 by A2, NAT_1:13;
A4: now__::_thesis:_(len_f1)_+_n_<=_len_(f1_^'_f2)
percases ( f2 <> {} or f2 = {} ) ;
supposeA5: f2 <> {} ; ::_thesis: (len f1) + n <= len (f1 ^' f2)
A6: (len f1) + n < (len f1) + (len f2) by A2, XREAL_1:6;
(len (f1 ^' f2)) + 1 = (len f1) + (len f2) by A5, Th13;
hence (len f1) + n <= len (f1 ^' f2) by A6, NAT_1:13; ::_thesis: verum
end;
suppose f2 = {} ; ::_thesis: (len f1) + n <= len (f1 ^' f2)
hence (len f1) + n <= len (f1 ^' f2) by A2; ::_thesis: verum
end;
end;
end;
A7: 0 + 1 <= n + 1 by XREAL_1:6;
0 + 1 <= (len f1) + n by A1, XREAL_1:7;
hence (f1 ^' f2) /. ((len f1) + n) = (f1 ^' f2) . ((len f1) + n) by A4, FINSEQ_4:15
.= f2 . (n + 1) by A1, A2, Th15
.= f2 /. (n + 1) by A7, A3, FINSEQ_4:15 ;
::_thesis: verum
end;
definition
let F be FinSequence of INT ;
let m, n be Element of NAT ;
assume that
A1: 1 <= m and
A2: m <= n and
A3: n <= len F ;
func min_at (F,m,n) -> Element of NAT means :Def11: :: GRAPH_2:def 11
ex X being non empty finite Subset of INT st
( X = rng ((m,n) -cut F) & it + 1 = ((min X) .. ((m,n) -cut F)) + m );
existence
ex b1 being Element of NAT ex X being non empty finite Subset of INT st
( X = rng ((m,n) -cut F) & b1 + 1 = ((min X) .. ((m,n) -cut F)) + m )
proof
set Cut = (m,n) -cut F;
set X = rng ((m,n) -cut F);
m < n + 1 by A2, NAT_1:13;
then A4: m - m < (n + 1) - m by XREAL_1:9;
(len ((m,n) -cut F)) + m = n + 1 by A1, A2, A3, Def1;
then A5: not (m,n) -cut F is empty by A4;
rng ((m,n) -cut F) is Subset of INT ;
then reconsider X = rng ((m,n) -cut F) as non empty finite Subset of INT by A5;
set q = (((min X) .. ((m,n) -cut F)) + m) - 1;
1 - 1 <= m - 1 by A1, XREAL_1:9;
then 0 + 0 <= ((min X) .. ((m,n) -cut F)) + (m - 1) ;
then reconsider q = (((min X) .. ((m,n) -cut F)) + m) - 1 as Element of NAT by INT_1:3;
take q ; ::_thesis: ex X being non empty finite Subset of INT st
( X = rng ((m,n) -cut F) & q + 1 = ((min X) .. ((m,n) -cut F)) + m )
take X ; ::_thesis: ( X = rng ((m,n) -cut F) & q + 1 = ((min X) .. ((m,n) -cut F)) + m )
thus X = rng ((m,n) -cut F) ; ::_thesis: q + 1 = ((min X) .. ((m,n) -cut F)) + m
thus q + 1 = ((min X) .. ((m,n) -cut F)) + m ; ::_thesis: verum
end;
uniqueness
for b1, b2 being Element of NAT st ex X being non empty finite Subset of INT st
( X = rng ((m,n) -cut F) & b1 + 1 = ((min X) .. ((m,n) -cut F)) + m ) & ex X being non empty finite Subset of INT st
( X = rng ((m,n) -cut F) & b2 + 1 = ((min X) .. ((m,n) -cut F)) + m ) holds
b1 = b2 ;
end;
:: deftheorem Def11 defines min_at GRAPH_2:def_11_:_
for F being FinSequence of INT
for m, n being Element of NAT st 1 <= m & m <= n & n <= len F holds
for b4 being Element of NAT holds
( b4 = min_at (F,m,n) iff ex X being non empty finite Subset of INT st
( X = rng ((m,n) -cut F) & b4 + 1 = ((min X) .. ((m,n) -cut F)) + m ) );
theorem Th59: :: GRAPH_2:59
for F being FinSequence of INT
for m, n, ma being Element of NAT st 1 <= m & m <= n & n <= len F holds
( ma = min_at (F,m,n) iff ( m <= ma & ma <= n & ( for i being Element of NAT st m <= i & i <= n holds
F . ma <= F . i ) & ( for i being Element of NAT st m <= i & i < ma holds
F . ma < F . i ) ) )
proof
let F be FinSequence of INT ; ::_thesis: for m, n, ma being Element of NAT st 1 <= m & m <= n & n <= len F holds
( ma = min_at (F,m,n) iff ( m <= ma & ma <= n & ( for i being Element of NAT st m <= i & i <= n holds
F . ma <= F . i ) & ( for i being Element of NAT st m <= i & i < ma holds
F . ma < F . i ) ) )
let m, n, ma be Element of NAT ; ::_thesis: ( 1 <= m & m <= n & n <= len F implies ( ma = min_at (F,m,n) iff ( m <= ma & ma <= n & ( for i being Element of NAT st m <= i & i <= n holds
F . ma <= F . i ) & ( for i being Element of NAT st m <= i & i < ma holds
F . ma < F . i ) ) ) )
assume that
A1: 1 <= m and
A2: m <= n and
A3: n <= len F ; ::_thesis: ( ma = min_at (F,m,n) iff ( m <= ma & ma <= n & ( for i being Element of NAT st m <= i & i <= n holds
F . ma <= F . i ) & ( for i being Element of NAT st m <= i & i < ma holds
F . ma < F . i ) ) )
set Cut = (m,n) -cut F;
A4: (len ((m,n) -cut F)) + m = n + 1 by A1, A2, A3, Def1;
hereby ::_thesis: ( m <= ma & ma <= n & ( for i being Element of NAT st m <= i & i <= n holds
F . ma <= F . i ) & ( for i being Element of NAT st m <= i & i < ma holds
F . ma < F . i ) implies ma = min_at (F,m,n) )
A5: n - m < (n - m) + 1 by XREAL_1:29;
assume ma = min_at (F,m,n) ; ::_thesis: ( m <= ma & ma <= n & ( for i being Element of NAT st m <= i & i <= n holds
F . ma <= F . i ) & ( for i being Element of NAT st m <= i & i < ma holds
F . ma < F . i ) )
then consider X being non empty finite Subset of INT such that
A6: X = rng ((m,n) -cut F) and
A7: ma + 1 = ((min X) .. ((m,n) -cut F)) + m by A1, A2, A3, Def11;
A8: ma = (((min X) .. ((m,n) -cut F)) - 1) + m by A7;
A9: ma = (((min X) .. ((m,n) -cut F)) + m) - 1 by A7;
A10: min X in X by XXREAL_2:def_7;
then A11: 1 <= (min X) .. ((m,n) -cut F) by A6, FINSEQ_4:21;
then 1 - 1 <= ((min X) .. ((m,n) -cut F)) - 1 by XREAL_1:9;
then reconsider i1 = ((min X) .. ((m,n) -cut F)) - 1 as Element of NAT by INT_1:3;
A12: (min X) .. ((m,n) -cut F) <= len ((m,n) -cut F) by A6, A10, FINSEQ_4:21;
then i1 < len ((m,n) -cut F) by XREAL_1:146, XXREAL_0:2;
then A13: F . ma = ((m,n) -cut F) . (i1 + 1) by A1, A2, A3, A8, Def1
.= ((m,n) -cut F) . ((ma + 1) - m) by A7 ;
((min X) .. ((m,n) -cut F)) + m <= (len ((m,n) -cut F)) + m by A12, XREAL_1:6;
then A14: ma <= ((len ((m,n) -cut F)) + m) - 1 by A9, XREAL_1:9;
m + 1 <= ((min X) .. ((m,n) -cut F)) + m by A11, XREAL_1:6;
then (m + 1) - 1 <= ma by A9, XREAL_1:9;
hence ( m <= ma & ma <= n ) by A4, A14; ::_thesis: ( ( for i being Element of NAT st m <= i & i <= n holds
F . ma <= F . i ) & ( for i being Element of NAT st m <= i & i < ma holds
F . ma < F . i ) )
A15: ((m,n) -cut F) . ((min X) .. ((m,n) -cut F)) = min X by A6, A10, FINSEQ_4:19;
thus A16: for i being Element of NAT st m <= i & i <= n holds
F . ma <= F . i ::_thesis: for i being Element of NAT st m <= i & i < ma holds
F . ma < F . i
proof
let i be Element of NAT ; ::_thesis: ( m <= i & i <= n implies F . ma <= F . i )
assume that
A17: m <= i and
A18: i <= n ; ::_thesis: F . ma <= F . i
m - m <= i - m by A17, XREAL_1:9;
then reconsider i1 = i - m as Element of NAT by INT_1:3;
A19: 0 + 1 <= i1 + 1 by XREAL_1:6;
A20: n - m < (n - m) + 1 by XREAL_1:29;
i1 <= n - m by A18, XREAL_1:9;
then A21: i1 < len ((m,n) -cut F) by A4, A20, XXREAL_0:2;
then i1 + 1 <= len ((m,n) -cut F) by NAT_1:13;
then A22: i1 + 1 in dom ((m,n) -cut F) by A19, FINSEQ_3:25;
((m,n) -cut F) . (i1 + 1) = F . (m + i1) by A1, A2, A3, A21, Def1;
then F . i in rng ((m,n) -cut F) by A22, FUNCT_1:def_3;
hence F . ma <= F . i by A6, A7, A13, A15, XXREAL_2:def_7; ::_thesis: verum
end;
let i be Element of NAT ; ::_thesis: ( m <= i & i < ma implies F . ma < F . i )
assume that
A23: m <= i and
A24: i < ma ; ::_thesis: F . ma < F . i
A25: i <= n by A4, A14, A24, XXREAL_0:2;
then A26: F . ma <= F . i by A16, A23;
m - m <= i - m by A23, XREAL_1:9;
then reconsider i1 = i - m as Element of NAT by INT_1:3;
reconsider k = i1 + 1 as Element of NAT ;
i <= ((len ((m,n) -cut F)) - 1) + m by A14, A24, XXREAL_0:2;
then i - m <= (len ((m,n) -cut F)) - 1 by XREAL_1:20;
then A27: k <= len ((m,n) -cut F) by XREAL_1:19;
i1 <= n - m by A25, XREAL_1:9;
then A28: i1 < len ((m,n) -cut F) by A4, A5, XXREAL_0:2;
0 + 1 <= k by XREAL_1:6;
then A29: k in dom ((m,n) -cut F) by A27, FINSEQ_3:25;
i - m < ma - m by A24, XREAL_1:9;
then A30: k < (ma - m) + 1 by XREAL_1:6;
F . i = F . (i1 + m)
.= ((m,n) -cut F) . k by A1, A2, A3, A28, Def1 ;
then F . i <> F . ma by A6, A7, A10, A13, A30, A29, FINSEQ_4:19, FINSEQ_4:24;
hence F . ma < F . i by A26, XXREAL_0:1; ::_thesis: verum
end;
set Cut = (m,n) -cut F;
A31: (len ((m,n) -cut F)) + m = n + 1 by A1, A2, A3, Def1;
then A32: len ((m,n) -cut F) = (n + 1) - m ;
set X = rng ((m,n) -cut F);
A33: rng ((m,n) -cut F) is Subset of INT ;
m < n + 1 by A2, NAT_1:13;
then m - m < (n + 1) - m by XREAL_1:9;
then not (m,n) -cut F is empty by A31;
then reconsider X = rng ((m,n) -cut F) as non empty finite Subset of INT by A33;
reconsider rX = X as non empty finite Subset of REAL by MEMBERED:3;
assume that
A34: m <= ma and
A35: ma <= n and
A36: for i being Element of NAT st m <= i & i <= n holds
F . ma <= F . i and
A37: for i being Element of NAT st m <= i & i < ma holds
F . ma < F . i ; ::_thesis: ma = min_at (F,m,n)
m - m <= ma - m by A34, XREAL_1:9;
then reconsider qm = ma - m as Element of NAT by INT_1:3;
A38: qm + 1 = (ma + 1) - m ;
then reconsider q1 = (ma + 1) - m as Element of NAT ;
ma + 1 <= n + 1 by A35, XREAL_1:6;
then A39: q1 <= len ((m,n) -cut F) by A32, XREAL_1:9;
0 + 1 <= qm + 1 by XREAL_1:6;
then A40: q1 in dom ((m,n) -cut F) by A39, FINSEQ_3:25;
A41: ma = qm + m ;
qm < len ((m,n) -cut F) by A38, A39, NAT_1:13;
then A42: F . ma = ((m,n) -cut F) . ((ma + 1) - m) by A1, A2, A3, A38, A41, Def1;
now__::_thesis:_(_F_._ma_in_X_&_(_for_k_being_ext-real_number_st_k_in_X_holds_
F_._ma_<=_k_)_)
thus F . ma in X by A40, A42, FUNCT_1:def_3; ::_thesis: for k being ext-real number st k in X holds
F . ma <= k
let k be ext-real number ; ::_thesis: ( k in X implies F . ma <= k )
assume k in X ; ::_thesis: F . ma <= k
then consider dk being set such that
A43: dk in dom ((m,n) -cut F) and
A44: ((m,n) -cut F) . dk = k by FUNCT_1:def_3;
reconsider dk = dk as Element of NAT by A43;
1 <= dk by A43, FINSEQ_3:25;
then 1 - 1 <= dk - 1 by XREAL_1:9;
then reconsider dk1 = dk - 1 as Element of NAT by INT_1:3;
A45: dk <= len ((m,n) -cut F) by A43, FINSEQ_3:25;
then dk + m <= (len ((m,n) -cut F)) + m by XREAL_1:6;
then A46: (dk + m) - 1 <= n by A4, XREAL_1:20;
dk1 < len ((m,n) -cut F) by A45, XREAL_1:146, XXREAL_0:2;
then F . (dk1 + m) = ((m,n) -cut F) . (dk1 + 1) by A1, A2, A3, Def1
.= ((m,n) -cut F) . dk ;
hence F . ma <= k by A36, A44, A46, NAT_1:12; ::_thesis: verum
end;
then A47: F . ma = min rX by XXREAL_2:def_7;
set mX = min X;
set mXC = (min X) .. ((m,n) -cut F);
A48: min X in X by XXREAL_2:def_7;
then 1 <= (min X) .. ((m,n) -cut F) by FINSEQ_4:21;
then 1 - 1 <= ((min X) .. ((m,n) -cut F)) - 1 by XREAL_1:9;
then reconsider mXC1 = ((min X) .. ((m,n) -cut F)) - 1 as Element of NAT by INT_1:3;
set mXCm = mXC1 + m;
(min X) .. ((m,n) -cut F) <= len ((m,n) -cut F) by A48, FINSEQ_4:21;
then A49: mXC1 < len ((m,n) -cut F) by XREAL_1:146, XXREAL_0:2;
(min X) .. ((m,n) -cut F) = mXC1 + 1 ;
then A50: F . (mXC1 + m) = ((m,n) -cut F) . ((min X) .. ((m,n) -cut F)) by A1, A2, A3, A49, Def1;
A51: m <= mXC1 + m by NAT_1:12;
A52: ((m,n) -cut F) . ((min X) .. ((m,n) -cut F)) = min X by A48, FINSEQ_4:19;
now__::_thesis:_not_q1_<>_(min_X)_.._((m,n)_-cut_F)
assume A53: q1 <> (min X) .. ((m,n) -cut F) ; ::_thesis: contradiction
percases ( q1 < (min X) .. ((m,n) -cut F) or q1 > (min X) .. ((m,n) -cut F) ) by A53, XXREAL_0:1;
suppose q1 < (min X) .. ((m,n) -cut F) ; ::_thesis: contradiction
hence contradiction by A40, A42, A47, FINSEQ_4:24; ::_thesis: verum
end;
suppose q1 > (min X) .. ((m,n) -cut F) ; ::_thesis: contradiction
then ((min X) .. ((m,n) -cut F)) + m < ma + 1 by XREAL_1:20;
then (((min X) .. ((m,n) -cut F)) + m) - 1 < ma by XREAL_1:19;
hence contradiction by A37, A52, A47, A51, A50; ::_thesis: verum
end;
end;
end;
then ma + 1 = ((min X) .. ((m,n) -cut F)) + m ;
hence ma = min_at (F,m,n) by A1, A2, A3, Def11; ::_thesis: verum
end;
theorem :: GRAPH_2:60
for F being FinSequence of INT
for m being Element of NAT st 1 <= m & m <= len F holds
min_at (F,m,m) = m
proof
let F be FinSequence of INT ; ::_thesis: for m being Element of NAT st 1 <= m & m <= len F holds
min_at (F,m,m) = m
let m be Element of NAT ; ::_thesis: ( 1 <= m & m <= len F implies min_at (F,m,m) = m )
assume that
A1: 1 <= m and
A2: m <= len F ; ::_thesis: min_at (F,m,m) = m
A3: for i being Element of NAT st m <= i & i < m holds
F . m < F . i ;
for i being Element of NAT st m <= i & i <= m holds
F . m <= F . i by XXREAL_0:1;
hence min_at (F,m,m) = m by A1, A2, A3, Th59; ::_thesis: verum
end;
definition
let F be FinSequence of INT ;
let m, n be Element of NAT ;
predF is_non_decreasing_on m,n means :Def12: :: GRAPH_2:def 12
for i, j being Element of NAT st m <= i & i <= j & j <= n holds
F . i <= F . j;
end;
:: deftheorem Def12 defines is_non_decreasing_on GRAPH_2:def_12_:_
for F being FinSequence of INT
for m, n being Element of NAT holds
( F is_non_decreasing_on m,n iff for i, j being Element of NAT st m <= i & i <= j & j <= n holds
F . i <= F . j );
definition
let F be FinSequence of INT ;
let n be Element of NAT ;
predF is_split_at n means :Def13: :: GRAPH_2:def 13
for i, j being Element of NAT st 1 <= i & i <= n & n < j & j <= len F holds
F . i <= F . j;
end;
:: deftheorem Def13 defines is_split_at GRAPH_2:def_13_:_
for F being FinSequence of INT
for n being Element of NAT holds
( F is_split_at n iff for i, j being Element of NAT st 1 <= i & i <= n & n < j & j <= len F holds
F . i <= F . j );
theorem :: GRAPH_2:61
for F, F1 being FinSequence of INT
for k, ma being Element of NAT st k + 1 <= len F & ma = min_at (F,(k + 1),(len F)) & F is_split_at k & F is_non_decreasing_on 1,k & F1 = (F +* ((k + 1),(F . ma))) +* (ma,(F . (k + 1))) holds
F1 is_non_decreasing_on 1,k + 1
proof
let F, F1 be FinSequence of INT ; ::_thesis: for k, ma being Element of NAT st k + 1 <= len F & ma = min_at (F,(k + 1),(len F)) & F is_split_at k & F is_non_decreasing_on 1,k & F1 = (F +* ((k + 1),(F . ma))) +* (ma,(F . (k + 1))) holds
F1 is_non_decreasing_on 1,k + 1
let k, ma be Element of NAT ; ::_thesis: ( k + 1 <= len F & ma = min_at (F,(k + 1),(len F)) & F is_split_at k & F is_non_decreasing_on 1,k & F1 = (F +* ((k + 1),(F . ma))) +* (ma,(F . (k + 1))) implies F1 is_non_decreasing_on 1,k + 1 )
assume that
A1: k + 1 <= len F and
A2: ma = min_at (F,(k + 1),(len F)) and
A3: F is_split_at k and
A4: F is_non_decreasing_on 1,k and
A5: F1 = (F +* ((k + 1),(F . ma))) +* (ma,(F . (k + 1))) ; ::_thesis: F1 is_non_decreasing_on 1,k + 1
A6: 1 <= k + 1 by NAT_1:12;
set Fk = F +* ((k + 1),(F . ma));
A7: dom F1 = dom (F +* ((k + 1),(F . ma))) by A5, FUNCT_7:30;
A8: dom (F +* ((k + 1),(F . ma))) = dom F by FUNCT_7:30;
then A9: k + 1 in dom F1 by A1, A7, A6, FINSEQ_3:25;
let i, j be Element of NAT ; :: according to GRAPH_2:def_12 ::_thesis: ( 1 <= i & i <= j & j <= k + 1 implies F1 . i <= F1 . j )
assume that
A10: 1 <= i and
A11: i <= j and
A12: j <= k + 1 ; ::_thesis: F1 . i <= F1 . j
A13: j <= len F by A1, A12, XXREAL_0:2;
1 <= j by A10, A11, XXREAL_0:2;
then A14: j in dom F1 by A7, A8, A13, FINSEQ_3:25;
percases ( j < k + 1 or j = k + 1 ) by A12, XXREAL_0:1;
supposeA15: j < k + 1 ; ::_thesis: F1 . i <= F1 . j
then i < k + 1 by A11, XXREAL_0:2;
then i <> ma by A1, A2, A6, Th59;
then A16: F1 . i = (F +* ((k + 1),(F . ma))) . i by A5, FUNCT_7:32
.= F . i by A11, A15, FUNCT_7:32 ;
j <> ma by A1, A2, A6, A15, Th59;
then A17: F1 . j = (F +* ((k + 1),(F . ma))) . j by A5, FUNCT_7:32
.= F . j by A15, FUNCT_7:32 ;
j <= k by A15, NAT_1:13;
hence F1 . i <= F1 . j by A4, A10, A11, A16, A17, Def12; ::_thesis: verum
end;
supposeA18: j = k + 1 ; ::_thesis: F1 . i <= F1 . j
thus F1 . i <= F1 . j ::_thesis: verum
proof
percases ( i < j or i = j ) by A11, XXREAL_0:1;
supposeA19: i < j ; ::_thesis: F1 . i <= F1 . j
then i <> ma by A1, A2, A6, A18, Th59;
then A20: F1 . i = (F +* ((k + 1),(F . ma))) . i by A5, FUNCT_7:32
.= F . i by A18, A19, FUNCT_7:32 ;
A21: i <= k by A18, A19, NAT_1:13;
A22: k < j by A18, NAT_1:13;
thus F1 . i <= F1 . j ::_thesis: verum
proof
percases ( k + 1 = ma or k + 1 <> ma ) ;
suppose k + 1 = ma ; ::_thesis: F1 . i <= F1 . j
then F1 . j = F . (k + 1) by A5, A7, A9, A18, FUNCT_7:31;
hence F1 . i <= F1 . j by A1, A3, A10, A18, A20, A21, A22, Def13; ::_thesis: verum
end;
supposeA23: k + 1 <> ma ; ::_thesis: F1 . i <= F1 . j
A24: ma <= len F by A1, A2, A6, Th59;
k + 1 <= ma by A1, A2, A6, Th59;
then A25: k < ma by NAT_1:13;
F1 . j = (F +* ((k + 1),(F . ma))) . j by A5, A18, A23, FUNCT_7:32
.= F . ma by A7, A8, A14, A18, FUNCT_7:31 ;
hence F1 . i <= F1 . j by A3, A10, A20, A21, A25, A24, Def13; ::_thesis: verum
end;
end;
end;
end;
suppose i = j ; ::_thesis: F1 . i <= F1 . j
hence F1 . i <= F1 . j ; ::_thesis: verum
end;
end;
end;
end;
end;
end;
theorem :: GRAPH_2:62
for F, F1 being FinSequence of INT
for k, ma being Element of NAT st k + 1 <= len F & ma = min_at (F,(k + 1),(len F)) & F is_split_at k & F1 = (F +* ((k + 1),(F . ma))) +* (ma,(F . (k + 1))) holds
F1 is_split_at k + 1
proof
let F, F1 be FinSequence of INT ; ::_thesis: for k, ma being Element of NAT st k + 1 <= len F & ma = min_at (F,(k + 1),(len F)) & F is_split_at k & F1 = (F +* ((k + 1),(F . ma))) +* (ma,(F . (k + 1))) holds
F1 is_split_at k + 1
let k, ma be Element of NAT ; ::_thesis: ( k + 1 <= len F & ma = min_at (F,(k + 1),(len F)) & F is_split_at k & F1 = (F +* ((k + 1),(F . ma))) +* (ma,(F . (k + 1))) implies F1 is_split_at k + 1 )
assume that
A1: k + 1 <= len F and
A2: ma = min_at (F,(k + 1),(len F)) and
A3: F is_split_at k and
A4: F1 = (F +* ((k + 1),(F . ma))) +* (ma,(F . (k + 1))) ; ::_thesis: F1 is_split_at k + 1
A5: dom F1 = dom (F +* ((k + 1),(F . ma))) by A4, FUNCT_7:30;
A6: k < k + 1 by NAT_1:13;
A7: 1 <= k + 1 by NAT_1:12;
let i, j be Element of NAT ; :: according to GRAPH_2:def_13 ::_thesis: ( 1 <= i & i <= k + 1 & k + 1 < j & j <= len F1 implies F1 . i <= F1 . j )
assume that
A8: 1 <= i and
A9: i <= k + 1 and
A10: k + 1 < j and
A11: j <= len F1 ; ::_thesis: F1 . i <= F1 . j
A12: k < j by A10, NAT_1:13;
A13: dom (F +* ((k + 1),(F . ma))) = dom F by FUNCT_7:30;
then A14: len F1 = len F by A5, FINSEQ_3:29;
then A15: k + 1 <= len F by A10, A11, XXREAL_0:2;
i <= len F1 by A1, A14, A9, XXREAL_0:2;
then A16: i in dom F1 by A8, FINSEQ_3:25;
1 <= j by A10, NAT_1:12;
then A17: j in dom F1 by A11, FINSEQ_3:25;
percases ( i < k + 1 or i = k + 1 ) by A9, XXREAL_0:1;
supposeA18: i < k + 1 ; ::_thesis: F1 . i <= F1 . j
then i <> ma by A1, A2, A7, Th59;
then A19: F1 . i = (F +* ((k + 1),(F . ma))) . i by A4, FUNCT_7:32
.= F . i by A18, FUNCT_7:32 ;
A20: i <= k by A18, NAT_1:13;
thus F1 . i <= F1 . j ::_thesis: verum
proof
percases ( j <> ma or j = ma ) ;
suppose j <> ma ; ::_thesis: F1 . i <= F1 . j
then F1 . j = (F +* ((k + 1),(F . ma))) . j by A4, FUNCT_7:32
.= F . j by A10, FUNCT_7:32 ;
hence F1 . i <= F1 . j by A3, A14, A8, A11, A12, A20, A19, Def13; ::_thesis: verum
end;
suppose j = ma ; ::_thesis: F1 . i <= F1 . j
then F1 . j = F . (k + 1) by A4, A5, A17, FUNCT_7:31;
hence F1 . i <= F1 . j by A3, A6, A8, A15, A20, A19, Def13; ::_thesis: verum
end;
end;
end;
end;
supposeA21: i = k + 1 ; ::_thesis: F1 . i <= F1 . j
A22: F1 . i = F . ma
proof
percases ( k + 1 = ma or k + 1 <> ma ) ;
suppose k + 1 = ma ; ::_thesis: F1 . i = F . ma
hence F1 . i = F . ma by A4, A5, A16, A21, FUNCT_7:31; ::_thesis: verum
end;
suppose k + 1 <> ma ; ::_thesis: F1 . i = F . ma
hence F1 . i = (F +* ((k + 1),(F . ma))) . i by A4, A21, FUNCT_7:32
.= F . ma by A5, A13, A16, A21, FUNCT_7:31 ;
::_thesis: verum
end;
end;
end;
thus F1 . i <= F1 . j ::_thesis: verum
proof
percases ( j = ma or j <> ma ) ;
suppose j = ma ; ::_thesis: F1 . i <= F1 . j
then F1 . j = F . (k + 1) by A4, A5, A17, FUNCT_7:31;
hence F1 . i <= F1 . j by A1, A2, A7, A22, Th59; ::_thesis: verum
end;
suppose j <> ma ; ::_thesis: F1 . i <= F1 . j
then F1 . j = (F +* ((k + 1),(F . ma))) . j by A4, FUNCT_7:32
.= F . j by A10, FUNCT_7:32 ;
hence F1 . i <= F1 . j by A1, A2, A14, A7, A10, A11, A22, Th59; ::_thesis: verum
end;
end;
end;
end;
end;
end;
theorem :: GRAPH_2:63
for f being FinSequence of INT
for m, n being Element of NAT st m >= n holds
f is_non_decreasing_on m,n
proof
let f be FinSequence of INT ; ::_thesis: for m, n being Element of NAT st m >= n holds
f is_non_decreasing_on m,n
let m, n be Element of NAT ; ::_thesis: ( m >= n implies f is_non_decreasing_on m,n )
assume A1: m >= n ; ::_thesis: f is_non_decreasing_on m,n
let i, j be Element of NAT ; :: according to GRAPH_2:def_12 ::_thesis: ( m <= i & i <= j & j <= n implies f . i <= f . j )
assume that
A2: ( m <= i & i <= j ) and
A3: j <= n ; ::_thesis: f . i <= f . j
A4: m <= j by A2, XXREAL_0:2;
percases ( m = n or m > n ) by A1, XXREAL_0:1;
suppose m = n ; ::_thesis: f . i <= f . j
then j = m by A3, A4, XXREAL_0:1;
hence f . i <= f . j by A2, XXREAL_0:1; ::_thesis: verum
end;
suppose m > n ; ::_thesis: f . i <= f . j
hence f . i <= f . j by A3, A4, XXREAL_0:2; ::_thesis: verum
end;
end;
end;