Exact Lean source
TensorPBWOccupations
formalization/Cloning/TensorPBWOccupations.lean
Source hash: 7fdcc222ae4edcef8fd43f86a7ea1f1338f847f6a67d52256af6509314a5f1d0
Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.
The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.
Declarations in this module
definition
Cloning.TensorLie.occupationHeightdefinition Cloning.TensorLie.HeightOccupationtheorem Cloning.TensorLie.HeightOccupation.apply_ledefinition Cloning.TensorLie.HeightOccupation.toBoxtheorem Cloning.TensorLie.HeightOccupation.toBox_injectivetheorem Cloning.TensorLie.HeightOccupation.card_ledefinition Cloning.TensorLie.occupationMultisettheorem Cloning.TensorLie.occupationMultiset_countdefinition Cloning.TensorLie.canonicalWordtheorem Cloning.TensorLie.canonicalWord_counttheorem Cloning.TensorLie.canonicalWord_orderedtheorem Cloning.TensorLie.canonicalWord_perm_ifftheorem Cloning.TensorLie.canonicalWord_injectivetheorem Cloning.TensorLie.loweringHeight_eq_sum_counttheorem Cloning.TensorLie.loweringWeight_eq_sum_counttheorem Cloning.TensorLie.list_length_eq_sum_counttheorem Cloning.TensorLie.canonicalWord_counts_permtheorem Cloning.TensorLie.canonicalWord_counts_of_orderedtheorem Cloning.TensorLie.canonicalWord_heighttheorem Cloning.TensorLie.canonicalWord_weighttheorem Cloning.TensorLie.canonicalWord_length1import Cloning.TensorPBWOrder
2import Cloning.TensorPBWWeight
3import Mathlib.Data.Finsupp.Multiset
4
5/-! Finite occupation indices and canonical ordered positive-root words.
6All combinatorics is independent of the tensor representation. -/
7noncomputable section
8open scoped BigOperators
9namespace Cloning.TensorLie
10set_option maxHeartbeats 1000000
11set_option backward.isDefEq.respectTransparency false
12variable {d : ℕ}
13
14/-- The weighted height of a positive-root occupation function. -/
15def occupationHeight (k : PositiveRoot d → ℕ) : ℕ := ∑ a, a.height * k a
16
17/-- Occupations whose total root height is at most the fixed cutoff. -/
18def HeightOccupation (d R : ℕ) := {k : PositiveRoot d → ℕ // occupationHeight k ≤ R}
19
20theorem HeightOccupation.apply_le {R : ℕ} (k : HeightOccupation d R)
21 (a : PositiveRoot d) : k.val a ≤ R := by
22 have hpos := a.height_pos
23 have hsum : a.height * k.val a ≤ occupationHeight k.val := by
24 unfold occupationHeight
25 exact Finset.single_le_sum (f := fun r : PositiveRoot d => r.height * k.val r)
26 (fun _ _ => Nat.zero_le _) (Finset.mem_univ a)
27 exact (Nat.le_mul_of_pos_left _ hpos).trans (hsum.trans k.property)
28
29def HeightOccupation.toBox {R : ℕ} (k : HeightOccupation d R) :
30 PositiveRoot d → Fin (R + 1) := fun a => ⟨k.val a, Nat.lt_succ_of_le (k.apply_le a)⟩
31
32theorem HeightOccupation.toBox_injective {R : ℕ} :
33 Function.Injective (@HeightOccupation.toBox d R) := by
34 intro k l h
35 apply Subtype.ext
36 funext a
37 exact congrArg Fin.val (congrFun h a)
38
39instance {R : ℕ} : Fintype (HeightOccupation d R) :=
40 Fintype.ofInjective HeightOccupation.toBox HeightOccupation.toBox_injective
41
42theorem HeightOccupation.card_le (R : ℕ) :
43 Fintype.card (HeightOccupation d R) ≤ (R + 1) ^ Fintype.card (PositiveRoot d) := by
44 simpa using Fintype.card_le_of_injective
45 (@HeightOccupation.toBox d R) HeightOccupation.toBox_injective
46
47/-- The multiset with exactly the prescribed root occupations. -/
48def occupationMultiset (k : PositiveRoot d → ℕ) : Multiset (PositiveRoot d) :=
49 (Finsupp.equivFunOnFinite.symm k).toMultiset
50
51@[simp] theorem occupationMultiset_count (k : PositiveRoot d → ℕ) (a : PositiveRoot d) :
52 (occupationMultiset k).count a = k a := by
53 simp [occupationMultiset]
54
55/-- The roots occur in ascending `rootKey` order. In the operator convention
56used by `loweringWord`, the leftmost root acts last. -/
57def canonicalWord (k : PositiveRoot d → ℕ) : List (PositiveRoot d) :=
58 (occupationMultiset k).toList.mergeSort (fun a b => rootKey a ≤ rootKey b)
59
60@[simp] theorem canonicalWord_count (k : PositiveRoot d → ℕ) (a : PositiveRoot d) :
61 (canonicalWord k).count a = k a := by
62 rw [canonicalWord, (List.mergeSort_perm _ _).count_eq]
63 have h := Multiset.coe_count a (occupationMultiset k).toList
64 rw [Multiset.coe_toList] at h
65 convert h.symm.trans (occupationMultiset_count k a) using 1
66 simp only [List.count, beq_eq_decide]
67
68theorem canonicalWord_ordered (k : PositiveRoot d → ℕ) : RootOrdered (canonicalWord k) := by
69 have ht : ∀ a b c : PositiveRoot d, decide (rootKey a ≤ rootKey b) = true →
70 decide (rootKey b ≤ rootKey c) = true → decide (rootKey a ≤ rootKey c) = true := by
71 intro a b c hab hbc
72 exact decide_eq_true (le_trans (of_decide_eq_true hab) (of_decide_eq_true hbc))
73 have htotal : ∀ a b : PositiveRoot d,
74 (decide (rootKey a ≤ rootKey b) || decide (rootKey b ≤ rootKey a)) = true := by
75 intro a b
76 simpa only [Bool.or_eq_true, decide_eq_true_eq] using le_total (rootKey a) (rootKey b)
77 simpa only [RootOrdered, canonicalWord, decide_eq_true_eq] using
78 List.pairwise_mergeSort ht htotal (occupationMultiset k).toList
79
80theorem canonicalWord_perm_iff (k l : PositiveRoot d → ℕ) :
81 (canonicalWord k).Perm (canonicalWord l) ↔ k = l := by
82 constructor
83 · intro h
84 funext a
85 simpa using h.count_eq a
86 · rintro rfl
87 exact List.Perm.refl _
88
89theorem canonicalWord_injective : Function.Injective (@canonicalWord d) := by
90 intro k l h
91 exact (canonicalWord_perm_iff k l).mp (h ▸ List.Perm.refl _)
92
93theorem loweringHeight_eq_sum_count (w : List (PositiveRoot d)) :
94 loweringHeight w = ∑ a, a.height * w.count a := by
95 induction w with
96 | nil => simp [loweringHeight]
97 | cons r w ih =>
98 simp only [loweringHeight, List.count_cons, beq_iff_eq, Nat.mul_add,
99 Finset.sum_add_distrib, mul_ite, mul_one, mul_zero, Finset.sum_ite_eq,
100 Finset.mem_univ, ↓reduceIte, ih]
101 omega
102
103theorem loweringWeight_eq_sum_count (w : List (PositiveRoot d)) (a : Fin d) :
104 loweringWeight w a = ∑ r, (w.count r : ℤ) * r.weight a := by
105 induction w with
106 | nil => simp
107 | cons r w ih =>
108 simp only [loweringWeight_cons, Pi.add_apply, List.count_cons, beq_iff_eq,
109 Nat.cast_add, Nat.cast_ite, Nat.cast_one, Nat.cast_zero, add_mul,
110 Finset.sum_add_distrib, ite_mul, one_mul, zero_mul, Finset.sum_ite_eq,
111 Finset.mem_univ, ↓reduceIte, ih]
112 omega
113
114theorem list_length_eq_sum_count (w : List (PositiveRoot d)) :
115 w.length = ∑ a : PositiveRoot d, w.count a := by
116 induction w with
117 | nil => simp
118 | cons r w ih =>
119 simp only [List.length_cons, List.count_cons, beq_iff_eq, Finset.sum_add_distrib,
120 Finset.sum_ite_eq, Finset.mem_univ, ↓reduceIte, ih]
121
122theorem canonicalWord_counts_perm (w : List (PositiveRoot d)) :
123 (canonicalWord (fun a => w.count a)).Perm w := by
124 apply List.perm_iff_count.mpr
125 intro a
126 exact canonicalWord_count _ a
127
128theorem canonicalWord_counts_of_ordered (w : List (PositiveRoot d)) (hw : RootOrdered w) :
129 canonicalWord (fun a => w.count a) = w := by
130 exact (canonicalWord_counts_perm w).eq_of_pairwise
131 (fun a b _ _ hab hba => rootKey_injective (Nat.le_antisymm hab hba))
132 (canonicalWord_ordered _) hw
133
134@[simp] theorem canonicalWord_height (k : PositiveRoot d → ℕ) :
135 loweringHeight (canonicalWord k) = occupationHeight k := by
136 simp [loweringHeight_eq_sum_count, occupationHeight]
137
138theorem canonicalWord_weight (k : PositiveRoot d → ℕ) (a : Fin d) :
139 loweringWeight (canonicalWord k) a = ∑ r, (k r : ℤ) * r.weight a := by
140 simp [loweringWeight_eq_sum_count]
141
142@[simp] theorem canonicalWord_length (k : PositiveRoot d → ℕ) :
143 (canonicalWord k).length = ∑ a, k a := by
144 simp [list_length_eq_sum_count]
145
146end Cloning.TensorLie