Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(geometry/euclidean/basic): intersections of circles #4088

Closed
wants to merge 6 commits into from

Conversation

jsm28
Copy link
Collaborator

@jsm28 jsm28 commented Sep 9, 2020

Add two versions of the statement that two circles in two-dimensional
space intersect in at most two points, along with some lemmas involved
in the proof (some of which can be interpreted in terms of
intersections of circles or spheres and lines).


Add two versions of the statement that two circles in two-dimensional
space intersect in at most two points, along with some lemmas involved
in the proof (some of which can be interpreted in terms of
intersections of circles or spheres and lines).
@jsm28 jsm28 added the awaiting-review The author would like community review of the PR label Sep 9, 2020
@eric-wieser
Copy link
Member

eric-wieser commented Sep 10, 2020

It would be neat to generalize this to show:

  • If it exists, the intersection of two (n-1)-spheres in n dimensions is a n-2 sphere in an n-1 dimensional affine space
  • There are at most two points on a 0-sphere

I think the first one can be stated something like

/-- A circular subspace -/
variables (P)
structure circle :=
(c : P)
(r : ℝ)
(direction : submodule ℝ V)
variables {P}

namespace circle

def subspace (c : circle P) : affine_subspace ℝ P := affine_subspace.mk' c.c c.direction

instance : has_mem P (circle P) := ⟨
  λ p c, dist p c.c = c.r ∧ p ∈ c.subspace
⟩

end circle

lemma mem_circle_inter
  {p : P}
  {c₁ c₂ : circle P}
  (hc : c₁.c ≠ c₂.c)
  (hc2 : c₁.subspace = c₂.subspace)
  (hpc₁ : p ∈ c₁)
  (hpc₂ : p ∈ c₂) :
    p ∈ let d := c₂.c -ᵥ c₁.c in 
      circle.mk
        (((inner d d + c₁.r*c₁.r - c₂.r*c₂.r) / inner d d) • d +ᵥ c₁.c)
        sorry -- too lazy to write this right now
        (c₁.direction ⊓ (submodule.span ℝ {d}).orthogonal) :=
begin
  sorry
end

@jsm28
Copy link
Collaborator Author

jsm28 commented Sep 10, 2020

My inclination is that the most natural version of bundled spheres bundles center, radius and probably radius_pos to require being non-degenerate, but not a direction, so is a sphere in whatever dimension the ambient Euclidean space is, rather than in a subspace. Then you'd define sphere.power, define sphere.radical_subspace and show it contains exactly the points of equal power with respect to both spheres, and deduce that the intersection lies within the radical subspace because points in both spheres have power 0 with respect to both spheres (if the spheres are concentric, the definition of the radical subspace ought to give the empty subspace if the radii are different and the whole space if they are equal, for the above properties to hold). I'm less sure of the use of a version of bundled spheres that bundles a direction as well, versus providing the direction separately when relevant.

Anyway, I think the specific results about intersections of circles are useful in unbundled form in terms of equal distances, not just in a form with bundled spheres; that quite a lot would need to be done to get bundled spheres cleanly to a point where they are helpful for such unbundled results; and that much of the complexity is simply what you get when manipulating things in a particular concrete dimension such as dimension 2 so a proof based on bundled spheres wouldn't actually be much simpler.

@PatrickMassot
Copy link
Member

I'm sorry about the delay. Start of academic year is always difficult, and this is Covid year...
bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Sep 18, 2020
bors bot pushed a commit that referenced this pull request Sep 18, 2020
Add two versions of the statement that two circles in two-dimensional
space intersect in at most two points, along with some lemmas involved
in the proof (some of which can be interpreted in terms of
intersections of circles or spheres and lines).
@bors
Copy link

bors bot commented Sep 18, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(geometry/euclidean/basic): intersections of circles [Merged by Bors] - feat(geometry/euclidean/basic): intersections of circles Sep 18, 2020
@bors bors bot closed this Sep 18, 2020
@bors bors bot deleted the circle-intersection branch September 18, 2020 21:07
jsm28 added a commit that referenced this pull request Aug 21, 2022
Define a bundled `sphere` structure, for various uses in Euclidean
geometry where it's convenient to pass around `center` and `radius`
together.

Some basic API is set up for this structure, including `sphere`
versions of a few existing lemmas that could naturally be expressed in
that way.  The construction of `circumcenter` and `circumradius` is
also changed to pass around a `sphere` instead of using `P × ℝ`.  It
is likely that other existing lemmas can usefully have bundled sphere
versions added in followups.  Certainly there are plenty of other
definitions and results about spheres that can usefully be built up on
top of this basic API.

Notes:

* As with `cospherical`, the definition and some of the most basic
  lemmas don't actually need anything more than the metric space
  structure.  `sphere` is defined alongside `cospherical`, but it
  would also be reasonable to define both in some metric space file.
  In that case, the name of `sphere` would need to change to avoid
  conflicts with the existing `metric.sphere` (which is part of a
  family of unbundled definitions with `metric.ball` and
  `metric.closed_ball`, so should probably remain as-is).

* The definition doesn't include any non-degeneracy conditions, so
  avoiding the need for users to prove such conditions when
  constructing a `sphere` for a lemma that doesn't need them.  Note
  that the base case for the induction constructing the circumsphere
  uses a radius of zero.

* I haven't forgotten the discussion in #4088 of simplifying the proof
  of `eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two` using bundled
  spheres, a definition of the radical subspace and a proof that a
  one-dimensional sphere has at most two points (so ending up proving
  the unbundled lemma using the bundled one rather than vice versa),
  but I think quite a lot more API about power of a point and radical
  subspaces would still need adding before that could be done.
bors bot pushed a commit that referenced this pull request Oct 5, 2022
Define a bundled `sphere` structure, for various uses in Euclidean
geometry where it's convenient to pass around `center` and `radius`
together.

Some basic API is set up for this structure, including `sphere`
versions of a few existing lemmas that could naturally be expressed in
that way.  The construction of `circumcenter` and `circumradius` is
also changed to pass around a `sphere` instead of using `P × ℝ`.  It
is likely that other existing lemmas can usefully have bundled sphere
versions added in followups.  Certainly there are plenty of other
definitions and results about spheres that can usefully be built up on
top of this basic API.

Notes:

* As with `cospherical`, the definition and some of the most basic
  lemmas don't actually need anything more than the metric space
  structure.  `sphere` is defined alongside `cospherical`, but it
  would also be reasonable to define both in some metric space file.
  In that case, the name of `sphere` would need to change to avoid
  conflicts with the existing `metric.sphere` (which is part of a
  family of unbundled definitions with `metric.ball` and
  `metric.closed_ball`, so should probably remain as-is).

* The definition doesn't include any non-degeneracy conditions, so
  avoiding the need for users to prove such conditions when
  constructing a `sphere` for a lemma that doesn't need them.  Note
  that the base case for the induction constructing the circumsphere
  uses a radius of zero.

* I haven't forgotten the discussion in #4088 of simplifying the proof
  of `eq_of_dist_eq_of_dist_eq_of_mem_of_finrank_eq_two` using bundled
  spheres, a definition of the radical subspace and a proof that a
  one-dimensional sphere has at most two points (so ending up proving
  the unbundled lemma using the bundled one rather than vice versa),
  but I think quite a lot more API about power of a point and radical
  subspaces would still need adding before that could be done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants