Closed AtticusKuhn closed 2 months ago
Alive Statistics: 64 / 93 (29 failed)
Unfortunately, I don't believe lemma1
. Proof of disbelief:
axiom lemma1 {w n : Nat} {x : BitVec w} :
(-x).getLsb (n + 1 + 1) = (x.getLsb (n + 1 + 1) != (-x).getLsb (n + 1))
open BitVec in
theorem contra : (-(1#2)).getLsb 2 =
((1#2).getLsb 2 != (-(1#2)).getLsb 1) :=
lemma1
theorem exploison : False := by
have := contra
simp at this
/-- info: 'exploison' depends on axioms: [propext, lemma1, Quot.sound, Classical.choice] -/
#guard_msgs in #print axioms exploison
That is a good catch @bollu . I did not see that before. I have refined these three lemmas so that proving my goal can be reduced to proving:
lemma lemma1 (h : n + 1 < w) : (-x).getLsb (n + 1) = decide (x.getLsb (n + 1) = !(-x).getLsb n) := by
sorry
lemma lemma2 (h : n + 1 < w) (c : x.getLsb n) : (-x).getLsb (n + 1) = !x.getLsb (n + 1) := by
sorry
lemma lemma3 : (2 ^ w - x.toNat) % 2 ^ w / 2 % 2 = 1 ↔ (x.toNat / 2 % 2 = 1 ↔ ¬x.toNat % 2 = 1) := by
sorry
And this time, I have written a script to check all small examples on lemma1, so I am confident that there will at least not be any obvious counter-examples to lemma1.
Actually, I have managed to make further simplifications, and now I am only required to prove
lemma lemma7 {w t : Nat} (a : 0 < w) (h : t < 2 ^ w) : (2 ^ w - 1 - t + 1) % 2 = 1 ↔ t % 2 = 1 := by
sorry
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
@AtticusKuhn here you go:
theorem lemma7 (w : Nat) (hw : w > 0) (t : Nat) (h : t < 2 ^ w) : (2 ^ w - 1 - t + 1) % 2 = 1 ↔ t % 2 = 1 := by
rcases w with rfl | w
· simp at hw
· omega
Thanks to the help froim Sid and Henrik, I have now removed one sorry (which was for neg).
Is this something that can already pulled out and be reviewed separately? Let's try to keep our prs small.
Alive Statistics: 64 / 93 (29 failed)
Is this something that can already pulled out and be reviewed separately? Let's try to keep our prs small.
Got it. I will only solve the case of "neg" in this PR and solve the other two cases in another PR.
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
I have removed the sorry in the case of "neg". I now think this PR is ready for review.
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
@AtticusKuhn I took the liberty of renaming your PR: it's generally best to describe the actual result you've proven, instead of saying you've removed a sorry from a file. The former requires the reader to have remembered less context to understand what the PR does!
In the PR description, then, you can mention that this result closes one of the open sorries
in that particular file
Thank you Alex for your feedback.
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Thank you for your feedback.
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
I have now made all the changes from Sid's, Alex's, and William's review. I think this PR is ready to be merged now. (I know there are some unrelated changes in the git diff, they were already merged in https://github.com/opencompl/lean-mlir/pull/533 but I don't know how to mkake these changes disappear from the git diff)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Thanks for your feedback. I have changed some "simp only"s to "simp"s in the case where it is in the terminal position.
Alive Statistics: 64 / 93 (29 failed)
I now think this PR is ready to be merged.
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
Alive Statistics: 64 / 93 (29 failed)
There are currently three sorries in SSA/Experimental/Bits/Fast/BitStream.Lean.
In this current PR, I only remove the sorry from "neg" to keep each PR small and atomic.