Skip to content

Commit 6edcbb3

Browse files
committed
fix: unused arguments (#277)
1 parent fa4c522 commit 6edcbb3

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

Mathlib/Data/BinaryHeap.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def mkHeap (lt : α → α → Bool) (a : Array α) : {a' : Array α // a'.size
5151
⟨a₂, h₂.trans a'.2
5252
loop (a.size / 2) a (Nat.div_le_self ..)
5353

54-
@[simp] theorem size_mkHeap (lt : α → α → Bool) (a : Array α) (i : Fin a.size) :
54+
@[simp] theorem size_mkHeap (lt : α → α → Bool) (a : Array α) :
5555
(mkHeap lt a).1.size = a.size := (mkHeap lt a).2
5656

5757
/-- Core operation for binary heaps, expressed directly on arrays.

Mathlib/Data/List/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ theorem get_of_eq {L L' : List α} (h : L = L') (i : Fin L.length) :
649649
cases n
650650
subst hn0; rfl
651651

652-
theorem get_zero [Inhabited α] {L : List α} (h : 0 < L.length) : L.get ⟨0, h⟩ = L.head? := by
652+
theorem get_zero {L : List α} (h : 0 < L.length) : L.get ⟨0, h⟩ = L.head? := by
653653
cases L; {cases h}; simp
654654

655655
theorem get_append : ∀ {l₁ l₂ : List α} (n : ℕ) (h : n < l₁.length),
@@ -1241,12 +1241,12 @@ repeat' a (n - length l) ++ l
12411241
theorem leftpad_length (n : ℕ) (a : α) (l : List α) : (leftpad n a l).length = max n l.length :=
12421242
by simp only [leftpad, length_append, length_repeat', Nat.sub_add_eq_max]
12431243

1244-
theorem leftpad_prefix [DecidableEq α] (n : ℕ) (a : α) (l : List α) : isPrefix (repeat' a (n - length l)) (leftpad n a l) :=
1244+
theorem leftpad_prefix (n : ℕ) (a : α) (l : List α) : isPrefix (repeat' a (n - length l)) (leftpad n a l) :=
12451245
by
12461246
simp only [isPrefix, leftpad]
12471247
exact Exists.intro l rfl
12481248

1249-
theorem leftpad_suffix [DecidableEq α] (n : ℕ) (a : α) (l : List α) : isSuffix l (leftpad n a l) :=
1249+
theorem leftpad_suffix (n : ℕ) (a : α) (l : List α) : isSuffix l (leftpad n a l) :=
12501250
by
12511251
simp only [isSuffix, leftpad]
12521252
exact Exists.intro (repeat' a (n - length l)) rfl

Mathlib/Data/UnionFind.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def setParent {n} (m : UFModel n) (x y : Fin n) (h : m.rank x < m.rank y) : UFMo
3939
· exact m.rank_lt i
4040

4141
def setParentBump {n} (m : UFModel n) (x y : Fin n)
42-
(ne : x.1 ≠ y) (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
42+
(H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
4343
parent i := if x.1 = i then y else m.parent i
4444
rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
4545
rank_lt i := by
@@ -273,7 +273,7 @@ def link (self : UnionFind α) (x y : Fin self.size)
273273
case b =>
274274
let ⟨m, hm⟩ := self.model'; let n := self.size
275275
simp [hm.rank_eq] at h; simp [hm.parent_eq'] at yroot
276-
refine ⟨_, m.setParentBump x y ne h yroot, ?_⟩
276+
refine ⟨_, m.setParentBump x y h yroot, ?_⟩
277277
let parent (i : Fin n) := (if x.1 = i then y else m.parent i).1
278278
have : UFModel.Agrees arr₁ (·.parent) parent :=
279279
hm.1.set (fun i h => by simp; rw [if_neg h.symm]) (fun h => by simp)

Mathlib/Tactic/Core.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ def toPreDefinition (nm newNm : Name) (newType newValue : Expr) (newDoc : Option
5555
type := newType
5656
value := newValue }
5757
return predef
58+
5859
/-- Make `nm` protected. -/
59-
def setProtected {m : TypeType} [Monad m] [MonadEnv m] (nm : Name) : m Unit := do
60+
def setProtected {m : TypeType} [MonadEnv m] (nm : Name) : m Unit :=
6061
modifyEnv (addProtected · nm)
6162

6263
namespace Parser.Tactic

Mathlib/Testing/SlimCheck/Testable.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,14 +404,14 @@ section IO
404404
open TestResult
405405

406406
/-- Execute `cmd` and repeat every time the result is `gave_up` (at most `n` times). -/
407-
def retry (cmd : Rand (TestResult p)) (cfg : Configuration) : Nat → Rand (TestResult p)
407+
def retry (cmd : Rand (TestResult p)) : Nat → Rand (TestResult p)
408408
| 0 => pure $ TestResult.gaveUp 1
409409
| n+1 => do
410410
let r ← cmd
411411
match r with
412412
| success hp => pure $ success hp
413413
| TestResult.failure h xs n => pure $ failure h xs n
414-
| gaveUp _ => retry cmd cfg n
414+
| gaveUp _ => retry cmd n
415415

416416
/-- Count the number of times the test procedure gave up. -/
417417
def giveUp (x : Nat) : TestResult p → TestResult p
@@ -428,7 +428,7 @@ def Testable.runSuiteAux (p : Prop) [Testable p] (cfg : Configuration) : TestRes
428428
if cfg.traceSuccesses then
429429
slimTrace s!"New sample"
430430
slimTrace s!"Retrying up to {cfg.numRetries} times until guards hold"
431-
let x ← retry (ReaderT.run (Testable.runProp p cfg true) ⟨size⟩) cfg cfg.numRetries
431+
let x ← retry (ReaderT.run (Testable.runProp p cfg true) ⟨size⟩) cfg.numRetries
432432
match x with
433433
| (success (PSum.inl ())) => runSuiteAux p cfg r n
434434
| (gaveUp g) => runSuiteAux p cfg (giveUp g r) n

0 commit comments

Comments
 (0)