reserve N for Cardinal;
reserve M for Aleph;
reserve X for non empty set;
reserve Y,Z,Z1,Z2,Y1,Y2,Y3,Y4 for Subset of X;
reserve S for Subset-Family of X;
reserve x for set;
reserve F,Uf for Filter of X;
reserve S for non empty Subset-Family of X;
reserve I for Ideal of X;
reserve S,S1 for Subset-Family of X;
reserve FS for non empty Subset of Filters(X);
reserve X for infinite set;
reserve Y,Y1,Y2,Z for Subset of X;
reserve F,Uf for Filter of X;
reserve x for Element of X;
reserve X for set;
reserve M for non limit_cardinal Aleph;
reserve F for Filter of M;
reserve N1,N2,N3 for Element of predecessor M;
reserve K1,K2 for Element of M;
reserve T for Inf_Matrix of predecessor M, M, bool M;

theorem Th34:
  ex T st T is_Ulam_Matrix_of M
proof
  set N = predecessor M;
  set GT = nextcard N \ N;
  defpred P[object,object] means
   ex f being Function st $2 = f & f is one-to-one &
  dom f = N & rng f = $1;
A1: for K1 being object st K1 in GT
    ex x being object st x in Funcs(N, nextcard N) & P[K1,x]
  proof
    let K1 be object such that
A2: K1 in (nextcard N) \ N;
    reconsider K2=K1 as Element of nextcard N by A2;
    not K1 in N by A2,XBOOLE_0:def 5;
    then card N c= card K2 by CARD_1:11,ORDINAL1:16;
    then
A3: N c= card K2;
    card K2 in nextcard N by CARD_1:9;
    then card K2 c= N by CARD_3:91;
    then card K2 = N by A3
      .= card N;
    then K2,N are_equipotent by CARD_1:5;
    then consider f being Function such that
A4: f is one-to-one and
A5: dom f = N and
A6: rng f = K1 by WELLORD2:def 4;
    rng f c= nextcard N by A2,A6,ORDINAL1:def 2;
    then f in Funcs(N, nextcard N) by A5,FUNCT_2:def 2;
    hence thesis by A4,A5,A6;
  end;
  consider h1 being Function such that
A7: dom h1 = GT and
  rng h1 c= Funcs(N, nextcard N) and
A8: for K1 being object st K1 in GT holds P[K1,h1.K1] from FUNCT_1:sch 6(
  A1);
  for K1 being object st K1 in dom h1 holds h1.K1 is Function
  proof
    let K1 be object;
    assume K1 in dom h1;
    then
    ex f being Function st h1.K1 = f & f is one-to-one & dom f = N & rng f
    = K1 by A7,A8;
    hence thesis;
  end;
  then reconsider h = h1 as Function-yielding Function by FUNCOP_1:def 6;
  N in nextcard N & not N in N by CARD_1:18;
  then reconsider GT1 = nextcard N \ N as non empty set by XBOOLE_0:def 5;
  deffunc g(set,set) = (h.$2).$1;
  defpred P[set,set,set] means $3 = {K2 where K2 is Element of GT1 : g($1,K2)=
  $2 };
A9: for N1,K1 ex S1 being Subset of GT1 st P[N1,K1,S1]
  proof
    let N1,K1;
    defpred P[set] means g(N1,$1)=K1;
    take {K2 where K2 is Element of GT1 : g(N1,K2)=K1 };
    {K2 where K2 is Element of GT1 : P[K2] } is Subset of GT1 from
    DOMAIN_1:sch 7;
    hence thesis;
  end;
  consider T1 being Function of [:predecessor M,M:],bool GT1 such that
A10: for N1,K1 holds P[N1,K1,T1.(N1,K1)] from BINOP_1:sch 3(A9);
  GT1 c= nextcard N;
  then GT1 c= M by Def17;
  then bool GT1 c= bool M by ZFMISC_1:67;
  then reconsider T=T1 as Function of [:predecessor M,M:],bool M by FUNCT_2:7;
  take T;
A11: for N1,N2,K1,K2 for K3 being set holds K3 in T.(N1,K1) /\ T.(N2,K2)
  implies ex K4 being Element of GT1 st K4=K3 & g(N1,K4)=K1 & g(N2,K4)=K2
  proof
    let N1,N2,K1,K2;
    let K3 be set;
    defpred A[Element of GT1] means g(N1,$1)=K1;
    defpred B[Element of GT1] means g(N2,$1)=K2;
    assume
