Exact Lean source
GeneralCoherentMultiplicity
formalization/Cloning/GeneralCoherentMultiplicity.lean
Source hash: ca40d9c526fe48831bfa4b6181454f493dd75624475eb3c797774562bfb63a96
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
1import Cloning.GeneralSymmetricDimension
2import Mathlib.Data.Fintype.Perm
3
4/-! Exact multinomial occupation multiplicities by splitting a permutation
5into its induced computational word and the bijections of all letter fibers. -/
6noncomputable section
7open scoped BigOperators
8namespace Cloning.GeneralSymmetricOccupation
9set_option maxHeartbeats 1000000
10set_option synthInstance.maxHeartbeats 200000
11set_option backward.isDefEq.respectTransparency false
12
13private abbrev WordFiber {L d : ℕ} (w : Word L d) := {v : Word L d // profile v = profile w}
14private abbrev FiberBijections {L d : ℕ} (w : Word L d) (v : WordFiber w) :=
15 ∀ a : Fin d, {i : Fin L // w i = a} ≃ {i : Fin L // v.val i = a}
16
17private def fiberPerm {L d : ℕ} (w : Word L d)
18 (x : Σ v : WordFiber w, FiberBijections w v) : Equiv.Perm (Fin L) :=
19 Equiv.ofFiberEquiv x.2
20
21private theorem fiberPerm_injective {L d : ℕ} (w : Word L d) :
22 Function.Injective (fiberPerm w) := by
23 rintro ⟨⟨v, hv⟩, e⟩ ⟨⟨u, hu⟩, f⟩ h
24 have heq : v = u := by
25 funext i
26 obtain ⟨j, rfl⟩ := (fiberPerm w ⟨⟨v, hv⟩, e⟩).surjective i
27 change v (Equiv.ofFiberEquiv e j) = u (Equiv.ofFiberEquiv e j)
28 have he := Equiv.ofFiberEquiv_map e j
29 change v (Equiv.ofFiberEquiv e j) = w j at he
30 rw [he]
31 have hp := Equiv.ofFiberEquiv_map f j
32 change u (fiberPerm w ⟨⟨u, hu⟩, f⟩ j) = w j at hp
33 rw [← h] at hp
34 exact hp.symm
35 subst u
36 congr 1
37 funext a
38 apply Equiv.ext
39 intro i
40 apply Subtype.ext
41 rcases i with ⟨i, hi⟩
42 subst a
43 have hp := congrArg (fun σ : Equiv.Perm (Fin L) => σ i) h
44 simpa [fiberPerm, Equiv.ofFiberEquiv] using hp
45
46private theorem fiberPerm_surjective {L d : ℕ} (w : Word L d) :
47 Function.Surjective (fiberPerm w) := by
48 intro σ
49 let v : WordFiber w := ⟨w ∘ σ.symm, profile_permute w σ.symm⟩
50 let e : FiberBijections w v := fun a =>
51 { toFun := fun i => ⟨σ i, by change w (σ.symm (σ i)) = a; simpa using i.property⟩
52 invFun := fun i => ⟨σ.symm i, i.property⟩
53 left_inv := by intro i; exact Subtype.ext (σ.symm_apply_apply i)
54 right_inv := by intro i; exact Subtype.ext (σ.apply_symm_apply i) }
55 refine ⟨⟨v, e⟩, ?_⟩
56 ext i
57 simp [fiberPerm, Equiv.ofFiberEquiv_apply, e]
58
59/-- Permutations split into an occupation word and independent bijections of
60its letter fibers. This gives the multinomial count without assuming it. -/
61theorem multiplicity_mul_factorials {L d : ℕ} (q : Occupation L d) :
62 multiplicity q * ∏ a, (q.val a).factorial = L.factorial := by
63 classical
64 obtain ⟨w, hw⟩ := label_surjective L d q
65 subst q
66 let E : (Σ v : WordFiber w, FiberBijections w v) ≃ Equiv.Perm (Fin L) :=
67 Equiv.ofBijective (fiberPerm w) ⟨fiberPerm_injective w, fiberPerm_surjective w⟩
68 have hc := Fintype.card_congr E
69 rw [Fintype.card_sigma, Fintype.card_perm, Fintype.card_fin] at hc
70 have hf (v : WordFiber w) : Fintype.card (FiberBijections w v) =
71 ∏ a, (profile w a).factorial := by
72 rw [Fintype.card_pi]
73 apply Finset.prod_congr rfl
74 intro a ha
75 exact Fintype.card_equiv (Fintype.equivOfCardEq (congrFun v.property a).symm)
76 simp_rw [hf] at hc
77 simp only [Finset.sum_const, Finset.card_univ, smul_eq_mul] at hc
78 have hwcard : Fintype.card (WordFiber w) = multiplicity (label w) := by
79 simp only [WordFiber, multiplicity, Fintype.card_subtype]
80 congr 1
81 ext v
82 simp only [Finset.mem_filter, Finset.mem_univ, true_and]
83 exact ⟨fun h => Subtype.ext h, fun h => congrArg Subtype.val h⟩
84 rw [hwcard] at hc
85 exact hc
86
87end Cloning.GeneralSymmetricOccupation