import Mathlib.Algebra.Star.Subalgebra import Mathlib.Algebra.Star.Unitary import Mathlib.Analysis.Complex.Basic import Mathlib.Analysis.Normed.Module.Basic import Mathlib.Analysis.Normed.Operator.Bilinear import Mathlib.Topology.Algebra.Module.Spaces.ContinuousLinearMap import Mathlib.Topology.Algebra.StarSubalgebra import OAI.Analysis.FactorGeneration.Words namespace OAI noncomputable section namespace Generator /-! The algebraic star algebra generated by one unitary is exactly the linear span of all its integer powers. No topology on the ambient algebra is needed. -/ section variable {R A : Type*} [CommRing R] [StarRing R] [Ring A] [StarRing A] [Algebra R A] [StarModule R A] def unitaryPowerMonoid (v : unitary A) : Submonoid A where carrier := Set.range (fun n : ℤ => (↑(v^n) : A)) one_mem' := ⟨0, by simp⟩ mul_mem' := by rintro a b ⟨n,rfl⟩ ⟨m,rfl⟩ exact ⟨n+m,by simp [zpow_add]⟩ theorem unitary_power_mem_adjoin (v : unitary A) (n : ℤ) : (↑(v^n) : A) ∈ StarAlgebra.adjoin R {(v : A)} := by have hv := StarAlgebra.self_mem_adjoin_singleton R (v : A) cases n with | ofNat n => simpa using (StarAlgebra.adjoin R {(v : A)}).pow_mem hv n | negSucc n => have hs : star (v : A) ∈ StarAlgebra.adjoin R {(v : A)} := star_mem hv have hp := (StarAlgebra.adjoin R {(v : A)}).pow_mem hs (n+1) change (↑(v ^ (-(↑n + 1) : ℤ)) : A) ∈ _ rw [zpow_neg, ← Int.natCast_add_one, zpow_natCast] change star ((v : A)^(n+1)) ∈ _ rw [star_pow] exact hp theorem unitary_adjoin_eq_span (v : unitary A) : (StarAlgebra.adjoin R {(v : A)}).toSubalgebra.toSubmodule = Submodule.span R (Set.range (fun n : ℤ => (↑(v^n) : A))) := by apply le_antisymm · rw [StarAlgebra.adjoin_eq_span] apply Submodule.span_mono change Submonoid.closure _ ≤ unitaryPowerMonoid v apply Submonoid.closure_le.mpr intro x hx rcases hx with hx | hx · obtain rfl := Set.mem_singleton_iff.mp hx exact ⟨1,by simp⟩ · have hx' : x = star (v : A) := by have he : star x = (v : A) := by simpa using hx exact (star_star x).symm.trans (congrArg star he) subst x exact ⟨-1,by change (↑(v ^ (-1 : ℤ)) : A) = _; rw [zpow_neg_one]; rfl⟩ · apply Submodule.span_le.mpr rintro x ⟨n,rfl⟩ exact unitary_power_mem_adjoin v n end /-! Centered Laurent polynomials and their norm closure. -/ open scoped Topology section Algebraic variable {A : Type*} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] def nonzeroUnitaryPowers (v : unitary A) : Set A := {x | ∃ n : ℤ,n ≠ 0 ∧ x=(↑(v^n) : A)} def centerLinear (φ : A →ₗ[ℂ] ℂ) : A →ₗ[ℂ] A := LinearMap.id - φ.smulRight (1 : A) omit [StarRing A] [StarModule ℂ A] in @[simp] theorem centerLinear_apply (φ : A →ₗ[ℂ] ℂ) (x : A) : centerLinear φ x = x-φ x • (1 : A) := rfl theorem center_adjoin_mem_span (v : unitary A) (φ : A →ₗ[ℂ] ℂ) (h1 : φ 1=1) (hhaar : ∀ n : ℤ,n ≠ 0 → φ (↑(v^n) : A)=0) (x : A) (hx : x ∈ StarAlgebra.adjoin ℂ {(v : A)}) : centerLinear φ x ∈ Submodule.span ℂ (nonzeroUnitaryPowers v) := by have hx' : x ∈ Submodule.span ℂ (Set.range (fun n : ℤ => (↑(v^n) : A))) := by rw [← unitary_adjoin_eq_span]; exact hx clear hx induction hx' using Submodule.span_induction with | mem x hx => obtain ⟨n,rfl⟩ := hx by_cases hn : n=0 · simp [hn,h1] · rw [centerLinear_apply,hhaar n hn,zero_smul,sub_zero] exact Submodule.subset_span ⟨n,hn,rfl⟩ | zero => simpa only [map_zero] using (Submodule.span ℂ (nonzeroUnitaryPowers v)).zero_mem | add x y hx hy ihx ihy => rw [map_add]; exact Submodule.add_mem _ ihx ihy | smul r x hx ih => rw [map_smul]; exact Submodule.smul_mem _ r ih end Algebraic section variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] [StarRing A] [StarModule ℂ A] [ContinuousStar A] /-- Every centered element of the actual norm-closed generated star algebra is a norm limit of linear combinations of nonzero powers. -/ theorem centered_elemental_mem_closedSpan (v : unitary A) (φ : A →L[ℂ] ℂ) (h1 : φ 1=1) (hhaar : ∀ n : ℤ,n ≠ 0 → φ (↑(v^n) : A)=0) (x : A) (hx : x ∈ StarAlgebra.elemental ℂ (v : A)) (hcenter : φ x=0) : x ∈ (Submodule.span ℂ (nonzeroUnitaryPowers v)).topologicalClosure := by let S := (Submodule.span ℂ (nonzeroUnitaryPowers v)).topologicalClosure let f : A →L[ℂ] A := ContinuousLinearMap.id ℂ A - φ.smulRight (1 : A) have hc : IsClosed {y : A | f y ∈ S} := (Submodule.span ℂ (nonzeroUnitaryPowers v)).isClosed_topologicalClosure.preimage f.continuous have hp : ∀ y ∈ StarAlgebra.adjoin ℂ {(v : A)},f y ∈ S := by intro y hy exact Submodule.le_topologicalClosure _ (center_adjoin_mem_span v φ.toLinearMap h1 hhaar y hy) have hh : f x ∈ S := closure_minimal hp hc hx change x-φ x • (1 : A) ∈ S at hh simpa only [hcenter,zero_smul,sub_zero] using hh end /-! A continuous functional on a normed algebra extends zero product moments separately to the closed linear span in each slot. -/ open scoped Topology section variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] def sandwichFunctional (φ : A →L[ℂ] ℂ) (a b : A) : A →L[ℂ] ℂ where toFun x := φ (a*x*b) map_add' x y := by simp only [mul_add,add_mul,map_add] map_smul' c x := by simp only [mul_smul_comm,smul_mul_assoc,map_smul,RingHom.id_apply] cont := by fun_prop theorem functional_sandwich_closedSpan (φ : A →L[ℂ] ℂ) (S : Set A) (a b x : A) (hx : x ∈ (Submodule.span ℂ S).topologicalClosure) (hm : ∀ y ∈ S,φ (a*y*b)=0) : φ (a*x*b)=0 := by let f := sandwichFunctional φ a b have hs : Submodule.span ℂ S ≤ LinearMap.ker f.toLinearMap := by apply Submodule.span_le.mpr intro y hy exact hm y hy exact (Submodule.span ℂ S).topologicalClosure_minimal hs f.isClosed_ker hx theorem functional_product_closedSpan (φ : A →L[ℂ] ℂ) (sets : List (Set A)) (xs : List A) (a : A) (hxs : List.Forall₂ (fun S x => x ∈ (Submodule.span ℂ S).topologicalClosure) sets xs) (hm : ∀ ys,List.Forall₂ (fun S y => y ∈ S) sets ys → φ (a*ys.prod)=0) : φ (a*xs.prod)=0 := by induction xs generalizing sets a with | nil => cases hxs; exact hm [] .nil | cons x xs ih => cases hxs with | @cons S x sets xs hx hxs => have hh := functional_sandwich_closedSpan φ S a xs.prod x hx (by intro y hy apply ih sets (a*y) hxs intro ys hys simpa only [List.prod_cons,mul_assoc] using hm (y::ys) (.cons hy hys)) simpa only [List.prod_cons,mul_assoc] using hh theorem alternatingFrom_closedSpan_slots (S T : Set A) (b : Bool) (xs : List A) (hx : alternatingFrom ((Submodule.span ℂ S).topologicalClosure : Set A) ((Submodule.span ℂ T).topologicalClosure : Set A) b xs) : List.Forall₂ (fun s x => x ∈ (Submodule.span ℂ s).topologicalClosure) (alternatingSlotSets S T b xs.length) xs := by induction xs generalizing b with | nil => exact .nil | cons x xs ih => cases b <;> exact .cons hx.1 (ih _ hx.2) theorem alternatingMomentsZero_closedSpan (φ : A →L[ℂ] ℂ) (S T : Set A) (hm : alternatingMomentsZero φ S T) : alternatingMomentsZero φ ((Submodule.span ℂ S).topologicalClosure : Set A) ((Submodule.span ℂ T).topologicalClosure : Set A) := by intro b xs hn hx have hh := functional_product_closedSpan φ (alternatingSlotSets S T b xs.length) xs 1 (alternatingFrom_closedSpan_slots S T b xs hx) (by intro ys hys have hl : ys.length=xs.length := by rw [← hys.length_eq,alternatingSlotSets_length] have hy : ys ≠ [] := by intro he have hz : xs.length=0 := by simpa [he] using hl.symm exact hn (List.length_eq_zero_iff.mp hz) have ha : alternatingFrom S T b ys := by apply (alternatingFrom_slots S T b ys).mpr simpa only [hl] using hys simpa only [one_mul] using hm b ys hy ha) simpa only [one_mul] using hh /-- Standard freeness: every nonempty alternating product of centered elements vanishes, starting with either algebra and with no restriction on length parity. -/ def freeSets (φ : A → ℂ) (S T : Set A) : Prop := alternatingMomentsZero φ {x | x ∈ S ∧ φ x=0} {x | x ∈ T ∧ φ x=0} end /-! Norm completion of algebraic mixed moments gives full freeness of the actual generated C*-algebra from the closed base algebra. -/ variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] /-- Centering commutes with norm approximation in a unital subalgebra. -/ theorem centered_subalgebra_closure_mem (φ : A →L[ℂ] ℂ) (h1 : φ 1=1) (D : Subalgebra ℂ A) (x : A) (hx : x ∈ D.topologicalClosure) (hcenter : φ x=0) : x ∈ (Submodule.span ℂ {d | d ∈ D ∧ φ d=0}).topologicalClosure := by let S := Submodule.span ℂ {d | d ∈ D ∧ φ d=0} let f : A →L[ℂ] A := ContinuousLinearMap.id ℂ A - φ.smulRight (1 : A) have hc : IsClosed {y : A | f y ∈ S.topologicalClosure} := S.isClosed_topologicalClosure.preimage f.continuous have hp : ∀ y ∈ D,f y ∈ S.topologicalClosure := by intro y hy apply Submodule.le_topologicalClosure apply Submodule.subset_span change y-φ y • (1 : A) ∈ D ∧ φ (y-φ y • (1 : A))=0 refine ⟨D.sub_mem hy (D.smul_mem D.one_mem _),?_⟩ simp only [map_sub,map_smul,h1,smul_eq_mul,mul_one,sub_self] have hh : f x ∈ S.topologicalClosure := closure_minimal hp hc hx change x-φ x • (1 : A) ∈ S.topologicalClosure at hh simpa only [hcenter,zero_smul,sub_zero] using hh variable [StarRing A] [StarModule ℂ A] [ContinuousStar A] theorem unitary_generated_free_of_power_moments (φ : A →L[ℂ] ℂ) (h1 : φ 1=1) (v : unitary A) (D : Subalgebra ℂ A) (hhaar : ∀ n : ℤ,n ≠ 0 → φ (↑(v^n) : A)=0) (hm : alternatingMomentsZero φ (nonzeroUnitaryPowers v) {d | d ∈ D ∧ φ d=0}) : freeSets φ (StarAlgebra.elemental ℂ (v : A)) D.topologicalClosure := by have hclosed := alternatingMomentsZero_closedSpan φ _ _ hm intro b xs hn hx apply hclosed b xs hn clear hn induction xs generalizing b with | nil => trivial | cons x xs ih => cases b with | true => exact ⟨centered_elemental_mem_closedSpan v φ h1 hhaar x hx.1.1 hx.1.2,ih _ hx.2⟩ | false => exact ⟨centered_subalgebra_closure_mem φ h1 D x hx.1.1 hx.1.2,ih _ hx.2⟩ end Generator end end OAI