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;
reserve n0 for Nat;

theorem Th17:
  V is non empty & A is complex-containing & A is_without_nonatomicND_wrt V &
  (for T holds loc/.1 is_a_value_on T & loc/.2 is_a_value_on T &
    loc/.4 is_a_value_on T & loc/.6 is_a_value_on T) &
  Seg 6 c= dom loc & loc|Seg 6 is one-to-one
  implies
  <* Fibonacci_inv(A,loc,n0),
     Fibonacci_loop_body(A,loc),
     Fibonacci_inv(A,loc,n0) *> is SFHT of ND(V,A)
  proof
    set i = loc/.1, j = loc/.2, n = loc/.3, s = loc/.4, b = loc/.5, c = loc/.6;
    assume that
A1: V is non empty and
A2: A is complex-containing and
A3: A is_without_nonatomicND_wrt V and
A4: for T holds loc/.1 is_a_value_on T & loc/.2 is_a_value_on T &
    loc/.4 is_a_value_on T & loc/.6 is_a_value_on T;
    assume that
A5: Seg 6 c= dom loc and
A6: loc|Seg 6 is one-to-one;
    set D = ND(V,A);
    set EN = {i,j,n,s,b,c};
    set inv = Fibonacci_inv(A,loc,n0);
    set B = Fibonacci_loop_body(A,loc);
    set Di = denaming(V,A,i);
    set Dj = denaming(V,A,j);
    set Dn = denaming(V,A,n);
    set Ds = denaming(V,A,s);
    set Db = denaming(V,A,b);
    set Dc = denaming(V,A,c);
    set Acs = addition(A,c,s);
    set Aij = addition(A,i,j);
    set AS1 = SC_assignment(Ds,c);
    set AS2 = SC_assignment(Db,s);
    set AS3 = SC_assignment(Acs,b);
    set AS4 = SC_assignment(Aij,i);
    now
      let d be TypeSCNominativeData of V,A such that
A7:   d in dom inv and
A8:   inv.d = TRUE and
A9:   d in dom B and
A10:   B.d in dom inv;
      Fibonacci_inv_pred A,loc,n0,d by A7,A8,Def19;
      then consider d1 being NonatomicND of V,A such that
A11:  d = d1 and
A12:  EN c= dom d1 and
A13:  d1.j = 1 and
A14:  d1.n = n0 and
A15:  ex I being Nat st I = d1.i & d1.s = Fib(I) & d1.b = Fib(I+1);
A16:  i in EN by ENUMSET1:def 4;
A17:  j in EN by ENUMSET1:def 4;
A18:  n in EN by ENUMSET1:def 4;
A19:  s in EN by ENUMSET1:def 4;
A20:  b in EN by ENUMSET1:def 4;
      consider I being Nat such that
A21:  I = d1.i and
A22:  d1.s = Fib(I) and
A23:  d1.b = Fib(I+1) by A15;
A24:  dom AS1 = dom Ds by NOMIN_2:def 7;
A25:  dom AS2 = dom Db by NOMIN_2:def 7;
      PP_composition(PP_composition(AS1,AS2),AS3) = PP_composition(AS2*AS1,AS3)
        by PARTPR_2:def 1
      .= AS3*(AS2*AS1) by PARTPR_2:def 1;
      then
A26:  B = AS4*(AS3*(AS2*AS1)) by PARTPR_2:def 1;
A27:  AS3*AS2*AS1 = AS3*(AS2*AS1) by RELAT_1:36;
A28:  B = AS4*(AS3*AS2*AS1) by A26,RELAT_1:36;
      then
A29:  d in dom(AS3*AS2*AS1) by A9,FUNCT_1:11;
      then
A30:  d in dom(AS2*AS1) by A27,FUNCT_1:11;
      then
A31:  (AS2*AS1).d = AS2.(AS1.d) by FUNCT_1:12;
A32:  dom Di = {d where d is NonatomicND of V,A: i in dom d}
      by NOMIN_1:def 18;
A33:  dom Dj = {d where d is NonatomicND of V,A: j in dom d}
      by NOMIN_1:def 18;
A34:  dom Ds = {d where d is NonatomicND of V,A: s in dom d}
      by NOMIN_1:def 18;
A35:  dom Dc = {d where d is NonatomicND of V,A: c in dom d}
      by NOMIN_1:def 18;
