Download data/lean/OAI/Algebra/DepthFive/CoefficientSupport.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.13 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/DepthFive/CoefficientSupport.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Algebra/DepthFive/CoefficientSupport.lean
-
curl -L -o CoefficientSupport.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/DepthFive/CoefficientSupport.lean
4.13 kB
| import OAI.Algebra.DepthFive.Basic | |
| namespace OAI | |
| noncomputable section | |
| universe u | |
| namespace Problem335 | |
| /-- The scalars actually occurring at a leaf. -/ | |
| def leafCoefficientSet {K : Type u} {n : β} (x : D5Leaf K n) : Finset K := by | |
| classical | |
| exact match x with | |
| | .scalar a => {a} | |
| | .variable _ => β | |
| /-- All coefficients occurring in a circuit, including weighted wires. -/ | |
| def circuitCoefficientSet {K : Type u} [CommSemiring K] {n : β} | |
| (c : Depth5Circuit K n) : Finset K := by | |
| classical | |
| exact (Finset.univ.biUnion fun i => leafCoefficientSet (c.leaves i)) βͺ | |
| (Finset.univ.biUnion fun i => ((c.bottomInputs i).map Prod.fst).toFinset) βͺ | |
| (Finset.univ.biUnion fun i => ((c.middleInputs i).map Prod.fst).toFinset) βͺ | |
| (c.outputInputs.map Prod.fst).toFinset | |
| lemma leaf_scalar_mem_coefficientSet {K : Type u} [CommSemiring K] {n : β} | |
| (c : Depth5Circuit K n) (i : Fin c.leafCount) (a : K) | |
| (h : c.leaves i = .scalar a) : a β circuitCoefficientSet c := by | |
| classical | |
| simp only [circuitCoefficientSet, Finset.mem_union] | |
| left; left; left | |
| exact Finset.mem_biUnion.mpr β¨i, Finset.mem_univ _, by simp [h, leafCoefficientSet]β© | |
| lemma bottom_coeff_mem_coefficientSet {K : Type u} [CommSemiring K] {n : β} | |
| (c : Depth5Circuit K n) (i : Fin c.bottomCount) (entry : K Γ Fin c.leafCount) | |
| (h : entry β c.bottomInputs i) : entry.1 β circuitCoefficientSet c := by | |
| classical | |
| simp only [circuitCoefficientSet, Finset.mem_union] | |
| left; left; right | |
| exact Finset.mem_biUnion.mpr β¨i, Finset.mem_univ _, List.mem_toFinset.mpr | |
| (List.mem_map.mpr β¨entry, h, rflβ©)β© | |
| lemma middle_coeff_mem_coefficientSet {K : Type u} [CommSemiring K] {n : β} | |
| (c : Depth5Circuit K n) (i : Fin c.middleCount) (entry : K Γ Fin c.lowerCount) | |
| (h : entry β c.middleInputs i) : entry.1 β circuitCoefficientSet c := by | |
| classical | |
| simp only [circuitCoefficientSet, Finset.mem_union] | |
| left; right | |
| exact Finset.mem_biUnion.mpr β¨i, Finset.mem_univ _, List.mem_toFinset.mpr | |
| (List.mem_map.mpr β¨entry, h, rflβ©)β© | |
| lemma output_coeff_mem_coefficientSet {K : Type u} [CommSemiring K] {n : β} | |
| (c : Depth5Circuit K n) (entry : K Γ Fin c.upperCount) | |
| (h : entry β c.outputInputs) : entry.1 β circuitCoefficientSet c := by | |
| classical | |
| simp only [circuitCoefficientSet, Finset.mem_union] | |
| right | |
| exact List.mem_toFinset.mpr (List.mem_map.mpr β¨entry, h, rflβ©) | |
| /-- The subfield generated by the finitely many coefficients of a circuit. -/ | |
| def circuitCoefficientField {K : Type u} [Field K] {n : β} | |
| (c : Depth5Circuit K n) : Subfield K := | |
| Subfield.closure (β(circuitCoefficientSet c) : Set K) | |
| lemma leaf_scalar_mem {K : Type u} [Field K] {n : β} | |
| (c : Depth5Circuit K n) (i : Fin c.leafCount) (a : K) | |
| (h : c.leaves i = .scalar a) : a β circuitCoefficientField c := | |
| Subfield.subset_closure (leaf_scalar_mem_coefficientSet c i a h) | |
| lemma bottom_coeff_mem {K : Type u} [Field K] {n : β} | |
| (c : Depth5Circuit K n) (i : Fin c.bottomCount) (entry : K Γ Fin c.leafCount) | |
| (h : entry β c.bottomInputs i) : entry.1 β circuitCoefficientField c := | |
| Subfield.subset_closure (bottom_coeff_mem_coefficientSet c i entry h) | |
| lemma middle_coeff_mem {K : Type u} [Field K] {n : β} | |
| (c : Depth5Circuit K n) (i : Fin c.middleCount) (entry : K Γ Fin c.lowerCount) | |
| (h : entry β c.middleInputs i) : entry.1 β circuitCoefficientField c := | |
| Subfield.subset_closure (middle_coeff_mem_coefficientSet c i entry h) | |
| lemma output_coeff_mem {K : Type u} [Field K] {n : β} | |
| (c : Depth5Circuit K n) (entry : K Γ Fin c.upperCount) | |
| (h : entry β c.outputInputs) : entry.1 β circuitCoefficientField c := | |
| Subfield.subset_closure (output_coeff_mem_coefficientSet c entry h) | |
| instance circuitCoefficientField_countable {K : Type u} [Field K] {n : β} | |
| (c : Depth5Circuit K n) : Countable (circuitCoefficientField c) := by | |
| apply Cardinal.mk_le_aleph0_iff.mp | |
| exact (Subfield.cardinalMk_closure_le_max (β(circuitCoefficientSet c) : Set K)).trans | |
| (max_le (Cardinal.mk_le_aleph0) le_rfl) | |
| end Problem335 | |
| end | |
| end OAI | |