reserve a,b,c for set;

theorem Th20:
  card {[.x,q.[ where x,q is Real: x < q & q is rational} = continuum
proof
  defpred P[object,object] means
ex x being Element of REAL, q being Element of REAL
  st $1 = x & $2 = [.x,q.[ & x < q & q is rational;
  deffunc F(Element of [:REAL,RAT:]) = [.$1`1,$1`2.[;
  set X = {[.x,q.[ where x,q is Real: x < q & q is rational};
  consider f being Function such that
A1: dom f = [:REAL,RAT:] and
A2: for z being Element of [:REAL,RAT:] holds f.z = F(z) from FUNCT_1: sch 4;
A3: X c= rng f
  proof
    let a be object;
    assume a in X;
    then consider x,q being Real such that
A4: a = [.x,q.[ and
    x < q and
A5: q is rational;
    x in REAL & q in RAT by A5,RAT_1:def 2,XREAL_0:def 1;
    then reconsider b = [x,q] as Element of [:REAL,RAT:] by ZFMISC_1:def 2;
A6: b`2 = q;
    b`1 = x;
    then f.b = [.x,q.[ by A6,A2;
    hence thesis by A1,A4,FUNCT_1:def 3;
  end;
  card omega c= card REAL by CARD_1:11,NUMBERS:19;
  then
A7: omega c= continuum;
  card [:REAL,RAT:] = card [:card REAL, card RAT:] by CARD_2:7
    .= continuum *` omega by Th17,CARD_2:def 2
    .= continuum by A7,CARD_4:16;
  hence card X c= continuum by A1,A3,CARD_1:12;
A8: for a being object st a in REAL
     ex b being object st b in X & P[a,b]
  proof let a be object;
    assume a in REAL;
    then reconsider x = a as Element of REAL;
    x+0 < x+1 by XREAL_1:6;
    then consider q being Rational such that
A9: x < q and
    q < x+1 by RAT_1:7;
    q in RAT by RAT_1:def 2;
    then reconsider q as Element of REAL by NUMBERS:12;
    [.x,q.[ in X by A9;
    hence thesis by A9;
  end;
  consider f being Function such that
A10: dom f = REAL & rng f c= X &
 for a being object st a in REAL holds P[a,f.a] from
  FUNCT_1:sch 6(A8);
  f is one-to-one
  proof
    let a,b be object;
    assume a in dom f;
    then consider x being Element of REAL, q being Element of REAL such that
A11: a = x and
A12: f.a = [.x,q.[ and
A13: x < q and
    q is rational by A10;
    assume b in dom f;
    then consider y being Element of REAL, r being Element of REAL such that
A14: b = y and
A15: f.b = [.y,r.[ and
A16: y < r and
    r is rational by A10;
    assume
A17: f.a = f.b;
    then y in [.x,q.[ by A12,A15,A16,XXREAL_1:3;
    then
A18: x <= y by XXREAL_1:3;
    x in [.y,r.[ by A17,A12,A13,A15,XXREAL_1:3;
    then y <= x by XXREAL_1:3;
    hence thesis by A18,A11,A14,XXREAL_0:1;
  end;
  hence thesis by A10,CARD_1:10;
end;
