:: Chordal Graphs
:: by Broderick Arneson and Piotr Rudnicki
::
:: Received August 18, 2006
:: Copyright (c) 2006-2011 Association of Mizar Users


begin

theorem Th1: :: CHORD:1
for n being non zero natural number holds
( n - 1 is natural number & 1 <= n )
proof end;

theorem Th2: :: CHORD:2
for n being natural odd number holds
( n - 1 is natural number & 1 <= n ) by Th1;

Lm1: for a, b, c being Integer st a + 2 < b holds
((c - b) + 1) + 2 < (c - a) + 1
proof end;

theorem Th3: :: CHORD:3
for n, m being odd Integer st n < m holds
n <= m - 2
proof end;

theorem Th4: :: CHORD:4
for n, m being odd Integer st m < n holds
m + 2 <= n
proof end;

theorem Th5: :: CHORD:5
for n being natural odd number st 1 <> n holds
ex m being natural odd number st m + 2 = n
proof end;

theorem Th6: :: CHORD:6
for n being natural odd number st n <= 2 holds
n = 1
proof end;

theorem Th7: :: CHORD:7
for n being natural odd number holds
( not n <= 4 or n = 1 or n = 3 )
proof end;

theorem Th8: :: CHORD:8
for n being natural odd number holds
( not n <= 6 or n = 1 or n = 3 or n = 5 )
proof end;

theorem :: CHORD:9
for n being natural odd number holds
( not n <= 8 or n = 1 or n = 3 or n = 5 or n = 7 )
proof end;

theorem Th10: :: CHORD:10
for n being natural even number st n <= 1 holds
n = 0
proof end;

theorem Th11: :: CHORD:11
for n being natural even number holds
( not n <= 3 or n = 0 or n = 2 )
proof end;

theorem Th12: :: CHORD:12
for n being natural even number holds
( not n <= 5 or n = 0 or n = 2 or n = 4 )
proof end;

theorem Th13: :: CHORD:13
for n being natural even number holds
( not n <= 7 or n = 0 or n = 2 or n = 4 or n = 6 )
proof end;

Lm2: for i, j being natural odd number st i <= j holds
ex k being natural number st i + (2 * k) = j
proof end;

theorem :: CHORD:14
for p being FinSequence
for n being non zero natural number st p is one-to-one & n <= len p holds
(p . n) .. p = n
proof end;

theorem Th15: :: CHORD:15
for p being non empty FinSequence
for T being non empty Subset of (rng p) ex x being set st
( x in T & ( for y being set st y in T holds
x .. p <= y .. p ) )
proof end;

definition
let p be FinSequence;
let n be natural number ;
func p .followSet n -> finite set equals :: CHORD:def 1
rng ((n,(len p)) -cut p);
correctness
coherence
rng ((n,(len p)) -cut p) is finite set
;
;
end;

:: deftheorem defines .followSet CHORD:def 1 :
for p being FinSequence
for n being natural number holds p .followSet n = rng ((n,(len p)) -cut p);

theorem Th16: :: CHORD:16
for p being FinSequence
for x being set
for n being natural number st x in rng p & n in dom p & p is one-to-one holds
( x in p .followSet n iff x .. p >= n )
proof end;

theorem Th17: :: CHORD:17
for p, q being FinSequence
for x being set st p = <*x*> ^ q holds
for n being non zero natural number holds p .followSet (n + 1) = q .followSet n
proof end;

theorem Th18: :: CHORD:18
for X being set
for f being FinSequence of X
for g being Subset of f st len (Seq g) = len f holds
Seq g = f
proof end;

begin

theorem Th19: :: CHORD:19
for G being _Graph
for S being Subset of (the_Vertices_of G)
for H being inducedSubgraph of G,S
for u, v being set st u in S & v in S holds
for e being set st e Joins u,v,G holds
e Joins u,v,H
proof end;

theorem :: CHORD:20
for G being _Graph
for W being Walk of G holds
( W is Trail-like iff len W = (2 * (card (W .edges()))) + 1 )
proof end;

theorem Th21: :: CHORD:21
for G being _Graph
for S being Subset of (the_Vertices_of G)
for H being removeVertices of G,S
for W being Walk of G st ( for n being natural odd number st n <= len W holds
not W . n in S ) holds
W is Walk of H
proof end;

theorem Th22: :: CHORD:22
for G being _Graph
for a, b being set st a <> b holds
for W being Walk of G st W .vertices() = {a,b} holds
ex e being set st e Joins a,b,G
proof end;

