Skip to content

feat(Geometry/Euclidean/Sphere): define arcs on spheres - #34164

Open
Scarlett-le wants to merge 22 commits into
leanprover-community:masterfrom
Scarlett-le:feat/sphere-arc
Open

Scarlett-le wants to merge 22 commits into
leanprover-community:masterfrom
Scarlett-le:feat/sphere-arc

Conversation

@Scarlett-le

@Scarlett-le Scarlett-le commented Jan 20, 2026 •

Copy link
Copy Markdown
Contributor

This PR defines arcs on spheres and proves basic properties.

Main definitions

  • EuclideanGeometry.Sphere.Arc: An arc on a sphere, defined by a left
    endpoint and a midpoint on the sphere. The right endpoint is computed as
    the reflection of left across the line through the center and mid.
  • Arc.opposite: The opposite arc (same endpoints, antipodal mid).
  • Arc.oppositeEquiv: The involution given by opposite.
  • Arc.minor / Arc.major: The minor/major arc between two
    non-diametrically-opposite points.
  • Arc.through: The arc from A to C passing through B.
  • Arc.avoiding: The arc from A to C not passing through B.

Main results

  • through_right / avoiding_right: The right endpoint equals C.
  • mem_interior_through / mem_through: B lies in the through arc.
  • not_mem_avoiding: B does not lie in the avoiding arc (when A ≠ C).

Dependencies

@github-actions github-actions Bot added the t-euclidean-geometry Affine and axiomatic geometry label Jan 20, 2026
@github-actions

github-actions Bot commented Jan 20, 2026 •

Copy link
Copy Markdown

PR summary b3084c7b64

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Geometry.Euclidean.Sphere.OrthRadius 2188 2191 +3 (+0.14%)
Import changes for all files
Files Import difference
6 files Mathlib.Geometry.Euclidean.Angle.Incenter Mathlib.Geometry.Euclidean.Angle.Sphere Mathlib.Geometry.Euclidean.Incenter Mathlib.Geometry.Euclidean.NinePointCircle Mathlib.Geometry.Euclidean.Sphere.Power Mathlib.Geometry.Euclidean.Sphere.Ptolemy
2
Mathlib.Geometry.Euclidean.Sphere.OrthRadius Mathlib.Geometry.Euclidean.Sphere.Tangent 3
Mathlib.Geometry.Euclidean.Sphere.Arc.Basic (new file) 2287

Declarations diff (regex)

