-
Notifications
You must be signed in to change notification settings - Fork 141
feat: Add Array.scan{l,r,lM,rM} #1589
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
Changes from 69 commits
8c0277f
1bc0061
2bab1b2
e449b1d
0f02ec2
883cf13
1433ecb
dd015f6
5687b0c
3a16ca1
b48bc64
fd7e218
4503c35
ba7db05
f6cf53e
67d7e93
d912d0f
e839054
daccff9
dd98786
1bbec43
db9d551
e3521d6
89305f1
95633a6
7edf5b7
8bcc79d
7c7da5d
4d195f2
191ca86
80f14bc
e048788
98bb5ab
9ed1f16
128f5b9
11b7ec3
878baac
6c83c0c
1e6813d
6fcaca6
00325a8
35a9fc0
2c28ac4
9753b95
42544d8
c0e02a2
be12368
83318fa
8876c24
b283d6b
027e85d
5248e55
c8645eb
de51a6e
dc661af
d7487bf
bf7ab54
472ec6d
1f0fdf5
4f1c05b
c4f611b
5f4465c
7c88448
adfe908
6e96f0a
d77c298
0a93369
7d2329b
044b170
f86a688
3d8b8ed
7e344f6
845c803
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -41,6 +41,10 @@ theorem idxOf?_toList [BEq α] {a : α} {l : Array α} : | |||||||
| (a.eraseIdxIfInBounds i).size = if i < a.size then a.size-1 else a.size := by | ||||||||
| grind | ||||||||
|
|
||||||||
| theorem toList_drop (as: Array α) (n : Nat) : | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
to match
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't work as a simp lemma because simp simplifies '(as.drop n).toList' to 'List.take (as.size - n) (List.drop n as.toList)`
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fwiw I think this is very frustrating. Array.drop is automatically simplified to Array.extract. This over-eager simplification is why I wanted a toList_drop method to begin with.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are way too many simp lemmas for my taste. Eric is very fond of them though and I respect his opinion. We (in general, including Eric and I) need a common language to talk about simp-normal-form. The Mathlib/Batteries concerns are a bit different.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for starting the Zulip thread; indeed this can't be
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we resolve this or are we hoping to fix the simp issues upstream? |
||||||||
| (as.drop n).toList = as.toList.drop n := by | ||||||||
| simp only [drop, toList_extract, size_eq_length_toList, List.drop_eq_extract] | ||||||||
|
|
||||||||
| /-! ### set -/ | ||||||||
|
|
||||||||
| theorem size_set! (a : Array α) (i v) : (a.set! i v).size = a.size := by simp | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.