Zulip Chat Archive

Stream: mathlib4

Topic: Quickfix: symm version missing from `semilinearEquiv`


Kenny Lau (Jun 01 2025 at 07:39):

import Mathlib

variable (R M : Type*) [CommRing R] [CommRing M] [Algebra R M] (S₁ : Submodule R M)

def foo (r : R) : M ≃ₐ[R] M := sorry

@[simps!] noncomputable def fooSub (r : R) : S₁ ≃ₗ[R] S₁ :=
  (foo R M r : M ≃ₗ[R] M).ofSubmodules S₁ S₁ sorry

#check fooSub_apply_coe -- no weird arrow
#check fooSub_symm_apply_coe -- RHS has weird arrow

example {r} (x : M) : (foo R M r : M ≃ₗ[R] M) x = x := by simp?
-- correctly simplifies to (foo R M r) x = x
-- uses SemilinearEquivClass.semilinearEquiv_apply

example {r} (x : M) : (foo R M r : M ≃ₗ[R] M).symm x = x := by simp -- simp made no progress

Kenny Lau (Jun 01 2025 at 07:40):

So I noticed that in one of my PR's, an autogenerated simp lemma was a bit weird, so I minimised it as above, where the coercion from M ≃ₐ[R] M to M ≃ₗ[R] M actually has the forward simp lemma but is missing the backward simp lemma (see "RHS has weird arrow")

Kenny Lau (Jun 01 2025 at 07:41):

I did more digging and isolated the issue as SemilinearEquivClass.semilinearEquiv_apply missing the corresponding symm version (see "simp made no progress")

Kenny Lau (Jun 01 2025 at 07:41):

is this diagnosis correct, and if so, who should I ping for this issue who might be interested?


Last updated: Dec 20 2025 at 21:32 UTC