Theorem: Basis.SmithNormalForm.repr_apply_embedding_eq_repr_smul
File: Mathlib/LinearAlgebra/FreeModule/PID.lean

Proof steps:
state_before: ι : Type u_1
R : Type u_2
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
M : Type u_3
inst✝¹ : AddCommGroup M
inst✝ : Module R M
b : ι → M
n : ℕ
N : Submodule R M
snf : SmithNormalForm N ι n
m : ↥N
i : Fin n
⊢ (snf.bM.repr ↑m) (snf.f i) = (snf.bN.repr (snf.a i • m)) i
state_after: case mk
ι : Type u_1
R : Type u_2
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
M : Type u_3
inst✝¹ : AddCommGroup M
inst✝ : Module R M
b : ι → M
n : ℕ
N : Submodule R M
snf : SmithNormalForm N ι n
i : Fin n
m : M
hm : m ∈ N
⊢ (snf.bM.repr ↑⟨m, hm⟩) (snf.f i) = (snf.bN.repr (snf.a i • ⟨m, hm⟩)) i
tactic: obtain ⟨m, hm⟩ := m
state_before: case mk
ι : Type u_1
R : Type u_2
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
M : Type u_3
inst✝¹ : AddCommGroup M
inst✝ : Module R M
b : ι → M
n : ℕ
N : Submodule R M
snf : SmithNormalForm N ι n
i : Fin n
m : M
hm : m ∈ N
⊢ (snf.bM.repr ↑⟨m, hm⟩) (snf.f i) = (snf.bN.repr (snf.a i • ⟨m, hm⟩)) i
state_after: case mk.intro
ι : Type u_1
R : Type u_2
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
M : Type u_3
inst✝¹ : AddCommGroup M
inst✝ : Module R M
b : ι → M
n : ℕ
N : Submodule R M
snf : SmithNormalForm N ι n
i : Fin n
c : Fin n →₀ R
hm : (c.sum fun i x => x • ↑(snf.bN i)) ∈ N
⊢ (snf.bM.repr ↑⟨c.sum fun i x => x • ↑(snf.bN i), hm⟩) (snf.f i) =
    (snf.bN.repr (snf.a i • ⟨c.sum fun i x => x • ↑(snf.bN i), hm⟩)) i
tactic: obtain ⟨c, rfl⟩ := snf.bN.mem_submodule_iff.mp hm
state_before: case mk.intro
ι : Type u_1
R : Type u_2
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
M : Type u_3
inst✝¹ : AddCommGroup M
inst✝ : Module R M
b : ι → M
n : ℕ
N : Submodule R M
snf : SmithNormalForm N ι n
i : Fin n
c : Fin n →₀ R
hm : (c.sum fun i x => x • ↑(snf.bN i)) ∈ N
⊢ (snf.bM.repr ↑⟨c.sum fun i x => x • ↑(snf.bN i), hm⟩) (snf.f i) =
    (snf.bN.repr (snf.a i • ⟨c.sum fun i x => x • ↑(snf.bN i), hm⟩)) i
state_after: case mk.intro
ι : Type u_1
R : Type u_2
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
M : Type u_3
inst✝¹ : AddCommGroup M
inst✝ : Module R M
b : ι → M
n : ℕ
N : Submodule R M
snf : SmithNormalForm N ι n
i : Fin n
c : Fin n →₀ R
hm✝ : (c.sum fun i x => x • ↑(snf.bN i)) ∈ N
hm : ⟨c.sum fun i t => t • ↑(snf.bN i), hm✝⟩ = c.sum fun i t => t • ⟨↑(snf.bN i), ⋯⟩
⊢ (snf.bM.repr ↑⟨c.sum fun i x => x • ↑(snf.bN i), hm✝⟩) (snf.f i) =
    (snf.bN.repr (snf.a i • ⟨c.sum fun i x => x • ↑(snf.bN i), hm✝⟩)) i
tactic: replace hm : (⟨Finsupp.sum c fun i t ↦ t • (↑(snf.bN i) : M), hm⟩ : N) =
      Finsupp.sum c fun i t ↦ t • ⟨snf.bN i, (snf.bN i).2⟩ := by
    ext; change _ = N.subtype _; simp [map_finsupp_sum]
state_before: case mk.intro
ι : Type u_1
R : Type u_2
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
inst✝² : IsPrincipalIdealRing R
M : Type u_3
inst✝¹ : AddCommGroup M
inst✝ : Module R M
b : ι → M
n : ℕ
N : Submodule R M
snf : SmithNormalForm N ι n
i : Fin n
c : Fin n →₀ R
hm✝ : (c.sum fun i x => x • ↑(snf.bN i)) ∈ N
hm : ⟨c.sum fun i t => t • ↑(snf.bN i), hm✝⟩ = c.sum fun i t => t • ⟨↑(snf.bN i), ⋯⟩
⊢ (snf.bM.repr ↑⟨c.sum fun i x => x • ↑(snf.bN i), hm✝⟩) (snf.f i) =
    (snf.bN.repr (snf.a i • ⟨c.sum fun i x => x • ↑(snf.bN i), hm✝⟩)) i
state_after: no goals
tactic: classical
  simp_rw [hm, map_smul, map_finsupp_sum, map_smul, Subtype.coe_eta, repr_self,
    Finsupp.smul_single, smul_eq_mul, mul_one, Finsupp.sum_single, Finsupp.smul_apply, snf.snf,
    map_smul, repr_self, Finsupp.smul_single, smul_eq_mul, mul_one, Finsupp.sum_apply,
    Finsupp.single_apply, EmbeddingLike.apply_eq_iff_eq, Finsupp.sum_ite_eq',
    Finsupp.mem_support_iff, ite_not, mul_comm, ite_eq_right_iff]
  exact fun a ↦ (mul_eq_zero_of_right _ a).symm