A12: K3 in T.(N1,K1) /\ T.(N2,K2);
    then
A13: K3 in T1.(N1,K1) by XBOOLE_0:def 4;
    then reconsider K4=K3 as Element of GT1;
    take K4;
    thus K4=K3;
A14: K4 in {K5 where K5 is Element of GT1 : A[K5] } by A10,A13;
    thus A[K4] from ElemProp(A14);
    K3 in T1.(N2,K2) by A12,XBOOLE_0:def 4;
    then
A15: K4 in {K5 where K5 is Element of GT1 : B[K5] } by A10;
    thus B[K4] from ElemProp(A15);
  end;
  thus for N1,K1,K2 holds K1<>K2 implies T.(N1,K1) /\ T.(N1,K2) is empty
  proof
    let N1,K1,K2;
    assume
A16: K1<>K2;
    assume not T.(N1,K1) /\ T.(N1,K2) is empty;
    then consider K3 being object such that
A17: K3 in T.(N1,K1) /\ T.(N1,K2);
    ex K4 being Element of GT1 st K4=K3 & g(N1,K4)=K1 & g( N1,K4)=K2 by A11,A17
;
    hence contradiction by A16;
  end;
  thus for K1,N1,N2 holds N1<>N2 implies T.(N1,K1) /\ T.(N2,K1) is empty
  proof
    let K1,N1,N2;
    assume
A18: N1<>N2;
    assume not T.(N1,K1) /\ T.(N2,K1) is empty;
    then consider K3 being object such that
A19: K3 in T.(N1,K1) /\ T.(N2,K1);
    consider K4 being Element of GT1 such that
    K4=K3 and
A20: g(N1,K4)=K1 & g(N2,K4)=K1 by A11,A19;
    ex f being Function st h1.K4 = f & f is one-to-one & dom f = N & rng f
    = K4 by A8;
    hence contradiction by A18,A20;
  end;
A21: for N1 for K1 being Element of GT1 holds dom (h.K1)=N & rng (h.K1) = K1
  proof
    let N1;
    let K1 be Element of GT1;
    ex f being Function st h1.K1 = f & f is one-to-one & dom f = N & rng f
    = K1 by A8;
    hence thesis;
  end;
  thus for N1 holds card (M \ union {T.(N1,K1): K1 in M}) c= N
  proof
    let N1;
    union {T.(N1,K1):K1 in M} = GT1
    proof
      for S1 being set st S1 in {T.(N1,K1):K1 in M} holds S1 c= GT1
      proof
        let S1 be set;
        assume S1 in {T.(N1,K1):K1 in M};
        then consider K1 such that
A22:    S1 = T.(N1,K1) and
        K1 in M;
        T1.(N1,K1) c= GT1;
        hence thesis by A22;
      end;
      hence union {T.(N1,K1):K1 in M} c= GT1 by ZFMISC_1:76;
      let K2 be object such that
A23:  K2 in GT1;
      reconsider K5=K2 as Element of GT1 by A23;
      N1 in N;
      then N1 in dom (h.K5) by A21;
      then (h.K5).N1 in rng (h.K5) by FUNCT_1:def 3;
      then
A24:  g(N1,K5) in K5 by A21;
      K2 in nextcard N by A23;
      then K2 in M by Def17;
      then
A25:  K5 c= M by ORDINAL1:def 2;
      then
A26:  T.(N1,g(N1,K5)) in {T.(N1,K1):K1 in M} by A24;
      K5 in {K3 where K3 is Element of GT1 : g(N1,K3)=g(N1,K5)};
      then K5 in T.(N1,g(N1,K5)) by A10,A25,A24;
      hence thesis by A26,TARSKI:def 4;
    end;
    then union {T.(N1,K1):K1 in M} = M \ N by Def17;
    then M \ union {T.(N1,K1):K1 in M} = M /\ N by XBOOLE_1:48;
    hence thesis by CARD_1:7,XBOOLE_1:17;
  end;
  thus for K1 holds card (M \ union {T.(N1,K1): N1 in N}) c= N
  proof
    let K1;
A27: N c= K1 implies card K1 = N
    proof
      assume N c= K1;
      then card N c= card K1 by CARD_1:11;
      then
