Commit graph

65 commits

Author SHA1 Message Date
Leonardo de Moura
94bca2b9d8 chore(library/init): mimize use of notations 2019-06-24 15:48:11 -07:00
Leonardo de Moura
dda0e38802 chore(library/init): avoid local notation 2019-06-24 15:48:11 -07:00
Leonardo de Moura
62d7cc6b37 feat(library/init/wf): remove wf_term_hack 2019-03-27 12:41:16 -07:00
Leonardo de Moura
4d9150859b chore(library/init/core): avoid {{x : A}} strict implicit arguments, and cleanup 2019-03-23 19:03:26 -07:00
Sebastian Ullrich
c786673837 chore(library/init/core): more renaming 2019-03-21 15:06:45 -07:00
Sebastian Ullrich
97e5aa2411 chore(library): s/Punit/PUnit/g etc 2019-03-21 15:06:45 -07:00
Leonardo de Moura
4c50859129 chore(*): or => Or 2019-03-21 15:06:44 -07:00
Leonardo de Moura
2ea0baeb99 chore(library): use lowercase in imports 2019-03-21 15:06:44 -07:00
Leonardo de Moura
675003318e chore(*): small fixes 2019-03-21 15:06:44 -07:00
Sebastian Ullrich
beda5f5f43 chore(library): capitalize types and namespaces 2019-03-21 15:06:43 -07:00
Sebastian Ullrich
b939162168 chore(library): switch from snake_case to camelCase 2019-03-21 15:06:43 -07:00
Leonardo de Moura
4e04d373e4 feat(library/init): unicode notation for heq: ≅ 2019-03-07 10:21:14 -08:00
Leonardo de Moura
67b01cddd0 chore(library/init): heq notation == ==> ~= 2019-03-07 10:21:14 -08:00
Leonardo de Moura
b9cee7b8ae chore(library/init/wf): disable codegen for wf 2018-10-01 11:41:57 -07:00
Leonardo de Moura
7f64033111 chore(library/init): remove all occurrences of parameter command
We will not support the `parameter` command in Lean 4.
It is seldom used and creates many complications.
2018-09-26 17:54:11 -07:00
Leonardo de Moura
a7d08d2f3d feat(kernel/inductive/inductive): dependent elimination for inductive predicates
In Lean4, we will not generate non dependent recursors for inductive
predicates. The main goal is to make the shape of the automatically
generated recursors more uniform. The non uniform representation is
leftover from Lean2. In Lean2, we wanted to support different kernels
with different features. For example: we could create proof relevant
kernels, no impredicative universe, etc.
Recall that, in a kernel with an impredicative Prop and no proof
irrelevance, inductive predicates without dependent elimination are
weaker that inductive predicates with dependent elimination.
When proof irrelevance is enabled, we can generate the dependent
recursor from the non dependent one. Actually, the module drec.cpp
generates the dependent recursor.
Now, we only support one kind of kernel, and it doesn't make sense
anymore to generate non dependent recursors for inductive predicates.
This would only produce an unnecessary asymmetry on the inductive
datatype module.

Remark: we had to create non dependent recursors to help the elaborator.
This can be avoid if we improve the elaborator. I will do that in the
new elaborator implemented in Lean.

Remark: equation lemmas are broken for definitions that pattern match on
nested inductive datatypes. The problem is the super messy
`prove_eq_rec_invertible_aux` function. This function will not be needed
after I finish the new inductive datatype support in the kernel.

cc @kha
2018-06-12 13:03:26 -07:00
Leonardo de Moura
0405a67a70 feat(library/init): add wf_term_hack (unsound) axiom
We use the axiom instead of `sorry` to avoid a tsunami of warnings.
2018-04-30 11:06:51 -07:00
Leonardo de Moura
5787f17138 chore(library/init): merge sigma/lex.lean with wf.lean 2018-04-30 10:04:03 -07:00
Leonardo de Moura
2503d6026e chore(library/init): remove prod micro module 2018-04-30 09:25:25 -07:00
Sebastian Ullrich
a7688a10b8 feat(frontends/lean/definition_cmds): elaborate a def's type separately when explicit return type is given 2018-04-20 09:59:09 -07:00
Leonardo de Moura
6d96741010 feat(library): provide names for constructor arguments
Motivation: `cases` and `induction` tactics use these names when the
user does not provide them.
2017-12-04 16:25:16 -08:00
Sebastian Ullrich
f024ccd75d refactor(frontends/lean/token_table,library): take ~> assume 2017-07-05 11:20:10 -07:00
Leonardo de Moura
290e7b9cff feat(library/init): use Sort instead of Type for defining acc and well_founded 2017-05-23 16:40:45 -07:00
Leonardo de Moura
499fc355df feat(library/init): add has_well_founded type class 2017-05-17 14:34:52 -07:00
Leonardo de Moura
5cef84709f refactor(library): avoid auxiliary definitions such as add/mul/le/etc
See Section "Other goodies" at
https://github.com/leanprover/lean/wiki/Refactoring-structures

This commit also improves the support for projections in the
unifier/matcher.