+ Arc
+ Sphere.radius_ne_zero_of_mem_of_mem_of_ne
+ avoiding
+ avoiding_left
+ avoiding_mid
+ avoiding_opposite
+ avoiding_right
+ coe_eq_interior_union_endpoints
+ coe_eq_singleton_iff_mid_eq_left
+ eq_minor_or_eq_major_of_ne
+ eq_of_left_eq_of_right_eq_of_sSameSide_mid
+ eq_or_eq_opposite_of_left_eq_of_right_eq
+ inner_mid_vsub_center_right_vsub_left
+ instance : CoeTC (Arc s) (Set P)
+ instance : Membership P (Arc s)
+ interior
+ interior_eq_empty_of_mid_eq_left
+ interior_subset
+ left_eq_right_iff_mem_line
+ left_eq_right_of_left_eq_mid
+ left_eq_right_of_mid_eq_right
+ left_mem_arc
+ left_mem_lineOrOrthRadius
+ lineOrOrthRadius
+ lineOrOrthRadius_comm
+ lineOrOrthRadius_of_eq
+ lineOrOrthRadius_of_ne
+ line_center_mid_le_perpBisector
+ line_center_opposite_mid
+ major
+ major_left
+ major_mid
+ major_opposite_eq_minor
+ major_right
+ mem_iff
+ mem_iff_wSameSide
+ mem_interior_iff
+ mem_interior_iff_mem_and_ne
+ mem_interior_of_mem_of_ne_left_of_ne_right
+ mem_interior_through
+ mem_lineOrOrthRadius_iff_of_mem_sphere
+ mem_of_mem_interior
+ mem_sphere_of_mem_interior
+ mem_through
+ mid_eq_pointReflection_center_left_of_left_eq_right_of_mid_ne_left
+ mid_mem_arc
+ mid_mem_interior
+ mid_notMem_line
+ mid_notMem_lineOrOrthRadius
+ midpoint_mid_opposite_mid
+ minor
+ minorMidpoint
+ minorMidpoint_comm
+ minorMidpoint_mem
+ minorMidpoint_self
+ minor_left
+ minor_mid
+ minor_ne_major
+ minor_opposite_eq_major
+ minor_right
+ ne_left_of_mem_interior
+ ne_right_of_mem_interior
+ notMem_avoiding
+ notMem_lineOrOrthRadius_of_mem_interior
+ notMem_lineOrOrthRadius_of_mem_sphere
+ not_wSameSide_mid_of_mem_sphere_of_notMem
+ opposite
+ opposite_involutive
+ opposite_left
+ opposite_mid_notMem_line
+ opposite_mid_vsub_center
+ opposite_opposite
+ opposite_right
+ pointReflection_center_mem
+ right
+ right_eq_reflection
+ right_mem
+ right_mem_arc
+ right_mem_lineOrOrthRadius
+ sOppSide_mid_opposite_mid
+ sOppSide_mid_opposite_mid_line
+ sSameSide_of_mem_interior
+ sSameSide_opposite_mid_iff
+ sbtw_mid_midpoint_opposite_mid
+ sum_vsub_center_ne_zero_of_not_isDiameter
+ through
+ throughMidpoint
+ throughMidpoint_eq_antipodal_of_eq
+ throughMidpoint_mem
+ through_left
+ through_mid
+ through_opposite
+ through_right
+ through_self_eq_major_self

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit b3084c7).

  • +115 new declarations
  • −0 removed declarations
