Commit graph

7405 commits

Author SHA1 Message Date
Leonardo de Moura
41a5c2bce4 feat: add support for negation at simpCnstr? 2022-02-25 18:30:09 -08:00
Leonardo de Moura
7217ee7754 fix: GE.ge and GT.gt support at simpCnstr? 2022-02-25 17:12:27 -08:00
Leonardo de Moura
3f636b9f83 feat: add Lean.Meta.Linear.Nat.simpCnstr? 2022-02-25 16:27:21 -08:00
Leonardo de Moura
049273afee fix: add workarounds to code generator
The issue is only going to be properly fixed when we rewrite `csimp`
in Lean. The `csimp` performs transformations that do not preserve
typability, but it also uses the kernel `infer_type` which assumes the
input is type correct. In the new `csimp`, we must have a different
`infer_type` which returns an `Any` type in this kind of situation.

The workaround in this commit simply disables optimizations when
`infer_type` fails. It does not fix all occurrences of this problem,
but the two places that issue #1030 triggered.

closes #1030
2022-02-25 08:47:56 -08:00
Leonardo de Moura
4f7067fe7f fix: substEqs may close input goal
closes #1029
2022-02-25 08:07:23 -08:00
Leonardo de Moura
7920db9521 feat: check for invalid projections during elaboration
It produces a better error message than the one produced by the
kernel.
2022-02-25 07:43:37 -08:00
Leonardo de Moura
db38bc4043 fix: missing check at infer_proj
We should not allow `h.1` if `h` is a proposition and the result is
not. The recursor for `h`'s type can only eliminate into `Prop`.
2022-02-25 07:15:34 -08:00
Leonardo de Moura
e04ad112b2 fix: store levelNames in the SavedContext 2022-02-24 17:47:26 -08:00
Leonardo de Moura
2961e9cbf0 fix: heuristic for deciding which additional propositions must be included in equality theorems 2022-02-24 17:17:07 -08:00
Leonardo de Moura
bdea43a52a feat: while and repeat macros 2022-02-24 16:26:07 -08:00
Leonardo de Moura
05be43455a feat: add src/Init/Data/Nat/Linear.lean 2022-02-24 13:45:17 -08:00
Leonardo de Moura
43c2169f78 fix: when performing contextual simplification, and arrow may become a dependent arrow
fixes #1024
2022-02-23 18:43:32 -08:00
Leonardo de Moura
49c64040a2 feat: add support for HEq at injections tactic 2022-02-23 17:31:17 -08:00
Leonardo de Moura
07d1ec1926 fix: simp_all was "self-simplifying" simplified hypotheses
fixes #1027
2022-02-23 16:48:28 -08:00
Leonardo de Moura
16b8800607 chore: fix tests 2022-02-23 16:30:27 -08:00
Leonardo de Moura
0125db40a2 fix: remove [..] annotation from if simp theorems
fixes #1025
2022-02-23 16:28:12 -08:00
Leonardo de Moura
52b53ab7a2 fix: heuristic for generating equation theorem types
closes #1026
2022-02-23 13:10:30 -08:00
Leonardo de Moura
1ac9c1263b test: add helper theorems 2022-02-23 11:52:03 -08:00
Leonardo de Moura
dbe9bf61c5 fix: unfold auxiliary theorems created by decreasing_tactic 2022-02-23 09:02:23 -08:00
Leonardo de Moura
52ff840321 feat: support for HEq at injection 2022-02-22 17:24:11 -08:00
Leonardo de Moura
c9f8ec71df fix: invalid rewrite when proving equation theorems for declaration using well-founded recursion 2022-02-22 16:38:51 -08:00
Leonardo de Moura
d36027d2fa test: add Certificate.of_combine_isUnsat 2022-02-22 16:04:23 -08:00
Leonardo de Moura
77fc0d3223 test: cleanup 2022-02-22 07:23:07 -08:00
Leonardo de Moura
c932d9d33c test: combine two inequalities 2022-02-21 15:13:37 -08:00
Leonardo de Moura
e9ee8ee86f test: add cancelation theorems for <= and < 2022-02-21 08:49:50 -08:00
Leonardo de Moura
0986696758 test: add cancelation example 2022-02-20 17:35:33 -08:00
Leonardo de Moura
a8427702e8 test: reverse direction for cancelation procedure 2022-02-20 17:03:11 -08:00
Leonardo de Moura
4ccab41819 test: proof by reflection example 2022-02-20 10:11:40 -08:00
Leonardo de Moura
cf0f7a30c4 test: add Monomials.cancel 2022-02-19 21:29:33 -08:00
Leonardo de Moura
855b71299f test: arith by reflection 2022-02-19 17:54:32 -08:00
Leonardo de Moura
7a81589c49 feat: improve "constant approximation" heuristic used at isDefEq 2022-02-19 08:09:31 -08:00
Leonardo de Moura
e61d0be561 feat: isolate fixed prefix at well-founded recursion
closes #1017
2022-02-18 10:40:32 -08:00
Leonardo de Moura
70312191f7 feat: make sure packDomain and packMutual ignore the fixed arguments
TODO: adapt `elabWFRel`, `mkFix`, and etc.

