Winding dynamics: Circle homotopy, branch sectors, and reset ledgers
DefinitionWindingDynamics_CoreV1This bundle defines four interfaces for winding dynamics. First, it defines canonical integer winding of a based complex-unit-circle loop from the endpoint of its zero-based lift through the exponential covering, together with moving-basepoint normalization for a jointly continuous closed Circle field. Second, it defines principal integer turns on a finite directed edge system, the antipodal branch cut, and chain winding. Third, it defines coherent finite reset ledgers whose resets are successive turn-state differences, plus certified closed integer cycles. Fourth, it defines a conditional ambient-state trajectory that stays in a registered carrier and has a continuous Circle readout. The four associated gate propositions keep intrinsic homotopy conservation, branch-regular finite conservation, exact reset accounting, and model-dependent carrier/readout reduction logically separate.
import Mathlib.Analysis.SpecialFunctions.Complex.Circle
import Mathlib.Algebra.Order.Floor.Ring
import Mathlib.Topology.Homotopy.Lifting
import Mathlib.Topology.LocallyConstant.Basic
noncomputable section
namespace WindingDynamics
open Set Filter
open scoped BigOperators Topology
open unitInterval
/-! ## Intrinsic Circle winding and continuous fields -/
abbrev CircleLoop := Path (1 : Circle) 1
noncomputable def circleAngleLift (loop : CircleLoop) :
C(Set.Icc (0 : ℝ) 1, ℝ) :=
Circle.isCoveringMap_exp.liftPath loop.toContinuousMap 0 (by simp)
noncomputable def circleLiftEndpoint (loop : CircleLoop) : ℝ :=
circleAngleLift loop 1
noncomputable def circleWinding (loop : CircleLoop) : ℤ :=
⌊(circleLiftEndpoint loop) / (2 * Real.pi)⌋
/-- A jointly continuous Circle field on the parameter/spatial square whose
spatial endpoints agree at every parameter value. -/
structure ClosedCircleField where
field : C(I × I, Circle)
spatial_closed : ∀ t : I, field (t, 1) = field (t, 0)
/-- Moving-basepoint normalization of a closed Circle field. -/
noncomputable def ClosedCircleField.normalized (F : ClosedCircleField) :
C(I × I, Circle) where
toFun p := F.field p * (F.field (p.1, 0))⁻¹
continuous_toFun := by fun_prop
/-- The normalized based spatial loop at a fixed time. -/
noncomputable def ClosedCircleField.basedSlice
(F : ClosedCircleField) (t : I) : CircleLoop where
toFun x := F.normalized (t, x)
continuous_toFun := F.normalized.continuous.comp (by fun_prop)
source' := by simp [ClosedCircleField.normalized]
target' := by
change F.field (t, 1) * (F.field (t, 0))⁻¹ = 1
rw [F.spatial_closed]
simp
/-- Joint continuity constructs a based endpoint homotopy and preserves the
canonical lift endpoint and its integer winding. -/
def CircleFieldConservationGate : Prop :=
∀ F : ClosedCircleField,
(F.basedSlice 0).Homotopic (F.basedSlice 1) ∧
circleLiftEndpoint (F.basedSlice 0) =
circleLiftEndpoint (F.basedSlice 1) ∧
circleWinding (F.basedSlice 0) =
circleWinding (F.basedSlice 1)
/-! ## Branch-regular finite principal turns -/
/-- Integer correction selecting the representative in `(-pi, pi]`. -/
noncomputable def principalTurn (tail head : ℝ) : ℤ :=
-toIocDiv Real.two_pi_pos (-Real.pi) (head - tail)
/-- The discontinuity locus of the selected principal branch. -/
def IsAntipodal (tail head : ℝ) : Prop :=
head - tail ≡ -Real.pi [PMOD (2 * Real.pi)]
/-- Principal turn of an oriented edge in a lifted phase trajectory. -/
noncomputable def edgeTurn {Time Vertex Edge : Type*}
(tail head : Edge → Vertex) (phase : Time → Vertex → ℝ)
(t : Time) (e : Edge) : ℤ :=
principalTurn (phase t (tail e)) (phase t (head e))
/-- Pair the principal-turn cochain with an integer edge chain. -/
noncomputable def chainWinding {Time Vertex Edge : Type*} [Fintype Edge]
(tail head : Edge → Vertex) (phase : Time → Vertex → ℝ)
(chain : Edge → ℤ) (t : Time) : ℤ :=
∑ e, edgeTurn tail head phase t e * chain e
/-- On a preconnected time domain, every finite-chain principal winding is
constant under continuous branch-regular motion. The second conjunct is the
negative control showing that continuity alone does not suffice. -/
def BranchRegularConservationGate : Prop :=
(∀ (Time Vertex Edge : Type) [TopologicalSpace Time]
[PreconnectedSpace Time] [Fintype Edge]
(tail head : Edge → Vertex) (phase : Time → Vertex → ℝ),
(∀ v, Continuous (fun t ↦ phase t v)) →
(∀ t e, ¬IsAntipodal (phase t (tail e)) (phase t (head e))) →
∀ (chain : Edge → ℤ) (t₀ t₁ : Time),
chainWinding tail head phase chain t₀ =
chainWinding tail head phase chain t₁) ∧
∃ tail head : ℝ → ℝ,
Continuous tail ∧ Continuous head ∧
principalTurn (tail 0) (head 0) ≠
principalTurn (tail 1) (head 1)
/-! ## Coherent finite reset ledgers -/
abbrev IntegerEdgeCochain (Edge : Type*) := Edge → ℤ
abbrev IntegerEdgeChain (Edge : Type*) := Edge → ℤ
def pairing {Edge : Type*} [Fintype Edge]
(a : IntegerEdgeCochain Edge) (c : IntegerEdgeChain Edge) : ℤ :=
∑ e, a e * c e
/-- Successive integer turn states. Only states `0, ..., steps` are used. -/
structure ResetLedger (Edge : Type*) where
steps : ℕ
turn : ℕ → IntegerEdgeCochain Edge
/-- Reset orientation is next state minus current state. -/
def ResetLedger.reset {Edge : Type*} (L : ResetLedger Edge) (i : ℕ) :
IntegerEdgeCochain Edge :=
L.turn (i + 1) - L.turn i
def ResetLedger.netReset {Edge : Type*} (L : ResetLedger Edge) :
IntegerEdgeCochain Edge :=
L.turn L.steps - L.turn 0
/-- Registered incidence coefficients for oriented edges. -/
structure EdgeBoundary (Vertex Edge : Type*) where
coeff : Edge → Vertex → ℤ
def chainBoundary {Vertex Edge : Type*} [Fintype Edge]
(B : EdgeBoundary Vertex Edge) (c : IntegerEdgeChain Edge)
(v : Vertex) : ℤ :=
∑ e, c e * B.coeff e v
def IsClosedChain {Vertex Edge : Type*} [Fintype Edge]
(B : EdgeBoundary Vertex Edge) (c : IntegerEdgeChain Edge) : Prop :=
∀ v, chainBoundary B c v = 0
structure CertifiedCycle {Vertex Edge : Type*} [Fintype Edge]
(B : EdgeBoundary Vertex Edge) where
chain : IntegerEdgeChain Edge
closed : IsClosedChain B chain
def cycleWinding {Vertex Edge : Type*} [Fintype Edge]
{B : EdgeBoundary Vertex Edge} (a : IntegerEdgeCochain Edge)
(C : CertifiedCycle B) : ℤ :=
pairing a C.chain
/-- Every edge reset telescopes and every certified-cycle winding jump is the
sum of the registered reset periods. -/
def ResetLedgerBalanceGate : Prop :=
(∀ (Edge : Type) (L : ResetLedger Edge) (e : Edge),
(∑ i ∈ Finset.range L.steps, L.reset i e) = L.netReset e) ∧
∀ (Vertex Edge : Type) [Fintype Edge]
(B : EdgeBoundary Vertex Edge) (L : ResetLedger Edge)
(C : CertifiedCycle B),
cycleWinding (L.turn L.steps) C - cycleWinding (L.turn 0) C =
∑ i ∈ Finset.range L.steps, cycleWinding (L.reset i) C
/-! ## Conditional dynamics/readout consumer -/
/-- An ambient-state evolution which stays in a registered carrier and has a
continuous Circle readout there. No existence or carrier-preservation theorem
for a particular ODE is built into this interface. -/
structure CarrierReadoutSegment (State : Type*) [TopologicalSpace State] where
carrier : Set State
trajectory : C(I × I, State)
stays_in_carrier : ∀ p, trajectory p ∈ carrier
spatial_closed : ∀ t : I, trajectory (t, 1) = trajectory (t, 0)
readout : C(carrier, Circle)
noncomputable def CarrierReadoutSegment.carrierTrajectory
{State : Type*} [TopologicalSpace State]
(D : CarrierReadoutSegment State) : C(I × I, D.carrier) where
toFun p := ⟨D.trajectory p, D.stays_in_carrier p⟩
continuous_toFun := D.trajectory.continuous.subtype_mk _
noncomputable def CarrierReadoutSegment.inducedCircleField
{State : Type*} [TopologicalSpace State]
(D : CarrierReadoutSegment State) : ClosedCircleField where
field := D.readout.comp D.carrierTrajectory
spatial_closed := by
intro t
apply congrArg D.readout
exact Subtype.ext (D.spatial_closed t)
/-- Any model supplying the carrier-valued continuous evolution and readout
inherits the intrinsic Circle conservation theorem. -/
def CarrierReadoutConservationGate : Prop :=
(∀ (State : Type) [TopologicalSpace State]
(D : CarrierReadoutSegment State),
circleWinding (D.inducedCircleField.basedSlice 0) =
circleWinding (D.inducedCircleField.basedSlice 1)) ∧
∀ (X : Type) [TopologicalSpace X] [SimplyConnectedSpace X]
(readout : C(X, Circle)) (x : X) (loop : Path x x),
(loop.map readout.continuous).Homotopic (Path.refl (readout x))
/-- Mission boundary: intrinsic homotopy conservation, regular-sector finite
conservation with its continuity-only control, coherent reset balance, and the
conditional carrier/readout consumer. -/
def ClaimBoundary : Prop :=
CircleFieldConservationGate ∧
BranchRegularConservationGate ∧
ResetLedgerBalanceGate ∧
CarrierReadoutConservationGate
end WindingDynamics
Read-back
What the Lean code literally says, in plain math · gpt-5.6-sol
The bundle takes and the unit circle in . A CircleLoop is a continuous path in the circle from back to . For such a loop , it chooses the lift of through the real-to-circle exponential covering whose initial value is , calls its value at the lift endpoint, and defines the winding to be ; thus the sign is whatever is induced by that covering-map convention and the floor, rather than an independently specified orientation convention. A closed circle field is a continuous satisfying for every ; its normalization is , and its based slice at is the resulting path from to . The first gate says that for every such , its slices at and are endpoint-preservingly homotopic, their chosen lift endpoints are equal, and their floor-defined windings are equal. For real tail and head angles, the principal turn is the negative of the integer quotient used to move the difference into , equivalently the integer correction for which ; the pair is antipodal precisely when . Given arbitrary types of times, vertices, and edges, incidence maps , and phases , the oriented edge turn is that correction from to , and the winding paired with an arbitrary integer edge chain is . The second gate is a conjunction: for all small types Time, Vertex, and finite Edge, with a topology and preconnected-space instance on Time, coordinatewise continuity of for every vertex and avoidance of antipodality at every time and edge imply equality of this sum for every integer chain and every pair ; and there also exist globally continuous whose principal turns at real parameters and differ, with no antipodality-avoidance condition on that existential pair. Integer edge cochains and chains are simply functions , paired by . A reset ledger has a natural number of steps and a total sequence of turn cochains for every ; its reset has the orientation , and its net reset is . An edge boundary is an entirely arbitrary integer coefficient function ; the boundary of a chain is , a chain is closed when this is zero at every vertex, a certified cycle is a chain equipped with that condition, and its winding against is . The third gate says, first, that for every small edge type, ledger, and edge, , and, second, that for every small vertex type and finite small edge type, arbitrary boundary data, ledger, and certified cycle , . A carrier/readout segment over a topological state type consists only of a subset , a continuous square-valued trajectory lying in , equality , and a continuous readout ; it induces the circle field . The fourth gate says both that every such segment over a small state type has equal normalized-slice windings at and , and that for every small simply connected topological space , continuous , point , and loop at , the mapped loop is endpoint-preservingly homotopic to the constant loop at . ClaimBoundary is the conjunction of those four gates. Edge cases included literally are empty edge types, zero reset steps, empty time or state types, and arbitrary boundary coefficients; universal claims requiring an edge, time point, state segment, certified cycle, or base point are vacuous when no such object exists. The branch implication is also vacuous whenever either displayed premise fails. No vertex topology, vertex finiteness, joint continuity of the phase, closedness of the branch chain, incidence axioms on the boundary coefficients, ODE or evolution equation, carrier-existence theorem, or carrier-preservation theorem is assumed. The reset-cycle identity does not use the certified closedness proof, and ledger values after the declared final step are unrestricted and unused.