lean4-htt/src
Leonardo de Moura fedf235cba fix: fixes #2011
In Lean 4, we have support for typing constraints of the form
```
(?m ...).1 =?= v
```
where the type of `?m ...` is a structure with a single field.
This kind of constraint is reduced to `?m ... =?= ⟨v⟩`

This feature is implemented by the function `isDefEqSingleton`.
As far as I remember, Lean 3 does not implement this feature.

This commit disables this feature if the structure is a class.
The goal is to avoid the generation of counterintuitive instances by
typing inference.

For example, in the example at issue #2011, the following weird
instance was being generated for `Zero (f x)`
```
(@Zero.mk (f x✝) ((@instZero I (fun i => f i) fun i => inst✝¹ i).1 x✝)
```
where `inst✝¹` is the local instance `[∀ i, Zero (f i)]`
Note that this instance is definitinally equal to the expected nicer
instance `inst✝¹ x✝`.
However, the nasty instance trigger nasty unification higher order
constraints later.

Note that a few tests broke because different error messages were
produced. The new error messages seem better. I do not expect this
change to affect Mathlib4 since Lean 3 does not have this feature.
2023-01-05 17:33:45 -08:00
..
bin chore: lean-gdb: recursive values & tag 2022-06-26 18:47:47 +02:00
cmake
include/lean feat: LLVM backend (#1837) 2022-12-30 12:45:30 +01:00
Init doc: replace maximum? in minimum? docstring 2023-01-05 14:02:19 -08:00
initialize chore: remove Bootstrap package 2022-09-02 16:39:03 -07:00
kernel chore: remove remnants of C++ format 2022-11-18 06:11:24 -08:00
lake@d0b530530f fix: remove Inhabited Environment instance 2022-12-21 20:08:08 +01:00
Lean fix: fixes #2011 2023-01-05 17:33:45 -08:00
library feat: LLVM backend (#1837) 2022-12-30 12:45:30 +01:00
runtime fix: avoid warning by dropping '#pragma once' 2023-01-04 09:42:40 +01:00
shell fix: update libleanrt.bc, rename to lean.h.bc 2022-11-28 16:20:12 +01:00
util feat: LLVM backend (#1837) 2022-12-30 12:45:30 +01:00
CMakeLists.txt feat: LLVM backend (#1837) 2022-12-30 12:45:30 +01:00
config.h.in chore: document simplified object header and remove obsolete cmake options 2021-07-20 10:42:28 -07:00
githash.h.in
Init.lean chore: move Bootstrap.Dynamic -> Init.Dynamic 2022-09-02 04:36:54 -07:00
Lean.lean feat: add linter.deprecated option to silence deprecation warnings 2022-10-23 21:11:57 +02:00
lean.mk.in chore: lean.mk: re-suppress find error messages 2022-11-20 19:55:09 +01:00
Leanc.lean chore: fix typo in CLI usage (--ldlags) (#1947) 2022-12-14 10:20:50 +01:00
stdlib.make.in chore: abort build on panic 2022-11-11 16:24:04 +01:00
stdlib_flags.h chore: parseQuotWithCurrentStage and quotPrecheck 2022-11-11 13:45:41 +01:00
version.h.in feat: version information API 2020-12-29 14:42:48 -08:00