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 Th16:
  for val being 6-element FinSequence holds
  V is non empty & A is_without_nonatomicND_wrt V &
  Seg 6 c= dom loc & loc|Seg 6 is one-to-one & loc,val are_different_wrt 6
  implies
  <* valid_Fibonacci_input(V,A,val,n0),
     initial_assignments(A,loc,val,6),
     Fibonacci_inv(A,loc,n0) *> is SFHT of ND(V,A)
  proof
    let val be 6-element FinSequence;
    set size = 6;
    set G = initial_assignments_Seq(A,loc,val,size);
A1: G.1 = SC_assignment(denaming(V,A,val.1),loc/.1) by Def8;
    set i = loc/.1, j = loc/.2, n = loc/.3, s = loc/.4, b = loc/.5, c = loc/.6;
    set i1 = val.1, j1 = val.2, n1 = val.3, s1 = val.4, b1 = val.5, c1 = val.6;
    set EN = {i1,j1,n1,s1,b1,c1};
    set D = ND(V,A);
    set I = valid_Fibonacci_input(V,A,val,n0);
    set inv = Fibonacci_inv(A,loc,n0);
    set Di = denaming(V,A,i1);
    set Dj = denaming(V,A,j1);
    set Dn = denaming(V,A,n1);
    set Ds = denaming(V,A,s1);
    set Db = denaming(V,A,b1);
    set Dc = denaming(V,A,c1);
    set asi = SC_assignment(Di,i);
    set asj = SC_assignment(Dj,j);
    set asn = SC_assignment(Dn,n);
    set ass = SC_assignment(Ds,s);
    set asb = SC_assignment(Db,b);
    set asc = SC_assignment(Dc,c);
    set U1 = SC_Psuperpos(inv,Dc,c);
    set T1 = SC_Psuperpos(U1,Db,b);
    set S1 = SC_Psuperpos(T1,Ds,s);
    set R1 = SC_Psuperpos(S1,Dn,n);
    set Q1 = SC_Psuperpos(R1,Dj,j);
    set P1 = SC_Psuperpos(Q1,Di,i);
    assume that
A2: V is non empty and
A3: A is_without_nonatomicND_wrt V and
A4: Seg 6 c= dom loc and
A5: loc|Seg 6 is one-to-one and
A6: loc,val are_different_wrt 6;
A7: Seg 6 = dom val by FINSEQ_1:89;
A8: <*U1,asc,inv*> is SFHT of D by NOMIN_3:29;
A9: <*T1,asb,U1*> is SFHT of D by NOMIN_3:29;
A10: <*S1,ass,T1*> is SFHT of D by NOMIN_3:29;
A11: <*R1,asn,S1*> is SFHT of D by NOMIN_3:29;
A12: <*Q1,asj,R1*> is SFHT of D by NOMIN_3:29;
A13: <*P1,asi,Q1*> is SFHT of D by NOMIN_3:29;
    2 = 1+1; then
A14: G.2 = PP_composition(asi,asj) by A1,Def8;
    3 = 2+1; then
A15: G.3 = PP_composition(G.2,asn) by Def8;
    4 = 3+1; then
A16: G.4 = PP_composition(G.3,ass) by Def8;
    5 = 4+1; then
A17: G.5 = PP_composition(G.4,asb) by Def8;
    6 = 5+1;
    then
A18: initial_assignments(A,loc,val,6) =
    PP_composition(asi,asj,asn,ass,asb,asc) by A14,A15,A16,A17,Def8;
    I ||= P1
    proof
      let d be Element of D;
      assume d in dom I & I.d = TRUE;
      then valid_Fibonacci_input_pred V,A,val,n0,d by Def15;
      then consider d1 being NonatomicND of V,A such that
A19:  d = d1 and
A20:  EN c= dom d1 and
A21:  d1.i1 = 0 and
A22:  d1.j1 = 1 and
A23:  d1.n1 = n0 and
A24:  d1.s1 = 0 and
A25:  d1.b1 = 1 and
      d1.c1 = 0;
      set F = LocalOverlapSeq(A,loc,val,d1,size);
