Article GRAPH_5, MML version 4.99.1005

:: GRAPH_5:th 2
theorem
for b1 being set
for b2, b3 being Relation-like Function-like set
      st proj2 b2 c= proj2 b3 & b1 in proj1 b2
   holds ex b4 being set st
      b4 in proj1 b3 & b2 . b1 = b3 . b4;

:: GRAPH_5:sch 1
scheme GRAPH_5:sch 1
{F1 -> set,
  F2 -> set,
  F3 -> set}:
ex b1 being Relation-like Function-like set st
   proj1 b1 = F1() &
    (for b2 being Element of F2()
          st b2 in F1()
       holds b1 . b2 = F3(b2))


:: GRAPH_5:th 3
theorem
for b1 being finite set
for b2 being Element of NAT
for b3 being set
      st b3 = {b4 where b4 is Element of b1 *: 1 <= len b4 & len b4 <= b2}
   holds b3 is finite;

:: GRAPH_5:th 4
theorem
for b1 being finite set
for b2 being Element of NAT
for b3 being set
      st b3 = {b4 where b4 is Element of b1 *: len b4 <= b2}
   holds b3 is finite;

:: GRAPH_5:th 5
theorem
for b1 being finite set holds
      card b1 <> 0
   iff
      b1 <> {};

:: GRAPH_5:th 6
theorem
for b1 being finite set
for b2 being Element of NAT
      st card b1 = b2 + 1
   holds ex b3 being Element of b1 st
      ex b4 being Element of bool b1 st
         b1 = b4 \/ {b3} & card b4 = b2;

:: GRAPH_5:th 7
theorem
for b1 being finite set
      st card b1 = 1
   holds ex b2 being Element of b1 st
      b1 = {b2};

:: GRAPH_5:sch 2
scheme GRAPH_5:sch 2
{F1 -> non empty finite set,
  F2 -> real set}:
ex b1 being Element of F1() st
   for b2 being Element of F1() holds
      F2(b1) <= F2(b2)


:: GRAPH_5:modenot 1 => GRAPH_5:mode 1
definition
  let a1 be set;
  let a2 be non empty Element of bool (a1 *);
  redefine mode Element of a2 -> FinSequence of a1;
end;

:: GRAPH_5:th 9
theorem
for b1 being Relation-like Function-like FinSequence-like set holds
      for b2, b3 being Element of NAT
            st 1 <= b2 & b2 < b3 & b3 <= len b1
         holds b1 . b2 <> b1 . b3
   iff
      b1 is one-to-one;

:: GRAPH_5:th 10
theorem
for b1 being Relation-like Function-like FinSequence-like set holds
      for b2, b3 being Element of NAT
            st 1 <= b2 & b2 < b3 & b3 <= len b1
         holds b1 . b2 <> b1 . b3
   iff
      card proj2 b1 = len b1;

:: GRAPH_5:th 11
theorem
for b1 being Element of NAT
for b2 being Graph-like MultiGraphStruct
for b3 being FinSequence of the Edges of b2
      st b1 in dom b3
   holds (the Source of b2) . (b3 . b1) in the Vertices of b2 &
    (the Target of b2) . (b3 . b1) in the Vertices of b2;

:: GRAPH_5:th 12
theorem
for b1 being set
for b2, b3 being Relation-like Function-like FinSequence-like set
      st b2 ^ <*b1*> is one-to-one &
         proj2 (b2 ^ <*b1*>) c= proj2 b3
   holds ex b4, b5 being Relation-like Function-like FinSequence-like set st
      b3 = (b4 ^ <*b1*>) ^ b5 & proj2 b2 c= proj2 (b4 ^ b5);

:: GRAPH_5:th 13
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set
for b3 being Graph-like MultiGraphStruct
      st b1 ^ b2 is Chain of b3
   holds b1 is Chain of b3 & b2 is Chain of b3;

:: GRAPH_5:th 14
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set
for b3 being Graph-like MultiGraphStruct
      st b1 ^ b2 is oriented Chain of b3
   holds b1 is oriented Chain of b3 & b2 is oriented Chain of b3;

:: GRAPH_5:th 15
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being oriented Chain of b1
      st (the Target of b1) . (b2 . len b2) = (the Source of b1) . (b3 . 1)
   holds b2 ^ b3 is oriented Chain of b1;

:: GRAPH_5:th 16
theorem
for b1 being Graph-like MultiGraphStruct holds
   {} is oriented Simple Chain of b1;

:: GRAPH_5:th 17
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set
for b3 being Graph-like MultiGraphStruct
      st b1 ^ b2 is oriented Simple Chain of b3
   holds b1 is oriented Simple Chain of b3 & b2 is oriented Simple Chain of b3;

:: GRAPH_5:th 18
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being FinSequence of the Edges of b1
      st len b2 = 1
   holds b2 is oriented Simple Chain of b1;