+EuclideanGeometry.Sphere.Arc
+EuclideanGeometry.Sphere.Arc.avoiding
+EuclideanGeometry.Sphere.Arc.avoiding.congr_simp
+EuclideanGeometry.Sphere.Arc.avoiding_left
+EuclideanGeometry.Sphere.Arc.avoiding_mid
+EuclideanGeometry.Sphere.Arc.avoiding_opposite
+EuclideanGeometry.Sphere.Arc.avoiding_right
+EuclideanGeometry.Sphere.Arc.casesOn
+EuclideanGeometry.Sphere.Arc.coe_eq_interior_union_endpoints
+EuclideanGeometry.Sphere.Arc.coe_eq_singleton_iff_mid_eq_left
+EuclideanGeometry.Sphere.Arc.ctorIdx
+EuclideanGeometry.Sphere.Arc.eq_minor_or_eq_major_of_ne
+EuclideanGeometry.Sphere.Arc.eq_of_left_eq_of_right_eq_of_sSameSide_mid
+EuclideanGeometry.Sphere.Arc.eq_or_eq_opposite_of_left_eq_of_right_eq
+EuclideanGeometry.Sphere.Arc.ext
+EuclideanGeometry.Sphere.Arc.ext_iff
+EuclideanGeometry.Sphere.Arc.inner_mid_vsub_center_right_vsub_left
+EuclideanGeometry.Sphere.Arc.instCoeTCSet
+EuclideanGeometry.Sphere.Arc.instMembership
+EuclideanGeometry.Sphere.Arc.interior
+EuclideanGeometry.Sphere.Arc.interior_eq_empty_of_mid_eq_left
+EuclideanGeometry.Sphere.Arc.interior_subset
+EuclideanGeometry.Sphere.Arc.left
+EuclideanGeometry.Sphere.Arc.left_eq_right_iff_mem_line
+EuclideanGeometry.Sphere.Arc.left_eq_right_of_left_eq_mid
+EuclideanGeometry.Sphere.Arc.left_eq_right_of_mid_eq_right
+EuclideanGeometry.Sphere.Arc.left_mem
+EuclideanGeometry.Sphere.Arc.left_mem_arc
+EuclideanGeometry.Sphere.Arc.line_center_mid_le_perpBisector
+EuclideanGeometry.Sphere.Arc.line_center_opposite_mid
+EuclideanGeometry.Sphere.Arc.major
+EuclideanGeometry.Sphere.Arc.major_left
+EuclideanGeometry.Sphere.Arc.major_mid
+EuclideanGeometry.Sphere.Arc.major_opposite_eq_minor
+EuclideanGeometry.Sphere.Arc.major_right
+EuclideanGeometry.Sphere.Arc.mem_iff
+EuclideanGeometry.Sphere.Arc.mem_iff_wSameSide
+EuclideanGeometry.Sphere.Arc.mem_interior_iff
+EuclideanGeometry.Sphere.Arc.mem_interior_iff_mem_and_ne
+EuclideanGeometry.Sphere.Arc.mem_interior_of_mem_of_ne_left_of_ne_right
+EuclideanGeometry.Sphere.Arc.mem_interior_through
+EuclideanGeometry.Sphere.Arc.mem_of_mem_interior
+EuclideanGeometry.Sphere.Arc.mem_sphere_of_mem_interior
+EuclideanGeometry.Sphere.Arc.mem_through
+EuclideanGeometry.Sphere.Arc.mid
+EuclideanGeometry.Sphere.Arc.mid_eq_pointReflection_center_left_of_left_eq_right_of_mid_ne_left
+EuclideanGeometry.Sphere.Arc.mid_mem
+EuclideanGeometry.Sphere.Arc.mid_mem_arc
+EuclideanGeometry.Sphere.Arc.mid_mem_interior
+EuclideanGeometry.Sphere.Arc.mid_notMem_line
+EuclideanGeometry.Sphere.Arc.mid_notMem_lineOrOrthRadius
+EuclideanGeometry.Sphere.Arc.midpoint_mid_opposite_mid
+EuclideanGeometry.Sphere.Arc.minor
+EuclideanGeometry.Sphere.Arc.minor.congr_simp
+EuclideanGeometry.Sphere.Arc.minorMidpoint
+EuclideanGeometry.Sphere.Arc.minorMidpoint_comm
+EuclideanGeometry.Sphere.Arc.minorMidpoint_mem
+EuclideanGeometry.Sphere.Arc.minorMidpoint_self
+EuclideanGeometry.Sphere.Arc.minor_left
+EuclideanGeometry.Sphere.Arc.minor_mid
+EuclideanGeometry.Sphere.Arc.minor_ne_major
+EuclideanGeometry.Sphere.Arc.minor_opposite_eq_major
+EuclideanGeometry.Sphere.Arc.minor_right
+EuclideanGeometry.Sphere.Arc.mk
+EuclideanGeometry.Sphere.Arc.mk.congr_simp
+EuclideanGeometry.Sphere.Arc.mk.inj
+EuclideanGeometry.Sphere.Arc.mk.injEq
+EuclideanGeometry.Sphere.Arc.mk.noConfusion
+EuclideanGeometry.Sphere.Arc.mk.sizeOf_spec
+EuclideanGeometry.Sphere.Arc.ne_left_of_mem_interior
+EuclideanGeometry.Sphere.Arc.ne_right_of_mem_interior
+EuclideanGeometry.Sphere.Arc.noConfusion
+EuclideanGeometry.Sphere.Arc.noConfusionType
+EuclideanGeometry.Sphere.Arc.notMem_avoiding
+EuclideanGeometry.Sphere.Arc.notMem_lineOrOrthRadius_of_mem_interior
+EuclideanGeometry.Sphere.Arc.not_wSameSide_mid_of_mem_sphere_of_notMem
+EuclideanGeometry.Sphere.Arc.opposite
+EuclideanGeometry.Sphere.Arc.opposite_involutive
+EuclideanGeometry.Sphere.Arc.opposite_left
+EuclideanGeometry.Sphere.Arc.opposite_mid_notMem_line
+EuclideanGeometry.Sphere.Arc.opposite_mid_vsub_center
+EuclideanGeometry.Sphere.Arc.opposite_opposite
+EuclideanGeometry.Sphere.Arc.opposite_right
+EuclideanGeometry.Sphere.Arc.rec
+EuclideanGeometry.Sphere.Arc.recOn
+EuclideanGeometry.Sphere.Arc.right
+EuclideanGeometry.Sphere.Arc.right_eq_reflection
+EuclideanGeometry.Sphere.Arc.right_mem
+EuclideanGeometry.Sphere.Arc.right_mem_arc
+EuclideanGeometry.Sphere.Arc.sOppSide_mid_opposite_mid
+EuclideanGeometry.Sphere.Arc.sOppSide_mid_opposite_mid_line
+EuclideanGeometry.Sphere.Arc.sSameSide_of_mem_interior
+EuclideanGeometry.Sphere.Arc.sSameSide_opposite_mid_iff
+EuclideanGeometry.Sphere.Arc.sbtw_mid_midpoint_opposite_mid
+EuclideanGeometry.Sphere.Arc.sum_vsub_center_ne_zero_of_not_isDiameter
+EuclideanGeometry.Sphere.Arc.through
+EuclideanGeometry.Sphere.Arc.through.congr_simp
+EuclideanGeometry.Sphere.Arc.throughMidpoint
+EuclideanGeometry.Sphere.Arc.throughMidpoint_eq_antipodal_of_eq
+EuclideanGeometry.Sphere.Arc.throughMidpoint_mem
+EuclideanGeometry.Sphere.Arc.through_left
+EuclideanGeometry.Sphere.Arc.through_mid
+EuclideanGeometry.Sphere.Arc.through_opposite
+EuclideanGeometry.Sphere.Arc.through_right
+EuclideanGeometry.Sphere.Arc.through_self_eq_major_self
+EuclideanGeometry.Sphere.left_mem_lineOrOrthRadius
+EuclideanGeometry.Sphere.lineOrOrthRadius
+EuclideanGeometry.Sphere.lineOrOrthRadius_comm
+EuclideanGeometry.Sphere.lineOrOrthRadius_of_eq
+EuclideanGeometry.Sphere.lineOrOrthRadius_of_ne
+EuclideanGeometry.Sphere.mem_lineOrOrthRadius_iff_of_mem_sphere
+EuclideanGeometry.Sphere.notMem_lineOrOrthRadius_of_mem_sphere
+EuclideanGeometry.Sphere.pointReflection_center_mem
+EuclideanGeometry.Sphere.radius_ne_zero_of_mem_of_mem_of_ne
+EuclideanGeometry.Sphere.right_mem_lineOrOrthRadius

