Zulip Chat Archive

Stream: mathlib4

Topic: Slow `refine` for `ZMod`


Gareth Ma (Oct 20 2023 at 12:48):

import Mathlib.Tactic

set_option profiler true
set_option trace.profiler true

open ZMod

/- 12.2s -/
example : addOrderOf (3 : ZMod 1200) = 400 := by
  change addOrderOf 3 = 400

/- 0.01s -/
example : (3 : ZMod 12000) = 3 := rfl

Gareth Ma (Oct 20 2023 at 12:52):

Relevant example:

/-
tactic execution of Mathlib.Tactic.convert took 6.26s
type checking took 5.77s
-/
example : addOrderOf (3 : ZMod 12000) = 4000 := by
  convert addOrderOf_coe' _ _
  -- simp

What's happening with type checking? :thinking:

Alex J. Best (Oct 20 2023 at 13:08):

import Mathlib.Tactic

set_option profiler true
set_option trace.profiler true

open ZMod

example : addOrderOf (3 : ZMod 12000) = 4000 := by
  convert addOrderOf_coe' _ _
  simp

takes 0.1s in the web editor

Gareth Ma (Oct 20 2023 at 13:36):

Uhhh I must have messed something up then. Is the first example still there though?

Gareth Ma (Oct 22 2023 at 16:09):

Is there any progress on this?


Last updated: Dec 20 2023 at 11:08 UTC