:: GRAPH_5:th 19
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being oriented Simple Chain of b1
for b3 being FinSequence of the Edges of b1
      st 1 <= len b2 &
         len b3 = 1 &
         (the Source of b1) . (b3 . 1) = (the Target of b1) . (b2 . len b2) &
         (the Source of b1) . (b2 . 1) <> (the Target of b1) . (b2 . len b2) &
         (for b4 being Element of NAT
               st 1 <= b4 & b4 <= len b2
            holds (the Target of b1) . (b2 . b4) <> (the Target of b1) . (b3 . 1))
   holds b2 ^ b3 is oriented Simple Chain of b1;

:: GRAPH_5:th 20
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being oriented Simple Chain of b1 holds
   b2 is one-to-one;

:: GRAPH_5:funcnot 1 => GRAPH_5:func 1
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be Element of the Edges of a1;
  func vertices A2 -> set equals
    {(the Source of a1) . a2,(the Target of a1) . a2};
end;

:: GRAPH_5:def 1
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being Element of the Edges of b1 holds
   vertices b2 = {(the Source of b1) . b2,(the Target of b1) . b2};

:: GRAPH_5:funcnot 2 => GRAPH_5:func 2
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be FinSequence of the Edges of a1;
  func vertices A2 -> Element of bool the Vertices of a1 equals
    {b1 where b1 is Element of the Vertices of a1: ex b2 being Element of NAT st
       b2 in dom a2 & b1 in vertices (a2 /. b2)};
end;

:: GRAPH_5:def 2
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being FinSequence of the Edges of b1 holds
   vertices b2 = {b3 where b3 is Element of the Vertices of b1: ex b4 being Element of NAT st
      b4 in dom b2 & b3 in vertices (b2 /. b4)};

:: GRAPH_5:th 21
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being FinSequence of the Edges of b1
for b4 being oriented Simple Chain of b1
      st b4 = b2 ^ b3 &
         1 <= len b2 &
         1 <= len b3 &
         (the Source of b1) . (b4 . 1) <> (the Target of b1) . (b4 . len b4)
   holds not (the Source of b1) . (b4 . 1) in vertices b3 &
    not (the Target of b1) . (b4 . len b4) in vertices b2;

:: GRAPH_5:th 22
theorem
for b1 being set
for b2 being Graph-like MultiGraphStruct
for b3 being FinSequence of the Edges of b2 holds
      vertices b3 c= b1
   iff
      for b4 being natural set
            st b4 in dom b3
         holds vertices (b3 /. b4) c= b1;

:: GRAPH_5:th 23
theorem
for b1 being set
for b2 being Graph-like MultiGraphStruct
for b3 being FinSequence of the Edges of b2
      st not vertices b3 c= b1
   holds ex b4 being Element of NAT st
      ex b5, b6 being FinSequence of the Edges of b2 st
         b4 + 1 <= len b3 & not vertices (b3 /. (b4 + 1)) c= b1 & len b5 = b4 & b3 = b5 ^ b6 & vertices b5 c= b1;

:: GRAPH_5:th 24
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being FinSequence of the Edges of b1
      st proj2 b2 c= proj2 b3
   holds vertices b2 c= vertices b3;

:: GRAPH_5:th 25
theorem
for b1, b2 being set
for b3 being Graph-like MultiGraphStruct
for b4, b5 being FinSequence of the Edges of b3
      st proj2 b4 c= proj2 b5 & (vertices b5) \ b1 c= b2
   holds (vertices b4) \ b1 c= b2;

:: GRAPH_5:th 26
theorem
for b1, b2 being set
for b3 being Graph-like MultiGraphStruct
for b4, b5 being FinSequence of the Edges of b3
      st (vertices (b4 ^ b5)) \ b1 c= b2
   holds (vertices b4) \ b1 c= b2 & (vertices b5) \ b1 c= b2;

:: GRAPH_5:th 28
theorem
for b1 being Element of NAT
for b2 being Graph-like MultiGraphStruct
for b3 being FinSequence of the Edges of b2
for b4 being Element of the Vertices of b2
      st b1 in dom b3 &
         (b4 = (the Source of b2) . (b3 . b1) or b4 = (the Target of b2) . (b3 . b1))
   holds b4 in vertices b3;

:: GRAPH_5:th 29
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being FinSequence of the Edges of b1
      st len b2 = 1
   holds vertices b2 = vertices (b2 /. 1);

:: GRAPH_5:th 30
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being FinSequence of the Edges of b1 holds
vertices b2 c= vertices (b2 ^ b3) & vertices b3 c= vertices (b2 ^ b3);

:: GRAPH_5:th 31
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being FinSequence of the Edges of b1
for b3, b4 being oriented Chain of b1
      st b3 = b4 ^ b2 & 1 <= len b4 & len b2 = 1
   holds vertices b3 = (vertices b4) \/ {(the Target of b1) . (b2 . 1)};

