Aether Catalog definitions — EML_NeuralCoding_EMLStoneWeierstrassHausdorff
DefinitionEML_NeuralCoding_EMLStoneWeierstrassHausdorffaether-catalogeml
Definition bundle for the Aether Catalog module EML.NeuralCoding.EMLStoneWeierstrassHausdorff, transplanted by skeleton subtraction; supplies the types and constants the catalog's theorems import.
Definition code
-- Def bundle generated from EML/NeuralCoding/EMLStoneWeierstrassHausdorff.lean by skeleton subtraction
import Mathlib
/-
# EML Stone–Weierstrass Theorem for Compact Hausdorff Spaces
This file proves the generalized EML Stone–Weierstrass theorem: for any compact
Hausdorff space X equipped with a continuous point-separating family Φ : Fin n → C(X, ℝ),
the ℝ-subalgebra of C(X, ℝ) generated by the EML exponential and logistic generators
is dense in C(X, ℝ) (i.e., its topological closure is ⊤).
This removes the assumption that the ambient space is Euclidean (Fin n → ℝ) and works
with arbitrary compact Hausdorff topological spaces.
-/
noncomputable section
open Real Finset
variable {X : Type*} [TopologicalSpace X] [CompactSpace X] [T2Space X]
variable {n : ℕ} (Φ : Fin n → C(X, ℝ))
/-- The logistic (sigmoid) activation function. -/
def logistic (x : ℝ) : ℝ := 1 / (1 + exp (-x))
lemma logistic_continuous : Continuous logistic := by
unfold logistic
apply Continuous.div continuous_const
· exact continuous_const.add (continuous_neg.rexp)
· intro x; positivity
/-- EML exponential generator: `exp(∑ᵢ wᵢ Φᵢ(x) + b)`. -/
def emlExpGen (w : Fin n → ℝ) (b : ℝ) : C(X, ℝ) :=
⟨fun x => exp (∑ i : Fin n, w i * Φ i x + b),
(continuous_finset_sum _ (fun i _ => continuous_const.mul (Φ i).continuous) |>.add
continuous_const).rexp⟩
/-- EML logistic generator: `σ(∑ᵢ wᵢ Φᵢ(x) + b)`. -/
def emlLogisticGen (w : Fin n → ℝ) (b : ℝ) : C(X, ℝ) :=
⟨fun x => logistic (∑ i : Fin n, w i * Φ i x + b),
logistic_continuous.comp
(continuous_finset_sum _ (fun i _ => continuous_const.mul (Φ i).continuous) |>.add
continuous_const)⟩
/-- The set of all EML generators (exponential and logistic). -/
def emlGeneratorsHausdorff : Set C(X, ℝ) :=
{f | ∃ w b, f = emlExpGen Φ w b} ∪ {f | ∃ w b, f = emlLogisticGen Φ w b}
/-- The ℝ-subalgebra of C(X, ℝ) generated by the EML generators. -/
def emlSubalgebraHausdorff : Subalgebra ℝ C(X, ℝ) :=
Algebra.adjoin ℝ (emlGeneratorsHausdorff Φ)