leanprover-community / mathport

Mathport is a tool for porting Lean3 projects to Lean4
Apache License 2.0
41 stars 15 forks source link

Emit default options in synported files #127

Open gebner opened 2 years ago

gebner commented 2 years ago

I often have to add some options just to get the statements of the theorems to elaborate:

set_option synthInstance.maxHeartbeats 100000

In the future we might also want to add options that disable automatic implicit lambdas (see #53).

dselsam commented 2 years ago

It might be nice to bundle them all in one command, e.g. #mathlib_set_defaults

gebner commented 2 years ago

That's a good suggestion, but I'm not sure it's the best idea.

  1. In my experience, putting mathport configuration in mathlib4 is a bit of a maintenance headache. For example changing alignments requires adding it to mathlib4, then update mathlib4 in mathport, and then verify that the alignment actually works. I'd rather keep these things in the mathport repo if possible to make it easier to iterate on them.
  2. After porting, we might want to remove these options incrementally again. Having several lines makes it easier to clean up the "hackport" options again.
digama0 commented 2 years ago

An alignment is a relationship between a lean 3 mathlib definition and a mathlib4 definition; it does not intrinsically involve mathport. It might make sense for rapid iteration purposes to have mathport configuration that overrides these alignment indications, but for reasonably stable alignments that we want to keep I think we should be pushing them to mathlib4.