Now, we consider the extra case-split for projections.
Given a projection `proj`, and the constraint `proj s =?= proj t`, we need to try first `s =?= t` and if it fails, then try to reduce.
This is needed in the standard library because we now have constraints such as:
```
@has_le.le ?A ?s ?a ?b  =?=  @has_le.le nat nat.has_add x y
```
If we reduce the right hand side, we get the unsolvable constraint
```
@has_le.le ?A ?s ?a ?b  =?=  nat.le x y
```
Before this change, the constraint was `@le ?A ?s ?a ?b  =?=  @le nat nat.has_add x y`, and we already perform a case-split in this case.
Moreover, projections were eagerly reduced whenever possible.
The extra case-split generates a performance problem in several tests. For example `fib 8 = 34` was timing out.
I worked around this issue by performing the case-split only when the constraint contains meta-variables.
There are also minor issues. Example. `<` is notation for `has_lt.lt`, but `>` is for `gt`.
2017-05-01 08:52:19 -07:00
Leonardo de Moura
71685e4dd6 feat(frontends/lean): add support for t.<id> and t.<idx> when t is a composite term
Replace `^.` with `.` in the stdlib
2017-03-28 17:47:49 -07:00
Leonardo de Moura
8e2dcb8ad8 chore(frontends/lean): remove ^. variants (~> and )
This modification was motivated by a discussion at slack.
2017-03-28 12:23:33 -07:00
Leonardo de Moura
36770119b6 feat(library): do not generate C.destruct (for structures), and C.induction_on (for structures and inductive datatypes) 2017-03-15 14:45:13 -07:00
Leonardo de Moura
a00f2e49a7 chore(frontends/lean): remove several command aliases
We still have many more to remove and rename.
See issue #1432
2017-03-09 16:49:03 -08:00
Leonardo de Moura
0768bb28f4 chore(library/init/wf): rename parameter 2017-03-03 16:56:40 -08:00
Leonardo de Moura
17556758cb feat(library/constructions,library/inductive_compiler): automatically generate dependent eliminator for inductive predicates
The dependent eliminator for an inductive predicate C is called C.drec

TODO: construct dcases_on and drec_on using C.drec

We need this recursor for implementing dependent elimination for
inductive predicates.

We don't need to define acc.drec and eq.drec in the standard library anymore.
2017-02-28 20:58:04 -08:00
Leonardo de Moura
32e6442d0a feat(frontends/lean): no global universes in the frontend 2017-02-08 17:23:04 -08:00
Leonardo de Moura
4a2ffefdaf fix(library/init/wf): wf eliminators should be able to eliminate into Prop and Type 2017-01-30 19:14:43 -08:00
Leonardo de Moura
77a9feaf70 refactor(frontends/lean): PType ==> Sort
see #1341
2017-01-30 11:54:00 -08:00
Leonardo de Moura
bf9f7560f7 feat(frontends/lean): (Type u) can't be a proposition
(Type u)  is the old (Type (u+1))
(PType u) is the old (Type u)
Type*     is the old (Type (_+1))
PType*    is the old Type*

The stdlib can be compiled, but we still have > 70 broken tests

See discussion at #1341
2017-01-30 11:54:00 -08:00
François G. Dorais
b305130ec3 fix(library/init/wf): typo
Same typo as #1091, different location.
2017-01-13 11:35:52 -08:00
Leonardo de Moura
e423588463 refactor(library/init): merge some files 2016-12-02 16:13:45 -08:00
Leonardo de Moura
e11fd8820a refactor(library/init): create init.data folder 2016-12-02 14:23:06 -08:00
Leonardo de Moura
0d2d595c31 chore(library/init): remove unnecessary space 2016-11-23 10:53:19 -08:00
Leonardo de Moura
c816b80855 chore(*): don't use upper case letter for type variables, and camelCase for declarations 2016-11-17 14:54:08 -08:00
Leonardo de Moura
e304d778a1 chore(library/init): cleanup 2016-09-24 16:38:39 -07:00
Leonardo de Moura
0641f3f714 chore(library/init): cleanup proofs using new elaborator 2016-09-23 17:36:32 -07:00
Leonardo de Moura
5e5285ee67 refactor(library): rename pr1/pr2 ==> fst/snd 2016-09-21 09:48:39 -07:00
Leonardo de Moura
b716827206 chore(library/init): uniform style 2016-09-21 09:21:37 -07:00
Leonardo de Moura
4c15c9833d fix(frontends/lean/elaborator): use_elim_elab_core 2016-09-17 20:04:14 -07:00
Leonardo de Moura
75d5087d43 fix(library/type_context): using incorrect local_context at revert 2016-09-17 19:44:38 -07:00
Leonardo de Moura
5e8f2add84 refactor(library/init): use universe variables 2016-09-17 12:25:02 -07:00
Daniel Selsam
a9b01991c2 feat(frontends/lean/inductive_cmd): new frontend for the inductive cmd
Conflicts:
	src/frontends/lean/CMakeLists.txt
	src/frontends/lean/structure_cmd.h
2016-08-17 07:34:03 -07:00
Sebastian Ullrich
fd2c42a8bf chore(library, tests): switch to new attribute declaration syntax
sed -Ei 's/^(\s*)((private |protected )?(noncomputable )?(abbreviation|definition|meta_definition|theorem|lemma|proposition|corollary)\s+\S+\s*)((\s*\[(\S+(\s+[0-9]+)*|priority.*)\])+)\s*/\1attribute \6\n\1\2/' library/**/*.lean tests/**/*.lean
sed -Ei 's/\s+$//' library/**/*.lean  # remove trailing whitespace
2016-08-12 15:36:12 -07:00
Leonardo de Moura
8c36cd04a3 feat(library/init/sigma_lex): add skip_left relation for sigma 2016-08-09 11:17:12 -07:00