reserve X,Y,Z for set,
  x,y,z for object,
  E for non empty set,
  A,B,C for Ordinal ,
  L,L1 for Sequence,
  f,f1,f2,h for Function,
  d,d1,d2,d9 for Element of E;

theorem Th9:
  ex f st dom f = E & for d holds f.d = f.:d
proof
  defpred Q[Ordinal,Function,non empty set] means dom $2 = Collapse ($3,$1) &
  for d st d in Collapse ($3,$1) holds $2.d = $2.:d;
  defpred TI[Ordinal] means for f1,f2 st Q[$1,f1,E] & Q[$1,f2,E] holds f1 = f2;
  defpred MAIN[Ordinal] means ex f st Q[$1,f,E];
A1: A c= B & Q[B,f,E] implies Q[A,f|Collapse (E,A),E]
  proof
    assume that
A2: A c= B and
A3: dom f = Collapse (E,B) and
A4: for d st d in Collapse (E,B) holds f.d = f.:d;
A5: Collapse (E,A) c= Collapse (E,B) by A2,Th4;
    thus dom(f|Collapse (E,A)) = Collapse (E,A) by A2,A3,Th4,RELAT_1:62;
    let d such that
A6: d in Collapse (E,A);
    for x being object holds x in f.:d implies x in f|Collapse (E,A).:d
    proof let x be object;
A7:   dom(f|Collapse (E,A)) = Collapse (E,A) by A2,A3,Th4,RELAT_1:62;
      assume x in f.:d;
      then consider z being object such that
A8:   z in dom f and
A9:   z in d and
A10:  x = f.z by FUNCT_1:def 6;
      dom f c= E by A3,Th7;
      then reconsider d1 = z as Element of E by A8;
A11:  d1 in Collapse (E,A) by A6,A9,Th6;
      then f|Collapse (E,A).z = f.z by FUNCT_1:49;
      hence thesis by A9,A10,A11,A7,FUNCT_1:def 6;
    end;
    then
A12: f.:d c= f|Collapse (E,A).:d;
    f|Collapse (E,A).:d c= f.:d by RELAT_1:128;
    then
A13: f.:d = f|Collapse (E,A).:d by A12;
    thus f|Collapse (E,A).d = f.d by A6,FUNCT_1:49
      .= f|Collapse (E,A).:d by A4,A5,A6,A13;
  end;
A14: now
    let A such that
A15: for B st B in A holds TI[B];
    thus TI[A]
    proof
      let f1,f2 such that
A16:  Q[A,f1,E] and
A17:  Q[A,f2,E];
      now
        let x be object such that
A18:    x in Collapse (E,A);
        Collapse (E,A) c= E by Th7;
        then reconsider d = x as Element of E by A18;
A19:    f1.:d = f2.:d
        proof
          thus for y being object holds y in f1.:d implies y in f2.:d
          proof let y be object;
            assume y in f1.:d;
            then consider z being object such that
A20:        z in dom f1 and
A21:        z in d and
A22:        y = f1.z by FUNCT_1:def 6;
            dom f1 c= E by A16,Th7;
            then reconsider d1 = z as Element of E by A20;
            consider B such that
A23:        B in A and
A24:        d1 in Collapse (E,B) by A18,A21,Th6;
            B c= A by A23,ORDINAL1:def 2;
            then ( Q[B,f1|Collapse (E,B),E])& Q[B,f2|Collapse (E,B),E] by A1
,A16,A17;
            then
A25:        f1|Collapse (E,B) = f2|Collapse (E,B) by A15,A23;
            f1.d1 = f1|Collapse (E,B).d1 by A24,FUNCT_1:49
              .= f2.d1 by A24,A25,FUNCT_1:49;
            hence thesis by A16,A17,A20,A21,A22,FUNCT_1:def 6;
          end;
          let y be object;
          assume y in f2.:d;
          then consider z being object such that
A26:      z in dom f2 and
A27:      z in d and
A28:      y = f2.z by FUNCT_1:def 6;
          dom f2 c= E by A17,Th7;
          then reconsider d1 = z as Element of E by A26;
          consider B such that
