 reserve a,Z1,Z2,Z3 for set,
         x,y,z for object,
         k for Nat;
 reserve S for RelStr;
 reserve P,Q for non empty flat Poset;
 reserve p,p1,p2 for Element of P;
 reserve K for non empty Chain of P;
 reserve X,Y for non empty set;
 reserve D for Subset of X;
 reserve I for Function of X,Y;
 reserve J for Function of [:X,Y:], Y;
 reserve E for Function of X,X;

theorem Threcursive03:
  E is_well_founded_with_minimal_set D implies
    ex f being continuous Function of FlatPoset(X),FlatPoset(Y) st
       for x being Element of X holds
           f.x in Y & f.x = BaseFunc01(x,f.(E.x),I,J,D)
  proof
    set z = X;
    set r = Y;
    assume
A0:  E is_well_founded_with_minimal_set D;
A1: not z in X & not r in Y;
    set FX = FlatPoset(X);
    set CX = succ(X);
    set FY = FlatPoset(Y);
    set CY = succ(Y);
    consider f being set such that
A5: f in ConFuncs(FlatPoset(X),FlatPoset(Y)) &
       f = RecFunc01(f,E,I,J,D) by Threcursive02;
    reconsider f as continuous Function of FlatPoset(X),FlatPoset(Y) by A5;
    consider l be Function of X,NAT such that
A6:   for x0 being Element of X holds
     (l.x0 <=0 implies x0 in D) &
     (not x0 in D implies l.(E.x0) < l.x0) by A0;
    defpred P[Nat] means
         for x0 being Element of X st l.x0<=$1 holds
          (f.x0 in Y & f.x0 = BaseFunc01(x0,f.(E.x0),I,J,D));
A7: P[0]
    proof
      let x0 be Element of X;
      assume
   b1:l.x0 <=0;
B2:   x0 in X;
      reconsider x0 as Element of FX by XBOOLE_0:def 3;
B3:   x0 <> z by B2;
B5:   f.x0 = BaseFunc01(x0,f.((Flatten E).x0),I,J,D) by DefRecFunc01,A5
          .= BaseFunc01(x0,f.(E.x0),I,J,D) by B3,DefFlatten04;
      then f.x0 = I.x0 by DefBaseFunc01,b1,A6;
      hence thesis by B5,FUNCT_2:5;
    end;
A8: for k st P[k] holds P[k + 1]
    proof
      let k;
      assume
B0:   P[k];
      let x0 be Element of X;
      assume
B1:   l.x0 <=k+1;
      reconsider x0 as Element of FX by XBOOLE_0:def 3;
B3:   x0 <> z by A1;
      reconsider x1 = E.x0 as Element of X by FUNCT_2:5;
B5:   f.x0 = BaseFunc01(x0,f.((Flatten E).x0),I,J,D) by DefRecFunc01,A5
          .= BaseFunc01(x0,f.x1,I,J,D) by B3,DefFlatten04;
      per cases;
        suppose x0 in D;
          then f.x0 = I.x0 by DefBaseFunc01,B5;
          hence thesis by FUNCT_2:5,B5;
        end;
        suppose
C0:       not x0 in D;
          reconsider x0 as Element of X;
          l.x1 + 1 <= l.x0 by NAT_1:13,A6,C0;
          then l.x1 + 1 <= k + 1 by B1,XXREAL_0:2;
          then l.x1 <= k by XREAL_1:8; then
C1:       f.x1 in Y by B0;
C4:       [x0,f.x1] in [:X,Y:] by C1,ZFMISC_1:def 2;
          J.[x0,f.x1] in Y by C4,FUNCT_2:5;
          hence thesis by B5,DefBaseFunc01,C0,C1;
        end;
      end;
A9: for k being Nat holds P[k] from NAT_1:sch 2(A7,A8);
    for x being Element of X holds
      f.x in Y & f.x = BaseFunc01(x,f.(E.x),I,J,D)
    proof
      let x be Element of X;
      reconsider k = l.x as Nat;
      l.x <= k;
      hence thesis by A9;
    end;
    hence thesis;
  end;
