Commit graph

5502 commits

Author SHA1 Message Date
Leonardo de Moura
5e9ccf19d7 fix: fixes #329 2021-03-05 13:42:54 -08:00
Leonardo de Moura
e228ca38b8 test: add set example 2021-03-04 19:16:12 -08:00
Leonardo de Moura
66f1a88f2c feat: simp [-decl] 2021-03-04 17:50:44 -08:00
Joe Hendrix
9bd60c7519 feat: Nat/Fin/UInt instances of bitwise classes 2021-03-04 15:42:43 -08:00
Leonardo de Moura
30287836b0 test: OfNatSound 2021-03-04 13:48:01 -08:00
Leonardo de Moura
1fedbfb9a3 feat: simp only 2021-03-04 11:58:34 -08:00
Leonardo de Moura
960e964b71 feat: allow user to "erase" [simp] lemmas 2021-03-04 11:36:12 -08:00
Leonardo de Moura
130a087ecf feat: Lean 3 french single quote notation 2021-03-04 09:43:59 -08:00
Leonardo de Moura
3107473c9f feat: add rename tactic
cc @Kha
2021-03-03 18:32:25 -08:00
Leonardo de Moura
1ecc50f809 test: contradiction 2021-03-03 17:13:25 -08:00
Leonardo de Moura
6cdc6cb1d0 feat: add contradiction 2021-03-03 17:00:54 -08:00
Leonardo de Moura
4aec7579db test: add do equivalence examples 2021-03-03 13:44:30 -08:00
Leonardo de Moura
f1245f9dc7 fix: bug at isDefEqOffset
fixes #326
2021-03-02 17:28:40 -08:00
Leonardo de Moura
5626b537c7 chore: move nondet to Std/Control/Nondet.lean 2021-03-02 07:57:25 -08:00
Leonardo de Moura
769e3a9082 chore: fix test 2021-02-28 16:38:04 -08:00
Leonardo de Moura
140cdbe942 test: tactic framework 2021-02-26 19:34:55 -08:00
Leonardo de Moura
0c1c6c0a73 feat: convert universe metavariables into parameters after elaborating theorem header
closes #318

Like Lean 3, we are doing it only for theorems.
@Kha, we talked about doing it for definitions too, it sounded like a
good idea, and it would make the system's behavior more uniform, but
unfortunately it creates too many problems. There are so many trivial
cases where it breaks. Here are some examples.

1- Definitions that take multiple bundled structures
```
def foo (s1 : Group) (s2 : CommRing) ...
```
They are universe polymorphic, and the different structures must be in
the same universe, but we don't know it when we elaborate the header,
that is, we need to elaborate the body.

An extreme case is `PUnit` occurring in the header. It is universe
polymorphic, but we only lear the constraints on this universe after
we elaborate the body.

2- All files containing unification hints broke.
Again, there are universe constraints on the header that we only learn
after we elaborate the body.

3- Many `CoeSort` and `CoeFun` examples broke.
Example:
```
structure Group :=
  (carrier : Type u) (mul : carrier → carrier → carrier) (one : carrier)

instance GroupToType : CoeSort Group (Type u) :=
  CoeSort.mk (fun g => g.carrier)
```
We would have to write
```
instance GroupToType : CoeSort Group.{u} (Type u) :=
  CoeSort.mk (fun g => g.carrier)
```
We would have to provide universe level parameters manually in this
kind of instance. I think it would be too annoying.
2021-02-25 16:53:58 -08:00
Zygimantas Straznickas
49ebd30fd5 fix: fix deriving Repr for structure-like inductives
The deriving code currently uses isStructureLike when choosing whether to use
Inductive or Structure logic, which fails for inductives that are
structure-like. The commit changes the code to use isStructure.
2021-02-25 13:38:33 -08:00
Leonardo de Moura
1b16f9b33c fix: make sure kernel checks examples
We discard the resulting environment for examples.

closes #309

cc @Kha
2021-02-25 13:34:27 -08:00
Leonardo de Moura
d770c55326 feat: universe level parameters in instances are outParam by default
This commit makes sure Lean 4 treats universe level parameters in
instances as `outParam`s. This the behavior in Lean 3.