This is needed for #1017
2022-02-17 17:43:06 -08:00
Leonardo de Moura
9ee529e5ce fix: use PSum instead of Sum when using well-founded recursion
See new test for example that did not work with `Sum` because type
alpha was `Sort u`.
2022-02-17 16:14:34 -08:00
Leonardo de Moura
dedb6ee01b fix: skip value if type is computationally irrelevant 2022-02-17 10:41:16 -08:00
Xubai Wang
ca521e1188 feat: add position to mod doc 2022-02-16 13:50:19 -08:00
Leonardo de Moura
373a64ee09 test: for isNoncomputable 2022-02-16 13:37:49 -08:00
Leonardo de Moura
ad5099ec3c fix: mkLetRecClosureFor for nested let-recs
closes #1020
2022-02-16 12:44:02 -08:00
Leonardo de Moura
3f4d8f370a fix: backtrack InfoTree when backtracking at the discriminant refinement method
This commit addresses issue described at https://github.com/leanprover/lean4/issues/1018#issuecomment-1040597212

closes #1018
2022-02-15 16:01:09 -08:00
Leonardo de Moura
fd9165415e feat: try to preserve variable names during discriminant refinement
This fixes second issue at #1018
2022-02-15 15:54:03 -08:00
Leonardo de Moura
56cdacfc28 feat: allow synthetic holes to be used as patterns
They are useful for getting meaningful pattern variable names when the hole
is not an inaccessible pattern. See new test.

We are going to use this feature to address issue 2 at #1018.
2022-02-15 15:34:14 -08:00
Leonardo de Moura
df584567f5 feat: (generalizing := true) is the default behavior for match-expressions
closes #1018
2022-02-15 11:12:04 -08:00
Leonardo de Moura
d1e5e4166a feat: use sorry instead of trying to synthesize Inhabited at error recovery 2022-02-15 09:15:18 -08:00
Leonardo de Moura
f75fdcb19b feat: when Lean cannot prove termination, then report error and add definition as partial, and if it fails add as axiom 2022-02-15 07:44:27 -08:00
Leonardo de Moura
66e0b72c6f test: notation for providing names to equality proofs in match expressions is not whitespace sensitivity anymore 2022-02-14 15:51:23 -08:00
Leonardo de Moura
764a1d9f51 chore: fix tests 2022-02-14 15:47:12 -08:00
Leonardo de Moura
93b5b74b36 feat: modify notation for providing motive in "match" expressions 2022-02-14 15:36:14 -08:00
Leonardo de Moura
07043e73b0 chore: fix tests 2022-02-14 12:06:03 -08:00
Leonardo de Moura
aa63fda835 fix: mark auxiliary noConfusion declarations for enumeration types as [reducible]
closes #1016
2022-02-14 12:03:49 -08:00
Leonardo de Moura
82bce7ebec fix: declare local instaces occurring in patterns 2022-02-12 12:01:08 -08:00