reserve v for object;
reserve V,A for set;
reserve f for SCBinominativeFunction of V,A;
reserve d for TypeSCNominativeData of V,A;
reserve d1 for NonatomicND of V,A;
reserve a,b,c,z for Element of V;
reserve x,y for object;
reserve p,q,r,s for SCPartialNominativePredicate of V,A;
reserve x0,y0 for Nat;

theorem Th17:
  V is non empty & A is_without_nonatomicND_wrt V & a <> b &
  A is complex-containing &
  (for d holds a is_complex_on d) & (for d holds b is_complex_on d)
  implies
  <* PP_and(less(A,b,a),gcd_inv(V,A,a,b,x0,y0)),
     SC_assignment(subtraction(A,a,b),a),
     gcd_inv(V,A,a,b,x0,y0) *> is SFHT of ND(V,A)
  proof
    assume that
A1: V is non empty and
A2: A is_without_nonatomicND_wrt V and
A3: a <> b and
A4: A is complex-containing and
A5: for d holds a is_complex_on d and
A6: for d holds b is_complex_on d;
    set i = gcd_inv(V,A,a,b,x0,y0);
    set l = less(A,b,a);
    set D = subtraction(A,a,b);
    set Da = denaming(V,A,a);
    set Db = denaming(V,A,b);
    set f = SC_assignment(D,a);
    set p = PP_and(l,i);
    set S = SC_Psuperpos(i,D,a);
A7: <*S,f,i*> is SFHT of ND(V,A) by NOMIN_3:29;
    for d holds d in dom p & p.d = TRUE & d in dom f & f.d in dom i implies
     i.(f.d) = TRUE
    proof
      let d such that
A8:   d in dom p and
A9:   p.d = TRUE and
A10:  d in dom f and
A11:  f.d in dom i;
A12:  dom f = dom D by NOMIN_2:def 7;
A13:  dom S = {d where d is TypeSCNominativeData of V,A:
       local_overlapping(V,A,d,D.d,a) in dom i & d in dom D} by NOMIN_2:def 11;
A14:  dom Da = {d where d is NonatomicND of V,A: a in dom d} by NOMIN_1:def 18;
A15:  dom Db = {d where d is NonatomicND of V,A: b in dom d} by NOMIN_1:def 18;
A16:  d in dom l by A8,A9,PARTPR_1:23;
A17:  dom(less(A)*<:Db,Da:>) c= dom <:Db,Da:> by RELAT_1:25;
A18:  dom <:Db,Da:> = dom Db /\ dom Da by FUNCT_3:def 7;
      then
A19:  d in dom Da by A16,A17,XBOOLE_0:def 4;
      then consider da being NonatomicND of V,A such that
A20:  d = da and
A21:  a in dom da by A14;
A22:  d in dom Db by A16,A17,A18,XBOOLE_0:def 4;
      then consider db being NonatomicND of V,A such that
A23:  d = db and
A24:  b in dom db by A15;
      reconsider L = local_overlapping(V,A,da,D.da,a) as Function;
      dom i = ND(V,A) by Def28;
      then
A25:  L in dom i;
A26:  rng D c= rng subtraction(A) by RELAT_1:26;
A27:  rng D c= A by A26,XBOOLE_1:1;
      reconsider L as NonatomicND of V,A by NOMIN_2:9;
A28:  gcd_inv_pred V,A,a,b,x0,y0,L
      proof
        take L;
        thus L = L;
        d in dom i & i.d = TRUE by A8,A9,PARTPR_1:23;
        then gcd_inv_pred V,A,a,b,x0,y0,d by Def28;
        then consider d1 being NonatomicND of V,A such that
A29:    d = d1 and
        a in dom d1 and
        b in dom d1 and
A30:    ex x,y being Nat st x = d1.a & y = d1.b & x gcd y = x0 gcd y0;
        consider x,y being Nat such that
A31:    x = d1.a and
A32:    y = d1.b and
A33:    x gcd y = x0 gcd y0 by A30;
        D.d in rng D by A10,A12,FUNCT_1:def 3;
        then reconsider Dd = D.d as TypeSCNominativeData of V,A
        by A27,NOMIN_1:def 6;
A34:    L.a = Dd by A1,A20,NOMIN_2:10;
A35:    <:Db,Da:>.d = [Db.d,Da.d] by A16,A17,FUNCT_3:def 7;
A36:    Da.d = denaming(a,da) & Db.d = denaming(b,db)
        by A20,A23,A19,A22,NOMIN_1:def 18;
        a is_complex_on d & b is_complex_on d by A5,A6;
        then consider x1,y1 being Complex such that
A37:    x1 = denaming(a,da) and
A38:    y1 = denaming(b,db) and
A39:    subtraction(denaming(a,da),denaming(b,db)) = x1 - y1 by A36,Def14;
A40:    x1 = x by A20,A21,A29,A31,A37,NOMIN_1:def 12;
A41:    y1 = y by A23,A24,A29,A32,A38,NOMIN_1:def 12;
A42:    not da in A by A2,Th3;
A43:    not naming(V,A,a,D.da) in A by A2,Th3;
        Dd = D.d;
        then
A44:    L.b = da.b by A1,A3,A20,A23,A24,A42,A43,NOMIN_2:12;
A45:    denaming(a,da) in COMPLEX by A37,XCMPLX_0:def 2;
A46:    denaming(b,db) in COMPLEX by A38,XCMPLX_0:def 2;
A47:    dom local_overlapping(V,A,da,Dd,a) = dom da
        by A1,A20,A21,A42,A43,NOMIN_2:14;
        hence a in dom L by A20,A21;
        thus b in dom L by A20,A23,A24,A47;
A48:    l.d = TRUE by A8,A9,PARTPR_1:23;
        d in dom l by A8,A9,PARTPR_1:23;
        then l.d = (less(A)).(Db.d,Da.d) by A35,FUNCT_1:12;
        then Db.d less_pred Da.d by A4,A36,A45,A46,A48,Def12;
        then x-y in NAT by A36,A37,A38,A40,A41,INT_1:5;
        then reconsider z = x-y as Nat;
        take z,y;
        dom <:Da,Db:> = dom Da /\ dom Db by FUNCT_3:def 7;
        then
A49:    d in dom <:Da,Db:> by A19,A22,XBOOLE_0:def 4;
        then <:Da,Db:>.d = [Da.d,Db.d] by FUNCT_3:def 7;
        then D.d = (subtraction(A)).(denaming(a,da),denaming(b,db))
        by A36,A49,FUNCT_1:13
        .= subtraction(denaming(a,da),denaming(b,db)) by A4,A45,A46,Def15;
        hence z = L.a by A20,A21,A29,A31,A34,A37,A39,A41,NOMIN_1:def 12;
        thus y = L.b by A20,A23,A24,A38,A41,A44,NOMIN_1:def 12;
        (x-1*y) gcd y = x gcd y by NEWTON02:5;
        hence thesis by A33;
      end;
A50:  d in dom S by A10,A12,A13,A20,A25;
      then S.d = i.L by A20,NOMIN_2:35
      .= TRUE by A25,A28,Def28;
      hence i.(f.d) = TRUE by A7,A10,A11,A50,NOMIN_3:11;
    end;
    hence thesis by NOMIN_3:28;
  end;
