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 Th16:
  V is non empty & A is_without_nonatomicND_wrt V &
  a <> b & a <> y implies
  <* valid_gcd_input(V,A,x,y,x0,y0), gcd_var_init(V,A,a,b,x,y),
     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 <> y;
  set Dx = denaming(V,A,x);
  set Dy = denaming(V,A,y);
  set p = gcd_inv(V,A,a,b,x0,y0);
  set Q = SC_Psuperpos(p,Dy,b);
  set P = SC_Psuperpos(Q,Dx,a);
  set F = SC_assignment(Dx,a);
  set G = SC_assignment(Dy,b);
  set H = gcd_var_init(V,A,a,b,x,y);
  set I = valid_gcd_input(V,A,x,y,x0,y0);
A5: <*P,F,Q*> is SFHT of ND(V,A) by NOMIN_3:29;
A6: <*Q,G,p*> is SFHT of ND(V,A) by NOMIN_3:29;
A7: dom Q = {d where d is TypeSCNominativeData of V,A:
     local_overlapping(V,A,d,Dy.d,b) in dom p & d in dom Dy} by NOMIN_2:def 11;
A8: dom Dy = {d where d is NonatomicND of V,A: y in dom d} by NOMIN_1:def 18;
A9: dom p = ND(V,A) by Def28;
  <*PP_inversion(Q),G,p*> is SFHT of ND(V,A) by Th15;
  then
A10: <*P,H,p*> is SFHT of ND(V,A) by A5,A6,NOMIN_3:25;
  I ||= P
  proof
    let d be Element of ND(V,A) such that
A11: d in dom I and
A12: I.d = TRUE;
A13: valid_gcd_input_pred V,A,x,y,x0,y0,d by A11,A12,Def24;
    then reconsider d as NonatomicND of V,A;
A14: dom Dx = {d where d is NonatomicND of V,A: x in dom d} by NOMIN_1:def 18;
A15: dom P = {d where d is TypeSCNominativeData of V,A:
     local_overlapping(V,A,d,Dx.d,a) in dom Q & d in dom Dx} by NOMIN_2:def 11;
    reconsider Lx = local_overlapping(V,A,d,Dx.d,a) as NonatomicND of V,A
    by NOMIN_2:9;
    reconsider Ly = local_overlapping(V,A,Lx,Dy.Lx,b) as NonatomicND of V,A
    by NOMIN_2:9;
A16: Ly in dom p by A9;
    reconsider GO = global_overlapping(V,A,Lx,naming(V,A,b,Dy.Lx)) as Function;
    set d1 = naming(V,A,a,Dx.d);
    set d2 = b.-->Dy.Lx;
A17: not Lx in A by A2,Th3;
A18: not d in A by A2,Th3;
A19: not d1 in A by A2,Th3;
A20: Lx = d1 \/ (d|(dom(d)\dom(d1))) by A18,A19,NOMIN_1:64;
    then d1 c= Lx by XBOOLE_1:7;
    then
A21: dom d1 c= dom Lx by GRFUNC_1:2;
A22: d in dom Dx by A13,A14;
    then
A23: Dx.d is TypeSCNominativeData of V,A by PARTFUN1:4,NOMIN_1:39;
    then
A24: d1 = a.-->Dx.d by A1,NOMIN_1:def 13;
    not y in dom d1 by A4,A24,TARSKI:def 1;
    then y in dom(d)\dom(d1) by A13,XBOOLE_0:def 5;
    then
A25: y in dom(d|(dom(d)\dom(d1))) by RELAT_1:57;
    d|(dom(d)\dom(d1)) c= Lx by A20,XBOOLE_1:7;
    then
A26: dom(d|(dom(d)\dom(d1))) c= dom Lx by GRFUNC_1:2;
    then
A27: Lx in dom Dy by A8,A25;
A28: Dy.Lx is TypeSCNominativeData of V,A by A27,PARTFUN1:4,NOMIN_1:39;
    then
A29: naming(V,A,b,Dy.Lx) = d2 by A1,NOMIN_1:def 13;
    then
A30: not d2 in A by A2,Th3;
    then
A31: Ly = d2 \/ (Lx|(dom(Lx)\dom(d2))) by A29,A17,NOMIN_1:64;
    then d2 c= Ly by XBOOLE_1:7;
    then
A32: dom d2 c= dom Ly by GRFUNC_1:2;
A34: not a in dom d2 by A3,TARSKI:def 1;
    a in {a} by TARSKI:def 1;
    then
A35: a in dom(Lx)\dom(d2) by A21,A24,A34,XBOOLE_0:def 5;
    reconsider G1 = global_overlapping(V,A,Lx,d2) as Function by A29;
A36: G1 = d2 \/ (Lx|(dom(Lx)\dom(d2))) by A29,A17,A30,NOMIN_1:64;
A37: a in dom(Lx|(dom(Lx)\dom(d2))) by A35,RELAT_1:57;
    Lx|(dom(Lx)\dom(d2)) c= Ly by A31,XBOOLE_1:7;
    then
A38: dom(Lx|(dom(Lx)\dom(d2))) c= dom Ly by GRFUNC_1:2;
A39: b in {b} by TARSKI:def 1;
A41: Ly.a = G1.a by A28,A1,NOMIN_1:def 13
    .= (Lx|(dom(Lx)\dom(d2))).a by A36,A37,GRFUNC_1:15
    .= Lx.a by A37,FUNCT_1:47
    .= Dx.d by A1,A23,NOMIN_2:10
    .= denaming(x,d) by A22,NOMIN_1:def 18
    .= x0 by A13,NOMIN_1:def 12;
    Ly.b = Dy.Lx by A1,A28,NOMIN_2:10
    .= denaming(y,Lx) by A27,NOMIN_1:def 18
    .= Lx.y by A26,A25,NOMIN_1:def 12
    .= y0 by A13,A19,A23,A1,A4,A18,NOMIN_2:12;
    then
A42: gcd_inv_pred V,A,a,b,x0,y0,Ly by A38,A37,A39,A32,A41;
A43: Lx in dom Q by A7,A16,A27;
    then d in dom P by A15,A22;
    then P.d = Q.Lx by NOMIN_2:35
    .= p.Ly by A43,NOMIN_2:35
    .= TRUE by A16,A42,Def28;
    hence thesis by A15,A43,A22;
  end;
  hence thesis by A10,NOMIN_3:15;
end;
