Commit 57e2391 1 parent 14e626a commit 57e2391 Copy full SHA for 57e2391
File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -328,8 +328,9 @@ unsafe def anyMUnsafe {α : Type u} {m : Type → Type w} [Monad m] (p : α →
328
328
else
329
329
any (i+1 ) stop
330
330
if start < stop then
331
- if stop ≤ as.size then
332
- any (USize.ofNat start) (USize.ofNat stop )
331
+ let stop ' := min stop as.size
332
+ if start < stop ' then
333
+ any (USize.ofNat start) (USize.ofNat stop ')
333
334
else
334
335
pure false
335
336
else
Original file line number Diff line number Diff line change
1
+ @[simp] theorem Array.size_singleton : #[a].size = 1 := rfl
2
+ @[simp] theorem USize.not_size_le_one : ¬ USize.size ≤ 1 := by cases usize_size_eq <;> simp_all
3
+
4
+ def f := #[true ].any id 0 USize.size
5
+
6
+ -- `native_decide` used to prove `false` here, due to a bug in `Array.anyMUnsafe`.
7
+ example : f = true := by native_decide
8
+
9
+ example : f = true := by simp [f, Array.any, Array.anyM]
You can’t perform that action at this time.
0 commit comments