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 Th11:
  V is non empty & A is_without_nonatomicND_wrt V &
  (for T holds loc/.1 is_a_value_on T & loc/.3 is_a_value_on T)
  implies
  PP_and(Equality(A,loc/.1,loc/.3),factorial_inv(A,loc,n0))
  ||=
  SC_Psuperpos(valid_factorial_output(A,z,n0),denaming(V,A,loc/.4),z)
  proof
    set i = loc/.1, j = loc/.2, n = loc/.3, s = loc/.4;
    set D = ND(V,A);
    set inv = factorial_inv(A,loc,n0);
    set Di = denaming(V,A,i);
    set Dn = denaming(V,A,n);
    set Ds = denaming(V,A,s);
    set Dz = denaming(V,A,z);
    set ass = SC_assignment(Ds,z);
    set out = valid_factorial_output(A,z,n0);
    set p = SC_Psuperpos(out,Ds,z);
    set E = Equality(A,i,n);
    assume that
A1: V is non empty & A is_without_nonatomicND_wrt V and
A2: for T holds i is_a_value_on T & n is_a_value_on T;
    let d be Element of D such that
A3: d in dom PP_and(E,inv) and
A4: (PP_and(E,inv)).d = TRUE;
A5: dom p = {d where d is TypeSCNominativeData of V,A:
      local_overlapping(V,A,d,Ds.d,z) in dom out & d in dom Ds}
      by NOMIN_2:def 11;
A6: dom out = {d where d is TypeSCNominativeData of V,A: d in dom Dz}
    by Def17;
A7: dom Ds = {d where d is NonatomicND of V,A: s in dom d} by NOMIN_1:def 18;
A8: dom Dz = {d where d is NonatomicND of V,A: z in dom d} by NOMIN_1:def 18;
A9: d in dom E by A3,A4,PARTPR_1:23;
A10: d in dom inv by A3,A4,PARTPR_1:23;
A11: dom E = dom Di /\ dom Dn by A2,NOMIN_4:11;
     then
A12: d in dom Di by A9,XBOOLE_0:def 4;
     inv.d = TRUE by A3,A4,PARTPR_1:23;
     then factorial_inv_pred A,loc,n0,d by A10,Def19;
     then consider d1 being NonatomicND of V,A such that
A13: d = d1 and
A14: {i,j,n,s} c= dom d1 and
     d1.j = 1 and
A15: d1.n = n0 and
A16: ex I,S being Nat st I = d1.i & S = d1.s & S = I!;
A17: i in {i,j,n,s} by ENUMSET1:def 2;
A18: n in {i,j,n,s} by ENUMSET1:def 2;
A19: s in {i,j,n,s} by ENUMSET1:def 2;
     reconsider dd = d as TypeSCNominativeData of V,A by NOMIN_1:39;
     set L = local_overlapping(V,A,dd,Ds.dd,z);
A20: dd in dom Ds by A7,A13,A14,A19;
     then Ds.d1 in D by A13,PARTFUN1:4;
     then
A21: ex d2 being TypeSCNominativeData of V,A st Ds.d1 = d2;
     then
A22: L in dom Dz by A1,A13,NOMIN_4:6;
     then
A23: L in dom out by A6;
     hence
A24: d in dom p by A5,A20;
     valid_factorial_output_pred A,z,n0,L
     proof
       consider I,S being Nat such that
A25:   I = d1.i and
A26:   S = d1.s and
A27:   S = I! by A16;
A28:   ex d being NonatomicND of V,A st L = d & z in dom d by A8,A22;
       then reconsider dlo = L as NonatomicND of V,A;
       take dlo;
       thus L = dlo;
       thus z in dom dlo by A28;
A29:   i is_a_value_on dd by A2;
A30:   n is_a_value_on dd by A2;
A31:   dom <:Di,Dn:> = dom Di /\ dom Dn by FUNCT_3:def 7;
       d in dom <:Di,Dn:> by A9,A11,FUNCT_3:def 7;
       then
A32:   E.d = (Equality(A)).(<:Di,Dn:>.d) by FUNCT_1:13;
A33:   d in dom Dn by A9,A11,XBOOLE_0:def 4;
A34:   <:Di,Dn:>.d = [Di.d,Dn.d] by A9,A11,A31,FUNCT_3:def 7;
A35:   Di.d = denaming(i,d1) by A13,A12,NOMIN_1:def 18
       .= d1.i by A14,A17,NOMIN_1:def 12;
A36:   Dn.d = denaming(n,d1) by A13,A33,NOMIN_1:def 18
       .= d1.n by A14,A18,NOMIN_1:def 12;
A37:   Ds.d = denaming(s,d1) by A20,A13,NOMIN_1:def 18
       .= d1.s by A14,A19,NOMIN_1:def 12;
       (Equality(A)).(Di.d,Dn.d) <> FALSE by A3,A4,A32,A34,PARTPR_1:23;
       then Di.d = Dn.d by A29,A30,NOMIN_4:def 9;
       hence dlo.z = n0! by A1,A13,A15,A21,A25,A26,A27,A35,A36,A37,NOMIN_2:10;
     end;
     hence TRUE = out.L by A23,Def17
     .= p.d by A24,NOMIN_2:35;
   end;
