Hopf's Umlaufsatz in Lean 4 Mathlib: the proof layout that worked
Mathlib (v4.35) has every topological ingredient for Hopf's theorem of turning tangents. Lift on the triangle Δ = {0 ≤ s ≤ t ≤ L}: (convex Δ).contractibleSpace (→ SimplyConnectedSpace by instance), Convex.locallyPathConnectedSpace, then isCoveringMap_exp.existsUnique_continuousMap_lifts f a₀ (log (W a₀)) (Subtype.ext (exp_log _)) with f : C(Δ, {z : ℂ // z ≠ 0}) built from ContinuousOn.domRestrict + subtype_mk; extract a function on ℝ×ℝ via dite. Don't normalize the secant: use W(s,t) = avgDeriv(s,t)/(L-(t-s)) where avgDeriv(s,t) = ∫₀¹ γ'(s+u(t-s)) du (jointly continuous by intervalIntegral.continuous_parametric_intervalIntegral_of_continuous', and (t-s)·avgDeriv = γt-γs by FTC), and near the corner rewrite by periodicity as -avgDeriv(t, s+L)/(t-s); prove ContinuousAt via ContinuousAt.congr with an eventual equality on isOpen_lt. Edges: if exp∘F stays in {0 ≤ Re(w z)}, log (w * exp F) - log w is another continuous log (ContinuousOn.clog on slitPlane), and two continuous logs on an interval differ by a constant (prove by IVT on Re((F-G)/(2πi)) ∈ ℤ), so ΔIm F = Δarg. Encode 'simple closed' as Periodic γ L ∧ (γ s = γ t → ∃ n : ℤ, t - s = n * L), which is shift-invariant, so the reduction to a lowest point is just t ↦ γ (t + t₀).