theorem Th23: :: CHORD:23
for G being _Graph
for S being non empty Subset of (the_Vertices_of G)
for H being inducedSubgraph of G,S
for W being Walk of G st W .vertices() c= S holds
W is Walk of H
proof end;

theorem Th24: :: CHORD:24
for G1, G2 being _Graph st G1 == G2 holds
for W1 being Walk of G1
for W2 being Walk of G2 st W1 = W2 & W1 is Cycle-like holds
W2 is Cycle-like
proof end;

theorem Th25: :: CHORD:25
for G being _Graph
for P being Path of G
for m, n being natural odd number st m <= len P & n <= len P & P . m = P . n & not m = n & not ( m = 1 & n = len P ) holds
( m = len P & n = 1 )
proof end;

theorem :: CHORD:26
for G being _Graph
for P being Path of G st not P is closed holds
for a, e, b being set st not a in P .vertices() & b = P .first() & e Joins a,b,G holds
(G .walkOf (a,e,b)) .append P is Path-like
proof end;

theorem Th27: :: CHORD:27
for G being _Graph
for P, H being Path of G st P .edges() misses H .edges() & not P is closed & not H is trivial & not H is closed & (P .vertices()) /\ (H .vertices()) = {(P .first()),(P .last())} & H .first() = P .last() & H .last() = P .first() holds
P .append H is Cycle-like
proof end;

theorem Th28: :: CHORD:28
for G being _Graph
for W1, W2 being Walk of G st W1 .last() = W2 .first() holds
(W1 .append W2) .length() = (W1 .length()) + (W2 .length())
proof end;

theorem Th29: :: CHORD:29
for G being _Graph
for A, B being non empty Subset of (the_Vertices_of G) st B c= A holds
for H1 being inducedSubgraph of G,A
for H2 being inducedSubgraph of H1,B holds H2 is inducedSubgraph of G,B
proof end;

theorem Th30: :: CHORD:30
for G being _Graph
for A, B being non empty Subset of (the_Vertices_of G) st B c= A holds
for H1 being inducedSubgraph of G,A
for H2 being inducedSubgraph of G,B holds H2 is inducedSubgraph of H1,B
proof end;

theorem Th31: :: CHORD:31
for G being _Graph
for S, T being non empty Subset of (the_Vertices_of G) st T c= S holds
for G2 being inducedSubgraph of G,S holds G2 .edgesBetween T = G .edgesBetween T
proof end;

scheme :: CHORD:sch 1
FinGraphOrderCompInd{ P1[ set ] } :
for G being finite _Graph holds P1[G]
provided
A1: for k being non zero natural number st ( for Gk being finite _Graph st Gk .order() < k holds
P1[Gk] ) holds
for Gk1 being finite _Graph st Gk1 .order() = k holds
P1[Gk1]
proof end;

theorem Th32: :: CHORD:32
for G being _Graph
for W being Walk of G st not W is closed & W is Path-like holds
W is vertex-distinct
proof end;

theorem Th33: :: CHORD:33
for G being _Graph
for P being Path of G st not P is closed & len P > 3 holds
for e being set st e Joins P .last() ,P .first() ,G holds
P .addEdge e is Cycle-like
proof end;

begin

definition
let G be _Graph;
let W be Walk of G;
attr W is minlength means :Def2: :: CHORD:def 2
for W2 being Walk of G st W2 is_Walk_from W .first() ,W .last() holds
len W2 >= len W;
end;

:: deftheorem Def2 defines minlength CHORD:def 2 :
for G being _Graph
for W being Walk of G holds
( W is minlength iff for W2 being Walk of G st W2 is_Walk_from W .first() ,W .last() holds
len W2 >= len W );

theorem Th34: :: CHORD:34
for G being _Graph
for W being Walk of G
for S being Subwalk of W st S .first() = W .first() & S .edgeSeq() = W .edgeSeq() holds
S = W
proof end;

theorem Th35: :: CHORD:35
for G being _Graph
for W being Walk of G
for S being Subwalk of W st len S = len W holds
S = W
proof end;

theorem :: CHORD:36
for G being _Graph
for W being Walk of G st W is minlength holds
W is Path-like
proof end;

theorem :: CHORD:37
for G being _Graph
for W being Walk of G st W is minlength holds
W is Path-like
proof end;

theorem Th38: :: CHORD:38
for G being _Graph
for W being Walk of G st ( for P being Path of G st P is_Walk_from W .first() ,W .last() holds
len P >= len W ) holds
W is minlength
proof end;

theorem Th39: :: CHORD:39
for G being _Graph
for W being Walk of G ex P being Path of G st
( P is_Walk_from W .first() ,W .last() & P is minlength )
proof end;

