Theorem: Module.Baer.of_divisible
File: Mathlib/Algebra/Category/Grp/Injective.lean

Proof steps:
state_before: A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
I : Ideal ℤ
g : ↥I →ₗ[ℤ] A
⊢ ∃ g', ∀ (x : ℤ) (mem : x ∈ I), g' x = g ⟨x, mem⟩
state_after: case mk.intro
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
m : ℤ
g : ↥(Submodule.span ℤ {m}) →ₗ[ℤ] A
⊢ ∃ g', ∀ (x : ℤ) (mem : x ∈ Submodule.span ℤ {m}), g' x = g ⟨x, mem⟩
tactic: rcases IsPrincipalIdealRing.principal I with ⟨m, rfl⟩
state_before: case mk.intro
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
m : ℤ
g : ↥(Submodule.span ℤ {m}) →ₗ[ℤ] A
⊢ ∃ g', ∀ (x : ℤ) (mem : x ∈ Submodule.span ℤ {m}), g' x = g ⟨x, mem⟩
state_after: case mk.intro.inl
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
g : ↥(Submodule.span ℤ {0}) →ₗ[ℤ] A
⊢ ∃ g', ∀ (x : ℤ) (mem : x ∈ Submodule.span ℤ {0}), g' x = g ⟨x, mem⟩

case mk.intro.inr
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
m : ℤ
g : ↥(Submodule.span ℤ {m}) →ₗ[ℤ] A
h0 : m ≠ 0
⊢ ∃ g', ∀ (x : ℤ) (mem : x ∈ Submodule.span ℤ {m}), g' x = g ⟨x, mem⟩
tactic: obtain rfl | h0 := eq_or_ne m 0
state_before: case mk.intro.inr
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
m : ℤ
g : ↥(Submodule.span ℤ {m}) →ₗ[ℤ] A
h0 : m ≠ 0
⊢ ∃ g', ∀ (x : ℤ) (mem : x ∈ Submodule.span ℤ {m}), g' x = g ⟨x, mem⟩
state_after: case mk.intro.inr
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
m : ℤ
g : ↥(Submodule.span ℤ {m}) →ₗ[ℤ] A
h0 : m ≠ 0
gₘ : A := g ⟨m, ⋯⟩
⊢ ∃ g', ∀ (x : ℤ) (mem : x ∈ Submodule.span ℤ {m}), g' x = g ⟨x, mem⟩
tactic: let gₘ := g ⟨m, Submodule.subset_span (Set.mem_singleton _)⟩
state_before: case mk.intro.inr
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
m : ℤ
g : ↥(Submodule.span ℤ {m}) →ₗ[ℤ] A
h0 : m ≠ 0
gₘ : A := g ⟨m, ⋯⟩
⊢ ∃ g', ∀ (x : ℤ) (mem : x ∈ Submodule.span ℤ {m}), g' x = g ⟨x, mem⟩
state_after: case mk.intro.inr
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
m : ℤ
g : ↥(Submodule.span ℤ {m}) →ₗ[ℤ] A
h0 : m ≠ 0
gₘ : A := g ⟨m, ⋯⟩
n : ℤ
hn : n ∈ Submodule.span ℤ {m}
⊢ (LinearMap.toSpanSingleton ℤ A (DivisibleBy.div gₘ m)) n = g ⟨n, hn⟩
tactic: refine ⟨LinearMap.toSpanSingleton ℤ A (DivisibleBy.div gₘ m), fun n hn ↦ ?_⟩
state_before: case mk.intro.inr
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
m : ℤ
g : ↥(Submodule.span ℤ {m}) →ₗ[ℤ] A
h0 : m ≠ 0
gₘ : A := g ⟨m, ⋯⟩
n : ℤ
hn : n ∈ Submodule.span ℤ {m}
⊢ (LinearMap.toSpanSingleton ℤ A (DivisibleBy.div gₘ m)) n = g ⟨n, hn⟩
state_after: case mk.intro.inr.intro
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
m : ℤ
g : ↥(Submodule.span ℤ {m}) →ₗ[ℤ] A
h0 : m ≠ 0
gₘ : A := g ⟨m, ⋯⟩
n : ℤ
hn : n • m ∈ Submodule.span ℤ {m}
⊢ (LinearMap.toSpanSingleton ℤ A (DivisibleBy.div gₘ m)) (n • m) = g ⟨n • m, hn⟩
tactic: rcases Submodule.mem_span_singleton.mp hn with ⟨n, rfl⟩
state_before: case mk.intro.inr.intro
A : Type u
inst✝¹ : AddCommGroup A
inst✝ : DivisibleBy A ℤ
m : ℤ
g : ↥(Submodule.span ℤ {m}) →ₗ[ℤ] A
h0 : m ≠ 0
gₘ : A := g ⟨m, ⋯⟩
n : ℤ
hn : n • m ∈ Submodule.span ℤ {m}
⊢ (LinearMap.toSpanSingleton ℤ A (DivisibleBy.div gₘ m)) (n • m) = g ⟨n • m, hn⟩
state_after: no goals
tactic: rw [map_zsmul, LinearMap.toSpanSingleton_apply, DivisibleBy.div_cancel gₘ h0, ← map_zsmul g,
    SetLike.mk_smul_mk]