File: Mathlib/Geometry/Euclidean/Sphere/Basic.lean

full_name: EuclideanGeometry.Sphere.center
code: /-- A `Sphere P` bundles a `center` and `radius`. This definition does not require the radius to
be positive; that should be given as a hypothesis to lemmas that require it. -/
@[ext]
structure Sphere [MetricSpace P] where
  /-- center of this sphere -/
  center : P
  /-- radius of the sphere: not required to be positive -/
  radius : ℝ
goal: P

full_name: EuclideanGeometry.Sphere.radius
code: /-- A `Sphere P` bundles a `center` and `radius`. This definition does not require the radius to
be positive; that should be given as a hypothesis to lemmas that require it. -/
@[ext]
structure Sphere [MetricSpace P] where
  /-- center of this sphere -/
  center : P
  /-- radius of the sphere: not required to be positive -/
  radius : ℝ
goal: ℝ

full_name: EuclideanGeometry.Sphere
code: /-- A `Sphere P` bundles a `center` and `radius`. This definition does not require the radius to
be positive; that should be given as a hypothesis to lemmas that require it. -/
@[ext]
structure Sphere [MetricSpace P] where
  /-- center of this sphere -/
  center : P
  /-- radius of the sphere: not required to be positive -/
  radius : ℝ
goal: Type u_2

full_name: EuclideanGeometry.instNonemptySphere
code: instance [Nonempty P] : Nonempty (Sphere P) 
goal: Nonempty (EuclideanGeometry.Sphere P)

full_name: EuclideanGeometry.instCoeSphereSet
code: instance : Coe (Sphere P) (Set P) 
goal: Coe (EuclideanGeometry.Sphere P) (Set P)

full_name: EuclideanGeometry.instMembershipSphere
code: instance : Membership P (Sphere P) 
goal: Membership P (EuclideanGeometry.Sphere P)

full_name: EuclideanGeometry.Sphere.mk_center
code: theorem Sphere.mk_center (c : P) (r : ℝ) : (⟨c, r⟩ : Sphere P).center = c 
goal: { center := c, radius := r }.center = c

full_name: EuclideanGeometry.Sphere.mk_radius
code: theorem Sphere.mk_radius (c : P) (r : ℝ) : (⟨c, r⟩ : Sphere P).radius = r 
goal: { center := c, radius := r }.radius = r

full_name: EuclideanGeometry.Sphere.mk_center_radius
code: @[simp]
theorem Sphere.mk_center_radius (s : Sphere P) : (⟨s.center, s.radius⟩ : Sphere P) = s 
goal: { center := s.center, radius := s.radius } = s

full_name: EuclideanGeometry.Sphere.coe_mk
code: @[simp]
theorem Sphere.coe_mk (c : P) (r : ℝ) : ↑(⟨c, r⟩ : Sphere P) = Metric.sphere c r 
goal: Metric.sphere { center := c, radius := r }.center { center := c, radius := r }.radius = Metric.sphere c r

full_name: EuclideanGeometry.Sphere.mem_coe
code: theorem Sphere.mem_coe {p : P} {s : Sphere P} : p ∈ (s : Set P) ↔ p ∈ s 
goal: p ∈ Metric.sphere s.center s.radius ↔ p ∈ s

full_name: EuclideanGeometry.Sphere.mem_coe'
code: @[simp]
theorem Sphere.mem_coe' {p : P} {s : Sphere P} : dist p s.center = s.radius ↔ p ∈ s 
goal: dist p s.center = s.radius ↔ p ∈ s

full_name: EuclideanGeometry.mem_sphere
code: theorem mem_sphere {p : P} {s : Sphere P} : p ∈ s ↔ dist p s.center = s.radius 
goal: p ∈ s ↔ dist p s.center = s.radius

full_name: EuclideanGeometry.mem_sphere'
code: theorem mem_sphere' {p : P} {s : Sphere P} : p ∈ s ↔ dist s.center p = s.radius 
goal: p ∈ s ↔ dist s.center p = s.radius