theorem Th40: :: CHORD:40
for G being _Graph
for W being Walk of G st W is minlength holds
for m, n being natural odd number st m + 2 < n & n <= len W holds
for e being set holds not e Joins W . m,W . n,G
proof end;

theorem Th41: :: CHORD:41
for G being _Graph
for S being non empty Subset of (the_Vertices_of G)
for H being inducedSubgraph of G,S
for W being Walk of H st W is minlength holds
for m, n being natural odd number st m + 2 < n & n <= len W holds
for e being set holds not e Joins W . m,W . n,G
proof end;

theorem Th42: :: CHORD:42
for G being _Graph
for W being Walk of G st W is minlength holds
for m, n being natural odd number st m <= n & n <= len W holds
W .cut (m,n) is minlength
proof end;

theorem :: CHORD:43
for G being _Graph st G is connected holds
for A, B being non empty Subset of (the_Vertices_of G) st A misses B holds
ex P being Path of G st
( P is minlength & not P is trivial & P .first() in A & P .last() in B & ( for n being natural odd number st 1 < n & n < len P holds
( not P . n in A & not P . n in B ) ) )
proof end;

begin

definition
let G be _Graph;
let a, b be Vertex of G;
pred a,b are_adjacent means :Def3: :: CHORD:def 3
ex e being set st e Joins a,b,G;
symmetry
for a, b being Vertex of G st ex e being set st e Joins a,b,G holds
ex e being set st e Joins b,a,G
by GLIB_000:17;
end;

:: deftheorem Def3 defines are_adjacent CHORD:def 3 :
for G being _Graph
for a, b being Vertex of G holds
( a,b are_adjacent iff ex e being set st e Joins a,b,G );

theorem Th44: :: CHORD:44
for G1, G2 being _Graph st G1 == G2 holds
for u1, v1 being Vertex of G1 st u1,v1 are_adjacent holds
for u2, v2 being Vertex of G2 st u1 = u2 & v1 = v2 holds
u2,v2 are_adjacent
proof end;

theorem Th45: :: CHORD:45
for G being _Graph
for S being non empty Subset of (the_Vertices_of G)
for H being inducedSubgraph of G,S
for u, v being Vertex of G
for t, w being Vertex of H st u = t & v = w holds
( u,v are_adjacent iff t,w are_adjacent )
proof end;

theorem Th46: :: CHORD:46
for G being _Graph
for W being Walk of G st W .first() <> W .last() & not W .first() ,W .last() are_adjacent holds
W .length() >= 2
proof end;

theorem Th47: :: CHORD:47
for G being _Graph
for v1, v2, v3 being Vertex of G st v1 <> v2 & v1 <> v3 & v2 <> v3 & v1,v2 are_adjacent & v2,v3 are_adjacent holds
ex P being Path of G ex e1, e2 being set st
( not P is closed & len P = 5 & P .length() = 2 & e1 Joins v1,v2,G & e2 Joins v2,v3,G & P .edges() = {e1,e2} & P .vertices() = {v1,v2,v3} & P . 1 = v1 & P . 3 = v2 & P . 5 = v3 )
proof end;

theorem Th48: :: CHORD:48
for G being _Graph
for v1, v2, v3, v4 being Vertex of G st v1 <> v2 & v1 <> v3 & v2 <> v3 & v2 <> v4 & v3 <> v4 & v1,v2 are_adjacent & v2,v3 are_adjacent & v3,v4 are_adjacent holds
ex P being Path of G st
( len P = 7 & P .length() = 3 & P .vertices() = {v1,v2,v3,v4} & P . 1 = v1 & P . 3 = v2 & P . 5 = v3 & P . 7 = v4 )
proof end;

definition
let G be _Graph;
let S be set ;
func G .AdjacentSet S -> Subset of (the_Vertices_of G) equals :: CHORD:def 4
{ u where u is Vertex of G : ( not u in S & ex v being Vertex of G st
( v in S & u,v are_adjacent ) )
}
;
coherence
{ u where u is Vertex of G : ( not u in S & ex v being Vertex of G st
( v in S & u,v are_adjacent ) )
}
is Subset of (the_Vertices_of G)
proof end;
end;

:: deftheorem defines .AdjacentSet CHORD:def 4 :
for G being _Graph
for S being set holds G .AdjacentSet S = { u where u is Vertex of G : ( not u in S & ex v being Vertex of G st
( v in S & u,v are_adjacent ) )
}
;

theorem :: CHORD:49
for G being _Graph
for S, x being set st x in G .AdjacentSet S holds
not x in S
proof end;