:: GRAPH_5:th 32
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being Element of the Vertices of b1
for b3 being oriented Chain of b1
      st b2 <> (the Source of b1) . (b3 . 1) & b2 in vertices b3
   holds ex b4 being Element of NAT st
      1 <= b4 & b4 <= len b3 & b2 = (the Target of b1) . (b3 . b4);

:: GRAPH_5:prednot 1 => GRAPH_5:pred 1
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be oriented Chain of a1;
  let a3, a4 be Element of the Vertices of a1;
  pred A2 is_orientedpath_of A3,A4 means
    a2 <> {} & (the Source of a1) . (a2 . 1) = a3 & (the Target of a1) . (a2 . len a2) = a4;
end;

:: GRAPH_5:dfs 3
definiens
  let a1 be Graph-like MultiGraphStruct;
  let a2 be oriented Chain of a1;
  let a3, a4 be Element of the Vertices of a1;
To prove
     a2 is_orientedpath_of a3,a4
it is sufficient to prove
  thus a2 <> {} & (the Source of a1) . (a2 . 1) = a3 & (the Target of a1) . (a2 . len a2) = a4;

:: GRAPH_5:def 3
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being oriented Chain of b1
for b3, b4 being Element of the Vertices of b1 holds
   b2 is_orientedpath_of b3,b4
iff
   b2 <> {} & (the Source of b1) . (b2 . 1) = b3 & (the Target of b1) . (b2 . len b2) = b4;

:: GRAPH_5:prednot 2 => GRAPH_5:pred 2
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  let a4 be oriented Chain of a1;
  let a5 be set;
  pred A4 is_orientedpath_of A2,A3,A5 means
    a4 is_orientedpath_of a2,a3 & (vertices a4) \ {a3} c= a5;
end;

:: GRAPH_5:dfs 4
definiens
  let a1 be Graph-like MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  let a4 be oriented Chain of a1;
  let a5 be set;
To prove
     a4 is_orientedpath_of a2,a3,a5
it is sufficient to prove
  thus a4 is_orientedpath_of a2,a3 & (vertices a4) \ {a3} c= a5;

:: GRAPH_5:def 4
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1
for b4 being oriented Chain of b1
for b5 being set holds
      b4 is_orientedpath_of b2,b3,b5
   iff
      b4 is_orientedpath_of b2,b3 & (vertices b4) \ {b3} c= b5;

:: GRAPH_5:funcnot 3 => GRAPH_5:func 3
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  func OrientedPaths(A2,A3) -> Element of bool ((the Edges of a1) *) equals
    {b1 where b1 is oriented Chain of a1: b1 is_orientedpath_of a2,a3};
end;

:: GRAPH_5:def 5
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1 holds
OrientedPaths(b2,b3) = {b4 where b4 is oriented Chain of b1: b4 is_orientedpath_of b2,b3};

:: GRAPH_5:th 33
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1
for b4 being oriented Chain of b1
      st b4 is_orientedpath_of b2,b3
   holds b2 in vertices b4 & b3 in vertices b4;

:: GRAPH_5:th 34
theorem
for b1 being set
for b2 being Graph-like MultiGraphStruct
for b3, b4 being Element of the Vertices of b2 holds
   b1 in OrientedPaths(b3,b4)
iff
   ex b5 being oriented Chain of b2 st
      b5 = b1 & b5 is_orientedpath_of b3,b4;

:: GRAPH_5:th 35
theorem
for b1 being set
for b2 being Graph-like MultiGraphStruct
for b3, b4 being Element of the Vertices of b2
for b5 being oriented Chain of b2
      st b5 is_orientedpath_of b3,b4,b1 & b3 <> b4
   holds b3 in b1;

:: GRAPH_5:th 36
theorem
for b1, b2 being set
for b3 being Graph-like MultiGraphStruct
for b4, b5 being Element of the Vertices of b3
for b6 being oriented Chain of b3
      st b6 is_orientedpath_of b4,b5,b1 & b1 c= b2
   holds b6 is_orientedpath_of b4,b5,b2;

:: GRAPH_5:th 37
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being FinSequence of the Edges of b1
for b3, b4, b5 being Element of the Vertices of b1
for b6 being oriented Chain of b1
      st 1 <= len b6 & b6 is_orientedpath_of b3,b4 & b2 . 1 orientedly_joins b4,b5 & len b2 = 1
   holds ex b7 being oriented Chain of b1 st
      b7 = b6 ^ b2 & b7 is_orientedpath_of b3,b5;