fixes #319
2021-02-25 13:21:53 -08:00
Leonardo de Moura
162062b3de feat: improve Lawful.lean 2021-02-23 12:38:00 -08:00
Leonardo de Moura
0ceac85c6d chore: fix test 2021-02-21 16:29:13 -08:00
Leonardo de Moura
1b15a848e0 chore: fix test 2021-02-21 11:16:21 -08:00
Leonardo de Moura
1ed2ee4df8 fix: local simp lemmas with implicits 2021-02-20 14:29:15 -08:00
Leonardo de Moura
d8ca6d847b test: lost synthetic mvar issue 2021-02-20 13:01:36 -08:00
Leonardo de Moura
8fa1ecde49 fix: throw error when default value contains metavariables 2021-02-20 11:31:56 -08:00
Leonardo de Moura
6eeccdd675 test: for field auto implicit bound feature 2021-02-20 07:52:42 -08:00
Leonardo de Moura
e1f6965266 feat: allow user to define rewrite lemmas with (local) match expressions 2021-02-19 15:18:19 -08:00
Leonardo de Moura
d493e700cc fix: matchUnit simplification 2021-02-19 13:51:08 -08:00
Leonardo de Moura
2861f71c61 feat: add option autoLift 2021-02-19 11:02:58 -08:00
Leonardo de Moura
c06ca8304d fix: test 2021-02-18 16:54:45 -08:00
Joe Hendrix
ffef5635bb fix: Json.num
Handle negative numbers correctly.
2021-02-18 13:27:31 +01:00
Leonardo de Moura
df8634e9ad fix: assertAfter 2021-02-17 13:52:43 -08:00
Leonardo de Moura
bb2ca97df9 refactor: add options for controlling whether variables are included or not at mkLambdaFVars and mkForallFVars 2021-02-17 13:49:27 -08:00
Leonardo de Moura
c97ae92afe chore: cleanup 2021-02-17 13:03:24 -08:00
Leonardo de Moura
79a4aebf96 feat: add byCases tactic 2021-02-17 13:03:24 -08:00
Leonardo de Moura
08927f1e66 test: tactic framework and AC by reflection 2021-02-17 13:03:24 -08:00
Leonardo de Moura
1a7535263e fix: unfolding class projections at simp 2021-02-16 17:55:57 -08:00
Leonardo de Moura
5f80659b45 fix: unfold constants at simp 2021-02-16 15:42:31 -08:00
Leonardo de Moura
5e24da0c2e fix: simp argument issue
See new test.
2021-02-16 13:12:57 -08:00
Leonardo de Moura
d1009e8405 chore: add simp lemmas, theorem naming convention 2021-02-16 11:53:49 -08:00
Sebastian Ullrich
1490d095a8 fix: delaborator: bind without lambda 2021-02-16 12:07:46 +01:00
Leonardo de Moura
242a8dcfbf test: simp 2021-02-15 17:09:51 -08:00
Leonardo de Moura
e97df2f61b feat: functions to unfold at simp 2021-02-15 15:32:25 -08:00
Leonardo de Moura
1c5de9842d feat: use decide at simp 2021-02-15 13:08:45 -08:00
Leonardo de Moura
9528c1abd7 chore: add basic simp lemmas
TODO: consistent naming convention for theorems.

cc @Kha
2021-02-15 11:32:19 -08:00
Leonardo de Moura
3bc5b89ac3 test: add if p x then .. else .. example
cc @Kha
2021-02-14 11:44:10 -08:00
Leonardo de Moura
ac51d3e621 feat: eager coe expansion 2021-02-14 11:34:08 -08:00
Leonardo de Moura
f07b9926b1 feat: unfold coercions and coeFun, coeSort, coeM, liftCoeM
TODO: `coe`
2021-02-14 10:27:34 -08:00
Leonardo de Moura
0787886cea feat: improve simp local lemma elaboration 2021-02-13 18:55:19 -08:00