💎 Reusable layer
← all 82R0010

Cotes' harmonic means theorem

showcase

Use this theorem

  1. Create a project

    Shell
    lake +leanprover/lean4:v4.35.0 new myproject std.toml
    cd myproject

    Standard template, not math: the math template adds its own Mathlib requirement pinned to the Lean release tag, not to the Mathlib commit this package is built and tested with, so you would get a second, different Mathlib. Mathlib comes in through this package. Skip this step in an existing project with the same Lean and Mathlib.

  2. Add the dependency to lakefile.toml

    TOML
    [[require]]
    name = "formalizations"
    git = "https://github.com/karlesmarin/formalizations"
    rev = "v0.15.0"
  3. Import the minimal module

    Lean 4
    import Formalizations.Reusable.AlgebraicGeometry

    In a file of the project, e.g. Example.lean.

  4. Paste the example

    Lean 4
    open Formalizations.Reusable
    
    /-- Cotes: the harmonic-mean point lies on the polar of `p`. -/
    example (f : MvPolynomial (Fin 2) ℝ) (p v : Fin 2 → ℝ) (hp : MvPolynomial.eval p f ≠ 0)
        (hsplit : (MvPolynomial.aeval (fun i => Polynomial.C (p i) + Polynomial.C (v i) * Polynomial.X)
          f).roots.card = (MvPolynomial.aeval
            (fun i => Polynomial.C (p i) + Polynomial.C (v i) * Polynomial.X) f).natDegree)
        (hd : 1 ≤ (MvPolynomial.aeval
            (fun i => Polynomial.C (p i) + Polynomial.C (v i) * Polynomial.X) f).natDegree)
        (hH : ((MvPolynomial.aeval (fun i => Polynomial.C (p i) + Polynomial.C (v i) * Polynomial.X)
          f).roots.map (fun r => r⁻¹)).sum ≠ 0) :
        let g := MvPolynomial.aeval (fun i => Polynomial.C (p i) + Polynomial.C (v i) * Polynomial.X) f
        ∑ i, MvPolynomial.eval p (MvPolynomial.pderiv i f) *
            ((g.natDegree : ℝ) / (g.roots.map (fun r => r⁻¹)).sum * v i)
          = -(g.natDegree : ℝ) * MvPolynomial.eval p f :=
      cotes_harmonic_mean_polar f p v hp _ rfl hsplit hd hH

    Steps 3 and 4 together are a complete Lean file:FormalizationsTest/ReusableAlgebraicGeometryExample.lean at v0.15.0, compiled by the CI.

  5. Fetch and check

    Shell
    lake update
    lake lean Example.lean

    lake update fetches this package and Mathlib, and Mathlib's update hook downloads the compiled Mathlib (lake exe cache get). lake lean Example.lean builds the imports of the file (steps 3 and 4) and checks it. If the file belongs to a lean_lib of your project, lake build <lib> does the same. Avoid a bare lake build in a project from the standard template: its default target is the executable, whose link compiles every imported Mathlib module to native code. Same versions required: Lean v4.35.0, Mathlib f0b4c81.

Alternative: import Formalizations.Reusable imports the whole layer (all areas).

Cotes' harmonic means theorem: if a line p + t v meets a real plane curve f = 0 in deg g real points (g(t) = f(p + t v) splits), the harmonic-mean point lies on the polar line ∇f(p)·(q − p) = −d f(p) of p.

Lean statement

Lean 4
theorem cotes_harmonic_mean_polar (f : MvPolynomial (Fin 2) ℝ) (p v : Fin 2 → ℝ)
    (hp : MvPolynomial.eval p f ≠ 0)
    (g : Polynomial ℝ)
    (hg : g = MvPolynomial.aeval (fun i => Polynomial.C (p i) + Polynomial.C (v i) * Polynomial.X) f)
    (hsplit : g.roots.card = g.natDegree) (hd : 1 ≤ g.natDegree)
    (hH : (g.roots.map (fun r => r⁻¹)).sum ≠ 0) :
    ∑ i, MvPolynomial.eval p (MvPolynomial.pderiv i f) *
        ((g.natDegree : ℝ) / (g.roots.map (fun r => r⁻¹)).sum * v i)
      = -(g.natDegree : ℝ) * MvPolynomial.eval p f
Name
Formalizations.Reusable.cotes_harmonic_mean_polar
Import
import Formalizations.Reusable.AlgebraicGeometry
Version
formalizations 0.15.0Lean v4.35.0Mathlib f0b4c81
Role
showcase a classical theorem, to consult
Provenance
Cotes.harmonic_mean_polar in Formalizations.AlgebraicGeometry.PlaneCurve.Cotes
Paper: none
Classical reference
R. Cotes, Harmonia Mensurarum, Cambridge, 1722
Trust
standard axioms only propext, Classical.choice, Quot.sound
#print axioms in FormalizationsTest/Axioms.lean, audited by scripts/check_axioms.sh (2758 results), which the CI build workflow runs and passed at this commit.
Status
reusable not an upstream candidate
Area
Algebraic Geometry

Links

Lean docstring

Cotes' harmonic means theorem. Let f ∈ ℝ[x, y] define a plane curve, p a point with f(p) ≠ 0 and v a direction, and let g(t) = f(p + t v). Suppose g splits over ℝ with d = deg g ≥ 1 roots tᵢ and Σ 1/tᵢ ≠ 0. Then the harmonic-mean point p + t* v, t* = d / Σ 1/tᵢ, satisfies ∇f(p) · (t* v) = −d f(p): it lies on the polar line ∇f(p) · (q − p) = −d f(p) of p, which does not depend on the direction v.

  • Archive: Cotes.harmonic_mean_polar (Formalizations.AlgebraicGeometry.PlaneCurve.Cotes, from Mathlib's logarithmic derivative of a split polynomial); no research paper.
  • Classical reference: R. Cotes, Harmonia Mensurarum, Cambridge, 1722; C. Maclaurin, De linearum geometricarum proprietatibus generalibus, 1748.
  • Example: for the unit circle f = x² + y² − 1, p = 0 and any v, g = |v|² t² − 1 splits with Σ 1/tᵢ = 0, so the hypothesis hH fails: the theorem says nothing about lines through the centre, as expected (the polar of the centre is the line at infinity).

Upstream

the hypotheses (roots.card = natDegree, nonzero sum of inverse roots) are tailored to the proof; a Mathlib version would need plane-curve API

Depends on, in this repository

None besides the archive module (repo_dependencies = []).