:: GRAPH_5:th 38
theorem
for b1 being set
for b2 being Graph-like MultiGraphStruct
for b3 being FinSequence of the Edges of b2
for b4, b5, b6 being Element of the Vertices of b2
for b7, b8 being oriented Chain of b2
      st b7 = b8 ^ b3 & 1 <= len b8 & len b3 = 1 & b8 is_orientedpath_of b4,b5,b1 & b3 . 1 orientedly_joins b5,b6
   holds b7 is_orientedpath_of b4,b6,b1 \/ {b5};

:: GRAPH_5:prednot 3 => GRAPH_5:pred 3
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be oriented Chain of a1;
  let a3, a4 be Element of the Vertices of a1;
  pred A2 is_acyclicpath_of A3,A4 means
    a2 is Simple(a1) & a2 is_orientedpath_of a3,a4;
end;

:: GRAPH_5:dfs 6
definiens
  let a1 be Graph-like MultiGraphStruct;
  let a2 be oriented Chain of a1;
  let a3, a4 be Element of the Vertices of a1;
To prove
     a2 is_acyclicpath_of a3,a4
it is sufficient to prove
  thus a2 is Simple(a1) & a2 is_orientedpath_of a3,a4;

:: GRAPH_5:def 6
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being oriented Chain of b1
for b3, b4 being Element of the Vertices of b1 holds
   b2 is_acyclicpath_of b3,b4
iff
   b2 is Simple(b1) & b2 is_orientedpath_of b3,b4;

:: GRAPH_5:prednot 4 => GRAPH_5:pred 4
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be oriented Chain of a1;
  let a3, a4 be Element of the Vertices of a1;
  let a5 be set;
  pred A2 is_acyclicpath_of A3,A4,A5 means
    a2 is Simple(a1) & a2 is_orientedpath_of a3,a4,a5;
end;

:: GRAPH_5:dfs 7
definiens
  let a1 be Graph-like MultiGraphStruct;
  let a2 be oriented Chain of a1;
  let a3, a4 be Element of the Vertices of a1;
  let a5 be set;
To prove
     a2 is_acyclicpath_of a3,a4,a5
it is sufficient to prove
  thus a2 is Simple(a1) & a2 is_orientedpath_of a3,a4,a5;

:: GRAPH_5:def 7
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being oriented Chain of b1
for b3, b4 being Element of the Vertices of b1
for b5 being set holds
      b2 is_acyclicpath_of b3,b4,b5
   iff
      b2 is Simple(b1) & b2 is_orientedpath_of b3,b4,b5;

:: GRAPH_5:funcnot 4 => GRAPH_5:func 4
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  func AcyclicPaths(A2,A3) -> Element of bool ((the Edges of a1) *) equals
    {b1 where b1 is oriented Simple Chain of a1: b1 is_acyclicpath_of a2,a3};
end;

:: GRAPH_5:def 8
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1 holds
AcyclicPaths(b2,b3) = {b4 where b4 is oriented Simple Chain of b1: b4 is_acyclicpath_of b2,b3};

:: GRAPH_5:funcnot 5 => GRAPH_5:func 5
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  let a4 be set;
  func AcyclicPaths(A2,A3,A4) -> Element of bool ((the Edges of a1) *) equals
    {b1 where b1 is oriented Simple Chain of a1: b1 is_acyclicpath_of a2,a3,a4};
end;

:: GRAPH_5:def 9
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1
for b4 being set holds
   AcyclicPaths(b2,b3,b4) = {b5 where b5 is oriented Simple Chain of b1: b5 is_acyclicpath_of b2,b3,b4};

:: GRAPH_5:funcnot 6 => GRAPH_5:func 6
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be oriented Chain of a1;
  func AcyclicPaths A2 -> Element of bool ((the Edges of a1) *) equals
    {b1 where b1 is oriented Simple Chain of a1: b1 <> {} &
     (the Source of a1) . (b1 . 1) = (the Source of a1) . (a2 . 1) &
     (the Target of a1) . (b1 . len b1) = (the Target of a1) . (a2 . len a2) &
     proj2 b1 c= proj2 a2};
end;

:: GRAPH_5:def 10
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being oriented Chain of b1 holds
   AcyclicPaths b2 = {b3 where b3 is oriented Simple Chain of b1: b3 <> {} &
    (the Source of b1) . (b3 . 1) = (the Source of b1) . (b2 . 1) &
    (the Target of b1) . (b3 . len b3) = (the Target of b1) . (b2 . len b2) &
    proj2 b3 c= proj2 b2};

:: GRAPH_5:funcnot 7 => GRAPH_5:func 7
definition
  let a1 be Graph-like MultiGraphStruct;
  func AcyclicPaths A1 -> Element of bool ((the Edges of a1) *) equals
    {b1 where b1 is oriented Simple Chain of a1: TRUE};
end;

:: GRAPH_5:def 11
theorem
for b1 being Graph-like MultiGraphStruct holds
   AcyclicPaths b1 = {b2 where b2 is oriented Simple Chain of b1: TRUE};

