:: GRAPH_3 semantic presentation begin definition let D be set ; let T be non empty FinSequenceSet of D; let S be non empty Subset of T; :: original: Element redefine mode Element of S -> FinSequence of D; coherence for b1 being Element of S holds b1 is FinSequence of D proof let x be Element of S; ::_thesis: x is FinSequence of D x is Element of T ; hence x is FinSequence of D ; ::_thesis: verum end; end; registration let i, j be even Integer; clusteri - j -> even ; coherence i - j is even proof 2 divides j by ABIAN:def_1; then consider l being Integer such that A1: j = 2 * l by INT_1:def_3; 2 divides i by ABIAN:def_1; then consider k being Integer such that A2: i = 2 * k by INT_1:def_3; i - j = 2 * (k - l) by A2, A1; hence i - j is even ; ::_thesis: verum end; end; theorem :: GRAPH_3:1 for i, j being Integer holds ( ( i is even iff j is even ) iff i - j is even ) ; Lm1: 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 n < m by XREAL_1:29; then (m,n) -cut p = {} by GRAPH_2:def_1; 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) ( not 1 <= m or not m <= n or not n <= len p ) by A5, XREAL_1:29; hence for i being Element of NAT st i < len ((m,n) -cut p) holds ((m,n) -cut p) . (i + 1) = p . (m + i) by CARD_1:27, GRAPH_2:def_1; ::_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, GRAPH_2:def_1; ::_thesis: verum end; end; end; theorem Th2: :: GRAPH_3:2 for p being FinSequence for m, n, a being Element of NAT st a in dom ((m,n) -cut p) holds ex k being Element of NAT st ( k in dom p & p . k = ((m,n) -cut p) . a & k + 1 = m + a & m <= k & k <= n ) proof let p be FinSequence; ::_thesis: for m, n, a being Element of NAT st a in dom ((m,n) -cut p) holds ex k being Element of NAT st ( k in dom p & p . k = ((m,n) -cut p) . a & k + 1 = m + a & m <= k & k <= n ) let m, n, a be Element of NAT ; ::_thesis: ( a in dom ((m,n) -cut p) implies ex k being Element of NAT st ( k in dom p & p . k = ((m,n) -cut p) . a & k + 1 = m + a & m <= k & k <= n ) ) assume A1: a in dom ((m,n) -cut p) ; ::_thesis: ex k being Element of NAT st ( k in dom p & p . k = ((m,n) -cut p) . a & k + 1 = m + a & m <= k & k <= n ) set cp = (m,n) -cut p; A2: a <= len ((m,n) -cut p) by A1, FINSEQ_3:25; percases ( ( 1 <= m & m <= n & n <= len p ) or not 1 <= m or not m <= n or not n <= len p ) ; supposeA3: ( 1 <= m & m <= n & n <= len p ) ; ::_thesis: ex k being Element of NAT st ( k in dom p & p . k = ((m,n) -cut p) . a & k + 1 = m + a & m <= k & k <= n ) 0 + 1 <= a by A1, FINSEQ_3:25; then consider i1 being Element of NAT such that 0 <= i1 and A4: i1 < len ((m,n) -cut p) and A5: a = i1 + 1 by A2, GRAPH_2:1; take k = m + i1; ::_thesis: ( k in dom p & p . k = ((m,n) -cut p) . a & k + 1 = m + a & m <= k & k <= n ) m <= k by NAT_1:11; then A6: 1 <= k by A3, XXREAL_0:2; A7: (len ((m,n) -cut p)) + m = n + 1 by A3, GRAPH_2:def_1; A8: m + i1 < m + (len ((m,n) -cut p)) by A4, XREAL_1:6; then m + i1 <= n by A7, NAT_1:13; then k <= len p by A3, XXREAL_0:2; hence k in dom p by A6, FINSEQ_3:25; ::_thesis: ( p . k = ((m,n) -cut p) . a & k + 1 = m + a & m <= k & k <= n ) thus p . k = ((m,n) -cut p) . a by A3, A4, A5, GRAPH_2:def_1; ::_thesis: ( k + 1 = m + a & m <= k & k <= n ) thus k + 1 = m + a by A5; ::_thesis: ( m <= k & k <= n ) thus ( m <= k & k <= n ) by A7, A8, NAT_1:11, NAT_1:13; ::_thesis: verum end; suppose ( not 1 <= m or not m <= n or not n <= len p ) ; ::_thesis: ex k being Element of NAT st ( k in dom p & p . k = ((m,n) -cut p) . a & k + 1 = m + a & m <= k & k <= n ) hence ex k being Element of NAT st ( k in dom p & p . k = ((m,n) -cut p) . a & k + 1 = m + a & m <= k & k <= n ) by A1, GRAPH_2:def_1, RELAT_1:38; ::_thesis: verum end; end; end; definition let G be Graph; mode Vertex of G is Element of the carrier of G; end; theorem Th3: :: GRAPH_3:3 for G being Graph for c being Chain of G for vs being FinSequence of the carrier of G st vs is_vertex_seq_of c holds not vs is empty proof let G be Graph; ::_thesis: for c being Chain of G for vs being FinSequence of the carrier of G st vs is_vertex_seq_of c holds not vs is empty let c be Chain of G; ::_thesis: for vs being FinSequence of the carrier of G st vs is_vertex_seq_of c holds not vs is empty let vs be FinSequence of the carrier of G; ::_thesis: ( vs is_vertex_seq_of c implies not vs is empty ) assume vs is_vertex_seq_of c ; ::_thesis: not vs is empty then len vs = (len c) + 1 by GRAPH_2:def_6; hence not vs is empty ; ::_thesis: verum end; Lm2: for G being Graph for p being Path of G for n, m being Element of NAT st 1 <= n & n <= len p & 1 <= m & m <= len p & n <> m holds p . n <> p . m proof let G be Graph; ::_thesis: for p being Path of G for n, m being Element of NAT st 1 <= n & n <= len p & 1 <= m & m <= len p & n <> m holds p . n <> p . m let p be Path of G; ::_thesis: for n, m being Element of NAT st 1 <= n & n <= len p & 1 <= m & m <= len p & n <> m holds p . n <> p . m let n, m be Element of NAT ; ::_thesis: ( 1 <= n & n <= len p & 1 <= m & m <= len p & n <> m implies p . n <> p . m ) assume that A1: ( 1 <= n & n <= len p & 1 <= m & m <= len p ) and A2: n <> m ; ::_thesis: p . n <> p . m ( n in dom p & m in dom p ) by A1, FINSEQ_3:25; hence p . n <> p . m by A2, FUNCT_1:def_4; ::_thesis: verum end; theorem Th4: :: GRAPH_3:4 for G being Graph for e being set st e in the carrier' of G holds <*e*> is Path of G proof let G be Graph; ::_thesis: for e being set st e in the carrier' of G holds <*e*> is Path of G let e be set ; ::_thesis: ( e in the carrier' of G implies <*e*> is Path of G ) assume e in the carrier' of G ; ::_thesis: <*e*> is Path of G then reconsider c = <*e*> as Chain of G by MSSCYC_1:5; now__::_thesis:_for_n,_m_being_Element_of_NAT_st_1_<=_n_&_n_<_m_&_m_<=_len_c_holds_ c_._n_<>_c_._m let n, m be Element of NAT ; ::_thesis: ( 1 <= n & n < m & m <= len c implies c . n <> c . m ) A1: len c = 1 by FINSEQ_1:39; assume ( 1 <= n & n < m & m <= len c ) ; ::_thesis: c . n <> c . m hence c . n <> c . m by A1, XXREAL_0:2; ::_thesis: verum end; hence <*e*> is Path of G by GRAPH_1:def_16; ::_thesis: verum end; theorem Th5: :: GRAPH_3:5 for G being Graph for p being Path of G for m, n being Element of NAT holds (m,n) -cut p is Path of G proof let G be Graph; ::_thesis: for p being Path of G for m, n being Element of NAT holds (m,n) -cut p is Path of G let p be Path of G; ::_thesis: for m, n being Element of NAT holds (m,n) -cut p is Path of G let m, n be Element of NAT ; ::_thesis: (m,n) -cut p is Path of G percases ( not 1 <= m or not n <= len p or m > n or ( 1 <= m & m <= n & n <= len p ) ) ; suppose ( not 1 <= m or not n <= len p or m > n ) ; ::_thesis: (m,n) -cut p is Path of G then (m,n) -cut p = {} by GRAPH_2:def_1; hence (m,n) -cut p is Path of G by GRAPH_1:14; ::_thesis: verum end; suppose ( 1 <= m & m <= n & n <= len p ) ; ::_thesis: (m,n) -cut p is Path of G then reconsider q = (m,n) -cut p as Chain of G by GRAPH_2:41; assume (m,n) -cut p is not Path of G ; ::_thesis: contradiction then consider a, b being Element of NAT such that A1: 1 <= a and A2: a < b and A3: b <= len q and A4: q . a = q . b by GRAPH_1:def_16; 1 <= b by A1, A2, XXREAL_0:2; then b in dom q by A3, FINSEQ_3:25; then consider kb being Element of NAT such that A5: ( kb in dom p & p . kb = q . b ) and A6: kb + 1 = m + b and m <= kb and kb <= n by Th2; a <= len q by A2, A3, XXREAL_0:2; then a in dom q by A1, FINSEQ_3:25; then consider ka being Element of NAT such that A7: ( ka in dom p & p . ka = q . a ) and A8: ka + 1 = m + a and m <= ka and ka <= n by Th2; ka = kb by A4, A7, A5, FUNCT_1:def_4; hence contradiction by A2, A8, A6; ::_thesis: verum end; end; end; theorem Th6: :: GRAPH_3:6 for G being Graph for p1, p2 being Path of G for vs1, vs2 being FinSequence of the carrier of G st rng p1 misses rng p2 & vs1 is_vertex_seq_of p1 & vs2 is_vertex_seq_of p2 & vs1 . (len vs1) = vs2 . 1 holds p1 ^ p2 is Path of G proof let G be Graph; ::_thesis: for p1, p2 being Path of G for vs1, vs2 being FinSequence of the carrier of G st rng p1 misses rng p2 & vs1 is_vertex_seq_of p1 & vs2 is_vertex_seq_of p2 & vs1 . (len vs1) = vs2 . 1 holds p1 ^ p2 is Path of G let p1, p2 be Path of G; ::_thesis: for vs1, vs2 being FinSequence of the carrier of G st rng p1 misses rng p2 & vs1 is_vertex_seq_of p1 & vs2 is_vertex_seq_of p2 & vs1 . (len vs1) = vs2 . 1 holds p1 ^ p2 is Path of G let vs1, vs2 be FinSequence of the carrier of G; ::_thesis: ( rng p1 misses rng p2 & vs1 is_vertex_seq_of p1 & vs2 is_vertex_seq_of p2 & vs1 . (len vs1) = vs2 . 1 implies p1 ^ p2 is Path of G ) set c1 = p1; set c2 = p2; assume that A1: rng p1 misses rng p2 and A2: ( vs1 is_vertex_seq_of p1 & vs2 is_vertex_seq_of p2 & vs1 . (len vs1) = vs2 . 1 ) ; ::_thesis: p1 ^ p2 is Path of G reconsider c = p1 ^ p2 as Chain of G by A2, GRAPH_2:43; now__::_thesis:_for_n,_m_being_Element_of_NAT_st_1_<=_n_&_n_<_m_&_m_<=_len_c_holds_ not_c_._n_=_c_._m let n, m be Element of NAT ; ::_thesis: ( 1 <= n & n < m & m <= len c implies not c . n = c . m ) assume that A3: 1 <= n and A4: n < m and A5: m <= len c and A6: c . n = c . m ; ::_thesis: contradiction 1 <= m by A3, A4, XXREAL_0:2; then A7: m in dom c by A5, FINSEQ_3:25; n <= len c by A4, A5, XXREAL_0:2; then A8: n in dom c by A3, FINSEQ_3:25; percases ( ( n in dom p1 & m in dom p1 ) or ( n in dom p1 & ex m2 being Nat st ( m2 in dom p2 & m = (len p1) + m2 ) ) or ( m in dom p1 & ex n2 being Nat st ( n2 in dom p2 & n = (len p1) + n2 ) ) or ( ex n2 being Nat st ( n2 in dom p2 & n = (len p1) + n2 ) & ex m2 being Nat st ( m2 in dom p2 & m = (len p1) + m2 ) ) ) by A8, A7, FINSEQ_1:25; supposeA9: ( n in dom p1 & m in dom p1 ) ; ::_thesis: contradiction then p1 . n = c . n by FINSEQ_1:def_7 .= p1 . m by A6, A9, FINSEQ_1:def_7 ; hence contradiction by A4, A9, FUNCT_1:def_4; ::_thesis: verum end; supposeA10: ( n in dom p1 & ex m2 being Nat st ( m2 in dom p2 & m = (len p1) + m2 ) ) ; ::_thesis: contradiction then A11: p1 . n in rng p1 by FUNCT_1:def_3; consider m2 being Nat such that A12: m2 in dom p2 and A13: m = (len p1) + m2 by A10; A14: p2 . m2 in rng p2 by A12, FUNCT_1:def_3; p1 . n = c . n by A10, FINSEQ_1:def_7 .= p2 . m2 by A6, A12, A13, FINSEQ_1:def_7 ; hence contradiction by A1, A11, A14, XBOOLE_0:3; ::_thesis: verum end; supposeA15: ( m in dom p1 & ex n2 being Nat st ( n2 in dom p2 & n = (len p1) + n2 ) ) ; ::_thesis: contradiction then consider n2 being Nat such that n2 in dom p2 and A16: n = (len p1) + n2 ; m <= len p1 by A15, FINSEQ_3:25; then (len p1) + n2 < len p1 by A4, A16, XXREAL_0:2; hence contradiction by NAT_1:11; ::_thesis: verum end; supposeA17: ( ex n2 being Nat st ( n2 in dom p2 & n = (len p1) + n2 ) & ex m2 being Nat st ( m2 in dom p2 & m = (len p1) + m2 ) ) ; ::_thesis: contradiction then consider n2 being Nat such that A18: ( n2 in dom p2 & n = (len p1) + n2 ) ; consider m2 being Nat such that A19: ( m2 in dom p2 & m = (len p1) + m2 ) by A17; p2 . n2 = c . n by A18, FINSEQ_1:def_7 .= p2 . m2 by A6, A19, FINSEQ_1:def_7 ; hence contradiction by A4, A19, A18, FUNCT_1:def_4; ::_thesis: verum end; end; end; hence p1 ^ p2 is Path of G by GRAPH_1:def_16; ::_thesis: verum end; theorem Th7: :: GRAPH_3:7 for G being Graph for c being Chain of G st c = {} holds c is cyclic proof let G be Graph; ::_thesis: for c being Chain of G st c = {} holds c is cyclic let c be Chain of G; ::_thesis: ( c = {} implies c is cyclic ) set v = the Vertex of G; assume c = {} ; ::_thesis: c is cyclic then A1: <* the Vertex of G*> is_vertex_seq_of c by GRAPH_2:32; <* the Vertex of G*> . 1 = <* the Vertex of G*> . (len <* the Vertex of G*>) by FINSEQ_1:40; hence c is cyclic by A1, MSSCYC_1:def_2; ::_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 cyclic for Chain of G; existence ex b1 being Path of G st b1 is cyclic proof reconsider p = {} as Path of G by GRAPH_1:14; take p ; ::_thesis: p is cyclic thus p is cyclic by Th7; ::_thesis: verum end; end; theorem Th8: :: GRAPH_3:8 for G being Graph for m being Element of NAT for p being cyclic Path of G holds (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G proof let G be Graph; ::_thesis: for m being Element of NAT for p being cyclic Path of G holds (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G let m be Element of NAT ; ::_thesis: for p being cyclic Path of G holds (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G let p be cyclic Path of G; ::_thesis: (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G percases ( m = 0 or ( 1 <= m & len p = m ) or ( 1 <= m & len p < m ) or ( 1 <= m & m < len p ) ) by NAT_1:14, XXREAL_0:1; supposeA1: m = 0 ; ::_thesis: (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G 0 <= len p ; then (len ((1,m) -cut p)) + 1 = 0 + 1 by A1, Lm1; then A2: (1,m) -cut p = {} ; ((m + 1),(len p)) -cut p = p by A1, GRAPH_2:7; hence (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G by A2, FINSEQ_1:34; ::_thesis: verum end; supposeA3: ( 1 <= m & len p = m ) ; ::_thesis: (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G 1 <= m + 1 by NAT_1:12; then (len (((m + 1),(len p)) -cut p)) + (m + 1) = (len p) + 1 by A3, Lm1; then ((m + 1),(len p)) -cut p = {} by A3; then (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) = (1,m) -cut p by FINSEQ_1:34 .= p by A3, GRAPH_2:7 ; hence (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G ; ::_thesis: verum end; supposeA4: ( 1 <= m & len p < m ) ; ::_thesis: (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G m <= m + 1 by NAT_1:11; then len p < m + 1 by A4, XXREAL_0:2; then A5: ((m + 1),(len p)) -cut p = {} by GRAPH_2:def_1; (1,m) -cut p = {} by A4, GRAPH_2:def_1; then (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) = {} by A5, FINSEQ_1:34; hence (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G by Th7, GRAPH_1:14; ::_thesis: verum end; supposeA6: ( 1 <= m & m < len p ) ; ::_thesis: (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G set n1 = m; set n = m + 1; A7: 1 <= m + 1 by A6, NAT_1:13; reconsider r1 = (1,m) -cut p, r2 = ((m + 1),(len p)) -cut p as Path of G by Th5; consider vs being FinSequence of the carrier of G such that A8: vs is_vertex_seq_of p by GRAPH_2:33; reconsider vs1 = (1,(m + 1)) -cut vs, vs2 = ((m + 1),(len vs)) -cut vs as FinSequence of the carrier of G ; A9: m + 1 <= len p by A6, NAT_1:13; A10: len vs = (len p) + 1 by A8, GRAPH_2:def_6; then A11: vs2 is_vertex_seq_of r2 by A7, A9, A8, GRAPH_2:42; len p <= (len p) + 1 by NAT_1:11; then A12: m + 1 <= len vs by A9, A10, XXREAL_0:2; then A13: m + 1 < (len vs) + 1 by NAT_1:13; (len vs1) + 1 = (m + 1) + 1 by A7, A12, GRAPH_2:def_1; then A14: 1 < len vs1 by A6, NAT_1:13; A15: vs1 is_vertex_seq_of r1 by A6, A8, GRAPH_2:42; len vs <= (len vs) + 1 by NAT_1:11; then m + 1 <= (len vs) + 1 by A12, XXREAL_0:2; then (len vs2) + (m + 1) = (len vs) + 1 by A7, Lm1; then 1 + (m + 1) <= (len vs2) + (m + 1) by A13, NAT_1:13; then A16: 1 <= len vs2 by XREAL_1:6; reconsider vs9 = vs2 ^' vs1 as FinSequence of the carrier of G ; set r = r2 ^ r1; A17: vs . (len vs) = vs . 1 by A8, MSSCYC_1:6; A18: ( vs1 . 1 = vs . 1 & vs2 . (len vs2) = vs . (len vs) ) by A7, A12, GRAPH_2:12; then reconsider r = r2 ^ r1 as Chain of G by A17, A15, A11, GRAPH_2:43; A19: vs9 is_vertex_seq_of r by A17, A15, A11, A18, GRAPH_2:44; p = r1 ^ r2 by A6, GRAPH_2:9; then rng r1 misses rng r2 by FINSEQ_3:91; then reconsider r = r as Path of G by A17, A15, A11, A18, Th6; ( vs1 . (len vs1) = vs . (m + 1) & vs2 . 1 = vs . (m + 1) ) by A7, A12, GRAPH_2:12; then vs9 . 1 = vs1 . (len vs1) by A16, GRAPH_2:14 .= vs9 . (len vs9) by A14, GRAPH_2:16 ; then r is cyclic Path of G by A19, MSSCYC_1:def_2; hence (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p) is cyclic Path of G ; ::_thesis: verum end; end; end; theorem Th9: :: GRAPH_3:9 for G being Graph for p being Path of G for m being Element of NAT st m + 1 in dom p holds ( len ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = len p & rng ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = rng p & ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) . 1 = p . (m + 1) ) proof let G be Graph; ::_thesis: for p being Path of G for m being Element of NAT st m + 1 in dom p holds ( len ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = len p & rng ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = rng p & ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) . 1 = p . (m + 1) ) let p be Path of G; ::_thesis: for m being Element of NAT st m + 1 in dom p holds ( len ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = len p & rng ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = rng p & ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) . 1 = p . (m + 1) ) let m be Element of NAT ; ::_thesis: ( m + 1 in dom p implies ( len ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = len p & rng ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = rng p & ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) . 1 = p . (m + 1) ) ) set r2 = ((m + 1),(len p)) -cut p; set r1 = (1,m) -cut p; set r = (((m + 1),(len p)) -cut p) ^ ((1,m) -cut p); set n = m + 1; assume A1: m + 1 in dom p ; ::_thesis: ( len ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = len p & rng ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = rng p & ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) . 1 = p . (m + 1) ) then A2: m + 1 <= len p by FINSEQ_3:25; then A3: m + 1 < (len p) + 1 by NAT_1:13; m <= m + 1 by NAT_1:11; then A4: p = ((1,m) -cut p) ^ (((m + 1),(len p)) -cut p) by A2, GRAPH_2:9, XXREAL_0:2; thus len ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = (len ((1,m) -cut p)) + (len (((m + 1),(len p)) -cut p)) by FINSEQ_1:22 .= len p by A4, FINSEQ_1:22 ; ::_thesis: ( rng ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = rng p & ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) . 1 = p . (m + 1) ) thus rng ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) = (rng ((1,m) -cut p)) \/ (rng (((m + 1),(len p)) -cut p)) by FINSEQ_1:31 .= rng p by A4, FINSEQ_1:31 ; ::_thesis: ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) . 1 = p . (m + 1) A5: 1 <= m + 1 by A1, FINSEQ_3:25; then (len (((m + 1),(len p)) -cut p)) + (m + 1) = (len p) + 1 by A2, GRAPH_2:def_1; then 1 + (m + 1) <= (len (((m + 1),(len p)) -cut p)) + (m + 1) by A3, NAT_1:13; then A6: 1 <= len (((m + 1),(len p)) -cut p) by XREAL_1:6; then 1 in dom (((m + 1),(len p)) -cut p) by FINSEQ_3:25; hence ((((m + 1),(len p)) -cut p) ^ ((1,m) -cut p)) . 1 = (((m + 1),(len p)) -cut p) . (0 + 1) by FINSEQ_1:def_7 .= p . ((m + 1) + 0) by A5, A2, A6, GRAPH_2:def_1 .= p . (m + 1) ; ::_thesis: verum end; theorem Th10: :: GRAPH_3:10 for G being Graph for n being Element of NAT for p being cyclic Path of G st n in dom p holds ex p9 being cyclic Path of G st ( p9 . 1 = p . n & len p9 = len p & rng p9 = rng p ) proof let G be Graph; ::_thesis: for n being Element of NAT for p being cyclic Path of G st n in dom p holds ex p9 being cyclic Path of G st ( p9 . 1 = p . n & len p9 = len p & rng p9 = rng p ) let n be Element of NAT ; ::_thesis: for p being cyclic Path of G st n in dom p holds ex p9 being cyclic Path of G st ( p9 . 1 = p . n & len p9 = len p & rng p9 = rng p ) let p be cyclic Path of G; ::_thesis: ( n in dom p implies ex p9 being cyclic Path of G st ( p9 . 1 = p . n & len p9 = len p & rng p9 = rng p ) ) assume A1: n in dom p ; ::_thesis: ex p9 being cyclic Path of G st ( p9 . 1 = p . n & len p9 = len p & rng p9 = rng p ) then A2: 1 <= n by FINSEQ_3:25; percases ( n = 1 or 1 < n ) by A2, XXREAL_0:1; supposeA3: n = 1 ; ::_thesis: ex p9 being cyclic Path of G st ( p9 . 1 = p . n & len p9 = len p & rng p9 = rng p ) take p ; ::_thesis: ( p . 1 = p . n & len p = len p & rng p = rng p ) thus ( p . 1 = p . n & len p = len p & rng p = rng p ) by A3; ::_thesis: verum end; suppose 1 < n ; ::_thesis: ex p9 being cyclic Path of G st ( p9 . 1 = p . n & len p9 = len p & rng p9 = rng p ) then 1 + 1 <= n by NAT_1:13; then consider n1 being Element of NAT such that 1 <= n1 and n1 < n and A4: n = n1 + 1 by GRAPH_2:1; reconsider r = ((n,(len p)) -cut p) ^ ((1,n1) -cut p) as cyclic Path of G by A4, Th8; take r ; ::_thesis: ( r . 1 = p . n & len r = len p & rng r = rng p ) thus ( r . 1 = p . n & len r = len p & rng r = rng p ) by A1, A4, Th9; ::_thesis: verum end; end; end; theorem Th11: :: GRAPH_3:11 for G being Graph for e being set for s, t being Vertex of G st s = the Source of G . e & t = the Target of G . e holds <*t,s*> is_vertex_seq_of <*e*> proof let G be Graph; ::_thesis: for e being set for s, t being Vertex of G st s = the Source of G . e & t = the Target of G . e holds <*t,s*> is_vertex_seq_of <*e*> let e be set ; ::_thesis: for s, t being Vertex of G st s = the Source of G . e & t = the Target of G . e holds <*t,s*> is_vertex_seq_of <*e*> let s, t be Element of the carrier of G; ::_thesis: ( s = the Source of G . e & t = the Target of G . e implies <*t,s*> is_vertex_seq_of <*e*> ) assume A1: ( s = the Source of G . e & t = the Target of G . e ) ; ::_thesis: <*t,s*> is_vertex_seq_of <*e*> set c = <*e*>; set vs = <*t,s*>; A2: <*t,s*> /. (1 + 1) = s by FINSEQ_4:17; A3: len <*e*> = 1 by FINSEQ_1:39; hence len <*t,s*> = (len <*e*>) + 1 by FINSEQ_1:44; :: according to GRAPH_2:def_6 ::_thesis: for b1 being Element of NAT holds ( not 1 <= b1 or not b1 <= len <*e*> or <*e*> . b1 joins <*t,s*> /. b1,<*t,s*> /. (b1 + 1) ) let n be Element of NAT ; ::_thesis: ( not 1 <= n or not n <= len <*e*> or <*e*> . n joins <*t,s*> /. n,<*t,s*> /. (n + 1) ) assume ( 1 <= n & n <= len <*e*> ) ; ::_thesis: <*e*> . n joins <*t,s*> /. n,<*t,s*> /. (n + 1) then A4: n = 1 by A3, XXREAL_0:1; ( <*e*> . 1 = e & <*t,s*> /. 1 = t ) by FINSEQ_1:40, FINSEQ_4:17; hence <*e*> . n joins <*t,s*> /. n,<*t,s*> /. (n + 1) by A1, A4, A2, GRAPH_1:def_12; ::_thesis: verum end; theorem Th12: :: GRAPH_3:12 for G being Graph for c being Chain of G for vs being FinSequence of the carrier of G for e being set st e in the carrier' of G & vs is_vertex_seq_of c & vs . (len vs) = the Source of G . e holds ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) ) proof let G be Graph; ::_thesis: for c being Chain of G for vs being FinSequence of the carrier of G for e being set st e in the carrier' of G & vs is_vertex_seq_of c & vs . (len vs) = the Source of G . e holds ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) ) let c be Chain of G; ::_thesis: for vs being FinSequence of the carrier of G for e being set st e in the carrier' of G & vs is_vertex_seq_of c & vs . (len vs) = the Source of G . e holds ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) ) let vs be FinSequence of the carrier of G; ::_thesis: for e being set st e in the carrier' of G & vs is_vertex_seq_of c & vs . (len vs) = the Source of G . e holds ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) ) let e be set ; ::_thesis: ( e in the carrier' of G & vs is_vertex_seq_of c & vs . (len vs) = the Source of G . e implies ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) ) ) assume that A1: e in the carrier' of G and A2: vs is_vertex_seq_of c ; ::_thesis: ( not vs . (len vs) = the Source of G . e or ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) ) ) reconsider ec = <*e*> as Chain of G by A1, MSSCYC_1:5; reconsider s = the Source of G . e, t = the Target of G . e as Vertex of G by A1, FUNCT_2:5; reconsider vse = <*s,t*> as FinSequence of the carrier of G ; A3: ( vse is_vertex_seq_of ec & vse . 1 = s ) by FINSEQ_1:44, MSSCYC_1:4; assume A4: vs . (len vs) = the Source of G . e ; ::_thesis: ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) ) hence c ^ <*e*> is Chain of G by A2, A3, GRAPH_2:43; ::_thesis: ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) reconsider ce = c ^ ec as Chain of G by A2, A4, A3, GRAPH_2:43; take vs9 = vs ^' vse; ::_thesis: ( vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) thus vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> ; ::_thesis: ( vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) vs9 is_vertex_seq_of ce by A2, A4, A3, GRAPH_2:44; hence vs9 is_vertex_seq_of c ^ <*e*> ; ::_thesis: ( vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Target of G . e ) len vs = (len c) + 1 by A2, GRAPH_2:def_6; then 1 <= len vs by NAT_1:11; hence vs9 . 1 = vs . 1 by GRAPH_2:14; ::_thesis: vs9 . (len vs9) = the Target of G . e A5: len vse = 2 by FINSEQ_1:44; then vse . (len vse) = t by FINSEQ_1:44; hence vs9 . (len vs9) = the Target of G . e by A5, GRAPH_2:16; ::_thesis: verum end; theorem Th13: :: GRAPH_3:13 for G being Graph for c being Chain of G for vs being FinSequence of the carrier of G for e being set st e in the carrier' of G & vs is_vertex_seq_of c & vs . (len vs) = the Target of G . e holds ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) ) proof let G be Graph; ::_thesis: for c being Chain of G for vs being FinSequence of the carrier of G for e being set st e in the carrier' of G & vs is_vertex_seq_of c & vs . (len vs) = the Target of G . e holds ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) ) let c be Chain of G; ::_thesis: for vs being FinSequence of the carrier of G for e being set st e in the carrier' of G & vs is_vertex_seq_of c & vs . (len vs) = the Target of G . e holds ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) ) let vs be FinSequence of the carrier of G; ::_thesis: for e being set st e in the carrier' of G & vs is_vertex_seq_of c & vs . (len vs) = the Target of G . e holds ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) ) let e be set ; ::_thesis: ( e in the carrier' of G & vs is_vertex_seq_of c & vs . (len vs) = the Target of G . e implies ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) ) ) assume that A1: e in the carrier' of G and A2: vs is_vertex_seq_of c ; ::_thesis: ( not vs . (len vs) = the Target of G . e or ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) ) ) reconsider ec = <*e*> as Chain of G by A1, MSSCYC_1:5; reconsider s = the Source of G . e, t = the Target of G . e as Vertex of G by A1, FUNCT_2:5; assume A3: vs . (len vs) = the Target of G . e ; ::_thesis: ( c ^ <*e*> is Chain of G & ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) ) reconsider vse = <*t,s*> as FinSequence of the carrier of G ; A4: ( vse is_vertex_seq_of ec & vse . 1 = t ) by Th11, FINSEQ_1:44; hence c ^ <*e*> is Chain of G by A2, A3, GRAPH_2:43; ::_thesis: ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) reconsider ce = c ^ ec as Chain of G by A2, A3, A4, GRAPH_2:43; take vs9 = vs ^' vse; ::_thesis: ( vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> & vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) thus vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> ; ::_thesis: ( vs9 is_vertex_seq_of c ^ <*e*> & vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) vs9 is_vertex_seq_of ce by A2, A3, A4, GRAPH_2:44; hence vs9 is_vertex_seq_of c ^ <*e*> ; ::_thesis: ( vs9 . 1 = vs . 1 & vs9 . (len vs9) = the Source of G . e ) len vs = (len c) + 1 by A2, GRAPH_2:def_6; then 1 <= len vs by NAT_1:11; hence vs9 . 1 = vs . 1 by GRAPH_2:14; ::_thesis: vs9 . (len vs9) = the Source of G . e A5: len vse = 2 by FINSEQ_1:44; then vse . (len vse) = s by FINSEQ_1:44; hence vs9 . (len vs9) = the Source of G . e by A5, GRAPH_2:16; ::_thesis: verum end; Lm3: for G being Graph for c being Chain of G for vs being FinSequence of the carrier of G st vs is_vertex_seq_of c holds for n being Nat st 1 <= n & n <= len c holds ( 1 <= n & n <= len vs & 1 <= n + 1 & n + 1 <= len vs & ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) proof let G be Graph; ::_thesis: for c being Chain of G for vs being FinSequence of the carrier of G st vs is_vertex_seq_of c holds for n being Nat st 1 <= n & n <= len c holds ( 1 <= n & n <= len vs & 1 <= n + 1 & n + 1 <= len vs & ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) let c be Chain of G; ::_thesis: for vs being FinSequence of the carrier of G st vs is_vertex_seq_of c holds for n being Nat st 1 <= n & n <= len c holds ( 1 <= n & n <= len vs & 1 <= n + 1 & n + 1 <= len vs & ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) let vs be FinSequence of the carrier of G; ::_thesis: ( vs is_vertex_seq_of c implies for n being Nat st 1 <= n & n <= len c holds ( 1 <= n & n <= len vs & 1 <= n + 1 & n + 1 <= len vs & ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) ) assume A1: vs is_vertex_seq_of c ; ::_thesis: for n being Nat st 1 <= n & n <= len c holds ( 1 <= n & n <= len vs & 1 <= n + 1 & n + 1 <= len vs & ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) then A2: len vs = (len c) + 1 by GRAPH_2:def_6; let n be Nat; ::_thesis: ( 1 <= n & n <= len c implies ( 1 <= n & n <= len vs & 1 <= n + 1 & n + 1 <= len vs & ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) ) assume that A3: 1 <= n and A4: n <= len c ; ::_thesis: ( 1 <= n & n <= len vs & 1 <= n + 1 & n + 1 <= len vs & ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) thus 1 <= n by A3; ::_thesis: ( n <= len vs & 1 <= n + 1 & n + 1 <= len vs & ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) len c <= (len c) + 1 by NAT_1:11; hence A5: n <= len vs by A4, A2, XXREAL_0:2; ::_thesis: ( 1 <= n + 1 & n + 1 <= len vs & ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) thus 1 <= n + 1 by NAT_1:11; ::_thesis: ( n + 1 <= len vs & ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) thus A6: n + 1 <= len vs by A4, A2, XREAL_1:6; ::_thesis: ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) reconsider n = n as Element of NAT by ORDINAL1:def_12; A7: vs . n = vs /. n by A3, A5, FINSEQ_4:15; A8: vs . (n + 1) = vs /. (n + 1) by A6, FINSEQ_4:15, NAT_1:11; c . n joins vs /. n,vs /. (n + 1) by A1, A3, A4, GRAPH_2:def_6; hence ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) by A7, A8, GRAPH_1:def_12; ::_thesis: verum end; theorem :: GRAPH_3:14 for G being Graph for c being Chain of G for vs being FinSequence of the carrier of G st vs is_vertex_seq_of c holds for n being Element of NAT holds ( not n in dom c or ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) proof let G be Graph; ::_thesis: for c being Chain of G for vs being FinSequence of the carrier of G st vs is_vertex_seq_of c holds for n being Element of NAT holds ( not n in dom c or ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) let c be Chain of G; ::_thesis: for vs being FinSequence of the carrier of G st vs is_vertex_seq_of c holds for n being Element of NAT holds ( not n in dom c or ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) let vs be FinSequence of the carrier of G; ::_thesis: ( vs is_vertex_seq_of c implies for n being Element of NAT holds ( not n in dom c or ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) ) assume A1: vs is_vertex_seq_of c ; ::_thesis: for n being Element of NAT holds ( not n in dom c or ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) let n be Element of NAT ; ::_thesis: ( not n in dom c or ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) assume n in dom c ; ::_thesis: ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) then ( 1 <= n & n <= len c ) by FINSEQ_3:25; hence ( ( vs . n = the Target of G . (c . n) & vs . (n + 1) = the Source of G . (c . n) ) or ( vs . n = the Source of G . (c . n) & vs . (n + 1) = the Target of G . (c . n) ) ) by A1, Lm3; ::_thesis: verum end; theorem Th15: :: GRAPH_3:15 for G being Graph for c being Chain of G for vs being FinSequence of the carrier of G for e being set st vs is_vertex_seq_of c & e in rng c holds ( the Target of G . e in rng vs & the Source of G . e in rng vs ) proof let G be Graph; ::_thesis: for c being Chain of G for vs being FinSequence of the carrier of G for e being set st vs is_vertex_seq_of c & e in rng c holds ( the Target of G . e in rng vs & the Source of G . e in rng vs ) let c be Chain of G; ::_thesis: for vs being FinSequence of the carrier of G for e being set st vs is_vertex_seq_of c & e in rng c holds ( the Target of G . e in rng vs & the Source of G . e in rng vs ) let vs be FinSequence of the carrier of G; ::_thesis: for e being set st vs is_vertex_seq_of c & e in rng c holds ( the Target of G . e in rng vs & the Source of G . e in rng vs ) let e be set ; ::_thesis: ( vs is_vertex_seq_of c & e in rng c implies ( the Target of G . e in rng vs & the Source of G . e in rng vs ) ) assume that A1: vs is_vertex_seq_of c and A2: e in rng c ; ::_thesis: ( the Target of G . e in rng vs & the Source of G . e in rng vs ) c is FinSequence of the carrier' of G by MSSCYC_1:def_1; then A3: rng c c= the carrier' of G by FINSEQ_1:def_4; then reconsider e9 = e as Element of the carrier' of G by A2; reconsider t = the Target of G . e, s = the Source of G . e as Vertex of G by A2, A3, FUNCT_2:5; e9 in rng c by A2; then ( t in G -VSet (rng c) & s in G -VSet (rng c) ) ; hence ( the Target of G . e in rng vs & the Source of G . e in rng vs ) by A1, A2, GRAPH_2:31, RELAT_1:38; ::_thesis: verum end; definition let G be Graph; let X be set ; :: original: -VSet redefine funcG -VSet X -> Subset of the carrier of G; coherence G -VSet X is Subset of the carrier of G proof defpred S1[ set ] means ex e being Element of the carrier' of G st ( e in X & ( $1 = the Source of G . e or $1 = the Target of G . e ) ); { v where v is Vertex of G : S1[v] } is Subset of the carrier of G from DOMAIN_1:sch_7(); hence G -VSet X is Subset of the carrier of G ; ::_thesis: verum end; end; theorem Th16: :: GRAPH_3:16 for G being Graph holds G -VSet {} = {} proof let G be Graph; ::_thesis: G -VSet {} = {} assume not G -VSet {} = {} ; ::_thesis: contradiction then consider x being set such that A1: x in G -VSet {} by XBOOLE_0:def_1; ex v being Vertex of G st ( x = v & ex e being Element of the carrier' of G st ( e in {} & ( v = the Source of G . e or v = the Target of G . e ) ) ) by A1; hence contradiction ; ::_thesis: verum end; theorem Th17: :: GRAPH_3:17 for G being Graph for e, X being set st e in the carrier' of G & e in X holds not G -VSet X is empty proof let G be Graph; ::_thesis: for e, X being set st e in the carrier' of G & e in X holds not G -VSet X is empty let e, X be set ; ::_thesis: ( e in the carrier' of G & e in X implies not G -VSet X is empty ) assume that A1: e in the carrier' of G and A2: e in X ; ::_thesis: not G -VSet X is empty reconsider v = the Source of G . e as Vertex of G by A1, FUNCT_2:5; v in G -VSet X by A1, A2; hence not G -VSet X is empty ; ::_thesis: verum end; theorem Th18: :: GRAPH_3:18 for G being Graph holds ( G is connected iff for v1, v2 being Vertex of G st v1 <> v2 holds ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v2 ) ) proof let G be Graph; ::_thesis: ( G is connected iff for v1, v2 being Vertex of G st v1 <> v2 holds ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v2 ) ) set E = the carrier' of G; set S = the Source of G; set T = the Target of G; thus ( G is connected implies for v1, v2 being Vertex of G st v1 <> v2 holds ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v2 ) ) ::_thesis: ( ( for v1, v2 being Vertex of G st v1 <> v2 holds ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v2 ) ) implies G is connected ) proof reconsider V = the carrier of G as non empty set ; assume A1: G is connected ; ::_thesis: for v1, v2 being Vertex of G st v1 <> v2 holds ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v2 ) let v1, v2 be Vertex of G; ::_thesis: ( v1 <> v2 implies ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v2 ) ) set V1 = { v where v is Element of V : ( v = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v ) ) } ; set V2 = V \ { v where v is Element of V : ( v = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v ) ) } ; v1 in { v where v is Element of V : ( v = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v ) ) } ; then reconsider V1 = { v where v is Element of V : ( v = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v ) ) } as non empty set ; assume A2: v1 <> v2 ; ::_thesis: ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v2 ) assume A3: for c being Chain of G for vs being FinSequence of the carrier of G holds ( c is empty or not vs is_vertex_seq_of c or not vs . 1 = v1 or not vs . (len vs) = v2 ) ; ::_thesis: contradiction now__::_thesis:_not_v2_in_V1 assume v2 in V1 ; ::_thesis: contradiction then ex v being Vertex of G st ( v = v2 & ( v = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v ) ) ) ; hence contradiction by A2, A3; ::_thesis: verum end; then reconsider V2 = V \ { v where v is Element of V : ( v = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v ) ) } as non empty set by XBOOLE_0:def_5; defpred S1[ set ] means ( $1 = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = $1 ) ); A4: { v where v is Element of V : S1[v] } is Subset of V from DOMAIN_1:sch_7(); defpred S2[ set ] means ( the Source of G . $1 in V1 & the Target of G . $1 in V1 ); consider E1 being set such that A5: for e being set holds ( e in E1 iff ( e in the carrier' of G & S2[e] ) ) from XBOOLE_0:sch_1(); A6: dom the Source of G = the carrier' of G by FUNCT_2:def_1; set E2 = the carrier' of G \ E1; A7: dom ( the Source of G | ( the carrier' of G \ E1)) = (dom the Source of G) /\ ( the carrier' of G \ E1) by RELAT_1:61 .= the carrier' of G \ E1 by A6, XBOOLE_1:28 ; A8: rng the Source of G c= V by RELAT_1:def_19; rng ( the Source of G | ( the carrier' of G \ E1)) c= V2 proof let v be set ; :: according to TARSKI:def_3 ::_thesis: ( not v in rng ( the Source of G | ( the carrier' of G \ E1)) or v in V2 ) assume v in rng ( the Source of G | ( the carrier' of G \ E1)) ; ::_thesis: v in V2 then consider e being set such that A9: e in dom ( the Source of G | ( the carrier' of G \ E1)) and A10: ( the Source of G | ( the carrier' of G \ E1)) . e = v by FUNCT_1:def_3; reconsider e = e as Element of the carrier' of G by A7, A9; A11: ( the Source of G | ( the carrier' of G \ E1)) . e = the Source of G . e by A9, FUNCT_1:47; A12: not e in E1 by A7, A9, XBOOLE_0:def_5; percases ( not e in the carrier' of G or not the Source of G . e in V1 or not the Target of G . e in V1 ) by A5, A12; suppose not e in the carrier' of G ; ::_thesis: v in V2 hence v in V2 by A7, A9; ::_thesis: verum end; supposeA13: not the Source of G . e in V1 ; ::_thesis: v in V2 the Source of G . e in V by A7, A9, FUNCT_2:5; hence v in V2 by A10, A11, A13, XBOOLE_0:def_5; ::_thesis: verum end; supposeA14: not the Target of G . e in V1 ; ::_thesis: v in V2 reconsider Te = the Target of G . e as Vertex of G by A7, A9, FUNCT_2:5; ( v in rng ( the Source of G | ( the carrier' of G \ E1)) & rng ( the Source of G | ( the carrier' of G \ E1)) c= rng the Source of G ) by A9, A10, FUNCT_1:def_3, RELAT_1:70; then A15: v in rng the Source of G ; assume not v in V2 ; ::_thesis: contradiction then v in V1 by A8, A15, XBOOLE_0:def_5; then consider v9 being Vertex of G such that A16: v9 = v and A17: ( v9 = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v9 ) ) ; thus contradiction ::_thesis: verum proof percases ( v9 = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v9 ) ) by A17; supposeA18: v9 = v1 ; ::_thesis: contradiction reconsider ec = <*e*> as Chain of G by A7, A9, MSSCYC_1:5; reconsider vs = <*v1,Te*> as FinSequence of the carrier of G ; len vs = 2 by FINSEQ_1:44; then A19: ( vs . 1 = v1 & vs . (len vs) = Te ) by FINSEQ_1:44; vs is_vertex_seq_of ec by A10, A11, A16, A18, MSSCYC_1:4; hence contradiction by A14, A19; ::_thesis: verum end; suppose ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v9 ) ; ::_thesis: contradiction then consider c being Chain of G, vs being FinSequence of the carrier of G such that not c is empty and A20: vs is_vertex_seq_of c and A21: vs . 1 = v1 and A22: vs . (len vs) = v9 ; reconsider c9 = c ^ <*e*> as Chain of G by A7, A9, A10, A11, A16, A20, A22, Th12; ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Source of G . e),( the Target of G . e)*> & vs9 is_vertex_seq_of c9 & vs9 . 1 = vs . 1 & vs9 . (len vs9) = Te ) by A7, A9, A10, A11, A16, A20, A22, Th12; hence contradiction by A14, A21; ::_thesis: verum end; end; end; end; end; end; then reconsider S2 = the Source of G | ( the carrier' of G \ E1) as Function of ( the carrier' of G \ E1),V2 by A7, FUNCT_2:def_1, RELSET_1:4; A23: dom the Target of G = the carrier' of G by FUNCT_2:def_1; A24: dom ( the Target of G | ( the carrier' of G \ E1)) = (dom the Target of G) /\ ( the carrier' of G \ E1) by RELAT_1:61 .= the carrier' of G \ E1 by A23, XBOOLE_1:28 ; A25: rng the Target of G c= V by RELAT_1:def_19; rng ( the Target of G | ( the carrier' of G \ E1)) c= V2 proof let v be set ; :: according to TARSKI:def_3 ::_thesis: ( not v in rng ( the Target of G | ( the carrier' of G \ E1)) or v in V2 ) assume v in rng ( the Target of G | ( the carrier' of G \ E1)) ; ::_thesis: v in V2 then consider e being set such that A26: e in dom ( the Target of G | ( the carrier' of G \ E1)) and A27: ( the Target of G | ( the carrier' of G \ E1)) . e = v by FUNCT_1:def_3; reconsider e = e as Element of the carrier' of G by A24, A26; A28: ( the Target of G | ( the carrier' of G \ E1)) . e = the Target of G . e by A26, FUNCT_1:47; A29: not e in E1 by A24, A26, XBOOLE_0:def_5; percases ( not e in the carrier' of G or not the Target of G . e in V1 or not the Source of G . e in V1 ) by A5, A29; suppose not e in the carrier' of G ; ::_thesis: v in V2 hence v in V2 by A24, A26; ::_thesis: verum end; supposeA30: not the Target of G . e in V1 ; ::_thesis: v in V2 the Target of G . e in V by A24, A26, FUNCT_2:5; hence v in V2 by A27, A28, A30, XBOOLE_0:def_5; ::_thesis: verum end; supposeA31: not the Source of G . e in V1 ; ::_thesis: v in V2 reconsider Se = the Source of G . e as Vertex of G by A24, A26, FUNCT_2:5; ( v in rng ( the Target of G | ( the carrier' of G \ E1)) & rng ( the Target of G | ( the carrier' of G \ E1)) c= rng the Target of G ) by A26, A27, FUNCT_1:def_3, RELAT_1:70; then A32: v in rng the Target of G ; assume not v in V2 ; ::_thesis: contradiction then v in V1 by A25, A32, XBOOLE_0:def_5; then consider v9 being Vertex of G such that A33: v9 = v and A34: ( v9 = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v9 ) ) ; thus contradiction ::_thesis: verum proof percases ( v9 = v1 or ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v9 ) ) by A34; supposeA35: v9 = v1 ; ::_thesis: contradiction reconsider ec = <*e*> as Chain of G by A24, A26, MSSCYC_1:5; reconsider vs = <*v1,Se*> as FinSequence of the carrier of G ; len vs = 2 by FINSEQ_1:44; then A36: ( vs . 1 = v1 & vs . (len vs) = Se ) by FINSEQ_1:44; vs is_vertex_seq_of ec by A27, A28, A33, A35, Th11; hence contradiction by A31, A36; ::_thesis: verum end; suppose ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v9 ) ; ::_thesis: contradiction then consider c being Chain of G, vs being FinSequence of the carrier of G such that not c is empty and A37: vs is_vertex_seq_of c and A38: vs . 1 = v1 and A39: vs . (len vs) = v9 ; reconsider c9 = c ^ <*e*> as Chain of G by A24, A26, A27, A28, A33, A37, A39, Th13; ex vs9 being FinSequence of the carrier of G st ( vs9 = vs ^' <*( the Target of G . e),( the Source of G . e)*> & vs9 is_vertex_seq_of c9 & vs9 . 1 = vs . 1 & vs9 . (len vs9) = Se ) by A24, A26, A27, A28, A33, A37, A39, Th13; hence contradiction by A31, A38; ::_thesis: verum end; end; end; end; end; end; then reconsider T2 = the Target of G | ( the carrier' of G \ E1) as Function of ( the carrier' of G \ E1),V2 by A24, FUNCT_2:def_1, RELSET_1:4; A40: E1 c= the carrier' of G proof let e be set ; :: according to TARSKI:def_3 ::_thesis: ( not e in E1 or e in the carrier' of G ) assume e in E1 ; ::_thesis: e in the carrier' of G hence e in the carrier' of G by A5; ::_thesis: verum end; A41: dom ( the Target of G | E1) = (dom the Target of G) /\ E1 by RELAT_1:61 .= the carrier' of G /\ E1 by FUNCT_2:def_1 .= E1 by A40, XBOOLE_1:28 ; rng ( the Target of G | E1) c= V1 proof let v be set ; :: according to TARSKI:def_3 ::_thesis: ( not v in rng ( the Target of G | E1) or v in V1 ) assume v in rng ( the Target of G | E1) ; ::_thesis: v in V1 then consider e being set such that A42: e in dom ( the Target of G | E1) and A43: ( the Target of G | E1) . e = v by FUNCT_1:def_3; ( the Target of G | E1) . e = the Target of G . e by A42, FUNCT_1:47; hence v in V1 by A5, A41, A42, A43; ::_thesis: verum end; then reconsider T1 = the Target of G | E1 as Function of E1,V1 by A41, FUNCT_2:def_1, RELSET_1:4; A44: dom ( the Source of G | E1) = (dom the Source of G) /\ E1 by RELAT_1:61 .= the carrier' of G /\ E1 by FUNCT_2:def_1 .= E1 by A40, XBOOLE_1:28 ; rng ( the Source of G | E1) c= V1 proof let v be set ; :: according to TARSKI:def_3 ::_thesis: ( not v in rng ( the Source of G | E1) or v in V1 ) assume v in rng ( the Source of G | E1) ; ::_thesis: v in V1 then consider e being set such that A45: e in dom ( the Source of G | E1) and A46: ( the Source of G | E1) . e = v by FUNCT_1:def_3; ( the Source of G | E1) . e = the Source of G . e by A45, FUNCT_1:47; hence v in V1 by A5, A44, A45, A46; ::_thesis: verum end; then reconsider S1 = the Source of G | E1 as Function of E1,V1 by A44, FUNCT_2:def_1, RELSET_1:4; reconsider G1 = MultiGraphStruct(# V1,E1,S1,T1 #), G2 = MultiGraphStruct(# V2,( the carrier' of G \ E1),S2,T2 #) as Graph ; A47: G is_sum_of G1,G2 proof reconsider MG = MultiGraphStruct(# the carrier of G, the carrier' of G, the Source of G, the Target of G #) as strict Graph ; thus A48: the Target of G1 tolerates the Target of G2 :: according to GRAPH_1:def_6 ::_thesis: ( the Source of G1 tolerates the Source of G2 & MultiGraphStruct(# the carrier of G, the carrier' of G, the Source of G, the Target of G #) = G1 \/ G2 ) proof let x be set ; :: according to PARTFUN1:def_4 ::_thesis: ( not x in (dom the Target of G1) /\ (dom the Target of G2) or the Target of G1 . x = the Target of G2 . x ) assume A49: x in (dom the Target of G1) /\ (dom the Target of G2) ; ::_thesis: the Target of G1 . x = the Target of G2 . x then x in dom the Target of G2 by XBOOLE_0:def_4; then A50: x in the carrier' of G \ E1 by FUNCT_2:def_1; x in dom the Target of G1 by A49, XBOOLE_0:def_4; then x in E1 by FUNCT_2:def_1; hence the Target of G1 . x = the Target of G2 . x by A50, XBOOLE_0:def_5; ::_thesis: verum end; thus A51: the Source of G1 tolerates the Source of G2 ::_thesis: MultiGraphStruct(# the carrier of G, the carrier' of G, the Source of G, the Target of G #) = G1 \/ G2 proof let x be set ; :: according to PARTFUN1:def_4 ::_thesis: ( not x in (dom the Source of G1) /\ (dom the Source of G2) or the Source of G1 . x = the Source of G2 . x ) assume A52: x in (dom the Source of G1) /\ (dom the Source of G2) ; ::_thesis: the Source of G1 . x = the Source of G2 . x then x in dom the Source of G2 by XBOOLE_0:def_4; then A53: x in the carrier' of G \ E1 by FUNCT_2:def_1; x in dom the Source of G1 by A52, XBOOLE_0:def_4; then x in E1 by FUNCT_2:def_1; hence the Source of G1 . x = the Source of G2 . x by A53, XBOOLE_0:def_5; ::_thesis: verum end; A54: ( ( for v being set st v in the carrier' of G1 holds ( the Source of MG . v = the Source of G1 . v & the Target of MG . v = the Target of G1 . v ) ) & ( for v being set st v in the carrier' of G2 holds ( the Source of MG . v = the Source of G2 . v & the Target of MG . v = the Target of G2 . v ) ) ) by FUNCT_1:49; ( the carrier of MG = the carrier of G1 \/ the carrier of G2 & the carrier' of MG = the carrier' of G1 \/ the carrier' of G2 ) by A4, A40, XBOOLE_1:45; hence MultiGraphStruct(# the carrier of G, the carrier' of G, the Source of G, the Target of G #) = G1 \/ G2 by A48, A51, A54, GRAPH_1:def_5; ::_thesis: verum end; V1 misses V2 by XBOOLE_1:79; hence contradiction by A1, A47, GRAPH_1:def_10; ::_thesis: verum end; assume A55: for v1, v2 being Vertex of G st v1 <> v2 holds ex c being Chain of G ex vs being FinSequence of the carrier of G st ( not c is empty & vs is_vertex_seq_of c & vs . 1 = v1 & vs . (len vs) = v2 ) ; ::_thesis: G is connected thus G is connected ::_thesis: verum proof given G1, G2 being Graph such that A56: the carrier of G1 misses the carrier of G2 and A57: G is_sum_of G1,G2 ; :: according to GRAPH_1:def_10 ::_thesis: contradiction set v2 = the Vertex of G2; set v1 = the Vertex of G1; set V2 = the carrier of G2; set V1 = the carrier of G1; set T2 = the Target of G2; set T1 = the Target of G1; set S2 = the Source of G2; set S1 = the Source of G1; set E1 = the carrier' of G1; A58: MultiGraphStruct(# the carrier of G, the carrier' of G, the Source of G, the Target of G #) = G1 \/ G2 by A57, GRAPH_1:def_6; A59: ( the Target of G1 tolerates the Target of G2 & the Source of G1 tolerates the Source of G2 ) by A57, GRAPH_1:def_6; then A60: the carrier' of G = the carrier' of G1 \/ the carrier' of G2 by A58, GRAPH_1:def_5; the carrier of MultiGraphStruct(# the carrier of G, the carrier' of G, the Source of G, the Target of G #) = the carrier of G1 \/ the carrier of G2 by A59, A58, GRAPH_1:def_5; then reconsider v19 = the Vertex of G1, v29 = the Vertex of G2 as Vertex of G by XBOOLE_0:def_3; A61: the carrier of G1 /\ the carrier of G2 = {} by A56, XBOOLE_0:def_7; then the Vertex of G1 <> the Vertex of G2 by XBOOLE_0:def_4; then consider c being Chain of G, vs being FinSequence of the carrier of G such that not c is empty and A62: vs is_vertex_seq_of c and A63: vs . 1 = v19 and A64: vs . (len vs) = v29 by A55; defpred S1[ Nat] means ( $1 in dom vs & vs . $1 is Vertex of G2 ); A65: len vs = (len c) + 1 by A62, GRAPH_2:def_6; c is FinSequence of the carrier' of G by MSSCYC_1:def_1; then A66: rng c c= the carrier' of G by FINSEQ_1:def_4; 1 <= (len c) + 1 by NAT_1:11; then len vs in dom vs by A65, FINSEQ_3:25; then A67: ex k being Nat st S1[k] by A64; consider k being Nat such that A68: S1[k] and A69: for n being Nat st S1[n] holds k <= n from NAT_1:sch_5(A67); A70: 1 <= k by A68, FINSEQ_3:25; k <> 1 by A61, A63, A68, XBOOLE_0:def_4; then 1 < k by A70, XXREAL_0:1; then 1 + 1 <= k by NAT_1:13; then consider i being Element of NAT such that A71: 1 <= i and A72: i < k and A73: k = i + 1 by GRAPH_2:1; set e = c . i; A74: k <= len vs by A68, FINSEQ_3:25; then A75: i <= len c by A65, A73, XREAL_1:6; then i in dom c by A71, FINSEQ_3:25; then A76: c . i in rng c by FUNCT_1:def_3; i <= len vs by A72, A74, XXREAL_0:2; then A77: i in dom vs by A71, FINSEQ_3:25; percases ( c . i in the carrier' of G1 or c . i in the carrier' of G2 ) by A60, A66, A76, XBOOLE_0:def_3; supposeA78: c . i in the carrier' of G1 ; ::_thesis: contradiction then A79: the Target of G1 . (c . i) in the carrier of G1 by FUNCT_2:5; A80: the Source of G1 . (c . i) in the carrier of G1 by A78, FUNCT_2:5; thus contradiction ::_thesis: verum proof percases ( ( vs . i = the Target of G . (c . i) & vs . (i + 1) = the Source of G . (c . i) ) or ( vs . i = the Source of G . (c . i) & vs . (i + 1) = the Target of G . (c . i) ) ) by A62, A71, A75, Lm3; suppose ( vs . i = the Target of G . (c . i) & vs . (i + 1) = the Source of G . (c . i) ) ; ::_thesis: contradiction then vs . k in the carrier of G1 by A59, A58, A73, A78, A80, GRAPH_1:def_5; hence contradiction by A61, A68, XBOOLE_0:def_4; ::_thesis: verum end; suppose ( vs . i = the Source of G . (c . i) & vs . (i + 1) = the Target of G . (c . i) ) ; ::_thesis: contradiction then vs . k in the carrier of G1 by A59, A58, A73, A78, A79, GRAPH_1:def_5; hence contradiction by A61, A68, XBOOLE_0:def_4; ::_thesis: verum end; end; end; end; supposeA81: c . i in the carrier' of G2 ; ::_thesis: contradiction then A82: the Target of G2 . (c . i) in the carrier of G2 by FUNCT_2:5; A83: the Source of G2 . (c . i) in the carrier of G2 by A81, FUNCT_2:5; thus contradiction ::_thesis: verum proof percases ( ( vs . i = the Target of G . (c . i) & vs . (i + 1) = the Source of G . (c . i) ) or ( vs . i = the Source of G . (c . i) & vs . (i + 1) = the Target of G . (c . i) ) ) by A62, A71, A75, Lm3; suppose ( vs . i = the Target of G . (c . i) & vs . (i + 1) = the Source of G . (c . i) ) ; ::_thesis: contradiction then vs . i in the carrier of G2 by A59, A58, A81, A82, GRAPH_1:def_5; hence contradiction by A69, A72, A77; ::_thesis: verum end; suppose ( vs . i = the Source of G . (c . i) & vs . (i + 1) = the Target of G . (c . i) ) ; ::_thesis: contradiction then vs . i in the carrier of G2 by A59, A58, A81, A83, GRAPH_1:def_5; hence contradiction by A69, A72, A77; ::_thesis: verum end; end; end; end; end; end; end; theorem Th19: :: GRAPH_3:19 for G being connected Graph for X being set for v being Vertex of G st X meets the carrier' of G & not v in G -VSet X holds ex v9 being Vertex of G ex e being Element of the carrier' of G st ( v9 in G -VSet X & not e in X & ( v9 = the Target of G . e or v9 = the Source of G . e ) ) proof let G be connected Graph; ::_thesis: for X being set for v being Vertex of G st X meets the carrier' of G & not v in G -VSet X holds ex v9 being Vertex of G ex e being Element of the carrier' of G st ( v9 in G -VSet X & not e in X & ( v9 = the Target of G . e or v9 = the Source of G . e ) ) let X be set ; ::_thesis: for v being Vertex of G st X meets the carrier' of G & not v in G -VSet X holds ex v9 being Vertex of G ex e being Element of the carrier' of G st ( v9 in G -VSet X & not e in X & ( v9 = the Target of G . e or v9 = the Source of G . e ) ) let v be Vertex of G; ::_thesis: ( X meets the carrier' of G & not v in G -VSet X implies ex v9 being Vertex of G ex e being Element of the carrier' of G st ( v9 in G -VSet X & not e in X & ( v9 = the Target of G . e or v9 = the Source of G . e ) ) ) assume that A1: X meets the carrier' of G and A2: not v in G -VSet X ; ::_thesis: ex v9 being Vertex of G ex e being Element of the carrier' of G st ( v9 in G -VSet X & not e in X & ( v9 = the Target of G . e or v9 = the Source of G . e ) ) ex e being set st ( e in X & e in the carrier' of G ) by A1, XBOOLE_0:3; then not G -VSet X is empty by Th17; then consider vv being set such that A3: vv in G -VSet X by XBOOLE_0:def_1; reconsider vv = vv as Vertex of G by A3; consider c being Chain of G, vs being FinSequence of the carrier of G such that A4: not c is empty and A5: vs is_vertex_seq_of c and A6: vs . 1 = vv and A7: vs . (len vs) = v by A2, A3, Th18; defpred S1[ Nat] means ( 1 <= $1 & $1 <= len c & not vs . ($1 + 1) in G -VSet X ); A8: len vs = (len c) + 1 by A5, GRAPH_2:def_6; 1 + 0 <= len c by A4, NAT_1:13; then A9: ex n being Nat st S1[n] by A2, A7, A8; 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); len c <= (len c) + 1 by NAT_1:11; then k <= len vs by A8, A10, XXREAL_0:2; then k in dom vs by A10, FINSEQ_3:25; then reconsider v9 = vs . k as Vertex of G by FINSEQ_2:11; reconsider c = c as FinSequence of the carrier' of G by MSSCYC_1:def_1; A12: rng c c= the carrier' of G by FINSEQ_1:def_4; k in dom c by A10, FINSEQ_3:25; then c . k in rng c by FUNCT_1:def_3; then reconsider e = c . k as Element of the carrier' of G by A12; take v9 ; ::_thesis: ex e being Element of the carrier' of G st ( v9 in G -VSet X & not e in X & ( v9 = the Target of G . e or v9 = the Source of G . e ) ) take e ; ::_thesis: ( v9 in G -VSet X & not e in X & ( v9 = the Target of G . e or v9 = the Source of G . e ) ) hereby ::_thesis: ( not e in X & ( v9 = the Target of G . e or v9 = the Source of G . e ) ) percases ( k = 1 or 1 < k ) by A10, XXREAL_0:1; suppose k = 1 ; ::_thesis: v9 in G -VSet X hence v9 in G -VSet X by A3, A6; ::_thesis: verum end; supposeA13: 1 < k ; ::_thesis: v9 in G -VSet X assume A14: not v9 in G -VSet X ; ::_thesis: contradiction consider p being Element of NAT such that A15: k = 1 + p and A16: 1 <= p by A13, FINSEQ_4:84; p <= k by A15, NAT_1:11; then p <= len c by A10, XXREAL_0:2; then k <= p by A11, A15, A16, A14; hence contradiction by A15, NAT_1:13; ::_thesis: verum end; end; end; hereby ::_thesis: ( v9 = the Target of G . e or v9 = the Source of G . e ) ( 1 <= k + 1 & k + 1 <= len vs ) by A8, A10, NAT_1:11, XREAL_1:6; then k + 1 in dom vs by FINSEQ_3:25; then reconsider v99 = vs . (k + 1) as Vertex of G by FINSEQ_2:11; assume A17: e in X ; ::_thesis: contradiction ( v99 = the Target of G . e or v99 = the Source of G . e ) by A5, A10, Lm3; hence contradiction by A10, A17; ::_thesis: verum end; thus ( v9 = the Target of G . e or v9 = the Source of G . e ) by A5, A10, Lm3; ::_thesis: verum end; begin definition let G be Graph; let v be Vertex of G; let X be set ; func Edges_In (v,X) -> Subset of the carrier' of G means :Def1: :: GRAPH_3:def 1 for e being set holds ( e in it iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ); existence ex b1 being Subset of the carrier' of G st for e being set holds ( e in b1 iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) proof defpred S1[ set ] means ( $1 in X & the Target of G . $1 = v ); consider IT being set such that A1: for x being set holds ( x in IT iff ( x in the carrier' of G & S1[x] ) ) from XBOOLE_0:sch_1(); take IT ; ::_thesis: ( IT is Subset of the carrier' of G & ( for e being set holds ( e in IT iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) ) ) for x being set st x in IT holds x in the carrier' of G by A1; hence IT is Subset of the carrier' of G by TARSKI:def_3; ::_thesis: for e being set holds ( e in IT iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) thus for e being set holds ( e in IT iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) by A1; ::_thesis: verum end; uniqueness for b1, b2 being Subset of the carrier' of G st ( for e being set holds ( e in b1 iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) ) & ( for e being set holds ( e in b2 iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) ) holds b1 = b2 proof let it1, it2 be Subset of the carrier' of G; ::_thesis: ( ( for e being set holds ( e in it1 iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) ) & ( for e being set holds ( e in it2 iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) ) implies it1 = it2 ) assume that A2: for e being set holds ( e in it1 iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) and A3: for e being set holds ( e in it2 iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) ; ::_thesis: it1 = it2 now__::_thesis:_for_e_being_set_holds_ (_e_in_it1_iff_e_in_it2_) let e be set ; ::_thesis: ( e in it1 iff e in it2 ) ( e in it1 iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) by A2; hence ( e in it1 iff e in it2 ) by A3; ::_thesis: verum end; hence it1 = it2 by TARSKI:1; ::_thesis: verum end; func Edges_Out (v,X) -> Subset of the carrier' of G means :Def2: :: GRAPH_3:def 2 for e being set holds ( e in it iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ); existence ex b1 being Subset of the carrier' of G st for e being set holds ( e in b1 iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) proof defpred S1[ set ] means ( $1 in X & the Source of G . $1 = v ); consider IT being set such that A4: for x being set holds ( x in IT iff ( x in the carrier' of G & S1[x] ) ) from XBOOLE_0:sch_1(); take IT ; ::_thesis: ( IT is Subset of the carrier' of G & ( for e being set holds ( e in IT iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) ) ) for x being set st x in IT holds x in the carrier' of G by A4; hence IT is Subset of the carrier' of G by TARSKI:def_3; ::_thesis: for e being set holds ( e in IT iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) thus for e being set holds ( e in IT iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) by A4; ::_thesis: verum end; uniqueness for b1, b2 being Subset of the carrier' of G st ( for e being set holds ( e in b1 iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) ) & ( for e being set holds ( e in b2 iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) ) holds b1 = b2 proof let it1, it2 be Subset of the carrier' of G; ::_thesis: ( ( for e being set holds ( e in it1 iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) ) & ( for e being set holds ( e in it2 iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) ) implies it1 = it2 ) assume that A5: for e being set holds ( e in it1 iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) and A6: for e being set holds ( e in it2 iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) ; ::_thesis: it1 = it2 now__::_thesis:_for_e_being_set_holds_ (_e_in_it1_iff_e_in_it2_) let e be set ; ::_thesis: ( e in it1 iff e in it2 ) ( e in it1 iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) by A5; hence ( e in it1 iff e in it2 ) by A6; ::_thesis: verum end; hence it1 = it2 by TARSKI:1; ::_thesis: verum end; end; :: deftheorem Def1 defines Edges_In GRAPH_3:def_1_:_ for G being Graph for v being Vertex of G for X being set for b4 being Subset of the carrier' of G holds ( b4 = Edges_In (v,X) iff for e being set holds ( e in b4 iff ( e in the carrier' of G & e in X & the Target of G . e = v ) ) ); :: deftheorem Def2 defines Edges_Out GRAPH_3:def_2_:_ for G being Graph for v being Vertex of G for X being set for b4 being Subset of the carrier' of G holds ( b4 = Edges_Out (v,X) iff for e being set holds ( e in b4 iff ( e in the carrier' of G & e in X & the Source of G . e = v ) ) ); definition let G be Graph; let v be Vertex of G; let X be set ; func Edges_At (v,X) -> Subset of the carrier' of G equals :: GRAPH_3:def 3 (Edges_In (v,X)) \/ (Edges_Out (v,X)); correctness coherence (Edges_In (v,X)) \/ (Edges_Out (v,X)) is Subset of the carrier' of G; ; end; :: deftheorem defines Edges_At GRAPH_3:def_3_:_ for G being Graph for v being Vertex of G for X being set holds Edges_At (v,X) = (Edges_In (v,X)) \/ (Edges_Out (v,X)); registration let G be finite Graph; let v be Vertex of G; let X be set ; cluster Edges_In (v,X) -> finite ; correctness coherence Edges_In (v,X) is finite ; proof the carrier' of G is finite by GRAPH_1:def_11; hence Edges_In (v,X) is finite ; ::_thesis: verum end; cluster Edges_Out (v,X) -> finite ; correctness coherence Edges_Out (v,X) is finite ; proof the carrier' of G is finite by GRAPH_1:def_11; hence Edges_Out (v,X) is finite ; ::_thesis: verum end; cluster Edges_At (v,X) -> finite ; correctness coherence Edges_At (v,X) is finite ; ; end; registration let G be Graph; let v be Vertex of G; let X be empty set ; cluster Edges_In (v,X) -> empty ; correctness coherence Edges_In (v,X) is empty ; proof assume not Edges_In (v,X) is empty ; ::_thesis: contradiction then ex x being set st x in Edges_In (v,X) by XBOOLE_0:def_1; hence contradiction by Def1; ::_thesis: verum end; cluster Edges_Out (v,X) -> empty ; correctness coherence Edges_Out (v,X) is empty ; proof assume not Edges_Out (v,X) is empty ; ::_thesis: contradiction then ex x being set st x in Edges_Out (v,X) by XBOOLE_0:def_1; hence contradiction by Def2; ::_thesis: verum end; cluster Edges_At (v,X) -> empty ; correctness coherence Edges_At (v,X) is empty ; ; end; definition let G be Graph; let v be Vertex of G; func Edges_In v -> Subset of the carrier' of G equals :: GRAPH_3:def 4 Edges_In (v, the carrier' of G); correctness coherence Edges_In (v, the carrier' of G) is Subset of the carrier' of G; ; func Edges_Out v -> Subset of the carrier' of G equals :: GRAPH_3:def 5 Edges_Out (v, the carrier' of G); correctness coherence Edges_Out (v, the carrier' of G) is Subset of the carrier' of G; ; end; :: deftheorem defines Edges_In GRAPH_3:def_4_:_ for G being Graph for v being Vertex of G holds Edges_In v = Edges_In (v, the carrier' of G); :: deftheorem defines Edges_Out GRAPH_3:def_5_:_ for G being Graph for v being Vertex of G holds Edges_Out v = Edges_Out (v, the carrier' of G); theorem Th20: :: GRAPH_3:20 for G being Graph for v being Vertex of G for X being set holds Edges_In (v,X) c= Edges_In v proof let G be Graph; ::_thesis: for v being Vertex of G for X being set holds Edges_In (v,X) c= Edges_In v let v be Vertex of G; ::_thesis: for X being set holds Edges_In (v,X) c= Edges_In v let X be set ; ::_thesis: Edges_In (v,X) c= Edges_In v let e be set ; :: according to TARSKI:def_3 ::_thesis: ( not e in Edges_In (v,X) or e in Edges_In v ) assume A1: e in Edges_In (v,X) ; ::_thesis: e in Edges_In v then the Target of G . e = v by Def1; hence e in Edges_In v by A1, Def1; ::_thesis: verum end; theorem Th21: :: GRAPH_3:21 for G being Graph for v being Vertex of G for X being set holds Edges_Out (v,X) c= Edges_Out v proof let G be Graph; ::_thesis: for v being Vertex of G for X being set holds Edges_Out (v,X) c= Edges_Out v let v be Vertex of G; ::_thesis: for X being set holds Edges_Out (v,X) c= Edges_Out v let X be set ; ::_thesis: Edges_Out (v,X) c= Edges_Out v let e be set ; :: according to TARSKI:def_3 ::_thesis: ( not e in Edges_Out (v,X) or e in Edges_Out v ) assume A1: e in Edges_Out (v,X) ; ::_thesis: e in Edges_Out v then the Source of G . e = v by Def2; hence e in Edges_Out v by A1, Def2; ::_thesis: verum end; registration let G be finite Graph; let v be Vertex of G; cluster Edges_In v -> finite ; correctness coherence Edges_In v is finite ; ; cluster Edges_Out v -> finite ; correctness coherence Edges_Out v is finite ; ; end; theorem Th22: :: GRAPH_3:22 for G being finite Graph for v being Vertex of G holds card (Edges_In v) = EdgesIn v proof let G be finite Graph; ::_thesis: for v being Vertex of G holds card (Edges_In v) = EdgesIn v let v be Vertex of G; ::_thesis: card (Edges_In v) = EdgesIn v consider X being finite set such that A1: for z being set holds ( z in X iff ( z in the carrier' of G & the Target of G . z = v ) ) and A2: EdgesIn v = card X by GRAPH_1:def_21; now__::_thesis:_for_e_being_set_holds_ (_e_in_Edges_In_v_iff_e_in_X_) let e be set ; ::_thesis: ( e in Edges_In v iff e in X ) ( e in Edges_In (v, the carrier' of G) iff ( e in the carrier' of G & the Target of G . e = v ) ) by Def1; hence ( e in Edges_In v iff e in X ) by A1; ::_thesis: verum end; hence card (Edges_In v) = EdgesIn v by A2, TARSKI:1; ::_thesis: verum end; theorem Th23: :: GRAPH_3:23 for G being finite Graph for v being Vertex of G holds card (Edges_Out v) = EdgesOut v proof let G be finite Graph; ::_thesis: for v being Vertex of G holds card (Edges_Out v) = EdgesOut v let v be Vertex of G; ::_thesis: card (Edges_Out v) = EdgesOut v consider X being finite set such that A1: for z being set holds ( z in X iff ( z in the carrier' of G & the Source of G . z = v ) ) and A2: EdgesOut v = card X by GRAPH_1:def_22; now__::_thesis:_for_e_being_set_holds_ (_e_in_Edges_Out_v_iff_e_in_X_) let e be set ; ::_thesis: ( e in Edges_Out v iff e in X ) ( e in Edges_Out (v, the carrier' of G) iff ( e in the carrier' of G & the Source of G . e = v ) ) by Def2; hence ( e in Edges_Out v iff e in X ) by A1; ::_thesis: verum end; hence card (Edges_Out v) = EdgesOut v by A2, TARSKI:1; ::_thesis: verum end; definition let G be finite Graph; let v be Vertex of G; let X be set ; func Degree (v,X) -> Element of NAT equals :: GRAPH_3:def 6 (card (Edges_In (v,X))) + (card (Edges_Out (v,X))); correctness coherence (card (Edges_In (v,X))) + (card (Edges_Out (v,X))) is Element of NAT ; ; end; :: deftheorem defines Degree GRAPH_3:def_6_:_ for G being finite Graph for v being Vertex of G for X being set holds Degree (v,X) = (card (Edges_In (v,X))) + (card (Edges_Out (v,X))); theorem Th24: :: GRAPH_3:24 for G being finite Graph for v being Vertex of G holds Degree v = Degree (v, the carrier' of G) proof let G be finite Graph; ::_thesis: for v being Vertex of G holds Degree v = Degree (v, the carrier' of G) let v be Vertex of G; ::_thesis: Degree v = Degree (v, the carrier' of G) thus Degree v = (card (Edges_In v)) + (EdgesOut v) by Th22 .= (card (Edges_In (v, the carrier' of G))) + (card (Edges_Out v)) by Th23 .= Degree (v, the carrier' of G) ; ::_thesis: verum end; theorem Th25: :: GRAPH_3:25 for X being set for G being finite Graph for v being Vertex of G st Degree (v,X) <> 0 holds not Edges_At (v,X) is empty proof let X be set ; ::_thesis: for G being finite Graph for v being Vertex of G st Degree (v,X) <> 0 holds not Edges_At (v,X) is empty let G be finite Graph; ::_thesis: for v being Vertex of G st Degree (v,X) <> 0 holds not Edges_At (v,X) is empty let v be Vertex of G; ::_thesis: ( Degree (v,X) <> 0 implies not Edges_At (v,X) is empty ) assume A1: Degree (v,X) <> 0 ; ::_thesis: not Edges_At (v,X) is empty assume A2: Edges_At (v,X) is empty ; ::_thesis: contradiction then Edges_In (v,X) = {} ; hence contradiction by A1, A2; ::_thesis: verum end; theorem Th26: :: GRAPH_3:26 for e, X being set for G being finite Graph for v being Vertex of G st e in the carrier' of G & not e in X & ( v = the Target of G . e or v = the Source of G . e ) holds Degree v <> Degree (v,X) proof let e, X be set ; ::_thesis: for G being finite Graph for v being Vertex of G st e in the carrier' of G & not e in X & ( v = the Target of G . e or v = the Source of G . e ) holds Degree v <> Degree (v,X) let G be finite Graph; ::_thesis: for v being Vertex of G st e in the carrier' of G & not e in X & ( v = the Target of G . e or v = the Source of G . e ) holds Degree v <> Degree (v,X) let v be Vertex of G; ::_thesis: ( e in the carrier' of G & not e in X & ( v = the Target of G . e or v = the Source of G . e ) implies Degree v <> Degree (v,X) ) set T = the Target of G; set S = the Source of G; set E = the carrier' of G; assume that A1: e in the carrier' of G and A2: not e in X and A3: ( v = the Target of G . e or v = the Source of G . e ) ; ::_thesis: Degree v <> Degree (v,X) A4: Degree v = Degree (v, the carrier' of G) by Th24; Edges_Out v = Edges_Out (v, the carrier' of G) ; then A5: Edges_Out (v,X) c= Edges_Out (v, the carrier' of G) by Th21; Edges_In v = Edges_In (v, the carrier' of G) ; then A6: Edges_In (v,X) c= Edges_In (v, the carrier' of G) by Th20; percases ( v = the Target of G . e or v = the Source of G . e ) by A3; supposeA7: v = the Target of G . e ; ::_thesis: Degree v <> Degree (v,X) A8: not e in Edges_In (v,X) by A2, Def1; e in Edges_In (v, the carrier' of G) by A1, A7, Def1; then Edges_In (v,X) c< Edges_In (v, the carrier' of G) by A6, A8, XBOOLE_0:def_8; then card (Edges_In (v,X)) < card (Edges_In (v, the carrier' of G)) by CARD_2:48; hence Degree v <> Degree (v,X) by A4, A5, NAT_1:43, XREAL_1:8; ::_thesis: verum end; supposeA9: v = the Source of G . e ; ::_thesis: Degree v <> Degree (v,X) A10: not e in Edges_Out (v,X) by A2, Def2; e in Edges_Out (v, the carrier' of G) by A1, A9, Def2; then Edges_Out (v,X) c< Edges_Out (v, the carrier' of G) by A5, A10, XBOOLE_0:def_8; then card (Edges_Out (v,X)) < card (Edges_Out (v, the carrier' of G)) by CARD_2:48; hence Degree v <> Degree (v,X) by A4, A6, NAT_1:43, XREAL_1:8; ::_thesis: verum end; end; end; theorem Th27: :: GRAPH_3:27 for G being finite Graph for v being Vertex of G for X2, X1 being set st X2 c= X1 holds card (Edges_In (v,(X1 \ X2))) = (card (Edges_In (v,X1))) - (card (Edges_In (v,X2))) proof let G be finite Graph; ::_thesis: for v being Vertex of G for X2, X1 being set st X2 c= X1 holds card (Edges_In (v,(X1 \ X2))) = (card (Edges_In (v,X1))) - (card (Edges_In (v,X2))) let v be Vertex of G; ::_thesis: for X2, X1 being set st X2 c= X1 holds card (Edges_In (v,(X1 \ X2))) = (card (Edges_In (v,X1))) - (card (Edges_In (v,X2))) let X2, X1 be set ; ::_thesis: ( X2 c= X1 implies card (Edges_In (v,(X1 \ X2))) = (card (Edges_In (v,X1))) - (card (Edges_In (v,X2))) ) assume A1: X2 c= X1 ; ::_thesis: card (Edges_In (v,(X1 \ X2))) = (card (Edges_In (v,X1))) - (card (Edges_In (v,X2))) then A2: X1 = X2 \/ (X1 \ X2) by XBOOLE_1:45; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_Edges_In_(v,X1)_implies_x_in_(Edges_In_(v,X2))_\/_(Edges_In_(v,(X1_\_X2)))_)_&_(_x_in_(Edges_In_(v,X2))_\/_(Edges_In_(v,(X1_\_X2)))_implies_x_in_Edges_In_(v,X1)_)_) let x be set ; ::_thesis: ( ( x in Edges_In (v,X1) implies x in (Edges_In (v,X2)) \/ (Edges_In (v,(X1 \ X2))) ) & ( x in (Edges_In (v,X2)) \/ (Edges_In (v,(X1 \ X2))) implies x in Edges_In (v,X1) ) ) hereby ::_thesis: ( x in (Edges_In (v,X2)) \/ (Edges_In (v,(X1 \ X2))) implies x in Edges_In (v,X1) ) assume A3: x in Edges_In (v,X1) ; ::_thesis: x in (Edges_In (v,X2)) \/ (Edges_In (v,(X1 \ X2))) then x in X1 by Def1; then A4: ( x in X2 or x in X1 \ X2 ) by A2, XBOOLE_0:def_3; the Target of G . x = v by A3, Def1; then ( x in Edges_In (v,X2) or x in Edges_In (v,(X1 \ X2)) ) by A3, A4, Def1; hence x in (Edges_In (v,X2)) \/ (Edges_In (v,(X1 \ X2))) by XBOOLE_0:def_3; ::_thesis: verum end; assume A5: x in (Edges_In (v,X2)) \/ (Edges_In (v,(X1 \ X2))) ; ::_thesis: x in Edges_In (v,X1) then A6: ( x in Edges_In (v,X2) or x in Edges_In (v,(X1 \ X2)) ) by XBOOLE_0:def_3; then A7: ( x in X2 or x in X1 \ X2 ) by Def1; the Target of G . x = v by A6, Def1; hence x in Edges_In (v,X1) by A1, A5, A7, Def1; ::_thesis: verum end; then A8: Edges_In (v,X1) = (Edges_In (v,X2)) \/ (Edges_In (v,(X1 \ X2))) by TARSKI:1; Edges_In (v,X2) misses Edges_In (v,(X1 \ X2)) proof assume not Edges_In (v,X2) misses Edges_In (v,(X1 \ X2)) ; ::_thesis: contradiction then consider x being set such that A9: x in (Edges_In (v,X2)) /\ (Edges_In (v,(X1 \ X2))) by XBOOLE_0:4; x in Edges_In (v,(X1 \ X2)) by A9, XBOOLE_0:def_4; then A10: x in X1 \ X2 by Def1; x in Edges_In (v,X2) by A9, XBOOLE_0:def_4; then x in X2 by Def1; hence contradiction by A10, XBOOLE_0:def_5; ::_thesis: verum end; then card (Edges_In (v,X1)) = (card (Edges_In (v,X2))) + (card (Edges_In (v,(X1 \ X2)))) by A8, CARD_2:40; hence card (Edges_In (v,(X1 \ X2))) = (card (Edges_In (v,X1))) - (card (Edges_In (v,X2))) ; ::_thesis: verum end; theorem Th28: :: GRAPH_3:28 for G being finite Graph for v being Vertex of G for X2, X1 being set st X2 c= X1 holds card (Edges_Out (v,(X1 \ X2))) = (card (Edges_Out (v,X1))) - (card (Edges_Out (v,X2))) proof let G be finite Graph; ::_thesis: for v being Vertex of G for X2, X1 being set st X2 c= X1 holds card (Edges_Out (v,(X1 \ X2))) = (card (Edges_Out (v,X1))) - (card (Edges_Out (v,X2))) let v be Vertex of G; ::_thesis: for X2, X1 being set st X2 c= X1 holds card (Edges_Out (v,(X1 \ X2))) = (card (Edges_Out (v,X1))) - (card (Edges_Out (v,X2))) let X2, X1 be set ; ::_thesis: ( X2 c= X1 implies card (Edges_Out (v,(X1 \ X2))) = (card (Edges_Out (v,X1))) - (card (Edges_Out (v,X2))) ) assume A1: X2 c= X1 ; ::_thesis: card (Edges_Out (v,(X1 \ X2))) = (card (Edges_Out (v,X1))) - (card (Edges_Out (v,X2))) then A2: X1 = X2 \/ (X1 \ X2) by XBOOLE_1:45; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_Edges_Out_(v,X1)_implies_x_in_(Edges_Out_(v,X2))_\/_(Edges_Out_(v,(X1_\_X2)))_)_&_(_x_in_(Edges_Out_(v,X2))_\/_(Edges_Out_(v,(X1_\_X2)))_implies_x_in_Edges_Out_(v,X1)_)_) let x be set ; ::_thesis: ( ( x in Edges_Out (v,X1) implies x in (Edges_Out (v,X2)) \/ (Edges_Out (v,(X1 \ X2))) ) & ( x in (Edges_Out (v,X2)) \/ (Edges_Out (v,(X1 \ X2))) implies x in Edges_Out (v,X1) ) ) hereby ::_thesis: ( x in (Edges_Out (v,X2)) \/ (Edges_Out (v,(X1 \ X2))) implies x in Edges_Out (v,X1) ) assume A3: x in Edges_Out (v,X1) ; ::_thesis: x in (Edges_Out (v,X2)) \/ (Edges_Out (v,(X1 \ X2))) then x in X1 by Def2; then A4: ( x in X2 or x in X1 \ X2 ) by A2, XBOOLE_0:def_3; the Source of G . x = v by A3, Def2; then ( x in Edges_Out (v,X2) or x in Edges_Out (v,(X1 \ X2)) ) by A3, A4, Def2; hence x in (Edges_Out (v,X2)) \/ (Edges_Out (v,(X1 \ X2))) by XBOOLE_0:def_3; ::_thesis: verum end; assume A5: x in (Edges_Out (v,X2)) \/ (Edges_Out (v,(X1 \ X2))) ; ::_thesis: x in Edges_Out (v,X1) then A6: ( x in Edges_Out (v,X2) or x in Edges_Out (v,(X1 \ X2)) ) by XBOOLE_0:def_3; then A7: ( x in X2 or x in X1 \ X2 ) by Def2; the Source of G . x = v by A6, Def2; hence x in Edges_Out (v,X1) by A1, A5, A7, Def2; ::_thesis: verum end; then A8: Edges_Out (v,X1) = (Edges_Out (v,X2)) \/ (Edges_Out (v,(X1 \ X2))) by TARSKI:1; Edges_Out (v,X2) misses Edges_Out (v,(X1 \ X2)) proof assume not Edges_Out (v,X2) misses Edges_Out (v,(X1 \ X2)) ; ::_thesis: contradiction then consider x being set such that A9: x in (Edges_Out (v,X2)) /\ (Edges_Out (v,(X1 \ X2))) by XBOOLE_0:4; x in Edges_Out (v,(X1 \ X2)) by A9, XBOOLE_0:def_4; then A10: x in X1 \ X2 by Def2; x in Edges_Out (v,X2) by A9, XBOOLE_0:def_4; then x in X2 by Def2; hence contradiction by A10, XBOOLE_0:def_5; ::_thesis: verum end; then card (Edges_Out (v,X1)) = (card (Edges_Out (v,X2))) + (card (Edges_Out (v,(X1 \ X2)))) by A8, CARD_2:40; hence card (Edges_Out (v,(X1 \ X2))) = (card (Edges_Out (v,X1))) - (card (Edges_Out (v,X2))) ; ::_thesis: verum end; theorem Th29: :: GRAPH_3:29 for G being finite Graph for v being Vertex of G for X2, X1 being set st X2 c= X1 holds Degree (v,(X1 \ X2)) = (Degree (v,X1)) - (Degree (v,X2)) proof let G be finite Graph; ::_thesis: for v being Vertex of G for X2, X1 being set st X2 c= X1 holds Degree (v,(X1 \ X2)) = (Degree (v,X1)) - (Degree (v,X2)) let v be Vertex of G; ::_thesis: for X2, X1 being set st X2 c= X1 holds Degree (v,(X1 \ X2)) = (Degree (v,X1)) - (Degree (v,X2)) let X2, X1 be set ; ::_thesis: ( X2 c= X1 implies Degree (v,(X1 \ X2)) = (Degree (v,X1)) - (Degree (v,X2)) ) assume X2 c= X1 ; ::_thesis: Degree (v,(X1 \ X2)) = (Degree (v,X1)) - (Degree (v,X2)) then ( card (Edges_In (v,(X1 \ X2))) = (card (Edges_In (v,X1))) - (card (Edges_In (v,X2))) & card (Edges_Out (v,(X1 \ X2))) = (card (Edges_Out (v,X1))) - (card (Edges_Out (v,X2))) ) by Th27, Th28; hence Degree (v,(X1 \ X2)) = (Degree (v,X1)) - (Degree (v,X2)) ; ::_thesis: verum end; theorem Th30: :: GRAPH_3:30 for X being set for G being finite Graph for v being Vertex of G holds ( Edges_In (v,X) = Edges_In (v,(X /\ the carrier' of G)) & Edges_Out (v,X) = Edges_Out (v,(X /\ the carrier' of G)) ) proof let X be set ; ::_thesis: for G being finite Graph for v being Vertex of G holds ( Edges_In (v,X) = Edges_In (v,(X /\ the carrier' of G)) & Edges_Out (v,X) = Edges_Out (v,(X /\ the carrier' of G)) ) let G be finite Graph; ::_thesis: for v being Vertex of G holds ( Edges_In (v,X) = Edges_In (v,(X /\ the carrier' of G)) & Edges_Out (v,X) = Edges_Out (v,(X /\ the carrier' of G)) ) let v be Vertex of G; ::_thesis: ( Edges_In (v,X) = Edges_In (v,(X /\ the carrier' of G)) & Edges_Out (v,X) = Edges_Out (v,(X /\ the carrier' of G)) ) set E = the carrier' of G; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_Edges_In_(v,X)_implies_x_in_Edges_In_(v,(X_/\_the_carrier'_of_G))_)_&_(_x_in_Edges_In_(v,(X_/\_the_carrier'_of_G))_implies_x_in_Edges_In_(v,X)_)_) let x be set ; ::_thesis: ( ( x in Edges_In (v,X) implies x in Edges_In (v,(X /\ the carrier' of G)) ) & ( x in Edges_In (v,(X /\ the carrier' of G)) implies x in Edges_In (v,X) ) ) hereby ::_thesis: ( x in Edges_In (v,(X /\ the carrier' of G)) implies x in Edges_In (v,X) ) assume A1: x in Edges_In (v,X) ; ::_thesis: x in Edges_In (v,(X /\ the carrier' of G)) then x in X by Def1; then A2: x in X /\ the carrier' of G by A1, XBOOLE_0:def_4; the Target of G . x = v by A1, Def1; hence x in Edges_In (v,(X /\ the carrier' of G)) by A1, A2, Def1; ::_thesis: verum end; assume A3: x in Edges_In (v,(X /\ the carrier' of G)) ; ::_thesis: x in Edges_In (v,X) then x in X /\ the carrier' of G by Def1; then A4: x in X by XBOOLE_0:def_4; the Target of G . x = v by A3, Def1; hence x in Edges_In (v,X) by A3, A4, Def1; ::_thesis: verum end; hence Edges_In (v,X) = Edges_In (v,(X /\ the carrier' of G)) by TARSKI:1; ::_thesis: Edges_Out (v,X) = Edges_Out (v,(X /\ the carrier' of G)) now__::_thesis:_for_x_being_set_holds_ (_(_x_in_Edges_Out_(v,X)_implies_x_in_Edges_Out_(v,(X_/\_the_carrier'_of_G))_)_&_(_x_in_Edges_Out_(v,(X_/\_the_carrier'_of_G))_implies_x_in_Edges_Out_(v,X)_)_) let x be set ; ::_thesis: ( ( x in Edges_Out (v,X) implies x in Edges_Out (v,(X /\ the carrier' of G)) ) & ( x in Edges_Out (v,(X /\ the carrier' of G)) implies x in Edges_Out (v,X) ) ) hereby ::_thesis: ( x in Edges_Out (v,(X /\ the carrier' of G)) implies x in Edges_Out (v,X) ) assume A5: x in Edges_Out (v,X) ; ::_thesis: x in Edges_Out (v,(X /\ the carrier' of G)) then x in X by Def2; then A6: x in X /\ the carrier' of G by A5, XBOOLE_0:def_4; the Source of G . x = v by A5, Def2; hence x in Edges_Out (v,(X /\ the carrier' of G)) by A5, A6, Def2; ::_thesis: verum end; assume A7: x in Edges_Out (v,(X /\ the carrier' of G)) ; ::_thesis: x in Edges_Out (v,X) then x in X /\ the carrier' of G by Def2; then A8: x in X by XBOOLE_0:def_4; the Source of G . x = v by A7, Def2; hence x in Edges_Out (v,X) by A7, A8, Def2; ::_thesis: verum end; hence Edges_Out (v,X) = Edges_Out (v,(X /\ the carrier' of G)) by TARSKI:1; ::_thesis: verum end; theorem Th31: :: GRAPH_3:31 for X being set for G being finite Graph for v being Vertex of G holds Degree (v,X) = Degree (v,(X /\ the carrier' of G)) proof let X be set ; ::_thesis: for G being finite Graph for v being Vertex of G holds Degree (v,X) = Degree (v,(X /\ the carrier' of G)) let G be finite Graph; ::_thesis: for v being Vertex of G holds Degree (v,X) = Degree (v,(X /\ the carrier' of G)) let v be Vertex of G; ::_thesis: Degree (v,X) = Degree (v,(X /\ the carrier' of G)) set E = the carrier' of G; thus Degree (v,X) = (card (Edges_In (v,(X /\ the carrier' of G)))) + (card (Edges_Out (v,X))) by Th30 .= Degree (v,(X /\ the carrier' of G)) by Th30 ; ::_thesis: verum end; theorem Th32: :: GRAPH_3:32 for G being finite Graph for v being Vertex of G for c being Chain of G for vs being FinSequence of the carrier of G st not c is empty & vs is_vertex_seq_of c holds ( v in rng vs iff Degree (v,(rng c)) <> 0 ) proof let G be finite Graph; ::_thesis: for v being Vertex of G for c being Chain of G for vs being FinSequence of the carrier of G st not c is empty & vs is_vertex_seq_of c holds ( v in rng vs iff Degree (v,(rng c)) <> 0 ) let v be Vertex of G; ::_thesis: for c being Chain of G for vs being FinSequence of the carrier of G st not c is empty & vs is_vertex_seq_of c holds ( v in rng vs iff Degree (v,(rng c)) <> 0 ) let c be Chain of G; ::_thesis: for vs being FinSequence of the carrier of G st not c is empty & vs is_vertex_seq_of c holds ( v in rng vs iff Degree (v,(rng c)) <> 0 ) let vs be FinSequence of the carrier of G; ::_thesis: ( not c is empty & vs is_vertex_seq_of c implies ( v in rng vs iff Degree (v,(rng c)) <> 0 ) ) assume that A1: not c is empty and A2: vs is_vertex_seq_of c ; ::_thesis: ( v in rng vs iff Degree (v,(rng c)) <> 0 ) hereby ::_thesis: ( Degree (v,(rng c)) <> 0 implies v in rng vs ) c is FinSequence of the carrier' of G by MSSCYC_1:def_1; then A3: rng c c= the carrier' of G by FINSEQ_1:def_4; assume that A4: v in rng vs and A5: Degree (v,(rng c)) = 0 ; ::_thesis: contradiction A6: ( Edges_In (v,(rng c)) = {} & Edges_Out (v,(rng c)) = {} ) by A5; A7: 0 + 1 <= len c by A1, NAT_1:13; A8: len vs = (len c) + 1 by A2, GRAPH_2:def_6; consider i being Nat such that A9: i in dom vs and A10: vs . i = v by A4, FINSEQ_2:10; A11: 1 <= i by A9, FINSEQ_3:25; A12: i <= len vs by A9, FINSEQ_3:25; percases ( i = len vs or i < len vs ) by A12, XXREAL_0:1; supposeA13: i = len vs ; ::_thesis: contradiction set ic = len c; len c in dom c by A7, FINSEQ_3:25; then A14: c . (len c) in rng c by FUNCT_1:def_3; ( vs . (len vs) = the Target of G . (c . (len c)) or vs . (len vs) = the Source of G . (c . (len c)) ) by A2, A8, A7, Lm3; hence contradiction by A6, A10, A3, A13, A14, Def1, Def2; ::_thesis: verum end; suppose i < len vs ; ::_thesis: contradiction then A15: i <= len c by A8, NAT_1:13; then i in dom c by A11, FINSEQ_3:25; then A16: c . i in rng c by FUNCT_1:def_3; ( vs . i = the Target of G . (c . i) or vs . i = the Source of G . (c . i) ) by A2, A11, A15, Lm3; hence contradiction by A6, A10, A3, A16, Def1, Def2; ::_thesis: verum end; end; end; assume that A17: Degree (v,(rng c)) <> 0 and A18: not v in rng vs ; ::_thesis: contradiction percases ( card (Edges_In (v,(rng c))) <> 0 or card (Edges_Out (v,(rng c))) <> 0 ) by A17; suppose card (Edges_In (v,(rng c))) <> 0 ; ::_thesis: contradiction then consider e being set such that A19: e in Edges_In (v,(rng c)) by CARD_1:27, XBOOLE_0:def_1; A20: the Target of G . e = v by A19, Def1; e in rng c by A19, Def1; then consider i being Nat such that A21: i in dom c and A22: c . i = e by FINSEQ_2:10; A23: 1 <= i by A21, FINSEQ_3:25; A24: i <= len c by A21, FINSEQ_3:25; then ( 1 <= i + 1 & i + 1 <= len vs ) by A2, A23, Lm3; then A25: i + 1 in dom vs by FINSEQ_3:25; i <= len vs by A2, A23, A24, Lm3; then A26: i in dom vs by A23, FINSEQ_3:25; ( ( vs . i = the Target of G . (c . i) & vs . (i + 1) = the Source of G . (c . i) ) or ( vs . i = the Source of G . (c . i) & vs . (i + 1) = the Target of G . (c . i) ) ) by A2, A23, A24, Lm3; hence contradiction by A18, A20, A22, A26, A25, FUNCT_1:def_3; ::_thesis: verum end; suppose card (Edges_Out (v,(rng c))) <> 0 ; ::_thesis: contradiction then consider e being set such that A27: e in Edges_Out (v,(rng c)) by CARD_1:27, XBOOLE_0:def_1; A28: the Source of G . e = v by A27, Def2; e in rng c by A27, Def2; then consider i being Nat such that A29: i in dom c and A30: c . i = e by FINSEQ_2:10; A31: 1 <= i by A29, FINSEQ_3:25; A32: i <= len c by A29, FINSEQ_3:25; then ( 1 <= i + 1 & i + 1 <= len vs ) by A2, A31, Lm3; then A33: i + 1 in dom vs by FINSEQ_3:25; i <= len vs by A2, A31, A32, Lm3; then A34: i in dom vs by A31, FINSEQ_3:25; ( ( vs . i = the Target of G . (c . i) & vs . (i + 1) = the Source of G . (c . i) ) or ( vs . i = the Source of G . (c . i) & vs . (i + 1) = the Target of G . (c . i) ) ) by A2, A31, A32, Lm3; hence contradiction by A18, A28, A30, A34, A33, FUNCT_1:def_3; ::_thesis: verum end; end; end; theorem Th33: :: GRAPH_3:33 for G being non void connected finite Graph for v being Vertex of G holds Degree v <> 0 proof let G be non void connected finite Graph; ::_thesis: for v being Vertex of G holds Degree v <> 0 let v be Vertex of G; ::_thesis: Degree v <> 0 assume A1: Degree v = 0 ; ::_thesis: contradiction set E = the carrier' of G; A2: Degree v = Degree (v, the carrier' of G) by Th24 .= (card (Edges_In (v, the carrier' of G))) + (card (Edges_Out (v, the carrier' of G))) ; then A3: Edges_In (v, the carrier' of G) = {} by A1; A4: Edges_Out (v, the carrier' of G) = {} by A1, A2; set S = the Source of G; set T = the Target of G; consider e being set such that A5: e in the carrier' of G by XBOOLE_0:def_1; reconsider s = the Source of G . e as Vertex of G by A5, FUNCT_2:5; percases ( v = s or v <> s ) ; suppose v = s ; ::_thesis: contradiction hence contradiction by A4, A5, Def2; ::_thesis: verum end; suppose v <> s ; ::_thesis: contradiction then consider c being Chain of G, vs being FinSequence of the carrier of G such that A6: not c is empty and A7: vs is_vertex_seq_of c and A8: vs . 1 = v and vs . (len vs) = s by Th18; A9: 0 + 1 <= len c by A6, NAT_1:13; then 1 in dom c by FINSEQ_3:25; then A10: c . 1 in rng c by FUNCT_1:def_3; c is FinSequence of the carrier' of G by MSSCYC_1:def_1; then A11: rng c c= the carrier' of G by FINSEQ_1:def_4; ( vs . 1 = the Target of G . (c . 1) or vs . 1 = the Source of G . (c . 1) ) by A7, A9, Lm3; hence contradiction by A3, A4, A8, A11, A10, Def1, Def2; ::_thesis: verum end; end; end; begin definition let G be Graph; let v1, v2 be Vertex of G; func AddNewEdge (v1,v2) -> strict Graph means :Def7: :: GRAPH_3:def 7 ( the carrier of it = the carrier of G & the carrier' of it = the carrier' of G \/ { the carrier' of G} & the Source of it = the Source of G +* ( the carrier' of G .--> v1) & the Target of it = the Target of G +* ( the carrier' of G .--> v2) ); existence ex b1 being strict Graph st ( the carrier of b1 = the carrier of G & the carrier' of b1 = the carrier' of G \/ { the carrier' of G} & the Source of b1 = the Source of G +* ( the carrier' of G .--> v1) & the Target of b1 = the Target of G +* ( the carrier' of G .--> v2) ) proof set T = the Target of G; set E = the carrier' of G; set V = the carrier of G; set Eit = the carrier' of G \/ { the carrier' of G}; set t = the carrier' of G .--> v2; A1: {v1} c= the carrier of G by ZFMISC_1:31; set Tit = the Target of G +* ( the carrier' of G .--> v2); A2: dom ( the carrier' of G .--> v2) = { the carrier' of G} by FUNCOP_1:13; A3: {v2} c= the carrier of G by ZFMISC_1:31; ( rng ( the carrier' of G .--> v2) = {v2} & rng the Target of G c= the carrier of G ) by FUNCOP_1:8, RELAT_1:def_19; then ( rng ( the Target of G +* ( the carrier' of G .--> v2)) c= (rng the Target of G) \/ (rng ( the carrier' of G .--> v2)) & (rng the Target of G) \/ (rng ( the carrier' of G .--> v2)) c= the carrier of G ) by A3, FUNCT_4:17, XBOOLE_1:8; then A4: rng ( the Target of G +* ( the carrier' of G .--> v2)) c= the carrier of G by XBOOLE_1:1; dom ( the Target of G +* ( the carrier' of G .--> v2)) = (dom the Target of G) \/ (dom ( the carrier' of G .--> v2)) by FUNCT_4:def_1 .= the carrier' of G \/ { the carrier' of G} by A2, FUNCT_2:def_1 ; then reconsider Tit = the Target of G +* ( the carrier' of G .--> v2) as Function of ( the carrier' of G \/ { the carrier' of G}), the carrier of G by A4, FUNCT_2:def_1, RELSET_1:4; set S = the Source of G; set s = the carrier' of G .--> v1; A5: dom ( the carrier' of G .--> v1) = { the carrier' of G} by FUNCOP_1:13; set Sit = the Source of G +* ( the carrier' of G .--> v1); A6: dom ( the Source of G +* ( the carrier' of G .--> v1)) = (dom the Source of G) \/ (dom ( the carrier' of G .--> v1)) by FUNCT_4:def_1 .= the carrier' of G \/ { the carrier' of G} by A5, FUNCT_2:def_1 ; ( rng ( the carrier' of G .--> v1) = {v1} & rng the Source of G c= the carrier of G ) by FUNCOP_1:8, RELAT_1:def_19; then ( rng ( the Source of G +* ( the carrier' of G .--> v1)) c= (rng the Source of G) \/ (rng ( the carrier' of G .--> v1)) & (rng the Source of G) \/ (rng ( the carrier' of G .--> v1)) c= the carrier of G ) by A1, FUNCT_4:17, XBOOLE_1:8; then rng ( the Source of G +* ( the carrier' of G .--> v1)) c= the carrier of G by XBOOLE_1:1; then reconsider Sit = the Source of G +* ( the carrier' of G .--> v1) as Function of ( the carrier' of G \/ { the carrier' of G}), the carrier of G by A6, FUNCT_2:def_1, RELSET_1:4; reconsider IT = MultiGraphStruct(# the carrier of G,( the carrier' of G \/ { the carrier' of G}),Sit,Tit #) as non empty strict MultiGraphStruct ; take IT ; ::_thesis: ( the carrier of IT = the carrier of G & the carrier' of IT = the carrier' of G \/ { the carrier' of G} & the Source of IT = the Source of G +* ( the carrier' of G .--> v1) & the Target of IT = the Target of G +* ( the carrier' of G .--> v2) ) thus ( the carrier of IT = the carrier of G & the carrier' of IT = the carrier' of G \/ { the carrier' of G} & the Source of IT = the Source of G +* ( the carrier' of G .--> v1) & the Target of IT = the Target of G +* ( the carrier' of G .--> v2) ) ; ::_thesis: verum end; uniqueness for b1, b2 being strict Graph st the carrier of b1 = the carrier of G & the carrier' of b1 = the carrier' of G \/ { the carrier' of G} & the Source of b1 = the Source of G +* ( the carrier' of G .--> v1) & the Target of b1 = the Target of G +* ( the carrier' of G .--> v2) & the carrier of b2 = the carrier of G & the carrier' of b2 = the carrier' of G \/ { the carrier' of G} & the Source of b2 = the Source of G +* ( the carrier' of G .--> v1) & the Target of b2 = the Target of G +* ( the carrier' of G .--> v2) holds b1 = b2 ; end; :: deftheorem Def7 defines AddNewEdge GRAPH_3:def_7_:_ for G being Graph for v1, v2 being Vertex of G for b4 being strict Graph holds ( b4 = AddNewEdge (v1,v2) iff ( the carrier of b4 = the carrier of G & the carrier' of b4 = the carrier' of G \/ { the carrier' of G} & the Source of b4 = the Source of G +* ( the carrier' of G .--> v1) & the Target of b4 = the Target of G +* ( the carrier' of G .--> v2) ) ); registration let G be finite Graph; let v1, v2 be Vertex of G; cluster AddNewEdge (v1,v2) -> strict finite ; coherence AddNewEdge (v1,v2) is finite proof reconsider E = the carrier' of G as finite set by GRAPH_1:def_11; reconsider V = the carrier of G as finite set by GRAPH_1:def_11; the carrier of (AddNewEdge (v1,v2)) = V by Def7; hence the carrier of (AddNewEdge (v1,v2)) is finite ; :: according to GRAPH_1:def_11 ::_thesis: the carrier' of (AddNewEdge (v1,v2)) is finite the carrier' of (AddNewEdge (v1,v2)) = E \/ { the carrier' of G} by Def7; hence the carrier' of (AddNewEdge (v1,v2)) is finite ; ::_thesis: verum end; end; theorem Th34: :: GRAPH_3:34 for G being Graph for v1, v2 being Vertex of G holds ( the carrier' of G in the carrier' of (AddNewEdge (v1,v2)) & the carrier' of G = the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} & the Source of (AddNewEdge (v1,v2)) . the carrier' of G = v1 & the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v2 ) proof let G be Graph; ::_thesis: for v1, v2 being Vertex of G holds ( the carrier' of G in the carrier' of (AddNewEdge (v1,v2)) & the carrier' of G = the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} & the Source of (AddNewEdge (v1,v2)) . the carrier' of G = v1 & the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v2 ) let v1, v2 be Vertex of G; ::_thesis: ( the carrier' of G in the carrier' of (AddNewEdge (v1,v2)) & the carrier' of G = the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} & the Source of (AddNewEdge (v1,v2)) . the carrier' of G = v1 & the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v2 ) set G9 = AddNewEdge (v1,v2); set E = the carrier' of G; set S = the Source of G; set T = the Target of G; set E9 = the carrier' of (AddNewEdge (v1,v2)); A1: the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; the carrier' of G in { the carrier' of G} by TARSKI:def_1; hence the carrier' of G in the carrier' of (AddNewEdge (v1,v2)) by A1, XBOOLE_0:def_3; ::_thesis: ( the carrier' of G = the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} & the Source of (AddNewEdge (v1,v2)) . the carrier' of G = v1 & the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v2 ) now__::_thesis:_for_x_being_set_holds_ (_(_x_in_the_carrier'_of_G_implies_x_in_the_carrier'_of_(AddNewEdge_(v1,v2))_\_{_the_carrier'_of_G}_)_&_(_x_in_the_carrier'_of_(AddNewEdge_(v1,v2))_\_{_the_carrier'_of_G}_implies_x_in_the_carrier'_of_G_)_) let x be set ; ::_thesis: ( ( x in the carrier' of G implies x in the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} ) & ( x in the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} implies x in the carrier' of G ) ) hereby ::_thesis: ( x in the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} implies x in the carrier' of G ) assume A2: x in the carrier' of G ; ::_thesis: x in the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} then x <> the carrier' of G ; then A3: not x in { the carrier' of G} by TARSKI:def_1; x in the carrier' of (AddNewEdge (v1,v2)) by A1, A2, XBOOLE_0:def_3; hence x in the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} by A3, XBOOLE_0:def_5; ::_thesis: verum end; assume A4: x in the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} ; ::_thesis: x in the carrier' of G then not x in { the carrier' of G} by XBOOLE_0:def_5; hence x in the carrier' of G by A1, A4, XBOOLE_0:def_3; ::_thesis: verum end; hence the carrier' of G = the carrier' of (AddNewEdge (v1,v2)) \ { the carrier' of G} by TARSKI:1; ::_thesis: ( the Source of (AddNewEdge (v1,v2)) . the carrier' of G = v1 & the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v2 ) dom ( the carrier' of G .--> v1) = { the carrier' of G} by FUNCOP_1:13; then A5: the carrier' of G in dom ( the carrier' of G .--> v1) by TARSKI:def_1; the Source of (AddNewEdge (v1,v2)) = the Source of G +* ( the carrier' of G .--> v1) by Def7; hence the Source of (AddNewEdge (v1,v2)) . the carrier' of G = ( the carrier' of G .--> v1) . the carrier' of G by A5, FUNCT_4:13 .= v1 by FUNCOP_1:72 ; ::_thesis: the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v2 dom ( the carrier' of G .--> v2) = { the carrier' of G} by FUNCOP_1:13; then A6: the carrier' of G in dom ( the carrier' of G .--> v2) by TARSKI:def_1; the Target of (AddNewEdge (v1,v2)) = the Target of G +* ( the carrier' of G .--> v2) by Def7; hence the Target of (AddNewEdge (v1,v2)) . the carrier' of G = ( the carrier' of G .--> v2) . the carrier' of G by A6, FUNCT_4:13 .= v2 by FUNCOP_1:72 ; ::_thesis: verum end; theorem Th35: :: GRAPH_3:35 for e being set for G being Graph for v1, v2 being Vertex of G st e in the carrier' of G holds ( the Source of (AddNewEdge (v1,v2)) . e = the Source of G . e & the Target of (AddNewEdge (v1,v2)) . e = the Target of G . e ) proof let e be set ; ::_thesis: for G being Graph for v1, v2 being Vertex of G st e in the carrier' of G holds ( the Source of (AddNewEdge (v1,v2)) . e = the Source of G . e & the Target of (AddNewEdge (v1,v2)) . e = the Target of G . e ) let G be Graph; ::_thesis: for v1, v2 being Vertex of G st e in the carrier' of G holds ( the Source of (AddNewEdge (v1,v2)) . e = the Source of G . e & the Target of (AddNewEdge (v1,v2)) . e = the Target of G . e ) let v1, v2 be Vertex of G; ::_thesis: ( e in the carrier' of G implies ( the Source of (AddNewEdge (v1,v2)) . e = the Source of G . e & the Target of (AddNewEdge (v1,v2)) . e = the Target of G . e ) ) set S = the Source of G; set T = the Target of G; set E = the carrier' of G; set G9 = AddNewEdge (v1,v2); set S9 = the Source of (AddNewEdge (v1,v2)); set T9 = the Target of (AddNewEdge (v1,v2)); assume A1: e in the carrier' of G ; ::_thesis: ( the Source of (AddNewEdge (v1,v2)) . e = the Source of G . e & the Target of (AddNewEdge (v1,v2)) . e = the Target of G . e ) A2: not e in dom ( the carrier' of G .--> v1) proof assume e in dom ( the carrier' of G .--> v1) ; ::_thesis: contradiction then e in { the carrier' of G} by FUNCOP_1:13; then e = the carrier' of G by TARSKI:def_1; hence contradiction by A1; ::_thesis: verum end; thus the Source of (AddNewEdge (v1,v2)) . e = ( the Source of G +* ( the carrier' of G .--> v1)) . e by Def7 .= the Source of G . e by A2, FUNCT_4:11 ; ::_thesis: the Target of (AddNewEdge (v1,v2)) . e = the Target of G . e A3: not e in dom ( the carrier' of G .--> v2) proof assume e in dom ( the carrier' of G .--> v2) ; ::_thesis: contradiction then e in { the carrier' of G} by FUNCOP_1:13; then e = the carrier' of G by TARSKI:def_1; hence contradiction by A1; ::_thesis: verum end; thus the Target of (AddNewEdge (v1,v2)) . e = ( the Target of G +* ( the carrier' of G .--> v2)) . e by Def7 .= the Target of G . e by A3, FUNCT_4:11 ; ::_thesis: verum end; theorem Th36: :: GRAPH_3:36 for G being Graph for v1, v2 being Vertex of G for c being Chain of G for vs being FinSequence of the carrier of G for vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st vs9 = vs & vs is_vertex_seq_of c holds vs9 is_vertex_seq_of c proof let G be Graph; ::_thesis: for v1, v2 being Vertex of G for c being Chain of G for vs being FinSequence of the carrier of G for vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st vs9 = vs & vs is_vertex_seq_of c holds vs9 is_vertex_seq_of c let v1, v2 be Vertex of G; ::_thesis: for c being Chain of G for vs being FinSequence of the carrier of G for vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st vs9 = vs & vs is_vertex_seq_of c holds vs9 is_vertex_seq_of c let c be Chain of G; ::_thesis: for vs being FinSequence of the carrier of G for vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st vs9 = vs & vs is_vertex_seq_of c holds vs9 is_vertex_seq_of c let vs be FinSequence of the carrier of G; ::_thesis: for vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st vs9 = vs & vs is_vertex_seq_of c holds vs9 is_vertex_seq_of c let vs9 be FinSequence of the carrier of (AddNewEdge (v1,v2)); ::_thesis: ( vs9 = vs & vs is_vertex_seq_of c implies vs9 is_vertex_seq_of c ) assume that A1: vs9 = vs and A2: vs is_vertex_seq_of c ; ::_thesis: vs9 is_vertex_seq_of c thus len vs9 = (len c) + 1 by A1, A2, GRAPH_2:def_6; :: according to GRAPH_2:def_6 ::_thesis: for b1 being Element of NAT holds ( not 1 <= b1 or not b1 <= len c or c . b1 joins vs9 /. b1,vs9 /. (b1 + 1) ) let n be Element of NAT ; ::_thesis: ( not 1 <= n or not n <= len c or c . n joins vs9 /. n,vs9 /. (n + 1) ) set T = the Target of G; set S = the Source of G; set v = c . n; set x = vs /. n; set y = vs /. (n + 1); assume A3: ( 1 <= n & n <= len c ) ; ::_thesis: c . n joins vs9 /. n,vs9 /. (n + 1) then c . n joins vs /. n,vs /. (n + 1) by A2, GRAPH_2:def_6; then A4: ( ( the Source of G . (c . n) = vs /. n & the Target of G . (c . n) = vs /. (n + 1) ) or ( the Source of G . (c . n) = vs /. (n + 1) & the Target of G . (c . n) = vs /. n ) ) by GRAPH_1:def_12; set G9 = AddNewEdge (v1,v2); set S9 = the Source of (AddNewEdge (v1,v2)); set T9 = the Target of (AddNewEdge (v1,v2)); A5: the carrier of G = the carrier of (AddNewEdge (v1,v2)) by Def7; c is FinSequence of the carrier' of G by MSSCYC_1:def_1; then A6: rng c c= the carrier' of G by FINSEQ_1:def_4; n in dom c by A3, FINSEQ_3:25; then c . n in rng c by FUNCT_1:def_3; then ( the Source of (AddNewEdge (v1,v2)) . (c . n) = the Source of G . (c . n) & the Target of G . (c . n) = the Target of (AddNewEdge (v1,v2)) . (c . n) ) by A6, Th35; hence c . n joins vs9 /. n,vs9 /. (n + 1) by A1, A5, A4, GRAPH_1:def_12; ::_thesis: verum end; theorem Th37: :: GRAPH_3:37 for G being Graph for v1, v2 being Vertex of G for c being Chain of G holds c is Chain of AddNewEdge (v1,v2) proof let G be Graph; ::_thesis: for v1, v2 being Vertex of G for c being Chain of G holds c is Chain of AddNewEdge (v1,v2) let v1, v2 be Vertex of G; ::_thesis: for c being Chain of G holds c is Chain of AddNewEdge (v1,v2) let c be Chain of G; ::_thesis: c is Chain of AddNewEdge (v1,v2) set G9 = AddNewEdge (v1,v2); consider p being FinSequence of the carrier of G such that A1: p is_vertex_seq_of c by GRAPH_2:33; c is FinSequence of the carrier' of G by MSSCYC_1:def_1; then A2: rng c c= the carrier' of G by FINSEQ_1:def_4; the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; then the carrier' of G c= the carrier' of (AddNewEdge (v1,v2)) by XBOOLE_1:7; then rng c c= the carrier' of (AddNewEdge (v1,v2)) by A2, XBOOLE_1:1; hence c is FinSequence of the carrier' of (AddNewEdge (v1,v2)) by FINSEQ_1:def_4; :: according to MSSCYC_1:def_1 ::_thesis: ex b1 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st b1 is_vertex_seq_of c reconsider p9 = p as FinSequence of the carrier of (AddNewEdge (v1,v2)) by Def7; take p9 ; ::_thesis: p9 is_vertex_seq_of c thus p9 is_vertex_seq_of c by A1, Th36; ::_thesis: verum end; theorem :: GRAPH_3:38 for G being Graph for v1, v2 being Vertex of G for p being Path of G holds p is Path of AddNewEdge (v1,v2) by Th37; theorem Th39: :: GRAPH_3:39 for X being set for G being Graph for v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v1 & v1 <> v2 holds Edges_In (v9,X) = Edges_In (v1,X) proof let X be set ; ::_thesis: for G being Graph for v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v1 & v1 <> v2 holds Edges_In (v9,X) = Edges_In (v1,X) let G be Graph; ::_thesis: for v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v1 & v1 <> v2 holds Edges_In (v9,X) = Edges_In (v1,X) let v1, v2 be Vertex of G; ::_thesis: for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v1 & v1 <> v2 holds Edges_In (v9,X) = Edges_In (v1,X) let v9 be Vertex of (AddNewEdge (v1,v2)); ::_thesis: ( v9 = v1 & v1 <> v2 implies Edges_In (v9,X) = Edges_In (v1,X) ) assume that A1: v9 = v1 and A2: v1 <> v2 ; ::_thesis: Edges_In (v9,X) = Edges_In (v1,X) set G9 = AddNewEdge (v1,v2); set E = the carrier' of G; set T = the Target of G; set E9 = the carrier' of (AddNewEdge (v1,v2)); set T9 = the Target of (AddNewEdge (v1,v2)); A3: the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_Edges_In_(v9,X)_implies_x_in_Edges_In_(v1,X)_)_&_(_x_in_Edges_In_(v1,X)_implies_x_in_Edges_In_(v9,X)_)_) let x be set ; ::_thesis: ( ( x in Edges_In (v9,X) implies x in Edges_In (v1,X) ) & ( x in Edges_In (v1,X) implies x in Edges_In (v9,X) ) ) hereby ::_thesis: ( x in Edges_In (v1,X) implies x in Edges_In (v9,X) ) assume A4: x in Edges_In (v9,X) ; ::_thesis: x in Edges_In (v1,X) then A5: x in X by Def1; A6: the Target of (AddNewEdge (v1,v2)) . x = v9 by A4, Def1; the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v2 by Th34; then not x in { the carrier' of G} by A1, A2, A6, TARSKI:def_1; then A7: x in the carrier' of G by A3, A4, XBOOLE_0:def_3; then the Target of G . x = v1 by A1, A6, Th35; hence x in Edges_In (v1,X) by A5, A7, Def1; ::_thesis: verum end; assume A8: x in Edges_In (v1,X) ; ::_thesis: x in Edges_In (v9,X) then the Target of G . x = v1 by Def1; then A9: the Target of (AddNewEdge (v1,v2)) . x = v9 by A1, A8, Th35; ( x in X & x in the carrier' of (AddNewEdge (v1,v2)) ) by A3, A8, Def1, XBOOLE_0:def_3; hence x in Edges_In (v9,X) by A9, Def1; ::_thesis: verum end; hence Edges_In (v9,X) = Edges_In (v1,X) by TARSKI:1; ::_thesis: verum end; theorem Th40: :: GRAPH_3:40 for X being set for G being Graph for v2, v1 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v2 & v1 <> v2 holds Edges_Out (v9,X) = Edges_Out (v2,X) proof let X be set ; ::_thesis: for G being Graph for v2, v1 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v2 & v1 <> v2 holds Edges_Out (v9,X) = Edges_Out (v2,X) let G be Graph; ::_thesis: for v2, v1 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v2 & v1 <> v2 holds Edges_Out (v9,X) = Edges_Out (v2,X) let v2, v1 be Vertex of G; ::_thesis: for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v2 & v1 <> v2 holds Edges_Out (v9,X) = Edges_Out (v2,X) let v9 be Vertex of (AddNewEdge (v1,v2)); ::_thesis: ( v9 = v2 & v1 <> v2 implies Edges_Out (v9,X) = Edges_Out (v2,X) ) assume that A1: v9 = v2 and A2: v1 <> v2 ; ::_thesis: Edges_Out (v9,X) = Edges_Out (v2,X) set G9 = AddNewEdge (v1,v2); set E = the carrier' of G; set S = the Source of G; set E9 = the carrier' of (AddNewEdge (v1,v2)); set S9 = the Source of (AddNewEdge (v1,v2)); A3: the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_Edges_Out_(v9,X)_implies_x_in_Edges_Out_(v2,X)_)_&_(_x_in_Edges_Out_(v2,X)_implies_x_in_Edges_Out_(v9,X)_)_) let x be set ; ::_thesis: ( ( x in Edges_Out (v9,X) implies x in Edges_Out (v2,X) ) & ( x in Edges_Out (v2,X) implies x in Edges_Out (v9,X) ) ) hereby ::_thesis: ( x in Edges_Out (v2,X) implies x in Edges_Out (v9,X) ) assume A4: x in Edges_Out (v9,X) ; ::_thesis: x in Edges_Out (v2,X) then A5: x in X by Def2; A6: the Source of (AddNewEdge (v1,v2)) . x = v9 by A4, Def2; the Source of (AddNewEdge (v1,v2)) . the carrier' of G = v1 by Th34; then not x in { the carrier' of G} by A1, A2, A6, TARSKI:def_1; then A7: x in the carrier' of G by A3, A4, XBOOLE_0:def_3; then the Source of G . x = v2 by A1, A6, Th35; hence x in Edges_Out (v2,X) by A5, A7, Def2; ::_thesis: verum end; assume A8: x in Edges_Out (v2,X) ; ::_thesis: x in Edges_Out (v9,X) then the Source of G . x = v2 by Def2; then A9: the Source of (AddNewEdge (v1,v2)) . x = v9 by A1, A8, Th35; ( x in X & x in the carrier' of (AddNewEdge (v1,v2)) ) by A3, A8, Def2, XBOOLE_0:def_3; hence x in Edges_Out (v9,X) by A9, Def2; ::_thesis: verum end; hence Edges_Out (v9,X) = Edges_Out (v2,X) by TARSKI:1; ::_thesis: verum end; theorem Th41: :: GRAPH_3:41 for X being set for G being Graph for v2, v1 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v1 & the carrier' of G in X holds ( Edges_Out (v9,X) = (Edges_Out (v1,X)) \/ { the carrier' of G} & Edges_Out (v1,X) misses { the carrier' of G} ) proof let X be set ; ::_thesis: for G being Graph for v2, v1 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v1 & the carrier' of G in X holds ( Edges_Out (v9,X) = (Edges_Out (v1,X)) \/ { the carrier' of G} & Edges_Out (v1,X) misses { the carrier' of G} ) let G be Graph; ::_thesis: for v2, v1 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v1 & the carrier' of G in X holds ( Edges_Out (v9,X) = (Edges_Out (v1,X)) \/ { the carrier' of G} & Edges_Out (v1,X) misses { the carrier' of G} ) let v2, v1 be Vertex of G; ::_thesis: for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v1 & the carrier' of G in X holds ( Edges_Out (v9,X) = (Edges_Out (v1,X)) \/ { the carrier' of G} & Edges_Out (v1,X) misses { the carrier' of G} ) let v9 be Vertex of (AddNewEdge (v1,v2)); ::_thesis: ( v9 = v1 & the carrier' of G in X implies ( Edges_Out (v9,X) = (Edges_Out (v1,X)) \/ { the carrier' of G} & Edges_Out (v1,X) misses { the carrier' of G} ) ) assume that A1: v9 = v1 and A2: the carrier' of G in X ; ::_thesis: ( Edges_Out (v9,X) = (Edges_Out (v1,X)) \/ { the carrier' of G} & Edges_Out (v1,X) misses { the carrier' of G} ) set G9 = AddNewEdge (v1,v2); set E = the carrier' of G; set S = the Source of G; set E9 = the carrier' of (AddNewEdge (v1,v2)); set S9 = the Source of (AddNewEdge (v1,v2)); A3: the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_Edges_Out_(v9,X)_implies_x_in_(Edges_Out_(v1,X))_\/_{_the_carrier'_of_G}_)_&_(_x_in_(Edges_Out_(v1,X))_\/_{_the_carrier'_of_G}_implies_x_in_Edges_Out_(v9,X)_)_) let x be set ; ::_thesis: ( ( x in Edges_Out (v9,X) implies x in (Edges_Out (v1,X)) \/ { the carrier' of G} ) & ( x in (Edges_Out (v1,X)) \/ { the carrier' of G} implies b1 in Edges_Out (v9,X) ) ) hereby ::_thesis: ( x in (Edges_Out (v1,X)) \/ { the carrier' of G} implies b1 in Edges_Out (v9,X) ) assume A4: x in Edges_Out (v9,X) ; ::_thesis: x in (Edges_Out (v1,X)) \/ { the carrier' of G} then A5: x in X by Def2; A6: the Source of (AddNewEdge (v1,v2)) . x = v9 by A4, Def2; percases ( x in the carrier' of G or x in { the carrier' of G} ) by A3, A4, XBOOLE_0:def_3; supposeA7: x in the carrier' of G ; ::_thesis: x in (Edges_Out (v1,X)) \/ { the carrier' of G} then the Source of G . x = v1 by A1, A6, Th35; then x in Edges_Out (v1,X) by A5, A7, Def2; hence x in (Edges_Out (v1,X)) \/ { the carrier' of G} by XBOOLE_0:def_3; ::_thesis: verum end; suppose x in { the carrier' of G} ; ::_thesis: x in (Edges_Out (v1,X)) \/ { the carrier' of G} hence x in (Edges_Out (v1,X)) \/ { the carrier' of G} by XBOOLE_0:def_3; ::_thesis: verum end; end; end; assume A8: x in (Edges_Out (v1,X)) \/ { the carrier' of G} ; ::_thesis: b1 in Edges_Out (v9,X) percases ( x in Edges_Out (v1,X) or x in { the carrier' of G} ) by A8, XBOOLE_0:def_3; supposeA9: x in Edges_Out (v1,X) ; ::_thesis: b1 in Edges_Out (v9,X) then the Source of G . x = v1 by Def2; then A10: the Source of (AddNewEdge (v1,v2)) . x = v9 by A1, A9, Th35; ( x in X & x in the carrier' of (AddNewEdge (v1,v2)) ) by A3, A9, Def2, XBOOLE_0:def_3; hence x in Edges_Out (v9,X) by A10, Def2; ::_thesis: verum end; supposeA11: x in { the carrier' of G} ; ::_thesis: b1 in Edges_Out (v9,X) A12: the Source of (AddNewEdge (v1,v2)) . the carrier' of G = v1 by Th34; ( x = the carrier' of G & x in the carrier' of (AddNewEdge (v1,v2)) ) by A3, A11, TARSKI:def_1, XBOOLE_0:def_3; hence x in Edges_Out (v9,X) by A1, A2, A12, Def2; ::_thesis: verum end; end; end; hence Edges_Out (v9,X) = (Edges_Out (v1,X)) \/ { the carrier' of G} by TARSKI:1; ::_thesis: Edges_Out (v1,X) misses { the carrier' of G} assume (Edges_Out (v1,X)) /\ { the carrier' of G} <> {} ; :: according to XBOOLE_0:def_7 ::_thesis: contradiction then consider x being set such that A13: x in (Edges_Out (v1,X)) /\ { the carrier' of G} by XBOOLE_0:def_1; x in { the carrier' of G} by A13, XBOOLE_0:def_4; then A14: x = the carrier' of G by TARSKI:def_1; x in the carrier' of G by A13; hence contradiction by A14; ::_thesis: verum end; theorem Th42: :: GRAPH_3:42 for X being set for G being Graph for v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v2 & the carrier' of G in X holds ( Edges_In (v9,X) = (Edges_In (v2,X)) \/ { the carrier' of G} & Edges_In (v2,X) misses { the carrier' of G} ) proof let X be set ; ::_thesis: for G being Graph for v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v2 & the carrier' of G in X holds ( Edges_In (v9,X) = (Edges_In (v2,X)) \/ { the carrier' of G} & Edges_In (v2,X) misses { the carrier' of G} ) let G be Graph; ::_thesis: for v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v2 & the carrier' of G in X holds ( Edges_In (v9,X) = (Edges_In (v2,X)) \/ { the carrier' of G} & Edges_In (v2,X) misses { the carrier' of G} ) let v1, v2 be Vertex of G; ::_thesis: for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v2 & the carrier' of G in X holds ( Edges_In (v9,X) = (Edges_In (v2,X)) \/ { the carrier' of G} & Edges_In (v2,X) misses { the carrier' of G} ) let v9 be Vertex of (AddNewEdge (v1,v2)); ::_thesis: ( v9 = v2 & the carrier' of G in X implies ( Edges_In (v9,X) = (Edges_In (v2,X)) \/ { the carrier' of G} & Edges_In (v2,X) misses { the carrier' of G} ) ) assume that A1: v9 = v2 and A2: the carrier' of G in X ; ::_thesis: ( Edges_In (v9,X) = (Edges_In (v2,X)) \/ { the carrier' of G} & Edges_In (v2,X) misses { the carrier' of G} ) set G9 = AddNewEdge (v1,v2); set E = the carrier' of G; set T = the Target of G; set E9 = the carrier' of (AddNewEdge (v1,v2)); set T9 = the Target of (AddNewEdge (v1,v2)); A3: the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_Edges_In_(v9,X)_implies_x_in_(Edges_In_(v2,X))_\/_{_the_carrier'_of_G}_)_&_(_x_in_(Edges_In_(v2,X))_\/_{_the_carrier'_of_G}_implies_x_in_Edges_In_(v9,X)_)_) let x be set ; ::_thesis: ( ( x in Edges_In (v9,X) implies x in (Edges_In (v2,X)) \/ { the carrier' of G} ) & ( x in (Edges_In (v2,X)) \/ { the carrier' of G} implies b1 in Edges_In (v9,X) ) ) hereby ::_thesis: ( x in (Edges_In (v2,X)) \/ { the carrier' of G} implies b1 in Edges_In (v9,X) ) assume A4: x in Edges_In (v9,X) ; ::_thesis: x in (Edges_In (v2,X)) \/ { the carrier' of G} then A5: x in X by Def1; A6: the Target of (AddNewEdge (v1,v2)) . x = v9 by A4, Def1; percases ( x in the carrier' of G or x in { the carrier' of G} ) by A3, A4, XBOOLE_0:def_3; supposeA7: x in the carrier' of G ; ::_thesis: x in (Edges_In (v2,X)) \/ { the carrier' of G} then the Target of G . x = v2 by A1, A6, Th35; then x in Edges_In (v2,X) by A5, A7, Def1; hence x in (Edges_In (v2,X)) \/ { the carrier' of G} by XBOOLE_0:def_3; ::_thesis: verum end; suppose x in { the carrier' of G} ; ::_thesis: x in (Edges_In (v2,X)) \/ { the carrier' of G} hence x in (Edges_In (v2,X)) \/ { the carrier' of G} by XBOOLE_0:def_3; ::_thesis: verum end; end; end; assume A8: x in (Edges_In (v2,X)) \/ { the carrier' of G} ; ::_thesis: b1 in Edges_In (v9,X) percases ( x in Edges_In (v2,X) or x in { the carrier' of G} ) by A8, XBOOLE_0:def_3; supposeA9: x in Edges_In (v2,X) ; ::_thesis: b1 in Edges_In (v9,X) then the Target of G . x = v2 by Def1; then A10: the Target of (AddNewEdge (v1,v2)) . x = v9 by A1, A9, Th35; ( x in X & x in the carrier' of (AddNewEdge (v1,v2)) ) by A3, A9, Def1, XBOOLE_0:def_3; hence x in Edges_In (v9,X) by A10, Def1; ::_thesis: verum end; supposeA11: x in { the carrier' of G} ; ::_thesis: b1 in Edges_In (v9,X) A12: the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v2 by Th34; ( x = the carrier' of G & x in the carrier' of (AddNewEdge (v1,v2)) ) by A3, A11, TARSKI:def_1, XBOOLE_0:def_3; hence x in Edges_In (v9,X) by A1, A2, A12, Def1; ::_thesis: verum end; end; end; hence Edges_In (v9,X) = (Edges_In (v2,X)) \/ { the carrier' of G} by TARSKI:1; ::_thesis: Edges_In (v2,X) misses { the carrier' of G} assume (Edges_In (v2,X)) /\ { the carrier' of G} <> {} ; :: according to XBOOLE_0:def_7 ::_thesis: contradiction then consider x being set such that A13: x in (Edges_In (v2,X)) /\ { the carrier' of G} by XBOOLE_0:def_1; x in { the carrier' of G} by A13, XBOOLE_0:def_4; then A14: x = the carrier' of G by TARSKI:def_1; x in the carrier' of G by A13; hence contradiction by A14; ::_thesis: verum end; theorem Th43: :: GRAPH_3:43 for X being set for G being Graph for v1, v, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v2 holds Edges_In (v9,X) = Edges_In (v,X) proof let X be set ; ::_thesis: for G being Graph for v1, v, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v2 holds Edges_In (v9,X) = Edges_In (v,X) let G be Graph; ::_thesis: for v1, v, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v2 holds Edges_In (v9,X) = Edges_In (v,X) let v1, v, v2 be Vertex of G; ::_thesis: for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v2 holds Edges_In (v9,X) = Edges_In (v,X) let v9 be Vertex of (AddNewEdge (v1,v2)); ::_thesis: ( v9 = v & v <> v2 implies Edges_In (v9,X) = Edges_In (v,X) ) assume that A1: v9 = v and A2: v <> v2 ; ::_thesis: Edges_In (v9,X) = Edges_In (v,X) set G9 = AddNewEdge (v1,v2); set E = the carrier' of G; set T = the Target of G; set E9 = the carrier' of (AddNewEdge (v1,v2)); set T9 = the Target of (AddNewEdge (v1,v2)); A3: the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_Edges_In_(v9,X)_implies_x_in_Edges_In_(v,X)_)_&_(_x_in_Edges_In_(v,X)_implies_x_in_Edges_In_(v9,X)_)_) let x be set ; ::_thesis: ( ( x in Edges_In (v9,X) implies x in Edges_In (v,X) ) & ( x in Edges_In (v,X) implies x in Edges_In (v9,X) ) ) hereby ::_thesis: ( x in Edges_In (v,X) implies x in Edges_In (v9,X) ) assume A4: x in Edges_In (v9,X) ; ::_thesis: x in Edges_In (v,X) then A5: x in X by Def1; A6: the Target of (AddNewEdge (v1,v2)) . x = v9 by A4, Def1; the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v2 by Th34; then not x in { the carrier' of G} by A1, A2, A6, TARSKI:def_1; then A7: x in the carrier' of G by A3, A4, XBOOLE_0:def_3; then the Target of G . x = v by A1, A6, Th35; hence x in Edges_In (v,X) by A5, A7, Def1; ::_thesis: verum end; assume A8: x in Edges_In (v,X) ; ::_thesis: x in Edges_In (v9,X) then the Target of G . x = v by Def1; then A9: the Target of (AddNewEdge (v1,v2)) . x = v9 by A1, A8, Th35; ( x in X & x in the carrier' of (AddNewEdge (v1,v2)) ) by A3, A8, Def1, XBOOLE_0:def_3; hence x in Edges_In (v9,X) by A9, Def1; ::_thesis: verum end; hence Edges_In (v9,X) = Edges_In (v,X) by TARSKI:1; ::_thesis: verum end; theorem Th44: :: GRAPH_3:44 for X being set for G being Graph for v2, v, v1 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v1 holds Edges_Out (v9,X) = Edges_Out (v,X) proof let X be set ; ::_thesis: for G being Graph for v2, v, v1 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v1 holds Edges_Out (v9,X) = Edges_Out (v,X) let G be Graph; ::_thesis: for v2, v, v1 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v1 holds Edges_Out (v9,X) = Edges_Out (v,X) let v2, v, v1 be Vertex of G; ::_thesis: for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v1 holds Edges_Out (v9,X) = Edges_Out (v,X) let v9 be Vertex of (AddNewEdge (v1,v2)); ::_thesis: ( v9 = v & v <> v1 implies Edges_Out (v9,X) = Edges_Out (v,X) ) assume that A1: v9 = v and A2: v <> v1 ; ::_thesis: Edges_Out (v9,X) = Edges_Out (v,X) set G9 = AddNewEdge (v1,v2); set E = the carrier' of G; set S = the Source of G; set E9 = the carrier' of (AddNewEdge (v1,v2)); set S9 = the Source of (AddNewEdge (v1,v2)); A3: the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_Edges_Out_(v9,X)_implies_x_in_Edges_Out_(v,X)_)_&_(_x_in_Edges_Out_(v,X)_implies_x_in_Edges_Out_(v9,X)_)_) let x be set ; ::_thesis: ( ( x in Edges_Out (v9,X) implies x in Edges_Out (v,X) ) & ( x in Edges_Out (v,X) implies x in Edges_Out (v9,X) ) ) hereby ::_thesis: ( x in Edges_Out (v,X) implies x in Edges_Out (v9,X) ) assume A4: x in Edges_Out (v9,X) ; ::_thesis: x in Edges_Out (v,X) then A5: x in X by Def2; A6: the Source of (AddNewEdge (v1,v2)) . x = v9 by A4, Def2; the Source of (AddNewEdge (v1,v2)) . the carrier' of G = v1 by Th34; then not x in { the carrier' of G} by A1, A2, A6, TARSKI:def_1; then A7: x in the carrier' of G by A3, A4, XBOOLE_0:def_3; then the Source of G . x = v by A1, A6, Th35; hence x in Edges_Out (v,X) by A5, A7, Def2; ::_thesis: verum end; assume A8: x in Edges_Out (v,X) ; ::_thesis: x in Edges_Out (v9,X) then the Source of G . x = v by Def2; then A9: the Source of (AddNewEdge (v1,v2)) . x = v9 by A1, A8, Th35; ( x in X & x in the carrier' of (AddNewEdge (v1,v2)) ) by A3, A8, Def2, XBOOLE_0:def_3; hence x in Edges_Out (v9,X) by A9, Def2; ::_thesis: verum end; hence Edges_Out (v9,X) = Edges_Out (v,X) by TARSKI:1; ::_thesis: verum end; theorem Th45: :: GRAPH_3:45 for G being Graph for v1, v2 being Vertex of G for p9 being Path of AddNewEdge (v1,v2) st not the carrier' of G in rng p9 holds p9 is Path of G proof let G be Graph; ::_thesis: for v1, v2 being Vertex of G for p9 being Path of AddNewEdge (v1,v2) st not the carrier' of G in rng p9 holds p9 is Path of G let v1, v2 be Vertex of G; ::_thesis: for p9 being Path of AddNewEdge (v1,v2) st not the carrier' of G in rng p9 holds p9 is Path of G let p9 be Path of AddNewEdge (v1,v2); ::_thesis: ( not the carrier' of G in rng p9 implies p9 is Path of G ) set G9 = AddNewEdge (v1,v2); set S = the Source of G; set T = the Target of G; set E = the carrier' of G; set S9 = the Source of (AddNewEdge (v1,v2)); set T9 = the Target of (AddNewEdge (v1,v2)); the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; then A1: rng p9 c= the carrier' of G \/ { the carrier' of G} by FINSEQ_1:def_4; assume A2: not the carrier' of G in rng p9 ; ::_thesis: p9 is Path of G A3: rng p9 c= the carrier' of G proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng p9 or x in the carrier' of G ) assume A4: x in rng p9 ; ::_thesis: x in the carrier' of G then ( x in the carrier' of G or x in { the carrier' of G} ) by A1, XBOOLE_0:def_3; hence x in the carrier' of G by A2, A4, TARSKI:def_1; ::_thesis: verum end; p9 is Chain of G proof thus p9 is FinSequence of the carrier' of G by A3, FINSEQ_1:def_4; :: according to MSSCYC_1:def_1 ::_thesis: ex b1 being FinSequence of the carrier of G st b1 is_vertex_seq_of p9 consider vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) such that A5: vs9 is_vertex_seq_of p9 by MSSCYC_1:def_1; reconsider vs = vs9 as FinSequence of the carrier of G by Def7; take vs ; ::_thesis: vs is_vertex_seq_of p9 thus vs is_vertex_seq_of p9 ::_thesis: verum proof thus A6: len vs = (len p9) + 1 by A5, GRAPH_2:def_6; :: according to GRAPH_2:def_6 ::_thesis: for b1 being Element of NAT holds ( not 1 <= b1 or not b1 <= len p9 or p9 . b1 joins vs /. b1,vs /. (b1 + 1) ) let n be Element of NAT ; ::_thesis: ( not 1 <= n or not n <= len p9 or p9 . n joins vs /. n,vs /. (n + 1) ) assume that A7: 1 <= n and A8: n <= len p9 ; ::_thesis: p9 . n joins vs /. n,vs /. (n + 1) set e = p9 . n; reconsider vn9 = vs9 /. n, vn19 = vs9 /. (n + 1) as Vertex of (AddNewEdge (v1,v2)) ; p9 . n joins vs9 /. n,vs9 /. (n + 1) by A5, A7, A8, GRAPH_2:def_6; then A9: ( ( the Source of (AddNewEdge (v1,v2)) . (p9 . n) = vn9 & the Target of (AddNewEdge (v1,v2)) . (p9 . n) = vn19 ) or ( the Source of (AddNewEdge (v1,v2)) . (p9 . n) = vn19 & the Target of (AddNewEdge (v1,v2)) . (p9 . n) = vn9 ) ) by GRAPH_1:def_12; reconsider vn = vs /. n, vn1 = vs /. (n + 1) as Vertex of G ; ( 1 <= n + 1 & n + 1 <= len vs ) by A6, A8, NAT_1:11, XREAL_1:6; then A10: n + 1 in dom vs by FINSEQ_3:25; then A11: vn1 = vs . (n + 1) by PARTFUN1:def_6 .= vn19 by A10, PARTFUN1:def_6 ; n in dom p9 by A7, A8, FINSEQ_3:25; then p9 . n in rng p9 by FUNCT_1:def_3; then A12: ( the Source of (AddNewEdge (v1,v2)) . (p9 . n) = the Source of G . (p9 . n) & the Target of (AddNewEdge (v1,v2)) . (p9 . n) = the Target of G . (p9 . n) ) by A3, Th35; len p9 <= len vs by A6, NAT_1:11; then n <= len vs by A8, XXREAL_0:2; then A13: n in dom vs by A7, FINSEQ_3:25; then vn = vs . n by PARTFUN1:def_6 .= vn9 by A13, PARTFUN1:def_6 ; hence p9 . n joins vs /. n,vs /. (n + 1) by A9, A12, A11, GRAPH_1:def_12; ::_thesis: verum end; end; then reconsider p99 = p9 as Chain of G ; p99 is V14() ; hence p9 is Path of G ; ::_thesis: verum end; theorem Th46: :: GRAPH_3:46 for G being Graph for v1, v2 being Vertex of G for vs being FinSequence of the carrier of G for p9 being Path of AddNewEdge (v1,v2) for vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st not the carrier' of G in rng p9 & vs = vs9 & vs9 is_vertex_seq_of p9 holds vs is_vertex_seq_of p9 proof let G be Graph; ::_thesis: for v1, v2 being Vertex of G for vs being FinSequence of the carrier of G for p9 being Path of AddNewEdge (v1,v2) for vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st not the carrier' of G in rng p9 & vs = vs9 & vs9 is_vertex_seq_of p9 holds vs is_vertex_seq_of p9 let v1, v2 be Vertex of G; ::_thesis: for vs being FinSequence of the carrier of G for p9 being Path of AddNewEdge (v1,v2) for vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st not the carrier' of G in rng p9 & vs = vs9 & vs9 is_vertex_seq_of p9 holds vs is_vertex_seq_of p9 let vs be FinSequence of the carrier of G; ::_thesis: for p9 being Path of AddNewEdge (v1,v2) for vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st not the carrier' of G in rng p9 & vs = vs9 & vs9 is_vertex_seq_of p9 holds vs is_vertex_seq_of p9 let p9 be Path of AddNewEdge (v1,v2); ::_thesis: for vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st not the carrier' of G in rng p9 & vs = vs9 & vs9 is_vertex_seq_of p9 holds vs is_vertex_seq_of p9 let vs9 be FinSequence of the carrier of (AddNewEdge (v1,v2)); ::_thesis: ( not the carrier' of G in rng p9 & vs = vs9 & vs9 is_vertex_seq_of p9 implies vs is_vertex_seq_of p9 ) set G9 = AddNewEdge (v1,v2); set S = the Source of G; set T = the Target of G; set E = the carrier' of G; set S9 = the Source of (AddNewEdge (v1,v2)); set T9 = the Target of (AddNewEdge (v1,v2)); the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; then A1: rng p9 c= the carrier' of G \/ { the carrier' of G} by FINSEQ_1:def_4; assume A2: not the carrier' of G in rng p9 ; ::_thesis: ( not vs = vs9 or not vs9 is_vertex_seq_of p9 or vs is_vertex_seq_of p9 ) A3: rng p9 c= the carrier' of G proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng p9 or x in the carrier' of G ) assume A4: x in rng p9 ; ::_thesis: x in the carrier' of G then ( x in the carrier' of G or x in { the carrier' of G} ) by A1, XBOOLE_0:def_3; hence x in the carrier' of G by A2, A4, TARSKI:def_1; ::_thesis: verum end; assume that A5: vs = vs9 and A6: vs9 is_vertex_seq_of p9 ; ::_thesis: vs is_vertex_seq_of p9 thus vs is_vertex_seq_of p9 ::_thesis: verum proof thus A7: len vs = (len p9) + 1 by A5, A6, GRAPH_2:def_6; :: according to GRAPH_2:def_6 ::_thesis: for b1 being Element of NAT holds ( not 1 <= b1 or not b1 <= len p9 or p9 . b1 joins vs /. b1,vs /. (b1 + 1) ) let n be Element of NAT ; ::_thesis: ( not 1 <= n or not n <= len p9 or p9 . n joins vs /. n,vs /. (n + 1) ) assume that A8: 1 <= n and A9: n <= len p9 ; ::_thesis: p9 . n joins vs /. n,vs /. (n + 1) set e = p9 . n; reconsider vn9 = vs9 /. n, vn19 = vs9 /. (n + 1) as Vertex of (AddNewEdge (v1,v2)) ; p9 . n joins vs9 /. n,vs9 /. (n + 1) by A6, A8, A9, GRAPH_2:def_6; then A10: ( ( the Source of (AddNewEdge (v1,v2)) . (p9 . n) = vn9 & the Target of (AddNewEdge (v1,v2)) . (p9 . n) = vn19 ) or ( the Source of (AddNewEdge (v1,v2)) . (p9 . n) = vn19 & the Target of (AddNewEdge (v1,v2)) . (p9 . n) = vn9 ) ) by GRAPH_1:def_12; reconsider vn = vs /. n, vn1 = vs /. (n + 1) as Vertex of G ; ( 1 <= n + 1 & n + 1 <= len vs ) by A7, A9, NAT_1:11, XREAL_1:6; then A11: n + 1 in dom vs by FINSEQ_3:25; then A12: vn1 = vs . (n + 1) by PARTFUN1:def_6 .= vn19 by A5, A11, PARTFUN1:def_6 ; n in dom p9 by A8, A9, FINSEQ_3:25; then p9 . n in rng p9 by FUNCT_1:def_3; then A13: ( the Source of (AddNewEdge (v1,v2)) . (p9 . n) = the Source of G . (p9 . n) & the Target of (AddNewEdge (v1,v2)) . (p9 . n) = the Target of G . (p9 . n) ) by A3, Th35; len p9 <= len vs by A7, NAT_1:11; then n <= len vs by A9, XXREAL_0:2; then A14: n in dom vs by A8, FINSEQ_3:25; then vn = vs . n by PARTFUN1:def_6 .= vn9 by A5, A14, PARTFUN1:def_6 ; hence p9 . n joins vs /. n,vs /. (n + 1) by A10, A13, A12, GRAPH_1:def_12; ::_thesis: verum end; end; registration let G be connected Graph; let v1, v2 be Vertex of G; cluster AddNewEdge (v1,v2) -> strict connected ; coherence AddNewEdge (v1,v2) is connected proof set G9 = AddNewEdge (v1,v2); now__::_thesis:_for_v19,_v29_being_Vertex_of_(AddNewEdge_(v1,v2))_st_v19_<>_v29_holds_ ex_c9_being_Chain_of_AddNewEdge_(v1,v2)_ex_vs9_being_FinSequence_of_the_carrier_of_(AddNewEdge_(v1,v2))_st_ (_not_c9_is_empty_&_vs9_is_vertex_seq_of_c9_&_vs9_._1_=_v19_&_vs9_._(len_vs9)_=_v29_) let v19, v29 be Vertex of (AddNewEdge (v1,v2)); ::_thesis: ( v19 <> v29 implies ex c9 being Chain of AddNewEdge (v1,v2) ex vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st ( not c9 is empty & vs9 is_vertex_seq_of c9 & vs9 . 1 = v19 & vs9 . (len vs9) = v29 ) ) reconsider v1 = v19, v2 = v29 as Vertex of G by Def7; assume v19 <> v29 ; ::_thesis: ex c9 being Chain of AddNewEdge (v1,v2) ex vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st ( not c9 is empty & vs9 is_vertex_seq_of c9 & vs9 . 1 = v19 & vs9 . (len vs9) = v29 ) then consider c being Chain of G, vs being FinSequence of the carrier of G such that A1: not c is empty and A2: vs is_vertex_seq_of c and A3: ( vs . 1 = v1 & vs . (len vs) = v2 ) by Th18; reconsider vs9 = vs as FinSequence of the carrier of (AddNewEdge (v1,v2)) by Def7; reconsider c9 = c as Chain of AddNewEdge (v1,v2) by Th37; take c9 = c9; ::_thesis: ex vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) st ( not c9 is empty & vs9 is_vertex_seq_of c9 & vs9 . 1 = v19 & vs9 . (len vs9) = v29 ) take vs9 = vs9; ::_thesis: ( not c9 is empty & vs9 is_vertex_seq_of c9 & vs9 . 1 = v19 & vs9 . (len vs9) = v29 ) thus not c9 is empty by A1; ::_thesis: ( vs9 is_vertex_seq_of c9 & vs9 . 1 = v19 & vs9 . (len vs9) = v29 ) thus vs9 is_vertex_seq_of c9 by A2, Th36; ::_thesis: ( vs9 . 1 = v19 & vs9 . (len vs9) = v29 ) thus ( vs9 . 1 = v19 & vs9 . (len vs9) = v29 ) by A3; ::_thesis: verum end; hence AddNewEdge (v1,v2) is connected by Th18; ::_thesis: verum end; end; theorem Th47: :: GRAPH_3:47 for X being set for G being finite Graph for v, v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v1 <> v2 & ( v = v1 or v = v2 ) & the carrier' of G in X holds Degree (v9,X) = (Degree (v,X)) + 1 proof let X be set ; ::_thesis: for G being finite Graph for v, v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v1 <> v2 & ( v = v1 or v = v2 ) & the carrier' of G in X holds Degree (v9,X) = (Degree (v,X)) + 1 let G be finite Graph; ::_thesis: for v, v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v1 <> v2 & ( v = v1 or v = v2 ) & the carrier' of G in X holds Degree (v9,X) = (Degree (v,X)) + 1 let v, v1, v2 be Vertex of G; ::_thesis: for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v1 <> v2 & ( v = v1 or v = v2 ) & the carrier' of G in X holds Degree (v9,X) = (Degree (v,X)) + 1 let v9 be Vertex of (AddNewEdge (v1,v2)); ::_thesis: ( v9 = v & v1 <> v2 & ( v = v1 or v = v2 ) & the carrier' of G in X implies Degree (v9,X) = (Degree (v,X)) + 1 ) assume that A1: v9 = v and A2: v1 <> v2 and A3: ( v = v1 or v = v2 ) and A4: the carrier' of G in X ; ::_thesis: Degree (v9,X) = (Degree (v,X)) + 1 set E = the carrier' of G; percases ( v = v1 or v = v2 ) by A3; supposeA5: v = v1 ; ::_thesis: Degree (v9,X) = (Degree (v,X)) + 1 then ( Edges_In (v9,X) = Edges_In (v,X) & Edges_Out (v9,X) = (Edges_Out (v,X)) \/ { the carrier' of G} ) by A1, A2, A4, Th39, Th41; hence Degree (v9,X) = (card (Edges_In (v,X))) + ((card (Edges_Out (v,X))) + (card { the carrier' of G})) by A1, A4, A5, Th41, CARD_2:40 .= ((card (Edges_In (v,X))) + (card (Edges_Out (v,X)))) + (card { the carrier' of G}) .= (Degree (v,X)) + 1 by CARD_1:30 ; ::_thesis: verum end; supposeA6: v = v2 ; ::_thesis: Degree (v9,X) = (Degree (v,X)) + 1 then ( Edges_Out (v9,X) = Edges_Out (v,X) & Edges_In (v9,X) = (Edges_In (v,X)) \/ { the carrier' of G} ) by A1, A2, A4, Th40, Th42; hence Degree (v9,X) = ((card (Edges_In (v,X))) + (card { the carrier' of G})) + (card (Edges_Out (v,X))) by A1, A4, A6, Th42, CARD_2:40 .= ((card (Edges_In (v,X))) + (card (Edges_Out (v,X)))) + (card { the carrier' of G}) .= (Degree (v,X)) + 1 by CARD_1:30 ; ::_thesis: verum end; end; end; theorem Th48: :: GRAPH_3:48 for X being set for G being finite Graph for v, v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v1 & v <> v2 holds Degree (v9,X) = Degree (v,X) proof let X be set ; ::_thesis: for G being finite Graph for v, v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v1 & v <> v2 holds Degree (v9,X) = Degree (v,X) let G be finite Graph; ::_thesis: for v, v1, v2 being Vertex of G for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v1 & v <> v2 holds Degree (v9,X) = Degree (v,X) let v, v1, v2 be Vertex of G; ::_thesis: for v9 being Vertex of (AddNewEdge (v1,v2)) st v9 = v & v <> v1 & v <> v2 holds Degree (v9,X) = Degree (v,X) let v9 be Vertex of (AddNewEdge (v1,v2)); ::_thesis: ( v9 = v & v <> v1 & v <> v2 implies Degree (v9,X) = Degree (v,X) ) assume that A1: v9 = v and A2: v <> v1 and A3: v <> v2 ; ::_thesis: Degree (v9,X) = Degree (v,X) thus Degree (v9,X) = (card (Edges_In (v,X))) + (card (Edges_Out (v9,X))) by A1, A3, Th43 .= Degree (v,X) by A1, A2, Th44 ; ::_thesis: verum end; begin Lm4: for G being finite Graph for c being cyclic Path of G for vs being FinSequence of the carrier of G for v being Vertex of G st vs is_vertex_seq_of c & v in rng vs holds Degree (v,(rng c)) is even proof let G be finite Graph; ::_thesis: for c being cyclic Path of G for vs being FinSequence of the carrier of G for v being Vertex of G st vs is_vertex_seq_of c & v in rng vs holds Degree (v,(rng c)) is even let c be cyclic Path of G; ::_thesis: for vs being FinSequence of the carrier of G for v being Vertex of G st vs is_vertex_seq_of c & v in rng vs holds Degree (v,(rng c)) is even let vs be FinSequence of the carrier of G; ::_thesis: for v being Vertex of G st vs is_vertex_seq_of c & v in rng vs holds Degree (v,(rng c)) is even let v be Vertex of G; ::_thesis: ( vs is_vertex_seq_of c & v in rng vs implies Degree (v,(rng c)) is even ) assume that A1: vs is_vertex_seq_of c and A2: v in rng vs ; ::_thesis: Degree (v,(rng c)) is even set S = the Source of G; set T = the Target of G; percases ( c is empty or not c is empty ) ; suppose c is empty ; ::_thesis: Degree (v,(rng c)) is even then reconsider rc = rng c as empty set ; Degree (v,rc) = 2 * 0 ; hence Degree (v,(rng c)) is even ; ::_thesis: verum end; supposeA3: not c is empty ; ::_thesis: Degree (v,(rng c)) is even set ev = { n where n is Element of NAT : ( 1 <= n & n <= len c & vs . n = v ) } ; A4: { n where n is Element of NAT : ( 1 <= n & n <= len c & vs . n = v ) } c= Seg (len c) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { n where n is Element of NAT : ( 1 <= n & n <= len c & vs . n = v ) } or x in Seg (len c) ) assume x in { n where n is Element of NAT : ( 1 <= n & n <= len c & vs . n = v ) } ; ::_thesis: x in Seg (len c) then ex n being Element of NAT st ( x = n & 1 <= n & n <= len c & vs . n = v ) ; hence x in Seg (len c) by FINSEQ_1:1; ::_thesis: verum end; reconsider rc = rng c as non empty set by A3; A5: len vs = (len c) + 1 by A1, GRAPH_2:def_6; set evout = [:{1},(Edges_Out (v,rc)):]; set evin = [:{0},(Edges_In (v,rc)):]; A6: card [:{1},(Edges_Out (v,rc)):] = (card {1}) * (card (Edges_Out (v,rc))) by CARD_2:46 .= 1 * (card (Edges_Out (v,rc))) by CARD_1:30 .= card (Edges_Out (v,rc)) ; A7: card [:{0},(Edges_In (v,rc)):] = (card {0}) * (card (Edges_In (v,rc))) by CARD_2:46 .= 1 * (card (Edges_In (v,rc))) by CARD_1:30 .= card (Edges_In (v,rc)) ; now__::_thesis:_not_[:{0},(Edges_In_(v,rc)):]_\/_[:{1},(Edges_Out_(v,rc)):]_is_empty assume A8: [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] is empty ; ::_thesis: contradiction then [:{0},(Edges_In (v,rc)):] is empty ; then Degree (v,rc) = 0 + 0 by A7, A6, A8; hence contradiction by A1, A2, A3, Th32; ::_thesis: verum end; then reconsider evio = [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] as non empty set ; A9: [:{0},(Edges_In (v,rc)):] misses [:{1},(Edges_Out (v,rc)):] proof assume not [:{0},(Edges_In (v,rc)):] misses [:{1},(Edges_Out (v,rc)):] ; ::_thesis: contradiction then consider x being set such that A10: x in [:{0},(Edges_In (v,rc)):] /\ [:{1},(Edges_Out (v,rc)):] by XBOOLE_0:4; x in [:{1},(Edges_Out (v,rc)):] by A10, XBOOLE_0:def_4; then consider x21, x22 being set such that A11: x21 in {1} and x22 in Edges_Out (v,rc) and A12: x = [x21,x22] by ZFMISC_1:def_2; A13: x21 = 1 by A11, TARSKI:def_1; x in [:{0},(Edges_In (v,rc)):] by A10, XBOOLE_0:def_4; then consider x11, x12 being set such that A14: x11 in {0} and x12 in Edges_In (v,rc) and A15: x = [x11,x12] by ZFMISC_1:def_2; x11 = 0 by A14, TARSKI:def_1; hence contradiction by A15, A12, A13, XTUPLE_0:1; ::_thesis: verum end; reconsider ev = { n where n is Element of NAT : ( 1 <= n & n <= len c & vs . n = v ) } as Subset of (Seg (len c)) by A4; A16: rc c= the carrier' of G by FINSEQ_1:def_4; then reconsider G9 = G as non void finite Graph ; reconsider vs9 = vs as FinSequence of the carrier of G9 ; A17: vs9 . 1 = vs . (len vs) by A1, MSSCYC_1:6; now__::_thesis:_not_ev_is_empty A18: 0 + 1 <= len c by A3, NAT_1:13; consider n being set such that A19: n in dom vs and A20: vs . n = v by A2, FUNCT_1:def_3; reconsider n = n as Element of NAT by A19; A21: n <= len vs by A19, FINSEQ_3:25; A22: 1 <= n by A19, FINSEQ_3:25; thus not ev is empty ::_thesis: verum proof percases ( n = len vs or n < len vs ) by A21, XXREAL_0:1; suppose n = len vs ; ::_thesis: not ev is empty then 1 in ev by A17, A20, A18; hence not ev is empty ; ::_thesis: verum end; suppose n < len vs ; ::_thesis: not ev is empty then n <= len c by A5, NAT_1:13; then n in ev by A20, A22; hence not ev is empty ; ::_thesis: verum end; end; end; end; then reconsider ev = ev as non empty finite set ; set ev92 = [:2,ev:]; now__::_thesis:_ex_Z_being_set_st_ (_(_for_x_being_set_st_x_in_[:2,ev:]_holds_ ex_y_being_set_st_ (_y_in_[:{0},(Edges_In_(v,rc)):]_\/_[:{1},(Edges_Out_(v,rc)):]_&_[x,y]_in_Z_)_)_&_(_for_y_being_set_st_y_in_[:{0},(Edges_In_(v,rc)):]_\/_[:{1},(Edges_Out_(v,rc)):]_holds_ ex_x_being_set_st_ (_x_in_[:2,ev:]_&_[x,y]_in_Z_)_)_&_(_for_x,_y,_z,_u_being_set_st_[x,y]_in_Z_&_[z,u]_in_Z_holds_ (_x_=_z_iff_y_=_u_)_)_) defpred S1[ Element of [:2,ev:], Element of evio, Element of NAT ] means ( $1 = [1,$3] & ( ( vs . $3 = the Source of G . (c . $3) & $2 = [1,(c . $3)] ) or ( vs . $3 = the Target of G . (c . $3) & $2 = [0,(c . $3)] & the Target of G . (c . $3) <> the Source of G . (c . $3) ) ) ); defpred S2[ Element of [:2,ev:], Element of evio, Element of NAT ] means ( $1 = [0,$3] & ( ex k being Element of NAT st ( 1 <= k & $3 = k + 1 & ( ( vs . $3 = the Target of G . (c . k) & $2 = [0,(c . k)] ) or ( vs . $3 = the Source of G . (c . k) & $2 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) or ( $3 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & $2 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & $2 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ) ); take Z = { [x,y] where x is Element of [:2,ev:], y is Element of evio : ex n being Element of NAT st ( 1 <= n & n <= len c & ( S2[x,y,n] or S1[x,y,n] ) ) } ; ::_thesis: ( ( for x being set st x in [:2,ev:] holds ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) ) & ( for y being set st y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] holds ex x being set st ( x in [:2,ev:] & [x,y] in Z ) ) & ( for x, y, z, u being set st [x,y] in Z & [z,u] in Z holds ( x = z iff y = u ) ) ) thus for x being set st x in [:2,ev:] holds ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) ::_thesis: ( ( for y being set st y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] holds ex x being set st ( x in [:2,ev:] & [x,y] in Z ) ) & ( for x, y, z, u being set st [x,y] in Z & [z,u] in Z holds ( x = z iff y = u ) ) ) proof A23: 1 in {1} by TARSKI:def_1; let x be set ; ::_thesis: ( x in [:2,ev:] implies ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) ) A24: 0 in {0} by TARSKI:def_1; assume A25: x in [:2,ev:] ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) then consider u, w being set such that A26: [u,w] = x by RELAT_1:def_1; reconsider x9 = x as Element of [:2,ev:] by A25; A27: u in 2 by A25, A26, ZFMISC_1:87; w in ev by A25, A26, ZFMISC_1:87; then consider n being Element of NAT such that A28: w = n and A29: 1 <= n and A30: n <= len c and A31: vs . n = v ; percases ( u = 0 or u = 1 ) by A27, CARD_1:50, TARSKI:def_2; supposeA32: u = 0 ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) thus ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) ::_thesis: verum proof percases ( 1 < n or n = 1 ) by A29, XXREAL_0:1; suppose 1 < n ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) then consider k being Element of NAT such that A33: n = 1 + k and A34: 1 <= k by FINSEQ_4:84; k <= n by A33, NAT_1:11; then A35: k <= len c by A30, XXREAL_0:2; then k in dom c by A34, FINSEQ_3:25; then reconsider e = c . k as Element of rc by FUNCT_1:def_3; A36: e in rc ; thus ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) ::_thesis: verum proof percases ( the Target of G . (c . k) = vs . (k + 1) or ( the Source of G . (c . k) = vs . (k + 1) & the Target of G . (c . k) <> the Source of G . (c . k) ) ) by A1, A34, A35, Lm3; supposeA37: the Target of G . (c . k) = vs . (k + 1) ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) take y = [0,(c . k)]; ::_thesis: ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) e in Edges_In (v,rc) by A16, A31, A33, A36, A37, Def1; then A38: y in [:{0},(Edges_In (v,rc)):] by A24, ZFMISC_1:87; hence y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] by XBOOLE_0:def_3; ::_thesis: [x,y] in Z reconsider y9 = y as Element of evio by A38, XBOOLE_0:def_3; S2[x9,y9,n] by A26, A28, A32, A33, A34, A37; hence [x,y] in Z by A29, A30; ::_thesis: verum end; supposeA39: ( the Source of G . (c . k) = vs . (k + 1) & the Target of G . (c . k) <> the Source of G . (c . k) ) ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) take y = [1,(c . k)]; ::_thesis: ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) e in Edges_Out (v,rc) by A16, A31, A33, A36, A39, Def2; then A40: y in [:{1},(Edges_Out (v,rc)):] by A23, ZFMISC_1:87; hence y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] by XBOOLE_0:def_3; ::_thesis: [x,y] in Z reconsider y9 = y as Element of evio by A40, XBOOLE_0:def_3; S2[x9,y9,n] by A26, A28, A32, A33, A34, A39; hence [x,y] in Z by A29, A30; ::_thesis: verum end; end; end; end; supposeA41: n = 1 ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) A42: 1 <= len c by A29, A30, XXREAL_0:2; then len c in dom c by FINSEQ_3:25; then reconsider e = c . (len c) as Element of rc by FUNCT_1:def_3; A43: 1 <= len c by A29, A30, XXREAL_0:2; A44: ( e in rc & vs . 1 = vs . ((len c) + 1) ) by A1, A5, MSSCYC_1:6; thus ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) ::_thesis: verum proof percases ( the Target of G . (c . (len c)) = vs . ((len c) + 1) or ( the Source of G . (c . (len c)) = vs . ((len c) + 1) & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) by A1, A42, Lm3; supposeA45: the Target of G . (c . (len c)) = vs . ((len c) + 1) ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) take y = [0,(c . (len c))]; ::_thesis: ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) e in Edges_In (v,rc) by A16, A31, A41, A44, A45, Def1; then A46: y in [:{0},(Edges_In (v,rc)):] by A24, ZFMISC_1:87; hence y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] by XBOOLE_0:def_3; ::_thesis: [x,y] in Z reconsider y9 = y as Element of evio by A46, XBOOLE_0:def_3; S2[x9,y9,1] by A1, A5, A26, A28, A32, A41, A45, MSSCYC_1:6; hence [x,y] in Z by A43; ::_thesis: verum end; supposeA47: ( the Source of G . (c . (len c)) = vs . ((len c) + 1) & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) take y = [1,(c . (len c))]; ::_thesis: ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) e in Edges_Out (v,rc) by A16, A31, A41, A44, A47, Def2; then A48: y in [:{1},(Edges_Out (v,rc)):] by A23, ZFMISC_1:87; hence y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] by XBOOLE_0:def_3; ::_thesis: [x,y] in Z reconsider y9 = y as Element of evio by A48, XBOOLE_0:def_3; S2[x9,y9,1] by A1, A5, A26, A28, A32, A41, A47, MSSCYC_1:6; hence [x,y] in Z by A43; ::_thesis: verum end; end; end; end; end; end; end; supposeA49: u = 1 ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) n in dom c by A29, A30, FINSEQ_3:25; then reconsider e = c . n as Element of rc by FUNCT_1:def_3; A50: e in rc ; thus ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) ::_thesis: verum proof percases ( vs . n = the Source of G . (c . n) or ( vs . n = the Target of G . (c . n) & the Target of G . (c . n) <> the Source of G . (c . n) ) ) by A1, A29, A30, Lm3; supposeA51: vs . n = the Source of G . (c . n) ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) take y = [1,(c . n)]; ::_thesis: ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) e in Edges_Out (v,rc) by A16, A31, A50, A51, Def2; then A52: y in [:{1},(Edges_Out (v,rc)):] by A23, ZFMISC_1:87; hence y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] by XBOOLE_0:def_3; ::_thesis: [x,y] in Z reconsider y9 = y as Element of evio by A52, XBOOLE_0:def_3; S1[x9,y9,n] by A26, A28, A49, A51; hence [x,y] in Z by A29, A30; ::_thesis: verum end; supposeA53: ( vs . n = the Target of G . (c . n) & the Target of G . (c . n) <> the Source of G . (c . n) ) ; ::_thesis: ex y being set st ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) take y = [0,(c . n)]; ::_thesis: ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] & [x,y] in Z ) e in Edges_In (v,rc) by A16, A31, A50, A53, Def1; then A54: y in [:{0},(Edges_In (v,rc)):] by A24, ZFMISC_1:87; hence y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] by XBOOLE_0:def_3; ::_thesis: [x,y] in Z reconsider y9 = y as Element of evio by A54, XBOOLE_0:def_3; S1[x9,y9,n] by A26, A28, A49, A53; hence [x,y] in Z by A29, A30; ::_thesis: verum end; end; end; end; end; end; thus for y being set st y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] holds ex x being set st ( x in [:2,ev:] & [x,y] in Z ) ::_thesis: for x, y, z, u being set st [x,y] in Z & [z,u] in Z holds ( x = z iff y = u ) proof let y be set ; ::_thesis: ( y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] implies ex x being set st ( x in [:2,ev:] & [x,y] in Z ) ) assume A55: y in [:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) then reconsider y9 = y as Element of evio ; percases ( y in [:{0},(Edges_In (v,rc)):] or y in [:{1},(Edges_Out (v,rc)):] ) by A55, XBOOLE_0:def_3; supposeA56: y in [:{0},(Edges_In (v,rc)):] ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) then consider u, e being set such that A57: [u,e] = y by RELAT_1:def_1; A58: e in Edges_In (v,rc) by A56, A57, ZFMISC_1:87; then A59: the Target of G . e = v by Def1; e in rc by A58, Def1; then consider n being set such that A60: n in dom c and A61: e = c . n by FUNCT_1:def_3; reconsider n = n as Element of NAT by A60; A62: dom c = Seg (len c) by FINSEQ_1:def_3; then A63: 1 <= n by A60, FINSEQ_1:1; A64: 1 in 2 by CARD_1:50, TARSKI:def_2; A65: 0 in 2 by CARD_1:50, TARSKI:def_2; A66: n <= len c by A60, A62, FINSEQ_1:1; A67: u in {0} by A56, A57, ZFMISC_1:87; then A68: u = 0 by TARSKI:def_1; thus ex x being set st ( x in [:2,ev:] & [x,y] in Z ) ::_thesis: verum proof percases ( vs . (n + 1) = the Target of G . (c . n) or ( vs . n = the Target of G . (c . n) & the Target of G . (c . n) <> the Source of G . (c . n) ) ) by A1, A63, A66, Lm3; supposeA69: vs . (n + 1) = the Target of G . (c . n) ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) thus ex x being set st ( x in [:2,ev:] & [x,y] in Z ) ::_thesis: verum proof percases ( n = len c or n < len c ) by A66, XXREAL_0:1; supposeA70: n = len c ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) take x = [0,1]; ::_thesis: ( x in [:2,ev:] & [x,y] in Z ) vs . 1 = v by A1, A5, A59, A61, A69, A70, MSSCYC_1:6; then A71: 1 in ev by A63, A70; hence x in [:2,ev:] by A65, ZFMISC_1:87; ::_thesis: [x,y] in Z reconsider x9 = x as Element of [:2,ev:] by A65, A71, ZFMISC_1:87; ( 1 <= len c & S2[x9,y9,1] ) by A1, A5, A57, A67, A60, A61, A62, A69, A70, FINSEQ_1:1, MSSCYC_1:6, TARSKI:def_1; hence [x,y] in Z ; ::_thesis: verum end; supposeA72: n < len c ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) take x = [0,(n + 1)]; ::_thesis: ( x in [:2,ev:] & [x,y] in Z ) A73: ( 1 <= n + 1 & n + 1 <= len c ) by A72, NAT_1:11, NAT_1:13; then A74: n + 1 in ev by A59, A61, A69; hence x in [:2,ev:] by A65, ZFMISC_1:87; ::_thesis: [x,y] in Z reconsider x9 = x as Element of [:2,ev:] by A65, A74, ZFMISC_1:87; S2[x9,y9,n + 1] by A57, A68, A61, A63, A69; hence [x,y] in Z by A73; ::_thesis: verum end; end; end; end; supposeA75: ( vs . n = the Target of G . (c . n) & the Target of G . (c . n) <> the Source of G . (c . n) ) ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) take x = [1,n]; ::_thesis: ( x in [:2,ev:] & [x,y] in Z ) A76: n in ev by A59, A61, A63, A66, A75; hence x in [:2,ev:] by A64, ZFMISC_1:87; ::_thesis: [x,y] in Z reconsider x9 = x as Element of [:2,ev:] by A64, A76, ZFMISC_1:87; S1[x9,y9,n] by A57, A67, A61, A75, TARSKI:def_1; hence [x,y] in Z by A63, A66; ::_thesis: verum end; end; end; end; supposeA77: y in [:{1},(Edges_Out (v,rc)):] ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) then consider u, e being set such that A78: [u,e] = y by RELAT_1:def_1; A79: e in Edges_Out (v,rc) by A77, A78, ZFMISC_1:87; then A80: the Source of G . e = v by Def2; e in rc by A79, Def2; then consider n being set such that A81: n in dom c and A82: e = c . n by FUNCT_1:def_3; reconsider n = n as Element of NAT by A81; A83: dom c = Seg (len c) by FINSEQ_1:def_3; then A84: 1 <= n by A81, FINSEQ_1:1; A85: 1 in 2 by CARD_1:50, TARSKI:def_2; A86: 0 in 2 by CARD_1:50, TARSKI:def_2; A87: n <= len c by A81, A83, FINSEQ_1:1; A88: u in {1} by A77, A78, ZFMISC_1:87; then A89: u = 1 by TARSKI:def_1; thus ex x being set st ( x in [:2,ev:] & [x,y] in Z ) ::_thesis: verum proof percases ( ( vs . (n + 1) = the Source of G . (c . n) & the Target of G . (c . n) <> the Source of G . (c . n) ) or vs . n = the Source of G . (c . n) ) by A1, A84, A87, Lm3; supposeA90: ( vs . (n + 1) = the Source of G . (c . n) & the Target of G . (c . n) <> the Source of G . (c . n) ) ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) thus ex x being set st ( x in [:2,ev:] & [x,y] in Z ) ::_thesis: verum proof percases ( n = len c or n < len c ) by A87, XXREAL_0:1; supposeA91: n = len c ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) take x = [0,1]; ::_thesis: ( x in [:2,ev:] & [x,y] in Z ) vs . 1 = v by A1, A5, A80, A82, A90, A91, MSSCYC_1:6; then A92: 1 in ev by A84, A91; hence x in [:2,ev:] by A86, ZFMISC_1:87; ::_thesis: [x,y] in Z reconsider x9 = x as Element of [:2,ev:] by A86, A92, ZFMISC_1:87; ( 1 <= len c & S2[x9,y9,1] ) by A1, A5, A78, A88, A81, A82, A83, A90, A91, FINSEQ_1:1, MSSCYC_1:6, TARSKI:def_1; hence [x,y] in Z ; ::_thesis: verum end; supposeA93: n < len c ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) take x = [0,(n + 1)]; ::_thesis: ( x in [:2,ev:] & [x,y] in Z ) A94: ( 1 <= n + 1 & n + 1 <= len c ) by A93, NAT_1:11, NAT_1:13; then A95: n + 1 in ev by A80, A82, A90; hence x in [:2,ev:] by A86, ZFMISC_1:87; ::_thesis: [x,y] in Z reconsider x9 = x as Element of [:2,ev:] by A86, A95, ZFMISC_1:87; S2[x9,y9,n + 1] by A78, A89, A82, A84, A90; hence [x,y] in Z by A94; ::_thesis: verum end; end; end; end; supposeA96: vs . n = the Source of G . (c . n) ; ::_thesis: ex x being set st ( x in [:2,ev:] & [x,y] in Z ) take x = [1,n]; ::_thesis: ( x in [:2,ev:] & [x,y] in Z ) A97: n in ev by A80, A82, A84, A87, A96; hence x in [:2,ev:] by A85, ZFMISC_1:87; ::_thesis: [x,y] in Z reconsider x9 = x as Element of [:2,ev:] by A85, A97, ZFMISC_1:87; S1[x9,y9,n] by A78, A88, A82, A96, TARSKI:def_1; hence [x,y] in Z by A84, A87; ::_thesis: verum end; end; end; end; end; end; thus for x, y, z, u being set st [x,y] in Z & [z,u] in Z holds ( x = z iff y = u ) ::_thesis: verum proof let x, y, z, u be set ; ::_thesis: ( [x,y] in Z & [z,u] in Z implies ( x = z iff y = u ) ) assume that A98: [x,y] in Z and A99: [z,u] in Z ; ::_thesis: ( x = z iff y = u ) consider x9 being Element of [:2,ev:], y9 being Element of evio such that A100: [x,y] = [x9,y9] and A101: ex n being Element of NAT st ( 1 <= n & n <= len c & ( S2[x9,y9,n] or S1[x9,y9,n] ) ) by A98; consider z9 being Element of [:2,ev:], u9 being Element of evio such that A102: [z,u] = [z9,u9] and A103: ex n being Element of NAT st ( 1 <= n & n <= len c & ( S2[z9,u9,n] or S1[z9,u9,n] ) ) by A99; A104: x = x9 by A100, XTUPLE_0:1; A105: y = y9 by A100, XTUPLE_0:1; consider n2 being Element of NAT such that A106: 1 <= n2 and A107: n2 <= len c and A108: ( S2[z9,u9,n2] or S1[z9,u9,n2] ) by A103; consider n1 being Element of NAT such that A109: 1 <= n1 and A110: n1 <= len c and A111: ( S2[x9,y9,n1] or S1[x9,y9,n1] ) by A101; A112: z = z9 by A102, XTUPLE_0:1; thus ( x = z implies y = u ) ::_thesis: ( y = u implies x = z ) proof assume A113: x = z ; ::_thesis: y = u percases ( ( S2[x9,y9,n1] & S2[z9,u9,n2] ) or ( S2[x9,y9,n1] & S1[z9,u9,n2] ) or ( S1[x9,y9,n1] & S2[z9,u9,n2] ) or ( S1[x9,y9,n1] & S1[z9,u9,n2] ) ) by A111, A108; supposeA114: ( S2[x9,y9,n1] & S2[z9,u9,n2] ) ; ::_thesis: y = u then A115: n1 = n2 by A104, A112, A113, XTUPLE_0:1; thus y = u ::_thesis: verum proof percases ( ( ex k being Element of NAT st ( 1 <= k & n1 = k + 1 & ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) & ex k being Element of NAT st ( 1 <= k & n2 = k + 1 & ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) ) or ( ex k being Element of NAT st ( 1 <= k & n1 = k + 1 & ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) & n2 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & u9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & u9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) or ( n1 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & y9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & y9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) & ex k being Element of NAT st ( 1 <= k & n2 = k + 1 & ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) ) or ( n1 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & y9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & y9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) & n2 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & u9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & u9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ) by A114; suppose ( ex k being Element of NAT st ( 1 <= k & n1 = k + 1 & ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) & ex k being Element of NAT st ( 1 <= k & n2 = k + 1 & ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) ) ; ::_thesis: y = u hence y = u by A102, A105, A115, XTUPLE_0:1; ::_thesis: verum end; suppose ( ex k being Element of NAT st ( 1 <= k & n1 = k + 1 & ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) & n2 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & u9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & u9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ; ::_thesis: y = u hence y = u by A115; ::_thesis: verum end; suppose ( n1 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & y9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & y9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) & ex k being Element of NAT st ( 1 <= k & n2 = k + 1 & ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) ) ; ::_thesis: y = u hence y = u by A115; ::_thesis: verum end; suppose ( n1 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & y9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & y9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) & n2 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & u9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & u9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ; ::_thesis: y = u hence y = u by A102, A105, XTUPLE_0:1; ::_thesis: verum end; end; end; end; suppose ( S2[x9,y9,n1] & S1[z9,u9,n2] ) ; ::_thesis: y = u hence y = u by A104, A112, A113, XTUPLE_0:1; ::_thesis: verum end; suppose ( S1[x9,y9,n1] & S2[z9,u9,n2] ) ; ::_thesis: y = u hence y = u by A104, A112, A113, XTUPLE_0:1; ::_thesis: verum end; supposeA116: ( S1[x9,y9,n1] & S1[z9,u9,n2] ) ; ::_thesis: y = u then n1 = n2 by A104, A112, A113, XTUPLE_0:1; hence y = u by A100, A102, A116, XTUPLE_0:1; ::_thesis: verum end; end; end; A117: u = u9 by A102, XTUPLE_0:1; thus ( y = u implies x = z ) ::_thesis: verum proof assume A118: y = u ; ::_thesis: x = z percases ( ( S2[x9,y9,n1] & S2[z9,u9,n2] ) or ( S2[x9,y9,n1] & S1[z9,u9,n2] ) or ( S1[x9,y9,n1] & S2[z9,u9,n2] ) or ( S1[x9,y9,n1] & S1[z9,u9,n2] ) ) by A111, A108; supposeA119: ( S2[x9,y9,n1] & S2[z9,u9,n2] ) ; ::_thesis: x = z thus x = z ::_thesis: verum proof percases ( ( ex k being Element of NAT st ( 1 <= k & n1 = k + 1 & ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) & ex k being Element of NAT st ( 1 <= k & n2 = k + 1 & ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) ) or ( ex k being Element of NAT st ( 1 <= k & n1 = k + 1 & ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) & n2 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & u9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & u9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) or ( n1 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & y9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & y9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) & ex k being Element of NAT st ( 1 <= k & n2 = k + 1 & ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) ) or ( n1 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & y9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & y9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) & n2 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & u9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & u9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ) by A119; supposeA120: ( ex k being Element of NAT st ( 1 <= k & n1 = k + 1 & ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) & ex k being Element of NAT st ( 1 <= k & n2 = k + 1 & ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) ) ; ::_thesis: x = z then consider k2 being Element of NAT such that A121: 1 <= k2 and A122: n2 = k2 + 1 and A123: ( ( vs . n2 = the Target of G . (c . k2) & u9 = [0,(c . k2)] ) or ( vs . n2 = the Source of G . (c . k2) & u9 = [1,(c . k2)] & the Target of G . (c . k2) <> the Source of G . (c . k2) ) ) ; k2 <= n2 by A122, NAT_1:12; then A124: k2 <= len c by A107, XXREAL_0:2; consider k1 being Element of NAT such that A125: 1 <= k1 and A126: n1 = k1 + 1 and A127: ( ( vs . n1 = the Target of G . (c . k1) & y9 = [0,(c . k1)] ) or ( vs . n1 = the Source of G . (c . k1) & y9 = [1,(c . k1)] & the Target of G . (c . k1) <> the Source of G . (c . k1) ) ) by A120; k1 <= n1 by A126, NAT_1:12; then A128: k1 <= len c by A110, XXREAL_0:2; c . k1 = c . k2 by A105, A117, A118, A127, A123, XTUPLE_0:1; then k1 = k2 by A125, A121, A128, A124, Lm2; hence x = z by A100, A102, A119, A126, A122, XTUPLE_0:1; ::_thesis: verum end; supposeA129: ( ex k being Element of NAT st ( 1 <= k & n1 = k + 1 & ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) & n2 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & u9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & u9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ; ::_thesis: x = z A130: 1 <= len c by A109, A110, XXREAL_0:2; consider k1 being Element of NAT such that A131: 1 <= k1 and A132: n1 = k1 + 1 and ( ( vs . n1 = the Target of G . (c . k1) & y9 = [0,(c . k1)] ) or ( vs . n1 = the Source of G . (c . k1) & y9 = [1,(c . k1)] & the Target of G . (c . k1) <> the Source of G . (c . k1) ) ) by A129; k1 <= n1 by A132, NAT_1:12; then A133: k1 <= len c by A110, XXREAL_0:2; c . k1 = c . (len c) by A105, A117, A118, A129, A132, XTUPLE_0:1; then (len c) + 1 <= len c by A110, A131, A132, A133, A130, Lm2; hence x = z by NAT_1:13; ::_thesis: verum end; supposeA134: ( n1 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & y9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & y9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) & ex k being Element of NAT st ( 1 <= k & n2 = k + 1 & ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) ) ; ::_thesis: x = z A135: 1 <= len c by A106, A107, XXREAL_0:2; consider k2 being Element of NAT such that A136: 1 <= k2 and A137: n2 = k2 + 1 and ( ( vs . n2 = the Target of G . (c . k2) & u9 = [0,(c . k2)] ) or ( vs . n2 = the Source of G . (c . k2) & u9 = [1,(c . k2)] & the Target of G . (c . k2) <> the Source of G . (c . k2) ) ) by A134; k2 <= n2 by A137, NAT_1:12; then A138: k2 <= len c by A107, XXREAL_0:2; c . k2 = c . (len c) by A105, A117, A118, A134, A137, XTUPLE_0:1; then (len c) + 1 <= len c by A107, A136, A137, A138, A135, Lm2; hence x = z by NAT_1:13; ::_thesis: verum end; suppose ( n1 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & y9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & y9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) & n2 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & u9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & u9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ; ::_thesis: x = z hence x = z by A100, A102, A119, XTUPLE_0:1; ::_thesis: verum end; end; end; end; supposeA139: ( S2[x9,y9,n1] & S1[z9,u9,n2] ) ; ::_thesis: x = z thus x = z ::_thesis: verum proof percases ( ex k being Element of NAT st ( 1 <= k & n1 = k + 1 & ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) or ( n1 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & y9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & y9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ) by A139; suppose ex k being Element of NAT st ( 1 <= k & n1 = k + 1 & ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) ; ::_thesis: x = z then consider k being Element of NAT such that A140: 1 <= k and A141: n1 = k + 1 and ( ( vs . n1 = the Target of G . (c . k) & y9 = [0,(c . k)] ) or ( vs . n1 = the Source of G . (c . k) & y9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ; k <= n1 by A141, NAT_1:12; then A142: k <= len c by A110, XXREAL_0:2; c . n2 = c . k by A105, A117, A118, A139, A140, A141, XTUPLE_0:1; then n2 = k by A106, A107, A140, A142, Lm2; hence x = z by A1, A105, A117, A106, A107, A118, A139, A141, Lm3, XTUPLE_0:1; ::_thesis: verum end; supposeA143: ( n1 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & y9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & y9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ; ::_thesis: x = z A144: 1 <= len c by A109, A110, XXREAL_0:2; c . n2 = c . (len c) by A105, A117, A118, A139, A143, XTUPLE_0:1; then A145: n2 = len c by A106, A107, A144, Lm2; ( ( vs . n2 = the Target of G . (c . n2) & vs . (n2 + 1) = the Source of G . (c . n2) ) or ( vs . n2 = the Source of G . (c . n2) & vs . (n2 + 1) = the Target of G . (c . n2) ) ) by A1, A106, A107, Lm3; hence x = z by A1, A5, A105, A117, A118, A139, A143, A145, MSSCYC_1:6, XTUPLE_0:1; ::_thesis: verum end; end; end; end; supposeA146: ( S1[x9,y9,n1] & S2[z9,u9,n2] ) ; ::_thesis: x = z thus x = z ::_thesis: verum proof percases ( ex k being Element of NAT st ( 1 <= k & n2 = k + 1 & ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) or ( n2 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & u9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & u9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ) by A146; suppose ex k being Element of NAT st ( 1 <= k & n2 = k + 1 & ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ) ; ::_thesis: x = z then consider k being Element of NAT such that A147: 1 <= k and A148: n2 = k + 1 and ( ( vs . n2 = the Target of G . (c . k) & u9 = [0,(c . k)] ) or ( vs . n2 = the Source of G . (c . k) & u9 = [1,(c . k)] & the Target of G . (c . k) <> the Source of G . (c . k) ) ) ; k <= n2 by A148, NAT_1:12; then A149: k <= len c by A107, XXREAL_0:2; c . n1 = c . k by A105, A117, A118, A146, A147, A148, XTUPLE_0:1; then n1 = k by A109, A110, A147, A149, Lm2; hence x = z by A1, A105, A117, A109, A110, A118, A146, A148, Lm3, XTUPLE_0:1; ::_thesis: verum end; supposeA150: ( n2 = 1 & ( ( vs . 1 = the Target of G . (c . (len c)) & u9 = [0,(c . (len c))] ) or ( vs . 1 = the Source of G . (c . (len c)) & u9 = [1,(c . (len c))] & the Target of G . (c . (len c)) <> the Source of G . (c . (len c)) ) ) ) ; ::_thesis: x = z A151: 1 <= len c by A109, A110, XXREAL_0:2; c . n1 = c . (len c) by A105, A117, A118, A146, A150, XTUPLE_0:1; then A152: n1 = len c by A109, A110, A151, Lm2; ( ( vs . n1 = the Target of G . (c . n1) & vs . (n1 + 1) = the Source of G . (c . n1) ) or ( vs . n1 = the Source of G . (c . n1) & vs . (n1 + 1) = the Target of G . (c . n1) ) ) by A1, A109, A110, Lm3; hence x = z by A1, A5, A105, A117, A118, A146, A150, A152, MSSCYC_1:6, XTUPLE_0:1; ::_thesis: verum end; end; end; end; supposeA153: ( S1[x9,y9,n1] & S1[z9,u9,n2] ) ; ::_thesis: x = z then c . n1 = c . n2 by A105, A117, A118, XTUPLE_0:1; then n1 = n2 by A109, A110, A106, A107, Lm2; hence x = z by A100, A102, A153, XTUPLE_0:1; ::_thesis: verum end; end; end; end; end; then [:2,ev:],[:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):] are_equipotent by TARSKI:def_6; then card [:2,ev:] = card ([:{0},(Edges_In (v,rc)):] \/ [:{1},(Edges_Out (v,rc)):]) by CARD_1:5 .= (card [:{0},(Edges_In (v,rc)):]) + (card [:{1},(Edges_Out (v,rc)):]) by A9, CARD_2:40 ; then Degree (v,rc) = (card 2) * (card ev) by A7, A6, CARD_2:46 .= 2 * (card ev) by CARD_1:def_2 ; hence Degree (v,(rng c)) is even ; ::_thesis: verum end; end; end; theorem Th49: :: GRAPH_3:49 for G being finite Graph for v being Vertex of G for c being cyclic Path of G holds Degree (v,(rng c)) is even proof let G be finite Graph; ::_thesis: for v being Vertex of G for c being cyclic Path of G holds Degree (v,(rng c)) is even let v be Vertex of G; ::_thesis: for c being cyclic Path of G holds Degree (v,(rng c)) is even let c be cyclic Path of G; ::_thesis: Degree (v,(rng c)) is even percases ( c is empty or not c is empty ) ; suppose c is empty ; ::_thesis: Degree (v,(rng c)) is even then reconsider rc = rng c as empty set ; Degree (v,rc) = 2 * 0 ; hence Degree (v,(rng c)) is even ; ::_thesis: verum end; supposeA1: not c is empty ; ::_thesis: Degree (v,(rng c)) is even consider vs being FinSequence of the carrier of G such that A2: vs is_vertex_seq_of c by GRAPH_2:33; thus Degree (v,(rng c)) is even ::_thesis: verum proof percases ( v in rng vs or not v in rng vs ) ; suppose v in rng vs ; ::_thesis: Degree (v,(rng c)) is even hence Degree (v,(rng c)) is even by A2, Lm4; ::_thesis: verum end; suppose not v in rng vs ; ::_thesis: Degree (v,(rng c)) is even then Degree (v,(rng c)) = 2 * 0 by A1, A2, Th32; hence Degree (v,(rng c)) is even ; ::_thesis: verum end; end; end; end; end; end; theorem Th50: :: GRAPH_3:50 for G being finite Graph for v being Vertex of G for vs being FinSequence of the carrier of G for c being Path of G st not c is cyclic & vs is_vertex_seq_of c holds ( Degree (v,(rng c)) is even iff ( v <> vs . 1 & v <> vs . (len vs) ) ) proof let G be finite Graph; ::_thesis: for v being Vertex of G for vs being FinSequence of the carrier of G for c being Path of G st not c is cyclic & vs is_vertex_seq_of c holds ( Degree (v,(rng c)) is even iff ( v <> vs . 1 & v <> vs . (len vs) ) ) let v be Vertex of G; ::_thesis: for vs being FinSequence of the carrier of G for c being Path of G st not c is cyclic & vs is_vertex_seq_of c holds ( Degree (v,(rng c)) is even iff ( v <> vs . 1 & v <> vs . (len vs) ) ) let vs be FinSequence of the carrier of G; ::_thesis: for c being Path of G st not c is cyclic & vs is_vertex_seq_of c holds ( Degree (v,(rng c)) is even iff ( v <> vs . 1 & v <> vs . (len vs) ) ) let c be Path of G; ::_thesis: ( not c is cyclic & vs is_vertex_seq_of c implies ( Degree (v,(rng c)) is even iff ( v <> vs . 1 & v <> vs . (len vs) ) ) ) assume that A1: not c is cyclic and A2: vs is_vertex_seq_of c ; ::_thesis: ( Degree (v,(rng c)) is even iff ( v <> vs . 1 & v <> vs . (len vs) ) ) len vs = (len c) + 1 by A2, GRAPH_2:def_6; then A3: 1 <= len vs by NAT_1:11; then ( 1 in dom vs & len vs in dom vs ) by FINSEQ_3:25; then reconsider v1 = vs . 1, v2 = vs . (len vs) as Vertex of G by FINSEQ_2:11; A4: v1 <> v2 by A1, A2, MSSCYC_1:def_2; set G9 = AddNewEdge (v1,v2); reconsider vs9 = vs as FinSequence of the carrier of (AddNewEdge (v1,v2)) by Def7; reconsider c9 = c as Path of AddNewEdge (v1,v2) by Th37; A5: vs9 is_vertex_seq_of c9 by A2, Th36; reconsider v9 = v, v19 = v1, v29 = v2 as Vertex of (AddNewEdge (v1,v2)) by Def7; set v219 = <*v29,v19*>; set vs9e = vs9 ^' <*v29,v19*>; len <*v29,v19*> = 2 by FINSEQ_1:44; then A6: (vs9 ^' <*v29,v19*>) . (len (vs9 ^' <*v29,v19*>)) = <*v29,v19*> . 2 by GRAPH_2:16; set E = the carrier' of G; set e = the carrier' of G; A7: the carrier' of G in { the carrier' of G} by TARSKI:def_1; the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; then the carrier' of G in the carrier' of (AddNewEdge (v1,v2)) by A7, XBOOLE_0:def_3; then reconsider ep = <* the carrier' of G*> as Path of AddNewEdge (v1,v2) by Th4; A8: rng ep = { the carrier' of G} by FINSEQ_1:39; A9: not the carrier' of G in the carrier' of G ; then rng ep misses the carrier' of G by A8, ZFMISC_1:50; then A10: (rng ep) /\ the carrier' of G = {} by XBOOLE_0:def_7; ( the Source of (AddNewEdge (v1,v2)) . the carrier' of G = v19 & the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v29 ) by Th34; then A11: ( vs9 . (len vs9) = <*v29,v19*> . 1 & <*v29,v19*> is_vertex_seq_of ep ) by Th11, FINSEQ_1:44; A12: rng c c= the carrier' of G by FINSEQ_1:def_4; then A13: not the carrier' of G in rng c by A9; rng c9 misses rng ep proof assume not rng c9 misses rng ep ; ::_thesis: contradiction then ex x being set st ( x in rng c9 & x in rng ep ) by XBOOLE_0:3; hence contradiction by A13, A8, TARSKI:def_1; ::_thesis: verum end; then reconsider c9e = c9 ^ ep as Path of AddNewEdge (v1,v2) by A5, A11, Th6; A14: vs9 ^' <*v29,v19*> is_vertex_seq_of c9e by A5, A11, GRAPH_2:44; (vs9 ^' <*v29,v19*>) . 1 = vs . 1 by A3, GRAPH_2:14; then (vs9 ^' <*v29,v19*>) . 1 = (vs9 ^' <*v29,v19*>) . (len (vs9 ^' <*v29,v19*>)) by A6, FINSEQ_1:44; then reconsider c9e = c9e as cyclic Path of AddNewEdge (v1,v2) by A14, MSSCYC_1:def_2; rng c9e = (rng c) \/ (rng ep) by FINSEQ_1:31; then A15: the carrier' of G in rng c9e by A7, A8, XBOOLE_0:def_3; A16: (rng c9e) /\ the carrier' of G = ((rng c) \/ (rng ep)) /\ the carrier' of G by FINSEQ_1:31 .= ((rng c) /\ the carrier' of G) \/ {} by A10, XBOOLE_1:23 .= rng c by A12, XBOOLE_1:28 ; then A17: Degree (v,(rng c9e)) = Degree (v,(rng c)) by Th31; reconsider dv9 = Degree (v9,(rng c9e)) as even Element of NAT by Th49; A18: Degree (v9,(rng c9e)) is even by Th49; percases ( ( v <> v1 & v <> v2 ) or v = v1 or v = v2 ) ; suppose ( v <> v1 & v <> v2 ) ; ::_thesis: ( Degree (v,(rng c)) is even iff ( v <> vs . 1 & v <> vs . (len vs) ) ) hence ( Degree (v,(rng c)) is even iff ( v <> vs . 1 & v <> vs . (len vs) ) ) by A18, A17, Th48; ::_thesis: verum end; supposeA19: ( v = v1 or v = v2 ) ; ::_thesis: ( Degree (v,(rng c)) is even iff ( v <> vs . 1 & v <> vs . (len vs) ) ) then Degree (v9,(rng c9e)) = (Degree (v,(rng c9e))) + 1 by A4, A15, Th47; then Degree (v,(rng c9e)) = dv9 - 1 ; hence ( Degree (v,(rng c)) is even iff ( v <> vs . 1 & v <> vs . (len vs) ) ) by A16, A19, Th31; ::_thesis: verum end; end; end; definition let G be Graph; funcG -CycleSet -> FinSequenceSet of the carrier' of G means :Def8: :: GRAPH_3:def 8 for x being set holds ( x in it iff x is cyclic Path of G ); existence ex b1 being FinSequenceSet of the carrier' of G st for x being set holds ( x in b1 iff x is cyclic Path of G ) proof defpred S1[ set ] means $1 is cyclic Path of G; set IT = { p where p is Element of the carrier' of G * : S1[p] } ; { p where p is Element of the carrier' of G * : S1[p] } is Subset of ( the carrier' of G *) from DOMAIN_1:sch_7(); then for x being set st x in { p where p is Element of the carrier' of G * : S1[p] } holds x is FinSequence of the carrier' of G by FINSEQ_1:def_11; then reconsider IT = { p where p is Element of the carrier' of G * : S1[p] } as FinSequenceSet of the carrier' of G by FINSEQ_2:def_3; reconsider p = {} as Path of G by GRAPH_1:14; set v = the Vertex of G; reconsider IT = IT as FinSequenceSet of the carrier' of G ; take IT ; ::_thesis: for x being set holds ( x in IT iff x is cyclic Path of G ) let x be set ; ::_thesis: ( x in IT iff x is cyclic Path of G ) hereby ::_thesis: ( x is cyclic Path of G implies x in IT ) assume x in IT ; ::_thesis: x is cyclic Path of G then ex p being Element of the carrier' of G * st ( p = x & p is cyclic Path of G ) ; hence x is cyclic Path of G ; ::_thesis: verum end; assume A1: x is cyclic Path of G ; ::_thesis: x in IT then x is Element of the carrier' of G * by FINSEQ_1:def_11; hence x in IT by A1; ::_thesis: verum end; uniqueness for b1, b2 being FinSequenceSet of the carrier' of G st ( for x being set holds ( x in b1 iff x is cyclic Path of G ) ) & ( for x being set holds ( x in b2 iff x is cyclic Path of G ) ) holds b1 = b2 proof let it1, it2 be FinSequenceSet of the carrier' of G; ::_thesis: ( ( for x being set holds ( x in it1 iff x is cyclic Path of G ) ) & ( for x being set holds ( x in it2 iff x is cyclic Path of G ) ) implies it1 = it2 ) assume that A2: for x being set holds ( x in it1 iff x is cyclic Path of G ) and A3: for x being set holds ( x in it2 iff x is cyclic Path of G ) ; ::_thesis: it1 = it2 now__::_thesis:_for_x_being_set_holds_ (_x_in_it1_iff_x_in_it2_) let x be set ; ::_thesis: ( x in it1 iff x in it2 ) ( x in it1 iff x is cyclic Path of G ) by A2; hence ( x in it1 iff x in it2 ) by A3; ::_thesis: verum end; hence it1 = it2 by TARSKI:1; ::_thesis: verum end; end; :: deftheorem Def8 defines -CycleSet GRAPH_3:def_8_:_ for G being Graph for b2 being FinSequenceSet of the carrier' of G holds ( b2 = G -CycleSet iff for x being set holds ( x in b2 iff x is cyclic Path of G ) ); theorem Th51: :: GRAPH_3:51 for G being Graph holds {} in G -CycleSet proof let G be Graph; ::_thesis: {} in G -CycleSet reconsider p = {} as Path of G by GRAPH_1:14; set v = the Vertex of G; ( <* the Vertex of G*> is_vertex_seq_of p & <* the Vertex of G*> . 1 = <* the Vertex of G*> . (len <* the Vertex of G*>) ) by FINSEQ_1:40, GRAPH_2:32; then p is cyclic by MSSCYC_1:def_2; hence {} in G -CycleSet by Def8; ::_thesis: verum end; registration let G be Graph; clusterG -CycleSet -> non empty ; coherence not G -CycleSet is empty by Th51; end; theorem Th52: :: GRAPH_3:52 for G being Graph for v being Vertex of G for c being Element of G -CycleSet st v in G -VSet (rng c) holds { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is non empty Subset of (G -CycleSet) proof let G be Graph; ::_thesis: for v being Vertex of G for c being Element of G -CycleSet st v in G -VSet (rng c) holds { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is non empty Subset of (G -CycleSet) let v be Vertex of G; ::_thesis: for c being Element of G -CycleSet st v in G -VSet (rng c) holds { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is non empty Subset of (G -CycleSet) let c be Element of G -CycleSet ; ::_thesis: ( v in G -VSet (rng c) implies { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is non empty Subset of (G -CycleSet) ) set Cset = { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } ; reconsider c9 = c as cyclic Path of G by Def8; consider vs being FinSequence of the carrier of G such that A1: vs is_vertex_seq_of c9 by GRAPH_2:33; A2: len vs = (len c) + 1 by A1, GRAPH_2:def_6; assume A3: v in G -VSet (rng c) ; ::_thesis: { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is non empty Subset of (G -CycleSet) then A4: ex vv being Vertex of G st ( vv = v & ex e being Element of the carrier' of G st ( e in rng c & ( vv = the Source of G . e or vv = the Target of G . e ) ) ) ; then G -VSet (rng c9) = rng vs by A1, GRAPH_2:31, RELAT_1:38; then consider n being Nat such that A5: n in dom vs and A6: vs . n = v by A3, FINSEQ_2:10; reconsider n = n as Element of NAT by ORDINAL1:def_12; dom vs = Seg (len vs) by FINSEQ_1:def_3; then A7: ( 1 <= n & n <= len vs ) by A5, FINSEQ_1:1; A8: now__::_thesis:_not__{__c9_where_c9_is_Element_of_G_-CycleSet_:_(_rng_c9_=_rng_c_&_ex_vs_being_FinSequence_of_the_carrier_of_G_st_ (_vs_is_vertex_seq_of_c9_&_vs_._1_=_v_)_)__}__is_empty percases ( ( 1 = n & n = len vs ) or 1 = n or n = len vs or ( 1 < n & n < len vs ) ) by A7, XXREAL_0:1; suppose ( 1 = n & n = len vs ) ; ::_thesis: not { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is empty then 0 + 1 = (len c) + 1 by A1, GRAPH_2:def_6; then c = {} ; hence not { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is empty by A4; ::_thesis: verum end; suppose 1 = n ; ::_thesis: not { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is empty then c in { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } by A1, A6; hence not { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is empty ; ::_thesis: verum end; suppose n = len vs ; ::_thesis: not { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is empty then vs . 1 = v by A1, A6, MSSCYC_1:6; then c in { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } by A1; hence not { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is empty ; ::_thesis: verum end; supposeA9: ( 1 < n & n < len vs ) ; ::_thesis: not { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is empty set vs2 = (n,(len vs)) -cut vs; consider m being Element of NAT such that A10: n = 1 + m and A11: 1 <= m by A9, FINSEQ_4:84; set vs1 = (1,(m + 1)) -cut vs; A12: 1 <= (m + 1) + 1 by A9, A10, NAT_1:13; then A13: (len ((1,(m + 1)) -cut vs)) + 1 = (m + 1) + 1 by A9, A10, Lm1; then A14: ((1,(m + 1)) -cut vs) . 1 = vs . (1 + 0) by A9, A10, A12, Lm1; reconsider c1 = (1,m) -cut c9, c2 = (n,(len c)) -cut c9 as Path of G by Th5; A15: n <= len c by A2, A9, NAT_1:13; then A16: (n,(len vs)) -cut vs is_vertex_seq_of c2 by A1, A2, A9, GRAPH_2:42; A17: (len ((n,(len vs)) -cut vs)) + n = (len vs) + 1 by A9, GRAPH_2:def_1; A18: now__::_thesis:_not_len_((n,(len_vs))_-cut_vs)_=_0 assume len ((n,(len vs)) -cut vs) = 0 ; ::_thesis: contradiction then (len vs) + 1 < (len vs) + 0 by A9, A17; hence contradiction by XREAL_1:6; ::_thesis: verum end; then A19: 1 + 0 <= len ((n,(len vs)) -cut vs) by NAT_1:13; then consider lv2 being Element of NAT such that 0 <= lv2 and A20: lv2 < len ((n,(len vs)) -cut vs) and A21: len ((n,(len vs)) -cut vs) = lv2 + 1 by GRAPH_2:1; reconsider vs21 = ((n,(len vs)) -cut vs) ^' ((1,(m + 1)) -cut vs) as FinSequence of the carrier of G ; A22: vs21 . 1 = ((n,(len vs)) -cut vs) . (0 + 1) by A19, GRAPH_2:14 .= vs . (n + 0) by A9, A18, GRAPH_2:def_1 ; A23: m <= m + 1 by NAT_1:11; then m <= len c by A10, A15, XXREAL_0:2; then A24: (1,(m + 1)) -cut vs is_vertex_seq_of c1 by A1, A11, GRAPH_2:42; A25: ((n,(len vs)) -cut vs) . (len ((n,(len vs)) -cut vs)) = vs . (n + lv2) by A9, A20, A21, GRAPH_2:def_1 .= ((1,(m + 1)) -cut vs) . 1 by A1, A17, A21, A14, MSSCYC_1:6 ; now__::_thesis:_for_y_being_set_holds_ (_not_y_in_rng_c1_or_not_y_in_rng_c2_) given y being set such that A26: y in rng c1 and A27: y in rng c2 ; ::_thesis: contradiction consider b being Nat such that A28: b in dom c2 and A29: c2 . b = y by A27, FINSEQ_2:10; A30: ex l being Element of NAT st ( l in dom c9 & c . l = c2 . b & l + 1 = n + b & n <= l & l <= len c ) by A28, Th2; consider a being Nat such that A31: a in dom c1 and A32: c1 . a = y by A26, FINSEQ_2:10; consider k being Element of NAT such that A33: ( k in dom c9 & c . k = c1 . a ) and k + 1 = 1 + a and 1 <= k and A34: k <= m by A31, Th2; k < n by A10, A34, NAT_1:13; hence contradiction by A32, A29, A33, A30, FUNCT_1:def_4; ::_thesis: verum end; then rng c1 misses rng c2 by XBOOLE_0:3; then reconsider c219 = c2 ^ c1 as Path of G by A24, A16, A25, Th6; A35: vs21 is_vertex_seq_of c219 by A24, A16, A25, GRAPH_2:44; A36: c = c1 ^ c2 by A10, A15, A23, GRAPH_2:9, XXREAL_0:2; 1 < len ((1,(m + 1)) -cut vs) by A11, A13, NAT_1:13; then vs21 . (len vs21) = ((1,(m + 1)) -cut vs) . (len ((1,(m + 1)) -cut vs)) by GRAPH_2:16 .= vs . n by A9, A10, GRAPH_2:12 ; then reconsider c219 = c219 as cyclic Path of G by A22, A35, MSSCYC_1:def_2; reconsider c21 = c219 as Element of G -CycleSet by Def8; rng c21 = (rng c2) \/ (rng c1) by FINSEQ_1:31 .= rng c by A36, FINSEQ_1:31 ; then c21 in { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } by A6, A22, A35; hence not { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is empty ; ::_thesis: verum end; end; end; { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } c= G -CycleSet proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } or x in G -CycleSet ) assume x in { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } ; ::_thesis: x in G -CycleSet then ex c9 being Element of G -CycleSet st ( c9 = x & rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) ; hence x in G -CycleSet ; ::_thesis: verum end; hence { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is non empty Subset of (G -CycleSet) by A8; ::_thesis: verum end; definition let G be Graph; let v be Vertex of G; let c be Element of G -CycleSet ; assume A1: v in G -VSet (rng c) ; func Rotate (c,v) -> Element of G -CycleSet equals :Def9: :: GRAPH_3:def 9 choose { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } ; coherence choose { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is Element of G -CycleSet proof set Rotated = { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } ; set IT = choose { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } ; not { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is empty by A1, Th52; then choose { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } in { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } ; then ex c9 being Element of G -CycleSet st ( choose { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } = c9 & rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) ; hence choose { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } is Element of G -CycleSet ; ::_thesis: verum end; end; :: deftheorem Def9 defines Rotate GRAPH_3:def_9_:_ for G being Graph for v being Vertex of G for c being Element of G -CycleSet st v in G -VSet (rng c) holds Rotate (c,v) = choose { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } ; Lm5: for G being Graph for c being Element of G -CycleSet for v being Vertex of G st v in G -VSet (rng c) holds rng (Rotate (c,v)) = rng c proof let G be Graph; ::_thesis: for c being Element of G -CycleSet for v being Vertex of G st v in G -VSet (rng c) holds rng (Rotate (c,v)) = rng c let c be Element of G -CycleSet ; ::_thesis: for v being Vertex of G st v in G -VSet (rng c) holds rng (Rotate (c,v)) = rng c let v be Vertex of G; ::_thesis: ( v in G -VSet (rng c) implies rng (Rotate (c,v)) = rng c ) assume A1: v in G -VSet (rng c) ; ::_thesis: rng (Rotate (c,v)) = rng c then reconsider Rotated = { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } as non empty Subset of (G -CycleSet) by Th52; Rotate (c,v) = choose Rotated by A1, Def9; then Rotate (c,v) in Rotated ; then ex c9 being Element of G -CycleSet st ( Rotate (c,v) = c9 & rng c9 = rng c & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) ; hence rng (Rotate (c,v)) = rng c ; ::_thesis: verum end; definition let G be Graph; let c1, c2 be Element of G -CycleSet ; assume that A1: G -VSet (rng c1) meets G -VSet (rng c2) and A2: rng c1 misses rng c2 ; func CatCycles (c1,c2) -> Element of G -CycleSet means :Def10: :: GRAPH_3:def 10 ex v being Vertex of G st ( v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) & it = (Rotate (c1,v)) ^ (Rotate (c2,v)) ); existence ex b1 being Element of G -CycleSet ex v being Vertex of G st ( v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) & b1 = (Rotate (c1,v)) ^ (Rotate (c2,v)) ) proof set v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))); A3: not (G -VSet (rng c1)) /\ (G -VSet (rng c2)) is empty by A1, XBOOLE_0:def_7; then A4: choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) in (G -VSet (rng c1)) /\ (G -VSet (rng c2)) ; A5: choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) in G -VSet (rng c1) by A3, XBOOLE_0:def_4; A6: choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) in G -VSet (rng c2) by A3, XBOOLE_0:def_4; reconsider v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) as Vertex of G by A4; reconsider Rotated2 = { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c2 & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } as non empty Subset of (G -CycleSet) by A6, Th52; set r2 = Rotate (c2,v); Rotate (c2,v) = choose Rotated2 by A6, Def9; then Rotate (c2,v) in Rotated2 ; then consider c99 being Element of G -CycleSet such that A7: Rotate (c2,v) = c99 and A8: rng c99 = rng c2 and A9: ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c99 & vs . 1 = v ) ; consider vs2 being FinSequence of the carrier of G such that A10: vs2 is_vertex_seq_of c99 and A11: vs2 . 1 = v by A9; reconsider c92 = c99 as cyclic Path of G by Def8; A12: Rotate (c2,v) = c92 by A7; not rng c2 is empty by A6, Th16; then not c99 is empty by A8; then 0 + 1 < (len c99) + 1 by XREAL_1:6; then A13: 1 < len vs2 by A10, GRAPH_2:def_6; A14: vs2 is_vertex_seq_of c92 by A10; reconsider Rotated1 = { c9 where c9 is Element of G -CycleSet : ( rng c9 = rng c1 & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } as non empty Subset of (G -CycleSet) by A5, Th52; set r1 = Rotate (c1,v); Rotate (c1,v) = choose Rotated1 by A5, Def9; then Rotate (c1,v) in Rotated1 ; then consider c9 being Element of G -CycleSet such that A15: Rotate (c1,v) = c9 and A16: rng c9 = rng c1 and A17: ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ; reconsider c91 = c9 as cyclic Path of G by Def8; consider vs1 being FinSequence of the carrier of G such that A18: vs1 is_vertex_seq_of c9 and A19: vs1 . 1 = v by A17; vs1 is_vertex_seq_of c91 by A18; then A20: vs1 . 1 = vs1 . (len vs1) by MSSCYC_1:6; set vs12 = vs1 ^' vs2; len vs1 = (len c9) + 1 by A18, GRAPH_2:def_6; then 1 <= len vs1 by NAT_1:11; then A21: (vs1 ^' vs2) . 1 = vs1 . 1 by GRAPH_2:14 .= vs2 . (len vs2) by A19, A11, A14, MSSCYC_1:6 .= (vs1 ^' vs2) . (len (vs1 ^' vs2)) by A13, GRAPH_2:16 ; A22: Rotate (c1,v) = c91 by A15; then reconsider c = (Rotate (c1,v)) ^ (Rotate (c2,v)) as Path of G by A2, A16, A8, A18, A19, A10, A11, A20, A12, Th6; vs1 ^' vs2 is_vertex_seq_of c by A18, A19, A10, A11, A20, A22, A12, GRAPH_2:44; then c is cyclic by A21, MSSCYC_1:def_2; then reconsider c = c as Element of G -CycleSet by Def8; take c ; ::_thesis: ex v being Vertex of G st ( v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) & c = (Rotate (c1,v)) ^ (Rotate (c2,v)) ) take v ; ::_thesis: ( v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) & c = (Rotate (c1,v)) ^ (Rotate (c2,v)) ) thus ( v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) & c = (Rotate (c1,v)) ^ (Rotate (c2,v)) ) ; ::_thesis: verum end; correctness uniqueness for b1, b2 being Element of G -CycleSet st ex v being Vertex of G st ( v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) & b1 = (Rotate (c1,v)) ^ (Rotate (c2,v)) ) & ex v being Vertex of G st ( v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) & b2 = (Rotate (c1,v)) ^ (Rotate (c2,v)) ) holds b1 = b2; ; end; :: deftheorem Def10 defines CatCycles GRAPH_3:def_10_:_ for G being Graph for c1, c2 being Element of G -CycleSet st G -VSet (rng c1) meets G -VSet (rng c2) & rng c1 misses rng c2 holds for b4 being Element of G -CycleSet holds ( b4 = CatCycles (c1,c2) iff ex v being Vertex of G st ( v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) & b4 = (Rotate (c1,v)) ^ (Rotate (c2,v)) ) ); theorem Th53: :: GRAPH_3:53 for G being Graph for c1, c2 being Element of G -CycleSet st G -VSet (rng c1) meets G -VSet (rng c2) & rng c1 misses rng c2 & ( c1 <> {} or c2 <> {} ) holds not CatCycles (c1,c2) is empty proof let G be Graph; ::_thesis: for c1, c2 being Element of G -CycleSet st G -VSet (rng c1) meets G -VSet (rng c2) & rng c1 misses rng c2 & ( c1 <> {} or c2 <> {} ) holds not CatCycles (c1,c2) is empty let c1, c2 be Element of G -CycleSet ; ::_thesis: ( G -VSet (rng c1) meets G -VSet (rng c2) & rng c1 misses rng c2 & ( c1 <> {} or c2 <> {} ) implies not CatCycles (c1,c2) is empty ) assume that A1: G -VSet (rng c1) meets G -VSet (rng c2) and A2: rng c1 misses rng c2 and A3: ( c1 <> {} or c2 <> {} ) ; ::_thesis: not CatCycles (c1,c2) is empty consider v being Vertex of G such that A4: v = choose ((G -VSet (rng c1)) /\ (G -VSet (rng c2))) and A5: CatCycles (c1,c2) = (Rotate (c1,v)) ^ (Rotate (c2,v)) by A1, A2, Def10; A6: (G -VSet (rng c1)) /\ (G -VSet (rng c2)) <> {} by A1, XBOOLE_0:def_7; then A7: v in G -VSet (rng c1) by A4, XBOOLE_0:def_4; A8: v in G -VSet (rng c2) by A4, A6, XBOOLE_0:def_4; percases ( c1 <> {} or c2 <> {} ) by A3; suppose c1 <> {} ; ::_thesis: not CatCycles (c1,c2) is empty then rng (Rotate (c1,v)) <> {} by A7, Lm5; hence not CatCycles (c1,c2) is empty by A5, FINSEQ_1:35, RELAT_1:38; ::_thesis: verum end; suppose c2 <> {} ; ::_thesis: not CatCycles (c1,c2) is empty then rng (Rotate (c2,v)) <> {} by A8, Lm5; hence not CatCycles (c1,c2) is empty by A5, FINSEQ_1:35, RELAT_1:38; ::_thesis: verum end; end; end; definition let G be finite Graph; let v be Vertex of G; let X be set ; assume A1: Degree (v,X) <> 0 ; funcX -PathSet v -> non empty FinSequenceSet of the carrier' of G equals :Def11: :: GRAPH_3:def 11 { c where c is Element of X * : ( c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } ; coherence { c where c is Element of X * : ( c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } is non empty FinSequenceSet of the carrier' of G proof set e = choose (Edges_At (v,X)); set IT = { c where c is Element of X * : ( c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } ; A2: now__::_thesis:_for_x_being_set_st_x_in__{__c_where_c_is_Element_of_X_*_:_(_c_is_Path_of_G_&_not_c_is_empty_&_ex_vs_being_FinSequence_of_the_carrier_of_G_st_ (_vs_is_vertex_seq_of_c_&_vs_._1_=_v_)_)__}__holds_ x_is_FinSequence_of_the_carrier'_of_G let x be set ; ::_thesis: ( x in { c where c is Element of X * : ( c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } implies x is FinSequence of the carrier' of G ) assume x in { c where c is Element of X * : ( c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } ; ::_thesis: x is FinSequence of the carrier' of G then ex c being Element of X * st ( x = c & c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) ; hence x is FinSequence of the carrier' of G ; ::_thesis: verum end; A3: not Edges_At (v,X) is empty by A1, Th25; now__::_thesis:_ex_e9_being_Element_of_X_st_ (_choose_(Edges_At_(v,X))_=_e9_&_e9_in_X_&_e9_in_the_carrier'_of_G_&_(_v_=_the_Target_of_G_._e9_or_v_=_the_Source_of_G_._e9_)_) percases ( choose (Edges_At (v,X)) in Edges_In (v,X) or choose (Edges_At (v,X)) in Edges_Out (v,X) ) by A3, XBOOLE_0:def_3; supposeA4: choose (Edges_At (v,X)) in Edges_In (v,X) ; ::_thesis: ex e9 being Element of X st ( choose (Edges_At (v,X)) = e9 & e9 in X & e9 in the carrier' of G & ( v = the Target of G . e9 or v = the Source of G . e9 ) ) then ( choose (Edges_At (v,X)) in X & the Target of G . (choose (Edges_At (v,X))) = v ) by Def1; hence ex e9 being Element of X st ( choose (Edges_At (v,X)) = e9 & e9 in X & e9 in the carrier' of G & ( v = the Target of G . e9 or v = the Source of G . e9 ) ) by A4; ::_thesis: verum end; supposeA5: choose (Edges_At (v,X)) in Edges_Out (v,X) ; ::_thesis: ex e9 being Element of X st ( choose (Edges_At (v,X)) = e9 & e9 in X & e9 in the carrier' of G & ( v = the Target of G . e9 or v = the Source of G . e9 ) ) then ( choose (Edges_At (v,X)) in X & the Source of G . (choose (Edges_At (v,X))) = v ) by Def2; hence ex e9 being Element of X st ( choose (Edges_At (v,X)) = e9 & e9 in X & e9 in the carrier' of G & ( v = the Target of G . e9 or v = the Source of G . e9 ) ) by A5; ::_thesis: verum end; end; end; then consider e9 being Element of X such that choose (Edges_At (v,X)) = e9 and A6: e9 in X and A7: e9 in the carrier' of G and A8: ( v = the Target of G . e9 or v = the Source of G . e9 ) ; reconsider X9 = X as non empty set by A6; reconsider e9 = e9 as Element of X9 ; reconsider c = <*e9*> as Element of X * by FINSEQ_1:def_11; A9: ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) proof set s = the Source of G . e9; reconsider s = the Source of G . e9 as Vertex of G by A7, FUNCT_2:5; set t = the Target of G . e9; reconsider t = the Target of G . e9 as Vertex of G by A7, FUNCT_2:5; percases ( v = the Target of G . e9 or v = the Source of G . e9 ) by A8; supposeA10: v = the Target of G . e9 ; ::_thesis: ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) take <*t,s*> ; ::_thesis: ( <*t,s*> is_vertex_seq_of c & <*t,s*> . 1 = v ) thus ( <*t,s*> is_vertex_seq_of c & <*t,s*> . 1 = v ) by A10, Th11, FINSEQ_1:44; ::_thesis: verum end; supposeA11: v = the Source of G . e9 ; ::_thesis: ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) take <*s,t*> ; ::_thesis: ( <*s,t*> is_vertex_seq_of c & <*s,t*> . 1 = v ) thus ( <*s,t*> is_vertex_seq_of c & <*s,t*> . 1 = v ) by A11, FINSEQ_1:44, MSSCYC_1:4; ::_thesis: verum end; end; end; c is Path of G by A7, Th4; then c in { c where c is Element of X * : ( c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } by A9; hence { c where c is Element of X * : ( c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } is non empty FinSequenceSet of the carrier' of G by A2, FINSEQ_2:def_3; ::_thesis: verum end; end; :: deftheorem Def11 defines -PathSet GRAPH_3:def_11_:_ for G being finite Graph for v being Vertex of G for X being set st Degree (v,X) <> 0 holds X -PathSet v = { c where c is Element of X * : ( c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } ; theorem Th54: :: GRAPH_3:54 for X being set for G being finite Graph for v being Vertex of G for p being Element of X -PathSet v for Y being finite set st Y = the carrier' of G & Degree (v,X) <> 0 holds len p <= card Y proof let X be set ; ::_thesis: for G being finite Graph for v being Vertex of G for p being Element of X -PathSet v for Y being finite set st Y = the carrier' of G & Degree (v,X) <> 0 holds len p <= card Y let G be finite Graph; ::_thesis: for v being Vertex of G for p being Element of X -PathSet v for Y being finite set st Y = the carrier' of G & Degree (v,X) <> 0 holds len p <= card Y let v be Vertex of G; ::_thesis: for p being Element of X -PathSet v for Y being finite set st Y = the carrier' of G & Degree (v,X) <> 0 holds len p <= card Y let p be Element of X -PathSet v; ::_thesis: for Y being finite set st Y = the carrier' of G & Degree (v,X) <> 0 holds len p <= card Y let Y be finite set ; ::_thesis: ( Y = the carrier' of G & Degree (v,X) <> 0 implies len p <= card Y ) assume that A1: Y = the carrier' of G and A2: Degree (v,X) <> 0 ; ::_thesis: len p <= card Y A3: p in X -PathSet v ; X -PathSet v = { c where c is Element of X * : ( c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } by A2, Def11; then ex c being Element of X * st ( p = c & c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) by A3; then A4: card (rng p) = len p by FINSEQ_4:62; rng p c= Y by A1, FINSEQ_1:def_4; hence len p <= card Y by A4, NAT_1:43; ::_thesis: verum end; definition let G be finite Graph; let v be Vertex of G; let X be set ; assume that A1: for v being Vertex of G holds Degree (v,X) is even and A2: Degree (v,X) <> 0 ; funcX -CycleSet v -> non empty Subset of (G -CycleSet) equals :Def12: :: GRAPH_3:def 12 { c where c is Element of G -CycleSet : ( rng c c= X & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } ; coherence { c where c is Element of G -CycleSet : ( rng c c= X & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } is non empty Subset of (G -CycleSet) proof reconsider E = the carrier' of G as finite set by GRAPH_1:def_11; set XL = { (len p) where p is Element of X -PathSet v : verum } ; set IT = { c where c is Element of G -CycleSet : ( rng c c= X & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } ; set p = the Element of X -PathSet v; A3: len the Element of X -PathSet v in { (len p) where p is Element of X -PathSet v : verum } ; A4: { (len p) where p is Element of X -PathSet v : verum } c= NAT proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { (len p) where p is Element of X -PathSet v : verum } or x in NAT ) assume x in { (len p) where p is Element of X -PathSet v : verum } ; ::_thesis: x in NAT then ex p being Element of X -PathSet v st x = len p ; hence x in NAT ; ::_thesis: verum end; A5: X -PathSet v = { c where c is Element of X * : ( c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } by A2, Def11; { (len p) where p is Element of X -PathSet v : verum } c= Seg (card E) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { (len p) where p is Element of X -PathSet v : verum } or x in Seg (card E) ) assume x in { (len p) where p is Element of X -PathSet v : verum } ; ::_thesis: x in Seg (card E) then consider p being Element of X -PathSet v such that A6: x = len p ; p in X -PathSet v ; then ex c being Element of X * st ( p = c & c is Path of G & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) by A5; then A7: 0 + 1 <= len p by NAT_1:13; len p <= card E by A2, Th54; hence x in Seg (card E) by A6, A7, FINSEQ_1:1; ::_thesis: verum end; then reconsider XL = { (len p) where p is Element of X -PathSet v : verum } as non empty finite Subset of NAT by A3, A4; set maxl = max XL; max XL in XL by XXREAL_2:def_8; then consider p being Element of X -PathSet v such that A8: max XL = len p ; p in X -PathSet v ; then consider c being Element of X * such that A9: p = c and A10: c is Path of G and A11: not c is empty and A12: ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) by A5; reconsider p = p as Path of G by A9, A10; A13: rng c c= X by FINSEQ_1:def_4; now__::_thesis:_p_is_cyclic set T = the Target of G; set S = the Source of G; A14: rng p c= X by A9, FINSEQ_1:def_4; consider vs being FinSequence of the carrier of G such that A15: vs is_vertex_seq_of p and A16: vs . 1 = v by A9, A12; len vs = (len p) + 1 by A15, GRAPH_2:def_6; then A17: 1 <= len vs by NAT_1:11; then len vs in dom vs by FINSEQ_3:25; then reconsider v1 = vs . (len vs) as Vertex of G by FINSEQ_2:11; assume not p is cyclic ; ::_thesis: contradiction then A18: Degree (v1,(rng p)) is odd by A15, Th50; then rng p <> X by A1; then rng p c< X by A14, XBOOLE_0:def_8; then ex xx being set st ( xx in X & not xx in rng p ) by XBOOLE_0:6; then reconsider Xp = X \ (rng p) as non empty set by XBOOLE_0:def_5; set e = choose (Edges_At (v1,Xp)); Degree (v1,Xp) = (Degree (v1,X)) - (Degree (v1,(rng p))) by A14, Th29; then Degree (v1,Xp) <> 0 by A1, A18; then A19: not Edges_At (v1,Xp) is empty by Th25; A20: now__::_thesis:_ex_e9_being_Element_of_Xp_st_ (_choose_(Edges_At_(v1,Xp))_=_e9_&_e9_in_Xp_&_e9_in_the_carrier'_of_G_&_(_v1_=_the_Target_of_G_._e9_or_v1_=_the_Source_of_G_._e9_)_) percases ( choose (Edges_At (v1,Xp)) in Edges_In (v1,Xp) or choose (Edges_At (v1,Xp)) in Edges_Out (v1,Xp) ) by A19, XBOOLE_0:def_3; supposeA21: choose (Edges_At (v1,Xp)) in Edges_In (v1,Xp) ; ::_thesis: ex e9 being Element of Xp st ( choose (Edges_At (v1,Xp)) = e9 & e9 in Xp & e9 in the carrier' of G & ( v1 = the Target of G . e9 or v1 = the Source of G . e9 ) ) then ( choose (Edges_At (v1,Xp)) in Xp & the Target of G . (choose (Edges_At (v1,Xp))) = v1 ) by Def1; hence ex e9 being Element of Xp st ( choose (Edges_At (v1,Xp)) = e9 & e9 in Xp & e9 in the carrier' of G & ( v1 = the Target of G . e9 or v1 = the Source of G . e9 ) ) by A21; ::_thesis: verum end; supposeA22: choose (Edges_At (v1,Xp)) in Edges_Out (v1,Xp) ; ::_thesis: ex e9 being Element of Xp st ( choose (Edges_At (v1,Xp)) = e9 & e9 in Xp & e9 in the carrier' of G & ( v1 = the Target of G . e9 or v1 = the Source of G . e9 ) ) then ( choose (Edges_At (v1,Xp)) in Xp & the Source of G . (choose (Edges_At (v1,Xp))) = v1 ) by Def2; hence ex e9 being Element of Xp st ( choose (Edges_At (v1,Xp)) = e9 & e9 in Xp & e9 in the carrier' of G & ( v1 = the Target of G . e9 or v1 = the Source of G . e9 ) ) by A22; ::_thesis: verum end; end; end; then reconsider ep = <*(choose (Edges_At (v1,Xp)))*> as Path of G by Th4; reconsider t = the Target of G . (choose (Edges_At (v1,Xp))), s = the Source of G . (choose (Edges_At (v1,Xp))) as Vertex of G by A20, FUNCT_2:5; now__::_thesis:_for_x_being_set_holds_ (_not_x_in_rng_ep_or_not_x_in_rng_p_) given x being set such that A23: x in rng ep and A24: x in rng p ; ::_thesis: contradiction rng ep = {(choose (Edges_At (v1,Xp)))} by FINSEQ_1:38; then x in Xp by A20, A23, TARSKI:def_1; hence contradiction by A24, XBOOLE_0:def_5; ::_thesis: verum end; then A25: rng ep misses rng p by XBOOLE_0:3; percases ( v1 = the Target of G . (choose (Edges_At (v1,Xp))) or v1 = the Source of G . (choose (Edges_At (v1,Xp))) ) by A20; supposeA26: v1 = the Target of G . (choose (Edges_At (v1,Xp))) ; ::_thesis: contradiction reconsider ts = <*t,s*> as FinSequence of the carrier of G ; A27: vs . (len vs) = ts . 1 by A26, FINSEQ_1:44; reconsider X9 = X as non empty set by A20; reconsider vs1 = vs ^' ts as FinSequence of the carrier of G ; reconsider e9 = choose (Edges_At (v1,Xp)) as Element of X9 by A20; A28: vs1 . 1 = v by A16, A17, GRAPH_2:14; A29: ts is_vertex_seq_of ep by Th11; then reconsider p1 = p ^ ep as Path of G by A15, A25, A27, Th6; A30: len p1 = (len p) + (len ep) by FINSEQ_1:22 .= (len p) + 1 by FINSEQ_1:39 ; reconsider p = p as FinSequence of X by A9; reconsider ep = <*e9*> as FinSequence of X ; reconsider xp1 = p ^ ep as Element of X * by FINSEQ_1:def_11; vs1 is_vertex_seq_of p1 by A15, A29, A27, GRAPH_2:44; then xp1 in X -PathSet v by A5, A28; then reconsider xp1 = xp1 as Element of X -PathSet v ; len xp1 in XL ; then (len p) + 1 <= (len p) + 0 by A8, A30, XXREAL_2:def_8; hence contradiction by XREAL_1:6; ::_thesis: verum end; supposeA31: v1 = the Source of G . (choose (Edges_At (v1,Xp))) ; ::_thesis: contradiction reconsider ts = <*s,t*> as FinSequence of the carrier of G ; A32: ( ts is_vertex_seq_of ep & vs . (len vs) = ts . 1 ) by A31, FINSEQ_1:44, MSSCYC_1:4; then reconsider p1 = p ^ ep as Path of G by A15, A25, Th6; A33: len p1 = (len p) + (len ep) by FINSEQ_1:22 .= (len p) + 1 by FINSEQ_1:39 ; reconsider X9 = X as non empty set by A20; reconsider vs1 = vs ^' ts as FinSequence of the carrier of G ; reconsider e9 = choose (Edges_At (v1,Xp)) as Element of X9 by A20; A34: vs1 . 1 = v by A16, A17, GRAPH_2:14; reconsider p = p as FinSequence of X by A9; reconsider ep = <*e9*> as FinSequence of X ; reconsider xp1 = p ^ ep as Element of X * by FINSEQ_1:def_11; vs1 is_vertex_seq_of p1 by A15, A32, GRAPH_2:44; then xp1 in X -PathSet v by A5, A34; then reconsider xp1 = xp1 as Element of X -PathSet v ; len xp1 in XL ; then (len p) + 1 <= (len p) + 0 by A8, A33, XXREAL_2:def_8; hence contradiction by XREAL_1:6; ::_thesis: verum end; end; end; then reconsider c = c as Element of G -CycleSet by A9, Def8; A35: now__::_thesis:_for_c_being_set_st_c_in__{__c_where_c_is_Element_of_G_-CycleSet_:_(_rng_c_c=_X_&_not_c_is_empty_&_ex_vs_being_FinSequence_of_the_carrier_of_G_st_ (_vs_is_vertex_seq_of_c_&_vs_._1_=_v_)_)__}__holds_ c_in_G_-CycleSet let c be set ; ::_thesis: ( c in { c where c is Element of G -CycleSet : ( rng c c= X & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } implies c in G -CycleSet ) assume c in { c where c is Element of G -CycleSet : ( rng c c= X & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } ; ::_thesis: c in G -CycleSet then ex c9 being Element of G -CycleSet st ( c = c9 & rng c9 c= X & not c9 is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) ; hence c in G -CycleSet ; ::_thesis: verum end; c in { c where c is Element of G -CycleSet : ( rng c c= X & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } by A11, A12, A13; hence { c where c is Element of G -CycleSet : ( rng c c= X & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } is non empty Subset of (G -CycleSet) by A35, TARSKI:def_3; ::_thesis: verum end; end; :: deftheorem Def12 defines -CycleSet GRAPH_3:def_12_:_ for G being finite Graph for v being Vertex of G for X being set st ( for v being Vertex of G holds Degree (v,X) is even ) & Degree (v,X) <> 0 holds X -CycleSet v = { c where c is Element of G -CycleSet : ( rng c c= X & not c is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c & vs . 1 = v ) ) } ; theorem Th55: :: GRAPH_3:55 for X being set for G being finite Graph for v being Vertex of G st Degree (v,X) <> 0 & ( for v being Vertex of G holds Degree (v,X) is even ) holds for c being Element of X -CycleSet v holds ( not c is empty & rng c c= X & v in G -VSet (rng c) ) proof let X be set ; ::_thesis: for G being finite Graph for v being Vertex of G st Degree (v,X) <> 0 & ( for v being Vertex of G holds Degree (v,X) is even ) holds for c being Element of X -CycleSet v holds ( not c is empty & rng c c= X & v in G -VSet (rng c) ) let G be finite Graph; ::_thesis: for v being Vertex of G st Degree (v,X) <> 0 & ( for v being Vertex of G holds Degree (v,X) is even ) holds for c being Element of X -CycleSet v holds ( not c is empty & rng c c= X & v in G -VSet (rng c) ) let v be Vertex of G; ::_thesis: ( Degree (v,X) <> 0 & ( for v being Vertex of G holds Degree (v,X) is even ) implies for c being Element of X -CycleSet v holds ( not c is empty & rng c c= X & v in G -VSet (rng c) ) ) assume ( Degree (v,X) <> 0 & ( for v being Vertex of G holds Degree (v,X) is even ) ) ; ::_thesis: for c being Element of X -CycleSet v holds ( not c is empty & rng c c= X & v in G -VSet (rng c) ) then A1: X -CycleSet v = { c9 where c9 is Element of G -CycleSet : ( rng c9 c= X & not c9 is empty & ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) ) } by Def12; let c be Element of X -CycleSet v; ::_thesis: ( not c is empty & rng c c= X & v in G -VSet (rng c) ) c in X -CycleSet v ; then consider c9 being Element of G -CycleSet such that A2: c = c9 and A3: rng c9 c= X and A4: not c9 is empty and A5: ex vs being FinSequence of the carrier of G st ( vs is_vertex_seq_of c9 & vs . 1 = v ) by A1; thus not c is empty by A2, A4; ::_thesis: ( rng c c= X & v in G -VSet (rng c) ) thus rng c c= X by A2, A3; ::_thesis: v in G -VSet (rng c) reconsider c9 = c9 as Path of G by Def8; consider vs being FinSequence of the carrier of G such that A6: vs is_vertex_seq_of c9 and A7: vs . 1 = v by A5; len vs = (len c9) + 1 by A6, GRAPH_2:def_6; then 1 <= len vs by NAT_1:11; then A8: 1 in dom vs by FINSEQ_3:25; G -VSet (rng c9) = rng vs by A4, A6, GRAPH_2:31; hence v in G -VSet (rng c) by A2, A7, A8, FUNCT_1:def_3; ::_thesis: verum end; theorem Th56: :: GRAPH_3:56 for G being connected finite Graph for c being Element of G -CycleSet st rng c <> the carrier' of G & not c is empty holds { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } is non empty Subset of the carrier of G proof let G be connected finite Graph; ::_thesis: for c being Element of G -CycleSet st rng c <> the carrier' of G & not c is empty holds { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } is non empty Subset of the carrier of G let c be Element of G -CycleSet ; ::_thesis: ( rng c <> the carrier' of G & not c is empty implies { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } is non empty Subset of the carrier of G ) defpred S1[ Vertex of G] means ( $1 in G -VSet (rng c) & Degree $1 <> Degree ($1,(rng c)) ); set X = { v9 where v9 is Vertex of G : S1[v9] } ; set T = the Target of G; set S = the Source of G; set E = the carrier' of G; A1: rng c c= the carrier' of G by FINSEQ_1:def_4; reconsider cp = c as cyclic Path of G by Def8; assume that A2: rng c <> the carrier' of G and A3: not c is empty ; ::_thesis: { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } is non empty Subset of the carrier of G consider vs being FinSequence of the carrier of G such that A4: vs is_vertex_seq_of cp by GRAPH_2:33; A5: G -VSet (rng cp) = rng vs by A3, A4, GRAPH_2:31; now__::_thesis:_ex_v_being_Vertex_of_G_st_ (_v_in_rng_vs_&_Degree_v_<>_Degree_(v,(rng_c))_) consider x being set such that A6: ( ( x in rng c & not x in the carrier' of G ) or ( x in the carrier' of G & not x in rng c ) ) by A2, TARSKI:1; reconsider x = x as Element of the carrier' of G by A1, A6; reconsider v = the Target of G . x as Vertex of G by A1, A6, FUNCT_2:5; percases ( v in rng vs or not v in rng vs ) ; supposeA7: v in rng vs ; ::_thesis: ex v being Vertex of G st ( v in rng vs & Degree v <> Degree (v,(rng c)) ) Degree v <> Degree (v,(rng c)) by A1, A6, Th26; hence ex v being Vertex of G st ( v in rng vs & Degree v <> Degree (v,(rng c)) ) by A7; ::_thesis: verum end; supposeA8: not v in rng vs ; ::_thesis: ex v being Vertex of G st ( v in rng vs & Degree v <> Degree (v,(rng c)) ) A9: ex e being set st e in rng c by A3, XBOOLE_0:def_1; then rng c meets the carrier' of G by A1, XBOOLE_0:3; then consider v9 being Vertex of G, e being Element of the carrier' of G such that A10: v9 in rng vs and A11: ( not e in rng c & ( v9 = the Target of G . e or v9 = the Source of G . e ) ) by A5, A8, Th19; Degree v9 <> Degree (v9,(rng c)) by A1, A9, A11, Th26; hence ex v being Vertex of G st ( v in rng vs & Degree v <> Degree (v,(rng c)) ) by A10; ::_thesis: verum end; end; end; then consider v being Vertex of G such that A12: ( v in rng vs & Degree v <> Degree (v,(rng c)) ) ; A13: { v9 where v9 is Vertex of G : S1[v9] } is Subset of the carrier of G from DOMAIN_1:sch_7(); v in { v9 where v9 is Vertex of G : S1[v9] } by A5, A12; hence { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } is non empty Subset of the carrier of G by A13; ::_thesis: verum end; definition let G be connected finite Graph; let c be Element of G -CycleSet ; assume that A1: rng c <> the carrier' of G and A2: not c is empty ; func ExtendCycle c -> Element of G -CycleSet means :Def13: :: GRAPH_3:def 13 ex c9 being Element of G -CycleSet ex v being Vertex of G st ( v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } & c9 = choose (( the carrier' of G \ (rng c)) -CycleSet v) & it = CatCycles (c,c9) ); existence ex b1, c9 being Element of G -CycleSet ex v being Vertex of G st ( v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } & c9 = choose (( the carrier' of G \ (rng c)) -CycleSet v) & b1 = CatCycles (c,c9) ) proof set X = { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } ; set v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } ; not { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } is empty by A1, A2, Th56; then choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } in { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } ; then ex v9 being Vertex of G st ( choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } = v9 & v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) ; then reconsider v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } as Vertex of G ; set E = the carrier' of G; reconsider E9 = the carrier' of G as finite set by GRAPH_1:def_11; rng c c= the carrier' of G by FINSEQ_1:def_4; then rng c c< the carrier' of G by A1, XBOOLE_0:def_8; then ex xx being set st ( xx in the carrier' of G & not xx in rng c ) by XBOOLE_0:6; then reconsider Erc = E9 \ (rng c) as non empty finite set by XBOOLE_0:def_5; set c9 = choose (Erc -CycleSet v); choose (Erc -CycleSet v) in Erc -CycleSet v ; then reconsider c9 = choose (Erc -CycleSet v) as Element of G -CycleSet ; reconsider IT = CatCycles (c,c9) as Element of G -CycleSet ; take IT ; ::_thesis: ex c9 being Element of G -CycleSet ex v being Vertex of G st ( v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } & c9 = choose (( the carrier' of G \ (rng c)) -CycleSet v) & IT = CatCycles (c,c9) ) take c9 ; ::_thesis: ex v being Vertex of G st ( v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } & c9 = choose (( the carrier' of G \ (rng c)) -CycleSet v) & IT = CatCycles (c,c9) ) take v ; ::_thesis: ( v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } & c9 = choose (( the carrier' of G \ (rng c)) -CycleSet v) & IT = CatCycles (c,c9) ) thus ( v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } & c9 = choose (( the carrier' of G \ (rng c)) -CycleSet v) & IT = CatCycles (c,c9) ) ; ::_thesis: verum end; uniqueness for b1, b2 being Element of G -CycleSet st ex c9 being Element of G -CycleSet ex v being Vertex of G st ( v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } & c9 = choose (( the carrier' of G \ (rng c)) -CycleSet v) & b1 = CatCycles (c,c9) ) & ex c9 being Element of G -CycleSet ex v being Vertex of G st ( v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } & c9 = choose (( the carrier' of G \ (rng c)) -CycleSet v) & b2 = CatCycles (c,c9) ) holds b1 = b2 ; end; :: deftheorem Def13 defines ExtendCycle GRAPH_3:def_13_:_ for G being connected finite Graph for c being Element of G -CycleSet st rng c <> the carrier' of G & not c is empty holds for b3 being Element of G -CycleSet holds ( b3 = ExtendCycle c iff ex c9 being Element of G -CycleSet ex v being Vertex of G st ( v = choose { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } & c9 = choose (( the carrier' of G \ (rng c)) -CycleSet v) & b3 = CatCycles (c,c9) ) ); theorem Th57: :: GRAPH_3:57 for G being connected finite Graph for c being Element of G -CycleSet st rng c <> the carrier' of G & not c is empty & ( for v being Vertex of G holds Degree v is even ) holds ( not ExtendCycle c is empty & card (rng c) < card (rng (ExtendCycle c)) ) proof let G be connected finite Graph; ::_thesis: for c being Element of G -CycleSet st rng c <> the carrier' of G & not c is empty & ( for v being Vertex of G holds Degree v is even ) holds ( not ExtendCycle c is empty & card (rng c) < card (rng (ExtendCycle c)) ) let c be Element of G -CycleSet ; ::_thesis: ( rng c <> the carrier' of G & not c is empty & ( for v being Vertex of G holds Degree v is even ) implies ( not ExtendCycle c is empty & card (rng c) < card (rng (ExtendCycle c)) ) ) set E = the carrier' of G; reconsider E9 = the carrier' of G as finite set by GRAPH_1:def_11; reconsider ccp = c as cyclic Path of G by Def8; assume that A1: rng c <> the carrier' of G and A2: not c is empty and A3: for v being Vertex of G holds Degree v is even ; ::_thesis: ( not ExtendCycle c is empty & card (rng c) < card (rng (ExtendCycle c)) ) A4: rng c c= the carrier' of G by FINSEQ_1:def_4; then rng c c< the carrier' of G by A1, XBOOLE_0:def_8; then ex xx being set st ( xx in the carrier' of G & not xx in rng c ) by XBOOLE_0:6; then reconsider Erc = E9 \ (rng c) as non empty finite set by XBOOLE_0:def_5; reconsider X = { v9 where v9 is Vertex of G : ( v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) } as non empty set by A1, A2, Th56; consider c9 being Element of G -CycleSet , v being Vertex of G such that A5: v = choose X and A6: c9 = choose (Erc -CycleSet v) and A7: ExtendCycle c = CatCycles (c,c9) by A1, A2, Def13; v in X by A5; then A8: ex v9 being Vertex of G st ( v = v9 & v9 in G -VSet (rng c) & Degree v9 <> Degree (v9,(rng c)) ) ; A9: now__::_thesis:_for_v_being_Vertex_of_G_holds_Degree_(v,Erc)_is_even let v be Vertex of G; ::_thesis: Degree (v,Erc) is even A10: ( Degree v = Degree (v, the carrier' of G) & Degree v is even ) by A3, Th24; ( Degree (v,Erc) = (Degree (v,E9)) - (Degree (v,(rng c))) & Degree (v,(rng ccp)) is even ) by A4, Th29, Th49; hence Degree (v,Erc) is even by A10; ::_thesis: verum end; rng c misses the carrier' of G \ (rng c) by XBOOLE_1:79; then A11: (rng c) /\ ( the carrier' of G \ (rng c)) = {} by XBOOLE_0:def_7; Degree (v,Erc) = (Degree (v,E9)) - (Degree (v,(rng c))) by A4, Th29; then A12: Degree (v,Erc) <> 0 by A8, Th24; then rng c9 c= the carrier' of G \ (rng c) by A6, A9, Th55; then (rng c) /\ (rng c9) = (rng c) /\ (( the carrier' of G \ (rng c)) /\ (rng c9)) by XBOOLE_1:28 .= {} /\ (rng c9) by A11, XBOOLE_1:16 .= {} ; then A13: rng c misses rng c9 by XBOOLE_0:def_7; v in G -VSet (rng c9) by A6, A9, A12, Th55; then A14: G -VSet (rng c) meets G -VSet (rng c9) by A8, XBOOLE_0:3; hence not ExtendCycle c is empty by A2, A7, A13, Th53; ::_thesis: card (rng c) < card (rng (ExtendCycle c)) consider vr being Vertex of G such that A15: vr = choose ((G -VSet (rng c)) /\ (G -VSet (rng c9))) and A16: CatCycles (c,c9) = (Rotate (c,vr)) ^ (Rotate (c9,vr)) by A14, A13, Def10; A17: (G -VSet (rng c)) /\ (G -VSet (rng c9)) <> {} by A14, XBOOLE_0:def_7; then vr in G -VSet (rng c9) by A15, XBOOLE_0:def_4; then A18: rng (Rotate (c9,vr)) = rng c9 by Lm5; vr in G -VSet (rng c) by A17, A15, XBOOLE_0:def_4; then rng (Rotate (c,vr)) = rng c by Lm5; then rng (ExtendCycle c) = (rng c) \/ (rng c9) by A7, A16, A18, FINSEQ_1:31; then A19: card (rng (ExtendCycle c)) = (card (rng c)) + (card (rng c9)) by A13, CARD_2:40; not c9 is empty by A6, A9, A12, Th55; hence card (rng c) < card (rng (ExtendCycle c)) by A19, XREAL_1:29; ::_thesis: verum end; begin definition let G be Graph; let p be Path of G; attrp is Eulerian means :Def14: :: GRAPH_3:def 14 rng p = the carrier' of G; end; :: deftheorem Def14 defines Eulerian GRAPH_3:def_14_:_ for G being Graph for p being Path of G holds ( p is Eulerian iff rng p = the carrier' of G ); theorem Th58: :: GRAPH_3:58 for G being connected Graph for p being Path of G for vs being FinSequence of the carrier of G st p is Eulerian & vs is_vertex_seq_of p holds rng vs = the carrier of G proof let G be connected Graph; ::_thesis: for p being Path of G for vs being FinSequence of the carrier of G st p is Eulerian & vs is_vertex_seq_of p holds rng vs = the carrier of G let p be Path of G; ::_thesis: for vs being FinSequence of the carrier of G st p is Eulerian & vs is_vertex_seq_of p holds rng vs = the carrier of G let vs be FinSequence of the carrier of G; ::_thesis: ( p is Eulerian & vs is_vertex_seq_of p implies rng vs = the carrier of G ) assume that A1: p is Eulerian and A2: vs is_vertex_seq_of p and A3: rng vs <> the carrier of G ; ::_thesis: contradiction consider x being set such that A4: ( ( x in rng vs & not x in the carrier of G ) or ( x in the carrier of G & not x in rng vs ) ) by A3, TARSKI:1; vs <> {} by A2, Th3; then consider y being set such that A5: y in rng vs by XBOOLE_0:def_1; A6: rng vs c= the carrier of G by FINSEQ_1:def_4; then consider c being Chain of G, vs1 being FinSequence of the carrier of G such that A7: not c is empty and A8: ( vs1 is_vertex_seq_of c & vs1 . 1 = x ) and vs1 . (len vs1) = y by A4, A5, Th18; A9: 1 <= len c by A7, NAT_1:14; A10: rng p = the carrier' of G by A1, Def14; reconsider c = c as FinSequence of the carrier' of G by MSSCYC_1:def_1; 1 in dom c by A9, FINSEQ_3:25; then c . 1 in the carrier' of G by PARTFUN1:4; then ( the Target of G . (c . 1) in rng vs & the Source of G . (c . 1) in rng vs ) by A2, A10, Th15; hence contradiction by A6, A4, A8, A9, Lm3; ::_thesis: verum end; theorem Th59: :: GRAPH_3:59 for G being connected finite Graph holds ( ex p being cyclic Path of G st p is Eulerian iff for v being Vertex of G holds Degree v is even ) proof let G be connected finite Graph; ::_thesis: ( ex p being cyclic Path of G st p is Eulerian iff for v being Vertex of G holds Degree v is even ) set E = the carrier' of G; hereby ::_thesis: ( ( for v being Vertex of G holds Degree v is even ) implies ex p being cyclic Path of G st p is Eulerian ) given c being cyclic Path of G such that A1: c is Eulerian ; ::_thesis: for v being Vertex of G holds Degree v is even let v be Vertex of G; ::_thesis: Degree v is even consider vs being FinSequence of the carrier of G such that A2: vs is_vertex_seq_of c and vs . 1 = vs . (len vs) by MSSCYC_1:def_2; rng vs = the carrier of G by A1, A2, Th58; then A3: Degree (v,(rng c)) is even by A2, Lm4; rng c = the carrier' of G by A1, Def14; hence Degree v is even by A3, Th24; ::_thesis: verum end; assume A4: for v being Vertex of G holds Degree v is even ; ::_thesis: ex p being cyclic Path of G st p is Eulerian percases ( G is void or not G is void ) ; supposeA5: G is void ; ::_thesis: ex p being cyclic Path of G st p is Eulerian {} is Element of G -CycleSet by Th51; then reconsider ec = {} as cyclic Path of G by Def8; take ec ; ::_thesis: ec is Eulerian the carrier' of G is empty by A5; hence rng ec = the carrier' of G ; :: according to GRAPH_3:def_14 ::_thesis: verum end; suppose not G is void ; ::_thesis: ex p being cyclic Path of G st p is Eulerian then reconsider G9 = G as non void connected finite Graph ; reconsider V = choose the carrier of G as Vertex of G9 ; deffunc H1( Nat, Element of G9 -CycleSet ) -> Element of G9 -CycleSet = ExtendCycle $2; choose ( the carrier' of G -CycleSet V) in the carrier' of G -CycleSet V ; then reconsider ec = choose ( the carrier' of G -CycleSet V) as Element of G9 -CycleSet ; consider f being Function of NAT,(G9 -CycleSet) such that A6: ( f . 0 = ec & ( for n being Nat holds f . (n + 1) = H1(n,f . n) ) ) from NAT_1:sch_12(); A7: now__::_thesis:_for_v_being_Vertex_of_G_holds_Degree_(v,_the_carrier'_of_G)_is_even let v be Vertex of G; ::_thesis: Degree (v, the carrier' of G) is even Degree v = Degree (v, the carrier' of G) by Th24; hence Degree (v, the carrier' of G) is even by A4; ::_thesis: verum end; Degree V = Degree (V, the carrier' of G) by Th24; then A8: Degree (V, the carrier' of G) <> 0 by Th33; now__::_thesis:_ex_n_being_Element_of_NAT_ex_c_being_Element_of_G9_-CycleSet_st_ (_c_=_f_._n_&_rng_c_=_the_carrier'_of_G_) defpred S1[ Element of NAT ] means ex c being Element of G9 -CycleSet st ( not c is empty & c = f . $1 & $1 <= card (rng c) ); reconsider E = the carrier' of G as finite set by GRAPH_1:def_11; assume A9: for n being Element of NAT for c being Element of G9 -CycleSet holds ( not c = f . n or not rng c = the carrier' of G ) ; ::_thesis: contradiction A10: for n being Element of NAT st S1[n] holds S1[n + 1] proof let n be Element of NAT ; ::_thesis: ( S1[n] implies S1[n + 1] ) given c being Element of G9 -CycleSet such that A11: not c is empty and A12: c = f . n and A13: n <= card (rng c) ; ::_thesis: S1[n + 1] reconsider r = ExtendCycle c as Element of G9 -CycleSet ; take r ; ::_thesis: ( not r is empty & r = f . (n + 1) & n + 1 <= card (rng r) ) rng c <> E by A9, A12; hence not r is empty by A4, A11, Th57; ::_thesis: ( r = f . (n + 1) & n + 1 <= card (rng r) ) thus r = f . (n + 1) by A6, A12; ::_thesis: n + 1 <= card (rng r) rng c <> E by A9, A12; then n < card (rng r) by A4, A11, A13, Th57, XXREAL_0:2; hence n + 1 <= card (rng r) by NAT_1:13; ::_thesis: verum end; A14: S1[ 0 ] proof take ec ; ::_thesis: ( not ec is empty & ec = f . 0 & 0 <= card (rng ec) ) thus not ec is empty by A7, A8, Th55; ::_thesis: ( ec = f . 0 & 0 <= card (rng ec) ) thus ec = f . 0 by A6; ::_thesis: 0 <= card (rng ec) thus 0 <= card (rng ec) ; ::_thesis: verum end; for n being Element of NAT holds S1[n] from NAT_1:sch_1(A14, A10); then consider c being Element of G -CycleSet such that not c is empty and c = f . ((card E) + 1) and A15: (card E) + 1 <= card (rng c) ; rng c c= E by FINSEQ_1:def_4; then card (rng c) <= card E by NAT_1:43; then (card E) + 1 <= (card E) + 0 by A15, XXREAL_0:2; hence contradiction by XREAL_1:6; ::_thesis: verum end; then consider n being Element of NAT , c being Element of G -CycleSet such that c = f . n and A16: rng c = the carrier' of G ; reconsider c = c as cyclic Path of G by Def8; take c ; ::_thesis: c is Eulerian thus rng c = the carrier' of G by A16; :: according to GRAPH_3:def_14 ::_thesis: verum end; end; end; theorem :: GRAPH_3:60 for G being connected finite Graph holds ( ex p being Path of G st ( not p is cyclic & p is Eulerian ) iff ex v1, v2 being Vertex of G st ( v1 <> v2 & ( for v being Vertex of G holds ( Degree v is even iff ( v <> v1 & v <> v2 ) ) ) ) ) proof let G be connected finite Graph; ::_thesis: ( ex p being Path of G st ( not p is cyclic & p is Eulerian ) iff ex v1, v2 being Vertex of G st ( v1 <> v2 & ( for v being Vertex of G holds ( Degree v is even iff ( v <> v1 & v <> v2 ) ) ) ) ) set V = the carrier of G; set E = the carrier' of G; A1: now__::_thesis:_not_{_the_carrier'_of_G}_meets_the_carrier'_of_G assume { the carrier' of G} meets the carrier' of G ; ::_thesis: contradiction then consider x being set such that A2: x in { the carrier' of G} and A3: x in the carrier' of G by XBOOLE_0:3; x = the carrier' of G by A2, TARSKI:def_1; hence contradiction by A3; ::_thesis: verum end; hereby ::_thesis: ( ex v1, v2 being Vertex of G st ( v1 <> v2 & ( for v being Vertex of G holds ( Degree v is even iff ( v <> v1 & v <> v2 ) ) ) ) implies ex p being Path of G st ( not p is cyclic & p is Eulerian ) ) given p being Path of G such that A4: not p is cyclic and A5: p is Eulerian ; ::_thesis: ex v1, v2 being Vertex of G st ( v1 <> v2 & ( for v being Vertex of G holds ( Degree v is even iff ( v <> v1 & v <> v2 ) ) ) ) consider vs being FinSequence of the carrier of G such that A6: vs is_vertex_seq_of p by GRAPH_2:33; len vs = (len p) + 1 by A6, GRAPH_2:def_6; then 1 <= len vs by NAT_1:11; then ( 1 in dom vs & len vs in dom vs ) by FINSEQ_3:25; then reconsider v1 = vs . 1, v2 = vs . (len vs) as Vertex of G by FINSEQ_2:11; take v1 = v1; ::_thesis: ex v2 being Vertex of G st ( v1 <> v2 & ( for v being Vertex of G holds ( Degree v is even iff ( v <> v1 & v <> v2 ) ) ) ) take v2 = v2; ::_thesis: ( v1 <> v2 & ( for v being Vertex of G holds ( Degree v is even iff ( v <> v1 & v <> v2 ) ) ) ) thus v1 <> v2 by A4, A6, MSSCYC_1:def_2; ::_thesis: for v being Vertex of G holds ( Degree v is even iff ( v <> v1 & v <> v2 ) ) let v be Vertex of G; ::_thesis: ( Degree v is even iff ( v <> v1 & v <> v2 ) ) Degree v = Degree (v, the carrier' of G) by Th24 .= Degree (v,(rng p)) by A5, Def14 ; hence ( Degree v is even iff ( v <> v1 & v <> v2 ) ) by A4, A6, Th50; ::_thesis: verum end; given v1, v2 being Vertex of G such that A7: v1 <> v2 and A8: for v being Vertex of G holds ( Degree v is even iff ( v <> v1 & v <> v2 ) ) ; ::_thesis: ex p being Path of G st ( not p is cyclic & p is Eulerian ) set G9 = AddNewEdge (v1,v2); set E9 = the carrier' of (AddNewEdge (v1,v2)); A9: the carrier' of (AddNewEdge (v1,v2)) = the carrier' of G \/ { the carrier' of G} by Def7; the carrier' of G in { the carrier' of G} by TARSKI:def_1; then A10: the carrier' of G in the carrier' of (AddNewEdge (v1,v2)) by A9, XBOOLE_0:def_3; A11: the carrier' of G = the carrier' of (AddNewEdge (v1,v2)) /\ the carrier' of G by A9, XBOOLE_1:21; for v being Vertex of (AddNewEdge (v1,v2)) holds Degree v is even proof let v9 be Vertex of (AddNewEdge (v1,v2)); ::_thesis: Degree v9 is even reconsider v = v9 as Vertex of G by Def7; A12: Degree v9 = Degree (v9, the carrier' of (AddNewEdge (v1,v2))) by Th24; A13: Degree (v, the carrier' of (AddNewEdge (v1,v2))) = Degree (v, the carrier' of G) by A11, Th31; percases ( ( v9 <> v1 & v9 <> v2 ) or v = v1 or v = v2 ) ; supposeA14: ( v9 <> v1 & v9 <> v2 ) ; ::_thesis: Degree v9 is even then Degree v9 = Degree (v, the carrier' of (AddNewEdge (v1,v2))) by A12, Th48 .= Degree v by A13, Th24 ; hence Degree v9 is even by A8, A14; ::_thesis: verum end; supposeA15: ( v = v1 or v = v2 ) ; ::_thesis: Degree v9 is even then reconsider dv = Degree v as odd Element of NAT by A8; A16: dv + 1 is even ; Degree v9 = (Degree (v, the carrier' of (AddNewEdge (v1,v2)))) + 1 by A7, A10, A12, A15, Th47 .= (Degree v) + 1 by A13, Th24 ; hence Degree v9 is even by A16; ::_thesis: verum end; end; end; then consider P9 being cyclic Path of AddNewEdge (v1,v2) such that A17: P9 is Eulerian by Th59; A18: rng P9 = the carrier' of (AddNewEdge (v1,v2)) by A17, Def14; then consider n being Nat such that A19: n in dom P9 and A20: P9 . n = the carrier' of G by A10, FINSEQ_2:10; consider p9 being cyclic Path of AddNewEdge (v1,v2) such that A21: p9 . 1 = P9 . n and A22: len p9 = len P9 and A23: rng p9 = rng P9 by A19, Th10; reconsider p = ((1 + 1),(len p9)) -cut p9 as Path of AddNewEdge (v1,v2) by Th5; consider vs9 being FinSequence of the carrier of (AddNewEdge (v1,v2)) such that A24: vs9 is_vertex_seq_of p9 by GRAPH_2:33; A25: now__::_thesis:_not_the_carrier'_of_G_in_rng_p assume the carrier' of G in rng p ; ::_thesis: contradiction then consider a being Nat such that A26: a in dom p and A27: p . a = the carrier' of G by FINSEQ_2:10; consider k being Element of NAT such that A28: k in dom p9 and A29: p9 . k = p . a and k + 1 = (1 + 1) + a and A30: 1 + 1 <= k and k <= len p9 by A26, Th2; 1 in dom p9 by A28, FINSEQ_5:6, RELAT_1:38; then k = 1 by A20, A21, A27, A28, A29, FUNCT_1:def_4; hence contradiction by A30; ::_thesis: verum end; A31: ( 1 <= n & n <= len P9 ) by A19, FINSEQ_3:25; then A32: 1 <= len P9 by XXREAL_0:2; then reconsider p1 = (1,1) -cut p9 as Chain of AddNewEdge (v1,v2) by A22, GRAPH_2:41; A33: p9 = p1 ^ (((1 + 1),(len p9)) -cut p9) by A31, A22, GRAPH_2:9, XXREAL_0:2; reconsider vs = ((1 + 1),(len vs9)) -cut vs9 as FinSequence of the carrier of (AddNewEdge (v1,v2)) ; A34: len vs9 = (len p9) + 1 by A24, GRAPH_2:def_6; now__::_thesis:_not_len_P9_=_1 consider c being Chain of G, vs being FinSequence of the carrier of G such that A35: not c is empty and vs is_vertex_seq_of c and vs . 1 = v1 and vs . (len vs) = v2 by A7, Th18; reconsider c = c as FinSequence of the carrier' of G by MSSCYC_1:def_1; 1 in dom c by A35, FINSEQ_5:6; then A36: ( rng c c= the carrier' of G & c . 1 in rng c ) by FINSEQ_1:def_4, FUNCT_1:def_3; then A37: c . 1 in the carrier' of G ; c . 1 in the carrier' of (AddNewEdge (v1,v2)) by A9, A36, XBOOLE_0:def_3; then consider m being Nat such that A38: m in dom P9 and A39: P9 . m = c . 1 by A18, FINSEQ_2:10; assume A40: len P9 = 1 ; ::_thesis: contradiction ( 1 <= m & m <= len P9 ) by A38, FINSEQ_3:25; then A41: m = 1 by A40, XXREAL_0:1; n = 1 by A31, A40, XXREAL_0:1; hence contradiction by A20, A37, A39, A41; ::_thesis: verum end; then 1 < len P9 by A32, XXREAL_0:1; then A42: 1 + 1 <= len P9 by NAT_1:13; then A43: vs is_vertex_seq_of p by A22, A24, A34, GRAPH_2:42; reconsider vs = vs as FinSequence of the carrier of G by Def7; reconsider p = p as Path of G by A25, Th45; take p ; ::_thesis: ( not p is cyclic & p is Eulerian ) A44: ( the Source of (AddNewEdge (v1,v2)) . the carrier' of G = v1 & the Target of (AddNewEdge (v1,v2)) . the carrier' of G = v2 ) by Th34; now__::_thesis:_not_vs_._1_=_vs_._(len_vs) 1 + 1 <= (len p9) + 1 by A42, A22, NAT_1:12; then A45: 1 + 1 <= (len vs9) + 1 by A34, NAT_1:12; then A46: (len vs) + (1 + 1) = (len p9) + (1 + 1) by A34, Lm1; then 0 + 1 <= len vs by A31, A22, XXREAL_0:2; then consider i being Element of NAT such that 0 <= i and A47: i < len vs and A48: len vs = i + 1 by GRAPH_2:1; ((len vs) + 1) + 1 = (len vs) + (1 + 1) .= (len vs9) + 1 by A45, Lm1 ; then A49: len vs9 = i + (1 + 1) by A48; A50: vs9 . 1 = vs9 . (len vs9) by A24, MSSCYC_1:6; A51: ( ( vs9 . 1 = v1 & vs9 . (1 + 1) = v2 ) or ( vs9 . 1 = v2 & vs9 . (1 + 1) = v1 ) ) by A44, A20, A32, A21, A22, A24, Lm3; assume A52: vs . 1 = vs . (len vs) ; ::_thesis: contradiction vs . (0 + 1) = vs9 . ((1 + 1) + 0) by A31, A22, A45, A46, Lm1; hence contradiction by A7, A52, A45, A47, A48, A49, A50, A51, Lm1; ::_thesis: verum end; hence not p is cyclic by A43, A25, Th46, MSSCYC_1:6; ::_thesis: p is Eulerian ( rng <* the carrier' of G*> = { the carrier' of G} & p1 = <* the carrier' of G*> ) by A20, A32, A21, A22, FINSEQ_1:39, GRAPH_2:6; then ( rng p9 = { the carrier' of G} \/ (rng p) & { the carrier' of G} misses rng p ) by A33, FINSEQ_1:31, FINSEQ_3:91; hence rng p = the carrier' of G by A9, A18, A23, A1, XBOOLE_1:72; :: according to GRAPH_3:def_14 ::_thesis: verum end;