let G be Cycle-like _Graph; :: thesis: for C being Circuit-like Walk of G holds
( C .vertices() = the_Vertices_of G & C .edges() = the_Edges_of G )

let C be Circuit-like Walk of G; :: thesis: ( C .vertices() = the_Vertices_of G & C .edges() = the_Edges_of G )
now :: thesis: for x being object holds
( not x in the_Vertices_of G or x in C .vertices() )
given x being object such that A1: ( x in the_Vertices_of G & not x in C .vertices() ) ; :: thesis: contradiction
reconsider x = x as Vertex of G by A1;
consider W being Walk of G such that
A2: W is_Walk_from C .first() ,x by GLIB_002:def 1;
defpred S1[ Nat] means ( $1 is odd & $1 <= len W & not W . $1 in C .vertices() );
A3: ex k being Nat st S1[k]
proof
take k = len W; :: thesis: S1[k]
thus k is odd ; :: thesis: ( k <= len W & not W . k in C .vertices() )
W .last() = x by A2, GLIB_001:def 23;
hence ( k <= len W & not W . k in C .vertices() ) by A1; :: thesis: verum
end;
consider k being Nat such that
A4: ( S1[k] & ( for n being Nat st S1[n] holds
k <= n ) ) from NAT_1:sch 5(A3);
2 < k
proof end;
then reconsider k2 = k - 2 as odd Element of NAT by A4, INT_1:5, POLYFORM:5;
A5: ( k2 <= k - 0 & k2 < k - 0 ) by XREAL_1:10;
then k2 <= len W by A4, XXREAL_0:2;
then A7: W . k2 in C .vertices() by A4, A5;
then consider m being odd Element of NAT such that
A8: ( m <= len C & C . m = W . k2 ) by GLIB_001:87;
reconsider w = W . k2 as Vertex of G by A7;
k2 < len W by A4, A5, XXREAL_0:2;
then A9: W . (k2 + 1) Joins W . k2,W . (k2 + 2),G by GLIB_001:def 3;
3 c= w .degree()
proof
A10: len C >= 3 by GLIB_001:125;
then reconsider n = (len C) - 2 as odd Element of NAT by INT_1:5, POLYFORM:5, XXREAL_0:2;
n < (len C) - 0 by XREAL_1:10;
then A11: C . (n + 1) Joins C . n,C . (n + 2),G by GLIB_001:def 3;
per cases ( m = 1 or m = len C or ( m <> 1 & m <> len C ) ) ;
suppose A12: m = 1 ; :: thesis: 3 c= w .degree()
then m < len C by A10, XXREAL_0:2;
then A13: C . (m + 1) Joins C . m,C . (m + 2),G by GLIB_001:def 3;
3 - 2 <= n by A10, XREAL_1:9;
per cases then ( n > m or n = m ) by A12, XXREAL_0:1;
suppose n > m ; :: thesis: 3 c= w .degree()
then A14: n + 1 > m + 1 by XREAL_1:6;
A15: 1 + 0 <= 1 + m by XREAL_1:6;
n + 1 <= ((len C) - 2) + 2 by XREAL_1:6;
then A17: C . (m + 1) <> C . (n + 1) by A14, A15, GLIB_001:138;
set M = {(C . (m + 1)),(W . (k2 + 1)),(C . (n + 1))};
( W . (k2 + 1) <> C . (m + 1) & W . (k2 + 1) <> C . (n + 1) )
proof
assume ( W . (k2 + 1) = C . (m + 1) or W . (k2 + 1) = C . (n + 1) ) ; :: thesis: contradiction
per cases then ( W . (k2 + 1) = C . (m + 1) or W . (k2 + 1) = C . (n + 1) ) ;
suppose W . (k2 + 1) = C . (m + 1) ; :: thesis: contradiction
then A18: ( W . k = C . m or W . k = C . (m + 2) ) by A9, A13, GLIB_000:15;
( m <= len C & m + 2 <= len C ) by A10, A12, XXREAL_0:2;
hence contradiction by A4, A18, GLIB_001:87; :: thesis: verum
end;
suppose W . (k2 + 1) = C . (n + 1) ; :: thesis: contradiction
then A19: ( W . k = C . n or W . k = C . (n + 2) ) by A9, A11, GLIB_000:15;
n + 0 <= n + 2 by XREAL_1:6;
hence contradiction by A4, A19, GLIB_001:87; :: thesis: verum
end;
end;
end;
then A20: card {(C . (m + 1)),(W . (k2 + 1)),(C . (n + 1))} = 3 by A17, CARD_2:58;
now :: thesis: for x being object st x in {(C . (m + 1)),(W . (k2 + 1)),(C . (n + 1))} holds
x in w .edgesInOut()
let x be object ; :: thesis: ( x in {(C . (m + 1)),(W . (k2 + 1)),(C . (n + 1))} implies b1 in w .edgesInOut() )
assume x in {(C . (m + 1)),(W . (k2 + 1)),(C . (n + 1))} ; :: thesis: b1 in w .edgesInOut()
end;
then A21: 3 c= card (w .edgesInOut()) by A20, CARD_1:11, TARSKI:def 3;
card (w .edgesInOut()) c= w .degree() by CARD_2:34;
hence 3 c= w .degree() by A21, XBOOLE_1:1; :: thesis: verum
end;
suppose n = m ; :: thesis: 3 c= w .degree()
end;
end;
end;
suppose A28: m = len C ; :: thesis: 3 c= w .degree()
reconsider l = 1 as odd Element of NAT by POLYFORM:4;
l < len C by A10, XXREAL_0:2;
then A29: C . (l + 1) Joins C . l,C . (l + 2),G by GLIB_001:def 3;
3 - 2 <= n by A10, XREAL_1:9;
per cases then ( n > 1 or n = 1 ) by XXREAL_0:1;
suppose n > 1 ; :: thesis: 3 c= w .degree()
then A30: ( n + 1 > l + 1 & 1 + 0 <= 1 + k ) by XREAL_1:6;
n + 1 <= ((len C) - 2) + 2 by XREAL_1:6;
then A31: C . (l + 1) <> C . (n + 1) by A30, GLIB_001:138;
set M = {(C . (l + 1)),(W . (k2 + 1)),(C . (n + 1))};
( W . (k2 + 1) <> C . (l + 1) & W . (k2 + 1) <> C . (n + 1) )
proof
assume ( W . (k2 + 1) = C . (l + 1) or W . (k2 + 1) = C . (n + 1) ) ; :: thesis: contradiction
per cases then ( W . (k2 + 1) = C . (l + 1) or W . (k2 + 1) = C . (n + 1) ) ;
suppose W . (k2 + 1) = C . (l + 1) ; :: thesis: contradiction
then A32: ( W . k = C . l or W . k = C . (l + 2) ) by A9, A29, GLIB_000:15;
( l <= len C & l + 2 <= len C ) by A10, XXREAL_0:2;
hence contradiction by A4, A32, GLIB_001:87; :: thesis: verum
end;
suppose W . (k2 + 1) = C . (n + 1) ; :: thesis: contradiction
then A33: ( W . k = C . n or W . k = C . (n + 2) ) by A9, A11, GLIB_000:15;
n + 0 <= n + 2 by XREAL_1:6;
hence contradiction by A4, A33, GLIB_001:87; :: thesis: verum
end;
end;
end;
then A34: card {(C . (l + 1)),(W . (k2 + 1)),(C . (n + 1))} = 3 by A31, CARD_2:58;
now :: thesis: for x being object st x in {(C . (l + 1)),(W . (k2 + 1)),(C . (n + 1))} holds
x in w .edgesInOut()
let x be object ; :: thesis: ( x in {(C . (l + 1)),(W . (k2 + 1)),(C . (n + 1))} implies b1 in w .edgesInOut() )
assume x in {(C . (l + 1)),(W . (k2 + 1)),(C . (n + 1))} ; :: thesis: b1 in w .edgesInOut()
end;
then A35: 3 c= card (w .edgesInOut()) by A34, CARD_1:11, TARSKI:def 3;
card (w .edgesInOut()) c= w .degree() by CARD_2:34;
hence 3 c= w .degree() by A35, XBOOLE_1:1; :: thesis: verum
end;
suppose n = 1 ; :: thesis: 3 c= w .degree()
end;
end;
end;
suppose A44: ( m <> 1 & m <> len C ) ; :: thesis: 3 c= w .degree()
then A45: m < len C by A8, XXREAL_0:1;
then A46: C . (m + 1) Joins C . m,C . (m + 2),G by GLIB_001:def 3;
0 < m ;
then 0 + 1 <= m by INT_1:7;
then m > 1 by A44, XXREAL_0:1;
then m >= 1 + 1 by INT_1:7;
then reconsider l = m - 2 as odd Element of NAT by INT_1:5, POLYFORM:5;
A48: l < m - 0 by XREAL_1:10;
then A49: l < len C by A45, XXREAL_0:2;
then A50: C . (l + 1) Joins C . l,C . (l + 2),G by GLIB_001:def 3;
A51: m + 1 > l + 1 by A48, XREAL_1:6;
A52: 1 + 0 <= l + 1 by XREAL_1:6;
m + 1 <= len C by A45, INT_1:7;
then A53: C . (m + 1) <> C . (l + 1) by A51, A52, GLIB_001:138;
set M = {(C . (m + 1)),(W . (k2 + 1)),(C . (l + 1))};
( W . (k2 + 1) <> C . (m + 1) & W . (k2 + 1) <> C . (l + 1) )
proof
assume ( W . (k2 + 1) = C . (m + 1) or W . (k2 + 1) = C . (l + 1) ) ; :: thesis: contradiction
per cases then ( W . (k2 + 1) = C . (m + 1) or W . (k2 + 1) = C . (l + 1) ) ;
suppose W . (k2 + 1) = C . (m + 1) ; :: thesis: contradiction
then A54: ( W . k = C . m or W . k = C . (m + 2) ) by A9, A46, GLIB_000:15;
( m <= len C & m + 2 <= len C ) by A45, CHORD:4;
hence contradiction by A4, A54, GLIB_001:87; :: thesis: verum
end;
suppose W . (k2 + 1) = C . (l + 1) ; :: thesis: contradiction
then ( W . k = C . l or W . k = C . (l + 2) ) by A9, A50, GLIB_000:15;
hence contradiction by A4, A45, A49, GLIB_001:87; :: thesis: verum
end;
end;
end;
then A56: card {(C . (m + 1)),(W . (k2 + 1)),(C . (l + 1))} = 3 by A53, CARD_2:58;
now :: thesis: for x being object st x in {(C . (m + 1)),(W . (k2 + 1)),(C . (l + 1))} holds
x in w .edgesInOut()
let x be object ; :: thesis: ( x in {(C . (m + 1)),(W . (k2 + 1)),(C . (l + 1))} implies b1 in w .edgesInOut() )
assume x in {(C . (m + 1)),(W . (k2 + 1)),(C . (l + 1))} ; :: thesis: b1 in w .edgesInOut()
end;
then A57: 3 c= card (w .edgesInOut()) by A56, CARD_1:11, TARSKI:def 3;
card (w .edgesInOut()) c= w .degree() by CARD_2:34;
hence 3 c= w .degree() by A57, XBOOLE_1:1; :: thesis: verum
end;
end;
end;
then Segm 3 c= Segm 2 by GLIB_016:def 4;
hence contradiction by NAT_1:39; :: thesis: verum
end;
then the_Vertices_of G c= C .vertices() by TARSKI:def 3;
hence A58: C .vertices() = the_Vertices_of G by XBOOLE_0:def 10; :: thesis: C .edges() = the_Edges_of G
now :: thesis: for x being object holds
( not x in the_Edges_of G or x in C .edges() )
given x being object such that A59: ( x in the_Edges_of G & not x in C .edges() ) ; :: thesis: contradiction
set w = (the_Source_of G) . x;
reconsider w = (the_Source_of G) . x as Vertex of G by A59, FUNCT_2:5;
consider m being odd Element of NAT such that
A60: ( m <= len C & C . m = w ) by A58, GLIB_001:87;
3 c= w .degree()
proof
A61: len C >= 3 by GLIB_001:125;
then reconsider n = (len C) - 2 as odd Element of NAT by INT_1:5, POLYFORM:5, XXREAL_0:2;
A62: n < (len C) - 0 by XREAL_1:10;
then A63: C . (n + 1) Joins C . n,C . (n + 2),G by GLIB_001:def 3;
per cases ( m = 1 or m = len C or ( m <> 1 & m <> len C ) ) ;
suppose A64: m = 1 ; :: thesis: 3 c= w .degree()
m < len C by A61, A64, XXREAL_0:2;
then A65: C . (m + 1) Joins C . m,C . (m + 2),G by GLIB_001:def 3;
3 - 2 <= n by A61, XREAL_1:9;
per cases then ( n > m or n = m ) by A64, XXREAL_0:1;
suppose A66: n > m ; :: thesis: 3 c= w .degree()
then A67: n + 1 > m + 1 by XREAL_1:6;
A68: 1 + 0 <= 1 + m by XREAL_1:6;
n + 1 <= ((len C) - 2) + 2 by XREAL_1:6;
then A70: C . (m + 1) <> C . (n + 1) by A67, A68, GLIB_001:138;
set M = {(C . (m + 1)),x,(C . (n + 1))};
( x <> C . (m + 1) & x <> C . (n + 1) )
proof
m < len C by A62, A66, XXREAL_0:2;
hence ( x <> C . (m + 1) & x <> C . (n + 1) ) by A59, A62, GLIB_001:100; :: thesis: verum
end;
then A71: card {(C . (m + 1)),x,(C . (n + 1))} = 3 by A70, CARD_2:58;
now :: thesis: for y being object st y in {(C . (m + 1)),x,(C . (n + 1))} holds
y in w .edgesInOut()
let y be object ; :: thesis: ( y in {(C . (m + 1)),x,(C . (n + 1))} implies b1 in w .edgesInOut() )
assume y in {(C . (m + 1)),x,(C . (n + 1))} ; :: thesis: b1 in w .edgesInOut()
end;
then A72: 3 c= card (w .edgesInOut()) by A71, CARD_1:11, TARSKI:def 3;
card (w .edgesInOut()) c= w .degree() by CARD_2:34;
hence 3 c= w .degree() by A72, XBOOLE_1:1; :: thesis: verum
end;
end;
end;
suppose A79: m = len C ; :: thesis: 3 c= w .degree()
reconsider l = 1 as odd Element of NAT by POLYFORM:4;
A80: l < len C by A61, XXREAL_0:2;
then A81: C . (l + 1) Joins C . l,C . (l + 2),G by GLIB_001:def 3;
3 - 2 <= n by A61, XREAL_1:9;
per cases then ( n > 1 or n = 1 ) by XXREAL_0:1;
suppose n > 1 ; :: thesis: 3 c= w .degree()
then A82: ( n + 1 > l + 1 & 1 + 0 <= 1 + l ) by XREAL_1:6;
n + 1 <= ((len C) - 2) + 2 by XREAL_1:6;
then A83: C . (l + 1) <> C . (n + 1) by A82, GLIB_001:138;
set M = {(C . (l + 1)),x,(C . (n + 1))};
( x <> C . (l + 1) & x <> C . (n + 1) ) by A59, A62, A80, GLIB_001:100;
then A84: card {(C . (l + 1)),x,(C . (n + 1))} = 3 by A83, CARD_2:58;
now :: thesis: for y being object st y in {(C . (l + 1)),x,(C . (n + 1))} holds
y in w .edgesInOut()
let y be object ; :: thesis: ( y in {(C . (l + 1)),x,(C . (n + 1))} implies b1 in w .edgesInOut() )
assume y in {(C . (l + 1)),x,(C . (n + 1))} ; :: thesis: b1 in w .edgesInOut()
end;
then A85: 3 c= card (w .edgesInOut()) by A84, CARD_1:11, TARSKI:def 3;
card (w .edgesInOut()) c= w .degree() by CARD_2:34;
hence 3 c= w .degree() by A85, XBOOLE_1:1; :: thesis: verum
end;
end;
end;
suppose A93: ( m <> 1 & m <> len C ) ; :: thesis: 3 c= w .degree()
then A94: m < len C by A60, XXREAL_0:1;
then A95: C . (m + 1) Joins C . m,C . (m + 2),G by GLIB_001:def 3;
0 < m ;
then 0 + 1 <= m by INT_1:7;
then m > 1 by A93, XXREAL_0:1;
then m >= 1 + 1 by INT_1:7;
then reconsider l = m - 2 as odd Element of NAT by INT_1:5, POLYFORM:5;
A97: l < m - 0 by XREAL_1:10;
then A98: l < len C by A94, XXREAL_0:2;
then A99: C . (l + 1) Joins C . l,C . (l + 2),G by GLIB_001:def 3;
A100: m + 1 > l + 1 by A97, XREAL_1:6;
A101: 1 + 0 <= l + 1 by XREAL_1:6;
m + 1 <= len C by A94, INT_1:7;
then A102: C . (m + 1) <> C . (l + 1) by A100, A101, GLIB_001:138;
set M = {(C . (m + 1)),x,(C . (l + 1))};
( x <> C . (m + 1) & x <> C . (l + 1) ) by A59, A94, A98, GLIB_001:100;
then A103: card {(C . (m + 1)),x,(C . (l + 1))} = 3 by A102, CARD_2:58;
now :: thesis: for y being object st y in {(C . (m + 1)),x,(C . (l + 1))} holds
y in w .edgesInOut()
let y be object ; :: thesis: ( y in {(C . (m + 1)),x,(C . (l + 1))} implies b1 in w .edgesInOut() )
assume y in {(C . (m + 1)),x,(C . (l + 1))} ; :: thesis: b1 in w .edgesInOut()
end;
then A104: 3 c= card (w .edgesInOut()) by A103, CARD_1:11, TARSKI:def 3;
card (w .edgesInOut()) c= w .degree() by CARD_2:34;
hence 3 c= w .degree() by A104, XBOOLE_1:1; :: thesis: verum
end;
end;
end;
then Segm 3 c= Segm 2 by GLIB_016:def 4;
hence contradiction by NAT_1:39; :: thesis: verum
end;
then the_Edges_of G c= C .edges() by TARSKI:def 3;
hence C .edges() = the_Edges_of G by XBOOLE_0:def 10; :: thesis: verum