leanprover / lean4

Lean 4 programming language and theorem prover
https://lean-lang.org
Apache License 2.0
4.02k stars 345 forks source link

`simp` uglifies `ofScientific` pretty printing #3194

Closed girving closed 5 months ago

girving commented 5 months ago

Prerequisites

Description

Scientific literals like 0.123712 pretty print nicely, but simp only messes up the pretty printing. Here's an example with no imports:

theorem with_number : (0.123712 : Float) < 0.8482312 := by
  -- Goal print as `0.123712 < 0.8482312`
  simp only
  -- Goal prints as `OfScientific.ofScientific 123712 true 6 < OfScientific.ofScientific 8482312 true 7`
  sorry

Context

Zulip discussion

This came up for me because I'm working on tightening some bounds of nonlinear functions, and weird numbers naturally appear.

Steps to Reproduce

See repro above.

Versions

% lean --version
Lean (version 4.5.0-rc1, commit b614ff1d12bc, Release)

Impact

Add :+1: to issues you consider important. If others are impacted by this issue, please ask them to add :+1: to it.

eric-wieser commented 5 months ago

A slightly simpler reproduction is #simp 0.5, which also outputs OfScientific.ofScientific ...

hrmacbeth commented 5 months ago

Duplicate of https://github.com/leanprover/lean4/issues/2159?

girving commented 5 months ago

Yep, duplicate, apologies for not noticing the previous issue.