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 Th93:
  P is compact &
  |[-1,0]|,|[1,0]| realize-max-dist-in P & A is_inside_component_of P implies
  A c= closed_inside_of_rectangle(-1,1,-3,3)
proof
  assume that
A1: P is compact and
A2: |[-1,0]|,|[1,0]| realize-max-dist-in P and
A3: A is_inside_component_of P;
  let x be object;
  assume that
A4: x in A and
A5: not x in R;
  P c= R by A2,Th71;
  then
A6: R` c= P` by SUBSET_1:12;
  reconsider x as Point of T2 by A4;
A7: not (rl <= x`1 & x`1 <= rp & rd <= x`2 & x`2 <= rg) by A5;
  per cases;
  suppose
A8: 0 <= x`1;
    set E = east_halfline(x);
    E c= R`
    proof
      let e be object;
      assume
A9:   e in E;
      then reconsider e as Point of T2;
A10:  e`1 >= x`1 by A9,TOPREAL1:def 11;
      now
        assume e in R;
        then ex p st e = p & rl <= p`1 & p`1 <= rp & rd <= p`2 & p`2 <= rg;
        hence contradiction by A7,A8,A9,A10,TOPREAL1:def 11,XXREAL_0:2;
      end;
      hence thesis by SUBSET_1:29;
    end;
    then E c= P` by A6;
    then E misses P by SUBSET_1:23;
    then
A11: E c= UBD P by A1,JORDAN2C:127;
    x in E by TOPREAL1:38;
    then A meets UBD P by A4,A11,XBOOLE_0:3;
    hence thesis by A3,Th14;
  end;
  suppose
A12: x`1 < 0;
    set E = west_halfline(x);
    E c= R`
    proof
      let e be object;
      assume
A13:  e in E;
      then reconsider e as Point of T2;
A14:  e`1 <= x`1 by A13,TOPREAL1:def 13;
      now
        assume e in R;
        then ex p st e = p & rl <= p`1 & p`1 <= rp & rd <= p`2 & p`2 <= rg;
        hence contradiction by A7,A12,A13,A14,TOPREAL1:def 13,XXREAL_0:2;
      end;
      hence thesis by SUBSET_1:29;
    end;
    then E c= P` by A6;
    then E misses P by SUBSET_1:23;
    then
A15: E c= UBD P by A1,JORDAN2C:126;
    x in E by TOPREAL1:38;
    then A meets UBD P by A4,A15,XBOOLE_0:3;
    hence thesis by A3,Th14;
  end;
end;