full_name: EuclideanGeometry.subset_sphere
code: theorem subset_sphere {ps : Set P} {s : Sphere P} : ps ⊆ s ↔ ∀ p ∈ ps, p ∈ s 
goal: ps ⊆ Metric.sphere s.center s.radius ↔ ∀ p ∈ ps, p ∈ s

full_name: EuclideanGeometry.dist_of_mem_subset_sphere
code: theorem dist_of_mem_subset_sphere {p : P} {ps : Set P} {s : Sphere P} (hp : p ∈ ps)
    (hps : ps ⊆ (s : Set P)) : dist p s.center = s.radius 
goal: dist p s.center = s.radius

full_name: EuclideanGeometry.dist_of_mem_subset_mk_sphere
code: theorem dist_of_mem_subset_mk_sphere {p c : P} {ps : Set P} {r : ℝ} (hp : p ∈ ps)
    (hps : ps ⊆ ↑(⟨c, r⟩ : Sphere P)) : dist p c = r 
goal: dist p c = r

full_name: EuclideanGeometry.Sphere.ne_iff
code: theorem Sphere.ne_iff {s₁ s₂ : Sphere P} :
    s₁ ≠ s₂ ↔ s₁.center ≠ s₂.center ∨ s₁.radius ≠ s₂.radius 
goal: s₁ ≠ s₂ ↔ s₁.center ≠ s₂.center ∨ s₁.radius ≠ s₂.radius

full_name: EuclideanGeometry.Sphere.center_eq_iff_eq_of_mem
code: theorem Sphere.center_eq_iff_eq_of_mem {s₁ s₂ : Sphere P} {p : P} (hs₁ : p ∈ s₁) (hs₂ : p ∈ s₂) :
    s₁.center = s₂.center ↔ s₁ = s₂ 
goal: s₁.center = s₂.center ↔ s₁ = s₂

full_name: EuclideanGeometry.Sphere.center_ne_iff_ne_of_mem
code: theorem Sphere.center_ne_iff_ne_of_mem {s₁ s₂ : Sphere P} {p : P} (hs₁ : p ∈ s₁) (hs₂ : p ∈ s₂) :
    s₁.center ≠ s₂.center ↔ s₁ ≠ s₂ 
goal: s₁.center ≠ s₂.center ↔ s₁ ≠ s₂

full_name: EuclideanGeometry.dist_center_eq_dist_center_of_mem_sphere
code: theorem dist_center_eq_dist_center_of_mem_sphere {p₁ p₂ : P} {s : Sphere P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) : dist p₁ s.center = dist p₂ s.center 
goal: dist p₁ s.center = dist p₂ s.center

full_name: EuclideanGeometry.dist_center_eq_dist_center_of_mem_sphere'
code: theorem dist_center_eq_dist_center_of_mem_sphere' {p₁ p₂ : P} {s : Sphere P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) : dist s.center p₁ = dist s.center p₂ 
goal: dist s.center p₁ = dist s.center p₂

full_name: EuclideanGeometry.Cospherical
code: /-- A set of points is cospherical if they are equidistant from some
point. In two dimensions, this is the same thing as being
concyclic. -/
def Cospherical (ps : Set P) : Prop 
goal: Prop

full_name: EuclideanGeometry.cospherical_def
code: /-- The definition of `Cospherical`. -/
theorem cospherical_def (ps : Set P) :
    Cospherical ps ↔ ∃ (center : P) (radius : ℝ), ∀ p ∈ ps, dist p center = radius 
goal: EuclideanGeometry.Cospherical ps ↔ ∃ center radius, ∀ p ∈ ps, dist p center = radius

full_name: EuclideanGeometry.cospherical_iff_exists_sphere
code: /-- A set of points is cospherical if and only if they lie in some sphere. -/
theorem cospherical_iff_exists_sphere {ps : Set P} :
    Cospherical ps ↔ ∃ s : Sphere P, ps ⊆ (s : Set P) 
goal: EuclideanGeometry.Cospherical ps ↔ ∃ s, ps ⊆ Metric.sphere s.center s.radius

