math / data /lean /OAI /Computability /PerfectCompleteness /Construction /FactoredFunctionsLemmas.lean
Download data/lean/OAI/Computability/PerfectCompleteness/Construction/FactoredFunctionsLemmas.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.3 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/PerfectCompleteness/Construction/FactoredFunctionsLemmas.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/PerfectCompleteness/Construction/FactoredFunctionsLemmas.lean
-
curl -L -o FactoredFunctionsLemmas.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/PerfectCompleteness/Construction/FactoredFunctionsLemmas.lean
6.3 kB
| import Mathlib.LinearAlgebra.Pi | |
| import Mathlib.LinearAlgebra.Span.Basic | |
| namespace OAI | |
| namespace PerfectCompleteness.FactoredFunctions | |
| variable {π Ξ© Z I J : Type*} [Field π] | |
| def factoringSpace (other : Ξ© β Z) : Submodule π (Ξ© β π) where | |
| carrier := {f | β x y, other x = other y β f x = f y} | |
| zero_mem' := by intro x y _; rfl | |
| add_mem' := by | |
| intro f g hf hg x y h | |
| change f x + g x = f y + g y | |
| rw [hf x y h, hg x y h] | |
| smul_mem' := by | |
| intro c f hf x y h | |
| change c β’ f x = c β’ f y | |
| rw [hf x y h] | |
| @[simp] theorem mem_factoringSpace (other : Ξ© β Z) (f : Ξ© β π) : | |
| f β factoringSpace other β β x y, other x = other y β f x = f y := Iff.rfl | |
| theorem mem_factoringSpace_iff_exists_factor (other : Ξ© β Z) (f : Ξ© β π) : | |
| f β factoringSpace other β β g : Z β π, β x, f x = g (other x) := by | |
| classical | |
| constructor | |
| Β· intro hf | |
| let g : Z β π := fun z => | |
| if h : β x, other x = z then f (Classical.choose h) else 0 | |
| refine β¨g, ?_β© | |
| intro x | |
| have hx : β y, other y = other x := β¨x, rflβ© | |
| change f x = if h : β y, other y = other x then f (Classical.choose h) else 0 | |
| rw [dite_eq_left hx] | |
| exact hf x _ (Classical.choose_spec hx).symm | |
| Β· rintro β¨g, hgβ© x y h | |
| rw [hg x, hg y, h] | |
| theorem const_mem_factoringSpace (other : Ξ© β Z) (c : π) : | |
| (fun _ : Ξ© => c) β factoringSpace other := by | |
| intro x y _ | |
| rfl | |
| theorem one_mem_factoringSpace (other : Ξ© β Z) : | |
| (1 : Ξ© β π) β factoringSpace other := | |
| const_mem_factoringSpace other 1 | |
| theorem mul_mem_factoringSpace (other : Ξ© β Z) {f g : Ξ© β π} | |
| (hf : f β factoringSpace other) (hg : g β factoringSpace other) : | |
| f * g β factoringSpace other := by | |
| intro x y h | |
| change f x * g x = f y * g y | |
| rw [hf x y h, hg x y h] | |
| theorem coordinate_mem_factoringSpace (lower : Ξ© β I β J β π) (i : I) (t : J) : | |
| (fun x => lower x i t) β factoringSpace lower := by | |
| intro x y h | |
| exact congrFun (congrFun h i) t | |
| def quadraticSpan (lower : Ξ© β I β J β π) : Submodule π (Ξ© β π) := | |
| Submodule.span π {f | f = 1 β¨ | |
| β (i : I) (t u : J), f = fun x => lower x i t * lower x i u} | |
| theorem one_mem_quadraticSpan (lower : Ξ© β I β J β π) : | |
| (1 : Ξ© β π) β quadraticSpan lower := | |
| Submodule.subset_span (Or.inl rfl) | |
| theorem product_mem_quadraticSpan (lower : Ξ© β I β J β π) (i : I) (t u : J) : | |
| (fun x => lower x i t * lower x i u) β quadraticSpan lower := | |
| Submodule.subset_span (Or.inr β¨i, t, u, rflβ©) | |
| theorem quadraticSpan_le_factoringSpace (lower : Ξ© β I β J β π) : | |
| quadraticSpan lower β€ factoringSpace lower := by | |
| apply Submodule.span_le.mpr | |
| intro f hf | |
| rcases hf with rfl | β¨i, t, u, rflβ© | |
| Β· exact one_mem_factoringSpace lower | |
| Β· exact mul_mem_factoringSpace lower | |
| (coordinate_mem_factoringSpace lower i t) (coordinate_mem_factoringSpace lower i u) | |
| noncomputable section | |
| def realizer (other : Ξ© β Z) (z : Set.range other) : Ξ© := | |
| Classical.choose z.property | |
| theorem realizer_spec (other : Ξ© β Z) (z : Set.range other) : | |
| other (realizer other z) = z.val := | |
| Classical.choose_spec z.property | |
| def evaluation {other : Ξ© β Z} {B : Submodule π (Ξ© β π)} | |
| (_hB : B β€ factoringSpace other) (z : Set.range other) : B ββ[π] π := | |
| (LinearMap.proj (realizer other z)).comp B.subtype | |
| @[simp] theorem evaluation_apply {other : Ξ© β Z} {B : Submodule π (Ξ© β π)} | |
| (hB : B β€ factoringSpace other) (z : Set.range other) (b : B) : | |
| evaluation hB z b = b.val (realizer other z) := rfl | |
| theorem evaluation_apply_of_eq {other : Ξ© β Z} {B : Submodule π (Ξ© β π)} | |
| (hB : B β€ factoringSpace other) (z : Set.range other) (x : Ξ©) | |
| (hx : other x = z.val) (b : B) : evaluation hB z b = b.val x := | |
| hB b.property (realizer other z) x ((realizer_spec other z).trans hx.symm) | |
| theorem evaluation_eq_pointEvaluation {other : Ξ© β Z} {B : Submodule π (Ξ© β π)} | |
| (hB : B β€ factoringSpace other) (z : Set.range other) (x : Ξ©) | |
| (hx : other x = z.val) : | |
| evaluation hB z = (LinearMap.proj x).comp B.subtype := by | |
| apply LinearMap.ext | |
| intro b | |
| exact evaluation_apply_of_eq hB z x hx b | |
| @[simp] theorem evaluation_at_image {other : Ξ© β Z} {B : Submodule π (Ξ© β π)} | |
| (hB : B β€ factoringSpace other) (x : Ξ©) (b : B) : | |
| evaluation hB β¨other x, β¨x, rflβ©β© b = b.val x := | |
| evaluation_apply_of_eq hB _ x rfl b | |
| theorem evaluation_one {other : Ξ© β Z} {B : Submodule π (Ξ© β π)} | |
| (hB : B β€ factoringSpace other) (z : Set.range other) (h1 : (1 : Ξ© β π) β B) : | |
| evaluation hB z β¨1, h1β© = 1 := rfl | |
| end | |
| end PerfectCompleteness.FactoredFunctions | |
| namespace PerfectCompleteness.FactoredFunctionsDependent | |
| open PerfectCompleteness.FactoredFunctions | |
| variable {π Ξ© I : Type*} [Field π] {J : I β Type*} | |
| theorem coordinate_mem_factoringSpace (lower : Ξ© β (i : I) β J i β π) | |
| (i : I) (t : J i) : | |
| (fun x => lower x i t) β factoringSpace lower := by | |
| intro x y h | |
| exact congrFun (congrFun h i) t | |
| def dependentQuadraticSpan (lower : Ξ© β (i : I) β J i β π) : | |
| Submodule π (Ξ© β π) := | |
| Submodule.span π {f | f = 1 β¨ | |
| β (i : I) (t u : J i), f = fun x => lower x i t * lower x i u} | |
| theorem one_mem_dependentQuadraticSpan (lower : Ξ© β (i : I) β J i β π) : | |
| (1 : Ξ© β π) β dependentQuadraticSpan lower := | |
| Submodule.subset_span (Or.inl rfl) | |
| theorem product_mem_dependentQuadraticSpan (lower : Ξ© β (i : I) β J i β π) | |
| (i : I) (t u : J i) : | |
| (fun x => lower x i t * lower x i u) β dependentQuadraticSpan lower := | |
| Submodule.subset_span (Or.inr β¨i, t, u, rflβ©) | |
| theorem dependentQuadraticSpan_le_factoringSpace (lower : Ξ© β (i : I) β J i β π) : | |
| dependentQuadraticSpan lower β€ factoringSpace lower := by | |
| apply Submodule.span_le.mpr | |
| intro f hf | |
| rcases hf with rfl | β¨i, t, u, rflβ© | |
| Β· exact one_mem_factoringSpace lower | |
| Β· exact mul_mem_factoringSpace lower | |
| (coordinate_mem_factoringSpace lower i t) (coordinate_mem_factoringSpace lower i u) | |
| end PerfectCompleteness.FactoredFunctionsDependent | |
| end OAI | |