
theorem
  for f being FinSequence, k1,k2 being Nat st
    k1 in dom f & k2 in dom f holds smid(f,k1,k2) = (k1,k2)-cut f
  proof
    let f be FinSequence, k1,k2 be Nat;
    set ff = (k1,k2)-cut f;
    set g = smid(f,k1,k2);
    reconsider af = f as FinSequence of rng f by FINSEQ_1:def 4;
    assume k1 in dom f & k2 in dom f; then
S0: 1 <= k1 <= len f & 1 <= k2 <= len f by FINSEQ_3:25;
    per cases;
    suppose A0: k1 <= k2; then
WW:   smid(f,k1,k2) = mid(f,k1,k2) by Th4;
      len ff + k1 = k2 + 1 by A0,S0,FINSEQ_6:def 4; then
S2:   len ff = k2 + 1 - k1 .= k2 + 1 -' k1 by A0,NAT_D:37;
      k2 <= k2+1 by NAT_1:13; then
W4:   k2+1-k1 = k2+1-'k1 by XREAL_1:233,A0,XXREAL_0:2;
      k1-'1 <= k1 by NAT_D:35; then
      k1-'1 <= len f by XXREAL_0:2,S0; then
S3:   len (f/^(k1-'1)) = len f - (k1-'1) by RFINSEQ:def 1;
W3:   len f - (k1-'1) = len f - (k1-1) by S0,XREAL_1:233
              .= len f + 1 - k1;
      k2+1 <= len f + 1 by S0,XREAL_1:6; then
      k2+1-'k1 <= len (f/^(k1-'1)) by S3,W3,W4,XREAL_1:9; then
A1:   len ff = len g by S2,FINSEQ_1:59;
      for k being Nat st 1 <= k <= len ff holds ff.k = g.k
      proof
        let k be Nat;
        assume Z0: 1 <= k <= len ff; then
ZZ:     k-'1 + 1 = k by XREAL_1:235;
        k-'1 < len ff
        proof
          per cases by Z0,XXREAL_0:1;
          suppose k > 1; then
            1 <= k-'1 by NAT_D:49; then
            k-'1 < k by NAT_D:51;
            hence thesis by Z0,XXREAL_0:2;
          end;
          suppose k = 1; then
            k-'1 < k by NAT_D:51;
            hence thesis by Z0,XXREAL_0:2;
          end;
        end; then
Z2:     ff.k = f.(k1+(k-'1)) by ZZ,FINSEQ_6:def 4,A0,S0;
P1:     k <= len mid (af,k1,k2) by WW,A1,Z0;
        k1+k >= k by NAT_1:11; then
P2:     1 <= k1+k by XXREAL_0:2,Z0;
        g.k = mid(f,k1,k2).k by Th4,A0
           .= af.(k+k1-'1) by Z0,FINSEQ_6:118,A0,P1,S0
           .= af.(k1+k-1) by P2,XREAL_1:233
           .= af.(k1+(k-1))
           .= af.(k1+(k-'1)) by Z0,XREAL_1:233;
        hence thesis by Z2;
      end;
      hence thesis by A1;
    end;
    suppose A1: k1 > k2; then
      (k1,k2)-cut f = {} by FINSEQ_6:def 4;
      hence thesis by A1,Th7;
    end;
  end;
