Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 3348bed

Browse files
committed
chore(tactic/linarith): remove unneeded code (#16791)
Removes some unneeded lemmas (and consequently unneeded imports) in `tactic/linarith/lemmas.lean`, in preparation for porting. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 476f28f commit 3348bed

File tree

3 files changed

+1
-32
lines changed

3 files changed

+1
-32
lines changed

src/algebra/order/ring.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ end
14901490

14911491
end mul_zero_class
14921492

1493-
/-- `nontrivial α` is needed here as otherwise we have `1 * ⊤ = ⊤` but also `= 0 * ⊤ = 0`. -/
1493+
/-- `nontrivial α` is needed here as otherwise we have `1 * ⊤ = ⊤` but also `0 * ⊤ = 0`. -/
14941494
instance [mul_zero_one_class α] [nontrivial α] : mul_zero_one_class (with_top α) :=
14951495
{ mul := (*),
14961496
one := 1,

src/data/int/basic.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jeremy Avigad
55
-/
66
import data.nat.pow
7-
import order.min_max
87
import data.nat.cast
98
import algebra.ring.regular
109

src/tactic/linarith/lemmas.lean

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ Authors: Robert Y. Lewis
55
-/
66

77
import algebra.order.ring
8-
import data.int.basic
9-
import tactic.norm_num
108

119
/-!
1210
# Lemmas for `linarith`
@@ -17,33 +15,6 @@ If you find yourself looking for a theorem here, you might be in the wrong place
1715

1816
namespace linarith
1917

20-
lemma int.coe_nat_bit0 (n : ℕ) : (↑(bit0 n : ℕ) : ℤ) = bit0 (↑n : ℤ) := by simp [bit0]
21-
lemma int.coe_nat_bit1 (n : ℕ) : (↑(bit1 n : ℕ) : ℤ) = bit1 (↑n : ℤ) := by simp [bit1, bit0]
22-
lemma int.coe_nat_bit0_mul (n : ℕ) (x : ℕ) : (↑(bit0 n * x) : ℤ) = (↑(bit0 n) : ℤ) * (↑x : ℤ) :=
23-
by simp
24-
lemma int.coe_nat_bit1_mul (n : ℕ) (x : ℕ) : (↑(bit1 n * x) : ℤ) = (↑(bit1 n) : ℤ) * (↑x : ℤ) :=
25-
by simp
26-
lemma int.coe_nat_one_mul (x : ℕ) : (↑(1 * x) : ℤ) = 1 * (↑x : ℤ) := by simp
27-
lemma int.coe_nat_zero_mul (x : ℕ) : (↑(0 * x) : ℤ) = 0 * (↑x : ℤ) := by simp
28-
lemma int.coe_nat_mul_bit0 (n : ℕ) (x : ℕ) : (↑(x * bit0 n) : ℤ) = (↑x : ℤ) * (↑(bit0 n) : ℤ) :=
29-
by simp
30-
lemma int.coe_nat_mul_bit1 (n : ℕ) (x : ℕ) : (↑(x * bit1 n) : ℤ) = (↑x : ℤ) * (↑(bit1 n) : ℤ) :=
31-
by simp
32-
lemma int.coe_nat_mul_one (x : ℕ) : (↑(x * 1) : ℤ) = (↑x : ℤ) * 1 := by simp
33-
lemma int.coe_nat_mul_zero (x : ℕ) : (↑(x * 0) : ℤ) = (↑x : ℤ) * 0 := by simp
34-
35-
lemma nat_eq_subst {n1 n2 : ℕ} {z1 z2 : ℤ} (hn : n1 = n2) (h1 : ↑n1 = z1) (h2 : ↑n2 = z2) :
36-
z1 = z2 :=
37-
by simpa [eq.symm h1, eq.symm h2, int.coe_nat_eq_coe_nat_iff]
38-
39-
lemma nat_le_subst {n1 n2 : ℕ} {z1 z2 : ℤ} (hn : n1 ≤ n2) (h1 : ↑n1 = z1) (h2 : ↑n2 = z2) :
40-
z1 ≤ z2 :=
41-
by simpa [eq.symm h1, eq.symm h2, int.coe_nat_le]
42-
43-
lemma nat_lt_subst {n1 n2 : ℕ} {z1 z2 : ℤ} (hn : n1 < n2) (h1 : ↑n1 = z1) (h2 : ↑n2 = z2) :
44-
z1 < z2 :=
45-
by simpa [eq.symm h1, eq.symm h2, int.coe_nat_lt]
46-
4718
lemma eq_of_eq_of_eq {α} [ordered_semiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0 :=
4819
by simp *
4920

@@ -75,7 +46,6 @@ by simp *
7546
lemma eq_of_not_lt_of_not_gt {α} [linear_order α] (a b : α) (h1 : ¬ a < b) (h2 : ¬ b < a) : a = b :=
7647
le_antisymm (le_of_not_gt h2) (le_of_not_gt h1)
7748

78-
7949
-- used in the `nlinarith` normalization steps. The `_` argument is for uniformity.
8050
@[nolint unused_arguments]
8151
lemma mul_zero_eq {α} {R : α → α → Prop} [semiring α] {a b : α} (_ : R a 0) (h : b = 0) :

0 commit comments

Comments
 (0)