Skip to content

Commit

Permalink
feat(Algebra/Module): use notation3 for composition notation (#8847)
Browse files Browse the repository at this point in the history
This means that `comp` is printed with this notation in the goal view.
  • Loading branch information
eric-wieser committed Dec 11, 2023
1 parent bbc6e56 commit f2f86bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Module/Equiv.lean
Expand Up @@ -342,11 +342,11 @@ def trans
#align linear_equiv.trans LinearEquiv.trans

/-- The notation `e₁ ≪≫ₗ e₂` denotes the composition of the linear equivalences `e₁` and `e₂`. -/
infixl:80 " ≪≫ₗ " =>
notation3:80 (name := transNotation) e₁:80 " ≪≫ₗ " e₂:81 =>
@LinearEquiv.trans _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ (RingHom.id _) (RingHom.id _) (RingHom.id _)
(RingHom.id _) (RingHom.id _) (RingHom.id _) RingHomCompTriple.ids RingHomCompTriple.ids
RingHomInvPair.ids RingHomInvPair.ids RingHomInvPair.ids RingHomInvPair.ids RingHomInvPair.ids
RingHomInvPair.ids
RingHomInvPair.ids e₁ e₂

variable {e₁₂} {e₂₃}

Expand Down
5 changes: 2 additions & 3 deletions Mathlib/Algebra/Module/LinearMap.lean
Expand Up @@ -550,12 +550,11 @@ def comp : M₁ →ₛₗ[σ₁₃] M₃ where
map_smul' r x := by simp only [Function.comp_apply, map_smulₛₗ, RingHomCompTriple.comp_apply]
#align linear_map.comp LinearMap.comp

set_option quotPrecheck false in -- Porting note: error message suggested to do this
/-- `∘ₗ` is notation for composition of two linear (not semilinear!) maps into a linear map.
This is useful when Lean is struggling to infer the `RingHomCompTriple` instance. -/
infixr:80 " ∘ₗ " =>
notation3:80 (name := compNotation) f:81 " ∘ₗ " g:80 =>
@LinearMap.comp _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ (RingHom.id _) (RingHom.id _) (RingHom.id _)
RingHomCompTriple.ids
RingHomCompTriple.ids f g

theorem comp_apply (x : M₁) : f.comp g x = f (g x) :=
rfl
Expand Down

0 comments on commit f2f86bd

Please sign in to comment.