Skip to content

Commit ffeaffb

Browse files
committed
cleanups
1 parent 83f04b3 commit ffeaffb

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

src/Init/Data/Iterators/Lemmas/Consumers/Loop.lean

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ theorem Iter.forIn'_eq_match_step {α β : Type w} [Iterator α Id β]
107107
fun out h' acc => f out (.indirect ⟨_, rfl, h⟩ h') acc
108108
| .done _ => return init) := by
109109
simp only [forIn'_eq]
110-
rw [IterM.DefaultConsumers.forIn'_eq_match_step (fun _ _ _ => True) IteratorLoop.wellFounded_of_finite
111-
(f' := fun a b c => (⟨·, trivial⟩) <$> f a (Iter.isPlausibleIndirectOutput_iff_isPlausibleIndirectOutput_toIterM.mpr b) c)
110+
rw [IterM.DefaultConsumers.forIn'_eq_match_step (fun _ _ _ => True)
111+
IteratorLoop.wellFounded_of_finite
112+
(f' := fun a b c => (⟨·, trivial⟩) <$>
113+
f a (Iter.isPlausibleIndirectOutput_iff_isPlausibleIndirectOutput_toIterM.mpr b) c)
112114
(hf := by simp)]
113115
simp only [Iter.step]
114116
cases it.toIterM.step.run.inflate using PlausibleIterStep.casesOn
@@ -120,16 +122,20 @@ theorem Iter.forIn'_eq_match_step {α β : Type w} [Iterator α Id β]
120122
· simp only
121123
apply IterM.DefaultConsumers.forIn'_eq_forIn' (fun _ _ _ => True)
122124
IteratorLoop.wellFounded_of_finite
123-
(f' := fun a b c => (⟨·, trivial⟩) <$> f a (Iter.isPlausibleIndirectOutput_iff_isPlausibleIndirectOutput_toIterM.mpr b) c)
124-
(g' := fun a b c => (⟨·, trivial⟩) <$> f a (Iter.isPlausibleIndirectOutput_iff_isPlausibleIndirectOutput_toIterM.mpr (.indirect ⟨_, rfl, ‹_›⟩ b)) c)
125+
(f' := fun a b c => (⟨·, trivial⟩) <$>
126+
f a (Iter.isPlausibleIndirectOutput_iff_isPlausibleIndirectOutput_toIterM.mpr b) c)
127+
(g' := fun a b c => (⟨·, trivial⟩) <$>
128+
f a (Iter.isPlausibleIndirectOutput_iff_isPlausibleIndirectOutput_toIterM.mpr (.indirect ⟨_, rfl, ‹_›⟩ b)) c)
125129
· simp
126130
· simp
127131
· simp
128132
· simp only
129133
apply IterM.DefaultConsumers.forIn'_eq_forIn' (fun _ _ _ => True)
130134
IteratorLoop.wellFounded_of_finite
131-
(f' := fun a b c => (⟨·, trivial⟩) <$> f a (Iter.isPlausibleIndirectOutput_iff_isPlausibleIndirectOutput_toIterM.mpr b) c)
132-
(g' := fun a b c => (⟨·, trivial⟩) <$> f a (Iter.isPlausibleIndirectOutput_iff_isPlausibleIndirectOutput_toIterM.mpr (.indirect ⟨_, rfl, ‹_›⟩ b)) c)
135+
(f' := fun a b c => (⟨·, trivial⟩) <$>
136+
f a (Iter.isPlausibleIndirectOutput_iff_isPlausibleIndirectOutput_toIterM.mpr b) c)
137+
(g' := fun a b c => (⟨·, trivial⟩) <$>
138+
f a (Iter.isPlausibleIndirectOutput_iff_isPlausibleIndirectOutput_toIterM.mpr (.indirect ⟨_, rfl, ‹_›⟩ b)) c)
133139
· simp
134140
· simp
135141
· simp

src/Init/Data/Iterators/Lemmas/Consumers/Monadic/Loop.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public section
1515
namespace Std.Iterators
1616

1717
theorem IterM.DefaultConsumers.forIn'_eq_match_step {α β : Type w} {m : Type w → Type w'}
18-
[Iterator α m β]
19-
{n : Type x → Type x'} [Monad n] [LawfulMonad n]
18+
[Iterator α m β] {n : Type x → Type x'} [Monad n] [LawfulMonad n]
2019
{lift : ∀ γ δ, (γ → n δ) → m γ → n δ} {γ : Type x}
2120
{it : IterM (α := α) m β} {init : γ}
2221
{P hP} {f : (b : β) → P b → (c : γ) → n (ForInStep γ)}

src/Init/Data/Range/Polymorphic/RangeIterator.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ where finally
512512
refine ⟨1, ?_⟩
513513
simpa [succMany?_one] using hs
514514

515-
private theorem Iterator.instIteratorLoop.loop_eq_loopWf [UpwardEnumerable α] [LE α] [DecidableLE α]
515+
private theorem Iterator.instIteratorLoop.loop_eq_wf [UpwardEnumerable α] [LE α] [DecidableLE α]
516516
[LawfulUpwardEnumerable α] [LawfulUpwardEnumerableLE α] [Monad n] [LawfulMonad n]
517517
{γ LargeEnough hl upperBound} {next hn} {acc} (Pl wf f) :
518518
loop γ LargeEnough hl upperBound acc next hn (fun out h₁ h₂ acc => Subtype.val <$> f out h₁ h₂ acc) =
@@ -620,7 +620,7 @@ instance Iterator.instLawfulIteratorLoop [UpwardEnumerable α] [LE α] [Decidabl
620620
split; rotate_left
621621
· simp [Monadic.step_eq_step, Monadic.step, Internal.LawfulMonadLiftBindFunction.liftBind_pure]
622622
rename_i next _
623-
rw [instIteratorLoop.loop_eq_loopWf Pl wf, instIteratorLoop.loopWf_eq (lift := lift)]
623+
rw [instIteratorLoop.loop_eq_wf Pl wf, instIteratorLoop.loopWf_eq (lift := lift)]
624624
simp only [Monadic.step_eq_step, Monadic.step, instLawfulMonadLiftFunction.liftBind_pure,
625625
Shrink.inflate_deflate]
626626
split
@@ -1110,7 +1110,7 @@ where finally
11101110
refine ⟨1, ?_⟩
11111111
simpa [succMany?_one] using hs
11121112

1113-
private theorem Iterator.instIteratorLoop.loop_eq_loopWf [UpwardEnumerable α] [LT α] [DecidableLT α]
1113+
private theorem Iterator.instIteratorLoop.loop_eq_wf [UpwardEnumerable α] [LT α] [DecidableLT α]
11141114
[LawfulUpwardEnumerable α] [LawfulUpwardEnumerableLT α] [Monad n] [LawfulMonad n]
11151115
{γ LargeEnough hl upperBound} {next hn} {acc} (Pl wf f) :
11161116
loop γ LargeEnough hl upperBound acc next hn (fun out h₁ h₂ acc => Subtype.val <$> f out h₁ h₂ acc) =
@@ -1218,7 +1218,7 @@ instance Iterator.instLawfulIteratorLoop [UpwardEnumerable α] [LT α] [Decidabl
12181218
split; rotate_left
12191219
· simp [Monadic.step_eq_step, Monadic.step, Internal.LawfulMonadLiftBindFunction.liftBind_pure]
12201220
rename_i next _
1221-
rw [instIteratorLoop.loop_eq_loopWf Pl wf, instIteratorLoop.loopWf_eq (lift := lift)]
1221+
rw [instIteratorLoop.loop_eq_wf Pl wf, instIteratorLoop.loopWf_eq (lift := lift)]
12221222
simp only [Monadic.step_eq_step, Monadic.step, instLawfulMonadLiftFunction.liftBind_pure,
12231223
Shrink.inflate_deflate]
12241224
split
@@ -1614,7 +1614,7 @@ where finally
16141614
refine ⟨1, ?_⟩
16151615
simpa [succMany?_one] using hs
16161616

1617-
private theorem Iterator.instIteratorLoop.loop_eq_loopWf [UpwardEnumerable α]
1617+
private theorem Iterator.instIteratorLoop.loop_eq_wf [UpwardEnumerable α]
16181618
[LawfulUpwardEnumerable α] [Monad n] [LawfulMonad n]
16191619
{γ LargeEnough hl} {next hn} {acc} (Pl wf f) :
16201620
loop γ LargeEnough hl acc next hn (fun out h acc => Subtype.val <$> f out h acc) =
@@ -1707,7 +1707,7 @@ instance Iterator.instLawfulIteratorLoop [UpwardEnumerable α]
17071707
split; rotate_left
17081708
· simp [Monadic.step_eq_step, Monadic.step, Internal.LawfulMonadLiftBindFunction.liftBind_pure]
17091709
rename_i next _
1710-
rw [instIteratorLoop.loop_eq_loopWf Pl wf, instIteratorLoop.loopWf_eq (lift := lift)]
1710+
rw [instIteratorLoop.loop_eq_wf Pl wf, instIteratorLoop.loopWf_eq (lift := lift)]
17111711
simp only [Monadic.step_eq_step, Monadic.step, instLawfulMonadLiftFunction.liftBind_pure,
17121712
Shrink.inflate_deflate]
17131713
apply bind_congr; intro forInStep

src/Init/Internal/ExtrinsicTermination.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ public def TerminatesTotally₃
205205
/-
206206
SAFE assuming that the code generated by iteration over `F` is compatible
207207
with the kernel semantics of iteration over
208-
`F' : (a : α) → (b : β a) → ((a' : α) → (b' : β a') → C₂ a' b') → C a b`
209-
for all `F'` as in `TerminatesTotally`.
208+
`F' : ∀ a b c, (∀ a' b' c', C₃ a' b' c') → C a b c`
209+
for all `F'` as in `TerminatesTotally`.
210210
-/
211211
@[implemented_by opaqueFix₃]
212212
public def extrinsicFix₃ [∀ a b c, Nonempty (C₃ a b c)]

src/Lean/Elab/Tactic/BVDecide/LRAT/Trim.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ where
192192
| .del .. => go worklist
193193
| none => go worklist
194194

195-
set_option trace.compiler.ir.result true in
196195
/--
197196
Map the set of used proof steps to a new LRAT proof that has no holes in the sequence of proof
198197
identifiers.

0 commit comments

Comments
 (0)