No changes to strong technical debt.

Increase in weak tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type (weak)
4934 1 exposed public sections

Current commit b3084c7b64
Reference commit 3a2e014f23

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@jsm28

jsm28 commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

I don't think this is the right way to set up arcs.

Most importantly, I think the choice between two possible arcs between two points should be part of the data included in an Arc; rather than having minorSet and majorSet definitions for an arc, the choice would be made when constructing an Arc (and it would be possible to have arcs on a diameter, which aren't meaningfully covered in this definition at all). And there would be an involution defined (as a bundled Equiv) that goes from one arc between two points to the opposite arc between those two points.

There are four common ways to construct an arc between A and C in geometry problems, each of which should have a corresponding definition to construct an Arc. You can take the major arc AC, the minor arc AC, the arc ABC or the arc AC not passing through B. Problem 6 at https://www.egmo.org/egmos/egmo12/paper-day2-English.pdf is an example of a geometry problem that uses both the latter two constructions, described as "the arcs AC and AB that do not contain the third vertex" and "arc BAC (the arc BC containing A)". All of these constructions require A and C (and B as applicable) to be on the circle; major and minor arcs require that AC is not a diameter; arc ABC and arc AC not through B require that B does not equal A or C. I think the degenerate cases of an arc that is a single point or the whole circle should be allowed.

As for how to express that in Lean: I think the Arc type should take the Sphere as a parameter (rather than having it as a structure field). I think there should be fields left and midpoint (and left_mem and midpoint_mem), from which you can construct right as the reflection of left in the line through the center of the sphere and midpoint.

Then for membership of an arc, don't define it with angles (probably wouldn't work for arcs on a diameter). Rather, define membership (Membership instance and matching coercion to a Set of points) using the property of points being in the sphere and weakly on the same side (WSameSide) of the line through left and right as midpoint is. For the case of points being specified as in the interior of an arc, there should also be an interior definition, producing the set of points in the sphere that are strictly on the same side (SSameSide) of that line as midpoint.

