reserve D for non empty set;
reserve f1,f2,f3,f4 for BinominativeFunction of D;
reserve p,q,r,t,w for PartialPredicate of D;
reserve d,v,v1 for object;
reserve V,A for set;
reserve z for Element of V;
reserve d1 for NonatomicND of V,A;
reserve f for SCBinominativeFunction of V,A;
reserve T for TypeSCNominativeData of V,A;
reserve loc for V-valued Function;
reserve val for Function;
reserve n0 for Nat;

theorem Th7:
  V is non empty & A is complex-containing & A is_without_nonatomicND_wrt V &
  loc/.1, loc/.2, loc/.3, loc/.4 are_mutually_distinct
  implies
  <* factorial_inv(A,loc,n0),
     factorial_loop_body(A,loc),
     factorial_inv(A,loc,n0) *> is SFHT of ND(V,A)
  proof
    set i = loc/.1, j = loc/.2, n = loc/.3, s = loc/.4;
    assume that
A1: V is non empty and
A2: A is complex-containing and
A3: A is_without_nonatomicND_wrt V and
A4: i,j,n,s are_mutually_distinct;
    set D = ND(V,A);
    set inv = factorial_inv(A,loc,n0);
    set B = factorial_loop_body(A,loc);
    set add = addition(A,i,j);
    set mlt = multiplication(A,s,i);
    set f = SC_assignment(add,i);
    set g = SC_assignment(mlt,s);
    set Di = denaming(V,A,i);
    set Dj = denaming(V,A,j);
    set Dn = denaming(V,A,n);
    set Ds = denaming(V,A,s);
    now
      let d be TypeSCNominativeData of V,A such that
A5:   d in dom inv and
A6:   inv.d = TRUE and
A7:   d in dom B and
A8:   B.d in dom inv;
      factorial_inv_pred A,loc,n0,d by A5,A6,Def19;
      then consider d1 being NonatomicND of V,A such that
A9:   d = d1 and
A10:  {i,j,n,s} c= dom d1 and
A11:  d1.j = 1 and
A12:  d1.n = n0 and
A13:  ex I,S being Nat st I = d1.i & S = d1.s & S = I!;
A14:  i in {i,j,n,s} by ENUMSET1:def 2;
A15:  j in {i,j,n,s} by ENUMSET1:def 2;
A16:  n in {i,j,n,s} by ENUMSET1:def 2;
A17:  s in {i,j,n,s} by ENUMSET1:def 2;
      consider I,S being Nat such that
A18:  I = d1.i and
A19:  S = d1.s and
A20:  S = I! by A13;
A21:  dom f = dom add by NOMIN_2:def 7;
A22:  dom g = dom mlt by NOMIN_2:def 7;
A23:  PP_composition(f,g) = g*f by PARTPR_2:def 1;
      then
A24:  d in dom f by A7,FUNCT_1:11;
      then reconsider Ad = add.d1 as TypeSCNominativeData of V,A
      by A21,A9,PARTFUN1:4,NOMIN_1:39;
      reconsider La = local_overlapping(V,A,d1,Ad,i)
      as NonatomicND of V,A by NOMIN_2:9;
      reconsider Lm = local_overlapping(V,A,La,mlt.La,s)
      as NonatomicND of V,A by NOMIN_2:9;
      B = g*f by PARTPR_2:def 1;
      then
A25:  B.d = g.(f.d) by A7,FUNCT_1:12;
A26:  f.d = La by A9,A24,NOMIN_2:def 7;
      then
A27:  La in dom g by A7,A23,FUNCT_1:11;
A28:  g.La = Lm by A27,NOMIN_2:def 7;
      factorial_inv_pred A,loc,n0,Lm
      proof
        take Lm;
        thus Lm = Lm;
A29:    mlt.La is TypeSCNominativeData of V,A by A22,A27,PARTFUN1:4,NOMIN_1:39;
A30:    dom Lm = dom La \/ {s} by A3,A1,A22,A27,A28,NOMIN_4:5;
A31:    dom La = {i} \/ dom d1 by A3,A1,NOMIN_4:4;
        i in {i} by TARSKI:def 1;
        then
A32:    i in dom La by A31,XBOOLE_0:def 3;
        then
A33:    i in dom Lm by A30,XBOOLE_0:def 3;
A34:    j in dom La by A10,A15,A31,XBOOLE_0:def 3;
        then
A35:    j in dom Lm by A30,XBOOLE_0:def 3;
A36:    n in dom La by A10,A16,A31,XBOOLE_0:def 3;
        then
A37:    n in dom Lm by A30,XBOOLE_0:def 3;
        s in {s} by TARSKI:def 1;
        then s in dom Lm by A30,XBOOLE_0:def 3;
        hence {i,j,n,s} c= dom Lm by A33,A35,A37,ENUMSET1:def 2;
        thus Lm.j = La.j by A1,A3,A4,A29,A34,Th3
        .= 1 by A3,A1,A10,A15,A11,A4,Th3;
        thus Lm.n = La.n by A4,A1,A29,A36,A3,Th3
        .= n0 by A3,A1,A4,A10,A16,A12,Th3;
        take I1 = I+1, S1 = S*(I+1);
A38:    La.i = Ad by A1,NOMIN_2:10
        .= I1 by A14,A2,A18,A10,A11,A15,A9,A24,A21,Th4;
        hence Lm.i = I1 by A1,A29,A3,A4,A32,Th3;
A39:    s in dom La by A10,A17,A31,XBOOLE_0:def 3;
A40:    La.s = d1.s by A3,A1,A10,A4,A17,Th3;
        thus Lm.s = mlt.La by A1,A29,NOMIN_2:10
        .= S1 by A32,A2,A19,A39,A22,A27,A38,A40,Th5;
        thus S1 = I1! by A20,NEWTON:15;
      end;
      hence inv.(B.d) = TRUE by A8,A25,A26,A28,Def19;
    end;
    hence thesis by NOMIN_3:28;
  end;