theorem Th50: :: CHORD:50
for G being _Graph
for S being set
for u being Vertex of G holds
( u in G .AdjacentSet S iff ( not u in S & ex v being Vertex of G st
( v in S & u,v are_adjacent ) ) )
proof end;

theorem Th51: :: CHORD:51
for G1, G2 being _Graph st G1 == G2 holds
for S being set holds G1 .AdjacentSet S = G2 .AdjacentSet S
proof end;

theorem Th52: :: CHORD:52
for G being _Graph
for u, v being Vertex of G holds
( u in G .AdjacentSet {v} iff ( u <> v & v,u are_adjacent ) )
proof end;

theorem :: CHORD:53
for G being _Graph
for x, y being set holds
( x in G .AdjacentSet {y} iff y in G .AdjacentSet {x} )
proof end;

theorem :: CHORD:54
for G being _Graph
for C being Path of G st C is Cycle-like & C .length() > 3 holds
for x being Vertex of G st x in C .vertices() holds
ex m, n being odd Nat st
( m + 2 < n & n <= len C & ( not m = 1 or not n = len C ) & ( not m = 1 or not n = (len C) - 2 ) & ( not m = 3 or not n = len C ) & C . m <> C . n & C . m in G .AdjacentSet {x} & C . n in G .AdjacentSet {x} )
proof end;

theorem Th55: :: CHORD:55
for G being _Graph
for C being Path of G st C is Cycle-like & C .length() > 3 holds
for x being Vertex of G st x in C .vertices() holds
ex m, n being natural odd number st
( m + 2 < n & n <= len C & C . m <> C . n & C . m in G .AdjacentSet {x} & C . n in G .AdjacentSet {x} & ( for e being set st e in C .edges() holds
not e Joins C . m,C . n,G ) )
proof end;

theorem :: CHORD:56
for G being loopless _Graph
for u being Vertex of G holds
( G .AdjacentSet {u} = {} iff u is isolated )
proof end;

theorem Th57: :: CHORD:57
for G being _Graph
for G0 being Subgraph of G
for S being non empty Subset of (the_Vertices_of G)
for x being Vertex of G
for G1 being inducedSubgraph of G,S
for G2 being inducedSubgraph of G,(S \/ {x}) st G1 is connected & x in G .AdjacentSet (the_Vertices_of G1) holds
G2 is connected
proof end;

theorem Th58: :: CHORD:58
for G being _Graph
for S being non empty Subset of (the_Vertices_of G)
for H being inducedSubgraph of G,S
for u being Vertex of G st u in S & G .AdjacentSet {u} c= S holds
for v being Vertex of H st u = v holds
G .AdjacentSet {u} = H .AdjacentSet {v}
proof end;

definition
let G be _Graph;
let S be set ;
mode AdjGraph of G,S -> Subgraph of G means :Def5: :: CHORD:def 5
it is inducedSubgraph of G,(G .AdjacentSet S) if S is Subset of (the_Vertices_of G)
;
existence
( S is Subset of (the_Vertices_of G) implies ex b1 being Subgraph of G st b1 is inducedSubgraph of G,(G .AdjacentSet S) )
proof end;
consistency
for b1 being Subgraph of G holds verum
;
end;

:: deftheorem Def5 defines AdjGraph CHORD:def 5 :
for G being _Graph
for S being set
for b3 being Subgraph of G st S is Subset of (the_Vertices_of G) holds
( b3 is AdjGraph of G,S iff b3 is inducedSubgraph of G,(G .AdjacentSet S) );

theorem Th59: :: CHORD:59
for G1, G2 being _Graph st G1 == G2 holds
for u1 being Vertex of G1
for u2 being Vertex of G2 st u1 = u2 holds
for H1 being AdjGraph of G1,{u1}
for H2 being AdjGraph of G2,{u2} holds H1 == H2
proof end;

theorem Th60: :: CHORD:60
for G being _Graph
for S being non empty Subset of (the_Vertices_of G)
for H being inducedSubgraph of G,S
for u being Vertex of G st u in S & G .AdjacentSet {u} c= S & G .AdjacentSet {u} <> {} holds
for v being Vertex of H st u = v holds
for Ga being AdjGraph of G,{u}
for Ha being AdjGraph of H,{v} holds Ga == Ha
proof end;

definition
let G be _Graph;
attr G is complete means :Def6: :: CHORD:def 6
for u, v being Vertex of G st u <> v holds
u,v are_adjacent ;
end;

:: deftheorem Def6 defines complete CHORD:def 6 :
for G being _Graph holds
( G is complete iff for u, v being Vertex of G st u <> v holds
u,v are_adjacent );

