:: GLIB_001 semantic presentation begin theorem Th1: :: GLIB_001:1 for x, y being odd Element of NAT holds ( x < y iff x + 2 <= y ) proof let x, y be odd Element of NAT ; ::_thesis: ( x < y iff x + 2 <= y ) hereby ::_thesis: ( x + 2 <= y implies x < y ) assume x < y ; ::_thesis: x + 2 <= y then x + 1 <= y by NAT_1:13; then x + 1 < y by XXREAL_0:1; then (x + 1) + 1 < y + 1 by XREAL_1:8; hence x + 2 <= y by NAT_1:13; ::_thesis: verum end; assume x + 2 <= y ; ::_thesis: x < y then (x + 2) - 2 < y - 0 by XREAL_1:15; hence x < y ; ::_thesis: verum end; theorem :: GLIB_001:2 canceled; theorem Th3: :: GLIB_001:3 for X being set for fs being FinSequence of X for fss being Subset of fs holds len (Seq fss) <= len fs proof let X be set ; ::_thesis: for fs being FinSequence of X for fss being Subset of fs holds len (Seq fss) <= len fs let fs be FinSequence of X; ::_thesis: for fss being Subset of fs holds len (Seq fss) <= len fs let fss be Subset of fs; ::_thesis: len (Seq fss) <= len fs A1: Seq fss = fss * (Sgm (dom fss)) by FINSEQ_1:def_14; dom fss c= dom fs by GRAPH_2:25; then A2: dom fss c= Seg (len fs) by FINSEQ_1:def_3; then rng (Sgm (dom fss)) = dom fss by FINSEQ_1:def_13; then len (Seq fss) = len (Sgm (dom fss)) by A1, FINSEQ_2:29 .= card (dom fss) by A2, FINSEQ_3:39 .= card fss by CARD_1:62 ; hence len (Seq fss) <= len fs by NAT_1:43; ::_thesis: verum end; theorem Th4: :: GLIB_001:4 for X being set for fs being FinSequence of X for fss being Subset of fs for m being Element of NAT st m in dom (Seq fss) holds ex n being Element of NAT st ( n in dom fs & m <= n & (Seq fss) . m = fs . n ) proof let X be set ; ::_thesis: for fs being FinSequence of X for fss being Subset of fs for m being Element of NAT st m in dom (Seq fss) holds ex n being Element of NAT st ( n in dom fs & m <= n & (Seq fss) . m = fs . n ) let fs be FinSequence of X; ::_thesis: for fss being Subset of fs for m being Element of NAT st m in dom (Seq fss) holds ex n being Element of NAT st ( n in dom fs & m <= n & (Seq fss) . m = fs . n ) let fss be Subset of fs; ::_thesis: for m being Element of NAT st m in dom (Seq fss) holds ex n being Element of NAT st ( n in dom fs & m <= n & (Seq fss) . m = fs . n ) let m be Element of NAT ; ::_thesis: ( m in dom (Seq fss) implies ex n being Element of NAT st ( n in dom fs & m <= n & (Seq fss) . m = fs . n ) ) set f = Sgm (dom fss); set n = (Sgm (dom fss)) . m; consider k being Nat such that A1: dom fss c= Seg k by FINSEQ_1:def_12; assume A2: m in dom (Seq fss) ; ::_thesis: ex n being Element of NAT st ( n in dom fs & m <= n & (Seq fss) . m = fs . n ) then A3: m in dom (fss * (Sgm (dom fss))) by FINSEQ_1:def_14; then A4: (Sgm (dom fss)) . m in dom fss by FUNCT_1:11; Seq fss = fss * (Sgm (dom fss)) by FINSEQ_1:def_14; then (Seq fss) . m = fss . ((Sgm (dom fss)) . m) by A2, FUNCT_1:12; then A5: [((Sgm (dom fss)) . m),((Seq fss) . m)] in fss by A4, FUNCT_1:def_2; then A6: (Sgm (dom fss)) . m in dom fs by FUNCT_1:1; A7: m in dom (Sgm (dom fss)) by A3, FUNCT_1:11; A8: (Seq fss) . m = fs . ((Sgm (dom fss)) . m) by A5, FUNCT_1:1; k in NAT by ORDINAL1:def_12; hence ex n being Element of NAT st ( n in dom fs & m <= n & (Seq fss) . m = fs . n ) by A7, A6, A8, A1, FINSEQ_3:152; ::_thesis: verum end; theorem Th5: :: GLIB_001:5 for X being set for fs being FinSequence of X for fss being Subset of fs holds len (Seq fss) = card fss proof let X be set ; ::_thesis: for fs being FinSequence of X for fss being Subset of fs holds len (Seq fss) = card fss let fs be FinSequence of X; ::_thesis: for fss being Subset of fs holds len (Seq fss) = card fss let fss be Subset of fs; ::_thesis: len (Seq fss) = card fss A1: Seq fss = fss * (Sgm (dom fss)) by FINSEQ_1:def_14; A2: ex k being Nat st dom fss c= Seg k by FINSEQ_1:def_12; then rng (Sgm (dom fss)) = dom fss by FINSEQ_1:def_13; then dom (Seq fss) = dom (Sgm (dom fss)) by A1, RELAT_1:27; then dom (Seq fss) = Seg (card (dom fss)) by A2, FINSEQ_3:40; then len (Seq fss) = card (dom fss) by FINSEQ_1:def_3; hence len (Seq fss) = card fss by CARD_1:62; ::_thesis: verum end; theorem Th6: :: GLIB_001:6 for X being set for fs being FinSequence of X for fss being Subset of fs holds dom (Seq fss) = dom (Sgm (dom fss)) proof let X be set ; ::_thesis: for fs being FinSequence of X for fss being Subset of fs holds dom (Seq fss) = dom (Sgm (dom fss)) let fs be FinSequence of X; ::_thesis: for fss being Subset of fs holds dom (Seq fss) = dom (Sgm (dom fss)) let fss be Subset of fs; ::_thesis: dom (Seq fss) = dom (Sgm (dom fss)) ex k being Nat st dom fss c= Seg k by FINSEQ_1:def_12; then A1: rng (Sgm (dom fss)) c= dom fss by FINSEQ_1:def_13; Seq fss = fss * (Sgm (dom fss)) by FINSEQ_1:def_14; hence dom (Seq fss) = dom (Sgm (dom fss)) by A1, RELAT_1:27; ::_thesis: verum end; begin definition let G be _Graph; mode VertexSeq of G -> FinSequence of the_Vertices_of G means :Def1: :: GLIB_001:def 1 for n being Element of NAT st 1 <= n & n < len it holds ex e being set st e Joins it . n,it . (n + 1),G; existence ex b1 being FinSequence of the_Vertices_of G st for n being Element of NAT st 1 <= n & n < len b1 holds ex e being set st e Joins b1 . n,b1 . (n + 1),G proof set v = choose (the_Vertices_of G); set IT = <*(choose (the_Vertices_of G))*>; reconsider IT = <*(choose (the_Vertices_of G))*> as FinSequence of the_Vertices_of G ; take IT ; ::_thesis: for n being Element of NAT st 1 <= n & n < len IT holds ex e being set st e Joins IT . n,IT . (n + 1),G let n be Element of NAT ; ::_thesis: ( 1 <= n & n < len IT implies ex e being set st e Joins IT . n,IT . (n + 1),G ) assume that A1: 1 <= n and A2: n < len IT ; ::_thesis: ex e being set st e Joins IT . n,IT . (n + 1),G thus ex e being set st e Joins IT . n,IT . (n + 1),G by A1, A2, FINSEQ_1:40; ::_thesis: verum end; end; :: deftheorem Def1 defines VertexSeq GLIB_001:def_1_:_ for G being _Graph for b2 being FinSequence of the_Vertices_of G holds ( b2 is VertexSeq of G iff for n being Element of NAT st 1 <= n & n < len b2 holds ex e being set st e Joins b2 . n,b2 . (n + 1),G ); definition let G be _Graph; mode EdgeSeq of G -> FinSequence of the_Edges_of G means :Def2: :: GLIB_001:def 2 ex vs being FinSequence of the_Vertices_of G st ( len vs = (len it) + 1 & ( for n being Element of NAT st 1 <= n & n <= len it holds it . n Joins vs . n,vs . (n + 1),G ) ); existence ex b1 being FinSequence of the_Edges_of G ex vs being FinSequence of the_Vertices_of G st ( len vs = (len b1) + 1 & ( for n being Element of NAT st 1 <= n & n <= len b1 holds b1 . n Joins vs . n,vs . (n + 1),G ) ) proof set IT = <*> (the_Edges_of G); set vs = <*(choose (the_Vertices_of G))*>; reconsider vs = <*(choose (the_Vertices_of G))*> as FinSequence of the_Vertices_of G ; take <*> (the_Edges_of G) ; ::_thesis: ex vs being FinSequence of the_Vertices_of G st ( len vs = (len (<*> (the_Edges_of G))) + 1 & ( for n being Element of NAT st 1 <= n & n <= len (<*> (the_Edges_of G)) holds (<*> (the_Edges_of G)) . n Joins vs . n,vs . (n + 1),G ) ) take vs ; ::_thesis: ( len vs = (len (<*> (the_Edges_of G))) + 1 & ( for n being Element of NAT st 1 <= n & n <= len (<*> (the_Edges_of G)) holds (<*> (the_Edges_of G)) . n Joins vs . n,vs . (n + 1),G ) ) thus len vs = (len (<*> (the_Edges_of G))) + 1 by FINSEQ_1:40; ::_thesis: for n being Element of NAT st 1 <= n & n <= len (<*> (the_Edges_of G)) holds (<*> (the_Edges_of G)) . n Joins vs . n,vs . (n + 1),G let n be Element of NAT ; ::_thesis: ( 1 <= n & n <= len (<*> (the_Edges_of G)) implies (<*> (the_Edges_of G)) . n Joins vs . n,vs . (n + 1),G ) assume that A1: 1 <= n and A2: n <= len (<*> (the_Edges_of G)) ; ::_thesis: (<*> (the_Edges_of G)) . n Joins vs . n,vs . (n + 1),G thus (<*> (the_Edges_of G)) . n Joins vs . n,vs . (n + 1),G by A1, A2; ::_thesis: verum end; end; :: deftheorem Def2 defines EdgeSeq GLIB_001:def_2_:_ for G being _Graph for b2 being FinSequence of the_Edges_of G holds ( b2 is EdgeSeq of G iff ex vs being FinSequence of the_Vertices_of G st ( len vs = (len b2) + 1 & ( for n being Element of NAT st 1 <= n & n <= len b2 holds b2 . n Joins vs . n,vs . (n + 1),G ) ) ); definition let G be _Graph; mode Walk of G -> FinSequence of (the_Vertices_of G) \/ (the_Edges_of G) means :Def3: :: GLIB_001:def 3 ( len it is odd & it . 1 in the_Vertices_of G & ( for n being odd Element of NAT st n < len it holds it . (n + 1) Joins it . n,it . (n + 2),G ) ); existence ex b1 being FinSequence of (the_Vertices_of G) \/ (the_Edges_of G) st ( len b1 is odd & b1 . 1 in the_Vertices_of G & ( for n being odd Element of NAT st n < len b1 holds b1 . (n + 1) Joins b1 . n,b1 . (n + 2),G ) ) proof set VE = (the_Vertices_of G) \/ (the_Edges_of G); consider v being set such that A1: v in the_Vertices_of G by XBOOLE_0:def_1; reconsider v = v as Element of (the_Vertices_of G) \/ (the_Edges_of G) by A1, XBOOLE_0:def_3; take <*v*> ; ::_thesis: ( len <*v*> is odd & <*v*> . 1 in the_Vertices_of G & ( for n being odd Element of NAT st n < len <*v*> holds <*v*> . (n + 1) Joins <*v*> . n,<*v*> . (n + 2),G ) ) thus len <*v*> is odd by FINSEQ_1:40, JORDAN12:2; ::_thesis: ( <*v*> . 1 in the_Vertices_of G & ( for n being odd Element of NAT st n < len <*v*> holds <*v*> . (n + 1) Joins <*v*> . n,<*v*> . (n + 2),G ) ) thus <*v*> . 1 in the_Vertices_of G by A1, FINSEQ_1:40; ::_thesis: for n being odd Element of NAT st n < len <*v*> holds <*v*> . (n + 1) Joins <*v*> . n,<*v*> . (n + 2),G let n be odd Element of NAT ; ::_thesis: ( n < len <*v*> implies <*v*> . (n + 1) Joins <*v*> . n,<*v*> . (n + 2),G ) assume n < len <*v*> ; ::_thesis: <*v*> . (n + 1) Joins <*v*> . n,<*v*> . (n + 2),G then n < 1 by FINSEQ_1:40; hence <*v*> . (n + 1) Joins <*v*> . n,<*v*> . (n + 2),G by ABIAN:12; ::_thesis: verum end; end; :: deftheorem Def3 defines Walk GLIB_001:def_3_:_ for G being _Graph for b2 being FinSequence of (the_Vertices_of G) \/ (the_Edges_of G) holds ( b2 is Walk of G iff ( len b2 is odd & b2 . 1 in the_Vertices_of G & ( for n being odd Element of NAT st n < len b2 holds b2 . (n + 1) Joins b2 . n,b2 . (n + 2),G ) ) ); registration let G be _Graph; let W be Walk of G; cluster card W -> non empty odd ; correctness coherence ( not len W is even & not len W is empty ); proof thus len W is odd by Def3; ::_thesis: not len W is empty hence not len W is empty ; ::_thesis: verum end; end; definition let G be _Graph; let v be Vertex of G; funcG .walkOf v -> Walk of G equals :: GLIB_001:def 4 <*v*>; coherence <*v*> is Walk of G proof set VE = (the_Vertices_of G) \/ (the_Edges_of G); set W = <*v*>; set v9 = v; reconsider v9 = v as Element of (the_Vertices_of G) \/ (the_Edges_of G) by XBOOLE_0:def_3; <*v9*> is FinSequence of (the_Vertices_of G) \/ (the_Edges_of G) ; then reconsider W = <*v*> as FinSequence of (the_Vertices_of G) \/ (the_Edges_of G) ; now__::_thesis:_(_len_W_is_odd_&_W_._1_in_the_Vertices_of_G_&_(_for_n_being_odd_Element_of_NAT_st_n_<_len_<*v*>_holds_ W_._(n_+_1)_Joins_W_._n,W_._(n_+_2),G_)_) thus len W is odd by FINSEQ_1:40, JORDAN12:2; ::_thesis: ( W . 1 in the_Vertices_of G & ( for n being odd Element of NAT st n < len <*v*> holds W . (n + 1) Joins W . n,W . (n + 2),G ) ) W . 1 = v by FINSEQ_1:40; hence W . 1 in the_Vertices_of G ; ::_thesis: for n being odd Element of NAT st n < len <*v*> holds W . (n + 1) Joins W . n,W . (n + 2),G let n be odd Element of NAT ; ::_thesis: ( n < len <*v*> implies W . (n + 1) Joins W . n,W . (n + 2),G ) A1: 1 <= n by ABIAN:12; assume n < len <*v*> ; ::_thesis: W . (n + 1) Joins W . n,W . (n + 2),G hence W . (n + 1) Joins W . n,W . (n + 2),G by A1, FINSEQ_1:40; ::_thesis: verum end; hence <*v*> is Walk of G by Def3; ::_thesis: verum end; end; :: deftheorem defines .walkOf GLIB_001:def_4_:_ for G being _Graph for v being Vertex of G holds G .walkOf v = <*v*>; definition let G be _Graph; let x, y, e be set ; funcG .walkOf (x,e,y) -> Walk of G equals :Def5: :: GLIB_001:def 5 <*x,e,y*> if e Joins x,y,G otherwise G .walkOf (choose (the_Vertices_of G)); coherence ( ( e Joins x,y,G implies <*x,e,y*> is Walk of G ) & ( not e Joins x,y,G implies G .walkOf (choose (the_Vertices_of G)) is Walk of G ) ) proof set VE = (the_Vertices_of G) \/ (the_Edges_of G); hereby ::_thesis: ( not e Joins x,y,G implies G .walkOf (choose (the_Vertices_of G)) is Walk of G ) set W = <*x,e,y*>; assume A1: e Joins x,y,G ; ::_thesis: <*x,e,y*> is Walk of G then y is Vertex of G by GLIB_000:13; then A2: y is Element of (the_Vertices_of G) \/ (the_Edges_of G) by XBOOLE_0:def_3; e in the_Edges_of G by A1, GLIB_000:def_13; then A3: e is Element of (the_Vertices_of G) \/ (the_Edges_of G) by XBOOLE_0:def_3; x is Vertex of G by A1, GLIB_000:13; then x is Element of (the_Vertices_of G) \/ (the_Edges_of G) by XBOOLE_0:def_3; then reconsider W = <*x,e,y*> as FinSequence of (the_Vertices_of G) \/ (the_Edges_of G) by A2, A3, FINSEQ_2:14; A4: W . 1 = x by FINSEQ_1:45; A5: W . 2 = e by FINSEQ_1:45; now__::_thesis:_(_len_W_is_odd_&_W_._1_in_the_Vertices_of_G_&_(_for_n_being_odd_Element_of_NAT_st_n_<_len_W_holds_ W_._(n_+_1)_Joins_W_._n,W_._(n_+_2),G_)_) reconsider aa1 = 1 as odd Element of NAT by JORDAN12:2; aa1 + 2 is odd ; hence len W is odd by FINSEQ_1:45; ::_thesis: ( W . 1 in the_Vertices_of G & ( for n being odd Element of NAT st n < len W holds W . (n + 1) Joins W . n,W . (n + 2),G ) ) thus W . 1 in the_Vertices_of G by A1, A4, GLIB_000:13; ::_thesis: for n being odd Element of NAT st n < len W holds W . (n + 1) Joins W . n,W . (n + 2),G let n be odd Element of NAT ; ::_thesis: ( n < len W implies W . (n + 1) Joins W . n,W . (n + 2),G ) assume n < len W ; ::_thesis: W . (n + 1) Joins W . n,W . (n + 2),G then n < 2 + 1 by FINSEQ_1:45; then n <= 2 * 1 by NAT_1:13; then ( n = 2 * 0 or n = 1 or n = 2 * 1 ) by NAT_1:26; hence W . (n + 1) Joins W . n,W . (n + 2),G by A1, A4, A5, FINSEQ_1:45; ::_thesis: verum end; hence <*x,e,y*> is Walk of G by Def3; ::_thesis: verum end; thus ( not e Joins x,y,G implies G .walkOf (choose (the_Vertices_of G)) is Walk of G ) ; ::_thesis: verum end; consistency for b1 being Walk of G holds verum ; end; :: deftheorem Def5 defines .walkOf GLIB_001:def_5_:_ for G being _Graph for x, y, e being set holds ( ( e Joins x,y,G implies G .walkOf (x,e,y) = <*x,e,y*> ) & ( not e Joins x,y,G implies G .walkOf (x,e,y) = G .walkOf (choose (the_Vertices_of G)) ) ); definition let G be _Graph; let W be Walk of G; funcW .first() -> Vertex of G equals :: GLIB_001:def 6 W . 1; coherence W . 1 is Vertex of G by Def3; funcW .last() -> Vertex of G equals :: GLIB_001:def 7 W . (len W); coherence W . (len W) is Vertex of G proof now__::_thesis:_W_._(len_W)_is_Vertex_of_G percases ( len W = 1 or len W <> 1 ) ; suppose len W = 1 ; ::_thesis: W . (len W) is Vertex of G hence W . (len W) is Vertex of G by Def3; ::_thesis: verum end; supposeA1: len W <> 1 ; ::_thesis: W . (len W) is Vertex of G 1 <= len W by ABIAN:12; then 1 < len W by A1, XXREAL_0:1; then 1 + 1 < (len W) + 1 by XREAL_1:8; then 2 <= len W by NAT_1:13; then reconsider n = (len W) - (2 * 1) as odd Element of NAT by INT_1:5; A2: n + 2 = len W ; then n < len W by NAT_1:16; then W . (n + 1) Joins W . n,W . (len W),G by A2, Def3; hence W . (len W) is Vertex of G by GLIB_000:13; ::_thesis: verum end; end; end; hence W . (len W) is Vertex of G ; ::_thesis: verum end; end; :: deftheorem defines .first() GLIB_001:def_6_:_ for G being _Graph for W being Walk of G holds W .first() = W . 1; :: deftheorem defines .last() GLIB_001:def_7_:_ for G being _Graph for W being Walk of G holds W .last() = W . (len W); definition let G be _Graph; let W be Walk of G; let n be Nat; funcW .vertexAt n -> Vertex of G equals :Def8: :: GLIB_001:def 8 W . n if ( n is odd & n <= len W ) otherwise W .first() ; correctness coherence ( ( n is odd & n <= len W implies W . n is Vertex of G ) & ( ( not n is odd or not n <= len W ) implies W .first() is Vertex of G ) ); consistency for b1 being Vertex of G holds verum; proof hereby ::_thesis: ( ( ( not n is odd or not n <= len W ) implies W .first() is Vertex of G ) & ( for b1 being Vertex of G holds verum ) ) reconsider n1 = n as Element of NAT by ORDINAL1:def_12; assume that A1: n is odd and A2: n <= len W ; ::_thesis: W . n is Vertex of G now__::_thesis:_W_._n_is_Vertex_of_G percases ( n = len W or n <> len W ) ; suppose n = len W ; ::_thesis: W . n is Vertex of G then W . n = W .last() ; hence W . n is Vertex of G ; ::_thesis: verum end; suppose n <> len W ; ::_thesis: W . n is Vertex of G then n < len W by A2, XXREAL_0:1; then W . (n1 + 1) Joins W . n,W . (n + 2),G by A1, Def3; hence W . n is Vertex of G by GLIB_000:13; ::_thesis: verum end; end; end; hence W . n is Vertex of G ; ::_thesis: verum end; thus ( ( ( not n is odd or not n <= len W ) implies W .first() is Vertex of G ) & ( for b1 being Vertex of G holds verum ) ) ; ::_thesis: verum end; end; :: deftheorem Def8 defines .vertexAt GLIB_001:def_8_:_ for G being _Graph for W being Walk of G for n being Nat holds ( ( n is odd & n <= len W implies W .vertexAt n = W . n ) & ( ( not n is odd or not n <= len W ) implies W .vertexAt n = W .first() ) ); definition let G be _Graph; let W be Walk of G; funcW .reverse() -> Walk of G equals :: GLIB_001:def 9 Rev W; coherence Rev W is Walk of G proof set W9 = Rev W; reconsider W9 = Rev W as FinSequence of (the_Vertices_of G) \/ (the_Edges_of G) ; A1: len W9 = len W by FINSEQ_5:def_3; now__::_thesis:_(_len_W9_is_odd_&_W9_._1_in_the_Vertices_of_G_&_(_for_n_being_odd_Element_of_NAT_st_n_<_len_W9_holds_ W9_._(n_+_1)_Joins_W9_._n,W9_._(n_+_2),G_)_) thus len W9 is odd by A1; ::_thesis: ( W9 . 1 in the_Vertices_of G & ( for n being odd Element of NAT st n < len W9 holds W9 . (n + 1) Joins W9 . n,W9 . (n + 2),G ) ) W9 . 1 = W .last() by FINSEQ_5:62; hence W9 . 1 in the_Vertices_of G ; ::_thesis: for n being odd Element of NAT st n < len W9 holds W9 . (n + 1) Joins W9 . n,W9 . (n + 2),G let n be odd Element of NAT ; ::_thesis: ( n < len W9 implies W9 . (n + 1) Joins W9 . n,W9 . (n + 2),G ) set rn = ((len W) - n) + 1; set rnaa1 = ((len W) - (n + 1)) + 1; set rn2 = ((len W) - (n + 2)) + 1; assume A2: n < len W9 ; ::_thesis: W9 . (n + 1) Joins W9 . n,W9 . (n + 2),G then A3: n + 1 <= len W by A1, NAT_1:13; then reconsider rnaa1 = ((len W) - (n + 1)) + 1 as even Element of NAT by FINSEQ_5:1; n + 1 < len W by A3, XXREAL_0:1; then A4: (n + 1) + 1 <= len W by NAT_1:13; then reconsider rn2 = ((len W) - (n + 2)) + 1 as odd Element of NAT by FINSEQ_5:1; 1 <= n + 1 by NAT_1:12; then n + 1 in dom W by A3, FINSEQ_3:25; then A5: W9 . (n + 1) = W . rnaa1 by FINSEQ_5:58 .= W . (rn2 + 1) ; A6: n <= len W by A2, FINSEQ_5:def_3; then reconsider rn = ((len W) - n) + 1 as odd Element of NAT by FINSEQ_5:1; 1 <= n by ABIAN:12; then n in dom W by A6, FINSEQ_3:25; then A7: W9 . n = W . rn by FINSEQ_5:58 .= W . (rn2 + 2) ; 1 + 0 < n + 2 by XREAL_1:8; then (len W) - (n + 2) < (len W) - 1 by XREAL_1:15; then ((len W) - (n + 2)) + 1 < ((len W) - 1) + 1 by XREAL_1:8; then A8: W . (rn2 + 1) Joins W . rn2,W . (rn2 + 2),G by Def3; 1 <= n + 2 by NAT_1:12; then n + 2 in dom W by A4, FINSEQ_3:25; then W9 . (n + 1) Joins W9 . (n + 2),W9 . n,G by A8, A7, A5, FINSEQ_5:58; hence W9 . (n + 1) Joins W9 . n,W9 . (n + 2),G by GLIB_000:14; ::_thesis: verum end; hence Rev W is Walk of G by Def3; ::_thesis: verum end; involutiveness for b1, b2 being Walk of G st b1 = Rev b2 holds b2 = Rev b1 ; end; :: deftheorem defines .reverse() GLIB_001:def_9_:_ for G being _Graph for W being Walk of G holds W .reverse() = Rev W; definition let G be _Graph; let W1, W2 be Walk of G; funcW1 .append W2 -> Walk of G equals :Def10: :: GLIB_001:def 10 W1 ^' W2 if W1 .last() = W2 .first() otherwise W1; correctness coherence ( ( W1 .last() = W2 .first() implies W1 ^' W2 is Walk of G ) & ( not W1 .last() = W2 .first() implies W1 is Walk of G ) ); consistency for b1 being Walk of G holds verum; proof set W = W1 ^' W2; set lenW = len (W1 ^' W2); hereby ::_thesis: ( ( not W1 .last() = W2 .first() implies W1 is Walk of G ) & ( for b1 being Walk of G holds verum ) ) assume A1: W1 .last() = W2 .first() ; ::_thesis: W1 ^' W2 is Walk of G A2: now__::_thesis:_for_n_being_odd_Element_of_NAT_st_n_<_len_(W1_^'_W2)_holds_ (W1_^'_W2)_._(n_+_1)_Joins_(W1_^'_W2)_._n,(W1_^'_W2)_._(n_+_2),G let n be odd Element of NAT ; ::_thesis: ( n < len (W1 ^' W2) implies (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G ) assume A3: n < len (W1 ^' W2) ; ::_thesis: (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G set v1 = (W1 ^' W2) . n; set v2 = (W1 ^' W2) . (n + 2); set e = (W1 ^' W2) . (n + 1); now__::_thesis:_(W1_^'_W2)_._(n_+_1)_Joins_(W1_^'_W2)_._n,(W1_^'_W2)_._(n_+_2),G percases ( n + 2 <= len W1 or len W1 < n + 2 ) ; supposeA4: n + 2 <= len W1 ; ::_thesis: (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G A5: 1 <= n by ABIAN:12; (n + 2) - 2 <= (len W1) - 0 by A4, XREAL_1:13; then A6: (W1 ^' W2) . n = W1 . n by A5, GRAPH_2:14; (n + 2) - 1 <= (len W1) - 0 by A4, XREAL_1:13; then A7: (W1 ^' W2) . (n + 1) = W1 . (n + 1) by GRAPH_2:14, NAT_1:12; A8: (W1 ^' W2) . (n + 2) = W1 . (n + 2) by A4, GRAPH_2:14, NAT_1:12; n < len W1 by A4, NAT_1:16, XXREAL_0:2; hence (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G by A6, A7, A8, Def3; ::_thesis: verum end; supposeA9: len W1 < n + 2 ; ::_thesis: (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G then (len W1) + 1 <= n + 2 by NAT_1:13; then (len W1) + 1 < (n + 1) + 1 by XXREAL_0:1; then len W1 < n + 1 by XREAL_1:6; then A10: len W1 <= n by NAT_1:13; consider k being Nat such that A11: n + 2 = (len W1) + k by A9, NAT_1:10; reconsider k = k as even Element of NAT by A11, ORDINAL1:def_12; k <> 0 by A9, A11; then 0 + 1 < k + 1 by XREAL_1:8; then A12: 1 <= k by NAT_1:13; n + 1 < (len (W1 ^' W2)) + 1 by A3, XREAL_1:8; then n + 1 < (len W1) + (len W2) by CARD_1:27, GRAPH_2:13; then (n + 1) + 1 < ((len W1) + (len W2)) + 1 by XREAL_1:8; then A13: k + (len W1) < (len W1) + ((len W2) + 1) by A11; then k < (len W2) + 1 by XREAL_1:6; then A14: k <= len W2 by NAT_1:13; then A15: k < len W2 by XXREAL_0:1; then A16: (W1 ^' W2) . (n + 2) = W2 . (k + 1) by A11, A12, GRAPH_2:15; now__::_thesis:_(W1_^'_W2)_._(n_+_1)_Joins_(W1_^'_W2)_._n,(W1_^'_W2)_._(n_+_2),G percases ( n = len W1 or len W1 <> n ) ; supposeA17: n = len W1 ; ::_thesis: (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G 1 <= n by ABIAN:12; then A18: (W1 ^' W2) . n = W1 . (len W1) by A17, GRAPH_2:14; (1 + 1) + 0 < (len W2) + 1 by A11, A13, A17, XREAL_1:6; then A19: 1 < len W2 by XREAL_1:6; then (W1 ^' W2) . (n + 1) = W2 . (1 + 1) by A17, GRAPH_2:15; hence (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G by A1, A11, A16, A17, A18, A19, Def3, JORDAN12:2; ::_thesis: verum end; supposeA20: len W1 <> n ; ::_thesis: (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G reconsider two = 2 * 1 as even Element of NAT ; A21: len W1 < n by A10, A20, XXREAL_0:1; then reconsider k2 = k - two as even Element of NAT by A11, INT_1:5, XREAL_1:8; (2 + (len W1)) - (len W1) < (k + (len W1)) - (len W1) by A11, A21, XREAL_1:8; then (1 + 1) - 1 < ((k2 + 1) + 1) - 1 by XREAL_1:14; then A22: 1 <= k2 by NAT_1:13; set kaa1 = k2 + 1; reconsider kaa1 = k2 + 1 as odd Element of NAT ; A23: 1 <= k2 + 1 by NAT_1:12; (kaa1 + 1) - 1 < (len W2) - 0 by A14, XREAL_1:15; then A24: W2 . (kaa1 + 1) = (W1 ^' W2) . ((len W1) + kaa1) by A23, GRAPH_2:15 .= (W1 ^' W2) . (n + 1) by A11 ; kaa1 < kaa1 + 1 by NAT_1:19; then A25: kaa1 < len W2 by A14, XXREAL_0:2; kaa1 + 2 = k + 1 ; then A26: W2 . (kaa1 + 2) = (W1 ^' W2) . (n + 2) by A11, A12, A15, GRAPH_2:15; k2 < k2 + (1 + 1) by NAT_1:16; then A27: k2 < len W2 by A14, XXREAL_0:2; n + 2 = ((len W1) + k2) + 2 by A11; then (W1 ^' W2) . n = W2 . (k2 + 1) by A22, A27, GRAPH_2:15; hence (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G by A26, A25, A24, Def3; ::_thesis: verum end; end; end; hence (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G ; ::_thesis: verum end; end; end; hence (W1 ^' W2) . (n + 1) Joins (W1 ^' W2) . n,(W1 ^' W2) . (n + 2),G ; ::_thesis: verum end; A28: now__::_thesis:_not_len_(W1_^'_W2)_is_even assume len (W1 ^' W2) is even ; ::_thesis: contradiction then reconsider lenW = len (W1 ^' W2) as even Element of NAT ; lenW + 1 = (len W1) + (len W2) by CARD_1:27, GRAPH_2:13; hence contradiction ; ::_thesis: verum end; 1 <= len W1 by ABIAN:12; then (W1 ^' W2) . 1 = W1 .first() by GRAPH_2:14; hence W1 ^' W2 is Walk of G by A28, A2, Def3; ::_thesis: verum end; thus ( ( not W1 .last() = W2 .first() implies W1 is Walk of G ) & ( for b1 being Walk of G holds verum ) ) ; ::_thesis: verum end; end; :: deftheorem Def10 defines .append GLIB_001:def_10_:_ for G being _Graph for W1, W2 being Walk of G holds ( ( W1 .last() = W2 .first() implies W1 .append W2 = W1 ^' W2 ) & ( not W1 .last() = W2 .first() implies W1 .append W2 = W1 ) ); definition let G be _Graph; let W be Walk of G; let m, n be Nat; funcW .cut (m,n) -> Walk of G equals :Def11: :: GLIB_001:def 11 (m,n) -cut W if ( m is odd & n is odd & m <= n & n <= len W ) otherwise W; correctness coherence ( ( m is odd & n is odd & m <= n & n <= len W implies (m,n) -cut W is Walk of G ) & ( ( not m is odd or not n is odd or not m <= n or not n <= len W ) implies W is Walk of G ) ); consistency for b1 being Walk of G holds verum; proof hereby ::_thesis: ( ( ( not m is odd or not n is odd or not m <= n or not n <= len W ) implies W is Walk of G ) & ( for b1 being Walk of G holds verum ) ) set W2 = (m,n) -cut W; set VG = the_Vertices_of G; assume that A1: m is odd and A2: n is odd and A3: m <= n and A4: n <= len W ; ::_thesis: (m,n) -cut W is Walk of G reconsider m4 = m, n4 = n as odd Nat by A1, A2; A5: 1 <= m by A1, ABIAN:12; then ((len ((m,n) -cut W)) + m4) - m4 = (n4 + 1) - m4 by A3, A4, GRAPH_2:def_1; then reconsider lenW2 = len ((m,n) -cut W) as odd Element of NAT ; now__::_thesis:_(_len_((m,n)_-cut_W)_is_odd_&_((m,n)_-cut_W)_._1_in_the_Vertices_of_G_&_(_for_i_being_odd_Element_of_NAT_st_i_<_len_((m,n)_-cut_W)_holds_ ((m,n)_-cut_W)_._(i_+_1)_Joins_((m,n)_-cut_W)_._i,((m,n)_-cut_W)_._(i_+_2),G_)_) reconsider lenW2aa1 = lenW2 - 1 as Element of NAT by ABIAN:12, INT_1:5; lenW2 is odd ; hence len ((m,n) -cut W) is odd ; ::_thesis: ( ((m,n) -cut W) . 1 in the_Vertices_of G & ( for i being odd Element of NAT st i < len ((m,n) -cut W) holds ((m,n) -cut W) . (i + 1) Joins ((m,n) -cut W) . i,((m,n) -cut W) . (i + 2),G ) ) 0 < lenW2aa1 + 1 ; then A6: ((m,n) -cut W) . (0 + 1) = W . (m + 0) by A3, A4, A5, GRAPH_2:def_1; m <= len W by A3, A4, XXREAL_0:2; then W . m = W .vertexAt m by A1, Def8; hence ((m,n) -cut W) . 1 in the_Vertices_of G by A6; ::_thesis: for i being odd Element of NAT st i < len ((m,n) -cut W) holds ((m,n) -cut W) . (i + 1) Joins ((m,n) -cut W) . i,((m,n) -cut W) . (i + 2),G let i be odd Element of NAT ; ::_thesis: ( i < len ((m,n) -cut W) implies ((m,n) -cut W) . (i + 1) Joins ((m,n) -cut W) . i,((m,n) -cut W) . (i + 2),G ) reconsider x = (m4 + i) - 1 as odd Element of NAT by A5, INT_1:5, NAT_1:12; reconsider iaa1 = i - 1 as even Element of NAT by ABIAN:12, INT_1:5; assume A7: i < len ((m,n) -cut W) ; ::_thesis: ((m,n) -cut W) . (i + 1) Joins ((m,n) -cut W) . i,((m,n) -cut W) . (i + 2),G then i + 1 <= lenW2 by NAT_1:13; then i + 1 < len ((m,n) -cut W) by XXREAL_0:1; then A8: ((m,n) -cut W) . ((i + 1) + 1) = W . (m + (i + 1)) by A3, A4, A5, GRAPH_2:def_1; i + m < (len ((m,n) -cut W)) + m by A7, XREAL_1:8; then i + m < n + 1 by A3, A4, A5, GRAPH_2:def_1; then i + m4 <= n4 by NAT_1:13; then m4 + i < n4 by XXREAL_0:1; then m + i < len W by A4, XXREAL_0:2; then (m + i) - 1 < (len W) - 0 by XREAL_1:14; then A9: W . (x + 1) Joins W . x,W . (x + 2),G by Def3; iaa1 < (len ((m,n) -cut W)) - 0 by A7, XREAL_1:14; then ((m,n) -cut W) . (iaa1 + 1) = W . (m + iaa1) by A3, A4, A5, GRAPH_2:def_1; hence ((m,n) -cut W) . (i + 1) Joins ((m,n) -cut W) . i,((m,n) -cut W) . (i + 2),G by A3, A4, A5, A7, A8, A9, GRAPH_2:def_1; ::_thesis: verum end; hence (m,n) -cut W is Walk of G by Def3; ::_thesis: verum end; thus ( ( ( not m is odd or not n is odd or not m <= n or not n <= len W ) implies W is Walk of G ) & ( for b1 being Walk of G holds verum ) ) ; ::_thesis: verum end; end; :: deftheorem Def11 defines .cut GLIB_001:def_11_:_ for G being _Graph for W being Walk of G for m, n being Nat holds ( ( m is odd & n is odd & m <= n & n <= len W implies W .cut (m,n) = (m,n) -cut W ) & ( ( not m is odd or not n is odd or not m <= n or not n <= len W ) implies W .cut (m,n) = W ) ); definition let G be _Graph; let W be Walk of G; let m, n be Element of NAT ; funcW .remove (m,n) -> Walk of G equals :Def12: :: GLIB_001:def 12 (W .cut (1,m)) .append (W .cut (n,(len W))) if ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) otherwise W; correctness coherence ( ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n implies (W .cut (1,m)) .append (W .cut (n,(len W))) is Walk of G ) & ( ( not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) implies W is Walk of G ) ); consistency for b1 being Walk of G holds verum; ; end; :: deftheorem Def12 defines .remove GLIB_001:def_12_:_ for G being _Graph for W being Walk of G for m, n being Element of NAT holds ( ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n implies W .remove (m,n) = (W .cut (1,m)) .append (W .cut (n,(len W))) ) & ( ( not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) implies W .remove (m,n) = W ) ); definition let G be _Graph; let W be Walk of G; let e be set ; funcW .addEdge e -> Walk of G equals :: GLIB_001:def 13 W .append (G .walkOf ((W .last()),e,((W .last()) .adj e))); coherence W .append (G .walkOf ((W .last()),e,((W .last()) .adj e))) is Walk of G ; end; :: deftheorem defines .addEdge GLIB_001:def_13_:_ for G being _Graph for W being Walk of G for e being set holds W .addEdge e = W .append (G .walkOf ((W .last()),e,((W .last()) .adj e))); definition let G be _Graph; let W be Walk of G; funcW .vertexSeq() -> VertexSeq of G means :Def14: :: GLIB_001:def 14 ( (len W) + 1 = 2 * (len it) & ( for n being Nat st 1 <= n & n <= len it holds it . n = W . ((2 * n) - 1) ) ); existence ex b1 being VertexSeq of G st ( (len W) + 1 = 2 * (len b1) & ( for n being Nat st 1 <= n & n <= len b1 holds b1 . n = W . ((2 * n) - 1) ) ) proof deffunc H1( Nat) -> set = W . ((2 * $1) - 1); reconsider lenW1 = (len W) + 1 as even Element of NAT ; set lenIT = lenW1 div 2; consider IT being FinSequence such that A1: ( len IT = lenW1 div 2 & ( for k being Nat st k in dom IT holds IT . k = H1(k) ) ) from FINSEQ_1:sch_2(); A2: 2 divides lenW1 by PEPIN:22; then A3: 2 * (lenW1 div 2) = lenW1 by NAT_D:3; now__::_thesis:_for_y_being_set_st_y_in_rng_IT_holds_ y_in_the_Vertices_of_G let y be set ; ::_thesis: ( y in rng IT implies y in the_Vertices_of G ) assume y in rng IT ; ::_thesis: y in the_Vertices_of G then consider x being set such that A4: x in dom IT and A5: y = IT . x by FUNCT_1:def_3; A6: x in Seg (lenW1 div 2) by A1, A4, FINSEQ_1:def_3; reconsider x = x as Element of NAT by A4; set 2x = x * 2; reconsider 2x = x * 2 as even Element of NAT ; set 2xaa1 = 2x - 1; 1 <= x by A6, FINSEQ_1:1; then 1 * 2 <= 2x by XREAL_1:64; then reconsider 2xaa1 = 2x - 1 as odd Element of NAT by INT_1:5, XXREAL_0:2; x <= lenW1 div 2 by A6, FINSEQ_1:1; then 2x <= (lenW1 div 2) * 2 by XREAL_1:64; then 2xaa1 <= lenW1 - 1 by A3, XREAL_1:9; then W . 2xaa1 = W .vertexAt 2xaa1 by Def8; then W . 2xaa1 in the_Vertices_of G ; hence y in the_Vertices_of G by A1, A4, A5; ::_thesis: verum end; then rng IT c= the_Vertices_of G by TARSKI:def_3; then reconsider IT = IT as FinSequence of the_Vertices_of G by FINSEQ_1:def_4; now__::_thesis:_for_n_being_Element_of_NAT_st_1_<=_n_&_n_<_len_IT_holds_ ex_e_being_set_st_e_Joins_IT_._n,IT_._(n_+_1),G let n be Element of NAT ; ::_thesis: ( 1 <= n & n < len IT implies ex e being set st e Joins IT . n,IT . (n + 1),G ) set v2 = IT . (n + 1); assume that A7: 1 <= n and A8: n < len IT ; ::_thesis: ex e being set st e Joins IT . n,IT . (n + 1),G set 2n = 2 * n; reconsider 2n = 2 * n as even Element of NAT ; A9: 1 <= n + 1 by A7, NAT_1:13; set 2naa1 = 2n - 1; 1 * 2 <= n * 2 by A7, XREAL_1:64; then reconsider 2naa1 = 2n - 1 as odd Element of NAT by INT_1:5, XXREAL_0:2; 2n <= lenW1 by A3, A1, A8, XREAL_1:68; then A10: 2n - 1 <= ((len W) + 1) - 1 by XREAL_1:9; 2naa1 <> len W by A3, A1, A8; then 2naa1 < len W by A10, XXREAL_0:1; then A11: W . (2naa1 + 1) Joins W . 2naa1,W . (2naa1 + 2),G by Def3; n + 1 <= lenW1 div 2 by A1, A8, NAT_1:13; then n + 1 in dom IT by A1, A9, FINSEQ_3:25; then A12: IT . (n + 1) = W . ((2 * (n + 1)) - 1) by A1 .= W . (2n + 1) ; n in dom IT by A7, A8, FINSEQ_3:25; then W . (2naa1 + 1) Joins IT . n,W . (2naa1 + 2),G by A1, A11; hence ex e being set st e Joins IT . n,IT . (n + 1),G by A12; ::_thesis: verum end; then reconsider IT = IT as VertexSeq of G by Def1; take IT ; ::_thesis: ( (len W) + 1 = 2 * (len IT) & ( for n being Nat st 1 <= n & n <= len IT holds IT . n = W . ((2 * n) - 1) ) ) thus (len W) + 1 = 2 * (len IT) by A2, A1, NAT_D:3; ::_thesis: for n being Nat st 1 <= n & n <= len IT holds IT . n = W . ((2 * n) - 1) let n be Nat; ::_thesis: ( 1 <= n & n <= len IT implies IT . n = W . ((2 * n) - 1) ) assume that A13: 1 <= n and A14: n <= len IT ; ::_thesis: IT . n = W . ((2 * n) - 1) n in dom IT by A13, A14, FINSEQ_3:25; hence IT . n = W . ((2 * n) - 1) by A1; ::_thesis: verum end; uniqueness for b1, b2 being VertexSeq of G st (len W) + 1 = 2 * (len b1) & ( for n being Nat st 1 <= n & n <= len b1 holds b1 . n = W . ((2 * n) - 1) ) & (len W) + 1 = 2 * (len b2) & ( for n being Nat st 1 <= n & n <= len b2 holds b2 . n = W . ((2 * n) - 1) ) holds b1 = b2 proof let IT1, IT2 be VertexSeq of G; ::_thesis: ( (len W) + 1 = 2 * (len IT1) & ( for n being Nat st 1 <= n & n <= len IT1 holds IT1 . n = W . ((2 * n) - 1) ) & (len W) + 1 = 2 * (len IT2) & ( for n being Nat st 1 <= n & n <= len IT2 holds IT2 . n = W . ((2 * n) - 1) ) implies IT1 = IT2 ) assume that A15: (len W) + 1 = 2 * (len IT1) and A16: for n being Nat st 1 <= n & n <= len IT1 holds IT1 . n = W . ((2 * n) - 1) and A17: (len W) + 1 = 2 * (len IT2) and A18: for n being Nat st 1 <= n & n <= len IT2 holds IT2 . n = W . ((2 * n) - 1) ; ::_thesis: IT1 = IT2 A19: now__::_thesis:_for_n_being_Nat_st_n_in_dom_IT1_holds_ IT1_._n_=_IT2_._n let n be Nat; ::_thesis: ( n in dom IT1 implies IT1 . n = IT2 . n ) assume A20: n in dom IT1 ; ::_thesis: IT1 . n = IT2 . n A21: n <= len IT1 by A20, FINSEQ_3:25; A22: 1 <= n by A20, FINSEQ_3:25; then IT1 . n = W . ((2 * n) - 1) by A16, A21; hence IT1 . n = IT2 . n by A15, A17, A18, A22, A21; ::_thesis: verum end; dom IT1 = Seg (len IT2) by A15, A17, FINSEQ_1:def_3 .= dom IT2 by FINSEQ_1:def_3 ; hence IT1 = IT2 by A19, FINSEQ_1:13; ::_thesis: verum end; end; :: deftheorem Def14 defines .vertexSeq() GLIB_001:def_14_:_ for G being _Graph for W being Walk of G for b3 being VertexSeq of G holds ( b3 = W .vertexSeq() iff ( (len W) + 1 = 2 * (len b3) & ( for n being Nat st 1 <= n & n <= len b3 holds b3 . n = W . ((2 * n) - 1) ) ) ); definition let G be _Graph; let W be Walk of G; funcW .edgeSeq() -> EdgeSeq of G means :Def15: :: GLIB_001:def 15 ( len W = (2 * (len it)) + 1 & ( for n being Nat st 1 <= n & n <= len it holds it . n = W . (2 * n) ) ); existence ex b1 being EdgeSeq of G st ( len W = (2 * (len b1)) + 1 & ( for n being Nat st 1 <= n & n <= len b1 holds b1 . n = W . (2 * n) ) ) proof deffunc H1( Nat) -> set = W . (2 * $1); reconsider lenWaa1 = (len W) - 1 as even Element of NAT by ABIAN:12, INT_1:5; set lenIT = lenWaa1 div 2; reconsider lenIT = lenWaa1 div 2 as Element of NAT ; consider IT being FinSequence such that A1: ( len IT = lenIT & ( for n being Nat st n in dom IT holds IT . n = H1(n) ) ) from FINSEQ_1:sch_2(); now__::_thesis:_for_y_being_set_st_y_in_rng_IT_holds_ y_in_the_Edges_of_G let y be set ; ::_thesis: ( y in rng IT implies y in the_Edges_of G ) A2: 2 divides lenWaa1 by PEPIN:22; assume y in rng IT ; ::_thesis: y in the_Edges_of G then consider x being set such that A3: x in dom IT and A4: y = IT . x by FUNCT_1:def_3; A5: x in Seg lenIT by A1, A3, FINSEQ_1:def_3; reconsider x = x as Element of NAT by A3; reconsider 2x = 2 * x as even Element of NAT ; x <= lenIT by A5, FINSEQ_1:1; then x * 2 <= lenIT * 2 by XREAL_1:64; then 2x <= lenWaa1 by A2, NAT_D:3; then A6: 2x + 1 <= lenWaa1 + 1 by XREAL_1:7; 1 <= x by A5, FINSEQ_1:1; then 1 * 2 <= 2 * x by XREAL_1:64; then reconsider 2xaa1 = 2x - 1 as odd Element of NAT by INT_1:5, XXREAL_0:2; 2x <= 2x + 1 by NAT_1:11; then 2x <= len W by A6, XXREAL_0:2; then 2xaa1 < len W by XREAL_1:147; then A7: W . (2xaa1 + 1) Joins W . 2xaa1,W . (2xaa1 + 2),G by Def3; y = W . (2 * x) by A1, A3, A4; hence y in the_Edges_of G by A7, GLIB_000:def_13; ::_thesis: verum end; then rng IT c= the_Edges_of G by TARSKI:def_3; then reconsider IT = IT as FinSequence of the_Edges_of G by FINSEQ_1:def_4; 2 divides lenWaa1 by PEPIN:22; then A8: lenWaa1 = 2 * lenIT by NAT_D:3; then A9: len W = (2 * lenIT) + 1 ; now__::_thesis:_ex_vs_being_VertexSeq_of_G_st_ (_len_vs_=_(len_IT)_+_1_&_(_for_n_being_Element_of_NAT_st_1_<=_n_&_n_<=_len_IT_holds_ IT_._n_Joins_vs_._n,vs_._(n_+_1),G_)_) set vs = W .vertexSeq() ; take vs = W .vertexSeq() ; ::_thesis: ( len vs = (len IT) + 1 & ( for n being Element of NAT st 1 <= n & n <= len IT holds IT . n Joins vs . n,vs . (n + 1),G ) ) A10: ((2 * (len IT)) + 1) + 1 = 2 * (len vs) by A8, A1, Def14; then A11: 2 * ((len IT) + 1) = 2 * (len vs) ; thus len vs = (len IT) + 1 by A10; ::_thesis: for n being Element of NAT st 1 <= n & n <= len IT holds IT . n Joins vs . n,vs . (n + 1),G let n be Element of NAT ; ::_thesis: ( 1 <= n & n <= len IT implies IT . n Joins vs . n,vs . (n + 1),G ) set v1 = vs . n; set v2 = vs . (n + 1); assume that A12: 1 <= n and A13: n <= len IT ; ::_thesis: IT . n Joins vs . n,vs . (n + 1),G set 2n = 2 * n; reconsider 2n = 2 * n as even Element of NAT ; set 2naa1 = 2n - 1; 1 <= n + n by A12, NAT_1:12; then reconsider 2naa1 = 2n - 1 as odd Element of NAT by INT_1:5; A14: 1 <= n + 1 by NAT_1:12; n * 2 <= (len IT) * 2 by A13, XREAL_1:64; then n * 2 <= len W by A9, A1, NAT_1:12; then A15: 2naa1 < (len W) - 0 by XREAL_1:15; n + 1 <= len vs by A11, A13, XREAL_1:7; then vs . (n + 1) = W . ((2 * (n + 1)) - 1) by A14, Def14; then A16: vs . (n + 1) = W . (2naa1 + 2) ; n in dom IT by A12, A13, FINSEQ_3:25; then A17: IT . n = W . (2naa1 + 1) by A1; n <= len vs by A11, A13, NAT_1:12; then vs . n = W . ((2 * n) - 1) by A12, Def14; hence IT . n Joins vs . n,vs . (n + 1),G by A17, A16, A15, Def3; ::_thesis: verum end; then reconsider IT = IT as EdgeSeq of G by Def2; take IT ; ::_thesis: ( len W = (2 * (len IT)) + 1 & ( for n being Nat st 1 <= n & n <= len IT holds IT . n = W . (2 * n) ) ) thus len W = (2 * (len IT)) + 1 by A8, A1; ::_thesis: for n being Nat st 1 <= n & n <= len IT holds IT . n = W . (2 * n) let n be Nat; ::_thesis: ( 1 <= n & n <= len IT implies IT . n = W . (2 * n) ) assume that A18: 1 <= n and A19: n <= len IT ; ::_thesis: IT . n = W . (2 * n) n in dom IT by A18, A19, FINSEQ_3:25; hence IT . n = W . (2 * n) by A1; ::_thesis: verum end; uniqueness for b1, b2 being EdgeSeq of G st len W = (2 * (len b1)) + 1 & ( for n being Nat st 1 <= n & n <= len b1 holds b1 . n = W . (2 * n) ) & len W = (2 * (len b2)) + 1 & ( for n being Nat st 1 <= n & n <= len b2 holds b2 . n = W . (2 * n) ) holds b1 = b2 proof let IT1, IT2 be EdgeSeq of G; ::_thesis: ( len W = (2 * (len IT1)) + 1 & ( for n being Nat st 1 <= n & n <= len IT1 holds IT1 . n = W . (2 * n) ) & len W = (2 * (len IT2)) + 1 & ( for n being Nat st 1 <= n & n <= len IT2 holds IT2 . n = W . (2 * n) ) implies IT1 = IT2 ) assume that A20: len W = (2 * (len IT1)) + 1 and A21: for n being Nat st 1 <= n & n <= len IT1 holds IT1 . n = W . (2 * n) and A22: len W = (2 * (len IT2)) + 1 and A23: for n being Nat st 1 <= n & n <= len IT2 holds IT2 . n = W . (2 * n) ; ::_thesis: IT1 = IT2 A24: now__::_thesis:_for_n_being_Nat_st_n_in_dom_IT1_holds_ IT1_._n_=_IT2_._n let n be Nat; ::_thesis: ( n in dom IT1 implies IT1 . n = IT2 . n ) assume A25: n in dom IT1 ; ::_thesis: IT1 . n = IT2 . n then A26: 1 <= n by FINSEQ_3:25; A27: n <= len IT2 by A20, A22, A25, FINSEQ_3:25; n <= len IT1 by A25, FINSEQ_3:25; hence IT1 . n = W . (2 * n) by A21, A26 .= IT2 . n by A23, A26, A27 ; ::_thesis: verum end; dom IT1 = Seg (len IT2) by A20, A22, FINSEQ_1:def_3 .= dom IT2 by FINSEQ_1:def_3 ; hence IT1 = IT2 by A24, FINSEQ_1:13; ::_thesis: verum end; end; :: deftheorem Def15 defines .edgeSeq() GLIB_001:def_15_:_ for G being _Graph for W being Walk of G for b3 being EdgeSeq of G holds ( b3 = W .edgeSeq() iff ( len W = (2 * (len b3)) + 1 & ( for n being Nat st 1 <= n & n <= len b3 holds b3 . n = W . (2 * n) ) ) ); definition let G be _Graph; let W be Walk of G; funcW .vertices() -> finite Subset of (the_Vertices_of G) equals :: GLIB_001:def 16 rng (W .vertexSeq()); coherence rng (W .vertexSeq()) is finite Subset of (the_Vertices_of G) ; end; :: deftheorem defines .vertices() GLIB_001:def_16_:_ for G being _Graph for W being Walk of G holds W .vertices() = rng (W .vertexSeq()); definition let G be _Graph; let W be Walk of G; funcW .edges() -> finite Subset of (the_Edges_of G) equals :: GLIB_001:def 17 rng (W .edgeSeq()); coherence rng (W .edgeSeq()) is finite Subset of (the_Edges_of G) ; end; :: deftheorem defines .edges() GLIB_001:def_17_:_ for G being _Graph for W being Walk of G holds W .edges() = rng (W .edgeSeq()); definition let G be _Graph; let W be Walk of G; funcW .length() -> Element of NAT equals :: GLIB_001:def 18 len (W .edgeSeq()); coherence len (W .edgeSeq()) is Element of NAT ; end; :: deftheorem defines .length() GLIB_001:def_18_:_ for G being _Graph for W being Walk of G holds W .length() = len (W .edgeSeq()); definition let G be _Graph; let W be Walk of G; let v be set ; funcW .find v -> odd Element of NAT means :Def19: :: GLIB_001:def 19 ( it <= len W & W . it = v & ( for n being odd Nat st n <= len W & W . n = v holds it <= n ) ) if v in W .vertices() otherwise it = len W; existence ( ( v in W .vertices() implies ex b1 being odd Element of NAT st ( b1 <= len W & W . b1 = v & ( for n being odd Nat st n <= len W & W . n = v holds b1 <= n ) ) ) & ( not v in W .vertices() implies ex b1 being odd Element of NAT st b1 = len W ) ) proof hereby ::_thesis: ( not v in W .vertices() implies ex b1 being odd Element of NAT st b1 = len W ) defpred S1[ Nat] means ( $1 is odd & $1 <= len W & W . $1 = v ); set vs = W .vertexSeq() ; assume A1: v in W .vertices() ; ::_thesis: ex IT being odd Element of NAT st ( IT <= len W & W . IT = v & ( for n being odd Nat st n <= len W & W . n = v holds IT <= n ) ) now__::_thesis:_ex_n_being_odd_Element_of_NAT_st_ (_n_<=_len_W_&_W_._n_=_v_) consider i being Nat such that A2: i in dom (W .vertexSeq()) and A3: (W .vertexSeq()) . i = v by A1, FINSEQ_2:10; set n1 = 2 * i; reconsider n1 = 2 * i as even Nat ; set n = n1 - 1; A4: 1 <= i by A2, FINSEQ_3:25; then 1 <= i + i by NAT_1:12; then reconsider n = n1 - 1 as odd Element of NAT by INT_1:5; take n = n; ::_thesis: ( n <= len W & W . n = v ) A5: i <= len (W .vertexSeq()) by A2, FINSEQ_3:25; then i * 2 <= (len (W .vertexSeq())) * 2 by XREAL_1:64; then i * 2 <= (len W) + 1 by Def14; then n1 - 1 <= ((len W) + 1) - 1 by XREAL_1:13; hence n <= len W ; ::_thesis: W . n = v thus W . n = v by A3, A4, A5, Def14; ::_thesis: verum end; then A6: ex k being Nat st S1[k] ; consider IT being Nat such that A7: ( S1[IT] & ( for n being Nat st S1[n] holds IT <= n ) ) from NAT_1:sch_5(A6); reconsider IT = IT as odd Element of NAT by A7, ORDINAL1:def_12; take IT = IT; ::_thesis: ( IT <= len W & W . IT = v & ( for n being odd Nat st n <= len W & W . n = v holds IT <= n ) ) thus ( IT <= len W & W . IT = v ) by A7; ::_thesis: for n being odd Nat st n <= len W & W . n = v holds IT <= n let n be odd Nat; ::_thesis: ( n <= len W & W . n = v implies IT <= n ) assume that A8: n <= len W and A9: W . n = v ; ::_thesis: IT <= n thus IT <= n by A7, A8, A9; ::_thesis: verum end; set IT = len W; assume not v in W .vertices() ; ::_thesis: ex b1 being odd Element of NAT st b1 = len W take len W ; ::_thesis: len W = len W thus len W = len W ; ::_thesis: verum end; uniqueness for b1, b2 being odd Element of NAT holds ( ( v in W .vertices() & b1 <= len W & W . b1 = v & ( for n being odd Nat st n <= len W & W . n = v holds b1 <= n ) & b2 <= len W & W . b2 = v & ( for n being odd Nat st n <= len W & W . n = v holds b2 <= n ) implies b1 = b2 ) & ( not v in W .vertices() & b1 = len W & b2 = len W implies b1 = b2 ) ) proof let IT1, IT2 be odd Element of NAT ; ::_thesis: ( ( v in W .vertices() & IT1 <= len W & W . IT1 = v & ( for n being odd Nat st n <= len W & W . n = v holds IT1 <= n ) & IT2 <= len W & W . IT2 = v & ( for n being odd Nat st n <= len W & W . n = v holds IT2 <= n ) implies IT1 = IT2 ) & ( not v in W .vertices() & IT1 = len W & IT2 = len W implies IT1 = IT2 ) ) hereby ::_thesis: ( not v in W .vertices() & IT1 = len W & IT2 = len W implies IT1 = IT2 ) assume v in W .vertices() ; ::_thesis: ( IT1 <= len W & W . IT1 = v & ( for n being odd Nat st n <= len W & W . n = v holds IT1 <= n ) & IT2 <= len W & W . IT2 = v & ( for n being odd Nat st n <= len W & W . n = v holds IT2 <= n ) implies IT1 = IT2 ) assume that A10: IT1 <= len W and A11: W . IT1 = v and A12: for n being odd Nat st n <= len W & W . n = v holds IT1 <= n ; ::_thesis: ( IT2 <= len W & W . IT2 = v & ( for n being odd Nat st n <= len W & W . n = v holds IT2 <= n ) implies IT1 = IT2 ) assume that A13: IT2 <= len W and A14: W . IT2 = v and A15: for n being odd Nat st n <= len W & W . n = v holds IT2 <= n ; ::_thesis: IT1 = IT2 A16: IT2 <= IT1 by A10, A11, A15; IT1 <= IT2 by A12, A13, A14; hence IT1 = IT2 by A16, XXREAL_0:1; ::_thesis: verum end; assume not v in W .vertices() ; ::_thesis: ( not IT1 = len W or not IT2 = len W or IT1 = IT2 ) thus ( not IT1 = len W or not IT2 = len W or IT1 = IT2 ) ; ::_thesis: verum end; consistency for b1 being odd Element of NAT holds verum ; end; :: deftheorem Def19 defines .find GLIB_001:def_19_:_ for G being _Graph for W being Walk of G for v being set for b4 being odd Element of NAT holds ( ( v in W .vertices() implies ( b4 = W .find v iff ( b4 <= len W & W . b4 = v & ( for n being odd Nat st n <= len W & W . n = v holds b4 <= n ) ) ) ) & ( not v in W .vertices() implies ( b4 = W .find v iff b4 = len W ) ) ); definition let G be _Graph; let W be Walk of G; let n be Element of NAT ; funcW .find n -> odd Element of NAT means :Def20: :: GLIB_001:def 20 ( it <= len W & W . it = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds it <= k ) ) if ( n is odd & n <= len W ) otherwise it = len W; existence ( ( n is odd & n <= len W implies ex b1 being odd Element of NAT st ( b1 <= len W & W . b1 = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds b1 <= k ) ) ) & ( ( not n is odd or not n <= len W ) implies ex b1 being odd Element of NAT st b1 = len W ) ) proof defpred S1[ Nat] means ( $1 is odd & $1 <= len W & W . $1 = W . n ); hereby ::_thesis: ( ( not n is odd or not n <= len W ) implies ex b1 being odd Element of NAT st b1 = len W ) assume that A1: n is odd and A2: n <= len W ; ::_thesis: ex IT being odd Element of NAT st ( IT <= len W & W . IT = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds IT <= k ) ) A3: ex n being Nat st S1[n] by A1, A2; consider IT being Nat such that A4: ( S1[IT] & ( for k being Nat st S1[k] holds IT <= k ) ) from NAT_1:sch_5(A3); reconsider IT = IT as odd Element of NAT by A4, ORDINAL1:def_12; take IT = IT; ::_thesis: ( IT <= len W & W . IT = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds IT <= k ) ) thus ( IT <= len W & W . IT = W . n ) by A4; ::_thesis: for k being odd Nat st k <= len W & W . k = W . n holds IT <= k let k be odd Nat; ::_thesis: ( k <= len W & W . k = W . n implies IT <= k ) thus ( k <= len W & W . k = W . n implies IT <= k ) by A4; ::_thesis: verum end; thus ( ( not n is odd or not n <= len W ) implies ex b1 being odd Element of NAT st b1 = len W ) ; ::_thesis: verum end; uniqueness for b1, b2 being odd Element of NAT holds ( ( n is odd & n <= len W & b1 <= len W & W . b1 = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds b1 <= k ) & b2 <= len W & W . b2 = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds b2 <= k ) implies b1 = b2 ) & ( ( not n is odd or not n <= len W ) & b1 = len W & b2 = len W implies b1 = b2 ) ) proof let IT1, IT2 be odd Element of NAT ; ::_thesis: ( ( n is odd & n <= len W & IT1 <= len W & W . IT1 = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds IT1 <= k ) & IT2 <= len W & W . IT2 = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds IT2 <= k ) implies IT1 = IT2 ) & ( ( not n is odd or not n <= len W ) & IT1 = len W & IT2 = len W implies IT1 = IT2 ) ) hereby ::_thesis: ( ( not n is odd or not n <= len W ) & IT1 = len W & IT2 = len W implies IT1 = IT2 ) assume that n is odd and n <= len W ; ::_thesis: ( IT1 <= len W & W . IT1 = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds IT1 <= k ) & IT2 <= len W & W . IT2 = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds IT2 <= k ) implies IT1 = IT2 ) assume that A5: IT1 <= len W and A6: W . IT1 = W . n and A7: for k being odd Nat st k <= len W & W . k = W . n holds IT1 <= k ; ::_thesis: ( IT2 <= len W & W . IT2 = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds IT2 <= k ) implies IT1 = IT2 ) assume that A8: IT2 <= len W and A9: W . IT2 = W . n and A10: for k being odd Nat st k <= len W & W . k = W . n holds IT2 <= k ; ::_thesis: IT1 = IT2 A11: IT2 <= IT1 by A5, A6, A10; IT1 <= IT2 by A7, A8, A9; hence IT1 = IT2 by A11, XXREAL_0:1; ::_thesis: verum end; thus ( ( not n is odd or not n <= len W ) & IT1 = len W & IT2 = len W implies IT1 = IT2 ) ; ::_thesis: verum end; consistency for b1 being odd Element of NAT holds verum ; end; :: deftheorem Def20 defines .find GLIB_001:def_20_:_ for G being _Graph for W being Walk of G for n being Element of NAT for b4 being odd Element of NAT holds ( ( n is odd & n <= len W implies ( b4 = W .find n iff ( b4 <= len W & W . b4 = W . n & ( for k being odd Nat st k <= len W & W . k = W . n holds b4 <= k ) ) ) ) & ( ( not n is odd or not n <= len W ) implies ( b4 = W .find n iff b4 = len W ) ) ); definition let G be _Graph; let W be Walk of G; let v be set ; funcW .rfind v -> odd Element of NAT means :Def21: :: GLIB_001:def 21 ( it <= len W & W . it = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= it ) ) if v in W .vertices() otherwise it = len W; existence ( ( v in W .vertices() implies ex b1 being odd Element of NAT st ( b1 <= len W & W . b1 = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= b1 ) ) ) & ( not v in W .vertices() implies ex b1 being odd Element of NAT st b1 = len W ) ) proof hereby ::_thesis: ( not v in W .vertices() implies ex b1 being odd Element of NAT st b1 = len W ) defpred S1[ Nat] means ( $1 is odd & $1 <= len W & W . $1 = v ); assume A1: v in W .vertices() ; ::_thesis: ex IT being odd Element of NAT st ( IT <= len W & W . IT = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= IT ) ) then A2: W . (W .find v) = v by Def19; W .find v <= len W by A1, Def19; then A3: ex k being Nat st S1[k] by A2; A4: for k being Nat st S1[k] holds k <= len W ; consider IT being Nat such that A5: ( S1[IT] & ( for n being Nat st S1[n] holds n <= IT ) ) from NAT_1:sch_6(A4, A3); reconsider IT = IT as odd Element of NAT by A5, ORDINAL1:def_12; take IT = IT; ::_thesis: ( IT <= len W & W . IT = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= IT ) ) thus ( IT <= len W & W . IT = v ) by A5; ::_thesis: for n being odd Element of NAT st n <= len W & W . n = v holds n <= IT let n be odd Element of NAT ; ::_thesis: ( n <= len W & W . n = v implies n <= IT ) assume that A6: n <= len W and A7: W . n = v ; ::_thesis: n <= IT thus n <= IT by A5, A6, A7; ::_thesis: verum end; thus ( not v in W .vertices() implies ex b1 being odd Element of NAT st b1 = len W ) ; ::_thesis: verum end; uniqueness for b1, b2 being odd Element of NAT holds ( ( v in W .vertices() & b1 <= len W & W . b1 = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= b1 ) & b2 <= len W & W . b2 = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= b2 ) implies b1 = b2 ) & ( not v in W .vertices() & b1 = len W & b2 = len W implies b1 = b2 ) ) proof let IT1, IT2 be odd Element of NAT ; ::_thesis: ( ( v in W .vertices() & IT1 <= len W & W . IT1 = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= IT1 ) & IT2 <= len W & W . IT2 = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= IT2 ) implies IT1 = IT2 ) & ( not v in W .vertices() & IT1 = len W & IT2 = len W implies IT1 = IT2 ) ) hereby ::_thesis: ( not v in W .vertices() & IT1 = len W & IT2 = len W implies IT1 = IT2 ) assume v in W .vertices() ; ::_thesis: ( IT1 <= len W & W . IT1 = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= IT1 ) & IT2 <= len W & W . IT2 = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= IT2 ) implies IT1 = IT2 ) assume that A8: IT1 <= len W and A9: W . IT1 = v and A10: for n being odd Element of NAT st n <= len W & W . n = v holds n <= IT1 ; ::_thesis: ( IT2 <= len W & W . IT2 = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= IT2 ) implies IT1 = IT2 ) assume that A11: IT2 <= len W and A12: W . IT2 = v and A13: for n being odd Element of NAT st n <= len W & W . n = v holds n <= IT2 ; ::_thesis: IT1 = IT2 A14: IT1 <= IT2 by A8, A9, A13; IT2 <= IT1 by A10, A11, A12; hence IT1 = IT2 by A14, XXREAL_0:1; ::_thesis: verum end; thus ( not v in W .vertices() & IT1 = len W & IT2 = len W implies IT1 = IT2 ) ; ::_thesis: verum end; consistency for b1 being odd Element of NAT holds verum ; end; :: deftheorem Def21 defines .rfind GLIB_001:def_21_:_ for G being _Graph for W being Walk of G for v being set for b4 being odd Element of NAT holds ( ( v in W .vertices() implies ( b4 = W .rfind v iff ( b4 <= len W & W . b4 = v & ( for n being odd Element of NAT st n <= len W & W . n = v holds n <= b4 ) ) ) ) & ( not v in W .vertices() implies ( b4 = W .rfind v iff b4 = len W ) ) ); definition let G be _Graph; let W be Walk of G; let n be Element of NAT ; funcW .rfind n -> odd Element of NAT means :Def22: :: GLIB_001:def 22 ( it <= len W & W . it = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= it ) ) if ( n is odd & n <= len W ) otherwise it = len W; existence ( ( n is odd & n <= len W implies ex b1 being odd Element of NAT st ( b1 <= len W & W . b1 = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= b1 ) ) ) & ( ( not n is odd or not n <= len W ) implies ex b1 being odd Element of NAT st b1 = len W ) ) proof defpred S1[ Nat] means ( $1 is odd & $1 <= len W & W . $1 = W . n ); hereby ::_thesis: ( ( not n is odd or not n <= len W ) implies ex b1 being odd Element of NAT st b1 = len W ) A1: for k being Nat st S1[k] holds k <= len W ; assume that A2: n is odd and A3: n <= len W ; ::_thesis: ex IT being odd Element of NAT st ( IT <= len W & W . IT = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT ) ) A4: ex k being Nat st S1[k] by A2, A3; consider IT being Nat such that A5: ( S1[IT] & ( for k being Nat st S1[k] holds k <= IT ) ) from NAT_1:sch_6(A1, A4); reconsider IT = IT as odd Element of NAT by A5, ORDINAL1:def_12; take IT = IT; ::_thesis: ( IT <= len W & W . IT = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT ) ) thus ( IT <= len W & W . IT = W . n ) by A5; ::_thesis: for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT thus for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT by A5; ::_thesis: verum end; thus ( ( not n is odd or not n <= len W ) implies ex b1 being odd Element of NAT st b1 = len W ) ; ::_thesis: verum end; uniqueness for b1, b2 being odd Element of NAT holds ( ( n is odd & n <= len W & b1 <= len W & W . b1 = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= b1 ) & b2 <= len W & W . b2 = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= b2 ) implies b1 = b2 ) & ( ( not n is odd or not n <= len W ) & b1 = len W & b2 = len W implies b1 = b2 ) ) proof let IT1, IT2 be odd Element of NAT ; ::_thesis: ( ( n is odd & n <= len W & IT1 <= len W & W . IT1 = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT1 ) & IT2 <= len W & W . IT2 = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT2 ) implies IT1 = IT2 ) & ( ( not n is odd or not n <= len W ) & IT1 = len W & IT2 = len W implies IT1 = IT2 ) ) hereby ::_thesis: ( ( not n is odd or not n <= len W ) & IT1 = len W & IT2 = len W implies IT1 = IT2 ) assume that n is odd and n <= len W ; ::_thesis: ( IT1 <= len W & W . IT1 = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT1 ) & IT2 <= len W & W . IT2 = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT2 ) implies IT1 = IT2 ) assume that A6: IT1 <= len W and A7: W . IT1 = W . n and A8: for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT1 ; ::_thesis: ( IT2 <= len W & W . IT2 = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT2 ) implies IT1 = IT2 ) assume that A9: IT2 <= len W and A10: W . IT2 = W . n and A11: for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= IT2 ; ::_thesis: IT1 = IT2 A12: IT2 <= IT1 by A8, A9, A10; IT1 <= IT2 by A6, A7, A11; hence IT1 = IT2 by A12, XXREAL_0:1; ::_thesis: verum end; thus ( ( not n is odd or not n <= len W ) & IT1 = len W & IT2 = len W implies IT1 = IT2 ) ; ::_thesis: verum end; consistency for b1 being odd Element of NAT holds verum ; end; :: deftheorem Def22 defines .rfind GLIB_001:def_22_:_ for G being _Graph for W being Walk of G for n being Element of NAT for b4 being odd Element of NAT holds ( ( n is odd & n <= len W implies ( b4 = W .rfind n iff ( b4 <= len W & W . b4 = W . n & ( for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= b4 ) ) ) ) & ( ( not n is odd or not n <= len W ) implies ( b4 = W .rfind n iff b4 = len W ) ) ); definition let G be _Graph; let u, v be set ; let W be Walk of G; predW is_Walk_from u,v means :Def23: :: GLIB_001:def 23 ( W .first() = u & W .last() = v ); end; :: deftheorem Def23 defines is_Walk_from GLIB_001:def_23_:_ for G being _Graph for u, v being set for W being Walk of G holds ( W is_Walk_from u,v iff ( W .first() = u & W .last() = v ) ); definition let G be _Graph; let W be Walk of G; attrW is closed means :Def24: :: GLIB_001:def 24 W .first() = W .last() ; attrW is directed means :Def25: :: GLIB_001:def 25 for n being odd Element of NAT st n < len W holds (the_Source_of G) . (W . (n + 1)) = W . n; attrW is trivial means :Def26: :: GLIB_001:def 26 W .length() = 0 ; attrW is Trail-like means :Def27: :: GLIB_001:def 27 W .edgeSeq() is one-to-one ; end; :: deftheorem Def24 defines closed GLIB_001:def_24_:_ for G being _Graph for W being Walk of G holds ( W is closed iff W .first() = W .last() ); :: deftheorem Def25 defines directed GLIB_001:def_25_:_ for G being _Graph for W being Walk of G holds ( W is directed iff for n being odd Element of NAT st n < len W holds (the_Source_of G) . (W . (n + 1)) = W . n ); :: deftheorem Def26 defines trivial GLIB_001:def_26_:_ for G being _Graph for W being Walk of G holds ( W is trivial iff W .length() = 0 ); :: deftheorem Def27 defines Trail-like GLIB_001:def_27_:_ for G being _Graph for W being Walk of G holds ( W is Trail-like iff W .edgeSeq() is one-to-one ); notation let G be _Graph; let W be Walk of G; antonym open W for closed ; end; definition let G be _Graph; let W be Walk of G; attrW is Path-like means :Def28: :: GLIB_001:def 28 ( W is Trail-like & ( for m, n being odd Element of NAT st m < n & n <= len W & W . m = W . n holds ( m = 1 & n = len W ) ) ); end; :: deftheorem Def28 defines Path-like GLIB_001:def_28_:_ for G being _Graph for W being Walk of G holds ( W is Path-like iff ( W is Trail-like & ( for m, n being odd Element of NAT st m < n & n <= len W & W . m = W . n holds ( m = 1 & n = len W ) ) ) ); definition let G be _Graph; let W be Walk of G; attrW is vertex-distinct means :Def29: :: GLIB_001:def 29 for m, n being odd Element of NAT st m <= len W & n <= len W & W . m = W . n holds m = n; end; :: deftheorem Def29 defines vertex-distinct GLIB_001:def_29_:_ for G being _Graph for W being Walk of G holds ( W is vertex-distinct iff for m, n being odd Element of NAT st m <= len W & n <= len W & W . m = W . n holds m = n ); definition let G be _Graph; let W be Walk of G; attrW is Circuit-like means :Def30: :: GLIB_001:def 30 ( W is closed & W is Trail-like & not W is trivial ); attrW is Cycle-like means :Def31: :: GLIB_001:def 31 ( W is closed & W is Path-like & not W is trivial ); end; :: deftheorem Def30 defines Circuit-like GLIB_001:def_30_:_ for G being _Graph for W being Walk of G holds ( W is Circuit-like iff ( W is closed & W is Trail-like & not W is trivial ) ); :: deftheorem Def31 defines Cycle-like GLIB_001:def_31_:_ for G being _Graph for W being Walk of G holds ( W is Cycle-like iff ( W is closed & W is Path-like & not W is trivial ) ); Lm1: for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds W . n in the_Vertices_of G proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n <= len W holds W . n in the_Vertices_of G let W be Walk of G; ::_thesis: for n being odd Element of NAT st n <= len W holds W . n in the_Vertices_of G let n be odd Element of NAT ; ::_thesis: ( n <= len W implies W . n in the_Vertices_of G ) assume n <= len W ; ::_thesis: W . n in the_Vertices_of G then W . n = W .vertexAt n by Def8; hence W . n in the_Vertices_of G ; ::_thesis: verum end; Lm2: for G being _Graph for W being Walk of G for n being even Element of NAT st n in dom W holds ex naa1 being odd Element of NAT st ( naa1 = n - 1 & n - 1 in dom W & n + 1 in dom W & W . n Joins W . naa1,W . (n + 1),G ) proof let G be _Graph; ::_thesis: for W being Walk of G for n being even Element of NAT st n in dom W holds ex naa1 being odd Element of NAT st ( naa1 = n - 1 & n - 1 in dom W & n + 1 in dom W & W . n Joins W . naa1,W . (n + 1),G ) let W be Walk of G; ::_thesis: for n being even Element of NAT st n in dom W holds ex naa1 being odd Element of NAT st ( naa1 = n - 1 & n - 1 in dom W & n + 1 in dom W & W . n Joins W . naa1,W . (n + 1),G ) let n be even Element of NAT ; ::_thesis: ( n in dom W implies ex naa1 being odd Element of NAT st ( naa1 = n - 1 & n - 1 in dom W & n + 1 in dom W & W . n Joins W . naa1,W . (n + 1),G ) ) A1: 1 <= 1 + n by NAT_1:12; assume A2: n in dom W ; ::_thesis: ex naa1 being odd Element of NAT st ( naa1 = n - 1 & n - 1 in dom W & n + 1 in dom W & W . n Joins W . naa1,W . (n + 1),G ) then A3: n <= len W by FINSEQ_3:25; A4: 1 <= n by A2, FINSEQ_3:25; then reconsider naa1 = n - 1 as odd Element of NAT by INT_1:5; take naa1 ; ::_thesis: ( naa1 = n - 1 & n - 1 in dom W & n + 1 in dom W & W . n Joins W . naa1,W . (n + 1),G ) thus naa1 = n - 1 ; ::_thesis: ( n - 1 in dom W & n + 1 in dom W & W . n Joins W . naa1,W . (n + 1),G ) 1 < n by A4, JORDAN12:2, XXREAL_0:1; then 1 + 1 <= n by NAT_1:13; then (1 + 1) - 1 <= n - 1 by XREAL_1:13; then A5: 1 <= naa1 ; n - 1 <= (len W) - 0 by A3, XREAL_1:13; hence n - 1 in dom W by A5, FINSEQ_3:25; ::_thesis: ( n + 1 in dom W & W . n Joins W . naa1,W . (n + 1),G ) n < len W by A3, XXREAL_0:1; then n + 1 <= len W by NAT_1:13; hence n + 1 in dom W by A1, FINSEQ_3:25; ::_thesis: W . n Joins W . naa1,W . (n + 1),G n - 1 < (len W) - 0 by A3, XREAL_1:15; then W . (naa1 + 1) Joins W . naa1,W . (naa1 + 2),G by Def3; hence W . n Joins W . naa1,W . (n + 1),G ; ::_thesis: verum end; Lm3: for G being _Graph for W being Walk of G for n being odd Element of NAT st n < len W holds ( n in dom W & n + 1 in dom W & n + 2 in dom W ) proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n < len W holds ( n in dom W & n + 1 in dom W & n + 2 in dom W ) let W be Walk of G; ::_thesis: for n being odd Element of NAT st n < len W holds ( n in dom W & n + 1 in dom W & n + 2 in dom W ) let n be odd Element of NAT ; ::_thesis: ( n < len W implies ( n in dom W & n + 1 in dom W & n + 2 in dom W ) ) A1: 1 <= n by ABIAN:12; A2: 1 <= n + 1 by NAT_1:12; A3: 1 <= n + 2 by NAT_1:12; assume A4: n < len W ; ::_thesis: ( n in dom W & n + 1 in dom W & n + 2 in dom W ) then A5: n + 1 <= len W by NAT_1:13; n + 2 <= len W by A4, Th1; hence ( n in dom W & n + 1 in dom W & n + 2 in dom W ) by A4, A1, A2, A3, A5, FINSEQ_3:25; ::_thesis: verum end; Lm4: for G being _Graph for v being Vertex of G holds ( G .walkOf v is closed & G .walkOf v is directed & G .walkOf v is trivial & G .walkOf v is Trail-like & G .walkOf v is Path-like ) proof let G be _Graph; ::_thesis: for v being Vertex of G holds ( G .walkOf v is closed & G .walkOf v is directed & G .walkOf v is trivial & G .walkOf v is Trail-like & G .walkOf v is Path-like ) let v be Vertex of G; ::_thesis: ( G .walkOf v is closed & G .walkOf v is directed & G .walkOf v is trivial & G .walkOf v is Trail-like & G .walkOf v is Path-like ) set W = G .walkOf v; (G .walkOf v) .first() = (G .walkOf v) .last() by FINSEQ_1:40; hence G .walkOf v is closed by Def24; ::_thesis: ( G .walkOf v is directed & G .walkOf v is trivial & G .walkOf v is Trail-like & G .walkOf v is Path-like ) now__::_thesis:_for_n_being_odd_Element_of_NAT_st_n_<_len_(G_.walkOf_v)_holds_ (G_.walkOf_v)_._n_=_(the_Source_of_G)_._((G_.walkOf_v)_._(n_+_1)) let n be odd Element of NAT ; ::_thesis: ( n < len (G .walkOf v) implies (G .walkOf v) . n = (the_Source_of G) . ((G .walkOf v) . (n + 1)) ) assume n < len (G .walkOf v) ; ::_thesis: (G .walkOf v) . n = (the_Source_of G) . ((G .walkOf v) . (n + 1)) then n < 1 by FINSEQ_1:39; hence (G .walkOf v) . n = (the_Source_of G) . ((G .walkOf v) . (n + 1)) by ABIAN:12; ::_thesis: verum end; hence G .walkOf v is directed by Def25; ::_thesis: ( G .walkOf v is trivial & G .walkOf v is Trail-like & G .walkOf v is Path-like ) len (G .walkOf v) = 1 by FINSEQ_1:39; then 0 + 1 = (2 * (len ((G .walkOf v) .edgeSeq()))) + 1 by Def15; then (G .walkOf v) .length() = 0 ; hence G .walkOf v is trivial by Def26; ::_thesis: ( G .walkOf v is Trail-like & G .walkOf v is Path-like ) len (G .walkOf v) = (2 * (len ((G .walkOf v) .edgeSeq()))) + 1 by Def15; then 0 + 1 = (2 * (len ((G .walkOf v) .edgeSeq()))) + 1 by FINSEQ_1:40; then (G .walkOf v) .edgeSeq() = {} ; hence A1: G .walkOf v is Trail-like by Def27; ::_thesis: G .walkOf v is Path-like now__::_thesis:_for_n,_m_being_odd_Element_of_NAT_st_n_<_m_&_m_<=_len_(G_.walkOf_v)_&_(G_.walkOf_v)_._n_=_(G_.walkOf_v)_._m_holds_ (_n_=_1_&_m_=_len_(G_.walkOf_v)_) let n, m be odd Element of NAT ; ::_thesis: ( n < m & m <= len (G .walkOf v) & (G .walkOf v) . n = (G .walkOf v) . m implies ( n = 1 & m = len (G .walkOf v) ) ) assume that A2: n < m and A3: m <= len (G .walkOf v) ; ::_thesis: ( (G .walkOf v) . n = (G .walkOf v) . m implies ( n = 1 & m = len (G .walkOf v) ) ) m <= 1 by A3, FINSEQ_1:40; then n < 1 by A2, XXREAL_0:2; hence ( (G .walkOf v) . n = (G .walkOf v) . m implies ( n = 1 & m = len (G .walkOf v) ) ) by ABIAN:12; ::_thesis: verum end; hence G .walkOf v is Path-like by A1, Def28; ::_thesis: verum end; Lm5: for G being _Graph for x, e, y being set st e Joins x,y,G holds len (G .walkOf (x,e,y)) = 3 proof let G be _Graph; ::_thesis: for x, e, y being set st e Joins x,y,G holds len (G .walkOf (x,e,y)) = 3 let x, e, y be set ; ::_thesis: ( e Joins x,y,G implies len (G .walkOf (x,e,y)) = 3 ) assume e Joins x,y,G ; ::_thesis: len (G .walkOf (x,e,y)) = 3 then G .walkOf (x,e,y) = <*x,e,y*> by Def5; hence len (G .walkOf (x,e,y)) = 3 by FINSEQ_1:45; ::_thesis: verum end; Lm6: for G being _Graph for x, e, y being set st e Joins x,y,G holds ( (G .walkOf (x,e,y)) .first() = x & (G .walkOf (x,e,y)) .last() = y & G .walkOf (x,e,y) is_Walk_from x,y ) proof let G be _Graph; ::_thesis: for x, e, y being set st e Joins x,y,G holds ( (G .walkOf (x,e,y)) .first() = x & (G .walkOf (x,e,y)) .last() = y & G .walkOf (x,e,y) is_Walk_from x,y ) let x, e, y be set ; ::_thesis: ( e Joins x,y,G implies ( (G .walkOf (x,e,y)) .first() = x & (G .walkOf (x,e,y)) .last() = y & G .walkOf (x,e,y) is_Walk_from x,y ) ) set W = G .walkOf (x,e,y); assume e Joins x,y,G ; ::_thesis: ( (G .walkOf (x,e,y)) .first() = x & (G .walkOf (x,e,y)) .last() = y & G .walkOf (x,e,y) is_Walk_from x,y ) then A1: G .walkOf (x,e,y) = <*x,e,y*> by Def5; hence A2: (G .walkOf (x,e,y)) .first() = x by FINSEQ_1:45; ::_thesis: ( (G .walkOf (x,e,y)) .last() = y & G .walkOf (x,e,y) is_Walk_from x,y ) len (G .walkOf (x,e,y)) = 3 by A1, FINSEQ_1:45; hence (G .walkOf (x,e,y)) .last() = y by A1, FINSEQ_1:45; ::_thesis: G .walkOf (x,e,y) is_Walk_from x,y hence G .walkOf (x,e,y) is_Walk_from x,y by A2, Def23; ::_thesis: verum end; Lm7: for G being _Graph for W being Walk of G holds ( W .first() = (W .reverse()) .last() & W .last() = (W .reverse()) .first() ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W .first() = (W .reverse()) .last() & W .last() = (W .reverse()) .first() ) let W be Walk of G; ::_thesis: ( W .first() = (W .reverse()) .last() & W .last() = (W .reverse()) .first() ) len W = len (W .reverse()) by FINSEQ_5:def_3; hence W .first() = (W .reverse()) .last() by FINSEQ_5:62; ::_thesis: W .last() = (W .reverse()) .first() thus W .last() = (W .reverse()) .first() by FINSEQ_5:62; ::_thesis: verum end; Lm8: for G being _Graph for W being Walk of G for n being Element of NAT st n in dom (W .reverse()) holds ( (W .reverse()) . n = W . (((len W) - n) + 1) & ((len W) - n) + 1 in dom W ) proof let G be _Graph; ::_thesis: for W being Walk of G for n being Element of NAT st n in dom (W .reverse()) holds ( (W .reverse()) . n = W . (((len W) - n) + 1) & ((len W) - n) + 1 in dom W ) let W be Walk of G; ::_thesis: for n being Element of NAT st n in dom (W .reverse()) holds ( (W .reverse()) . n = W . (((len W) - n) + 1) & ((len W) - n) + 1 in dom W ) let n be Element of NAT ; ::_thesis: ( n in dom (W .reverse()) implies ( (W .reverse()) . n = W . (((len W) - n) + 1) & ((len W) - n) + 1 in dom W ) ) assume A1: n in dom (W .reverse()) ; ::_thesis: ( (W .reverse()) . n = W . (((len W) - n) + 1) & ((len W) - n) + 1 in dom W ) hence (W .reverse()) . n = W . (((len W) - n) + 1) by FINSEQ_5:def_3; ::_thesis: ((len W) - n) + 1 in dom W n in Seg (len (W .reverse())) by A1, FINSEQ_1:def_3; then n in Seg (len W) by FINSEQ_5:def_3; then ((len W) - n) + 1 in Seg (len W) by FINSEQ_5:2; hence ((len W) - n) + 1 in dom W by FINSEQ_1:def_3; ::_thesis: verum end; Lm9: for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds (len (W1 .append W2)) + 1 = (len W1) + (len W2) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 .last() = W2 .first() holds (len (W1 .append W2)) + 1 = (len W1) + (len W2) let W1, W2 be Walk of G; ::_thesis: ( W1 .last() = W2 .first() implies (len (W1 .append W2)) + 1 = (len W1) + (len W2) ) set W = W1 .append W2; assume W1 .last() = W2 .first() ; ::_thesis: (len (W1 .append W2)) + 1 = (len W1) + (len W2) then W1 .append W2 = W1 ^' W2 by Def10; hence (len (W1 .append W2)) + 1 = (len W1) + (len W2) by CARD_1:27, GRAPH_2:13; ::_thesis: verum end; Lm10: for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds ( len W1 <= len (W1 .append W2) & len W2 <= len (W1 .append W2) ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 .last() = W2 .first() holds ( len W1 <= len (W1 .append W2) & len W2 <= len (W1 .append W2) ) let W1, W2 be Walk of G; ::_thesis: ( W1 .last() = W2 .first() implies ( len W1 <= len (W1 .append W2) & len W2 <= len (W1 .append W2) ) ) set W = W1 .append W2; assume W1 .last() = W2 .first() ; ::_thesis: ( len W1 <= len (W1 .append W2) & len W2 <= len (W1 .append W2) ) then A1: (len (W1 .append W2)) + 1 = (len W1) + (len W2) by Lm9; 1 <= len W2 by ABIAN:12; then ((len W1) + (len W2)) - (len W2) <= ((len (W1 .append W2)) + 1) - 1 by A1, XREAL_1:13; hence len W1 <= len (W1 .append W2) ; ::_thesis: len W2 <= len (W1 .append W2) 1 <= len W1 by ABIAN:12; then ((len W2) + (len W1)) - (len W1) <= ((len (W1 .append W2)) + 1) - 1 by A1, XREAL_1:13; hence len W2 <= len (W1 .append W2) ; ::_thesis: verum end; Lm11: for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds ( (W1 .append W2) .first() = W1 .first() & (W1 .append W2) .last() = W2 .last() & W1 .append W2 is_Walk_from W1 .first() ,W2 .last() ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 .last() = W2 .first() holds ( (W1 .append W2) .first() = W1 .first() & (W1 .append W2) .last() = W2 .last() & W1 .append W2 is_Walk_from W1 .first() ,W2 .last() ) let W1, W2 be Walk of G; ::_thesis: ( W1 .last() = W2 .first() implies ( (W1 .append W2) .first() = W1 .first() & (W1 .append W2) .last() = W2 .last() & W1 .append W2 is_Walk_from W1 .first() ,W2 .last() ) ) set W = W1 .append W2; assume A1: W1 .last() = W2 .first() ; ::_thesis: ( (W1 .append W2) .first() = W1 .first() & (W1 .append W2) .last() = W2 .last() & W1 .append W2 is_Walk_from W1 .first() ,W2 .last() ) then A2: W1 .append W2 = W1 ^' W2 by Def10; 1 <= len W1 by ABIAN:12; hence A3: (W1 .append W2) .first() = W1 .first() by A2, GRAPH_2:14; ::_thesis: ( (W1 .append W2) .last() = W2 .last() & W1 .append W2 is_Walk_from W1 .first() ,W2 .last() ) now__::_thesis:_(W1_.append_W2)_.last()_=_W2_.last() percases ( len W2 <> 1 or len W2 = 1 ) ; supposeA4: len W2 <> 1 ; ::_thesis: (W1 .append W2) .last() = W2 .last() 1 <= len W2 by ABIAN:12; then 1 < len W2 by A4, XXREAL_0:1; hence (W1 .append W2) .last() = W2 .last() by A2, GRAPH_2:16; ::_thesis: verum end; supposeA5: len W2 = 1 ; ::_thesis: (W1 .append W2) .last() = W2 .last() A6: (2,1) -cut W2 = {} by GRAPH_2:def_1; W1 .append W2 = W1 ^ ((2,1) -cut W2) by A2, A5, GRAPH_2:def_2; hence (W1 .append W2) .last() = W2 .last() by A1, A5, A6, FINSEQ_1:34; ::_thesis: verum end; end; end; hence ( (W1 .append W2) .last() = W2 .last() & W1 .append W2 is_Walk_from W1 .first() ,W2 .last() ) by A3, Def23; ::_thesis: verum end; Lm12: for G being _Graph for W1, W2 being Walk of G for n being Element of NAT st n in dom W1 holds ( (W1 .append W2) . n = W1 . n & n in dom (W1 .append W2) ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G for n being Element of NAT st n in dom W1 holds ( (W1 .append W2) . n = W1 . n & n in dom (W1 .append W2) ) let W1, W2 be Walk of G; ::_thesis: for n being Element of NAT st n in dom W1 holds ( (W1 .append W2) . n = W1 . n & n in dom (W1 .append W2) ) let n be Element of NAT ; ::_thesis: ( n in dom W1 implies ( (W1 .append W2) . n = W1 . n & n in dom (W1 .append W2) ) ) set W = W1 .append W2; assume A1: n in dom W1 ; ::_thesis: ( (W1 .append W2) . n = W1 . n & n in dom (W1 .append W2) ) then A2: n <= len W1 by FINSEQ_3:25; A3: 1 <= n by A1, FINSEQ_3:25; now__::_thesis:_(_(W1_.append_W2)_._n_=_W1_._n_&_n_in_dom_(W1_.append_W2)_) percases ( W1 .last() = W2 .first() or W1 .last() <> W2 .first() ) ; supposeA4: W1 .last() = W2 .first() ; ::_thesis: ( (W1 .append W2) . n = W1 . n & n in dom (W1 .append W2) ) then W1 .append W2 = W1 ^' W2 by Def10; hence (W1 .append W2) . n = W1 . n by A3, A2, GRAPH_2:14; ::_thesis: n in dom (W1 .append W2) reconsider lenW2aa1 = (len W2) - 1 as Element of NAT by ABIAN:12, INT_1:5; n <= (len W1) + lenW2aa1 by A2, NAT_1:12; then n <= ((len W1) + (len W2)) + (- 1) ; then n <= ((len (W1 .append W2)) + 1) + (- 1) by A4, Lm9; hence n in dom (W1 .append W2) by A3, FINSEQ_3:25; ::_thesis: verum end; suppose W1 .last() <> W2 .first() ; ::_thesis: ( (W1 .append W2) . n = W1 . n & n in dom (W1 .append W2) ) hence ( (W1 .append W2) . n = W1 . n & n in dom (W1 .append W2) ) by A1, Def10; ::_thesis: verum end; end; end; hence ( (W1 .append W2) . n = W1 . n & n in dom (W1 .append W2) ) ; ::_thesis: verum end; Lm13: for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds for n being Element of NAT st n < len W2 holds ( (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) & (len W1) + n in dom (W1 .append W2) ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 .last() = W2 .first() holds for n being Element of NAT st n < len W2 holds ( (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) & (len W1) + n in dom (W1 .append W2) ) let W1, W2 be Walk of G; ::_thesis: ( W1 .last() = W2 .first() implies for n being Element of NAT st n < len W2 holds ( (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) & (len W1) + n in dom (W1 .append W2) ) ) set W = W1 .append W2; assume A1: W1 .last() = W2 .first() ; ::_thesis: for n being Element of NAT st n < len W2 holds ( (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) & (len W1) + n in dom (W1 .append W2) ) let n be Element of NAT ; ::_thesis: ( n < len W2 implies ( (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) & (len W1) + n in dom (W1 .append W2) ) ) assume A2: n < len W2 ; ::_thesis: ( (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) & (len W1) + n in dom (W1 .append W2) ) then n + 1 <= len W2 by NAT_1:13; then (n + 1) + (len W1) <= (len W2) + (len W1) by XREAL_1:7; then ((len W1) + n) + 1 <= (len (W1 .append W2)) + 1 by A1, Lm9; then A3: (len W1) + n <= len (W1 .append W2) by XREAL_1:6; A4: W1 .append W2 = W1 ^' W2 by A1, Def10; now__::_thesis:_(W1_.append_W2)_._((len_W1)_+_n)_=_W2_._(n_+_1) percases ( n = 0 or n <> 0 ) ; supposeA5: n = 0 ; ::_thesis: (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) then 1 <= (len W1) + n by ABIAN:12; then (len W1) + n in dom W1 by A5, FINSEQ_3:25; hence (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) by A1, A5, Lm12; ::_thesis: verum end; suppose n <> 0 ; ::_thesis: (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) then 0 + 1 < n + 1 by XREAL_1:8; then 1 <= n by NAT_1:13; hence (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) by A4, A2, GRAPH_2:15; ::_thesis: verum end; end; end; hence (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) ; ::_thesis: (len W1) + n in dom (W1 .append W2) 1 <= (len W1) + n by ABIAN:12, NAT_1:12; hence (len W1) + n in dom (W1 .append W2) by A3, FINSEQ_3:25; ::_thesis: verum end; Lm14: for G being _Graph for W1, W2 being Walk of G for n being Element of NAT holds ( not n in dom (W1 .append W2) or n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G for n being Element of NAT holds ( not n in dom (W1 .append W2) or n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) let W1, W2 be Walk of G; ::_thesis: for n being Element of NAT holds ( not n in dom (W1 .append W2) or n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) let n be Element of NAT ; ::_thesis: ( not n in dom (W1 .append W2) or n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) set W3 = W1 .append W2; assume A1: n in dom (W1 .append W2) ; ::_thesis: ( n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) then A2: n <= len (W1 .append W2) by FINSEQ_3:25; A3: 1 <= n by A1, FINSEQ_3:25; now__::_thesis:_(_n_in_dom_W1_or_ex_k_being_Element_of_NAT_st_ (_k_<_len_W2_&_n_=_(len_W1)_+_k_)_) percases ( W1 .last() = W2 .first() or W1 .last() <> W2 .first() ) ; suppose W1 .last() = W2 .first() ; ::_thesis: ( n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) then A4: (len (W1 .append W2)) + 1 = (len W1) + (len W2) by Lm9; now__::_thesis:_(_not_n_in_dom_W1_implies_ex_k_being_Element_of_NAT_st_ (_k_<_len_W2_&_n_=_(len_W1)_+_k_)_) assume not n in dom W1 ; ::_thesis: ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) then len W1 < n by A3, FINSEQ_3:25; then reconsider k = n - (len W1) as Element of NAT by INT_1:5; take k = k; ::_thesis: ( k < len W2 & n = (len W1) + k ) now__::_thesis:_not_len_W2_<=_k assume len W2 <= k ; ::_thesis: contradiction then (len W1) + (len W2) <= (len W1) + k by XREAL_1:7; hence contradiction by A2, A4, NAT_1:13; ::_thesis: verum end; hence k < len W2 ; ::_thesis: n = (len W1) + k thus n = (len W1) + k ; ::_thesis: verum end; hence ( n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) ; ::_thesis: verum end; suppose W1 .last() <> W2 .first() ; ::_thesis: ( n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) hence ( n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) by A1, Def10; ::_thesis: verum end; end; end; hence ( n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) ; ::_thesis: verum end; Lm15: for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W holds ( (len (W .cut (m,n))) + m = n + 1 & ( for i being Element of NAT st i < len (W .cut (m,n)) holds ( (W .cut (m,n)) . (i + 1) = W . (m + i) & m + i in dom W ) ) ) proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W holds ( (len (W .cut (m,n))) + m = n + 1 & ( for i being Element of NAT st i < len (W .cut (m,n)) holds ( (W .cut (m,n)) . (i + 1) = W . (m + i) & m + i in dom W ) ) ) let W be Walk of G; ::_thesis: for m, n being odd Element of NAT st m <= n & n <= len W holds ( (len (W .cut (m,n))) + m = n + 1 & ( for i being Element of NAT st i < len (W .cut (m,n)) holds ( (W .cut (m,n)) . (i + 1) = W . (m + i) & m + i in dom W ) ) ) let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n <= len W implies ( (len (W .cut (m,n))) + m = n + 1 & ( for i being Element of NAT st i < len (W .cut (m,n)) holds ( (W .cut (m,n)) . (i + 1) = W . (m + i) & m + i in dom W ) ) ) ) set W2 = W .cut (m,n); assume that A1: m <= n and A2: n <= len W ; ::_thesis: ( (len (W .cut (m,n))) + m = n + 1 & ( for i being Element of NAT st i < len (W .cut (m,n)) holds ( (W .cut (m,n)) . (i + 1) = W . (m + i) & m + i in dom W ) ) ) A3: 1 <= m by ABIAN:12; A4: W .cut (m,n) = (m,n) -cut W by A1, A2, Def11; hence A5: (len (W .cut (m,n))) + m = n + 1 by A1, A2, A3, GRAPH_2:def_1; ::_thesis: for i being Element of NAT st i < len (W .cut (m,n)) holds ( (W .cut (m,n)) . (i + 1) = W . (m + i) & m + i in dom W ) let i be Element of NAT ; ::_thesis: ( i < len (W .cut (m,n)) implies ( (W .cut (m,n)) . (i + 1) = W . (m + i) & m + i in dom W ) ) assume A6: i < len (W .cut (m,n)) ; ::_thesis: ( (W .cut (m,n)) . (i + 1) = W . (m + i) & m + i in dom W ) hence (W .cut (m,n)) . (i + 1) = W . (m + i) by A1, A2, A4, A3, GRAPH_2:def_1; ::_thesis: m + i in dom W m + i < n + 1 by A5, A6, XREAL_1:8; then m + i <= n by NAT_1:13; then A7: m + i <= len W by A2, XXREAL_0:2; 1 <= m + i by ABIAN:12, NAT_1:12; hence m + i in dom W by A7, FINSEQ_3:25; ::_thesis: verum end; Lm16: for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W holds ( (W .cut (m,n)) .first() = W . m & (W .cut (m,n)) .last() = W . n & W .cut (m,n) is_Walk_from W . m,W . n ) proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W holds ( (W .cut (m,n)) .first() = W . m & (W .cut (m,n)) .last() = W . n & W .cut (m,n) is_Walk_from W . m,W . n ) let W be Walk of G; ::_thesis: for m, n being odd Element of NAT st m <= n & n <= len W holds ( (W .cut (m,n)) .first() = W . m & (W .cut (m,n)) .last() = W . n & W .cut (m,n) is_Walk_from W . m,W . n ) let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n <= len W implies ( (W .cut (m,n)) .first() = W . m & (W .cut (m,n)) .last() = W . n & W .cut (m,n) is_Walk_from W . m,W . n ) ) set W2 = W .cut (m,n); assume that A1: m <= n and A2: n <= len W ; ::_thesis: ( (W .cut (m,n)) .first() = W . m & (W .cut (m,n)) .last() = W . n & W .cut (m,n) is_Walk_from W . m,W . n ) 1 - 1 < (len (W .cut (m,n))) - 0 ; then (W .cut (m,n)) . (0 + 1) = W . (m + 0) by A1, A2, Lm15; hence A3: (W .cut (m,n)) .first() = W . m ; ::_thesis: ( (W .cut (m,n)) .last() = W . n & W .cut (m,n) is_Walk_from W . m,W . n ) reconsider nm4 = n - m as Element of NAT by A1, INT_1:5; A4: ((len (W .cut (m,n))) + m) - m = (n + 1) - m by A1, A2, Lm15; then ((n - m) + 1) - 1 < (len (W .cut (m,n))) - 0 by XREAL_1:15; then nm4 < len (W .cut (m,n)) ; then (W .cut (m,n)) . ((n - m) + 1) = W . (m + (n - m)) by A1, A2, Lm15; hence (W .cut (m,n)) .last() = W . n by A4; ::_thesis: W .cut (m,n) is_Walk_from W . m,W . n hence W .cut (m,n) is_Walk_from W . m,W . n by A3, Def23; ::_thesis: verum end; Lm17: for G being _Graph for W being Walk of G for m, n, o being odd Element of NAT st m <= n & n <= o & o <= len W holds (W .cut (m,n)) .append (W .cut (n,o)) = W .cut (m,o) proof let G be _Graph; ::_thesis: for W being Walk of G for m, n, o being odd Element of NAT st m <= n & n <= o & o <= len W holds (W .cut (m,n)) .append (W .cut (n,o)) = W .cut (m,o) let W be Walk of G; ::_thesis: for m, n, o being odd Element of NAT st m <= n & n <= o & o <= len W holds (W .cut (m,n)) .append (W .cut (n,o)) = W .cut (m,o) let m, n, o be odd Element of NAT ; ::_thesis: ( m <= n & n <= o & o <= len W implies (W .cut (m,n)) .append (W .cut (n,o)) = W .cut (m,o) ) assume that A1: m <= n and A2: n <= o and A3: o <= len W ; ::_thesis: (W .cut (m,n)) .append (W .cut (n,o)) = W .cut (m,o) set W1 = W .cut (m,n); set W2 = W .cut (n,o); set W3 = W .cut (m,o); set W4 = (W .cut (m,n)) .append (W .cut (n,o)); A4: n <= len W by A2, A3, XXREAL_0:2; A5: m <= o by A1, A2, XXREAL_0:2; now__::_thesis:_(_len_((W_.cut_(m,n))_.append_(W_.cut_(n,o)))_=_len_((W_.cut_(m,n))_.append_(W_.cut_(n,o)))_&_len_(W_.cut_(m,o))_=_len_((W_.cut_(m,n))_.append_(W_.cut_(n,o)))_&_(_for_x_being_Nat_st_x_in_dom_((W_.cut_(m,n))_.append_(W_.cut_(n,o)))_holds_ ((W_.cut_(m,n))_.append_(W_.cut_(n,o)))_._x_=_(W_.cut_(m,o))_._x_)_) A6: (len (W .cut (m,o))) + m = o + 1 by A3, A5, Lm15; A7: (W .cut (m,n)) .last() = W . n by A1, A4, Lm16 .= (W .cut (n,o)) .first() by A2, A3, Lm16 ; A8: (len (W .cut (m,n))) + m = n + 1 by A1, A4, Lm15; A9: (len (W .cut (n,o))) + n = o + 1 by A2, A3, Lm15; then ((len (W .cut (m,n))) + (len (W .cut (n,o)))) + m = (1 + (len (W .cut (m,o)))) + m by A8, A6; then A10: (len ((W .cut (m,n)) .append (W .cut (n,o)))) + 1 = (len (W .cut (m,o))) + 1 by A7, Lm9; hence ( len ((W .cut (m,n)) .append (W .cut (n,o))) = len ((W .cut (m,n)) .append (W .cut (n,o))) & len (W .cut (m,o)) = len ((W .cut (m,n)) .append (W .cut (n,o))) ) ; ::_thesis: for x being Nat st x in dom ((W .cut (m,n)) .append (W .cut (n,o))) holds ((W .cut (m,n)) .append (W .cut (n,o))) . x = (W .cut (m,o)) . x let x be Nat; ::_thesis: ( x in dom ((W .cut (m,n)) .append (W .cut (n,o))) implies ((W .cut (m,n)) .append (W .cut (n,o))) . x = (W .cut (m,o)) . x ) assume A11: x in dom ((W .cut (m,n)) .append (W .cut (n,o))) ; ::_thesis: ((W .cut (m,n)) .append (W .cut (n,o))) . x = (W .cut (m,o)) . x then A12: 1 <= x by FINSEQ_3:25; then reconsider xaa1 = x - 1 as Element of NAT by INT_1:5; A13: x <= len ((W .cut (m,n)) .append (W .cut (n,o))) by A11, FINSEQ_3:25; then xaa1 < (len ((W .cut (m,n)) .append (W .cut (n,o)))) - 0 by XREAL_1:15; then A14: (W .cut (m,o)) . (xaa1 + 1) = W . (m + xaa1) by A3, A5, A10, Lm15; now__::_thesis:_((W_.cut_(m,n))_.append_(W_.cut_(n,o)))_._x_=_(W_.cut_(m,o))_._x percases ( x <= len (W .cut (m,n)) or x > len (W .cut (m,n)) ) ; supposeA15: x <= len (W .cut (m,n)) ; ::_thesis: ((W .cut (m,n)) .append (W .cut (n,o))) . x = (W .cut (m,o)) . x then A16: xaa1 < (len (W .cut (m,n))) - 0 by XREAL_1:15; x in dom (W .cut (m,n)) by A12, A15, FINSEQ_3:25; hence ((W .cut (m,n)) .append (W .cut (n,o))) . x = (W .cut (m,n)) . (xaa1 + 1) by Lm12 .= (W .cut (m,o)) . x by A1, A4, A14, A16, Lm15 ; ::_thesis: verum end; suppose x > len (W .cut (m,n)) ; ::_thesis: ((W .cut (m,n)) .append (W .cut (n,o))) . x = (W .cut (m,o)) . x then consider k being Nat such that A17: (len (W .cut (m,n))) + k = x by NAT_1:10; reconsider k = k as Element of NAT by ORDINAL1:def_12; ((len (W .cut (m,n))) + k) + 1 <= (len (W .cut (m,o))) + 1 by A10, A13, A17, XREAL_1:7; then ((k + 1) + (len (W .cut (m,n)))) - (len (W .cut (m,n))) <= ((len (W .cut (n,o))) + (len (W .cut (m,n)))) - (len (W .cut (m,n))) by A8, A9, A6, XREAL_1:13; then A18: (k + 1) - 1 < ((len (W .cut (n,o))) + 1) - 1 by NAT_1:13; then ((W .cut (m,n)) .append (W .cut (n,o))) . x = (W .cut (n,o)) . (k + 1) by A7, A17, Lm13 .= W . (n + k) by A2, A3, A18, Lm15 ; hence ((W .cut (m,n)) .append (W .cut (n,o))) . x = (W .cut (m,o)) . x by A8, A14, A17; ::_thesis: verum end; end; end; hence ((W .cut (m,n)) .append (W .cut (n,o))) . x = (W .cut (m,o)) . x ; ::_thesis: verum end; hence (W .cut (m,n)) .append (W .cut (n,o)) = W .cut (m,o) by FINSEQ_2:9; ::_thesis: verum end; Lm18: for G being _Graph for W being Walk of G holds W .cut (1,(len W)) = W proof let G be _Graph; ::_thesis: for W being Walk of G holds W .cut (1,(len W)) = W let W be Walk of G; ::_thesis: W .cut (1,(len W)) = W 1 <= len W by ABIAN:12; then W .cut (1,(len W)) = (1,(len W)) -cut W by Def11, JORDAN12:2; hence W .cut (1,(len W)) = W by GRAPH_2:7; ::_thesis: verum end; Lm19: for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds W .cut (n,n) = <*(W .vertexAt n)*> proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n <= len W holds W .cut (n,n) = <*(W .vertexAt n)*> let W be Walk of G; ::_thesis: for n being odd Element of NAT st n <= len W holds W .cut (n,n) = <*(W .vertexAt n)*> let n be odd Element of NAT ; ::_thesis: ( n <= len W implies W .cut (n,n) = <*(W .vertexAt n)*> ) A1: 1 <= n by ABIAN:12; assume A2: n <= len W ; ::_thesis: W .cut (n,n) = <*(W .vertexAt n)*> then A3: W . n = W .vertexAt n by Def8; W .cut (n,n) = (n,n) -cut W by A2, Def11; hence W .cut (n,n) = <*(W .vertexAt n)*> by A2, A3, A1, GRAPH_2:6; ::_thesis: verum end; Lm20: for G being _Graph for W being Walk of G for m, n being Element of NAT st m is odd & m <= n holds (W .cut (1,n)) .cut (1,m) = W .cut (1,m) proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being Element of NAT st m is odd & m <= n holds (W .cut (1,n)) .cut (1,m) = W .cut (1,m) let W be Walk of G; ::_thesis: for m, n being Element of NAT st m is odd & m <= n holds (W .cut (1,n)) .cut (1,m) = W .cut (1,m) let m, n be Element of NAT ; ::_thesis: ( m is odd & m <= n implies (W .cut (1,n)) .cut (1,m) = W .cut (1,m) ) set W1 = W .cut (1,n); assume that A1: m is odd and A2: m <= n ; ::_thesis: (W .cut (1,n)) .cut (1,m) = W .cut (1,m) now__::_thesis:_(W_.cut_(1,n))_.cut_(1,m)_=_W_.cut_(1,m) percases ( ( n is odd & n <= len W ) or not n is odd or not n <= len W ) ; supposeA3: ( n is odd & n <= len W ) ; ::_thesis: (W .cut (1,n)) .cut (1,m) = W .cut (1,m) A4: 1 <= m by A1, ABIAN:12; A5: 1 <= n by A3, ABIAN:12; then A6: (len (W .cut (1,n))) + 1 = n + 1 by A3, Lm15, JORDAN12:2; then A7: (len ((W .cut (1,n)) .cut (1,m))) + 1 = m + 1 by A1, A2, A4, Lm15, JORDAN12:2; A8: m <= len W by A2, A3, XXREAL_0:2; then A9: W .cut (1,m) = (1,m) -cut W by A1, A4, Def11, JORDAN12:2; A10: (len (W .cut (1,m))) + 1 = m + 1 by A1, A4, A8, Lm15, JORDAN12:2; A11: W .cut (1,n) = (1,n) -cut W by A3, A5, Def11, JORDAN12:2; A12: (W .cut (1,n)) .cut (1,m) = (1,m) -cut (W .cut (1,n)) by A1, A2, A4, A6, Def11, JORDAN12:2; A13: now__::_thesis:_for_x_being_Nat_st_x_in_dom_((W_.cut_(1,n))_.cut_(1,m))_holds_ ((W_.cut_(1,n))_.cut_(1,m))_._x_=_(W_.cut_(1,m))_._x let x be Nat; ::_thesis: ( x in dom ((W .cut (1,n)) .cut (1,m)) implies ((W .cut (1,n)) .cut (1,m)) . x = (W .cut (1,m)) . x ) assume A14: x in dom ((W .cut (1,n)) .cut (1,m)) ; ::_thesis: ((W .cut (1,n)) .cut (1,m)) . x = (W .cut (1,m)) . x then A15: x <= m by A7, FINSEQ_3:25; A16: 1 <= x by A14, FINSEQ_3:25; then reconsider xaa1 = x - 1 as Element of NAT by INT_1:5; A17: 1 <= m by A16, A15, XXREAL_0:2; A18: xaa1 < (len (W .cut (1,m))) - 0 by A10, A15, XREAL_1:15; x <= n by A2, A15, XXREAL_0:2; then A19: xaa1 < (len (W .cut (1,n))) - 0 by A6, XREAL_1:15; xaa1 < (len ((W .cut (1,n)) .cut (1,m))) - 0 by A7, A15, XREAL_1:15; hence ((W .cut (1,n)) .cut (1,m)) . x = (W .cut (1,n)) . (1 + xaa1) by A2, A6, A12, A17, GRAPH_2:def_1 .= W . (1 + xaa1) by A3, A5, A11, A19, GRAPH_2:def_1 .= (W .cut (1,m)) . x by A4, A8, A9, A18, GRAPH_2:def_1 ; ::_thesis: verum end; (len (W .cut (1,m))) + 1 = m + 1 by A1, A4, A8, Lm15, JORDAN12:2; hence (W .cut (1,n)) .cut (1,m) = W .cut (1,m) by A7, A13, FINSEQ_2:9; ::_thesis: verum end; suppose ( not n is odd or not n <= len W ) ; ::_thesis: (W .cut (1,n)) .cut (1,m) = W .cut (1,m) hence (W .cut (1,n)) .cut (1,m) = W .cut (1,m) by Def11; ::_thesis: verum end; end; end; hence (W .cut (1,n)) .cut (1,m) = W .cut (1,m) ; ::_thesis: verum end; Lm21: for G being _Graph for W1, W2 being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W1 & W1 .last() = W2 .first() holds (W1 .append W2) .cut (m,n) = W1 .cut (m,n) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W1 & W1 .last() = W2 .first() holds (W1 .append W2) .cut (m,n) = W1 .cut (m,n) let W1, W2 be Walk of G; ::_thesis: for m, n being odd Element of NAT st m <= n & n <= len W1 & W1 .last() = W2 .first() holds (W1 .append W2) .cut (m,n) = W1 .cut (m,n) let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n <= len W1 & W1 .last() = W2 .first() implies (W1 .append W2) .cut (m,n) = W1 .cut (m,n) ) assume that A1: m <= n and A2: n <= len W1 and A3: W1 .last() = W2 .first() ; ::_thesis: (W1 .append W2) .cut (m,n) = W1 .cut (m,n) A4: W1 .cut (m,n) = (m,n) -cut W1 by A1, A2, Def11; set W3 = W1 .append W2; len W1 <= len (W1 .append W2) by A3, Lm10; then A5: n <= len (W1 .append W2) by A2, XXREAL_0:2; then A6: (len ((W1 .append W2) .cut (m,n))) + m = n + 1 by A1, Lm15 .= (len (W1 .cut (m,n))) + m by A1, A2, Lm15 ; A7: 1 <= m by ABIAN:12; A8: (W1 .append W2) .cut (m,n) = (m,n) -cut (W1 .append W2) by A1, A5, Def11; now__::_thesis:_for_x_being_Nat_st_x_in_dom_(W1_.cut_(m,n))_holds_ ((W1_.append_W2)_.cut_(m,n))_._x_=_(W1_.cut_(m,n))_._x let x be Nat; ::_thesis: ( x in dom (W1 .cut (m,n)) implies ((W1 .append W2) .cut (m,n)) . x = (W1 .cut (m,n)) . x ) assume A9: x in dom (W1 .cut (m,n)) ; ::_thesis: ((W1 .append W2) .cut (m,n)) . x = (W1 .cut (m,n)) . x then 1 <= x by FINSEQ_3:25; then reconsider xaa1 = x - 1 as Element of NAT by INT_1:5; A10: x <= len (W1 .cut (m,n)) by A9, FINSEQ_3:25; then A11: xaa1 < (len (W1 .cut (m,n))) - 0 by XREAL_1:15; (len (W1 .cut (m,n))) + m = n + 1 by A1, A2, Lm15; then m + xaa1 < n + 1 by A11, XREAL_1:8; then m + xaa1 <= n by NAT_1:13; then A12: m + xaa1 <= len W1 by A2, XXREAL_0:2; 1 <= m + xaa1 by ABIAN:12, NAT_1:12; then A13: m + xaa1 in dom W1 by A12, FINSEQ_3:25; A14: xaa1 + 1 = x ; xaa1 < (len ((W1 .append W2) .cut (m,n))) - 0 by A6, A10, XREAL_1:15; then A15: ((W1 .append W2) .cut (m,n)) . x = (W1 .append W2) . (m + xaa1) by A1, A5, A8, A7, A14, GRAPH_2:def_1; (W1 .cut (m,n)) . x = W1 . (m + xaa1) by A1, A2, A4, A7, A14, A11, GRAPH_2:def_1; hence ((W1 .append W2) .cut (m,n)) . x = (W1 .cut (m,n)) . x by A15, A13, Lm12; ::_thesis: verum end; hence (W1 .append W2) .cut (m,n) = W1 .cut (m,n) by A6, FINSEQ_2:9; ::_thesis: verum end; Lm22: for G being _Graph for W being Walk of G for m being odd Element of NAT st m <= len W holds len (W .cut (1,m)) = m proof let G be _Graph; ::_thesis: for W being Walk of G for m being odd Element of NAT st m <= len W holds len (W .cut (1,m)) = m let W be Walk of G; ::_thesis: for m being odd Element of NAT st m <= len W holds len (W .cut (1,m)) = m let m be odd Element of NAT ; ::_thesis: ( m <= len W implies len (W .cut (1,m)) = m ) A1: 1 <= m by ABIAN:12; assume m <= len W ; ::_thesis: len (W .cut (1,m)) = m then (len (W .cut (1,m))) + 1 = m + 1 by A1, Lm15, JORDAN12:2; hence len (W .cut (1,m)) = m ; ::_thesis: verum end; Lm23: for G being _Graph for W being Walk of G for m being odd Element of NAT for x being Element of NAT st x in dom (W .cut (1,m)) & m <= len W holds (W .cut (1,m)) . x = W . x proof let G be _Graph; ::_thesis: for W being Walk of G for m being odd Element of NAT for x being Element of NAT st x in dom (W .cut (1,m)) & m <= len W holds (W .cut (1,m)) . x = W . x let W be Walk of G; ::_thesis: for m being odd Element of NAT for x being Element of NAT st x in dom (W .cut (1,m)) & m <= len W holds (W .cut (1,m)) . x = W . x let m be odd Element of NAT ; ::_thesis: for x being Element of NAT st x in dom (W .cut (1,m)) & m <= len W holds (W .cut (1,m)) . x = W . x let x be Element of NAT ; ::_thesis: ( x in dom (W .cut (1,m)) & m <= len W implies (W .cut (1,m)) . x = W . x ) assume that A1: x in dom (W .cut (1,m)) and A2: m <= len W ; ::_thesis: (W .cut (1,m)) . x = W . x x <= len (W .cut (1,m)) by A1, FINSEQ_3:25; then A3: x - 1 < (len (W .cut (1,m))) - 0 by XREAL_1:15; 1 <= x by A1, FINSEQ_3:25; then reconsider xaa1 = x - 1 as Element of NAT by INT_1:5; A4: 1 <= m by ABIAN:12; xaa1 + 1 = x ; hence (W .cut (1,m)) . x = W . x by A2, A4, A3, Lm15, JORDAN12:2; ::_thesis: verum end; Lm24: for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds (len (W .remove (m,n))) + n = (len W) + m proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds (len (W .remove (m,n))) + n = (len W) + m let W be Walk of G; ::_thesis: for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds (len (W .remove (m,n))) + n = (len W) + m let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n <= len W & W . m = W . n implies (len (W .remove (m,n))) + n = (len W) + m ) set W1 = W .cut (1,m); set W2 = W .cut (n,(len W)); assume that A1: m <= n and A2: n <= len W and A3: W . m = W . n ; ::_thesis: (len (W .remove (m,n))) + n = (len W) + m A4: W .remove (m,n) = (W .cut (1,m)) .append (W .cut (n,(len W))) by A1, A2, A3, Def12; A5: (len (W .cut (n,(len W)))) + n = (len W) + 1 by A2, Lm15; A6: W . n = (W .cut (n,(len W))) .first() by A2, Lm16; A7: 1 <= m by ABIAN:12; A8: m <= len W by A1, A2, XXREAL_0:2; then A9: (len (W .cut (1,m))) + 1 = m + 1 by A7, Lm15, JORDAN12:2; (W .cut (1,m)) .last() = W . n by A3, A7, A8, Lm16, JORDAN12:2; then (len ((W .cut (1,m)) .append (W .cut (n,(len W))))) + 1 = m + (((len W) + 1) + (- n)) by A6, A9, A5, Lm9 .= (((len W) + m) + (- n)) + 1 ; hence (len (W .remove (m,n))) + n = (len W) + m by A4; ::_thesis: verum end; Lm25: for G being _Graph for W being Walk of G for m, n being Element of NAT for x, y being set st W is_Walk_from x,y holds W .remove (m,n) is_Walk_from x,y proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being Element of NAT for x, y being set st W is_Walk_from x,y holds W .remove (m,n) is_Walk_from x,y let W be Walk of G; ::_thesis: for m, n being Element of NAT for x, y being set st W is_Walk_from x,y holds W .remove (m,n) is_Walk_from x,y let m, n be Element of NAT ; ::_thesis: for x, y being set st W is_Walk_from x,y holds W .remove (m,n) is_Walk_from x,y let x, y be set ; ::_thesis: ( W is_Walk_from x,y implies W .remove (m,n) is_Walk_from x,y ) set W2 = W .remove (m,n); set WA = W .cut (1,m); set WB = W .cut (n,(len W)); assume A1: W is_Walk_from x,y ; ::_thesis: W .remove (m,n) is_Walk_from x,y now__::_thesis:_W_.remove_(m,n)_is_Walk_from_x,y percases ( ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) or not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; supposeA2: ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) ; ::_thesis: W .remove (m,n) is_Walk_from x,y then A3: (W .cut (n,(len W))) .last() = W .last() by Lm16 .= y by A1, Def23 ; A4: W .remove (m,n) = (W .cut (1,m)) .append (W .cut (n,(len W))) by A2, Def12; A5: m <= len W by A2, XXREAL_0:2; A6: 1 <= m by A2, ABIAN:12; then A7: (W .cut (1,m)) .first() = W .first() by A2, A5, Lm16, JORDAN12:2 .= x by A1, Def23 ; (W .cut (1,m)) .last() = W . n by A2, A6, A5, Lm16, JORDAN12:2 .= (W .cut (n,(len W))) .first() by A2, Lm16 ; hence W .remove (m,n) is_Walk_from x,y by A4, A7, A3, Lm11; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; ::_thesis: W .remove (m,n) is_Walk_from x,y hence W .remove (m,n) is_Walk_from x,y by A1, Def12; ::_thesis: verum end; end; end; hence W .remove (m,n) is_Walk_from x,y ; ::_thesis: verum end; Lm26: for G being _Graph for W being Walk of G for m, n being Element of NAT holds len (W .remove (m,n)) <= len W proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being Element of NAT holds len (W .remove (m,n)) <= len W let W be Walk of G; ::_thesis: for m, n being Element of NAT holds len (W .remove (m,n)) <= len W let m, n be Element of NAT ; ::_thesis: len (W .remove (m,n)) <= len W set W2 = W .remove (m,n); now__::_thesis:_len_(W_.remove_(m,n))_<=_len_W percases ( ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) or not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; supposeA1: ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) ; ::_thesis: len (W .remove (m,n)) <= len W then (len (W .remove (m,n))) + n = (len W) + m by Lm24; then ((len (W .remove (m,n))) + n) - n <= ((len W) + m) - m by A1, XREAL_1:13; hence len (W .remove (m,n)) <= len W ; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; ::_thesis: len (W .remove (m,n)) <= len W hence len (W .remove (m,n)) <= len W by Def12; ::_thesis: verum end; end; end; hence len (W .remove (m,n)) <= len W ; ::_thesis: verum end; Lm27: for G being _Graph for W being Walk of G for m being Element of NAT holds W .remove (m,m) = W proof let G be _Graph; ::_thesis: for W being Walk of G for m being Element of NAT holds W .remove (m,m) = W let W be Walk of G; ::_thesis: for m being Element of NAT holds W .remove (m,m) = W let m be Element of NAT ; ::_thesis: W .remove (m,m) = W now__::_thesis:_W_.remove_(m,m)_=_W percases ( ( m is odd & m <= len W & W . m = W . m ) or not m is odd or not m <= len W or not W . m = W . m ) ; supposeA1: ( m is odd & m <= len W & W . m = W . m ) ; ::_thesis: W .remove (m,m) = W then A2: 1 <= m by ABIAN:12; thus W .remove (m,m) = (W .cut (1,m)) .append (W .cut (m,(len W))) by A1, Def12 .= W .cut (1,(len W)) by A1, A2, Lm17, JORDAN12:2 .= W by Lm18 ; ::_thesis: verum end; suppose ( not m is odd or not m <= len W or not W . m = W . m ) ; ::_thesis: W .remove (m,m) = W hence W .remove (m,m) = W by Def12; ::_thesis: verum end; end; end; hence W .remove (m,m) = W ; ::_thesis: verum end; Lm28: for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds (W .cut (1,m)) .last() = (W .cut (n,(len W))) .first() proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds (W .cut (1,m)) .last() = (W .cut (n,(len W))) .first() let W be Walk of G; ::_thesis: for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds (W .cut (1,m)) .last() = (W .cut (n,(len W))) .first() let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n <= len W & W . m = W . n implies (W .cut (1,m)) .last() = (W .cut (n,(len W))) .first() ) assume that A1: m <= n and A2: n <= len W and A3: W . m = W . n ; ::_thesis: (W .cut (1,m)) .last() = (W .cut (n,(len W))) .first() A4: 1 <= m by ABIAN:12; m <= len W by A1, A2, XXREAL_0:2; hence (W .cut (1,m)) .last() = W . n by A3, A4, Lm16, JORDAN12:2 .= (W .cut (n,(len W))) .first() by A2, Lm16 ; ::_thesis: verum end; Lm29: for G being _Graph for W being Walk of G for x, y being set for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds for x being Element of NAT st x in Seg m holds (W .remove (m,n)) . x = W . x proof let G be _Graph; ::_thesis: for W being Walk of G for x, y being set for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds for x being Element of NAT st x in Seg m holds (W .remove (m,n)) . x = W . x let W be Walk of G; ::_thesis: for x, y being set for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds for x being Element of NAT st x in Seg m holds (W .remove (m,n)) . x = W . x let x, y be set ; ::_thesis: for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds for x being Element of NAT st x in Seg m holds (W .remove (m,n)) . x = W . x let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n <= len W & W . m = W . n implies for x being Element of NAT st x in Seg m holds (W .remove (m,n)) . x = W . x ) set W2 = W .remove (m,n); assume that A1: m <= n and A2: n <= len W and A3: W . m = W . n ; ::_thesis: for x being Element of NAT st x in Seg m holds (W .remove (m,n)) . x = W . x let x be Element of NAT ; ::_thesis: ( x in Seg m implies (W .remove (m,n)) . x = W . x ) assume A4: x in Seg m ; ::_thesis: (W .remove (m,n)) . x = W . x then x <= m by FINSEQ_1:1; then A5: x <= len (W .cut (1,m)) by A1, A2, Lm22, XXREAL_0:2; 1 <= x by A4, FINSEQ_1:1; then A6: x in dom (W .cut (1,m)) by A5, FINSEQ_3:25; W .remove (m,n) = (W .cut (1,m)) .append (W .cut (n,(len W))) by A1, A2, A3, Def12; hence (W .remove (m,n)) . x = (W .cut (1,m)) . x by A6, Lm12 .= W . x by A1, A2, A6, Lm23, XXREAL_0:2 ; ::_thesis: verum end; Lm30: for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds for x being Element of NAT st m <= x & x <= len (W .remove (m,n)) holds ( (W .remove (m,n)) . x = W . ((x - m) + n) & (x - m) + n is Element of NAT & (x - m) + n <= len W ) proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds for x being Element of NAT st m <= x & x <= len (W .remove (m,n)) holds ( (W .remove (m,n)) . x = W . ((x - m) + n) & (x - m) + n is Element of NAT & (x - m) + n <= len W ) let W be Walk of G; ::_thesis: for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds for x being Element of NAT st m <= x & x <= len (W .remove (m,n)) holds ( (W .remove (m,n)) . x = W . ((x - m) + n) & (x - m) + n is Element of NAT & (x - m) + n <= len W ) let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n <= len W & W . m = W . n implies for x being Element of NAT st m <= x & x <= len (W .remove (m,n)) holds ( (W .remove (m,n)) . x = W . ((x - m) + n) & (x - m) + n is Element of NAT & (x - m) + n <= len W ) ) set W2 = W .remove (m,n); set WA = W .cut (1,m); set WB = W .cut (n,(len W)); assume that A1: m <= n and A2: n <= len W and A3: W . m = W . n ; ::_thesis: for x being Element of NAT st m <= x & x <= len (W .remove (m,n)) holds ( (W .remove (m,n)) . x = W . ((x - m) + n) & (x - m) + n is Element of NAT & (x - m) + n <= len W ) A4: (W .cut (1,m)) .last() = (W .cut (n,(len W))) .first() by A1, A2, A3, Lm28; let x be Element of NAT ; ::_thesis: ( m <= x & x <= len (W .remove (m,n)) implies ( (W .remove (m,n)) . x = W . ((x - m) + n) & (x - m) + n is Element of NAT & (x - m) + n <= len W ) ) assume that A5: m <= x and A6: x <= len (W .remove (m,n)) ; ::_thesis: ( (W .remove (m,n)) . x = W . ((x - m) + n) & (x - m) + n is Element of NAT & (x - m) + n <= len W ) A7: len (W .cut (1,m)) = m by A1, A2, Lm22, XXREAL_0:2; then consider a being Nat such that A8: (len (W .cut (1,m))) + a = x by A5, NAT_1:10; reconsider a = a as Element of NAT by ORDINAL1:def_12; (len (W .remove (m,n))) + n = (len W) + m by A1, A2, A3, Lm24; then (m + a) + n <= m + (len W) by A7, A6, A8, XREAL_1:7; then A9: ((a + n) + m) - m <= ((len W) + m) - m by XREAL_1:13; (len (W .cut (n,(len W)))) + n = (len W) + 1 by A2, Lm15; then (a + n) + 1 <= (len (W .cut (n,(len W)))) + n by A9, XREAL_1:7; then ((a + 1) + n) - n <= ((len (W .cut (n,(len W)))) + n) - n by XREAL_1:13; then A10: (a + 1) - 1 < ((len (W .cut (n,(len W)))) + 1) - 1 by NAT_1:13; W .remove (m,n) = (W .cut (1,m)) .append (W .cut (n,(len W))) by A1, A2, A3, Def12; then (W .remove (m,n)) . x = (W .cut (n,(len W))) . (a + 1) by A4, A8, A10, Lm13 .= W . (a + n) by A2, A10, Lm15 ; hence (W .remove (m,n)) . x = W . ((x - m) + n) by A7, A8; ::_thesis: ( (x - m) + n is Element of NAT & (x - m) + n <= len W ) a + n is Element of NAT ; hence (x - m) + n is Element of NAT by A7, A8; ::_thesis: (x - m) + n <= len W thus (x - m) + n <= len W by A7, A8, A9; ::_thesis: verum end; Lm31: for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds len (W .remove (m,n)) = ((len W) + m) - n proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds len (W .remove (m,n)) = ((len W) + m) - n let W be Walk of G; ::_thesis: for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds len (W .remove (m,n)) = ((len W) + m) - n let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n <= len W & W . m = W . n implies len (W .remove (m,n)) = ((len W) + m) - n ) assume that A1: m <= n and A2: n <= len W and A3: W . m = W . n ; ::_thesis: len (W .remove (m,n)) = ((len W) + m) - n (len (W .remove (m,n))) + n = (len W) + m by A1, A2, A3, Lm24; hence len (W .remove (m,n)) = ((len W) + m) - n ; ::_thesis: verum end; Lm32: for G being _Graph for W being Walk of G for m being Element of NAT st W .first() = W . m holds W .remove (1,m) = W .cut (m,(len W)) proof let G be _Graph; ::_thesis: for W being Walk of G for m being Element of NAT st W .first() = W . m holds W .remove (1,m) = W .cut (m,(len W)) let W be Walk of G; ::_thesis: for m being Element of NAT st W .first() = W . m holds W .remove (1,m) = W .cut (m,(len W)) let m be Element of NAT ; ::_thesis: ( W .first() = W . m implies W .remove (1,m) = W .cut (m,(len W)) ) assume A1: W .first() = W . m ; ::_thesis: W .remove (1,m) = W .cut (m,(len W)) now__::_thesis:_W_.remove_(1,m)_=_W_.cut_(m,(len_W)) percases ( ( m is odd & m <= len W ) or not m is odd or not m <= len W ) ; supposeA2: ( m is odd & m <= len W ) ; ::_thesis: W .remove (1,m) = W .cut (m,(len W)) then 1 <= m by ABIAN:12; then A3: W .remove (1,m) = (W .cut (1,1)) .append (W .cut (m,(len W))) by A1, A2, Def12, JORDAN12:2; A4: 1 <= len W by ABIAN:12; then A5: (W .cut (1,1)) .last() = W . m by A1, Lm16, JORDAN12:2 .= (W .cut (m,(len W))) .first() by A2, Lm16 ; A6: now__::_thesis:_for_n_being_Nat_st_1_<=_n_&_n_<=_len_(W_.remove_(1,m))_holds_ (W_.remove_(1,m))_._n_=_(W_.cut_(m,(len_W)))_._n let n be Nat; ::_thesis: ( 1 <= n & n <= len (W .remove (1,m)) implies (W .remove (1,m)) . n = (W .cut (m,(len W))) . n ) assume that A7: 1 <= n and A8: n <= len (W .remove (1,m)) ; ::_thesis: (W .remove (1,m)) . n = (W .cut (m,(len W))) . n A9: n in dom (W .remove (1,m)) by A7, A8, FINSEQ_3:25; now__::_thesis:_(W_.remove_(1,m))_._n_=_(W_.cut_(m,(len_W)))_._n percases ( n in dom (W .cut (1,1)) or ex k being Element of NAT st ( k < len (W .cut (m,(len W))) & n = (len (W .cut (1,1))) + k ) ) by A3, A9, Lm14; supposeA10: n in dom (W .cut (1,1)) ; ::_thesis: (W .remove (1,m)) . n = (W .cut (m,(len W))) . n then n <= len (W .cut (1,1)) by FINSEQ_3:25; then A11: n <= 1 by A4, Lm22, JORDAN12:2; A12: 1 <= n by A10, FINSEQ_3:25; then A13: n = 1 by A11, XXREAL_0:1; (W .remove (1,m)) . n = (W .cut (1,1)) . n by A3, A10, Lm12 .= <*(W .vertexAt 1)*> . 1 by A4, A13, Lm19, JORDAN12:2 .= W .vertexAt 1 by FINSEQ_1:def_8 .= W . m by A1, A4, Def8, JORDAN12:2 .= (W .cut (m,(len W))) .first() by A2, Lm16 .= (W .cut (m,(len W))) . 1 ; hence (W .remove (1,m)) . n = (W .cut (m,(len W))) . n by A12, A11, XXREAL_0:1; ::_thesis: verum end; suppose ex k being Element of NAT st ( k < len (W .cut (m,(len W))) & n = (len (W .cut (1,1))) + k ) ; ::_thesis: (W .remove (1,m)) . n = (W .cut (m,(len W))) . n then consider k being Element of NAT such that A14: k < len (W .cut (m,(len W))) and A15: n = (len (W .cut (1,1))) + k ; n = k + 1 by A14, A15, Lm22, ABIAN:12, JORDAN12:2; hence (W .remove (1,m)) . n = (W .cut (m,(len W))) . n by A3, A5, A14, A15, Lm13; ::_thesis: verum end; end; end; hence (W .remove (1,m)) . n = (W .cut (m,(len W))) . n ; ::_thesis: verum end; (len (W .remove (1,m))) + 1 = (len (W .cut (1,1))) + (len (W .cut (m,(len W)))) by A3, A5, Lm9; then (len (W .remove (1,m))) + 1 = (len (W .cut (m,(len W)))) + 1 by Lm22, ABIAN:12, JORDAN12:2; hence W .remove (1,m) = W .cut (m,(len W)) by A6, FINSEQ_1:14; ::_thesis: verum end; supposeA16: ( not m is odd or not m <= len W ) ; ::_thesis: W .remove (1,m) = W .cut (m,(len W)) then W .cut (m,(len W)) = W by Def11; hence W .remove (1,m) = W .cut (m,(len W)) by A16, Def12; ::_thesis: verum end; end; end; hence W .remove (1,m) = W .cut (m,(len W)) ; ::_thesis: verum end; Lm33: for G being _Graph for W being Walk of G for m, n being Element of NAT holds ( (W .remove (m,n)) .first() = W .first() & (W .remove (m,n)) .last() = W .last() ) proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being Element of NAT holds ( (W .remove (m,n)) .first() = W .first() & (W .remove (m,n)) .last() = W .last() ) let W be Walk of G; ::_thesis: for m, n being Element of NAT holds ( (W .remove (m,n)) .first() = W .first() & (W .remove (m,n)) .last() = W .last() ) let m, n be Element of NAT ; ::_thesis: ( (W .remove (m,n)) .first() = W .first() & (W .remove (m,n)) .last() = W .last() ) W is_Walk_from W .first() ,W .last() by Def23; then W .remove (m,n) is_Walk_from W .first() ,W .last() by Lm25; hence ( (W .remove (m,n)) .first() = W .first() & (W .remove (m,n)) .last() = W .last() ) by Def23; ::_thesis: verum end; Lm34: for G being _Graph for W being Walk of G for m, n being odd Element of NAT for x being Element of NAT holds ( not x in dom (W .remove (m,n)) or x in Seg m or ( m <= x & x <= len (W .remove (m,n)) ) ) proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT for x being Element of NAT holds ( not x in dom (W .remove (m,n)) or x in Seg m or ( m <= x & x <= len (W .remove (m,n)) ) ) let W be Walk of G; ::_thesis: for m, n being odd Element of NAT for x being Element of NAT holds ( not x in dom (W .remove (m,n)) or x in Seg m or ( m <= x & x <= len (W .remove (m,n)) ) ) let m, n be odd Element of NAT ; ::_thesis: for x being Element of NAT holds ( not x in dom (W .remove (m,n)) or x in Seg m or ( m <= x & x <= len (W .remove (m,n)) ) ) let x be Element of NAT ; ::_thesis: ( not x in dom (W .remove (m,n)) or x in Seg m or ( m <= x & x <= len (W .remove (m,n)) ) ) assume A1: x in dom (W .remove (m,n)) ; ::_thesis: ( x in Seg m or ( m <= x & x <= len (W .remove (m,n)) ) ) 1 <= x by A1, FINSEQ_3:25; hence ( x in Seg m or ( m <= x & x <= len (W .remove (m,n)) ) ) by A1, FINSEQ_1:1, FINSEQ_3:25; ::_thesis: verum end; Lm35: for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds W .addEdge e = W ^ <*e,x*> proof let G be _Graph; ::_thesis: for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds W .addEdge e = W ^ <*e,x*> let W be Walk of G; ::_thesis: for e, x being set st e Joins W .last() ,x,G holds W .addEdge e = W ^ <*e,x*> let e, x be set ; ::_thesis: ( e Joins W .last() ,x,G implies W .addEdge e = W ^ <*e,x*> ) set W1 = G .walkOf ((W .last()),e,((W .last()) .adj e)); assume A1: e Joins W .last() ,x,G ; ::_thesis: W .addEdge e = W ^ <*e,x*> then reconsider x9 = x as Vertex of G by GLIB_000:13; A2: (W .last()) .adj e = x9 by A1, GLIB_000:66; then A3: G .walkOf ((W .last()),e,((W .last()) .adj e)) = <*(W .last()),e,x*> by A1, Def5; then A4: len (G .walkOf ((W .last()),e,((W .last()) .adj e))) = 3 by FINSEQ_1:45; A5: (G .walkOf ((W .last()),e,((W .last()) .adj e))) . 3 = x by A3, FINSEQ_1:45; (G .walkOf ((W .last()),e,((W .last()) .adj e))) . 2 = e by A3, FINSEQ_1:45; then (2,2) -cut (G .walkOf ((W .last()),e,((W .last()) .adj e))) = <*e*> by A4, GRAPH_2:6; then <*e*> ^ (((2 + 1),3) -cut (G .walkOf ((W .last()),e,((W .last()) .adj e)))) = ((1 + 1),3) -cut (G .walkOf ((W .last()),e,((W .last()) .adj e))) by A4, GRAPH_2:8; then A6: <*e*> ^ <*x*> = (2,3) -cut (G .walkOf ((W .last()),e,((W .last()) .adj e))) by A4, A5, GRAPH_2:6; W .last() = (G .walkOf ((W .last()),e,((W .last()) .adj e))) .first() by A1, A2, Lm6; then W .append (G .walkOf ((W .last()),e,((W .last()) .adj e))) = W ^' (G .walkOf ((W .last()),e,((W .last()) .adj e))) by Def10 .= W ^ ((2,(len (G .walkOf ((W .last()),e,((W .last()) .adj e))))) -cut (G .walkOf ((W .last()),e,((W .last()) .adj e)))) by GRAPH_2:def_2 .= W ^ ((2,3) -cut (G .walkOf ((W .last()),e,((W .last()) .adj e)))) by A3, FINSEQ_1:45 ; hence W .addEdge e = W ^ <*e,x*> by A6, FINSEQ_1:def_9; ::_thesis: verum end; Lm36: for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds ( (W .addEdge e) .first() = W .first() & (W .addEdge e) .last() = x & W .addEdge e is_Walk_from W .first() ,x ) proof let G be _Graph; ::_thesis: for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds ( (W .addEdge e) .first() = W .first() & (W .addEdge e) .last() = x & W .addEdge e is_Walk_from W .first() ,x ) let W be Walk of G; ::_thesis: for e, x being set st e Joins W .last() ,x,G holds ( (W .addEdge e) .first() = W .first() & (W .addEdge e) .last() = x & W .addEdge e is_Walk_from W .first() ,x ) let e, x be set ; ::_thesis: ( e Joins W .last() ,x,G implies ( (W .addEdge e) .first() = W .first() & (W .addEdge e) .last() = x & W .addEdge e is_Walk_from W .first() ,x ) ) set W2 = G .walkOf ((W .last()),e,((W .last()) .adj e)); assume A1: e Joins W .last() ,x,G ; ::_thesis: ( (W .addEdge e) .first() = W .first() & (W .addEdge e) .last() = x & W .addEdge e is_Walk_from W .first() ,x ) then reconsider x9 = x as Vertex of G by GLIB_000:13; A2: (W .last()) .adj e = x9 by A1, GLIB_000:66; then A3: (G .walkOf ((W .last()),e,((W .last()) .adj e))) .last() = x by A1, Lm6; (G .walkOf ((W .last()),e,((W .last()) .adj e))) .first() = W .last() by A1, A2, Lm6; hence ( (W .addEdge e) .first() = W .first() & (W .addEdge e) .last() = x & W .addEdge e is_Walk_from W .first() ,x ) by A3, Lm11; ::_thesis: verum end; Lm37: for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds len (W .addEdge e) = (len W) + 2 proof let G be _Graph; ::_thesis: for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds len (W .addEdge e) = (len W) + 2 let W be Walk of G; ::_thesis: for e, x being set st e Joins W .last() ,x,G holds len (W .addEdge e) = (len W) + 2 let e, x be set ; ::_thesis: ( e Joins W .last() ,x,G implies len (W .addEdge e) = (len W) + 2 ) set W2 = G .walkOf ((W .last()),e,((W .last()) .adj e)); assume A1: e Joins W .last() ,x,G ; ::_thesis: len (W .addEdge e) = (len W) + 2 then reconsider x9 = x as Vertex of G by GLIB_000:13; A2: (W .last()) .adj e = x9 by A1, GLIB_000:66; then (G .walkOf ((W .last()),e,((W .last()) .adj e))) .first() = W .last() by A1, Lm6; then A3: (len (W .addEdge e)) + 1 = (len W) + (len (G .walkOf ((W .last()),e,((W .last()) .adj e)))) by Lm9; G .walkOf ((W .last()),e,((W .last()) .adj e)) = <*(W .last()),e,x*> by A1, A2, Def5; then (len (W .addEdge e)) + 1 = (len W) + 3 by A3, FINSEQ_1:45; hence len (W .addEdge e) = (len W) + 2 ; ::_thesis: verum end; Lm38: for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds ( (W .addEdge e) . ((len W) + 1) = e & (W .addEdge e) . ((len W) + 2) = x & ( for n being Element of NAT st n in dom W holds (W .addEdge e) . n = W . n ) ) proof let G be _Graph; ::_thesis: for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds ( (W .addEdge e) . ((len W) + 1) = e & (W .addEdge e) . ((len W) + 2) = x & ( for n being Element of NAT st n in dom W holds (W .addEdge e) . n = W . n ) ) let W be Walk of G; ::_thesis: for e, x being set st e Joins W .last() ,x,G holds ( (W .addEdge e) . ((len W) + 1) = e & (W .addEdge e) . ((len W) + 2) = x & ( for n being Element of NAT st n in dom W holds (W .addEdge e) . n = W . n ) ) let e, x be set ; ::_thesis: ( e Joins W .last() ,x,G implies ( (W .addEdge e) . ((len W) + 1) = e & (W .addEdge e) . ((len W) + 2) = x & ( for n being Element of NAT st n in dom W holds (W .addEdge e) . n = W . n ) ) ) set W2 = W .addEdge e; A1: <*e,x*> . 1 = e by FINSEQ_1:44; assume e Joins W .last() ,x,G ; ::_thesis: ( (W .addEdge e) . ((len W) + 1) = e & (W .addEdge e) . ((len W) + 2) = x & ( for n being Element of NAT st n in dom W holds (W .addEdge e) . n = W . n ) ) then A2: W .addEdge e = W ^ <*e,x*> by Lm35; A3: dom <*e,x*> = Seg 2 by FINSEQ_1:89; then 1 in dom <*e,x*> by FINSEQ_1:1; hence (W .addEdge e) . ((len W) + 1) = e by A2, A1, FINSEQ_1:def_7; ::_thesis: ( (W .addEdge e) . ((len W) + 2) = x & ( for n being Element of NAT st n in dom W holds (W .addEdge e) . n = W . n ) ) A4: <*e,x*> . 2 = x by FINSEQ_1:44; 2 in dom <*e,x*> by A3, FINSEQ_1:1; hence (W .addEdge e) . ((len W) + 2) = x by A2, A4, FINSEQ_1:def_7; ::_thesis: for n being Element of NAT st n in dom W holds (W .addEdge e) . n = W . n let n be Element of NAT ; ::_thesis: ( n in dom W implies (W .addEdge e) . n = W . n ) assume n in dom W ; ::_thesis: (W .addEdge e) . n = W . n hence (W .addEdge e) . n = W . n by A2, FINSEQ_1:def_7; ::_thesis: verum end; Lm39: for G being _Graph for W being Walk of G for e, x, y, z being set st W is_Walk_from x,y & e Joins y,z,G holds W .addEdge e is_Walk_from x,z proof let G be _Graph; ::_thesis: for W being Walk of G for e, x, y, z being set st W is_Walk_from x,y & e Joins y,z,G holds W .addEdge e is_Walk_from x,z let W be Walk of G; ::_thesis: for e, x, y, z being set st W is_Walk_from x,y & e Joins y,z,G holds W .addEdge e is_Walk_from x,z let e, x, y, z be set ; ::_thesis: ( W is_Walk_from x,y & e Joins y,z,G implies W .addEdge e is_Walk_from x,z ) assume that A1: W is_Walk_from x,y and A2: e Joins y,z,G ; ::_thesis: W .addEdge e is_Walk_from x,z A3: W .last() = y by A1, Def23; W .first() = x by A1, Def23; hence W .addEdge e is_Walk_from x,z by A2, A3, Lm36; ::_thesis: verum end; Lm40: for G being _Graph for W being Walk of G for n being even Element of NAT st 1 <= n & n <= len W holds ( n div 2 in dom (W .edgeSeq()) & W . n = (W .edgeSeq()) . (n div 2) ) proof let G be _Graph; ::_thesis: for W being Walk of G for n being even Element of NAT st 1 <= n & n <= len W holds ( n div 2 in dom (W .edgeSeq()) & W . n = (W .edgeSeq()) . (n div 2) ) let W be Walk of G; ::_thesis: for n being even Element of NAT st 1 <= n & n <= len W holds ( n div 2 in dom (W .edgeSeq()) & W . n = (W .edgeSeq()) . (n div 2) ) let n be even Element of NAT ; ::_thesis: ( 1 <= n & n <= len W implies ( n div 2 in dom (W .edgeSeq()) & W . n = (W .edgeSeq()) . (n div 2) ) ) assume that A1: 1 <= n and A2: n <= len W ; ::_thesis: ( n div 2 in dom (W .edgeSeq()) & W . n = (W .edgeSeq()) . (n div 2) ) A3: 2 divides n by PEPIN:22; then A4: n = 2 * (n div 2) by NAT_D:3; A5: now__::_thesis:_n_div_2_in_dom_(W_.edgeSeq()) assume A6: not n div 2 in dom (W .edgeSeq()) ; ::_thesis: contradiction now__::_thesis:_contradiction percases ( n div 2 < 0 + 1 or n div 2 > len (W .edgeSeq()) ) by A6, FINSEQ_3:25; suppose n div 2 < 0 + 1 ; ::_thesis: contradiction then n div 2 = 0 by NAT_1:13; then n = 2 * 0 by A3, NAT_D:3; hence contradiction by A1; ::_thesis: verum end; suppose n div 2 > len (W .edgeSeq()) ; ::_thesis: contradiction then 2 * (n div 2) > 2 * (len (W .edgeSeq())) by XREAL_1:68; then n + 1 > (2 * (len (W .edgeSeq()))) + 1 by A4, XREAL_1:8; then n + 1 > len W by Def15; then n >= len W by NAT_1:13; hence contradiction by A2, XXREAL_0:1; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; hence n div 2 in dom (W .edgeSeq()) ; ::_thesis: W . n = (W .edgeSeq()) . (n div 2) A7: n div 2 <= len (W .edgeSeq()) by A5, FINSEQ_3:25; 1 <= n div 2 by A5, FINSEQ_3:25; hence W . n = (W .edgeSeq()) . (n div 2) by A4, A7, Def15; ::_thesis: verum end; Lm41: for G being _Graph for W being Walk of G for n being Element of NAT holds ( n in dom (W .edgeSeq()) iff 2 * n in dom W ) proof let G be _Graph; ::_thesis: for W being Walk of G for n being Element of NAT holds ( n in dom (W .edgeSeq()) iff 2 * n in dom W ) let W be Walk of G; ::_thesis: for n being Element of NAT holds ( n in dom (W .edgeSeq()) iff 2 * n in dom W ) let n be Element of NAT ; ::_thesis: ( n in dom (W .edgeSeq()) iff 2 * n in dom W ) hereby ::_thesis: ( 2 * n in dom W implies n in dom (W .edgeSeq()) ) assume A1: n in dom (W .edgeSeq()) ; ::_thesis: 2 * n in dom W then n <= len (W .edgeSeq()) by FINSEQ_3:25; then 2 * n <= (len (W .edgeSeq())) * 2 by NAT_1:4; then 2 * n <= ((len (W .edgeSeq())) * 2) + 1 by NAT_1:12; then A2: 2 * n <= len W by Def15; 1 <= n by A1, FINSEQ_3:25; then 1 <= n + n by NAT_1:12; hence 2 * n in dom W by A2, FINSEQ_3:25; ::_thesis: verum end; assume A3: 2 * n in dom W ; ::_thesis: n in dom (W .edgeSeq()) then A4: 2 * n <= len W by FINSEQ_3:25; 1 <= 2 * n by A3, FINSEQ_3:25; then (2 * n) div 2 in dom (W .edgeSeq()) by A4, Lm40; hence n in dom (W .edgeSeq()) by NAT_D:20; ::_thesis: verum end; Lm42: for G being _Graph for W being Walk of G ex lenWaa1 being even Element of NAT st ( lenWaa1 = (len W) - 1 & len (W .edgeSeq()) = lenWaa1 div 2 ) proof let G be _Graph; ::_thesis: for W being Walk of G ex lenWaa1 being even Element of NAT st ( lenWaa1 = (len W) - 1 & len (W .edgeSeq()) = lenWaa1 div 2 ) let W be Walk of G; ::_thesis: ex lenWaa1 being even Element of NAT st ( lenWaa1 = (len W) - 1 & len (W .edgeSeq()) = lenWaa1 div 2 ) set lenWaa1 = (len W) - 1; reconsider lenWaa1 = (len W) - 1 as even Element of NAT by ABIAN:12, INT_1:5; take lenWaa1 ; ::_thesis: ( lenWaa1 = (len W) - 1 & len (W .edgeSeq()) = lenWaa1 div 2 ) thus lenWaa1 = (len W) - 1 ; ::_thesis: len (W .edgeSeq()) = lenWaa1 div 2 2 divides lenWaa1 by PEPIN:22; then A1: lenWaa1 = 2 * (lenWaa1 div 2) by NAT_D:3; len W = (2 * (len (W .edgeSeq()))) + 1 by Def15; hence len (W .edgeSeq()) = lenWaa1 div 2 by A1; ::_thesis: verum end; Lm43: for G being _Graph for W being Walk of G for n being Element of NAT holds (W .cut (1,n)) .edgeSeq() c= W .edgeSeq() proof let G be _Graph; ::_thesis: for W being Walk of G for n being Element of NAT holds (W .cut (1,n)) .edgeSeq() c= W .edgeSeq() let W be Walk of G; ::_thesis: for n being Element of NAT holds (W .cut (1,n)) .edgeSeq() c= W .edgeSeq() let n be Element of NAT ; ::_thesis: (W .cut (1,n)) .edgeSeq() c= W .edgeSeq() percases ( ( n is odd & 1 <= n & n <= len W ) or not n is odd or not 1 <= n or not n <= len W ) ; supposeA1: ( n is odd & 1 <= n & n <= len W ) ; ::_thesis: (W .cut (1,n)) .edgeSeq() c= W .edgeSeq() set f = (W .cut (1,n)) .edgeSeq() ; now__::_thesis:_for_e_being_set_st_e_in_(W_.cut_(1,n))_.edgeSeq()_holds_ e_in_W_.edgeSeq() let e be set ; ::_thesis: ( e in (W .cut (1,n)) .edgeSeq() implies e in W .edgeSeq() ) assume A2: e in (W .cut (1,n)) .edgeSeq() ; ::_thesis: e in W .edgeSeq() then consider x, y being set such that A3: e = [x,y] by RELAT_1:def_1; A4: y = ((W .cut (1,n)) .edgeSeq()) . x by A2, A3, FUNCT_1:1; A5: x in dom ((W .cut (1,n)) .edgeSeq()) by A2, A3, FUNCT_1:1; then reconsider x = x as Element of NAT ; A6: x <= len ((W .cut (1,n)) .edgeSeq()) by A5, FINSEQ_3:25; A7: 2 * x in dom (W .cut (1,n)) by A5, Lm41; then 2 * x <= len (W .cut (1,n)) by FINSEQ_3:25; then 2 * x <= n by A1, Lm22; then A8: 2 * x <= len W by A1, XXREAL_0:2; 1 <= 2 * x by A7, FINSEQ_3:25; then 2 * x in dom W by A8, FINSEQ_3:25; then A9: x in dom (W .edgeSeq()) by Lm41; then A10: x <= len (W .edgeSeq()) by FINSEQ_3:25; 1 <= x by A5, FINSEQ_3:25; then y = (W .cut (1,n)) . (2 * x) by A4, A6, Def15; then A11: y = W . (2 * x) by A1, A7, Lm23; 1 <= x by A9, FINSEQ_3:25; then (W .edgeSeq()) . x = y by A11, A10, Def15; hence e in W .edgeSeq() by A3, A9, FUNCT_1:1; ::_thesis: verum end; hence (W .cut (1,n)) .edgeSeq() c= W .edgeSeq() by TARSKI:def_3; ::_thesis: verum end; suppose ( not n is odd or not 1 <= n or not n <= len W ) ; ::_thesis: (W .cut (1,n)) .edgeSeq() c= W .edgeSeq() hence (W .cut (1,n)) .edgeSeq() c= W .edgeSeq() by Def11; ::_thesis: verum end; end; end; Lm44: for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .edgeSeq() = (W .edgeSeq()) ^ <*e*> proof let G be _Graph; ::_thesis: for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .edgeSeq() = (W .edgeSeq()) ^ <*e*> let W be Walk of G; ::_thesis: for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .edgeSeq() = (W .edgeSeq()) ^ <*e*> let e, x be set ; ::_thesis: ( e Joins W .last() ,x,G implies (W .addEdge e) .edgeSeq() = (W .edgeSeq()) ^ <*e*> ) set W2 = W .addEdge e; set W3 = (W .edgeSeq()) ^ <*e*>; assume A1: e Joins W .last() ,x,G ; ::_thesis: (W .addEdge e) .edgeSeq() = (W .edgeSeq()) ^ <*e*> then len (W .addEdge e) = (len W) + 2 by Lm37; then (len W) + 2 = (2 * (len ((W .addEdge e) .edgeSeq()))) + 1 by Def15; then 2 + ((2 * (len (W .edgeSeq()))) + 1) = (2 * (len ((W .addEdge e) .edgeSeq()))) + 1 by Def15; then A2: 2 * ((len (W .edgeSeq())) + 1) = 2 * (len ((W .addEdge e) .edgeSeq())) ; len ((W .edgeSeq()) ^ <*e*>) = (len (W .edgeSeq())) + (len <*e*>) by FINSEQ_1:22; then A3: 2 * (len ((W .edgeSeq()) ^ <*e*>)) = 2 * (len ((W .addEdge e) .edgeSeq())) by A2, FINSEQ_1:39; now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((W_.addEdge_e)_.edgeSeq())_holds_ ((W_.addEdge_e)_.edgeSeq())_._k_=_((W_.edgeSeq())_^_<*e*>)_._k let k be Nat; ::_thesis: ( 1 <= k & k <= len ((W .addEdge e) .edgeSeq()) implies ((W .addEdge e) .edgeSeq()) . k = ((W .edgeSeq()) ^ <*e*>) . k ) assume that A4: 1 <= k and A5: k <= len ((W .addEdge e) .edgeSeq()) ; ::_thesis: ((W .addEdge e) .edgeSeq()) . k = ((W .edgeSeq()) ^ <*e*>) . k A6: ((W .addEdge e) .edgeSeq()) . k = (W .addEdge e) . (2 * k) by A4, A5, Def15; A7: k in dom ((W .edgeSeq()) ^ <*e*>) by A3, A4, A5, FINSEQ_3:25; now__::_thesis:_((W_.addEdge_e)_.edgeSeq())_._k_=_((W_.edgeSeq())_^_<*e*>)_._k percases ( k in dom (W .edgeSeq()) or ex n being Nat st ( n in dom <*e*> & k = (len (W .edgeSeq())) + n ) ) by A7, FINSEQ_1:25; supposeA8: k in dom (W .edgeSeq()) ; ::_thesis: ((W .addEdge e) .edgeSeq()) . k = ((W .edgeSeq()) ^ <*e*>) . k then A9: 2 * k in dom W by Lm41; A10: 1 <= k by A8, FINSEQ_3:25; A11: k <= len (W .edgeSeq()) by A8, FINSEQ_3:25; ((W .edgeSeq()) ^ <*e*>) . k = (W .edgeSeq()) . k by A8, FINSEQ_1:def_7; then ((W .edgeSeq()) ^ <*e*>) . k = W . (2 * k) by A10, A11, Def15; hence ((W .addEdge e) .edgeSeq()) . k = ((W .edgeSeq()) ^ <*e*>) . k by A1, A6, A9, Lm38; ::_thesis: verum end; suppose ex n being Nat st ( n in dom <*e*> & k = (len (W .edgeSeq())) + n ) ; ::_thesis: ((W .addEdge e) .edgeSeq()) . k = ((W .edgeSeq()) ^ <*e*>) . k then consider n being Element of NAT such that A12: n in dom <*e*> and A13: k = (len (W .edgeSeq())) + n ; n in {1} by A12, FINSEQ_1:2, FINSEQ_1:38; then A14: n = 1 by TARSKI:def_1; then A15: 2 * k = ((2 * (len (W .edgeSeq()))) + 1) + 1 by A13 .= (len W) + 1 by Def15 ; ((W .edgeSeq()) ^ <*e*>) . k = <*e*> . 1 by A12, A13, A14, FINSEQ_1:def_7 .= e by FINSEQ_1:def_8 ; hence ((W .addEdge e) .edgeSeq()) . k = ((W .edgeSeq()) ^ <*e*>) . k by A1, A6, A15, Lm38; ::_thesis: verum end; end; end; hence ((W .addEdge e) .edgeSeq()) . k = ((W .edgeSeq()) ^ <*e*>) . k ; ::_thesis: verum end; hence (W .addEdge e) .edgeSeq() = (W .edgeSeq()) ^ <*e*> by A3, FINSEQ_1:14; ::_thesis: verum end; Lm45: for G being _Graph for W being Walk of G for x being set holds ( x in W .vertices() iff ex n being odd Element of NAT st ( n <= len W & W . n = x ) ) proof let G be _Graph; ::_thesis: for W being Walk of G for x being set holds ( x in W .vertices() iff ex n being odd Element of NAT st ( n <= len W & W . n = x ) ) let W be Walk of G; ::_thesis: for x being set holds ( x in W .vertices() iff ex n being odd Element of NAT st ( n <= len W & W . n = x ) ) let x be set ; ::_thesis: ( x in W .vertices() iff ex n being odd Element of NAT st ( n <= len W & W . n = x ) ) set vs = W .vertexSeq() ; hereby ::_thesis: ( ex n being odd Element of NAT st ( n <= len W & W . n = x ) implies x in W .vertices() ) assume x in W .vertices() ; ::_thesis: ex n being odd Element of NAT st ( n <= len W & W . n = x ) then consider i being Nat such that A1: i in dom (W .vertexSeq()) and A2: (W .vertexSeq()) . i = x by FINSEQ_2:10; set n1 = 2 * i; reconsider n1 = 2 * i as even Nat ; set n = n1 - 1; A3: 1 <= i by A1, FINSEQ_3:25; then 1 <= i + i by NAT_1:12; then reconsider n = n1 - 1 as odd Element of NAT by INT_1:5; take n = n; ::_thesis: ( n <= len W & W . n = x ) A4: i <= len (W .vertexSeq()) by A1, FINSEQ_3:25; then i * 2 <= (len (W .vertexSeq())) * 2 by XREAL_1:64; then i * 2 <= (len W) + 1 by Def14; then n1 - 1 <= ((len W) + 1) - 1 by XREAL_1:13; hence n <= len W ; ::_thesis: W . n = x thus W . n = x by A2, A3, A4, Def14; ::_thesis: verum end; assume ex n being odd Element of NAT st ( n <= len W & W . n = x ) ; ::_thesis: x in W .vertices() then consider n being odd Element of NAT such that A5: n <= len W and A6: W . n = x ; set n1 = n + 1; reconsider n1 = n + 1 as even Element of NAT ; set i = n1 div 2; A7: 2 divides n1 by PEPIN:22; then A8: 2 * (n1 div 2) = n1 by NAT_D:3; reconsider i = n1 div 2 as Element of NAT ; 1 <= n by ABIAN:12; then 1 + 1 <= n1 by XREAL_1:7; then 2 * 1 <= 2 * i by A7, NAT_D:3; then A9: 1 <= i by XREAL_1:68; n1 <= (len W) + 1 by A5, XREAL_1:7; then 2 * i <= 2 * (len (W .vertexSeq())) by A8, Def14; then A10: i <= len (W .vertexSeq()) by XREAL_1:68; then A11: i in dom (W .vertexSeq()) by A9, FINSEQ_3:25; (W .vertexSeq()) . i = W . ((2 * i) - 1) by A9, A10, Def14 .= x by A6, A8 ; hence x in W .vertices() by A11, FUNCT_1:def_3; ::_thesis: verum end; Lm46: for G being _Graph for W being Walk of G for e being set holds ( e in W .edges() iff ex n being even Element of NAT st ( 1 <= n & n <= len W & W . n = e ) ) proof let G be _Graph; ::_thesis: for W being Walk of G for e being set holds ( e in W .edges() iff ex n being even Element of NAT st ( 1 <= n & n <= len W & W . n = e ) ) let W be Walk of G; ::_thesis: for e being set holds ( e in W .edges() iff ex n being even Element of NAT st ( 1 <= n & n <= len W & W . n = e ) ) let e be set ; ::_thesis: ( e in W .edges() iff ex n being even Element of NAT st ( 1 <= n & n <= len W & W . n = e ) ) set es = W .edgeSeq() ; hereby ::_thesis: ( ex n being even Element of NAT st ( 1 <= n & n <= len W & W . n = e ) implies e in W .edges() ) assume e in W .edges() ; ::_thesis: ex n being even Element of NAT st ( 1 <= n & n <= len W & W . n = e ) then consider i being Nat such that A1: i in dom (W .edgeSeq()) and A2: (W .edgeSeq()) . i = e by FINSEQ_2:10; set n = 2 * i; reconsider n = 2 * i as even Element of NAT ; take n = n; ::_thesis: ( 1 <= n & n <= len W & W . n = e ) A3: 1 <= i by A1, FINSEQ_3:25; then 1 <= i + i by NAT_1:12; hence 1 <= n ; ::_thesis: ( n <= len W & W . n = e ) A4: i <= len (W .edgeSeq()) by A1, FINSEQ_3:25; then i * 2 <= (len (W .edgeSeq())) * 2 by XREAL_1:64; then n <= ((len (W .edgeSeq())) * 2) + 1 by NAT_1:12; hence n <= len W by Def15; ::_thesis: W . n = e thus W . n = e by A2, A3, A4, Def15; ::_thesis: verum end; assume ex n being even Element of NAT st ( 1 <= n & n <= len W & W . n = e ) ; ::_thesis: e in W .edges() then consider n being even Element of NAT such that A5: 1 <= n and A6: n <= len W and A7: W . n = e ; set i = n div 2; 2 divides n by PEPIN:22; then A8: 2 * (n div 2) = n by NAT_D:3; reconsider i = n div 2 as Element of NAT ; 1 < n by A5, JORDAN12:2, XXREAL_0:1; then 1 + 1 < n + 1 by XREAL_1:8; then 2 * 1 <= 2 * i by A8, NAT_1:13; then A9: 1 <= i by XREAL_1:68; n < len W by A6, XXREAL_0:1; then 2 * i < (2 * (len (W .edgeSeq()))) + 1 by A8, Def15; then 2 * i <= 2 * (len (W .edgeSeq())) by NAT_1:13; then A10: i <= len (W .edgeSeq()) by XREAL_1:68; then A11: i in dom (W .edgeSeq()) by A9, FINSEQ_3:25; (W .edgeSeq()) . i = e by A7, A8, A9, A10, Def15; hence e in W .edges() by A11, FUNCT_1:def_3; ::_thesis: verum end; Lm47: for G being _Graph for W being Walk of G for e being set st e in W .edges() holds ex v1, v2 being Vertex of G ex n being odd Element of NAT st ( n + 2 <= len W & v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) & e Joins v1,v2,G ) proof let G be _Graph; ::_thesis: for W being Walk of G for e being set st e in W .edges() holds ex v1, v2 being Vertex of G ex n being odd Element of NAT st ( n + 2 <= len W & v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) & e Joins v1,v2,G ) let W be Walk of G; ::_thesis: for e being set st e in W .edges() holds ex v1, v2 being Vertex of G ex n being odd Element of NAT st ( n + 2 <= len W & v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) & e Joins v1,v2,G ) let e be set ; ::_thesis: ( e in W .edges() implies ex v1, v2 being Vertex of G ex n being odd Element of NAT st ( n + 2 <= len W & v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) & e Joins v1,v2,G ) ) reconsider lenW = len W as odd Element of NAT ; assume e in W .edges() ; ::_thesis: ex v1, v2 being Vertex of G ex n being odd Element of NAT st ( n + 2 <= len W & v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) & e Joins v1,v2,G ) then consider n1 being even Element of NAT such that A1: 1 <= n1 and A2: n1 <= len W and A3: W . n1 = e by Lm46; reconsider n = n1 - 1 as odd Element of NAT by A1, INT_1:5; set v1 = W . n; set v2 = W . (n + 2); n1 - 1 <= (len W) - 0 by A2, XREAL_1:13; then reconsider v1 = W . n as Vertex of G by Lm1; n1 < lenW by A2, XXREAL_0:1; then A4: (n + 1) + 1 <= len W by NAT_1:13; then reconsider v2 = W . (n + 2) as Vertex of G by Lm1; take v1 ; ::_thesis: ex v2 being Vertex of G ex n being odd Element of NAT st ( n + 2 <= len W & v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) & e Joins v1,v2,G ) take v2 ; ::_thesis: ex n being odd Element of NAT st ( n + 2 <= len W & v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) & e Joins v1,v2,G ) take n ; ::_thesis: ( n + 2 <= len W & v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) & e Joins v1,v2,G ) thus n + 2 <= len W by A4; ::_thesis: ( v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) & e Joins v1,v2,G ) thus ( v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) ) by A3; ::_thesis: e Joins v1,v2,G (n + 1) - 1 < (len W) - 0 by A2, XREAL_1:15; hence e Joins v1,v2,G by A3, Def3; ::_thesis: verum end; Lm48: for G being _Graph for W being Walk of G for e, x, y being set st e in W .edges() & e Joins x,y,G holds ( x in W .vertices() & y in W .vertices() ) proof let G be _Graph; ::_thesis: for W being Walk of G for e, x, y being set st e in W .edges() & e Joins x,y,G holds ( x in W .vertices() & y in W .vertices() ) let W be Walk of G; ::_thesis: for e, x, y being set st e in W .edges() & e Joins x,y,G holds ( x in W .vertices() & y in W .vertices() ) let e, x, y be set ; ::_thesis: ( e in W .edges() & e Joins x,y,G implies ( x in W .vertices() & y in W .vertices() ) ) assume that A1: e in W .edges() and A2: e Joins x,y,G ; ::_thesis: ( x in W .vertices() & y in W .vertices() ) consider v1, v2 being Vertex of G, n being odd Element of NAT such that A3: n + 2 <= len W and A4: v1 = W . n and e = W . (n + 1) and A5: v2 = W . (n + 2) and A6: e Joins v1,v2,G by A1, Lm47; (n + 2) - 2 <= (len W) - 0 by A3, XREAL_1:13; then A7: v1 in W .vertices() by A4, Lm45; v2 in W .vertices() by A3, A5, Lm45; hence ( x in W .vertices() & y in W .vertices() ) by A2, A6, A7, GLIB_000:15; ::_thesis: verum end; Lm49: for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds W .find n <= n proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n <= len W holds W .find n <= n let W be Walk of G; ::_thesis: for n being odd Element of NAT st n <= len W holds W .find n <= n let n be odd Element of NAT ; ::_thesis: ( n <= len W implies W .find n <= n ) assume A1: n <= len W ; ::_thesis: W .find n <= n then for k being odd Element of NAT st k <= len W & W . k = W . n holds W .find n <= k by Def20; hence W .find n <= n by A1; ::_thesis: verum end; Lm50: for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds W .rfind n >= n proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n <= len W holds W .rfind n >= n let W be Walk of G; ::_thesis: for n being odd Element of NAT st n <= len W holds W .rfind n >= n let n be odd Element of NAT ; ::_thesis: ( n <= len W implies W .rfind n >= n ) assume A1: n <= len W ; ::_thesis: W .rfind n >= n then for k being odd Element of NAT st k <= len W & W . k = W . n holds k <= W .rfind n by Def22; hence W .rfind n >= n by A1; ::_thesis: verum end; Lm51: for G being _Graph for W being Walk of G holds ( W is directed iff for n being odd Element of NAT st n < len W holds W . (n + 1) DJoins W . n,W . (n + 2),G ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W is directed iff for n being odd Element of NAT st n < len W holds W . (n + 1) DJoins W . n,W . (n + 2),G ) let W be Walk of G; ::_thesis: ( W is directed iff for n being odd Element of NAT st n < len W holds W . (n + 1) DJoins W . n,W . (n + 2),G ) hereby ::_thesis: ( ( for n being odd Element of NAT st n < len W holds W . (n + 1) DJoins W . n,W . (n + 2),G ) implies W is directed ) assume A1: W is directed ; ::_thesis: for n being odd Element of NAT st n < len W holds W . (n + 1) DJoins W . n,W . (n + 2),G let n be odd Element of NAT ; ::_thesis: ( n < len W implies W . (n + 1) DJoins W . n,W . (n + 2),G ) assume A2: n < len W ; ::_thesis: W . (n + 1) DJoins W . n,W . (n + 2),G then A3: W . n = (the_Source_of G) . (W . (n + 1)) by A1, Def25; A4: now__::_thesis:_(_W_._(n_+_1)_DJoins_W_._(n_+_2),W_._n,G_implies_W_._(n_+_1)_DJoins_W_._n,W_._(n_+_2),G_) assume A5: W . (n + 1) DJoins W . (n + 2),W . n,G ; ::_thesis: W . (n + 1) DJoins W . n,W . (n + 2),G then W . (n + 2) = W . n by A3, GLIB_000:def_14; hence W . (n + 1) DJoins W . n,W . (n + 2),G by A5; ::_thesis: verum end; W . (n + 1) Joins W . n,W . (n + 2),G by A2, Def3; hence W . (n + 1) DJoins W . n,W . (n + 2),G by A4, GLIB_000:16; ::_thesis: verum end; assume A6: for n being odd Element of NAT st n < len W holds W . (n + 1) DJoins W . n,W . (n + 2),G ; ::_thesis: W is directed now__::_thesis:_for_n_being_odd_Element_of_NAT_st_n_<_len_W_holds_ (the_Source_of_G)_._(W_._(n_+_1))_=_W_._n let n be odd Element of NAT ; ::_thesis: ( n < len W implies (the_Source_of G) . (W . (n + 1)) = W . n ) assume n < len W ; ::_thesis: (the_Source_of G) . (W . (n + 1)) = W . n then W . (n + 1) DJoins W . n,W . (n + 2),G by A6; hence (the_Source_of G) . (W . (n + 1)) = W . n by GLIB_000:def_14; ::_thesis: verum end; hence W is directed by Def25; ::_thesis: verum end; Lm52: for G being _Graph for W being Walk of G for x, e, y, z being set st W is directed & W is_Walk_from x,y & e DJoins y,z,G holds ( W .addEdge e is directed & W .addEdge e is_Walk_from x,z ) proof let G be _Graph; ::_thesis: for W being Walk of G for x, e, y, z being set st W is directed & W is_Walk_from x,y & e DJoins y,z,G holds ( W .addEdge e is directed & W .addEdge e is_Walk_from x,z ) let W be Walk of G; ::_thesis: for x, e, y, z being set st W is directed & W is_Walk_from x,y & e DJoins y,z,G holds ( W .addEdge e is directed & W .addEdge e is_Walk_from x,z ) let x, e, y, z be set ; ::_thesis: ( W is directed & W is_Walk_from x,y & e DJoins y,z,G implies ( W .addEdge e is directed & W .addEdge e is_Walk_from x,z ) ) set W2 = W .addEdge e; assume that A1: W is directed and A2: W is_Walk_from x,y and A3: e DJoins y,z,G ; ::_thesis: ( W .addEdge e is directed & W .addEdge e is_Walk_from x,z ) A4: W .last() = y by A2, Def23; then A5: e Joins W .last() ,z,G by A3, GLIB_000:16; then A6: len (W .addEdge e) = (len W) + 2 by Lm37; A7: (W .addEdge e) . ((len W) + 1) = e by A5, Lm38; 1 <= len W by ABIAN:12; then len W in dom W by FINSEQ_3:25; then A8: (W .addEdge e) . (len W) = y by A4, A5, Lm38; now__::_thesis:_for_n_being_odd_Element_of_NAT_st_n_<_len_(W_.addEdge_e)_holds_ (W_.addEdge_e)_._n_=_(the_Source_of_G)_._((W_.addEdge_e)_._(n_+_1)) let n be odd Element of NAT ; ::_thesis: ( n < len (W .addEdge e) implies (W .addEdge e) . n = (the_Source_of G) . ((W .addEdge e) . (n + 1)) ) assume n < len (W .addEdge e) ; ::_thesis: (W .addEdge e) . n = (the_Source_of G) . ((W .addEdge e) . (n + 1)) then n < ((len W) + 1) + 1 by A6; then n <= (len W) + 1 by NAT_1:13; then n < (len W) + 1 by XXREAL_0:1; then A9: n <= len W by NAT_1:13; now__::_thesis:_(W_.addEdge_e)_._n_=_(the_Source_of_G)_._((W_.addEdge_e)_._(n_+_1)) percases ( n = len W or n <> len W ) ; suppose n = len W ; ::_thesis: (W .addEdge e) . n = (the_Source_of G) . ((W .addEdge e) . (n + 1)) hence (W .addEdge e) . n = (the_Source_of G) . ((W .addEdge e) . (n + 1)) by A3, A8, A7, GLIB_000:def_14; ::_thesis: verum end; supposeA10: n <> len W ; ::_thesis: (W .addEdge e) . n = (the_Source_of G) . ((W .addEdge e) . (n + 1)) A11: 1 <= n + 1 by NAT_1:12; 1 <= n by ABIAN:12; then n in dom W by A9, FINSEQ_3:25; then A12: (W .addEdge e) . n = W . n by A5, Lm38; A13: n < len W by A9, A10, XXREAL_0:1; then n + 1 <= len W by NAT_1:13; then n + 1 in dom W by A11, FINSEQ_3:25; then (W .addEdge e) . (n + 1) = W . (n + 1) by A5, Lm38; hence (W .addEdge e) . n = (the_Source_of G) . ((W .addEdge e) . (n + 1)) by A1, A13, A12, Def25; ::_thesis: verum end; end; end; hence (W .addEdge e) . n = (the_Source_of G) . ((W .addEdge e) . (n + 1)) ; ::_thesis: verum end; hence W .addEdge e is directed by Def25; ::_thesis: W .addEdge e is_Walk_from x,z thus W .addEdge e is_Walk_from x,z by A2, A4, A5, Lm39; ::_thesis: verum end; Lm53: for G being _Graph for W being Walk of G for m, n being Element of NAT st W is directed holds W .cut (m,n) is directed proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being Element of NAT st W is directed holds W .cut (m,n) is directed let W be Walk of G; ::_thesis: for m, n being Element of NAT st W is directed holds W .cut (m,n) is directed let m, n be Element of NAT ; ::_thesis: ( W is directed implies W .cut (m,n) is directed ) set W2 = W .cut (m,n); assume A1: W is directed ; ::_thesis: W .cut (m,n) is directed now__::_thesis:_W_.cut_(m,n)_is_directed percases ( ( m is odd & n is odd & m <= n & n <= len W ) or not m is odd or not n is odd or not m <= n or not n <= len W ) ; supposeA2: ( m is odd & n is odd & m <= n & n <= len W ) ; ::_thesis: W .cut (m,n) is directed then reconsider m9 = m as odd Element of NAT ; now__::_thesis:_for_x_being_odd_Element_of_NAT_st_x_<_len_(W_.cut_(m,n))_holds_ (W_.cut_(m,n))_._(x_+_1)_DJoins_(W_.cut_(m,n))_._x,(W_.cut_(m,n))_._(x_+_2),G let x be odd Element of NAT ; ::_thesis: ( x < len (W .cut (m,n)) implies (W .cut (m,n)) . (x + 1) DJoins (W .cut (m,n)) . x,(W .cut (m,n)) . (x + 2),G ) reconsider xaa1 = x - 1 as even Element of NAT by ABIAN:12, INT_1:5; assume A3: x < len (W .cut (m,n)) ; ::_thesis: (W .cut (m,n)) . (x + 1) DJoins (W .cut (m,n)) . x,(W .cut (m,n)) . (x + 2),G then x + 1 <= len (W .cut (m,n)) by NAT_1:13; then A4: x + 1 < len (W .cut (m,n)) by XXREAL_0:1; m + x in dom W by A2, A3, Lm15; then m9 + x <= len W by FINSEQ_3:25; then A5: (m9 + x) - 1 < (len W) - 0 by XREAL_1:15; xaa1 < (len (W .cut (m,n))) - 0 by A3, XREAL_1:14; then A6: (W .cut (m,n)) . (xaa1 + 1) = W . (m + xaa1) by A2, Lm15; A7: (W .cut (m,n)) . (x + 2) = (W .cut (m,n)) . ((x + 1) + 1) .= W . (m + (((x - 1) + 1) + 1)) by A2, A4, Lm15 .= W . ((m + xaa1) + 2) ; (W .cut (m,n)) . (x + 1) = W . (((m + x) - 1) + 1) by A2, A3, Lm15 .= W . ((m + xaa1) + 1) ; hence (W .cut (m,n)) . (x + 1) DJoins (W .cut (m,n)) . x,(W .cut (m,n)) . (x + 2),G by A1, A6, A5, A7, Lm51; ::_thesis: verum end; hence W .cut (m,n) is directed by Lm51; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W ) ; ::_thesis: W .cut (m,n) is directed hence W .cut (m,n) is directed by A1, Def11; ::_thesis: verum end; end; end; hence W .cut (m,n) is directed ; ::_thesis: verum end; Lm54: for G being _Graph for W being Walk of G holds ( not W is trivial iff 3 <= len W ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( not W is trivial iff 3 <= len W ) let W be Walk of G; ::_thesis: ( not W is trivial iff 3 <= len W ) hereby ::_thesis: ( 3 <= len W implies not W is trivial ) assume not W is trivial ; ::_thesis: 3 <= len W then W .length() <> 0 by Def26; then 0 + 1 <= len (W .edgeSeq()) by NAT_1:13; then 2 * 1 <= 2 * (len (W .edgeSeq())) by NAT_1:4; then 2 + 1 <= (2 * (len (W .edgeSeq()))) + 1 by XREAL_1:7; hence 3 <= len W by Def15; ::_thesis: verum end; assume 3 <= len W ; ::_thesis: not W is trivial then (2 * 1) + 1 <= (2 * (len (W .edgeSeq()))) + 1 by Def15; then W .length() <> 0 ; hence not W is trivial by Def26; ::_thesis: verum end; Lm55: for G being _Graph for W being Walk of G holds ( not W is trivial iff len W <> 1 ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( not W is trivial iff len W <> 1 ) let W be Walk of G; ::_thesis: ( not W is trivial iff len W <> 1 ) A1: 1 <= len W by ABIAN:12; thus ( not W is trivial implies len W <> 1 ) by Lm54; ::_thesis: ( len W <> 1 implies not W is trivial ) assume len W <> 1 ; ::_thesis: not W is trivial then 1 < len W by A1, XXREAL_0:1; then 1 + 1 <= len W by NAT_1:13; then 2 * 1 < len W by XXREAL_0:1; then (2 * 1) + 1 <= len W by NAT_1:13; hence not W is trivial by Lm54; ::_thesis: verum end; Lm56: for G being _Graph for W being Walk of G holds ( W is trivial iff ex v being Vertex of G st W = G .walkOf v ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W is trivial iff ex v being Vertex of G st W = G .walkOf v ) let W be Walk of G; ::_thesis: ( W is trivial iff ex v being Vertex of G st W = G .walkOf v ) hereby ::_thesis: ( ex v being Vertex of G st W = G .walkOf v implies W is trivial ) assume A1: W is trivial ; ::_thesis: ex v being Vertex of G st W = G .walkOf v take v = W .first() ; ::_thesis: W = G .walkOf v len W = 1 by A1, Lm55; hence W = G .walkOf v by FINSEQ_1:40; ::_thesis: verum end; given v being Vertex of G such that A2: W = G .walkOf v ; ::_thesis: W is trivial len W = 1 by A2, FINSEQ_1:39; hence W is trivial by Lm55; ::_thesis: verum end; Lm57: for G being _Graph for W being Walk of G holds ( W is Trail-like iff for m, n being even Element of NAT st 1 <= m & m < n & n <= len W holds W . m <> W . n ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W is Trail-like iff for m, n being even Element of NAT st 1 <= m & m < n & n <= len W holds W . m <> W . n ) let W be Walk of G; ::_thesis: ( W is Trail-like iff for m, n being even Element of NAT st 1 <= m & m < n & n <= len W holds W . m <> W . n ) hereby ::_thesis: ( ( for m, n being even Element of NAT st 1 <= m & m < n & n <= len W holds W . m <> W . n ) implies W is Trail-like ) assume W is Trail-like ; ::_thesis: for m, n being even Element of NAT st 1 <= m & m < n & n <= len W holds W . m <> W . n then A1: W .edgeSeq() is one-to-one by Def27; let m, n be even Element of NAT ; ::_thesis: ( 1 <= m & m < n & n <= len W implies W . m <> W . n ) assume that A2: 1 <= m and A3: m < n and A4: n <= len W ; ::_thesis: W . m <> W . n A5: 1 <= n by A2, A3, XXREAL_0:2; then A6: n div 2 in dom (W .edgeSeq()) by A4, Lm40; A7: m <= len W by A3, A4, XXREAL_0:2; then A8: W . m = (W .edgeSeq()) . (m div 2) by A2, Lm40; A9: now__::_thesis:_not_m_div_2_=_n_div_2 2 divides m by PEPIN:22; then A10: 2 * (m div 2) = m by NAT_D:3; A11: 2 divides n by PEPIN:22; assume m div 2 = n div 2 ; ::_thesis: contradiction hence contradiction by A3, A11, A10, NAT_D:3; ::_thesis: verum end; A12: W . n = (W .edgeSeq()) . (n div 2) by A4, A5, Lm40; m div 2 in dom (W .edgeSeq()) by A2, A7, Lm40; hence W . m <> W . n by A1, A8, A6, A12, A9, FUNCT_1:def_4; ::_thesis: verum end; assume A13: for m, n being even Element of NAT st 1 <= m & m < n & n <= len W holds W . m <> W . n ; ::_thesis: W is Trail-like now__::_thesis:_for_x1,_x2_being_set_st_x1_in_dom_(W_.edgeSeq())_&_x2_in_dom_(W_.edgeSeq())_&_(W_.edgeSeq())_._x1_=_(W_.edgeSeq())_._x2_holds_ x1_=_x2 let x1, x2 be set ; ::_thesis: ( x1 in dom (W .edgeSeq()) & x2 in dom (W .edgeSeq()) & (W .edgeSeq()) . x1 = (W .edgeSeq()) . x2 implies x1 = x2 ) assume that A14: x1 in dom (W .edgeSeq()) and A15: x2 in dom (W .edgeSeq()) and A16: (W .edgeSeq()) . x1 = (W .edgeSeq()) . x2 ; ::_thesis: x1 = x2 reconsider m = x1, n = x2 as Element of NAT by A14, A15; A17: m <= len (W .edgeSeq()) by A14, FINSEQ_3:25; 1 <= m by A14, FINSEQ_3:25; then A18: (W .edgeSeq()) . x1 = W . (2 * m) by A17, Def15; A19: n <= len (W .edgeSeq()) by A15, FINSEQ_3:25; 1 <= n by A15, FINSEQ_3:25; then A20: W . (2 * m) = W . (2 * n) by A16, A18, A19, Def15; A21: 2 * n in dom W by A15, Lm41; then A22: 1 <= 2 * n by FINSEQ_3:25; A23: 2 * m in dom W by A14, Lm41; then A24: 2 * m <= len W by FINSEQ_3:25; A25: 2 * n <= len W by A21, FINSEQ_3:25; A26: 1 <= 2 * m by A23, FINSEQ_3:25; now__::_thesis:_x1_=_x2 percases ( 2 * m < 2 * n or 2 * m = 2 * n or 2 * m > 2 * n ) by XXREAL_0:1; suppose 2 * m < 2 * n ; ::_thesis: x1 = x2 hence x1 = x2 by A13, A20, A26, A25; ::_thesis: verum end; suppose 2 * m = 2 * n ; ::_thesis: x1 = x2 hence x1 = x2 ; ::_thesis: verum end; suppose 2 * m > 2 * n ; ::_thesis: x1 = x2 hence x1 = x2 by A13, A20, A24, A22; ::_thesis: verum end; end; end; hence x1 = x2 ; ::_thesis: verum end; then W .edgeSeq() is one-to-one by FUNCT_1:def_4; hence W is Trail-like by Def27; ::_thesis: verum end; Lm58: for G being _Graph for W being Walk of G holds ( W is Trail-like iff W .reverse() is Trail-like ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W is Trail-like iff W .reverse() is Trail-like ) let W be Walk of G; ::_thesis: ( W is Trail-like iff W .reverse() is Trail-like ) A1: now__::_thesis:_for_W_being_Walk_of_G_st_W_is_Trail-like_holds_ W_.reverse()_is_Trail-like let W be Walk of G; ::_thesis: ( W is Trail-like implies W .reverse() is Trail-like ) assume A2: W is Trail-like ; ::_thesis: W .reverse() is Trail-like now__::_thesis:_for_m,_n_being_even_Element_of_NAT_st_1_<=_m_&_m_<_n_&_n_<=_len_(W_.reverse())_holds_ (W_.reverse())_._m_<>_(W_.reverse())_._n reconsider lenW = len W as odd Element of NAT ; let m, n be even Element of NAT ; ::_thesis: ( 1 <= m & m < n & n <= len (W .reverse()) implies (W .reverse()) . m <> (W .reverse()) . n ) assume that A3: 1 <= m and A4: m < n and A5: n <= len (W .reverse()) ; ::_thesis: (W .reverse()) . m <> (W .reverse()) . n (len W) - n < (len W) - m by A4, XREAL_1:15; then A6: ((len W) - n) + 1 < ((len W) - m) + 1 by XREAL_1:8; m <= len (W .reverse()) by A4, A5, XXREAL_0:2; then A7: m in dom (W .reverse()) by A3, FINSEQ_3:25; then A8: ((len W) - m) + 1 in dom W by Lm8; then reconsider rm = (lenW - m) + 1 as even Element of NAT ; A9: rm <= len W by A8, FINSEQ_3:25; 1 <= n by A3, A4, XXREAL_0:2; then A10: n in dom (W .reverse()) by A5, FINSEQ_3:25; then A11: (W .reverse()) . n = W . (((len W) - n) + 1) by Lm8; A12: ((len W) - n) + 1 in dom W by A10, Lm8; then reconsider rn = (lenW - n) + 1 as even Element of NAT ; A13: 1 <= rn by A12, FINSEQ_3:25; (W .reverse()) . m = W . (((len W) - m) + 1) by A7, Lm8; hence (W .reverse()) . m <> (W .reverse()) . n by A2, A11, A6, A13, A9, Lm57; ::_thesis: verum end; hence W .reverse() is Trail-like by Lm57; ::_thesis: verum end; hence ( W is Trail-like implies W .reverse() is Trail-like ) ; ::_thesis: ( W .reverse() is Trail-like implies W is Trail-like ) assume W .reverse() is Trail-like ; ::_thesis: W is Trail-like then (W .reverse()) .reverse() is Trail-like by A1; hence W is Trail-like ; ::_thesis: verum end; Lm59: for G being _Graph for W being Walk of G for m, n being Element of NAT st W is Trail-like holds W .cut (m,n) is Trail-like proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being Element of NAT st W is Trail-like holds W .cut (m,n) is Trail-like let W be Walk of G; ::_thesis: for m, n being Element of NAT st W is Trail-like holds W .cut (m,n) is Trail-like let m, n be Element of NAT ; ::_thesis: ( W is Trail-like implies W .cut (m,n) is Trail-like ) assume A1: W is Trail-like ; ::_thesis: W .cut (m,n) is Trail-like now__::_thesis:_W_.cut_(m,n)_is_Trail-like percases ( ( m is odd & n is odd & m <= n & n <= len W ) or not m is odd or not n is odd or not m <= n or not n <= len W ) ; supposeA2: ( m is odd & n is odd & m <= n & n <= len W ) ; ::_thesis: W .cut (m,n) is Trail-like now__::_thesis:_for_x,_y_being_even_Element_of_NAT_st_1_<=_x_&_x_<_y_&_y_<=_len_(W_.cut_(m,n))_holds_ (W_.cut_(m,n))_._x_<>_(W_.cut_(m,n))_._y reconsider m9 = m as odd Element of NAT by A2; let x, y be even Element of NAT ; ::_thesis: ( 1 <= x & x < y & y <= len (W .cut (m,n)) implies (W .cut (m,n)) . x <> (W .cut (m,n)) . y ) assume that A3: 1 <= x and A4: x < y and A5: y <= len (W .cut (m,n)) ; ::_thesis: (W .cut (m,n)) . x <> (W .cut (m,n)) . y reconsider xaa1 = x - 1 as odd Element of NAT by A3, INT_1:5; reconsider yaa1 = y - 1 as odd Element of NAT by A3, A4, INT_1:5, XXREAL_0:2; x - 1 < y - 1 by A4, XREAL_1:14; then A6: xaa1 + m < yaa1 + m by XREAL_1:8; x <= len (W .cut (m,n)) by A4, A5, XXREAL_0:2; then x - 1 < (len (W .cut (m,n))) - 0 by XREAL_1:15; then A7: (W .cut (m,n)) . (xaa1 + 1) = W . (m + xaa1) by A2, Lm15; A8: y - 1 < (len (W .cut (m,n))) - 0 by A5, XREAL_1:15; then A9: (W .cut (m,n)) . (yaa1 + 1) = W . (m + yaa1) by A2, Lm15; m + yaa1 in dom W by A2, A8, Lm15; then A10: m + yaa1 <= len W by FINSEQ_3:25; 1 <= m + xaa1 by ABIAN:12, NAT_1:12; then W . (m9 + xaa1) <> W . (m9 + yaa1) by A1, A10, A6, Lm57; hence (W .cut (m,n)) . x <> (W .cut (m,n)) . y by A7, A9; ::_thesis: verum end; hence W .cut (m,n) is Trail-like by Lm57; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W ) ; ::_thesis: W .cut (m,n) is Trail-like hence W .cut (m,n) is Trail-like by A1, Def11; ::_thesis: verum end; end; end; hence W .cut (m,n) is Trail-like ; ::_thesis: verum end; Lm60: for G being _Graph for W being Walk of G for e being set st W is Trail-like & e in (W .last()) .edgesInOut() & not e in W .edges() holds W .addEdge e is Trail-like proof let G be _Graph; ::_thesis: for W being Walk of G for e being set st W is Trail-like & e in (W .last()) .edgesInOut() & not e in W .edges() holds W .addEdge e is Trail-like let W be Walk of G; ::_thesis: for e being set st W is Trail-like & e in (W .last()) .edgesInOut() & not e in W .edges() holds W .addEdge e is Trail-like let e be set ; ::_thesis: ( W is Trail-like & e in (W .last()) .edgesInOut() & not e in W .edges() implies W .addEdge e is Trail-like ) assume that A1: W is Trail-like and A2: e in (W .last()) .edgesInOut() and A3: not e in W .edges() ; ::_thesis: W .addEdge e is Trail-like set W2 = W .addEdge e; reconsider lenW2 = len (W .addEdge e) as odd Element of NAT ; A4: e Joins W .last() ,(W .last()) .adj e,G by A2, GLIB_000:67; now__::_thesis:_for_m,_n_being_even_Element_of_NAT_st_1_<=_m_&_m_<_n_&_n_<=_len_(W_.addEdge_e)_holds_ (W_.addEdge_e)_._m_<>_(W_.addEdge_e)_._n let m, n be even Element of NAT ; ::_thesis: ( 1 <= m & m < n & n <= len (W .addEdge e) implies (W .addEdge e) . m <> (W .addEdge e) . n ) assume that A5: 1 <= m and A6: m < n and A7: n <= len (W .addEdge e) ; ::_thesis: (W .addEdge e) . m <> (W .addEdge e) . n now__::_thesis:_(W_.addEdge_e)_._m_<>_(W_.addEdge_e)_._n percases ( n <= len W or n > len W ) ; supposeA8: n <= len W ; ::_thesis: (W .addEdge e) . m <> (W .addEdge e) . n then m <= len W by A6, XXREAL_0:2; then m in dom W by A5, FINSEQ_3:25; then A9: (W .addEdge e) . m = W . m by A4, Lm38; 1 <= n by A5, A6, XXREAL_0:2; then n in dom W by A8, FINSEQ_3:25; then (W .addEdge e) . n = W . n by A4, Lm38; hence (W .addEdge e) . m <> (W .addEdge e) . n by A1, A5, A6, A8, A9, Lm57; ::_thesis: verum end; supposeA10: n > len W ; ::_thesis: (W .addEdge e) . m <> (W .addEdge e) . n n < lenW2 by A7, XXREAL_0:1; then n + 1 <= len (W .addEdge e) by NAT_1:13; then (n + 1) - 1 <= (len (W .addEdge e)) - 1 by XREAL_1:13; then A11: n <= ((len W) + (1 + 1)) - 1 by A4, Lm37; (len W) + 1 <= n by A10, NAT_1:13; then A12: n = (len W) + 1 by A11, XXREAL_0:1; then A13: (W .addEdge e) . n = e by A4, Lm38; A14: (m + 1) - 1 <= ((len W) + 1) - 1 by A6, A12, NAT_1:13; then m in dom W by A5, FINSEQ_3:25; then (W .addEdge e) . m = W . m by A4, Lm38; hence (W .addEdge e) . m <> (W .addEdge e) . n by A3, A5, A13, A14, Lm46; ::_thesis: verum end; end; end; hence (W .addEdge e) . m <> (W .addEdge e) . n ; ::_thesis: verum end; hence W .addEdge e is Trail-like by Lm57; ::_thesis: verum end; Lm61: for G being _Graph for W being Walk of G st len W <= 3 holds W is Trail-like proof let G be _Graph; ::_thesis: for W being Walk of G st len W <= 3 holds W is Trail-like let W be Walk of G; ::_thesis: ( len W <= 3 implies W is Trail-like ) assume A1: len W <= 3 ; ::_thesis: W is Trail-like now__::_thesis:_W_is_Trail-like percases ( len W = 1 or len W <> 1 ) ; suppose len W = 1 ; ::_thesis: W is Trail-like then W is trivial by Lm55; then ex v being Vertex of G st W = G .walkOf v by Lm56; hence W is Trail-like by Lm4; ::_thesis: verum end; supposeA2: len W <> 1 ; ::_thesis: W is Trail-like 1 <= len W by ABIAN:12; then 1 < len W by A2, XXREAL_0:1; then 1 + 2 <= len W by Th1, JORDAN12:2; then A3: len W = 3 by A1, XXREAL_0:1; now__::_thesis:_for_m,_n_being_even_Element_of_NAT_st_1_<=_m_&_m_<_n_&_n_<=_len_W_holds_ W_._m_<>_W_._n let m, n be even Element of NAT ; ::_thesis: ( 1 <= m & m < n & n <= len W implies W . m <> W . n ) assume that A4: 1 <= m and A5: m < n and A6: n <= len W ; ::_thesis: W . m <> W . n (2 * 0) + 1 < m by A4, XXREAL_0:1; then A7: 1 + 1 <= m by NAT_1:13; n < 2 + 1 by A3, A6, XXREAL_0:1; then n <= 2 by NAT_1:13; hence W . m <> W . n by A5, A7, XXREAL_0:2; ::_thesis: verum end; hence W is Trail-like by Lm57; ::_thesis: verum end; end; end; hence W is Trail-like ; ::_thesis: verum end; Lm62: for G being _Graph for x, e, y being set st e Joins x,y,G holds G .walkOf (x,e,y) is Path-like proof let G be _Graph; ::_thesis: for x, e, y being set st e Joins x,y,G holds G .walkOf (x,e,y) is Path-like let x, e, y be set ; ::_thesis: ( e Joins x,y,G implies G .walkOf (x,e,y) is Path-like ) set W = G .walkOf (x,e,y); assume A1: e Joins x,y,G ; ::_thesis: G .walkOf (x,e,y) is Path-like then A2: len (G .walkOf (x,e,y)) = 3 by Lm5; A3: now__::_thesis:_for_m,_n_being_odd_Element_of_NAT_st_m_<_n_&_n_<=_len_(G_.walkOf_(x,e,y))_&_(G_.walkOf_(x,e,y))_._m_=_(G_.walkOf_(x,e,y))_._n_holds_ (_m_=_1_&_n_=_len_(G_.walkOf_(x,e,y))_) let m, n be odd Element of NAT ; ::_thesis: ( m < n & n <= len (G .walkOf (x,e,y)) & (G .walkOf (x,e,y)) . m = (G .walkOf (x,e,y)) . n implies ( m = 1 & n = len (G .walkOf (x,e,y)) ) ) assume that A4: m < n and A5: n <= len (G .walkOf (x,e,y)) ; ::_thesis: ( (G .walkOf (x,e,y)) . m = (G .walkOf (x,e,y)) . n implies ( m = 1 & n = len (G .walkOf (x,e,y)) ) ) assume (G .walkOf (x,e,y)) . m = (G .walkOf (x,e,y)) . n ; ::_thesis: ( m = 1 & n = len (G .walkOf (x,e,y)) ) A6: 1 <= m by ABIAN:12; then 1 < n by A4, XXREAL_0:2; then 1 + 1 < n + 1 by XREAL_1:8; then 2 * 1 <= n by NAT_1:13; then 2 * 1 < n by XXREAL_0:1; then 2 + 1 < n + 1 by XREAL_1:8; then A7: 3 <= n by NAT_1:13; then A8: n = 3 by A2, A5, XXREAL_0:1; now__::_thesis:_not_m_<>_1 assume m <> 1 ; ::_thesis: contradiction then 1 < m by A6, XXREAL_0:1; then 1 + 1 < m + 1 by XREAL_1:8; then 2 * 1 <= m by NAT_1:13; then 2 * 1 < m by XXREAL_0:1; then 2 + 1 < m + 1 by XREAL_1:8; hence contradiction by A4, A8, NAT_1:13; ::_thesis: verum end; hence ( m = 1 & n = len (G .walkOf (x,e,y)) ) by A2, A5, A7, XXREAL_0:1; ::_thesis: verum end; now__::_thesis:_for_m,_n_being_even_Element_of_NAT_st_1_<=_m_&_m_<_n_&_n_<=_len_(G_.walkOf_(x,e,y))_holds_ (G_.walkOf_(x,e,y))_._m_<>_(G_.walkOf_(x,e,y))_._n let m, n be even Element of NAT ; ::_thesis: ( 1 <= m & m < n & n <= len (G .walkOf (x,e,y)) implies (G .walkOf (x,e,y)) . m <> (G .walkOf (x,e,y)) . n ) assume that A9: 1 <= m and A10: m < n and A11: n <= len (G .walkOf (x,e,y)) ; ::_thesis: (G .walkOf (x,e,y)) . m <> (G .walkOf (x,e,y)) . n 1 < m by A9, JORDAN12:2, XXREAL_0:1; then 1 + 1 <= m by NAT_1:13; then A12: 2 < n by A10, XXREAL_0:2; n <= 3 by A1, A11, Lm5; then n < (2 * 1) + 1 by XXREAL_0:1; hence (G .walkOf (x,e,y)) . m <> (G .walkOf (x,e,y)) . n by A12, NAT_1:13; ::_thesis: verum end; then G .walkOf (x,e,y) is Trail-like by Lm57; hence G .walkOf (x,e,y) is Path-like by A3, Def28; ::_thesis: verum end; Lm63: for G being _Graph for W being Walk of G holds ( W is Path-like iff W .reverse() is Path-like ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W is Path-like iff W .reverse() is Path-like ) let W be Walk of G; ::_thesis: ( W is Path-like iff W .reverse() is Path-like ) A1: now__::_thesis:_for_W_being_Walk_of_G_st_W_is_Path-like_holds_ W_.reverse()_is_Path-like let W be Walk of G; ::_thesis: ( W is Path-like implies W .reverse() is Path-like ) reconsider lenW = len W as odd Element of NAT ; assume A2: W is Path-like ; ::_thesis: W .reverse() is Path-like A3: now__::_thesis:_for_m,_n_being_odd_Element_of_NAT_st_m_<_n_&_n_<=_len_(W_.reverse())_&_(W_.reverse())_._m_=_(W_.reverse())_._n_holds_ (_m_=_1_&_n_=_len_(W_.reverse())_) let m, n be odd Element of NAT ; ::_thesis: ( m < n & n <= len (W .reverse()) & (W .reverse()) . m = (W .reverse()) . n implies ( m = 1 & n = len (W .reverse()) ) ) assume that A4: m < n and A5: n <= len (W .reverse()) and A6: (W .reverse()) . m = (W .reverse()) . n ; ::_thesis: ( m = 1 & n = len (W .reverse()) ) A7: 1 <= m by ABIAN:12; m <= len (W .reverse()) by A4, A5, XXREAL_0:2; then A8: m in dom (W .reverse()) by A7, FINSEQ_3:25; then A9: ((len W) - m) + 1 in dom W by Lm8; then reconsider rm = (lenW - m) + 1 as odd Element of NAT ; 1 <= n by ABIAN:12; then A10: n in dom (W .reverse()) by A5, FINSEQ_3:25; then ((len W) - n) + 1 in dom W by Lm8; then reconsider rn = (lenW - n) + 1 as odd Element of NAT ; lenW - n < (len W) - m by A4, XREAL_1:15; then A11: rn < rm by XREAL_1:8; (W .reverse()) . n = W . (((len W) - n) + 1) by A10, Lm8; then A12: W . rm = W . rn by A6, A8, Lm8; A13: rm <= len W by A9, FINSEQ_3:25; then (len W) + (1 + (- m)) = len W by A2, A11, A12, Def28; hence m = 1 ; ::_thesis: n = len (W .reverse()) rn = 1 by A2, A11, A13, A12, Def28; hence n = len (W .reverse()) by FINSEQ_5:def_3; ::_thesis: verum end; W is Trail-like by A2, Def28; then W .reverse() is Trail-like by Lm58; hence W .reverse() is Path-like by A3, Def28; ::_thesis: verum end; hence ( W is Path-like implies W .reverse() is Path-like ) ; ::_thesis: ( W .reverse() is Path-like implies W is Path-like ) assume W .reverse() is Path-like ; ::_thesis: W is Path-like then (W .reverse()) .reverse() is Path-like by A1; hence W is Path-like ; ::_thesis: verum end; Lm64: for G being _Graph for W being Walk of G for m, n being Element of NAT st W is Path-like holds W .cut (m,n) is Path-like proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being Element of NAT st W is Path-like holds W .cut (m,n) is Path-like let W be Walk of G; ::_thesis: for m, n being Element of NAT st W is Path-like holds W .cut (m,n) is Path-like let m, n be Element of NAT ; ::_thesis: ( W is Path-like implies W .cut (m,n) is Path-like ) assume A1: W is Path-like ; ::_thesis: W .cut (m,n) is Path-like now__::_thesis:_W_.cut_(m,n)_is_Path-like percases ( ( m is odd & n is odd & m <= n & n <= len W ) or not m is odd or not n is odd or not m <= n or not n <= len W ) ; supposeA2: ( m is odd & n is odd & m <= n & n <= len W ) ; ::_thesis: W .cut (m,n) is Path-like then reconsider m9 = m as odd Element of NAT ; now__::_thesis:_(_W_.cut_(m,n)_is_Trail-like_&_(_for_x,_y_being_odd_Element_of_NAT_st_x_<_y_&_y_<=_len_(W_.cut_(m,n))_&_(W_.cut_(m,n))_._x_=_(W_.cut_(m,n))_._y_holds_ (_x_=_1_&_y_=_len_(W_.cut_(m,n))_)_)_) W is Trail-like by A1, Def28; hence W .cut (m,n) is Trail-like by Lm59; ::_thesis: for x, y being odd Element of NAT st x < y & y <= len (W .cut (m,n)) & (W .cut (m,n)) . x = (W .cut (m,n)) . y holds ( x = 1 & y = len (W .cut (m,n)) ) let x, y be odd Element of NAT ; ::_thesis: ( x < y & y <= len (W .cut (m,n)) & (W .cut (m,n)) . x = (W .cut (m,n)) . y implies ( x = 1 & y = len (W .cut (m,n)) ) ) assume that A3: x < y and A4: y <= len (W .cut (m,n)) and A5: (W .cut (m,n)) . x = (W .cut (m,n)) . y ; ::_thesis: ( x = 1 & y = len (W .cut (m,n)) ) reconsider xaa1 = x - 1 as even Element of NAT by ABIAN:12, INT_1:5; reconsider yaa1 = y - 1 as even Element of NAT by ABIAN:12, INT_1:5; x - 1 < y - 1 by A3, XREAL_1:14; then A6: xaa1 + m < yaa1 + m by XREAL_1:8; x <= len (W .cut (m,n)) by A3, A4, XXREAL_0:2; then x - 1 < (len (W .cut (m,n))) - 0 by XREAL_1:15; then A7: (W .cut (m,n)) . (xaa1 + 1) = W . (m + xaa1) by A2, Lm15; A8: y - 1 < (len (W .cut (m,n))) - 0 by A4, XREAL_1:15; then A9: (W .cut (m,n)) . (yaa1 + 1) = W . (m + yaa1) by A2, Lm15; m + yaa1 in dom W by A2, A8, Lm15; then A10: m9 + yaa1 <= len W by FINSEQ_3:25; then A11: m9 + yaa1 = len W by A1, A5, A7, A9, A6, Def28; A12: now__::_thesis:_not_xaa1_<>_0 assume A13: xaa1 <> 0 ; ::_thesis: contradiction m >= 1 by A2, ABIAN:12; then 1 + 0 < m + xaa1 by A13, XREAL_1:8; hence contradiction by A1, A5, A7, A9, A6, A10, Def28; ::_thesis: verum end; then (m + 1) - 1 = 1 by A1, A5, A7, A9, A6, A10, Def28; then A14: (len (W .cut (m,n))) + 1 = n + 1 by A2, Lm15; thus x = 1 by A12; ::_thesis: y = len (W .cut (m,n)) m9 + xaa1 = 1 by A1, A5, A7, A9, A6, A10, Def28; hence y = len (W .cut (m,n)) by A2, A4, A11, A12, A14, XXREAL_0:1; ::_thesis: verum end; hence W .cut (m,n) is Path-like by Def28; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W ) ; ::_thesis: W .cut (m,n) is Path-like hence W .cut (m,n) is Path-like by A1, Def11; ::_thesis: verum end; end; end; hence W .cut (m,n) is Path-like ; ::_thesis: verum end; Lm65: for G being _Graph for W being Walk of G for e, v being set st W is Path-like & e Joins W .last() ,v,G & not e in W .edges() & ( W is trivial or W is open ) & ( for n being odd Element of NAT st 1 < n & n <= len W holds W . n <> v ) holds W .addEdge e is Path-like proof let G be _Graph; ::_thesis: for W being Walk of G for e, v being set st W is Path-like & e Joins W .last() ,v,G & not e in W .edges() & ( W is trivial or W is open ) & ( for n being odd Element of NAT st 1 < n & n <= len W holds W . n <> v ) holds W .addEdge e is Path-like let W be Walk of G; ::_thesis: for e, v being set st W is Path-like & e Joins W .last() ,v,G & not e in W .edges() & ( W is trivial or W is open ) & ( for n being odd Element of NAT st 1 < n & n <= len W holds W . n <> v ) holds W .addEdge e is Path-like let e, v be set ; ::_thesis: ( W is Path-like & e Joins W .last() ,v,G & not e in W .edges() & ( W is trivial or W is open ) & ( for n being odd Element of NAT st 1 < n & n <= len W holds W . n <> v ) implies W .addEdge e is Path-like ) assume that A1: W is Path-like and A2: e Joins W .last() ,v,G and A3: not e in W .edges() and A4: ( W is trivial or W is open ) and A5: for n being odd Element of NAT st 1 < n & n <= len W holds W . n <> v ; ::_thesis: W .addEdge e is Path-like reconsider lenW = len W as odd Element of NAT ; set W2 = W .addEdge e; A6: e in (W .last()) .edgesInOut() by A2, GLIB_000:62; now__::_thesis:_(_W_.addEdge_e_is_Trail-like_&_(_for_m,_n_being_odd_Element_of_NAT_st_m_<_n_&_n_<=_len_(W_.addEdge_e)_&_(W_.addEdge_e)_._m_=_(W_.addEdge_e)_._n_holds_ (_m_=_1_&_n_=_len_(W_.addEdge_e)_)_)_) W is Trail-like by A1, Def28; hence W .addEdge e is Trail-like by A3, A6, Lm60; ::_thesis: for m, n being odd Element of NAT st m < n & n <= len (W .addEdge e) & (W .addEdge e) . m = (W .addEdge e) . n holds ( m = 1 & n = len (W .addEdge e) ) let m, n be odd Element of NAT ; ::_thesis: ( m < n & n <= len (W .addEdge e) & (W .addEdge e) . m = (W .addEdge e) . n implies ( m = 1 & n = len (W .addEdge e) ) ) assume that A7: m < n and A8: n <= len (W .addEdge e) and A9: (W .addEdge e) . m = (W .addEdge e) . n ; ::_thesis: ( m = 1 & n = len (W .addEdge e) ) now__::_thesis:_(_m_=_1_&_n_=_len_(W_.addEdge_e)_) percases ( W is open or W is trivial ) by A4; supposeA10: W is open ; ::_thesis: ( m = 1 & n = len (W .addEdge e) ) now__::_thesis:_(_m_=_1_&_n_=_len_(W_.addEdge_e)_) percases ( n <= len W or n > len W ) ; supposeA11: n <= len W ; ::_thesis: ( m = 1 & n = len (W .addEdge e) ) A12: 1 <= m by ABIAN:12; m <= len W by A7, A11, XXREAL_0:2; then m in dom W by A12, FINSEQ_3:25; then A13: (W .addEdge e) . m = W . m by A2, Lm38; 1 <= n by ABIAN:12; then n in dom W by A11, FINSEQ_3:25; then A14: W . m = W . n by A2, A9, A13, Lm38; then m = 1 by A1, A7, A11, Def28; then W .first() = W .last() by A1, A7, A11, A14, Def28; hence ( m = 1 & n = len (W .addEdge e) ) by A10, Def24; ::_thesis: verum end; suppose n > len W ; ::_thesis: ( m = 1 & n = len (W .addEdge e) ) then lenW + 1 <= n by NAT_1:13; then lenW + 1 < n by XXREAL_0:1; then (lenW + 1) + 1 <= n by NAT_1:13; then (len W) + (1 + 1) <= n ; then A15: len (W .addEdge e) <= n by A2, Lm37; then n = len (W .addEdge e) by A8, XXREAL_0:1; then (W .addEdge e) . n = (W .addEdge e) . ((len W) + 2) by A2, Lm37; then A16: (W .addEdge e) . n = v by A2, Lm38; m < len (W .addEdge e) by A7, A8, A15, XXREAL_0:1; then m < (len W) + (1 + 1) by A2, Lm37; then m < ((len W) + 1) + 1 ; then m <= lenW + 1 by NAT_1:13; then m < lenW + 1 by XXREAL_0:1; then A17: m <= len W by NAT_1:13; 1 <= m by ABIAN:12; then m in dom W by A17, FINSEQ_3:25; then A18: W . m = v by A2, A9, A16, Lm38; now__::_thesis:_not_m_<>_1 A19: 1 <= m by ABIAN:12; assume m <> 1 ; ::_thesis: contradiction then 1 < m by A19, XXREAL_0:1; hence contradiction by A5, A17, A18; ::_thesis: verum end; hence m = 1 ; ::_thesis: n = len (W .addEdge e) thus n = len (W .addEdge e) by A8, A15, XXREAL_0:1; ::_thesis: verum end; end; end; hence ( m = 1 & n = len (W .addEdge e) ) ; ::_thesis: verum end; suppose W is trivial ; ::_thesis: ( m = 1 & n = len (W .addEdge e) ) then ex v being Vertex of G st W = G .walkOf v by Lm56; then len W = 1 by FINSEQ_1:39; then A20: len (W .addEdge e) = 1 + 2 by A2, Lm37; A21: m + 1 <= n by A7, NAT_1:13; A22: 1 <= m by ABIAN:12; then 1 + 1 <= m + 1 by XREAL_1:7; then 2 * 1 <= n by A21, XXREAL_0:2; then 2 * 1 < n by XXREAL_0:1; then A23: len (W .addEdge e) <= n by A20, NAT_1:13; then n = len (W .addEdge e) by A8, XXREAL_0:1; then (m + 1) - 1 <= 3 - 1 by A7, A20, NAT_1:13; then m < 2 * 1 by XXREAL_0:1; then m + 1 <= 2 by NAT_1:13; then (m + 1) - 1 <= 2 - 1 by XREAL_1:13; hence ( m = 1 & n = len (W .addEdge e) ) by A8, A22, A23, XXREAL_0:1; ::_thesis: verum end; end; end; hence ( m = 1 & n = len (W .addEdge e) ) ; ::_thesis: verum end; hence W .addEdge e is Path-like by Def28; ::_thesis: verum end; Lm66: for G being _Graph for W being Walk of G st ( for m, n being odd Element of NAT st m <= len W & n <= len W & W . m = W . n holds m = n ) holds W is Path-like proof let G be _Graph; ::_thesis: for W being Walk of G st ( for m, n being odd Element of NAT st m <= len W & n <= len W & W . m = W . n holds m = n ) holds W is Path-like let W be Walk of G; ::_thesis: ( ( for m, n being odd Element of NAT st m <= len W & n <= len W & W . m = W . n holds m = n ) implies W is Path-like ) assume A1: for m, n being odd Element of NAT st m <= len W & n <= len W & W . m = W . n holds m = n ; ::_thesis: W is Path-like now__::_thesis:_for_m,_n_being_even_Element_of_NAT_st_1_<=_m_&_m_<_n_&_n_<=_len_W_holds_ W_._m_<>_W_._n let m, n be even Element of NAT ; ::_thesis: ( 1 <= m & m < n & n <= len W implies W . m <> W . n ) assume that A2: 1 <= m and A3: m < n and A4: n <= len W ; ::_thesis: W . m <> W . n m <= len W by A3, A4, XXREAL_0:2; then A5: m in dom W by A2, FINSEQ_3:25; 1 <= n by A2, A3, XXREAL_0:2; then A6: n in dom W by A4, FINSEQ_3:25; now__::_thesis:_not_W_._m_=_W_._n assume W . m = W . n ; ::_thesis: contradiction then consider naa1 being odd Element of NAT such that A7: naa1 = n - 1 and A8: n - 1 in dom W and A9: n + 1 in dom W and A10: W . m Joins W . naa1,W . (n + 1),G by A6, Lm2; A11: naa1 <= len W by A7, A8, FINSEQ_3:25; consider maa1 being odd Element of NAT such that A12: maa1 = m - 1 and A13: m - 1 in dom W and A14: m + 1 in dom W and A15: W . m Joins W . maa1,W . (m + 1),G by A5, Lm2; A16: maa1 <= len W by A12, A13, FINSEQ_3:25; A17: n + 1 <= len W by A9, FINSEQ_3:25; A18: m + 1 <= len W by A14, FINSEQ_3:25; now__::_thesis:_contradiction percases ( ( W . naa1 = W . maa1 & W . (n + 1) = W . (m + 1) ) or ( W . naa1 = W . (m + 1) & W . (n + 1) = W . maa1 ) ) by A15, A10, GLIB_000:15; suppose ( W . naa1 = W . maa1 & W . (n + 1) = W . (m + 1) ) ; ::_thesis: contradiction then naa1 = maa1 by A1, A16, A11; hence contradiction by A3, A12, A7; ::_thesis: verum end; supposeA19: ( W . naa1 = W . (m + 1) & W . (n + 1) = W . maa1 ) ; ::_thesis: contradiction then A20: n + 1 = maa1 by A1, A16, A17; naa1 = m + 1 by A1, A18, A11, A19; hence contradiction by A12, A7, A20; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; hence W . m <> W . n ; ::_thesis: verum end; then A21: W is Trail-like by Lm57; now__::_thesis:_for_m,_n_being_odd_Element_of_NAT_st_m_<_n_&_n_<=_len_W_&_W_._m_=_W_._n_holds_ (_m_=_1_&_n_=_len_W_) let m, n be odd Element of NAT ; ::_thesis: ( m < n & n <= len W & W . m = W . n implies ( m = 1 & n = len W ) ) assume that A22: m < n and A23: n <= len W ; ::_thesis: ( W . m = W . n implies ( m = 1 & n = len W ) ) assume A24: W . m = W . n ; ::_thesis: ( m = 1 & n = len W ) m <= len W by A22, A23, XXREAL_0:2; hence ( m = 1 & n = len W ) by A1, A22, A23, A24; ::_thesis: verum end; hence W is Path-like by A21, Def28; ::_thesis: verum end; Lm67: for G being _Graph for W being Walk of G st ( for n being odd Element of NAT st n <= len W holds W .rfind n = n ) holds W is Path-like proof let G be _Graph; ::_thesis: for W being Walk of G st ( for n being odd Element of NAT st n <= len W holds W .rfind n = n ) holds W is Path-like let W be Walk of G; ::_thesis: ( ( for n being odd Element of NAT st n <= len W holds W .rfind n = n ) implies W is Path-like ) assume A1: for n being odd Element of NAT st n <= len W holds W .rfind n = n ; ::_thesis: W is Path-like now__::_thesis:_for_m,_n_being_odd_Element_of_NAT_st_m_<=_len_W_&_n_<=_len_W_&_W_._m_=_W_._n_holds_ m_=_n let m, n be odd Element of NAT ; ::_thesis: ( m <= len W & n <= len W & W . m = W . n implies m = n ) assume that A2: m <= len W and A3: n <= len W and A4: W . m = W . n ; ::_thesis: m = n W .rfind n = n by A1, A3; then A5: m <= n by A2, A3, A4, Def22; W .rfind m = m by A1, A2; then n <= m by A2, A3, A4, Def22; hence m = n by A5, XXREAL_0:1; ::_thesis: verum end; hence W is Path-like by Lm66; ::_thesis: verum end; Lm68: for G being _Graph for W being Walk of G for e, v being set st e Joins W .last() ,v,G & W is Path-like & not v in W .vertices() & ( W is trivial or W is open ) holds W .addEdge e is Path-like proof let G be _Graph; ::_thesis: for W being Walk of G for e, v being set st e Joins W .last() ,v,G & W is Path-like & not v in W .vertices() & ( W is trivial or W is open ) holds W .addEdge e is Path-like let W be Walk of G; ::_thesis: for e, v being set st e Joins W .last() ,v,G & W is Path-like & not v in W .vertices() & ( W is trivial or W is open ) holds W .addEdge e is Path-like let e, v be set ; ::_thesis: ( e Joins W .last() ,v,G & W is Path-like & not v in W .vertices() & ( W is trivial or W is open ) implies W .addEdge e is Path-like ) assume that A1: e Joins W .last() ,v,G and A2: W is Path-like and A3: not v in W .vertices() and A4: ( W is trivial or W is open ) ; ::_thesis: W .addEdge e is Path-like A5: for n being odd Element of NAT st 1 < n & n <= len W holds v <> W . n by A3, Lm45; not e in W .edges() by A1, A3, Lm48; hence W .addEdge e is Path-like by A1, A2, A4, A5, Lm65; ::_thesis: verum end; Lm69: for G being _Graph for W being Walk of G st len W <= 3 holds W is Path-like proof let G be _Graph; ::_thesis: for W being Walk of G st len W <= 3 holds W is Path-like let W be Walk of G; ::_thesis: ( len W <= 3 implies W is Path-like ) assume A1: len W <= 3 ; ::_thesis: W is Path-like now__::_thesis:_W_is_Path-like percases ( len W = 1 or len W <> 1 ) ; suppose len W = 1 ; ::_thesis: W is Path-like then W is trivial by Lm55; then ex v being Vertex of G st W = G .walkOf v by Lm56; hence W is Path-like by Lm4; ::_thesis: verum end; supposeA2: len W <> 1 ; ::_thesis: W is Path-like 1 <= len W by ABIAN:12; then 1 < len W by A2, XXREAL_0:1; then 1 + 2 <= len W by Th1, JORDAN12:2; then A3: len W = 3 by A1, XXREAL_0:1; A4: now__::_thesis:_for_m,_n_being_odd_Element_of_NAT_st_m_<_n_&_n_<=_len_W_&_W_._m_=_W_._n_holds_ (_m_=_1_&_n_=_len_W_) let m, n be odd Element of NAT ; ::_thesis: ( m < n & n <= len W & W . m = W . n implies ( m = 1 & n = len W ) ) assume that A5: m < n and A6: n <= len W and W . m = W . n ; ::_thesis: ( m = 1 & n = len W ) A7: 1 <= m by ABIAN:12; m < (2 * 1) + 1 by A3, A5, A6, XXREAL_0:2; then (m + 2) - 2 <= 3 - 2 by Th1; hence m = 1 by A7, XXREAL_0:1; ::_thesis: n = len W (2 * 0) + 1 < n by A5, A7, XXREAL_0:2; then 1 + 2 <= n by Th1; hence n = len W by A3, A6, XXREAL_0:1; ::_thesis: verum end; W is Trail-like by A1, Lm61; hence W is Path-like by A4, Def28; ::_thesis: verum end; end; end; hence W is Path-like ; ::_thesis: verum end; registration let G be _Graph; cluster Path-like -> Trail-like for Walk of G; correctness coherence for b1 being Walk of G st b1 is Path-like holds b1 is Trail-like ; by Def28; cluster trivial -> Path-like for Walk of G; correctness coherence for b1 being Walk of G st b1 is trivial holds b1 is Path-like ; proof let W be Walk of G; ::_thesis: ( W is trivial implies W is Path-like ) assume A1: W is trivial ; ::_thesis: W is Path-like A2: now__::_thesis:_for_m,_n_being_odd_Element_of_NAT_st_m_<_n_&_n_<=_len_W_&_W_._m_=_W_._n_holds_ (_m_=_1_&_n_=_len_W_) let m, n be odd Element of NAT ; ::_thesis: ( m < n & n <= len W & W . m = W . n implies ( m = 1 & n = len W ) ) assume that A3: m < n and A4: n <= len W and W . m = W . n ; ::_thesis: ( m = 1 & n = len W ) A5: 1 <= m by ABIAN:12; A6: 1 <= n by ABIAN:12; n <= 1 by A1, A4, Lm55; hence ( m = 1 & n = len W ) by A3, A5, A6, XXREAL_0:1; ::_thesis: verum end; len W = 1 by A1, Lm55; then (2 * (len (W .edgeSeq()))) + 1 = 0 + 1 by Def15; then W .edgeSeq() = {} ; then W is Trail-like by Def27; hence W is Path-like by A2, Def28; ::_thesis: verum end; cluster trivial -> vertex-distinct for Walk of G; coherence for b1 being Walk of G st b1 is trivial holds b1 is vertex-distinct proof let W be Walk of G; ::_thesis: ( W is trivial implies W is vertex-distinct ) assume A7: W is trivial ; ::_thesis: W is vertex-distinct now__::_thesis:_for_m,_n_being_odd_Element_of_NAT_st_m_<=_len_W_&_n_<=_len_W_&_W_._m_=_W_._n_holds_ m_=_n let m, n be odd Element of NAT ; ::_thesis: ( m <= len W & n <= len W & W . m = W . n implies m = n ) assume that A8: m <= len W and A9: n <= len W and W . m = W . n ; ::_thesis: m = n A10: 1 <= m by ABIAN:12; m <= 1 by A7, A8, Lm55; then A11: m = 1 by A10, XXREAL_0:1; A12: 1 <= n by ABIAN:12; n <= 1 by A7, A9, Lm55; hence m = n by A12, A11, XXREAL_0:1; ::_thesis: verum end; hence W is vertex-distinct by Def29; ::_thesis: verum end; cluster vertex-distinct -> Path-like for Walk of G; coherence for b1 being Walk of G st b1 is vertex-distinct holds b1 is Path-like proof let W be Walk of G; ::_thesis: ( W is vertex-distinct implies W is Path-like ) assume W is vertex-distinct ; ::_thesis: W is Path-like then for m, n being odd Element of NAT st m <= len W & n <= len W & W . m = W . n holds m = n by Def29; hence W is Path-like by Lm66; ::_thesis: verum end; cluster Circuit-like -> closed non trivial Trail-like for Walk of G; correctness coherence for b1 being Walk of G st b1 is Circuit-like holds ( b1 is closed & b1 is Trail-like & not b1 is trivial ); by Def30; cluster Cycle-like -> closed non trivial Path-like for Walk of G; correctness coherence for b1 being Walk of G st b1 is Cycle-like holds ( b1 is closed & b1 is Path-like & not b1 is trivial ); by Def31; end; registration let G be _Graph; cluster Relation-like NAT -defined (the_Vertices_of G) \/ (the_Edges_of G) -valued Function-like finite FinSequence-like FinSubsequence-like closed directed trivial for Walk of G; existence ex b1 being Walk of G st ( b1 is closed & b1 is directed & b1 is trivial ) proof set v = the Vertex of G; take G .walkOf the Vertex of G ; ::_thesis: ( G .walkOf the Vertex of G is closed & G .walkOf the Vertex of G is directed & G .walkOf the Vertex of G is trivial ) thus ( G .walkOf the Vertex of G is closed & G .walkOf the Vertex of G is directed & G .walkOf the Vertex of G is trivial ) by Lm4; ::_thesis: verum end; end; registration let G be _Graph; cluster Relation-like NAT -defined (the_Vertices_of G) \/ (the_Edges_of G) -valued Function-like finite FinSequence-like FinSubsequence-like vertex-distinct for Walk of G; existence ex b1 being Walk of G st b1 is vertex-distinct proof set W = the trivial Walk of G; take the trivial Walk of G ; ::_thesis: the trivial Walk of G is vertex-distinct thus the trivial Walk of G is vertex-distinct ; ::_thesis: verum end; end; definition let G be _Graph; mode Trail of G is Trail-like Walk of G; mode Path of G is Path-like Walk of G; end; definition let G be _Graph; mode DWalk of G is directed Walk of G; mode DTrail of G is directed Trail of G; mode DPath of G is directed Path of G; end; registration let G be _Graph; let v be Vertex of G; clusterG .walkOf v -> closed directed trivial ; coherence ( G .walkOf v is closed & G .walkOf v is directed & G .walkOf v is trivial ) by Lm4; end; registration let G be _Graph; let x, e, y be set ; clusterG .walkOf (x,e,y) -> Path-like ; coherence G .walkOf (x,e,y) is Path-like proof set W = G .walkOf (x,e,y); now__::_thesis:_G_.walkOf_(x,e,y)_is_Path-like percases ( e Joins x,y,G or not e Joins x,y,G ) ; suppose e Joins x,y,G ; ::_thesis: G .walkOf (x,e,y) is Path-like hence G .walkOf (x,e,y) is Path-like by Lm62; ::_thesis: verum end; suppose not e Joins x,y,G ; ::_thesis: G .walkOf (x,e,y) is Path-like then G .walkOf (x,e,y) = G .walkOf (choose (the_Vertices_of G)) by Def5; hence G .walkOf (x,e,y) is Path-like ; ::_thesis: verum end; end; end; hence G .walkOf (x,e,y) is Path-like ; ::_thesis: verum end; end; registration let G be _Graph; let x, e be set ; clusterG .walkOf (x,e,x) -> closed ; coherence G .walkOf (x,e,x) is closed proof set W = G .walkOf (x,e,x); now__::_thesis:_G_.walkOf_(x,e,x)_is_closed percases ( e Joins x,x,G or not e Joins x,x,G ) ; supposeA1: e Joins x,x,G ; ::_thesis: G .walkOf (x,e,x) is closed then A2: (G .walkOf (x,e,x)) .last() = x by Lm6; (G .walkOf (x,e,x)) .first() = x by A1, Lm6; hence G .walkOf (x,e,x) is closed by A2, Def24; ::_thesis: verum end; suppose not e Joins x,x,G ; ::_thesis: G .walkOf (x,e,x) is closed then G .walkOf (x,e,x) = G .walkOf (choose (the_Vertices_of G)) by Def5; hence G .walkOf (x,e,x) is closed ; ::_thesis: verum end; end; end; hence G .walkOf (x,e,x) is closed ; ::_thesis: verum end; end; registration let G be _Graph; let W be closed Walk of G; clusterW .reverse() -> closed ; coherence W .reverse() is closed proof ( W is closed iff W .first() = W .last() ) by Def24; then ( W is closed iff (W .reverse()) .last() = W .last() ) by Lm7; then ( W is closed iff (W .reverse()) .last() = (W .reverse()) .first() ) by Lm7; hence W .reverse() is closed by Def24; ::_thesis: verum end; end; registration let G be _Graph; let W be trivial Walk of G; clusterW .reverse() -> trivial ; coherence W .reverse() is trivial proof len W = 1 by Lm55; then len (W .reverse()) = 1 by FINSEQ_5:def_3; hence W .reverse() is trivial by Lm55; ::_thesis: verum end; end; registration let G be _Graph; let W be Trail of G; clusterW .reverse() -> Trail-like ; coherence W .reverse() is Trail-like by Lm58; end; registration let G be _Graph; let W be Path of G; clusterW .reverse() -> Path-like ; coherence W .reverse() is Path-like by Lm63; end; registration let G be _Graph; let W1, W2 be closed Walk of G; clusterW1 .append W2 -> closed ; coherence W1 .append W2 is closed proof set W = W1 .append W2; now__::_thesis:_W1_.append_W2_is_closed percases ( W1 .last() = W2 .first() or W1 .last() <> W2 .first() ) ; supposeA1: W1 .last() = W2 .first() ; ::_thesis: W1 .append W2 is closed then W1 .last() = W2 .last() by Def24; then W1 .first() = W2 .last() by Def24 .= (W1 .append W2) .last() by A1, Lm11 ; then (W1 .append W2) .first() = (W1 .append W2) .last() by A1, Lm11; hence W1 .append W2 is closed by Def24; ::_thesis: verum end; suppose W1 .last() <> W2 .first() ; ::_thesis: W1 .append W2 is closed hence W1 .append W2 is closed by Def10; ::_thesis: verum end; end; end; hence W1 .append W2 is closed ; ::_thesis: verum end; end; registration let G be _Graph; let W1, W2 be DWalk of G; clusterW1 .append W2 -> directed ; coherence W1 .append W2 is directed proof set W = W1 .append W2; now__::_thesis:_W1_.append_W2_is_directed percases ( W1 .last() = W2 .first() or W1 .last() <> W2 .first() ) ; supposeA1: W1 .last() = W2 .first() ; ::_thesis: W1 .append W2 is directed now__::_thesis:_for_n_being_odd_Element_of_NAT_st_n_<_len_(W1_.append_W2)_holds_ (W1_.append_W2)_._(n_+_1)_DJoins_(W1_.append_W2)_._n,(W1_.append_W2)_._(n_+_2),G let n be odd Element of NAT ; ::_thesis: ( n < len (W1 .append W2) implies (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G ) assume A2: n < len (W1 .append W2) ; ::_thesis: (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G 1 <= n by ABIAN:12; then A3: n in dom (W1 .append W2) by A2, FINSEQ_3:25; now__::_thesis:_(W1_.append_W2)_._(n_+_1)_DJoins_(W1_.append_W2)_._n,(W1_.append_W2)_._(n_+_2),G percases ( n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) by A3, Lm14; supposeA4: n in dom W1 ; ::_thesis: (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G then A5: n <= len W1 by FINSEQ_3:25; A6: (W1 .append W2) . n = W1 . n by A4, Lm12; now__::_thesis:_(W1_.append_W2)_._(n_+_1)_DJoins_(W1_.append_W2)_._n,(W1_.append_W2)_._(n_+_2),G percases ( n < len W1 or n = len W1 ) by A5, XXREAL_0:1; supposeA7: n < len W1 ; ::_thesis: (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G then n + 2 in dom W1 by Lm3; then A8: (W1 .append W2) . (n + 2) = W1 . (n + 2) by Lm12; n + 1 in dom W1 by A7, Lm3; then (W1 .append W2) . (n + 1) = W1 . (n + 1) by Lm12; hence (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G by A6, A7, A8, Lm51; ::_thesis: verum end; supposeA9: n = len W1 ; ::_thesis: (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G n + 1 < (len (W1 .append W2)) + 1 by A2, XREAL_1:8; then 1 + n < (len W2) + n by A1, A9, Lm9; then A10: 1 < len W2 by XREAL_1:6; then A11: W2 . (((2 * 0) + 1) + 1) DJoins W2 . ((2 * 0) + 1),W2 . (((2 * 0) + 1) + 2),G by Lm51; A12: n = (len W1) + 0 by A9; A13: 0 < len W2 ; 1 + 1 <= len W2 by A10, NAT_1:13; then 2 * 1 < len W2 by XXREAL_0:1; then A14: (W1 .append W2) . (n + 2) = W2 . (2 + 1) by A1, A9, Lm13; (W1 .append W2) . (n + 1) = W2 . (1 + 1) by A1, A9, A10, Lm13; hence (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G by A1, A13, A12, A14, A11, Lm13; ::_thesis: verum end; end; end; hence (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G ; ::_thesis: verum end; suppose ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ; ::_thesis: (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G then consider k being Element of NAT such that A15: k < len W2 and A16: n = (len W1) + k ; reconsider k = k as even Element of NAT by A16; A17: (W1 .append W2) . n = W2 . (k + 1) by A1, A15, A16, Lm13; n + 1 < (len (W1 .append W2)) + 1 by A2, XREAL_1:8; then 1 + (k + (len W1)) < (len W2) + (len W1) by A1, A16, Lm9; then A18: ((k + 1) + (len W1)) - (len W1) < ((len W2) + (len W1)) - (len W1) by XREAL_1:14; then (k + 1) + 1 <= len W2 by NAT_1:13; then A19: (k + 1) + 1 < len W2 by XXREAL_0:1; A20: (n + 1) + 1 = (len W1) + ((k + 1) + 1) by A16; A21: W2 . ((k + 1) + (1 + 1)) = W2 . (((k + 1) + 1) + 1) .= (W1 .append W2) . (n + (1 + 1)) by A1, A19, A20, Lm13 ; (W1 .append W2) . (n + 1) = W2 . ((k + 1) + 1) by A1, A16, A18, Lm13; hence (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G by A17, A18, A21, Lm51; ::_thesis: verum end; end; end; hence (W1 .append W2) . (n + 1) DJoins (W1 .append W2) . n,(W1 .append W2) . (n + 2),G ; ::_thesis: verum end; hence W1 .append W2 is directed by Lm51; ::_thesis: verum end; suppose W1 .last() <> W2 .first() ; ::_thesis: W1 .append W2 is directed hence W1 .append W2 is directed by Def10; ::_thesis: verum end; end; end; hence W1 .append W2 is directed ; ::_thesis: verum end; end; registration let G be _Graph; let W1, W2 be trivial Walk of G; clusterW1 .append W2 -> trivial ; coherence W1 .append W2 is trivial proof set W = W1 .append W2; now__::_thesis:_W1_.append_W2_is_trivial percases ( W1 .last() = W2 .first() or W1 .last() <> W2 .first() ) ; suppose W1 .last() = W2 .first() ; ::_thesis: W1 .append W2 is trivial then (len (W1 .append W2)) + 1 = (len W1) + (len W2) by Lm9 .= (len W1) + 1 by Lm55 .= 1 + 1 by Lm55 ; hence W1 .append W2 is trivial by Lm55; ::_thesis: verum end; suppose W1 .last() <> W2 .first() ; ::_thesis: W1 .append W2 is trivial hence W1 .append W2 is trivial by Def10; ::_thesis: verum end; end; end; hence W1 .append W2 is trivial ; ::_thesis: verum end; end; registration let G be _Graph; let W be DWalk of G; let m, n be Element of NAT ; clusterW .cut (m,n) -> directed ; coherence W .cut (m,n) is directed by Lm53; end; registration let G be _Graph; let W be trivial Walk of G; let m, n be Element of NAT ; clusterW .cut (m,n) -> trivial ; coherence W .cut (m,n) is trivial proof set W2 = W .cut (m,n); now__::_thesis:_W_.cut_(m,n)_is_trivial percases ( ( m is odd & n is odd & m <= n & n <= len W ) or not m is odd or not n is odd or not m <= n or not n <= len W ) ; supposeA1: ( m is odd & n is odd & m <= n & n <= len W ) ; ::_thesis: W .cut (m,n) is trivial then A2: 1 <= n by ABIAN:12; n <= 1 by A1, Lm55; then A3: n = 1 by A2, XXREAL_0:1; A4: 1 <= m by A1, ABIAN:12; (len (W .cut (m,n))) + m = n + 1 by A1, Lm15; then (len (W .cut (m,n))) + 1 = 1 + 1 by A1, A4, A3, XXREAL_0:1; hence W .cut (m,n) is trivial by Lm55; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W ) ; ::_thesis: W .cut (m,n) is trivial hence W .cut (m,n) is trivial by Def11; ::_thesis: verum end; end; end; hence W .cut (m,n) is trivial ; ::_thesis: verum end; end; registration let G be _Graph; let W be Trail of G; let m, n be Element of NAT ; clusterW .cut (m,n) -> Trail-like ; coherence W .cut (m,n) is Trail-like by Lm59; end; registration let G be _Graph; let W be Path of G; let m, n be Element of NAT ; clusterW .cut (m,n) -> Path-like ; coherence W .cut (m,n) is Path-like by Lm64; end; registration let G be _Graph; let W be vertex-distinct Walk of G; let m, n be Element of NAT ; clusterW .cut (m,n) -> vertex-distinct ; coherence W .cut (m,n) is vertex-distinct proof set W2 = W .cut (m,n); now__::_thesis:_W_.cut_(m,n)_is_vertex-distinct percases ( ( m is odd & n is odd & m <= n & n <= len W ) or not m is odd or not n is odd or not m <= n or not n <= len W ) ; supposeA1: ( m is odd & n is odd & m <= n & n <= len W ) ; ::_thesis: W .cut (m,n) is vertex-distinct then reconsider m9 = m as odd Element of NAT ; now__::_thesis:_for_a,_b_being_odd_Element_of_NAT_st_a_<=_len_(W_.cut_(m,n))_&_b_<=_len_(W_.cut_(m,n))_&_(W_.cut_(m,n))_._a_=_(W_.cut_(m,n))_._b_holds_ a_=_b let a, b be odd Element of NAT ; ::_thesis: ( a <= len (W .cut (m,n)) & b <= len (W .cut (m,n)) & (W .cut (m,n)) . a = (W .cut (m,n)) . b implies a = b ) assume that A2: a <= len (W .cut (m,n)) and A3: b <= len (W .cut (m,n)) and A4: (W .cut (m,n)) . a = (W .cut (m,n)) . b ; ::_thesis: a = b reconsider aaa1 = a - 1, baa1 = b - 1 as even Element of NAT by ABIAN:12, INT_1:5; A5: baa1 < (len (W .cut (m,n))) - 0 by A3, XREAL_1:15; then A6: (W .cut (m,n)) . (baa1 + 1) = W . (m + baa1) by A1, Lm15; A7: aaa1 < (len (W .cut (m,n))) - 0 by A2, XREAL_1:15; then m + aaa1 in dom W by A1, Lm15; then A8: m9 + aaa1 <= len W by FINSEQ_3:25; m + baa1 in dom W by A1, A5, Lm15; then A9: m9 + baa1 <= len W by FINSEQ_3:25; (W .cut (m,n)) . (aaa1 + 1) = W . (m + aaa1) by A1, A7, Lm15; then aaa1 + m9 = baa1 + m9 by A4, A6, A8, A9, Def29; hence a = b ; ::_thesis: verum end; hence W .cut (m,n) is vertex-distinct by Def29; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W ) ; ::_thesis: W .cut (m,n) is vertex-distinct hence W .cut (m,n) is vertex-distinct by Def11; ::_thesis: verum end; end; end; hence W .cut (m,n) is vertex-distinct ; ::_thesis: verum end; end; registration let G be _Graph; let W be closed Walk of G; let m, n be Element of NAT ; clusterW .remove (m,n) -> closed ; coherence W .remove (m,n) is closed proof thus (W .remove (m,n)) .first() = W .first() by Lm33 .= W .last() by Def24 .= (W .remove (m,n)) .last() by Lm33 ; :: according to GLIB_001:def_24 ::_thesis: verum end; end; registration let G be _Graph; let W be DWalk of G; let m, n be Element of NAT ; clusterW .remove (m,n) -> directed ; coherence W .remove (m,n) is directed proof now__::_thesis:_W_.remove_(m,n)_is_directed percases ( ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) or not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; suppose ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) ; ::_thesis: W .remove (m,n) is directed then W .remove (m,n) = (W .cut (1,m)) .append (W .cut (n,(len W))) by Def12; hence W .remove (m,n) is directed ; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; ::_thesis: W .remove (m,n) is directed hence W .remove (m,n) is directed by Def12; ::_thesis: verum end; end; end; hence W .remove (m,n) is directed ; ::_thesis: verum end; end; registration let G be _Graph; let W be trivial Walk of G; let m, n be Element of NAT ; clusterW .remove (m,n) -> trivial ; coherence W .remove (m,n) is trivial proof now__::_thesis:_W_.remove_(m,n)_is_trivial percases ( ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) or not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; suppose ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) ; ::_thesis: W .remove (m,n) is trivial then W .remove (m,n) = (W .cut (1,m)) .append (W .cut (n,(len W))) by Def12; hence W .remove (m,n) is trivial ; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; ::_thesis: W .remove (m,n) is trivial hence W .remove (m,n) is trivial by Def12; ::_thesis: verum end; end; end; hence W .remove (m,n) is trivial ; ::_thesis: verum end; end; registration let G be _Graph; let W be Trail of G; let m, n be Element of NAT ; clusterW .remove (m,n) -> Trail-like ; coherence W .remove (m,n) is Trail-like proof set W2 = W .remove (m,n); A1: len (W .remove (m,n)) <= len W by Lm26; now__::_thesis:_W_.remove_(m,n)_is_Trail-like percases ( ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) or not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; supposeA2: ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) ; ::_thesis: W .remove (m,n) is Trail-like then reconsider m9 = m, n9 = n as odd Element of NAT ; now__::_thesis:_for_a,_b_being_even_Element_of_NAT_holds_ (_not_1_<=_a_or_not_a_<_b_or_not_b_<=_len_(W_.remove_(m,n))_or_not_(W_.remove_(m,n))_._a_=_(W_.remove_(m,n))_._b_) given a, b being even Element of NAT such that A3: 1 <= a and A4: a < b and A5: b <= len (W .remove (m,n)) and A6: (W .remove (m,n)) . a = (W .remove (m,n)) . b ; ::_thesis: contradiction 1 <= b by A3, A4, XXREAL_0:2; then A7: b in dom (W .remove (m,n)) by A5, FINSEQ_3:25; a <= len (W .remove (m,n)) by A4, A5, XXREAL_0:2; then A8: a in dom (W .remove (m,n)) by A3, FINSEQ_3:25; now__::_thesis:_contradiction percases ( a in Seg m or ( m <= a & a <= len (W .remove (m,n)) ) ) by A2, A8, Lm34; suppose a in Seg m ; ::_thesis: contradiction then A9: (W .remove (m,n)) . a = W . a by A2, Lm29; now__::_thesis:_contradiction percases ( b in Seg m or ( m <= b & b <= len (W .remove (m,n)) ) ) by A2, A7, Lm34; supposeA10: b in Seg m ; ::_thesis: contradiction A11: b <= len W by A1, A5, XXREAL_0:2; (W .remove (m,n)) . b = W . b by A2, A10, Lm29; hence contradiction by A3, A4, A6, A9, A11, Lm57; ::_thesis: verum end; supposeA12: ( m <= b & b <= len (W .remove (m,n)) ) ; ::_thesis: contradiction then reconsider b2 = (b - m9) + n9 as even Element of NAT by A2, Lm30; A13: b2 <= len W by A2, A12, Lm30; A14: (W .remove (m,n)) . b = W . b2 by A2, A12, Lm30; now__::_thesis:_contradiction percases ( a < b2 or b2 <= a ) ; suppose a < b2 ; ::_thesis: contradiction hence contradiction by A3, A6, A9, A14, A13, Lm57; ::_thesis: verum end; supposeA15: b2 <= a ; ::_thesis: contradiction A16: n - m >= m - m by A2, XREAL_1:13; A17: a - b < b - b by A4, XREAL_1:14; ((n - m) + b) - b <= a - b by A15, XREAL_1:13; then 0 <= a - b by A16; hence contradiction by A17; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; supposeA18: ( m <= a & a <= len (W .remove (m,n)) ) ; ::_thesis: contradiction then reconsider a2 = (a - m9) + n9 as even Element of NAT by A2, Lm30; reconsider nm4 = n9 - m9 as even Element of NAT by A2, INT_1:5; A19: (W .remove (m,n)) . a = W . a2 by A2, A18, Lm30; now__::_thesis:_contradiction percases ( b in Seg m or ( m <= b & b <= len (W .remove (m,n)) ) ) by A2, A7, Lm34; suppose b in Seg m ; ::_thesis: contradiction then b <= m by FINSEQ_1:1; hence contradiction by A4, A18, XXREAL_0:2; ::_thesis: verum end; supposeA20: ( m <= b & b <= len (W .remove (m,n)) ) ; ::_thesis: contradiction then reconsider b2 = (b - m9) + n9 as even Element of NAT by A2, Lm30; A21: b2 <= len W by A2, A20, Lm30; A22: (W .remove (m,n)) . b = W . b2 by A2, A20, Lm30; now__::_thesis:_contradiction percases ( a2 < b2 or b2 <= a2 ) ; supposeA23: a2 < b2 ; ::_thesis: contradiction 1 <= m9 by ABIAN:12; then 1 <= a by A18, XXREAL_0:2; then 1 <= a + nm4 by NAT_1:12; hence contradiction by A6, A19, A22, A21, A23, Lm57; ::_thesis: verum end; suppose b2 <= a2 ; ::_thesis: contradiction then b + nm4 <= a + nm4 ; hence contradiction by A4, XREAL_1:6; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; hence W .remove (m,n) is Trail-like by Lm57; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; ::_thesis: W .remove (m,n) is Trail-like hence W .remove (m,n) is Trail-like by Def12; ::_thesis: verum end; end; end; hence W .remove (m,n) is Trail-like ; ::_thesis: verum end; end; registration let G be _Graph; let W be Path of G; let m, n be Element of NAT ; clusterW .remove (m,n) -> Path-like ; coherence W .remove (m,n) is Path-like proof set W2 = W .remove (m,n); A1: len (W .remove (m,n)) <= len W by Lm26; now__::_thesis:_W_.remove_(m,n)_is_Path-like percases ( ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) or not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; supposeA2: ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) ; ::_thesis: W .remove (m,n) is Path-like then reconsider m9 = m, n9 = n as odd Element of NAT ; now__::_thesis:_for_x,_y_being_odd_Element_of_NAT_st_x_<_y_&_y_<=_len_(W_.remove_(m,n))_&_(W_.remove_(m,n))_._x_=_(W_.remove_(m,n))_._y_holds_ (_x_=_1_&_y_=_len_(W_.remove_(m,n))_) let x, y be odd Element of NAT ; ::_thesis: ( x < y & y <= len (W .remove (m,n)) & (W .remove (m,n)) . x = (W .remove (m,n)) . y implies ( x = 1 & y = len (W .remove (m,n)) ) ) assume that A3: x < y and A4: y <= len (W .remove (m,n)) and A5: (W .remove (m,n)) . x = (W .remove (m,n)) . y ; ::_thesis: ( x = 1 & y = len (W .remove (m,n)) ) A6: 1 <= x by ABIAN:12; x <= len (W .remove (m,n)) by A3, A4, XXREAL_0:2; then A7: x in dom (W .remove (m,n)) by A6, FINSEQ_3:25; 1 <= y by ABIAN:12; then A8: y in dom (W .remove (m,n)) by A4, FINSEQ_3:25; A9: y <= len W by A1, A4, XXREAL_0:2; now__::_thesis:_(_x_=_1_&_y_=_len_(W_.remove_(m,n))_) percases ( x in Seg m or ( m <= x & x <= len (W .remove (m,n)) ) ) by A2, A7, Lm34; suppose x in Seg m ; ::_thesis: ( x = 1 & y = len (W .remove (m,n)) ) then A10: (W .remove (m,n)) . x = W . x by A2, Lm29; now__::_thesis:_(_x_=_1_&_y_=_len_(W_.remove_(m,n))_) percases ( y in Seg m or ( m <= y & y <= len (W .remove (m,n)) ) ) by A2, A8, Lm34; suppose y in Seg m ; ::_thesis: ( x = 1 & y = len (W .remove (m,n)) ) then A11: (W .remove (m,n)) . y = W . y by A2, Lm29; then y = len W by A3, A5, A9, A10, Def28; hence ( x = 1 & y = len (W .remove (m,n)) ) by A1, A3, A4, A5, A10, A11, Def28, XXREAL_0:1; ::_thesis: verum end; supposeA12: ( m <= y & y <= len (W .remove (m,n)) ) ; ::_thesis: ( x = 1 & y = len (W .remove (m,n)) ) then A13: (y - m) + n <= len W by A2, Lm30; A14: (W .remove (m,n)) . y = W . ((y - m) + n) by A2, A12, Lm30; reconsider y2 = (y - m9) + n9 as odd Element of NAT by A2, A12, Lm30; (y - m) + n >= (y - m) + m by A2, XREAL_1:7; then A15: x < y2 by A3, XXREAL_0:2; y2 <= len W by A2, A12, Lm30; then y2 = len W by A5, A10, A14, A15, Def28; then (len (W .remove (m,n))) + n = ((y - m) + n) + m by A2, Lm24 .= y + n ; hence ( x = 1 & y = len (W .remove (m,n)) ) by A5, A10, A14, A13, A15, Def28; ::_thesis: verum end; end; end; hence ( x = 1 & y = len (W .remove (m,n)) ) ; ::_thesis: verum end; supposeA16: ( m <= x & x <= len (W .remove (m,n)) ) ; ::_thesis: ( x = 1 & y = len (W .remove (m,n)) ) then reconsider x2 = (x - m9) + n9 as odd Element of NAT by A2, Lm30; A17: (W .remove (m,n)) . x = W . ((x - m) + n) by A2, A16, Lm30; now__::_thesis:_(_x_=_1_&_y_=_len_(W_.remove_(m,n))_) percases ( y in Seg m or ( m <= y & y <= len (W .remove (m,n)) ) ) by A2, A8, Lm34; suppose y in Seg m ; ::_thesis: ( x = 1 & y = len (W .remove (m,n)) ) then y <= m by FINSEQ_1:1; hence ( x = 1 & y = len (W .remove (m,n)) ) by A3, A16, XXREAL_0:2; ::_thesis: verum end; supposeA18: ( m <= y & y <= len (W .remove (m,n)) ) ; ::_thesis: ( x = 1 & y = len (W .remove (m,n)) ) then reconsider y2 = (y - m9) + n9 as odd Element of NAT by A2, Lm30; x + (n - m) < y + (n - m) by A3, XREAL_1:8; then A19: x2 < y2 ; reconsider xm4 = x - m as Element of NAT by A16, INT_1:5; A20: 1 <= n9 by ABIAN:12; A21: 1 <= m9 by ABIAN:12; A22: (y - m) + n <= len W by A2, A18, Lm30; A23: (W .remove (m,n)) . y = W . ((y - m) + n) by A2, A18, Lm30; then y2 = len W by A5, A17, A22, A19, Def28; then A24: (len (W .remove (m,n))) + n = ((y - m) + n) + m by A2, Lm24 .= y + n ; x2 = 1 by A5, A17, A23, A22, A19, Def28; then x2 - n9 <= 1 - 1 by A20, XREAL_1:13; then A25: xm4 = 0 ; then m <= 1 by A2, A5, A17, A23, A22, A19, Def28; hence ( x = 1 & y = len (W .remove (m,n)) ) by A24, A25, A21, XXREAL_0:1; ::_thesis: verum end; end; end; hence ( x = 1 & y = len (W .remove (m,n)) ) ; ::_thesis: verum end; end; end; hence ( x = 1 & y = len (W .remove (m,n)) ) ; ::_thesis: verum end; hence W .remove (m,n) is Path-like by Def28; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; ::_thesis: W .remove (m,n) is Path-like hence W .remove (m,n) is Path-like by Def12; ::_thesis: verum end; end; end; hence W .remove (m,n) is Path-like ; ::_thesis: verum end; end; definition let G be _Graph; let W be Walk of G; mode Subwalk of W -> Walk of G means :Def32: :: GLIB_001:def 32 ( it is_Walk_from W .first() ,W .last() & ex es being Subset of (W .edgeSeq()) st it .edgeSeq() = Seq es ); existence ex b1 being Walk of G st ( b1 is_Walk_from W .first() ,W .last() & ex es being Subset of (W .edgeSeq()) st b1 .edgeSeq() = Seq es ) proof reconsider es = W .edgeSeq() as Subset of (W .edgeSeq()) by GRAPH_2:26; take W ; ::_thesis: ( W is_Walk_from W .first() ,W .last() & ex es being Subset of (W .edgeSeq()) st W .edgeSeq() = Seq es ) thus W is_Walk_from W .first() ,W .last() by Def23; ::_thesis: ex es being Subset of (W .edgeSeq()) st W .edgeSeq() = Seq es take es ; ::_thesis: W .edgeSeq() = Seq es thus W .edgeSeq() = Seq es by FINSEQ_3:116; ::_thesis: verum end; end; :: deftheorem Def32 defines Subwalk GLIB_001:def_32_:_ for G being _Graph for W, b3 being Walk of G holds ( b3 is Subwalk of W iff ( b3 is_Walk_from W .first() ,W .last() & ex es being Subset of (W .edgeSeq()) st b3 .edgeSeq() = Seq es ) ); Lm70: for G being _Graph for W being Walk of G holds W is Subwalk of W proof let G be _Graph; ::_thesis: for W being Walk of G holds W is Subwalk of W let W be Walk of G; ::_thesis: W is Subwalk of W reconsider es = W .edgeSeq() as Subset of (W .edgeSeq()) by GRAPH_2:26; A1: W .edgeSeq() = Seq es by FINSEQ_3:116; W is_Walk_from W .first() ,W .last() by Def23; hence W is Subwalk of W by A1, Def32; ::_thesis: verum end; Lm71: for G being _Graph for W1 being Walk of G for W2 being Subwalk of W1 for W3 being Subwalk of W2 holds W3 is Subwalk of W1 proof let G be _Graph; ::_thesis: for W1 being Walk of G for W2 being Subwalk of W1 for W3 being Subwalk of W2 holds W3 is Subwalk of W1 let W1 be Walk of G; ::_thesis: for W2 being Subwalk of W1 for W3 being Subwalk of W2 holds W3 is Subwalk of W1 let W2 be Subwalk of W1; ::_thesis: for W3 being Subwalk of W2 holds W3 is Subwalk of W1 let W3 be Subwalk of W2; ::_thesis: W3 is Subwalk of W1 set fs = W1 .edgeSeq() ; set fs1 = W2 .edgeSeq() ; set fs2 = W3 .edgeSeq() ; consider fss1 being Subset of (W2 .edgeSeq()) such that A1: W3 .edgeSeq() = Seq fss1 by Def32; consider fss being Subset of (W1 .edgeSeq()) such that A2: W2 .edgeSeq() = Seq fss by Def32; set fss2 = fss | (rng ((Sgm (dom fss)) | (dom fss1))); reconsider fss2 = fss | (rng ((Sgm (dom fss)) | (dom fss1))) as Subset of (W1 .edgeSeq()) by GRAPH_2:27; A3: W3 .edgeSeq() = Seq fss2 by A1, A2, GRAPH_2:28; A4: W2 is_Walk_from W1 .first() ,W1 .last() by Def32; then A5: W2 .last() = W1 .last() by Def23; W2 .first() = W1 .first() by A4, Def23; hence W3 is Subwalk of W1 by A5, A3, Def32; ::_thesis: verum end; Lm72: for G being _Graph for W1, W2 being Walk of G st W1 is Subwalk of W2 holds len W1 <= len W2 proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 is Subwalk of W2 holds len W1 <= len W2 let W1, W2 be Walk of G; ::_thesis: ( W1 is Subwalk of W2 implies len W1 <= len W2 ) assume W1 is Subwalk of W2 ; ::_thesis: len W1 <= len W2 then ex es being Subset of (W2 .edgeSeq()) st W1 .edgeSeq() = Seq es by Def32; then 2 * (len (W1 .edgeSeq())) <= 2 * (len (W2 .edgeSeq())) by Th3, XREAL_1:64; then (2 * (len (W1 .edgeSeq()))) + 1 <= (2 * (len (W2 .edgeSeq()))) + 1 by XREAL_1:7; then len W1 <= (2 * (len (W2 .edgeSeq()))) + 1 by Def15; hence len W1 <= len W2 by Def15; ::_thesis: verum end; definition let G be _Graph; let W be Walk of G; let m, n be Element of NAT ; :: original: .remove redefine funcW .remove (m,n) -> Subwalk of W; coherence W .remove (m,n) is Subwalk of W proof set W2 = W .remove (m,n); set es1 = (W .remove (m,n)) .edgeSeq() ; now__::_thesis:_W_.remove_(m,n)_is_Subwalk_of_W percases ( ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) or not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; supposeA1: ( m is odd & n is odd & m <= n & n <= len W & W . m = W . n ) ; ::_thesis: W .remove (m,n) is Subwalk of W then reconsider m9 = m, n9 = n as odd Element of NAT ; reconsider lenWn4 = (len W) - n9 as even Element of NAT by A1, INT_1:5; A2: Seg (len ((W .remove (m,n)) .edgeSeq())) = dom ((W .remove (m,n)) .edgeSeq()) by FINSEQ_1:def_3; reconsider lenWaa1 = (len W) - 1 as even Element of NAT by ABIAN:12, INT_1:5; reconsider n1 = n9 + 1 as even Element of NAT ; reconsider maa1 = m9 - 1 as even Element of NAT by ABIAN:12, INT_1:5; set X = { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } ; set Y = { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } ; set Z = { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } ; set es = (W .edgeSeq()) | ( { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } ); 2 divides maa1 by PEPIN:22; then A3: maa1 = 2 * (maa1 div 2) by NAT_D:3; 2 divides n1 by PEPIN:22; then A4: n1 = 2 * (n1 div 2) by NAT_D:3; now__::_thesis:_not_n1_div_2_<_1 assume n1 div 2 < 1 ; ::_thesis: contradiction then 2 * (n1 div 2) < 2 * 1 by XREAL_1:68; then (n + 1) - 1 < 2 - 1 by A4, XREAL_1:14; then n9 < 1 ; hence contradiction by ABIAN:12; ::_thesis: verum end; then reconsider n1div2aa1 = (n1 div 2) - 1 as Element of NAT by INT_1:5; A5: 2 divides lenWaa1 by PEPIN:22; then A6: lenWaa1 = 2 * (lenWaa1 div 2) by NAT_D:3; now__::_thesis:_for_x_being_set_st_x_in__{__x_where_x_is_Element_of_NAT_:_(_1_<=_x_&_x_<=_maa1_div_2_)__}__\/__{__x_where_x_is_Element_of_NAT_:_(_n1_div_2_<=_x_&_x_<=_lenWaa1_div_2_)__}__holds_ x_in_dom_(W_.edgeSeq()) let x be set ; ::_thesis: ( x in { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } implies x in dom (W .edgeSeq()) ) assume A7: x in { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } ; ::_thesis: x in dom (W .edgeSeq()) now__::_thesis:_x_in_dom_(W_.edgeSeq()) percases ( x in { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } or x in { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } ) by A7, XBOOLE_0:def_3; suppose x in { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } ; ::_thesis: x in dom (W .edgeSeq()) then consider y being Element of NAT such that A8: y = x and A9: 1 <= y and A10: y <= maa1 div 2 ; 2 * y <= maa1 by A3, A10, XREAL_1:64; then 2 * y <= maa1 + 1 by NAT_1:12; then 2 * y <= n by A1, XXREAL_0:2; then A11: 2 * y <= len W by A1, XXREAL_0:2; 1 <= y + y by A9, NAT_1:12; then 2 * y in dom W by A11, FINSEQ_3:25; hence x in dom (W .edgeSeq()) by A8, Lm41; ::_thesis: verum end; suppose x in { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } ; ::_thesis: x in dom (W .edgeSeq()) then consider y being Element of NAT such that A12: y = x and A13: n1 div 2 <= y and A14: y <= lenWaa1 div 2 ; 2 * y <= lenWaa1 by A6, A14, XREAL_1:64; then A15: 2 * y <= lenWaa1 + 1 by NAT_1:12; A16: 1 <= n1 by NAT_1:12; n1 <= 2 * y by A4, A13, XREAL_1:64; then 1 <= 2 * y by A16, XXREAL_0:2; then 2 * y in dom W by A15, FINSEQ_3:25; hence x in dom (W .edgeSeq()) by A12, Lm41; ::_thesis: verum end; end; end; hence x in dom (W .edgeSeq()) ; ::_thesis: verum end; then A17: { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } c= dom (W .edgeSeq()) by TARSKI:def_3; then A18: { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } c= Seg (len (W .edgeSeq())) by FINSEQ_1:def_3; then A19: { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } c= Seg (len (W .edgeSeq())) by XBOOLE_1:11; A20: { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } c= Seg (len (W .edgeSeq())) by A18, XBOOLE_1:11; reconsider X = { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } , Y = { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } as finite set by A18, FINSET_1:1, XBOOLE_1:11; A21: X = { x where x is Element of NAT : ( 0 + 1 <= x & x <= 0 + (maa1 div 2) ) } ; A22: (dom (W .edgeSeq())) /\ ( { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } ) = { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } by A17, XBOOLE_1:28; then A23: dom ((W .edgeSeq()) | ( { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } )) = { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } by RELAT_1:61; 2 divides lenWn4 by PEPIN:22; then A24: lenWn4 = 2 * (lenWn4 div 2) by NAT_D:3; A25: now__::_thesis:_card_Y_=_lenWn4_div_2 percases ( n1 div 2 > lenWaa1 div 2 or n1 div 2 <= lenWaa1 div 2 ) ; supposeA26: n1 div 2 > lenWaa1 div 2 ; ::_thesis: card Y = lenWn4 div 2 then lenWaa1 < n + 1 by A6, A4, XREAL_1:68; then lenWaa1 + 1 <= n + 1 by NAT_1:13; then len W <= n9 + 1 ; then len W < n + 1 by XXREAL_0:1; then len W <= n by NAT_1:13; then A27: len W = n by A1, XXREAL_0:1; now__::_thesis:_not_Y_<>_{} assume Y <> {} ; ::_thesis: contradiction then consider x being set such that A28: x in Y by XBOOLE_0:def_1; ex x9 being Element of NAT st ( x9 = x & n1 div 2 <= x9 & x9 <= lenWaa1 div 2 ) by A28; hence contradiction by A26, XXREAL_0:2; ::_thesis: verum end; hence card Y = lenWn4 div 2 by A27, CARD_1:27, NAT_2:2; ::_thesis: verum end; suppose n1 div 2 <= lenWaa1 div 2 ; ::_thesis: card Y = lenWn4 div 2 then reconsider k = (lenWaa1 div 2) - (n1 div 2) as Element of NAT by INT_1:5; Y = { x where x is Element of NAT : ( n1 div 2 <= x & x <= (n1 div 2) + k ) } ; then card Y = k + 1 by GRAPH_2:4; hence card Y = lenWn4 div 2 by A24, A6, A4; ::_thesis: verum end; end; end; reconsider Z = { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } as finite set by A17; W .edgeSeq() is Subset of (W .edgeSeq()) by GRAPH_2:26; then reconsider es = (W .edgeSeq()) | ( { x where x is Element of NAT : ( 1 <= x & x <= maa1 div 2 ) } \/ { x where x is Element of NAT : ( n1 div 2 <= x & x <= lenWaa1 div 2 ) } ) as Subset of (W .edgeSeq()) by GRAPH_2:27; set es2 = Seq es; A29: Seq es = es * (Sgm (dom es)) by FINSEQ_1:def_14; set lenY = (lenWaa1 div 2) - n1div2aa1; now__::_thesis:_not_n1div2aa1_>_lenWaa1_div_2 assume n1div2aa1 > lenWaa1 div 2 ; ::_thesis: contradiction then 2 * n1div2aa1 > 2 * (lenWaa1 div 2) by XREAL_1:68; then ((n + 1) - 1) - 1 > (len W) - 1 by A5, A4, NAT_D:3; hence contradiction by A1, XREAL_1:9; ::_thesis: verum end; then reconsider lenY = (lenWaa1 div 2) - n1div2aa1 as Element of NAT by INT_1:5; A30: Y = { x where x is Element of NAT : ( n1div2aa1 + 1 <= x & x <= n1div2aa1 + lenY ) } ; A31: now__::_thesis:_for_a,_b_being_Element_of_NAT_st_a_in_X_&_b_in_Y_holds_ a_<_b let a, b be Element of NAT ; ::_thesis: ( a in X & b in Y implies a < b ) assume that A32: a in X and A33: b in Y ; ::_thesis: a < b consider b9 being Element of NAT such that A34: b9 = b and A35: n1 div 2 <= b9 and b9 <= lenWaa1 div 2 by A33; consider a9 being Element of NAT such that A36: a9 = a and 1 <= a9 and A37: a9 <= maa1 div 2 by A32; 2 * a9 <= maa1 by A3, A37, XREAL_1:64; then 2 * a9 < maa1 + 1 by NAT_1:13; then 2 * a9 < n by A1, XXREAL_0:2; then A38: (2 * a9) + 0 < n + 1 by XREAL_1:8; A39: n + 1 <= 2 * b9 by A4, A35, XREAL_1:64; then 2 * a9 < 2 * b9 by A38, XXREAL_0:2; then a9 <= b9 by XREAL_1:68; hence a < b by A36, A34, A38, A39, XXREAL_0:1; ::_thesis: verum end; A40: now__::_thesis:_card_X_=_maa1_div_2 percases ( maa1 div 2 = 0 or maa1 div 2 <> 0 ) ; supposeA41: maa1 div 2 = 0 ; ::_thesis: card X = maa1 div 2 now__::_thesis:_not_X_<>_{} assume X <> {} ; ::_thesis: contradiction then consider x being set such that A42: x in X by XBOOLE_0:def_1; ex x9 being Element of NAT st ( x9 = x & 1 <= x9 & x9 <= maa1 div 2 ) by A42; hence contradiction by A41; ::_thesis: verum end; hence card X = maa1 div 2 by A41; ::_thesis: verum end; suppose maa1 div 2 <> 0 ; ::_thesis: card X = maa1 div 2 then consider k being Nat such that A43: maa1 div 2 = k + 1 by NAT_1:6; reconsider k = k as Element of NAT by ORDINAL1:def_12; maa1 div 2 = k + 1 by A43; hence card X = maa1 div 2 by GRAPH_2:4; ::_thesis: verum end; end; end; then A44: dom (Sgm X) = Seg (maa1 div 2) by A18, FINSEQ_3:40, XBOOLE_1:11; then A45: len (Sgm X) = maa1 div 2 by FINSEQ_1:def_3; len (W .remove (m,n)) = (2 * (len ((W .remove (m,n)) .edgeSeq()))) + 1 by Def15; then A46: ((len W) + m) - n = (2 * (len ((W .remove (m,n)) .edgeSeq()))) + 1 by A1, Lm31; now__::_thesis:_X_/\_Y_=_{} assume not X /\ Y = {} ; ::_thesis: contradiction then consider x being set such that A47: x in X /\ Y by XBOOLE_0:def_1; x in Y by A47, XBOOLE_0:def_4; then consider y9 being Element of NAT such that A48: y9 = x and A49: n1 div 2 <= y9 and y9 <= lenWaa1 div 2 ; x in X by A47, XBOOLE_0:def_4; then consider x9 being Element of NAT such that A50: x9 = x and 1 <= x9 and A51: x9 <= maa1 div 2 ; 2 * x9 <= maa1 by A3, A51, XREAL_1:64; then 2 * y9 < maa1 + 1 by A50, A48, NAT_1:13; then 2 * y9 < n by A1, XXREAL_0:2; then (2 * y9) + 0 < n + 1 by XREAL_1:8; hence contradiction by A4, A49, XREAL_1:64; ::_thesis: verum end; then X misses Y by XBOOLE_0:def_7; then A52: card Z = (maa1 div 2) + (lenWn4 div 2) by A40, A25, CARD_2:40; dom es c= Seg (len (W .edgeSeq())) by A22, A18, RELAT_1:61; then rng (Sgm (dom es)) = dom es by FINSEQ_1:def_13; then A53: dom (Seq es) = dom (Sgm Z) by A23, A29, RELAT_1:27 .= Seg (card Z) by A18, FINSEQ_3:40 ; A54: dom (Sgm Y) = Seg (lenWn4 div 2) by A18, A25, FINSEQ_3:40, XBOOLE_1:11; now__::_thesis:_for_x9_being_set_st_x9_in_dom_((W_.remove_(m,n))_.edgeSeq())_holds_ ((W_.remove_(m,n))_.edgeSeq())_._x9_=_(Seq_es)_._x9 let x9 be set ; ::_thesis: ( x9 in dom ((W .remove (m,n)) .edgeSeq()) implies ((W .remove (m,n)) .edgeSeq()) . x9 = (Seq es) . x9 ) assume A55: x9 in dom ((W .remove (m,n)) .edgeSeq()) ; ::_thesis: ((W .remove (m,n)) .edgeSeq()) . x9 = (Seq es) . x9 then reconsider x = x9 as Element of NAT ; A56: 1 <= x by A55, FINSEQ_3:25; A57: x <= len ((W .remove (m,n)) .edgeSeq()) by A55, FINSEQ_3:25; then A58: ((W .remove (m,n)) .edgeSeq()) . x = (W .remove (m,n)) . (2 * x) by A56, Def15; now__::_thesis:_((W_.remove_(m,n))_.edgeSeq())_._x9_=_(Seq_es)_._x9 percases ( (2 * x) + 1 <= m or (2 * x) + 1 > m ) ; supposeA59: (2 * x) + 1 <= m ; ::_thesis: ((W .remove (m,n)) .edgeSeq()) . x9 = (Seq es) . x9 A60: 1 <= x + x by A56, NAT_1:12; ((2 * x) + 1) - 1 < m - 0 by A59, XREAL_1:15; then 2 * x in Seg m by A60, FINSEQ_1:1; then A61: ((W .remove (m,n)) .edgeSeq()) . x9 = W . (2 * x) by A1, A58, Lm29; A62: (Sgm Z) . x = ((Sgm X) ^ (Sgm Y)) . x by A19, A20, A31, FINSEQ_3:42; ((2 * x) + 1) - 1 <= maa1 by A59, XREAL_1:13; then A63: x <= maa1 div 2 by A3, XREAL_1:68; then x in X by A56; then A64: x in dom es by A23, XBOOLE_0:def_3; x in dom (Sgm X) by A44, A56, A63, FINSEQ_1:1; then (Sgm Z) . x = (Sgm X) . x by A62, FINSEQ_1:def_7 .= 0 + x by A21, A56, A63, GRAPH_2:5 ; then (Seq es) . x = es . x by A3, A24, A23, A2, A29, A53, A46, A52, A55, FUNCT_1:12; then A65: (Seq es) . x = (W .edgeSeq()) . x by A64, FUNCT_1:47; x <= len (W .edgeSeq()) by A23, A18, A64, FINSEQ_1:1; hence ((W .remove (m,n)) .edgeSeq()) . x9 = (Seq es) . x9 by A56, A61, A65, Def15; ::_thesis: verum end; supposeA66: (2 * x) + 1 > m ; ::_thesis: ((W .remove (m,n)) .edgeSeq()) . x9 = (Seq es) . x9 A67: now__::_thesis:_not_x_<=_maa1_div_2 assume x <= maa1 div 2 ; ::_thesis: contradiction then 2 * x <= maa1 by A3, XREAL_1:64; then (2 * x) + 1 <= maa1 + 1 by XREAL_1:7; hence contradiction by A66; ::_thesis: verum end; then consider k being Nat such that A68: x = (maa1 div 2) + k by NAT_1:10; A69: (Sgm Z) . x = ((Sgm X) ^ (Sgm Y)) . x by A19, A20, A31, FINSEQ_3:42; A70: ex lenWaa19 being even Element of NAT st ( lenWaa19 = lenWaa1 & len (W .edgeSeq()) = lenWaa19 div 2 ) by Lm42; 2 * x <= 2 * (len ((W .remove (m,n)) .edgeSeq())) by A57, XREAL_1:64; then 2 * x <= (2 * (len ((W .remove (m,n)) .edgeSeq()))) + 1 by NAT_1:12; then A71: 2 * x <= len (W .remove (m,n)) by Def15; reconsider k = k as Element of NAT by ORDINAL1:def_12; A72: 2 * (n1div2aa1 + k) = ((2 * x) - m) + n by A3, A4, A68; A73: m <= 2 * x by A66, NAT_1:13; then A74: ((2 * x) - m) + n <= len W by A1, A71, Lm30; A75: now__::_thesis:_not_lenWaa1_div_2_<_k_+_n1div2aa1 reconsider z = ((2 * x) - m9) + n9 as Element of NAT by A1, A73, A71, Lm30; assume lenWaa1 div 2 < k + n1div2aa1 ; ::_thesis: contradiction then lenWaa1 < 2 * ((x - (maa1 div 2)) + n1div2aa1) by A6, A68, XREAL_1:68; then lenWaa1 + 1 < (((2 * x) - m) + n) + 1 by A3, A4, XREAL_1:8; then len W <= z by NAT_1:13; hence contradiction by A74, XXREAL_0:1; ::_thesis: verum end; k <> 0 by A67, A68; then 0 + 1 < k + 1 by XREAL_1:8; then A76: 1 <= k by NAT_1:13; then n1div2aa1 + 1 <= n1div2aa1 + k by XREAL_1:7; then n1div2aa1 + k in Y by A75; then n1div2aa1 + k in dom es by A23, XBOOLE_0:def_3; then A77: es . (n1div2aa1 + k) = (W .edgeSeq()) . (n1div2aa1 + k) by FUNCT_1:47; A78: now__::_thesis:_not_lenWn4_div_2_<_x_-_(maa1_div_2) set z = ((2 * x) - m9) + n9; reconsider z = ((2 * x) - m9) + n9 as Element of NAT by A1, A73, A71, Lm30; assume lenWn4 div 2 < x - (maa1 div 2) ; ::_thesis: contradiction then 2 * (lenWn4 div 2) < 2 * (x - (maa1 div 2)) by XREAL_1:68; then A79: lenWn4 + n < (((2 * x) - m) + 1) + n by A3, A24, XREAL_1:8; ((2 * x) - m9) + n9 < len W by A74, XXREAL_0:1; then z + 1 <= len W by NAT_1:13; hence contradiction by A79; ::_thesis: verum end; then k in dom (Sgm Y) by A54, A68, A76, FINSEQ_1:1; then (Sgm Z) . x = (Sgm Y) . k by A45, A69, A68, FINSEQ_1:def_7 .= n1div2aa1 + k by A24, A6, A4, A30, A68, A76, A78, GRAPH_2:5 ; then A80: (Seq es) . x = es . (n1div2aa1 + k) by A3, A24, A23, A2, A29, A53, A46, A52, A55, FUNCT_1:12; 1 <= n1div2aa1 + k by A76, NAT_1:12; then (Seq es) . x = W . (2 * (n1div2aa1 + k)) by A80, A75, A77, A70, Def15; hence ((W .remove (m,n)) .edgeSeq()) . x9 = (Seq es) . x9 by A1, A58, A73, A71, A72, Lm30; ::_thesis: verum end; end; end; hence ((W .remove (m,n)) .edgeSeq()) . x9 = (Seq es) . x9 ; ::_thesis: verum end; then A81: (W .remove (m,n)) .edgeSeq() = Seq es by A3, A24, A2, A53, A46, A52, FUNCT_1:2; W is_Walk_from W .first() ,W .last() by Def23; then W .remove (m,n) is_Walk_from W .first() ,W .last() by Lm25; hence W .remove (m,n) is Subwalk of W by A81, Def32; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W or not W . m = W . n ) ; ::_thesis: W .remove (m,n) is Subwalk of W then W .remove (m,n) = W by Def12; hence W .remove (m,n) is Subwalk of W by Lm70; ::_thesis: verum end; end; end; hence W .remove (m,n) is Subwalk of W ; ::_thesis: verum end; end; registration let G be _Graph; let W be Walk of G; cluster Relation-like NAT -defined (the_Vertices_of G) \/ (the_Edges_of G) -valued Function-like finite FinSequence-like FinSubsequence-like Trail-like Path-like for Subwalk of W; existence ex b1 being Subwalk of W st ( b1 is Trail-like & b1 is Path-like ) proof set n = (len W) + 1; defpred S1[ Element of NAT , set , set ] means ( ( W is Walk of G & ex Wn being Walk of G st ( Wn = W & c3 = Wn .remove ((Wn .find ((2 * G) + 1)),(Wn .rfind ((2 * G) + 1))) ) ) or ( W is not Walk of G & c3 = W ) ); A1: now__::_thesis:_for_n_being_Element_of_NAT_ for_x_being_set_ex_y_being_set_st_S1[n,x,y] let n be Element of NAT ; ::_thesis: for x being set ex y being set st S1[n,x,y] let x be set ; ::_thesis: ex y being set st S1[n,x,y] now__::_thesis:_ex_y_being_set_st_S1[n,x,y] percases ( x is Walk of G or not x is Walk of G ) ; suppose x is Walk of G ; ::_thesis: ex y being set st S1[n,x,y] then reconsider W = x as Walk of G ; set y = W .remove ((W .find ((2 * n) + 1)),(W .rfind ((2 * n) + 1))); S1[n,x,W .remove ((W .find ((2 * n) + 1)),(W .rfind ((2 * n) + 1)))] ; hence ex y being set st S1[n,x,y] ; ::_thesis: verum end; suppose x is not Walk of G ; ::_thesis: ex y being set st S1[n,x,y] hence ex y being set st S1[n,x,y] ; ::_thesis: verum end; end; end; hence ex y being set st S1[n,x,y] ; ::_thesis: verum end; consider f being Function such that A2: ( dom f = NAT & f . 0 = W & ( for n being Element of NAT holds S1[n,f . n,f . (n + 1)] ) ) from RECDEF_1:sch_1(A1); defpred S2[ Element of NAT ] means ex Wn being Subwalk of W st ( Wn = f . G & len Wn <= len W & ( for m being odd Element of NAT st m < (2 * G) + 1 & m <= len Wn holds Wn .rfind m = m ) ); now__::_thesis:_for_n_being_Element_of_NAT_st_S2[n]_holds_ ex_Wn1_being_Subwalk_of_W_st_ (_f_._(n_+_1)_=_Wn1_&_len_Wn1_<=_len_W_&_(_for_m_being_odd_Element_of_NAT_st_m_<_(2_*_(n_+_1))_+_1_&_m_<=_len_Wn1_holds_ Wn1_.rfind_m_=_m_)_) let n be Element of NAT ; ::_thesis: ( S2[n] implies ex Wn1 being Subwalk of W st ( f . (n + 1) = Wn1 & len Wn1 <= len W & ( for m being odd Element of NAT st m < (2 * (n + 1)) + 1 & m <= len Wn1 holds Wn1 .rfind m = m ) ) ) assume S2[n] ; ::_thesis: ex Wn1 being Subwalk of W st ( f . (n + 1) = Wn1 & len Wn1 <= len W & ( for m being odd Element of NAT st m < (2 * (n + 1)) + 1 & m <= len Wn1 holds Wn1 .rfind m = m ) ) then consider Wn being Subwalk of W such that A3: Wn = f . n and A4: len Wn <= len W and A5: for m being odd Element of NAT st m < (2 * n) + 1 & m <= len Wn holds Wn .rfind m = m ; set a = Wn .find ((2 * n) + 1); set b = Wn .rfind ((2 * n) + 1); set Wn1 = Wn .remove ((Wn .find ((2 * n) + 1)),(Wn .rfind ((2 * n) + 1))); reconsider Wn1 = Wn .remove ((Wn .find ((2 * n) + 1)),(Wn .rfind ((2 * n) + 1))) as Subwalk of W by Lm71; take Wn1 = Wn1; ::_thesis: ( f . (n + 1) = Wn1 & len Wn1 <= len W & ( for m being odd Element of NAT st m < (2 * (n + 1)) + 1 & m <= len Wn1 holds Wn1 .rfind m = m ) ) S1[n,f . n,f . (n + 1)] by A2; hence f . (n + 1) = Wn1 by A3; ::_thesis: ( len Wn1 <= len W & ( for m being odd Element of NAT st m < (2 * (n + 1)) + 1 & m <= len Wn1 holds Wn1 .rfind m = m ) ) len Wn1 <= len Wn by Lm26; hence len Wn1 <= len W by A4, XXREAL_0:2; ::_thesis: for m being odd Element of NAT st m < (2 * (n + 1)) + 1 & m <= len Wn1 holds Wn1 .rfind m = m let m be odd Element of NAT ; ::_thesis: ( m < (2 * (n + 1)) + 1 & m <= len Wn1 implies Wn1 .rfind m = m ) assume that A6: m < (2 * (n + 1)) + 1 and A7: m <= len Wn1 ; ::_thesis: Wn1 .rfind m = m set W1 = Wn .cut (1,(Wn .find ((2 * n) + 1))); set W2 = Wn .cut ((Wn .rfind ((2 * n) + 1)),(len Wn)); A8: len Wn1 <= len Wn by Lm26; then A9: m <= len Wn by A7, XXREAL_0:2; m <= 2 * (n + 1) by A6, NAT_1:13; then m < ((2 * n) + 1) + 1 by XXREAL_0:1; then A10: m <= (2 * n) + 1 by NAT_1:13; now__::_thesis:_Wn1_.rfind_m_=_m percases ( (2 * n) + 1 <= len Wn or len Wn < (2 * n) + 1 ) ; supposeA11: (2 * n) + 1 <= len Wn ; ::_thesis: Wn1 .rfind m = m then A12: Wn .find ((2 * n) + 1) <= (2 * n) + 1 by Lm49; A13: Wn . (Wn .find ((2 * n) + 1)) = Wn . ((2 * n) + 1) by A11, Def20; A14: Wn .find ((2 * n) + 1) <= len Wn by A11, Def20; A15: now__::_thesis:_not_Wn_.find_((2_*_n)_+_1)_<_(2_*_n)_+_1 assume A16: Wn .find ((2 * n) + 1) < (2 * n) + 1 ; ::_thesis: contradiction then Wn .find ((2 * n) + 1) <= len Wn by A11, XXREAL_0:2; then Wn .rfind (Wn .find ((2 * n) + 1)) = Wn .find ((2 * n) + 1) by A5, A16; hence contradiction by A11, A14, A13, A16, Def22; ::_thesis: verum end; then A17: Wn .find ((2 * n) + 1) = (2 * n) + 1 by A12, XXREAL_0:1; A18: Wn . (Wn .rfind ((2 * n) + 1)) = Wn . ((2 * n) + 1) by A11, Def22; set m9 = Wn1 .rfind m; A19: 1 <= m by ABIAN:12; A20: Wn1 . (Wn1 .rfind m) = Wn1 . m by A7, Def22; A21: Wn1 .rfind m >= m by A7, Lm50; A22: Wn .rfind ((2 * n) + 1) <= len Wn by A11, Def22; 1 <= Wn .find ((2 * n) + 1) by ABIAN:12; then A23: (Wn .cut (1,(Wn .find ((2 * n) + 1)))) .last() = Wn . ((2 * n) + 1) by A14, A13, Lm16, JORDAN12:2 .= (Wn .cut ((Wn .rfind ((2 * n) + 1)),(len Wn))) .first() by A22, A18, Lm16 ; (2 * n) + 1 <= Wn .rfind ((2 * n) + 1) by A11, Lm50; then A24: Wn .find ((2 * n) + 1) <= Wn .rfind ((2 * n) + 1) by A12, XXREAL_0:2; then A25: Wn1 = (Wn .cut (1,(Wn .find ((2 * n) + 1)))) .append (Wn .cut ((Wn .rfind ((2 * n) + 1)),(len Wn))) by A13, A22, A18, Def12; A26: Wn1 .rfind m <= len Wn1 by A7, Def22; then A27: Wn1 .rfind m <= len Wn by A8, XXREAL_0:2; now__::_thesis:_Wn1_.rfind_m_=_m percases ( m < (2 * n) + 1 or m = (2 * n) + 1 ) by A10, XXREAL_0:1; supposeA28: m < (2 * n) + 1 ; ::_thesis: Wn1 .rfind m = m then m < len (Wn .cut (1,(Wn .find ((2 * n) + 1)))) by A11, A17, Lm22; then A29: Wn1 .cut (1,m) = (Wn .cut (1,(Wn .find ((2 * n) + 1)))) .cut (1,m) by A25, A19, A23, Lm21, JORDAN12:2 .= Wn .cut (1,m) by A10, A17, Lm20 ; reconsider maa1 = m - 1 as Element of NAT by ABIAN:12, INT_1:5; A30: maa1 + 1 = m ; A31: maa1 < m - 0 by XREAL_1:15; then A32: maa1 < len (Wn .cut (1,m)) by A7, A8, Lm22, XXREAL_0:2; maa1 < len (Wn1 .cut (1,m)) by A7, A31, Lm22; then Wn1 . m = (Wn .cut (1,m)) . m by A7, A19, A29, A30, Lm15, JORDAN12:2; then A33: Wn1 . m = Wn . m by A9, A19, A30, A32, Lm15, JORDAN12:2; A34: Wn .rfind m = m by A5, A9, A28; now__::_thesis:_Wn1_.rfind_m_=_m percases ( Wn1 .rfind m < Wn .find ((2 * n) + 1) or Wn .find ((2 * n) + 1) <= Wn1 .rfind m ) ; supposeA35: Wn1 .rfind m < Wn .find ((2 * n) + 1) ; ::_thesis: Wn1 .rfind m = m reconsider m9aa1 = (Wn1 .rfind m) - 1 as Element of NAT by ABIAN:12, INT_1:5; A36: 1 <= Wn1 .rfind m by ABIAN:12; A37: m9aa1 < (Wn1 .rfind m) - 0 by XREAL_1:15; then A38: m9aa1 < len (Wn1 .cut (1,(Wn1 .rfind m))) by A26, Lm22; A39: m9aa1 < len (Wn .cut (1,(Wn1 .rfind m))) by A8, A26, A37, Lm22, XXREAL_0:2; Wn1 .rfind m < len (Wn .cut (1,(Wn .find ((2 * n) + 1)))) by A14, A35, Lm22; then Wn1 .cut (1,(Wn1 .rfind m)) = (Wn .cut (1,(Wn .find ((2 * n) + 1)))) .cut (1,(Wn1 .rfind m)) by A25, A23, A36, Lm21, JORDAN12:2 .= Wn .cut (1,(Wn1 .rfind m)) by A35, Lm20 ; then Wn1 . (Wn1 .rfind m) = (Wn .cut (1,(Wn1 .rfind m))) . (m9aa1 + 1) by A26, A36, A38, Lm15, JORDAN12:2; then Wn . (Wn1 .rfind m) = Wn . m by A20, A27, A33, A36, A39, Lm15, JORDAN12:2; then Wn1 .rfind m <= m by A9, A27, A34, Def22; hence Wn1 .rfind m = m by A21, XXREAL_0:1; ::_thesis: verum end; supposeA40: Wn .find ((2 * n) + 1) <= Wn1 .rfind m ; ::_thesis: Wn1 .rfind m = m set x = ((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .rfind ((2 * n) + 1)); A41: Wn1 . (Wn1 .rfind m) = Wn . (((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .rfind ((2 * n) + 1))) by A13, A22, A18, A24, A26, A40, Lm30; A42: ((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .rfind ((2 * n) + 1)) <= len Wn by A13, A22, A18, A24, A26, A40, Lm30; (Wn1 .rfind m) + (Wn .find ((2 * n) + 1)) <= (Wn1 .rfind m) + (Wn .rfind ((2 * n) + 1)) by A24, XREAL_1:7; then A43: ((Wn1 .rfind m) + (Wn .find ((2 * n) + 1))) - (Wn .find ((2 * n) + 1)) <= ((Wn1 .rfind m) + (Wn .rfind ((2 * n) + 1))) - (Wn .find ((2 * n) + 1)) by XREAL_1:13; reconsider x = ((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .rfind ((2 * n) + 1)) as Element of NAT by A13, A22, A18, A24, A26, A40, Lm30; x <= m by A9, A20, A34, A33, A41, A42, Def22; then Wn1 .rfind m <= m by A43, XXREAL_0:2; hence Wn1 .rfind m = m by A21, XXREAL_0:1; ::_thesis: verum end; end; end; hence Wn1 .rfind m = m ; ::_thesis: verum end; supposeA44: m = (2 * n) + 1 ; ::_thesis: Wn1 .rfind m = m then m <= len (Wn .cut (1,(Wn .find ((2 * n) + 1)))) by A11, A17, Lm22; then A45: Wn1 .cut (1,m) = (Wn .cut (1,(Wn .find ((2 * n) + 1)))) .cut (1,m) by A25, A19, A23, Lm21, JORDAN12:2 .= Wn .cut (1,m) by A10, A17, Lm20 ; reconsider maa1 = m - 1 as Element of NAT by ABIAN:12, INT_1:5; A46: maa1 + 1 = m ; A47: maa1 < m - 0 by XREAL_1:15; then A48: maa1 < len (Wn .cut (1,m)) by A7, A8, Lm22, XXREAL_0:2; maa1 < len (Wn1 .cut (1,m)) by A7, A47, Lm22; then Wn1 . m = (Wn .cut (1,m)) . m by A7, A19, A45, A46, Lm15, JORDAN12:2; then A49: Wn1 . m = Wn . m by A9, A19, A46, A48, Lm15, JORDAN12:2; now__::_thesis:_not_m_<_Wn1_.rfind_m set x = ((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .rfind ((2 * n) + 1)); assume A50: m < Wn1 .rfind m ; ::_thesis: contradiction then A51: Wn .find ((2 * n) + 1) < Wn1 .rfind m by A12, A15, A44, XXREAL_0:1; then A52: ((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .rfind ((2 * n) + 1)) is Element of NAT by A13, A22, A18, A24, A26, Lm30; A53: ((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .rfind ((2 * n) + 1)) <= len Wn by A13, A22, A18, A24, A26, A51, Lm30; Wn1 . (Wn1 .rfind m) = Wn . (((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .rfind ((2 * n) + 1))) by A13, A22, A18, A24, A26, A51, Lm30; then ((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .rfind ((2 * n) + 1)) <= Wn .rfind ((2 * n) + 1) by A11, A20, A44, A49, A52, A53, Def22; then (((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .rfind ((2 * n) + 1))) - (Wn .rfind ((2 * n) + 1)) <= (Wn .rfind ((2 * n) + 1)) - (Wn .rfind ((2 * n) + 1)) by XREAL_1:13; then ((Wn1 .rfind m) - (Wn .find ((2 * n) + 1))) + (Wn .find ((2 * n) + 1)) <= 0 + (Wn .find ((2 * n) + 1)) by XREAL_1:7; hence contradiction by A12, A15, A44, A50, XXREAL_0:1; ::_thesis: verum end; hence Wn1 .rfind m = m by A21, XXREAL_0:1; ::_thesis: verum end; end; end; hence Wn1 .rfind m = m ; ::_thesis: verum end; supposeA54: len Wn < (2 * n) + 1 ; ::_thesis: Wn1 .rfind m = m then A55: m < (2 * n) + 1 by A9, XXREAL_0:2; A56: Wn .rfind ((2 * n) + 1) = len Wn by A54, Def22; Wn .find ((2 * n) + 1) = len Wn by A54, Def20; then Wn1 = Wn by A56, Lm27; hence Wn1 .rfind m = m by A5, A7, A55; ::_thesis: verum end; end; end; hence Wn1 .rfind m = m ; ::_thesis: verum end; then A57: for n being Element of NAT st S2[n] holds S2[n + 1] ; reconsider W0 = f . 0 as Subwalk of W by A2, Lm70; for m being odd Element of NAT st m < (2 * 0) + 1 & m <= len W0 holds W0 .rfind m = m by ABIAN:12; then A58: S2[ 0 ] by A2; for n being Element of NAT holds S2[n] from NAT_1:sch_1(A58, A57); then consider P being Subwalk of W such that P = f . ((len W) + 1) and A59: len P <= len W and A60: for m being odd Element of NAT st m < (2 * ((len W) + 1)) + 1 & m <= len P holds P .rfind m = m ; take P ; ::_thesis: ( P is Trail-like & P is Path-like ) now__::_thesis:_for_m_being_odd_Element_of_NAT_st_m_<=_len_P_holds_ P_.rfind_m_=_m let m be odd Element of NAT ; ::_thesis: ( m <= len P implies P .rfind m = m ) assume A61: m <= len P ; ::_thesis: P .rfind m = m (len P) + 0 < (len W) + 1 by A59, XREAL_1:8; then (len P) + 0 < ((len W) + 1) + ((len W) + 1) by XREAL_1:8; then (len P) + 0 < (2 * ((len W) + 1)) + 1 by XREAL_1:8; then m < (2 * ((len W) + 1)) + 1 by A61, XXREAL_0:2; hence P .rfind m = m by A60, A61; ::_thesis: verum end; then P is Path-like by Lm67; hence ( P is Trail-like & P is Path-like ) ; ::_thesis: verum end; end; definition let G be _Graph; let W be Walk of G; mode Trail of W is Trail-like Subwalk of W; mode Path of W is Path-like Subwalk of W; end; registration let G be _Graph; let W be DWalk of G; cluster Relation-like NAT -defined (the_Vertices_of G) \/ (the_Edges_of G) -valued Function-like finite FinSequence-like FinSubsequence-like directed Trail-like Path-like for Subwalk of W; existence ex b1 being Path of W st b1 is directed proof defpred S1[ Element of NAT ] means for W1 being DWalk of G st W1 .length() = G holds ex W2 being Path of W1 st W2 is directed ; A1: W .length() = W .length() ; now__::_thesis:_for_k_being_Element_of_NAT_st_S1[k]_holds_ for_W1_being_DWalk_of_G_st_W1_.length()_=_k_+_1_holds_ ex_W2_being_Path_of_W1_st_W2_is_directed let k be Element of NAT ; ::_thesis: ( S1[k] implies for W1 being DWalk of G st W1 .length() = k + 1 holds ex W2 being Path of W1 st W2 is directed ) assume A2: S1[k] ; ::_thesis: for W1 being DWalk of G st W1 .length() = k + 1 holds ex W2 being Path of W1 st W2 is directed let W1 be DWalk of G; ::_thesis: ( W1 .length() = k + 1 implies ex W2 being Path of W1 st W2 is directed ) set WA = W1 .cut (1,((2 * k) + 1)); set e = W1 . (((2 * k) + 1) + 1); set v = W1 . (((2 * k) + 1) + 2); assume A3: W1 .length() = k + 1 ; ::_thesis: ex W2 being Path of W1 st W2 is directed then A4: len W1 = (2 * (k + 1)) + 1 by Def15 .= ((2 * k) + 1) + 2 ; then A5: (((2 * k) + 1) + 2) - 2 < (len W1) - 0 by XREAL_1:15; then A6: W1 . (((2 * k) + 1) + 1) DJoins W1 . ((2 * k) + 1),W1 . (((2 * k) + 1) + 2),G by Lm51; len (W1 .cut (1,((2 * k) + 1))) = (2 * k) + 1 by A5, Lm22; then A7: (2 * k) + 1 = (2 * ((W1 .cut (1,((2 * k) + 1))) .length())) + 1 by Def15; then consider WB being Path of W1 .cut (1,((2 * k) + 1)) such that A8: WB is directed by A2; A9: (W1 .cut (1,((2 * k) + 1))) .edgeSeq() c= W1 .edgeSeq() by Lm43; A10: WB is_Walk_from (W1 .cut (1,((2 * k) + 1))) .first() ,(W1 .cut (1,((2 * k) + 1))) .last() by Def32; A11: 1 <= (2 * k) + 1 by NAT_1:12; then A12: (W1 .cut (1,((2 * k) + 1))) .last() = W1 . ((2 * k) + 1) by A5, Lm16, JORDAN12:2; A13: (W1 .cut (1,((2 * k) + 1))) .first() = W1 . 1 by A5, A11, Lm16, JORDAN12:2; then A14: WB .first() = W1 . 1 by A10, Def23; A15: WB .last() = W1 . ((2 * k) + 1) by A10, A12, Def23; then A16: W1 . (((2 * k) + 1) + 1) Joins WB .last() ,W1 . (((2 * k) + 1) + 2),G by A6, GLIB_000:16; now__::_thesis:_ex_W2_being_Path_of_W1_st_W2_is_directed percases ( WB is closed or WB is open ) ; supposeA17: WB is closed ; ::_thesis: ex W2 being Path of W1 st W2 is directed set W2 = W1 .remove (1,((2 * k) + 1)); W1 .first() = W1 . ((2 * k) + 1) by A14, A15, A17, Def24; then W1 .remove (1,((2 * k) + 1)) = W1 .cut (((2 * k) + 1),(((2 * k) + 1) + 2)) by A4, Lm32; then (len (W1 .remove (1,((2 * k) + 1)))) + ((2 * k) + 1) = (((2 * k) + 1) + 2) + 1 by A4, A5, Lm15 .= ((2 * k) + 1) + (2 + 1) ; then reconsider W2 = W1 .remove (1,((2 * k) + 1)) as Path of W1 by Lm69; take W2 = W2; ::_thesis: W2 is directed thus W2 is directed ; ::_thesis: verum end; supposeA18: WB is open ; ::_thesis: ex W2 being Path of W1 st W2 is directed consider esb being Subset of ((W1 .cut (1,((2 * k) + 1))) .edgeSeq()) such that A19: WB .edgeSeq() = Seq esb by Def32; A20: Seq esb is one-to-one by A19, Def27; A21: Seq esb = esb * (Sgm (dom esb)) by FINSEQ_1:def_14; A22: now__::_thesis:_for_x_being_set_st_x_in_dom_esb_holds_ x_in_Seg_k let x be set ; ::_thesis: ( x in dom esb implies x in Seg k ) assume x in dom esb ; ::_thesis: x in Seg k then [x,(esb . x)] in esb by FUNCT_1:1; then x in dom ((W1 .cut (1,((2 * k) + 1))) .edgeSeq()) by FUNCT_1:1; hence x in Seg k by A7, FINSEQ_1:def_3; ::_thesis: verum end; then A23: dom esb c= Seg k by TARSKI:def_3; then rng (Sgm (dom esb)) = dom esb by FINSEQ_1:def_13; then A24: Sgm (dom esb) is one-to-one by A21, A20, FUNCT_1:26; now__::_thesis:_ex_W2_being_Path_of_W1_st_W2_is_directed percases ( W1 . (((2 * k) + 1) + 2) in WB .vertices() or not W1 . (((2 * k) + 1) + 2) in WB .vertices() ) ; supposeA25: W1 . (((2 * k) + 1) + 2) in WB .vertices() ; ::_thesis: ex W2 being Path of W1 st W2 is directed reconsider WB9 = WB as directed Path of G by A8; A26: dom (Sgm (dom esb)) = dom (WB .edgeSeq()) by A19, Th6 .= Seg (len (WB .edgeSeq())) by FINSEQ_1:def_3 ; consider n being odd Element of NAT such that A27: n <= len WB and A28: WB . n = W1 . (((2 * k) + 1) + 2) by A25, Lm45; set W2 = WB9 .cut (1,n); len (WB9 .cut (1,n)) = n by A27, Lm22; then consider naa1 being even Element of NAT such that A29: naa1 = n - 1 and A30: len ((WB9 .cut (1,n)) .edgeSeq()) = naa1 div 2 by Lm42; (2 * 0) + 1 <= n by ABIAN:12; then A31: WB9 .cut (1,n) is_Walk_from W1 .first() ,W1 .last() by A4, A14, A27, A28, Lm16; 2 divides naa1 by PEPIN:22; then A32: 2 * (naa1 div 2) = naa1 by NAT_D:3; now__::_thesis:_not_naa1_div_2_>_len_(WB_.edgeSeq()) assume naa1 div 2 > len (WB .edgeSeq()) ; ::_thesis: contradiction then naa1 > 2 * (len (WB .edgeSeq())) by A32, XREAL_1:68; then naa1 + 1 > (2 * (len (WB .edgeSeq()))) + 1 by XREAL_1:8; hence contradiction by A27, A29, Def15; ::_thesis: verum end; then Seg (naa1 div 2) c= dom (Sgm (dom esb)) by A26, FINSEQ_1:5; then A33: dom ((Sgm (dom esb)) | (Seg (naa1 div 2))) = Seg (naa1 div 2) by RELAT_1:62; then reconsider ses = (Sgm (dom esb)) | (Seg (naa1 div 2)) as FinSequence by FINSEQ_1:def_2; A34: ses is one-to-one by A24, FUNCT_1:52; set es = esb | (rng ((Sgm (dom esb)) | (Seg (naa1 div 2)))); reconsider es = esb | (rng ((Sgm (dom esb)) | (Seg (naa1 div 2)))) as Subset of ((W1 .cut (1,((2 * k) + 1))) .edgeSeq()) by GRAPH_2:27; for x being set st x in es holds x in W1 .edgeSeq() by A9, TARSKI:def_3; then reconsider es = es as Subset of (W1 .edgeSeq()) by TARSKI:def_3; reconsider esbes1 = esb \ es as Function ; now__::_thesis:_for_z_being_set_st_z_in_rng_((Sgm_(dom_esb))_|_(Seg_(naa1_div_2)))_holds_ z_in_dom_esb let z be set ; ::_thesis: ( z in rng ((Sgm (dom esb)) | (Seg (naa1 div 2))) implies z in dom esb ) A35: rng ((Sgm (dom esb)) | (Seg (naa1 div 2))) c= rng (Sgm (dom esb)) by RELAT_1:70; assume z in rng ((Sgm (dom esb)) | (Seg (naa1 div 2))) ; ::_thesis: z in dom esb then z in rng (Sgm (dom esb)) by A35; hence z in dom esb by A23, FINSEQ_1:def_13; ::_thesis: verum end; then rng ((Sgm (dom esb)) | (Seg (naa1 div 2))) c= dom esb by TARSKI:def_3; then A36: dom es = rng ((Sgm (dom esb)) | (Seg (naa1 div 2))) by RELAT_1:62; A37: now__::_thesis:_for_a,_b_being_Element_of_NAT_st_a_in_dom_es_&_b_in_dom_esbes1_holds_ a_<_b let a, b be Element of NAT ; ::_thesis: ( a in dom es & b in dom esbes1 implies a < b ) assume that A38: a in dom es and A39: b in dom esbes1 ; ::_thesis: a < b consider xa being set such that A40: xa in dom ses and A41: ses . xa = a by A36, A38, FUNCT_1:def_3; reconsider xa = xa as Element of NAT by A40; A42: xa in Seg (naa1 div 2) by A40, RELAT_1:57; then A43: 1 <= xa by FINSEQ_1:1; A44: [b,(esbes1 . b)] in esb \ es by A39, FUNCT_1:1; then A45: [b,(esbes1 . b)] in esb by XBOOLE_0:def_5; then b in dom esb by FUNCT_1:1; then b in rng (Sgm (dom esb)) by A23, FINSEQ_1:def_13; then consider xb being set such that A46: xb in dom (Sgm (dom esb)) and A47: (Sgm (dom esb)) . xb = b by FUNCT_1:def_3; reconsider xb = xb as Element of NAT by A46; A48: 1 <= xb by A26, A46, FINSEQ_1:1; A49: xa <= naa1 div 2 by A42, FINSEQ_1:1; A50: now__::_thesis:_not_xb_<=_xa assume xb <= xa ; ::_thesis: contradiction then xb <= naa1 div 2 by A49, XXREAL_0:2; then A51: xb in Seg (naa1 div 2) by A48, FINSEQ_1:1; [xb,b] in Sgm (dom esb) by A46, A47, FUNCT_1:1; then [xb,b] in ses by A51, RELAT_1:def_11; then b in rng ses by XTUPLE_0:def_13; then [b,(esbes1 . b)] in es by A45, RELAT_1:def_11; hence contradiction by A44, XBOOLE_0:def_5; ::_thesis: verum end; xb <= len (WB .edgeSeq()) by A26, A46, FINSEQ_1:1; then xb in dom (Seq esb) by A19, A48, FINSEQ_3:25; then xb in dom (Sgm (dom esb)) by Th6; then A52: xb <= len (Sgm (dom esb)) by FINSEQ_3:25; a = (Sgm (dom esb)) . xa by A40, A41, FUNCT_1:47; hence a < b by A23, A47, A43, A52, A50, FINSEQ_1:def_13; ::_thesis: verum end; len ses = naa1 div 2 by A33, FINSEQ_1:def_3; then card (dom es) = naa1 div 2 by A36, A34, FINSEQ_4:62; then card es = naa1 div 2 by CARD_1:62; then A53: len (Seq es) = len ((WB9 .cut (1,n)) .edgeSeq()) by A30, Th5; A54: es c= esb by RELAT_1:59; now__::_thesis:_for_z_being_set_holds_ (_(_z_in_esb_implies_z_in_es_\/_(esb_\_es)_)_&_(_z_in_es_\/_(esb_\_es)_implies_z_in_esb_)_) let z be set ; ::_thesis: ( ( z in esb implies z in es \/ (esb \ es) ) & ( z in es \/ (esb \ es) implies z in esb ) ) hereby ::_thesis: ( z in es \/ (esb \ es) implies z in esb ) assume A55: z in esb ; ::_thesis: z in es \/ (esb \ es) now__::_thesis:_z_in_es_\/_(esb_\_es) percases ( z in es or not z in es ) ; suppose z in es ; ::_thesis: z in es \/ (esb \ es) hence z in es \/ (esb \ es) by XBOOLE_0:def_3; ::_thesis: verum end; suppose not z in es ; ::_thesis: z in es \/ (esb \ es) then z in esb \ es by A55, XBOOLE_0:def_5; hence z in es \/ (esb \ es) by XBOOLE_0:def_3; ::_thesis: verum end; end; end; hence z in es \/ (esb \ es) ; ::_thesis: verum end; assume A56: z in es \/ (esb \ es) ; ::_thesis: z in esb now__::_thesis:_z_in_esb percases ( z in es or z in esb \ es ) by A56, XBOOLE_0:def_3; suppose z in es ; ::_thesis: z in esb hence z in esb by A54; ::_thesis: verum end; suppose z in esb \ es ; ::_thesis: z in esb hence z in esb by XBOOLE_0:def_5; ::_thesis: verum end; end; end; hence z in esb ; ::_thesis: verum end; then esb = es \/ (esb \ es) by TARSKI:1; then A57: dom esb = (dom es) \/ (dom (esb \ es)) by RELAT_1:1; esb \ es c= esb by XBOOLE_1:36; then dom (esb \ es) c= dom esb by RELAT_1:11; then A58: dom (esb \ es) c= Seg k by A23, XBOOLE_1:1; dom es c= dom esb by A54, RELAT_1:11; then dom es c= Seg k by A23, XBOOLE_1:1; then A59: Sgm (dom esb) = (Sgm (dom es)) ^ (Sgm (dom (esb \ es))) by A57, A58, A37, FINSEQ_3:42; A60: (WB9 .cut (1,n)) .edgeSeq() c= WB .edgeSeq() by Lm43; then A61: dom ((WB9 .cut (1,n)) .edgeSeq()) c= dom (Seq esb) by A19, RELAT_1:11; A62: Seq es = es * (Sgm (dom es)) by FINSEQ_1:def_14; now__::_thesis:_for_x_being_Nat_st_1_<=_x_&_x_<=_len_((WB9_.cut_(1,n))_.edgeSeq())_holds_ ((WB9_.cut_(1,n))_.edgeSeq())_._x_=_(Seq_es)_._x let x be Nat; ::_thesis: ( 1 <= x & x <= len ((WB9 .cut (1,n)) .edgeSeq()) implies ((WB9 .cut (1,n)) .edgeSeq()) . x = (Seq es) . x ) assume that A63: 1 <= x and A64: x <= len ((WB9 .cut (1,n)) .edgeSeq()) ; ::_thesis: ((WB9 .cut (1,n)) .edgeSeq()) . x = (Seq es) . x A65: x in dom ((WB9 .cut (1,n)) .edgeSeq()) by A63, A64, FINSEQ_3:25; then x in dom (Sgm (dom esb)) by A21, A61, FUNCT_1:11; then A66: [x,((Sgm (dom esb)) . x)] in Sgm (dom esb) by FUNCT_1:1; x in Seg (naa1 div 2) by A30, A63, A64, FINSEQ_1:1; then [x,((Sgm (dom esb)) . x)] in ses by A66, RELAT_1:def_11; then A67: (Sgm (dom esb)) . x in rng ses by XTUPLE_0:def_13; (Sgm (dom esb)) . x in dom esb by A21, A61, A65, FUNCT_1:11; then [((Sgm (dom esb)) . x),(esb . ((Sgm (dom esb)) . x))] in esb by FUNCT_1:1; then A68: [((Sgm (dom esb)) . x),(esb . ((Sgm (dom esb)) . x))] in es by A67, RELAT_1:def_11; [x,(((WB9 .cut (1,n)) .edgeSeq()) . x)] in (WB9 .cut (1,n)) .edgeSeq() by A65, FUNCT_1:1; then A69: ((WB9 .cut (1,n)) .edgeSeq()) . x = (Seq esb) . x by A19, A60, FUNCT_1:1 .= esb . ((Sgm (dom esb)) . x) by A21, A61, A65, FUNCT_1:12 ; A70: x in dom (Seq es) by A53, A63, A64, FINSEQ_3:25; then x in dom (Sgm (dom es)) by Th6; then (Sgm (dom esb)) . x = (Sgm (dom es)) . x by A59, FINSEQ_1:def_7; then es . ((Sgm (dom es)) . x) = esb . ((Sgm (dom esb)) . x) by A68, FUNCT_1:1; hence ((WB9 .cut (1,n)) .edgeSeq()) . x = (Seq es) . x by A62, A69, A70, FUNCT_1:12; ::_thesis: verum end; then (WB9 .cut (1,n)) .edgeSeq() = Seq es by A53, FINSEQ_1:14; then reconsider W2 = WB9 .cut (1,n) as Path of W1 by A31, Def32; take W2 = W2; ::_thesis: W2 is directed thus W2 is directed ; ::_thesis: verum end; supposeA71: not W1 . (((2 * k) + 1) + 2) in WB .vertices() ; ::_thesis: ex W2 being Path of W1 st W2 is directed set es = esb +* ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))); set W2 = WB .addEdge (W1 . (((2 * k) + 1) + 1)); A72: now__::_thesis:_for_m,_n_being_Element_of_NAT_st_m_in_dom_esb_&_n_in_{(k_+_1)}_holds_ m_<_n let m, n be Element of NAT ; ::_thesis: ( m in dom esb & n in {(k + 1)} implies m < n ) assume that A73: m in dom esb and A74: n in {(k + 1)} ; ::_thesis: m < n A75: n = k + 1 by A74, TARSKI:def_1; m <= k by A23, A73, FINSEQ_1:1; hence m < n by A75, NAT_1:13; ::_thesis: verum end; A76: dom ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))) = {(k + 1)} by FUNCOP_1:13; then A77: dom (esb +* ((k + 1) .--> (W1 . (((2 * k) + 1) + 1)))) = (dom esb) \/ {(k + 1)} by FUNCT_4:def_1; now__::_thesis:_for_x_being_set_st_x_in_dom_(esb_+*_((k_+_1)_.-->_(W1_._(((2_*_k)_+_1)_+_1))))_holds_ x_in_Seg_(k_+_1) let x be set ; ::_thesis: ( x in dom (esb +* ((k + 1) .--> (W1 . (((2 * k) + 1) + 1)))) implies x in Seg (k + 1) ) assume A78: x in dom (esb +* ((k + 1) .--> (W1 . (((2 * k) + 1) + 1)))) ; ::_thesis: x in Seg (k + 1) now__::_thesis:_x_in_Seg_(k_+_1) percases ( x in dom esb or x in {(k + 1)} ) by A77, A78, XBOOLE_0:def_3; suppose x in dom esb ; ::_thesis: x in Seg (k + 1) then A79: x in Seg k by A22; then reconsider x9 = x as Element of NAT ; x9 <= k by A79, FINSEQ_1:1; then A80: x9 <= k + 1 by NAT_1:12; 1 <= x9 by A79, FINSEQ_1:1; hence x in Seg (k + 1) by A80, FINSEQ_1:1; ::_thesis: verum end; supposeA81: x in {(k + 1)} ; ::_thesis: x in Seg (k + 1) A82: 1 <= k + 1 by NAT_1:12; x = k + 1 by A81, TARSKI:def_1; hence x in Seg (k + 1) by A82, FINSEQ_1:1; ::_thesis: verum end; end; end; hence x in Seg (k + 1) ; ::_thesis: verum end; then A83: dom (esb +* ((k + 1) .--> (W1 . (((2 * k) + 1) + 1)))) c= Seg (k + 1) by TARSKI:def_3; then reconsider es = esb +* ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))) as FinSubsequence by FINSEQ_1:def_12; now__::_thesis:_for_z_being_set_st_z_in_es_holds_ z_in_W1_.edgeSeq() let z be set ; ::_thesis: ( z in es implies z in W1 .edgeSeq() ) assume A84: z in es ; ::_thesis: z in W1 .edgeSeq() then consider x, y being set such that A85: z = [x,y] by RELAT_1:def_1; A86: x in dom es by A84, A85, FUNCT_1:1; A87: es . x = y by A84, A85, FUNCT_1:1; now__::_thesis:_z_in_W1_.edgeSeq() percases ( x in dom ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))) or not x in dom ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))) ) ; supposeA88: x in dom ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))) ; ::_thesis: z in W1 .edgeSeq() then reconsider x9 = x as Element of NAT by A76; A89: x = k + 1 by A88, TARSKI:def_1; then A90: 1 <= x9 by NAT_1:12; then A91: x in dom (W1 .edgeSeq()) by A3, A89, FINSEQ_3:25; y = ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))) . x by A76, A77, A86, A87, A88, FUNCT_4:def_1; then A92: y = W1 . (((2 * k) + 1) + 1) by A89, FUNCOP_1:72; (W1 .edgeSeq()) . x = W1 . (2 * (k + 1)) by A3, A89, A90, Def15 .= W1 . (((2 * k) + 1) + 1) ; hence z in W1 .edgeSeq() by A85, A92, A91, FUNCT_1:1; ::_thesis: verum end; supposeA93: not x in dom ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))) ; ::_thesis: z in W1 .edgeSeq() then A94: x in dom esb by A76, A77, A86, XBOOLE_0:def_3; y = esb . x by A76, A77, A86, A87, A93, FUNCT_4:def_1; then [x,y] in esb by A94, FUNCT_1:1; then [x,y] in (W1 .cut (1,((2 * k) + 1))) .edgeSeq() ; hence z in W1 .edgeSeq() by A9, A85; ::_thesis: verum end; end; end; hence z in W1 .edgeSeq() ; ::_thesis: verum end; then reconsider es = es as Subset of (W1 .edgeSeq()) by TARSKI:def_3; {(k + 1)} c= Seg (k + 1) by A77, A83, XBOOLE_1:11; then A95: Sgm (dom es) = (Sgm (dom esb)) ^ (Sgm {(k + 1)}) by A23, A77, A72, FINSEQ_3:42 .= (Sgm (dom esb)) ^ <*(k + 1)*> by FINSEQ_3:44 ; now__::_thesis:_not_(dom_esb)_/\_(dom_((k_+_1)_.-->_(W1_._(((2_*_k)_+_1)_+_1))))_<>_{} assume (dom esb) /\ (dom ((k + 1) .--> (W1 . (((2 * k) + 1) + 1)))) <> {} ; ::_thesis: contradiction then consider x being set such that A96: x in (dom esb) /\ (dom ((k + 1) .--> (W1 . (((2 * k) + 1) + 1)))) by XBOOLE_0:def_1; x in {(k + 1)} by A96; then A97: x = k + 1 by TARSKI:def_1; x in dom esb by A96, XBOOLE_0:def_4; then k + 1 <= k + 0 by A23, A97, FINSEQ_1:1; hence contradiction by XREAL_1:6; ::_thesis: verum end; then A98: dom esb misses dom ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))) by XBOOLE_0:def_7; A99: (WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq() = (Seq esb) ^ <*(W1 . (((2 * k) + 1) + 1))*> by A16, A19, Lm44; then A100: len ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) = (len (Seq esb)) + (len <*(W1 . (((2 * k) + 1) + 1))*>) by FINSEQ_1:22 .= (len (Seq esb)) + 1 by FINSEQ_1:39 .= (card esb) + 1 by Th5 ; A101: len (Seq es) = card es by Th5 .= (card esb) + (card ((k + 1) .--> (W1 . (((2 * k) + 1) + 1)))) by A98, PRE_CIRC:22 .= (card esb) + (card {[(k + 1),(W1 . (((2 * k) + 1) + 1))]}) by FUNCT_4:82 .= len ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) by A100, CARD_1:30 ; now__::_thesis:_for_n_being_Nat_st_1_<=_n_&_n_<=_len_((WB_.addEdge_(W1_._(((2_*_k)_+_1)_+_1)))_.edgeSeq())_holds_ ((WB_.addEdge_(W1_._(((2_*_k)_+_1)_+_1)))_.edgeSeq())_._n_=_(Seq_es)_._n A102: Seq es = es * (Sgm (dom es)) by FINSEQ_1:def_14; let n be Nat; ::_thesis: ( 1 <= n & n <= len ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) implies ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) . n = (Seq es) . n ) assume that A103: 1 <= n and A104: n <= len ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) ; ::_thesis: ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) . n = (Seq es) . n n in dom (Seq es) by A101, A103, A104, FINSEQ_3:25; then A105: (Seq es) . n = es . ((Sgm (dom es)) . n) by A102, FUNCT_1:12; A106: Seq esb = esb * (Sgm (dom esb)) by FINSEQ_1:def_14; A107: n in dom ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) by A103, A104, FINSEQ_3:25; now__::_thesis:_((WB_.addEdge_(W1_._(((2_*_k)_+_1)_+_1)))_.edgeSeq())_._n_=_(Seq_es)_._n percases ( n in dom (Seq esb) or ex m being Nat st ( m in dom <*(W1 . (((2 * k) + 1) + 1))*> & n = (len (Seq esb)) + m ) ) by A99, A107, FINSEQ_1:25; supposeA108: n in dom (Seq esb) ; ::_thesis: ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) . n = (Seq es) . n then n in dom (Sgm (dom esb)) by A106, FUNCT_1:11; then A109: (Sgm (dom es)) . n = (Sgm (dom esb)) . n by A95, FINSEQ_1:def_7; A110: (Sgm (dom esb)) . n in dom esb by A106, A108, FUNCT_1:11; ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) . n = (Seq esb) . n by A99, A108, FINSEQ_1:def_7 .= esb . ((Sgm (dom esb)) . n) by A106, A108, FUNCT_1:12 ; hence ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) . n = (Seq es) . n by A98, A105, A110, A109, FUNCT_4:16; ::_thesis: verum end; suppose ex m being Nat st ( m in dom <*(W1 . (((2 * k) + 1) + 1))*> & n = (len (Seq esb)) + m ) ; ::_thesis: ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) . n = (Seq es) . n then consider m being Nat such that A111: m in dom <*(W1 . (((2 * k) + 1) + 1))*> and A112: n = (len (Seq esb)) + m ; m in {1} by A111, FINSEQ_1:2, FINSEQ_1:def_8; then A113: m = 1 by TARSKI:def_1; A114: k + 1 in dom ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))) by A76, TARSKI:def_1; then A115: k + 1 in (dom esb) \/ (dom ((k + 1) .--> (W1 . (((2 * k) + 1) + 1)))) by XBOOLE_0:def_3; len (Sgm (dom esb)) = card (dom esb) by A23, FINSEQ_3:39 .= card esb by CARD_1:62 .= len (Seq esb) by Th5 ; then (Seq es) . n = es . (k + 1) by A95, A105, A112, A113, FINSEQ_1:42; then A116: (Seq es) . n = ((k + 1) .--> (W1 . (((2 * k) + 1) + 1))) . (k + 1) by A114, A115, FUNCT_4:def_1 .= W1 . (((2 * k) + 1) + 1) by FUNCOP_1:72 ; ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) . n = <*(W1 . (((2 * k) + 1) + 1))*> . 1 by A99, A111, A112, A113, FINSEQ_1:def_7 .= W1 . (((2 * k) + 1) + 1) by FINSEQ_1:def_8 ; hence ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) . n = (Seq es) . n by A116; ::_thesis: verum end; end; end; hence ((WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq()) . n = (Seq es) . n ; ::_thesis: verum end; then A117: (WB .addEdge (W1 . (((2 * k) + 1) + 1))) .edgeSeq() = Seq es by A101, FINSEQ_1:14; WB .addEdge (W1 . (((2 * k) + 1) + 1)) is_Walk_from W1 .first() ,W1 .last() by A4, A8, A6, A10, A13, A12, Lm52; then reconsider W2 = WB .addEdge (W1 . (((2 * k) + 1) + 1)) as Path of W1 by A16, A18, A71, A117, Def32, Lm68; take W2 = W2; ::_thesis: W2 is directed thus W2 is directed by A8, A6, A10, A12, Lm52; ::_thesis: verum end; end; end; hence ex W2 being Path of W1 st W2 is directed ; ::_thesis: verum end; end; end; hence ex W2 being Path of W1 st W2 is directed ; ::_thesis: verum end; then A118: for k being Element of NAT st S1[k] holds S1[k + 1] ; now__::_thesis:_for_W1_being_DWalk_of_G_st_W1_.length()_=_0_holds_ ex_W2_being_Path_of_W1_st_W2_is_directed let W1 be DWalk of G; ::_thesis: ( W1 .length() = 0 implies ex W2 being Path of W1 st W2 is directed ) set W2 = the Path of W1; assume W1 .length() = 0 ; ::_thesis: ex W2 being Path of W1 st W2 is directed then len W1 = (2 * 0) + 1 by Def15; then A119: len the Path of W1 <= 1 by Lm72; take W2 = the Path of W1; ::_thesis: W2 is directed 1 <= len W2 by ABIAN:12; then len W2 = 1 by A119, XXREAL_0:1; then W2 is trivial by Lm55; then ex v being Vertex of G st W2 = G .walkOf v by Lm56; hence W2 is directed ; ::_thesis: verum end; then A120: S1[ 0 ] ; for k being Element of NAT holds S1[k] from NAT_1:sch_1(A120, A118); hence ex b1 being Path of W st b1 is directed by A1; ::_thesis: verum end; end; definition let G be _Graph; let W be DWalk of G; mode DWalk of W is directed Subwalk of W; mode DTrail of W is directed Trail of W; mode DPath of W is directed Path of W; end; definition let G be _Graph; funcG .allWalks() -> non empty Subset of (((the_Vertices_of G) \/ (the_Edges_of G)) *) equals :: GLIB_001:def 33 { W where W is Walk of G : verum } ; coherence { W where W is Walk of G : verum } is non empty Subset of (((the_Vertices_of G) \/ (the_Edges_of G)) *) proof set IT = { W where W is Walk of G : verum } ; A1: now__::_thesis:_for_x_being_set_st_x_in__{__W_where_W_is_Walk_of_G_:_verum__}__holds_ x_in_((the_Vertices_of_G)_\/_(the_Edges_of_G))_* let x be set ; ::_thesis: ( x in { W where W is Walk of G : verum } implies x in ((the_Vertices_of G) \/ (the_Edges_of G)) * ) assume x in { W where W is Walk of G : verum } ; ::_thesis: x in ((the_Vertices_of G) \/ (the_Edges_of G)) * then ex W being Walk of G st x = W ; hence x in ((the_Vertices_of G) \/ (the_Edges_of G)) * by FINSEQ_1:def_11; ::_thesis: verum end; G .walkOf (choose (the_Vertices_of G)) in { W where W is Walk of G : verum } ; hence { W where W is Walk of G : verum } is non empty Subset of (((the_Vertices_of G) \/ (the_Edges_of G)) *) by A1, TARSKI:def_3; ::_thesis: verum end; end; :: deftheorem defines .allWalks() GLIB_001:def_33_:_ for G being _Graph holds G .allWalks() = { W where W is Walk of G : verum } ; definition let G be _Graph; funcG .allTrails() -> non empty Subset of (G .allWalks()) equals :: GLIB_001:def 34 { W where W is Trail of G : verum } ; coherence { W where W is Trail of G : verum } is non empty Subset of (G .allWalks()) proof set IT = { W where W is Trail of G : verum } ; A1: now__::_thesis:_for_e_being_set_st_e_in__{__W_where_W_is_Trail_of_G_:_verum__}__holds_ e_in_G_.allWalks() let e be set ; ::_thesis: ( e in { W where W is Trail of G : verum } implies e in G .allWalks() ) assume e in { W where W is Trail of G : verum } ; ::_thesis: e in G .allWalks() then ex W being Trail of G st W = e ; hence e in G .allWalks() ; ::_thesis: verum end; G .walkOf (choose (the_Vertices_of G)) in { W where W is Trail of G : verum } ; hence { W where W is Trail of G : verum } is non empty Subset of (G .allWalks()) by A1, TARSKI:def_3; ::_thesis: verum end; end; :: deftheorem defines .allTrails() GLIB_001:def_34_:_ for G being _Graph holds G .allTrails() = { W where W is Trail of G : verum } ; definition let G be _Graph; funcG .allPaths() -> non empty Subset of (G .allTrails()) equals :: GLIB_001:def 35 { W where W is Path of G : verum } ; coherence { W where W is Path of G : verum } is non empty Subset of (G .allTrails()) proof set IT = { W where W is Path of G : verum } ; A1: now__::_thesis:_for_e_being_set_st_e_in__{__W_where_W_is_Path_of_G_:_verum__}__holds_ e_in_G_.allTrails() let e be set ; ::_thesis: ( e in { W where W is Path of G : verum } implies e in G .allTrails() ) assume e in { W where W is Path of G : verum } ; ::_thesis: e in G .allTrails() then ex W being Path of G st e = W ; hence e in G .allTrails() ; ::_thesis: verum end; G .walkOf (choose (the_Vertices_of G)) in { W where W is Path of G : verum } ; hence { W where W is Path of G : verum } is non empty Subset of (G .allTrails()) by A1, TARSKI:def_3; ::_thesis: verum end; end; :: deftheorem defines .allPaths() GLIB_001:def_35_:_ for G being _Graph holds G .allPaths() = { W where W is Path of G : verum } ; definition let G be _Graph; funcG .allDWalks() -> non empty Subset of (G .allWalks()) equals :: GLIB_001:def 36 { W where W is DWalk of G : verum } ; coherence { W where W is DWalk of G : verum } is non empty Subset of (G .allWalks()) proof set IT = { W where W is directed Walk of G : verum } ; A1: now__::_thesis:_for_e_being_set_st_e_in__{__W_where_W_is_directed_Walk_of_G_:_verum__}__holds_ e_in_G_.allWalks() let e be set ; ::_thesis: ( e in { W where W is directed Walk of G : verum } implies e in G .allWalks() ) assume e in { W where W is directed Walk of G : verum } ; ::_thesis: e in G .allWalks() then ex W being directed Walk of G st e = W ; hence e in G .allWalks() ; ::_thesis: verum end; G .walkOf (choose (the_Vertices_of G)) in { W where W is directed Walk of G : verum } ; hence { W where W is DWalk of G : verum } is non empty Subset of (G .allWalks()) by A1, TARSKI:def_3; ::_thesis: verum end; end; :: deftheorem defines .allDWalks() GLIB_001:def_36_:_ for G being _Graph holds G .allDWalks() = { W where W is DWalk of G : verum } ; definition let G be _Graph; funcG .allDTrails() -> non empty Subset of (G .allTrails()) equals :: GLIB_001:def 37 { W where W is DTrail of G : verum } ; coherence { W where W is DTrail of G : verum } is non empty Subset of (G .allTrails()) proof set IT = { W where W is DTrail of G : verum } ; A1: now__::_thesis:_for_e_being_set_st_e_in__{__W_where_W_is_DTrail_of_G_:_verum__}__holds_ e_in_G_.allTrails() let e be set ; ::_thesis: ( e in { W where W is DTrail of G : verum } implies e in G .allTrails() ) assume e in { W where W is DTrail of G : verum } ; ::_thesis: e in G .allTrails() then ex W being DTrail of G st e = W ; hence e in G .allTrails() ; ::_thesis: verum end; G .walkOf (choose (the_Vertices_of G)) in { W where W is DTrail of G : verum } ; hence { W where W is DTrail of G : verum } is non empty Subset of (G .allTrails()) by A1, TARSKI:def_3; ::_thesis: verum end; end; :: deftheorem defines .allDTrails() GLIB_001:def_37_:_ for G being _Graph holds G .allDTrails() = { W where W is DTrail of G : verum } ; definition let G be _Graph; funcG .allDPaths() -> non empty Subset of (G .allDTrails()) equals :: GLIB_001:def 38 { W where W is directed Path of G : verum } ; coherence { W where W is directed Path of G : verum } is non empty Subset of (G .allDTrails()) proof set IT = { W where W is DPath of G : verum } ; A1: now__::_thesis:_for_e_being_set_st_e_in__{__W_where_W_is_DPath_of_G_:_verum__}__holds_ e_in_G_.allDTrails() let e be set ; ::_thesis: ( e in { W where W is DPath of G : verum } implies e in G .allDTrails() ) assume e in { W where W is DPath of G : verum } ; ::_thesis: e in G .allDTrails() then ex W being DPath of G st e = W ; hence e in G .allDTrails() ; ::_thesis: verum end; G .walkOf (choose (the_Vertices_of G)) in { W where W is DPath of G : verum } ; hence { W where W is directed Path of G : verum } is non empty Subset of (G .allDTrails()) by A1, TARSKI:def_3; ::_thesis: verum end; end; :: deftheorem defines .allDPaths() GLIB_001:def_38_:_ for G being _Graph holds G .allDPaths() = { W where W is directed Path of G : verum } ; registration let G be finite _Graph; clusterG .allTrails() -> non empty finite ; correctness coherence G .allTrails() is finite ; proof set D = (the_Vertices_of G) \/ (the_Edges_of G); set X = { x where x is Element of ((the_Vertices_of G) \/ (the_Edges_of G)) * : len x <= (2 * (G .size())) + 1 } ; A1: now__::_thesis:_for_W_being_Trail_of_G_holds_len_W_<=_(2_*_(G_.size()))_+_1 let W be Trail of G; ::_thesis: len W <= (2 * (G .size())) + 1 consider f being Function such that A2: ( dom f = W .edgeSeq() & ( for x being set st x in W .edgeSeq() holds f . x = x `2 ) ) from FUNCT_1:sch_3(); now__::_thesis:_for_x1,_x2_being_set_st_x1_in_dom_f_&_x2_in_dom_f_&_f_._x1_=_f_._x2_holds_ x1_=_x2 A3: W .edgeSeq() is one-to-one by Def27; let x1, x2 be set ; ::_thesis: ( x1 in dom f & x2 in dom f & f . x1 = f . x2 implies x1 = x2 ) assume that A4: x1 in dom f and A5: x2 in dom f and A6: f . x1 = f . x2 ; ::_thesis: x1 = x2 consider a1, b1 being set such that A7: x1 = [a1,b1] by A2, A4, RELAT_1:def_1; A8: a1 in dom (W .edgeSeq()) by A2, A4, A7, FUNCT_1:1; A9: f . x2 = x2 `2 by A2, A5; A10: (W .edgeSeq()) . a1 = b1 by A2, A4, A7, FUNCT_1:1; consider a2, b2 being set such that A11: x2 = [a2,b2] by A2, A5, RELAT_1:def_1; A12: a2 in dom (W .edgeSeq()) by A2, A5, A11, FUNCT_1:1; X1: [a1,b1] `2 = b1 ; X2: [a2,b2] `2 = b2 ; f . x1 = x1 `2 by A2, A4; then A13: b1 = f . x1 by A7, X1 .= b2 by A6, A9, A11, X2 ; then (W .edgeSeq()) . a2 = b1 by A2, A5, A11, FUNCT_1:1; hence x1 = x2 by A7, A11, A13, A3, A8, A10, A12, FUNCT_1:def_4; ::_thesis: verum end; then A14: f is one-to-one by FUNCT_1:def_4; now__::_thesis:_for_y_being_set_st_y_in_rng_f_holds_ y_in_the_Edges_of_G let y be set ; ::_thesis: ( y in rng f implies y in the_Edges_of G ) assume y in rng f ; ::_thesis: y in the_Edges_of G then consider x being set such that A15: x in dom f and A16: f . x = y by FUNCT_1:def_3; consider a, b being set such that A17: x = [a,b] by A2, A15, RELAT_1:def_1; X: [a,b] `2 = b ; y = x `2 by A2, A15, A16; then y = b by A17, X; then y in rng (W .edgeSeq()) by A2, A15, A17, XTUPLE_0:def_13; hence y in the_Edges_of G ; ::_thesis: verum end; then rng f c= the_Edges_of G by TARSKI:def_3; then card (W .edgeSeq()) c= card (the_Edges_of G) by A2, A14, CARD_1:10; then len (W .edgeSeq()) <= card (the_Edges_of G) by NAT_1:39; then len (W .edgeSeq()) <= G .size() by GLIB_000:def_25; then 2 * (len (W .edgeSeq())) <= 2 * (G .size()) by XREAL_1:64; then (2 * (len (W .edgeSeq()))) + 1 <= (2 * (G .size())) + 1 by XREAL_1:7; hence len W <= (2 * (G .size())) + 1 by Def15; ::_thesis: verum end; now__::_thesis:_for_e_being_set_st_e_in_G_.allTrails()_holds_ e_in__{__x_where_x_is_Element_of_((the_Vertices_of_G)_\/_(the_Edges_of_G))_*_:_len_x_<=_(2_*_(G_.size()))_+_1__}_ let e be set ; ::_thesis: ( e in G .allTrails() implies e in { x where x is Element of ((the_Vertices_of G) \/ (the_Edges_of G)) * : len x <= (2 * (G .size())) + 1 } ) assume e in G .allTrails() ; ::_thesis: e in { x where x is Element of ((the_Vertices_of G) \/ (the_Edges_of G)) * : len x <= (2 * (G .size())) + 1 } then consider W being Trail of G such that A18: W = e ; A19: len W <= (2 * (G .size())) + 1 by A1; e is Element of ((the_Vertices_of G) \/ (the_Edges_of G)) * by A18, FINSEQ_1:def_11; hence e in { x where x is Element of ((the_Vertices_of G) \/ (the_Edges_of G)) * : len x <= (2 * (G .size())) + 1 } by A18, A19; ::_thesis: verum end; then G .allTrails() c= { x where x is Element of ((the_Vertices_of G) \/ (the_Edges_of G)) * : len x <= (2 * (G .size())) + 1 } by TARSKI:def_3; hence G .allTrails() is finite by FINSET_1:1, GRAPH_5:3; ::_thesis: verum end; end; definition let G be _Graph; let X be non empty Subset of (G .allWalks()); :: original: Element redefine mode Element of X -> Walk of G; coherence for b1 being Element of X holds b1 is Walk of G proof let x be Element of X; ::_thesis: x is Walk of G x in { W where W is Walk of G : verum } ; then ex y being Walk of G st y = x ; hence x is Walk of G ; ::_thesis: verum end; end; definition let G be _Graph; let X be non empty Subset of (G .allTrails()); :: original: Element redefine mode Element of X -> Trail of G; coherence for b1 being Element of X holds b1 is Trail of G proof let x be Element of X; ::_thesis: x is Trail of G x in { W where W is Trail of G : verum } ; then ex y being Trail of G st y = x ; hence x is Trail of G ; ::_thesis: verum end; end; definition let G be _Graph; let X be non empty Subset of (G .allPaths()); :: original: Element redefine mode Element of X -> Path of G; coherence for b1 being Element of X holds b1 is Path of G proof let x be Element of X; ::_thesis: x is Path of G x in { W where W is Path of G : verum } ; then ex y being Path of G st y = x ; hence x is Path of G ; ::_thesis: verum end; end; definition let G be _Graph; let X be non empty Subset of (G .allDWalks()); :: original: Element redefine mode Element of X -> DWalk of G; coherence for b1 being Element of X holds b1 is DWalk of G proof let x be Element of X; ::_thesis: x is DWalk of G x in { W where W is DWalk of G : verum } ; then ex y being DWalk of G st y = x ; hence x is DWalk of G ; ::_thesis: verum end; end; definition let G be _Graph; let X be non empty Subset of (G .allDTrails()); :: original: Element redefine mode Element of X -> DTrail of G; coherence for b1 being Element of X holds b1 is DTrail of G proof let x be Element of X; ::_thesis: x is DTrail of G x in { W where W is DTrail of G : verum } ; then ex y being DTrail of G st y = x ; hence x is DTrail of G ; ::_thesis: verum end; end; definition let G be _Graph; let X be non empty Subset of (G .allDPaths()); :: original: Element redefine mode Element of X -> DPath of G; coherence for b1 being Element of X holds b1 is DPath of G proof let x be Element of X; ::_thesis: x is DPath of G x in { W where W is DPath of G : verum } ; then ex y being DPath of G st y = x ; hence x is DPath of G ; ::_thesis: verum end; end; begin theorem :: GLIB_001:7 for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds W . n in the_Vertices_of G by Lm1; theorem Th8: :: GLIB_001:8 for G being _Graph for W being Walk of G for n being even Element of NAT st n in dom W holds W . n in the_Edges_of G proof let G be _Graph; ::_thesis: for W being Walk of G for n being even Element of NAT st n in dom W holds W . n in the_Edges_of G let W be Walk of G; ::_thesis: for n being even Element of NAT st n in dom W holds W . n in the_Edges_of G let n be even Element of NAT ; ::_thesis: ( n in dom W implies W . n in the_Edges_of G ) assume A1: n in dom W ; ::_thesis: W . n in the_Edges_of G then 1 <= n by FINSEQ_3:25; then reconsider naa1 = n - 1 as odd Element of NAT by INT_1:5; n <= len W by A1, FINSEQ_3:25; then naa1 < (len W) - 0 by XREAL_1:15; then W . (naa1 + 1) Joins W . naa1,W . (naa1 + 2),G by Def3; hence W . n in the_Edges_of G by GLIB_000:def_13; ::_thesis: verum end; theorem :: GLIB_001:9 for G being _Graph for W being Walk of G for n being even Element of NAT st n in dom W holds ex naa1 being odd Element of NAT st ( naa1 = n - 1 & n - 1 in dom W & n + 1 in dom W & W . n Joins W . naa1,W . (n + 1),G ) by Lm2; theorem Th10: :: GLIB_001:10 for G being _Graph for W being Walk of G for n being odd Element of NAT st n < len W holds W . (n + 1) in (W .vertexAt n) .edgesInOut() proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n < len W holds W . (n + 1) in (W .vertexAt n) .edgesInOut() let W be Walk of G; ::_thesis: for n being odd Element of NAT st n < len W holds W . (n + 1) in (W .vertexAt n) .edgesInOut() let n be odd Element of NAT ; ::_thesis: ( n < len W implies W . (n + 1) in (W .vertexAt n) .edgesInOut() ) assume A1: n < len W ; ::_thesis: W . (n + 1) in (W .vertexAt n) .edgesInOut() then A2: W .vertexAt n = W . n by Def8; W . (n + 1) Joins W . n,W . (n + 2),G by A1, Def3; hence W . (n + 1) in (W .vertexAt n) .edgesInOut() by A2, GLIB_000:62; ::_thesis: verum end; theorem Th11: :: GLIB_001:11 for G being _Graph for W being Walk of G for n being odd Element of NAT st 1 < n & n <= len W holds W . (n - 1) in (W .vertexAt n) .edgesInOut() proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st 1 < n & n <= len W holds W . (n - 1) in (W .vertexAt n) .edgesInOut() let W be Walk of G; ::_thesis: for n being odd Element of NAT st 1 < n & n <= len W holds W . (n - 1) in (W .vertexAt n) .edgesInOut() let n be odd Element of NAT ; ::_thesis: ( 1 < n & n <= len W implies W . (n - 1) in (W .vertexAt n) .edgesInOut() ) assume that A1: 1 < n and A2: n <= len W ; ::_thesis: W . (n - 1) in (W .vertexAt n) .edgesInOut() reconsider naa1 = n - 1 as even Element of NAT by A1, INT_1:5; 1 + 1 <= n by A1, NAT_1:13; then A3: (1 + 1) - 1 <= n - 1 by XREAL_1:13; n - 1 <= (len W) - 0 by A2, XREAL_1:13; then naa1 in dom W by A3, FINSEQ_3:25; then consider n5 being odd Element of NAT such that A4: n5 = naa1 - 1 and A5: naa1 - 1 in dom W and naa1 + 1 in dom W and A6: W . naa1 Joins W . n5,W . (naa1 + 1),G by Lm2; n5 <= len W by A4, A5, FINSEQ_3:25; then W . n5 = W .vertexAt n5 by Def8; then W . (n - 1) Joins W .vertexAt n5,W .vertexAt n,G by A2, A6, Def8; hence W . (n - 1) in (W .vertexAt n) .edgesInOut() by GLIB_000:14, GLIB_000:62; ::_thesis: verum end; theorem :: GLIB_001:12 for G being _Graph for W being Walk of G for n being odd Element of NAT st n < len W holds ( n in dom W & n + 1 in dom W & n + 2 in dom W ) proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n < len W holds ( n in dom W & n + 1 in dom W & n + 2 in dom W ) let W be Walk of G; ::_thesis: for n being odd Element of NAT st n < len W holds ( n in dom W & n + 1 in dom W & n + 2 in dom W ) let n be odd Element of NAT ; ::_thesis: ( n < len W implies ( n in dom W & n + 1 in dom W & n + 2 in dom W ) ) A1: 1 <= n by ABIAN:12; A2: 1 <= n + 1 by NAT_1:12; A3: 1 <= n + 2 by NAT_1:12; assume A4: n < len W ; ::_thesis: ( n in dom W & n + 1 in dom W & n + 2 in dom W ) then A5: n + 1 <= len W by NAT_1:13; n + 2 <= len W by A4, Th1; hence ( n in dom W & n + 1 in dom W & n + 2 in dom W ) by A4, A1, A2, A3, A5, FINSEQ_3:25; ::_thesis: verum end; theorem Th13: :: GLIB_001:13 for G being _Graph for v being Vertex of G holds ( len (G .walkOf v) = 1 & (G .walkOf v) . 1 = v & (G .walkOf v) .first() = v & (G .walkOf v) .last() = v & G .walkOf v is_Walk_from v,v ) proof let G be _Graph; ::_thesis: for v being Vertex of G holds ( len (G .walkOf v) = 1 & (G .walkOf v) . 1 = v & (G .walkOf v) .first() = v & (G .walkOf v) .last() = v & G .walkOf v is_Walk_from v,v ) let v be Vertex of G; ::_thesis: ( len (G .walkOf v) = 1 & (G .walkOf v) . 1 = v & (G .walkOf v) .first() = v & (G .walkOf v) .last() = v & G .walkOf v is_Walk_from v,v ) thus A1: ( len (G .walkOf v) = 1 & (G .walkOf v) . 1 = v ) by FINSEQ_1:40; ::_thesis: ( (G .walkOf v) .first() = v & (G .walkOf v) .last() = v & G .walkOf v is_Walk_from v,v ) thus A2: (G .walkOf v) .first() = v by FINSEQ_1:40; ::_thesis: ( (G .walkOf v) .last() = v & G .walkOf v is_Walk_from v,v ) thus (G .walkOf v) .last() = v by A1; ::_thesis: G .walkOf v is_Walk_from v,v hence G .walkOf v is_Walk_from v,v by A2, Def23; ::_thesis: verum end; theorem Th14: :: GLIB_001:14 for G being _Graph for e, x, y being set st e Joins x,y,G holds len (G .walkOf (x,e,y)) = 3 proof let G be _Graph; ::_thesis: for e, x, y being set st e Joins x,y,G holds len (G .walkOf (x,e,y)) = 3 let e, x, y be set ; ::_thesis: ( e Joins x,y,G implies len (G .walkOf (x,e,y)) = 3 ) assume e Joins x,y,G ; ::_thesis: len (G .walkOf (x,e,y)) = 3 then G .walkOf (x,e,y) = <*x,e,y*> by Def5; hence len (G .walkOf (x,e,y)) = 3 by FINSEQ_1:45; ::_thesis: verum end; theorem Th15: :: GLIB_001:15 for G being _Graph for e, x, y being set st e Joins x,y,G holds ( (G .walkOf (x,e,y)) .first() = x & (G .walkOf (x,e,y)) .last() = y & G .walkOf (x,e,y) is_Walk_from x,y ) proof let G be _Graph; ::_thesis: for e, x, y being set st e Joins x,y,G holds ( (G .walkOf (x,e,y)) .first() = x & (G .walkOf (x,e,y)) .last() = y & G .walkOf (x,e,y) is_Walk_from x,y ) let e, x, y be set ; ::_thesis: ( e Joins x,y,G implies ( (G .walkOf (x,e,y)) .first() = x & (G .walkOf (x,e,y)) .last() = y & G .walkOf (x,e,y) is_Walk_from x,y ) ) set W = G .walkOf (x,e,y); assume e Joins x,y,G ; ::_thesis: ( (G .walkOf (x,e,y)) .first() = x & (G .walkOf (x,e,y)) .last() = y & G .walkOf (x,e,y) is_Walk_from x,y ) then A1: G .walkOf (x,e,y) = <*x,e,y*> by Def5; hence A2: (G .walkOf (x,e,y)) .first() = x by FINSEQ_1:45; ::_thesis: ( (G .walkOf (x,e,y)) .last() = y & G .walkOf (x,e,y) is_Walk_from x,y ) len (G .walkOf (x,e,y)) = 3 by A1, FINSEQ_1:45; hence (G .walkOf (x,e,y)) .last() = y by A1, FINSEQ_1:45; ::_thesis: G .walkOf (x,e,y) is_Walk_from x,y hence G .walkOf (x,e,y) is_Walk_from x,y by A2, Def23; ::_thesis: verum end; theorem :: GLIB_001:16 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds ( W1 .first() = W2 .first() & W1 .last() = W2 .last() ) ; theorem Th17: :: GLIB_001:17 for G being _Graph for W being Walk of G for x, y being set holds ( W is_Walk_from x,y iff ( W . 1 = x & W . (len W) = y ) ) proof let G be _Graph; ::_thesis: for W being Walk of G for x, y being set holds ( W is_Walk_from x,y iff ( W . 1 = x & W . (len W) = y ) ) let W be Walk of G; ::_thesis: for x, y being set holds ( W is_Walk_from x,y iff ( W . 1 = x & W . (len W) = y ) ) let x, y be set ; ::_thesis: ( W is_Walk_from x,y iff ( W . 1 = x & W . (len W) = y ) ) ( W is_Walk_from x,y iff ( W .first() = x & W .last() = y ) ) by Def23; hence ( W is_Walk_from x,y iff ( W . 1 = x & W . (len W) = y ) ) ; ::_thesis: verum end; theorem :: GLIB_001:18 for G being _Graph for W being Walk of G for x, y being set st W is_Walk_from x,y holds ( x is Vertex of G & y is Vertex of G ) proof let G be _Graph; ::_thesis: for W being Walk of G for x, y being set st W is_Walk_from x,y holds ( x is Vertex of G & y is Vertex of G ) let W be Walk of G; ::_thesis: for x, y being set st W is_Walk_from x,y holds ( x is Vertex of G & y is Vertex of G ) let x, y be set ; ::_thesis: ( W is_Walk_from x,y implies ( x is Vertex of G & y is Vertex of G ) ) assume A1: W is_Walk_from x,y ; ::_thesis: ( x is Vertex of G & y is Vertex of G ) then A2: W .last() = y by Def23; W .first() = x by A1, Def23; hence ( x is Vertex of G & y is Vertex of G ) by A2; ::_thesis: verum end; theorem :: GLIB_001:19 for G1, G2 being _Graph for x, y being set for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) proof let G1, G2 be _Graph; ::_thesis: for x, y being set for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) let x, y be set ; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 st W1 = W2 holds ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) let W2 be Walk of G2; ::_thesis: ( W1 = W2 implies ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) ) assume A1: W1 = W2 ; ::_thesis: ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) ( W1 is_Walk_from x,y iff ( W1 .first() = x & W1 .last() = y ) ) by Def23; then ( W1 is_Walk_from x,y iff ( W2 .first() = x & W2 .last() = y ) ) by A1; hence ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) by Def23; ::_thesis: verum end; theorem :: GLIB_001:20 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds for n being Element of NAT holds W1 .vertexAt n = W2 .vertexAt n proof let G1, G2 be _Graph; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds for n being Element of NAT holds W1 .vertexAt n = W2 .vertexAt n let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 st W1 = W2 holds for n being Element of NAT holds W1 .vertexAt n = W2 .vertexAt n let W2 be Walk of G2; ::_thesis: ( W1 = W2 implies for n being Element of NAT holds W1 .vertexAt n = W2 .vertexAt n ) assume A1: W1 = W2 ; ::_thesis: for n being Element of NAT holds W1 .vertexAt n = W2 .vertexAt n let n be Element of NAT ; ::_thesis: W1 .vertexAt n = W2 .vertexAt n now__::_thesis:_W1_.vertexAt_n_=_W2_.vertexAt_n percases ( ( n is odd & n <= len W1 ) or not n is odd or not n <= len W1 ) ; supposeA2: ( n is odd & n <= len W1 ) ; ::_thesis: W1 .vertexAt n = W2 .vertexAt n hence W1 .vertexAt n = W2 . n by A1, Def8 .= W2 .vertexAt n by A1, A2, Def8 ; ::_thesis: verum end; supposeA3: ( not n is odd or not n <= len W1 ) ; ::_thesis: W1 .vertexAt n = W2 .vertexAt n hence W1 .vertexAt n = W1 .first() by Def8 .= W2 .first() by A1 .= W2 .vertexAt n by A1, A3, Def8 ; ::_thesis: verum end; end; end; hence W1 .vertexAt n = W2 .vertexAt n ; ::_thesis: verum end; theorem :: GLIB_001:21 for G being _Graph for W being Walk of G holds ( len W = len (W .reverse()) & dom W = dom (W .reverse()) & rng W = rng (W .reverse()) ) by FINSEQ_5:57, FINSEQ_5:def_3; theorem Th22: :: GLIB_001:22 for G being _Graph for W being Walk of G holds ( W .first() = (W .reverse()) .last() & W .last() = (W .reverse()) .first() ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W .first() = (W .reverse()) .last() & W .last() = (W .reverse()) .first() ) let W be Walk of G; ::_thesis: ( W .first() = (W .reverse()) .last() & W .last() = (W .reverse()) .first() ) len W = len (W .reverse()) by FINSEQ_5:def_3; hence W .first() = (W .reverse()) .last() by FINSEQ_5:62; ::_thesis: W .last() = (W .reverse()) .first() thus W .last() = (W .reverse()) .first() by FINSEQ_5:62; ::_thesis: verum end; theorem Th23: :: GLIB_001:23 for G being _Graph for W being Walk of G for x, y being set holds ( W is_Walk_from x,y iff W .reverse() is_Walk_from y,x ) proof let G be _Graph; ::_thesis: for W being Walk of G for x, y being set holds ( W is_Walk_from x,y iff W .reverse() is_Walk_from y,x ) let W be Walk of G; ::_thesis: for x, y being set holds ( W is_Walk_from x,y iff W .reverse() is_Walk_from y,x ) let x, y be set ; ::_thesis: ( W is_Walk_from x,y iff W .reverse() is_Walk_from y,x ) A1: len W = len (W .reverse()) by FINSEQ_5:def_3; hereby ::_thesis: ( W .reverse() is_Walk_from y,x implies W is_Walk_from x,y ) assume A2: W is_Walk_from x,y ; ::_thesis: W .reverse() is_Walk_from y,x then W . (len W) = y by Th17; then A3: (W .reverse()) . 1 = y by FINSEQ_5:62; W . 1 = x by A2, Th17; then (W .reverse()) . (len W) = x by FINSEQ_5:62; hence W .reverse() is_Walk_from y,x by A1, A3, Th17; ::_thesis: verum end; assume A4: W .reverse() is_Walk_from y,x ; ::_thesis: W is_Walk_from x,y then (W .reverse()) . 1 = y by Th17; then A5: W . (len W) = y by FINSEQ_5:62; (W .reverse()) . (len (W .reverse())) = x by A4, Th17; then W . 1 = x by A1, FINSEQ_5:62; hence W is_Walk_from x,y by A5, Th17; ::_thesis: verum end; theorem Th24: :: GLIB_001:24 for G being _Graph for W being Walk of G for n being Element of NAT st n in dom W holds ( W . n = (W .reverse()) . (((len W) - n) + 1) & ((len W) - n) + 1 in dom (W .reverse()) ) proof let G be _Graph; ::_thesis: for W being Walk of G for n being Element of NAT st n in dom W holds ( W . n = (W .reverse()) . (((len W) - n) + 1) & ((len W) - n) + 1 in dom (W .reverse()) ) let W be Walk of G; ::_thesis: for n being Element of NAT st n in dom W holds ( W . n = (W .reverse()) . (((len W) - n) + 1) & ((len W) - n) + 1 in dom (W .reverse()) ) let n be Element of NAT ; ::_thesis: ( n in dom W implies ( W . n = (W .reverse()) . (((len W) - n) + 1) & ((len W) - n) + 1 in dom (W .reverse()) ) ) set rn = ((len W) - n) + 1; assume A1: n in dom W ; ::_thesis: ( W . n = (W .reverse()) . (((len W) - n) + 1) & ((len W) - n) + 1 in dom (W .reverse()) ) then n <= len W by FINSEQ_3:25; then reconsider rn = ((len W) - n) + 1 as Element of NAT by FINSEQ_5:1; n in Seg (len W) by A1, FINSEQ_1:def_3; then ((len W) - n) + 1 in Seg (len W) by FINSEQ_5:2; then A2: rn in Seg (len (W .reverse())) by FINSEQ_5:def_3; then rn in dom (W .reverse()) by FINSEQ_1:def_3; then (W .reverse()) . rn = W . (((len W) - rn) + 1) by FINSEQ_5:def_3; hence ( W . n = (W .reverse()) . (((len W) - n) + 1) & ((len W) - n) + 1 in dom (W .reverse()) ) by A2, FINSEQ_1:def_3; ::_thesis: verum end; theorem :: GLIB_001:25 for G being _Graph for W being Walk of G for n being Element of NAT st n in dom (W .reverse()) holds ( (W .reverse()) . n = W . (((len W) - n) + 1) & ((len W) - n) + 1 in dom W ) by Lm8; theorem :: GLIB_001:26 canceled; theorem :: GLIB_001:27 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds W1 .reverse() = W2 .reverse() ; theorem :: GLIB_001:28 for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds (len (W1 .append W2)) + 1 = (len W1) + (len W2) by Lm9; theorem :: GLIB_001:29 for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds ( len W1 <= len (W1 .append W2) & len W2 <= len (W1 .append W2) ) by Lm10; theorem :: GLIB_001:30 for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds ( (W1 .append W2) .first() = W1 .first() & (W1 .append W2) .last() = W2 .last() & W1 .append W2 is_Walk_from W1 .first() ,W2 .last() ) by Lm11; theorem Th31: :: GLIB_001:31 for G being _Graph for W1, W2 being Walk of G for x, y, z being set st W1 is_Walk_from x,y & W2 is_Walk_from y,z holds W1 .append W2 is_Walk_from x,z proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G for x, y, z being set st W1 is_Walk_from x,y & W2 is_Walk_from y,z holds W1 .append W2 is_Walk_from x,z let W1, W2 be Walk of G; ::_thesis: for x, y, z being set st W1 is_Walk_from x,y & W2 is_Walk_from y,z holds W1 .append W2 is_Walk_from x,z let x, y, z be set ; ::_thesis: ( W1 is_Walk_from x,y & W2 is_Walk_from y,z implies W1 .append W2 is_Walk_from x,z ) assume that A1: W1 is_Walk_from x,y and A2: W2 is_Walk_from y,z ; ::_thesis: W1 .append W2 is_Walk_from x,z A3: W1 .last() = y by A1, Def23; A4: W2 .last() = z by A2, Def23; A5: W2 .first() = y by A2, Def23; W1 .first() = x by A1, Def23; hence W1 .append W2 is_Walk_from x,z by A3, A5, A4, Lm11; ::_thesis: verum end; theorem :: GLIB_001:32 for G being _Graph for W1, W2 being Walk of G for n being Element of NAT st n in dom W1 holds ( (W1 .append W2) . n = W1 . n & n in dom (W1 .append W2) ) by Lm12; theorem :: GLIB_001:33 for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds for n being Element of NAT st n < len W2 holds ( (W1 .append W2) . ((len W1) + n) = W2 . (n + 1) & (len W1) + n in dom (W1 .append W2) ) by Lm13; theorem :: GLIB_001:34 for G being _Graph for W1, W2 being Walk of G for n being Element of NAT holds ( not n in dom (W1 .append W2) or n in dom W1 or ex k being Element of NAT st ( k < len W2 & n = (len W1) + k ) ) by Lm14; theorem Th35: :: GLIB_001:35 for G1, G2 being _Graph for W1A, W1B being Walk of G1 for W2A, W2B being Walk of G2 st W1A = W2A & W1B = W2B holds W1A .append W1B = W2A .append W2B proof let G1, G2 be _Graph; ::_thesis: for W1A, W1B being Walk of G1 for W2A, W2B being Walk of G2 st W1A = W2A & W1B = W2B holds W1A .append W1B = W2A .append W2B let W1A, W1B be Walk of G1; ::_thesis: for W2A, W2B being Walk of G2 st W1A = W2A & W1B = W2B holds W1A .append W1B = W2A .append W2B let W2A, W2B be Walk of G2; ::_thesis: ( W1A = W2A & W1B = W2B implies W1A .append W1B = W2A .append W2B ) assume that A1: W1A = W2A and A2: W1B = W2B ; ::_thesis: W1A .append W1B = W2A .append W2B now__::_thesis:_W1A_.append_W1B_=_W2A_.append_W2B percases ( W1A .last() = W1B .first() or W1A .last() <> W1B .first() ) ; supposeA3: W1A .last() = W1B .first() ; ::_thesis: W1A .append W1B = W2A .append W2B then A4: W2A .last() = W2B .first() by A1, A2; thus W1A .append W1B = W1A ^' W1B by A3, Def10 .= W2A .append W2B by A1, A2, A4, Def10 ; ::_thesis: verum end; supposeA5: W1A .last() <> W1B .first() ; ::_thesis: W1A .append W1B = W2A .append W2B then A6: W2A .last() <> W2B .first() by A1, A2; thus W1A .append W1B = W2A by A1, A5, Def10 .= W2A .append W2B by A6, Def10 ; ::_thesis: verum end; end; end; hence W1A .append W1B = W2A .append W2B ; ::_thesis: verum end; theorem :: GLIB_001:36 for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W holds ( (len (W .cut (m,n))) + m = n + 1 & ( for i being Element of NAT st i < len (W .cut (m,n)) holds ( (W .cut (m,n)) . (i + 1) = W . (m + i) & m + i in dom W ) ) ) by Lm15; theorem :: GLIB_001:37 for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W holds ( (W .cut (m,n)) .first() = W . m & (W .cut (m,n)) .last() = W . n & W .cut (m,n) is_Walk_from W . m,W . n ) by Lm16; theorem :: GLIB_001:38 for G being _Graph for W being Walk of G for m, n, o being odd Element of NAT st m <= n & n <= o & o <= len W holds (W .cut (m,n)) .append (W .cut (n,o)) = W .cut (m,o) by Lm17; theorem :: GLIB_001:39 for G being _Graph for W being Walk of G holds W .cut (1,(len W)) = W by Lm18; theorem Th40: :: GLIB_001:40 for G being _Graph for W being Walk of G for n being odd Element of NAT st n < len W holds G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2))) = W .cut (n,(n + 2)) proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n < len W holds G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2))) = W .cut (n,(n + 2)) let W be Walk of G; ::_thesis: for n being odd Element of NAT st n < len W holds G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2))) = W .cut (n,(n + 2)) let n be odd Element of NAT ; ::_thesis: ( n < len W implies G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2))) = W .cut (n,(n + 2)) ) set v1 = W . n; set e = W . (n + 1); set v2 = W . (n + 2); set W1 = G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2))); set W2 = W .cut (n,(n + 2)); assume A1: n < len W ; ::_thesis: G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2))) = W .cut (n,(n + 2)) then A2: n + 2 <= len W by Th1; A3: n <= n + 2 by Th1; then A4: (len (W .cut (n,(n + 2)))) + n = 1 + (2 + n) by A2, Lm15; A5: W . (n + 1) Joins W . n,W . (n + 2),G by A1, Def3; then A6: G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2))) = <*(W . n),(W . (n + 1)),(W . (n + 2))*> by Def5; A7: len (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) = 3 by A5, Th14; then A8: dom (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) = Seg 3 by FINSEQ_1:def_3; now__::_thesis:_for_x_being_Nat_st_x_in_dom_(G_.walkOf_((W_._n),(W_._(n_+_1)),(W_._(n_+_2))))_holds_ (G_.walkOf_((W_._n),(W_._(n_+_1)),(W_._(n_+_2))))_._x_=_(W_.cut_(n,(n_+_2)))_._x let x be Nat; ::_thesis: ( x in dom (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) implies (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) . x = (W .cut (n,(n + 2))) . x ) assume A9: x in dom (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) ; ::_thesis: (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) . x = (W .cut (n,(n + 2))) . x then 1 <= x by FINSEQ_3:25; then reconsider xaa1 = x - 1 as Element of NAT by INT_1:5; x <= 3 by A7, A9, FINSEQ_3:25; then A10: xaa1 < 3 - 0 by XREAL_1:15; xaa1 + 1 = x ; then A11: (W .cut (n,(n + 2))) . x = W . (n + xaa1) by A3, A2, A4, A10, Lm15; now__::_thesis:_(G_.walkOf_((W_._n),(W_._(n_+_1)),(W_._(n_+_2))))_._x_=_(W_.cut_(n,(n_+_2)))_._x percases ( x = 1 or x = 2 or x = 3 ) by A8, A9, ENUMSET1:def_1, FINSEQ_3:1; suppose x = 1 ; ::_thesis: (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) . x = (W .cut (n,(n + 2))) . x hence (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) . x = (W .cut (n,(n + 2))) . x by A6, A11, FINSEQ_1:45; ::_thesis: verum end; suppose x = 2 ; ::_thesis: (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) . x = (W .cut (n,(n + 2))) . x hence (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) . x = (W .cut (n,(n + 2))) . x by A6, A11, FINSEQ_1:45; ::_thesis: verum end; suppose x = 3 ; ::_thesis: (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) . x = (W .cut (n,(n + 2))) . x hence (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) . x = (W .cut (n,(n + 2))) . x by A6, A11, FINSEQ_1:45; ::_thesis: verum end; end; end; hence (G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2)))) . x = (W .cut (n,(n + 2))) . x ; ::_thesis: verum end; hence G .walkOf ((W . n),(W . (n + 1)),(W . (n + 2))) = W .cut (n,(n + 2)) by A4, A7, FINSEQ_2:9; ::_thesis: verum end; theorem Th41: :: GLIB_001:41 for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n < len W holds (W .cut (m,n)) .addEdge (W . (n + 1)) = W .cut (m,(n + 2)) proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT st m <= n & n < len W holds (W .cut (m,n)) .addEdge (W . (n + 1)) = W .cut (m,(n + 2)) let W be Walk of G; ::_thesis: for m, n being odd Element of NAT st m <= n & n < len W holds (W .cut (m,n)) .addEdge (W . (n + 1)) = W .cut (m,(n + 2)) let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n < len W implies (W .cut (m,n)) .addEdge (W . (n + 1)) = W .cut (m,(n + 2)) ) set W1 = W .cut (m,n); set e = W . (n + 1); assume that A1: m <= n and A2: n < len W ; ::_thesis: (W .cut (m,n)) .addEdge (W . (n + 1)) = W .cut (m,(n + 2)) A3: n + 2 <= len W by A2, Th1; A4: (W .cut (m,n)) .last() = W . n by A1, A2, Lm16; then W . (n + 1) Joins (W .cut (m,n)) .last() ,W . (n + 2),G by A2, Def3; then W . (n + 1) Joins (W .cut (m,n)) .last() ,W .vertexAt (n + 2),G by A3, Def8; then ((W .cut (m,n)) .last()) .adj (W . (n + 1)) = W .vertexAt (n + 2) by GLIB_000:66; then ((W .cut (m,n)) .last()) .adj (W . (n + 1)) = W . (n + 2) by A3, Def8; then A5: G .walkOf (((W .cut (m,n)) .last()),(W . (n + 1)),(((W .cut (m,n)) .last()) .adj (W . (n + 1)))) = W .cut (n,(n + 2)) by A2, A4, Th40; n <= n + 2 by Th1; hence (W .cut (m,n)) .addEdge (W . (n + 1)) = W .cut (m,(n + 2)) by A1, A3, A5, Lm17; ::_thesis: verum end; theorem :: GLIB_001:42 for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds W .cut (n,n) = <*(W .vertexAt n)*> by Lm19; theorem :: GLIB_001:43 for G being _Graph for W being Walk of G for m, n being Element of NAT st m is odd & m <= n holds (W .cut (1,n)) .cut (1,m) = W .cut (1,m) by Lm20; theorem :: GLIB_001:44 for G being _Graph for W1, W2 being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W1 & W1 .last() = W2 .first() holds (W1 .append W2) .cut (m,n) = W1 .cut (m,n) by Lm21; theorem :: GLIB_001:45 for G being _Graph for W being Walk of G for m being odd Element of NAT st m <= len W holds len (W .cut (1,m)) = m by Lm22; theorem :: GLIB_001:46 for G being _Graph for W being Walk of G for m being odd Element of NAT for x being Element of NAT st x in dom (W .cut (1,m)) & m <= len W holds (W .cut (1,m)) . x = W . x by Lm23; theorem :: GLIB_001:47 for G being _Graph for W being Walk of G for m, n being odd Element of NAT for i being Element of NAT st m <= n & n <= len W & i in dom (W .cut (m,n)) holds ( (W .cut (m,n)) . i = W . ((m + i) - 1) & (m + i) - 1 in dom W ) proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT for i being Element of NAT st m <= n & n <= len W & i in dom (W .cut (m,n)) holds ( (W .cut (m,n)) . i = W . ((m + i) - 1) & (m + i) - 1 in dom W ) let W be Walk of G; ::_thesis: for m, n being odd Element of NAT for i being Element of NAT st m <= n & n <= len W & i in dom (W .cut (m,n)) holds ( (W .cut (m,n)) . i = W . ((m + i) - 1) & (m + i) - 1 in dom W ) let m, n be odd Element of NAT ; ::_thesis: for i being Element of NAT st m <= n & n <= len W & i in dom (W .cut (m,n)) holds ( (W .cut (m,n)) . i = W . ((m + i) - 1) & (m + i) - 1 in dom W ) let i be Element of NAT ; ::_thesis: ( m <= n & n <= len W & i in dom (W .cut (m,n)) implies ( (W .cut (m,n)) . i = W . ((m + i) - 1) & (m + i) - 1 in dom W ) ) assume that A1: m <= n and A2: n <= len W and A3: i in dom (W .cut (m,n)) ; ::_thesis: ( (W .cut (m,n)) . i = W . ((m + i) - 1) & (m + i) - 1 in dom W ) 1 <= i by A3, FINSEQ_3:25; then reconsider iaa1 = i - 1 as Element of NAT by INT_1:5; i <= len (W .cut (m,n)) by A3, FINSEQ_3:25; then A4: iaa1 < (len (W .cut (m,n))) - 0 by XREAL_1:15; iaa1 + 1 = i ; then (W .cut (m,n)) . i = W . (m + iaa1) by A1, A2, A4, Lm15; hence ( (W .cut (m,n)) . i = W . ((m + i) - 1) & (m + i) - 1 in dom W ) by A1, A2, A4, Lm15; ::_thesis: verum end; theorem Th48: :: GLIB_001:48 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 for m, n being Element of NAT st W1 = W2 holds W1 .cut (m,n) = W2 .cut (m,n) proof let G1, G2 be _Graph; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 for m, n being Element of NAT st W1 = W2 holds W1 .cut (m,n) = W2 .cut (m,n) let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 for m, n being Element of NAT st W1 = W2 holds W1 .cut (m,n) = W2 .cut (m,n) let W2 be Walk of G2; ::_thesis: for m, n being Element of NAT st W1 = W2 holds W1 .cut (m,n) = W2 .cut (m,n) let m, n be Element of NAT ; ::_thesis: ( W1 = W2 implies W1 .cut (m,n) = W2 .cut (m,n) ) assume A1: W1 = W2 ; ::_thesis: W1 .cut (m,n) = W2 .cut (m,n) now__::_thesis:_W1_.cut_(m,n)_=_W2_.cut_(m,n) percases ( ( m is odd & n is odd & m <= n & n <= len W1 ) or not m is odd or not n is odd or not m <= n or not n <= len W1 ) ; supposeA2: ( m is odd & n is odd & m <= n & n <= len W1 ) ; ::_thesis: W1 .cut (m,n) = W2 .cut (m,n) hence W1 .cut (m,n) = (m,n) -cut W2 by A1, Def11 .= W2 .cut (m,n) by A1, A2, Def11 ; ::_thesis: verum end; supposeA3: ( not m is odd or not n is odd or not m <= n or not n <= len W1 ) ; ::_thesis: W1 .cut (m,n) = W2 .cut (m,n) hence W1 .cut (m,n) = W2 by A1, Def11 .= W2 .cut (m,n) by A1, A3, Def11 ; ::_thesis: verum end; end; end; hence W1 .cut (m,n) = W2 .cut (m,n) ; ::_thesis: verum end; theorem :: GLIB_001:49 for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds (len (W .remove (m,n))) + n = (len W) + m by Lm24; theorem :: GLIB_001:50 for G being _Graph for W being Walk of G for x, y being set for m, n being Element of NAT st W is_Walk_from x,y holds W .remove (m,n) is_Walk_from x,y by Lm25; theorem :: GLIB_001:51 for G being _Graph for W being Walk of G for m, n being Element of NAT holds len (W .remove (m,n)) <= len W by Lm26; theorem :: GLIB_001:52 for G being _Graph for W being Walk of G for m being Element of NAT holds W .remove (m,m) = W by Lm27; theorem :: GLIB_001:53 for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds (W .cut (1,m)) .last() = (W .cut (n,(len W))) .first() by Lm28; theorem :: GLIB_001:54 for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds for x being Element of NAT st x in Seg m holds (W .remove (m,n)) . x = W . x by Lm29; theorem :: GLIB_001:55 for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds for x being Element of NAT st m <= x & x <= len (W .remove (m,n)) holds ( (W .remove (m,n)) . x = W . ((x - m) + n) & (x - m) + n is Element of NAT & (x - m) + n <= len W ) by Lm30; theorem :: GLIB_001:56 for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W & W . m = W . n holds len (W .remove (m,n)) = ((len W) + m) - n by Lm31; theorem Th57: :: GLIB_001:57 for G being _Graph for W being Walk of G for m being Element of NAT st W . m = W .last() holds W .remove (m,(len W)) = W .cut (1,m) proof let G be _Graph; ::_thesis: for W being Walk of G for m being Element of NAT st W . m = W .last() holds W .remove (m,(len W)) = W .cut (1,m) let W be Walk of G; ::_thesis: for m being Element of NAT st W . m = W .last() holds W .remove (m,(len W)) = W .cut (1,m) let m be Element of NAT ; ::_thesis: ( W . m = W .last() implies W .remove (m,(len W)) = W .cut (1,m) ) assume A1: W . m = W .last() ; ::_thesis: W .remove (m,(len W)) = W .cut (1,m) now__::_thesis:_W_.remove_(m,(len_W))_=_W_.cut_(1,m) percases ( ( m is odd & m <= len W ) or not m is odd or not m <= len W ) ; supposeA2: ( m is odd & m <= len W ) ; ::_thesis: W .remove (m,(len W)) = W .cut (1,m) then A3: (len (W .remove (m,(len W)))) + (len W) = (len W) + m by A1, Lm24; then A4: len (W .remove (m,(len W))) = len (W .cut (1,m)) by A2, Lm22; now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_(W_.remove_(m,(len_W)))_holds_ (W_.remove_(m,(len_W)))_._k_=_(W_.cut_(1,m))_._k let k be Nat; ::_thesis: ( 1 <= k & k <= len (W .remove (m,(len W))) implies (W .remove (m,(len W))) . k = (W .cut (1,m)) . k ) assume that A5: 1 <= k and A6: k <= len (W .remove (m,(len W))) ; ::_thesis: (W .remove (m,(len W))) . k = (W .cut (1,m)) . k A7: k in dom (W .cut (1,m)) by A4, A5, A6, FINSEQ_3:25; k in Seg m by A3, A5, A6, FINSEQ_1:1; hence (W .remove (m,(len W))) . k = W . k by A1, A2, Lm29 .= (W .cut (1,m)) . k by A2, A7, Lm23 ; ::_thesis: verum end; hence W .remove (m,(len W)) = W .cut (1,m) by A4, FINSEQ_1:14; ::_thesis: verum end; supposeA8: ( not m is odd or not m <= len W ) ; ::_thesis: W .remove (m,(len W)) = W .cut (1,m) then W .cut (1,m) = W by Def11; hence W .remove (m,(len W)) = W .cut (1,m) by A8, Def12; ::_thesis: verum end; end; end; hence W .remove (m,(len W)) = W .cut (1,m) ; ::_thesis: verum end; theorem :: GLIB_001:58 for G being _Graph for W being Walk of G for m being Element of NAT st W .first() = W . m holds W .remove (1,m) = W .cut (m,(len W)) by Lm32; theorem :: GLIB_001:59 for G being _Graph for W being Walk of G for m, n being Element of NAT holds ( (W .remove (m,n)) .first() = W .first() & (W .remove (m,n)) .last() = W .last() ) by Lm33; theorem :: GLIB_001:60 for G being _Graph for W being Walk of G for m, n being odd Element of NAT for x being Element of NAT st m <= n & n <= len W & W . m = W . n & x in dom (W .remove (m,n)) & not x in Seg m holds ( m <= x & x <= len (W .remove (m,n)) ) by Lm34; theorem :: GLIB_001:61 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 for m, n being Element of NAT st W1 = W2 holds W1 .remove (m,n) = W2 .remove (m,n) proof let G1, G2 be _Graph; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 for m, n being Element of NAT st W1 = W2 holds W1 .remove (m,n) = W2 .remove (m,n) let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 for m, n being Element of NAT st W1 = W2 holds W1 .remove (m,n) = W2 .remove (m,n) let W2 be Walk of G2; ::_thesis: for m, n being Element of NAT st W1 = W2 holds W1 .remove (m,n) = W2 .remove (m,n) let m, n be Element of NAT ; ::_thesis: ( W1 = W2 implies W1 .remove (m,n) = W2 .remove (m,n) ) assume A1: W1 = W2 ; ::_thesis: W1 .remove (m,n) = W2 .remove (m,n) now__::_thesis:_W1_.remove_(m,n)_=_W2_.remove_(m,n) percases ( ( m is odd & n is odd & m <= n & n <= len W1 & W1 . m = W1 . n ) or not m is odd or not n is odd or not m <= n or not n <= len W1 or not W1 . m = W1 . n ) ; supposeA2: ( m is odd & n is odd & m <= n & n <= len W1 & W1 . m = W1 . n ) ; ::_thesis: W1 .remove (m,n) = W2 .remove (m,n) A3: W1 .cut (n,(len W1)) = W2 .cut (n,(len W2)) by A1, Th48; A4: W1 .cut (1,m) = W2 .cut (1,m) by A1, Th48; W1 .remove (m,n) = (W1 .cut (1,m)) .append (W1 .cut (n,(len W1))) by A2, Def12; then W1 .remove (m,n) = (W2 .cut (1,m)) .append (W2 .cut (n,(len W2))) by A4, A3, Th35; hence W1 .remove (m,n) = W2 .remove (m,n) by A1, A2, Def12; ::_thesis: verum end; supposeA5: ( not m is odd or not n is odd or not m <= n or not n <= len W1 or not W1 . m = W1 . n ) ; ::_thesis: W1 .remove (m,n) = W2 .remove (m,n) hence W1 .remove (m,n) = W2 by A1, Def12 .= W2 .remove (m,n) by A1, A5, Def12 ; ::_thesis: verum end; end; end; hence W1 .remove (m,n) = W2 .remove (m,n) ; ::_thesis: verum end; theorem :: GLIB_001:62 for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds W .addEdge e = W ^ <*e,x*> by Lm35; theorem :: GLIB_001:63 for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds ( (W .addEdge e) .first() = W .first() & (W .addEdge e) .last() = x & W .addEdge e is_Walk_from W .first() ,x ) by Lm36; theorem :: GLIB_001:64 for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds len (W .addEdge e) = (len W) + 2 by Lm37; theorem :: GLIB_001:65 for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds ( (W .addEdge e) . ((len W) + 1) = e & (W .addEdge e) . ((len W) + 2) = x & ( for n being Element of NAT st n in dom W holds (W .addEdge e) . n = W . n ) ) by Lm38; theorem :: GLIB_001:66 for G being _Graph for W being Walk of G for x, y, e, z being set st W is_Walk_from x,y & e Joins y,z,G holds W .addEdge e is_Walk_from x,z by Lm39; theorem Th67: :: GLIB_001:67 for G being _Graph for W being Walk of G holds 1 <= len (W .vertexSeq()) proof let G be _Graph; ::_thesis: for W being Walk of G holds 1 <= len (W .vertexSeq()) let W be Walk of G; ::_thesis: 1 <= len (W .vertexSeq()) now__::_thesis:_not_len_(W_.vertexSeq())_<_1 assume len (W .vertexSeq()) < 1 ; ::_thesis: contradiction then len (W .vertexSeq()) < 0 + 1 ; then len (W .vertexSeq()) = 0 by NAT_1:13; then (len W) + 1 = 2 * 0 by Def14; hence contradiction ; ::_thesis: verum end; hence 1 <= len (W .vertexSeq()) ; ::_thesis: verum end; theorem Th68: :: GLIB_001:68 for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds ( (2 * ((n + 1) div 2)) - 1 = n & 1 <= (n + 1) div 2 & (n + 1) div 2 <= len (W .vertexSeq()) ) proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n <= len W holds ( (2 * ((n + 1) div 2)) - 1 = n & 1 <= (n + 1) div 2 & (n + 1) div 2 <= len (W .vertexSeq()) ) let W be Walk of G; ::_thesis: for n being odd Element of NAT st n <= len W holds ( (2 * ((n + 1) div 2)) - 1 = n & 1 <= (n + 1) div 2 & (n + 1) div 2 <= len (W .vertexSeq()) ) let n be odd Element of NAT ; ::_thesis: ( n <= len W implies ( (2 * ((n + 1) div 2)) - 1 = n & 1 <= (n + 1) div 2 & (n + 1) div 2 <= len (W .vertexSeq()) ) ) assume A1: n <= len W ; ::_thesis: ( (2 * ((n + 1) div 2)) - 1 = n & 1 <= (n + 1) div 2 & (n + 1) div 2 <= len (W .vertexSeq()) ) set m = (n + 1) div 2; 2 divides n + 1 by PEPIN:22; then A2: 2 * ((n + 1) div 2) = n + 1 by NAT_D:3; hence (2 * ((n + 1) div 2)) - 1 = n ; ::_thesis: ( 1 <= (n + 1) div 2 & (n + 1) div 2 <= len (W .vertexSeq()) ) A3: now__::_thesis:_not_(n_+_1)_div_2_<_1 assume (n + 1) div 2 < 1 ; ::_thesis: contradiction then (n + 1) div 2 < 0 + 1 ; then (n + 1) div 2 = 0 by NAT_1:13; hence contradiction by A2; ::_thesis: verum end; then reconsider maa1 = ((n + 1) div 2) - 1 as Element of NAT by INT_1:5; thus 1 <= (n + 1) div 2 by A3; ::_thesis: (n + 1) div 2 <= len (W .vertexSeq()) now__::_thesis:_not_len_(W_.vertexSeq())_<_(n_+_1)_div_2 assume len (W .vertexSeq()) < (n + 1) div 2 ; ::_thesis: contradiction then len (W .vertexSeq()) < maa1 + 1 ; then len (W .vertexSeq()) <= maa1 by NAT_1:13; then 2 * (len (W .vertexSeq())) <= 2 * maa1 by NAT_1:4; then (len W) + 1 <= (2 * ((n + 1) div 2)) - (2 * 1) by Def14; then ((len W) + 1) + 2 <= ((n + 1) - 2) + 2 by A2, XREAL_1:7; then ((len W) + 1) + 2 < (n + 1) + 1 by NAT_1:13; then ((len W) + 3) - 3 < (n + 2) - 2 by XREAL_1:14; hence contradiction by A1; ::_thesis: verum end; hence (n + 1) div 2 <= len (W .vertexSeq()) ; ::_thesis: verum end; theorem :: GLIB_001:69 for G being _Graph for v being Vertex of G holds (G .walkOf v) .vertexSeq() = <*v*> proof let G be _Graph; ::_thesis: for v being Vertex of G holds (G .walkOf v) .vertexSeq() = <*v*> let v be Vertex of G; ::_thesis: (G .walkOf v) .vertexSeq() = <*v*> set VS = (G .walkOf v) .vertexSeq() ; (len (G .walkOf v)) + 1 = 2 * (len ((G .walkOf v) .vertexSeq())) by Def14; then A1: 1 + 1 = 2 * (len ((G .walkOf v) .vertexSeq())) by Th13; then ((G .walkOf v) .vertexSeq()) . 1 = (G .walkOf v) . ((2 * 1) - 1) by Def14 .= v by Th13 ; hence (G .walkOf v) .vertexSeq() = <*v*> by A1, FINSEQ_1:40; ::_thesis: verum end; theorem Th70: :: GLIB_001:70 for G being _Graph for e, x, y being set st e Joins x,y,G holds (G .walkOf (x,e,y)) .vertexSeq() = <*x,y*> proof let G be _Graph; ::_thesis: for e, x, y being set st e Joins x,y,G holds (G .walkOf (x,e,y)) .vertexSeq() = <*x,y*> let e, x, y be set ; ::_thesis: ( e Joins x,y,G implies (G .walkOf (x,e,y)) .vertexSeq() = <*x,y*> ) set W = G .walkOf (x,e,y); assume e Joins x,y,G ; ::_thesis: (G .walkOf (x,e,y)) .vertexSeq() = <*x,y*> then A1: G .walkOf (x,e,y) = <*x,e,y*> by Def5; (len (G .walkOf (x,e,y))) + 1 = 2 * (len ((G .walkOf (x,e,y)) .vertexSeq())) by Def14; then A2: 3 + 1 = 2 * (len ((G .walkOf (x,e,y)) .vertexSeq())) by A1, FINSEQ_1:45; then ((G .walkOf (x,e,y)) .vertexSeq()) . 2 = (G .walkOf (x,e,y)) . ((2 * 2) - 1) by Def14; then A3: ((G .walkOf (x,e,y)) .vertexSeq()) . 2 = y by A1, FINSEQ_1:45; ((G .walkOf (x,e,y)) .vertexSeq()) . 1 = (G .walkOf (x,e,y)) . ((2 * 1) - 1) by A2, Def14; then ((G .walkOf (x,e,y)) .vertexSeq()) . 1 = x by A1, FINSEQ_1:45; hence (G .walkOf (x,e,y)) .vertexSeq() = <*x,y*> by A2, A3, FINSEQ_1:44; ::_thesis: verum end; theorem :: GLIB_001:71 for G being _Graph for W being Walk of G holds ( W .first() = (W .vertexSeq()) . 1 & W .last() = (W .vertexSeq()) . (len (W .vertexSeq())) ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W .first() = (W .vertexSeq()) . 1 & W .last() = (W .vertexSeq()) . (len (W .vertexSeq())) ) let W be Walk of G; ::_thesis: ( W .first() = (W .vertexSeq()) . 1 & W .last() = (W .vertexSeq()) . (len (W .vertexSeq())) ) A1: (len W) + 1 = 2 * (len (W .vertexSeq())) by Def14; A2: 1 <= len (W .vertexSeq()) by Th67; then (W .vertexSeq()) . 1 = W . ((2 * 1) - 1) by Def14; hence (W .vertexSeq()) . 1 = W .first() ; ::_thesis: W .last() = (W .vertexSeq()) . (len (W .vertexSeq())) (W .vertexSeq()) . (len (W .vertexSeq())) = W . ((2 * (len (W .vertexSeq()))) - 1) by A2, Def14; hence W .last() = (W .vertexSeq()) . (len (W .vertexSeq())) by A1; ::_thesis: verum end; theorem :: GLIB_001:72 for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds W .vertexAt n = (W .vertexSeq()) . ((n + 1) div 2) proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n <= len W holds W .vertexAt n = (W .vertexSeq()) . ((n + 1) div 2) let W be Walk of G; ::_thesis: for n being odd Element of NAT st n <= len W holds W .vertexAt n = (W .vertexSeq()) . ((n + 1) div 2) let n be odd Element of NAT ; ::_thesis: ( n <= len W implies W .vertexAt n = (W .vertexSeq()) . ((n + 1) div 2) ) set m = (n + 1) div 2; assume A1: n <= len W ; ::_thesis: W .vertexAt n = (W .vertexSeq()) . ((n + 1) div 2) then A2: (2 * ((n + 1) div 2)) - 1 = n by Th68; A3: (n + 1) div 2 <= len (W .vertexSeq()) by A1, Th68; A4: 1 <= (n + 1) div 2 by A1, Th68; W .vertexAt n = W . n by A1, Def8; hence W .vertexAt n = (W .vertexSeq()) . ((n + 1) div 2) by A2, A4, A3, Def14; ::_thesis: verum end; theorem Th73: :: GLIB_001:73 for G being _Graph for W being Walk of G for n being Element of NAT holds ( n in dom (W .vertexSeq()) iff (2 * n) - 1 in dom W ) proof let G be _Graph; ::_thesis: for W being Walk of G for n being Element of NAT holds ( n in dom (W .vertexSeq()) iff (2 * n) - 1 in dom W ) let W be Walk of G; ::_thesis: for n being Element of NAT holds ( n in dom (W .vertexSeq()) iff (2 * n) - 1 in dom W ) let n be Element of NAT ; ::_thesis: ( n in dom (W .vertexSeq()) iff (2 * n) - 1 in dom W ) hereby ::_thesis: ( (2 * n) - 1 in dom W implies n in dom (W .vertexSeq()) ) assume A1: n in dom (W .vertexSeq()) ; ::_thesis: (2 * n) - 1 in dom W then A2: 1 <= n by FINSEQ_3:25; then 1 <= n + n by NAT_1:12; then A3: (2 * n) - 1 is Element of NAT by INT_1:5; n <= len (W .vertexSeq()) by A1, FINSEQ_3:25; then 2 * n <= 2 * (len (W .vertexSeq())) by XREAL_1:64; then 2 * n <= (len W) + 1 by Def14; then A4: (2 * n) - 1 <= ((len W) + 1) - 1 by XREAL_1:13; 2 * 1 <= 2 * n by A2, XREAL_1:64; then 2 - 1 <= (2 * n) - 1 by XREAL_1:13; hence (2 * n) - 1 in dom W by A4, A3, FINSEQ_3:25; ::_thesis: verum end; assume A5: (2 * n) - 1 in dom W ; ::_thesis: n in dom (W .vertexSeq()) then reconsider 2naa1 = (2 * n) - 1 as Element of NAT ; 1 <= 2naa1 by A5, FINSEQ_3:25; then 1 + 1 <= ((2 * n) - 1) + 1 by XREAL_1:7; then 2 * 1 <= 2 * n ; then A6: 1 <= n by XREAL_1:68; 2naa1 <= len W by A5, FINSEQ_3:25; then ((2 * n) - 1) + 1 <= (len W) + 1 by XREAL_1:7; then 2 * n <= 2 * (len (W .vertexSeq())) by Def14; then n <= len (W .vertexSeq()) by XREAL_1:68; hence n in dom (W .vertexSeq()) by A6, FINSEQ_3:25; ::_thesis: verum end; theorem :: GLIB_001:74 for G being _Graph for W being Walk of G for n being Element of NAT holds (W .cut (1,n)) .vertexSeq() c= W .vertexSeq() proof let G be _Graph; ::_thesis: for W being Walk of G for n being Element of NAT holds (W .cut (1,n)) .vertexSeq() c= W .vertexSeq() let W be Walk of G; ::_thesis: for n being Element of NAT holds (W .cut (1,n)) .vertexSeq() c= W .vertexSeq() let n be Element of NAT ; ::_thesis: (W .cut (1,n)) .vertexSeq() c= W .vertexSeq() now__::_thesis:_(W_.cut_(1,n))_.vertexSeq()_c=_W_.vertexSeq() percases ( ( n is odd & 1 <= n & n <= len W ) or not n is odd or not 1 <= n or not n <= len W ) ; supposeA1: ( n is odd & 1 <= n & n <= len W ) ; ::_thesis: (W .cut (1,n)) .vertexSeq() c= W .vertexSeq() set f = (W .cut (1,n)) .vertexSeq() ; now__::_thesis:_for_v_being_set_st_v_in_(W_.cut_(1,n))_.vertexSeq()_holds_ v_in_W_.vertexSeq() let v be set ; ::_thesis: ( v in (W .cut (1,n)) .vertexSeq() implies v in W .vertexSeq() ) assume A2: v in (W .cut (1,n)) .vertexSeq() ; ::_thesis: v in W .vertexSeq() then consider x, y being set such that A3: v = [x,y] by RELAT_1:def_1; A4: y = ((W .cut (1,n)) .vertexSeq()) . x by A2, A3, FUNCT_1:1; A5: x in dom ((W .cut (1,n)) .vertexSeq()) by A2, A3, FUNCT_1:1; then reconsider x = x as Element of NAT ; A6: x <= len ((W .cut (1,n)) .vertexSeq()) by A5, FINSEQ_3:25; A7: (2 * x) - 1 in dom (W .cut (1,n)) by A5, Th73; then (2 * x) - 1 <= len (W .cut (1,n)) by FINSEQ_3:25; then (2 * x) - 1 <= n by A1, Lm22; then A8: (2 * x) - 1 <= len W by A1, XXREAL_0:2; 1 <= (2 * x) - 1 by A7, FINSEQ_3:25; then (2 * x) - 1 in dom W by A7, A8, FINSEQ_3:25; then A9: x in dom (W .vertexSeq()) by Th73; then A10: x <= len (W .vertexSeq()) by FINSEQ_3:25; 1 <= x by A5, FINSEQ_3:25; then y = (W .cut (1,n)) . ((2 * x) - 1) by A4, A6, Def14; then A11: y = W . ((2 * x) - 1) by A1, A7, Lm23; 1 <= x by A9, FINSEQ_3:25; then (W .vertexSeq()) . x = y by A11, A10, Def14; hence v in W .vertexSeq() by A3, A9, FUNCT_1:1; ::_thesis: verum end; hence (W .cut (1,n)) .vertexSeq() c= W .vertexSeq() by TARSKI:def_3; ::_thesis: verum end; suppose ( not n is odd or not 1 <= n or not n <= len W ) ; ::_thesis: (W .cut (1,n)) .vertexSeq() c= W .vertexSeq() hence (W .cut (1,n)) .vertexSeq() c= W .vertexSeq() by Def11; ::_thesis: verum end; end; end; hence (W .cut (1,n)) .vertexSeq() c= W .vertexSeq() ; ::_thesis: verum end; theorem Th75: :: GLIB_001:75 for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .vertexSeq() = (W .vertexSeq()) ^ <*x*> proof let G be _Graph; ::_thesis: for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .vertexSeq() = (W .vertexSeq()) ^ <*x*> let W be Walk of G; ::_thesis: for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .vertexSeq() = (W .vertexSeq()) ^ <*x*> let e, x be set ; ::_thesis: ( e Joins W .last() ,x,G implies (W .addEdge e) .vertexSeq() = (W .vertexSeq()) ^ <*x*> ) set W2 = W .addEdge e; set W3 = (W .vertexSeq()) ^ <*x*>; assume A1: e Joins W .last() ,x,G ; ::_thesis: (W .addEdge e) .vertexSeq() = (W .vertexSeq()) ^ <*x*> then len (W .addEdge e) = (len W) + 2 by Lm37; then A2: ((len W) + 2) + 1 = 2 * (len ((W .addEdge e) .vertexSeq())) by Def14; len ((W .vertexSeq()) ^ <*x*>) = (len (W .vertexSeq())) + (len <*x*>) by FINSEQ_1:22; then len ((W .vertexSeq()) ^ <*x*>) = (len (W .vertexSeq())) + 1 by FINSEQ_1:39; then 2 * (len ((W .vertexSeq()) ^ <*x*>)) = (2 * (len (W .vertexSeq()))) + (2 * 1) ; then A3: 2 * (len ((W .vertexSeq()) ^ <*x*>)) = ((len W) + 1) + 2 by Def14 .= 2 * (len ((W .addEdge e) .vertexSeq())) by A2 ; now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((W_.addEdge_e)_.vertexSeq())_holds_ ((W_.addEdge_e)_.vertexSeq())_._k_=_((W_.vertexSeq())_^_<*x*>)_._k let k be Nat; ::_thesis: ( 1 <= k & k <= len ((W .addEdge e) .vertexSeq()) implies ((W .addEdge e) .vertexSeq()) . k = ((W .vertexSeq()) ^ <*x*>) . k ) assume that A4: 1 <= k and A5: k <= len ((W .addEdge e) .vertexSeq()) ; ::_thesis: ((W .addEdge e) .vertexSeq()) . k = ((W .vertexSeq()) ^ <*x*>) . k A6: ((W .addEdge e) .vertexSeq()) . k = (W .addEdge e) . ((2 * k) - 1) by A4, A5, Def14; A7: k in dom ((W .vertexSeq()) ^ <*x*>) by A3, A4, A5, FINSEQ_3:25; now__::_thesis:_((W_.addEdge_e)_.vertexSeq())_._k_=_((W_.vertexSeq())_^_<*x*>)_._k percases ( k in dom (W .vertexSeq()) or ex n being Nat st ( n in dom <*x*> & k = (len (W .vertexSeq())) + n ) ) by A7, FINSEQ_1:25; supposeA8: k in dom (W .vertexSeq()) ; ::_thesis: ((W .addEdge e) .vertexSeq()) . k = ((W .vertexSeq()) ^ <*x*>) . k then A9: (2 * k) - 1 in dom W by Th73; A10: 1 <= k by A8, FINSEQ_3:25; A11: k <= len (W .vertexSeq()) by A8, FINSEQ_3:25; ((W .vertexSeq()) ^ <*x*>) . k = (W .vertexSeq()) . k by A8, FINSEQ_1:def_7; then ((W .vertexSeq()) ^ <*x*>) . k = W . ((2 * k) - 1) by A10, A11, Def14; hence ((W .addEdge e) .vertexSeq()) . k = ((W .vertexSeq()) ^ <*x*>) . k by A1, A6, A9, Lm38; ::_thesis: verum end; suppose ex n being Nat st ( n in dom <*x*> & k = (len (W .vertexSeq())) + n ) ; ::_thesis: ((W .addEdge e) .vertexSeq()) . k = ((W .vertexSeq()) ^ <*x*>) . k then consider n being Nat such that A12: n in dom <*x*> and A13: k = (len (W .vertexSeq())) + n ; n in Seg 1 by A12, FINSEQ_1:38; then A14: n = 1 by FINSEQ_1:2, TARSKI:def_1; then A15: 2 * k = (2 * (len (W .vertexSeq()))) + (2 * 1) by A13 .= ((len W) + 1) + 2 by Def14 .= ((len W) + 2) + 1 ; ((W .vertexSeq()) ^ <*x*>) . k = <*x*> . 1 by A12, A13, A14, FINSEQ_1:def_7 .= x by FINSEQ_1:def_8 ; hence ((W .addEdge e) .vertexSeq()) . k = ((W .vertexSeq()) ^ <*x*>) . k by A1, A6, A15, Lm38; ::_thesis: verum end; end; end; hence ((W .addEdge e) .vertexSeq()) . k = ((W .vertexSeq()) ^ <*x*>) . k ; ::_thesis: verum end; hence (W .addEdge e) .vertexSeq() = (W .vertexSeq()) ^ <*x*> by A3, FINSEQ_1:14; ::_thesis: verum end; theorem Th76: :: GLIB_001:76 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds W1 .vertexSeq() = W2 .vertexSeq() proof let G1, G2 be _Graph; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds W1 .vertexSeq() = W2 .vertexSeq() let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 st W1 = W2 holds W1 .vertexSeq() = W2 .vertexSeq() let W2 be Walk of G2; ::_thesis: ( W1 = W2 implies W1 .vertexSeq() = W2 .vertexSeq() ) set VS1 = W1 .vertexSeq() ; set VS2 = W2 .vertexSeq() ; assume A1: W1 = W2 ; ::_thesis: W1 .vertexSeq() = W2 .vertexSeq() now__::_thesis:_(_len_(W1_.vertexSeq())_=_len_(W1_.vertexSeq())_&_len_(W2_.vertexSeq())_=_len_(W1_.vertexSeq())_&_(_for_x_being_Nat_st_x_in_dom_(W1_.vertexSeq())_holds_ (W1_.vertexSeq())_._x_=_(W2_.vertexSeq())_._x_)_) thus len (W1 .vertexSeq()) = len (W1 .vertexSeq()) ; ::_thesis: ( len (W2 .vertexSeq()) = len (W1 .vertexSeq()) & ( for x being Nat st x in dom (W1 .vertexSeq()) holds (W1 .vertexSeq()) . x = (W2 .vertexSeq()) . x ) ) A2: 2 * (len (W1 .vertexSeq())) = (len W2) + 1 by A1, Def14 .= 2 * (len (W2 .vertexSeq())) by Def14 ; hence len (W2 .vertexSeq()) = len (W1 .vertexSeq()) ; ::_thesis: for x being Nat st x in dom (W1 .vertexSeq()) holds (W1 .vertexSeq()) . x = (W2 .vertexSeq()) . x let x be Nat; ::_thesis: ( x in dom (W1 .vertexSeq()) implies (W1 .vertexSeq()) . x = (W2 .vertexSeq()) . x ) assume A3: x in dom (W1 .vertexSeq()) ; ::_thesis: (W1 .vertexSeq()) . x = (W2 .vertexSeq()) . x then A4: x <= len (W2 .vertexSeq()) by A2, FINSEQ_3:25; A5: 1 <= x by A3, FINSEQ_3:25; x <= len (W1 .vertexSeq()) by A3, FINSEQ_3:25; hence (W1 .vertexSeq()) . x = W2 . ((2 * x) - 1) by A1, A5, Def14 .= (W2 .vertexSeq()) . x by A5, A4, Def14 ; ::_thesis: verum end; hence W1 .vertexSeq() = W2 .vertexSeq() by FINSEQ_2:9; ::_thesis: verum end; theorem :: GLIB_001:77 for G being _Graph for W being Walk of G for n being even Element of NAT st 1 <= n & n <= len W holds ( n div 2 in dom (W .edgeSeq()) & W . n = (W .edgeSeq()) . (n div 2) ) by Lm40; theorem :: GLIB_001:78 for G being _Graph for W being Walk of G for n being Element of NAT holds ( n in dom (W .edgeSeq()) iff 2 * n in dom W ) by Lm41; theorem :: GLIB_001:79 for G being _Graph for W being Walk of G for n being Element of NAT st n in dom (W .edgeSeq()) holds (W .edgeSeq()) . n in the_Edges_of G proof let G be _Graph; ::_thesis: for W being Walk of G for n being Element of NAT st n in dom (W .edgeSeq()) holds (W .edgeSeq()) . n in the_Edges_of G let W be Walk of G; ::_thesis: for n being Element of NAT st n in dom (W .edgeSeq()) holds (W .edgeSeq()) . n in the_Edges_of G let n be Element of NAT ; ::_thesis: ( n in dom (W .edgeSeq()) implies (W .edgeSeq()) . n in the_Edges_of G ) assume n in dom (W .edgeSeq()) ; ::_thesis: (W .edgeSeq()) . n in the_Edges_of G then (W .edgeSeq()) . n in rng (W .edgeSeq()) by FUNCT_1:def_3; hence (W .edgeSeq()) . n in the_Edges_of G ; ::_thesis: verum end; theorem :: GLIB_001:80 for G being _Graph for W being Walk of G ex lenWaa1 being even Element of NAT st ( lenWaa1 = (len W) - 1 & len (W .edgeSeq()) = lenWaa1 div 2 ) by Lm42; theorem :: GLIB_001:81 for G being _Graph for W being Walk of G for n being Element of NAT holds (W .cut (1,n)) .edgeSeq() c= W .edgeSeq() by Lm43; theorem :: GLIB_001:82 for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .edgeSeq() = (W .edgeSeq()) ^ <*e*> by Lm44; theorem Th83: :: GLIB_001:83 for G being _Graph for e, x, y being set holds ( e Joins x,y,G iff (G .walkOf (x,e,y)) .edgeSeq() = <*e*> ) proof let G be _Graph; ::_thesis: for e, x, y being set holds ( e Joins x,y,G iff (G .walkOf (x,e,y)) .edgeSeq() = <*e*> ) let e, x, y be set ; ::_thesis: ( e Joins x,y,G iff (G .walkOf (x,e,y)) .edgeSeq() = <*e*> ) set W = G .walkOf (x,e,y); hereby ::_thesis: ( (G .walkOf (x,e,y)) .edgeSeq() = <*e*> implies e Joins x,y,G ) assume A1: e Joins x,y,G ; ::_thesis: (G .walkOf (x,e,y)) .edgeSeq() = <*e*> then len (G .walkOf (x,e,y)) = 3 by Th14; then A2: 2 + 1 = (2 * (len ((G .walkOf (x,e,y)) .edgeSeq()))) + 1 by Def15; A3: G .walkOf (x,e,y) = <*x,e,y*> by A1, Def5; A4: now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((G_.walkOf_(x,e,y))_.edgeSeq())_holds_ ((G_.walkOf_(x,e,y))_.edgeSeq())_._k_=_<*e*>_._k let k be Nat; ::_thesis: ( 1 <= k & k <= len ((G .walkOf (x,e,y)) .edgeSeq()) implies ((G .walkOf (x,e,y)) .edgeSeq()) . k = <*e*> . k ) assume that A5: 1 <= k and A6: k <= len ((G .walkOf (x,e,y)) .edgeSeq()) ; ::_thesis: ((G .walkOf (x,e,y)) .edgeSeq()) . k = <*e*> . k A7: k = 1 by A2, A5, A6, XXREAL_0:1; then ((G .walkOf (x,e,y)) .edgeSeq()) . k = (G .walkOf (x,e,y)) . (2 * 1) by A6, Def15 .= e by A3, FINSEQ_1:45 ; hence ((G .walkOf (x,e,y)) .edgeSeq()) . k = <*e*> . k by A7, FINSEQ_1:def_8; ::_thesis: verum end; len ((G .walkOf (x,e,y)) .edgeSeq()) = len <*e*> by A2, FINSEQ_1:39; hence (G .walkOf (x,e,y)) .edgeSeq() = <*e*> by A4, FINSEQ_1:14; ::_thesis: verum end; assume (G .walkOf (x,e,y)) .edgeSeq() = <*e*> ; ::_thesis: e Joins x,y,G then len ((G .walkOf (x,e,y)) .edgeSeq()) = 1 by FINSEQ_1:39; then A8: len (G .walkOf (x,e,y)) = (2 * 1) + 1 by Def15; now__::_thesis:_e_Joins_x,y,G assume not e Joins x,y,G ; ::_thesis: contradiction then G .walkOf (x,e,y) = G .walkOf (choose (the_Vertices_of G)) by Def5; hence contradiction by A8, Th13; ::_thesis: verum end; hence e Joins x,y,G ; ::_thesis: verum end; theorem :: GLIB_001:84 for G being _Graph for W being Walk of G holds (W .reverse()) .edgeSeq() = Rev (W .edgeSeq()) proof let G be _Graph; ::_thesis: for W being Walk of G holds (W .reverse()) .edgeSeq() = Rev (W .edgeSeq()) let W be Walk of G; ::_thesis: (W .reverse()) .edgeSeq() = Rev (W .edgeSeq()) set W1 = (W .reverse()) .edgeSeq() ; set W2 = Rev (W .edgeSeq()); A1: len W = len (W .reverse()) by FINSEQ_5:def_3; len W = (2 * (len (W .edgeSeq()))) + 1 by Def15; then A2: (2 * (len (W .edgeSeq()))) + 1 = (2 * (len ((W .reverse()) .edgeSeq()))) + 1 by A1, Def15; A3: now__::_thesis:_for_n_being_Nat_st_1_<=_n_&_n_<=_len_((W_.reverse())_.edgeSeq())_holds_ ((W_.reverse())_.edgeSeq())_._n_=_(Rev_(W_.edgeSeq()))_._n let n be Nat; ::_thesis: ( 1 <= n & n <= len ((W .reverse()) .edgeSeq()) implies ((W .reverse()) .edgeSeq()) . n = (Rev (W .edgeSeq())) . n ) assume that A4: 1 <= n and A5: n <= len ((W .reverse()) .edgeSeq()) ; ::_thesis: ((W .reverse()) .edgeSeq()) . n = (Rev (W .edgeSeq())) . n A6: ((W .reverse()) .edgeSeq()) . n = (W .reverse()) . (2 * n) by A4, A5, Def15; set rn = ((len (W .edgeSeq())) - n) + 1; reconsider rn = ((len (W .edgeSeq())) - n) + 1 as Element of NAT by A2, A5, FINSEQ_5:1; A7: n in Seg (len (W .edgeSeq())) by A2, A4, A5, FINSEQ_1:1; then A8: rn in Seg (len (W .edgeSeq())) by FINSEQ_5:2; then A9: 1 <= rn by FINSEQ_1:1; A10: n in dom (W .edgeSeq()) by A7, FINSEQ_1:def_3; then A11: 2 * n in dom W by Lm41; then A12: 1 <= 2 * n by FINSEQ_3:25; A13: rn <= len (W .edgeSeq()) by A8, FINSEQ_1:1; A14: ((len W) - (2 * n)) + 1 = (((2 * (len (W .edgeSeq()))) + 1) - (2 * n)) + 1 by Def15 .= 2 * rn ; 2 * n <= len (W .reverse()) by A1, A11, FINSEQ_3:25; then A15: 2 * n in dom (W .reverse()) by A12, FINSEQ_3:25; (Rev (W .edgeSeq())) . n = (W .edgeSeq()) . rn by A10, FINSEQ_5:58 .= W . (2 * rn) by A9, A13, Def15 ; hence ((W .reverse()) .edgeSeq()) . n = (Rev (W .edgeSeq())) . n by A15, A6, A14, Lm8; ::_thesis: verum end; len ((W .reverse()) .edgeSeq()) = len (Rev (W .edgeSeq())) by A2, FINSEQ_5:def_3; hence (W .reverse()) .edgeSeq() = Rev (W .edgeSeq()) by A3, FINSEQ_1:14; ::_thesis: verum end; theorem :: GLIB_001:85 for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds (W1 .append W2) .edgeSeq() = (W1 .edgeSeq()) ^ (W2 .edgeSeq()) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 .last() = W2 .first() holds (W1 .append W2) .edgeSeq() = (W1 .edgeSeq()) ^ (W2 .edgeSeq()) let W1, W2 be Walk of G; ::_thesis: ( W1 .last() = W2 .first() implies (W1 .append W2) .edgeSeq() = (W1 .edgeSeq()) ^ (W2 .edgeSeq()) ) set W3 = W1 .append W2; set W4 = (W1 .edgeSeq()) ^ (W2 .edgeSeq()); A1: len ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) = (len (W1 .edgeSeq())) + (len (W2 .edgeSeq())) by FINSEQ_1:22; assume A2: W1 .last() = W2 .first() ; ::_thesis: (W1 .append W2) .edgeSeq() = (W1 .edgeSeq()) ^ (W2 .edgeSeq()) then (len (W1 .append W2)) + 1 = (len W1) + (len W2) by Lm9; then (len (W1 .append W2)) + 1 = (len W1) + ((2 * (len (W2 .edgeSeq()))) + 1) by Def15 .= ((len W1) + (2 * (len (W2 .edgeSeq())))) + 1 ; then A3: (2 * (len ((W1 .append W2) .edgeSeq()))) + 1 = (2 * (len (W2 .edgeSeq()))) + (len W1) by Def15 .= (2 * (len (W2 .edgeSeq()))) + ((2 * (len (W1 .edgeSeq()))) + 1) by Def15 .= ((2 * (len (W2 .edgeSeq()))) + (2 * (len (W1 .edgeSeq())))) + 1 ; A4: W1 .append W2 = W1 ^' W2 by A2, Def10; now__::_thesis:_for_n_being_Nat_st_1_<=_n_&_n_<=_len_((W1_.append_W2)_.edgeSeq())_holds_ ((W1_.append_W2)_.edgeSeq())_._n_=_((W1_.edgeSeq())_^_(W2_.edgeSeq()))_._n let n be Nat; ::_thesis: ( 1 <= n & n <= len ((W1 .append W2) .edgeSeq()) implies ((W1 .append W2) .edgeSeq()) . n = ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) . n ) assume that A5: 1 <= n and A6: n <= len ((W1 .append W2) .edgeSeq()) ; ::_thesis: ((W1 .append W2) .edgeSeq()) . n = ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) . n reconsider n1 = n as Element of NAT by ORDINAL1:def_12; A7: ((W1 .append W2) .edgeSeq()) . n1 = (W1 .append W2) . (2 * n1) by A5, A6, Def15; A8: n1 in dom ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) by A1, A3, A5, A6, FINSEQ_3:25; now__::_thesis:_((W1_.append_W2)_.edgeSeq())_._n_=_((W1_.edgeSeq())_^_(W2_.edgeSeq()))_._n percases ( n in dom (W1 .edgeSeq()) or ex k being Nat st ( k in dom (W2 .edgeSeq()) & n = (len (W1 .edgeSeq())) + k ) ) by A8, FINSEQ_1:25; supposeA9: n in dom (W1 .edgeSeq()) ; ::_thesis: ((W1 .append W2) .edgeSeq()) . n = ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) . n then A10: n <= len (W1 .edgeSeq()) by FINSEQ_3:25; A11: 1 <= n by A9, FINSEQ_3:25; A12: 2 * n in dom W1 by A9, Lm41; then A13: 1 <= 2 * n by FINSEQ_3:25; A14: 2 * n <= len W1 by A12, FINSEQ_3:25; ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) . n = (W1 .edgeSeq()) . n by A9, FINSEQ_1:def_7 .= W1 . (2 * n) by A11, A10, Def15 ; hence ((W1 .append W2) .edgeSeq()) . n = ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) . n by A4, A7, A13, A14, GRAPH_2:14; ::_thesis: verum end; suppose ex k being Nat st ( k in dom (W2 .edgeSeq()) & n = (len (W1 .edgeSeq())) + k ) ; ::_thesis: ((W1 .append W2) .edgeSeq()) . n = ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) . n then consider k being Nat such that A15: k in dom (W2 .edgeSeq()) and A16: n = (len (W1 .edgeSeq())) + k ; (2 * n) + 1 = (2 * k) + ((2 * (len (W1 .edgeSeq()))) + 1) by A16 .= (2 * k) + (len W1) by Def15 ; then A17: 2 * n = (len W1) + ((2 * k) - 1) ; A18: 1 <= k by A15, FINSEQ_3:25; then 1 <= k + k by NAT_1:12; then reconsider 2kaa1 = (2 * k) - 1 as Element of NAT by INT_1:5; A19: k <= len (W2 .edgeSeq()) by A15, FINSEQ_3:25; then 2 * k <= 2 * (len (W2 .edgeSeq())) by XREAL_1:64; then 2 * k < (2 * (len (W2 .edgeSeq()))) + 1 by NAT_1:13; then 2 * k < len W2 by Def15; then A20: 2kaa1 < (len W2) - 0 by XREAL_1:14; 1 + 1 <= k + k by A18, XREAL_1:7; then (1 + 1) - 1 <= 2kaa1 by XREAL_1:13; then A21: (W1 .append W2) . (2 * n) = W2 . (2kaa1 + 1) by A4, A17, A20, GRAPH_2:15 .= W2 . (2 * k) ; ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) . n = (W2 .edgeSeq()) . k by A15, A16, FINSEQ_1:def_7 .= W2 . (2 * k) by A18, A19, Def15 ; hence ((W1 .append W2) .edgeSeq()) . n = ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) . n by A5, A6, A21, Def15; ::_thesis: verum end; end; end; hence ((W1 .append W2) .edgeSeq()) . n = ((W1 .edgeSeq()) ^ (W2 .edgeSeq())) . n ; ::_thesis: verum end; hence (W1 .append W2) .edgeSeq() = (W1 .edgeSeq()) ^ (W2 .edgeSeq()) by A1, A3, FINSEQ_1:14; ::_thesis: verum end; theorem Th86: :: GLIB_001:86 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds W1 .edgeSeq() = W2 .edgeSeq() proof let G1, G2 be _Graph; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds W1 .edgeSeq() = W2 .edgeSeq() let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 st W1 = W2 holds W1 .edgeSeq() = W2 .edgeSeq() let W2 be Walk of G2; ::_thesis: ( W1 = W2 implies W1 .edgeSeq() = W2 .edgeSeq() ) set ES1 = W1 .edgeSeq() ; set ES2 = W2 .edgeSeq() ; assume A1: W1 = W2 ; ::_thesis: W1 .edgeSeq() = W2 .edgeSeq() now__::_thesis:_(_len_(W1_.edgeSeq())_=_len_(W1_.edgeSeq())_&_len_(W2_.edgeSeq())_=_len_(W1_.edgeSeq())_&_(_for_x_being_Nat_st_x_in_dom_(W1_.edgeSeq())_holds_ (W1_.edgeSeq())_._x_=_(W2_.edgeSeq())_._x_)_) thus len (W1 .edgeSeq()) = len (W1 .edgeSeq()) ; ::_thesis: ( len (W2 .edgeSeq()) = len (W1 .edgeSeq()) & ( for x being Nat st x in dom (W1 .edgeSeq()) holds (W1 .edgeSeq()) . x = (W2 .edgeSeq()) . x ) ) A2: (2 * (len (W1 .edgeSeq()))) + 1 = len W2 by A1, Def15 .= (2 * (len (W2 .edgeSeq()))) + 1 by Def15 ; hence len (W2 .edgeSeq()) = len (W1 .edgeSeq()) ; ::_thesis: for x being Nat st x in dom (W1 .edgeSeq()) holds (W1 .edgeSeq()) . x = (W2 .edgeSeq()) . x let x be Nat; ::_thesis: ( x in dom (W1 .edgeSeq()) implies (W1 .edgeSeq()) . x = (W2 .edgeSeq()) . x ) assume A3: x in dom (W1 .edgeSeq()) ; ::_thesis: (W1 .edgeSeq()) . x = (W2 .edgeSeq()) . x then A4: x <= len (W2 .edgeSeq()) by A2, FINSEQ_3:25; A5: 1 <= x by A3, FINSEQ_3:25; x <= len (W1 .edgeSeq()) by A3, FINSEQ_3:25; hence (W1 .edgeSeq()) . x = W2 . (2 * x) by A1, A5, Def15 .= (W2 .edgeSeq()) . x by A5, A4, Def15 ; ::_thesis: verum end; hence W1 .edgeSeq() = W2 .edgeSeq() by FINSEQ_2:9; ::_thesis: verum end; theorem :: GLIB_001:87 for G being _Graph for W being Walk of G for x being set holds ( x in W .vertices() iff ex n being odd Element of NAT st ( n <= len W & W . n = x ) ) by Lm45; theorem Th88: :: GLIB_001:88 for G being _Graph for W being Walk of G holds ( W .first() in W .vertices() & W .last() in W .vertices() ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W .first() in W .vertices() & W .last() in W .vertices() ) let W be Walk of G; ::_thesis: ( W .first() in W .vertices() & W .last() in W .vertices() ) 1 <= len W by ABIAN:12; hence W .first() in W .vertices() by Lm45, JORDAN12:2; ::_thesis: W .last() in W .vertices() thus W .last() in W .vertices() by Lm45; ::_thesis: verum end; theorem Th89: :: GLIB_001:89 for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds W .vertexAt n in W .vertices() proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n <= len W holds W .vertexAt n in W .vertices() let W be Walk of G; ::_thesis: for n being odd Element of NAT st n <= len W holds W .vertexAt n in W .vertices() let n be odd Element of NAT ; ::_thesis: ( n <= len W implies W .vertexAt n in W .vertices() ) assume A1: n <= len W ; ::_thesis: W .vertexAt n in W .vertices() then W .vertexAt n = W . n by Def8; hence W .vertexAt n in W .vertices() by A1, Lm45; ::_thesis: verum end; theorem :: GLIB_001:90 for G being _Graph for v being Vertex of G holds (G .walkOf v) .vertices() = {v} proof let G be _Graph; ::_thesis: for v being Vertex of G holds (G .walkOf v) .vertices() = {v} let v be Vertex of G; ::_thesis: (G .walkOf v) .vertices() = {v} now__::_thesis:_for_x_being_set_holds_ (_(_x_in_(G_.walkOf_v)_.vertices()_implies_x_in_{v}_)_&_(_x_in_{v}_implies_x_in_(G_.walkOf_v)_.vertices()_)_) let x be set ; ::_thesis: ( ( x in (G .walkOf v) .vertices() implies x in {v} ) & ( x in {v} implies x in (G .walkOf v) .vertices() ) ) A1: 1 <= len (G .walkOf v) by ABIAN:12; hereby ::_thesis: ( x in {v} implies x in (G .walkOf v) .vertices() ) assume x in (G .walkOf v) .vertices() ; ::_thesis: x in {v} then consider n being odd Element of NAT such that A2: n <= len (G .walkOf v) and A3: (G .walkOf v) . n = x by Lm45; A4: 1 <= n by ABIAN:12; n <= 1 by A2, Th13; then x = (G .walkOf v) . 1 by A3, A4, XXREAL_0:1; then x = v by Th13; hence x in {v} by TARSKI:def_1; ::_thesis: verum end; assume x in {v} ; ::_thesis: x in (G .walkOf v) .vertices() then A5: x = v by TARSKI:def_1; (G .walkOf v) . 1 = v by Th13; hence x in (G .walkOf v) .vertices() by A5, A1, Lm45, JORDAN12:2; ::_thesis: verum end; hence (G .walkOf v) .vertices() = {v} by TARSKI:1; ::_thesis: verum end; theorem Th91: :: GLIB_001:91 for G being _Graph for e, x, y being set st e Joins x,y,G holds (G .walkOf (x,e,y)) .vertices() = {x,y} proof let G be _Graph; ::_thesis: for e, x, y being set st e Joins x,y,G holds (G .walkOf (x,e,y)) .vertices() = {x,y} let e, x, y be set ; ::_thesis: ( e Joins x,y,G implies (G .walkOf (x,e,y)) .vertices() = {x,y} ) set W = G .walkOf (x,e,y); assume e Joins x,y,G ; ::_thesis: (G .walkOf (x,e,y)) .vertices() = {x,y} then (G .walkOf (x,e,y)) .vertexSeq() = <*x,y*> by Th70; hence (G .walkOf (x,e,y)) .vertices() = {x,y} by FINSEQ_2:127; ::_thesis: verum end; theorem :: GLIB_001:92 for G being _Graph for W being Walk of G holds W .vertices() = (W .reverse()) .vertices() proof let G be _Graph; ::_thesis: for W being Walk of G holds W .vertices() = (W .reverse()) .vertices() let W be Walk of G; ::_thesis: W .vertices() = (W .reverse()) .vertices() now__::_thesis:_for_x_being_set_holds_ (_(_x_in_W_.vertices()_implies_x_in_(W_.reverse())_.vertices()_)_&_(_x_in_(W_.reverse())_.vertices()_implies_x_in_W_.vertices()_)_) reconsider lenW = len W as odd Element of NAT ; let x be set ; ::_thesis: ( ( x in W .vertices() implies x in (W .reverse()) .vertices() ) & ( x in (W .reverse()) .vertices() implies x in W .vertices() ) ) hereby ::_thesis: ( x in (W .reverse()) .vertices() implies x in W .vertices() ) reconsider lenW = len W as odd Element of NAT ; assume x in W .vertices() ; ::_thesis: x in (W .reverse()) .vertices() then consider n being odd Element of NAT such that A1: n <= len W and A2: W . n = x by Lm45; A3: (lenW - n) + 1 is odd Element of NAT by A1, FINSEQ_5:1; 1 <= n by ABIAN:12; then A4: n in dom W by A1, FINSEQ_3:25; then n in Seg (len W) by FINSEQ_1:def_3; then (lenW - n) + 1 in Seg (len W) by FINSEQ_5:2; then (lenW - n) + 1 in dom W by FINSEQ_1:def_3; then (lenW - n) + 1 <= len W by FINSEQ_3:25; then A5: (lenW - n) + 1 <= len (W .reverse()) by FINSEQ_5:def_3; (W .reverse()) . (((len W) - n) + 1) = x by A2, A4, Th24; hence x in (W .reverse()) .vertices() by A3, A5, Lm45; ::_thesis: verum end; assume x in (W .reverse()) .vertices() ; ::_thesis: x in W .vertices() then consider n being odd Element of NAT such that A6: n <= len (W .reverse()) and A7: (W .reverse()) . n = x by Lm45; A8: 1 <= n by ABIAN:12; then n in dom (W .reverse()) by A6, FINSEQ_3:25; then A9: W . (((len W) - n) + 1) = x by A7, FINSEQ_5:def_3; A10: n <= len W by A6, FINSEQ_5:def_3; then n in Seg (len W) by A8, FINSEQ_1:1; then (lenW - n) + 1 in Seg (len W) by FINSEQ_5:2; then A11: (lenW - n) + 1 <= len W by FINSEQ_1:1; (lenW - n) + 1 is odd Element of NAT by A10, FINSEQ_5:1; hence x in W .vertices() by A9, A11, Lm45; ::_thesis: verum end; hence W .vertices() = (W .reverse()) .vertices() by TARSKI:1; ::_thesis: verum end; theorem Th93: :: GLIB_001:93 for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds (W1 .append W2) .vertices() = (W1 .vertices()) \/ (W2 .vertices()) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 .last() = W2 .first() holds (W1 .append W2) .vertices() = (W1 .vertices()) \/ (W2 .vertices()) let W1, W2 be Walk of G; ::_thesis: ( W1 .last() = W2 .first() implies (W1 .append W2) .vertices() = (W1 .vertices()) \/ (W2 .vertices()) ) set W = W1 .append W2; assume A1: W1 .last() = W2 .first() ; ::_thesis: (W1 .append W2) .vertices() = (W1 .vertices()) \/ (W2 .vertices()) then A2: W1 .append W2 = W1 ^' W2 by Def10; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_(W1_.append_W2)_.vertices()_implies_x_in_(W1_.vertices())_\/_(W2_.vertices())_)_&_(_x_in_(W1_.vertices())_\/_(W2_.vertices())_implies_x_in_(W1_.append_W2)_.vertices()_)_) let x be set ; ::_thesis: ( ( x in (W1 .append W2) .vertices() implies x in (W1 .vertices()) \/ (W2 .vertices()) ) & ( x in (W1 .vertices()) \/ (W2 .vertices()) implies x in (W1 .append W2) .vertices() ) ) A3: now__::_thesis:_(_x_in_W1_.vertices()_implies_x_in_(W1_.append_W2)_.vertices()_) assume x in W1 .vertices() ; ::_thesis: x in (W1 .append W2) .vertices() then consider n being odd Element of NAT such that A4: n <= len W1 and A5: W1 . n = x by Lm45; 1 <= n by ABIAN:12; then A6: n in dom W1 by A4, FINSEQ_3:25; then n in dom (W1 .append W2) by Lm12; then A7: n <= len (W1 .append W2) by FINSEQ_3:25; (W1 .append W2) . n = x by A5, A6, Lm12; hence x in (W1 .append W2) .vertices() by A7, Lm45; ::_thesis: verum end; hereby ::_thesis: ( x in (W1 .vertices()) \/ (W2 .vertices()) implies x in (W1 .append W2) .vertices() ) assume A8: x in (W1 .append W2) .vertices() ; ::_thesis: x in (W1 .vertices()) \/ (W2 .vertices()) then reconsider v = x as Vertex of G ; consider n being odd Element of NAT such that A9: n <= len (W1 .append W2) and A10: (W1 .append W2) . n = v by A8, Lm45; A11: 1 <= n by ABIAN:12; now__::_thesis:_x_in_(W1_.vertices())_\/_(W2_.vertices()) percases ( n <= len W1 or n > len W1 ) ; supposeA12: n <= len W1 ; ::_thesis: x in (W1 .vertices()) \/ (W2 .vertices()) then n in dom W1 by A11, FINSEQ_3:25; then W1 . n = v by A10, Lm12; then v in W1 .vertices() by A12, Lm45; hence x in (W1 .vertices()) \/ (W2 .vertices()) by XBOOLE_0:def_3; ::_thesis: verum end; supposeA13: n > len W1 ; ::_thesis: x in (W1 .vertices()) \/ (W2 .vertices()) then consider k being Nat such that A14: (len W1) + k = n by NAT_1:10; reconsider k = k as even Element of NAT by A14, ORDINAL1:def_12; k <> 0 by A13, A14; then A15: 0 + 1 <= k by NAT_1:13; ((len W1) + k) + 1 <= (len (W1 .append W2)) + 1 by A9, A14, XREAL_1:7; then (k + 1) + (len W1) <= (len W2) + (len W1) by A1, Lm9; then A16: ((k + 1) + (len W1)) - (len W1) <= ((len W2) + (len W1)) - (len W1) by XREAL_1:13; then A17: W2 .vertexAt (k + 1) in W2 .vertices() by Th89; k < ((len W2) - 1) + 1 by A16, NAT_1:13; then W2 . (k + 1) = v by A2, A10, A14, A15, GRAPH_2:15; then v in W2 .vertices() by A16, A17, Def8; hence x in (W1 .vertices()) \/ (W2 .vertices()) by XBOOLE_0:def_3; ::_thesis: verum end; end; end; hence x in (W1 .vertices()) \/ (W2 .vertices()) ; ::_thesis: verum end; assume A18: x in (W1 .vertices()) \/ (W2 .vertices()) ; ::_thesis: x in (W1 .append W2) .vertices() now__::_thesis:_x_in_(W1_.append_W2)_.vertices() percases ( x in W1 .vertices() or x in W2 .vertices() ) by A18, XBOOLE_0:def_3; suppose x in W1 .vertices() ; ::_thesis: x in (W1 .append W2) .vertices() hence x in (W1 .append W2) .vertices() by A3; ::_thesis: verum end; supposeA19: x in W2 .vertices() ; ::_thesis: x in (W1 .append W2) .vertices() reconsider lenW1 = len W1 as odd Element of NAT ; consider n being odd Element of NAT such that A20: n <= len W2 and A21: W2 . n = x by A19, Lm45; reconsider naa1 = n - 1 as even Element of NAT by ABIAN:12, INT_1:5; A22: naa1 < (len W2) - 0 by A20, XREAL_1:15; then (len W1) + naa1 in dom (W1 .append W2) by A1, Lm13; then A23: lenW1 + naa1 <= len (W1 .append W2) by FINSEQ_3:25; (W1 .append W2) . ((len W1) + naa1) = W2 . (naa1 + 1) by A1, A22, Lm13; hence x in (W1 .append W2) .vertices() by A21, A23, Lm45; ::_thesis: verum end; end; end; hence x in (W1 .append W2) .vertices() ; ::_thesis: verum end; hence (W1 .append W2) .vertices() = (W1 .vertices()) \/ (W2 .vertices()) by TARSKI:1; ::_thesis: verum end; theorem :: GLIB_001:94 for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W holds (W .cut (m,n)) .vertices() c= W .vertices() proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W holds (W .cut (m,n)) .vertices() c= W .vertices() let W be Walk of G; ::_thesis: for m, n being odd Element of NAT st m <= n & n <= len W holds (W .cut (m,n)) .vertices() c= W .vertices() let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n <= len W implies (W .cut (m,n)) .vertices() c= W .vertices() ) set W2 = W .cut (m,n); assume that A1: m <= n and A2: n <= len W ; ::_thesis: (W .cut (m,n)) .vertices() c= W .vertices() now__::_thesis:_for_x_being_set_st_x_in_(W_.cut_(m,n))_.vertices()_holds_ x_in_W_.vertices() let x be set ; ::_thesis: ( x in (W .cut (m,n)) .vertices() implies x in W .vertices() ) assume x in (W .cut (m,n)) .vertices() ; ::_thesis: x in W .vertices() then consider n being odd Element of NAT such that A3: n <= len (W .cut (m,n)) and A4: (W .cut (m,n)) . n = x by Lm45; reconsider naa1 = n - 1 as even Element of NAT by ABIAN:12, INT_1:5; A5: naa1 < (len (W .cut (m,n))) - 0 by A3, XREAL_1:15; then m + naa1 in dom W by A1, A2, Lm15; then A6: m + naa1 <= len W by FINSEQ_3:25; (W .cut (m,n)) . (naa1 + 1) = W . (m + naa1) by A1, A2, A5, Lm15; hence x in W .vertices() by A4, A6, Lm45; ::_thesis: verum end; hence (W .cut (m,n)) .vertices() c= W .vertices() by TARSKI:def_3; ::_thesis: verum end; theorem Th95: :: GLIB_001:95 for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .vertices() = (W .vertices()) \/ {x} proof let G be _Graph; ::_thesis: for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .vertices() = (W .vertices()) \/ {x} let W be Walk of G; ::_thesis: for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .vertices() = (W .vertices()) \/ {x} let e, x be set ; ::_thesis: ( e Joins W .last() ,x,G implies (W .addEdge e) .vertices() = (W .vertices()) \/ {x} ) set W2 = G .walkOf ((W .last()),e,((W .last()) .adj e)); set W3 = W .addEdge e; set WV = W .vertices() ; assume A1: e Joins W .last() ,x,G ; ::_thesis: (W .addEdge e) .vertices() = (W .vertices()) \/ {x} then reconsider x9 = x as Vertex of G by GLIB_000:13; A2: (W .last()) .adj e = x9 by A1, GLIB_000:66; then (G .walkOf ((W .last()),e,((W .last()) .adj e))) .first() = W .last() by A1, Th15; then A3: (W .addEdge e) .vertices() = (W .vertices()) \/ ((G .walkOf ((W .last()),e,((W .last()) .adj e))) .vertices()) by Th93; A4: now__::_thesis:_for_y_being_set_holds_ (_(_y_in_(W_.vertices())_\/_{(W_.last()),x}_implies_y_in_(W_.vertices())_\/_{x}_)_&_(_y_in_(W_.vertices())_\/_{x}_implies_y_in_(W_.vertices())_\/_{(W_.last()),x}_)_) let y be set ; ::_thesis: ( ( y in (W .vertices()) \/ {(W .last()),x} implies y in (W .vertices()) \/ {x} ) & ( y in (W .vertices()) \/ {x} implies y in (W .vertices()) \/ {(W .last()),x} ) ) hereby ::_thesis: ( y in (W .vertices()) \/ {x} implies y in (W .vertices()) \/ {(W .last()),x} ) assume A5: y in (W .vertices()) \/ {(W .last()),x} ; ::_thesis: y in (W .vertices()) \/ {x} now__::_thesis:_y_in_(W_.vertices())_\/_{x} percases ( y in W .vertices() or y in {(W .last()),x} ) by A5, XBOOLE_0:def_3; suppose y in W .vertices() ; ::_thesis: y in (W .vertices()) \/ {x} hence y in (W .vertices()) \/ {x} by XBOOLE_0:def_3; ::_thesis: verum end; supposeA6: y in {(W .last()),x} ; ::_thesis: y in (W .vertices()) \/ {x} now__::_thesis:_y_in_(W_.vertices())_\/_{x} percases ( y = W .last() or y = x ) by A6, TARSKI:def_2; suppose y = W .last() ; ::_thesis: y in (W .vertices()) \/ {x} then y in W .vertices() by Th88; hence y in (W .vertices()) \/ {x} by XBOOLE_0:def_3; ::_thesis: verum end; suppose y = x ; ::_thesis: y in (W .vertices()) \/ {x} then y in {x} by TARSKI:def_1; hence y in (W .vertices()) \/ {x} by XBOOLE_0:def_3; ::_thesis: verum end; end; end; hence y in (W .vertices()) \/ {x} ; ::_thesis: verum end; end; end; hence y in (W .vertices()) \/ {x} ; ::_thesis: verum end; assume A7: y in (W .vertices()) \/ {x} ; ::_thesis: y in (W .vertices()) \/ {(W .last()),x} now__::_thesis:_y_in_(W_.vertices())_\/_{(W_.last()),x} percases ( y in W .vertices() or y in {x} ) by A7, XBOOLE_0:def_3; suppose y in W .vertices() ; ::_thesis: y in (W .vertices()) \/ {(W .last()),x} hence y in (W .vertices()) \/ {(W .last()),x} by XBOOLE_0:def_3; ::_thesis: verum end; suppose y in {x} ; ::_thesis: y in (W .vertices()) \/ {(W .last()),x} then y = x by TARSKI:def_1; then y in {(W .last()),x} by TARSKI:def_2; hence y in (W .vertices()) \/ {(W .last()),x} by XBOOLE_0:def_3; ::_thesis: verum end; end; end; hence y in (W .vertices()) \/ {(W .last()),x} ; ::_thesis: verum end; (G .walkOf ((W .last()),e,((W .last()) .adj e))) .vertices() = {(W .last()),x} by A1, A2, Th91; hence (W .addEdge e) .vertices() = (W .vertices()) \/ {x} by A3, A4, TARSKI:1; ::_thesis: verum end; theorem :: GLIB_001:96 for G being finite _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G & not x in W .vertices() holds card ((W .addEdge e) .vertices()) = (card (W .vertices())) + 1 proof let G be finite _Graph; ::_thesis: for W being Walk of G for e, x being set st e Joins W .last() ,x,G & not x in W .vertices() holds card ((W .addEdge e) .vertices()) = (card (W .vertices())) + 1 let W be Walk of G; ::_thesis: for e, x being set st e Joins W .last() ,x,G & not x in W .vertices() holds card ((W .addEdge e) .vertices()) = (card (W .vertices())) + 1 let e, x be set ; ::_thesis: ( e Joins W .last() ,x,G & not x in W .vertices() implies card ((W .addEdge e) .vertices()) = (card (W .vertices())) + 1 ) assume that A1: e Joins W .last() ,x,G and A2: not x in W .vertices() ; ::_thesis: card ((W .addEdge e) .vertices()) = (card (W .vertices())) + 1 card ((W .addEdge e) .vertices()) = card ((W .vertices()) \/ {x}) by A1, Th95; hence card ((W .addEdge e) .vertices()) = (card (W .vertices())) + 1 by A2, CARD_2:41; ::_thesis: verum end; theorem :: GLIB_001:97 for G being _Graph for W being Walk of G for x, y being set st x in W .vertices() & y in W .vertices() holds ex W9 being Walk of G st W9 is_Walk_from x,y proof let G be _Graph; ::_thesis: for W being Walk of G for x, y being set st x in W .vertices() & y in W .vertices() holds ex W9 being Walk of G st W9 is_Walk_from x,y let W be Walk of G; ::_thesis: for x, y being set st x in W .vertices() & y in W .vertices() holds ex W9 being Walk of G st W9 is_Walk_from x,y let x, y be set ; ::_thesis: ( x in W .vertices() & y in W .vertices() implies ex W9 being Walk of G st W9 is_Walk_from x,y ) assume that A1: x in W .vertices() and A2: y in W .vertices() ; ::_thesis: ex W9 being Walk of G st W9 is_Walk_from x,y consider m being odd Element of NAT such that A3: m <= len W and A4: W . m = x by A1, Lm45; consider n being odd Element of NAT such that A5: n <= len W and A6: W . n = y by A2, Lm45; now__::_thesis:_ex_W9_being_Walk_of_G_st_W9_is_Walk_from_x,y percases ( m <= n or n <= m ) ; suppose m <= n ; ::_thesis: ex W9 being Walk of G st W9 is_Walk_from x,y then W .cut (m,n) is_Walk_from x,y by A4, A5, A6, Lm16; hence ex W9 being Walk of G st W9 is_Walk_from x,y ; ::_thesis: verum end; suppose n <= m ; ::_thesis: ex W9 being Walk of G st W9 is_Walk_from x,y then W .cut (n,m) is_Walk_from y,x by A3, A4, A6, Lm16; then (W .cut (n,m)) .reverse() is_Walk_from x,y by Th23; hence ex W9 being Walk of G st W9 is_Walk_from x,y ; ::_thesis: verum end; end; end; hence ex W9 being Walk of G st W9 is_Walk_from x,y ; ::_thesis: verum end; theorem :: GLIB_001:98 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds W1 .vertices() = W2 .vertices() by Th76; theorem :: GLIB_001:99 for G being _Graph for W being Walk of G for e being set holds ( e in W .edges() iff ex n being even Element of NAT st ( 1 <= n & n <= len W & W . n = e ) ) by Lm46; theorem Th100: :: GLIB_001:100 for G being _Graph for W being Walk of G for e being set holds ( e in W .edges() iff ex n being odd Element of NAT st ( n < len W & W . (n + 1) = e ) ) proof let G be _Graph; ::_thesis: for W being Walk of G for e being set holds ( e in W .edges() iff ex n being odd Element of NAT st ( n < len W & W . (n + 1) = e ) ) let W be Walk of G; ::_thesis: for e being set holds ( e in W .edges() iff ex n being odd Element of NAT st ( n < len W & W . (n + 1) = e ) ) let e be set ; ::_thesis: ( e in W .edges() iff ex n being odd Element of NAT st ( n < len W & W . (n + 1) = e ) ) hereby ::_thesis: ( ex n being odd Element of NAT st ( n < len W & W . (n + 1) = e ) implies e in W .edges() ) assume e in W .edges() ; ::_thesis: ex n being odd Element of NAT st ( n < len W & W . (n + 1) = e ) then consider n1 being even Element of NAT such that A1: 1 <= n1 and A2: n1 <= len W and A3: W . n1 = e by Lm46; reconsider n = n1 - 1 as odd Element of NAT by A1, INT_1:5; take n = n; ::_thesis: ( n < len W & W . (n + 1) = e ) n1 - 1 < (len W) - 0 by A2, XREAL_1:15; hence n < len W ; ::_thesis: W . (n + 1) = e thus W . (n + 1) = e by A3; ::_thesis: verum end; given n being odd Element of NAT such that A4: n < len W and A5: W . (n + 1) = e ; ::_thesis: e in W .edges() A6: 1 <= n + 1 by NAT_1:12; n + 1 <= len W by A4, NAT_1:13; hence e in W .edges() by A5, A6, Lm46; ::_thesis: verum end; theorem Th101: :: GLIB_001:101 for G being _Graph for W being Walk of G holds rng W = (W .vertices()) \/ (W .edges()) proof let G be _Graph; ::_thesis: for W being Walk of G holds rng W = (W .vertices()) \/ (W .edges()) let W be Walk of G; ::_thesis: rng W = (W .vertices()) \/ (W .edges()) now__::_thesis:_for_y_being_set_st_y_in_(W_.vertices())_\/_(W_.edges())_holds_ y_in_rng_W let y be set ; ::_thesis: ( y in (W .vertices()) \/ (W .edges()) implies y in rng W ) assume A1: y in (W .vertices()) \/ (W .edges()) ; ::_thesis: y in rng W now__::_thesis:_y_in_rng_W percases ( y in W .vertices() or y in W .edges() ) by A1, XBOOLE_0:def_3; suppose y in W .vertices() ; ::_thesis: y in rng W then consider x being odd Element of NAT such that A2: x <= len W and A3: W . x = y by Lm45; 1 <= x by ABIAN:12; then x in dom W by A2, FINSEQ_3:25; hence y in rng W by A3, FUNCT_1:def_3; ::_thesis: verum end; suppose y in W .edges() ; ::_thesis: y in rng W then consider x being even Element of NAT such that A4: 1 <= x and A5: x <= len W and A6: W . x = y by Lm46; x in dom W by A4, A5, FINSEQ_3:25; hence y in rng W by A6, FUNCT_1:def_3; ::_thesis: verum end; end; end; hence y in rng W ; ::_thesis: verum end; then A7: (W .vertices()) \/ (W .edges()) c= rng W by TARSKI:def_3; now__::_thesis:_for_y_being_set_st_y_in_rng_W_holds_ y_in_(W_.vertices())_\/_(W_.edges()) let y be set ; ::_thesis: ( y in rng W implies y in (W .vertices()) \/ (W .edges()) ) assume y in rng W ; ::_thesis: y in (W .vertices()) \/ (W .edges()) then consider x being Nat such that A8: x in dom W and A9: W . x = y by FINSEQ_2:10; A10: x <= len W by A8, FINSEQ_3:25; A11: 1 <= x by A8, FINSEQ_3:25; now__::_thesis:_y_in_(W_.vertices())_\/_(W_.edges()) percases ( x is odd or x is even ) ; suppose x is odd ; ::_thesis: y in (W .vertices()) \/ (W .edges()) then y in W .vertices() by A8, A9, A10, Lm45; hence y in (W .vertices()) \/ (W .edges()) by XBOOLE_0:def_3; ::_thesis: verum end; suppose x is even ; ::_thesis: y in (W .vertices()) \/ (W .edges()) then y in W .edges() by A8, A9, A11, A10, Lm46; hence y in (W .vertices()) \/ (W .edges()) by XBOOLE_0:def_3; ::_thesis: verum end; end; end; hence y in (W .vertices()) \/ (W .edges()) ; ::_thesis: verum end; then rng W c= (W .vertices()) \/ (W .edges()) by TARSKI:def_3; hence rng W = (W .vertices()) \/ (W .edges()) by A7, XBOOLE_0:def_10; ::_thesis: verum end; theorem Th102: :: GLIB_001:102 for G being _Graph for W1, W2 being Walk of G st W1 .last() = W2 .first() holds (W1 .append W2) .edges() = (W1 .edges()) \/ (W2 .edges()) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 .last() = W2 .first() holds (W1 .append W2) .edges() = (W1 .edges()) \/ (W2 .edges()) let W1, W2 be Walk of G; ::_thesis: ( W1 .last() = W2 .first() implies (W1 .append W2) .edges() = (W1 .edges()) \/ (W2 .edges()) ) set W = W1 .append W2; set WE = (W1 .append W2) .edges() ; set W1E = W1 .edges() ; set W2E = W2 .edges() ; set lenW1 = len W1; set lenW2 = len W2; reconsider lenW1 = len W1, lenW2 = len W2 as odd Element of NAT ; assume A1: W1 .last() = W2 .first() ; ::_thesis: (W1 .append W2) .edges() = (W1 .edges()) \/ (W2 .edges()) then A2: W1 .append W2 = W1 ^' W2 by Def10; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_(W1_.append_W2)_.edges()_implies_x_in_(W1_.edges())_\/_(W2_.edges())_)_&_(_x_in_(W1_.edges())_\/_(W2_.edges())_implies_x_in_(W1_.append_W2)_.edges()_)_) let x be set ; ::_thesis: ( ( x in (W1 .append W2) .edges() implies x in (W1 .edges()) \/ (W2 .edges()) ) & ( x in (W1 .edges()) \/ (W2 .edges()) implies x in (W1 .append W2) .edges() ) ) hereby ::_thesis: ( x in (W1 .edges()) \/ (W2 .edges()) implies x in (W1 .append W2) .edges() ) assume x in (W1 .append W2) .edges() ; ::_thesis: x in (W1 .edges()) \/ (W2 .edges()) then consider n being even Element of NAT such that A3: 1 <= n and A4: n <= len (W1 .append W2) and A5: (W1 .append W2) . n = x by Lm46; now__::_thesis:_x_in_(W1_.edges())_\/_(W2_.edges()) percases ( n <= len W1 or len W1 < n ) ; supposeA6: n <= len W1 ; ::_thesis: x in (W1 .edges()) \/ (W2 .edges()) then (W1 .append W2) . n = W1 . n by A2, A3, GRAPH_2:14; then x in W1 .edges() by A3, A5, A6, Lm46; hence x in (W1 .edges()) \/ (W2 .edges()) by XBOOLE_0:def_3; ::_thesis: verum end; suppose len W1 < n ; ::_thesis: x in (W1 .edges()) \/ (W2 .edges()) then reconsider k = n - lenW1 as odd Element of NAT by INT_1:5; A7: 1 <= k + 1 by NAT_1:12; (n - lenW1) + (len W1) < (len (W1 .append W2)) + 1 by A4, NAT_1:13; then (n - lenW1) + lenW1 < lenW2 + (len W1) by A1, Lm9; then A8: k < (lenW2 + (len W1)) - (len W1) by XREAL_1:14; then A9: k + 1 <= len W2 by NAT_1:13; W2 . (k + 1) = (W1 .append W2) . ((len W1) + k) by A2, A8, ABIAN:12, GRAPH_2:15 .= x by A5 ; then x in W2 .edges() by A7, A9, Lm46; hence x in (W1 .edges()) \/ (W2 .edges()) by XBOOLE_0:def_3; ::_thesis: verum end; end; end; hence x in (W1 .edges()) \/ (W2 .edges()) ; ::_thesis: verum end; assume A10: x in (W1 .edges()) \/ (W2 .edges()) ; ::_thesis: x in (W1 .append W2) .edges() now__::_thesis:_x_in_(W1_.append_W2)_.edges() percases ( x in W1 .edges() or x in W2 .edges() ) by A10, XBOOLE_0:def_3; suppose x in W1 .edges() ; ::_thesis: x in (W1 .append W2) .edges() then consider n being even Element of NAT such that A11: 1 <= n and A12: n <= len W1 and A13: W1 . n = x by Lm46; len W1 <= len (W1 .append W2) by A1, Lm10; then A14: n <= len (W1 .append W2) by A12, XXREAL_0:2; (W1 .append W2) . n = x by A2, A11, A12, A13, GRAPH_2:14; hence x in (W1 .append W2) .edges() by A11, A14, Lm46; ::_thesis: verum end; suppose x in W2 .edges() ; ::_thesis: x in (W1 .append W2) .edges() then consider n being even Element of NAT such that A15: 1 <= n and A16: n <= len W2 and A17: W2 . n = x by Lm46; reconsider naa1 = n - 1 as odd Element of NAT by A15, INT_1:5; naa1 < len W2 by A16, XREAL_1:147; then A18: (W1 .append W2) . (lenW1 + naa1) = W2 . (naa1 + 1) by A2, ABIAN:12, GRAPH_2:15 .= x by A17 ; (naa1 + 1) + lenW1 <= (len W2) + (len W1) by A16, XREAL_1:7; then (lenW1 + naa1) + 1 <= (len (W1 .append W2)) + 1 by A1, Lm9; then A19: lenW1 + naa1 <= len (W1 .append W2) by XREAL_1:6; 1 <= lenW1 + naa1 by ABIAN:12, NAT_1:12; hence x in (W1 .append W2) .edges() by A18, A19, Lm46; ::_thesis: verum end; end; end; hence x in (W1 .append W2) .edges() ; ::_thesis: verum end; hence (W1 .append W2) .edges() = (W1 .edges()) \/ (W2 .edges()) by TARSKI:1; ::_thesis: verum end; theorem :: GLIB_001:103 for G being _Graph for W being Walk of G for e being set st e in W .edges() holds ex v1, v2 being Vertex of G ex n being odd Element of NAT st ( n + 2 <= len W & v1 = W . n & e = W . (n + 1) & v2 = W . (n + 2) & e Joins v1,v2,G ) by Lm47; theorem Th104: :: GLIB_001:104 for G being _Graph for W being Walk of G for e being set holds ( e in W .edges() iff ex n being Element of NAT st ( n in dom (W .edgeSeq()) & (W .edgeSeq()) . n = e ) ) proof let G be _Graph; ::_thesis: for W being Walk of G for e being set holds ( e in W .edges() iff ex n being Element of NAT st ( n in dom (W .edgeSeq()) & (W .edgeSeq()) . n = e ) ) let W be Walk of G; ::_thesis: for e being set holds ( e in W .edges() iff ex n being Element of NAT st ( n in dom (W .edgeSeq()) & (W .edgeSeq()) . n = e ) ) let e be set ; ::_thesis: ( e in W .edges() iff ex n being Element of NAT st ( n in dom (W .edgeSeq()) & (W .edgeSeq()) . n = e ) ) hereby ::_thesis: ( ex n being Element of NAT st ( n in dom (W .edgeSeq()) & (W .edgeSeq()) . n = e ) implies e in W .edges() ) assume e in W .edges() ; ::_thesis: ex n being Element of NAT st ( n in dom (W .edgeSeq()) & (W .edgeSeq()) . n = e ) then consider n being set such that A1: n in dom (W .edgeSeq()) and A2: (W .edgeSeq()) . n = e by FUNCT_1:def_3; reconsider n = n as Element of NAT by A1; take n = n; ::_thesis: ( n in dom (W .edgeSeq()) & (W .edgeSeq()) . n = e ) thus ( n in dom (W .edgeSeq()) & (W .edgeSeq()) . n = e ) by A1, A2; ::_thesis: verum end; given n being Element of NAT such that A3: n in dom (W .edgeSeq()) and A4: (W .edgeSeq()) . n = e ; ::_thesis: e in W .edges() thus e in W .edges() by A3, A4, FUNCT_1:def_3; ::_thesis: verum end; theorem :: GLIB_001:105 for G being _Graph for W being Walk of G for e, x, y being set st e in W .edges() & e Joins x,y,G holds ( x in W .vertices() & y in W .vertices() ) by Lm48; theorem :: GLIB_001:106 for G being _Graph for W being Walk of G for m, n being Element of NAT holds (W .cut (m,n)) .edges() c= W .edges() proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being Element of NAT holds (W .cut (m,n)) .edges() c= W .edges() let W be Walk of G; ::_thesis: for m, n being Element of NAT holds (W .cut (m,n)) .edges() c= W .edges() let m, n be Element of NAT ; ::_thesis: (W .cut (m,n)) .edges() c= W .edges() now__::_thesis:_(W_.cut_(m,n))_.edges()_c=_W_.edges() percases ( ( m is odd & n is odd & m <= n & n <= len W ) or not m is odd or not n is odd or not m <= n or not n <= len W ) ; supposeA1: ( m is odd & n is odd & m <= n & n <= len W ) ; ::_thesis: (W .cut (m,n)) .edges() c= W .edges() then reconsider m9 = m as odd Element of NAT ; now__::_thesis:_for_e_being_set_st_e_in_(W_.cut_(m,n))_.edges()_holds_ e_in_W_.edges() let e be set ; ::_thesis: ( e in (W .cut (m,n)) .edges() implies e in W .edges() ) assume e in (W .cut (m,n)) .edges() ; ::_thesis: e in W .edges() then consider x being even Element of NAT such that A2: 1 <= x and A3: x <= len (W .cut (m,n)) and A4: (W .cut (m,n)) . x = e by Lm46; reconsider xaa1 = x - 1 as odd Element of NAT by A2, INT_1:5; A5: xaa1 < (len (W .cut (m,n))) - 0 by A3, XREAL_1:15; then A6: m + xaa1 in dom W by A1, Lm15; then A7: m9 + xaa1 <= len W by FINSEQ_3:25; xaa1 + 1 = x ; then A8: e = W . (m + xaa1) by A1, A4, A5, Lm15; 1 <= m9 + xaa1 by A6, FINSEQ_3:25; hence e in W .edges() by A8, A7, Lm46; ::_thesis: verum end; hence (W .cut (m,n)) .edges() c= W .edges() by TARSKI:def_3; ::_thesis: verum end; suppose ( not m is odd or not n is odd or not m <= n or not n <= len W ) ; ::_thesis: (W .cut (m,n)) .edges() c= W .edges() hence (W .cut (m,n)) .edges() c= W .edges() by Def11; ::_thesis: verum end; end; end; hence (W .cut (m,n)) .edges() c= W .edges() ; ::_thesis: verum end; theorem Th107: :: GLIB_001:107 for G being _Graph for W being Walk of G holds W .edges() = (W .reverse()) .edges() proof let G be _Graph; ::_thesis: for W being Walk of G holds W .edges() = (W .reverse()) .edges() let W be Walk of G; ::_thesis: W .edges() = (W .reverse()) .edges() now__::_thesis:_for_e_being_set_holds_ (_(_e_in_W_.edges()_implies_e_in_(W_.reverse())_.edges()_)_&_(_e_in_(W_.reverse())_.edges()_implies_e_in_W_.edges()_)_) let e be set ; ::_thesis: ( ( e in W .edges() implies e in (W .reverse()) .edges() ) & ( e in (W .reverse()) .edges() implies e in W .edges() ) ) hereby ::_thesis: ( e in (W .reverse()) .edges() implies e in W .edges() ) assume e in W .edges() ; ::_thesis: e in (W .reverse()) .edges() then consider n being even Element of NAT such that A1: 1 <= n and A2: n <= len W and A3: W . n = e by Lm46; A4: n in dom W by A1, A2, FINSEQ_3:25; then A5: ((len W) - n) + 1 in dom (W .reverse()) by Th24; then reconsider rn = ((len W) - n) + 1 as even Element of NAT ; A6: 1 <= rn by A5, FINSEQ_3:25; A7: rn <= len (W .reverse()) by A5, FINSEQ_3:25; e = (W .reverse()) . (((len W) - n) + 1) by A3, A4, Th24; hence e in (W .reverse()) .edges() by A6, A7, Lm46; ::_thesis: verum end; assume e in (W .reverse()) .edges() ; ::_thesis: e in W .edges() then consider n being even Element of NAT such that A8: 1 <= n and A9: n <= len (W .reverse()) and A10: (W .reverse()) . n = e by Lm46; A11: n in dom (W .reverse()) by A8, A9, FINSEQ_3:25; then A12: ((len (W .reverse())) - n) + 1 in dom ((W .reverse()) .reverse()) by Th24; then reconsider rn = ((len (W .reverse())) - n) + 1 as even Element of NAT ; e = ((W .reverse()) .reverse()) . (((len (W .reverse())) - n) + 1) by A10, A11, Th24; then A13: e = W . rn ; rn in dom W by A12; then A14: rn <= len W by FINSEQ_3:25; 1 <= rn by A12, FINSEQ_3:25; hence e in W .edges() by A13, A14, Lm46; ::_thesis: verum end; hence W .edges() = (W .reverse()) .edges() by TARSKI:1; ::_thesis: verum end; theorem Th108: :: GLIB_001:108 for G being _Graph for e, x, y being set holds ( e Joins x,y,G iff (G .walkOf (x,e,y)) .edges() = {e} ) proof let G be _Graph; ::_thesis: for e, x, y being set holds ( e Joins x,y,G iff (G .walkOf (x,e,y)) .edges() = {e} ) let e, x, y be set ; ::_thesis: ( e Joins x,y,G iff (G .walkOf (x,e,y)) .edges() = {e} ) set W = G .walkOf (x,e,y); hereby ::_thesis: ( (G .walkOf (x,e,y)) .edges() = {e} implies e Joins x,y,G ) assume e Joins x,y,G ; ::_thesis: (G .walkOf (x,e,y)) .edges() = {e} then (G .walkOf (x,e,y)) .edgeSeq() = <*e*> by Th83; hence (G .walkOf (x,e,y)) .edges() = {e} by FINSEQ_1:39; ::_thesis: verum end; assume (G .walkOf (x,e,y)) .edges() = {e} ; ::_thesis: e Joins x,y,G then e in (G .walkOf (x,e,y)) .edges() by TARSKI:def_1; then consider n being even Element of NAT such that A1: 1 <= n and A2: n <= len (G .walkOf (x,e,y)) and (G .walkOf (x,e,y)) . n = e by Lm46; A3: (2 * 0) + 1 < n by A1, XXREAL_0:1; now__::_thesis:_e_Joins_x,y,G assume not e Joins x,y,G ; ::_thesis: contradiction then G .walkOf (x,e,y) = G .walkOf (choose (the_Vertices_of G)) by Def5; hence contradiction by A2, A3, Th13; ::_thesis: verum end; hence e Joins x,y,G ; ::_thesis: verum end; theorem :: GLIB_001:109 for G being _Graph for W being Walk of G holds W .edges() c= G .edgesBetween (W .vertices()) proof let G be _Graph; ::_thesis: for W being Walk of G holds W .edges() c= G .edgesBetween (W .vertices()) let W be Walk of G; ::_thesis: W .edges() c= G .edgesBetween (W .vertices()) now__::_thesis:_for_e_being_set_st_e_in_W_.edges()_holds_ e_in_G_.edgesBetween_(W_.vertices()) let e be set ; ::_thesis: ( e in W .edges() implies e in G .edgesBetween (W .vertices()) ) assume e in W .edges() ; ::_thesis: e in G .edgesBetween (W .vertices()) then consider v1, v2 being Vertex of G, n being odd Element of NAT such that A1: n + 2 <= len W and A2: v1 = W . n and e = W . (n + 1) and A3: v2 = W . (n + 2) and A4: e Joins v1,v2,G by Lm47; n < len W by A1, Th1; then A5: v1 in W .vertices() by A2, Lm45; v2 in W .vertices() by A1, A3, Lm45; hence e in G .edgesBetween (W .vertices()) by A4, A5, GLIB_000:32; ::_thesis: verum end; hence W .edges() c= G .edgesBetween (W .vertices()) by TARSKI:def_3; ::_thesis: verum end; theorem :: GLIB_001:110 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds W1 .edges() = W2 .edges() by Th86; theorem :: GLIB_001:111 for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .edges() = (W .edges()) \/ {e} proof let G be _Graph; ::_thesis: for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .edges() = (W .edges()) \/ {e} let W be Walk of G; ::_thesis: for e, x being set st e Joins W .last() ,x,G holds (W .addEdge e) .edges() = (W .edges()) \/ {e} let e, x be set ; ::_thesis: ( e Joins W .last() ,x,G implies (W .addEdge e) .edges() = (W .edges()) \/ {e} ) set WB = G .walkOf ((W .last()),e,((W .last()) .adj e)); assume e Joins W .last() ,x,G ; ::_thesis: (W .addEdge e) .edges() = (W .edges()) \/ {e} then e in (W .last()) .edgesInOut() by GLIB_000:62; then A1: e Joins W .last() ,(W .last()) .adj e,G by GLIB_000:67; then A2: (G .walkOf ((W .last()),e,((W .last()) .adj e))) .first() = W .last() by Th15; (G .walkOf ((W .last()),e,((W .last()) .adj e))) .edges() = {e} by A1, Th108; hence (W .addEdge e) .edges() = (W .edges()) \/ {e} by A2, Th102; ::_thesis: verum end; theorem :: GLIB_001:112 for G being _Graph for W being Walk of G holds len W = (2 * (W .length())) + 1 by Def15; theorem :: GLIB_001:113 for G being _Graph for W1, W2 being Walk of G holds ( len W1 = len W2 iff W1 .length() = W2 .length() ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G holds ( len W1 = len W2 iff W1 .length() = W2 .length() ) let W1, W2 be Walk of G; ::_thesis: ( len W1 = len W2 iff W1 .length() = W2 .length() ) hereby ::_thesis: ( W1 .length() = W2 .length() implies len W1 = len W2 ) assume len W1 = len W2 ; ::_thesis: W1 .length() = W2 .length() then (2 * (W1 .length())) + 1 = len W2 by Def15 .= (2 * (W2 .length())) + 1 by Def15 ; hence W1 .length() = W2 .length() ; ::_thesis: verum end; assume W1 .length() = W2 .length() ; ::_thesis: len W1 = len W2 hence len W1 = (2 * (W2 .length())) + 1 by Def15 .= len W2 by Def15 ; ::_thesis: verum end; theorem :: GLIB_001:114 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds W1 .length() = W2 .length() by Th86; theorem Th115: :: GLIB_001:115 for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds ( W .find (W . n) <= n & W .rfind (W . n) >= n ) proof let G be _Graph; ::_thesis: for W being Walk of G for n being odd Element of NAT st n <= len W holds ( W .find (W . n) <= n & W .rfind (W . n) >= n ) let W be Walk of G; ::_thesis: for n being odd Element of NAT st n <= len W holds ( W .find (W . n) <= n & W .rfind (W . n) >= n ) let n be odd Element of NAT ; ::_thesis: ( n <= len W implies ( W .find (W . n) <= n & W .rfind (W . n) >= n ) ) assume A1: n <= len W ; ::_thesis: ( W .find (W . n) <= n & W .rfind (W . n) >= n ) then A2: W . n in W .vertices() by Lm45; hence W .find (W . n) <= n by A1, Def19; ::_thesis: W .rfind (W . n) >= n thus W .rfind (W . n) >= n by A1, A2, Def21; ::_thesis: verum end; theorem :: GLIB_001:116 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 for v being set st W1 = W2 holds ( W1 .find v = W2 .find v & W1 .rfind v = W2 .rfind v ) proof let G1, G2 be _Graph; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 for v being set st W1 = W2 holds ( W1 .find v = W2 .find v & W1 .rfind v = W2 .rfind v ) let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 for v being set st W1 = W2 holds ( W1 .find v = W2 .find v & W1 .rfind v = W2 .rfind v ) let W2 be Walk of G2; ::_thesis: for v being set st W1 = W2 holds ( W1 .find v = W2 .find v & W1 .rfind v = W2 .rfind v ) let v be set ; ::_thesis: ( W1 = W2 implies ( W1 .find v = W2 .find v & W1 .rfind v = W2 .rfind v ) ) assume A1: W1 = W2 ; ::_thesis: ( W1 .find v = W2 .find v & W1 .rfind v = W2 .rfind v ) now__::_thesis:_(_W1_.find_v_=_W2_.find_v_&_W1_.rfind_v_=_W2_.rfind_v_) percases ( v in W1 .vertices() or not v in W1 .vertices() ) ; supposeA2: v in W1 .vertices() ; ::_thesis: ( W1 .find v = W2 .find v & W1 .rfind v = W2 .rfind v ) then A3: W2 . (W1 .find v) = v by A1, Def19; A4: v in W2 .vertices() by A1, A2, Th76; A5: for n being odd Nat st n <= len W2 & W2 . n = v holds W1 .find v <= n by A1, A2, Def19; W1 .find v <= len W2 by A1, A2, Def19; hence W1 .find v = W2 .find v by A4, A3, A5, Def19; ::_thesis: W1 .rfind v = W2 .rfind v A6: W2 . (W1 .rfind v) = v by A1, A2, Def21; A7: for n being odd Element of NAT st n <= len W2 & W2 . n = v holds n <= W1 .rfind v by A1, A2, Def21; W1 .rfind v <= len W2 by A1, A2, Def21; hence W1 .rfind v = W2 .rfind v by A4, A6, A7, Def21; ::_thesis: verum end; supposeA8: not v in W1 .vertices() ; ::_thesis: ( W1 .find v = W2 .find v & W1 .rfind v = W2 .rfind v ) then A9: not v in W2 .vertices() by A1, Th76; thus W1 .find v = len W2 by A1, A8, Def19 .= W2 .find v by A9, Def19 ; ::_thesis: W1 .rfind v = W2 .rfind v thus W1 .rfind v = len W2 by A1, A8, Def21 .= W2 .rfind v by A9, Def21 ; ::_thesis: verum end; end; end; hence ( W1 .find v = W2 .find v & W1 .rfind v = W2 .rfind v ) ; ::_thesis: verum end; theorem :: GLIB_001:117 for G being _Graph for W being Walk of G for n being odd Element of NAT st n <= len W holds ( W .find n <= n & W .rfind n >= n ) by Lm49, Lm50; theorem Th118: :: GLIB_001:118 for G being _Graph for W being Walk of G holds ( W is closed iff W . 1 = W . (len W) ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W is closed iff W . 1 = W . (len W) ) let W be Walk of G; ::_thesis: ( W is closed iff W . 1 = W . (len W) ) hereby ::_thesis: ( W . 1 = W . (len W) implies W is closed ) assume W is closed ; ::_thesis: W . 1 = W . (len W) then W .first() = W .last() by Def24; hence W . 1 = W . (len W) ; ::_thesis: verum end; assume W . 1 = W . (len W) ; ::_thesis: W is closed then W .first() = W .last() ; hence W is closed by Def24; ::_thesis: verum end; theorem :: GLIB_001:119 for G being _Graph for W being Walk of G holds ( W is closed iff ex x being set st W is_Walk_from x,x ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W is closed iff ex x being set st W is_Walk_from x,x ) let W be Walk of G; ::_thesis: ( W is closed iff ex x being set st W is_Walk_from x,x ) hereby ::_thesis: ( ex x being set st W is_Walk_from x,x implies W is closed ) set x = W .first() ; assume W is closed ; ::_thesis: ex x being set st W is_Walk_from x,x then W .first() = W .last() by Def24; then W is_Walk_from W .first() ,W .first() by Def23; hence ex x being set st W is_Walk_from x,x ; ::_thesis: verum end; given v being set such that A1: W is_Walk_from v,v ; ::_thesis: W is closed A2: W .last() = v by A1, Def23; W .first() = v by A1, Def23; hence W is closed by A2, Def24; ::_thesis: verum end; theorem :: GLIB_001:120 for G being _Graph for W being Walk of G holds ( W is closed iff W .reverse() is closed ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W is closed iff W .reverse() is closed ) let W be Walk of G; ::_thesis: ( W is closed iff W .reverse() is closed ) ( W is closed iff W .first() = W .last() ) by Def24; then ( W is closed iff (W .reverse()) .last() = W .last() ) by Th22; then ( W is closed iff (W .reverse()) .last() = (W .reverse()) .first() ) by Th22; hence ( W is closed iff W .reverse() is closed ) by Def24; ::_thesis: verum end; theorem :: GLIB_001:121 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 & W1 is closed holds W2 is closed proof let G1, G2 be _Graph; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 & W1 is closed holds W2 is closed let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 st W1 = W2 & W1 is closed holds W2 is closed let W2 be Walk of G2; ::_thesis: ( W1 = W2 & W1 is closed implies W2 is closed ) assume that A1: W1 = W2 and A2: W1 is closed ; ::_thesis: W2 is closed W2 . 1 = W2 . (len W2) by A1, A2, Th118; hence W2 is closed by Th118; ::_thesis: verum end; theorem :: GLIB_001:122 for G being _Graph for W being Walk of G holds ( W is directed iff for n being odd Element of NAT st n < len W holds W . (n + 1) DJoins W . n,W . (n + 2),G ) by Lm51; theorem :: GLIB_001:123 for G being _Graph for W being Walk of G for x, y, e, z being set st W is directed & W is_Walk_from x,y & e DJoins y,z,G holds ( W .addEdge e is directed & W .addEdge e is_Walk_from x,z ) by Lm52; theorem :: GLIB_001:124 for G being _Graph for W being DWalk of G for m, n being Element of NAT holds W .cut (m,n) is directed ; theorem :: GLIB_001:125 for G being _Graph for W being Walk of G holds ( not W is trivial iff 3 <= len W ) by Lm54; theorem :: GLIB_001:126 for G being _Graph for W being Walk of G holds ( not W is trivial iff len W <> 1 ) by Lm55; theorem :: GLIB_001:127 for G being _Graph for W being Walk of G st W .first() <> W .last() holds not W is trivial by Lm55; theorem :: GLIB_001:128 for G being _Graph for W being Walk of G holds ( W is trivial iff ex v being Vertex of G st W = G .walkOf v ) by Lm56; theorem :: GLIB_001:129 for G being _Graph for W being Walk of G holds ( W is trivial iff W .reverse() is trivial ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W is trivial iff W .reverse() is trivial ) let W be Walk of G; ::_thesis: ( W is trivial iff W .reverse() is trivial ) thus ( W is trivial implies W .reverse() is trivial ) ; ::_thesis: ( W .reverse() is trivial implies W is trivial ) assume W .reverse() is trivial ; ::_thesis: W is trivial then len (W .reverse()) = 1 by Lm55; then len W = 1 by FINSEQ_5:def_3; hence W is trivial by Lm55; ::_thesis: verum end; theorem :: GLIB_001:130 for G being _Graph for W2, W1 being Walk of G st W2 is trivial holds W1 .append W2 = W1 proof let G be _Graph; ::_thesis: for W2, W1 being Walk of G st W2 is trivial holds W1 .append W2 = W1 let W2, W1 be Walk of G; ::_thesis: ( W2 is trivial implies W1 .append W2 = W1 ) assume W2 is trivial ; ::_thesis: W1 .append W2 = W1 then A1: len W2 = 1 by Lm55; now__::_thesis:_W1_.append_W2_=_W1 percases ( W1 .last() = W2 .first() or W1 .last() <> W2 .first() ) ; suppose W1 .last() = W2 .first() ; ::_thesis: W1 .append W2 = W1 then A2: W1 .append W2 = W1 ^' W2 by Def10; then A3: (len (W1 .append W2)) + 1 = (len W1) + 1 by A1, CARD_1:27, GRAPH_2:13; for k being Nat st 1 <= k & k <= len (W1 .append W2) holds (W1 .append W2) . k = W1 . k proof let k be Nat; ::_thesis: ( 1 <= k & k <= len (W1 .append W2) implies (W1 .append W2) . k = W1 . k ) reconsider k = k as Element of NAT by ORDINAL1:def_12; ( 1 <= k & k <= len (W1 .append W2) implies (W1 .append W2) . k = W1 . k ) by A2, A3, GRAPH_2:14; hence ( 1 <= k & k <= len (W1 .append W2) implies (W1 .append W2) . k = W1 . k ) ; ::_thesis: verum end; hence W1 .append W2 = W1 by A3, FINSEQ_1:14; ::_thesis: verum end; suppose W1 .last() <> W2 .first() ; ::_thesis: W1 .append W2 = W1 hence W1 .append W2 = W1 by Def10; ::_thesis: verum end; end; end; hence W1 .append W2 = W1 ; ::_thesis: verum end; theorem :: GLIB_001:131 for G being _Graph for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W holds ( W .cut (m,n) is trivial iff m = n ) proof let G be _Graph; ::_thesis: for W being Walk of G for m, n being odd Element of NAT st m <= n & n <= len W holds ( W .cut (m,n) is trivial iff m = n ) let W be Walk of G; ::_thesis: for m, n being odd Element of NAT st m <= n & n <= len W holds ( W .cut (m,n) is trivial iff m = n ) let m, n be odd Element of NAT ; ::_thesis: ( m <= n & n <= len W implies ( W .cut (m,n) is trivial iff m = n ) ) assume that A1: m <= n and A2: n <= len W ; ::_thesis: ( W .cut (m,n) is trivial iff m = n ) A3: (len (W .cut (m,n))) + m = n + 1 by A1, A2, Lm15; hereby ::_thesis: ( m = n implies W .cut (m,n) is trivial ) assume W .cut (m,n) is trivial ; ::_thesis: m = n then 1 = (n - m) + 1 by A3, Lm55; hence m = n ; ::_thesis: verum end; assume m = n ; ::_thesis: W .cut (m,n) is trivial hence W .cut (m,n) is trivial by A3, Lm55; ::_thesis: verum end; theorem Th132: :: GLIB_001:132 for G being _Graph for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds not W .addEdge e is trivial proof let G be _Graph; ::_thesis: for W being Walk of G for e, x being set st e Joins W .last() ,x,G holds not W .addEdge e is trivial let W be Walk of G; ::_thesis: for e, x being set st e Joins W .last() ,x,G holds not W .addEdge e is trivial let e, x be set ; ::_thesis: ( e Joins W .last() ,x,G implies not W .addEdge e is trivial ) assume e Joins W .last() ,x,G ; ::_thesis: not W .addEdge e is trivial then A1: len (W .addEdge e) = (len W) + 2 by Lm37; 1 + 0 < (len W) + 2 by XREAL_1:8; hence not W .addEdge e is trivial by A1, Lm55; ::_thesis: verum end; theorem Th133: :: GLIB_001:133 for G being _Graph for W being Walk of G st not W is trivial holds ex lenW2 being odd Element of NAT st ( lenW2 = (len W) - 2 & (W .cut (1,lenW2)) .addEdge (W . (lenW2 + 1)) = W ) proof let G be _Graph; ::_thesis: for W being Walk of G st not W is trivial holds ex lenW2 being odd Element of NAT st ( lenW2 = (len W) - 2 & (W .cut (1,lenW2)) .addEdge (W . (lenW2 + 1)) = W ) let W be Walk of G; ::_thesis: ( not W is trivial implies ex lenW2 being odd Element of NAT st ( lenW2 = (len W) - 2 & (W .cut (1,lenW2)) .addEdge (W . (lenW2 + 1)) = W ) ) set lenW2 = (len W) - (2 * 1); assume not W is trivial ; ::_thesis: ex lenW2 being odd Element of NAT st ( lenW2 = (len W) - 2 & (W .cut (1,lenW2)) .addEdge (W . (lenW2 + 1)) = W ) then len W >= 3 by Lm54; then reconsider lenW2 = (len W) - (2 * 1) as odd Element of NAT by INT_1:5, XXREAL_0:2; set W1 = W .cut (1,lenW2); set e = W . (lenW2 + 1); take lenW2 ; ::_thesis: ( lenW2 = (len W) - 2 & (W .cut (1,lenW2)) .addEdge (W . (lenW2 + 1)) = W ) thus lenW2 = (len W) - 2 ; ::_thesis: (W .cut (1,lenW2)) .addEdge (W . (lenW2 + 1)) = W lenW2 < (len W) - 0 by XREAL_1:15; hence (W .cut (1,lenW2)) .addEdge (W . (lenW2 + 1)) = W .cut (1,(lenW2 + 2)) by Th41, ABIAN:12, JORDAN12:2 .= W by Lm18 ; ::_thesis: verum end; theorem Th134: :: GLIB_001:134 for G being _Graph for W2, W1 being Walk of G st not W2 is trivial & W2 .edges() c= W1 .edges() holds W2 .vertices() c= W1 .vertices() proof let G be _Graph; ::_thesis: for W2, W1 being Walk of G st not W2 is trivial & W2 .edges() c= W1 .edges() holds W2 .vertices() c= W1 .vertices() let W2, W1 be Walk of G; ::_thesis: ( not W2 is trivial & W2 .edges() c= W1 .edges() implies W2 .vertices() c= W1 .vertices() ) assume that A1: not W2 is trivial and A2: W2 .edges() c= W1 .edges() ; ::_thesis: W2 .vertices() c= W1 .vertices() A3: 3 <= len W2 by A1, Lm54; now__::_thesis:_for_v_being_set_st_v_in_W2_.vertices()_holds_ v_in_W1_.vertices() let v be set ; ::_thesis: ( v in W2 .vertices() implies v in W1 .vertices() ) assume v in W2 .vertices() ; ::_thesis: v in W1 .vertices() then consider n being odd Element of NAT such that A4: n <= len W2 and A5: W2 . n = v by Lm45; now__::_thesis:_v_in_W1_.vertices() percases ( n = len W2 or n <> len W2 ) ; suppose n = len W2 ; ::_thesis: v in W1 .vertices() then 3 - 1 < n - 0 by A3, XREAL_1:15; then reconsider n5 = n - (2 * 1) as odd Element of NAT by INT_1:5; A6: 1 <= n5 + 1 by NAT_1:12; n5 < n - 0 by XREAL_1:15; then A7: n5 < len W2 by A4, XXREAL_0:2; then A8: W2 . (n5 + 1) Joins W2 . n5,W2 . (n5 + 2),G by Def3; n5 + 1 <= len W2 by A7, NAT_1:13; then W2 . (n5 + 1) in W2 .edges() by A6, Lm46; then consider m being even Element of NAT such that A9: 1 <= m and A10: m <= len W1 and A11: W1 . m = W2 . (n5 + 1) by A2, Lm46; reconsider maa1 = m - 1 as odd Element of NAT by A9, INT_1:5; A12: maa1 < (len W1) - 0 by A10, XREAL_1:15; then A13: W1 . (maa1 + 1) Joins W1 . maa1,W1 . (maa1 + 2),G by Def3; A14: W1 . maa1 = W1 .vertexAt maa1 by A12, Def8; A15: maa1 + 2 <= len W1 by A12, Th1; then W1 . (maa1 + 2) = W1 .vertexAt (maa1 + 2) by Def8; then ( v = W1 .vertexAt maa1 or v = W1 .vertexAt (maa1 + 2) ) by A5, A8, A11, A13, A14, GLIB_000:15; hence v in W1 .vertices() by A12, A15, Th89; ::_thesis: verum end; suppose n <> len W2 ; ::_thesis: v in W1 .vertices() then A16: n < len W2 by A4, XXREAL_0:1; then W2 . (n + 1) in W2 .edges() by Th100; then consider m being even Element of NAT such that A17: 1 <= m and A18: m <= len W1 and A19: W1 . m = W2 . (n + 1) by A2, Lm46; A20: W1 . m Joins v,W2 . (n + 2),G by A5, A16, A19, Def3; reconsider maa1 = m - 1 as odd Element of NAT by A17, INT_1:5; A21: maa1 < (len W1) - 0 by A18, XREAL_1:15; then A22: W1 . (maa1 + 1) Joins W1 . maa1,W1 . (maa1 + 2),G by Def3; A23: W1 . maa1 = W1 .vertexAt maa1 by A21, Def8; A24: maa1 + 2 <= len W1 by A21, Th1; then W1 . (maa1 + 2) = W1 .vertexAt (maa1 + 2) by Def8; then ( v = W1 .vertexAt maa1 or v = W1 .vertexAt (maa1 + 2) ) by A20, A22, A23, GLIB_000:15; hence v in W1 .vertices() by A21, A24, Th89; ::_thesis: verum end; end; end; hence v in W1 .vertices() ; ::_thesis: verum end; hence W2 .vertices() c= W1 .vertices() by TARSKI:def_3; ::_thesis: verum end; theorem :: GLIB_001:135 for G being _Graph for W being Walk of G st not W is trivial holds for v being Vertex of G st v in W .vertices() holds not v is isolated proof let G be _Graph; ::_thesis: for W being Walk of G st not W is trivial holds for v being Vertex of G st v in W .vertices() holds not v is isolated let W be Walk of G; ::_thesis: ( not W is trivial implies for v being Vertex of G st v in W .vertices() holds not v is isolated ) assume not W is trivial ; ::_thesis: for v being Vertex of G st v in W .vertices() holds not v is isolated then A1: len W <> 1 by Lm55; let v be Vertex of G; ::_thesis: ( v in W .vertices() implies not v is isolated ) assume v in W .vertices() ; ::_thesis: not v is isolated then consider n being odd Element of NAT such that A2: n <= len W and A3: W . n = v by Lm45; now__::_thesis:_ex_e_being_set_st_e_in_v_.edgesInOut() percases ( n = len W or n <> len W ) ; supposeA4: n = len W ; ::_thesis: ex e being set st e in v .edgesInOut() 1 <= len W by ABIAN:12; then 1 < len W by A1, XXREAL_0:1; then 1 + 1 <= len W by NAT_1:13; then reconsider lenW2 = (len W) - (2 * 1) as odd Element of NAT by INT_1:5; lenW2 < (len W) - 0 by XREAL_1:15; then W . (lenW2 + 1) Joins W . lenW2,W . (lenW2 + 2),G by Def3; then W . (lenW2 + 1) Joins v,W . lenW2,G by A3, A4, GLIB_000:14; hence ex e being set st e in v .edgesInOut() by GLIB_000:62; ::_thesis: verum end; suppose n <> len W ; ::_thesis: ex e being set st e in v .edgesInOut() then n < len W by A2, XXREAL_0:1; then W . (n + 1) Joins v,W . (n + 2),G by A3, Def3; hence ex e being set st e in v .edgesInOut() by GLIB_000:62; ::_thesis: verum end; end; end; hence not v is isolated by GLIB_000:def_49; ::_thesis: verum end; theorem :: GLIB_001:136 for G being _Graph for W being Walk of G holds ( W is trivial iff W .edges() = {} ) proof let G be _Graph; ::_thesis: for W being Walk of G holds ( W is trivial iff W .edges() = {} ) let W be Walk of G; ::_thesis: ( W is trivial iff W .edges() = {} ) hereby ::_thesis: ( W .edges() = {} implies W is trivial ) assume W is trivial ; ::_thesis: W .edges() = {} then W .length() = 0 by Def26; then W .edgeSeq() = {} ; hence W .edges() = {} ; ::_thesis: verum end; assume W .edges() = {} ; ::_thesis: W is trivial then W .edgeSeq() = {} ; then W .length() = 0 ; hence W is trivial by Def26; ::_thesis: verum end; theorem :: GLIB_001:137 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 & W1 is trivial holds W2 is trivial proof let G1, G2 be _Graph; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 & W1 is trivial holds W2 is trivial let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 st W1 = W2 & W1 is trivial holds W2 is trivial let W2 be Walk of G2; ::_thesis: ( W1 = W2 & W1 is trivial implies W2 is trivial ) assume that A1: W1 = W2 and A2: W1 is trivial ; ::_thesis: W2 is trivial len W2 = 1 by A1, A2, Lm55; hence W2 is trivial by Lm55; ::_thesis: verum end; theorem :: GLIB_001:138 for G being _Graph for W being Walk of G holds ( W is Trail-like iff for m, n being even Element of NAT st 1 <= m & m < n & n <= len W holds W . m <> W . n ) by Lm57; theorem :: GLIB_001:139 for G being _Graph for W being Walk of G st len W <= 3 holds W is Trail-like by Lm61; theorem :: GLIB_001:140 for G being _Graph for W being Walk of G holds ( W is Trail-like iff W .reverse() is Trail-like ) by Lm58; theorem :: GLIB_001:141 for G being _Graph for W being Trail of G for m, n being Element of NAT holds W .cut (m,n) is Trail-like ; theorem :: GLIB_001:142 for G being _Graph for W being Trail of G for e being set st e in (W .last()) .edgesInOut() & not e in W .edges() holds W .addEdge e is Trail-like by Lm60; theorem :: GLIB_001:143 for G being _Graph for W being Trail of G for v being Vertex of G st v in W .vertices() & v is endvertex & not v = W .first() holds v = W .last() proof let G be _Graph; ::_thesis: for W being Trail of G for v being Vertex of G st v in W .vertices() & v is endvertex & not v = W .first() holds v = W .last() let W be Trail of G; ::_thesis: for v being Vertex of G st v in W .vertices() & v is endvertex & not v = W .first() holds v = W .last() let v be Vertex of G; ::_thesis: ( v in W .vertices() & v is endvertex & not v = W .first() implies v = W .last() ) assume that A1: v in W .vertices() and A2: v is endvertex ; ::_thesis: ( v = W .first() or v = W .last() ) consider e being set such that A3: v .edgesInOut() = {e} and not e Joins v,v,G by A2, GLIB_000:def_51; consider n being odd Element of NAT such that A4: n <= len W and A5: W . n = v by A1, Lm45; A6: W .vertexAt n = v by A4, A5, Def8; now__::_thesis:_(_v_<>_W_.first()_implies_not_v_<>_W_.last()_) reconsider naa1 = n - 1 as even Element of NAT by ABIAN:12, INT_1:5; assume that A7: v <> W .first() and A8: v <> W .last() ; ::_thesis: contradiction A9: n - 1 < naa1 + 2 by NAT_1:16; 1 <= n by ABIAN:12; then A10: 1 < n by A5, A7, XXREAL_0:1; then 1 + 1 <= n by NAT_1:13; then A11: (1 + 1) - 1 <= n - 1 by XREAL_1:13; A12: n < len W by A4, A5, A8, XXREAL_0:1; then A13: W . (n + 1) in v .edgesInOut() by A6, Th10; W . (n - 1) in v .edgesInOut() by A4, A6, A10, Th11; then A14: W . (n - 1) = e by A3, TARSKI:def_1; n + 1 <= len W by A12, NAT_1:13; then W . naa1 <> W . (n + 1) by A11, A9, Lm57; hence contradiction by A3, A14, A13, TARSKI:def_1; ::_thesis: verum end; hence ( v = W .first() or v = W .last() ) ; ::_thesis: verum end; theorem :: GLIB_001:144 for G being finite _Graph for W being Trail of G holds len (W .edgeSeq()) <= G .size() proof let G be finite _Graph; ::_thesis: for W being Trail of G holds len (W .edgeSeq()) <= G .size() let W be Trail of G; ::_thesis: len (W .edgeSeq()) <= G .size() consider f being Function such that A1: ( dom f = W .edgeSeq() & ( for x being set st x in W .edgeSeq() holds f . x = x `2 ) ) from FUNCT_1:sch_3(); now__::_thesis:_for_x1,_x2_being_set_st_x1_in_dom_f_&_x2_in_dom_f_&_f_._x1_=_f_._x2_holds_ x1_=_x2 A2: W .edgeSeq() is one-to-one by Def27; let x1, x2 be set ; ::_thesis: ( x1 in dom f & x2 in dom f & f . x1 = f . x2 implies x1 = x2 ) assume that A3: x1 in dom f and A4: x2 in dom f and A5: f . x1 = f . x2 ; ::_thesis: x1 = x2 consider a1, b1 being set such that A6: x1 = [a1,b1] by A1, A3, RELAT_1:def_1; A7: a1 in dom (W .edgeSeq()) by A1, A3, A6, FUNCT_1:1; A8: f . x2 = x2 `2 by A1, A4; A9: (W .edgeSeq()) . a1 = b1 by A1, A3, A6, FUNCT_1:1; consider a2, b2 being set such that A10: x2 = [a2,b2] by A1, A4, RELAT_1:def_1; A11: a2 in dom (W .edgeSeq()) by A1, A4, A10, FUNCT_1:1; X1: [a1,b1] `2 = b1 ; X2: [a2,b2] `2 = b2 ; f . x1 = x1 `2 by A1, A3; then A12: b1 = f . x1 by A6, X1 .= b2 by A5, A8, A10, X2 ; then (W .edgeSeq()) . a2 = b1 by A1, A4, A10, FUNCT_1:1; hence x1 = x2 by A6, A10, A12, A2, A7, A9, A11, FUNCT_1:def_4; ::_thesis: verum end; then A13: f is one-to-one by FUNCT_1:def_4; now__::_thesis:_for_y_being_set_st_y_in_rng_f_holds_ y_in_the_Edges_of_G let y be set ; ::_thesis: ( y in rng f implies y in the_Edges_of G ) assume y in rng f ; ::_thesis: y in the_Edges_of G then consider x being set such that A14: x in dom f and A15: f . x = y by FUNCT_1:def_3; consider a, b being set such that A16: x = [a,b] by A1, A14, RELAT_1:def_1; X: [a,b] `2 = b ; y = x `2 by A1, A14, A15; then y = b by A16, X; then y in rng (W .edgeSeq()) by A1, A14, A16, XTUPLE_0:def_13; hence y in the_Edges_of G ; ::_thesis: verum end; then rng f c= the_Edges_of G by TARSKI:def_3; then card (W .edgeSeq()) c= card (the_Edges_of G) by A1, A13, CARD_1:10; then card (W .edgeSeq()) <= card (the_Edges_of G) by NAT_1:39; hence len (W .edgeSeq()) <= G .size() by GLIB_000:def_25; ::_thesis: verum end; theorem :: GLIB_001:145 for G being _Graph for W being Walk of G st len W <= 3 holds W is Path-like by Lm69; theorem :: GLIB_001:146 for G being _Graph for W being Walk of G st ( for m, n being odd Element of NAT st m <= len W & n <= len W & W . m = W . n holds m = n ) holds W is Path-like by Lm66; theorem :: GLIB_001:147 for G being _Graph for W being Path of G st W is open holds for m, n being odd Element of NAT st m < n & n <= len W holds W . m <> W . n proof let G be _Graph; ::_thesis: for W being Path of G st W is open holds for m, n being odd Element of NAT st m < n & n <= len W holds W . m <> W . n let W be Path of G; ::_thesis: ( W is open implies for m, n being odd Element of NAT st m < n & n <= len W holds W . m <> W . n ) assume A1: W is open ; ::_thesis: for m, n being odd Element of NAT st m < n & n <= len W holds W . m <> W . n let m, n be odd Element of NAT ; ::_thesis: ( m < n & n <= len W implies W . m <> W . n ) assume that A2: m < n and A3: n <= len W ; ::_thesis: W . m <> W . n now__::_thesis:_not_W_._m_=_W_._n assume A4: W . m = W . n ; ::_thesis: contradiction then A5: n = len W by A2, A3, Def28; m = 1 by A2, A3, A4, Def28; hence contradiction by A1, A4, A5, Th118; ::_thesis: verum end; hence W . m <> W . n ; ::_thesis: verum end; theorem :: GLIB_001:148 for G being _Graph for W being Walk of G holds ( W is Path-like iff W .reverse() is Path-like ) by Lm63; theorem :: GLIB_001:149 for G being _Graph for W being Path of G for m, n being Element of NAT holds W .cut (m,n) is Path-like ; theorem Th150: :: GLIB_001:150 for G being _Graph for W being Path of G for e, v being set st e Joins W .last() ,v,G & not e in W .edges() & ( W is trivial or W is open ) & ( for n being odd Element of NAT st 1 < n & n <= len W holds W . n <> v ) holds W .addEdge e is Path-like proof let G be _Graph; ::_thesis: for W being Path of G for e, v being set st e Joins W .last() ,v,G & not e in W .edges() & ( W is trivial or W is open ) & ( for n being odd Element of NAT st 1 < n & n <= len W holds W . n <> v ) holds W .addEdge e is Path-like let W be Path of G; ::_thesis: for e, v being set st e Joins W .last() ,v,G & not e in W .edges() & ( W is trivial or W is open ) & ( for n being odd Element of NAT st 1 < n & n <= len W holds W . n <> v ) holds W .addEdge e is Path-like let e, v be set ; ::_thesis: ( e Joins W .last() ,v,G & not e in W .edges() & ( W is trivial or W is open ) & ( for n being odd Element of NAT st 1 < n & n <= len W holds W . n <> v ) implies W .addEdge e is Path-like ) assume that A1: e Joins W .last() ,v,G and A2: not e in W .edges() and A3: ( W is trivial or W is open ) and A4: for n being odd Element of NAT st 1 < n & n <= len W holds W . n <> v ; ::_thesis: W .addEdge e is Path-like reconsider lenW = len W as odd Element of NAT ; set W2 = W .addEdge e; A5: e in (W .last()) .edgesInOut() by A1, GLIB_000:62; now__::_thesis:_(_W_.addEdge_e_is_Trail-like_&_(_for_m,_n_being_odd_Element_of_NAT_st_m_<_n_&_n_<=_len_(W_.addEdge_e)_&_(W_.addEdge_e)_._m_=_(W_.addEdge_e)_._n_holds_ (_m_=_1_&_n_=_len_(W_.addEdge_e)_)_)_) thus W .addEdge e is Trail-like by A2, A5, Lm60; ::_thesis: for m, n being odd Element of NAT st m < n & n <= len (W .addEdge e) & (W .addEdge e) . m = (W .addEdge e) . n holds ( m = 1 & n = len (W .addEdge e) ) let m, n be odd Element of NAT ; ::_thesis: ( m < n & n <= len (W .addEdge e) & (W .addEdge e) . m = (W .addEdge e) . n implies ( m = 1 & n = len (W .addEdge e) ) ) assume that A6: m < n and A7: n <= len (W .addEdge e) and A8: (W .addEdge e) . m = (W .addEdge e) . n ; ::_thesis: ( m = 1 & n = len (W .addEdge e) ) now__::_thesis:_(_m_=_1_&_n_=_len_(W_.addEdge_e)_) percases ( W is open or W is trivial ) by A3; supposeA9: W is open ; ::_thesis: ( m = 1 & n = len (W .addEdge e) ) now__::_thesis:_(_m_=_1_&_n_=_len_(W_.addEdge_e)_) percases ( n <= len W or n > len W ) ; supposeA10: n <= len W ; ::_thesis: ( m = 1 & n = len (W .addEdge e) ) A11: 1 <= m by ABIAN:12; m <= len W by A6, A10, XXREAL_0:2; then m in dom W by A11, FINSEQ_3:25; then A12: (W .addEdge e) . m = W . m by A1, Lm38; 1 <= n by ABIAN:12; then n in dom W by A10, FINSEQ_3:25; then A13: W . m = W . n by A1, A8, A12, Lm38; then m = 1 by A6, A10, Def28; then W .first() = W .last() by A6, A10, A13, Def28; hence ( m = 1 & n = len (W .addEdge e) ) by A9, Def24; ::_thesis: verum end; suppose n > len W ; ::_thesis: ( m = 1 & n = len (W .addEdge e) ) then lenW + 1 <= n by NAT_1:13; then lenW + 1 < n by XXREAL_0:1; then (lenW + 1) + 1 <= n by NAT_1:13; then (len W) + (1 + 1) <= n ; then A14: len (W .addEdge e) <= n by A1, Lm37; then A15: n = len (W .addEdge e) by A7, XXREAL_0:1; then (W .addEdge e) . n = (W .addEdge e) . ((len W) + 2) by A1, Lm37; then A16: (W .addEdge e) . n = v by A1, Lm38; m < (len W) + (1 + 1) by A1, A6, A15, Lm37; then m < ((len W) + 1) + 1 ; then m <= lenW + 1 by NAT_1:13; then m < lenW + 1 by XXREAL_0:1; then A17: m <= len W by NAT_1:13; 1 <= m by ABIAN:12; then m in dom W by A17, FINSEQ_3:25; then A18: W . m = v by A1, A8, A16, Lm38; now__::_thesis:_not_m_<>_1 A19: 1 <= m by ABIAN:12; assume m <> 1 ; ::_thesis: contradiction then 1 < m by A19, XXREAL_0:1; hence contradiction by A4, A17, A18; ::_thesis: verum end; hence m = 1 ; ::_thesis: n = len (W .addEdge e) thus n = len (W .addEdge e) by A7, A14, XXREAL_0:1; ::_thesis: verum end; end; end; hence ( m = 1 & n = len (W .addEdge e) ) ; ::_thesis: verum end; suppose W is trivial ; ::_thesis: ( m = 1 & n = len (W .addEdge e) ) then ex v being Vertex of G st W = G .walkOf v by Lm56; then len W = 1 by Th13; then A20: len (W .addEdge e) = 1 + 2 by A1, Lm37; A21: m + 1 <= n by A6, NAT_1:13; A22: 1 <= m by ABIAN:12; then 1 + 1 <= m + 1 by XREAL_1:7; then 2 * 1 <= n by A21, XXREAL_0:2; then 2 * 1 < n by XXREAL_0:1; then A23: len (W .addEdge e) <= n by A20, NAT_1:13; then m < 3 by A6, A7, A20, XXREAL_0:1; then (m + 1) - 1 <= 3 - 1 by A20, NAT_1:13; then m < 2 * 1 by XXREAL_0:1; then m + 1 <= 2 by NAT_1:13; then (m + 1) - 1 <= 2 - 1 by XREAL_1:13; hence ( m = 1 & n = len (W .addEdge e) ) by A7, A22, A23, XXREAL_0:1; ::_thesis: verum end; end; end; hence ( m = 1 & n = len (W .addEdge e) ) ; ::_thesis: verum end; hence W .addEdge e is Path-like by Def28; ::_thesis: verum end; theorem :: GLIB_001:151 for G being _Graph for W being Path of G for e, v being set st e Joins W .last() ,v,G & not v in W .vertices() & ( W is trivial or W is open ) holds W .addEdge e is Path-like by Lm68; theorem :: GLIB_001:152 for G being _Graph for W being Walk of G st ( for n being odd Element of NAT st n <= len W holds W .find (W . n) = W .rfind (W . n) ) holds W is Path-like proof let G be _Graph; ::_thesis: for W being Walk of G st ( for n being odd Element of NAT st n <= len W holds W .find (W . n) = W .rfind (W . n) ) holds W is Path-like let W be Walk of G; ::_thesis: ( ( for n being odd Element of NAT st n <= len W holds W .find (W . n) = W .rfind (W . n) ) implies W is Path-like ) assume A1: for n being odd Element of NAT st n <= len W holds W .find (W . n) = W .rfind (W . n) ; ::_thesis: W is Path-like A2: now__::_thesis:_for_x_being_odd_Element_of_NAT_st_x_<=_len_W_holds_ (_W_.find_(W_._x)_=_x_&_W_.rfind_(W_._x)_=_x_) let x be odd Element of NAT ; ::_thesis: ( x <= len W implies ( W .find (W . x) = x & W .rfind (W . x) = x ) ) assume A3: x <= len W ; ::_thesis: ( W .find (W . x) = x & W .rfind (W . x) = x ) then A4: W .rfind (W . x) >= x by Th115; A5: W .find (W . x) = W .rfind (W . x) by A1, A3; W .find (W . x) <= x by A3, Th115; hence ( W .find (W . x) = x & W .rfind (W . x) = x ) by A4, A5, XXREAL_0:1; ::_thesis: verum end; now__::_thesis:_for_m,_n_being_even_Element_of_NAT_st_1_<=_m_&_m_<_n_&_n_<=_len_W_holds_ W_._m_<>_W_._n let m, n be even Element of NAT ; ::_thesis: ( 1 <= m & m < n & n <= len W implies W . m <> W . n ) assume that A6: 1 <= m and A7: m < n and A8: n <= len W ; ::_thesis: W . m <> W . n 1 <= n by A6, A7, XXREAL_0:2; then n in dom W by A8, FINSEQ_3:25; then consider naa1 being odd Element of NAT such that A9: naa1 = n - 1 and A10: n - 1 in dom W and A11: n + 1 in dom W and A12: W . n Joins W . naa1,W . (n + 1),G by Lm2; m <= len W by A7, A8, XXREAL_0:2; then m in dom W by A6, FINSEQ_3:25; then consider maa1 being odd Element of NAT such that A13: maa1 = m - 1 and A14: m - 1 in dom W and m + 1 in dom W and A15: W . m Joins W . maa1,W . (m + 1),G by Lm2; now__::_thesis:_not_W_._m_=_W_._n set Wnaa1 = W . naa1; set Wn1 = W . (n + 1); set Wmaa1 = W . maa1; set Wm1 = W . (m + 1); assume A16: W . m = W . n ; ::_thesis: contradiction maa1 <= len W by A13, A14, FINSEQ_3:25; then A17: W .find (W . maa1) = maa1 by A2; A18: n + 1 <= len W by A11, FINSEQ_3:25; A19: naa1 <= len W by A9, A10, FINSEQ_3:25; now__::_thesis:_contradiction percases ( ( W . maa1 = W . naa1 & W . (m + 1) = W . (n + 1) ) or ( W . maa1 = W . (n + 1) & W . (m + 1) = W . naa1 ) ) by A15, A12, A16, GLIB_000:15; suppose ( W . maa1 = W . naa1 & W . (m + 1) = W . (n + 1) ) ; ::_thesis: contradiction then maa1 = naa1 by A2, A19, A17; hence contradiction by A7, A13, A9; ::_thesis: verum end; suppose ( W . maa1 = W . (n + 1) & W . (m + 1) = W . naa1 ) ; ::_thesis: contradiction then maa1 = n + 1 by A2, A18, A17; then n <= (maa1 - 1) + 1 by NAT_1:12; then n <= (m - 1) + 1 by A13, NAT_1:12; hence contradiction by A7; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; hence W . m <> W . n ; ::_thesis: verum end; then A20: W is Trail-like by Lm57; now__::_thesis:_for_m,_n_being_odd_Element_of_NAT_st_m_<_n_&_n_<=_len_W_&_W_._m_=_W_._n_holds_ (_m_=_1_&_n_=_len_W_) let m, n be odd Element of NAT ; ::_thesis: ( m < n & n <= len W & W . m = W . n implies ( m = 1 & n = len W ) ) assume that A21: m < n and A22: n <= len W and A23: W . m = W . n ; ::_thesis: ( m = 1 & n = len W ) m <= len W by A21, A22, XXREAL_0:2; then W .find (W . m) = m by A2; hence ( m = 1 & n = len W ) by A2, A21, A22, A23; ::_thesis: verum end; hence W is Path-like by A20, Def28; ::_thesis: verum end; theorem :: GLIB_001:153 for G being _Graph for W being Walk of G st ( for n being odd Element of NAT st n <= len W holds W .rfind n = n ) holds W is Path-like by Lm67; theorem :: GLIB_001:154 for G being finite _Graph for W being Path of G holds len (W .vertexSeq()) <= (G .order()) + 1 proof let G be finite _Graph; ::_thesis: for W being Path of G holds len (W .vertexSeq()) <= (G .order()) + 1 let W be Path of G; ::_thesis: len (W .vertexSeq()) <= (G .order()) + 1 now__::_thesis:_len_(W_.vertexSeq())_<=_(G_.order())_+_1 percases ( len W = 1 or len W <> 1 ) ; suppose len W = 1 ; ::_thesis: len (W .vertexSeq()) <= (G .order()) + 1 then 1 + 1 = 2 * (len (W .vertexSeq())) by Def14; hence len (W .vertexSeq()) <= (G .order()) + 1 by NAT_1:12; ::_thesis: verum end; suppose len W <> 1 ; ::_thesis: len (W .vertexSeq()) <= (G .order()) + 1 then not W is trivial by Lm55; then consider lenW2 being odd Element of NAT such that A1: lenW2 = (len W) - 2 and A2: (W .cut (1,lenW2)) .addEdge (W . (lenW2 + 1)) = W by Th133; set W2 = W .cut (1,lenW2); set vs1 = (W .cut (1,lenW2)) .vertexSeq() ; consider f being Function such that A3: ( dom f = (W .cut (1,lenW2)) .vertexSeq() & ( for x being set st x in (W .cut (1,lenW2)) .vertexSeq() holds f . x = x `2 ) ) from FUNCT_1:sch_3(); A4: lenW2 < (len W) - 0 by A1, XREAL_1:15; then A5: len (W .cut (1,lenW2)) = lenW2 by Lm22; now__::_thesis:_for_x1,_x2_being_set_st_x1_in_dom_f_&_x2_in_dom_f_&_f_._x1_=_f_._x2_holds_ x1_=_x2 let x1, x2 be set ; ::_thesis: ( x1 in dom f & x2 in dom f & f . x1 = f . x2 implies x1 = x2 ) assume that A6: x1 in dom f and A7: x2 in dom f and A8: f . x1 = f . x2 ; ::_thesis: x1 = x2 consider a1, b1 being set such that A9: x1 = [a1,b1] by A3, A6, RELAT_1:def_1; A10: b1 = ((W .cut (1,lenW2)) .vertexSeq()) . a1 by A3, A6, A9, FUNCT_1:1; X1: [a1,b1] `2 = b1 ; A11: f . x1 = x1 `2 by A3, A6 .= b1 by A9, X1 ; consider a2, b2 being set such that A12: x2 = [a2,b2] by A3, A7, RELAT_1:def_1; A13: a2 in dom ((W .cut (1,lenW2)) .vertexSeq()) by A3, A7, A12, FUNCT_1:1; A14: a1 in dom ((W .cut (1,lenW2)) .vertexSeq()) by A3, A6, A9, FUNCT_1:1; A15: b2 = ((W .cut (1,lenW2)) .vertexSeq()) . a2 by A3, A7, A12, FUNCT_1:1; X2: [a2,b2] `2 = b2 ; A16: f . x2 = x2 `2 by A3, A7 .= b2 by A12, X2 ; reconsider a1 = a1, a2 = a2 as Element of NAT by A14, A13; A17: now__::_thesis:_for_n1,_n2_being_Element_of_NAT_st_n1_<_n2_&_n1_in_dom_((W_.cut_(1,lenW2))_.vertexSeq())_&_n2_in_dom_((W_.cut_(1,lenW2))_.vertexSeq())_holds_ not_((W_.cut_(1,lenW2))_.vertexSeq())_._n1_=_((W_.cut_(1,lenW2))_.vertexSeq())_._n2 let n1, n2 be Element of NAT ; ::_thesis: ( n1 < n2 & n1 in dom ((W .cut (1,lenW2)) .vertexSeq()) & n2 in dom ((W .cut (1,lenW2)) .vertexSeq()) implies not ((W .cut (1,lenW2)) .vertexSeq()) . n1 = ((W .cut (1,lenW2)) .vertexSeq()) . n2 ) assume that A18: n1 < n2 and A19: n1 in dom ((W .cut (1,lenW2)) .vertexSeq()) and A20: n2 in dom ((W .cut (1,lenW2)) .vertexSeq()) and A21: ((W .cut (1,lenW2)) .vertexSeq()) . n1 = ((W .cut (1,lenW2)) .vertexSeq()) . n2 ; ::_thesis: contradiction A22: (2 * n2) - 1 in dom (W .cut (1,lenW2)) by A20, Th73; A23: (2 * n1) - 1 in dom (W .cut (1,lenW2)) by A19, Th73; then reconsider a = (2 * n1) - 1, b = (2 * n2) - 1 as odd Element of NAT by A22; A24: (W .cut (1,lenW2)) . b = W . b by A4, A22, Lm23; A25: n2 <= len ((W .cut (1,lenW2)) .vertexSeq()) by A20, FINSEQ_3:25; 1 <= n2 by A20, FINSEQ_3:25; then A26: ((W .cut (1,lenW2)) .vertexSeq()) . n2 = (W .cut (1,lenW2)) . b by A25, Def14; A27: n1 <= len ((W .cut (1,lenW2)) .vertexSeq()) by A19, FINSEQ_3:25; 1 <= n1 by A19, FINSEQ_3:25; then A28: ((W .cut (1,lenW2)) .vertexSeq()) . n1 = (W .cut (1,lenW2)) . a by A27, Def14; b <= lenW2 by A5, A22, FINSEQ_3:25; then A29: b < len W by A4, XXREAL_0:2; 2 * n1 < 2 * n2 by A18, XREAL_1:68; then A30: a < b by XREAL_1:14; (W .cut (1,lenW2)) . a = W . a by A4, A23, Lm23; hence contradiction by A21, A28, A26, A24, A30, A29, Def28; ::_thesis: verum end; now__::_thesis:_not_a1_<>_a2 assume A31: a1 <> a2 ; ::_thesis: contradiction now__::_thesis:_contradiction percases ( a1 <= a2 or a1 > a2 ) ; suppose a1 <= a2 ; ::_thesis: contradiction then a1 < a2 by A31, XXREAL_0:1; hence contradiction by A8, A11, A16, A14, A10, A13, A15, A17; ::_thesis: verum end; suppose a1 > a2 ; ::_thesis: contradiction hence contradiction by A8, A11, A16, A14, A10, A13, A15, A17; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; hence x1 = x2 by A8, A9, A12, A11, A16; ::_thesis: verum end; then A32: f is one-to-one by FUNCT_1:def_4; now__::_thesis:_for_y_being_set_st_y_in_rng_f_holds_ y_in_the_Vertices_of_G let y be set ; ::_thesis: ( y in rng f implies y in the_Vertices_of G ) assume y in rng f ; ::_thesis: y in the_Vertices_of G then consider x being set such that A33: x in dom f and A34: f . x = y by FUNCT_1:def_3; consider a, b being set such that A35: x = [a,b] by A3, A33, RELAT_1:def_1; X: [a,b] `2 = b ; y = x `2 by A3, A33, A34; then A36: y = b by A35, X; A37: b = ((W .cut (1,lenW2)) .vertexSeq()) . a by A3, A33, A35, FUNCT_1:1; a in dom ((W .cut (1,lenW2)) .vertexSeq()) by A3, A33, A35, FUNCT_1:1; then y in rng ((W .cut (1,lenW2)) .vertexSeq()) by A36, A37, FUNCT_1:def_3; hence y in the_Vertices_of G ; ::_thesis: verum end; then rng f c= the_Vertices_of G by TARSKI:def_3; then card ((W .cut (1,lenW2)) .vertexSeq()) c= card (the_Vertices_of G) by A3, A32, CARD_1:10; then card ((W .cut (1,lenW2)) .vertexSeq()) <= card (the_Vertices_of G) by NAT_1:39; then len ((W .cut (1,lenW2)) .vertexSeq()) <= G .order() by GLIB_000:def_24; then A38: (len ((W .cut (1,lenW2)) .vertexSeq())) + 1 <= (G .order()) + 1 by XREAL_1:7; A39: lenW2 < (len W) - 0 by A1, XREAL_1:15; then A40: W . (lenW2 + 1) Joins W . lenW2,W . (lenW2 + 2),G by Def3; 1 <= lenW2 by ABIAN:12; then (W .cut (1,lenW2)) .last() = W . lenW2 by A39, Lm16, JORDAN12:2; then W .vertexSeq() = ((W .cut (1,lenW2)) .vertexSeq()) ^ <*(W . (lenW2 + 2))*> by A2, A40, Th75; then len (W .vertexSeq()) = (len ((W .cut (1,lenW2)) .vertexSeq())) + (len <*(W . (lenW2 + 2))*>) by FINSEQ_1:22; hence len (W .vertexSeq()) <= (G .order()) + 1 by A38, FINSEQ_1:39; ::_thesis: verum end; end; end; hence len (W .vertexSeq()) <= (G .order()) + 1 ; ::_thesis: verum end; theorem :: GLIB_001:155 for G being _Graph for W being vertex-distinct Walk of G for e, v being set st e Joins W .last() ,v,G & not v in W .vertices() holds W .addEdge e is vertex-distinct proof let G be _Graph; ::_thesis: for W being vertex-distinct Walk of G for e, v being set st e Joins W .last() ,v,G & not v in W .vertices() holds W .addEdge e is vertex-distinct let W be vertex-distinct Walk of G; ::_thesis: for e, v being set st e Joins W .last() ,v,G & not v in W .vertices() holds W .addEdge e is vertex-distinct let e, v be set ; ::_thesis: ( e Joins W .last() ,v,G & not v in W .vertices() implies W .addEdge e is vertex-distinct ) assume that A1: e Joins W .last() ,v,G and A2: not v in W .vertices() ; ::_thesis: W .addEdge e is vertex-distinct set W2 = W .addEdge e; A3: len (W .addEdge e) = (len W) + 2 by A1, Lm37; A4: now__::_thesis:_for_n_being_odd_Element_of_NAT_st_n_<=_len_(W_.addEdge_e)_&_n_>_len_W_holds_ (_n_=_len_(W_.addEdge_e)_&_(W_.addEdge_e)_._n_=_v_) let n be odd Element of NAT ; ::_thesis: ( n <= len (W .addEdge e) & n > len W implies ( n = len (W .addEdge e) & (W .addEdge e) . n = v ) ) assume that A5: n <= len (W .addEdge e) and A6: n > len W ; ::_thesis: ( n = len (W .addEdge e) & (W .addEdge e) . n = v ) (len W) + 1 <= n by A6, NAT_1:13; then (len W) + 1 < n by XXREAL_0:1; then ((len W) + 1) + 1 <= n by NAT_1:13; hence n = len (W .addEdge e) by A3, A5, XXREAL_0:1; ::_thesis: (W .addEdge e) . n = v hence (W .addEdge e) . n = v by A1, A3, Lm38; ::_thesis: verum end; now__::_thesis:_for_m,_n_being_odd_Element_of_NAT_st_m_<=_len_(W_.addEdge_e)_&_n_<=_len_(W_.addEdge_e)_&_(W_.addEdge_e)_._m_=_(W_.addEdge_e)_._n_holds_ m_=_n let m, n be odd Element of NAT ; ::_thesis: ( m <= len (W .addEdge e) & n <= len (W .addEdge e) & (W .addEdge e) . m = (W .addEdge e) . n implies m = n ) assume that A7: m <= len (W .addEdge e) and A8: n <= len (W .addEdge e) and A9: (W .addEdge e) . m = (W .addEdge e) . n ; ::_thesis: m = n A10: 1 <= n by ABIAN:12; A11: 1 <= m by ABIAN:12; now__::_thesis:_m_=_n percases ( m <= len W or m > len W ) ; supposeA12: m <= len W ; ::_thesis: m = n then m in dom W by A11, FINSEQ_3:25; then A13: (W .addEdge e) . m = W . m by A1, Lm38; now__::_thesis:_m_=_n percases ( n <= len W or n > len W ) ; supposeA14: n <= len W ; ::_thesis: m = n then n in dom W by A10, FINSEQ_3:25; then (W .addEdge e) . n = W . n by A1, Lm38; hence m = n by A9, A12, A13, A14, Def29; ::_thesis: verum end; suppose n > len W ; ::_thesis: m = n then W . m = v by A4, A8, A9, A13; hence m = n by A2, A12, Lm45; ::_thesis: verum end; end; end; hence m = n ; ::_thesis: verum end; supposeA15: m > len W ; ::_thesis: m = n then A16: (W .addEdge e) . m = v by A4, A7; A17: m = len (W .addEdge e) by A4, A7, A15; now__::_thesis:_m_=_n percases ( n <= len W or n > len W ) ; supposeA18: n <= len W ; ::_thesis: m = n then n in dom W by A10, FINSEQ_3:25; then v = W . n by A1, A9, A16, Lm38; hence m = n by A2, A18, Lm45; ::_thesis: verum end; suppose n > len W ; ::_thesis: m = n hence m = n by A4, A8, A17; ::_thesis: verum end; end; end; hence m = n ; ::_thesis: verum end; end; end; hence m = n ; ::_thesis: verum end; hence W .addEdge e is vertex-distinct by Def29; ::_thesis: verum end; theorem :: GLIB_001:156 for G being _Graph for e, x being set st e Joins x,x,G holds G .walkOf (x,e,x) is Cycle-like proof let G be _Graph; ::_thesis: for e, x being set st e Joins x,x,G holds G .walkOf (x,e,x) is Cycle-like let e, x be set ; ::_thesis: ( e Joins x,x,G implies G .walkOf (x,e,x) is Cycle-like ) set W = G .walkOf (x,e,x); assume e Joins x,x,G ; ::_thesis: G .walkOf (x,e,x) is Cycle-like then len (G .walkOf (x,e,x)) = 3 by Th14; then not G .walkOf (x,e,x) is trivial by Lm54; hence G .walkOf (x,e,x) is Cycle-like by Def31; ::_thesis: verum end; theorem :: GLIB_001:157 for G being _Graph for W1 being Walk of G for e, x, y being set st e Joins x,y,G & e in W1 .edges() & W1 is Cycle-like holds ex W2 being Walk of G st ( W2 is_Walk_from x,y & not e in W2 .edges() ) proof let G be _Graph; ::_thesis: for W1 being Walk of G for e, x, y being set st e Joins x,y,G & e in W1 .edges() & W1 is Cycle-like holds ex W2 being Walk of G st ( W2 is_Walk_from x,y & not e in W2 .edges() ) let W1 be Walk of G; ::_thesis: for e, x, y being set st e Joins x,y,G & e in W1 .edges() & W1 is Cycle-like holds ex W2 being Walk of G st ( W2 is_Walk_from x,y & not e in W2 .edges() ) let e, x, y be set ; ::_thesis: ( e Joins x,y,G & e in W1 .edges() & W1 is Cycle-like implies ex W2 being Walk of G st ( W2 is_Walk_from x,y & not e in W2 .edges() ) ) assume that A1: e Joins x,y,G and A2: e in W1 .edges() and A3: W1 is Cycle-like ; ::_thesis: ex W2 being Walk of G st ( W2 is_Walk_from x,y & not e in W2 .edges() ) consider v1, v2 being Vertex of G, n being odd Element of NAT such that A4: n + 2 <= len W1 and A5: v1 = W1 . n and A6: e = W1 . (n + 1) and A7: v2 = W1 . (n + 2) and A8: e Joins v1,v2,G by A2, Lm47; set WA = W1 .cut ((n + 2),(len W1)); set WB = W1 .cut (((2 * 0) + 1),n); A9: (W1 .cut ((n + 2),(len W1))) .last() = W1 .last() by A4, Lm16; A10: (n + 2) - 2 < (len W1) - 0 by A4, XREAL_1:15; A11: now__::_thesis:_not_e_in_(W1_.cut_(((2_*_0)_+_1),n))_.edges() assume e in (W1 .cut (((2 * 0) + 1),n)) .edges() ; ::_thesis: contradiction then consider m being even Element of NAT such that A12: 1 <= m and A13: m <= len (W1 .cut (((2 * 0) + 1),n)) and A14: (W1 .cut (((2 * 0) + 1),n)) . m = e by Lm46; m in dom (W1 .cut (((2 * 0) + 1),n)) by A12, A13, FINSEQ_3:25; then A15: W1 . m = W1 . (n + 1) by A6, A10, A14, Lm23; len (W1 .cut (((2 * 0) + 1),n)) = n by A10, Lm22; then A16: m + 0 < n + 1 by A13, XREAL_1:8; n + 1 <= len W1 by A10, NAT_1:13; hence contradiction by A3, A12, A15, A16, Lm57; ::_thesis: verum end; 1 <= n by ABIAN:12; then W1 .cut (((2 * 0) + 1),n) is_Walk_from W1 .first() ,v1 by A5, A10, Lm16; then A17: W1 .cut (((2 * 0) + 1),n) is_Walk_from W1 .last() ,v1 by A3, Def24; A18: W1 .cut ((n + 2),(len W1)) is_Walk_from v2,W1 . (len W1) by A4, A7, Lm16; then (W1 .cut ((n + 2),(len W1))) .append (W1 .cut (((2 * 0) + 1),n)) is_Walk_from v2,v1 by A17, Th31; then A19: ((W1 .cut ((n + 2),(len W1))) .append (W1 .cut (((2 * 0) + 1),n))) .reverse() is_Walk_from v1,v2 by Th23; A20: now__::_thesis:_not_e_in_(W1_.cut_((n_+_2),(len_W1)))_.edges() assume e in (W1 .cut ((n + 2),(len W1))) .edges() ; ::_thesis: contradiction then consider m being even Element of NAT such that A21: 1 <= m and A22: m <= len (W1 .cut ((n + 2),(len W1))) and A23: (W1 .cut ((n + 2),(len W1))) . m = e by Lm46; reconsider maa1 = m - 1 as odd Element of NAT by A21, INT_1:5; A24: maa1 < (len (W1 .cut ((n + 2),(len W1)))) - 0 by A22, XREAL_1:15; then (n + 2) + maa1 in dom W1 by A4, Lm15; then A25: (n + 2) + maa1 <= len W1 by FINSEQ_3:25; maa1 + 1 = m ; then A26: e = W1 . ((n + 2) + maa1) by A4, A23, A24, Lm15; n + 1 < (n + 1) + 1 by NAT_1:13; then A27: (n + 1) + 0 < (n + 2) + maa1 by XREAL_1:8; 1 <= n + 1 by NAT_1:12; hence contradiction by A3, A6, A26, A25, A27, Lm57; ::_thesis: verum end; (W1 .cut (((2 * 0) + 1),n)) .first() = W1 .last() by A17, Def23; then ((W1 .cut ((n + 2),(len W1))) .append (W1 .cut (((2 * 0) + 1),n))) .edges() = ((W1 .cut ((n + 2),(len W1))) .edges()) \/ ((W1 .cut (((2 * 0) + 1),n)) .edges()) by A9, Th102; then A28: not e in ((W1 .cut ((n + 2),(len W1))) .append (W1 .cut (((2 * 0) + 1),n))) .edges() by A20, A11, XBOOLE_0:def_3; then A29: not e in (((W1 .cut ((n + 2),(len W1))) .append (W1 .cut (((2 * 0) + 1),n))) .reverse()) .edges() by Th107; now__::_thesis:_ex_W2_being_Walk_of_G_st_ (_W2_is_Walk_from_x,y_&_not_e_in_W2_.edges()_) percases ( ( x = v1 & y = v2 ) or ( x = v2 & y = v1 ) ) by A1, A8, GLIB_000:15; suppose ( x = v1 & y = v2 ) ; ::_thesis: ex W2 being Walk of G st ( W2 is_Walk_from x,y & not e in W2 .edges() ) hence ex W2 being Walk of G st ( W2 is_Walk_from x,y & not e in W2 .edges() ) by A29, A19; ::_thesis: verum end; suppose ( x = v2 & y = v1 ) ; ::_thesis: ex W2 being Walk of G st ( W2 is_Walk_from x,y & not e in W2 .edges() ) hence ex W2 being Walk of G st ( W2 is_Walk_from x,y & not e in W2 .edges() ) by A18, A17, A28, Th31; ::_thesis: verum end; end; end; hence ex W2 being Walk of G st ( W2 is_Walk_from x,y & not e in W2 .edges() ) ; ::_thesis: verum end; theorem :: GLIB_001:158 for G being _Graph for W being Walk of G holds W is Subwalk of W by Lm70; theorem :: GLIB_001:159 for G being _Graph for W1 being Walk of G for W2 being Subwalk of W1 for W3 being Subwalk of W2 holds W3 is Subwalk of W1 by Lm71; theorem :: GLIB_001:160 for G being _Graph for W1, W2 being Walk of G for x, y being set st W1 is Subwalk of W2 holds ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G for x, y being set st W1 is Subwalk of W2 holds ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) let W1, W2 be Walk of G; ::_thesis: for x, y being set st W1 is Subwalk of W2 holds ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) let x, y be set ; ::_thesis: ( W1 is Subwalk of W2 implies ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) ) assume A1: W1 is Subwalk of W2 ; ::_thesis: ( W1 is_Walk_from x,y iff W2 is_Walk_from x,y ) hereby ::_thesis: ( W2 is_Walk_from x,y implies W1 is_Walk_from x,y ) A2: W1 is_Walk_from W2 .first() ,W2 .last() by A1, Def32; assume A3: W1 is_Walk_from x,y ; ::_thesis: W2 is_Walk_from x,y then W1 .last() = y by Def23; then A4: y = W2 .last() by A2, Def23; W1 .first() = x by A3, Def23; then x = W2 .first() by A2, Def23; hence W2 is_Walk_from x,y by A4, Def23; ::_thesis: verum end; assume A5: W2 is_Walk_from x,y ; ::_thesis: W1 is_Walk_from x,y then A6: W2 .last() = y by Def23; W2 .first() = x by A5, Def23; hence W1 is_Walk_from x,y by A1, A6, Def32; ::_thesis: verum end; theorem Th161: :: GLIB_001:161 for G being _Graph for W1, W2 being Walk of G st W1 is Subwalk of W2 holds ( W1 .first() = W2 .first() & W1 .last() = W2 .last() ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 is Subwalk of W2 holds ( W1 .first() = W2 .first() & W1 .last() = W2 .last() ) let W1, W2 be Walk of G; ::_thesis: ( W1 is Subwalk of W2 implies ( W1 .first() = W2 .first() & W1 .last() = W2 .last() ) ) assume W1 is Subwalk of W2 ; ::_thesis: ( W1 .first() = W2 .first() & W1 .last() = W2 .last() ) then W1 is_Walk_from W2 .first() ,W2 .last() by Def32; hence ( W1 .first() = W2 .first() & W1 .last() = W2 .last() ) by Def23; ::_thesis: verum end; theorem :: GLIB_001:162 for G being _Graph for W1, W2 being Walk of G st W1 is Subwalk of W2 holds len W1 <= len W2 by Lm72; theorem Th163: :: GLIB_001:163 for G being _Graph for W1, W2 being Walk of G st W1 is Subwalk of W2 holds ( W1 .edges() c= W2 .edges() & W1 .vertices() c= W2 .vertices() ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 is Subwalk of W2 holds ( W1 .edges() c= W2 .edges() & W1 .vertices() c= W2 .vertices() ) let W1, W2 be Walk of G; ::_thesis: ( W1 is Subwalk of W2 implies ( W1 .edges() c= W2 .edges() & W1 .vertices() c= W2 .vertices() ) ) assume A1: W1 is Subwalk of W2 ; ::_thesis: ( W1 .edges() c= W2 .edges() & W1 .vertices() c= W2 .vertices() ) then consider es being Subset of (W2 .edgeSeq()) such that A2: W1 .edgeSeq() = Seq es by Def32; now__::_thesis:_for_e_being_set_st_e_in_W1_.edges()_holds_ e_in_W2_.edges() let e be set ; ::_thesis: ( e in W1 .edges() implies e in W2 .edges() ) assume e in W1 .edges() ; ::_thesis: e in W2 .edges() then consider n being even Element of NAT such that A3: 1 <= n and A4: n <= len W1 and A5: W1 . n = e by Lm46; A6: W1 . n = (Seq es) . (n div 2) by A2, A3, A4, Lm40; n div 2 in dom (Seq es) by A2, A3, A4, Lm40; then ex m being Element of NAT st ( m in dom (W2 .edgeSeq()) & n div 2 <= m & W1 . n = (W2 .edgeSeq()) . m ) by A6, Th4; hence e in W2 .edges() by A5, Th104; ::_thesis: verum end; hence A7: W1 .edges() c= W2 .edges() by TARSKI:def_3; ::_thesis: W1 .vertices() c= W2 .vertices() now__::_thesis:_W1_.vertices()_c=_W2_.vertices() percases ( W1 is trivial or not W1 is trivial ) ; supposeA8: W1 is trivial ; ::_thesis: W1 .vertices() c= W2 .vertices() now__::_thesis:_for_v_being_set_st_v_in_W1_.vertices()_holds_ v_in_W2_.vertices() let v be set ; ::_thesis: ( v in W1 .vertices() implies v in W2 .vertices() ) assume v in W1 .vertices() ; ::_thesis: v in W2 .vertices() then consider n being odd Element of NAT such that A9: n <= len W1 and A10: W1 . n = v by Lm45; A11: 1 <= n by ABIAN:12; n <= 1 by A8, A9, Lm55; then v = W1 .first() by A10, A11, XXREAL_0:1; then v = W2 .first() by A1, Th161; hence v in W2 .vertices() by Th88; ::_thesis: verum end; hence W1 .vertices() c= W2 .vertices() by TARSKI:def_3; ::_thesis: verum end; suppose not W1 is trivial ; ::_thesis: W1 .vertices() c= W2 .vertices() hence W1 .vertices() c= W2 .vertices() by A7, Th134; ::_thesis: verum end; end; end; hence W1 .vertices() c= W2 .vertices() ; ::_thesis: verum end; theorem Th164: :: GLIB_001:164 for G being _Graph for W1, W2 being Walk of G st W1 is Subwalk of W2 holds for m being odd Element of NAT st m <= len W1 holds ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 is Subwalk of W2 holds for m being odd Element of NAT st m <= len W1 holds ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) let W1, W2 be Walk of G; ::_thesis: ( W1 is Subwalk of W2 implies for m being odd Element of NAT st m <= len W1 holds ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) ) assume A1: W1 is Subwalk of W2 ; ::_thesis: for m being odd Element of NAT st m <= len W1 holds ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) let m be odd Element of NAT ; ::_thesis: ( m <= len W1 implies ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) ) assume A2: m <= len W1 ; ::_thesis: ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) A3: ex es being Subset of (W2 .edgeSeq()) st W1 .edgeSeq() = Seq es by A1, Def32; now__::_thesis:_ex_n_being_odd_Element_of_NAT_st_ (_m_<=_n_&_n_<=_len_W2_&_W1_._m_=_W2_._n_) percases ( m < len W1 or m = len W1 ) by A2, XXREAL_0:1; supposeA4: m < len W1 ; ::_thesis: ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) then A5: W1 . (m + 1) Joins W1 . m,W1 . (m + 2),G by Def3; reconsider m1 = m + 1 as even Element of NAT ; A6: 1 <= m1 by NAT_1:12; A7: m1 <= len W1 by A4, NAT_1:13; then A8: W1 . m1 = (W1 .edgeSeq()) . (m1 div 2) by A6, Lm40; m1 div 2 in dom (W1 .edgeSeq()) by A6, A7, Lm40; then consider x being Element of NAT such that A9: x in dom (W2 .edgeSeq()) and A10: m1 div 2 <= x and A11: W1 . m1 = (W2 .edgeSeq()) . x by A3, A8, Th4; set n = 2 * x; A12: 1 <= x by A9, FINSEQ_3:25; 2 divides m1 by PEPIN:22; then 2 * (m1 div 2) = m1 by NAT_D:3; then m1 <= 2 * x by A10, XREAL_1:64; then A13: m1 - 1 <= (2 * x) - 1 by XREAL_1:13; A14: x <= len (W2 .edgeSeq()) by A9, FINSEQ_3:25; A15: 2 * x in dom W2 by A9, Lm41; then 1 <= 2 * x by FINSEQ_3:25; then reconsider naa1 = (2 * x) - 1 as odd Element of NAT by INT_1:5; 2 * x <= len W2 by A15, FINSEQ_3:25; then A16: naa1 < (len W2) - 0 by XREAL_1:15; then W2 . (naa1 + 1) Joins W2 . naa1,W2 . (naa1 + 2),G by Def3; then A17: W1 . m1 Joins W2 . naa1,W2 . (naa1 + 2),G by A11, A12, A14, Def15; A18: naa1 + 2 <= len W2 by A16, Th1; now__::_thesis:_ex_n_being_odd_Element_of_NAT_st_ (_m_<=_n_&_n_<=_len_W2_&_W1_._m_=_W2_._n_) percases ( W1 . m = W2 . naa1 or W1 . m = W2 . (naa1 + 2) ) by A5, A17, GLIB_000:15; suppose W1 . m = W2 . naa1 ; ::_thesis: ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) hence ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) by A16, A13; ::_thesis: verum end; suppose W1 . m = W2 . (naa1 + 2) ; ::_thesis: ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) hence ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) by A13, A18, NAT_1:12; ::_thesis: verum end; end; end; hence ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) ; ::_thesis: verum end; supposeA19: m = len W1 ; ::_thesis: ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) len W1 <= len W2 by A1, Lm72; then A20: m <= len W2 by A2, XXREAL_0:2; W1 . m = W1 .last() by A19 .= W2 .last() by A1, Th161 .= W2 . (len W2) ; hence ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) by A20; ::_thesis: verum end; end; end; hence ex n being odd Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) ; ::_thesis: verum end; theorem :: GLIB_001:165 for G being _Graph for W1, W2 being Walk of G st W1 is Subwalk of W2 holds for m being even Element of NAT st 1 <= m & m <= len W1 holds ex n being even Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) proof let G be _Graph; ::_thesis: for W1, W2 being Walk of G st W1 is Subwalk of W2 holds for m being even Element of NAT st 1 <= m & m <= len W1 holds ex n being even Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) let W1, W2 be Walk of G; ::_thesis: ( W1 is Subwalk of W2 implies for m being even Element of NAT st 1 <= m & m <= len W1 holds ex n being even Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) ) assume W1 is Subwalk of W2 ; ::_thesis: for m being even Element of NAT st 1 <= m & m <= len W1 holds ex n being even Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) then A1: ex es being Subset of (W2 .edgeSeq()) st W1 .edgeSeq() = Seq es by Def32; let m be even Element of NAT ; ::_thesis: ( 1 <= m & m <= len W1 implies ex n being even Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) ) assume that A2: 1 <= m and A3: m <= len W1 ; ::_thesis: ex n being even Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) A4: W1 . m = (W1 .edgeSeq()) . (m div 2) by A2, A3, Lm40; m div 2 in dom (W1 .edgeSeq()) by A2, A3, Lm40; then consider ndiv2 being Element of NAT such that A5: ndiv2 in dom (W2 .edgeSeq()) and A6: m div 2 <= ndiv2 and A7: W1 . m = (W2 .edgeSeq()) . ndiv2 by A1, A4, Th4; A8: ndiv2 <= len (W2 .edgeSeq()) by A5, FINSEQ_3:25; 2 divides m by PEPIN:22; then A9: 2 * (m div 2) = m by NAT_D:3; 2 * ndiv2 in dom W2 by A5, Lm41; then A10: 2 * ndiv2 <= len W2 by FINSEQ_3:25; 1 <= ndiv2 by A5, FINSEQ_3:25; then W1 . m = W2 . (2 * ndiv2) by A7, A8, Def15; hence ex n being even Element of NAT st ( m <= n & n <= len W2 & W1 . m = W2 . n ) by A6, A9, A10, XREAL_1:64; ::_thesis: verum end; theorem :: GLIB_001:166 for G being _Graph for W1 being Trail of G st not W1 is trivial holds ex W2 being Path of W1 st not W2 is trivial proof let G be _Graph; ::_thesis: for W1 being Trail of G st not W1 is trivial holds ex W2 being Path of W1 st not W2 is trivial let W1 be Trail of G; ::_thesis: ( not W1 is trivial implies ex W2 being Path of W1 st not W2 is trivial ) assume not W1 is trivial ; ::_thesis: not for W2 being Path of W1 holds W2 is trivial then A1: 1 <> len W1 by Lm55; 1 <= len W1 by ABIAN:12; then A2: 1 < len W1 by A1, XXREAL_0:1; now__::_thesis:_not_for_P_being_Path_of_W1_holds_P_is_trivial percases ( W1 is open or W1 is closed ) ; supposeA3: W1 is open ; ::_thesis: not for P being Path of W1 holds P is trivial set P = the Path of W1; take P = the Path of W1; ::_thesis: not P is trivial A4: P .first() = W1 .first() by Th161; A5: P .last() = W1 .last() by Th161; W1 .first() <> W1 .last() by A3, Def24; hence not P is trivial by A4, A5, Lm55; ::_thesis: verum end; supposeA6: W1 is closed ; ::_thesis: not for W2 being Path of W1 holds W2 is trivial defpred S1[ Nat] means ( $1 is odd & 1 < $1 & $1 <= len W1 & W1 . $1 = W1 . (len W1) ); A7: ex k being Nat st S1[k] by A2; consider k being Nat such that A8: ( S1[k] & ( for m being Nat st S1[m] holds k <= m ) ) from NAT_1:sch_5(A7); reconsider k = k as odd Element of NAT by A8, ORDINAL1:def_12; 1 + 1 < k + 1 by A8, XREAL_1:8; then 2 <= k by NAT_1:13; then reconsider k2 = k - (2 * 1) as odd Element of NAT by INT_1:5; set W3 = W1 .remove (k,(len W1)); set W4 = (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2); set W5 = the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2); consider es5 being Subset of (((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq()) such that A9: the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .edgeSeq() = Seq es5 by Def32; A10: ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq() c= (W1 .remove (k,(len W1))) .edgeSeq() by Lm43; W1 . k = W1 .last() by A8; then A11: W1 .remove (k,(len W1)) = W1 .cut (1,k) by Th57; then (W1 .remove (k,(len W1))) .edgeSeq() c= W1 .edgeSeq() by Lm43; then ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq() c= W1 .edgeSeq() by A10, XBOOLE_1:1; then reconsider es5 = es5 as Subset of (W1 .edgeSeq()) by XBOOLE_1:1; A12: the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) is_Walk_from ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .first() ,((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .last() by Def32; A13: (len (W1 .remove (k,(len W1)))) + (len W1) = (len W1) + k by A8, Lm24; then A14: k2 <= (len (W1 .remove (k,(len W1)))) - 0 by XREAL_1:13; A15: 1 <= k2 by ABIAN:12; then ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .last() = (W1 .remove (k,(len W1))) . k2 by A14, Lm16; then A16: the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .last() = (W1 .remove (k,(len W1))) . k2 by A12, Def23; k2 in dom (W1 .remove (k,(len W1))) by A14, A15, FINSEQ_3:25; then A17: the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .last() = W1 . k2 by A8, A16, A11, Lm23; ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .first() = (W1 .remove (k,(len W1))) . 1 by A14, A15, Lm16; then A18: the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .first() = (W1 .remove (k,(len W1))) . 1 by A12, Def23; A19: W1 . 1 = W1 . (len W1) by A6, Th118; A20: now__::_thesis:_(_not_the_Path_of_(W1_.remove_(k,(len_W1)))_.cut_(((2_*_0)_+_1),k2)_is_trivial_implies_not_the_Path_of_(W1_.remove_(k,(len_W1)))_.cut_(((2_*_0)_+_1),k2)_is_closed_) 1 <= len (W1 .remove (k,(len W1))) by ABIAN:12; then A21: (2 * 0) + 1 in dom (W1 .remove (k,(len W1))) by FINSEQ_3:25; assume that A22: not the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) is trivial and A23: the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) is closed ; ::_thesis: contradiction the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .first() = W1 . k2 by A17, A23, Def24; then A24: W1 . k2 = W1 . (len W1) by A19, A8, A18, A11, A21, Lm23; now__::_thesis:_not_k2_=_1 assume k2 = 1 ; ::_thesis: contradiction then len ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) = 1 by A14, Lm22; then A25: len the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) <= 1 by Lm72; 1 <= len the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) by ABIAN:12; then len the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) = 1 by A25, XXREAL_0:1; hence contradiction by A22, Lm55; ::_thesis: verum end; then A26: 1 < k2 by A15, XXREAL_0:1; A27: k2 < k - 0 by XREAL_1:15; then k2 <= len W1 by A8, XXREAL_0:2; hence contradiction by A8, A24, A26, A27; ::_thesis: verum end; set e = W1 . (k2 + 1); set W2 = the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .addEdge (W1 . (k2 + 1)); k2 < (len W1) - 0 by A8, XREAL_1:15; then A28: W1 . (k2 + 1) Joins W1 . k2,W1 . (k2 + 2),G by Def3; A29: k2 < (len (W1 .remove (k,(len W1)))) - 0 by A13, XREAL_1:15; then A30: len ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) = k2 by Lm22; A31: now__::_thesis:_for_m_being_odd_Element_of_NAT_st_1_<_m_&_m_<=_len_the_Path_of_(W1_.remove_(k,(len_W1)))_.cut_(((2_*_0)_+_1),k2)_holds_ the_Path_of_(W1_.remove_(k,(len_W1)))_.cut_(((2_*_0)_+_1),k2)_._m_<>_W1_._k let m be odd Element of NAT ; ::_thesis: ( 1 < m & m <= len the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) implies the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) . m <> W1 . k ) assume that A32: 1 < m and A33: m <= len the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) ; ::_thesis: the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) . m <> W1 . k consider n being odd Element of NAT such that A34: m <= n and A35: n <= len ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) and A36: the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) . m = ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) . n by A33, Th164; A37: 1 < n by A32, A34, XXREAL_0:2; then n in dom ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) by A35, FINSEQ_3:25; then A38: the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) . m = (W1 .remove (k,(len W1))) . n by A14, A36, Lm23; A39: n + 0 < k2 + 2 by A30, A35, XREAL_1:8; then A40: n <= len W1 by A8, XXREAL_0:2; n in dom (W1 .remove (k,(len W1))) by A13, A37, A39, FINSEQ_3:25; then the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) . m = W1 . n by A8, A11, A38, Lm23; hence the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) . m <> W1 . k by A8, A37, A39, A40; ::_thesis: verum end; k2 + 1 <= k by A13, A29, NAT_1:13; then A41: k2 + 1 <= len W1 by A8, XXREAL_0:2; now__::_thesis:_not_W1_._(k2_+_1)_in_the_Path_of_(W1_.remove_(k,(len_W1)))_.cut_(((2_*_0)_+_1),k2)_.edges() assume A42: W1 . (k2 + 1) in the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .edges() ; ::_thesis: contradiction the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .edges() c= ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edges() by Th163; then consider n being even Element of NAT such that A43: 1 <= n and A44: n <= len ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) and A45: ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) . n = W1 . (k2 + 1) by A42, Lm46; A46: n < k2 + 1 by A30, A44, NAT_1:13; n <= k2 + 2 by A30, A44, NAT_1:12; then A47: n in dom (W1 .remove (k,(len W1))) by A13, A43, FINSEQ_3:25; n in dom ((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) by A43, A44, FINSEQ_3:25; then W1 . (k2 + 1) = (W1 .remove (k,(len W1))) . n by A14, A45, Lm23; then W1 . (k2 + 1) = W1 . n by A8, A11, A47, Lm23; hence contradiction by A41, A43, A46, Lm57; ::_thesis: verum end; then reconsider W2 = the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .addEdge (W1 . (k2 + 1)) as Path of G by A28, A17, A20, A31, Th150; set g = ((k2 + 1) div 2) .--> (W1 . (k2 + 1)); set es = es5 +* (((k2 + 1) div 2) .--> (W1 . (k2 + 1))); A48: dom (es5 +* (((k2 + 1) div 2) .--> (W1 . (k2 + 1)))) = (dom es5) \/ (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1)))) by FUNCT_4:def_1; A49: dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) = {((k2 + 1) div 2)} by FUNCOP_1:13; A50: (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) . ((k2 + 1) div 2) = W1 . (k2 + 1) by FUNCOP_1:72; A51: now__::_thesis:_for_z_being_set_st_z_in_es5_+*_(((k2_+_1)_div_2)_.-->_(W1_._(k2_+_1)))_holds_ z_in_W1_.edgeSeq() let z be set ; ::_thesis: ( z in es5 +* (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) implies z in W1 .edgeSeq() ) assume A52: z in es5 +* (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) ; ::_thesis: z in W1 .edgeSeq() then consider x, y being set such that A53: z = [x,y] by RELAT_1:def_1; A54: x in dom (es5 +* (((k2 + 1) div 2) .--> (W1 . (k2 + 1)))) by A52, A53, FUNCT_1:1; A55: y = (es5 +* (((k2 + 1) div 2) .--> (W1 . (k2 + 1)))) . x by A52, A53, FUNCT_1:1; now__::_thesis:_z_in_W1_.edgeSeq() percases ( x in dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) or not x in dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) ) ; supposeA56: x in dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) ; ::_thesis: z in W1 .edgeSeq() then A57: x = (k2 + 1) div 2 by TARSKI:def_1; A58: 1 <= k2 + 1 by NAT_1:12; then W1 . (k2 + 1) = (W1 .edgeSeq()) . x by A41, A57, Lm40; then A59: (W1 .edgeSeq()) . x = y by A48, A50, A54, A55, A56, A57, FUNCT_4:def_1; x in dom (W1 .edgeSeq()) by A41, A57, A58, Lm40; hence z in W1 .edgeSeq() by A53, A59, FUNCT_1:1; ::_thesis: verum end; supposeA60: not x in dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) ; ::_thesis: z in W1 .edgeSeq() then A61: x in dom es5 by A48, A54, XBOOLE_0:def_3; y = es5 . x by A48, A54, A55, A60, FUNCT_4:def_1; then z in es5 by A53, A61, FUNCT_1:1; hence z in W1 .edgeSeq() ; ::_thesis: verum end; end; end; hence z in W1 .edgeSeq() ; ::_thesis: verum end; then es5 +* (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) c= W1 .edgeSeq() by TARSKI:def_3; then dom (es5 +* (((k2 + 1) div 2) .--> (W1 . (k2 + 1)))) c= dom (W1 .edgeSeq()) by RELAT_1:11; then A62: dom (es5 +* (((k2 + 1) div 2) .--> (W1 . (k2 + 1)))) c= Seg (len (W1 .edgeSeq())) by FINSEQ_1:def_3; then reconsider es = es5 +* (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) as FinSubsequence by FINSEQ_1:def_12; reconsider es = es as Subset of (W1 .edgeSeq()) by A51, TARSKI:def_3; A63: dom es5 c= dom (((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq()) by GRAPH_2:25; now__::_thesis:_(_dom_es5_c=_Seg_(len_(W1_.edgeSeq()))_&_dom_(((k2_+_1)_div_2)_.-->_(W1_._(k2_+_1)))_c=_Seg_(len_(W1_.edgeSeq()))_&_(_for_x,_y_being_Element_of_NAT_st_x_in_dom_es5_&_y_in_dom_(((k2_+_1)_div_2)_.-->_(W1_._(k2_+_1)))_holds_ x_<_y_)_) thus ( dom es5 c= Seg (len (W1 .edgeSeq())) & dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) c= Seg (len (W1 .edgeSeq())) ) by A48, A62, XBOOLE_1:11; ::_thesis: for x, y being Element of NAT st x in dom es5 & y in dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) holds x < y let x, y be Element of NAT ; ::_thesis: ( x in dom es5 & y in dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) implies x < y ) assume that A64: x in dom es5 and A65: y in dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) ; ::_thesis: x < y x <= len (((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq()) by A63, A64, FINSEQ_3:25; then 2 * x <= 2 * (len (((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq())) by XREAL_1:64; then (2 * x) + 1 <= (2 * (len (((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq()))) + 1 by XREAL_1:7; then A66: (2 * x) + 1 <= k2 by A30, Def15; A67: 2 divides k2 + 1 by PEPIN:22; y = (k2 + 1) div 2 by A65, TARSKI:def_1; then 2 * y = k2 + 1 by A67, NAT_D:3; then (2 * x) + 1 < 2 * y by A66, NAT_1:13; then A68: ((2 * x) + 1) - 1 < (2 * y) - 0 by XREAL_1:14; then x <= y by XREAL_1:68; hence x < y by A68, XXREAL_0:1; ::_thesis: verum end; then A69: Sgm (dom es) = (Sgm (dom es5)) ^ (Sgm (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))))) by A48, FINSEQ_3:42; A70: k2 in dom (W1 .remove (k,(len W1))) by A15, A29, FINSEQ_3:25; then A71: the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .last() = W1 . k2 by A8, A16, A11, Lm23; now__::_thesis:_(_len_(W2_.edgeSeq())_=_len_(Seq_es)_&_(_for_x_being_Nat_st_1_<=_x_&_x_<=_len_(W2_.edgeSeq())_holds_ (W2_.edgeSeq())_._x_=_(Seq_es)_._x_)_) now__::_thesis:_not_(dom_es5)_/\_(dom_(((k2_+_1)_div_2)_.-->_(W1_._(k2_+_1))))_<>_{} assume (dom es5) /\ (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1)))) <> {} ; ::_thesis: contradiction then consider x being set such that A72: x in (dom es5) /\ (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1)))) by XBOOLE_0:def_1; x in dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) by A72, XBOOLE_0:def_4; then A73: x = (k2 + 1) div 2 by TARSKI:def_1; x in dom es5 by A72, XBOOLE_0:def_4; then (k2 + 1) div 2 <= len (((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq()) by A63, A73, FINSEQ_3:25; then A74: 2 * ((k2 + 1) div 2) <= 2 * (len (((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq())) by XREAL_1:64; 2 divides k2 + 1 by PEPIN:22; then k2 + 1 <= 2 * (len (((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq())) by A74, NAT_D:3; then (k2 + 1) + 1 <= (2 * (len (((W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) .edgeSeq()))) + 1 by XREAL_1:7; then (1 + 1) + k2 <= 0 + k2 by A30, Def15; hence contradiction by XREAL_1:6; ::_thesis: verum end; then A75: dom es5 misses dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) by XBOOLE_0:def_7; len W2 = (len the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) + 2 by A28, A71, Lm37; then A76: (len the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) + 2 = (2 * (len (W2 .edgeSeq()))) + 1 by Def15; A77: len (Sgm (dom es5)) = card (dom es5) by A48, A62, FINSEQ_3:39, XBOOLE_1:11 .= card es5 by CARD_1:62 .= len ( the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .edgeSeq()) by A9, Th5 ; A78: now__::_thesis:_not_(k2_+_1)_div_2_=_0 assume (k2 + 1) div 2 = 0 ; ::_thesis: contradiction then A79: 2 * ((k2 + 1) div 2) = 2 * 0 ; 2 divides k2 + 1 by PEPIN:22; hence contradiction by A79, NAT_D:3; ::_thesis: verum end; Sgm (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1)))) = Sgm {((k2 + 1) div 2)} by FUNCOP_1:13; then A80: Sgm (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1)))) = <*((k2 + 1) div 2)*> by A78, FINSEQ_3:44; then A81: len (Sgm (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))))) = 1 by FINSEQ_1:40; A82: (Sgm (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))))) . 1 = (k2 + 1) div 2 by A80, FINSEQ_1:40; set h = Sgm (dom es); A83: Seq es = es * (Sgm (dom es)) by FINSEQ_1:def_14; len (Seq es) = card es by Th5 .= card (dom es) by CARD_1:62 ; then len (Seq es) = (card (dom es5)) + (card (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))))) by A48, A75, CARD_2:40 .= (card (dom es5)) + 1 by A49, CARD_1:30 .= (card es5) + 1 by CARD_1:62 .= (len ( the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .edgeSeq())) + 1 by A9, Th5 ; then A84: (2 * (len (Seq es))) + 1 = ((2 * (len ( the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .edgeSeq()))) + 1) + 2 .= (2 * (len (W2 .edgeSeq()))) + 1 by A76, Def15 ; hence len (W2 .edgeSeq()) = len (Seq es) ; ::_thesis: for x being Nat st 1 <= x & x <= len (W2 .edgeSeq()) holds (W2 .edgeSeq()) . x = (Seq es) . x let x be Nat; ::_thesis: ( 1 <= x & x <= len (W2 .edgeSeq()) implies (W2 .edgeSeq()) . x = (Seq es) . x ) assume that A85: 1 <= x and A86: x <= len (W2 .edgeSeq()) ; ::_thesis: (W2 .edgeSeq()) . x = (Seq es) . x A87: dom es5 c= Seg (len (W1 .edgeSeq())) by A48, A62, XBOOLE_1:11; A88: x in dom (Seq es) by A84, A85, A86, FINSEQ_3:25; then A89: (Sgm (dom es)) . x in dom es by A83, FUNCT_1:11; A90: dom (Sgm (dom es)) = Seg ((len (Sgm (dom es5))) + (len (Sgm (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))))))) by A69, FINSEQ_1:def_7; A91: W1 . (k2 + 1) Joins the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .last() ,W1 . k,G by A8, A28, A16, A11, A70, Lm23; A92: (Seq es) . x = es . ((Sgm (dom es)) . x) by A83, A88, FUNCT_1:12; A93: x in dom (Sgm (dom es)) by A83, A88, FUNCT_1:11; now__::_thesis:_(Seq_es)_._x_=_W2_._(2_*_x) percases ( x <= len (Sgm (dom es5)) or len (Sgm (dom es5)) < x ) ; supposeA94: x <= len (Sgm (dom es5)) ; ::_thesis: (Seq es) . x = W2 . (2 * x) then A95: x in dom (Sgm (dom es5)) by A85, FINSEQ_3:25; then A96: (Sgm (dom es)) . x = (Sgm (dom es5)) . x by A69, FINSEQ_1:def_7; rng (Sgm (dom es5)) = dom es5 by A87, FINSEQ_1:def_13; then (Sgm (dom es)) . x in dom es5 by A95, A96, FUNCT_1:def_3; then not (Sgm (dom es)) . x in dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) by A75, XBOOLE_0:3; then A97: (Seq es) . x = es5 . ((Sgm (dom es5)) . x) by A48, A89, A92, A96, FUNCT_4:def_1; A98: x in dom ( the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .edgeSeq()) by A85, A77, A94, FINSEQ_3:25; then A99: 2 * x in dom the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) by Lm41; ( the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .edgeSeq()) . x = the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) . (2 * x) by A85, A77, A94, Def15; then A100: W2 . (2 * x) = ( the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .edgeSeq()) . x by A91, A99, Lm38 .= (es5 * (Sgm (dom es5))) . x by A9, FINSEQ_1:def_14 ; x in dom (es5 * (Sgm (dom es5))) by A9, A98, FINSEQ_1:def_14; hence (Seq es) . x = W2 . (2 * x) by A97, A100, FUNCT_1:12; ::_thesis: verum end; suppose len (Sgm (dom es5)) < x ; ::_thesis: (Seq es) . x = W2 . (2 * x) then A101: (len (Sgm (dom es5))) + 1 <= x by NAT_1:13; x <= (len (Sgm (dom es5))) + 1 by A93, A90, A81, FINSEQ_1:1; then A102: x = (len (Sgm (dom es5))) + 1 by A101, XXREAL_0:1; 1 in dom (Sgm (dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))))) by A81, FINSEQ_3:25; then A103: (Sgm (dom es)) . x = (k2 + 1) div 2 by A69, A82, A102, FINSEQ_1:def_7; then (Sgm (dom es)) . x in dom (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) by A49, TARSKI:def_1; then A104: (Seq es) . x = (((k2 + 1) div 2) .--> (W1 . (k2 + 1))) . ((k2 + 1) div 2) by A48, A89, A92, A103, FUNCT_4:def_1 .= W1 . (k2 + 1) by FUNCOP_1:72 .= W2 . ((len the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) + 1) by A91, Lm38 ; 2 * x = ((2 * (len ( the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .edgeSeq()))) + 1) + 1 by A77, A102 .= (len the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2)) + 1 by Def15 ; hence (Seq es) . x = W2 . (2 * x) by A104; ::_thesis: verum end; end; end; hence (W2 .edgeSeq()) . x = (Seq es) . x by A85, A86, Def15; ::_thesis: verum end; then A105: W2 .edgeSeq() = Seq es by FINSEQ_1:14; 1 <= len (W1 .remove (k,(len W1))) by ABIAN:12; then (2 * 0) + 1 in dom (W1 .remove (k,(len W1))) by FINSEQ_3:25; then the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) .first() = W1 .first() by A8, A18, A11, Lm23; then the Path of (W1 .remove (k,(len W1))) .cut (((2 * 0) + 1),k2) is_Walk_from W1 .first() ,W1 . k2 by A71, Def23; then W2 is_Walk_from W1 .first() ,W1 .last() by A8, A28, Lm39; then reconsider W2 = W2 as Path of W1 by A105, Def32; take W2 = W2; ::_thesis: not W2 is trivial thus not W2 is trivial by A28, A17, Th132; ::_thesis: verum end; end; end; hence not for W2 being Path of W1 holds W2 is trivial ; ::_thesis: verum end; theorem Th167: :: GLIB_001:167 for G1 being _Graph for G2 being Subgraph of G1 for W being Walk of G2 holds W is Walk of G1 proof let G1 be _Graph; ::_thesis: for G2 being Subgraph of G1 for W being Walk of G2 holds W is Walk of G1 let G2 be Subgraph of G1; ::_thesis: for W being Walk of G2 holds W is Walk of G1 let W be Walk of G2; ::_thesis: W is Walk of G1 set VG1 = the_Vertices_of G1; set VG2 = the_Vertices_of G2; set EG1 = the_Edges_of G1; set EG2 = the_Edges_of G2; A1: the_Edges_of G2 c= (the_Vertices_of G1) \/ (the_Edges_of G1) by XBOOLE_1:10; A2: now__::_thesis:_(_len_W_is_odd_&_W_._1_in_the_Vertices_of_G1_&_(_for_n_being_odd_Element_of_NAT_st_n_<_len_W_holds_ W_._(n_+_1)_Joins_W_._n,W_._(n_+_2),G1_)_) thus len W is odd ; ::_thesis: ( W . 1 in the_Vertices_of G1 & ( for n being odd Element of NAT st n < len W holds W . (n + 1) Joins W . n,W . (n + 2),G1 ) ) W . 1 in the_Vertices_of G2 by Def3; hence W . 1 in the_Vertices_of G1 ; ::_thesis: for n being odd Element of NAT st n < len W holds W . (n + 1) Joins W . n,W . (n + 2),G1 let n be odd Element of NAT ; ::_thesis: ( n < len W implies W . (n + 1) Joins W . n,W . (n + 2),G1 ) assume n < len W ; ::_thesis: W . (n + 1) Joins W . n,W . (n + 2),G1 then W . (n + 1) Joins W . n,W . (n + 2),G2 by Def3; hence W . (n + 1) Joins W . n,W . (n + 2),G1 by GLIB_000:72; ::_thesis: verum end; the_Vertices_of G2 c= (the_Vertices_of G1) \/ (the_Edges_of G1) by XBOOLE_1:10; then (the_Vertices_of G2) \/ (the_Edges_of G2) c= (the_Vertices_of G1) \/ (the_Edges_of G1) by A1, XBOOLE_1:8; then for y being set st y in rng W holds y in (the_Vertices_of G1) \/ (the_Edges_of G1) by TARSKI:def_3; then rng W c= (the_Vertices_of G1) \/ (the_Edges_of G1) by TARSKI:def_3; then W is FinSequence of (the_Vertices_of G1) \/ (the_Edges_of G1) by FINSEQ_1:def_4; hence W is Walk of G1 by A2, Def3; ::_thesis: verum end; theorem Th168: :: GLIB_001:168 for G1 being _Graph for G2 being Subgraph of G1 for W being Walk of G1 st W is trivial & W .first() in the_Vertices_of G2 holds W is Walk of G2 proof let G1 be _Graph; ::_thesis: for G2 being Subgraph of G1 for W being Walk of G1 st W is trivial & W .first() in the_Vertices_of G2 holds W is Walk of G2 let G2 be Subgraph of G1; ::_thesis: for W being Walk of G1 st W is trivial & W .first() in the_Vertices_of G2 holds W is Walk of G2 let W be Walk of G1; ::_thesis: ( W is trivial & W .first() in the_Vertices_of G2 implies W is Walk of G2 ) assume that A1: W is trivial and A2: W .first() in the_Vertices_of G2 ; ::_thesis: W is Walk of G2 consider v being Vertex of G1 such that A3: W = G1 .walkOf v by A1, Lm56; reconsider v9 = v as Vertex of G2 by A2, A3, Th13; W = G2 .walkOf v9 by A3; hence W is Walk of G2 ; ::_thesis: verum end; theorem Th169: :: GLIB_001:169 for G1 being _Graph for G2 being Subgraph of G1 for W being Walk of G1 st not W is trivial & W .edges() c= the_Edges_of G2 holds W is Walk of G2 proof let G1 be _Graph; ::_thesis: for G2 being Subgraph of G1 for W being Walk of G1 st not W is trivial & W .edges() c= the_Edges_of G2 holds W is Walk of G2 let G2 be Subgraph of G1; ::_thesis: for W being Walk of G1 st not W is trivial & W .edges() c= the_Edges_of G2 holds W is Walk of G2 let W be Walk of G1; ::_thesis: ( not W is trivial & W .edges() c= the_Edges_of G2 implies W is Walk of G2 ) assume that A1: not W is trivial and A2: W .edges() c= the_Edges_of G2 ; ::_thesis: W is Walk of G2 set VG2 = the_Vertices_of G2; set EG2 = the_Edges_of G2; set WV = W .vertices() ; set WE = W .edges() ; A3: now__::_thesis:_for_n_being_odd_Element_of_NAT_st_n_<=_len_W_holds_ W_._n_in_the_Vertices_of_G2 let n be odd Element of NAT ; ::_thesis: ( n <= len W implies W . n in the_Vertices_of G2 ) assume A4: n <= len W ; ::_thesis: W . n in the_Vertices_of G2 now__::_thesis:_W_._n_in_the_Vertices_of_G2 percases ( n = len W or n <> len W ) ; supposeA5: n = len W ; ::_thesis: W . n in the_Vertices_of G2 A6: 1 <= n by ABIAN:12; n <> 1 by A1, A5, Lm54; then 1 < n by A6, XXREAL_0:1; then 1 + 1 <= n by NAT_1:13; then reconsider n5 = n - (2 * 1) as odd Element of NAT by INT_1:5; n5 + 1 = n - (2 - 1) ; then A7: n5 + 1 <= (len W) - 0 by A5, XREAL_1:13; n5 < (len W) - 0 by A5, XREAL_1:15; then A8: W . (n5 + 1) Joins W . n5,W . (n5 + 2),G1 by Def3; 1 <= n5 + 1 by NAT_1:12; then W . (n5 + 1) in W .edges() by A7, Lm46; then W . (n5 + 1) Joins W . n5,W . (n5 + 2),G2 by A2, A8, GLIB_000:73; hence W . n in the_Vertices_of G2 by GLIB_000:13; ::_thesis: verum end; suppose n <> len W ; ::_thesis: W . n in the_Vertices_of G2 then A9: n < len W by A4, XXREAL_0:1; then A10: W . (n + 1) Joins W . n,W . (n + 2),G1 by Def3; A11: 1 <= n + 1 by NAT_1:12; n + 1 <= len W by A9, NAT_1:13; then W . (n + 1) in W .edges() by A11, Lm46; then W . (n + 1) Joins W . n,W . (n + 2),G2 by A2, A10, GLIB_000:73; hence W . n in the_Vertices_of G2 by GLIB_000:13; ::_thesis: verum end; end; end; hence W . n in the_Vertices_of G2 ; ::_thesis: verum end; now__::_thesis:_for_y_being_set_st_y_in_rng_W_holds_ y_in_(the_Vertices_of_G2)_\/_(the_Edges_of_G2) let y be set ; ::_thesis: ( y in rng W implies y in (the_Vertices_of G2) \/ (the_Edges_of G2) ) assume y in rng W ; ::_thesis: y in (the_Vertices_of G2) \/ (the_Edges_of G2) then A12: y in (W .vertices()) \/ (W .edges()) by Th101; now__::_thesis:_y_in_(the_Vertices_of_G2)_\/_(the_Edges_of_G2) percases ( y in W .vertices() or y in W .edges() ) by A12, XBOOLE_0:def_3; suppose y in W .vertices() ; ::_thesis: y in (the_Vertices_of G2) \/ (the_Edges_of G2) then ex n being odd Element of NAT st ( n <= len W & W . n = y ) by Lm45; then y in the_Vertices_of G2 by A3; hence y in (the_Vertices_of G2) \/ (the_Edges_of G2) by XBOOLE_0:def_3; ::_thesis: verum end; suppose y in W .edges() ; ::_thesis: y in (the_Vertices_of G2) \/ (the_Edges_of G2) hence y in (the_Vertices_of G2) \/ (the_Edges_of G2) by A2, XBOOLE_0:def_3; ::_thesis: verum end; end; end; hence y in (the_Vertices_of G2) \/ (the_Edges_of G2) ; ::_thesis: verum end; then rng W c= (the_Vertices_of G2) \/ (the_Edges_of G2) by TARSKI:def_3; then A13: W is FinSequence of (the_Vertices_of G2) \/ (the_Edges_of G2) by FINSEQ_1:def_4; now__::_thesis:_(_len_W_is_odd_&_W_._1_in_the_Vertices_of_G2_&_(_for_n_being_odd_Element_of_NAT_st_n_<_len_W_holds_ W_._(n_+_1)_Joins_W_._n,W_._(n_+_2),G2_)_) reconsider aa1 = 1 as odd Element of NAT by JORDAN12:2; thus len W is odd ; ::_thesis: ( W . 1 in the_Vertices_of G2 & ( for n being odd Element of NAT st n < len W holds W . (n + 1) Joins W . n,W . (n + 2),G2 ) ) aa1 <= len W by ABIAN:12; hence W . 1 in the_Vertices_of G2 by A3; ::_thesis: for n being odd Element of NAT st n < len W holds W . (n + 1) Joins W . n,W . (n + 2),G2 let n be odd Element of NAT ; ::_thesis: ( n < len W implies W . (n + 1) Joins W . n,W . (n + 2),G2 ) A14: 1 <= n + 1 by NAT_1:12; assume A15: n < len W ; ::_thesis: W . (n + 1) Joins W . n,W . (n + 2),G2 then A16: W . (n + 1) Joins W . n,W . (n + 2),G1 by Def3; n + 1 <= len W by A15, NAT_1:13; then W . (n + 1) in W .edges() by A14, Lm46; hence W . (n + 1) Joins W . n,W . (n + 2),G2 by A2, A16, GLIB_000:73; ::_thesis: verum end; hence W is Walk of G2 by A13, Def3; ::_thesis: verum end; theorem Th170: :: GLIB_001:170 for G1 being _Graph for G2 being Subgraph of G1 for W being Walk of G1 st W .vertices() c= the_Vertices_of G2 & W .edges() c= the_Edges_of G2 holds W is Walk of G2 proof let G1 be _Graph; ::_thesis: for G2 being Subgraph of G1 for W being Walk of G1 st W .vertices() c= the_Vertices_of G2 & W .edges() c= the_Edges_of G2 holds W is Walk of G2 let G2 be Subgraph of G1; ::_thesis: for W being Walk of G1 st W .vertices() c= the_Vertices_of G2 & W .edges() c= the_Edges_of G2 holds W is Walk of G2 let W be Walk of G1; ::_thesis: ( W .vertices() c= the_Vertices_of G2 & W .edges() c= the_Edges_of G2 implies W is Walk of G2 ) assume that A1: W .vertices() c= the_Vertices_of G2 and A2: W .edges() c= the_Edges_of G2 ; ::_thesis: W is Walk of G2 now__::_thesis:_W_is_Walk_of_G2 percases ( not W is trivial or W is trivial ) ; suppose not W is trivial ; ::_thesis: W is Walk of G2 hence W is Walk of G2 by A2, Th169; ::_thesis: verum end; supposeA3: W is trivial ; ::_thesis: W is Walk of G2 W .first() in W .vertices() by Th88; hence W is Walk of G2 by A1, A3, Th168; ::_thesis: verum end; end; end; hence W is Walk of G2 ; ::_thesis: verum end; theorem :: GLIB_001:171 for G1 being non trivial _Graph for W being Walk of G1 for v being Vertex of G1 for G2 being removeVertex of G1,v st not v in W .vertices() holds W is Walk of G2 proof let G1 be non trivial _Graph; ::_thesis: for W being Walk of G1 for v being Vertex of G1 for G2 being removeVertex of G1,v st not v in W .vertices() holds W is Walk of G2 let W be Walk of G1; ::_thesis: for v being Vertex of G1 for G2 being removeVertex of G1,v st not v in W .vertices() holds W is Walk of G2 let v be Vertex of G1; ::_thesis: for G2 being removeVertex of G1,v st not v in W .vertices() holds W is Walk of G2 let G2 be removeVertex of G1,v; ::_thesis: ( not v in W .vertices() implies W is Walk of G2 ) assume A1: not v in W .vertices() ; ::_thesis: W is Walk of G2 set EG2 = (the_Edges_of G1) \ (v .edgesInOut()); set W2 = W; set VG2 = (the_Vertices_of G1) \ {v}; v .edgesInOut() = G1 .edgesInOut {v} by GLIB_000:def_40; then A2: (the_Edges_of G1) \ (v .edgesInOut()) = G1 .edgesBetween ((the_Vertices_of G1) \ {v}) by GLIB_000:35; now__::_thesis:_for_y_being_set_st_y_in_rng_W_holds_ y_in_(the_Vertices_of_G2)_\/_(the_Edges_of_G2) let y be set ; ::_thesis: ( y in rng W implies y in (the_Vertices_of G2) \/ (the_Edges_of G2) ) assume y in rng W ; ::_thesis: y in (the_Vertices_of G2) \/ (the_Edges_of G2) then consider x being set such that A3: x in dom W and A4: y = W . x by FUNCT_1:def_3; reconsider x = x as Element of NAT by A3; A5: x <= len W by A3, FINSEQ_3:25; now__::_thesis:_y_in_((the_Vertices_of_G1)_\_{v})_\/_((the_Edges_of_G1)_\_(v_.edgesInOut())) percases ( x is odd or x is even ) ; supposeA6: x is odd ; ::_thesis: y in ((the_Vertices_of G1) \ {v}) \/ ((the_Edges_of G1) \ (v .edgesInOut())) A7: now__::_thesis:_not_y_in_{v} assume y in {v} ; ::_thesis: contradiction then not y in W .vertices() by A1, TARSKI:def_1; hence contradiction by A4, A5, A6, Lm45; ::_thesis: verum end; y in the_Vertices_of G1 by A4, A5, A6, Lm1; then y in (the_Vertices_of G1) \ {v} by A7, XBOOLE_0:def_5; hence y in ((the_Vertices_of G1) \ {v}) \/ ((the_Edges_of G1) \ (v .edgesInOut())) by XBOOLE_0:def_3; ::_thesis: verum end; suppose x is even ; ::_thesis: y in ((the_Vertices_of G1) \ {v}) \/ ((the_Edges_of G1) \ (v .edgesInOut())) then reconsider x = x as even Element of NAT ; consider xaa1 being odd Element of NAT such that A8: xaa1 = x - 1 and A9: x - 1 in dom W and A10: x + 1 in dom W and A11: W . x Joins W . xaa1,W . (x + 1),G1 by A3, Lm2; A12: x + 1 <= len W by A10, FINSEQ_3:25; A13: xaa1 <= len W by A8, A9, FINSEQ_3:25; A14: now__::_thesis:_not_y_in_v_.edgesInOut() assume y in v .edgesInOut() ; ::_thesis: contradiction then A15: y in (v .edgesIn()) \/ (v .edgesOut()) by GLIB_000:60; now__::_thesis:_(_v_=_W_._xaa1_or_v_=_W_._(x_+_1)_) percases ( y in v .edgesIn() or y in v .edgesOut() ) by A15, XBOOLE_0:def_3; suppose y in v .edgesIn() ; ::_thesis: ( v = W . xaa1 or v = W . (x + 1) ) then (the_Target_of G1) . y = v by GLIB_000:56; hence ( v = W . xaa1 or v = W . (x + 1) ) by A4, A11, GLIB_000:def_13; ::_thesis: verum end; suppose y in v .edgesOut() ; ::_thesis: ( v = W . xaa1 or v = W . (x + 1) ) then (the_Source_of G1) . y = v by GLIB_000:58; hence ( v = W . xaa1 or v = W . (x + 1) ) by A4, A11, GLIB_000:def_13; ::_thesis: verum end; end; end; then ( v = W .vertexAt xaa1 or v = W .vertexAt (x + 1) ) by A13, A12, Def8; hence contradiction by A1, A13, A12, Th89; ::_thesis: verum end; y in the_Edges_of G1 by A4, A11, GLIB_000:def_13; then y in (the_Edges_of G1) \ (v .edgesInOut()) by A14, XBOOLE_0:def_5; hence y in ((the_Vertices_of G1) \ {v}) \/ ((the_Edges_of G1) \ (v .edgesInOut())) by XBOOLE_0:def_3; ::_thesis: verum end; end; end; then y in (the_Vertices_of G2) \/ ((the_Edges_of G1) \ (v .edgesInOut())) by GLIB_000:47; hence y in (the_Vertices_of G2) \/ (the_Edges_of G2) by A2, GLIB_000:47; ::_thesis: verum end; then rng W c= (the_Vertices_of G2) \/ (the_Edges_of G2) by TARSKI:def_3; then reconsider W2 = W as FinSequence of (the_Vertices_of G2) \/ (the_Edges_of G2) by FINSEQ_1:def_4; now__::_thesis:_(_len_W2_is_odd_&_W2_._1_in_the_Vertices_of_G2_&_(_for_n_being_odd_Element_of_NAT_st_n_<_len_W2_holds_ W_._(n_+_1)_Joins_W_._n,W_._(n_+_2),G2_)_) reconsider lenW2 = len W2 as odd Element of NAT ; thus len W2 is odd ; ::_thesis: ( W2 . 1 in the_Vertices_of G2 & ( for n being odd Element of NAT st n < len W2 holds W . (n + 1) Joins W . n,W . (n + 2),G2 ) ) W .first() in W .vertices() by Th88; then A16: not W2 . 1 in {v} by A1, TARSKI:def_1; W .first() in the_Vertices_of G1 ; then W2 . 1 in (the_Vertices_of G1) \ {v} by A16, XBOOLE_0:def_5; hence W2 . 1 in the_Vertices_of G2 by GLIB_000:47; ::_thesis: for n being odd Element of NAT st n < len W2 holds W . (n + 1) Joins W . n,W . (n + 2),G2 let n be odd Element of NAT ; ::_thesis: ( n < len W2 implies W . (n + 1) Joins W . n,W . (n + 2),G2 ) assume A17: n < len W2 ; ::_thesis: W . (n + 1) Joins W . n,W . (n + 2),G2 then A18: W . (n + 1) Joins W . n,W . (n + 2),G1 by Def3; then A19: W . (n + 1) in the_Edges_of G1 by GLIB_000:def_13; n + 1 <= len W2 by A17, NAT_1:13; then n + 1 < lenW2 by XXREAL_0:1; then (n + 1) + 1 <= len W2 by NAT_1:13; then A20: W . (n + 2) <> v by A1, Lm45; W . n <> v by A1, A17, Lm45; then not W . (n + 1) in v .edgesInOut() by A18, A20, GLIB_000:65; then W . (n + 1) in (the_Edges_of G1) \ (v .edgesInOut()) by A19, XBOOLE_0:def_5; then W . (n + 1) in the_Edges_of G2 by A2, GLIB_000:47; hence W . (n + 1) Joins W . n,W . (n + 2),G2 by A18, GLIB_000:73; ::_thesis: verum end; hence W is Walk of G2 by Def3; ::_thesis: verum end; theorem :: GLIB_001:172 for G1 being _Graph for W being Walk of G1 for e being set for G2 being removeEdge of G1,e st not e in W .edges() holds W is Walk of G2 proof let G1 be _Graph; ::_thesis: for W being Walk of G1 for e being set for G2 being removeEdge of G1,e st not e in W .edges() holds W is Walk of G2 let W be Walk of G1; ::_thesis: for e being set for G2 being removeEdge of G1,e st not e in W .edges() holds W is Walk of G2 let e be set ; ::_thesis: for G2 being removeEdge of G1,e st not e in W .edges() holds W is Walk of G2 let G2 be removeEdge of G1,e; ::_thesis: ( not e in W .edges() implies W is Walk of G2 ) A1: the_Edges_of G2 = (the_Edges_of G1) \ {e} by GLIB_000:53; assume A2: not e in W .edges() ; ::_thesis: W is Walk of G2 now__::_thesis:_for_x_being_set_st_x_in_W_.edges()_holds_ x_in_the_Edges_of_G2 let x be set ; ::_thesis: ( x in W .edges() implies x in the_Edges_of G2 ) assume A3: x in W .edges() ; ::_thesis: x in the_Edges_of G2 then not x in {e} by A2, TARSKI:def_1; hence x in the_Edges_of G2 by A1, A3, XBOOLE_0:def_5; ::_thesis: verum end; then A4: W .edges() c= the_Edges_of G2 by TARSKI:def_3; the_Vertices_of G2 = the_Vertices_of G1 by GLIB_000:53; then W .vertices() c= the_Vertices_of G2 ; hence W is Walk of G2 by A4, Th170; ::_thesis: verum end; theorem Th173: :: GLIB_001:173 for G1 being _Graph for G2 being Subgraph of G1 for x, y, e being set st e Joins x,y,G2 holds G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) proof let G1 be _Graph; ::_thesis: for G2 being Subgraph of G1 for x, y, e being set st e Joins x,y,G2 holds G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) let G2 be Subgraph of G1; ::_thesis: for x, y, e being set st e Joins x,y,G2 holds G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) let x, y, e be set ; ::_thesis: ( e Joins x,y,G2 implies G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) ) assume A1: e Joins x,y,G2 ; ::_thesis: G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) then A2: e Joins x,y,G1 by GLIB_000:72; G2 .walkOf (x,e,y) = <*x,e,y*> by A1, Def5; hence G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) by A2, Def5; ::_thesis: verum end; theorem :: GLIB_001:174 for G1 being _Graph for G2 being Subgraph of G1 for W1 being Walk of G1 for W2 being Walk of G2 for e being set st W1 = W2 & e in (W2 .last()) .edgesInOut() holds W1 .addEdge e = W2 .addEdge e proof let G1 be _Graph; ::_thesis: for G2 being Subgraph of G1 for W1 being Walk of G1 for W2 being Walk of G2 for e being set st W1 = W2 & e in (W2 .last()) .edgesInOut() holds W1 .addEdge e = W2 .addEdge e let G2 be Subgraph of G1; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 for e being set st W1 = W2 & e in (W2 .last()) .edgesInOut() holds W1 .addEdge e = W2 .addEdge e let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 for e being set st W1 = W2 & e in (W2 .last()) .edgesInOut() holds W1 .addEdge e = W2 .addEdge e let W2 be Walk of G2; ::_thesis: for e being set st W1 = W2 & e in (W2 .last()) .edgesInOut() holds W1 .addEdge e = W2 .addEdge e let e be set ; ::_thesis: ( W1 = W2 & e in (W2 .last()) .edgesInOut() implies W1 .addEdge e = W2 .addEdge e ) assume that A1: W1 = W2 and A2: e in (W2 .last()) .edgesInOut() ; ::_thesis: W1 .addEdge e = W2 .addEdge e set W2B = G2 .walkOf ((W2 .last()),e,((W2 .last()) .adj e)); set W1B = G1 .walkOf ((W1 .last()),e,((W1 .last()) .adj e)); A3: e Joins W2 .last() ,(W2 .last()) .adj e,G2 by A2, GLIB_000:67; (W1 .last()) .adj e = (W2 .last()) .adj e by A1, A2, GLIB_000:80; then G1 .walkOf ((W1 .last()),e,((W1 .last()) .adj e)) = G2 .walkOf ((W2 .last()),e,((W2 .last()) .adj e)) by A1, A3, Th173; hence W1 .addEdge e = W2 .addEdge e by A1, Th35; ::_thesis: verum end; theorem Th175: :: GLIB_001:175 for G1 being _Graph for G2 being Subgraph of G1 for W being Walk of G2 holds ( ( W is closed implies W is closed Walk of G1 ) & ( W is directed implies W is directed Walk of G1 ) & ( W is trivial implies W is trivial Walk of G1 ) & ( W is Trail-like implies W is Trail-like Walk of G1 ) & ( W is Path-like implies W is Path-like Walk of G1 ) & ( W is vertex-distinct implies W is vertex-distinct Walk of G1 ) ) proof let G1 be _Graph; ::_thesis: for G2 being Subgraph of G1 for W being Walk of G2 holds ( ( W is closed implies W is closed Walk of G1 ) & ( W is directed implies W is directed Walk of G1 ) & ( W is trivial implies W is trivial Walk of G1 ) & ( W is Trail-like implies W is Trail-like Walk of G1 ) & ( W is Path-like implies W is Path-like Walk of G1 ) & ( W is vertex-distinct implies W is vertex-distinct Walk of G1 ) ) let G2 be Subgraph of G1; ::_thesis: for W being Walk of G2 holds ( ( W is closed implies W is closed Walk of G1 ) & ( W is directed implies W is directed Walk of G1 ) & ( W is trivial implies W is trivial Walk of G1 ) & ( W is Trail-like implies W is Trail-like Walk of G1 ) & ( W is Path-like implies W is Path-like Walk of G1 ) & ( W is vertex-distinct implies W is vertex-distinct Walk of G1 ) ) let W be Walk of G2; ::_thesis: ( ( W is closed implies W is closed Walk of G1 ) & ( W is directed implies W is directed Walk of G1 ) & ( W is trivial implies W is trivial Walk of G1 ) & ( W is Trail-like implies W is Trail-like Walk of G1 ) & ( W is Path-like implies W is Path-like Walk of G1 ) & ( W is vertex-distinct implies W is vertex-distinct Walk of G1 ) ) reconsider W9 = W as Walk of G1 by Th167; hereby ::_thesis: ( ( W is directed implies W is directed Walk of G1 ) & ( W is trivial implies W is trivial Walk of G1 ) & ( W is Trail-like implies W is Trail-like Walk of G1 ) & ( W is Path-like implies W is Path-like Walk of G1 ) & ( W is vertex-distinct implies W is vertex-distinct Walk of G1 ) ) assume W is closed ; ::_thesis: W is closed Walk of G1 then W .first() = W .last() by Def24; then W9 .first() = W9 .last() ; hence W is closed Walk of G1 by Def24; ::_thesis: verum end; hereby ::_thesis: ( ( W is trivial implies W is trivial Walk of G1 ) & ( W is Trail-like implies W is Trail-like Walk of G1 ) & ( W is Path-like implies W is Path-like Walk of G1 ) & ( W is vertex-distinct implies W is vertex-distinct Walk of G1 ) ) assume A1: W is directed ; ::_thesis: W is directed Walk of G1 now__::_thesis:_for_n_being_odd_Element_of_NAT_st_n_<_len_W9_holds_ (the_Source_of_G1)_._(W9_._(n_+_1))_=_W9_._n let n be odd Element of NAT ; ::_thesis: ( n < len W9 implies (the_Source_of G1) . (W9 . (n + 1)) = W9 . n ) A2: 1 <= n + 1 by NAT_1:12; assume A3: n < len W9 ; ::_thesis: (the_Source_of G1) . (W9 . (n + 1)) = W9 . n then n + 1 <= len W9 by NAT_1:13; then n + 1 in dom W9 by A2, FINSEQ_3:25; then A4: W9 . (n + 1) in the_Edges_of G2 by Th8; (the_Source_of G2) . (W9 . (n + 1)) = W9 . n by A1, A3, Def25; hence (the_Source_of G1) . (W9 . (n + 1)) = W9 . n by A4, GLIB_000:def_32; ::_thesis: verum end; hence W is directed Walk of G1 by Def25; ::_thesis: verum end; hereby ::_thesis: ( ( W is Trail-like implies W is Trail-like Walk of G1 ) & ( W is Path-like implies W is Path-like Walk of G1 ) & ( W is vertex-distinct implies W is vertex-distinct Walk of G1 ) ) assume W is trivial ; ::_thesis: W is trivial Walk of G1 then len W9 = 1 by Lm55; hence W is trivial Walk of G1 by Lm54; ::_thesis: verum end; A5: now__::_thesis:_(_W_is_Trail-like_implies_W_is_Trail-like_Walk_of_G1_) assume W is Trail-like ; ::_thesis: W is Trail-like Walk of G1 then for m, n being even Element of NAT st 1 <= m & m < n & n <= len W holds W9 . m <> W9 . n by Lm57; hence W is Trail-like Walk of G1 by Lm57; ::_thesis: verum end; hence ( W is Trail-like implies W is Trail-like Walk of G1 ) ; ::_thesis: ( ( W is Path-like implies W is Path-like Walk of G1 ) & ( W is vertex-distinct implies W is vertex-distinct Walk of G1 ) ) now__::_thesis:_(_W_is_Path-like_implies_W_is_Path-like_Walk_of_G1_) assume A6: W is Path-like ; ::_thesis: W is Path-like Walk of G1 then for m, n being odd Element of NAT st m < n & n <= len W9 & W9 . m = W9 . n holds ( m = 1 & n = len W9 ) by Def28; hence W is Path-like Walk of G1 by A5, A6, Def28; ::_thesis: verum end; hence ( W is Path-like implies W is Path-like Walk of G1 ) ; ::_thesis: ( W is vertex-distinct implies W is vertex-distinct Walk of G1 ) hereby ::_thesis: verum assume W is vertex-distinct ; ::_thesis: W is vertex-distinct Walk of G1 then for m, n being odd Element of NAT st m <= len W9 & n <= len W9 & W9 . m = W9 . n holds m = n by Def29; hence W is vertex-distinct Walk of G1 by Def29; ::_thesis: verum end; end; theorem Th176: :: GLIB_001:176 for G1 being _Graph for G2 being Subgraph of G1 for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) proof let G1 be _Graph; ::_thesis: for G2 being Subgraph of G1 for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) let G2 be Subgraph of G1; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 st W1 = W2 holds ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 st W1 = W2 holds ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) let W2 be Walk of G2; ::_thesis: ( W1 = W2 implies ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) ) assume A1: W1 = W2 ; ::_thesis: ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) then A2: W1 .last() = W2 .last() ; A3: ( W1 is closed iff W1 .first() = W1 .last() ) by Def24; W1 .first() = W2 .first() by A1; hence ( W1 is closed iff W2 is closed ) by A3, A2, Def24; ::_thesis: ( ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) now__::_thesis:_(_(_W1_is_directed_implies_W2_is_directed_)_&_(_W2_is_directed_implies_W1_is_directed_Walk_of_G1_)_) hereby ::_thesis: ( W2 is directed implies W1 is directed Walk of G1 ) assume A4: W1 is directed ; ::_thesis: W2 is directed now__::_thesis:_for_n_being_odd_Element_of_NAT_st_n_<_len_W2_holds_ (the_Source_of_G2)_._(W2_._(n_+_1))_=_W2_._n let n be odd Element of NAT ; ::_thesis: ( n < len W2 implies (the_Source_of G2) . (W2 . (n + 1)) = W2 . n ) A5: 1 <= n + 1 by NAT_1:12; assume A6: n < len W2 ; ::_thesis: (the_Source_of G2) . (W2 . (n + 1)) = W2 . n then n + 1 <= len W2 by NAT_1:13; then n + 1 in dom W2 by A5, FINSEQ_3:25; then W2 . (n + 1) in the_Edges_of G2 by Th8; then (the_Source_of G2) . (W2 . (n + 1)) = (the_Source_of G1) . (W2 . (n + 1)) by GLIB_000:def_32; hence (the_Source_of G2) . (W2 . (n + 1)) = W2 . n by A1, A4, A6, Def25; ::_thesis: verum end; hence W2 is directed by Def25; ::_thesis: verum end; assume W2 is directed ; ::_thesis: W1 is directed Walk of G1 hence W1 is directed Walk of G1 by A1, Th175; ::_thesis: verum end; hence ( W1 is directed iff W2 is directed ) ; ::_thesis: ( ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) ( W1 is trivial iff len W2 = 1 ) by A1, Lm55; hence ( W1 is trivial iff W2 is trivial ) by Lm55; ::_thesis: ( ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) ( W1 is Trail-like iff for m, n being even Element of NAT st 1 <= m & m < n & n <= len W2 holds W2 . m <> W2 . n ) by A1, Lm57; hence A7: ( W1 is Trail-like iff W2 is Trail-like ) by Lm57; ::_thesis: ( ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) ( W1 is Path-like iff ( W1 is Trail-like & ( for m, n being odd Element of NAT st m < n & n <= len W2 & W2 . m = W2 . n holds ( m = 1 & n = len W2 ) ) ) ) by A1, Def28; hence ( W1 is Path-like iff W2 is Path-like ) by A7, Def28; ::_thesis: ( W1 is vertex-distinct iff W2 is vertex-distinct ) ( W1 is vertex-distinct iff for m, n being odd Element of NAT st m <= len W2 & n <= len W2 & W2 . m = W2 . n holds m = n ) by A1, Def29; hence ( W1 is vertex-distinct iff W2 is vertex-distinct ) by Def29; ::_thesis: verum end; theorem :: GLIB_001:177 for G1, G2 being _Graph for x being set st G1 == G2 & x is VertexSeq of G1 holds x is VertexSeq of G2 proof let G1, G2 be _Graph; ::_thesis: for x being set st G1 == G2 & x is VertexSeq of G1 holds x is VertexSeq of G2 let x be set ; ::_thesis: ( G1 == G2 & x is VertexSeq of G1 implies x is VertexSeq of G2 ) assume that A1: G1 == G2 and A2: x is VertexSeq of G1 ; ::_thesis: x is VertexSeq of G2 reconsider x2 = x as FinSequence of the_Vertices_of G2 by A1, A2, GLIB_000:def_34; now__::_thesis:_for_n_being_Element_of_NAT_st_1_<=_n_&_n_<_len_x2_holds_ ex_e_being_set_st_e_Joins_x2_._n,x2_._(n_+_1),G2 let n be Element of NAT ; ::_thesis: ( 1 <= n & n < len x2 implies ex e being set st e Joins x2 . n,x2 . (n + 1),G2 ) assume that A3: 1 <= n and A4: n < len x2 ; ::_thesis: ex e being set st e Joins x2 . n,x2 . (n + 1),G2 consider e being set such that A5: e Joins x2 . n,x2 . (n + 1),G1 by A2, A3, A4, Def1; e Joins x2 . n,x2 . (n + 1),G2 by A1, A5, GLIB_000:88; hence ex e being set st e Joins x2 . n,x2 . (n + 1),G2 ; ::_thesis: verum end; hence x is VertexSeq of G2 by Def1; ::_thesis: verum end; theorem :: GLIB_001:178 for G1, G2 being _Graph for x being set st G1 == G2 & x is EdgeSeq of G1 holds x is EdgeSeq of G2 proof let G1, G2 be _Graph; ::_thesis: for x being set st G1 == G2 & x is EdgeSeq of G1 holds x is EdgeSeq of G2 let x be set ; ::_thesis: ( G1 == G2 & x is EdgeSeq of G1 implies x is EdgeSeq of G2 ) assume that A1: G1 == G2 and A2: x is EdgeSeq of G1 ; ::_thesis: x is EdgeSeq of G2 reconsider es = x as EdgeSeq of G1 by A2; reconsider es2 = es as FinSequence of the_Edges_of G2 by A1, GLIB_000:def_34; consider vs being FinSequence of the_Vertices_of G1 such that A3: len vs = (len es) + 1 and A4: for n being Element of NAT st 1 <= n & n <= len es holds es . n Joins vs . n,vs . (n + 1),G1 by Def2; now__::_thesis:_ex_vs_being_FinSequence_of_the_Vertices_of_G2_st_ (_len_vs_=_(len_es)_+_1_&_(_for_n_being_Element_of_NAT_st_1_<=_n_&_n_<=_len_es2_holds_ es2_._n_Joins_vs_._n,vs_._(n_+_1),G2_)_) reconsider vs = vs as FinSequence of the_Vertices_of G2 by A1, GLIB_000:def_34; take vs = vs; ::_thesis: ( len vs = (len es) + 1 & ( for n being Element of NAT st 1 <= n & n <= len es2 holds es2 . n Joins vs . n,vs . (n + 1),G2 ) ) thus len vs = (len es) + 1 by A3; ::_thesis: for n being Element of NAT st 1 <= n & n <= len es2 holds es2 . n Joins vs . n,vs . (n + 1),G2 let n be Element of NAT ; ::_thesis: ( 1 <= n & n <= len es2 implies es2 . n Joins vs . n,vs . (n + 1),G2 ) assume that A5: 1 <= n and A6: n <= len es2 ; ::_thesis: es2 . n Joins vs . n,vs . (n + 1),G2 es2 . n Joins vs . n,vs . (n + 1),G1 by A4, A5, A6; hence es2 . n Joins vs . n,vs . (n + 1),G2 by A1, GLIB_000:88; ::_thesis: verum end; hence x is EdgeSeq of G2 by Def2; ::_thesis: verum end; theorem :: GLIB_001:179 for G1, G2 being _Graph for x being set st G1 == G2 & x is Walk of G1 holds x is Walk of G2 proof let G1, G2 be _Graph; ::_thesis: for x being set st G1 == G2 & x is Walk of G1 holds x is Walk of G2 let x be set ; ::_thesis: ( G1 == G2 & x is Walk of G1 implies x is Walk of G2 ) assume that A1: G1 == G2 and A2: x is Walk of G1 ; ::_thesis: x is Walk of G2 A3: the_Vertices_of G1 = the_Vertices_of G2 by A1, GLIB_000:def_34; then reconsider W = x as FinSequence of (the_Vertices_of G2) \/ (the_Edges_of G2) by A1, A2, GLIB_000:def_34; A4: now__::_thesis:_for_n_being_odd_Element_of_NAT_st_n_<_len_W_holds_ W_._(n_+_1)_Joins_W_._n,W_._(n_+_2),G2 let n be odd Element of NAT ; ::_thesis: ( n < len W implies W . (n + 1) Joins W . n,W . (n + 2),G2 ) assume n < len W ; ::_thesis: W . (n + 1) Joins W . n,W . (n + 2),G2 then W . (n + 1) Joins W . n,W . (n + 2),G1 by A2, Def3; hence W . (n + 1) Joins W . n,W . (n + 2),G2 by A1, GLIB_000:88; ::_thesis: verum end; W . 1 in the_Vertices_of G2 by A2, A3, Def3; hence x is Walk of G2 by A2, A4, Def3; ::_thesis: verum end; theorem :: GLIB_001:180 for G1, G2 being _Graph for x, e, y being set st G1 == G2 holds G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) proof let G1, G2 be _Graph; ::_thesis: for x, e, y being set st G1 == G2 holds G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) let x, e, y be set ; ::_thesis: ( G1 == G2 implies G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) ) assume A1: G1 == G2 ; ::_thesis: G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) now__::_thesis:_G1_.walkOf_(x,e,y)_=_G2_.walkOf_(x,e,y) percases ( e Joins x,y,G1 or not e Joins x,y,G1 ) ; supposeA2: e Joins x,y,G1 ; ::_thesis: G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) then A3: e Joins x,y,G2 by A1, GLIB_000:88; thus G1 .walkOf (x,e,y) = <*x,e,y*> by A2, Def5 .= G2 .walkOf (x,e,y) by A3, Def5 ; ::_thesis: verum end; supposeA4: not e Joins x,y,G1 ; ::_thesis: G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) then A5: not e Joins x,y,G2 by A1, GLIB_000:88; thus G1 .walkOf (x,e,y) = G1 .walkOf (choose (the_Vertices_of G1)) by A4, Def5 .= G2 .walkOf (choose (the_Vertices_of G2)) by A1, GLIB_000:def_34 .= G2 .walkOf (x,e,y) by A5, Def5 ; ::_thesis: verum end; end; end; hence G1 .walkOf (x,e,y) = G2 .walkOf (x,e,y) ; ::_thesis: verum end; theorem :: GLIB_001:181 for G1, G2 being _Graph for W1 being Walk of G1 for W2 being Walk of G2 st G1 == G2 & W1 = W2 holds ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) proof let G1, G2 be _Graph; ::_thesis: for W1 being Walk of G1 for W2 being Walk of G2 st G1 == G2 & W1 = W2 holds ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) let W1 be Walk of G1; ::_thesis: for W2 being Walk of G2 st G1 == G2 & W1 = W2 holds ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) let W2 be Walk of G2; ::_thesis: ( G1 == G2 & W1 = W2 implies ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) ) assume that A1: G1 == G2 and A2: W1 = W2 ; ::_thesis: ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) G1 is Subgraph of G2 by A1, GLIB_000:87; hence ( ( W1 is closed implies W2 is closed ) & ( W2 is closed implies W1 is closed ) & ( W1 is directed implies W2 is directed ) & ( W2 is directed implies W1 is directed ) & ( W1 is trivial implies W2 is trivial ) & ( W2 is trivial implies W1 is trivial ) & ( W1 is Trail-like implies W2 is Trail-like ) & ( W2 is Trail-like implies W1 is Trail-like ) & ( W1 is Path-like implies W2 is Path-like ) & ( W2 is Path-like implies W1 is Path-like ) & ( W1 is vertex-distinct implies W2 is vertex-distinct ) & ( W2 is vertex-distinct implies W1 is vertex-distinct ) ) by A2, Th176; ::_thesis: verum end;