Skip to content

Commit df2e55f

Browse files
committed
chore: Fix lemma name (#1080)
Match leanprover-community/mathlib3#17967
1 parent afa1900 commit df2e55f

File tree

4 files changed

+14
-28
lines changed

4 files changed

+14
-28
lines changed

Mathlib/Algebra/GroupPower/Lemmas.lean

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -735,28 +735,9 @@ end LinearOrderedRing
735735

736736
namespace Int
737737

738-
/- Porting note: `@[simp]` gave a linter error:
739-
740-
Left-hand side simplifies from
741-
↑(Int.natAbs x ^ 2)
742-
to
743-
↑(Int.natAbs x) ^ 2
744-
using
745-
simp only [Nat.cast_pow]
746-
Try to change the left-hand side to the simplified term!
747-
748-
Hence a new lemma was added and
749-
the simp attribute was removed from the original lemma and added to this.
750-
-/
751-
theorem natAbs_sq (x : ℤ) : ↑(x.natAbs ^ 2) = x ^ 2:= by rw [sq, Int.natAbs_mul_self, sq]
738+
lemma natAbs_sq (x : ℤ) : ↑(x.natAbs ^ 2) = x ^ 2 := by rw [sq, Int.natAbs_mul_self, sq]
752739
#align int.nat_abs_sq Int.natAbs_sq
753740

754-
@[simp]
755-
theorem natAbs_sq' (x : ℤ) : (x.natAbs: ℤ) ^ 2 = x ^ 2:= by
756-
have l : (x.natAbs: ℤ) ^ 2 = ↑(x.natAbs ^ 2) := by simp
757-
rw [l]
758-
exact natAbs_sq x
759-
760741
alias natAbs_sq ← natAbs_pow_two
761742

762743
theorem natAbs_le_self_sq (a : ℤ) : (Int.natAbs a : ℤ) ≤ a ^ 2 := by

Mathlib/Data/Int/Dvd/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ theorem coe_nat_dvd {m n : ℕ} : (↑m : ℤ) ∣ ↑n ↔ m ∣ n :=
3535
#align int.coe_nat_dvd Int.coe_nat_dvd
3636

3737
theorem coe_nat_dvd_left {n : ℕ} {z : ℤ} : (↑n : ℤ) ∣ z ↔ n ∣ z.natAbs := by
38-
rcases natAbs_eq z with (eq | eq) <;> rw [eq] <;> simp [coe_nat_dvd]
38+
rcases natAbs_eq z with (eq | eq) <;> rw [eq] <;> simp [coe_nat_dvd]
3939
#align int.coe_nat_dvd_left Int.coe_nat_dvd_left
4040

4141
theorem coe_nat_dvd_right {n : ℕ} {z : ℤ} : z ∣ (↑n : ℤ) ↔ z.natAbs ∣ n := by
42-
rcases natAbs_eq z with (eq | eq) <;> rw [eq] <;> simp [coe_nat_dvd]
42+
rcases natAbs_eq z with (eq | eq) <;> rw [eq] <;> simp [coe_nat_dvd]
4343
#align int.coe_nat_dvd_right Int.coe_nat_dvd_right
4444

4545
#align int.le_of_dvd Int.le_of_dvd

Mathlib/Data/Int/Order/Basic.lean

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jeremy Avigad
55
66
! This file was ported from Lean 3 source module data.int.order.basic
7-
! leanprover-community/mathlib commit 10b4e499f43088dd3bb7b5796184ad5216648ab1
7+
! leanprover-community/mathlib commit b86832321b586c6ac23ef8cdef6a7a27e42b13bd
88
! Please do not edit these lines, except to modify the commit id
99
! if you have ported upstream changes.
1010
-/
@@ -61,6 +61,13 @@ theorem abs_eq_natAbs : ∀ a : ℤ, |a| = natAbs a
6161
| -[_+1] => abs_of_nonpos <| le_of_lt <| negSucc_lt_zero _
6262
#align int.abs_eq_nat_abs Int.abs_eq_natAbs
6363

64+
@[simp, norm_cast] lemma coe_natAbs (n : ℤ) : (n.natAbs : ℤ) = |n| := n.abs_eq_natAbs.symm
65+
#align int.coe_nat_abs Int.coe_natAbs
66+
67+
lemma _root_.Nat.cast_natAbs {α : Type _} [AddGroupWithOne α] (n : ℤ) : (n.natAbs : α) = |n| :=
68+
by rw [←coe_natAbs, Int.cast_ofNat]
69+
#align nat.cast_nat_abs Nat.cast_natAbs
70+
6471
theorem natAbs_abs (a : ℤ) : natAbs (|a|) = natAbs a := by rw [abs_eq_natAbs] ; rfl
6572
#align int.nat_abs_abs Int.natAbs_abs
6673

@@ -80,9 +87,8 @@ theorem coe_nat_ne_zero_iff_pos {n : ℕ} : (n : ℤ) ≠ 0 ↔ 0 < n :=
8087
fun h => (_root_.ne_of_lt (ofNat_lt.2 h)).symm⟩
8188
#align int.coe_nat_ne_zero_iff_pos Int.coe_nat_ne_zero_iff_pos
8289

83-
theorem coe_natAbs (n : ℕ) : |(n : ℤ)| = n :=
84-
abs_of_nonneg (coe_nat_nonneg n)
85-
#align int.coe_nat_abs Int.coe_natAbs
90+
@[norm_cast] lemma abs_coe_nat (n : ℕ) : |(n : ℤ)| = n := abs_of_nonneg (coe_nat_nonneg n)
91+
#align int.abs_coe_nat Int.abs_coe_nat
8692

8793
/-! ### succ and pred -/
8894

Mathlib/Data/Rat/Floor.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,8 @@ theorem fract_inv_num_lt_num_of_pos {q : ℚ} (q_pos : 0 < q) : (fract q⁻¹).n
150150
have : ((q.den - q.num * ⌊q_inv⌋ : ℚ) / q.num).num = q.den - q.num * ⌊q_inv⌋ := by
151151
suffices ((q.den : ℤ) - q.num * ⌊q_inv⌋).natAbs.coprime q.num.natAbs by
152152
exact_mod_cast Rat.num_div_eq_of_coprime q_num_pos this
153-
have : (q.num.natAbs : ℚ) = (q.num : ℚ) := by exact_mod_cast q_num_abs_eq_q_num
154153
have tmp := Nat.coprime_sub_mul_floor_rat_div_of_coprime q.reduced.symm
155-
simpa only [this, q_num_abs_eq_q_num] using tmp
154+
simpa only [Nat.cast_natAbs, abs_of_nonneg q_num_pos.le] using tmp
156155
rwa [this]
157156
-- to show the claim, start with the following inequality
158157
have q_inv_num_denom_ineq : q⁻¹.num - ⌊q⁻¹⌋ * q⁻¹.den < q⁻¹.den := by

0 commit comments

Comments
 (0)