full_name: EuclideanGeometry.Sphere.cospherical
code: /-- The set of points in a sphere is cospherical. -/
theorem Sphere.cospherical (s : Sphere P) : Cospherical (s : Set P) 
goal: EuclideanGeometry.Cospherical (Metric.sphere s.center s.radius)

full_name: EuclideanGeometry.Cospherical.subset
code: /-- A subset of a cospherical set is cospherical. -/
theorem Cospherical.subset {ps₁ ps₂ : Set P} (hs : ps₁ ⊆ ps₂) (hc : Cospherical ps₂) :
    Cospherical ps₁ 
goal: EuclideanGeometry.Cospherical ps₁

full_name: EuclideanGeometry.cospherical_empty
code: /-- The empty set is cospherical. -/
theorem cospherical_empty [Nonempty P] : Cospherical (∅ : Set P) 
goal: EuclideanGeometry.Cospherical ∅

full_name: EuclideanGeometry.cospherical_singleton
code: /-- A single point is cospherical. -/
theorem cospherical_singleton (p : P) : Cospherical ({p} : Set P) 
goal: EuclideanGeometry.Cospherical {p}

full_name: EuclideanGeometry.cospherical_pair
code: /-- Two points are cospherical. -/
theorem cospherical_pair (p₁ p₂ : P) : Cospherical ({p₁, p₂} : Set P) 
goal: EuclideanGeometry.Cospherical {p₁, p₂}

full_name: EuclideanGeometry.Concyclic.Coplanar
code: /-- A set of points is concyclic if it is cospherical and coplanar. (Most results are stated
directly in terms of `Cospherical` instead of using `Concyclic`.) -/
structure Concyclic (ps : Set P) : Prop where
  Cospherical : Cospherical ps
  Coplanar : Coplanar ℝ ps
goal: Coplanar ℝ ps

full_name: EuclideanGeometry.Concyclic
code: /-- A set of points is concyclic if it is cospherical and coplanar. (Most results are stated
directly in terms of `Cospherical` instead of using `Concyclic`.) -/
structure Concyclic (ps : Set P) : Prop where
  Cospherical : Cospherical ps
  Coplanar : Coplanar ℝ ps
goal: Prop

full_name: EuclideanGeometry.Concyclic.Cospherical
code: /-- A set of points is concyclic if it is cospherical and coplanar. (Most results are stated
directly in terms of `Cospherical` instead of using `Concyclic`.) -/
structure Concyclic (ps : Set P) : Prop where
  Cospherical : Cospherical ps
  Coplanar : Coplanar ℝ ps
goal: EuclideanGeometry.Cospherical ps

full_name: EuclideanGeometry.Concyclic.subset
code: /-- A subset of a concyclic set is concyclic. -/
theorem Concyclic.subset {ps₁ ps₂ : Set P} (hs : ps₁ ⊆ ps₂) (h : Concyclic ps₂) : Concyclic ps₁ 
goal: EuclideanGeometry.Concyclic ps₁

full_name: EuclideanGeometry.concyclic_empty
code: /-- The empty set is concyclic. -/
theorem concyclic_empty : Concyclic (∅ : Set P) 
goal: EuclideanGeometry.Concyclic ∅

full_name: EuclideanGeometry.concyclic_singleton
code: /-- A single point is concyclic. -/
theorem concyclic_singleton (p : P) : Concyclic ({p} : Set P) 
goal: EuclideanGeometry.Concyclic {p}

full_name: EuclideanGeometry.concyclic_pair
code: /-- Two points are concyclic. -/
theorem concyclic_pair (p₁ p₂ : P) : Concyclic ({p₁, p₂} : Set P) 
goal: EuclideanGeometry.Concyclic {p₁, p₂}

full_name: EuclideanGeometry.Cospherical.affineIndependent
code: /-- Any three points in a cospherical set are affinely independent. -/
theorem Cospherical.affineIndependent {s : Set P} (hs : Cospherical s) {p : Fin 3 → P}
    (hps : Set.range p ⊆ s) (hpi : Function.Injective p) : AffineIndependent ℝ p 
