Skip to content

Commit e182ab1

Browse files
committed
chore: avoid superfluous use of push_neg with contrapose or by_contra
Found by #37907.
1 parent 78c5704 commit e182ab1

245 files changed

Lines changed: 340 additions & 340 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Mathlib/Algebra/Algebra/Spectrum/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ lemma spectrum.units_conjugate {a : A} {u : Aˣ} :
440440
simp [mul_assoc]
441441
intro a u μ hμ
442442
rw [spectrum.mem_iff] at hμ ⊢
443-
contrapose!
443+
contrapose hμ
444444
simpa [mul_sub, sub_mul, Algebra.right_comm] using u.isUnit.mul hμ |>.mul u⁻¹.isUnit
445445

446446
/-- Conjugation by a unit preserves the spectrum, inverse on left. -/

Mathlib/Algebra/GCDMonoid/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ noncomputable def gcdMonoidOfGCD [DecidableEq α] (gcd : α → α → α)
10131013
· rfl
10141014
have h := (Classical.choose_spec ((gcd_dvd_left a 0).trans (Dvd.intro 0 rfl))).symm
10151015
have a0' : gcd a 00 := by
1016-
contrapose! a0
1016+
contrapose a0
10171017
rw [← associated_zero_iff_eq_zero, ← a0]
10181018
exact associated_of_dvd_dvd (dvd_gcd (dvd_refl a) (dvd_zero a)) (gcd_dvd_left _ _)
10191019
apply Or.resolve_left (mul_eq_zero.1 _) a0'
@@ -1051,7 +1051,7 @@ noncomputable def normalizedGCDMonoidOfGCD [NormalizationMonoid α] [DecidableEq
10511051
· rw [hl, zero_mul]
10521052
have h1 : gcd a b ≠ 0 := by
10531053
have hab : a * b ≠ 0 := mul_ne_zero a0 hb
1054-
contrapose! hab
1054+
contrapose hab
10551055
rw [← normalize_eq_zero, ← this, hab, zero_mul]
10561056
have h2 : normalize (gcd a b * l) = gcd a b * l := by rw [this, normalize_idem]
10571057
rw [← normalize_gcd] at this

Mathlib/Algebra/Group/Irreducible/Indecomposable.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ lemma Submonoid.closure_image_isMulIndecomposable_baseOf [Finite ι]
102102
have ⟨(hi₀ : 1 < f (v i)), (hi₁ : v i ∉ _)⟩ : i ∈ s := hi.prop
103103
have hi₂ (k : ι) (hk₀ : 1 < f (v k)) (hk₁ : f (v k) < f (v i)) : v k ∈ closure (v '' t) := by
104104
by_contra hk₂; exact not_le.mpr hk₁ <| hi.le_of_le ⟨hk₀, hk₂⟩ hk₁.le
105-
have hi₃ : i ∉ t := by contrapose! hi₁; exact subset_closure <| mem_image_of_mem v hi₁
105+
have hi₃ : i ∉ t := by contrapose hi₁; exact subset_closure <| mem_image_of_mem v hi₁
106106
obtain ⟨j, k, hj, hk, hjk⟩ : ∃ (j k : ι) (hj : 1 < f (v j)) (hk : 1 < f (v k)),
107107
v i = v j * v k := by
108108
grind [IsMulIndecomposable]

Mathlib/Algebra/Group/UniqueProds/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ theorem of_mulOpposite (h : TwoUniqueProds Gᵐᵒᵖ) : TwoUniqueProds G where
560560
simp_rw [mem_product] at h1 h2 ⊢
561561
refine ⟨(_, _), ⟨?_, ?_⟩, (_, _), ⟨?_, ?_⟩, ?_, hu1.of_mulOpposite, hu2.of_mulOpposite⟩
562562
pick_goal 5
563-
· contrapose! hne; rw [Prod.ext_iff] at hne ⊢
563+
· contrapose hne; rw [Prod.ext_iff] at hne ⊢
564564
exact ⟨unop_injective hne.2, unop_injective hne.1
565565
all_goals apply (mem_map' f).mp
566566
exacts [h1.2, h1.1, h2.2, h2.1]

Mathlib/Algebra/GroupWithZero/Associated.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ theorem Associated.of_pow_associated_of_prime' [CommMonoidWithZero M] [IsCancelM
338338
lemma Irreducible.isRelPrime_iff_not_dvd [Monoid M] {p n : M} (hp : Irreducible p) :
339339
IsRelPrime p n ↔ ¬ p ∣ n := by
340340
refine ⟨fun h contra ↦ hp.not_isUnit (h dvd_rfl contra), fun hpn d hdp hdn ↦ ?_⟩
341-
contrapose! hpn
341+
contrapose hpn
342342
suffices Associated p d from this.dvd.trans hdn
343343
exact (hp.dvd_iff.mp hdp).resolve_left hpn
344344

@@ -669,7 +669,7 @@ theorem dvdNotUnit_of_lt {a b : Associates M} (hlt : a < b) : DvdNotUnit a b :=
669669
apply dvd_zero
670670
rcases hlt with ⟨⟨x, rfl⟩, ndvd⟩
671671
refine ⟨x, ?_, rfl⟩
672-
contrapose! ndvd
672+
contrapose ndvd
673673
rcases ndvd with ⟨u, rfl⟩
674674
simp
675675

Mathlib/Algebra/Lie/Semisimple/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ instance : LieModule.IsIrreducible R L L := by
8686
suffices Nontrivial (LieIdeal R L) from ⟨IsSimple.eq_bot_or_eq_top⟩
8787
rw [LieSubmodule.nontrivial_iff, ← not_subsingleton_iff_nontrivial]
8888
have _i : ¬ IsLieAbelian L := IsSimple.non_abelian R
89-
contrapose! _i
89+
contrapose _i
9090
infer_instance
9191

9292
protected lemma isAtom_top : IsAtom (⊤ : LieIdeal R L) := isAtom_top
@@ -185,7 +185,7 @@ lemma isSimple_of_isAtom (I : LieIdeal R L) (hI : IsAtom I) : IsSimple R I where
185185
exact x.2
186186
-- So we need to show `J ≠ I` as ideals of `L`.
187187
-- This follows from our assumption that `J ≠ ⊤` as ideals of `I`.
188-
contrapose! hJ
188+
contrapose hJ
189189
rw [eq_top_iff]
190190
rintro ⟨x, hx⟩ -
191191
rw [← hJ] at hx
@@ -260,7 +260,7 @@ lemma finitelyAtomistic : ∀ s : Finset (LieIdeal R L), ↑s ⊆ {I : LieIdeal
260260
exact LieSubmodule.lie_mem_lie j.2 hx
261261
-- Indeed `J ⊓ I = ⊥`, since `J` is an atom that is not contained in `I`.
262262
apply ((hs hJs).le_iff.mp _).resolve_right
263-
· contrapose! hJI
263+
· contrapose hJI
264264
rw [← hJI]
265265
exact inf_le_right
266266
exact inf_le_left

Mathlib/Algebra/Lie/Sl2.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ lemma lie_lie_smul_f (t : IsSl2Triple h e f) : ⁅h, f⁆ = -((2 : R) • f) :=
6565

6666
lemma e_ne_zero (t : IsSl2Triple h e f) : e ≠ 0 := by
6767
have := t.h_ne_zero
68-
contrapose! this
68+
contrapose this
6969
simpa [this] using t.lie_e_f.symm
7070

7171
lemma f_ne_zero (t : IsSl2Triple h e f) : f ≠ 0 := by
7272
have := t.h_ne_zero
73-
contrapose! this
73+
contrapose this
7474
simpa [this] using t.lie_e_f.symm
7575

7676
variable {R}

Mathlib/Algebra/Lie/Weights/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def equivSetOf : Weight R L M ≃ {χ : L → R | genWeightSpace M χ ≠ ⊥} w
278278
lemma genWeightSpaceOf_ne_bot (χ : Weight R L M) (x : L) :
279279
genWeightSpaceOf M (χ x) x ≠ ⊥ := by
280280
have : ⨅ x, genWeightSpaceOf M (χ x) x ≠ ⊥ := χ.genWeightSpace_ne_bot
281-
contrapose! this
281+
contrapose this
282282
rw [eq_bot_iff]
283283
exact le_of_le_of_eq (iInf_le _ _) this
284284

Mathlib/Algebra/Lie/Weights/Killing.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ lemma disjoint_ker_weight_corootSpace (α : Weight K H L) :
440440

441441
lemma root_apply_cartanEquivDual_symm_ne_zero {α : Weight K H L} (hα : α.IsNonZero) :
442442
α ((cartanEquivDual H).symm α) ≠ 0 := by
443-
contrapose!
443+
contrapose hα
444444
suffices (cartanEquivDual H).symm α ∈ α.ker ⊓ corootSpace α by
445445
rw [(disjoint_ker_weight_corootSpace α).eq_bot] at this
446446
simpa using this
@@ -540,7 +540,7 @@ lemma traceForm_eq_zero_of_mem_ker_of_mem_span_coroot {α : Weight K H L} {x y :
540540
simp [hα.eq, hβ.eq]
541541
else
542542
have hβ : β.IsNonZero := by
543-
contrapose!
543+
contrapose hα
544544
simp only [← coroot_eq_zero_iff] at hα ⊢
545545
rwa [hyp]
546546
have : α.ker = β.ker := by
@@ -600,7 +600,7 @@ lemma _root_.IsSl2Triple.h_eq_coroot {α : Weight K H L} (hα : α.IsNonZero)
600600
use (2 • (α α')⁻¹) * (killingForm K L e f)⁻¹
601601
have hef₀ : killingForm K L e f ≠ 0 := by
602602
have := ht.h_ne_zero
603-
contrapose! this
603+
contrapose this
604604
simpa [this] using h_eq
605605
rw [h_eq, smul_smul, mul_assoc, inv_mul_cancel₀ hef₀, mul_one, smul_assoc, coroot]
606606

Mathlib/Algebra/Module/Submodule/Union.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ lemma Submodule.iUnion_ssubset_of_forall_ne_top_of_card_lt (s : Finset ι) (p :
4343
· simpa using h₁ j
4444
replace h₂ : s.card + 1 < ENat.card K := by simpa [Finset.card_insert_of_notMem hj] using h₂
4545
specialize hj' (lt_trans ENat.natCast_lt_succ h₂)
46-
contrapose! hj'
46+
contrapose hj'
4747
replace hj' : (p j : Set M) ∪ (⋃ i ∈ s, p i) = univ := by
4848
simpa only [Finset.mem_insert, iUnion_iUnion_eq_or_left] using hj'
4949
suffices (p j : Set M) ⊆ ⋃ i ∈ s, p i by rwa [union_eq_right.mpr this] at hj'

0 commit comments

Comments
 (0)