 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;
 reserve D for Subset of X;
 reserve I,I1,I2 for Function of X,Y;
 reserve J,J1,J2 for Function of [:X,Y,Y:], Y;
 reserve E1,E2 for Function of X,X;

theorem Threcursive0301:
  E1,E2 is_well_founded_with_minimal_set D implies
    ex f,g being continuous Function of FlatPoset(X),FlatPoset(Y) st
       for x being Element of X holds
           (f.x in Y & f.x = BaseFunc02(x,f.(E1.x),g.(E2.x),I1,J1,D) &
            g.x in Y & g.x = BaseFunc02(x,f.(E1.x),g.(E2.x),I2,J2,D))
  proof
    assume
A1: E1,E2 is_well_founded_with_minimal_set D;
A2: not X in X & not Y in Y;
    set FX = FlatPoset(X);
    set CX = succ(X);
    set FY = FlatPoset(Y);
    set CY = succ(Y);
    consider f,g being set such that
A7: f in ConFuncs(FlatPoset(X),FlatPoset(Y)) &
          g in ConFuncs(FlatPoset(X),FlatPoset(Y)) &
          f = RecFunc02(f,g,E1,E2,I1,J1,D) &
          g = RecFunc02(f,g,E1,E2,I2,J2,D) by Threcursive0201;
    reconsider f,g as continuous Function of FlatPoset(X),FlatPoset(Y) by A7;
    take f,g;
    consider l be Function of X,NAT such that
A801: for x0 being Element of X holds
     (l.x0 <=0 implies x0 in D) &
     ( not x0 in D implies l.(E1.x0) < l.x0 & l.(E2.x0) < l.x0) by A1;
    defpred P[Nat] means
      for x1,x2 being Element of X
         st l.x1<=$1 & l.x2<=$1 holds
       (f.x1 in Y & f.x1 = BaseFunc02(x1,f.(E1.x1),g.(E2.x1),I1,J1,D) &
        g.x2 in Y & g.x2 = BaseFunc02(x2,f.(E1.x2),g.(E2.x2),I2,J2,D));
A9: P[0]
      proof
      let x1,x2 be Element of X;
      assume b1: l.x1<= 0 & l.x2<= 0;
B2:   x1 in X & x2 in X;
      reconsider x1,x2 as Element of FX by XBOOLE_0:def 3;
      x1 <> X & x2 <> X by B2; then
B4:     f.((Flatten E1).x1) = f.(E1.x1) &
        g.((Flatten E2).x1) = g.(E2.x1) &
        f.((Flatten E1).x2) = f.(E1.x2) &
        g.((Flatten E2).x2) = g.(E2.x2) by DefFlatten04;
      f.x1 = BaseFunc02(x1,f.(E1.x1),g.(E2.x1),I1,J1,D) by A7,DefRecFunc02,B4;
      then
B6:   f.x1 = I1.x1 by DefBaseFunc02,b1,A801;
      g.x2 = BaseFunc02(x2,f.(E1.x2),g.(E2.x2),I2,J2,D) by A7,DefRecFunc02,B4;
      then g.x2 = I2.x2 by DefBaseFunc02,b1,A801;
      hence thesis by A7,DefRecFunc02,B4,FUNCT_2:5,B6;
      end;
A10:  for k st P[k] holds P[k + 1]
      proof
        let k;
        assume
B0:     P[k];
        let x01,x02 be Element of X;
        assume
B1:     l.x01 <=k+1 & l.x02 <=k+1;
        reconsider x01,x02 as Element of FX by XBOOLE_0:def 3;
        x01 <> X & x02 <> X by A2; then
B4:     f.((Flatten E1).x01) = f.(E1.x01) &
        g.((Flatten E2).x01) = g.(E2.x01) &
        f.((Flatten E1).x02) = f.(E1.x02) &
        g.((Flatten E2).x02) = g.(E2.x02) by DefFlatten04;
        set x11 = E1.x01;
        set x21 = E2.x01;
        set x12 = E1.x02;
        set x22 = E2.x02;
        reconsider x11,x12,x21,x22 as Element of X by FUNCT_2:5;
