Exact Lean source
Nonadditivity.HaarPathCodes
Download original .lean · View on GitHub · Jump to source
Direct imports
Nonadditivity.HaarPathClassDataMathlib.Data.List.GetDdependency
Imported by project modules
2 direct reverse imports
Relationships above come from literal import commands. The declarations below link to types and references extracted from Lean’s environment. Source text is complete and unchanged.
Declarations in this module
12 project constants, including generated, internal and private declarations.
12 declarations
Nonadditivity.HaarPathClasses.BoundedListNonadditivity.HaarPathClasses.ExplorationEventNonadditivity.HaarPathClasses.ExplorationMarkNonadditivity.HaarPathClasses.card_boundedList_leNonadditivity.HaarPathClasses.card_explorationCodes_leNonadditivity.HaarPathClasses.card_explorationCodes_le._proof_1_1internal/detail/privateNonadditivity.HaarPathClasses.card_explorationEventNonadditivity.HaarPathClasses.instFintypeBoundedListNonadditivity.HaarPathClasses.paddedListCodeNonadditivity.HaarPathClasses.paddedListCode_injectiveNonadditivity.HaarPathClasses.paddedListCode_injective._proof_1_1internal/detail/privateNonadditivity.HaarPathClasses.paddedListCode_injective._proof_1_2internal/detail/private
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathClassData7import Mathlib.Data.List.GetD89/-! # Finite sparse codes with literal position and local-color marks1011An event records its time, its target vertex, the endpoint of the following12old-tree run, and three independent local color labels. For two generators13this is exactly 64*m^3 possibilities. Padding by `none` handles the variable14number of events without an additional polynomial factor.15-/16noncomputable section17namespace Nonadditivity.HaarPathClasses18open HaarPathProfiles19variable {A : Type*}2021abbrev BoundedList (A : Type*) (q : ℕ) := {l : List A // l.length ≤ q}2223/-- A literal bounded list, padded with `none` to its length budget. -/24def paddedListCode (q : ℕ) (l : BoundedList A q) : Fin q → Option A :=25fun i => l.val[i.val]?2627theorem paddedListCode_injective (q : ℕ) :28Function.Injective (@paddedListCode A q) := by29intro l s h30apply Subtype.ext31apply List.ext_getElem?32intro i33by_cases hi : i < q34· exact congrFun h ⟨i,hi⟩35· rw [List.getElem?_eq_none (by have := l.property; omega),36List.getElem?_eq_none (by have := s.property; omega)]3738instance [Fintype A] (q : ℕ) : Fintype (BoundedList A q) :=39Fintype.ofInjective (paddedListCode q) (paddedListCode_injective q)4041theorem card_boundedList_le [Fintype A] (q : ℕ) :42Fintype.card (BoundedList A q) ≤ (Fintype.card A+1)^q := by43calc44_ ≤ Fintype.card (Fin q → Option A) :=45Fintype.card_le_of_injective _ (paddedListCode_injective q)46_ = _ := by simp4748/-- The three local colors are independent endpoint labels. This avoids49assuming that local normalization produces a globally colored path. -/50abbrev ExplorationMark (m : ℕ) :=51Fin m × Fin m × Color 2 × Color 2 × Color 25253/-- Time, target vertex, end of old-tree run, and three local colors. -/54abbrev ExplorationEvent (m : ℕ) := Fin m × ExplorationMark m5556@[simp] theorem card_explorationEvent (m : ℕ) :57Fintype.card (ExplorationEvent m)=64*m^3 := by58simp only [ExplorationEvent,ExplorationMark,Color,Fintype.card_prod,59Fintype.card_fin,Fintype.card_bool]60ring6162/-- The fully explicit code-space bound, including padding and variable63length. It does not refer to the unknown final path graph. -/64theorem card_explorationCodes_le (m q : ℕ) (hm : 0 < m) :65Fintype.card (BoundedList (ExplorationEvent m) q) ≤66128^q*m^(3*q) := by67have hc : 64*m^3+1 ≤ 128*m^3 := by68have hp : 0 < m^3 := pow_pos hm _69omega70calc71_ ≤ (Fintype.card (ExplorationEvent m)+1)^q := card_boundedList_le q72_ = (64*m^3+1)^q := by rw [card_explorationEvent]73_ ≤ (128*m^3)^q := Nat.pow_le_pow_left hc _74_ = _ := by rw [mul_pow,←pow_mul]7576end Nonadditivity.HaarPathClasses