goal: AffineIndependent ℝ p

full_name: EuclideanGeometry.Cospherical.affineIndependent_of_mem_of_ne
code: /-- Any three points in a cospherical set are affinely independent. -/
theorem Cospherical.affineIndependent_of_mem_of_ne {s : Set P} (hs : Cospherical s) {p₁ p₂ p₃ : P}
    (h₁ : p₁ ∈ s) (h₂ : p₂ ∈ s) (h₃ : p₃ ∈ s) (h₁₂ : p₁ ≠ p₂) (h₁₃ : p₁ ≠ p₃) (h₂₃ : p₂ ≠ p₃) :
    AffineIndependent ℝ ![p₁, p₂, p₃] 
goal: AffineIndependent ℝ ![p₁, p₂, p₃]

full_name: EuclideanGeometry.Cospherical.affineIndependent_of_ne
code: /-- The three points of a cospherical set are affinely independent. -/
theorem Cospherical.affineIndependent_of_ne {p₁ p₂ p₃ : P} (hs : Cospherical ({p₁, p₂, p₃} : Set P))
    (h₁₂ : p₁ ≠ p₂) (h₁₃ : p₁ ≠ p₃) (h₂₃ : p₂ ≠ p₃) : AffineIndependent ℝ ![p₁, p₂, p₃] 
goal: AffineIndependent ℝ ![p₁, p₂, p₃]

full_name: EuclideanGeometry.inner_vsub_vsub_of_mem_sphere_of_mem_sphere
code: /-- Suppose that `p₁` and `p₂` lie in spheres `s₁` and `s₂`. Then the vector between the centers
of those spheres is orthogonal to that between `p₁` and `p₂`; this is a version of
`inner_vsub_vsub_of_dist_eq_of_dist_eq` for bundled spheres. (In two dimensions, this says that
the diagonals of a kite are orthogonal.) -/
theorem inner_vsub_vsub_of_mem_sphere_of_mem_sphere {p₁ p₂ : P} {s₁ s₂ : Sphere P} (hp₁s₁ : p₁ ∈ s₁)
    (hp₂s₁ : p₂ ∈ s₁) (hp₁s₂ : p₁ ∈ s₂) (hp₂s₂ : p₂ ∈ s₂) :
    ⟪s₂.center -ᵥ s₁.center, p₂ -ᵥ p₁⟫ = 0 
goal: ⟪s₂.center -ᵥ s₁.center, p₂ -ᵥ p₁⟫_ℝ = 0

full_name: EuclideanGeometry.eq_of_mem_sphere_of_mem_sphere_of_mem_of_finrank_eq_two
code: /-- Two spheres intersect in at most two points in a two-dimensional subspace containing their
centers; this is a version of `eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two` for bundled
spheres. -/
theorem eq_of_mem_sphere_of_mem_sphere_of_mem_of_finrank_eq_two {s : AffineSubspace ℝ P}
    [FiniteDimensional ℝ s.direction] (hd : finrank ℝ s.direction = 2) {s₁ s₂ : Sphere P}
    {p₁ p₂ p : P} (hs₁ : s₁.center ∈ s) (hs₂ : s₂.center ∈ s) (hp₁s : p₁ ∈ s) (hp₂s : p₂ ∈ s)
    (hps : p ∈ s) (hs : s₁ ≠ s₂) (hp : p₁ ≠ p₂) (hp₁s₁ : p₁ ∈ s₁) (hp₂s₁ : p₂ ∈ s₁) (hps₁ : p ∈ s₁)
    (hp₁s₂ : p₁ ∈ s₂) (hp₂s₂ : p₂ ∈ s₂) (hps₂ : p ∈ s₂) : p = p₁ ∨ p = p₂ 
goal: p = p₁ ∨ p = p₂