For these definitions, "line" is normally line[ℝ, left, right], but that doesn't do the right thing in the degenerate case when left = right. To handle that degenerate case correctly, I think there should be a definition lineOrOrthRadius that produces the line through two points when they are different, and the orthRadius at the point when they are the same. For two points on a circle, this definition is the chord between those points and becomes the tangent when they are equal, which is often the correct limiting value for the chord between two points. (I don't suggest that this definition be limited to the case of points lying on the sphere, even if it's mainly expected to be useful in that case.) Then, the above definitions of membership would apply WSameSide and SSameSide to s.lineOrOrthRadius left right (where s is the sphere). And of course there would be API lemmas defined with Iff.rfl for those exact definitions, plus ones using line for the common case of different points, plus other ones relating this definition to one with angles if you wish (but I think the ones based on sides are much more likely to be useful in practice for geometry problems, because information about sides is what you want to e.g. translate between oriented and unoriented angles).

@jsm28 jsm28 added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jan 20, 2026
@jsm28

jsm28 commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

I think the only case where my suggested approach behaves suboptimally is the degenerate one when left = right, midpoint is the diametrically opposite point and the ambient space is more than 2-dimensional, in which case the Arc is the whole sphere, not just an arc contained in a plane. I don't think that's sufficient to justify including a plane (with the center and left in that plane) as part of the data, to ensure it really is always just an arc, however.

@Scarlett-le

Copy link
Copy Markdown
Contributor Author

I think the only case where my suggested approach behaves suboptimally is the degenerate one when left = right, midpoint is the diametrically opposite point and the ambient space is more than 2-dimensional, in which case the Arc is the whole sphere, not just an arc contained in a plane. I don't think that's sufficient to justify including a plane (with the center and left in that plane) as part of the data, to ensure it really is always just an arc, however.

Thank you for the detailed and thoughtful review. I agree with your analysis—the current design has several issues, particularly with diameter cases and the separation of arc selection from the data structure.

I understand the suggested approach:

  • Make Sphere a parameter rather than a field
  • Store left and midpoint, deriving right via reflection
  • Define membership using WSameSide/SSameSide instead of angles
  • Introduce lineOrOrthRadius to handle the degenerate case when left = right
  • Provide four standard constructors (major, minor, through B, avoiding B)
  • Allow degenerate cases (single-point arc, whole circle) at the type level

I've drafted a rough sketch of the new design below. Could you take a look and let me know if I'm on the right track?

structure Arc (s : Sphere Pt) where
  left : Pt
  midpoint : Pt
  left_mem : left ∈ s
  midpoint_mem : midpoint ∈ s

-- Helper definition: chord or tangent line
def lineOrOrthRadius (s : Sphere Pt) (P Q : Pt) : AffineSubspace ℝ Pt :=
  if P = Q then s.orthRadius P else affineSpan ℝ {P, Q}

variable {s : Sphere Pt}

-- right is computed via reflection of left across the line through center and midpoint
def Arc.right (a : Arc s) : Pt :=
  reflection (line[ℝ, s.center, a.midpoint]) a.left

instance (s : Sphere Pt) : Membership Pt (Arc s) where
  mem := fun (P : Pt) (a : Arc s) => P ∈ s ∧ (lineOrOrthRadius s a.left a.right).WSameSide a.midpoint P

instance (s : Sphere Pt) : CoeTC (Arc s) (Set Pt) where
  coe := fun (a : Arc s) => { P : Pt | P ∈ a }

-- Interior of an arc (using sSameSide)
def Arc.interior (a : Arc s) : Set Pt :=
  { P | P ∈ s ∧ (s.lineOrOrthRadius a.left a.right).SSameSide a.midpoint P }