:: GRAPH_5:th 39
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1
for b4 being oriented Chain of b1
      st b4 = {}
   holds not b4 is_acyclicpath_of b2,b3;

:: GRAPH_5:th 40
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1
for b4 being oriented Chain of b1
      st b4 is_acyclicpath_of b2,b3
   holds b4 is_orientedpath_of b2,b3;

:: GRAPH_5:th 41
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1 holds
AcyclicPaths(b2,b3) c= OrientedPaths(b2,b3);

:: GRAPH_5:th 42
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being oriented Chain of b1 holds
   AcyclicPaths b2 c= AcyclicPaths b1;

:: GRAPH_5:th 43
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1 holds
AcyclicPaths(b2,b3) c= AcyclicPaths b1;

:: GRAPH_5:th 44
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1
for b4 being oriented Chain of b1
      st b4 is_orientedpath_of b2,b3
   holds AcyclicPaths b4 c= AcyclicPaths(b2,b3);

:: GRAPH_5:th 45
theorem
for b1 being set
for b2 being Graph-like MultiGraphStruct
for b3, b4 being Element of the Vertices of b2
for b5 being oriented Chain of b2
      st b5 is_orientedpath_of b3,b4,b1
   holds AcyclicPaths b5 c= AcyclicPaths(b3,b4,b1);

:: GRAPH_5:th 46
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being oriented Chain of b1
      st b2 in AcyclicPaths b3
   holds len b2 <= len b3;

:: GRAPH_5:th 47
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1
for b4 being oriented Chain of b1
      st b4 is_orientedpath_of b2,b3
   holds AcyclicPaths b4 <> {} & AcyclicPaths(b2,b3) <> {};

:: GRAPH_5:th 48
theorem
for b1 being set
for b2 being Graph-like MultiGraphStruct
for b3, b4 being Element of the Vertices of b2
for b5 being oriented Chain of b2
      st b5 is_orientedpath_of b3,b4,b1
   holds AcyclicPaths b5 <> {} & AcyclicPaths(b3,b4,b1) <> {};

:: GRAPH_5:th 49
theorem
for b1 being set
for b2 being Graph-like MultiGraphStruct
for b3, b4 being Element of the Vertices of b2 holds
AcyclicPaths(b3,b4,b1) c= AcyclicPaths b2;

:: GRAPH_5:funcnot 8 => GRAPH_5:func 8
definition
  func Real>=0 -> Element of bool REAL equals
    {b1 where b1 is Element of REAL: 0 <= b1};
end;

:: GRAPH_5:def 12
theorem
Real>=0 = {b1 where b1 is Element of REAL: 0 <= b1};

:: GRAPH_5:funcreg 1
registration
  cluster Real>=0 -> non empty;
end;

:: GRAPH_5:prednot 5 => GRAPH_5:pred 5
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be Relation-like Function-like set;
  pred A2 is_weight>=0of A1 means
    a2 is Function-like quasi_total Relation of the Edges of a1,Real>=0;
end;

:: GRAPH_5:dfs 13
definiens
  let a1 be Graph-like MultiGraphStruct;
  let a2 be Relation-like Function-like set;
To prove
     a2 is_weight>=0of a1
it is sufficient to prove
  thus a2 is Function-like quasi_total Relation of the Edges of a1,Real>=0;

:: GRAPH_5:def 13
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being Relation-like Function-like set holds
      b2 is_weight>=0of b1
   iff
      b2 is Function-like quasi_total Relation of the Edges of b1,Real>=0;

:: GRAPH_5:prednot 6 => GRAPH_5:pred 6
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be Relation-like Function-like set;
  pred A2 is_weight_of A1 means
    a2 is Function-like quasi_total Relation of the Edges of a1,REAL;
end;

:: GRAPH_5:dfs 14
definiens
  let a1 be Graph-like MultiGraphStruct;
  let a2 be Relation-like Function-like set;
To prove
     a2 is_weight_of a1
it is sufficient to prove
  thus a2 is Function-like quasi_total Relation of the Edges of a1,REAL;

:: GRAPH_5:def 14
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being Relation-like Function-like set holds
      b2 is_weight_of b1
   iff
      b2 is Function-like quasi_total Relation of the Edges of b1,REAL;

:: GRAPH_5:funcnot 9 => GRAPH_5:func 9
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be FinSequence of the Edges of a1;
  let a3 be Relation-like Function-like set;
  assume a3 is_weight_of a1;
  func RealSequence(A2,A3) -> FinSequence of REAL means
    dom a2 = dom it &
     (for b1 being Element of NAT
           st b1 in dom a2
        holds it . b1 = a3 . (a2 . b1));
end;

:: GRAPH_5:def 15
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being FinSequence of the Edges of b1
for b3 being Relation-like Function-like set
   st b3 is_weight_of b1
