import PaperIRelease.PacketDescent import PaperIRelease.AlgebraTransfer import KomorebiVerification.SeedRankOperations set_option autoImplicit false set_option linter.unnecessarySimpa false noncomputable section namespace Komorebi.PaperIRelease open Komorebi.Foundation universe u variable {π•œ X : Type u} [Field π•œ] [AddCommGroup X] [Module π•œ X] /-- Compress an ambient operator to the actual range of an idempotent. On a range vector this is the literal action `e T e`, because `e x = x`. -/ def cornerCompression (e : Module.End π•œ X) (T : Module.End π•œ X) : Module.End π•œ (LinearMap.range e) where toFun x := ⟨e (T x), ⟨T x, rfl⟩⟩ map_add' x y := Subtype.ext (by simp) map_smul' a x := Subtype.ext (by simp) theorem idempotent_range_fixed (e : Module.End π•œ X) (he : βˆ€ x, e (e x) = e x) (x : LinearMap.range e) : e (x : X) = x := by obtain ⟨y, hy⟩ := x.property rw [← hy] exact he y /-- The genuine unital corner acting on `range(e)`. The identity here is the restriction of `e`, rather than the ambient identity on unrelated packets. -/ def packetCornerAlgebra (A : Subalgebra π•œ (Module.End π•œ X)) (e : Module.End π•œ X) (heA : e ∈ A) (he : βˆ€ x, e (e x) = e x) : Subalgebra π•œ (Module.End π•œ (LinearMap.range e)) where carrier := {T | βˆƒ a ∈ A, cornerCompression e a = T} zero_mem' := ⟨0, A.zero_mem, by ext x; simp [cornerCompression]⟩ add_mem' := by rintro T U ⟨a, ha, rfl⟩ ⟨b, hb, rfl⟩ exact ⟨a + b, A.add_mem ha hb, by ext x; simp [cornerCompression]⟩ mul_mem' := by rintro T U ⟨a, ha, rfl⟩ ⟨b, hb, rfl⟩ exact ⟨a * e * b, A.mul_mem (A.mul_mem ha heA) hb, rfl⟩ algebraMap_mem' a := by refine ⟨algebraMap π•œ (Module.End π•œ X) a, A.algebraMap_mem a, ?_⟩ ext x change e (a β€’ (x : X)) = a β€’ (x : X) rw [map_smul, idempotent_range_fixed e he x] /-- Every corner action is an actual action by an element of the ambient algebra. The representing ambient element can be chosen independently of x. -/ theorem corner_action_ambient (A : Subalgebra π•œ (Module.End π•œ X)) (e : Module.End π•œ X) (heA : e ∈ A) (he : βˆ€ x, e (e x) = e x) (T : packetCornerAlgebra A e heA he) : βˆƒ a : A, βˆ€ x : LinearMap.range e, (T β€’ x : LinearMap.range e).val = a β€’ (x : X) := by obtain ⟨a, ha, hT⟩ := T.property refine ⟨⟨e * a, A.mul_mem heA ha⟩, ?_⟩ intro x change (T.val x : X) = e (a (x : X)) rw [← hT] rfl /-- The unital corner identity acts as the original projector on its range. -/ theorem corner_one_eq_projector (A : Subalgebra π•œ (Module.End π•œ X)) (e : Module.End π•œ X) (heA : e ∈ A) (he : βˆ€ x, e (e x) = e x) (x : LinearMap.range e) : ((1 : packetCornerAlgebra A e heA he) β€’ x : LinearMap.range e).val = e (x : X) := by rw [one_smul, idempotent_range_fixed e he x] end Komorebi.PaperIRelease