lean4-htt/src/Init
Joachim Breitner 784972462a
feat: omega: more helpful error messages (#3847)
while trying to help a user who was facing an unhelpful
```
omega did not find a contradiction:
[0, 0, 0, 0, 1, -1] ∈ [1, ∞)
[0, 0, 0, 0, 0, 1] ∈ [0, ∞)
[0, 0, 0, 0, 1] ∈ [0, ∞)
[1, -1] ∈ [1, ∞)
[0, 0, 0, 1] ∈ [0, ∞)
[0, 1] ∈ [0, ∞)
[1] ∈ [0, ∞)
[0, 0, 0, 1, 1] ∈ [-1, ∞)
```
I couldn’t resist and wrote a pretty-printer for these problem that
shows the linear combination as such, and includes the recognized atoms.
This is especially useful since oftem `omega` failures stem from failure
to recognize atoms as equal. In this case, we now get:

```
omega-failure.lean:19:2-19:7: error: omega could not prove the goal:
a possible counterexample may satisfy the constraints
  d - e ≥ 1
  e ≥ 0
  d ≥ 0
  a - b ≥ 1
  c ≥ 0
  b ≥ 0
  a ≥ 0
  c + d ≥ -1
where
 a := ↑(sizeOf xs)
 b := ↑(sizeOf x)
 c := ↑(sizeOf x.fst)
 d := ↑(sizeOf x.snd)
 e := ↑(sizeOf xs)
```
and this might help the user make progress (e.g. by using `case x`
first, and investingating why `sizeOf xs` shows up twice)
2024-04-16 15:11:51 +00:00
..
Control doc: docstrings for Alternative (#3860) 2024-04-15 12:40:40 +00:00
Data feat: omega: more helpful error messages (#3847) 2024-04-16 15:11:51 +00:00
Omega feat: in conv tactic, use try with_reducibe rfl (#3763) 2024-03-29 11:59:45 +00:00
System feat: shorten auto-generated instance names (#3089) 2024-04-13 18:08:50 +00:00
BinderPredicates.lean chore: upstream set notation (#3339) 2024-02-15 02:08:45 +00:00
ByCases.lean perf: rewrite UnusedVariables lint (#3186) 2024-03-21 12:28:57 +00:00
Classical.lean chore: bool and prop lemmas for Mathlib compatibility and improved confluence (#3508) 2024-03-04 23:56:30 +00:00
Coe.lean fix: make Lean.Internal.liftCoeM and Lean.Internal.coeM unfold (#3404) 2024-02-27 22:17:46 +00:00
Control.lean feat: add ExceptCpsT 2021-02-27 18:44:24 -08:00
Conv.lean chore: reorganising to reduce imports (#3790) 2024-03-27 11:15:01 +00:00
Core.lean fix: replace unary Nat.succ simp rules with simprocs (#3808) 2024-04-04 23:15:26 +00:00
Data.lean chore: upstream solve_by_elim (#3408) 2024-02-21 01:16:04 +00:00
Dynamic.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Ext.lean chore: reorganising to reduce imports (#3790) 2024-03-27 11:15:01 +00:00
GetElem.lean chore: extend GetElem with getElem! and getElem? (#3694) 2024-03-28 01:42:00 +00:00
Guard.lean feat: upstream guard_expr (#3297) 2024-02-11 23:25:04 +00:00
Hints.lean fix: Not should not be reducible, special support for Ne 2021-02-15 17:36:11 -08:00
MacroTrace.lean chore: reorganising to reduce imports (#3790) 2024-03-27 11:15:01 +00:00
Meta.lean chore: extend GetElem with getElem! and getElem? (#3694) 2024-03-28 01:42:00 +00:00
MetaTypes.lean doc: fix simp configuration option default value for decide (#3894) 2024-04-12 22:02:08 +00:00
Notation.lean feat: whitespace and message ordering configurations for #guard_msgs (#3883) 2024-04-13 08:53:43 +00:00
NotationExtra.lean chore: reorganising to reduce imports (#3790) 2024-03-27 11:15:01 +00:00
Omega.lean chore: add missing copyright headers (#3411) 2024-02-20 01:49:55 +00:00
Prelude.lean feat: shorten auto-generated instance names (#3089) 2024-04-13 18:08:50 +00:00
PropLemmas.lean feat: upstream apply helper tactics from Mathlib (#3670) 2024-03-17 06:47:56 +00:00
RCases.lean doc: typo in rcases docs (#3796) 2024-03-28 07:31:01 +00:00
ShareCommon.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
SimpLemmas.lean chore: bool and prop lemmas for Mathlib compatibility and improved confluence (#3508) 2024-03-04 23:56:30 +00:00
Simproc.lean chore: fix simproc doc-string (#3800) 2024-03-28 17:54:52 +00:00
SizeOf.lean doc: documentation for Init.SizeOf 2022-08-17 14:48:10 -07:00
SizeOfLemmas.lean fix: protect sizeOf lemmas 2023-07-19 08:50:59 +02:00
System.lean feat: Mutex, Condvar 2022-09-05 08:52:46 -07:00
Tactics.lean chore: extend GetElem with getElem! and getElem? (#3694) 2024-03-28 01:42:00 +00:00
TacticsExtra.lean chore: upstream norm_cast tactic (#3322) 2024-02-19 17:49:17 -08:00
Util.lean chore: extend GetElem with getElem! and getElem? (#3694) 2024-03-28 01:42:00 +00:00
WF.lean doc: Leo-Henrik retreat doc (#3869) 2024-04-12 09:14:31 +00:00
WFTactics.lean feat: use omega in default decreasing_trivial (#3503) 2024-02-27 18:53:36 +00:00