-- Predicate for non-degenerate arcs
def Arc.Nontrivial (a : Arc s) : Prop := a.midpoint ≠ a.left

-- Four standard constructors

-- Major arc from A to C (requires AC is not a diameter)
def Arc.major (s : Sphere Pt) (A C : Pt) (hA : A ∈ s) (hC : C ∈ s)
    (hne : A ≠ C) (hNotDiam : ¬s.IsDiameter A C) : Arc s := sorry

-- Minor arc from A to C (requires AC is not a diameter)
def Arc.minor (s : Sphere Pt) (A C : Pt) (hA : A ∈ s) (hC : C ∈ s)
    (hne : A ≠ C) (hNotDiam : ¬s.IsDiameter A C) : Arc s := sorry

-- Arc from A to C passing through B (requires B ≠ A and B ≠ C)
def Arc.through (s : Sphere Pt) (A B C : Pt) (hA : A ∈ s) (hB : B ∈ s) (hC : C ∈ s)
    (hBA : B ≠ A) (hBC : B ≠ C) : Arc s := sorry

-- Arc from A to C avoiding B (requires B ≠ A and B ≠ C)
def Arc.avoiding (s : Sphere Pt) (A C B : Pt) (hA : A ∈ s) (hB : B ∈ s) (hC : C ∈ s)
    (hBA : B ≠ A) (hBC : B ≠ C) : Arc s := sorry

-- Involution: opposite arc between the same endpoints
-- Uses the antipodal point of midpoint (point reflection through center)
def Arc.opposite (a : Arc s) : Arc s where
  left := a.left
  midpoint := AffineEquiv.pointReflection ℝ s.center a.midpoint  -- antipodal point
  left_mem := a.left_mem
  midpoint_mem := sorry  -- needs proof that antipodal point is on sphere

-- Bundled equivalence
def Arc.oppositeEquiv : Arc s ≃ Arc s where
  toFun := Arc.opposite
  invFun := Arc.opposite
  left_inv := sorry
  right_inv := sorry

I'll continue working on this and appreciate any feedback on the overall direction.

@jsm28

jsm28 commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Yes, that seems along the right lines. I'd be inclined to put lineOrOrthRadius in OrthRadius.lean (with associated API), and the line notation should be used when referring to the span of two points. You shouldn't need A ≠ C for major or minor arcs.

@Scarlett-le

Copy link
Copy Markdown
Contributor Author

The original design of through and avoiding included proof arguments (hB : B ∈ s), (hB_ne_A : B ≠ A), and (hB_ne_C : B ≠ C) to ensure mathematical correctness. However, these arguments were not used in the current implementation, causing the unusedArguments linter to fail. I've removed them for now.

I'm not entirely sure if the current design of through is optimal. The intent is to construct an arc from A to C that passes through B, but without using those conditions in the definition itself, the API feels incomplete.

I plan to add the following lemmas in a future PR to properly utilize these conditions:

  • mem_through: proves that B lies on the arc through
  • mem_through_interior: proves that B lies in the interior of through
  • not_mem_avoiding_interior: proves that B does not lie in the interior of avoiding

These lemmas require some key supporting results (likely about WSameSide and SSameSide relationships) that are not yet available. I'll work on this in a subsequent PR.

@jsm28

jsm28 commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

The problem with your definitions of through and avoiding is the hNotDiam hypothesis; an arc between two points, through or avoiding a third, is entirely meaningful whether or not the two points are a diameter.

Suggested approach for finding throughMidpoint: don't base it on minorMidpoint; rather, project B onto the lineOrOrthRadius between A and C, subtract that from B to get a vector, and add an appropriate (always positive) multiple of that vector to the midpoint of AC. (This requires a two-dimensional space to work properly - or more generally that A, B, C, center are all coplanar so a great circle arc through ABC exists, but probably define through and avoiding for a two-dimensional space.)

