forked from leanprover/lean4
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
div proofs for bitblaster #7
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In Lake's `tests/serve`, save server log to a file and give it a timeout (one smaller than CMake's).
…kward theorem (leanprover#4345) closes leanprover#4290
The main purpose here is to add `Char.ofUInt8`, so I can delete the semantically suspect `UInt8.toLower` etc in Mathlib.
Stores the dependency trace for a build in the cached build log and then verifies that it matches the trace of the current build before replaying the log. Includes test. Closes leanprover#4303.
The current manner of lifting `LogIO` into `CliM` produces excessive specializations (due to a nested inlined `forM`). There was also a bug where `IO` was lifted into `CliM` via `LogIO` rather than directly through `MainM`.
…goals (leanprover#4349) Remark: when splitting an `if-then-else` term, the subgoals now have tags `isTrue` and `isFalse` instead of `inl` and `inr`. closes leanprover#4313 --------- Co-authored-by: Mario Carneiro <di.gama@gmail.com>
The key idea is to notice that `signExtend` behavior is controlled by the `msb`. When `msb = false`, `sext` behaves the same as `trunc`. When `msb = true`, `sext` behaves like `trunc` but adds high 1-bits. This is expressed using the negate-truncate-negate pattern. Lemma statements below: ```lean theorem signExtend_eq_neg_truncate_neg_of_msb_false {x : BitVec w} {v : Nat} (hmsb : x.msb = false) : (x.signExtend v) = x.truncate v := by theorem signExtend_eq_neg_truncate_neg_of_msb_true {x : BitVec w} {v : Nat} (hmsb : x.msb = true) : (x.signExtend v) = ~~~((~~~x).truncate v) := by ``` These give the final theorem statement: ```lean theorem getLsb_signExtend {x : BitVec w} {v i : Nat} : (x.signExtend v).getLsb i = (decide (i < v) && if i < w then x.getLsb i else x.msb) := by ``` --------- Co-authored-by: Tobias Grosser <github@grosser.es> Co-authored-by: Alex Keizer <alex@keizer.dev> Co-authored-by: Kim Morrison <scott@tqft.net>
…ver#4327) types like ``` inductive Many (α : Type u) where | none : Many α | more : α → (Unit → Many α) → Many α ``` have a `.brecOn` only supports motives producing `Type u`, but not `Sort u`, but our induction principles produce `Prop`. So the previous implementation of functional induction would fail for functions that structurally recurse over such types. We recognize this case now and, rather hazardously, replace `.brecOn` with `.binductionOn` (and thus `.below ` with `.ibelow` and `PProd` with `And`). This assumes that these definitions are highly analogous. This also improves the error message when realizing a reserved name fails with an exception, by prepending ``` Failed to realize constant {id}: ``` to the error message. Fixes leanprover#4320
this is an amendment to leanprover#4177, after @kmill pointed out an issue: Users might expect that within a tactic combinator like `first`, `simp [h]` fails if `h` does not exist. Therefore the behavior introduced in PR leanprover#4177, which is really most useful in mormal interactive use of `skip`, is restricted to when `recover := true`.
PR leanprover#4333 added a call to `lake`, but that needs elan installed
so that the pretty-printed origin is clickable, and avoid the unnecessary `@`. Particularly nice is this fix: ```diff /-- -info: [Meta.Tactic.simp.discharge] @bar discharge ✅ +info: [Meta.Tactic.simp.discharge] bar discharge ✅ autoParam T _auto✝ - [Meta.Tactic.simp.rewrite] { }:1000, T ==> True -[Meta.Tactic.simp.rewrite] @bar:1000, U ==> True + [Meta.Tactic.simp.rewrite] T.mk:1000, T ==> True +[Meta.Tactic.simp.rewrite] bar:1000, U ==> True -/ ```
…n theorem`, `theorem foo.bar`, `lemma` (leanprover#4364) See Note [Incremental Macros] for the caveat on correct `withRef` use
Adds the path to build log to the warning for a missing/invalid build log to help with debugging.
chore: `toFin_ofNat`
This `@[inline]` causes Lean to respecialize `RBMap.find?` to `NameMap` at each call site of `NameMap.find?`, creating lots of unnecessary duplicate IR.
Very minor, but progress towards deleting a downstream file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CC @hargoniX , this is WIP. Proof sketch:
reduce to
toInt
, show that in the integer case, the existence and uniqueness holds byomega
.Key step is to deduce that because of the sign extension to width
2*w
, the modulus does not interfere, and our equalities hold directly as integer equalities.