AFTD Auto-Formalizing Theoretical Domains

planar_necklace_continuous_odd_exists_zero

theoremverified

A continuous function f : ℝ → ℝ that is odd with respect to π, in the sense that f (x + π) = - f x for all x, has a zero.

Statement

theorem planar_necklace_continuous_odd_exists_zero (f : ℝ → ℝ) (hf : Continuous f)
    (hodd : ∀ x, f (x + Real.pi) = - f x) : ∃ x, f x = 0
Source
step towards planar_necklace_three_agents_three_cuts
Verified
24 Oct 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

To find a zero of a continuous function satisfying $f(x + \pi) = -f(x)$, we restrict $f$ to the interval $[0, \pi]$. If $f(0) = 0$, then $x = 0$ is already a zero. Otherwise, $f(\pi) = -f(0)$ has the opposite sign of $f(0)$, so $0$ lies strictly between $f(0)$ and $f(\pi)$. By the Intermediate Value Theorem, $f$ must vanish at some point in $(0, \pi)$.

  1. If $f(0) = 0$, then $x = 0$ is a zero of $f$.

    We perform a case split on whether $f(0) = 0$. In the affirmative case, $x = 0$ directly witnesses the existential claim.

    lines 4–5

      by_cases h0 : f 0 = 0
      · exact ⟨0, h0⟩
  2. Under the assumption $f(0) \ne 0$, we have $f(\pi) = -f(0)$, $f$ is continuous on $[0, \pi]$, and $0 \le \pi$.

    Evaluating the oddness condition $f(x + \pi) = -f(x)$ at $x = 0$ shows that $f(\pi) = -f(0)$. The global continuity of $f$ restricts to continuity on the closed interval $[0, \pi]$, and the inequality $0 \le \pi$ follows from the positivity of $\pi$ (`Real.pi_pos`) via `le_of_lt`.

    lines 6–8

    uses Real.pi_pos, le_of_lt

      · have hpi : f Real.pi = - f 0 := by simpa using hodd 0
        have hcont : ContinuousOn f (Set.Icc 0 Real.pi) := hf.continuousOn
        have hle : (0 : ℝ) ≤ Real.pi := le_of_lt Real.pi_pos
  3. If $f(0) < 0$, then $f$ has a zero in $(0, \pi)$.

    Since $f(0) \ne 0$, by trichotomy (`lt_or_gt_of_ne`) either $f(0) < 0$ or $f(0) > 0$. In the first case, $f(0) < 0$, so $f(\pi) = -f(0) > 0$. Hence $0$ lies strictly between $f(0)$ and $f(\pi)$, i.e., $0 \in (f(0), f(\pi))$. The Intermediate Value Theorem (`intermediate_value_Ioo`) guarantees some $x \in (0, \pi)$ with $f(x) = 0$.

    lines 9–16

    uses lt_or_gt_of_ne, intermediate_value_Ioo

        rcases lt_or_gt_of_ne h0 with hneg | hpos
        · have hmem : (0 : ℝ) ∈ Set.Ioo (f 0) (f Real.pi) := by
            constructor
            · exact hneg
            · rw [hpi]
              linarith
          obtain ⟨x, hxmem, hx⟩ := intermediate_value_Ioo hle hcont hmem
          exact ⟨x, hx⟩
  4. If $f(0) > 0$, then $f$ has a zero in $(0, \pi)$.

    In the second case, $f(0) > 0$, so $f(\pi) = -f(0) < 0$. Hence $0 \in (f(\pi), f(0))$. Applying the Intermediate Value Theorem for decreasing endpoints (`intermediate_value_Ioo'`) yields a point $x \in (0, \pi)$ such that $f(x) = 0$.

    lines 17–23

    uses intermediate_value_Ioo'

        · have hmem : (0 : ℝ) ∈ Set.Ioo (f Real.pi) (f 0) := by
            constructor
            · rw [hpi]
              linarith
            · exact hpos
          obtain ⟨x, hxmem, hx⟩ := intermediate_value_Ioo' hle hcont hmem
          exact ⟨x, hx⟩
le_of_lt
A strict inequality $a < b$ in a preorder implies the non-strict inequality $a \le b$.
Real.pi_pos
The real number $\pi$ is strictly positive ($0 < \pi$).
lt_or_gt_of_ne
In a linear order, if $a \ne b$, then either $a < b$ or $b < a$.
intermediate_value_Ioo
If $f$ is continuous on $[a, b]$ with $a \le b$, then its image contains the open interval $(f(a), f(b))$.
intermediate_value_Ioo'
If $f$ is continuous on $[a, b]$ with $a \le b$, then its image contains the open interval $(f(b), f(a))$.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- A continuous function vanishing to order π up to sign (f (x + π) = -f x) has a zero; this is the IVT step of the median bisection. -/theorem planar_necklace_continuous_odd_exists_zero (f : ℝ → ℝ) (hf : Continuous f)    (hodd : ∀ x, f (x + Real.pi) = - f x) : ∃ x, f x = 0 := by  by_cases h0 : f 0 = 0  · exact ⟨0, h0⟩  · have hpi : f Real.pi = - f 0 := by simpa using hodd 0    have hcont : ContinuousOn f (Set.Icc 0 Real.pi) := hf.continuousOn    have hle : (0 : ℝ) ≤ Real.pi := le_of_lt Real.pi_pos    rcases lt_or_gt_of_ne h0 with hneg | hpos    · have hmem : (0 : ℝ) ∈ Set.Ioo (f 0) (f Real.pi) := by        constructor        · exact hneg        · rw [hpi]          linarith      obtain ⟨x, hxmem, hx⟩ := intermediate_value_Ioo hle hcont hmem      exact ⟨x, hx⟩    · have hmem : (0 : ℝ) ∈ Set.Ioo (f Real.pi) (f 0) := by        constructor        · rw [hpi]          linarith        · exact hpos      obtain ⟨x, hxmem, hx⟩ := intermediate_value_Ioo' hle hcont hmem      exact ⟨x, hx⟩
See it in the graphDiscuss this resultChallenge it