PyPantograph: Pantograph Error Cases Report
Environment setup
header = """
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
"""
project_path = "<repo>/experiments/minif2f/MiniF2F"
server = Server(imports=['Aesop', 'Mathlib'], project_path=project_path)
Error cases
-
JSONDecodeError for some cases
theorem amc12_2000_p15 (f : ℂ → ℂ) (h₀ : ∀ x, f (x / 3) = x ^ 2 + x + 1) (h₁ : Fintype (f ⁻¹' {7})) : (∑ y in (f ⁻¹' {7}).toFinset, y / 3) = -1 / 9 theorem mathd_numbertheory_552 (f g h : ℕ+ → ℕ) (h₀ : ∀ x, f x = 12 * x + 7) (h₁ : ∀ x, g x = 5 * x + 2) (h₂ : ∀ x, h x = Nat.gcd (f x) (g x)) (h₃ : Fintype (Set.range h)) : (∑ k in (Set.range h).toFinset, k) = 12A minimized Case
theorem mathd_numbertheory_552_min (h : ℕ → ℕ) (h₃ : Fintype (Set.range h)) : true -
Unsolved goalstheorem sample (p q r x : ℂ) (h₀ : (x - p) * (x - q) = (r - p) * (r - q)) : (x - r) * x = (x - r) * (p + q - r) := by linear_combination h₀The remaining goal state:
p : ℂ q : ℂ r : ℂ x : ℂ h₀ : (x - p) _(x - q) = (r - p)_ (r - q) ⊢ ℂ
Lean Server Result
The Lean server response can be check here
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (12 by maintainers)
All problems listed here should be solved in https://github.com/stanford-centaur/PyPantograph/pull/60. Please confirm.
Would it be an acceptable solution to remove most of the drafting features (
:= sorrywill remain) fromfrontend.processand implement them using the new draft tactic? It is more versatile and requires less hacking into Lean, so it should be more resistant to edge cases like this.If this is a problem with Lean’s json system we’ll have to wait until the upstream is fixed
Understood. This does seem rather strange as I’ve come across several similar issues that were due to json errors and were resolved by setting
ensure_ascii=False.I was able to successfully reproduce the error you mentioned. Below is a more detailed error backtrace:
As the error message suggests, commenting out this line can address the aforementioned
JSONDecodeErrors. (However,Unsolved goalsremains unsolved):https://github.com/lenianiva/Pantograph/blob/3744cfaa9608cd43e00078283339662b3720949b/Pantograph/Frontend/MetaTranslate.lean#L71C1-L71C43
I’m still not certain why this assertion fails. Perhaps @lenianiva could conduct a more in-depth inspection.
As for the
JSONDecodeErrorinmathd_numbertheory_552(and the corrsponding MWE), could you please try the following fix?https://github.com/lenianiva/PyPantograph/blob/f4cc21cc963a9f410b0aec05052d6b4975861321/pantograph/server.py#L177