theorem Th61: :: CHORD:61
for G being _Graph st G is trivial holds
G is complete
proof end;

registration
cluster Relation-like NAT -defined Function-like finite [Graph-like] trivial -> complete set ;
coherence
for b1 being _Graph st b1 is trivial holds
b1 is complete
by Th61;
end;

registration
cluster Relation-like NAT -defined Function-like finite [Graph-like] trivial simple complete set ;
existence
ex b1 being _Graph st
( b1 is trivial & b1 is simple & b1 is complete )
proof end;
cluster Relation-like NAT -defined Function-like finite [Graph-like] finite non trivial simple complete set ;
existence
ex b1 being _Graph st
( not b1 is trivial & b1 is finite & b1 is simple & b1 is complete )
proof end;
end;

theorem Th62: :: CHORD:62
for G1, G2 being _Graph st G1 == G2 & G1 is complete holds
G2 is complete
proof end;

theorem Th63: :: CHORD:63
for G being complete _Graph
for S being Subset of (the_Vertices_of G)
for H being inducedSubgraph of G,S holds H is complete
proof end;

begin

definition
let G be _Graph;
let v be Vertex of G;
attr v is simplicial means :Def7: :: CHORD:def 7
( G .AdjacentSet {v} <> {} implies for G2 being AdjGraph of G,{v} holds G2 is complete );
end;

:: deftheorem Def7 defines simplicial CHORD:def 7 :
for G being _Graph
for v being Vertex of G holds
( v is simplicial iff ( G .AdjacentSet {v} <> {} implies for G2 being AdjGraph of G,{v} holds G2 is complete ) );

theorem Th64: :: CHORD:64
for G being complete _Graph
for v being Vertex of G holds v is simplicial
proof end;

theorem Th65: :: CHORD:65
for G being trivial _Graph
for v being Vertex of G holds v is simplicial
proof end;

theorem Th66: :: CHORD:66
for G1, G2 being _Graph st G1 == G2 holds
for u1 being Vertex of G1
for u2 being Vertex of G2 st u1 = u2 & u1 is simplicial holds
u2 is simplicial
proof end;

theorem Th67: :: CHORD:67
for G being _Graph
for S being non empty Subset of (the_Vertices_of G)
for H being inducedSubgraph of G,S
for u being Vertex of G st u in S & G .AdjacentSet {u} c= S holds
for v being Vertex of H st u = v holds
( u is simplicial iff v is simplicial )
proof end;

theorem Th68: :: CHORD:68
for G being _Graph
for v being Vertex of G st v is simplicial holds
for a, b being set st a <> b & a in G .AdjacentSet {v} & b in G .AdjacentSet {v} holds
ex e being set st e Joins a,b,G
proof end;

theorem Th69: :: CHORD:69
for G being _Graph
for v being Vertex of G st not v is simplicial holds
ex a, b being Vertex of G st
( a <> b & v <> a & v <> b & v,a are_adjacent & v,b are_adjacent & not a,b are_adjacent )
proof end;

begin

definition
let G be _Graph;
let a, b be Vertex of G;
assume that
A1: a <> b and
A2: not a,b are_adjacent ;
mode VertexSeparator of a,b -> Subset of (the_Vertices_of G) means :Def8: :: CHORD:def 8
( not a in it & not b in it & ( for G2 being removeVertices of G,it
for W being Walk of G2 holds not W is_Walk_from a,b ) );
existence
ex b1 being Subset of (the_Vertices_of G) st
( not a in b1 & not b in b1 & ( for G2 being removeVertices of G,b1
for W being Walk of G2 holds not W is_Walk_from a,b ) )
proof end;
end;

:: deftheorem Def8 defines VertexSeparator CHORD:def 8 :
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for b4 being Subset of (the_Vertices_of G) holds
( b4 is VertexSeparator of a,b iff ( not a in b4 & not b in b4 & ( for G2 being removeVertices of G,b4
for W being Walk of G2 holds not W is_Walk_from a,b ) ) );

theorem Th70: :: CHORD:70
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b holds S is VertexSeparator of b,a
proof end;

theorem Th71: :: CHORD:71
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being Subset of (the_Vertices_of G) holds
( S is VertexSeparator of a,b iff ( not a in S & not b in S & ( for W being Walk of G st W is_Walk_from a,b holds
ex x being Vertex of G st
( x in S & x in W .vertices() ) ) ) )
proof end;

theorem Th72: :: CHORD:72
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b
for W being Walk of G st W is_Walk_from a,b holds
ex k being odd Nat st
( 1 < k & k < len W & W . k in S )
proof end;

