Zulip Chat Archive
Stream: mathlib4
Topic: mathport bug with `^`
Jireh Loreaux (Feb 14 2023 at 21:56):
@Mario Carneiro I know mathport is broken right now anyway, but I think I found a bug. In the file linear_algebra.quotient
, there is an occurence of P^.quotient.mk_smul
in the mathlib 3 source, where P : submodule R M
and this is some dot notation magic that unfolds to submodule.quotient.mk_smul P
. Mathport translated this as P
. I'm not sure what the ^
notation means anyway.
Eric Wieser (Feb 14 2023 at 21:57):
foo^.bar.baz
where foo : Foo
means Foo.bar.baz foo
Eric Wieser (Feb 14 2023 at 21:57):
As opposed to foo.bar.baz
which means Bar.baz (Foo.bar foo)
Eric Wieser (Feb 14 2023 at 21:57):
I think this is super-ancient dot notation
Yury G. Kudryashov (Feb 14 2023 at 22:40):
It is present in 106 lines, 17 files.
Yury G. Kudryashov (Feb 14 2023 at 22:41):
at least 1 false positive.
Mario Carneiro (Feb 14 2023 at 22:41):
It appears to be a simple bug. This notation is already supported, but the implementation was "lightly tested"
Mario Carneiro (Feb 15 2023 at 00:10):
While investigating this, I noticed that ^.
has a secret superpower compared to .
:
def list.foo.bar {α} : list α → list α := id
#check [1]^.foo.bar -- ok
#check [1].foo.bar -- fail, interpreted as ([1].foo).bar
Mario Carneiro (Feb 15 2023 at 00:19):
this superpower behavior apparently has no equivalent in lean 4: |>.foo.bar
is also interpreted as |>.foo |>.bar
Eric Wieser (Feb 15 2023 at 00:49):
Yes, that's the power I described here:
Eric Wieser said:
foo^.bar.baz
wherefoo : Foo
meansFoo.bar.baz foo
Last updated: Dec 20 2023 at 11:08 UTC