Download data/lean/OAI/NumberTheory/PiExponent/Jets/NormalBasisRigidity.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.78 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/PiExponent/Jets/NormalBasisRigidity.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/PiExponent/Jets/NormalBasisRigidity.lean
-
curl -L -o NormalBasisRigidity.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/PiExponent/Jets/NormalBasisRigidity.lean
7.78 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| namespace PiExponent.NormalBasisRigidity | |
| open Set Submodule Module | |
| variable {K V ΞΉ : Type*} [Field K] [AddCommGroup V] [Module K V] | |
| def IsNormalBasis (v : ΞΉ β V) (A : Finset ΞΉ) : Prop := | |
| LinearIndepOn K v (A : Set ΞΉ) β§ span K (v '' (A : Set ΞΉ)) = β€ | |
| lemma exists_normalBasis_subset [Fintype ΞΉ] (v : ΞΉ β V) (S : Set ΞΉ) | |
| (hS : span K (v '' S) = β€) : | |
| β A : Finset ΞΉ, (A : Set ΞΉ) β S β§ IsNormalBasis (K := K) v A := by | |
| classical | |
| let h := linearIndepOn_empty K v | |
| let A := h.extend (Set.empty_subset S) | |
| refine β¨A.toFinset, ?_, ?_, ?_β© | |
| Β· simpa only [Set.coe_toFinset] using h.extend_subset (Set.empty_subset S) | |
| Β· simpa only [Set.coe_toFinset] using h.linearIndepOn_extend (Set.empty_subset S) | |
| Β· simpa only [Set.coe_toFinset, A] using | |
| (h.span_image_extend_eq_span_image (Set.empty_subset S)).trans hS | |
| lemma exists_normalBasis_containing [Fintype ΞΉ] (v : ΞΉ β V) | |
| (hv : span K (Set.range v) = β€) (i : ΞΉ) (hi : v i β 0) : | |
| β A : Finset ΞΉ, i β A β§ IsNormalBasis (K := K) v A := by | |
| classical | |
| have h : LinearIndepOn K v ({i} : Set ΞΉ) := by | |
| exact LinearIndepOn.singleton hi | |
| let A := h.extend (Set.subset_univ _) | |
| refine β¨A.toFinset, ?_, ?_, ?_β© | |
| Β· exact Set.mem_toFinset.mpr (h.subset_extend (Set.subset_univ _) (Set.mem_singleton i)) | |
| Β· simpa only [Set.coe_toFinset] using h.linearIndepOn_extend (Set.subset_univ _) | |
| Β· simpa only [Set.coe_toFinset, Set.image_univ, A] using | |
| (h.span_image_extend_eq_span_image (Set.subset_univ _)).trans (by simpa using hv) | |
| lemma IsNormalBasis.ne_zero [DecidableEq ΞΉ] {v : ΞΉ β V} {A : Finset ΞΉ} | |
| (hA : IsNormalBasis (K := K) v A) {i : ΞΉ} (hi : i β A) : v i β 0 := | |
| hA.1.ne_zero hi | |
| lemma exists_normalBasis_omitting [Fintype ΞΉ] (v : ΞΉ β V) (i : ΞΉ) | |
| (h : span K (v '' {j | j β i}) = β€) : | |
| β A : Finset ΞΉ, i β A β§ IsNormalBasis (K := K) v A := by | |
| obtain β¨A, hA, hBβ© := exists_normalBasis_subset v {j | j β i} h | |
| exact β¨A, fun hi => hA hi rfl, hBβ© | |
| lemma mandatory_not_mem_span [Fintype ΞΉ] (v : ΞΉ β V) | |
| (hv : span K (Set.range v) = β€) (i : ΞΉ) | |
| (hi : β A, IsNormalBasis (K := K) v A β i β A) : | |
| v i β span K (v '' {j | j β i}) := by | |
| intro hmem | |
| have hspan : span K (v '' {j | j β i}) = β€ := by | |
| apply top_unique | |
| rw [β hv] | |
| apply span_le.mpr | |
| rintro _ β¨j, rflβ© | |
| by_cases hj : j = i | |
| Β· subst j | |
| exact hmem | |
| Β· exact subset_span β¨j, hj, rflβ© | |
| obtain β¨A, hAi, hAβ© := exists_normalBasis_omitting v i hspan | |
| exact hAi (hi A hA) | |
| lemma IsNormalBasis.card_eq {v : ΞΉ β V} {A : Finset ΞΉ} | |
| (hA : IsNormalBasis (K := K) v A) : A.card = Module.finrank K V := by | |
| classical | |
| have hli : LinearIndependent K (fun i : A => v i) := hA.1 | |
| let b : Basis A K V := Basis.mk hli (by | |
| have hr : Set.range (fun i : A => v i) = v '' (A : Set ΞΉ) := by | |
| ext x | |
| simp | |
| rw [hr, hA.2]) | |
| exact (Module.finrank_eq_card_finset_basis b).symm | |
| variable {W : Type*} [AddCommGroup W] [Module K W] | |
| lemma mandatory_coordinate_eq_zero [Fintype ΞΉ] (b : Basis ΞΉ K V) (q : V ββ[K] W) | |
| (hq : span K (Set.range (fun j => q (b j))) = β€) (i : ΞΉ) | |
| (hi : β A, IsNormalBasis (K := K) (fun j => q (b j)) A β i β A) | |
| (t : V) (ht : q t = 0) : b.repr t i = 0 := by | |
| classical | |
| by_contra hti | |
| let S : Submodule K W := span K ((fun j => q (b j)) '' {j | j β i}) | |
| have hsum : (β j β Finset.univ.erase i, b.repr t j β’ q (b j)) β S := by | |
| apply S.sum_mem | |
| intro j hj | |
| exact S.smul_mem _ (subset_span β¨j, (Finset.mem_erase.mp hj).1, rflβ©) | |
| have hall : (β j, b.repr t j β’ q (b j)) = 0 := by | |
| calc | |
| _ = q (β j, b.repr t j β’ b j) := by simp only [map_sum, map_smul] | |
| _ = 0 := by rw [b.sum_repr, ht] | |
| rw [β Finset.sum_erase_add _ _ (Finset.mem_univ i)] at hall | |
| have hterm : b.repr t i β’ q (b i) β S := by | |
| have heq : b.repr t i β’ q (b i) = -(β j β Finset.univ.erase i, | |
| b.repr t j β’ q (b j)) := eq_neg_of_add_eq_zero_left (by simpa only [add_comm] using hall) | |
| rw [heq] | |
| exact S.neg_mem hsum | |
| exact mandatory_not_mem_span (fun j => q (b j)) hq i hi | |
| ((S.smul_mem_iff hti).mp hterm) | |
| lemma largest_nontangent_mandatory {m : β} | |
| (u v : Fin (m + 1) β V) (hu : span K (Set.range u) = β€) | |
| (hvu : β i, i β 0 β v i = u i) | |
| (hexclude : β A B : Finset (Fin (m + 1)), | |
| IsNormalBasis (K := K) u A β IsNormalBasis (K := K) v B β | |
| β i, i β 0 β i β A β i β B β | |
| (β j, i < j β (j β A β j β B)) β False) | |
| (i : Fin (m + 1)) (hi0 : i β 0) (hi : u i β 0) | |
| (hlarge : β j, i < j β u j = 0) | |
| (B : Finset (Fin (m + 1))) (hB : IsNormalBasis (K := K) v B) : i β B := by | |
| classical | |
| obtain β¨A, hiA, hAβ© := exists_normalBasis_containing u hu i hi | |
| by_contra hiB | |
| apply hexclude A B hA hB i hi0 hiA hiB | |
| intro j hj | |
| have hj0 : j β 0 := by | |
| intro h | |
| subst j | |
| exact (not_lt_of_ge (Fin.zero_le _)) hj | |
| have hjA : j β A := fun h => hA.ne_zero h (hlarge j hj) | |
| have hjB : j β B := fun h => hB.ne_zero h ((hvu j hj0).trans (hlarge j hj)) | |
| simp only [hjA, hjB] | |
| lemma weighted_normalBasis_exclusion {m : β} | |
| (u v : Fin (m + 1) β V) (w cost : Fin (m + 1) β β) (C : β) | |
| (hcomparison : β A B, IsNormalBasis (K := K) u A β | |
| IsNormalBasis (K := K) v B β (β j β A, w j) β€ C * β j β B, cost j) | |
| (hseparated : β A B : Finset (Fin (m + 1)), A.card = B.card β | |
| β i, i β 0 β i β A β i β B β | |
| (β j, i < j β (j β A β j β B)) β | |
| C * (β j β B, cost j) < β j β A, w j) | |
| (A B : Finset (Fin (m + 1))) | |
| (hA : IsNormalBasis (K := K) u A) (hB : IsNormalBasis (K := K) v B) | |
| (i : Fin (m + 1)) (hi0 : i β 0) (hiA : i β A) (hiB : i β B) | |
| (hlarge : β j, i < j β (j β A β j β B)) : False := by | |
| exact (not_lt_of_ge (hcomparison A B hA hB)) | |
| (hseparated A B (hA.card_eq.trans hB.card_eq.symm) i hi0 hiA hiB hlarge) | |
| lemma normalBasis_unique_of_discrepancy_excluded [LinearOrder ΞΉ] | |
| (v : ΞΉ β V) | |
| (hexclude : β A B : Finset ΞΉ, | |
| IsNormalBasis (K := K) v A β IsNormalBasis (K := K) v B β | |
| β i, i β A β i β B β | |
| (β j, i < j β (j β A β j β B)) β False) | |
| (A B : Finset ΞΉ) (hA : IsNormalBasis (K := K) v A) | |
| (hB : IsNormalBasis (K := K) v B) : A = B := by | |
| classical | |
| by_contra hne | |
| let S := (A \ B) βͺ (B \ A) | |
| have hS : S.Nonempty := by | |
| by_contra he | |
| have he' : S = β := Finset.not_nonempty_iff_eq_empty.mp he | |
| apply hne | |
| apply Finset.ext | |
| intro i | |
| constructor | |
| Β· intro hi | |
| by_contra hn | |
| have : i β S := Finset.mem_union_left _ (Finset.mem_sdiff.mpr β¨hi, hnβ©) | |
| simp [he'] at this | |
| Β· intro hi | |
| by_contra hn | |
| have : i β S := Finset.mem_union_right _ (Finset.mem_sdiff.mpr β¨hi, hnβ©) | |
| simp [he'] at this | |
| let i := S.max' hS | |
| have hiS : i β S := Finset.max'_mem _ _ | |
| have hlarge : β j, i < j β (j β A β j β B) := by | |
| intro j hj | |
| have hjS : j β S := fun h => (not_lt_of_ge (Finset.le_max' _ _ h)) hj | |
| constructor | |
| Β· intro hja | |
| by_contra hjb | |
| exact hjS (Finset.mem_union_left _ (Finset.mem_sdiff.mpr β¨hja, hjbβ©)) | |
| Β· intro hjb | |
| by_contra hja | |
| exact hjS (Finset.mem_union_right _ (Finset.mem_sdiff.mpr β¨hjb, hjaβ©)) | |
| rcases Finset.mem_union.mp hiS with hi | hi | |
| Β· exact hexclude A B hA hB i (Finset.mem_sdiff.mp hi).1 | |
| (Finset.mem_sdiff.mp hi).2 hlarge | |
| Β· exact hexclude B A hB hA i (Finset.mem_sdiff.mp hi).1 | |
| (Finset.mem_sdiff.mp hi).2 (fun j hj => (hlarge j hj).symm) | |
| end PiExponent.NormalBasisRigidity | |
| end | |
| end OAI | |