theorem Th73: :: CHORD:73
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b st S = {} holds
for W being Walk of G holds not W is_Walk_from a,b
proof end;

theorem :: CHORD:74
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent & ( for W being Walk of G holds not W is_Walk_from a,b ) holds
{} is VertexSeparator of a,b
proof end;

theorem Th75: :: CHORD:75
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b
for G2 being removeVertices of G,S
for a2 being Vertex of G2 holds (G2 .reachableFrom a2) /\ S = {}
proof end;

theorem Th76: :: CHORD:76
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b
for G2 being removeVertices of G,S
for a2, b2 being Vertex of G2 st a2 = a & b2 = b holds
(G2 .reachableFrom a2) /\ (G2 .reachableFrom b2) = {}
proof end;

theorem Th77: :: CHORD:77
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b
for G2 being removeVertices of G,S holds
( a is Vertex of G2 & b is Vertex of G2 )
proof end;

definition
let G be _Graph;
let a, b be Vertex of G;
let S be VertexSeparator of a,b;
attr S is minimal means :Def9: :: CHORD:def 9
for T being Subset of S st T <> S holds
not T is VertexSeparator of a,b;
end;

:: deftheorem Def9 defines minimal CHORD:def 9 :
for G being _Graph
for a, b being Vertex of G
for S being VertexSeparator of a,b holds
( S is minimal iff for T being Subset of S st T <> S holds
not T is VertexSeparator of a,b );

theorem :: CHORD:78
for G being _Graph
for a, b being Vertex of G
for S being VertexSeparator of a,b st S = {} holds
S is minimal
proof end;

theorem Th79: :: CHORD:79
for G being finite _Graph
for a, b being Vertex of G ex S being VertexSeparator of a,b st S is minimal
proof end;

theorem Th80: :: CHORD:80
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b st S is minimal holds
for T being VertexSeparator of b,a st S = T holds
T is minimal
proof end;

theorem :: CHORD:81
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b st S is minimal holds
for x being Vertex of G st x in S holds
ex W being Walk of G st
( W is_Walk_from a,b & x in W .vertices() )
proof end;

theorem Th82: :: CHORD:82
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b st S is minimal holds
for H being removeVertices of G,S
for aa being Vertex of H st aa = a holds
for x being Vertex of G st x in S holds
ex y being Vertex of G st
( y in H .reachableFrom aa & x,y are_adjacent )
proof end;

theorem Th83: :: CHORD:83
for G being _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b st S is minimal holds
for H being removeVertices of G,S
for aa being Vertex of H st aa = b holds
for x being Vertex of G st x in S holds
ex y being Vertex of G st
( y in H .reachableFrom aa & x,y are_adjacent )
proof end;

begin

definition
let G be _Graph;
let W be Walk of G;
attr W is chordal means :Def10: :: CHORD:def 10
ex m, n being natural odd number st
( m + 2 < n & n <= len W & W . m <> W . n & ex e being set st e Joins W . m,W . n,G & ( for f being set st f in W .edges() holds
not f Joins W . m,W . n,G ) );
end;

:: deftheorem Def10 defines chordal CHORD:def 10 :
for G being _Graph
for W being Walk of G holds
( W is chordal iff ex m, n being natural odd number st
( m + 2 < n & n <= len W & W . m <> W . n & ex e being set st e Joins W . m,W . n,G & ( for f being set st f in W .edges() holds
not f Joins W . m,W . n,G ) ) );

notation
let G be _Graph;
let W be Walk of G;
antonym chordless W for chordal ;
end;

theorem Th84: :: CHORD:84
for G being _Graph
for W being Walk of G st W is chordal holds
ex m, n being natural odd number st
( m + 2 < n & n <= len W & W . m <> W . n & ex e being set st e Joins W . m,W . n,G & ( W is Cycle-like implies ( ( not m = 1 or not n = len W ) & ( not m = 1 or not n = (len W) - 2 ) & ( not m = 3 or not n = len W ) ) ) )
proof end;

theorem Th85: :: CHORD:85
for G being _Graph
for P being Path of G st ex m, n being natural odd number st
( m + 2 < n & n <= len P & ex e being set st e Joins P . m,P . n,G & ( P is Cycle-like implies ( ( not m = 1 or not n = len P ) & ( not m = 1 or not n = (len P) - 2 ) & ( not m = 3 or not n = len P ) ) ) ) holds
P is chordal
proof end;

theorem Th86: :: CHORD:86
for G1, G2 being _Graph st G1 == G2 holds
for W1 being Walk of G1
for W2 being Walk of G2 st W1 = W2 & W1 is chordal holds
W2 is chordal
proof end;

