# Documentation

Mathlib.LinearAlgebra.Projection

# Projection to a subspace #

In this file we define

• Submodule.linearProjOfIsCompl (p q : Submodule R E) (h : IsCompl p q): the projection of a module E to a submodule p along its complement q; it is the unique linear map f : E → p such that f x = x for x ∈ p and f x = 0 for x ∈ q.
• Submodule.isComplEquivProj p: equivalence between submodules q such that IsCompl p q and projections f : E → p, ∀ x ∈ p, f x = x.

We also provide some lemmas justifying correctness of our definitions.

## Tags #

projection, complement subspace

theorem LinearMap.ker_id_sub_eq_of_proj {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {f : E →ₗ[R] { x // x p }} (hf : ∀ (x : { x // x p }), f x = x) :
LinearMap.ker (LinearMap.id - ) = p
theorem LinearMap.range_eq_of_proj {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {f : E →ₗ[R] { x // x p }} (hf : ∀ (x : { x // x p }), f x = x) :
theorem LinearMap.isCompl_of_proj {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {f : E →ₗ[R] { x // x p }} (hf : ∀ (x : { x // x p }), f x = x) :
IsCompl p ()
def Submodule.quotientEquivOfIsCompl {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) :
(E p) ≃ₗ[R] { x // x q }

If q is a complement of p, then M/p ≃ q.

Instances For
@[simp]
theorem Submodule.quotientEquivOfIsCompl_symm_apply {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) (x : { x // x q }) :
@[simp]
theorem Submodule.quotientEquivOfIsCompl_apply_mk_coe {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) (x : { x // x q }) :
↑() () = x
@[simp]
theorem Submodule.mk_quotientEquivOfIsCompl_apply {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) (x : E p) :
Submodule.Quotient.mk ↑(↑() x) = x
def Submodule.prodEquivOfIsCompl {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) :
({ x // x p } × { x // x q }) ≃ₗ[R] E

If q is a complement of p, then p × q is isomorphic to E. It is the unique linear map f : E → p such that f x = x for x ∈ p and f x = 0 for x ∈ q.

Instances For
@[simp]
theorem Submodule.coe_prodEquivOfIsCompl {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) :
@[simp]
theorem Submodule.coe_prodEquivOfIsCompl' {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) (x : { x // x p } × { x // x q }) :
↑() x = x.fst + x.snd
@[simp]
theorem Submodule.prodEquivOfIsCompl_symm_apply_left {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) (x : { x // x p }) :
↑() x = (x, 0)
@[simp]
theorem Submodule.prodEquivOfIsCompl_symm_apply_right {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) (x : { x // x q }) :
↑() x = (0, x)
@[simp]
theorem Submodule.prodEquivOfIsCompl_symm_apply_fst_eq_zero {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) {x : E} :
(↑() x).fst = 0 x q
@[simp]
theorem Submodule.prodEquivOfIsCompl_symm_apply_snd_eq_zero {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) {x : E} :
(↑() x).snd = 0 x p
@[simp]
theorem Submodule.prodComm_trans_prodEquivOfIsCompl {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) :
LinearEquiv.trans (LinearEquiv.prodComm R { x // x q } { x // x p }) () = Submodule.prodEquivOfIsCompl q p (_ : IsCompl q p)
def Submodule.linearProjOfIsCompl {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : ) (h : IsCompl p q) :
E →ₗ[R] { x // x p }

Projection to a submodule along its complement.

Instances For
@[simp]
theorem Submodule.linearProjOfIsCompl_apply_left {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (h : IsCompl p q) (x : { x // x p }) :
↑() x = x
@[simp]
theorem Submodule.linearProjOfIsCompl_range {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (h : IsCompl p q) :
@[simp]
theorem Submodule.linearProjOfIsCompl_apply_eq_zero_iff {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (h : IsCompl p q) {x : E} :
↑() x = 0 x q
theorem Submodule.linearProjOfIsCompl_apply_right' {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (h : IsCompl p q) (x : E) (hx : x q) :
↑() x = 0
@[simp]
theorem Submodule.linearProjOfIsCompl_apply_right {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (h : IsCompl p q) (x : { x // x q }) :
↑() x = 0
@[simp]
theorem Submodule.linearProjOfIsCompl_ker {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (h : IsCompl p q) :
theorem Submodule.linearProjOfIsCompl_comp_subtype {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (h : IsCompl p q) :
= LinearMap.id
theorem Submodule.linearProjOfIsCompl_idempotent {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (h : IsCompl p q) (x : E) :
↑() ↑(↑() x) = ↑() x
theorem Submodule.existsUnique_add_of_isCompl_prod {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (hc : IsCompl p q) (x : E) :
∃! u, u.fst + u.snd = x
theorem Submodule.existsUnique_add_of_isCompl {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (hc : IsCompl p q) (x : E) :
u v, u + v = x ∀ (r : { x // x p }) (s : { x // x q }), r + s = xr = u s = v
theorem Submodule.linear_proj_add_linearProjOfIsCompl_eq_self {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {q : } (hpq : IsCompl p q) (x : E) :
↑(↑() x) + ↑(↑(Submodule.linearProjOfIsCompl q p (_ : IsCompl q p)) x) = x
def LinearMap.ofIsCompl {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {F : Type u_3} [] [Module R F] {p : } {q : } (h : IsCompl p q) (φ : { x // x p } →ₗ[R] F) (ψ : { x // x q } →ₗ[R] F) :

Given linear maps φ and ψ from complement submodules, LinearMap.ofIsCompl is the induced linear map over the entire module.

Instances For
@[simp]
theorem LinearMap.ofIsCompl_left_apply {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {F : Type u_3} [] [Module R F] {p : } {q : } (h : IsCompl p q) {φ : { x // x p } →ₗ[R] F} {ψ : { x // x q } →ₗ[R] F} (u : { x // x p }) :
↑() u = φ u
@[simp]
theorem LinearMap.ofIsCompl_right_apply {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {F : Type u_3} [] [Module R F] {p : } {q : } (h : IsCompl p q) {φ : { x // x p } →ₗ[R] F} {ψ : { x // x q } →ₗ[R] F} (v : { x // x q }) :
↑() v = ψ v
theorem LinearMap.ofIsCompl_eq {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {F : Type u_3} [] [Module R F] {p : } {q : } (h : IsCompl p q) {φ : { x // x p } →ₗ[R] F} {ψ : { x // x q } →ₗ[R] F} {χ : E →ₗ[R] F} (hφ : ∀ (u : { x // x p }), φ u = χ u) (hψ : ∀ (u : { x // x q }), ψ u = χ u) :
= χ
theorem LinearMap.ofIsCompl_eq' {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {F : Type u_3} [] [Module R F] {p : } {q : } (h : IsCompl p q) {φ : { x // x p } →ₗ[R] F} {ψ : { x // x q } →ₗ[R] F} {χ : E →ₗ[R] F} (hφ : φ = ) (hψ : ψ = ) :
= χ
@[simp]
theorem LinearMap.ofIsCompl_zero {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {F : Type u_3} [] [Module R F] {p : } {q : } (h : IsCompl p q) :
= 0
@[simp]
theorem LinearMap.ofIsCompl_add {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {F : Type u_3} [] [Module R F] {p : } {q : } (h : IsCompl p q) {φ₁ : { x // x p } →ₗ[R] F} {φ₂ : { x // x p } →ₗ[R] F} {ψ₁ : { x // x q } →ₗ[R] F} {ψ₂ : { x // x q } →ₗ[R] F} :
LinearMap.ofIsCompl h (φ₁ + φ₂) (ψ₁ + ψ₂) = LinearMap.ofIsCompl h φ₁ ψ₁ + LinearMap.ofIsCompl h φ₂ ψ₂
@[simp]
theorem LinearMap.ofIsCompl_smul {R : Type u_7} [] {E : Type u_8} [] [Module R E] {F : Type u_9} [] [Module R F] {p : } {q : } (h : IsCompl p q) {φ : { x // x p } →ₗ[R] F} {ψ : { x // x q } →ₗ[R] F} (c : R) :
LinearMap.ofIsCompl h (c φ) (c ψ) = c
def LinearMap.ofIsComplProd {E : Type u_2} [] {F : Type u_3} [] {R₁ : Type u_7} [CommRing R₁] [Module R₁ E] [Module R₁ F] {p : Submodule R₁ E} {q : Submodule R₁ E} (h : IsCompl p q) :
({ x // x p } →ₗ[R₁] F) × ({ x // x q } →ₗ[R₁] F) →ₗ[R₁] E →ₗ[R₁] F

The linear map from (p →ₗ[R₁] F) × (q →ₗ[R₁] F) to E →ₗ[R₁] F.

Instances For
@[simp]
theorem LinearMap.ofIsComplProd_apply {E : Type u_2} [] {F : Type u_3} [] {R₁ : Type u_7} [CommRing R₁] [Module R₁ E] [Module R₁ F] {p : Submodule R₁ E} {q : Submodule R₁ E} (h : IsCompl p q) (φ : ({ x // x p } →ₗ[R₁] F) × ({ x // x q } →ₗ[R₁] F)) :
↑() φ = LinearMap.ofIsCompl h φ.fst φ.snd
def LinearMap.ofIsComplProdEquiv {E : Type u_2} [] {F : Type u_3} [] {R₁ : Type u_7} [CommRing R₁] [Module R₁ E] [Module R₁ F] {p : Submodule R₁ E} {q : Submodule R₁ E} (h : IsCompl p q) :
(({ x // x p } →ₗ[R₁] F) × ({ x // x q } →ₗ[R₁] F)) ≃ₗ[R₁] E →ₗ[R₁] F

The natural linear equivalence between (p →ₗ[R₁] F) × (q →ₗ[R₁] F) and E →ₗ[R₁] F.

Instances For
@[simp]
theorem LinearMap.linearProjOfIsCompl_of_proj {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } (f : E →ₗ[R] { x // x p }) (hf : ∀ (x : { x // x p }), f x = x) :
def LinearMap.equivProdOfSurjectiveOfIsCompl {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {F : Type u_3} [] [Module R F] {G : Type u_4} [] [Module R G] (f : E →ₗ[R] F) (g : E →ₗ[R] G) (hf : ) (hg : ) (hfg : IsCompl () ()) :
E ≃ₗ[R] F × G

If f : E →ₗ[R] F and g : E →ₗ[R] G are two surjective linear maps and their kernels are complement of each other, then x ↦ (f x, g x) defines a linear equivalence E ≃ₗ[R] F × G.

Instances For
@[simp]
theorem LinearMap.coe_equivProdOfSurjectiveOfIsCompl {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {F : Type u_3} [] [Module R F] {G : Type u_4} [] [Module R G] {f : E →ₗ[R] F} {g : E →ₗ[R] G} (hf : ) (hg : ) (hfg : IsCompl () ()) :
↑() =
@[simp]
theorem LinearMap.equivProdOfSurjectiveOfIsCompl_apply {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {F : Type u_3} [] [Module R F] {G : Type u_4} [] [Module R G] {f : E →ₗ[R] F} {g : E →ₗ[R] G} (hf : ) (hg : ) (hfg : IsCompl () ()) (x : E) :
↑() x = (f x, g x)
def Submodule.isComplEquivProj {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) :
{ q // IsCompl p q } { f // ∀ (x : { x // x p }), f x = x }

Equivalence between submodules q such that IsCompl p q and linear maps f : E →ₗ[R] p such that ∀ x : p, f x = x.

Instances For
@[simp]
theorem Submodule.coe_isComplEquivProj_apply {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (q : { q // IsCompl p q }) :
↑() = Submodule.linearProjOfIsCompl p q (_ : IsCompl p q)
@[simp]
theorem Submodule.coe_isComplEquivProj_symm_apply {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] (p : ) (f : { f // ∀ (x : { x // x p }), f x = x }) :
↑(().symm f) =
structure LinearMap.IsProj {S : Type u_5} [] {M : Type u_6} [] [Module S M] (m : ) {F : Type u_7} [FunLike F M fun x => M] (f : F) :
• map_mem : ∀ (x : M), f x m
• map_id : ∀ (x : M), x mf x = x

A linear endomorphism of a module E is a projection onto a submodule p if it sends every element of E to p and fixes every element of p. The definition allow more generally any FunLike type and not just linear maps, so that it can be used for example with ContinuousLinearMap or Matrix.

Instances For
theorem LinearMap.isProj_iff_idempotent {S : Type u_5} [] {M : Type u_6} [] [Module S M] (f : M →ₗ[S] M) :
(p, ) = f
def LinearMap.IsProj.codRestrict {S : Type u_5} [] {M : Type u_6} [] [Module S M] {m : } {f : M →ₗ[S] M} (h : ) :
M →ₗ[S] { x // x m }

Restriction of the codomain of a projection of onto a subspace p to p instead of the whole space.

Instances For
@[simp]
theorem LinearMap.IsProj.codRestrict_apply {S : Type u_5} [] {M : Type u_6} [] [Module S M] {m : } {f : M →ₗ[S] M} (h : ) (x : M) :
↑() = f x
@[simp]
theorem LinearMap.IsProj.codRestrict_apply_cod {S : Type u_5} [] {M : Type u_6} [] [Module S M] {m : } {f : M →ₗ[S] M} (h : ) (x : { x // x m }) :
↑() x = x
theorem LinearMap.IsProj.codRestrict_ker {S : Type u_5} [] {M : Type u_6} [] [Module S M] {m : } {f : M →ₗ[S] M} (h : ) :
theorem LinearMap.IsProj.isCompl {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {f : E →ₗ[R] E} (h : ) :
IsCompl p ()
theorem LinearMap.IsProj.eq_conj_prod_map' {R : Type u_1} [Ring R] {E : Type u_2} [] [Module R E] {p : } {f : E →ₗ[R] E} (h : ) :
theorem LinearMap.IsProj.eq_conj_prodMap {R : Type u_1} [] {E : Type u_2} [] [Module R E] {p : } {f : E →ₗ[R] E} (h : ) :
f = ↑(LinearEquiv.conj (Submodule.prodEquivOfIsCompl p () (_ : IsCompl p ()))) (LinearMap.prodMap LinearMap.id 0)