reserve n for Nat,
  a, b, r, w for Real,
  x, y, z for Point of TOP-REAL n,
  e for Point of Euclid n;
reserve V for RealLinearSpace,
        p,q,x for Element of V;
reserve p, q, x for Point of TOP-REAL n;

theorem Th31:
  y in Sphere(x,r) & z in Ball(x,r) implies LSeg(y,z) /\ Sphere(x, r) = {y}
proof
  set s = y, t = z;
  assume that
A1: s in Sphere(x,r) and
A2: t in Ball(x,r);
  hereby
    let m be object;
    assume
A3: m in LSeg(s,t) /\ Sphere(x,r);
    then reconsider w = m as Point of TOP-REAL n;
    w in LSeg(s,t) by A3,XBOOLE_0:def 4;
    then consider d being Real such that
A4: 0 <= d and
A5: d <= 1 and
A6: w = (1-d)*s + d*t by RLTOPSP1:76;
A7: |. d*(t-x) .| = |.d.|*|. t-x .| by TOPRNS_1:7
      .= d*|. t-x .| by A4,ABSVALUE:def 1;
    d-1 <= 1-1 by A5,XREAL_1:9;
    then
A8: -(0 qua Element of NAT) <= -(d-1);
A9: |. (1-d)*(s-x) .| = |.1-d.|*|. s-x .| by TOPRNS_1:7
      .= (1-d)*|. s-x .| by A8,ABSVALUE:def 1
      .= (1-d)*r by A1,Th7;
    m in Sphere(x,r) by A3,XBOOLE_0:def 4;
    then
A10: r = |. w - x .| by Th7
      .= |. (1-d)*s + d*t - (1-d+d)*x .| by A6,RLVECT_1:def 8
      .= |. (1-d)*s + d*t - ((1-d)*x + d*x) .| by RLVECT_1:def 6
      .= |. (1-d)*s + d*t - (1-d)*x - d*x .| by RLVECT_1:27
      .= |. (1-d)*s - (1-d)*x + d*t - d*x .| by RLVECT_1:def 3
      .= |. (1-d)*(s-x) + d*t - d*x .| by RLVECT_1:34
      .= |. (1-d)*(s-x) + (d*t - d*x) .| by RLVECT_1:def 3
      .= |. (1-d)*(s-x) + d*(t-x) .| by RLVECT_1:34;
    per cases by A4;
    suppose
A11:  d > 0;
      |. t-x .| < r by A2,Th5;
      then d*|. t-x .| < d*r by A11,XREAL_1:68;
      then (1-d)*r + d*|. t-x .| < (1-d)*r + d*r by XREAL_1:8;
      hence m in {s} by A10,A9,A7,TOPRNS_1:29;
    end;
    suppose
      d = 0;
      then m = 1 * s + 0.TOP-REAL n by A6,RLVECT_1:10
        .= 1 * s by RLVECT_1:4
        .= s by RLVECT_1:def 8;
      hence m in {s} by TARSKI:def 1;
    end;
  end;
  let m be object;
A12: s in LSeg(s,t) by RLTOPSP1:68;
  assume m in {s};
  then m = s by TARSKI:def 1;
  hence thesis by A1,A12,XBOOLE_0:def 4;
end;
