Article HELLY, MML version 4.99.1005

:: HELLY:th 1
theorem
for b1 being non empty Relation-like Function-like FinSequence-like set holds
   <*b1 . 1*> ^' b1 = b1;

:: HELLY:funcnot 1 => HELLY:func 1
definition
  let a1, a2 be Relation-like Function-like FinSequence-like set;
  func maxPrefix(A1,A2) -> Relation-like Function-like FinSequence-like set means
    it c= a1 &
     it c= a2 &
     (for b1 being Relation-like Function-like FinSequence-like set
           st b1 c= a1 & b1 c= a2
        holds b1 c= it);
  commutativity;
::  for a1, a2 being Relation-like Function-like FinSequence-like set holds
::  maxPrefix(a1,a2) = maxPrefix(a2,a1);
end;

:: HELLY:def 1
theorem
for b1, b2, b3 being Relation-like Function-like FinSequence-like set holds
   b3 = maxPrefix(b1,b2)
iff
   b3 c= b1 &
    b3 c= b2 &
    (for b4 being Relation-like Function-like FinSequence-like set
          st b4 c= b1 & b4 c= b2
       holds b4 c= b3);

:: HELLY:th 2
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set holds
   b1 c= b2
iff
   maxPrefix(b1,b2) = b1;

:: HELLY:th 3
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set holds
len maxPrefix(b1,b2) <= len b1;

:: HELLY:th 4
theorem
for b1 being non empty Relation-like Function-like FinSequence-like set holds
   <*b1 . 1*> c= b1;

:: HELLY:th 5
theorem
for b1, b2 being non empty Relation-like Function-like FinSequence-like set
      st b1 . 1 = b2 . 1
   holds 1 <= len maxPrefix(b1,b2);

:: HELLY:th 6
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set
for b3 being natural set
      st b3 <= len maxPrefix(b1,b2)
   holds (maxPrefix(b1,b2)) . b3 = b1 . b3;

:: HELLY:th 7
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set
for b3 being natural set
      st b3 <= len maxPrefix(b1,b2)
   holds b1 . b3 = b2 . b3;

:: HELLY:th 8
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set holds
   not b1 c= b2
iff
   len maxPrefix(b1,b2) < len b1;

:: HELLY:th 9
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set
      st not b1 c= b2 & not b2 c= b1
   holds b1 . ((len maxPrefix(b1,b2)) + 1) <> b2 . ((len maxPrefix(b1,b2)) + 1);

:: HELLY:th 10
theorem
for b1 being [Graph-like] GraphStruct
for b2 being Walk of b1
for b3, b4 being natural set holds
len (b2 .cut(b3,b4)) <= len b2;

:: HELLY:th 11
theorem
for b1 being [Graph-like] GraphStruct
for b2 being Walk of b1
for b3, b4 being natural set
      st b2 .cut(b3,b4) is not trivial(b1)
   holds b2 is not trivial(b1);

:: HELLY:th 12
theorem
for b1 being [Graph-like] GraphStruct
for b2 being Walk of b1
for b3, b4, b5 being natural odd set
      st b3 <= b4 & b4 <= len b2 & b5 <= len (b2 .cut(b3,b4))
   holds ex b6 being natural odd set st
      (b2 .cut(b3,b4)) . b5 = b2 . b6 & b6 = (b3 + b5) - 1 & b6 <= len b2;

:: HELLY:condreg 1
registration
  let a1 be [Graph-like] GraphStruct;
  cluster -> non empty (Walk of a1);
end;

:: HELLY:th 13
theorem
for b1 being [Graph-like] GraphStruct
for b2, b3 being Walk of b1
      st b2 c= b3
   holds b2 .vertices() c= b3 .vertices();

:: HELLY:th 14
theorem
for b1 being [Graph-like] GraphStruct
for b2, b3 being Walk of b1
      st b2 c= b3
   holds b2 .edges() c= b3 .edges();

:: HELLY:th 15
theorem
for b1 being [Graph-like] GraphStruct
for b2, b3 being Walk of b1 holds
b2 c= b2 .append b3;

:: HELLY:th 16
theorem
for b1 being [Graph-like] GraphStruct
for b2, b3 being Trail-like Walk of b1
      st b2 .last() = b3 .first() & b2 .edges() misses b3 .edges()
   holds b2 .append b3 is Trail-like(b1);

