reserve x,y,P,Q for Integer;
reserve a,b,n for Nat;
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 for object;
reserve z for Element of V;
reserve T for TypeSCNominativeData of V,A;
reserve size for non zero Nat;
reserve x0, y0, p0, q0 for Integer;
reserve n0 for Nat;

theorem Th19:
  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),Lucas_inv(A,loc,x0,y0,p0,q0,n0))
  ||=
  SC_Psuperpos(valid_Lucas_output(A,z,x0,y0,p0,q0,n0),denaming(V,A,loc/.4),z)
  proof
    set i = loc/.1, j = loc/.2, n = loc/.3, s = loc/.4, b = loc/.5, c = loc/.6;
    set p = loc/.7, q = loc/.8, ps = loc/.9, qc = loc/.10;
    set D = ND(V,A);
    set res = Lucas(x0,y0,p0,q0,n0);
    set inv = Lucas_inv(A,loc,x0,y0,p0,q0,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_Lucas_output(A,z,x0,y0,p0,q0,n0);
    set F = SC_Psuperpos(out,Ds,z);
    set E = Equality(A,i,n);
    set EM = {i,j,n,s,b,c,p,q,ps,qc};
    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 F = {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 NOMIN_8:def 13;
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 Lucas_inv_pred A,loc,x0,y0,p0,q0,n0,d by A10,Def15;
     then consider d1 being NonatomicND of V,A such that
A13: d = d1 and
A14: EM c= dom d1 and
     d1.j = 1 and
A15: d1.n = n0 and
     d1.p = p0 and
     d1.q = q0 and
A16: ex I being Nat st I = d1.i & d1.s = Lucas(x0,y0,p0,q0,I) &
     d1.b = Lucas(x0,y0,p0,q0,I+1);
A17: i in EM by ENUMSET1:def 8;
A18: n in EM by ENUMSET1:def 8;
A19: s in EM by ENUMSET1:def 8;
     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 F by A5,A20;
     valid_Lucas_output_pred A,z,x0,y0,p0,q0,n0,L
     proof
       consider I being Nat such that
A25:   I = d1.i and
A26:   d1.s = Lucas(x0,y0,p0,q0,I) and
       d1.b = Lucas(x0,y0,p0,q0,I+1) by A16;
A27:   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;
       rng <*z*> = {z} by FINSEQ_1:38;
       hence rng <*z*> c= dom dlo by A27,ZFMISC_1:31;
       let nn be Nat such that
A28:   1 <= nn and
A29:   nn <= len <*z*>;
       len <*z*> = 1 by FINSEQ_1:39;
       then
A30:   nn = 1 by A28,A29,XXREAL_0:1;
A31:   i is_a_value_on dd by A2;
A32:   n is_a_value_on dd by A2;
A33:   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
A34:   E.d = (Equality(A)).(<:Di,Dn:>.d) by FUNCT_1:13;
A35:   d in dom Dn by A9,A11,XBOOLE_0:def 4;
A36:   <:Di,Dn:>.d = [Di.d,Dn.d] by A9,A11,A33,FUNCT_3:def 7;
A37:   Di.d = denaming(i,d1) by A13,A12,NOMIN_1:def 18
       .= d1.i by A14,A17,NOMIN_1:def 12;
A38:   Dn.d = denaming(n,d1) by A13,A35,NOMIN_1:def 18
       .= d1.n by A14,A18,NOMIN_1:def 12;
A39:   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,A34,A36,PARTPR_1:23;
       then Di.d = Dn.d by A31,A32,NOMIN_4:def 9;
       hence thesis by A1,A13,A15,A30,A21,A25,A26,A37,A38,A39,NOMIN_2:10;
     end;
     hence TRUE = out.L by A23,NOMIN_8:def 13
     .= F.d by A24,NOMIN_2:35;
   end;
