Skip to content

Commit 5f791c9

Browse files
committed
chore: address Markus' comments
1 parent 8731535 commit 5f791c9

File tree

12 files changed

+155
-164
lines changed

12 files changed

+155
-164
lines changed

src/Std/Data/DTreeMap/Internal/Zipper.lean

Lines changed: 122 additions & 131 deletions
Large diffs are not rendered by default.

src/Std/Data/DTreeMap/Iterator.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public def valuesIter {α : Type u} {β : Type u} {cmp : α → α → Ordering}
6161
@Raw.valuesIter _ _ cmp ⟨m.inner⟩
6262

6363
@[simp]
64-
public theorem iter_toList {cmp : α → α → Ordering} (m : DTreeMap α β cmp) :
65-
m.iter.toList = m.toList := Raw.iter_toList ⟨m.inner⟩
64+
public theorem toList_iter {cmp : α → α → Ordering} (m : DTreeMap α β cmp) :
65+
m.iter.toList = m.toList := Raw.toList_iter ⟨m.inner⟩
6666

6767
@[simp]
6868
public theorem keysIter_toList {cmp : α → α → Ordering} (m : DTreeMap α β cmp) :

src/Std/Data/DTreeMap/Raw/Iterator.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,21 @@ public def valuesIter {α : Type u} {β : Type u}
6363
(m.iter.map fun e => e.2 : Iter β)
6464

6565
@[simp]
66-
public theorem iter_toList {cmp : α → α → Ordering} (m : Raw α β cmp) :
66+
public theorem toList_iter {cmp : α → α → Ordering} (m : Raw α β cmp) :
6767
(m.iter).toList = m.toList := by
6868
rw [iter, toList]
69-
apply Internal.Zipper.toList.iterOfTree
69+
apply Internal.Zipper.toList_iterOfTree
7070

7171
@[simp]
7272
public theorem keysIter_toList {cmp : α → α → Ordering} (m : Raw α β cmp) :
7373
(m.keysIter).toList = m.keys := by
7474
rw [keysIter, keys, iter, ← Internal.Impl.map_fst_toList_eq_keys]
75-
apply Internal.Zipper.map_iterOfTree_eq_tree_toList_map
75+
rw [Iter.toList_map, Internal.Zipper.toList_iterOfTree]
7676

7777
@[simp]
7878
public theorem valuesIter_toList {cmp : α → α → Ordering} (m : Raw α (fun _ => β) cmp) :
7979
(m.valuesIter).toList = m.values := by
8080
rw [valuesIter, values, iter, Internal.Impl.values_eq_map_snd, ← Internal.Impl.toList_eq_toListModel]
81-
apply Internal.Zipper.map_iterOfTree_eq_tree_toList_map
81+
rw [Iter.toList_map, Internal.Zipper.toList_iterOfTree]
8282

8383
end Std.DTreeMap.Raw