A28:  N c= card K1;
      card K1 in M by CARD_1:9;
      then card K1 in nextcard N by Def17;
      then card K1 c= N by CARD_3:91;
      hence thesis by A28;
    end;
A29: card (M \ {K5 where K5 is Element of GT1: K1 in K5}) c= N
    proof
      per cases by ORDINAL1:16;
      suppose
A30:    N c= K1;
        M \ (K1 \/ {K1}) c= {K5 where K5 is Element of GT1: K1 in K5}
        proof
          let K6 be object such that
A31:      K6 in M \ (K1 \/ {K1});
          reconsider K7=K6 as Element of M by A31;
A32:      not K6 in (K1 \/ {K1}) by A31,XBOOLE_0:def 5;
          then not K6 in {K1} by XBOOLE_0:def 3;
          then
A33:      not K6 = K1 by TARSKI:def 1;
          K7 in M;
          then
A34:      K7 in nextcard N by Def17;
          not K6 in K1 by A32,XBOOLE_0:def 3;
          then
A35:      K1 in K7 by A33,ORDINAL1:14;
          then N in K7 by A30,ORDINAL1:12;
          then reconsider K8=K7 as Element of GT1 by A34,XBOOLE_0:def 5;
          K8 in {K5 where K5 is Element of GT1: K1 in K5} by A35;
          hence thesis;
        end;
        then M \ {K5 where K5 is Element of GT1: K1 in K5} c= M \ (M \ (K1 \/
        {K1})) by XBOOLE_1:34;
        then
A36:    M \ {K5 where K5 is Element of GT1: K1 in K5} c= M /\ (K1 \/ {K1}
        ) by XBOOLE_1:48;
        not K1 is finite by A30;
        then
A37:    card (K1 \/ {K1}) = card K1 by CARD_2:78;
        M /\ (K1 \/ {K1}) c= K1 \/ {K1} by XBOOLE_1:17;
        then M \ {K5 where K5 is Element of GT1: K1 in K5} c= K1 \/ {K1 } by
A36;
        hence thesis by A27,A30,A37,CARD_1:11;
      end;
      suppose
A38:    K1 in N;
        {K5 where K5 is Element of GT1: K1 in K5} = GT1
        proof
          defpred P[set] means K1 in $1;
          {K5 where K5 is Element of GT1: P[K5]} is Subset of GT1 from
          DOMAIN_1:sch 7;
          hence {K5 where K5 is Element of GT1: K1 in K5} c= GT1;
          let K6 be object such that
A39:      K6 in GT1;
          reconsider K7=K6 as Element of nextcard N by A39;
          reconsider K8=K7 as Element of GT1 by A39;
          not K6 in N by A39,XBOOLE_0:def 5;
          then N c= K7 by ORDINAL1:16;
          then K8 in {K5 where K5 is Element of GT1: K1 in K5} by A38;
          hence thesis;
        end;
        then (M \ {K5 where K5 is Element of GT1: K1 in K5}) = M \ ( M \ N)
        by Def17
          .= M /\ N by XBOOLE_1:48;
        hence thesis by CARD_1:7,XBOOLE_1:17;
      end;
    end;
    {K5 where K5 is Element of GT1 : K1 in K5} c= union {T.(N1,K1): N1 in N}
    proof
      let K4 be object;
      assume K4 in {K5 where K5 is Element of GT1 : K1 in K5};
      then consider K5 being Element of GT1 such that
A40:  K4=K5 and
A41:  K1 in K5;
      rng (h.K5) = K5 by A21;
      then consider N2 being object such that
A42:  N2 in dom (h.K5) and
A43:  (h.K5).N2 = K1 by A41,FUNCT_1:def 3;
      reconsider N3=N2 as Element of N by A21,A42;
      K5 in {K3 where K3 is Element of GT1 : g(N3,K3)=K1} by A43;
      then
A44:  K5 in T.(N3,K1) by A10;
      T.(N3,K1) in {T.(N1,K1): N1 in N};
      hence thesis by A40,A44,TARSKI:def 4;
    end;
    then M \ union {T.(N1,K1): N1 in N} c= M \ {K5 where K5 is Element of GT1
    : K1 in K5} by XBOOLE_1:34;
    then card (M \ union {T.(N1,K1): N1 in N}) c= card (M \ {K5 where K5 is
    Element of GT1: K1 in K5}) by CARD_1:11;
    hence thesis by A29;
  end;
end;
