File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -911,8 +911,16 @@ variable (A : Type*) [AddCommGroup A] (n : ℤ)
911911def torsionBy : AddSubgroup A :=
912912 (Submodule.torsionBy ℤ A n).toAddSubgroup
913913
914- @[inherit_doc]
915- scoped notation :max (priority := high) A"[" n"]" => torsionBy A n
914+ @[inherit_doc torsionBy]
915+ scoped syntax :max (name := torsionByStx) (priority := high) term noWs "[" term "]" : term
916+
917+ macro_rules | `($A[$n]) => `(torsionBy $A $n)
918+
919+ /-- Unexpander for `torsionBy`. -/
920+ @[scoped app_unexpander torsionBy]
921+ def torsionByUnexpander : Lean.PrettyPrinter.Unexpander
922+ | `($_ $A $n) => `($A[$n])
923+ | _ => throw ()
916924
917925lemma torsionBy.neg : A[-n] = A[n] := by
918926 ext a
Original file line number Diff line number Diff line change @@ -816,11 +816,19 @@ endowed with the convolution product.
816816def AddMonoidAlgebra :=
817817 G →₀ k
818818
819- @[inherit_doc]
820- scoped [AddMonoidAlgebra] notation :9000 R:max "[" A "]" => AddMonoidAlgebra R A
821-
822819namespace AddMonoidAlgebra
823820
821+ @[inherit_doc AddMonoidAlgebra]
822+ scoped syntax :max (priority := high) term noWs "[" term "]" : term
823+
824+ macro_rules | `($k[$g]) => `(AddMonoidAlgebra $k $g)
825+
826+ /-- Unexpander for `AddMonoidAlgebra`. -/
827+ @[scoped app_unexpander AddMonoidAlgebra]
828+ def unexpander : Lean.PrettyPrinter.Unexpander
829+ | `($_ $k $g) => `($k[$g])
830+ | _ => throw ()
831+
824832instance inhabited : Inhabited k[G] :=
825833 inferInstanceAs (Inhabited (G →₀ k))
826834
You can’t perform that action at this time.
0 commit comments