reserve I for non empty set;
reserve M for ManySortedSet of I;
reserve Y,x,y,i for set;
reserve r,r1,r2 for Real;

theorem Th20:
  for r1,r2 st r1 <= r2 holds RealSubLatt(r1,r2) is complete
proof
  let r1,r2 such that
A1: r1 <= r2;
  reconsider R1 = r1, R2 = r2 as R_eal by XXREAL_0:def 1;
  set A = [.r1,r2.];
  set L9 = RealSubLatt(r1,r2);
A2: the carrier of L9 = [.r1,r2.] by A1,Def4;
A3: the L_meet of L9 = minreal||[.r1,r2.] by A1,Def4;
  now
    let X be Subset of L9;
    per cases;
    suppose
A4:   X is empty;
      thus ex a be Element of L9 st a is_less_than X & for b being Element of
      L9 st b is_less_than X holds b [= a
      proof
        r2 in { r : r1 <= r & r <= r2 } by A1;
        then reconsider a = r2 as Element of L9 by A2,RCOMP_1:def 1;
        take a;
        for q be Element of L9 st q in X holds a [= q by A4;
        hence a is_less_than X;
        let b be Element of L9;
        assume b is_less_than X;
A5:     b in [.r1,r2.] by A2;
        then reconsider b9 = b as Element of REAL;
        b in { r : r1 <= r & r <= r2 } by A5,RCOMP_1:def 1;
        then consider b1 be Real such that
A6:      b = b1 & r1 <= b1 & b1 <= r2;
      reconsider b1,r2 as Real;
        b "/\" a = (minreal||A).(b,a) by A3,LATTICES:def 2
          .= minreal. [b,a] by A2,FUNCT_1:49
          .= minreal.(b,a)
          .= min(b9,r2) by REAL_LAT:def 1
          .= b by A6,XXREAL_0:def 9;
        hence thesis by LATTICES:4;
      end;
    end;
    suppose
A7:   X is non empty;
      X c= REAL by A2,XBOOLE_1:1;
      then reconsider X1 = X as non empty Subset of ExtREAL by A7,NUMBERS:31
,XBOOLE_1:1;
      thus ex a be Element of L9 st a is_less_than X & for b being Element of
      L9 st b is_less_than X holds b [= a
      proof
        set g = the Element of X1;
        set A1 = inf X1;
        set LB = r1 - 1;
        LB is LowerBound of X1
        proof
            let v be ExtReal;
            assume v in X1;
            then v in the carrier of L9;
            then v in { r : r1 <= r & r <= r2 } by A2,RCOMP_1:def 1;
            then consider w be Real such that
A8:         v = w and
A9:         r1 <= w and
            w <= r2;
            r1 - 1 <= r1 - 0 by XREAL_1:13;
            then r1 - 1 + r1 <= r1 + w by A9,XREAL_1:7;
            hence LB <= v by A8,XREAL_1:6;
        end;
        then
A10:    X1 is bounded_below;
        X <> {+infty}
        proof
          assume X = {+infty};
          then +infty in X by TARSKI:def 1;
          hence contradiction by A2;
        end;
        then
A11:    A1 in REAL by A10,XXREAL_2:58;
        g in [.r1,r2.] by A2,TARSKI:def 3;
        then g in { r : r1 <= r & r <= r2 } by RCOMP_1:def 1;
        then
A12:    ex w be Real st g = w & r1 <= w & w <= r2;
A13:    A1 is LowerBound of X1 by XXREAL_2:def 4;
        then A1 <= g by XXREAL_2:def 2;
        then consider A9,R29 be Real such that
A14:    A9 = A1 and
A15:    R29 = R2 & A9 <= R29 by A11,A12,XXREAL_0:2;
        now
          let v be ExtReal;
          assume v in X1;
          then v in A by A2;
          then v in { r : r1 <= r & r <= r2 } by RCOMP_1:def 1;
          then ex w be Real st v = w & r1 <= w & w <= r2;
          hence R1 <= v;
        end;
        then R1 is LowerBound of X1 by XXREAL_2:def 2;
        then R1 <= A1 by XXREAL_2:def 4;
        then A9 in { r : r1 <= r & r <= r2 } by A14,A15;
        then reconsider a = A1 as Element of L9 by A2,A14,RCOMP_1:def 1;
        take a;
        a in [.r1,r2.] by A2;
        then reconsider a9 = a as Element of REAL;
        now
          let q be Element of L9;
          assume
A16:      q in X;
          q in [.r1,r2.] by A2;
          then reconsider q9 = q as Element of REAL;
          reconsider Q = q9 as R_eal by NUMBERS:31;
          A1 = a9;
          then
A17:      ex a1, q1 be Real st a1 = A1 & q1 = Q & a1 <= q1 by A13,A16,
XXREAL_2:def 2;
          a "/\" q = (minreal||A).(a,q) by A3,LATTICES:def 2
            .= minreal. [a,q] by A2,FUNCT_1:49
            .= minreal.(a,q)
            .= min(a9,q9) by REAL_LAT:def 1
            .= a by A17,XXREAL_0:def 9;
          hence a [= q by LATTICES:4;
        end;
        hence a is_less_than X;
        let b be Element of L9;
        b in [.r1,r2.] by A2;
        then reconsider b9 = b as Element of REAL;
        reconsider B = b9 as R_eal by NUMBERS:31;
        assume
A18:    b is_less_than X;
        now
          let h be ExtReal;
          assume
A19:      h in X;
          then reconsider h1 = h as Element of L9;
          h in [.r1,r2.] by A2,A19;
          then reconsider h9 = h as Real;
A20:      b [= h1 by A18,A19;
          min(b9,h9) = minreal.(b,h1) by REAL_LAT:def 1
            .= (minreal||A). [b,h1] by A2,FUNCT_1:49
            .= (minreal||A).(b,h1)
            .= b "/\" h1 by A3,LATTICES:def 2
            .= b9 by A20,LATTICES:4;
          hence B <= h by XXREAL_0:def 9;
        end;
        then B is LowerBound of X1 by XXREAL_2:def 2;
        then
A21:    B <= A1 by XXREAL_2:def 4;
        b "/\" a = (minreal||A).(b,a) by A3,LATTICES:def 2
          .= minreal. [b,a] by A2,FUNCT_1:49
          .= minreal.(b,a)
          .= min(b9,a9) by REAL_LAT:def 1
          .= b by A21,XXREAL_0:def 9;
        hence thesis by LATTICES:4;
      end;
    end;
  end;
  hence thesis by VECTSP_8:def 6;
end;
