File: Mathlib/LinearAlgebra/Projection.lean

full_name: LinearMap.ker_id_sub_eq_of_proj
code: theorem ker_id_sub_eq_of_proj {f : E →ₗ[R] p} (hf : ∀ x : p, f x = x) :
    ker (id - p.subtype.comp f) = p 
goal: LinearMap.ker (LinearMap.id - p.subtype ∘ₗ f) = p

full_name: LinearMap.range_eq_of_proj
code: theorem range_eq_of_proj {f : E →ₗ[R] p} (hf : ∀ x : p, f x = x) : range f = ⊤ 
goal: LinearMap.range f = ⊤

full_name: LinearMap.isCompl_of_proj
code: theorem isCompl_of_proj {f : E →ₗ[R] p} (hf : ∀ x : p, f x = x) : IsCompl p (ker f) 
goal: IsCompl p (LinearMap.ker f)

full_name: Submodule.quotientEquivOfIsCompl
code: /-- If `q` is a complement of `p`, then `M/p ≃ q`. -/
def quotientEquivOfIsCompl (h : IsCompl p q) : (E ⧸ p) ≃ₗ[R] q 
goal: (E ⧸ p) ≃ₗ[R] ↥q

full_name: Submodule.quotientEquivOfIsCompl_symm_apply
code: @[simp]
theorem quotientEquivOfIsCompl_symm_apply (h : IsCompl p q) (x : q) :
    -- Porting note: type ascriptions needed on the RHS
    (quotientEquivOfIsCompl p q h).symm x = (Quotient.mk (x : E) : E ⧸ p) 
goal: (p.quotientEquivOfIsCompl q h).symm x = Submodule.Quotient.mk ↑x

full_name: Submodule.quotientEquivOfIsCompl_apply_mk_coe
code: @[simp]
theorem quotientEquivOfIsCompl_apply_mk_coe (h : IsCompl p q) (x : q) :
    quotientEquivOfIsCompl p q h (Quotient.mk x) = x 
goal: (p.quotientEquivOfIsCompl q h) (Submodule.Quotient.mk ↑x) = x

full_name: Submodule.mk_quotientEquivOfIsCompl_apply
code: @[simp]
theorem mk_quotientEquivOfIsCompl_apply (h : IsCompl p q) (x : E ⧸ p) :
    (Quotient.mk (quotientEquivOfIsCompl p q h x) : E ⧸ p) = x 
goal: Submodule.Quotient.mk ↑((p.quotientEquivOfIsCompl q h) x) = x