A36:  d in dom AS1 by A29,FUNCT_1:11;
      then reconsider Ad = Ds.d1 as TypeSCNominativeData of V,A
      by A24,A11,PARTFUN1:4,NOMIN_1:39;
      reconsider L1 = local_overlapping(V,A,d1,Ad,c) as NonatomicND of V,A
      by NOMIN_2:9;
A37:  AS1.d = L1 by A11,A36,NOMIN_2:def 7;
      then
A38:  L1 in dom AS2 by A30,FUNCT_1:11;
      reconsider DbL1 = Db.L1 as TypeSCNominativeData of V,A
      by A25,A38,PARTFUN1:4,NOMIN_1:39;
      reconsider L2 = local_overlapping(V,A,L1,DbL1,s) as NonatomicND of V,A
      by NOMIN_2:9;
A39:  AS2.L1 = L2 by A38,NOMIN_2:def 7;
A40:  dom L1 = {c} \/ dom d1 by A3,A1,NOMIN_4:4;
A41:  dom L2 = dom L1 \/ {s} by A3,A1,A25,A38,A39,NOMIN_4:5;
      c in {c} by TARSKI:def 1;
      then
A42:  c in dom L1 by A40,XBOOLE_0:def 3;
      then
A43:  c in dom L2 by A41,XBOOLE_0:def 3;
      then
A44:  L2 in dom Dc by A35;
A45:  dom(addition(A)) = [:A,A:] by A2,FUNCT_2:def 1;
      s in {s} by TARSKI:def 1;
      then
A46:  s in dom L2 by A41,XBOOLE_0:def 3;
      then L2 in dom Ds by A34;
      then L2 in dom Dc /\ dom Ds by A44,XBOOLE_0:def 4;
      then
A47:  L2 in dom <:Dc,Ds:> by FUNCT_3:def 7;
      then
A48:  <:Dc,Ds:>.L2 = [Dc.L2,Ds.L2] by FUNCT_3:def 7;
      c is_a_value_on L2 & s is_a_value_on L2 by A4;
      then [Dc.L2,Ds.L2] in [:A,A:] by ZFMISC_1:87;
      then
A49:  L2 in dom Acs by A47,A45,A48,FUNCT_1:11;
      then reconsider AcsL2 = Acs.L2 as TypeSCNominativeData of V,A
      by PARTFUN1:4,NOMIN_1:39;
      reconsider L3 = local_overlapping(V,A,L2,AcsL2,b) as NonatomicND of V,A
      by NOMIN_2:9;
A50:  dom L3 = {b} \/ dom L2 by A1,A3,NOMIN_4:4;
A51:  dom L2 = {s} \/ dom L1 by A1,A3,NOMIN_4:4;
A52:  i in dom L1 by A12,A16,A40,XBOOLE_0:def 3;
      then
A53:  i in dom L2 by A51,XBOOLE_0:def 3;
      then
A54:  i in dom L3 by A50,XBOOLE_0:def 3;
      then
A55:  L3 in dom Di by A32;
A56:  j in dom L1 by A12,A17,A40,XBOOLE_0:def 3;
      then
A57:  j in dom L2 by A51,XBOOLE_0:def 3;
      then
A58:  j in dom L3 by A50,XBOOLE_0:def 3;
      then
A59:  L3 in dom Dj by A33;
      L3 in dom Di /\ dom Dj by A55,A59,XBOOLE_0:def 4;
      then
A60:  L3 in dom <:Di,Dj:> by FUNCT_3:def 7;
      then
A61:  <:Di,Dj:>.L3 = [Di.L3,Dj.L3] by FUNCT_3:def 7;
      i is_a_value_on L3 & j is_a_value_on L3 by A4;
      then [Di.L3,Dj.L3] in [:A,A:] by ZFMISC_1:87;
      then
A62:  L3 in dom Aij by A45,A60,A61,FUNCT_1:11;
      then reconsider AijL3 = Aij.L3 as TypeSCNominativeData of V,A
      by PARTFUN1:4,NOMIN_1:39;
      reconsider L4 = local_overlapping(V,A,L3,AijL3,i) as NonatomicND of V,A
      by NOMIN_2:9;
A63:  dom L4 = {i} \/ dom L3 by A1,A3,NOMIN_4:4;
A64:  d in dom(AS3*(AS2*AS1)) by A9,A26,FUNCT_1:11;
      then L2 in dom AS3 by A31,A37,A39,FUNCT_1:11;
      then
