-- Mathlib/RingTheory/Coalgebra/Basic.lean
theorem comul_comp_lapply (i : ι) :
    comul ∘ₗ (lapply i : _ →ₗ[R] A i) = TensorProduct.map (lapply i) (lapply i) ∘ₗ comul

Proof state:
case h.inr
R : Type u
ι : Type v
A : ι → Type w
inst✝⁴ : DecidableEq ι
inst✝³ : CommSemiring R
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : (i : ι) → Module R (A i)
inst✝ : (i : ι) → Coalgebra R (A i)
i j : ι
hij : i ≠ j
⊢ (comul ∘ₗ lapply i) ∘ₗ lsingle j = TensorProduct.map (lapply i ∘ₗ lsingle j) (lapply i ∘ₗ lsingle j) ∘ₗ comul

Tactic:
rw [comp_assoc, lapply_comp_lsingle_of_ne _ _ hij, comp_zero, TensorProduct.map_zero_left,
  zero_comp]

Result:
no goals

Proof state:
R : Type u
ι : Type v
A : ι → Type w
inst✝⁴ : DecidableEq ι
inst✝³ : CommSemiring R
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : (i : ι) → Module R (A i)
inst✝ : (i : ι) → Coalgebra R (A i)
i : ι
⊢ comul ∘ₗ lapply i = TensorProduct.map (lapply i) (lapply i) ∘ₗ comul

Tactic:
ext j : 1

Result:
case h
R : Type u
ι : Type v
A : ι → Type w
inst✝⁴ : DecidableEq ι
inst✝³ : CommSemiring R
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : (i : ι) → Module R (A i)
inst✝ : (i : ι) → Coalgebra R (A i)
i j : ι
⊢ (comul ∘ₗ lapply i) ∘ₗ lsingle j = (TensorProduct.map (lapply i) (lapply i) ∘ₗ comul) ∘ₗ lsingle j

Proof state:
case h
R : Type u
ι : Type v
A : ι → Type w
inst✝⁴ : DecidableEq ι
inst✝³ : CommSemiring R
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : (i : ι) → Module R (A i)
inst✝ : (i : ι) → Coalgebra R (A i)
i j : ι
⊢ (comul ∘ₗ lapply i) ∘ₗ lsingle j = (TensorProduct.map (lapply i) (lapply i) ∘ₗ comul) ∘ₗ lsingle j

Tactic:
conv_rhs => rw [comp_assoc, comul_comp_lsingle, ← comp_assoc, ← TensorProduct.map_comp]

Result:
case h
R : Type u
ι : Type v
A : ι → Type w
inst✝⁴ : DecidableEq ι
inst✝³ : CommSemiring R
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : (i : ι) → Module R (A i)
inst✝ : (i : ι) → Coalgebra R (A i)
i j : ι
⊢ (comul ∘ₗ lapply i) ∘ₗ lsingle j = TensorProduct.map (lapply i ∘ₗ lsingle j) (lapply i ∘ₗ lsingle j) ∘ₗ comul

Proof state:
case h
R : Type u
ι : Type v
A : ι → Type w
inst✝⁴ : DecidableEq ι
inst✝³ : CommSemiring R
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : (i : ι) → Module R (A i)
inst✝ : (i : ι) → Coalgebra R (A i)
i j : ι
⊢ (comul ∘ₗ lapply i) ∘ₗ lsingle j = TensorProduct.map (lapply i ∘ₗ lsingle j) (lapply i ∘ₗ lsingle j) ∘ₗ comul

Tactic:
obtain rfl | hij := eq_or_ne i j

Result:
case h.inl
R : Type u
ι : Type v
A : ι → Type w
inst✝⁴ : DecidableEq ι
inst✝³ : CommSemiring R
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : (i : ι) → Module R (A i)
inst✝ : (i : ι) → Coalgebra R (A i)
i : ι
⊢ (comul ∘ₗ lapply i) ∘ₗ lsingle i = TensorProduct.map (lapply i ∘ₗ lsingle i) (lapply i ∘ₗ lsingle i) ∘ₗ comul

case h.inr
R : Type u
ι : Type v
A : ι → Type w
inst✝⁴ : DecidableEq ι
inst✝³ : CommSemiring R
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : (i : ι) → Module R (A i)
inst✝ : (i : ι) → Coalgebra R (A i)
i j : ι
hij : i ≠ j
⊢ (comul ∘ₗ lapply i) ∘ₗ lsingle j = TensorProduct.map (lapply i ∘ₗ lsingle j) (lapply i ∘ₗ lsingle j) ∘ₗ comul

Proof state:
case h.inl
R : Type u
ι : Type v
A : ι → Type w
inst✝⁴ : DecidableEq ι
inst✝³ : CommSemiring R
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : (i : ι) → Module R (A i)
inst✝ : (i : ι) → Coalgebra R (A i)
i : ι
⊢ (comul ∘ₗ lapply i) ∘ₗ lsingle i = TensorProduct.map (lapply i ∘ₗ lsingle i) (lapply i ∘ₗ lsingle i) ∘ₗ comul

Tactic:
rw [comp_assoc, lapply_comp_lsingle_same, comp_id,  TensorProduct.map_id, id_comp]

Result:
no goals