Skip to content

Commit e253d16

Browse files
committed
fix: not_prime_zero and not_prime_one Aesop rules (#22394)
These rules, which derive a contradiction from `Prime 0` or `Prime 1`, were tagged incorrectly and would therefore add `¬ Prime 0` and `¬ Prime 1` to every goal. Fixes the heartbeat bump introduced in #22334.
1 parent 0582f0d commit e253d16

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

Mathlib/Data/Nat/Prime/Defs.lean

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,24 @@ def Prime (p : ℕ) :=
4343
theorem irreducible_iff_nat_prime (a : ℕ) : Irreducible a ↔ Nat.Prime a :=
4444
Iff.rfl
4545

46-
@[aesop safe destruct] theorem not_prime_zero : ¬Prime 0
46+
theorem not_prime_zero : ¬ Prime 0
4747
| h => h.ne_zero rfl
4848

49-
@[aesop safe destruct] theorem not_prime_one : ¬Prime 1
49+
/-- A copy of `not_prime_zero` stated in a way that works for `aesop`.
50+
51+
See https://github.com/leanprover-community/aesop/issues/197 for an explanation. -/
52+
@[aesop safe destruct] theorem prime_zero_false : Prime 0 → False :=
53+
not_prime_zero
54+
55+
theorem not_prime_one : ¬ Prime 1
5056
| h => h.ne_one rfl
5157

58+
/-- A copy of `not_prime_one` stated in a way that works for `aesop`.
59+
60+
See https://github.com/leanprover-community/aesop/issues/197 for an explanation. -/
61+
@[aesop safe destruct] theorem prime_one_false : Prime 1 → False :=
62+
not_prime_one
63+
5264
theorem Prime.ne_zero {n : ℕ} (h : Prime n) : n ≠ 0 :=
5365
Irreducible.ne_zero h
5466

Mathlib/Probability/Kernel/Proper.lean

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@ private lemma IsProper.lintegral_indicator_mul_indicator (hπ : IsProper π) (h
8989
Pi.one_apply, one_mul]
9090
rw [← hπ.inter_eq_indicator_mul h𝓑𝓧 hA hB, inter_comm]
9191

92-
#adaptation_note
93-
/--
94-
The `by measurability` argument of `lintegral_iSup` became slower after
95-
https://github.com/leanprover-community/aesop/pull/199 was merged,
96-
resulting in this declaration now requiring a larger `maxHeartbeats` limit.
97-
-/
98-
set_option maxHeartbeats 400000 in
9992
set_option linter.style.multiGoal false in -- false positive
10093
/-- Auxiliary lemma for `IsProper.lintegral_mul` and
10194
`IsProper.setLIntegral_eq_indicator_mul_lintegral`. -/

0 commit comments

Comments
 (0)