Skip to content

Commit 6a18185

Browse files
committed
golf further
1 parent ad33bd5 commit 6a18185

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Mathlib/NumberTheory/LucasLehmer.lean

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,13 +636,7 @@ theorem sModNat_eq_sMod (p k : ℕ) (hp : 2 ≤ p) : (sModNat (2 ^ p - 1) k :
636636
4 = 2 ^ 2 := by simp
637637
_ ≤ 2 ^ p := Nat.pow_le_pow_right (by simp) hp
638638
have h2 : 12 ^ p := by lia
639-
induction k with
640-
| zero =>
641-
rw [sModNat, sMod, Int.natCast_emod]
642-
simp [h2]
643-
| succ k ih =>
644-
rw [sModNat, sMod, ← ih]
645-
grind [Int.emod_eq_emod_iff_emod_sub_eq_zero, Int.add_emod, Int.emod_eq_add_self_emod]
639+
induction k with grind [sModNat, sMod, Int.add_emod, Int.emod_eq_add_self_emod]
646640

647641
/-- Tail-recursive version of `sModNat`. -/
648642
meta def sModNatTR (q k : ℕ) : ℕ :=

0 commit comments

Comments
 (0)