:: GLIB_001 semantic presentation

theorem Th1: :: GLIB_001:1
for b1, b2 being odd Nat holds
( b1 < b2 iff b1 + 2 <= b2 )
proof end;

Lemma2: for b1, b2, b3 being real number st 0 < b3 & b1 * b3 <= b2 * b3 holds
b1 <= b2
by XREAL_1:70;

Lemma3: for b1 being finite Function holds card (dom b1) = card b1
by PRE_CIRC:21;

theorem Th2: :: GLIB_001:2
for b1 being set
for b2 being Nat st b1 c= Seg b2 holds
for b3, b4 being Nat st b3 in dom (Sgm b1) & b4 = (Sgm b1) . b3 holds
b3 <= b4
proof end;

theorem Th3: :: GLIB_001:3
for b1 being set
for b2 being FinSequence of b1
for b3 being FinSubsequence of b2 holds len (Seq b3) <= len b2
proof end;

theorem Th4: :: GLIB_001:4
for b1 being set
for b2 being FinSequence of b1
for b3 being FinSubsequence of b2
for b4 being Nat st b4 in dom (Seq b3) holds
ex b5 being Nat st
( b5 in dom b2 & b4 <= b5 & (Seq b3) . b4 = b2 . b5 )
proof end;

theorem Th5: :: GLIB_001:5
for b1 being set
for b2 being FinSequence of b1
for b3 being FinSubsequence of b2 holds len (Seq b3) = card b3
proof end;

theorem Th6: :: GLIB_001:6
for b1 being set
for b2 being FinSequence of b1
for b3 being FinSubsequence of b2 holds dom (Seq b3) = dom (Sgm (dom b3))
proof end;

definition
let c1 be _Graph;
mode VertexSeq of c1 -> FinSequence of the_Vertices_of a1 means :Def1: :: GLIB_001:def 1
for b1 being Nat st 1 <= b1 & b1 < len a2 holds
ex b2 being set st b2 Joins a2 . b1,a2 . (b1 + 1),a1;
existence
ex b1 being FinSequence of the_Vertices_of c1 st
for b2 being Nat st 1 <= b2 & b2 < len b1 holds
ex b3 being set st b3 Joins b1 . b2,b1 . (b2 + 1),c1
proof end;
end;

:: deftheorem Def1 defines VertexSeq GLIB_001:def 1 :
for b1 being _Graph
for b2 being FinSequence of the_Vertices_of b1 holds
( b2 is VertexSeq of b1 iff for b3 being Nat st 1 <= b3 & b3 < len b2 holds
ex b4 being set st b4 Joins b2 . b3,b2 . (b3 + 1),b1 );

definition
let c1 be _Graph;
mode EdgeSeq of c1 -> FinSequence of the_Edges_of a1 means :Def2: :: GLIB_001:def 2
ex b1 being FinSequence of the_Vertices_of a1 st
( len b1 = (len a2) + 1 & ( for b2 being Nat st 1 <= b2 & b2 <= len a2 holds
a2 . b2 Joins b1 . b2,b1 . (b2 + 1),a1 ) );
existence
ex b1 being FinSequence of the_Edges_of c1ex b2 being FinSequence of the_Vertices_of c1 st
( len b2 = (len b1) + 1 & ( for b3 being Nat st 1 <= b3 & b3 <= len b1 holds
b1 . b3 Joins b2 . b3,b2 . (b3 + 1),c1 ) )
proof end;
end;

:: deftheorem Def2 defines EdgeSeq GLIB_001:def 2 :
for b1 being _Graph
for b2 being FinSequence of the_Edges_of b1 holds
( b2 is EdgeSeq of b1 iff ex b3 being FinSequence of the_Vertices_of b1 st
( len b3 = (len b2) + 1 & ( for b4 being Nat st 1 <= b4 & b4 <= len b2 holds
b2 . b4 Joins b3 . b4,b3 . (b4 + 1),b1 ) ) );

definition
let c1 be _Graph;
mode Walk of c1 -> FinSequence of (the_Vertices_of a1) \/ (the_Edges_of a1) means :Def3: :: GLIB_001:def 3
( not len a2 is even & a2 . 1 in the_Vertices_of a1 & ( for b1 being odd Nat st b1 < len a2 holds
a2 . (b1 + 1) Joins a2 . b1,a2 . (b1 + 2),a1 ) );
existence
ex b1 being FinSequence of (the_Vertices_of c1) \/ (the_Edges_of c1) st
( not len b1 is even & b1 . 1 in the_Vertices_of c1 & ( for b2 being odd Nat st b2 < len b1 holds
b1 . (b2 + 1) Joins b1 . b2,b1 . (b2 + 2),c1 ) )
proof end;
end;

:: deftheorem Def3 defines Walk GLIB_001:def 3 :
for b1 being _Graph
for b2 being FinSequence of (the_Vertices_of b1) \/ (the_Edges_of b1) holds
( b2 is Walk of b1 iff ( not len b2 is even & b2 . 1 in the_Vertices_of b1 & ( for b3 being odd Nat st b3 < len b2 holds
b2 . (b3 + 1) Joins b2 . b3,b2 . (b3 + 2),b1 ) ) );

registration
let c1 be _Graph;
let c2 be Walk of c1;
cluster len a2 -> non empty odd ;
correctness
coherence
( not len c2 is even & not len c2 is empty )
;
proof end;
end;

definition
let c1 be _Graph;
let c2 be Vertex of c1;
func c1 .walkOf c2 -> Walk of a1 equals :: GLIB_001:def 4
<*a2*>;
coherence
<*c2*> is Walk of c1
proof end;
end;

:: deftheorem Def4 defines .walkOf GLIB_001:def 4 :
for b1 being _Graph
for b2 being Vertex of b1 holds b1 .walkOf b2 = <*b2*>;

definition
let c1 be _Graph;
let c2, c3, c4 be set ;
func c1 .walkOf c2,c4,c3 -> Walk of a1 equals :Def5: :: GLIB_001:def 5
<*a2,a4,a3*> if a4 Joins a2,a3,a1
otherwise a1 .walkOf (choose (the_Vertices_of a1));
coherence
( ( c4 Joins c2,c3,c1 implies <*c2,c4,c3*> is Walk of c1 ) & ( not c4 Joins c2,c3,c1 implies c1 .walkOf (choose (the_Vertices_of c1)) is Walk of c1 ) )
proof end;
consistency
for b1 being Walk of c1 holds verum
;
end;