A26:  len F = size by Def4;
      rng val c= EN
      proof
        let y be object;
        assume y in rng val;
        then consider x being object such that
A27:    x in dom val and
A28:    y = val.x by FUNCT_1:def 3;
        x = 1 or ... or x = 6 by A7,A27,FINSEQ_1:91;
        hence thesis by A28,ENUMSET1:def 4;
      end;
      then rng val c= dom d1 by A20;
      then val is_valid_wrt d1;
      then
A29:  loc,val,size are_correct_wrt d1 by A2,A3,A7,A26,FINSEQ_1:def 3;
A30:  i1 in EN by ENUMSET1:def 4;
A31:  s1 in EN by ENUMSET1:def 4;
A32:  b1 in EN by ENUMSET1:def 4;
A33:  dom Di = {d where d is NonatomicND of V,A: i1 in dom d}
      by NOMIN_1:def 18;
A34:  dom Dj = {d where d is NonatomicND of V,A: j1 in dom d}
      by NOMIN_1:def 18;
A35:  dom Dn = {d where d is NonatomicND of V,A: n1 in dom d}
      by NOMIN_1:def 18;
A36:  dom Ds = {d where d is NonatomicND of V,A: s1 in dom d}
      by NOMIN_1:def 18;
A37:  dom Db = {d where d is NonatomicND of V,A: b1 in dom d}
      by NOMIN_1:def 18;
A38:  dom Dc = {d where d is NonatomicND of V,A: c1 in dom d}
      by NOMIN_1:def 18;
A39:  dom P1 = {d where d is TypeSCNominativeData of V,A:
      local_overlapping(V,A,d,Di.d,i) in dom Q1 & d in dom Di}
      by NOMIN_2:def 11;
A40:  dom Q1 = {d where d is TypeSCNominativeData of V,A:
      local_overlapping(V,A,d,Dj.d,j) in dom R1 & d in dom Dj}
      by NOMIN_2:def 11;
A41:  dom R1 = {d where d is TypeSCNominativeData of V,A:
      local_overlapping(V,A,d,Dn.d,n) in dom S1 & d in dom Dn}
      by NOMIN_2:def 11;
A42:  dom S1 = {d where d is TypeSCNominativeData of V,A:
      local_overlapping(V,A,d,Ds.d,s) in dom T1 & d in dom Ds}
      by NOMIN_2:def 11;
A43:  dom T1 = {d where d is TypeSCNominativeData of V,A:
      local_overlapping(V,A,d,Db.d,b) in dom U1 & d in dom Db}
      by NOMIN_2:def 11;
A44:  dom U1 = {d where d is TypeSCNominativeData of V,A:
      local_overlapping(V,A,d,Dc.d,c) in dom inv & d in dom Dc}
      by NOMIN_2:def 11;
A45:  d1 in dom Di by A20,A30,A33;
      then
A46:  Di.d1 is TypeSCNominativeData of V,A by PARTFUN1:4,NOMIN_1:39;
      reconsider Li = F.1 as NonatomicND of V,A by A26,Def6;
      reconsider Lj = F.2 as NonatomicND of V,A by A26,Def6;
      reconsider Ln = F.3 as NonatomicND of V,A by A26,Def6;
      reconsider Ls = F.4 as NonatomicND of V,A by A26,Def6;
      reconsider Lb = F.5 as NonatomicND of V,A by A26,Def6;
      reconsider Lc = F.6 as NonatomicND of V,A by A26,Def6;
A47:  F.1 = local_overlapping(V,A,d1,Di.d1,i) by Def4;
A48:  F.(1+1) = local_overlapping(V,A,Li,Dj.Li,j) by A26,Def4;
A49:  F.(2+1) = local_overlapping(V,A,Lj,Dn.Lj,n) by A26,Def4;
A50:  F.(3+1) = local_overlapping(V,A,Ln,Ds.Ln,s) by A26,Def4;
A51:  F.(4+1) = local_overlapping(V,A,Ls,Db.Ls,b) by A26,Def4;
A52:  F.(5+1) = local_overlapping(V,A,Lb,Dc.Lb,c) by A26,Def4;
      j1 in dom Li by A29,Th10;
      then
