reserve D for non empty set;
reserve f1,f2,f3,f4,f5,f6,f7,f8,f9,f10 for BinominativeFunction of D;
reserve p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11 for PartialPredicate of D;
reserve q1,q2,q3,q4,q5,q6,q7,q8,q9,q10 for total PartialPredicate of D;
reserve n,m,N for Nat;
reserve fD for PFuncs(D,D)-valued FinSequence;
reserve fB for PFuncs(D,BOOLEAN)-valued FinSequence;
reserve V,A for set;
reserve val for Function;
reserve loc for V-valued Function;
reserve d1 for NonatomicND of V,A;
reserve p for SCPartialNominativePredicate of V,A;
reserve d,v for object;
reserve size for non zero Nat;
reserve inp,pos for FinSequence;
reserve prg for non empty FPrg(ND(V,A))-valued FinSequence;

theorem Th16:
  for val being size-element FinSequence holds
  loc,val,size are_correct_wrt d1 &
  d = LocalOverlapSeq(A,loc,val,d1,size).(size-1) & 2 <= n+1 < size &
  local_overlapping(V,A,d,denaming(V,A,val.len val).d,loc/.len val) in dom p
  implies
  local_overlapping(V,A,LocalOverlapSeq(A,loc,val,d1,size).(size-n-1),
    denaming(V,A,val.(len val-n)).
    (LocalOverlapSeq(A,loc,val,d1,size).(size-n-1)),
    loc/.(len val-n)) in dom(SC_Psuperpos_Seq(loc,val,p).n)
  proof
    let val be size-element FinSequence;
    set D = denaming(V,A,val.len val);
    set S = SC_Psuperpos_Seq(loc,val,p);
    set L = LocalOverlapSeq(A,loc,val,d1,size);
    deffunc F(Nat) = local_overlapping(V,A,L.(size-$1-1),
    denaming(V,A,val.(len val-$1)).(L.(size-$1-1)),loc/.(len val-$1));
    assume that
A1: loc,val,size are_correct_wrt d1 and
A2: d = LocalOverlapSeq(A,loc,val,d1,size).(size-1) and
A3: 2 <= n+1 and
A4: n+1 < size and
A5: local_overlapping(V,A,d,D.d,loc/.len val) in dom p;
A6: len val = size by CARD_1:def 7;
A7: len L = size by NOMIN_7:def 4;
A8: len S = len val by Def9;
    defpred P[Nat] means 2 <= $1+1 < size implies F($1) in dom(S.$1);
A9: P[0];
A10: for k being Nat st P[k] holds P[k+1]
    proof
      let k be Nat such that
A11:  P[k] and
      2 <= k+1+1 and
A12:  k+1+1 < size;
A13:  2 <= k+2 by NAT_1:11;
      then
A14:  2 < size by A12,XXREAL_0:2;
      per cases;
      suppose
A15:    k = 0;
        S.1 = SC_Psuperpos(p,D,loc/.len val) by Def9;
        then
A16:    dom(S.1) = {d where d is TypeSCNominativeData of V,A:
        local_overlapping(V,A,d,D.d,loc/.len val) in dom p & d in dom D}
        by NOMIN_2:def 11;
A17:    dom D = {d where d is NonatomicND of V,A: val.len val in dom d}
        by NOMIN_1:def 18;
        reconsider N = size-2 as Element of NAT by A13,A12,XXREAL_0:2,INT_1:5;
        2-2 < size-2 by A14,XREAL_1:14;
        then
A18:    0+1 <= N by NAT_1:13;
A19:    N < len L by A7,XREAL_1:44; then
A20:    L.(N+1) =
        local_overlapping(V,A,L.N,denaming(V,A,val.(N+1)).(L.N),loc/.(N+1))
        by A18,NOMIN_7:def 4;
A21:    1 <= len val by A6,A7,A18,A19,XXREAL_0:2;
A22:    1 <= N+1 by NAT_1:11;
A23:    N+1 <= size by XREAL_1:44,NAT_1:13;
        reconsider F1 = F(1) as NonatomicND of V,A
        by A6,A7,A20,A23,NAT_1:11,NOMIN_7:def 6;
        val.len val in dom(F1) by A1,A6,A21,A20,A22,A23,NOMIN_7:10;
        then F(1) in dom D by A17;
        hence F(k+1) in dom(S.(k+1)) by A15,A16,A5,A2,A6,A20;
      end;
      suppose
A24:    k > 0;
        then 0+1 <= k by NAT_1:13;
        then
A25:    1+1 <= k+1 by XREAL_1:7;
A26:    k+1 < size by A12,NAT_1:13;
        set D = denaming(V,A,val.(len val-k));
A27:    0+1 <= k by A24,NAT_1:13;
        k < k+2 by XREAL_1:29;
        then k < size by A12,XXREAL_0:2; then
        S.(k+1) = SC_Psuperpos(S.k,D,loc/.(len val-k)) by A6,A8,A27,Def9;
        then
A28:    dom(S.(k+1)) = {d where d is TypeSCNominativeData of V,A:
        local_overlapping(V,A,d,D.d,loc/.(len val-k)) in dom(S.k) &
        d in dom(D)} by NOMIN_2:def 11;
A29:    dom(D) = {d where d is NonatomicND of V,A: val.(len val-k) in dom d}
        by NOMIN_1:def 18;
A30:    size-(k+1) < size by XREAL_1:44;
A31:    k+1-k < size-k by A26,XREAL_1:9;
        then
A32:    1-1 < size-k-1 by XREAL_1:9;
        then
A33:    0+1 <= size-k-1 by INT_1:7;
        reconsider s = size-k-1 as Element of NAT by A32,INT_1:3;
        reconsider N = s-1 as Element of NAT by A33,INT_1:5;
        k+1+1-k < size-k by A12,XREAL_1:9;
        then 1+1-1 < size-k-1 by XREAL_1:9;
        then 1-1 < N by XREAL_1:9;
        then
A34:    0+1 <= N by INT_1:7;
        N < s by XREAL_1:44;
        then N < len L by A7,A30,XXREAL_0:2; then
A35:    L.s =
        local_overlapping(V,A,L.N,denaming(V,A,val.(N+1)).(L.N),loc/.(N+1))
        by A34,NOMIN_7:def 4;
        reconsider Fk1 = F(k+1) as NonatomicND of V,A
        by A6,A7,A35,A30,A33,NOMIN_7:def 6;
        reconsider M = size-k as Element of NAT by A31,INT_1:3;
        M <= size by XREAL_1:43;
        then val.(len val-k) in dom(Fk1) by A1,A6,A35,A30,A33,A31,NOMIN_7:10;
        then F(k+1) in dom(D) by A29;
        hence F(k+1) in dom(S.(k+1)) by A6,A11,A25,A28,A35,A12,NAT_1:13;
      end;
    end;
    for k being Nat holds P[k] from NAT_1:sch 2(A9,A10);
    hence thesis by A3,A4;
  end;