src/Std/Data/DTreeMap/Slice.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public instance {α : Type u} {β : α → Type v} (cmp : α → α → Ordering
8282

8383
@[simp] public theorem toList_roi {α : Type u} {β : α → Type v}
8484
(cmp : α → α → Ordering := by exact compare) [TransCmp cmp]
85-
{t : DTreeMap α β cmp} {bound : α} :t[bound<...*].toList =
85+
{t : DTreeMap α β cmp} {bound : α} : t[bound<...*].toList =
8686
t.toList.filter (fun e => (cmp e.fst bound).isGT) :=
8787
@Internal.toList_roi α β ⟨cmp⟩ _ t.inner (@t.wf.ordered α β ⟨cmp⟩ _) bound
8888

src/Std/Data/TreeMap/Iterator.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public def valuesIter {α : Type u} {β : Type u} {cmp : α → α → Ordering}
6363
m.inner.valuesIter
6464

6565
@[simp]
66-
public theorem iter_toList {cmp : α → α → Ordering} (m : TreeMap α β cmp) :
66+
public theorem toList_iter {cmp : α → α → Ordering} (m : TreeMap α β cmp) :
6767
m.iter.toList = m.toList := by
68-
simp only [iter, Iter.toList_map, DTreeMap.iter_toList, DTreeMap.toList,
68+
simp only [iter, Iter.toList_map, DTreeMap.toList_iter, DTreeMap.toList,
6969
DTreeMap.Internal.Impl.toList_eq_toListModel, toList, DTreeMap.Const.toList,
7070
DTreeMap.Internal.Impl.Const.toList_eq_toListModel_map]
7171

src/Std/Data/TreeMap/Raw/Iterator.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public def valuesIter {α : Type u} {β : Type u}
6363
(m.inner.valuesIter : Iter β)
6464

6565
@[simp]
66-
public theorem iter_toList {α : Type u} {β : Type v} {cmp : α → α → Ordering} (m : Raw α β cmp) :
66+
public theorem toList_iter {α : Type u} {β : Type v} {cmp : α → α → Ordering} (m : Raw α β cmp) :
6767
(m.iter.toList) = m.toList := by
68-
simp only [iter, Iter.toList_map, DTreeMap.Raw.iter_toList]
68+
simp only [iter, Iter.toList_map, DTreeMap.Raw.toList_iter]
6969
simp only [DTreeMap.Raw.toList, DTreeMap.Internal.Impl.toList_eq_toListModel, toList,
7070
DTreeMap.Raw.Const.toList, DTreeMap.Internal.Impl.Const.toList_eq_toListModel_map]
7171

src/Std/Data/TreeMap/Raw/Slice.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public theorem toList_ric {α : Type u} {β : Type v} (cmp : α → α → Order
3535
[TransCmp cmp] {t : Raw α β cmp} {wf : t.WF} {bound : α} :
3636
t[*...=bound].toList = t.toList.filter (fun e => (cmp e.fst bound).isLE) := by
3737
apply @DTreeMap.Internal.Const.toList_ric _ _ ⟨cmp⟩ _ _
38-
. exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
38+
· exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
3939

4040
public instance {α : Type u} {β : Type v} (cmp : α → α → Ordering := by exact compare) :
4141
Rio.Sliceable (Raw α β cmp) α (@DTreeMap.Internal.Const.RioSlice α β ⟨cmp⟩) :=
@@ -45,7 +45,7 @@ public theorem toList_rio {α : Type u} {β : Type v} (cmp : α → α → Order
4545
[TransCmp cmp] {t : Raw α β cmp} {wf : t.WF} {bound : α} :
4646
t[*...<bound].toList = t.toList.filter (fun e => (cmp e.fst bound).isLT) := by
4747
apply @DTreeMap.Internal.Const.toList_rio _ _ ⟨cmp⟩ _ _
48-
. exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
48+
· exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
4949

5050
public instance {α : Type u} {β : Type v} (cmp : α → α → Ordering := by exact compare) :
5151
Rci.Sliceable (Raw α β cmp) α (@DTreeMap.Internal.Const.RciSlice α β ⟨cmp⟩) :=
@@ -55,7 +55,7 @@ public theorem toList_rci {α : Type u} {β : Type v} (cmp : α → α → Order
5555
[TransCmp cmp] {t : Raw α β cmp} {wf : t.WF} {bound : α} :
5656
t[bound...*].toList = t.toList.filter (fun e => (cmp e.fst bound).isGE) := by
5757
apply @DTreeMap.Internal.Const.toList_rci _ _ ⟨cmp⟩ _ _
58-
. exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
58+
· exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
5959

6060
public instance {α : Type u} {β : Type v} (cmp : α → α → Ordering := by exact compare) :
6161
Rco.Sliceable (Raw α β cmp) α (@DTreeMap.Internal.Const.RcoSlice α β ⟨cmp⟩) :=
@@ -66,7 +66,7 @@ public theorem toList_rco {α : Type u} {β : Type v} (cmp : α → α → Order
6666
t[lowerBound...<upperBound].toList =
6767
t.toList.filter (fun e => (cmp e.fst lowerBound).isGE ∧ (cmp e.fst upperBound).isLT) := by
6868
apply @DTreeMap.Internal.Const.toList_rco _ _ ⟨cmp⟩ _ _
69-
. exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
69+
· exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
7070

7171
public instance {α : Type u} {β : Type v} (cmp : α → α → Ordering := by exact compare) :
7272
Rcc.Sliceable (Raw α β cmp) α (@DTreeMap.Internal.Const.RccSlice α β ⟨cmp⟩) :=
@@ -77,7 +77,7 @@ public theorem toList_rcc {α : Type u} {β : Type v} (cmp : α → α → Order
7777
t[lowerBound...=upperBound].toList =
7878
t.toList.filter (fun e => (cmp e.fst lowerBound).isGE ∧ (cmp e.fst upperBound).isLE) := by
7979
apply @DTreeMap.Internal.Const.toList_rcc _ _ ⟨cmp⟩ _ _
80-
. exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
80+
· exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
8181

8282
public instance {α : Type u} {β : Type v} (cmp : α → α → Ordering := by exact compare) :
8383
Roi.Sliceable (Raw α β cmp) α (@DTreeMap.Internal.Const.RoiSlice α β ⟨cmp⟩) :=
@@ -87,7 +87,7 @@ public theorem toList_roi {α : Type u} {β : Type v} (cmp : α → α → Order
8787
[TransCmp cmp] {t : Raw α β cmp} {wf : t.WF} {bound: α} : t[bound<...*].toList =
8888
t.toList.filter (fun e => (cmp e.fst bound).isGT) := by
8989
apply @DTreeMap.Internal.Const.toList_roi _ _ ⟨cmp⟩ _
90-
. exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
90+
· exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
9191

9292
public instance {α : Type u} {β : Type v} (cmp : α → α → Ordering := by exact compare) :
9393
Roc.Sliceable (Raw α β cmp) α (@DTreeMap.Internal.Const.RocSlice α β ⟨cmp⟩) :=
@@ -98,7 +98,7 @@ public theorem toList_roc {α : Type u} {β : Type v} (cmp : α → α → Order
9898
t[lowerBound<...=upperBound].toList =
9999
t.toList.filter (fun e => (cmp e.fst lowerBound).isGT ∧ (cmp e.fst upperBound).isLE) := by
100100
apply @DTreeMap.Internal.Const.toList_roc _ _ ⟨cmp⟩ _
101-
. exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
101+
· exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
102102

103103
public instance {α : Type u} {β : Type v} (cmp : α → α → Ordering := by exact compare) :
104104
Roo.Sliceable (Raw α β cmp) α (@DTreeMap.Internal.Const.RooSlice α β ⟨cmp⟩) :=
@@ -109,6 +109,6 @@ public theorem toList_roo {α : Type u} {β : Type v} (cmp : α → α → Order
109109
t[lowerBound<...upperBound].toList =
110110
t.toList.filter (fun e => (cmp e.fst lowerBound).isGT ∧ (cmp e.fst upperBound).isLT) := by
111111
apply @DTreeMap.Internal.Const.toList_roo _ _ ⟨cmp⟩ _
112-
. exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
112+
· exact @wf.out.out.ordered _ _ ⟨cmp⟩ _
113113

114114
end Std.TreeMap.Raw

src/Std/Data/TreeMap/Slice.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public instance {α : Type u} {β : Type v} (cmp : α → α → Ordering := by
8383

8484
@[simp] public theorem toList_roi {α : Type u} {β : Type v}
8585
(cmp : α → α → Ordering := by exact compare) [TransCmp cmp]
86-
{t : TreeMap α β cmp} {bound : α} :t[bound<...*].toList =
86+
{t : TreeMap α β cmp} {bound : α} : t[bound<...*].toList =
8787
t.toList.filter (fun e => (cmp e.fst bound).isGT) :=
8888
@DTreeMap.Internal.Const.toList_roi α β ⟨cmp⟩ _ t.inner.inner (@t.inner.wf.ordered α (fun _ => β) ⟨cmp⟩ _) bound
8989

src/Std/Data/TreeSet/Iterator.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public def iter {α : Type u}
3232
(m.inner.iter.map fun e => e.1 : Iter α)
3333

3434
@[simp]
35-
public theorem iter_toList {cmp : α → α → Ordering} (m : TreeSet α cmp) :
35+
public theorem toList_iter {cmp : α → α → Ordering} (m : TreeSet α cmp) :
3636
m.iter.toList = m.toList := by
37-
rw [iter, Iter.toList_map, TreeMap.iter_toList, toList, TreeMap.toList, TreeMap.keys, Std.DTreeMap.Const.map_fst_toList_eq_keys]
37+
rw [iter, Iter.toList_map, TreeMap.toList_iter, toList, TreeMap.toList, TreeMap.keys, Std.DTreeMap.Const.map_fst_toList_eq_keys]
3838

3939
end Std.TreeSet

src/Std/Data/TreeSet/Raw/Iterator.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public def iter {α : Type u}
3232
(m.inner.iter.map fun e => e.1 : Iter α)
3333

3434
@[simp]
35-
public theorem iter_toList {cmp : α → α → Ordering} (m : Raw α cmp) :
35+
public theorem toList_iter {cmp : α → α → Ordering} (m : Raw α cmp) :
3636
m.iter.toList = m.toList := by
37-
rw [iter, Iter.toList_map, TreeMap.Raw.iter_toList, TreeMap.Raw.toList]
37+
rw [iter, Iter.toList_map, TreeMap.Raw.toList_iter, TreeMap.Raw.toList]
3838
rw [TreeSet.Raw.toList]
3939
rw [Std.DTreeMap.Internal.Impl.foldr_eq_foldr_toList]
4040
simp only [DTreeMap.Raw.Const.map_fst_toList_eq_keys, List.empty_eq, List.foldr_cons_eq_append,

0 commit comments

Comments
 (0)