A53:  Li in dom Dj by A34;
      n1 in dom Lj by A29,Th10;
      then
A54:  Lj in dom Dn by A35;
A55:  s1 in dom Ln by A29,Th10;
      then
A56:  Ln in dom Ds by A36;
A57:  b1 in dom Ls by A29,Th10;
      then
A58:  Ls in dom Db by A37;
      dom inv = D by Def19;
      then
A59:  Lc in dom inv;
      c1 in dom Lb by A29,Th10;
      then Lb in dom Dc by A38;
      then
A60:  Lb in dom U1 by A44,A52,A59;
A61:  Ls in dom T1 by A43,A51,A60,A58;
      then
A62:  Ln in dom S1 by A42,A56,A50;
      then
A63:  Lj in dom R1 by A41,A54,A49;
      then
A64:  Li in dom Q1 by A40,A53,A48;
      hence
A65:  d in dom P1 by A19,A39,A45,A47;
A66:  Fibonacci_inv_pred A,loc,n0,Lc
      proof
        take Lc;
        thus Lc = Lc;
A67:    i in dom Lc by A29,Th9;
A68:    j in dom Lc by A29,Th9;
A69:    n in dom Lc by A29,Th9;
A70:    s in dom Lc by A29,Th9;
A71:    b in dom Lc by A29,Th9;
        c in dom Lc by A29,Th9;
        hence {i,j,n,s,b,c} c= dom Lc by A67,A68,A69,A70,A71,ENUMSET1:def 4;
A72:    i <> s1 by A6;
A73:    i <> b1 by A6;
        thus Lc.j = 1 by A4,A5,A6,A22,A29,Th13;
        thus Lc.n = n0 by A4,A5,A6,A23,A29,Th13;
A74:    Ln.s1 = Li.s1 by A6,A29,Th11
        .= 0 by A2,A3,A20,A24,A31,A46,A47,A72,NOMIN_5:3;
A75:    Ls.b1 = Li.b1 by A6,A29,Th11
        .= 1 by A2,A3,A20,A25,A32,A46,A47,A73,NOMIN_5:3;
        take 0;
        thus Lc.i = 0 by A4,A5,A6,A21,A29,Th13;
        thus Lc.s = Ls.s by A4,A5,A29,Th12
        .= Fib(0) by A2,A55,A50,A74,Th2,PRE_FF:1;
        thus Lc.b = Lb.b by A4,A5,A29,Th12
        .= Fib(0+1) by A2,A51,A57,A75,Th2,PRE_FF:1;
      end;
      thus P1.d = Q1.(F.1) by A19,A47,A65,NOMIN_2:35
      .= R1.(F.2) by A48,A64,NOMIN_2:35
      .= S1.(F.3) by A49,A63,NOMIN_2:35
      .= T1.(F.4) by A50,A62,NOMIN_2:35
      .= U1.(F.5) by A51,A61,NOMIN_2:35
      .= inv.(F.6) by A52,A60,NOMIN_2:35
      .= TRUE by A59,A66,Def19;
    end;
    then
A76: <*I,asi,Q1*> is SFHT of D by A13,NOMIN_3:15;
A77: <*PP_inversion(Q1),asj,R1*> is SFHT of D by NOMIN_4:16;
A78: <*PP_inversion(R1),asn,S1*> is SFHT of D by NOMIN_4:16;
A79: <*PP_inversion(S1),ass,T1*> is SFHT of D by NOMIN_4:16;
A80: <*PP_inversion(T1),asb,U1*> is SFHT of D by NOMIN_4:16;
     <*PP_inversion(U1),asc,inv*> is SFHT of D by NOMIN_4:16;
     hence thesis by A18,A8,A9,A10,A12,A11,A76,A77,A78,A79,A80,Th3;
   end;
