lean4 icon indicating copy to clipboard operation
lean4 copied to clipboard

Configuration option for `synthPendingDepth`

Open mattrobball opened this issue 1 year ago • 3 comments

Currently there is the following in Lean.Meta.SynthInstance

/- TODO: use a configuration option instead of the hard-coded limit `1`. -/
      if (← read).synthPendingDepth > 1 then
        trace[Meta.synthPending] "too many nested synthPending invocations"
        return false

There have been multiple places where Mathlib has butted up against this; the most recent is leanprover-community/mathlib4#12150.

There are also workaround instances in Mathlib.Analysis.NormedSpace.OperatorNorm and a thread on Zulip discussing this.

Given the labeling as a TODO, I assume such a change is desired. If indeed so but bandwidth is limited, conveying specifics as to implementation (should it look like other such ones? etc...) would help in getting a solution.

mattrobball avatar Apr 16 '24 15:04 mattrobball

Added references for failures in OperatorNorm in leanprover-community/mathlib4#12188

mattrobball avatar Apr 16 '24 19:04 mattrobball

What happens if you just increase this to 2? (I don't know what, if anything, we will want to do about this yet.)

kim-em avatar Apr 22 '24 05:04 kim-em

It broke things pretty badly when I bumped the hardcoded bound from 0 to 1.

mattrobball avatar Apr 22 '24 20:04 mattrobball