A65:  AS3.L2 = L3 by NOMIN_2:def 7;
A66:  (AS3*(AS2*AS1)).d = AS3.((AS2*AS1).d) by A64,FUNCT_1:12;
      B = AS4*(AS3*AS2)*AS1 by A28,RELAT_1:36
      .= AS4*AS3*AS2*AS1 by RELAT_1:36;
      then AS1.d in dom(AS4*AS3*AS2) by A9,FUNCT_1:11;
      then AS2.L1 in dom(AS4*AS3) by A37,FUNCT_1:11;
      then AS3.L2 in dom AS4 by A39,FUNCT_1:11;
      then
A67:  L4 = AS4.L3 by A65,NOMIN_2:def 7
      .= B.d by A65,A39,A37,A31,A66,A9,A26,FUNCT_1:12;
      Fibonacci_inv_pred A,loc,n0,L4
      proof
        take L4;
        thus L4 = L4;
        i in {i} by TARSKI:def 1;
        then
A68:    i in dom L4 by A63,XBOOLE_0:def 3;
A69:    j in dom L4 by A58,A63,XBOOLE_0:def 3;
A70:    n in dom L1 by A12,A18,A40,XBOOLE_0:def 3;
        then
A71:    n in dom L2 by A51,XBOOLE_0:def 3;
        then
A72:    n in dom L3 by A50,XBOOLE_0:def 3;
        then
A73:    n in dom L4 by A63,XBOOLE_0:def 3;
A74:    s in dom L3 by A46,A50,XBOOLE_0:def 3;
        then
A75:    s in dom L4 by A63,XBOOLE_0:def 3;
A76:    b in dom L1 by A12,A20,A40,XBOOLE_0:def 3;
        then b in dom L2 by A51,XBOOLE_0:def 3;
        then
A77:    b in dom L3 by A50,XBOOLE_0:def 3;
        then
A78:    b in dom L4 by A63,XBOOLE_0:def 3;
        c in dom L3 by A43,A50,XBOOLE_0:def 3;
        then c in dom L4 by A63,XBOOLE_0:def 3;
        hence EN c= dom L4 by A68,A69,A73,A75,A78,ENUMSET1:def 4;
A79:    L3.j = L2.j by A1,A3,A6,A57,A5,Th1,NOMIN_5:3
        .= L1.j by A1,A3,A56,A5,A6,Th1,NOMIN_5:3
        .= 1 by A1,A3,A12,A13,A17,A5,A6,Th1,NOMIN_5:3;
        hence L4.j = 1 by A1,A3,A58,A5,A6,Th1,NOMIN_5:3;
        thus L4.n = L3.n by A1,A3,A72,A5,A6,Th1,NOMIN_5:3
        .= L2.n by A1,A3,A71,A5,A6,Th1,NOMIN_5:3
        .= L1.n by A1,A3,A70,A5,A6,Th1,NOMIN_5:3
        .= n0 by A1,A3,A12,A14,A18,A5,A6,Th1,NOMIN_5:3;
        take I1 = I+1;
A80:    L3.i = L2.i by A1,A3,A53,A5,A6,Th1,NOMIN_5:3
        .= L1.i by A1,A3,A52,A5,A6,Th1,NOMIN_5:3
        .= I by A1,A3,A12,A16,A21,A5,A6,Th1,NOMIN_5:3;
        thus L4.i = Aij.L3 by A1,NOMIN_2:10
        .= I1 by A2,A62,A54,A58,A79,A80,NOMIN_5:4;
A81:    L2.s = L1.b by A1,A76,Th2
        .= Fib(I1) by A1,A3,A23,A12,A20,A5,A6,Th1,NOMIN_5:3;
        thus L4.s = L3.s by A1,A3,A74,A5,A6,Th1,NOMIN_5:3
        .= Fib(I1) by A1,A3,A46,A81,A5,A6,Th1,NOMIN_5:3;
A82:    L2.c = L1.c by A1,A3,A42,A5,A6,Th1,NOMIN_5:3
        .= Fib(I) by A1,A12,A19,A22,Th2;
        thus L4.b = L3.b by A1,A3,A77,A5,A6,Th1,NOMIN_5:3
        .= Acs.L2 by A1,NOMIN_2:10
        .= Fib(I)+Fib(I1) by A2,A49,A46,A81,A43,A82,NOMIN_5:4
        .= Fib(I1+1) by PRE_FF:1;
      end;
      hence inv.(B.d) = TRUE by A10,A67,Def19;
    end;
    hence thesis by NOMIN_3:28;
  end;
