
theorem Th41: :: TopPath05
  for G being _Graph for W being Walk of G st W is minlength
  for m,n being odd Nat st m<=n & n<=len W holds
  W.cut(m,n) is minlength
proof
  let G be _Graph, W be Walk of G such that
A1: W is minlength;
  let m,n be odd Nat such that
A2: m <= n and
A3: n <= len W;
  set S = W.cut(m,n);
  assume not S is minlength;
  then consider M being Walk of G such that
A4: M is_Walk_from S.first(),S.last() and
A5: len M < len S;
  set R = W.cut(1,m);
A6: 2*0+1 <= m by ABIAN:12;
  set T = W.cut(n,len W);
A7: n in NAT by ORDINAL1:def 12;
  then
A8: T.first() = W.n by A3,GLIB_001:37;
  set A = R.append(M);
A9: m in NAT by ORDINAL1:def 12;
A10: m <= len W by A2,A3,XXREAL_0:2;
  then
A11: R.last() = W.m by A6,A9,GLIB_001:37;
  S.first() = W.m by A2,A3,A9,A7,GLIB_001:37;
  then
A12: M.first() = W.m by A4;
  then len A + 1 = len R + len M by A11,GLIB_001:28;
  then
A13: len A + 1 < len R + len S by A5,XREAL_1:8;
  set B = A.append(T);
  S.last() = W.n by A2,A3,A9,A7,GLIB_001:37;
  then M.last() = W.n by A4;
  then
A14: A.last() = W.n by A11,A12,GLIB_001:30;
  then
A15: len B + 1 = len A + len T by A8,GLIB_001:28;
A16: len R + 1 = m + 1 by A6,A10,A9,GLIB_001:36;
  len S + m = n + 1 by A2,A3,A9,A7,GLIB_001:36;
  then len A + 1 - 1 < n + 1 - 1 by A16,A13,XREAL_1:14;
  then
A17: len B + 1 < len T + n by A15,XREAL_1:8;
  len T + n = len W + 1 by A3,A7,GLIB_001:36;
  then
A18: len B + 1 - 1 < len W + 1 - 1 by A17,XREAL_1:14;
  T.last() = W.(len W) by A3,A7,GLIB_001:37;
  then
A19: B.last() = W.last() by A8,A14,GLIB_001:30;
  R.first() = W.1 by A6,A10,A9,GLIB_001:37;
  then A.first() = W.1 by A11,A12,GLIB_001:30;
  then B.first() = W.first() by A8,A14,GLIB_001:30;
  then B is_Walk_from W.first(),W.last() by A19;
  hence contradiction by A1,A18;
end;