for b4 being FinSequence of REAL holds
      b4 = RealSequence(b2,b3)
   iff
      dom b2 = dom b4 &
       (for b5 being Element of NAT
             st b5 in dom b2
          holds b4 . b5 = b3 . (b2 . b5));

:: GRAPH_5:funcnot 10 => GRAPH_5:func 10
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be FinSequence of the Edges of a1;
  let a3 be Relation-like Function-like set;
  func cost(A2,A3) -> Element of REAL equals
    Sum RealSequence(a2,a3);
end;

:: GRAPH_5:def 16
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being FinSequence of the Edges of b1
for b3 being Relation-like Function-like set holds
   cost(b2,b3) = Sum RealSequence(b2,b3);

:: GRAPH_5:th 50
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like MultiGraphStruct
      st b1 is_weight>=0of b2
   holds b1 is_weight_of b2;

:: GRAPH_5:th 51
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like MultiGraphStruct
for b3 being FinSequence of the Edges of b2
for b4 being FinSequence of REAL
   st b1 is_weight>=0of b2 & b4 = RealSequence(b3,b1)
for b5 being Element of NAT
      st b5 in dom b4
   holds 0 <= b4 . b5;

:: GRAPH_5:th 52
theorem
for b1 being Element of NAT
for b2 being Relation-like Function-like set
for b3 being Graph-like MultiGraphStruct
for b4, b5 being FinSequence of the Edges of b3
      st proj2 b4 c= proj2 b5 & b2 is_weight_of b3 & b1 in dom b4
   holds ex b6 being Element of NAT st
      b6 in dom b5 &
       (RealSequence(b5,b2)) . b6 = (RealSequence(b4,b2)) . b1;

:: GRAPH_5:th 53
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like MultiGraphStruct
for b3, b4 being FinSequence of the Edges of b2
      st len b3 = 1 & proj2 b3 c= proj2 b4 & b1 is_weight>=0of b2
   holds cost(b3,b1) <= cost(b4,b1);

:: GRAPH_5:th 54
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like MultiGraphStruct
for b3 being FinSequence of the Edges of b2
      st b1 is_weight>=0of b2
   holds 0 <= cost(b3,b1);

:: GRAPH_5:th 55
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like MultiGraphStruct
for b3 being FinSequence of the Edges of b2
      st b3 = {} & b1 is_weight_of b2
   holds cost(b3,b1) = 0;

:: GRAPH_5:th 56
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like MultiGraphStruct
for b3, b4 being Element of the Vertices of b2
for b5 being non empty finite Element of bool ((the Edges of b2) *)
      st b5 = AcyclicPaths(b3,b4)
   holds ex b6 being FinSequence of the Edges of b2 st
      b6 in b5 &
       (for b7 being FinSequence of the Edges of b2
             st b7 in b5
          holds cost(b6,b1) <= cost(b7,b1));

:: GRAPH_5:th 57
theorem
for b1 being set
for b2 being Relation-like Function-like set
for b3 being Graph-like MultiGraphStruct
for b4, b5 being Element of the Vertices of b3
for b6 being non empty finite Element of bool ((the Edges of b3) *)
      st b6 = AcyclicPaths(b4,b5,b1)
   holds ex b7 being FinSequence of the Edges of b3 st
      b7 in b6 &
       (for b8 being FinSequence of the Edges of b3
             st b8 in b6
          holds cost(b7,b2) <= cost(b8,b2));

:: GRAPH_5:th 58
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like MultiGraphStruct
for b3, b4 being FinSequence of the Edges of b2
      st b1 is_weight_of b2
   holds cost(b3 ^ b4,b1) = (cost(b3,b1)) + cost(b4,b1);

:: GRAPH_5:th 59
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like MultiGraphStruct
for b3, b4 being FinSequence of the Edges of b2
      st b3 is one-to-one & proj2 b3 c= proj2 b4 & b1 is_weight>=0of b2
   holds cost(b3,b1) <= cost(b4,b1);

:: GRAPH_5:th 60
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like MultiGraphStruct
for b3 being FinSequence of the Edges of b2
for b4 being oriented Chain of b2
      st b3 in AcyclicPaths b4 & b1 is_weight>=0of b2
   holds cost(b3,b1) <= cost(b4,b1);

:: GRAPH_5:prednot 7 => GRAPH_5:pred 7
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  let a4 be oriented Chain of a1;
  let a5 be Relation-like Function-like set;
  pred A4 is_shortestpath_of A2,A3,A5 means
    a4 is_orientedpath_of a2,a3 &
     (for b1 being oriented Chain of a1
           st b1 is_orientedpath_of a2,a3
        holds cost(a4,a5) <= cost(b1,a5));
end;

:: GRAPH_5:dfs 17
definiens
  let a1 be Graph-like MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  let a4 be oriented Chain of a1;
  let a5 be Relation-like Function-like set;