full_name: Submodule.prodEquivOfIsCompl
code: /-- 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`. -/
def prodEquivOfIsCompl (h : IsCompl p q) : (p × q) ≃ₗ[R] E 
goal: (↥p × ↥q) ≃ₗ[R] E

full_name: Submodule.coe_prodEquivOfIsCompl
code: @[simp]
theorem coe_prodEquivOfIsCompl (h : IsCompl p q) :
    (prodEquivOfIsCompl p q h : p × q →ₗ[R] E) = p.subtype.coprod q.subtype 
goal: ↑(p.prodEquivOfIsCompl q h) = p.subtype.coprod q.subtype

full_name: Submodule.coe_prodEquivOfIsCompl'
code: @[simp]
theorem coe_prodEquivOfIsCompl' (h : IsCompl p q) (x : p × q) :
    prodEquivOfIsCompl p q h x = x.1 + x.2 
goal: (p.prodEquivOfIsCompl q h) x = ↑x.1 + ↑x.2

full_name: Submodule.prodEquivOfIsCompl_symm_apply_left
code: @[simp]
theorem prodEquivOfIsCompl_symm_apply_left (h : IsCompl p q) (x : p) :
    (prodEquivOfIsCompl p q h).symm x = (x, 0) 
goal: (p.prodEquivOfIsCompl q h).symm ↑x = (x, 0)

full_name: Submodule.prodEquivOfIsCompl_symm_apply_right
code: @[simp]
theorem prodEquivOfIsCompl_symm_apply_right (h : IsCompl p q) (x : q) :
    (prodEquivOfIsCompl p q h).symm x = (0, x) 
goal: (p.prodEquivOfIsCompl q h).symm ↑x = (0, x)

full_name: Submodule.prodEquivOfIsCompl_symm_apply_fst_eq_zero
code: @[simp]
theorem prodEquivOfIsCompl_symm_apply_fst_eq_zero (h : IsCompl p q) {x : E} :
    ((prodEquivOfIsCompl p q h).symm x).1 = 0 ↔ x ∈ q 
goal: ((p.prodEquivOfIsCompl q h).symm x).1 = 0 ↔ x ∈ q

full_name: Submodule.prodEquivOfIsCompl_symm_apply_snd_eq_zero
code: @[simp]
theorem prodEquivOfIsCompl_symm_apply_snd_eq_zero (h : IsCompl p q) {x : E} :
    ((prodEquivOfIsCompl p q h).symm x).2 = 0 ↔ x ∈ p 
goal: ((p.prodEquivOfIsCompl q h).symm x).2 = 0 ↔ x ∈ p

full_name: Submodule.prodComm_trans_prodEquivOfIsCompl
code: @[simp]
theorem prodComm_trans_prodEquivOfIsCompl (h : IsCompl p q) :
    LinearEquiv.prodComm R q p ≪≫ₗ prodEquivOfIsCompl p q h = prodEquivOfIsCompl q p h.symm 
goal: LinearEquiv.prodComm R ↥q ↥p ≪≫ₗ p.prodEquivOfIsCompl q h = q.prodEquivOfIsCompl p ⋯

full_name: Submodule.linearProjOfIsCompl
code: /-- Projection to a submodule along its complement. -/
def linearProjOfIsCompl (h : IsCompl p q) : E →ₗ[R] p 
goal: E →ₗ[R] ↥p

full_name: Submodule.linearProjOfIsCompl_apply_left
code: @[simp]
theorem linearProjOfIsCompl_apply_left (h : IsCompl p q) (x : p) :
    linearProjOfIsCompl p q h x = x 
goal: (p.linearProjOfIsCompl q h) ↑x = x

full_name: Submodule.linearProjOfIsCompl_range
code: @[simp]
theorem linearProjOfIsCompl_range (h : IsCompl p q) : range (linearProjOfIsCompl p q h) = ⊤ 
goal: LinearMap.range (p.linearProjOfIsCompl q h) = ⊤

full_name: Submodule.linearProjOfIsCompl_apply_eq_zero_iff
code: @[simp]
theorem linearProjOfIsCompl_apply_eq_zero_iff (h : IsCompl p q) {x : E} :
    linearProjOfIsCompl p q h x = 0 ↔ x ∈ q 
goal: (p.linearProjOfIsCompl q h) x = 0 ↔ x ∈ q

full_name: Submodule.linearProjOfIsCompl_apply_right'
code: theorem linearProjOfIsCompl_apply_right' (h : IsCompl p q) (x : E) (hx : x ∈ q) :
    linearProjOfIsCompl p q h x = 0 
goal: (p.linearProjOfIsCompl q h) x = 0

full_name: Submodule.linearProjOfIsCompl_apply_right
code: @[simp]
theorem linearProjOfIsCompl_apply_right (h : IsCompl p q) (x : q) :
    linearProjOfIsCompl p q h x = 0 
goal: (p.linearProjOfIsCompl q h) ↑x = 0

full_name: Submodule.linearProjOfIsCompl_ker
code: @[simp]
theorem linearProjOfIsCompl_ker (h : IsCompl p q) : ker (linearProjOfIsCompl p q h) = q 
goal: LinearMap.ker (p.linearProjOfIsCompl q h) = q

full_name: Submodule.linearProjOfIsCompl_comp_subtype
code: theorem linearProjOfIsCompl_comp_subtype (h : IsCompl p q) :
    (linearProjOfIsCompl p q h).comp p.subtype = LinearMap.id 
goal: p.linearProjOfIsCompl q h ∘ₗ p.subtype = LinearMap.id

full_name: Submodule.linearProjOfIsCompl_idempotent
code: theorem linearProjOfIsCompl_idempotent (h : IsCompl p q) (x : E) :
    linearProjOfIsCompl p q h (linearProjOfIsCompl p q h x) = linearProjOfIsCompl p q h x 
goal: (p.linearProjOfIsCompl q h) ↑((p.linearProjOfIsCompl q h) x) = (p.linearProjOfIsCompl q h) x

full_name: Submodule.existsUnique_add_of_isCompl_prod
code: theorem existsUnique_add_of_isCompl_prod (hc : IsCompl p q) (x : E) :
    ∃! u : p × q, (u.fst : E) + u.snd = x 
goal: ∃! u, ↑u.1 + ↑u.2 = x

full_name: Submodule.existsUnique_add_of_isCompl
code: theorem existsUnique_add_of_isCompl (hc : IsCompl p q) (x : E) :
    ∃ (u : p) (v : q), (u : E) + v = x ∧ ∀ (r : p) (s : q), (r : E) + s = x → r = u ∧ s = v 
goal: ∃ u v, ↑u + ↑v = x ∧ ∀ (r : ↥p) (s : ↥q), ↑r + ↑s = x → r = u ∧ s = v

full_name: Submodule.linear_proj_add_linearProjOfIsCompl_eq_self
code: theorem linear_proj_add_linearProjOfIsCompl_eq_self (hpq : IsCompl p q) (x : E) :
    (p.linearProjOfIsCompl q hpq x + q.linearProjOfIsCompl p hpq.symm x : E) = x 
goal: ↑((p.linearProjOfIsCompl q hpq) x) + ↑((q.linearProjOfIsCompl p ⋯) x) = x

full_name: LinearMap.ofIsCompl
code: /-- Given linear maps `φ` and `ψ` from complement submodules, `LinearMap.ofIsCompl` is
the induced linear map over the entire module. -/
def ofIsCompl {p q : Submodule R E} (h : IsCompl p q) (φ : p →ₗ[R] F) (ψ : q →ₗ[R] F) : E →ₗ[R] F 
goal: E →ₗ[R] F

full_name: LinearMap.ofIsCompl_left_apply
code: @[simp]
theorem ofIsCompl_left_apply (h : IsCompl p q) {φ : p →ₗ[R] F} {ψ : q →ₗ[R] F} (u : p) :
    ofIsCompl h φ ψ (u : E) = φ u 
goal: (LinearMap.ofIsCompl h φ ψ) ↑u = φ u

full_name: LinearMap.ofIsCompl_right_apply
code: @[simp]
theorem ofIsCompl_right_apply (h : IsCompl p q) {φ : p →ₗ[R] F} {ψ : q →ₗ[R] F} (v : q) :
    ofIsCompl h φ ψ (v : E) = ψ v 
goal: (LinearMap.ofIsCompl h φ ψ) ↑v = ψ v

full_name: LinearMap.ofIsCompl_eq
code: theorem ofIsCompl_eq (h : IsCompl p q) {φ : p →ₗ[R] F} {ψ : q →ₗ[R] F} {χ : E →ₗ[R] F}
    (hφ : ∀ u, φ u = χ u) (hψ : ∀ u, ψ u = χ u) : ofIsCompl h φ ψ = χ 
goal: LinearMap.ofIsCompl h φ ψ = χ

full_name: LinearMap.ofIsCompl_eq'
code: theorem ofIsCompl_eq' (h : IsCompl p q) {φ : p →ₗ[R] F} {ψ : q →ₗ[R] F} {χ : E →ₗ[R] F}
    (hφ : φ = χ.comp p.subtype) (hψ : ψ = χ.comp q.subtype) : ofIsCompl h φ ψ = χ 
goal: LinearMap.ofIsCompl h φ ψ = χ

full_name: LinearMap.ofIsCompl_zero
code: @[simp]
theorem ofIsCompl_zero (h : IsCompl p q) : (ofIsCompl h 0 0 : E →ₗ[R] F) = 0 
goal: LinearMap.ofIsCompl h 0 0 = 0

full_name: LinearMap.ofIsCompl_add
code: @[simp]
theorem ofIsCompl_add (h : IsCompl p q) {φ₁ φ₂ : p →ₗ[R] F} {ψ₁ ψ₂ : q →ₗ[R] F} :
    ofIsCompl h (φ₁ + φ₂) (ψ₁ + ψ₂) = ofIsCompl h φ₁ ψ₁ + ofIsCompl h φ₂ ψ₂ 
goal: LinearMap.ofIsCompl h (φ₁ + φ₂) (ψ₁ + ψ₂) = LinearMap.ofIsCompl h φ₁ ψ₁ + LinearMap.ofIsCompl h φ₂ ψ₂

full_name: LinearMap.ofIsCompl_smul
code: @[simp]
theorem ofIsCompl_smul {R : Type*} [CommRing R] {E : Type*} [AddCommGroup E] [Module R E]
    {F : Type*} [AddCommGroup F] [Module R F] {p q : Submodule R E} (h : IsCompl p q)
    {φ : p →ₗ[R] F} {ψ : q →ₗ[R] F} (c : R) : ofIsCompl h (c • φ) (c • ψ) = c • ofIsCompl h φ ψ 
goal: LinearMap.ofIsCompl h (c • φ) (c • ψ) = c • LinearMap.ofIsCompl h φ ψ

full_name: LinearMap.ofIsComplProd
code: /-- The linear map from `(p →ₗ[R₁] F) × (q →ₗ[R₁] F)` to `E →ₗ[R₁] F`. -/
def ofIsComplProd {p q : Submodule R₁ E} (h : IsCompl p q) :
    (p →ₗ[R₁] F) × (q →ₗ[R₁] F) →ₗ[R₁] E →ₗ[R₁] F 
goal: (↥p →ₗ[R₁] F) × (↥q →ₗ[R₁] F) →ₗ[R₁] E →ₗ[R₁] F

full_name: LinearMap.ofIsComplProd_apply
code: @[simp]
theorem ofIsComplProd_apply {p q : Submodule R₁ E} (h : IsCompl p q)
    (φ : (p →ₗ[R₁] F) × (q →ₗ[R₁] F)) : ofIsComplProd h φ = ofIsCompl h φ.1 φ.2 
goal: (LinearMap.ofIsComplProd h) φ = LinearMap.ofIsCompl h φ.1 φ.2

full_name: LinearMap.ofIsComplProdEquiv
code: /-- The natural linear equivalence between `(p →ₗ[R₁] F) × (q →ₗ[R₁] F)` and `E →ₗ[R₁] F`. -/
def ofIsComplProdEquiv {p q : Submodule R₁ E} (h : IsCompl p q) :
    ((p →ₗ[R₁] F) × (q →ₗ[R₁] F)) ≃ₗ[R₁] E →ₗ[R₁] F 
goal: ((↥p →ₗ[R₁] F) × (↥q →ₗ[R₁] F)) ≃ₗ[R₁] E →ₗ[R₁] F

full_name: LinearMap.linearProjOfIsCompl_of_proj
code: @[simp, nolint simpNF] -- Porting note: linter claims that LHS doesn't simplify, but it does
theorem linearProjOfIsCompl_of_proj (f : E →ₗ[R] p) (hf : ∀ x : p, f x = x) :
    p.linearProjOfIsCompl (ker f) (isCompl_of_proj hf) = f 
goal: p.linearProjOfIsCompl (LinearMap.ker f) ⋯ = f

full_name: LinearMap.equivProdOfSurjectiveOfIsCompl
code: /-- 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`. -/
def equivProdOfSurjectiveOfIsCompl (f : E →ₗ[R] F) (g : E →ₗ[R] G) (hf : range f = ⊤)
    (hg : range g = ⊤) (hfg : IsCompl (ker f) (ker g)) : E ≃ₗ[R] F × G 
