Zulip Chat Archive

Stream: mathlib4

Topic: RingCon extends


Matthew Ballard (Aug 24 2023 at 20:30):

While poking around slow instances, I found a note about making docs#RingCon extend docs#AddCon and docs#Con instead of extending Add and Mul with some fields.

Performance-wise, it doesn't make much difference. Is there an argument against this change?

Eric Wieser (Aug 24 2023 at 20:55):

Was docs3#con a new-style structure?

Eric Wieser (Aug 24 2023 at 20:56):

Yes, it was. The port was catching up in Lean3 and I didn't want to have to go back and make setoid an old-style structure

Matthew Ballard (Aug 24 2023 at 20:59):

So you are saying you have none now?

Matthew Ballard (Aug 24 2023 at 21:08):

There is #6722 which I can clean up unless people object

Eric Wieser (Aug 24 2023 at 21:08):

The only counterargument I have is a general distaste for nested inheritance and the asymmetry it forces

Eric Wieser (Aug 24 2023 at 21:09):

Wrong issue number?

Damiano Testa (Aug 25 2023 at 03:37):

I do not know if this helps, but I always had in the back of my mind this relationship between Con and Covariants:

import Mathlib.GroupTheory.Congruence

open Function Setoid
variable (M : Type*) [Setoid M] [Mul M]

@[to_additive]
theorem Con.of_covariants [CovariantClass M M (· * ·) r] [CovariantClass M M (swap (· * ·)) r] :
    Con M where
  mul' {w x y z} wx yz :=
    have left  : r (w * y) (x * y) := CovariantClass.elim (μ := swap (· * ·)) y wx
    have right : r (x * y) (x * z) := CovariantClass.elim (μ := (· * ·)) x yz
    Setoid.iseqv.trans left right

I do not know if this is useful to break some proofs up...

Damiano Testa (Aug 25 2023 at 03:48):

Matthew Ballard said:

There is #6722 which I can clean up unless people object

#6772?

Matthew Ballard (Aug 25 2023 at 09:55):

Apologies! Semester is starting :brain: :cooking:

Matthew Ballard (Aug 25 2023 at 15:32):

Eric suggested switching the parent order and now mathlib natively compiles 13% faster (somewhat skeptical).

Marked as awaiting-review

Sebastian Ullrich (Aug 25 2023 at 16:19):

If you click on the metric to get to its graph, you can see that it has quite a bit of variance, especially now that Mario has significantly decreased its total time http://speed.lean-fro.org/mathlib4/repo-detail/e7b27246-a3e6-496a-b552-ff4b45c7236e?zoomXStart=1692568800000&zoomXEnd=1693346400000&dimensions=build%3Anative%20compilation&dayEquidistant=true

Sebastian Ullrich (Aug 25 2023 at 16:21):

We don't have a good means of taking that variance into account when reporting yet but I can exclude the metric from significance reporting manually if desired

Matthew Ballard (Aug 25 2023 at 17:01):

I don’t think it needs to be excluded. That drop is crazy though.

Eric Wieser (Aug 25 2023 at 17:03):

Eric Wieser said:

The only counterargument I have is a general distaste for nested inheritance and the asymmetry it forces

I'm exploring restoring this symmetry in #6791

Matthew Ballard (Aug 25 2023 at 18:10):

I can also believe the drop here though since I can imagine compilation of algebraic quotient types is more intense but I don’t really know.


Last updated: Dec 20 2023 at 11:08 UTC