A29:      B in A and
A30:      d1 in Collapse (E,B) by A18,A27,Th6;
          B c= A by A29,ORDINAL1:def 2;
          then
          ( Q[B,f1|Collapse (E,B),E])& Q[B,f2|Collapse (E,B),E] by A1,A16,A17;
          then
A31:      f1|Collapse (E,B) = f2|Collapse (E,B) by A15,A29;
          f1.d1 = f1|Collapse (E,B).d1 by A30,FUNCT_1:49
            .= f2.d1 by A30,A31,FUNCT_1:49;
          hence thesis by A16,A17,A26,A27,A28,FUNCT_1:def 6;
        end;
        f1.d = f1.:d by A16,A18;
        hence f1.x = f2.x by A17,A18,A19;
      end;
      hence thesis by A16,A17,FUNCT_1:2;
    end;
  end;
A32: for A holds TI[A] from ORDINAL1:sch 2(A14);
A33: for A st for B st B in A holds MAIN[B] holds MAIN[A]
  proof
    let A;
    assume for B st B in A ex f st Q[B,f,E];
    defpred P[object,object] means
      ex d,e being set st d = $1 & e = $2 & for x holds x in e
iff ex d1,B,f st d1 in d & B in A & d1 in Collapse (E,B) & Q[B,f,E] & x = f.d1;
A34: for x being object st x in Collapse (E,A) ex y being object st P[x,y]
    proof
A35:  Collapse (E,A) c= E by Th7;
      let x be object;
      assume x in Collapse (E,A);
      then reconsider d = x as Element of E by A35;
      defpred R[object,object] means
       ex B,f st B in A & $1 in Collapse (E,B) & Q[B,f,E] & $2 = f.$1;
A36:  for x,y,z being object st R[x,y] & R[x,z] holds y = z
      proof
        let x,y,z be object;
        given B1 being Ordinal, f1 such that
        B1 in A and
A37:    x in Collapse (E,B1) and
A38:    Q[B1,f1,E] and
A39:    y = f1.x;
        given B2 being Ordinal, f2 such that
        B2 in A and
A40:    x in Collapse (E,B2) and
A41:    Q[B2,f2,E] and
A42:    z = f2.x;
A43:    now
          assume B2 c= B1;
          then Q[B2,f1|Collapse (E,B2),E] by A1,A38;
          then f1|Collapse (E,B2) = f2 by A32,A41;
          hence thesis by A39,A40,A42,FUNCT_1:49;
        end;
        now
          assume B1 c= B2;
          then Q[B1,f2|Collapse (E,B1),E] by A1,A41;
          then f2|Collapse (E,B1) = f1 by A32,A38;
          hence thesis by A37,A39,A42,FUNCT_1:49;
        end;
        hence thesis by A43;
      end;
      consider X such that
A44:  for y being object holds y in X iff
        ex x being object st x in d & R[x,y] from TARSKI:sch 1(A36);
      take y = X,d,X;
      thus d = x;
      thus y = X;
      let x;
      thus x in X implies ex d1,B,f st d1 in d & B in A & d1 in Collapse (E,B)
      & Q[B,f,E] & x = f.d1
      proof
        assume x in X;
        then consider y being object such that
A45:    y in d and
A46:    ex B,f st B in A & y in Collapse (E,B) & Q[B,f,E] & x = f.y by A44;
        consider B,f such that
A47:    B in A and
A48:    y in Collapse (E,B) and
A49:    ( Q[B,f,E])& x = f.y by A46;
        Collapse (E,B) c= E by Th7;
        then reconsider d1 = y as Element of E by A48;
        take d1,B,f;
        thus thesis by A45,A47,A48,A49;
      end;
      given d1,B,f such that
A50:  d1 in d & B in A & d1 in Collapse (E,B) & Q[B,f,E] & x = f.d1;
      thus thesis by A44,A50;
    end;
    consider f such that
A51: dom f = Collapse (E,A) &
    for x being object st x in Collapse (E,A) holds P[x,f.x]
      from CLASSES1:sch 1(A34);
    defpred TI[Ordinal] means $1 c= A implies Q[$1,f|Collapse(E,$1),E];
A52: for B st for C st C in B holds TI[C] holds TI[B]
    proof
      let B such that
A53:  for C st C in B holds TI[C];
      assume
A54:  B c= A;
      then
