reserve D for non empty set;
reserve m,n,N for Nat;
reserve size for non zero Nat;
reserve f1,f2,f3,f4,f5,f6 for BinominativeFunction of D;
reserve p1,p2,p3,p4,p5,p6,p7 for PartialPredicate of D;
reserve d,v for object;
reserve V,A for set;
reserve z for Element of V;
reserve val for Function;
reserve loc for V-valued Function;
reserve d1 for NonatomicND of V,A;
reserve T for TypeSCNominativeData of V,A;

theorem Th13:
  for val being size-element FinSequence holds
  Seg size c= dom loc & loc|Seg size is one-to-one &
  loc,val are_different_wrt size & loc,val,size are_correct_wrt d1
  implies
  for m,n st 1 <= n <= m <= size holds
  LocalOverlapSeq(A,loc,val,d1,size).m.(loc/.n) = d1.(val.n)
  proof
    let val be size-element FinSequence;
    assume that
A1: Seg size c= dom loc and
A2: loc|Seg size is one-to-one and
A3: loc,val are_different_wrt size and
A4: loc,val,size are_correct_wrt d1;
    let m,n such that
A5: 1 <= n and
A6: n <= m and
A7: m <= size;
    set F = LocalOverlapSeq(A,loc,val,d1,size);
A8: Seg size = dom val by FINSEQ_1:89;
A9: len F = size by Def4;
A10: 0+1 <= size by NAT_1:13;
A11: n <= size by A6,A7,XXREAL_0:2;
    defpred P[Nat] means
    n <= $1 <= size implies F.$1.(loc/.n) = d1.(val.n);
A12: P[0] by A5;
A13: for k being Nat st P[k] holds P[k+1]
    proof
      let k be Nat such that
A14:  P[k] and
A15:  n <= k+1 and
A16:  k+1 <= size;
      set D1 = denaming(V,A,val.1);
A17:  dom D1 = {d where d is NonatomicND of V,A: val.1 in dom d}
      by NOMIN_1:def 18;
A18:  rng val c= dom d1 by A4,Def1;
      1 in Seg size by A10,FINSEQ_1:1;
      then
A19:  val.1 in rng val by A8,FUNCT_1:def 3;
      then d1 in dom D1 by A18,A17;
      then reconsider T1 = D1.d1 as TypeSCNominativeData of V,A
      by PARTFUN1:4,NOMIN_1:39;
A20:  F.1 = local_overlapping(V,A,d1,T1,loc/.1) by Def4;
      n in Seg size by A5,A11,FINSEQ_1:1;
      then
A21:  val.n in rng val by A8,FUNCT_1:def 3;
      per cases;
      suppose
A22:    k = 0;
        then n = 1 by A5,A15,XXREAL_0:1;
        hence F.(k+1).(loc/.n) = d1.(val.n) by A4,A19,A18,A20,A22,Th2;
      end;
      suppose k > 0;
       then
A23:   0+1 <= k by NAT_1:13;
A24:   1 <= k+1 by NAT_1:11;
A25:   k < size by A16,NAT_1:13;
       set D = denaming(V,A,val.(k+1));
       reconsider d2 = F.k as NonatomicND of V,A by A23,A9,A25,Def6;
A26:   dom D = {d where d is NonatomicND of V,A: val.(k+1) in dom d}
       by NOMIN_1:def 18;
A27:   val.(k+1) in dom d2 by A4,A24,A16,A23,A25,Th10;
       then d2 in dom D by A26;
       then reconsider T = D.d2 as TypeSCNominativeData of V,A
       by PARTFUN1:4,NOMIN_1:39;
A28:   F.(k+1) = local_overlapping(V,A,d2,T,loc/.(k+1)) by A23,A9,A25,Def4;
       per cases;
       suppose
A29:     k+1 = n;
         then
A30:     k < n by NAT_1:13;
         1 < n by A23,A29,NAT_1:13;
         then
A31:     loc/.1 <> val.n by A3,A10,A11;
         thus F.(k+1).(loc/.n) = d2.(val.n) by A4,A29,A27,A28,Th2
         .= F.1.(val.n) by A4,A3,A11,A23,A30,Th11
         .= d1.(val.n) by A4,A18,A20,A31,A21,NOMIN_5:3;
       end;
       suppose k+1 <> n;
         then
A32:     n < k+1 by A15,XXREAL_0:1;
         then n <= k by NAT_1:13;
         then loc/.n in dom d2 by A4,A5,A25,Th9;
         hence thesis
         by A1,A2,A5,A4,A11,A14,A16,A24,A28,A32,Th1,NAT_1:13,NOMIN_5:3;
       end;
     end;
   end;
   for k being Nat holds P[k] from NAT_1:sch 2(A12,A13);
   hence thesis by A6,A7;
 end;
