Commit 2024-12-05 09:31 498c8c34

View on Github →

refactor(Algebra/Category/ModuleCat): make ModuleCat.Hom a structure (#19511) This PR follows the approach of #19065 to solve painful definitional equalities problems by forbidding the identification of A ⟶ B and A →ₗ[R] B. These are not equal reducibly, so tactics get confused if one is replaced by the other. There seem to be a few regressions caused by defeq abuse that we were able to get away with previously, but some subtle elaboration differences made it evident. Otherwise the cost is inserting many .homs and asHoms. A few steps that might clean up the diff, but would be too much work to incorporate in this PR:

  • Make the ext tactic pick up TensorProduct.ext again.
  • Replace the defeq abuse between (restrictScalars f).obj M and M with explicit maps going back and forth. Overall quite a few proofs could be cleaned up at the cost of more bookkeeping.

Estimated changes

added structure ModuleCat.Hom
deleted def ModuleCat.asHomLeft
deleted theorem ModuleCat.coe_comp
modified theorem ModuleCat.coe_of
added theorem ModuleCat.comp_apply
deleted theorem ModuleCat.comp_def
deleted theorem ModuleCat.ext
modified theorem ModuleCat.forget_map
added theorem ModuleCat.forget_obj
added theorem ModuleCat.hom_add
added theorem ModuleCat.hom_comp
added theorem ModuleCat.hom_ext
added theorem ModuleCat.hom_id
added theorem ModuleCat.hom_neg
added theorem ModuleCat.hom_nsmul
added theorem ModuleCat.hom_ofHom
added theorem ModuleCat.hom_smul
added theorem ModuleCat.hom_sub
added theorem ModuleCat.hom_sum
added theorem ModuleCat.hom_zero
added theorem ModuleCat.hom_zsmul
modified theorem ModuleCat.id_apply
deleted def ModuleCat.of
deleted def ModuleCat.ofHom
modified theorem ModuleCat.ofHom_apply
added theorem ModuleCat.ofHom_comp
added theorem ModuleCat.ofHom_hom
added theorem ModuleCat.ofHom_id