:: HELLY:th 17
theorem
for b1 being [Graph-like] GraphStruct
for b2, b3 being Path-like Walk of b1
      st b2 .last() = b3 .first() &
         b2 is open(b1) &
         b3 is open(b1) &
         b2 .edges() misses b3 .edges() &
         (b2 .first() in b3 .vertices() implies b2 .first() = b3 .last()) &
         b2 .vertices() /\ (b3 .vertices()) c= {b2 .first(),b2 .last()}
   holds b2 .append b3 is Path-like(b1);

:: HELLY:th 18
theorem
for b1 being [Graph-like] GraphStruct
for b2, b3 being Path-like Walk of b1
      st b2 .last() = b3 .first() &
         b2 is open(b1) &
         b3 is open(b1) &
         b2 .vertices() /\ (b3 .vertices()) = {b2 .last()}
   holds b2 .append b3 is open(b1) & b2 .append b3 is Path-like(b1);

:: HELLY:th 19
theorem
for b1 being [Graph-like] GraphStruct
for b2, b3 being Path-like Walk of b1
      st b2 .last() = b3 .first() &
         b3 .last() = b2 .first() &
         b2 is open(b1) &
         b3 is open(b1) &
         b2 .edges() misses b3 .edges() &
         b2 .vertices() /\ (b3 .vertices()) = {b2 .last(),b2 .first()}
   holds b2 .append b3 is Cycle-like(b1);

:: HELLY:th 20
theorem
for b1 being [Graph-like] simple GraphStruct
for b2, b3 being Walk of b1
for b4 being natural odd set
   st b4 <= len b2 &
      b4 <= len b3 &
      (for b5 being natural odd set
            st b5 <= b4
         holds b2 . b5 = b3 . b5)
for b5 being natural set
      st 1 <= b5 & b5 <= b4
   holds b2 . b5 = b3 . b5;

:: HELLY:th 21
theorem
for b1 being [Graph-like] GraphStruct
for b2, b3 being Walk of b1
      st b2 .first() = b3 .first()
   holds len maxPrefix(b2,b3) is odd;

:: HELLY:th 22
theorem
for b1 being [Graph-like] GraphStruct
for b2, b3 being Walk of b1
      st b2 .first() = b3 .first() & not b2 c= b3
   holds (len maxPrefix(b2,b3)) + 2 <= len b2;

:: HELLY:th 23
theorem
for b1 being [Graph-like] non-multi GraphStruct
for b2, b3 being Walk of b1
      st b2 .first() = b3 .first() & not b2 c= b3 & not b3 c= b2
   holds b2 . ((len maxPrefix(b2,b3)) + 2) <> b3 . ((len maxPrefix(b2,b3)) + 2);

:: HELLY:modenot 1
definition
  mode _Tree is [Graph-like] Tree-like GraphStruct;
end;

:: HELLY:modenot 2
definition
  let a1 be [Graph-like] GraphStruct;
  mode _Subtree of a1 is Tree-like Subgraph of a1;
end;

:: HELLY:condreg 2
registration
  let a1 be [Graph-like] Tree-like GraphStruct;
  cluster Trail-like -> Path-like (Walk of a1);
end;

:: HELLY:th 24
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2 being Path-like Walk of b1
      st b2 is not trivial(b1)
   holds b2 is open(b1);

:: HELLY:condreg 3
registration
  let a1 be [Graph-like] Tree-like GraphStruct;
  cluster non trivial Path-like -> open (Walk of a1);
end;

:: HELLY:th 25
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2 being Path-like Walk of b1
for b3, b4 being natural odd set
      st b3 < b4 & b4 <= len b2
   holds b2 . b3 <> b2 . b4;

:: HELLY:th 26
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1
for b4, b5 being Path-like Walk of b1
      st b4 is_Walk_from b2,b3 & b5 is_Walk_from b2,b3
   holds b4 = b5;

:: HELLY:funcnot 2 => HELLY:func 2
definition
  let a1 be [Graph-like] Tree-like GraphStruct;
  let a2, a3 be Element of the_Vertices_of a1;
  func A1 .pathBetween(A2,A3) -> Path-like Walk of a1 means
    it is_Walk_from a2,a3;
end;

:: HELLY:def 2
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1
for b4 being Path-like Walk of b1 holds
      b4 = b1 .pathBetween(b2,b3)
   iff
      b4 is_Walk_from b2,b3;

:: HELLY:th 27
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1 holds
(b1 .pathBetween(b2,b3)) .first() = b2 & (b1 .pathBetween(b2,b3)) .last() = b3;