To prove
     a4 is_shortestpath_of a2,a3,a5
it is sufficient to prove
  thus a4 is_orientedpath_of a2,a3 &
     (for b1 being oriented Chain of a1
           st b1 is_orientedpath_of a2,a3
        holds cost(a4,a5) <= cost(b1,a5));

:: GRAPH_5:def 17
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1
for b4 being oriented Chain of b1
for b5 being Relation-like Function-like set holds
      b4 is_shortestpath_of b2,b3,b5
   iff
      b4 is_orientedpath_of b2,b3 &
       (for b6 being oriented Chain of b1
             st b6 is_orientedpath_of b2,b3
          holds cost(b4,b5) <= cost(b6,b5));

:: GRAPH_5:prednot 8 => GRAPH_5:pred 8
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  let a4 be oriented Chain of a1;
  let a5 be set;
  let a6 be Relation-like Function-like set;
  pred A4 is_shortestpath_of A2,A3,A5,A6 means
    a4 is_orientedpath_of a2,a3,a5 &
     (for b1 being oriented Chain of a1
           st b1 is_orientedpath_of a2,a3,a5
        holds cost(a4,a6) <= cost(b1,a6));
end;

:: GRAPH_5:dfs 18
definiens
  let a1 be Graph-like MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  let a4 be oriented Chain of a1;
  let a5 be set;
  let a6 be Relation-like Function-like set;
To prove
     a4 is_shortestpath_of a2,a3,a5,a6
it is sufficient to prove
  thus a4 is_orientedpath_of a2,a3,a5 &
     (for b1 being oriented Chain of a1
           st b1 is_orientedpath_of a2,a3,a5
        holds cost(a4,a6) <= cost(b1,a6));

:: GRAPH_5:def 18
theorem
for b1 being Graph-like MultiGraphStruct
for b2, b3 being Element of the Vertices of b1
for b4 being oriented Chain of b1
for b5 being set
for b6 being Relation-like Function-like set holds
      b4 is_shortestpath_of b2,b3,b5,b6
   iff
      b4 is_orientedpath_of b2,b3,b5 &
       (for b7 being oriented Chain of b1
             st b7 is_orientedpath_of b2,b3,b5
          holds cost(b4,b6) <= cost(b7,b6));

:: GRAPH_5:th 61
theorem
for b1 being Graph-like finite MultiGraphStruct
for b2 being oriented Simple Chain of b1 holds
   len b2 <= VerticesCount b1;

:: GRAPH_5:th 62
theorem
for b1 being Graph-like finite MultiGraphStruct
for b2 being oriented Simple Chain of b1 holds
   len b2 <= EdgesCount b1;

:: GRAPH_5:funcreg 2
registration
  let a1 be Graph-like finite MultiGraphStruct;
  cluster AcyclicPaths a1 -> finite;
end;

:: GRAPH_5:funcreg 3
registration
  let a1 be Graph-like finite MultiGraphStruct;
  let a2 be oriented Chain of a1;
  cluster AcyclicPaths a2 -> finite;
end;

:: GRAPH_5:funcreg 4
registration
  let a1 be Graph-like finite MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  cluster AcyclicPaths(a2,a3) -> finite;
end;

:: GRAPH_5:funcreg 5
registration
  let a1 be Graph-like finite MultiGraphStruct;
  let a2, a3 be Element of the Vertices of a1;
  let a4 be set;
  cluster AcyclicPaths(a2,a3,a4) -> finite;
end;

:: GRAPH_5:th 63
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like finite MultiGraphStruct
for b3, b4 being Element of the Vertices of b2
      st AcyclicPaths(b3,b4) <> {}
   holds ex b5 being FinSequence of the Edges of b2 st
      b5 in AcyclicPaths(b3,b4) &
       (for b6 being FinSequence of the Edges of b2
             st b6 in AcyclicPaths(b3,b4)
          holds cost(b5,b1) <= cost(b6,b1));

:: GRAPH_5:th 64
theorem
for b1 being set
for b2 being Relation-like Function-like set
for b3 being Graph-like finite MultiGraphStruct
for b4, b5 being Element of the Vertices of b3
      st AcyclicPaths(b4,b5,b1) <> {}
   holds ex b6 being FinSequence of the Edges of b3 st
      b6 in AcyclicPaths(b4,b5,b1) &
       (for b7 being FinSequence of the Edges of b3
             st b7 in AcyclicPaths(b4,b5,b1)
          holds cost(b6,b2) <= cost(b7,b2));

:: GRAPH_5:th 65
theorem
for b1 being Relation-like Function-like set
for b2 being Graph-like finite MultiGraphStruct
for b3 being oriented Chain of b2
for b4, b5 being Element of the Vertices of b2
      st b3 is_orientedpath_of b4,b5 & b1 is_weight>=0of b2
   holds ex b6 being oriented Simple Chain of b2 st
      b6 is_shortestpath_of b4,b5,b1;