:: deftheorem Def5 defines .walkOf GLIB_001:def 5 :
for b1 being _Graph
for b2, b3, b4 being set holds
( ( b4 Joins b2,b3,b1 implies b1 .walkOf b2,b4,b3 = <*b2,b4,b3*> ) & ( not b4 Joins b2,b3,b1 implies b1 .walkOf b2,b4,b3 = b1 .walkOf (choose (the_Vertices_of b1)) ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
func c2 .first() -> Vertex of a1 equals :: GLIB_001:def 6
a2 . 1;
coherence
c2 . 1 is Vertex of c1
by Def3;
func c2 .last() -> Vertex of a1 equals :: GLIB_001:def 7
a2 . (len a2);
coherence
c2 . (len c2) is Vertex of c1
proof end;
end;

:: deftheorem Def6 defines .first() GLIB_001:def 6 :
for b1 being _Graph
for b2 being Walk of b1 holds b2 .first() = b2 . 1;

:: deftheorem Def7 defines .last() GLIB_001:def 7 :
for b1 being _Graph
for b2 being Walk of b1 holds b2 .last() = b2 . (len b2);

definition
let c1 be _Graph;
let c2 be Walk of c1;
let c3 be Nat;
func c2 .vertexAt c3 -> Vertex of a1 equals :Def8: :: GLIB_001:def 8
a2 . a3 if ( not a3 is even & a3 <= len a2 )
otherwise a2 .first() ;
correctness
coherence
( ( not c3 is even & c3 <= len c2 implies c2 . c3 is Vertex of c1 ) & ( ( c3 is even or not c3 <= len c2 ) implies c2 .first() is Vertex of c1 ) )
;
consistency
for b1 being Vertex of c1 holds verum
;
proof end;
end;

:: deftheorem Def8 defines .vertexAt GLIB_001:def 8 :
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat holds
( ( not b3 is even & b3 <= len b2 implies b2 .vertexAt b3 = b2 . b3 ) & ( ( b3 is even or not b3 <= len b2 ) implies b2 .vertexAt b3 = b2 .first() ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
func c2 .reverse() -> Walk of a1 equals :: GLIB_001:def 9
Rev a2;
coherence
Rev c2 is Walk of c1
proof end;
end;

:: deftheorem Def9 defines .reverse() GLIB_001:def 9 :
for b1 being _Graph
for b2 being Walk of b1 holds b2 .reverse() = Rev b2;

definition
let c1 be _Graph;
let c2, c3 be Walk of c1;
func c2 .append c3 -> Walk of a1 equals :Def10: :: GLIB_001:def 10
a2 ^' a3 if a2 .last() = a3 .first()
otherwise a2;
correctness
coherence
( ( c2 .last() = c3 .first() implies c2 ^' c3 is Walk of c1 ) & ( not c2 .last() = c3 .first() implies c2 is Walk of c1 ) )
;
consistency
for b1 being Walk of c1 holds verum
;
proof end;
end;

:: deftheorem Def10 defines .append GLIB_001:def 10 :
for b1 being _Graph
for b2, b3 being Walk of b1 holds
( ( b2 .last() = b3 .first() implies b2 .append b3 = b2 ^' b3 ) & ( not b2 .last() = b3 .first() implies b2 .append b3 = b2 ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
let c3, c4 be Nat;
func c2 .cut c3,c4 -> Walk of a1 equals :Def11: :: GLIB_001:def 11
a3,a4 -cut a2 if ( not a3 is even & not a4 is even & a3 <= a4 & a4 <= len a2 )
otherwise a2;
correctness
coherence
( ( not c3 is even & not c4 is even & c3 <= c4 & c4 <= len c2 implies c3,c4 -cut c2 is Walk of c1 ) & ( ( c3 is even or c4 is even or not c3 <= c4 or not c4 <= len c2 ) implies c2 is Walk of c1 ) )
;
consistency
for b1 being Walk of c1 holds verum
;
proof end;
end;

:: deftheorem Def11 defines .cut GLIB_001:def 11 :
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat holds
( ( not b3 is even & not b4 is even & b3 <= b4 & b4 <= len b2 implies b2 .cut b3,b4 = b3,b4 -cut b2 ) & ( ( b3 is even or b4 is even or not b3 <= b4 or not b4 <= len b2 ) implies b2 .cut b3,b4 = b2 ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
let c3, c4 be Nat;
func c2 .remove c3,c4 -> Walk of a1 equals :Def12: :: GLIB_001:def 12
(a2 .cut 1,a3) .append (a2 .cut a4,(len a2)) if ( not a3 is even & not a4 is even & a3 <= a4 & a4 <= len a2 & a2 . a3 = a2 . a4 )
otherwise a2;
correctness
coherence
( ( not c3 is even & not c4 is even & c3 <= c4 & c4 <= len c2 & c2 . c3 = c2 . c4 implies (c2 .cut 1,c3) .append (c2 .cut c4,(len c2)) is Walk of c1 ) & ( ( c3 is even or c4 is even or not c3 <= c4 or not c4 <= len c2 or not c2 . c3 = c2 . c4 ) implies c2 is Walk of c1 ) )
;
consistency
for b1 being Walk of c1 holds verum
;
;
end;

:: deftheorem Def12 defines .remove GLIB_001:def 12 :
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat holds
( ( not b3 is even & not b4 is even & b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 implies b2 .remove b3,b4 = (b2 .cut 1,b3) .append (b2 .cut b4,(len b2)) ) & ( ( b3 is even or b4 is even or not b3 <= b4 or not b4 <= len b2 or not b2 . b3 = b2 . b4 ) implies b2 .remove b3,b4 = b2 ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
let c3 be set ;
func c2 .addEdge c3 -> Walk of a1 equals :: GLIB_001:def 13
a2 .append (a1 .walkOf (a2 .last() ),a3,((a2 .last() ) .adj a3));
coherence
c2 .append (c1 .walkOf (c2 .last() ),c3,((c2 .last() ) .adj c3)) is Walk of c1
;
end;

:: deftheorem Def13 defines .addEdge GLIB_001:def 13 :
for b1 being _Graph
for b2 being Walk of b1
for b3 being set holds b2 .addEdge b3 = b2 .append (b1 .walkOf (b2 .last() ),b3,((b2 .last() ) .adj b3));

definition
let c1 be _Graph;
let c2 be Walk of c1;
func c2 .vertexSeq() -> VertexSeq of a1 means :Def14: :: GLIB_001:def 14
( (len a2) + 1 = 2 * (len a3) & ( for b1 being Nat st 1 <= b1 & b1 <= len a3 holds
a3 . b1 = a2 . ((2 * b1) - 1) ) );
existence
ex b1 being VertexSeq of c1 st
( (len c2) + 1 = 2 * (len b1) & ( for b2 being Nat st 1 <= b2 & b2 <= len b1 holds
b1 . b2 = c2 . ((2 * b2) - 1) ) )
proof end;
uniqueness
for b1, b2 being VertexSeq of c1 st (len c2) + 1 = 2 * (len b1) & ( for b3 being Nat st 1 <= b3 & b3 <= len b1 holds
b1 . b3 = c2 . ((2 * b3) - 1) ) & (len c2) + 1 = 2 * (len b2) & ( for b3 being Nat st 1 <= b3 & b3 <= len b2 holds
b2 . b3 = c2 . ((2 * b3) - 1) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def14 defines .vertexSeq() GLIB_001:def 14 :
for b1 being _Graph
for b2 being Walk of b1
for b3 being VertexSeq of b1 holds
( b3 = b2 .vertexSeq() iff ( (len b2) + 1 = 2 * (len b3) & ( for b4 being Nat st 1 <= b4 & b4 <= len b3 holds
b3 . b4 = b2 . ((2 * b4) - 1) ) ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
func c2 .edgeSeq() -> EdgeSeq of a1 means :Def15: :: GLIB_001:def 15
( len a2 = (2 * (len a3)) + 1 & ( for b1 being Nat st 1 <= b1 & b1 <= len a3 holds
a3 . b1 = a2 . (2 * b1) ) );
existence
ex b1 being EdgeSeq of c1 st
( len c2 = (2 * (len b1)) + 1 & ( for b2 being Nat st 1 <= b2 & b2 <= len b1 holds
b1 . b2 = c2 . (2 * b2) ) )
proof end;
uniqueness
for b1, b2 being EdgeSeq of c1 st len c2 = (2 * (len b1)) + 1 & ( for b3 being Nat st 1 <= b3 & b3 <= len b1 holds
b1 . b3 = c2 . (2 * b3) ) & len c2 = (2 * (len b2)) + 1 & ( for b3 being Nat st 1 <= b3 & b3 <= len b2 holds
b2 . b3 = c2 . (2 * b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def15 defines .edgeSeq() GLIB_001:def 15 :
for b1 being _Graph
for b2 being Walk of b1
for b3 being EdgeSeq of b1 holds
( b3 = b2 .edgeSeq() iff ( len b2 = (2 * (len b3)) + 1 & ( for b4 being Nat st 1 <= b4 & b4 <= len b3 holds
b3 . b4 = b2 . (2 * b4) ) ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
func c2 .vertices() -> finite Subset of (the_Vertices_of a1) equals :: GLIB_001:def 16
rng (a2 .vertexSeq() );
coherence
rng (c2 .vertexSeq() ) is finite Subset of (the_Vertices_of c1)
;
end;

:: deftheorem Def16 defines .vertices() GLIB_001:def 16 :
for b1 being _Graph
for b2 being Walk of b1 holds b2 .vertices() = rng (b2 .vertexSeq() );

definition
let c1 be _Graph;
let c2 be Walk of c1;
func c2 .edges() -> finite Subset of (the_Edges_of a1) equals :: GLIB_001:def 17
rng (a2 .edgeSeq() );
coherence
rng (c2 .edgeSeq() ) is finite Subset of (the_Edges_of c1)
;
end;

:: deftheorem Def17 defines .edges() GLIB_001:def 17 :
for b1 being _Graph
for b2 being Walk of b1 holds b2 .edges() = rng (b2 .edgeSeq() );

definition
let c1 be _Graph;
let c2 be Walk of c1;
func c2 .length() -> Nat equals :: GLIB_001:def 18
len (a2 .edgeSeq() );
coherence
len (c2 .edgeSeq() ) is Nat
;
end;

:: deftheorem Def18 defines .length() GLIB_001:def 18 :
for b1 being _Graph
for b2 being Walk of b1 holds b2 .length() = len (b2 .edgeSeq() );

definition
let c1 be _Graph;
let c2 be Walk of c1;
let c3 be set ;
func c2 .find c3 -> odd Nat means :Def19: :: GLIB_001:def 19
( a4 <= len a2 & a2 . a4 = a3 & ( for b1 being odd Nat st b1 <= len a2 & a2 . b1 = a3 holds
a4 <= b1 ) ) if a3 in a2 .vertices()
otherwise a4 = len a2;
existence
( ( c3 in c2 .vertices() implies ex b1 being odd Nat st
( b1 <= len c2 & c2 . b1 = c3 & ( for b2 being odd Nat st b2 <= len c2 & c2 . b2 = c3 holds
b1 <= b2 ) ) ) & ( not c3 in c2 .vertices() implies ex b1 being odd Nat st b1 = len c2 ) )
proof end;
uniqueness
for b1, b2 being odd Nat holds
( ( c3 in c2 .vertices() & b1 <= len c2 & c2 . b1 = c3 & ( for b3 being odd Nat st b3 <= len c2 & c2 . b3 = c3 holds
b1 <= b3 ) & b2 <= len c2 & c2 . b2 = c3 & ( for b3 being odd Nat st b3 <= len c2 & c2 . b3 = c3 holds
b2 <= b3 ) implies b1 = b2 ) & ( not c3 in c2 .vertices() & b1 = len c2 & b2 = len c2 implies b1 = b2 ) )
proof end;
consistency
for b1 being odd Nat holds verum
;
end;

:: deftheorem Def19 defines .find GLIB_001:def 19 :
for b1 being _Graph
for b2 being Walk of b1
for b3 being set
for b4 being odd Nat holds
( ( b3 in b2 .vertices() implies ( b4 = b2 .find b3 iff ( b4 <= len b2 & b2 . b4 = b3 & ( for b5 being odd Nat st b5 <= len b2 & b2 . b5 = b3 holds
b4 <= b5 ) ) ) ) & ( not b3 in b2 .vertices() implies ( b4 = b2 .find b3 iff b4 = len b2 ) ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
let c3 be Nat;
func c2 .find c3 -> odd Nat means :Def20: :: GLIB_001:def 20
( a4 <= len a2 & a2 . a4 = a2 . a3 & ( for b1 being odd Nat st b1 <= len a2 & a2 . b1 = a2 . a3 holds
a4 <= b1 ) ) if ( not a3 is even & a3 <= len a2 )
otherwise a4 = len a2;
existence
( ( not c3 is even & c3 <= len c2 implies ex b1 being odd Nat st
( b1 <= len c2 & c2 . b1 = c2 . c3 & ( for b2 being odd Nat st b2 <= len c2 & c2 . b2 = c2 . c3 holds
b1 <= b2 ) ) ) & ( ( c3 is even or not c3 <= len c2 ) implies ex b1 being odd Nat st b1 = len c2 ) )
proof end;
uniqueness
for b1, b2 being odd Nat holds
( ( not c3 is even & c3 <= len c2 & b1 <= len c2 & c2 . b1 = c2 . c3 & ( for b3 being odd Nat st b3 <= len c2 & c2 . b3 = c2 . c3 holds
b1 <= b3 ) & b2 <= len c2 & c2 . b2 = c2 . c3 & ( for b3 being odd Nat st b3 <= len c2 & c2 . b3 = c2 . c3 holds
b2 <= b3 ) implies b1 = b2 ) & ( ( c3 is even or not c3 <= len c2 ) & b1 = len c2 & b2 = len c2 implies b1 = b2 ) )
proof end;
consistency
for b1 being odd Nat holds verum
;
end;

:: deftheorem Def20 defines .find GLIB_001:def 20 :
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat
for b4 being odd Nat holds
( ( not b3 is even & b3 <= len b2 implies ( b4 = b2 .find b3 iff ( b4 <= len b2 & b2 . b4 = b2 . b3 & ( for b5 being odd Nat st b5 <= len b2 & b2 . b5 = b2 . b3 holds
b4 <= b5 ) ) ) ) & ( ( b3 is even or not b3 <= len b2 ) implies ( b4 = b2 .find b3 iff b4 = len b2 ) ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
let c3 be set ;
func c2 .rfind c3 -> odd Nat means :Def21: :: GLIB_001:def 21
( a4 <= len a2 & a2 . a4 = a3 & ( for b1 being odd Nat st b1 <= len a2 & a2 . b1 = a3 holds
b1 <= a4 ) ) if a3 in a2 .vertices()
otherwise a4 = len a2;
existence
( ( c3 in c2 .vertices() implies ex b1 being odd Nat st
( b1 <= len c2 & c2 . b1 = c3 & ( for b2 being odd Nat st b2 <= len c2 & c2 . b2 = c3 holds
b2 <= b1 ) ) ) & ( not c3 in c2 .vertices() implies ex b1 being odd Nat st b1 = len c2 ) )
proof end;
uniqueness
for b1, b2 being odd Nat holds
( ( c3 in c2 .vertices() & b1 <= len c2 & c2 . b1 = c3 & ( for b3 being odd Nat st b3 <= len c2 & c2 . b3 = c3 holds
b3 <= b1 ) & b2 <= len c2 & c2 . b2 = c3 & ( for b3 being odd Nat st b3 <= len c2 & c2 . b3 = c3 holds
b3 <= b2 ) implies b1 = b2 ) & ( not c3 in c2 .vertices() & b1 = len c2 & b2 = len c2 implies b1 = b2 ) )
proof end;
consistency
for b1 being odd Nat holds verum
;
end;

:: deftheorem Def21 defines .rfind GLIB_001:def 21 :
for b1 being _Graph
for b2 being Walk of b1
for b3 being set
for b4 being odd Nat holds
( ( b3 in b2 .vertices() implies ( b4 = b2 .rfind b3 iff ( b4 <= len b2 & b2 . b4 = b3 & ( for b5 being odd Nat st b5 <= len b2 & b2 . b5 = b3 holds
b5 <= b4 ) ) ) ) & ( not b3 in b2 .vertices() implies ( b4 = b2 .rfind b3 iff b4 = len b2 ) ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
let c3 be Nat;
func c2 .rfind c3 -> odd Nat means :Def22: :: GLIB_001:def 22
( a4 <= len a2 & a2 . a4 = a2 . a3 & ( for b1 being odd Nat st b1 <= len a2 & a2 . b1 = a2 . a3 holds
b1 <= a4 ) ) if ( not a3 is even & a3 <= len a2 )
otherwise a4 = len a2;
existence
( ( not c3 is even & c3 <= len c2 implies ex b1 being odd Nat st
( b1 <= len c2 & c2 . b1 = c2 . c3 & ( for b2 being odd Nat st b2 <= len c2 & c2 . b2 = c2 . c3 holds
b2 <= b1 ) ) ) & ( ( c3 is even or not c3 <= len c2 ) implies ex b1 being odd Nat st b1 = len c2 ) )
proof end;
uniqueness
for b1, b2 being odd Nat holds
( ( not c3 is even & c3 <= len c2 & b1 <= len c2 & c2 . b1 = c2 . c3 & ( for b3 being odd Nat st b3 <= len c2 & c2 . b3 = c2 . c3 holds
b3 <= b1 ) & b2 <= len c2 & c2 . b2 = c2 . c3 & ( for b3 being odd Nat st b3 <= len c2 & c2 . b3 = c2 . c3 holds
b3 <= b2 ) implies b1 = b2 ) & ( ( c3 is even or not c3 <= len c2 ) & b1 = len c2 & b2 = len c2 implies b1 = b2 ) )
proof end;
consistency
for b1 being odd Nat holds verum
;
end;

:: deftheorem Def22 defines .rfind GLIB_001:def 22 :
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat
for b4 being odd Nat holds
( ( not b3 is even & b3 <= len b2 implies ( b4 = b2 .rfind b3 iff ( b4 <= len b2 & b2 . b4 = b2 . b3 & ( for b5 being odd Nat st b5 <= len b2 & b2 . b5 = b2 . b3 holds
b5 <= b4 ) ) ) ) & ( ( b3 is even or not b3 <= len b2 ) implies ( b4 = b2 .rfind b3 iff b4 = len b2 ) ) );

definition
let c1 be _Graph;
let c2, c3 be set ;
let c4 be Walk of c1;
pred c4 is_Walk_from c2,c3 means :Def23: :: GLIB_001:def 23
( a4 .first() = a2 & a4 .last() = a3 );
end;

:: deftheorem Def23 defines is_Walk_from GLIB_001:def 23 :
for b1 being _Graph
for b2, b3 being set
for b4 being Walk of b1 holds
( b4 is_Walk_from b2,b3 iff ( b4 .first() = b2 & b4 .last() = b3 ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
attr a2 is closed means :Def24: :: GLIB_001:def 24
a2 .first() = a2 .last() ;
attr a2 is directed means :Def25: :: GLIB_001:def 25
for b1 being odd Nat st b1 < len a2 holds
(the_Source_of a1) . (a2 . (b1 + 1)) = a2 . b1;
attr a2 is trivial means :Def26: :: GLIB_001:def 26
a2 .length() = 0;
attr a2 is Trail-like means :Def27: :: GLIB_001:def 27
a2 .edgeSeq() is one-to-one;
end;

:: deftheorem Def24 defines closed GLIB_001:def 24 :
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is closed iff b2 .first() = b2 .last() );

:: deftheorem Def25 defines directed GLIB_001:def 25 :
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is directed iff for b3 being odd Nat st b3 < len b2 holds
(the_Source_of b1) . (b2 . (b3 + 1)) = b2 . b3 );

:: deftheorem Def26 defines trivial GLIB_001:def 26 :
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is trivial iff b2 .length() = 0 );

:: deftheorem Def27 defines Trail-like GLIB_001:def 27 :
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is Trail-like iff b2 .edgeSeq() is one-to-one );

notation
let c1 be _Graph;
let c2 be Walk of c1;
antonym open c2 for closed c2;
end;

definition
let c1 be _Graph;
let c2 be Walk of c1;
attr a2 is Path-like means :Def28: :: GLIB_001:def 28
( a2 is Trail-like & ( for b1, b2 being odd Nat st b1 < b2 & b2 <= len a2 & a2 . b1 = a2 . b2 holds
( b1 = 1 & b2 = len a2 ) ) );
end;

:: deftheorem Def28 defines Path-like GLIB_001:def 28 :
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is Path-like iff ( b2 is Trail-like & ( for b3, b4 being odd Nat st b3 < b4 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
( b3 = 1 & b4 = len b2 ) ) ) );

definition
let c1 be _Graph;
let c2 be Walk of c1;
attr a2 is vertex-distinct means :Def29: :: GLIB_001:def 29
for b1, b2 being odd Nat st b1 <= len a2 & b2 <= len a2 & a2 . b1 = a2 . b2 holds
b1 = b2;
end;

:: deftheorem Def29 defines vertex-distinct GLIB_001:def 29 :
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is vertex-distinct iff for b3, b4 being odd Nat st b3 <= len b2 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
b3 = b4 );

definition
let c1 be _Graph;
let c2 be Walk of c1;
attr a2 is Circuit-like means :Def30: :: GLIB_001:def 30
( a2 is closed & a2 is Trail-like & not a2 is trivial );
attr a2 is Cycle-like means :Def31: :: GLIB_001:def 31
( a2 is closed & a2 is Path-like & not a2 is trivial );
end;

:: deftheorem Def30 defines Circuit-like GLIB_001:def 30 :
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is Circuit-like iff ( b2 is closed & b2 is Trail-like & not b2 is trivial ) );

:: deftheorem Def31 defines Cycle-like GLIB_001:def 31 :
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is Cycle-like iff ( b2 is closed & b2 is Path-like & not b2 is trivial ) );

Lemma32: for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
b2 . b3 in the_Vertices_of b1
proof end;

Lemma33: for b1 being _Graph
for b2 being Walk of b1
for b3 being even Nat st b3 in dom b2 holds
ex b4 being odd Nat st
( b4 = b3 - 1 & b3 - 1 in dom b2 & b3 + 1 in dom b2 & b2 . b3 Joins b2 . b4,b2 . (b3 + 1),b1 )
proof end;

Lemma34: for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 < len b2 holds
( b3 in dom b2 & b3 + 1 in dom b2 & b3 + 2 in dom b2 )
proof end;

Lemma35: for b1 being _Graph
for b2 being Vertex of b1 holds
( b1 .walkOf b2 is closed & b1 .walkOf b2 is directed & b1 .walkOf b2 is trivial & b1 .walkOf b2 is Trail-like & b1 .walkOf b2 is Path-like )
proof end;

Lemma36: for b1 being _Graph
for b2, b3, b4 being set st b3 Joins b2,b4,b1 holds
len (b1 .walkOf b2,b3,b4) = 3
proof end;

Lemma37: for b1 being _Graph
for b2, b3, b4 being set st b3 Joins b2,b4,b1 holds
( (b1 .walkOf b2,b3,b4) .first() = b2 & (b1 .walkOf b2,b3,b4) .last() = b4 & b1 .walkOf b2,b3,b4 is_Walk_from b2,b4 )
proof end;

Lemma38: for b1 being _Graph
for b2 being Walk of b1 holds
( len b2 = len (b2 .reverse() ) & dom b2 = dom (b2 .reverse() ) & rng b2 = rng (b2 .reverse() ) )
by FINSEQ_5:def 3, FINSEQ_5:60;

Lemma39: for b1 being _Graph
for b2 being Walk of b1 holds
( b2 .first() = (b2 .reverse() ) .last() & b2 .last() = (b2 .reverse() ) .first() )
proof end;

Lemma40: for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat st b3 in dom (b2 .reverse() ) holds
( (b2 .reverse() ) . b3 = b2 . (((len b2) - b3) + 1) & ((len b2) - b3) + 1 in dom b2 )
proof end;

Lemma41: for b1 being _Graph
for b2 being Walk of b1 holds (b2 .reverse() ) .reverse() = b2
by FINSEQ_6:29;

Lemma42: for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
(len (b2 .append b3)) + 1 = (len b2) + (len b3)
proof end;

Lemma43: for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
( len b2 <= len (b2 .append b3) & len b3 <= len (b2 .append b3) )
proof end;

Lemma44: for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
( (b2 .append b3) .first() = b2 .first() & (b2 .append b3) .last() = b3 .last() & b2 .append b3 is_Walk_from b2 .first() ,b3 .last() )
proof end;

Lemma45: for b1 being _Graph
for b2, b3 being Walk of b1
for b4 being Nat st b4 in dom b2 holds
( (b2 .append b3) . b4 = b2 . b4 & b4 in dom (b2 .append b3) )
proof end;

Lemma46: for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
for b4 being Nat st b4 < len b3 holds
( (b2 .append b3) . ((len b2) + b4) = b3 . (b4 + 1) & (len b2) + b4 in dom (b2 .append b3) )
proof end;

Lemma47: for b1 being _Graph
for b2, b3 being Walk of b1
for b4 being Nat holds
( not b4 in dom (b2 .append b3) or b4 in dom b2 or ex b5 being Nat st
( b5 < len b3 & b4 = (len b2) + b5 ) )
proof end;

Lemma48: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 holds
( (len (b2 .cut b3,b4)) + b3 = b4 + 1 & ( for b5 being Nat st b5 < len (b2 .cut b3,b4) holds
( (b2 .cut b3,b4) . (b5 + 1) = b2 . (b3 + b5) & b3 + b5 in dom b2 ) ) )
proof end;

Lemma49: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 holds
( (b2 .cut b3,b4) .first() = b2 . b3 & (b2 .cut b3,b4) .last() = b2 . b4 & b2 .cut b3,b4 is_Walk_from b2 . b3,b2 . b4 )
proof end;

Lemma50: for b1 being _Graph
for b2 being Walk of b1
for b3, b4, b5 being odd Nat st b3 <= b4 & b4 <= b5 & b5 <= len b2 holds
(b2 .cut b3,b4) .append (b2 .cut b4,b5) = b2 .cut b3,b5
proof end;

Lemma51: for b1 being _Graph
for b2 being Walk of b1 holds b2 .cut 1,(len b2) = b2
proof end;

Lemma52: for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
b2 .cut b3,b3 = <*(b2 .vertexAt b3)*>
proof end;

Lemma53: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat st not b3 is even & b3 <= b4 holds
(b2 .cut 1,b4) .cut 1,b3 = b2 .cut 1,b3
proof end;

Lemma54: for b1 being _Graph
for b2, b3 being Walk of b1
for b4, b5 being odd Nat st b4 <= b5 & b5 <= len b2 & b2 .last() = b3 .first() holds
(b2 .append b3) .cut b4,b5 = b2 .cut b4,b5
proof end;

Lemma55: for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
len (b2 .cut 1,b3) = b3
proof end;

Lemma56: for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat
for b4 being Nat st b4 in dom (b2 .cut 1,b3) & b3 <= len b2 holds
(b2 .cut 1,b3) . b4 = b2 . b4
proof end;

Lemma57: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
(len (b2 .remove b3,b4)) + b4 = (len b2) + b3
proof end;

Lemma58: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat
for b5, b6 being set st b2 is_Walk_from b5,b6 holds
b2 .remove b3,b4 is_Walk_from b5,b6
proof end;

Lemma59: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat holds len (b2 .remove b3,b4) <= len b2
proof end;

Lemma60: for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat holds b2 .remove b3,b3 = b2
proof end;

Lemma61: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
(b2 .cut 1,b3) .last() = (b2 .cut b4,(len b2)) .first()
proof end;

Lemma62: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set
for b5, b6 being odd Nat st b5 <= b6 & b6 <= len b2 & b2 . b5 = b2 . b6 holds
for b7 being Nat st b7 in Seg b5 holds
(b2 .remove b5,b6) . b7 = b2 . b7
proof end;

Lemma63: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
for b5 being Nat st b3 <= b5 & b5 <= len (b2 .remove b3,b4) holds
( (b2 .remove b3,b4) . b5 = b2 . ((b5 - b3) + b4) & (b5 - b3) + b4 is Nat & (b5 - b3) + b4 <= len b2 )
proof end;

Lemma64: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
len (b2 .remove b3,b4) = ((len b2) + b3) - b4
proof end;

Lemma65: for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat st b2 .first() = b2 . b3 holds
b2 .remove 1,b3 = b2 .cut b3,(len b2)
proof end;

Lemma66: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat holds
( (b2 .remove b3,b4) .first() = b2 .first() & (b2 .remove b3,b4) .last() = b2 .last() )
proof end;

Lemma67: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat
for b5 being Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 & b5 in dom (b2 .remove b3,b4) & not b5 in Seg b3 holds
( b3 <= b5 & b5 <= len (b2 .remove b3,b4) )
proof end;

Lemma68: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
b2 .addEdge b3 = b2 ^ <*b3,b4*>
proof end;

Lemma69: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
( (b2 .addEdge b3) .first() = b2 .first() & (b2 .addEdge b3) .last() = b4 & b2 .addEdge b3 is_Walk_from b2 .first() ,b4 )
proof end;

Lemma70: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
len (b2 .addEdge b3) = (len b2) + 2
proof end;

Lemma71: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
( (b2 .addEdge b3) . ((len b2) + 1) = b3 & (b2 .addEdge b3) . ((len b2) + 2) = b4 & ( for b5 being Nat st b5 in dom b2 holds
(b2 .addEdge b3) . b5 = b2 . b5 ) )
proof end;

Lemma72: for b1 being _Graph
for b2 being Walk of b1
for b3, b4, b5, b6 being set st b2 is_Walk_from b4,b5 & b3 Joins b5,b6,b1 holds
b2 .addEdge b3 is_Walk_from b4,b6
proof end;

Lemma73: for b1 being _Graph
for b2 being Walk of b1
for b3 being even Nat st 1 <= b3 & b3 <= len b2 holds
( b3 div 2 in dom (b2 .edgeSeq() ) & b2 . b3 = (b2 .edgeSeq() ) . (b3 div 2) )
proof end;

Lemma74: for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat holds
( b3 in dom (b2 .edgeSeq() ) iff 2 * b3 in dom b2 )
proof end;

Lemma75: for b1 being _Graph
for b2 being Walk of b1 ex b3 being even Nat st
( b3 = (len b2) - 1 & len (b2 .edgeSeq() ) = b3 div 2 )
proof end;

Lemma76: for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat holds (b2 .cut 1,b3) .edgeSeq() c= b2 .edgeSeq()
proof end;

Lemma77: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
(b2 .addEdge b3) .edgeSeq() = (b2 .edgeSeq() ) ^ <*b3*>
proof end;

Lemma78: for b1 being _Graph
for b2 being Walk of b1
for b3 being set holds
( b3 in b2 .vertices() iff ex b4 being odd Nat st
( b4 <= len b2 & b2 . b4 = b3 ) )
proof end;

Lemma79: for b1 being _Graph
for b2 being Walk of b1
for b3 being set holds
( b3 in b2 .edges() iff ex b4 being even Nat st
( 1 <= b4 & b4 <= len b2 & b2 . b4 = b3 ) )
proof end;

Lemma80: for b1 being _Graph
for b2 being Walk of b1
for b3 being set st b3 in b2 .edges() holds
ex b4, b5 being Vertex of b1ex b6 being odd Nat st
( b6 + 2 <= len b2 & b4 = b2 . b6 & b3 = b2 . (b6 + 1) & b5 = b2 . (b6 + 2) & b3 Joins b4,b5,b1 )
proof end;

Lemma81: for b1 being _Graph
for b2 being Walk of b1
for b3, b4, b5 being set st b3 in b2 .edges() & b3 Joins b4,b5,b1 holds
( b4 in b2 .vertices() & b5 in b2 .vertices() )
proof end;

Lemma82: for b1 being _Graph
for b2 being Walk of b1 holds len b2 = (2 * (b2 .length() )) + 1
by Def15;

Lemma83: for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
b2 .find b3 <= b3
proof end;

Lemma84: for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
b2 .rfind b3 >= b3
proof end;

Lemma85: for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is directed iff for b3 being odd Nat st b3 < len b2 holds
b2 . (b3 + 1) DJoins b2 . b3,b2 . (b3 + 2),b1 )
proof end;

Lemma86: for b1 being _Graph
for b2 being Walk of b1
for b3, b4, b5, b6 being set st b2 is directed & b2 is_Walk_from b3,b5 & b4 DJoins b5,b6,b1 holds
( b2 .addEdge b4 is directed & b2 .addEdge b4 is_Walk_from b3,b6 )
proof end;

Lemma87: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat st b2 is directed holds
b2 .cut b3,b4 is directed
proof end;

Lemma88: for b1 being _Graph
for b2 being Walk of b1 holds
( not b2 is trivial iff 3 <= len b2 )
proof end;

Lemma89: for b1 being _Graph
for b2 being Walk of b1 holds
( not b2 is trivial iff len b2 <> 1 )
proof end;

Lemma90: for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is trivial iff ex b3 being Vertex of b1 st b2 = b1 .walkOf b3 )
proof end;

Lemma91: for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is Trail-like iff for b3, b4 being even Nat st 1 <= b3 & b3 < b4 & b4 <= len b2 holds
b2 . b3 <> b2 . b4 )
proof end;

Lemma92: for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is Trail-like iff b2 .reverse() is Trail-like )
proof end;

Lemma93: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat st b2 is Trail-like holds
b2 .cut b3,b4 is Trail-like
proof end;

Lemma94: for b1 being _Graph
for b2 being Walk of b1
for b3 being set st b2 is Trail-like & b3 in (b2 .last() ) .edgesInOut() & not b3 in b2 .edges() holds
b2 .addEdge b3 is Trail-like
proof end;

Lemma95: for b1 being _Graph
for b2 being Walk of b1 st len b2 <= 3 holds
b2 is Trail-like
proof end;

Lemma96: for b1 being _Graph
for b2, b3, b4 being set st b3 Joins b2,b4,b1 holds
b1 .walkOf b2,b3,b4 is Path-like
proof end;

Lemma97: for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is Path-like iff b2 .reverse() is Path-like )
proof end;

Lemma98: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat st b2 is Path-like holds
b2 .cut b3,b4 is Path-like
proof end;

Lemma99: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b2 is Path-like & b3 Joins b2 .last() ,b4,b1 & not b3 in b2 .edges() & ( b2 is trivial or not b2 is closed ) & ( for b5 being odd Nat st 1 < b5 & b5 <= len b2 holds
b2 . b5 <> b4 ) holds
b2 .addEdge b3 is Path-like
proof end;

Lemma100: for b1 being _Graph
for b2 being Walk of b1 st ( for b3, b4 being odd Nat st b3 <= len b2 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
b3 = b4 ) holds
b2 is Path-like
proof end;

Lemma101: for b1 being _Graph
for b2 being Walk of b1 st ( for b3 being odd Nat st b3 <= len b2 holds
b2 .rfind b3 = b3 ) holds
b2 is Path-like
proof end;

Lemma102: for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 & b2 is Path-like & not b4 in b2 .vertices() & ( b2 is trivial or not b2 is closed ) holds
b2 .addEdge b3 is Path-like
proof end;

Lemma103: for b1 being _Graph
for b2 being Walk of b1 st len b2 <= 3 holds
b2 is Path-like
proof end;

registration
let c1 be _Graph;
cluster Path-like -> Trail-like Walk of a1;
correctness
coherence
for b1 being Walk of c1 st b1 is Path-like holds
b1 is Trail-like
;
by Def28;
cluster trivial -> Path-like Walk of a1;
correctness
coherence
for b1 being Walk of c1 st b1 is trivial holds
b1 is Path-like
;
proof end;
cluster trivial -> vertex-distinct Walk of a1;
coherence
for b1 being Walk of c1 st b1 is trivial holds
b1 is vertex-distinct
proof end;
cluster vertex-distinct -> Path-like Walk of a1;
coherence
for b1 being Walk of c1 st b1 is vertex-distinct holds
b1 is Path-like
proof end;
cluster Circuit-like -> closed non trivial Trail-like Walk of a1;
correctness
coherence
for b1 being Walk of c1 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 Walk of a1;
correctness
coherence
for b1 being Walk of c1 st b1 is Cycle-like holds
( b1 is closed & b1 is Path-like & not b1 is trivial )
;
by Def31;
end;

registration
let c1 be _Graph;
cluster closed directed trivial Trail-like Path-like vertex-distinct Walk of a1;
existence
ex b1 being Walk of c1 st
( b1 is closed & b1 is directed & b1 is trivial )
proof end;
end;

registration
let c1 be _Graph;
cluster Trail-like Path-like vertex-distinct Walk of a1;
existence
ex b1 being Walk of c1 st b1 is vertex-distinct
proof end;
end;

definition
let c1 be _Graph;
mode Trail of a1 is Trail-like Walk of a1;
mode Path of a1 is Path-like Walk of a1;
end;

definition
let c1 be _Graph;
mode DWalk of a1 is directed Walk of a1;
mode DTrail of a1 is directed Trail of a1;
mode DPath of a1 is directed Path of a1;
end;

registration
let c1 be _Graph;
let c2 be Vertex of c1;
cluster a1 .walkOf a2 -> closed directed trivial Trail-like Path-like vertex-distinct ;
coherence
( c1 .walkOf c2 is closed & c1 .walkOf c2 is directed & c1 .walkOf c2 is trivial )
by Lemma35;
end;

registration
let c1 be _Graph;
let c2, c3, c4 be set ;
cluster a1 .walkOf a2,a3,a4 -> Trail-like Path-like ;
coherence
c1 .walkOf c2,c3,c4 is Path-like
proof end;
end;

registration
let c1 be _Graph;
let c2, c3 be set ;
cluster a1 .walkOf a2,a3,a2 -> closed Trail-like Path-like ;
coherence
c1 .walkOf c2,c3,c2 is closed
proof end;
end;

registration
let c1 be _Graph;
let c2 be closed Walk of c1;
cluster a2 .reverse() -> closed ;
coherence
c2 .reverse() is closed
proof end;
end;

registration
let c1 be _Graph;
let c2 be trivial Walk of c1;
cluster a2 .reverse() -> trivial Trail-like Path-like vertex-distinct ;
coherence
c2 .reverse() is trivial
proof end;
end;

registration
let c1 be _Graph;
let c2 be Trail of c1;
cluster a2 .reverse() -> Trail-like ;
coherence
c2 .reverse() is Trail-like
by Lemma92;
end;

registration
let c1 be _Graph;
let c2 be Path of c1;
cluster a2 .reverse() -> Trail-like Path-like ;
coherence
c2 .reverse() is Path-like
by Lemma97;
end;

registration
let c1 be _Graph;
let c2, c3 be closed Walk of c1;
cluster a2 .append a3 -> closed ;
coherence
c2 .append c3 is closed
proof end;
end;

registration
let c1 be _Graph;
let c2, c3 be DWalk of c1;
cluster a2 .append a3 -> directed ;
coherence
c2 .append c3 is directed
proof end;
end;

registration
let c1 be _Graph;
let c2, c3 be trivial Walk of c1;
cluster a2 .append a3 -> trivial Trail-like Path-like vertex-distinct ;
coherence
c2 .append c3 is trivial
proof end;
end;

registration
let c1 be _Graph;
let c2 be DWalk of c1;
let c3, c4 be Nat;
cluster a2 .cut a3,a4 -> directed ;
coherence
c2 .cut c3,c4 is directed
by Lemma87;
end;

registration
let c1 be _Graph;
let c2 be trivial Walk of c1;
let c3, c4 be Nat;
cluster a2 .cut a3,a4 -> trivial Trail-like Path-like vertex-distinct ;
coherence
c2 .cut c3,c4 is trivial
proof end;
end;

registration
let c1 be _Graph;
let c2 be Trail of c1;
let c3, c4 be Nat;
cluster a2 .cut a3,a4 -> Trail-like ;
coherence
c2 .cut c3,c4 is Trail-like
by Lemma93;
end;

registration
let c1 be _Graph;
let c2 be Path of c1;
let c3, c4 be Nat;
cluster a2 .cut a3,a4 -> Trail-like Path-like ;
coherence
c2 .cut c3,c4 is Path-like
by Lemma98;
end;

registration
let c1 be _Graph;
let c2 be vertex-distinct Walk of c1;
let c3, c4 be Nat;
cluster a2 .cut a3,a4 -> Trail-like Path-like vertex-distinct ;
coherence
c2 .cut c3,c4 is vertex-distinct
proof end;
end;

registration
let c1 be _Graph;
let c2 be closed Walk of c1;
let c3, c4 be Nat;
cluster a2 .remove a3,a4 -> closed ;
coherence
c2 .remove c3,c4 is closed
proof end;
end;

registration
let c1 be _Graph;
let c2 be DWalk of c1;
let c3, c4 be Nat;
cluster a2 .remove a3,a4 -> directed ;
coherence
c2 .remove c3,c4 is directed
proof end;
end;

registration
let c1 be _Graph;
let c2 be trivial Walk of c1;
let c3, c4 be Nat;
cluster a2 .remove a3,a4 -> trivial Trail-like Path-like vertex-distinct ;
coherence
c2 .remove c3,c4 is trivial
proof end;
end;

registration
let c1 be _Graph;
let c2 be Trail of c1;
let c3, c4 be Nat;
cluster a2 .remove a3,a4 -> Trail-like ;
coherence
c2 .remove c3,c4 is Trail-like
proof end;
end;

registration
let c1 be _Graph;
let c2 be Path of c1;
let c3, c4 be Nat;
cluster a2 .remove a3,a4 -> Trail-like Path-like ;
coherence
c2 .remove c3,c4 is Path-like
proof end;
end;

definition
let c1 be _Graph;
let c2 be Walk of c1;
mode Subwalk of c2 -> Walk of a1 means :Def32: :: GLIB_001:def 32
( a3 is_Walk_from a2 .first() ,a2 .last() & ex b1 being FinSubsequence of a2 .edgeSeq() st a3 .edgeSeq() = Seq b1 );
existence
ex b1 being Walk of c1 st
( b1 is_Walk_from c2 .first() ,c2 .last() & ex b2 being FinSubsequence of c2 .edgeSeq() st b1 .edgeSeq() = Seq b2 )
proof end;
end;

:: deftheorem Def32 defines Subwalk GLIB_001:def 32 :
for b1 being _Graph
for b2, b3 being Walk of b1 holds
( b3 is Subwalk of b2 iff ( b3 is_Walk_from b2 .first() ,b2 .last() & ex b4 being FinSubsequence of b2 .edgeSeq() st b3 .edgeSeq() = Seq b4 ) );

Lemma105: for b1 being _Graph
for b2 being Walk of b1 holds b2 is Subwalk of b2
proof end;

Lemma106: for b1 being _Graph
for b2 being Walk of b1
for b3 being Subwalk of b2
for b4 being Subwalk of b3 holds b4 is Subwalk of b2
proof end;

Lemma107: for b1 being _Graph
for b2, b3 being Walk of b1 st b2 is Subwalk of b3 holds
len b2 <= len b3
proof end;

definition
let c1 be _Graph;
let c2 be Walk of c1;
let c3, c4 be Nat;
redefine func .remove as c2 .remove c3,c4 -> Subwalk of a2;
coherence
c2 .remove c3,c4 is Subwalk of c2
proof end;
end;

registration
let c1 be _Graph;
let c2 be Walk of c1;
cluster Trail-like Path-like Subwalk of a2;
existence
ex b1 being Subwalk of c2 st
( b1 is Trail-like & b1 is Path-like )
proof end;
end;

definition
let c1 be _Graph;
let c2 be Walk of c1;
mode Trail of a2 is Trail-like Subwalk of a2;
mode Path of a2 is Path-like Subwalk of a2;
end;

registration
let c1 be _Graph;
let c2 be DWalk of c1;
cluster directed Subwalk of a2;
existence
ex b1 being Path of c2 st b1 is directed
proof end;
end;

definition
let c1 be _Graph;
let c2 be DWalk of c1;
mode DWalk of a2 is directed Subwalk of a2;
mode DTrail of a2 is directed Trail of a2;
mode DPath of a2 is directed Path of a2;
end;

definition
let c1 be _Graph;
func c1 .allWalks() -> non empty Subset of (((the_Vertices_of a1) \/ (the_Edges_of a1)) * ) equals :: GLIB_001:def 33
{ b1 where B is Walk of a1 : verum } ;
coherence
{ b1 where B is Walk of c1 : verum } is non empty Subset of (((the_Vertices_of c1) \/ (the_Edges_of c1)) * )
proof end;
end;

:: deftheorem Def33 defines .allWalks() GLIB_001:def 33 :
for b1 being _Graph holds b1 .allWalks() = { b2 where B is Walk of b1 : verum } ;

definition
let c1 be _Graph;
func c1 .allTrails() -> non empty Subset of (a1 .allWalks() ) equals :: GLIB_001:def 34
{ b1 where B is Trail of a1 : verum } ;
coherence
{ b1 where B is Trail of c1 : verum } is non empty Subset of (c1 .allWalks() )
proof end;
end;

:: deftheorem Def34 defines .allTrails() GLIB_001:def 34 :
for b1 being _Graph holds b1 .allTrails() = { b2 where B is Trail of b1 : verum } ;

definition
let c1 be _Graph;
func c1 .allPaths() -> non empty Subset of (a1 .allTrails() ) equals :: GLIB_001:def 35
{ b1 where B is Path of a1 : verum } ;
coherence
{ b1 where B is Path of c1 : verum } is non empty Subset of (c1 .allTrails() )
proof end;
end;

:: deftheorem Def35 defines .allPaths() GLIB_001:def 35 :
for b1 being _Graph holds b1 .allPaths() = { b2 where B is Path of b1 : verum } ;

definition
let c1 be _Graph;
func c1 .allDWalks() -> non empty Subset of (a1 .allWalks() ) equals :: GLIB_001:def 36
{ b1 where B is DWalk of a1 : verum } ;
coherence
{ b1 where B is DWalk of c1 : verum } is non empty Subset of (c1 .allWalks() )
proof end;
end;

:: deftheorem Def36 defines .allDWalks() GLIB_001:def 36 :
for b1 being _Graph holds b1 .allDWalks() = { b2 where B is DWalk of b1 : verum } ;

definition
let c1 be _Graph;
func c1 .allDTrails() -> non empty Subset of (a1 .allTrails() ) equals :: GLIB_001:def 37
{ b1 where B is DTrail of a1 : verum } ;
coherence
{ b1 where B is DTrail of c1 : verum } is non empty Subset of (c1 .allTrails() )
proof end;
end;

:: deftheorem Def37 defines .allDTrails() GLIB_001:def 37 :
for b1 being _Graph holds b1 .allDTrails() = { b2 where B is DTrail of b1 : verum } ;

definition
let c1 be _Graph;
func c1 .allDPaths() -> non empty Subset of (a1 .allDTrails() ) equals :: GLIB_001:def 38
{ b1 where B is directed Path of a1 : verum } ;
coherence
{ b1 where B is directed Path of c1 : verum } is non empty Subset of (c1 .allDTrails() )
proof end;
end;

:: deftheorem Def38 defines .allDPaths() GLIB_001:def 38 :
for b1 being _Graph holds b1 .allDPaths() = { b2 where B is directed Path of b1 : verum } ;

registration
let c1 be finite _Graph;
cluster a1 .allTrails() -> non empty finite ;
correctness
coherence
c1 .allTrails() is finite
;
proof end;
end;

definition
let c1 be _Graph;
let c2 be non empty Subset of (c1 .allWalks() );
redefine mode Element as Element of c2 -> Walk of a1;
coherence
for b1 being Element of c2 holds b1 is Walk of c1
proof end;
end;

definition
let c1 be _Graph;
let c2 be non empty Subset of (c1 .allTrails() );
redefine mode Element as Element of c2 -> Trail of a1;
coherence
for b1 being Element of c2 holds b1 is Trail of c1
proof end;
end;

definition
let c1 be _Graph;
let c2 be non empty Subset of (c1 .allPaths() );
redefine mode Element as Element of c2 -> Path of a1;
coherence
for b1 being Element of c2 holds b1 is Path of c1
proof end;
end;

definition
let c1 be _Graph;
let c2 be non empty Subset of (c1 .allDWalks() );
redefine mode Element as Element of c2 -> DWalk of a1;
coherence
for b1 being Element of c2 holds b1 is DWalk of c1
proof end;
end;

definition
let c1 be _Graph;
let c2 be non empty Subset of (c1 .allDTrails() );
redefine mode Element as Element of c2 -> DTrail of a1;
coherence
for b1 being Element of c2 holds b1 is DTrail of c1
proof end;
end;

definition
let c1 be _Graph;
let c2 be non empty Subset of (c1 .allDPaths() );
redefine mode Element as Element of c2 -> DPath of a1;
coherence
for b1 being Element of c2 holds b1 is DPath of c1
proof end;
end;

theorem Th7: :: GLIB_001:7
canceled;

theorem Th8: :: GLIB_001:8
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
b2 . b3 in the_Vertices_of b1 by Lemma32;

theorem Th9: :: GLIB_001:9
for b1 being _Graph
for b2 being Walk of b1
for b3 being even Nat st b3 in dom b2 holds
b2 . b3 in the_Edges_of b1
proof end;

theorem Th10: :: GLIB_001:10
for b1 being _Graph
for b2 being Walk of b1
for b3 being even Nat st b3 in dom b2 holds
ex b4 being odd Nat st
( b4 = b3 - 1 & b3 - 1 in dom b2 & b3 + 1 in dom b2 & b2 . b3 Joins b2 . b4,b2 . (b3 + 1),b1 ) by Lemma33;

theorem Th11: :: GLIB_001:11
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 < len b2 holds
b2 . (b3 + 1) in (b2 .vertexAt b3) .edgesInOut()
proof end;

theorem Th12: :: GLIB_001:12
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st 1 < b3 & b3 <= len b2 holds
b2 . (b3 - 1) in (b2 .vertexAt b3) .edgesInOut()
proof end;

theorem Th13: :: GLIB_001:13
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 < len b2 holds
( b3 in dom b2 & b3 + 1 in dom b2 & b3 + 2 in dom b2 )
proof end;

theorem Th14: :: GLIB_001:14
for b1 being _Graph
for b2 being Vertex of b1 holds
( len (b1 .walkOf b2) = 1 & (b1 .walkOf b2) . 1 = b2 & (b1 .walkOf b2) .first() = b2 & (b1 .walkOf b2) .last() = b2 & b1 .walkOf b2 is_Walk_from b2,b2 )
proof end;

theorem Th15: :: GLIB_001:15
for b1 being _Graph
for b2, b3, b4 being set st b2 Joins b3,b4,b1 holds
len (b1 .walkOf b3,b2,b4) = 3
proof end;

theorem Th16: :: GLIB_001:16
for b1 being _Graph
for b2, b3, b4 being set st b2 Joins b3,b4,b1 holds
( (b1 .walkOf b3,b2,b4) .first() = b3 & (b1 .walkOf b3,b2,b4) .last() = b4 & b1 .walkOf b3,b2,b4 is_Walk_from b3,b4 )
proof end;

theorem Th17: :: GLIB_001:17
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
( b3 .first() = b4 .first() & b3 .last() = b4 .last() ) ;

theorem Th18: :: GLIB_001:18
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set holds
( b2 is_Walk_from b3,b4 iff ( b2 . 1 = b3 & b2 . (len b2) = b4 ) )
proof end;

theorem Th19: :: GLIB_001:19
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b2 is_Walk_from b3,b4 holds
( b3 is Vertex of b1 & b4 is Vertex of b1 )
proof end;

theorem Th20: :: GLIB_001:20
for b1, b2 being _Graph
for b3, b4 being set
for b5 being Walk of b1
for b6 being Walk of b2 st b5 = b6 holds
( b5 is_Walk_from b3,b4 iff b6 is_Walk_from b3,b4 )
proof end;

theorem Th21: :: GLIB_001:21
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
for b5 being Nat holds b3 .vertexAt b5 = b4 .vertexAt b5
proof end;

theorem Th22: :: GLIB_001:22
for b1 being _Graph
for b2 being Walk of b1 holds
( len b2 = len (b2 .reverse() ) & dom b2 = dom (b2 .reverse() ) & rng b2 = rng (b2 .reverse() ) ) by Lemma38;

theorem Th23: :: GLIB_001:23
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 .first() = (b2 .reverse() ) .last() & b2 .last() = (b2 .reverse() ) .first() )
proof end;

theorem Th24: :: GLIB_001:24
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set holds
( b2 is_Walk_from b3,b4 iff b2 .reverse() is_Walk_from b4,b3 )
proof end;

theorem Th25: :: GLIB_001:25
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat st b3 in dom b2 holds
( b2 . b3 = (b2 .reverse() ) . (((len b2) - b3) + 1) & ((len b2) - b3) + 1 in dom (b2 .reverse() ) )
proof end;

theorem Th26: :: GLIB_001:26
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat st b3 in dom (b2 .reverse() ) holds
( (b2 .reverse() ) . b3 = b2 . (((len b2) - b3) + 1) & ((len b2) - b3) + 1 in dom b2 ) by Lemma40;

theorem Th27: :: GLIB_001:27
for b1 being _Graph
for b2 being Walk of b1 holds (b2 .reverse() ) .reverse() = b2 by Lemma41;

theorem Th28: :: GLIB_001:28
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
b3 .reverse() = b4 .reverse() ;

theorem Th29: :: GLIB_001:29
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
(len (b2 .append b3)) + 1 = (len b2) + (len b3) by Lemma42;

theorem Th30: :: GLIB_001:30
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
( len b2 <= len (b2 .append b3) & len b3 <= len (b2 .append b3) ) by Lemma43;

theorem Th31: :: GLIB_001:31
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
( (b2 .append b3) .first() = b2 .first() & (b2 .append b3) .last() = b3 .last() & b2 .append b3 is_Walk_from b2 .first() ,b3 .last() ) by Lemma44;

theorem Th32: :: GLIB_001:32
for b1 being _Graph
for b2, b3 being Walk of b1
for b4, b5, b6 being set st b2 is_Walk_from b4,b5 & b3 is_Walk_from b5,b6 holds
b2 .append b3 is_Walk_from b4,b6
proof end;

theorem Th33: :: GLIB_001:33
for b1 being _Graph
for b2, b3 being Walk of b1
for b4 being Nat st b4 in dom b2 holds
( (b2 .append b3) . b4 = b2 . b4 & b4 in dom (b2 .append b3) ) by Lemma45;

theorem Th34: :: GLIB_001:34
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
for b4 being Nat st b4 < len b3 holds
( (b2 .append b3) . ((len b2) + b4) = b3 . (b4 + 1) & (len b2) + b4 in dom (b2 .append b3) ) by Lemma46;

theorem Th35: :: GLIB_001:35
for b1 being _Graph
for b2, b3 being Walk of b1
for b4 being Nat holds
( not b4 in dom (b2 .append b3) or b4 in dom b2 or ex b5 being Nat st
( b5 < len b3 & b4 = (len b2) + b5 ) ) by Lemma47;

theorem Th36: :: GLIB_001:36
for b1, b2 being _Graph
for b3, b4 being Walk of b1
for b5, b6 being Walk of b2 st b3 = b5 & b4 = b6 holds
b3 .append b4 = b5 .append b6
proof end;

theorem Th37: :: GLIB_001:37
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 holds
( (len (b2 .cut b3,b4)) + b3 = b4 + 1 & ( for b5 being Nat st b5 < len (b2 .cut b3,b4) holds
( (b2 .cut b3,b4) . (b5 + 1) = b2 . (b3 + b5) & b3 + b5 in dom b2 ) ) ) by Lemma48;

theorem Th38: :: GLIB_001:38
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 holds
( (b2 .cut b3,b4) .first() = b2 . b3 & (b2 .cut b3,b4) .last() = b2 . b4 & b2 .cut b3,b4 is_Walk_from b2 . b3,b2 . b4 ) by Lemma49;

theorem Th39: :: GLIB_001:39
for b1 being _Graph
for b2 being Walk of b1
for b3, b4, b5 being odd Nat st b3 <= b4 & b4 <= b5 & b5 <= len b2 holds
(b2 .cut b3,b4) .append (b2 .cut b4,b5) = b2 .cut b3,b5 by Lemma50;

theorem Th40: :: GLIB_001:40
for b1 being _Graph
for b2 being Walk of b1 holds b2 .cut 1,(len b2) = b2 by Lemma51;

theorem Th41: :: GLIB_001:41
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 < len b2 holds
b1 .walkOf (b2 . b3),(b2 . (b3 + 1)),(b2 . (b3 + 2)) = b2 .cut b3,(b3 + 2)
proof end;

theorem Th42: :: GLIB_001:42
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 < len b2 holds
(b2 .cut b3,b4) .addEdge (b2 . (b4 + 1)) = b2 .cut b3,(b4 + 2)
proof end;

theorem Th43: :: GLIB_001:43
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
b2 .cut b3,b3 = <*(b2 .vertexAt b3)*> by Lemma52;

theorem Th44: :: GLIB_001:44
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat st not b3 is even & b3 <= b4 holds
(b2 .cut 1,b4) .cut 1,b3 = b2 .cut 1,b3 by Lemma53;

theorem Th45: :: GLIB_001:45
for b1 being _Graph
for b2, b3 being Walk of b1
for b4, b5 being odd Nat st b4 <= b5 & b5 <= len b2 & b2 .last() = b3 .first() holds
(b2 .append b3) .cut b4,b5 = b2 .cut b4,b5 by Lemma54;

theorem Th46: :: GLIB_001:46
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
len (b2 .cut 1,b3) = b3 by Lemma55;

theorem Th47: :: GLIB_001:47
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat
for b4 being Nat st b4 in dom (b2 .cut 1,b3) & b3 <= len b2 holds
(b2 .cut 1,b3) . b4 = b2 . b4 by Lemma56;

theorem Th48: :: GLIB_001:48
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat
for b5 being Nat st b3 <= b4 & b4 <= len b2 & b5 in dom (b2 .cut b3,b4) holds
( (b2 .cut b3,b4) . b5 = b2 . ((b3 + b5) - 1) & (b3 + b5) - 1 in dom b2 )
proof end;

theorem Th49: :: GLIB_001:49
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2
for b5, b6 being Nat st b3 = b4 holds
b3 .cut b5,b6 = b4 .cut b5,b6
proof end;

theorem Th50: :: GLIB_001:50
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
(len (b2 .remove b3,b4)) + b4 = (len b2) + b3 by Lemma57;

theorem Th51: :: GLIB_001:51
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set
for b5, b6 being Nat st b2 is_Walk_from b3,b4 holds
b2 .remove b5,b6 is_Walk_from b3,b4 by Lemma58;

theorem Th52: :: GLIB_001:52
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat holds len (b2 .remove b3,b4) <= len b2 by Lemma59;

theorem Th53: :: GLIB_001:53
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat holds b2 .remove b3,b3 = b2 by Lemma60;

theorem Th54: :: GLIB_001:54
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
(b2 .cut 1,b3) .last() = (b2 .cut b4,(len b2)) .first() by Lemma61;

theorem Th55: :: GLIB_001:55
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
for b5 being Nat st b5 in Seg b3 holds
(b2 .remove b3,b4) . b5 = b2 . b5 by Lemma62;

theorem Th56: :: GLIB_001:56
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
for b5 being Nat st b3 <= b5 & b5 <= len (b2 .remove b3,b4) holds
( (b2 .remove b3,b4) . b5 = b2 . ((b5 - b3) + b4) & (b5 - b3) + b4 is Nat & (b5 - b3) + b4 <= len b2 ) by Lemma63;

theorem Th57: :: GLIB_001:57
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
len (b2 .remove b3,b4) = ((len b2) + b3) - b4 by Lemma64;

theorem Th58: :: GLIB_001:58
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat st b2 . b3 = b2 .last() holds
b2 .remove b3,(len b2) = b2 .cut 1,b3
proof end;

theorem Th59: :: GLIB_001:59
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat st b2 .first() = b2 . b3 holds
b2 .remove 1,b3 = b2 .cut b3,(len b2) by Lemma65;

theorem Th60: :: GLIB_001:60
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat holds
( (b2 .remove b3,b4) .first() = b2 .first() & (b2 .remove b3,b4) .last() = b2 .last() ) by Lemma66;

theorem Th61: :: GLIB_001:61
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat
for b5 being Nat st b3 <= b4 & b4 <= len b2 & b2 . b3 = b2 . b4 & b5 in dom (b2 .remove b3,b4) & not b5 in Seg b3 holds
( b3 <= b5 & b5 <= len (b2 .remove b3,b4) ) by Lemma67;

theorem Th62: :: GLIB_001:62
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2
for b5, b6 being Nat st b3 = b4 holds
b3 .remove b5,b6 = b4 .remove b5,b6
proof end;

theorem Th63: :: GLIB_001:63
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
b2 .addEdge b3 = b2 ^ <*b3,b4*> by Lemma68;

theorem Th64: :: GLIB_001:64
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
( (b2 .addEdge b3) .first() = b2 .first() & (b2 .addEdge b3) .last() = b4 & b2 .addEdge b3 is_Walk_from b2 .first() ,b4 ) by Lemma69;

theorem Th65: :: GLIB_001:65
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
len (b2 .addEdge b3) = (len b2) + 2 by Lemma70;

theorem Th66: :: GLIB_001:66
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
( (b2 .addEdge b3) . ((len b2) + 1) = b3 & (b2 .addEdge b3) . ((len b2) + 2) = b4 & ( for b5 being Nat st b5 in dom b2 holds
(b2 .addEdge b3) . b5 = b2 . b5 ) ) by Lemma71;

theorem Th67: :: GLIB_001:67
for b1 being _Graph
for b2 being Walk of b1
for b3, b4, b5, b6 being set st b2 is_Walk_from b3,b4 & b5 Joins b4,b6,b1 holds
b2 .addEdge b5 is_Walk_from b3,b6 by Lemma72;

theorem Th68: :: GLIB_001:68
for b1 being _Graph
for b2 being Walk of b1 holds 1 <= len (b2 .vertexSeq() )
proof end;

theorem Th69: :: GLIB_001:69
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
( (2 * ((b3 + 1) div 2)) - 1 = b3 & 1 <= (b3 + 1) div 2 & (b3 + 1) div 2 <= len (b2 .vertexSeq() ) )
proof end;

theorem Th70: :: GLIB_001:70
for b1 being _Graph
for b2 being Vertex of b1 holds (b1 .walkOf b2) .vertexSeq() = <*b2*>
proof end;

theorem Th71: :: GLIB_001:71
for b1 being _Graph
for b2, b3, b4 being set st b2 Joins b3,b4,b1 holds
(b1 .walkOf b3,b2,b4) .vertexSeq() = <*b3,b4*>
proof end;

theorem Th72: :: GLIB_001:72
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 .first() = (b2 .vertexSeq() ) . 1 & b2 .last() = (b2 .vertexSeq() ) . (len (b2 .vertexSeq() )) )
proof end;

theorem Th73: :: GLIB_001:73
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
b2 .vertexAt b3 = (b2 .vertexSeq() ) . ((b3 + 1) div 2)
proof end;

theorem Th74: :: GLIB_001:74
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat holds
( b3 in dom (b2 .vertexSeq() ) iff (2 * b3) - 1 in dom b2 )
proof end;

theorem Th75: :: GLIB_001:75
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat holds (b2 .cut 1,b3) .vertexSeq() c= b2 .vertexSeq()
proof end;

theorem Th76: :: GLIB_001:76
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
(b2 .addEdge b3) .vertexSeq() = (b2 .vertexSeq() ) ^ <*b4*>
proof end;

theorem Th77: :: GLIB_001:77
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
b3 .vertexSeq() = b4 .vertexSeq()
proof end;

theorem Th78: :: GLIB_001:78
for b1 being _Graph
for b2 being Walk of b1
for b3 being even Nat st 1 <= b3 & b3 <= len b2 holds
( b3 div 2 in dom (b2 .edgeSeq() ) & b2 . b3 = (b2 .edgeSeq() ) . (b3 div 2) ) by Lemma73;

theorem Th79: :: GLIB_001:79
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat holds
( b3 in dom (b2 .edgeSeq() ) iff 2 * b3 in dom b2 ) by Lemma74;

theorem Th80: :: GLIB_001:80
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat st b3 in dom (b2 .edgeSeq() ) holds
(b2 .edgeSeq() ) . b3 in the_Edges_of b1
proof end;

theorem Th81: :: GLIB_001:81
for b1 being _Graph
for b2 being Walk of b1 ex b3 being even Nat st
( b3 = (len b2) - 1 & len (b2 .edgeSeq() ) = b3 div 2 ) by Lemma75;

theorem Th82: :: GLIB_001:82
for b1 being _Graph
for b2 being Walk of b1
for b3 being Nat holds (b2 .cut 1,b3) .edgeSeq() c= b2 .edgeSeq() by Lemma76;

theorem Th83: :: GLIB_001:83
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
(b2 .addEdge b3) .edgeSeq() = (b2 .edgeSeq() ) ^ <*b3*> by Lemma77;

theorem Th84: :: GLIB_001:84
for b1 being _Graph
for b2, b3, b4 being set holds
( b2 Joins b3,b4,b1 iff (b1 .walkOf b3,b2,b4) .edgeSeq() = <*b2*> )
proof end;

theorem Th85: :: GLIB_001:85
for b1 being _Graph
for b2 being Walk of b1 holds (b2 .reverse() ) .edgeSeq() = Rev (b2 .edgeSeq() )
proof end;

theorem Th86: :: GLIB_001:86
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
(b2 .append b3) .edgeSeq() = (b2 .edgeSeq() ) ^ (b3 .edgeSeq() )
proof end;

theorem Th87: :: GLIB_001:87
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
b3 .edgeSeq() = b4 .edgeSeq()
proof end;

theorem Th88: :: GLIB_001:88
for b1 being _Graph
for b2 being Walk of b1
for b3 being set holds
( b3 in b2 .vertices() iff ex b4 being odd Nat st
( b4 <= len b2 & b2 . b4 = b3 ) ) by Lemma78;

theorem Th89: :: GLIB_001:89
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 .first() in b2 .vertices() & b2 .last() in b2 .vertices() )
proof end;

theorem Th90: :: GLIB_001:90
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
b2 .vertexAt b3 in b2 .vertices()
proof end;

theorem Th91: :: GLIB_001:91
for b1 being _Graph
for b2 being Vertex of b1 holds (b1 .walkOf b2) .vertices() = {b2}
proof end;

theorem Th92: :: GLIB_001:92
for b1 being _Graph
for b2, b3, b4 being set st b2 Joins b3,b4,b1 holds
(b1 .walkOf b3,b2,b4) .vertices() = {b3,b4}
proof end;

theorem Th93: :: GLIB_001:93
for b1 being _Graph
for b2 being Walk of b1 holds b2 .vertices() = (b2 .reverse() ) .vertices()
proof end;

theorem Th94: :: GLIB_001:94
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
(b2 .append b3) .vertices() = (b2 .vertices() ) \/ (b3 .vertices() )
proof end;

theorem Th95: :: GLIB_001:95
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 holds
(b2 .cut b3,b4) .vertices() c= b2 .vertices()
proof end;

theorem Th96: :: GLIB_001:96
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
(b2 .addEdge b3) .vertices() = (b2 .vertices() ) \/ {b4}
proof end;

theorem Th97: :: GLIB_001:97
for b1 being finite _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 & not b4 in b2 .vertices() holds
card ((b2 .addEdge b3) .vertices() ) = (card (b2 .vertices() )) + 1
proof end;

theorem Th98: :: GLIB_001:98
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 in b2 .vertices() & b4 in b2 .vertices() holds
ex b5 being Walk of b1 st b5 is_Walk_from b3,b4
proof end;

theorem Th99: :: GLIB_001:99
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
b3 .vertices() = b4 .vertices() by Th77;

theorem Th100: :: GLIB_001:100
for b1 being _Graph
for b2 being Walk of b1
for b3 being set holds
( b3 in b2 .edges() iff ex b4 being even Nat st
( 1 <= b4 & b4 <= len b2 & b2 . b4 = b3 ) ) by Lemma79;

theorem Th101: :: GLIB_001:101
for b1 being _Graph
for b2 being Walk of b1
for b3 being set holds
( b3 in b2 .edges() iff ex b4 being odd Nat st
( b4 < len b2 & b2 . (b4 + 1) = b3 ) )
proof end;

theorem Th102: :: GLIB_001:102
for b1 being _Graph
for b2 being Walk of b1 holds rng b2 = (b2 .vertices() ) \/ (b2 .edges() )
proof end;

theorem Th103: :: GLIB_001:103
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
(b2 .append b3) .edges() = (b2 .edges() ) \/ (b3 .edges() )
proof end;

theorem Th104: :: GLIB_001:104
for b1 being _Graph
for b2 being Walk of b1
for b3 being set st b3 in b2 .edges() holds
ex b4, b5 being Vertex of b1ex b6 being odd Nat st
( b6 + 2 <= len b2 & b4 = b2 . b6 & b3 = b2 . (b6 + 1) & b5 = b2 . (b6 + 2) & b3 Joins b4,b5,b1 ) by Lemma80;

theorem Th105: :: GLIB_001:105
for b1 being _Graph
for b2 being Walk of b1
for b3 being set holds
( b3 in b2 .edges() iff ex b4 being Nat st
( b4 in dom (b2 .edgeSeq() ) & (b2 .edgeSeq() ) . b4 = b3 ) )
proof end;

theorem Th106: :: GLIB_001:106
for b1 being _Graph
for b2 being Walk of b1
for b3, b4, b5 being set st b3 in b2 .edges() & b3 Joins b4,b5,b1 holds
( b4 in b2 .vertices() & b5 in b2 .vertices() ) by Lemma81;

theorem Th107: :: GLIB_001:107
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being Nat holds (b2 .cut b3,b4) .edges() c= b2 .edges()
proof end;

theorem Th108: :: GLIB_001:108
for b1 being _Graph
for b2 being Walk of b1 holds b2 .edges() = (b2 .reverse() ) .edges()
proof end;

theorem Th109: :: GLIB_001:109
for b1 being _Graph
for b2, b3, b4 being set holds
( b2 Joins b3,b4,b1 iff (b1 .walkOf b3,b2,b4) .edges() = {b2} )
proof end;

theorem Th110: :: GLIB_001:110
for b1 being _Graph
for b2 being Walk of b1 holds b2 .edges() c= b1 .edgesBetween (b2 .vertices() )
proof end;

theorem Th111: :: GLIB_001:111
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
b3 .edges() = b4 .edges() by Th87;

theorem Th112: :: GLIB_001:112
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
(b2 .addEdge b3) .edges() = (b2 .edges() ) \/ {b3}
proof end;

theorem Th113: :: GLIB_001:113
for b1 being _Graph
for b2 being Walk of b1 holds len b2 = (2 * (b2 .length() )) + 1 by Lemma82;

theorem Th114: :: GLIB_001:114
for b1 being _Graph
for b2, b3 being Walk of b1 holds
( len b2 = len b3 iff b2 .length() = b3 .length() )
proof end;

theorem Th115: :: GLIB_001:115
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
b3 .length() = b4 .length() by Th87;

theorem Th116: :: GLIB_001:116
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
( b2 .find (b2 . b3) <= b3 & b2 .rfind (b2 . b3) >= b3 )
proof end;

theorem Th117: :: GLIB_001:117
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2
for b5 being set st b3 = b4 holds
( b3 .find b5 = b4 .find b5 & b3 .rfind b5 = b4 .rfind b5 )
proof end;

theorem Th118: :: GLIB_001:118
for b1 being _Graph
for b2 being Walk of b1
for b3 being odd Nat st b3 <= len b2 holds
( b2 .find b3 <= b3 & b2 .rfind b3 >= b3 ) by Lemma83, Lemma84;

theorem Th119: :: GLIB_001:119
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is closed iff b2 . 1 = b2 . (len b2) )
proof end;

theorem Th120: :: GLIB_001:120
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is closed iff ex b3 being set st b2 is_Walk_from b3,b3 )
proof end;

theorem Th121: :: GLIB_001:121
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is closed iff b2 .reverse() is closed )
proof end;

theorem Th122: :: GLIB_001:122
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 & b3 is closed holds
b4 is closed
proof end;

theorem Th123: :: GLIB_001:123
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is directed iff for b3 being odd Nat st b3 < len b2 holds
b2 . (b3 + 1) DJoins b2 . b3,b2 . (b3 + 2),b1 ) by Lemma85;

theorem Th124: :: GLIB_001:124
for b1 being _Graph
for b2 being Walk of b1
for b3, b4, b5, b6 being set st b2 is directed & b2 is_Walk_from b3,b4 & b5 DJoins b4,b6,b1 holds
( b2 .addEdge b5 is directed & b2 .addEdge b5 is_Walk_from b3,b6 ) by Lemma86;

theorem Th125: :: GLIB_001:125
for b1 being _Graph
for b2 being DWalk of b1
for b3, b4 being Nat holds b2 .cut b3,b4 is directed ;

theorem Th126: :: GLIB_001:126
for b1 being _Graph
for b2 being Walk of b1 holds
( not b2 is trivial iff 3 <= len b2 ) by Lemma88;

theorem Th127: :: GLIB_001:127
for b1 being _Graph
for b2 being Walk of b1 holds
( not b2 is trivial iff len b2 <> 1 ) by Lemma89;

theorem Th128: :: GLIB_001:128
for b1 being _Graph
for b2 being Walk of b1 st b2 .first() <> b2 .last() holds
not b2 is trivial by Lemma89;

theorem Th129: :: GLIB_001:129
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is trivial iff ex b3 being Vertex of b1 st b2 = b1 .walkOf b3 ) by Lemma90;

theorem Th130: :: GLIB_001:130
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is trivial iff b2 .reverse() is trivial )
proof end;

theorem Th131: :: GLIB_001:131
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 is trivial holds
b3 .append b2 = b3
proof end;

theorem Th132: :: GLIB_001:132
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being odd Nat st b3 <= b4 & b4 <= len b2 holds
( b2 .cut b3,b4 is trivial iff b3 = b4 )
proof end;

theorem Th133: :: GLIB_001:133
for b1 being _Graph
for b2 being Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 holds
not b2 .addEdge b3 is trivial
proof end;

theorem Th134: :: GLIB_001:134
for b1 being _Graph
for b2 being Walk of b1 st not b2 is trivial holds
ex b3 being odd Nat st
( b3 = (len b2) - 2 & (b2 .cut 1,b3) .addEdge (b2 . (b3 + 1)) = b2 )
proof end;

theorem Th135: :: GLIB_001:135
for b1 being _Graph
for b2, b3 being Walk of b1 st not b2 is trivial & b2 .edges() c= b3 .edges() holds
b2 .vertices() c= b3 .vertices()
proof end;

theorem Th136: :: GLIB_001:136
for b1 being _Graph
for b2 being Walk of b1 st not b2 is trivial holds
for b3 being Vertex of b1 st b3 in b2 .vertices() holds
not b3 is isolated
proof end;

theorem Th137: :: GLIB_001:137
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is trivial iff b2 .edges() = {} )
proof end;

theorem Th138: :: GLIB_001:138
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 & b3 is trivial holds
b4 is trivial
proof end;

theorem Th139: :: GLIB_001:139
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is Trail-like iff for b3, b4 being even Nat st 1 <= b3 & b3 < b4 & b4 <= len b2 holds
b2 . b3 <> b2 . b4 ) by Lemma91;

theorem Th140: :: GLIB_001:140
for b1 being _Graph
for b2 being Walk of b1 st len b2 <= 3 holds
b2 is Trail-like by Lemma95;

theorem Th141: :: GLIB_001:141
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is Trail-like iff b2 .reverse() is Trail-like ) by Lemma92;

theorem Th142: :: GLIB_001:142
for b1 being _Graph
for b2 being Trail of b1
for b3, b4 being Nat holds b2 .cut b3,b4 is Trail-like ;

theorem Th143: :: GLIB_001:143
for b1 being _Graph
for b2 being Trail of b1
for b3 being set st b3 in (b2 .last() ) .edgesInOut() & not b3 in b2 .edges() holds
b2 .addEdge b3 is Trail-like by Lemma94;

theorem Th144: :: GLIB_001:144
for b1 being _Graph
for b2 being Trail of b1
for b3 being Vertex of b1 st b3 in b2 .vertices() & b3 is endvertex & not b3 = b2 .first() holds
b3 = b2 .last()
proof end;

theorem Th145: :: GLIB_001:145
for b1 being finite _Graph
for b2 being Trail of b1 holds len (b2 .edgeSeq() ) <= b1 .size()
proof end;

theorem Th146: :: GLIB_001:146
for b1 being _Graph
for b2 being Walk of b1 st len b2 <= 3 holds
b2 is Path-like by Lemma103;

theorem Th147: :: GLIB_001:147
for b1 being _Graph
for b2 being Walk of b1 st ( for b3, b4 being odd Nat st b3 <= len b2 & b4 <= len b2 & b2 . b3 = b2 . b4 holds
b3 = b4 ) holds
b2 is Path-like by Lemma100;

theorem Th148: :: GLIB_001:148
for b1 being _Graph
for b2 being Path of b1 st not b2 is closed holds
for b3, b4 being odd Nat st b3 < b4 & b4 <= len b2 holds
b2 . b3 <> b2 . b4
proof end;

theorem Th149: :: GLIB_001:149
for b1 being _Graph
for b2 being Walk of b1 holds
( b2 is Path-like iff b2 .reverse() is Path-like ) by Lemma97;

theorem Th150: :: GLIB_001:150
for b1 being _Graph
for b2 being Path of b1
for b3, b4 being Nat holds b2 .cut b3,b4 is Path-like ;

theorem Th151: :: GLIB_001:151
for b1 being _Graph
for b2 being Path of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 & not b3 in b2 .edges() & ( b2 is trivial or not b2 is closed ) & ( for b5 being odd Nat st 1 < b5 & b5 <= len b2 holds
b2 . b5 <> b4 ) holds
b2 .addEdge b3 is Path-like
proof end;

theorem Th152: :: GLIB_001:152
for b1 being _Graph
for b2 being Path of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 & not b4 in b2 .vertices() & ( b2 is trivial or not b2 is closed ) holds
b2 .addEdge b3 is Path-like by Lemma102;

theorem Th153: :: GLIB_001:153
for b1 being _Graph
for b2 being Walk of b1 st ( for b3 being odd Nat st b3 <= len b2 holds
b2 .find (b2 . b3) = b2 .rfind (b2 . b3) ) holds
b2 is Path-like
proof end;

theorem Th154: :: GLIB_001:154
for b1 being _Graph
for b2 being Walk of b1 st ( for b3 being odd Nat st b3 <= len b2 holds
b2 .rfind b3 = b3 ) holds
b2 is Path-like by Lemma101;

theorem Th155: :: GLIB_001:155
for b1 being finite _Graph
for b2 being Path of b1 holds len (b2 .vertexSeq() ) <= (b1 .order() ) + 1
proof end;

theorem Th156: :: GLIB_001:156
for b1 being _Graph
for b2 being vertex-distinct Walk of b1
for b3, b4 being set st b3 Joins b2 .last() ,b4,b1 & not b4 in b2 .vertices() holds
b2 .addEdge b3 is vertex-distinct
proof end;

theorem Th157: :: GLIB_001:157
for b1 being _Graph
for b2, b3 being set st b2 Joins b3,b3,b1 holds
b1 .walkOf b3,b2,b3 is Cycle-like
proof end;

theorem Th158: :: GLIB_001:158
for b1 being _Graph
for b2 being Walk of b1
for b3, b4, b5 being set st b3 Joins b4,b5,b1 & b3 in b2 .edges() & b2 is Cycle-like holds
ex b6 being Walk of b1 st
( b6 is_Walk_from b4,b5 & not b3 in b6 .edges() )
proof end;

theorem Th159: :: GLIB_001:159
for b1 being _Graph
for b2 being Walk of b1 holds b2 is Subwalk of b2 by Lemma105;

theorem Th160: :: GLIB_001:160
for b1 being _Graph
for b2 being Walk of b1
for b3 being Subwalk of b2
for b4 being Subwalk of b3 holds b4 is Subwalk of b2 by Lemma106;

theorem Th161: :: GLIB_001:161
for b1 being _Graph
for b2, b3 being Walk of b1
for b4, b5 being set st b2 is Subwalk of b3 holds
( b2 is_Walk_from b4,b5 iff b3 is_Walk_from b4,b5 )
proof end;

theorem Th162: :: GLIB_001:162
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 is Subwalk of b3 holds
( b2 .first() = b3 .first() & b2 .last() = b3 .last() )
proof end;

theorem Th163: :: GLIB_001:163
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 is Subwalk of b3 holds
len b2 <= len b3 by Lemma107;

theorem Th164: :: GLIB_001:164
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 is Subwalk of b3 holds
( b2 .edges() c= b3 .edges() & b2 .vertices() c= b3 .vertices() )
proof end;

theorem Th165: :: GLIB_001:165
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 is Subwalk of b3 holds
for b4 being odd Nat st b4 <= len b2 holds
ex b5 being odd Nat st
( b4 <= b5 & b5 <= len b3 & b2 . b4 = b3 . b5 )
proof end;

theorem Th166: :: GLIB_001:166
for b1 being _Graph
for b2, b3 being Walk of b1 st b2 is Subwalk of b3 holds
for b4 being even Nat st 1 <= b4 & b4 <= len b2 holds
ex b5 being even Nat st
( b4 <= b5 & b5 <= len b3 & b2 . b4 = b3 . b5 )
proof end;

theorem Th167: :: GLIB_001:167
for b1 being _Graph
for b2 being Trail of b1 st not b2 is trivial holds
ex b3 being Path of b2 st not b3 is trivial
proof end;

theorem Th168: :: GLIB_001:168
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Walk of b2 holds b3 is Walk of b1
proof end;

theorem Th169: :: GLIB_001:169
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Walk of b1 st b3 is trivial & b3 .first() in the_Vertices_of b2 holds
b3 is Walk of b2
proof end;

theorem Th170: :: GLIB_001:170
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Walk of b1 st not b3 is trivial & b3 .edges() c= the_Edges_of b2 holds
b3 is Walk of b2
proof end;

theorem Th171: :: GLIB_001:171
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Walk of b1 st b3 .vertices() c= the_Vertices_of b2 & b3 .edges() c= the_Edges_of b2 holds
b3 is Walk of b2
proof end;

theorem Th172: :: GLIB_001:172
for b1 being non trivial _Graph
for b2 being Walk of b1
for b3 being Vertex of b1
for b4 being removeVertex of b1,b3 st not b3 in b2 .vertices() holds
b2 is Walk of b4
proof end;

theorem Th173: :: GLIB_001:173
for b1 being _Graph
for b2 being Walk of b1
for b3 being set
for b4 being removeEdge of b1,b3 st not b3 in b2 .edges() holds
b2 is Walk of b4
proof end;

theorem Th174: :: GLIB_001:174
for b1 being _Graph
for b2 being Subgraph of b1
for b3, b4, b5 being set st b5 Joins b3,b4,b2 holds
b1 .walkOf b3,b5,b4 = b2 .walkOf b3,b5,b4
proof end;

theorem Th175: :: GLIB_001:175
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Walk of b1
for b4 being Walk of b2
for b5 being set st b3 = b4 & b5 in (b4 .last() ) .edgesInOut() holds
b3 .addEdge b5 = b4 .addEdge b5
proof end;

theorem Th176: :: GLIB_001:176
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Walk of b2 holds
( ( b3 is closed implies b3 is closed Walk of b1 ) & ( b3 is directed implies b3 is directed Walk of b1 ) & ( b3 is trivial implies b3 is trivial Walk of b1 ) & ( b3 is Trail-like implies b3 is Trail-like Walk of b1 ) & ( b3 is Path-like implies b3 is Path-like Walk of b1 ) & ( b3 is vertex-distinct implies b3 is vertex-distinct Walk of b1 ) )
proof end;

theorem Th177: :: GLIB_001:177
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
( ( b3 is closed implies b4 is closed ) & ( b4 is closed implies b3 is closed ) & ( b3 is directed implies b4 is directed ) & ( b4 is directed implies b3 is directed ) & ( b3 is trivial implies b4 is trivial ) & ( b4 is trivial implies b3 is trivial ) & ( b3 is Trail-like implies b4 is Trail-like ) & ( b4 is Trail-like implies b3 is Trail-like ) & ( b3 is Path-like implies b4 is Path-like ) & ( b4 is Path-like implies b3 is Path-like ) & ( b3 is vertex-distinct implies b4 is vertex-distinct ) & ( b4 is vertex-distinct implies b3 is vertex-distinct ) )
proof end;

theorem Th178: :: GLIB_001:178
for b1, b2 being _Graph
for b3 being set st b1 == b2 & b3 is VertexSeq of b1 holds
b3 is VertexSeq of b2
proof end;

theorem Th179: :: GLIB_001:179
for b1, b2 being _Graph
for b3 being set st b1 == b2 & b3 is EdgeSeq of b1 holds
b3 is EdgeSeq of b2
proof end;

theorem Th180: :: GLIB_001:180
for b1, b2 being _Graph
for b3 being set st b1 == b2 & b3 is Walk of b1 holds
b3 is Walk of b2
proof end;

theorem Th181: :: GLIB_001:181
for b1, b2 being _Graph
for b3, b4, b5 being set st b1 == b2 holds
b1 .walkOf b3,b4,b5 = b2 .walkOf b3,b4,b5
proof end;

theorem Th182: :: GLIB_001:182
for b1, b2 being _Graph
for b3 being Walk of b1
for b4 being Walk of b2 st b1 == b2 & b3 = b4 holds
( ( b3 is closed implies b4 is closed ) & ( b4 is closed implies b3 is closed ) & ( b3 is directed implies b4 is directed ) & ( b4 is directed implies b3 is directed ) & ( b3 is trivial implies b4 is trivial ) & ( b4 is trivial implies b3 is trivial ) & ( b3 is Trail-like implies b4 is Trail-like ) & ( b4 is Trail-like implies b3 is Trail-like ) & ( b3 is Path-like implies b4 is Path-like ) & ( b4 is Path-like implies b3 is Path-like ) & ( b3 is vertex-distinct implies b4 is vertex-distinct ) & ( b4 is vertex-distinct implies b3 is vertex-distinct ) )
proof end;