@Scarlett-le

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've redesigned through and avoiding based on your feedback:

  • Removed hNotDiam: now takes (hB : B ∈ s) (hBA : B ≠ A) (hBC : B ≠ C) instead.
  • New midpoint construction: throughMidpoint is built from perpToLineOrOrthRadius (the component of B -ᵥ A perpendicular to s.lineOrOrthRadius A C), normalized onto the sphere. This handles the diameter case uniformly without relying on minorMidpoint.

through_right and avoiding_right are deferred to a follow-up PR — they require a reflection identity that needs some supporting lemmas about 2D inner product spaces (with a [Fact (finrank ℝ V = 2)] assumption). The through_eq_minor_or_major relationship will also be in that PR.

@jsm28

jsm28 commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

I'd say that through_right, avoiding_right, plus the two lemmas that the specified second point lies in through and does not lie in avoiding, are basic API lemmas to justify that the definitions through and avoiding actually correspond to the intended informal concepts, so should be included in this PR, and if they need lemmas elsewhere, those should be added in a preparatory PR and this PR should be made to depend on that one.

The main eq_major_or_minor lemma shouldn't be specifically about through, it should be for any arc whose left and right are not a diameter (any such arc must be either the major arc or the minor arc between those two points).

@Scarlett-le

Copy link
Copy Markdown
Contributor Author

Thanks for the guidance. through_right, avoiding_right, mem_interior_through (B lies in the interior of the through arc), mem_through, and not_mem_avoiding (B does not lie in the avoiding arc when A ≠ C) are now all included in this PR.

For eq_minor_or_major, I agree it should be stated for any arc with non-diameter endpoints, not specifically about through. The proof requires establishing an inner-product characterization of WSameSide on the chord line (using the perpendicularity of the chord direction and the sum of radial vectors), which needs some preparatory work. I'll add it in a follow-up PR.

@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Mar 10, 2026
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 4, 2026
@Scarlett-le
Scarlett-le force-pushed the feat/sphere-arc branch 3 times, most recently from 46fd210 to 7235ddb Compare June 4, 2026 05:07
@Scarlett-le
Scarlett-le temporarily deployed to cache-upload-forks June 4, 2026 05:09 — with GitHub Actions Inactive
@Scarlett-le
Scarlett-le temporarily deployed to cache-upload-forks June 5, 2026 04:07 — with GitHub Actions Inactive
@Scarlett-le
Scarlett-le temporarily deployed to cache-upload-forks June 5, 2026 04:20 — with GitHub Actions Inactive
@Scarlett-le

Copy link
Copy Markdown
Contributor Author

-awaiting-author

@github-actions github-actions Bot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jun 25, 2026
@wwylele

wwylele commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

There is a specific way to list dependencies in the PR description. Could you check the PR template that explains it?

Add:
- `Arc.inner_mid_vsub_center_right_vsub_left`: the vector from `s.center`
  to `a.mid` is orthogonal to the chord `a.right -ᵥ a.left`.
- `Arc.sOppSide_mid_opposite_mid`: in 2D, an arc's mid and the opposite
  arc's mid lie on strictly opposite sides of the chord.
- `Arc.sSameSide_opposite_mid_iff`: in 2D, `a.opposite.mid` lies strictly
  on the same side of the chord as `s.center` iff `a.mid` does not.

Refactor `mem_interior_through` and `not_mem_avoiding` to use
`real_inner_sub_smul_div_inner_self_eq_zero`, `inner_vsub_vsub_center_lt_zero`,
and `AffineSubspace.sSameSide_of_vsub_eq_smul` / `sOppSide_of_vsub_eq_smul`.
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 29, 2026
@jsm28

jsm28 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Please resolve the warnings shown by CI.

@jsm28 jsm28 added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Aug 13, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Aug 17, 2026
@Scarlett-le

Copy link
Copy Markdown
Contributor Author

-awaiting-author

@github-actions github-actions Bot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Aug 17, 2026

This branch was previously deployed

1 inactive (outdated) deployment
cache-upload-forks — a3f05e35 Deployed Jun 5, 2026 by Scarlett-le via ci (fork) / Upload to cache #303029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) t-euclidean-geometry Affine and axiomatic geometry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants