Download data/lean/OAI/RepresentationTheory/UniversalSquare/Contraction/DomainContractions.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.69 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/RepresentationTheory/UniversalSquare/Contraction/DomainContractions.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/RepresentationTheory/UniversalSquare/Contraction/DomainContractions.lean
-
curl -L -o DomainContractions.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/RepresentationTheory/UniversalSquare/Contraction/DomainContractions.lean
6.69 kB
| import Mathlib | |
| import OAI.RepresentationTheory.Saxl.Main | |
| import OAI.RepresentationTheory.UniversalSquare.Contraction.ColumnCertificates | |
| import OAI.RepresentationTheory.UniversalSquare.Balance.PackingPlans | |
| namespace OAI | |
| /-! Domain Contractions. -/ | |
| section | |
| open scoped BigOperators | |
| namespace Saxl.Columns | |
| def Domains : List β β Type | |
| | [] => Unit | |
| | r :: rs => Finset (Equiv.Perm (Fin r)) Γ Domains rs | |
| def Domains.full : (rs : List β) β Domains rs | |
| | [] => () | |
| | _ :: rs => (Finset.univ, full rs) | |
| def Domains.weight : {rs : List β} β Domains rs β Perms rs β β€ | |
| | [], _, _ => 1 | |
| | _ :: _, (s,D), (Ο,Ο) => (if Ο β s then (Equiv.Perm.sign Ο : β€) else 0) * weight D Ο | |
| lemma Domains.full_weight {rs : List β} (Ο : Perms rs) : | |
| (full rs).weight Ο = sgInteger Ο := by | |
| induction rs with | |
| | nil => rfl | |
| | cons r rs ih => simp only [full, weight, sgInteger, Finset.mem_univ, ite_true, ih] | |
| def Domains.atValue : {rs : List β} β Domains rs β Cells rs β β β Domains rs | |
| | _ :: _, (s,D), .inl i, j => (s.filter (fun Ο => (Ο i).val = j),D) | |
| | _ :: _, (s,D), .inr c, j => (s,atValue D c j) | |
| lemma Domains.atValue_weight {rs : List β} (D : Domains rs) (c : Cells rs) | |
| (j : β) (Ο : Perms rs) : | |
| (D.atValue c j).weight Ο = D.weight Ο * | |
| (if row (perm Ο c) = j then 1 else 0) := by | |
| induction rs with | |
| | nil => exact c.elim | |
| | cons r rs ih => | |
| rcases D with β¨s,Dβ© | |
| rcases Ο with β¨Ο,Οβ© | |
| cases c with | |
| | inl i => | |
| simp only [atValue, weight, Finset.mem_filter, perm, Equiv.sumCongr_apply, | |
| Sum.map_inl, row] | |
| split_ifs <;> simp_all | |
| | inr c => | |
| simp only [atValue, weight, perm, Equiv.sumCongr_apply, Sum.map_inr, row, ih, | |
| mul_assoc] | |
| def Domains.vanished : {rs : List β} β Domains rs β Bool | |
| | [], _ => false | |
| | _ :: _, (s,D) => decide (s = β ) || vanished D | |
| lemma Domains.weight_eq_zero {rs : List β} (D : Domains rs) | |
| (h : D.vanished = true) (Ο : Perms rs) : D.weight Ο = 0 := by | |
| induction rs with | |
| | nil => simp [vanished] at h | |
| | cons r rs ih => | |
| rcases D with β¨s,Dβ© | |
| rcases Ο with β¨Ο,Οβ© | |
| simp only [vanished, Bool.or_eq_true] at h | |
| rcases h with h | h | |
| Β· have hs : s = β := of_decide_eq_true h | |
| simp [weight, hs] | |
| Β· simp only [weight, ih D h Ο, mul_zero] | |
| def Domains.mass : {rs : List β} β Domains rs β β€ | |
| | [], _ => 1 | |
| | _ :: _, (s,D) => (β Ο β s, (Equiv.Perm.sign Ο : β€)) * mass D | |
| lemma Domains.mass_eq_sum {rs : List β} (D : Domains rs) : | |
| D.mass = β Ο : Perms rs, D.weight Ο := by | |
| classical | |
| induction rs with | |
| | nil => simp [mass, weight, Perms] | |
| | cons r rs ih => | |
| rcases D with β¨s,Dβ© | |
| simp only [Perms, Fintype.sum_prod_type, weight, β Finset.mul_sum, β ih, | |
| β Finset.sum_mul, mass] | |
| congr 1 | |
| simp | |
| abbrev Edge (rsT rsA rsB : List β) := Cells rsT Γ Cells rsA Γ Cells rsB | |
| def domainContraction {rsT rsA rsB : List β} | |
| (D : Domains rsT) (E : Domains rsA) (F : Domains rsB) | |
| (edges : List (Edge rsT rsA rsB)) (flag : Finset (β Γ β Γ β)) : β€ := | |
| β Ο : Perms rsT, β Ο : Perms rsA, β Ο : Perms rsB, | |
| D.weight Ο * E.weight Ο * F.weight Ο * | |
| (edges.map (fun c => if (row (perm Ο c.1), row (perm Ο c.2.1), | |
| row (perm Ο c.2.2)) β flag then (1 : β€) else 0)).prod | |
| lemma domainContraction_nil {rsT rsA rsB : List β} | |
| (D : Domains rsT) (E : Domains rsA) (F : Domains rsB) | |
| (flag : Finset (β Γ β Γ β)) : | |
| domainContraction D E F [] flag = D.mass * E.mass * F.mass := by | |
| simp only [domainContraction, List.map_nil, List.prod_nil, mul_one, | |
| β Finset.mul_sum, β Finset.sum_mul, β Domains.mass_eq_sum] | |
| lemma domainContraction_zero {rsT rsA rsB : List β} | |
| (D : Domains rsT) (E : Domains rsA) (F : Domains rsB) | |
| (edges : List (Edge rsT rsA rsB)) (flag : Finset (β Γ β Γ β)) | |
| (h : (D.vanished || E.vanished || F.vanished) = true) : | |
| domainContraction D E F edges flag = 0 := by | |
| rw [domainContraction] | |
| simp only [Bool.or_eq_true] at h | |
| rcases h with (h | h) | h | |
| Β· simp only [Domains.weight_eq_zero D h, zero_mul, Finset.sum_const_zero] | |
| Β· simp only [Domains.weight_eq_zero E h, mul_zero, zero_mul, Finset.sum_const_zero] | |
| Β· simp only [Domains.weight_eq_zero F h, mul_zero, zero_mul, Finset.sum_const_zero] | |
| lemma triple_indicator_sum (flag : Finset (β Γ β Γ β)) (a b c : β) : | |
| (β v β flag, (if a = v.1 then (1 : β€) else 0) * | |
| (if b = v.2.1 then 1 else 0) * (if c = v.2.2 then 1 else 0)) = | |
| if (a,b,c) β flag then 1 else 0 := by | |
| have hh : β v : β Γ β Γ β, (if a = v.1 then (1 : β€) else 0) * | |
| (if b = v.2.1 then 1 else 0) * (if c = v.2.2 then 1 else 0) = | |
| if (a,b,c) = v then 1 else 0 := by | |
| rintro β¨x,y,zβ© | |
| simp only [Prod.mk.injEq] | |
| split_ifs <;> simp_all | |
| simp only [hh] | |
| rw [Finset.sum_ite_eq] | |
| lemma domainContraction_cons {rsT rsA rsB : List β} | |
| (D : Domains rsT) (E : Domains rsA) (F : Domains rsB) | |
| (c : Edge rsT rsA rsB) (edges : List (Edge rsT rsA rsB)) | |
| (flag : Finset (β Γ β Γ β)) : | |
| domainContraction D E F (c::edges) flag = | |
| β v β flag, domainContraction (D.atValue c.1 v.1) | |
| (E.atValue c.2.1 v.2.1) (F.atValue c.2.2 v.2.2) edges flag := by | |
| classical | |
| simp only [domainContraction, List.map_cons, List.prod_cons, Domains.atValue_weight] | |
| conv_rhs => rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| conv_rhs => rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| conv_rhs => rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| trans (D.weight Ο * E.weight Ο * F.weight Ο) * | |
| (β v β flag, (if row (perm Ο c.1) = v.1 then (1 : β€) else 0) * | |
| (if row (perm Ο c.2.1) = v.2.1 then 1 else 0) * | |
| (if row (perm Ο c.2.2) = v.2.2 then 1 else 0)) * | |
| (edges.map (fun e => if (row (perm Ο e.1), row (perm Ο e.2.1), | |
| row (perm Ο e.2.2)) β flag then (1 : β€) else 0)).prod | |
| Β· rw [triple_indicator_sum] | |
| ring | |
| Β· simp only [Finset.mul_sum, Finset.sum_mul] | |
| apply Finset.sum_congr rfl | |
| intro v _ | |
| ring | |
| lemma domainContraction_perm {rsT rsA rsB : List β} | |
| (D : Domains rsT) (E : Domains rsA) (F : Domains rsB) | |
| {cs es : List (Edge rsT rsA rsB)} (hp : cs.Perm es) | |
| (flag : Finset (β Γ β Γ β)) : | |
| domainContraction D E F cs flag = domainContraction D E F es flag := by | |
| simp only [domainContraction] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| exact congrArg (_ * Β·) ((hp.map _).prod_eq) | |
| end Saxl.Columns | |
| end | |
| end OAI | |