reserve x,y,z,x1,x2,x3,x4,y1,y2,s for Variable,
  M for non empty set,
  a,b for set,
  i,j,k for Element of NAT,
  m,m1,m2,m3,m4 for Element of M,
  H,H1,H2 for ZF-formula,
  v,v9,v1,v2 for Function of VAR,M;
reserve F,G for Function;

theorem
  F is_definable_in M & G is_definable_in M & Free H c= {x.3} implies
for FG be Function st dom FG = M & for v holds (M,v |= H implies FG.(v.x.3) = F
  .(v.x.3)) & (M,v |= 'not' H implies FG.(v.x.3) = G.(v.x.3)) holds FG
  is_definable_in M
proof
A1: {x.3,x.3,x.4} = {x.3,x.4} by ENUMSET1:30;
A2: {x.3} \/ {x.3,x.4} = {x.3,x.3,x.4} by ENUMSET1:2;
  given H1 such that
A3: Free H1 c= {x.3,x.4} and
A4: M |= All(x.3,Ex(x.0,All(x.4,H1 <=> x.4 '=' x.0))) and
A5: F = def_func(H1,M);
  given H2 such that
A6: Free H2 c= {x.3,x.4} and
A7: M |= All(x.3,Ex(x.0,All(x.4,H2 <=> x.4 '=' x.0))) and
A8: G = def_func(H2,M);
  assume
A9: Free H c= {x.3};
  then
A10: not x.4 in Free H by Lm3,TARSKI:def 1;
  let FG be Function such that
A11: dom FG = M and
A12: for v holds (M,v |= H implies FG.(v.x.3) = F.(v.x.3)) & (M,v |=
  'not' H implies FG.(v.x.3) = G.(v.x.3));
  rng FG c= M
  proof
    set v = the Function of VAR,M;
    let a be object;
    assume a in rng FG;
    then consider b being object such that
A13: b in M and
A14: a = FG.b by A11,FUNCT_1:def 3;
    reconsider b as Element of M by A13;
A15: M,v/(x.3,b) |= H or M,v/(x.3,b) |= 'not' H by ZF_MODEL:14;
    v/(x.3,b).(x.3) = b by FUNCT_7:128;
    then FG.b = def_func(H1,M).b or FG.b = def_func(H2,M).b by A5,A8,A12,A15;
    hence thesis by A14;
  end;
  then reconsider f = FG as Function of M,M by A11,FUNCT_2:def 1,RELSET_1:4;
  take I = H '&' H1 'or' 'not' H '&' H2;
A16: Free ('not' H) = Free H by ZF_LANG1:60;
  Free (H '&' H1) = Free H \/ Free H1 by ZF_LANG1:61;
  then
A17: Free (H '&' H1) c= {x.3,x.4} by A3,A9,A2,A1,XBOOLE_1:13;
A18: not x.0 in Free H2 by A6,Lm1,Lm2,TARSKI:def 2;
A19: not x.0 in Free H1 by A3,Lm1,Lm2,TARSKI:def 2;
  Free ('not' H '&' H2) = Free ('not' H) \/ Free H2 by ZF_LANG1:61;
  then
A20: Free ('not' H '&' H2) c= {x.3,x.4} by A6,A9,A16,A2,A1,XBOOLE_1:13;
A21: Free I = Free (H '&' H1) \/ Free ('not' H '&' H2) by ZF_LANG1:63;
  hence Free I c= {x.3,x.4} by A17,A20,XBOOLE_1:8;
  then
A22: not x.0 in Free I by Lm1,Lm2,TARSKI:def 2;
A23: now
    let v;
    now
      let m3;
      M,v |= All(x.3,Ex(x.0,All(x.4,H1 <=> x.4 '=' x.0))) by A4;
      then consider m1 such that
A24:  M,v/(x.3,m3)/(x.4,m4) |= H1 iff m4 = m1 by A19,Th19;
      M,v |= All(x.3,Ex(x.0,All(x.4,H2 <=> x.4 '=' x.0))) by A7;
      then consider m2 such that