full_name: EuclideanGeometry.eq_of_mem_sphere_of_mem_sphere_of_finrank_eq_two
code: /-- Two spheres intersect in at most two points in two-dimensional space; this is a version of
`eq_of_dist_eq_of_dist_eq_of_finrank_eq_two` for bundled spheres. -/
theorem eq_of_mem_sphere_of_mem_sphere_of_finrank_eq_two [FiniteDimensional ℝ V]
    (hd : finrank ℝ V = 2) {s₁ s₂ : Sphere P} {p₁ p₂ p : P} (hs : s₁ ≠ s₂) (hp : p₁ ≠ p₂)
    (hp₁s₁ : p₁ ∈ s₁) (hp₂s₁ : p₂ ∈ s₁) (hps₁ : p ∈ s₁) (hp₁s₂ : p₁ ∈ s₂) (hp₂s₂ : p₂ ∈ s₂)
    (hps₂ : p ∈ s₂) : p = p₁ ∨ p = p₂ 
goal: p = p₁ ∨ p = p₂

full_name: EuclideanGeometry.inner_pos_or_eq_of_dist_le_radius
code: /-- Given a point on a sphere and a point not outside it, the inner product between the
difference of those points and the radius vector is positive unless the points are equal. -/
theorem inner_pos_or_eq_of_dist_le_radius {s : Sphere P} {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
    (hp₂ : dist p₂ s.center ≤ s.radius) : 0 < ⟪p₁ -ᵥ p₂, p₁ -ᵥ s.center⟫ ∨ p₁ = p₂ 
goal: 0 < ⟪p₁ -ᵥ p₂, p₁ -ᵥ s.center⟫_ℝ ∨ p₁ = p₂

full_name: EuclideanGeometry.inner_nonneg_of_dist_le_radius
code: /-- Given a point on a sphere and a point not outside it, the inner product between the
difference of those points and the radius vector is nonnegative. -/
theorem inner_nonneg_of_dist_le_radius {s : Sphere P} {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
    (hp₂ : dist p₂ s.center ≤ s.radius) : 0 ≤ ⟪p₁ -ᵥ p₂, p₁ -ᵥ s.center⟫ 
goal: 0 ≤ ⟪p₁ -ᵥ p₂, p₁ -ᵥ s.center⟫_ℝ

full_name: EuclideanGeometry.inner_pos_of_dist_lt_radius
code: /-- Given a point on a sphere and a point inside it, the inner product between the difference of
those points and the radius vector is positive. -/
theorem inner_pos_of_dist_lt_radius {s : Sphere P} {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
    (hp₂ : dist p₂ s.center < s.radius) : 0 < ⟪p₁ -ᵥ p₂, p₁ -ᵥ s.center⟫ 
goal: 0 < ⟪p₁ -ᵥ p₂, p₁ -ᵥ s.center⟫_ℝ

full_name: EuclideanGeometry.wbtw_of_collinear_of_dist_center_le_radius
code: /-- Given three collinear points, two on a sphere and one not outside it, the one not outside it
is weakly between the other two points. -/
theorem wbtw_of_collinear_of_dist_center_le_radius {s : Sphere P} {p₁ p₂ p₃ : P}
    (h : Collinear ℝ ({p₁, p₂, p₃} : Set P)) (hp₁ : p₁ ∈ s) (hp₂ : dist p₂ s.center ≤ s.radius)
    (hp₃ : p₃ ∈ s) (hp₁p₃ : p₁ ≠ p₃) : Wbtw ℝ p₁ p₂ p₃ 
goal: Wbtw ℝ p₁ p₂ p₃

full_name: EuclideanGeometry.sbtw_of_collinear_of_dist_center_lt_radius
code: /-- Given three collinear points, two on a sphere and one inside it, the one inside it is
strictly between the other two points. -/
theorem sbtw_of_collinear_of_dist_center_lt_radius {s : Sphere P} {p₁ p₂ p₃ : P}
    (h : Collinear ℝ ({p₁, p₂, p₃} : Set P)) (hp₁ : p₁ ∈ s) (hp₂ : dist p₂ s.center < s.radius)
    (hp₃ : p₃ ∈ s) (hp₁p₃ : p₁ ≠ p₃) : Sbtw ℝ p₁ p₂ p₃ 
goal: Sbtw ℝ p₁ p₂ p₃