The four lemma
ProvedFamousTheorems.four_lemma_7bThe four lemma. Consider a commutative diagram of modules over a commutative ring
with exact rows at , and . If and are surjective and is injective, then is surjective.
This is one half of the four lemma, and together with its dual it gives the five lemma: in a commutative diagram with exact rows, if the four outer vertical maps are isomorphisms, so is the middle one. These lemmas are basic tools of homological algebra, used to compare long exact sequences in homology and cohomology. The proof is a diagram chase.
Formalization note. Mathlib's LinearMap.surjective_of_surjective_of_surjective_of_injective. Commutativity of the squares is stated as equalities of composite linear maps, and Function.Exact f g says that the range of equals the kernel of . Exactness of the top row at is not needed.
import Mathlib
namespace FamousTheorems
theorem four_lemma_7b {R M₁ M₂ M₃ M₄ N₁ N₂ N₃ N₄ : Type*} [CommRing R]
[AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃] [AddCommGroup M₄]
[Module R M₁] [Module R M₂] [Module R M₃] [Module R M₄]
[AddCommGroup N₁] [AddCommGroup N₂] [AddCommGroup N₃] [AddCommGroup N₄]
[Module R N₁] [Module R N₂] [Module R N₃] [Module R N₄]
(f₁ : M₁ →ₗ[R] M₂) (f₂ : M₂ →ₗ[R] M₃) (f₃ : M₃ →ₗ[R] M₄)
(g₁ : N₁ →ₗ[R] N₂) (g₂ : N₂ →ₗ[R] N₃) (g₃ : N₃ →ₗ[R] N₄)
(i₁ : M₁ →ₗ[R] N₁) (i₂ : M₂ →ₗ[R] N₂) (i₃ : M₃ →ₗ[R] N₃) (i₄ : M₄ →ₗ[R] N₄)
(hc₁ : g₁ ∘ₗ i₁ = i₂ ∘ₗ f₁) (hc₂ : g₂ ∘ₗ i₂ = i₃ ∘ₗ f₂) (hc₃ : g₃ ∘ₗ i₃ = i₄ ∘ₗ f₃)
(hf : Function.Exact f₂ f₃) (hg₁ : Function.Exact g₁ g₂) (hg₂ : Function.Exact g₂ g₃)
(hi₁ : Function.Surjective i₁) (hi₃ : Function.Surjective i₃) (hi₄ : Function.Injective i₄) :
Function.Surjective i₂ := by sorry
end FamousTheorems