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
Conversation
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).
It would be neat to generalize this to show:
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 |
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
My inclination is that the most natural version of bundled spheres bundles 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. |
I'm sorry about the delay. Start of academic year is always difficult, and this is Covid year... |
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).
Pull request successfully merged into master. Build succeeded: |
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.
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.
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).