goal: E ≃ₗ[R] F × G

full_name: LinearMap.coe_equivProdOfSurjectiveOfIsCompl
code: @[simp]
theorem coe_equivProdOfSurjectiveOfIsCompl {f : E →ₗ[R] F} {g : E →ₗ[R] G} (hf : range f = ⊤)
    (hg : range g = ⊤) (hfg : IsCompl (ker f) (ker g)) :
    (equivProdOfSurjectiveOfIsCompl f g hf hg hfg : E →ₗ[R] F × G) = f.prod g 
goal: ↑(f.equivProdOfSurjectiveOfIsCompl g hf hg hfg) = f.prod g

full_name: LinearMap.equivProdOfSurjectiveOfIsCompl_apply
code: @[simp]
theorem equivProdOfSurjectiveOfIsCompl_apply {f : E →ₗ[R] F} {g : E →ₗ[R] G} (hf : range f = ⊤)
    (hg : range g = ⊤) (hfg : IsCompl (ker f) (ker g)) (x : E) :
    equivProdOfSurjectiveOfIsCompl f g hf hg hfg x = (f x, g x) 
goal: (f.equivProdOfSurjectiveOfIsCompl g hf hg hfg) x = (f x, g x)

full_name: Submodule.isComplEquivProj
code: /-- Equivalence between submodules `q` such that `IsCompl p q` and linear maps `f : E →ₗ[R] p`
such that `∀ x : p, f x = x`. -/
def isComplEquivProj : { q // IsCompl p q } ≃ { f : E →ₗ[R] p // ∀ x : p, f x = x } 
goal: { q // IsCompl p q } ≃ { f // ∀ (x : ↥p), f ↑x = x }

full_name: Submodule.coe_isComplEquivProj_apply
code: @[simp]
theorem coe_isComplEquivProj_apply (q : { q // IsCompl p q }) :
    (p.isComplEquivProj q : E →ₗ[R] p) = linearProjOfIsCompl p q q.2 
goal: ↑(p.isComplEquivProj q) = p.linearProjOfIsCompl ↑q ⋯

full_name: Submodule.coe_isComplEquivProj_symm_apply
code: @[simp]
theorem coe_isComplEquivProj_symm_apply (f : { f : E →ₗ[R] p // ∀ x : p, f x = x }) :
    (p.isComplEquivProj.symm f : Submodule R E) = ker (f : E →ₗ[R] p) 
goal: ↑(p.isComplEquivProj.symm f) = LinearMap.ker ↑f

full_name: Submodule.isIdempotentElemEquiv_apply_coe
code: /-- The idempotent endomorphisms of a module with range equal to a submodule are in 1-1
correspondence with linear maps to the submodule that restrict to the identity on the submodule. -/
@[simps] def isIdempotentElemEquiv :
    { f : Module.End R E // IsIdempotentElem f ∧ range f = p } ≃
    { f : E →ₗ[R] p // ∀ x : p, f x = x } 
goal: ↑(p.isIdempotentElemEquiv f) = LinearMap.codRestrict p ↑f ⋯

full_name: Submodule.isIdempotentElemEquiv
code: /-- The idempotent endomorphisms of a module with range equal to a submodule are in 1-1
correspondence with linear maps to the submodule that restrict to the identity on the submodule. -/
@[simps] def isIdempotentElemEquiv :
    { f : Module.End R E // IsIdempotentElem f ∧ range f = p } ≃
    { f : E →ₗ[R] p // ∀ x : p, f x = x } 
goal: { f // IsIdempotentElem f ∧ LinearMap.range f = p } ≃ { f // ∀ (x : ↥p), f ↑x = x }

full_name: Submodule.isIdempotentElemEquiv_symm_apply_coe
code: /-- The idempotent endomorphisms of a module with range equal to a submodule are in 1-1
correspondence with linear maps to the submodule that restrict to the identity on the submodule. -/
@[simps] def isIdempotentElemEquiv :
    { f : Module.End R E // IsIdempotentElem f ∧ range f = p } ≃
    { f : E →ₗ[R] p // ∀ x : p, f x = x } 
goal: ↑(p.isIdempotentElemEquiv.symm f) = p.subtype ∘ₗ ↑f

full_name: LinearMap.IsProj
code: /--
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`.
-/
structure IsProj {F : Type*} [FunLike F M M] (f : F) : Prop where
  map_mem : ∀ x, f x ∈ m
  map_id : ∀ x ∈ m, f x = x
goal: Prop

full_name: LinearMap.IsProj.map_mem
code: /--
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`.
-/
structure IsProj {F : Type*} [FunLike F M M] (f : F) : Prop where
  map_mem : ∀ x, f x ∈ m
  map_id : ∀ x ∈ m, f x = x
goal: f x ∈ m

full_name: LinearMap.IsProj.map_id
code: /--
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`.
-/
structure IsProj {F : Type*} [FunLike F M M] (f : F) : Prop where
  map_mem : ∀ x, f x ∈ m
  map_id : ∀ x ∈ m, f x = x
goal: x ∈ m → f x = x

full_name: LinearMap.isProj_iff_idempotent
code: theorem isProj_iff_idempotent (f : M →ₗ[S] M) : (∃ p : Submodule S M, IsProj p f) ↔ f ∘ₗ f = f 
goal: (∃ p, LinearMap.IsProj p f) ↔ f ∘ₗ f = f

full_name: LinearMap.IsProj.codRestrict
code: /-- Restriction of the codomain of a projection of onto a subspace `p` to `p` instead of the whole
space.
-/
def codRestrict {f : M →ₗ[S] M} (h : IsProj m f) : M →ₗ[S] m 
goal: M →ₗ[S] ↥m

full_name: LinearMap.IsProj.codRestrict_apply
code: @[simp]
theorem codRestrict_apply {f : M →ₗ[S] M} (h : IsProj m f) (x : M) : ↑(h.codRestrict x) = f x 
goal: ↑(h.codRestrict x) = f x

full_name: LinearMap.IsProj.codRestrict_apply_cod
code: @[simp]
theorem codRestrict_apply_cod {f : M →ₗ[S] M} (h : IsProj m f) (x : m) : h.codRestrict x = x 
goal: h.codRestrict ↑x = x

full_name: LinearMap.IsProj.codRestrict_ker
code: theorem codRestrict_ker {f : M →ₗ[S] M} (h : IsProj m f) : ker h.codRestrict = ker f 
goal: LinearMap.ker h.codRestrict = LinearMap.ker f

full_name: LinearMap.IsProj.isCompl
code: theorem isCompl {f : E →ₗ[R] E} (h : IsProj p f) : IsCompl p (ker f) 
goal: IsCompl p (LinearMap.ker f)

full_name: LinearMap.IsProj.eq_conj_prod_map'
code: theorem eq_conj_prod_map' {f : E →ₗ[R] E} (h : IsProj p f) :
    f = (p.prodEquivOfIsCompl (ker f) h.isCompl).toLinearMap ∘ₗ
        prodMap id 0 ∘ₗ (p.prodEquivOfIsCompl (ker f) h.isCompl).symm.toLinearMap 
goal: f =
  ↑(p.prodEquivOfIsCompl (LinearMap.ker f) ⋯) ∘ₗ
    LinearMap.id.prodMap 0 ∘ₗ ↑(p.prodEquivOfIsCompl (LinearMap.ker f) ⋯).symm

full_name: LinearMap.IsProj.eq_conj_prodMap
code: theorem IsProj.eq_conj_prodMap {f : E →ₗ[R] E} (h : IsProj p f) :
    f = (p.prodEquivOfIsCompl (ker f) h.isCompl).conj (prodMap id 0) 
goal: f = (p.prodEquivOfIsCompl (LinearMap.ker f) ⋯).conj (LinearMap.id.prodMap 0)