reserve a, b, c, d, r, s for Real,
  n for Element of NAT,
  p, p1, p2 for Point of TOP-REAL 2,
  x, y for Point of TOP-REAL n,
  C for Simple_closed_curve,
  A, B, P for Subset of TOP-REAL 2,
  U, V for Subset of (TOP-REAL 2)|C`,
  D for compact with_the_max_arc Subset of TOP-REAL 2;

theorem Th51:
  a <= b & c <= d implies
  closed_inside_of_rectangle(a,b,c,d) \ inside_of_rectangle(a,b,c,d)
  = rectangle(a,b,c,d)
proof
  assume that
A1: a <= b and
A2: c <= d;
  set R = rectangle(a,b,c,d);
  set P = closed_inside_of_rectangle(a,b,c,d);
  set P1 = inside_of_rectangle(a,b,c,d);
A3: R = {p where p is Point of T2: p`1 = a & p`2 <= d & p`2 >= c or
  p`1 <= b & p`1 >= a & p`2 = d or p`1 <= b & p`1 >= a & p`2 = c or
  p`1 = b & p`2 <= d & p`2 >= c} by A1,A2,SPPOL_2:54;
  thus P \ P1 c= R
  proof
    let x be object;
    assume
A4: x in P \ P1;
    then
A5: not x in P1 by XBOOLE_0:def 5;
    x in P by A4,XBOOLE_0:def 5;
    then consider p such that
A6: x = p and
A7: a <= p`1 and
A8: p`1 <= b and
A9: c <= p`2 and
A10: p`2 <= d;
    not (a < p`1 & p`1 < b & c < p`2 & p`2 < d) by A5,A6;
    then p`1 = a & p`2 <= d & p`2 >= c or p`1 <= b & p`1 >= a & p`2 = d or
    p`1 <= b & p`1 >= a & p`2 = c or
    p`1 = b & p`2 <= d & p`2 >= c by A7,A8,A9,A10,XXREAL_0:1;
    hence thesis by A3,A6;
  end;
  let x be object;
  assume
A11: x in R;
  then
A12: ex p st p = x & (p`1 = a & p`2 <= d & p`2 >= c or
  p`1 <= b & p`1 >= a & p`2 = d or p`1 <= b & p`1 >= a & p`2 = c or
  p`1 = b & p`2 <= d & p`2 >= c) by A3;
A13: R c= P by A1,A2,Th45;
  now
    assume x in P1;
    then ex p st x = p & a < p`1 & p`1 < b & c < p`2 & p`2 < d;
    hence contradiction by A12;
  end;
  hence thesis by A11,A13,XBOOLE_0:def 5;
end;