theorem Th87: :: CHORD:87
for G being _Graph
for S being non empty Subset of (the_Vertices_of G)
for H being inducedSubgraph of G,S
for W1 being Walk of G
for W2 being Walk of H st W1 = W2 holds
( W2 is chordal iff W1 is chordal )
proof end;

theorem :: CHORD:88
for G being _Graph
for W being Walk of G st W is Cycle-like & W is chordal & W .length() = 4 holds
ex e being set st
( e Joins W . 1,W . 5,G or e Joins W . 3,W . 7,G )
proof end;

theorem Th89: :: CHORD:89
for G being _Graph
for W being Walk of G st W is minlength holds
not W is chordal
proof end;

theorem :: CHORD:90
for G being _Graph
for W being Walk of G st len W = 5 & not W .first() ,W .last() are_adjacent holds
not W is chordal
proof end;

Lm3: for G being _Graph
for W being Walk of G st W is chordal holds
W .reverse() is chordal
proof end;

theorem :: CHORD:91
for G being _Graph
for W being Walk of G holds
( W is chordal iff W .reverse() is chordal )
proof end;

theorem Th92: :: CHORD:92
for G being _Graph
for P being Path of G st not P is closed & not P is chordal holds
for m, n being natural odd number st m < n & n <= len P holds
( ex e being set st e Joins P . m,P . n,G iff m + 2 = n )
proof end;

theorem :: CHORD:93
for G being _Graph
for P being Path of G st not P is closed & not P is chordal holds
for m, n being natural odd number st m < n & n <= len P holds
( not P .cut (m,n) is chordal & not P .cut (m,n) is closed )
proof end;

theorem :: CHORD:94
for G being _Graph
for S being non empty Subset of (the_Vertices_of G)
for H being inducedSubgraph of G,S
for W being Walk of G
for V being Walk of H st W = V holds
( not W is chordal iff not V is chordal )
proof end;

definition
let G be _Graph;
attr G is chordal means :Def11: :: CHORD:def 11
for P being Walk of G st P .length() > 3 & P is Cycle-like holds
P is chordal ;
end;

:: deftheorem Def11 defines chordal CHORD:def 11 :
for G being _Graph holds
( G is chordal iff for P being Walk of G st P .length() > 3 & P is Cycle-like holds
P is chordal );

theorem Th95: :: CHORD:95
for G1, G2 being _Graph st G1 == G2 & G1 is chordal holds
G2 is chordal
proof end;

theorem Th96: :: CHORD:96
for G being finite _Graph st card (the_Vertices_of G) <= 3 holds
G is chordal
proof end;

registration
cluster Relation-like NAT -defined Function-like finite [Graph-like] finite trivial chordal set ;
existence
ex b1 being _Graph st
( b1 is trivial & b1 is finite & b1 is chordal )
proof end;
cluster Relation-like NAT -defined Function-like finite [Graph-like] finite non trivial simple chordal set ;
existence
ex b1 being _Graph st
( not b1 is trivial & b1 is finite & b1 is simple & b1 is chordal )
proof end;
cluster Relation-like NAT -defined Function-like finite [Graph-like] complete -> chordal set ;
correctness
coherence
for b1 being _Graph st b1 is complete holds
b1 is chordal
;
proof end;
end;

registration
let G be chordal _Graph;
let V be set ;
cluster -> chordal inducedSubgraph of G,V,G .edgesBetween V;
coherence
for b1 being inducedSubgraph of G,V holds b1 is chordal
proof end;
end;

theorem :: CHORD:97
for G being chordal _Graph
for P being Path of G st not P is closed & not P is chordal holds
for x, e being set st not x in P .vertices() & e Joins P .last() ,x,G & ( for f being set holds not f Joins P . ((len P) - 2),x,G ) holds
( P .addEdge e is Path-like & not P .addEdge e is closed & not P .addEdge e is chordal )
proof end;

theorem Th98: :: CHORD:98
for G being chordal _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b st S is minimal & not S is empty holds
for H being inducedSubgraph of G,S holds H is complete
proof end;

theorem :: CHORD:99
for G being finite _Graph st ( for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b st S is minimal & not S is empty holds
for G2 being inducedSubgraph of G,S holds G2 is complete ) holds
G is chordal
proof end;

theorem Th100: :: CHORD:100
for G being finite chordal _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b st S is minimal holds
for H being removeVertices of G,S
for a1 being Vertex of H st a = a1 holds
ex c being Vertex of G st
( c in H .reachableFrom a1 & ( for x being Vertex of G st x in S holds
c,x are_adjacent ) )
proof end;

