Download data/lean/OAI/LinearAlgebra/MatrixMultiplication/Recovery/OrbitCounting.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.07 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Recovery/OrbitCounting.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Recovery/OrbitCounting.lean
-
curl -L -o OrbitCounting.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Recovery/OrbitCounting.lean
4.07 kB
| import Mathlib.GroupTheory.GroupAction.Quotient | |
| import Mathlib.Data.Fintype.Sigma | |
| import Mathlib.Logic.Equiv.Basic | |
| import Mathlib.Basic.Real.Basic | |
| namespace OAI | |
| /-! Finite orbit symmetries, masks and exact recovery operations. -/ | |
| open scoped BigOperators | |
| namespace MatrixMultiplication.OrbitCounting | |
| variable {G X : Type*} [Group G] [MulAction G X] [Fintype G] [DecidableEq X] | |
| def orbitSet (x : X) : Finset X := Finset.univ.image fun g : G => g β’ x | |
| @[simp] theorem smul_mem_orbitSet (x : X) (g : G) : g β’ x β orbitSet (G := G) x := by | |
| exact Finset.mem_image.mpr β¨g, Finset.mem_univ _, rflβ© | |
| theorem card_fiber_eq (x y : X) (hy : y β orbitSet (G := G) x) : | |
| Fintype.card {g : G // g β’ x = y} = Fintype.card {g : G // g β’ x = x} := by | |
| classical | |
| obtain β¨r, _, hrβ© := Finset.mem_image.mp hy | |
| let e : {g : G // g β’ x = y} β {g : G // g β’ x = x} := | |
| { toFun := fun g => β¨rβ»ΒΉ * g.1, by | |
| rw [mul_smul, g.2, β hr, inv_smul_smul]β© | |
| invFun := fun g => β¨r * g.1, by | |
| rw [mul_smul, g.2, hr]β© | |
| left_inv := by intro g; apply Subtype.ext; simp | |
| right_inv := by intro g; apply Subtype.ext; simp } | |
| exact Fintype.card_congr e | |
| theorem card_group (x : X) : | |
| Fintype.card G = (orbitSet (G := G) x).card * | |
| Fintype.card {g : G // g β’ x = x} := by | |
| classical | |
| let e := Equiv.sigmaSubtypeFiberEquiv (fun g : G => g β’ x) | |
| (fun y => y β orbitSet (G := G) x) (smul_mem_orbitSet x) | |
| calc | |
| Fintype.card G = Fintype.card (Ξ£ y : {y // y β orbitSet (G := G) x}, | |
| {g : G // g β’ x = y.1}) := (Fintype.card_congr e).symm | |
| _ = β y : {y // y β orbitSet (G := G) x}, | |
| Fintype.card {g : G // g β’ x = y.1} := Fintype.card_sigma | |
| _ = β _y : {y // y β orbitSet (G := G) x}, | |
| Fintype.card {g : G // g β’ x = x} := by | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| exact card_fiber_eq x y.1 y.2 | |
| _ = _ := by simp | |
| theorem bad_shift_count (x : X) (bad : X β Prop) [DecidablePred bad] : | |
| (Finset.univ.filter fun g : G => bad (g β’ x)).card = | |
| ((orbitSet (G := G) x).filter bad).card * | |
| Fintype.card {g : G // g β’ x = x} := by | |
| classical | |
| let e := Equiv.sigmaSubtypeFiberEquivSubtype (fun g : G => g β’ x) | |
| (p := fun g => bad (g β’ x)) | |
| (q := fun y => y β (orbitSet (G := G) x).filter bad) | |
| (fun g => by simp) | |
| calc | |
| (Finset.univ.filter fun g : G => bad (g β’ x)).card = | |
| Fintype.card {g : G // bad (g β’ x)} := (Fintype.card_subtype _).symm | |
| _ = Fintype.card (Ξ£ y : {y // y β (orbitSet (G := G) x).filter bad}, | |
| {g : G // g β’ x = y.1}) := (Fintype.card_congr e).symm | |
| _ = β y : {y // y β (orbitSet (G := G) x).filter bad}, | |
| Fintype.card {g : G // g β’ x = y.1} := Fintype.card_sigma | |
| _ = β _y : {y // y β (orbitSet (G := G) x).filter bad}, | |
| Fintype.card {g : G // g β’ x = x} := by | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| exact card_fiber_eq x y.1 (Finset.mem_filter.mp y.2).1 | |
| _ = _ := by simp | |
| theorem bad_shift_bound (x : X) (bad : X β Prop) [DecidablePred bad] (N C : β) | |
| (h : N * ((orbitSet (G := G) x).filter bad).card β€ C * (orbitSet (G := G) x).card) : | |
| N * (Finset.univ.filter fun g : G => bad (g β’ x)).card β€ C * Fintype.card G := by | |
| rw [bad_shift_count, card_group (G := G) x] | |
| simpa only [Nat.mul_assoc] using Nat.mul_le_mul_right | |
| (Fintype.card {g : G // g β’ x = x}) h | |
| theorem bad_shift_fraction (x : X) (bad : X β Prop) [DecidablePred bad] : | |
| ((Finset.univ.filter fun g : G => bad (g β’ x)).card : β) / Fintype.card G = | |
| (((orbitSet (G := G) x).filter bad).card : β) / (orbitSet (G := G) x).card := by | |
| have hsNat : 0 < Fintype.card {g : G // g β’ x = x} := | |
| Fintype.card_pos_iff.mpr β¨β¨1, one_smul G xβ©β© | |
| have hs : (Fintype.card {g : G // g β’ x = x} : β) β 0 := | |
| Nat.cast_ne_zero.mpr (Nat.ne_of_gt hsNat) | |
| rw [bad_shift_count, card_group (G := G) x] | |
| simp only [Nat.cast_mul] | |
| exact mul_div_mul_right _ _ hs | |
| end MatrixMultiplication.OrbitCounting | |
| end OAI | |