Integer weighted travel through endpoint events
DefinitionLX_ZeroGapEventTravelcayley-graphscombinatoricsglushkov-lxgroup-theory
For a list of events on a positive cycle, a directed move from the first endpoint of an event to the second has weight equal to their forward cyclic distance, read as an integer. The reverse move has the negative of that same distance. Travel is the relation generated by zero length travel at each vertex and concatenation of moves, adding weights. Repetition of edges is allowed. Also define a head shift giving value at position zero, at position , and zero elsewhere, checking zero first. Travel retains signed integer displacement rather than reducing its total modulo the cycle length.
Definition code
/-
Adapted from https://github.com/snow-ghost/glushkov-lx-lean at 8cddcd222b591673dc63475d9d45b9ed5c6eb92c.
MIT License
Copyright (c) 2026 S. Uskov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-/
import Mathlib
import Definitions.Def_LX_AffineCrossings
import Definitions.Def_LX_AffineLift
import Definitions.Def_LX_Graph
import Definitions.Def_LX_LiftedModel
import Definitions.Def_LX_PhysicalModel
import Definitions.Def_LX_PortRoute
import Definitions.Def_LX_ZeroGapEventGeometry
import Definitions.Def_LX_ZeroGapExchange
import Definitions.Def_LX_ZeroGapPair
namespace Int
end Int
namespace LX
end LX
namespace LX.Core
end LX.Core
namespace LX.Core.AffineLift
end LX.Core.AffineLift
namespace LX.Core.LiftedModel
end LX.Core.LiftedModel
namespace LX.Core.PhysicalModel
end LX.Core.PhysicalModel
namespace LX.Core.RotationWords
end LX.Core.RotationWords
namespace LX.Core.ZeroGap
end LX.Core.ZeroGap
namespace List
end List
/-! Weighted paths retain the signed integer motion of tokens through the
endpoint events; their weights do not identify coordinates modulo n. -/
namespace LX.Core.ZeroGap
open scoped Fin.IntCast Fin.NatCast Fin.CommRing
variable {n : ℕ} [NeZero n]
def EventMove (events : List (Event n)) (i j : Fin n) (z : ℤ) : Prop :=
∃ e ∈ events, (i=e.1 ∧ j=e.2 ∧ z=(distance e.1 e.2 : ℤ)) ∨
(i=e.2 ∧ j=e.1 ∧ z= -(distance e.1 e.2 : ℤ))
inductive Travel (events : List (Event n)) : Fin n → Fin n → ℤ → Prop
| refl (i : Fin n) : Travel events i i 0
| head {i j k : Fin n} {a b : ℤ} (he : EventMove events i j a)
(hp : Travel events j k b) : Travel events i k (a+b)
def headShift (v i : Fin n) : ℤ := if i=0 then (v : ℤ) else if i=v then -(v : ℤ) else 0
end LX.Core.ZeroGap
Source