Skip to content

Commit bbd7d9b

Browse files
committed
chore: avoid superfluous use of push_neg
Not exhaustive yet; found by leanprover-community#37907.
1 parent 0c6bcfa commit bbd7d9b

File tree

21 files changed

+26
-26
lines changed

21 files changed

+26
-26
lines changed

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/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/Tropical/Lattice.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ instance [ConditionallyCompleteLinearOrder R] : ConditionallyCompleteLinearOrder
6868
have : Set.range untrop = (Set.univ : Set R) := Equiv.range_eq_univ tropEquiv.symm
6969
simp only [sSup, Set.image_empty, trop_inj_iff]
7070
apply csSup_of_not_bddAbove
71-
contrapose! hs
71+
contrapose hs
7272
change BddAbove (tropOrderIso.symm '' s) at hs
7373
exact tropOrderIso.symm.bddAbove_image.1 hs
7474
csInf_of_not_bddBelow := by
7575
intro s hs
7676
have : Set.range untrop = (Set.univ : Set R) := Equiv.range_eq_univ tropEquiv.symm
7777
simp only [sInf, Set.image_empty, trop_inj_iff]
7878
apply csInf_of_not_bddBelow
79-
contrapose! hs
79+
contrapose hs
8080
change BddBelow (tropOrderIso.symm '' s) at hs
8181
exact tropOrderIso.symm.bddBelow_image.1 hs }

Mathlib/Data/Finset/Insert.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ instance (i : α) (s : Finset α) : Nonempty ((insert i s : Finset α) : Set α)
433433
(Finset.coe_nonempty.mpr (s.insert_nonempty i)).to_subtype
434434

435435
theorem ne_insert_of_notMem (s t : Finset α) {a : α} (h : a ∉ s) : s ≠ insert a t := by
436-
contrapose! h
436+
contrapose h
437437
simp [h]
438438

439439
theorem insert_subset_iff : insert a s ⊆ t ↔ a ∈ t ∧ s ⊆ t := by grind

Mathlib/Data/Finsupp/Fin.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ theorem cons_zero_zero : cons 0 (0 : Fin n →₀ M) = 0 := by simp [cons_zero_e
7979
variable {s} {y}
8080

8181
theorem cons_ne_zero_of_left (h : y ≠ 0) : cons y s ≠ 0 := by
82-
contrapose! h with c
82+
contrapose h with c
8383
rw [← cons_zero y s, c, Finsupp.coe_zero, Pi.zero_apply]
8484

8585
theorem cons_ne_zero_of_right (h : s ≠ 0) : cons y s ≠ 0 := by
86-
contrapose! h with c
86+
contrapose h with c
8787
ext a
8888
simp [← cons_succ a y s, c]
8989

Mathlib/Data/List/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ theorem succ_idxOf_lt_length_of_mem_dropLast {l : List α} {a : α} (ha : a ∈
591591
theorem idxOf_getLast {l : List α} (hl : l ≠ []) (hl' : l.getLast hl ∉ l.dropLast) :
592592
l.idxOf (l.getLast hl) = l.length - 1 :=
593593
Nat.le_antisymm (Nat.le_pred_of_lt <| l.idxOf_lt_length_of_mem <| getLast_mem hl) <| by
594-
contrapose! hl'
594+
contrapose hl'
595595
rwa [mem_dropLast_iff_idxOf_lt <| getLast_mem hl, ← Nat.not_le]
596596

597597
end IndexOf

Mathlib/Data/Nat/Count.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ theorem count_strict_mono {m n : ℕ} (hm : p m) (hmn : m < n) : count p m < cou
107107
(count_lt_count_succ_iff.2 hm).trans_le <| count_monotone _ (Nat.succ_le_iff.2 hmn)
108108

109109
theorem count_injective {m n : ℕ} (hm : p m) (hn : p n) (heq : count p m = count p n) : m = n := by
110-
by_contra! h : m ≠ n
110+
by_contra h : m ≠ n
111111
wlog hmn : m < n
112112
· exact this hn hm heq.symm h.symm (by grind)
113113
· simpa [heq] using count_strict_mono hm hmn

Mathlib/Data/Set/Finite/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ theorem not_injOn_infinite_finite_image {f : α → β} {s : Set α} (h_inf : s.
897897
have : Infinite s := infinite_coe_iff.mpr h_inf
898898
have h := not_injective_infinite_finite
899899
((f '' s).codRestrict (s.restrict f) fun x => ⟨x, x.property, rfl⟩)
900-
contrapose! h
900+
contrapose h
901901
rwa [injective_codRestrict, ← injOn_iff_injective]
902902

903903
theorem finite_range_findGreatest {P : α → ℕ → Prop} [∀ x, DecidablePred (P x)] {b : ℕ} :

Mathlib/Data/Sym/Sym2.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ instance decidablePred_mem_diagSet (α : Type u) [DecidableEq α] : DecidablePre
561561
IsDiag.decidablePred _
562562

563563
theorem other_ne {a : α} {z : Sym2 α} (hd : ¬IsDiag z) (h : a ∈ z) : Mem.other h ≠ a := by
564-
contrapose! hd
564+
contrapose hd
565565
have h' := Sym2.other_spec h
566566
rw [hd] at h'
567567
rw [← h']

Mathlib/GroupTheory/GroupAction/FixedPoints.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ is disjoint from `(fixedBy α g)ᶜ`, then `g` and `h` cannot commute.
262262
is disjoint from `(fixedBy α g)ᶜ`, then `g` and `h` cannot commute. -/]
263263
theorem not_commute_of_disjoint_movedBy_preimage {g h : G} (ne_one : g ≠ 1)
264264
(disjoint : Disjoint (fixedBy α g)ᶜ (h • (fixedBy α g)ᶜ)) : ¬Commute g h := by
265-
contrapose! ne_one with comm
265+
contrapose ne_one with comm
266266
rwa [movedBy_mem_fixedBy_of_commute comm, disjoint_self, Set.bot_eq_empty, ← Set.compl_univ,
267267
compl_inj_iff, fixedBy_eq_univ_iff_eq_one] at disjoint
268268

0 commit comments

Comments
 (0)