B501:   f.x01 = BaseFunc02(x01,f.x11,g.x21,I1,J1,D) by A7,DefRecFunc02,B4;
B502:   g.x02 = BaseFunc02(x02,f.x12,g.x22,I2,J2,D) by A7,DefRecFunc02,B4;
        reconsider x01,x02 as Element of X;
        per cases;
          suppose x01 in D; then
C2:         f.x01 = I1.x01 by DefBaseFunc02,B501;
            per cases;
              suppose x02 in D;
                then g.x02 = I2.x02 by DefBaseFunc02,B502;
                hence thesis by C2,A7,DefRecFunc02,B4;
                end;
              suppose
C01:            not x02 in D;
                then l.x12 + 1 <= l.x02 & l.x22 + 1 <= l.x02
                  by NAT_1:13,A801;
                then l.x12 + 1 <= k + 1 & l.x22 + 1 <= k + 1 by B1,XXREAL_0:2;
                then l.x12 <= k & l.x22 <= k by XREAL_1:8;
                then
C04:              f.x12 in Y & g.x22 in Y by B0;
C06:            g.x02 = J2.[x02,f.x12,g.x22] by B502,DefBaseFunc02,C01,C04;
                [x02,f.x12,g.x22] in [:X,Y,Y:] by C04,MCART_1:69;
                hence thesis by C2,C06,A7,DefRecFunc02,B4,FUNCT_2:5;
                end;
            end;
          suppose
C1:         not x01 in D;
            then l.x11 + 1 <= l.x01 & l.x21 + 1 <= l.x01 by NAT_1:13,A801;
            then l.x11 + 1 <= k + 1 & l.x21 + 1 <= k + 1 by B1,XXREAL_0:2;
            then l.x11 <= k & l.x21 <= k by XREAL_1:8; then
C4:         f.x11 in Y & g.x21 in Y by B0; then
C6:         f.x01 = J1.[x01,f.x11,g.x21] by B501,DefBaseFunc02,C1;
C7:         [x01,f.x11,g.x21] in [:X,Y,Y:] by C4,MCART_1:69;
            per cases;
              suppose x02 in D;
                then g.x02 = I2.x02 by DefBaseFunc02,B502;
                hence thesis by C6,C7,FUNCT_2:5,A7,DefRecFunc02,B4;
                end;
              suppose
C01:            not x02 in D;
                then l.x12 + 1 <= l.x02 & l.x22 + 1 <= l.x02 by NAT_1:13,A801;
                then l.x12 + 1 <= k + 1 & l.x22 + 1 <= k + 1 by B1,XXREAL_0:2;
                then l.x12 <= k & l.x22 <= k by XREAL_1:8;
                then
C04:              f.x12 in Y & g.x22 in Y by B0;
C06:            g.x02 = J2.[x02,f.x12,g.x22] by B502,DefBaseFunc02,C01,C04;
                [x02,f.x12,g.x22] in [:X,Y,Y:] by C04,MCART_1:69;
                hence thesis by C6,C7,C06,A7,DefRecFunc02,B4,FUNCT_2:5;
                end;
            end;
        end;
A11: for k being Nat holds P[k] from NAT_1:sch 2(A9,A10);
     for x1,x2 being Element of X holds
       f.x1 in Y & f.x1 = BaseFunc02(x1,f.(E1.x1),g.(E2.x1),I1,J1,D) &
       g.x2 in Y & g.x2 = BaseFunc02(x2,f.(E1.x2),g.(E2.x2),I2,J2,D)
     proof
       let x1,x2 be Element of X;
       reconsider k = l.x1 + l.x2 as Nat;
       l.x1 <= k & l.x2 <= k by NAT_1:11;
       hence thesis by A11;
     end;
     hence thesis;
   end;