:: GRAPH_5:th 66
theorem
for b1 being set
for b2 being Relation-like Function-like set
for b3 being Graph-like finite MultiGraphStruct
for b4 being oriented Chain of b3
for b5, b6 being Element of the Vertices of b3
      st b4 is_orientedpath_of b5,b6,b1 & b2 is_weight>=0of b3
   holds ex b7 being oriented Simple Chain of b3 st
      b7 is_shortestpath_of b5,b6,b1,b2;

:: GRAPH_5:th 67
theorem
for b1 being set
for b2 being Relation-like Function-like set
for b3 being Graph-like finite MultiGraphStruct
for b4 being oriented Chain of b3
for b5, b6 being Element of the Vertices of b3
      st b2 is_weight>=0of b3 &
         b4 is_shortestpath_of b5,b6,b1,b2 &
         b5 <> b6 &
         (for b7 being oriented Chain of b3
         for b8 being Element of the Vertices of b3
               st not b8 in b1 & b7 is_shortestpath_of b5,b8,b1,b2
            holds cost(b4,b2) <= cost(b7,b2))
   holds b4 is_shortestpath_of b5,b6,b2;

:: GRAPH_5:th 68
theorem
for b1, b2 being set
for b3 being Relation-like Function-like set
for b4 being Graph-like finite MultiGraphStruct
for b5 being oriented Chain of b4
for b6, b7 being Element of the Vertices of b4
      st b3 is_weight>=0of b4 &
         b5 is_shortestpath_of b6,b7,b1,b3 &
         b6 <> b7 &
         b1 c= b2 &
         (for b8 being oriented Chain of b4
         for b9 being Element of the Vertices of b4
               st not b9 in b1 & b8 is_shortestpath_of b6,b9,b1,b3
            holds cost(b5,b3) <= cost(b8,b3))
   holds b5 is_shortestpath_of b6,b7,b2,b3;

:: GRAPH_5:prednot 9 => GRAPH_5:pred 9
definition
  let a1 be Graph-like MultiGraphStruct;
  let a2 be FinSequence of the Edges of a1;
  let a3 be set;
  let a4 be Element of the Vertices of a1;
  let a5 be Relation-like Function-like set;
  pred A2 islongestInShortestpath A3,A4,A5 means
    for b1 being Element of the Vertices of a1
          st b1 in a3 & b1 <> a4
       holds ex b2 being oriented Chain of a1 st
          b2 is_shortestpath_of a4,b1,a3,a5 & cost(b2,a5) <= cost(a2,a5);
end;

:: GRAPH_5:dfs 19
definiens
  let a1 be Graph-like MultiGraphStruct;
  let a2 be FinSequence of the Edges of a1;
  let a3 be set;
  let a4 be Element of the Vertices of a1;
  let a5 be Relation-like Function-like set;
To prove
     a2 islongestInShortestpath a3,a4,a5
it is sufficient to prove
  thus for b1 being Element of the Vertices of a1
          st b1 in a3 & b1 <> a4
       holds ex b2 being oriented Chain of a1 st
          b2 is_shortestpath_of a4,b1,a3,a5 & cost(b2,a5) <= cost(a2,a5);

:: GRAPH_5:def 19
theorem
for b1 being Graph-like MultiGraphStruct
for b2 being FinSequence of the Edges of b1
for b3 being set
for b4 being Element of the Vertices of b1
for b5 being Relation-like Function-like set holds
      b2 islongestInShortestpath b3,b4,b5
   iff
      for b6 being Element of the Vertices of b1
            st b6 in b3 & b6 <> b4
         holds ex b7 being oriented Chain of b1 st
            b7 is_shortestpath_of b4,b6,b3,b5 & cost(b7,b5) <= cost(b2,b5);

:: GRAPH_5:th 69
theorem
for b1, b2 being set
for b3 being Relation-like Function-like set
for b4 being Graph-like oriented finite MultiGraphStruct
for b5, b6, b7 being oriented Chain of b4
for b8, b9, b10 being Element of the Vertices of b4
      st b1 in the Edges of b4 & b3 is_weight>=0of b4 & 1 <= len b5 & b5 is_shortestpath_of b8,b9,b2,b3 & b8 <> b9 & b8 <> b10 & b7 = b5 ^ <*b1*> & b6 is_shortestpath_of b8,b10,b2,b3 & b1 orientedly_joins b9,b10 & b5 islongestInShortestpath b2,b8,b3
   holds (cost(b6,b3) <= cost(b7,b3) implies b6 is_shortestpath_of b8,b10,b2 \/ {b9},b3) &
    (cost(b7,b3) <= cost(b6,b3) implies b7 is_shortestpath_of b8,b10,b2 \/ {b9},b3);