reserve p,p1,p2,p3,q,q1,q2 for Point of TOP-REAL 2,
  i for Nat,
  lambda for Real;

theorem Th46:
  for a,b,c,d being Real st a<=b & c <=d
  holds W-min rectangle(a,b,c,d)=|[a,c]| & E-max rectangle(a,b,c,d)=|[b,d]|
proof
  let a,b,c,d be Real;
  set K = rectangle(a,b,c,d);
  assume that
A1: a<=b and
A2: c <=d;
A3: lower_bound (proj2|LSeg(|[a,c]|,|[a,d]|)) = c
  proof
    set X = LSeg(|[a,c]|,|[a,d]|);
    reconsider Z = (proj2|X).:the carrier of ((TOP-REAL 2)|X)
    as Subset of REAL;
A4: X = the carrier of ((TOP-REAL 2)|X) by PRE_TOPC:8;
A5: for p be Real st p in Z holds p >= c
    proof
      let p be Real;
      assume p in Z;
      then consider p0 being object such that
A6:   p0 in the carrier of (TOP-REAL 2)|X and
      p0 in the carrier of (TOP-REAL 2)|X and
A7:   p = (proj2|X).p0 by FUNCT_2:64;
      reconsider p0 as Point of TOP-REAL 2 by A4,A6;
A8:   |[a,c]|`2 = c by EUCLID:52;
      |[a,d]|`2 = d by EUCLID:52;
      then p0`2 >= c by A2,A4,A6,A8,TOPREAL1:4;
      hence thesis by A4,A6,A7,PSCOMP_1:23;
    end;
A9: for q being Real st
    for p being Real st p in Z holds p >= q holds c >= q
    proof
      let q be Real such that
A10:  for p being Real st p in Z holds p >= q;
A11:  |[a,c]| in X by RLTOPSP1:68;
      (proj2|X). |[a,c]| = |[a,c]|`2 by PSCOMP_1:23,RLTOPSP1:68
        .= c by EUCLID:52;
      hence thesis by A4,A10,A11,FUNCT_2:35;
    end;
    thus lower_bound (proj2|X) = lower_bound Z by PSCOMP_1:def 1
      .= c by A5,A9,SEQ_4:44;
  end;
A12: W-most K = LSeg(|[a,c]|,|[a,d]|) by A1,A2,Th44;
A13: W-bound K = a by A1,A2,Th36;
A14: upper_bound (proj2|LSeg(|[b,c]|,|[b,d]|)) = d
  proof
    set X = LSeg(|[b,c]|,|[b,d]|);
    reconsider Z = (proj2|X).:the carrier of ((TOP-REAL 2)|X)
    as Subset of REAL;
A15: X = the carrier of ((TOP-REAL 2)|X) by PRE_TOPC:8;
A16: for p be Real st p in Z holds p <= d
    proof
      let p be Real;
      assume p in Z;
      then consider p0 being object such that
A17:  p0 in the carrier of (TOP-REAL 2)|X and
      p0 in the carrier of (TOP-REAL 2)|X and
A18:  p = (proj2|X).p0 by FUNCT_2:64;
      reconsider p0 as Point of TOP-REAL 2 by A15,A17;
A19:  |[b,c]|`2 = c by EUCLID:52;
      |[b,d]|`2 = d by EUCLID:52;
      then p0`2 <= d by A2,A15,A17,A19,TOPREAL1:4;
      hence thesis by A15,A17,A18,PSCOMP_1:23;
    end;
A20: for q being Real st
    for p being Real st p in Z holds p <= q holds d <= q
    proof
      let q be Real such that
A21:  for p being Real st p in Z holds p <= q;
A22:  |[b,d]| in X by RLTOPSP1:68;
      (proj2|X). |[b,d]| = |[b,d]|`2 by PSCOMP_1:23,RLTOPSP1:68
        .= d by EUCLID:52;
      hence thesis by A15,A21,A22,FUNCT_2:35;
    end;
    thus upper_bound (proj2|X) = upper_bound Z by PSCOMP_1:def 2
      .= d by A16,A20,SEQ_4:46;
  end;
A23: E-most K = LSeg(|[b,c]|,|[b,d]|) by A1,A2,Th45;
  E-bound K = b by A1,A2,Th38;
  hence thesis by A3,A12,A13,A14,A23,PSCOMP_1:def 19,def 23;
end;