:: HELLY:th 28
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1 holds
b2 in (b1 .pathBetween(b2,b3)) .vertices() & b3 in (b1 .pathBetween(b2,b3)) .vertices();

:: HELLY:funcreg 1
registration
  let a1 be [Graph-like] Tree-like GraphStruct;
  let a2 be Element of the_Vertices_of a1;
  cluster a1 .pathBetween(a2,a2) -> closed Path-like;
end;

:: HELLY:funcreg 2
registration
  let a1 be [Graph-like] Tree-like GraphStruct;
  let a2 be Element of the_Vertices_of a1;
  cluster a1 .pathBetween(a2,a2) -> trivial Path-like;
end;

:: HELLY:th 29
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2 being Element of the_Vertices_of b1 holds
   (b1 .pathBetween(b2,b2)) .vertices() = {b2};

:: HELLY:th 30
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1 holds
(b1 .pathBetween(b2,b3)) .reverse() = b1 .pathBetween(b3,b2);

:: HELLY:th 31
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1 holds
(b1 .pathBetween(b2,b3)) .vertices() = (b1 .pathBetween(b3,b2)) .vertices();

:: HELLY:th 32
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1
for b4 being Tree-like Subgraph of b1
for b5, b6 being Element of the_Vertices_of b4
      st b2 = b5 & b3 = b6
   holds b1 .pathBetween(b2,b3) = b4 .pathBetween(b5,b6);

:: HELLY:th 33
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1
for b4 being Tree-like Subgraph of b1
      st b2 in the_Vertices_of b4 & b3 in the_Vertices_of b4
   holds (b1 .pathBetween(b2,b3)) .vertices() c= the_Vertices_of b4;

:: HELLY:th 34
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2 being Path-like Walk of b1
for b3, b4 being Element of the_Vertices_of b1
for b5, b6 being natural odd set
      st b5 <= b6 & b6 <= len b2 & b2 . b5 = b3 & b2 . b6 = b4
   holds b1 .pathBetween(b3,b4) = b2 .cut(b5,b6);

:: HELLY:th 35
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4 being Element of the_Vertices_of b1 holds
   b4 in (b1 .pathBetween(b2,b3)) .vertices()
iff
   b1 .pathBetween(b2,b3) = (b1 .pathBetween(b2,b4)) .append (b1 .pathBetween(b4,b3));

:: HELLY:th 36
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4 being Element of the_Vertices_of b1 holds
   b4 in (b1 .pathBetween(b2,b3)) .vertices()
iff
   b1 .pathBetween(b2,b4) c= b1 .pathBetween(b2,b3);

:: HELLY:th 37
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Path-like Walk of b1
      st b2 .last() = b3 .first() &
         b2 .vertices() /\ (b3 .vertices()) = {b2 .last()}
   holds b2 .append b3 is Path-like(b1);

:: HELLY:th 38
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4 being Element of the_Vertices_of b1 holds
   b4 in (b1 .pathBetween(b2,b3)) .vertices()
iff
   (b1 .pathBetween(b2,b4)) .vertices() /\ ((b1 .pathBetween(b4,b3)) .vertices()) = {b4};

:: HELLY:th 39
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4, b5 being Element of the_Vertices_of b1
for b6, b7 being Path-like Walk of b1
      st b6 = b1 .pathBetween(b2,b3) & b7 = b1 .pathBetween(b2,b4) & not b6 c= b7 & not b7 c= b6 & b5 = b6 . len maxPrefix(b6,b7)
   holds (b1 .pathBetween(b5,b3)) .vertices() /\ ((b1 .pathBetween(b5,b4)) .vertices()) = {b5};

:: HELLY:funcnot 3 => HELLY:func 3
definition
  let a1 be [Graph-like] Tree-like GraphStruct;
  let a2, a3, a4 be Element of the_Vertices_of a1;
  func MiddleVertex(A2,A3,A4) -> Element of the_Vertices_of a1 means
    ((a1 .pathBetween(a2,a3)) .vertices() /\ ((a1 .pathBetween(a3,a4)) .vertices())) /\ ((a1 .pathBetween(a4,a2)) .vertices()) = {it};
end;

:: HELLY:def 3
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4, b5 being Element of the_Vertices_of b1 holds
   b5 = MiddleVertex(b2,b3,b4)
