lean4-htt/src/Lean
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
..
Compiler chore: move getUnboxOpName 2023-01-04 08:07:32 -08:00
Data feat: introduce custom leanSorryLike semantic token type for sorry, admit, stop 2023-01-04 10:50:02 +01:00
Elab fix: fixes #2009 2023-01-04 10:32:03 -08:00
Linter chore: use Expr.forEachWhere to implement linter 2022-11-30 18:44:20 -08:00
Meta fix: fixes #2011 2023-01-05 17:33:45 -08:00
Parser fix: fixes #2006 2023-01-04 08:19:22 -08:00
ParserCompiler feat: hovers & name resolution in registerCombinatorAttribute 2022-10-23 09:30:38 +02:00
PrettyPrinter feat: add fun x ↦ y syntax 2023-01-03 13:59:53 -08:00
Server feat: highlight #exit as leanSorryLike 2023-01-04 10:50:02 +01:00
Util refactor: consolidate MessageData constructors into lazy formatting with infos 2022-12-07 19:16:25 +01:00
Widget perf: avoid lifting ← over an if 2022-12-23 05:46:04 +01:00
Attributes.lean feat: add applicationTime to registerTagAttribute 2022-12-02 09:58:41 -08:00
AuxRecursor.lean feat: automatic extension names 2022-10-06 17:19:30 -07:00
Class.lean fix: fixes #1901 2022-12-01 08:39:06 -08:00
Compiler.lean refactor: new LCNF frontend 2022-08-24 11:40:37 -07:00
CoreM.lean chore: use deriving Nonempty 2022-12-22 03:48:15 +01:00
Data.lean chore: split Lean.Data.Name and NameMap 2022-09-15 14:02:38 -07:00
Declaration.lean fix: catch kernel exceptions in Kernel.{isDefEq, whnf} 2022-10-20 05:38:29 -07:00
DeclarationRange.lean feat: automatic extension names 2022-10-06 17:19:30 -07:00
DocString.lean feat: automatic extension names 2022-10-06 17:19:30 -07:00
Elab.lean perf: add parseImports' 2022-11-09 14:50:11 -08:00
Environment.lean chore: use deriving Nonempty 2022-12-22 03:48:15 +01:00
Eval.lean doc: some doc strings 2022-07-30 21:18:50 -07:00
Exception.lean refactor: consolidate MessageData constructors into lazy formatting with infos 2022-12-07 19:16:25 +01:00
Expr.lean chore: replace Expr.forEach with Expr.forEachWhere 2022-12-01 05:19:32 -08:00
HeadIndex.lean doc: some doc strings 2022-07-30 21:18:50 -07:00
Hygiene.lean perf: improve Unhygienic.run code 2022-10-12 19:36:05 -07:00
ImportingFlag.lean doc: some doc strings 2022-07-30 21:18:50 -07:00
InternalExceptionId.lean doc: some doc strings 2022-07-30 21:18:50 -07:00
KeyedDeclsAttribute.lean chore: use deriving Nonempty 2022-12-22 03:48:15 +01:00
LazyInitExtension.lean
Level.lean refactor: Level.instantiateParams => Level.substParams, add Level.instantiateParams 2022-10-24 19:49:57 -07:00
Linter.lean feat: add linter.deprecated option to silence deprecation warnings 2022-10-23 21:11:57 +02:00
LoadDynlib.lean
LocalContext.lean feat: add implementation-detail hypotheses 2022-10-11 17:24:35 -07:00
Log.lean refactor: consolidate MessageData constructors into lazy formatting with infos 2022-12-07 19:16:25 +01:00
Message.lean refactor: consolidate MessageData constructors into lazy formatting with infos 2022-12-07 19:16:25 +01:00
Meta.lean feat: add evalTerm and Meta.evalExpr 2022-06-28 19:14:40 -07:00
MetavarContext.lean refactor: replace ignoreLevelMVarDepth by levelAssignDepth 2022-12-19 20:14:17 +01:00
Modifiers.lean feat: automatic extension names 2022-10-06 17:19:30 -07:00
MonadEnv.lean refactor: move compileDecl, compileDecls, and addDecl to CoreM 2022-09-21 18:09:19 -07:00
Parser.lean chore: improve pretty printer antiquotation support 2022-10-28 21:25:47 +02:00
ParserCompiler.lean chore: generalize parser kind detection 2022-11-14 12:53:18 +01:00
PrettyPrinter.lean feat: signature pretty printer for hovers 2022-12-21 21:59:05 +01:00
ProjFns.lean feat: automatic extension names 2022-10-06 17:19:30 -07:00
ReducibilityAttrs.lean feat: automatic extension names 2022-10-06 17:19:30 -07:00
ResolveName.lean fix: private + pp.fullNames 2022-12-21 21:59:05 +01:00
Runtime.lean
ScopedEnvExtension.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Server.lean feat: CodeActionProvider 2022-10-20 11:20:42 -07:00
Structure.lean feat: automatic extension names 2022-10-06 17:19:30 -07:00
SubExpr.lean chore: move Std.* data structures to Lean.* 2022-09-26 05:46:04 -07:00
Syntax.lean feat: add (canonical := true) option in Syntax 2022-09-27 22:09:54 +02:00
ToExpr.lean feat: new ToExpr Name 2022-09-29 17:27:45 -07:00
Util.lean feat: add Expr.forEachWhere 2022-11-30 18:41:12 -08:00
Widget.lean feat: user widgets 2022-07-25 08:01:27 -07:00