
theorem
  for R being non empty RelStr, V being non trivial set st for H being
Function of [:the carrier of R, PFuncs(the carrier of R, V):], V, F1, F2 being
  Function of the carrier of R, V st F1 is_recursively_expressed_by H & F2
  is_recursively_expressed_by H holds F1 = F2 holds R is well_founded
proof
  let R be non empty RelStr, V be non trivial set;
  set c = the carrier of R, r = the InternalRel of R, PF = PFuncs(c, V), wfp =
  well_founded-Part R;
  consider a0, a1 being object such that
A1: a0 in V and
A2: a1 in V and
A3: a0 <> a1 by ZFMISC_1:def 10;
  set F3 = c --> a1, F4 = wfp --> a0, F2 = F3 +* F4;
  defpred P[set,Function,set] means (ex x being set st x in dom $2 & $2.x = a1
  ) iff $3 = a1;
  reconsider a0,a1 as set by TARSKI:1;
  set a01 = {a0, a1};
A5: now
    reconsider u = a1, v = a0 as Element of a01 by TARSKI:def 2;
    let x be Element of c, y be Element of PF;
    per cases;
    suppose
A6:   ex x being set st x in dom y & y.x = a1;
      take u;
      thus P[x,y,u] by A6;
    end;
    suppose
A7:   not ex x being set st x in dom y & y.x = a1;
      take v;
      thus P[x,y,v] by A3,A7;
    end;
  end;
  consider H being Function of [:c, PF:], a01 such that
A8: for x being Element of c, y being Element of PF holds P[x,y,H.(x,y)
  ] from BINOP_1:sch 3(A5);
A9: a01 c= V by A1,A2,ZFMISC_1:32;
  then
A10: rng H c= V;
  rng F3 \/ rng F4 c= {a0} \/ {a1} by XBOOLE_1:13;
  then
A11: rng F3 \/ rng F4 c= a01 by ENUMSET1:1;
  rng F2 c= rng F3 \/ rng F4 by FUNCT_4:17;
  then rng F2 c= a01 by A11;
  then
A12: rng F2 c= V by A9;
A13: rng H c= a01;
A14: dom H = [:c, PF:] by FUNCT_2:def 1;
  then reconsider H as Function of [:c, PF:], V by A10,FUNCT_2:def 1,RELSET_1:4
;
A15: dom F4 = wfp;
A16: dom F2 = dom F3 \/ dom F4 by FUNCT_4:def 1
    .= c by XBOOLE_1:12;
  then reconsider F2 as Function of c, V by A12,FUNCT_2:def 1,RELSET_1:4;
A17: F2 is_recursively_expressed_by H
  proof
    let x be Element of c;
    reconsider F2r = F2 | r-Seg x as Element of PF by PARTFUN1:45;
    per cases;
    suppose
A18:  x in wfp;
      now
        let z be set;
A19:    r-Seg x c= wfp by A18,Th4;
        assume z in dom F2r;
        then
A20:    z in r-Seg x by RELAT_1:57;
        then F2r.z = F2.z by FUNCT_1:49
          .= F4.z by A15,A20,A19,FUNCT_4:13
          .= a0 by A20,A19,FUNCOP_1:7;
        hence F2r.z <> a1 by A3;
      end;
      then
A21:  H.(x, F2r)<>a1 by A8;
A22:  H.[x, F2r] in rng H by A14,FUNCT_1:def 3;
      F4.x = a0 by A18,FUNCOP_1:7;
      hence F2.x = a0 by A15,A18,FUNCT_4:13
        .= H.(x, F2 | r-Seg x) by A13,A21,A22,TARSKI:def 2;
    end;
    suppose
A23:  not x in wfp;
      then not r-Seg x c= wfp by Th9;
      then consider z being object such that
A24:  z in r-Seg x and
A25:  not z in wfp;
A26:  r-Seg x c= c by Th3;
      then
A27:  z in dom F2r by A16,A24,RELAT_1:57;
A28:  F2r.z = F2.z by A24,FUNCT_1:49
        .= F3.z by A15,A25,FUNCT_4:11
        .= a1 by A24,A26,FUNCOP_1:7;
      thus F2.x = F3.x by A15,A23,FUNCT_4:11
        .= a1
        .= H.(x, F2 | r-Seg x) by A8,A27,A28;
    end;
  end;
  reconsider F1 = c --> a0 as Function of c, V by A1,FUNCOP_1:45;
  assume
A29: for H being Function of [:c, PF:], V, F1, F2 being Function of c, V
st F1 is_recursively_expressed_by H & F2 is_recursively_expressed_by H holds F1
  = F2;
  assume not R is well_founded;
  then wfp <> c by Th8;
  then consider x being object such that
A30: not (x in wfp iff x in c) by TARSKI:2;
A31: F1 is_recursively_expressed_by H
  proof
    let x be Element of c;
    reconsider F1r = F1 | r-Seg x as Element of PF by PARTFUN1:45;
A32: H.[x, F1r] in rng H by A14,FUNCT_1:def 3;
    now
      let z be set;
      assume
A33:  z in dom F1r;
      then z in r-Seg x by RELAT_1:57;
      then F1r.z = F1.z by FUNCT_1:49
        .= a0 by A33,FUNCOP_1:7;
      hence F1r.z <> a1 by A3;
    end;
    then
A34: H.(x, F1r) <> a1 by A8;
    thus F1.x = a0
      .= H.(x, F1 | r-Seg x) by A13,A34,A32,TARSKI:def 2;
  end;
A35: F1.x = a0 by A30,FUNCOP_1:7;
  F2.x = F3.x by A15,A30,FUNCT_4:11
    .= a1 by A30,FUNCOP_1:7;
  hence contradiction by A3,A31,A17,A29,A35;
end;