A25:  M,v/(x.3,m3)/(x.4,m4) |= H2 iff m4 = m2 by A18,Th19;
      not M,v/(x.3,m3) |= 'not' H & M,v/(x.3,m3) |= H or M,v/(x.3,m3) |=
      'not' H & not M,v/(x.3,m3) |= H by ZF_MODEL:14;
      then consider m such that
A26:  not M,v/(x.3,m3) |= 'not' H & M,v/(x.3,m3) |= H & m = m1 or M,v
      /(x.3,m3) |= 'not' H & m = m2 & not M,v/(x.3,m3) |= H;
      take m;
      let m4;
      thus M,v/(x.3,m3)/(x.4,m4) |= I implies m4 = m
      proof
        assume M,v/(x.3,m3)/(x.4,m4) |= I;
        then M,v/(x.3,m3)/(x.4,m4) |= H '&' H1 or M,v/(x.3,m3)/(x.4,m4) |=
        'not' H '&' H2 by ZF_MODEL:17;
        then
        M,v/(x.3,m3)/(x.4,m4) |= H & M,v/(x.3,m3)/(x.4,m4) |= H1 or M,v/(
x.3,m3)/(x.4,m4) |= 'not' H & M,v/(x.3,m3)/(x.4,m4) |= H2 by ZF_MODEL:15;
        hence thesis by A10,A16,A24,A25,A26,Th9;
      end;
      assume m4 = m;
      then
      M,v/(x.3,m3)/(x.4,m4) |= H & M,v/(x.3,m3)/(x.4,m4) |= H1 or M,v/(x.
3,m3)/(x.4,m4) |= 'not' H & M,v/(x.3,m3)/(x.4,m4) |= H2 by A10,A16,A24,A25,A26
,Th9;
      then
      M,v/(x.3,m3)/(x.4,m4) |= H '&' H1 or M,v/(x.3,m3)/(x.4,m4) |= 'not'
      H '&' H2 by ZF_MODEL:15;
      hence M,v/(x.3,m3)/(x.4,m4) |= I by ZF_MODEL:17;
    end;
    hence M,v |= All(x.3,Ex(x.0,All(x.4,I <=> x.4 '=' x.0))) by A22,Th19;
  end;
  hence
A27: M |= All(x.3,Ex(x.0,All(x.4,I <=> x.4 '=' x.0)));
  now
    set v = the Function of VAR,M;
    let a be Element of M;
    set m4 = def_func(I,M).a;
A28: M,v |= All(x.3,Ex(x.0,All(x.4,I <=> x.4 '=' x.0))) by A23;
    def_func(I,M) = def_func'(I,v) by A21,A17,A20,A27,Th11,XBOOLE_1:8;
    then M,v/(x.3,a)/(x.4,m4) |= I by A22,A28,Th10;
    then M,v/(x.3,a)/(x.4,m4) |= H '&' H1 or M,v/(x.3,a)/(x.4,m4) |= 'not' H
    '&' H2 by ZF_MODEL:17;
    then M,v/(x.3,a)/(x.4,m4) |= H & M,v/(x.3,a)/(x.4,m4) |= H1 & M,v |= All(
x.3,Ex(x.0,All(x.4,H1 <=> x.4 '=' x.0))) & def_func(H1,M) = def_func'(H1,v) or
M,v/(x.3,a)/(x.4,m4) |= 'not' H & M,v/(x.3,a)/(x.4,m4) |= H2 & M,v |= All(x.3,
Ex(x.0,All(x.4,H2 <=> x.4 '=' x.0))) & def_func(H2,M) = def_func'(H2,v) by A3
,A4,A6,A7,Th11,ZF_MODEL:15;
    then
A29: M,v/(x.3,a) |= H & m4 = F.a or M,v/(x.3,a) |= 'not' H & m4 = G.a by A5,A8
,A10,A16,A19,A18,Th9,Th10;
    v/(x.3,a).(x.3) = a by FUNCT_7:128;
    hence f.a = def_func(I,M).a by A12,A29;
  end;
  hence thesis by FUNCT_2:63;
end;
