diff --git a/HumanEvalLean/HumanEval139.lean b/HumanEvalLean/HumanEval139.lean index e96b839..c0eebdb 100644 --- a/HumanEvalLean/HumanEval139.lean +++ b/HumanEvalLean/HumanEval139.lean @@ -46,8 +46,6 @@ theorem special_factorial_func_correct {n : Nat} : fun_induction special_factorial.go with | case1 fact brazil_fact curr h => rw [h₂] - unfold special_factorial.go - simp [h] have : curr = n := by omega rw [this] | case2 fact brazilFact curr h fact' brazilFact' ih => @@ -55,8 +53,7 @@ theorem special_factorial_func_correct {n : Nat} : simp only [h₁, Nat.succ_eq_add_one, Nat.factorial_succ, h₂, Nat.brazilianFactorial_succ, Nat.succ_le_of_lt h, forall_const, fact', brazilFact'] at ih have : ¬ curr >= n := by omega - unfold special_factorial.go - simp [this, h₁, h₂, ih] + grind theorem test1 : special_factorial 4 = 288 := by native_decide theorem test2 : special_factorial 5 = 34560 := by native_decide diff --git a/HumanEvalLean/HumanEval24.lean b/HumanEvalLean/HumanEval24.lean index b82886a..cab7929 100644 --- a/HumanEvalLean/HumanEval24.lean +++ b/HumanEvalLean/HumanEval24.lean @@ -31,21 +31,12 @@ theorem largestDivisorSpec_go {n i : Nat} (hi : 2 ≤ i) (hi' : ∀ j, 2 ≤ j → j < i → n % j ≠ 0) : LargestDivisorSpec n (largestDivisor.go n i) := by fun_induction largestDivisor.go n i case case1 i hni => - rw [largestDivisor.go, dif_pos hni] - apply LargestDivisorSpec.one - intro j hj hj' - apply hi' _ hj - exact Nat.mul_self_lt_mul_self_iff.1 (Nat.lt_of_le_of_lt hj' hni) + have := @Nat.mul_self_lt_mul_self_iff i + grind [LargestDivisorSpec.one] case case2 i hni hni' => - rw [largestDivisor.go, dif_neg hni, if_pos hni'] - exact LargestDivisorSpec.div hi' hi hni' + grind [LargestDivisorSpec.div] case case3 i hni hni' ih => - rw [largestDivisor.go, dif_neg hni, if_neg hni'] - apply ih (by omega) - intro j hj hij - by_cases hij' : j = i - · exact hij' ▸ hni' - · exact hi' _ hj (by omega) + grind theorem largestDivisorSpec_largestDivisor {n : Nat} : LargestDivisorSpec n (largestDivisor n) := by diff --git a/lean-toolchain b/lean-toolchain index 78adacd..4b945b4 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.20.1 +leanprover/lean4:nightly-2025-06-25