iff
   ((b1 .pathBetween(b2,b3)) .vertices() /\ ((b1 .pathBetween(b3,b4)) .vertices())) /\ ((b1 .pathBetween(b4,b2)) .vertices()) = {b5};

:: HELLY:th 40
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4 being Element of the_Vertices_of b1 holds
MiddleVertex(b2,b3,b4) = MiddleVertex(b2,b4,b3);

:: HELLY:th 41
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4 being Element of the_Vertices_of b1 holds
MiddleVertex(b2,b3,b4) = MiddleVertex(b3,b2,b4);

:: HELLY:th 42
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4 being Element of the_Vertices_of b1 holds
MiddleVertex(b2,b3,b4) = MiddleVertex(b3,b4,b2);

:: HELLY:th 43
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4 being Element of the_Vertices_of b1 holds
MiddleVertex(b2,b3,b4) = MiddleVertex(b4,b2,b3);

:: HELLY:th 44
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4 being Element of the_Vertices_of b1 holds
MiddleVertex(b2,b3,b4) = MiddleVertex(b4,b3,b2);

:: HELLY:th 45
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4 being Element of the_Vertices_of b1
      st b4 in (b1 .pathBetween(b2,b3)) .vertices()
   holds MiddleVertex(b2,b3,b4) = b4;

:: HELLY:th 46
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2 being Element of the_Vertices_of b1 holds
   MiddleVertex(b2,b2,b2) = b2;

:: HELLY:th 47
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1 holds
MiddleVertex(b2,b2,b3) = b2;

:: HELLY:th 48
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1 holds
MiddleVertex(b2,b3,b2) = b2;

:: HELLY:th 49
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Element of the_Vertices_of b1 holds
MiddleVertex(b2,b3,b3) = b3;

:: HELLY:th 50
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3 being Path-like Walk of b1
for b4, b5, b6 being Element of the_Vertices_of b1
      st b2 = b1 .pathBetween(b4,b5) & b3 = b1 .pathBetween(b4,b6) & not b5 in b3 .vertices() & not b6 in b2 .vertices()
   holds MiddleVertex(b4,b5,b6) = b2 . len maxPrefix(b2,b3);

:: HELLY:th 51
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4, b5 being Path-like Walk of b1
for b6, b7, b8 being Element of the_Vertices_of b1
      st b2 = b1 .pathBetween(b6,b7) & b3 = b1 .pathBetween(b6,b8) & b4 = b1 .pathBetween(b7,b6) & b5 = b1 .pathBetween(b7,b8) & not b7 in b3 .vertices() & not b8 in b2 .vertices() & not b6 in b5 .vertices()
   holds b2 . len maxPrefix(b2,b3) = b4 . len maxPrefix(b4,b5);

:: HELLY:th 52
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2, b3, b4 being Element of the_Vertices_of b1
for b5 being non empty set
      st for b6 being set
              st b6 in b5
           holds (ex b7 being Tree-like Subgraph of b1 st
               b6 = the_Vertices_of b7) &
            ((b2 in b6 implies not b3 in b6) & (b2 in b6 implies not b4 in b6) implies b3 in b6 & b4 in b6)
   holds meet b5 <> {};

:: HELLY:attrnot 1 => HELLY:attr 1
definition
  let a1 be set;
  attr a1 is with_Helly_property means
    for b1 being non empty set
          st b1 c= a1 &
             (for b2, b3 being set
                   st b2 in b1 & b3 in b1
                holds b2 meets b3)
       holds meet b1 <> {};
end;

:: HELLY:dfs 4
definiens
  let a1 be set;
To prove
     a1 is with_Helly_property
it is sufficient to prove
  thus for b1 being non empty set
          st b1 c= a1 &
             (for b2, b3 being set
                   st b2 in b1 & b3 in b1
                holds b2 meets b3)
       holds meet b1 <> {};

:: HELLY:def 4
theorem
for b1 being set holds
      b1 is with_Helly_property
   iff
      for b2 being non empty set
            st b2 c= b1 &
               (for b3, b4 being set
                     st b3 in b2 & b4 in b2
                  holds b3 meets b4)
         holds meet b2 <> {};

:: HELLY:th 53
theorem
for b1 being [Graph-like] Tree-like GraphStruct
for b2 being finite set
      st for b3 being set
              st b3 in b2
           holds ex b4 being Tree-like Subgraph of b1 st
              b3 = the_Vertices_of b4
   holds b2 is with_Helly_property;