theorem :: CHORD:101
for G being finite chordal _Graph
for a, b being Vertex of G st a <> b & not a,b are_adjacent holds
for S being VertexSeparator of a,b st S is minimal holds
for H being removeVertices of G,S
for a1 being Vertex of H st a = a1 holds
for x, y being Vertex of G st x in S & y in S holds
ex c being Vertex of G st
( c in H .reachableFrom a1 & c,x are_adjacent & c,y are_adjacent )
proof end;

theorem Th102: :: CHORD:102
for G being finite non trivial chordal _Graph st not G is complete holds
ex a, b being Vertex of G st
( a <> b & not a,b are_adjacent & a is simplicial & b is simplicial )
proof end;

theorem Th103: :: CHORD:103
for G being finite chordal _Graph ex v being Vertex of G st v is simplicial
proof end;

begin

definition
let G be finite _Graph;
mode VertexScheme of G -> FinSequence of the_Vertices_of G means :Def12: :: CHORD:def 12
( it is one-to-one & rng it = the_Vertices_of G );
existence
ex b1 being FinSequence of the_Vertices_of G st
( b1 is one-to-one & rng b1 = the_Vertices_of G )
proof end;
end;

:: deftheorem Def12 defines VertexScheme CHORD:def 12 :
for G being finite _Graph
for b2 being FinSequence of the_Vertices_of G holds
( b2 is VertexScheme of G iff ( b2 is one-to-one & rng b2 = the_Vertices_of G ) );

registration
let G be finite _Graph;
cluster -> non empty VertexScheme of G;
correctness
coherence
for b1 being VertexScheme of G holds not b1 is empty
;
by Def12, RELAT_1:60;
end;

theorem :: CHORD:104
for G being finite _Graph
for S being VertexScheme of G holds len S = card (the_Vertices_of G)
proof end;

theorem :: CHORD:105
for G being finite _Graph
for S being VertexScheme of G holds 1 <= len S by NAT_1:14;

theorem Th106: :: CHORD:106
for G, H being finite _Graph
for g being VertexScheme of G st G == H holds
g is VertexScheme of H
proof end;

definition
let G be finite _Graph;
let S be VertexScheme of G;
let x be Vertex of G;
:: original: ..
redefine func x .. S -> non zero Element of NAT ;
correctness
coherence
x .. S is non zero Element of NAT
;
proof end;
end;

definition
let G be finite _Graph;
let S be VertexScheme of G;
let n be Nat;
:: original: .followSet
redefine func S .followSet n -> Subset of (the_Vertices_of G);
coherence
S .followSet n is Subset of (the_Vertices_of G)
proof end;
end;

theorem Th107: :: CHORD:107
for G being finite _Graph
for S being VertexScheme of G
for n being non zero natural number st n <= len S holds
not S .followSet n is empty
proof end;

definition
let G be finite _Graph;
let S be VertexScheme of G;
attr S is perfect means :Def13: :: CHORD:def 13
for n being non zero natural number st n <= len S holds
for Gf being inducedSubgraph of G,(S .followSet n)
for v being Vertex of Gf st v = S . n holds
v is simplicial ;
end;

:: deftheorem Def13 defines perfect CHORD:def 13 :
for G being finite _Graph
for S being VertexScheme of G holds
( S is perfect iff for n being non zero natural number st n <= len S holds
for Gf being inducedSubgraph of G,(S .followSet n)
for v being Vertex of Gf st v = S . n holds
v is simplicial );

theorem Th108: :: CHORD:108
for G being finite trivial _Graph
for v being Vertex of G ex S being VertexScheme of G st
( S = <*v*> & S is perfect )
proof end;

theorem :: CHORD:109
for G being finite _Graph
for V being VertexScheme of G holds
( V is perfect iff for a, b, c being Vertex of G st b <> c & a,b are_adjacent & a,c are_adjacent holds
for va, vb, vc being natural number st va in dom V & vb in dom V & vc in dom V & V . va = a & V . vb = b & V . vc = c & va < vb & va < vc holds
b,c are_adjacent )
proof end;

registration
let G be finite chordal _Graph;
cluster non empty Relation-like NAT -defined the_Vertices_of G -valued Function-like finite FinSequence-like FinSubsequence-like perfect VertexScheme of G;
existence
ex b1 being VertexScheme of G st b1 is perfect
proof end;
end;

theorem :: CHORD:110
for G, H being finite chordal _Graph
for g being perfect VertexScheme of G st G == H holds
g is perfect VertexScheme of H
proof end;

theorem :: CHORD:111
for G being finite _Graph st ex S being VertexScheme of G st S is perfect holds
G is chordal
proof end;