A55:  Collapse (E,B) c= Collapse (E,A) by Th4;
      thus
A56:  dom(f|Collapse (E,B)) = Collapse (E,B) by A51,A54,Th4,RELAT_1:62;
      let d;
      assume
A57:  d in Collapse (E,B);
      then f|Collapse (E,B).d = f.d by FUNCT_1:49;
      then consider d9,e being set such that
A58:  d9 = d and
A59:   e = f|Collapse (E,B).d and
A60:  for x holds x in e iff ex d1,B,f st d1 in d9 & B in A &
      d1 in Collapse (E,B) & Q[B,f,E] & x = f.d1 by A51,A55,A57;
      set X = f|Collapse (E,B).d;
A61:  X c= f|Collapse (E,B).:d
      proof
        let x be object;
        assume x in X;
        then consider d1,C,h such that
A62:    d1 in d9 and
        C in A and
A63:    d1 in Collapse (E,C) and
A64:    Q[C,h,E] and
A65:    x = h.d1 by A60,A59;
        consider C9 being Ordinal such that
A66:    C9 in B and
A67:    d1 in Collapse (E,C9) by A57,A58,A62,Th6;
A68:    for C,h st C c= C9 & Q[C,h,E] & d1 in Collapse (E,C) & x = h.d1
        holds thesis
        proof
          let C,h;
          assume that
A69:      C c= C9 and
A70:      Q[C,h,E] and
A71:      d1 in Collapse (E,C) and
A72:      x = h.d1;
A73:      C in B by A66,A69,ORDINAL1:12;
          then C c= A by A54,ORDINAL1:def 2;
          then Q[C,f|Collapse (E,C),E] by A53,A73;
          then
A74:      f|Collapse (E,C) = h by A32,A70;
A75:      Collapse (E,C) c= Collapse (E,B) by Th4,A73,ORDINAL1:def 2;
          then f|Collapse (E,C) = f|Collapse (E,B)|Collapse (E,C) by FUNCT_1:51
;
          then h.d1 = f|Collapse (E,B).d1 by A71,A74,FUNCT_1:49;
          hence thesis by A56,A58,A62,A71,A72,A75,FUNCT_1:def 6;
        end;
        C9 c= C implies thesis
        proof
          assume C9 c= C;
          then
A76:      Q[C9,h|Collapse (E,C9),E] by A1,A64;
          h.d1 = h|Collapse (E,C9).d1 by A67,FUNCT_1:49;
          hence thesis by A65,A67,A68,A76;
        end;
        hence thesis by A63,A64,A65,A68;
      end;
      f|Collapse (E,B).:d c= X
      proof
        let x be object;
        assume x in f|Collapse (E,B).:d;
        then consider y being object such that
A77:    y in dom(f|Collapse (E,B)) and
A78:    y in d and
A79:    x = f|Collapse (E,B).y by FUNCT_1:def 6;
        Collapse (E,B) c= E by Th7;
        then reconsider d1 = y as Element of E by A56,A77;
        consider C such that
A80:    C in B and
A81:    d1 in Collapse (E,C) by A57,A78,Th6;
        Collapse (E,C) c= Collapse (E,B) by Th4,A80,ORDINAL1:def 2;
        then f|Collapse (E,B)|Collapse (E,C) = f|Collapse (E,C) by FUNCT_1:51;
        then
A82:    f|Collapse (E,C).y = f|Collapse (E,B).y by A81,FUNCT_1:49;
        C c= A by A54,A80,ORDINAL1:def 2;
        then Q[C,f|Collapse (E,C),E] by A53,A80;
        hence thesis by A54,A58,A60,A78,A79,A80,A81,A82,A59;
      end;
      hence thesis by A61;
    end;
A83: for B holds TI[B] from ORDINAL1:sch 2(A52);
    take f;
    f|dom f = f by RELAT_1:68;
    hence thesis by A51,A83;
  end;
A84: MAIN[A] from ORDINAL1:sch 2 (A33);
  consider A such that
A85: E = Collapse (E,A) by Th8;
  consider f such that
A86: Q[A,f,E] by A84;
  take f;
  thus dom f = E by A85,A86;
  let d;
  thus thesis by A85,A86;
end;
