Skip to content
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Group/Fin/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ lemma lt_sub_iff {n : ℕ} {a b : Fin n} : a < a - b ↔ a < b := by
rcases n with - | n
· exact a.elim0
constructor
· contrapose!
· contrapose
intro h
obtain ⟨l, hl⟩ := Nat.exists_eq_add_of_le (Fin.not_lt.mp h)
simpa only [Fin.not_lt, le_iff_val_le_val, sub_def, hl, ← Nat.add_assoc, Nat.add_mod_left,
Expand Down
6 changes: 2 additions & 4 deletions Mathlib/Algebra/Group/Pointwise/Finset/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,9 @@ lemma Nonempty.pow (hs : s.Nonempty) : ∀ {n}, (s ^ n).Nonempty
| 0 => by simp
| n + 1 => by rw [pow_succ]; exact hs.pow.mul hs

set_option push_neg.use_distrib true in
@[to_additive (attr := simp)] lemma pow_eq_empty : s ^ n = ∅ ↔ s = ∅ ∧ n ≠ 0 := by
constructor
· contrapose!
· contrapose! +distrib
rintro (hs | rfl)
-- TODO: The `nonempty_iff_ne_empty` would be unnecessary if `push_neg` knew how to simplify
-- `s ≠ ∅` to `s.Nonempty` when `s : Finset α`.
Expand Down Expand Up @@ -1003,10 +1002,9 @@ lemma Nonempty.zpow (hs : s.Nonempty) : ∀ {n : ℤ}, (s ^ n).Nonempty
| (n : ℕ) => hs.pow
| .negSucc n => by simpa using hs.pow

set_option push_neg.use_distrib true in
@[to_additive (attr := simp)] lemma zpow_eq_empty : s ^ n = ∅ ↔ s = ∅ ∧ n ≠ 0 := by
constructor
· contrapose!
· contrapose! +distrib
rintro (hs | rfl)
· exact nonempty_iff_ne_empty.1 (nonempty_iff_ne_empty.2 hs).zpow
· rw [← nonempty_iff_ne_empty]
Expand Down
6 changes: 2 additions & 4 deletions Mathlib/Algebra/Group/Pointwise/Set/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -638,10 +638,9 @@ lemma Nonempty.pow (hs : s.Nonempty) : ∀ {n}, (s ^ n).Nonempty
| 0 => by simp
| n + 1 => by rw [pow_succ]; exact hs.pow.mul hs

set_option push_neg.use_distrib true in
@[to_additive (attr := simp)] lemma pow_eq_empty : s ^ n = ∅ ↔ s = ∅ ∧ n ≠ 0 := by
constructor
· contrapose!
· contrapose! +distrib
rintro (hs | rfl)
· exact hs.pow
· simp
Expand Down Expand Up @@ -796,10 +795,9 @@ lemma Nonempty.zpow (hs : s.Nonempty) : ∀ {n : ℤ}, (s ^ n).Nonempty
| (n : ℕ) => hs.pow
| .negSucc n => by simpa using hs.pow

set_option push_neg.use_distrib true in
@[to_additive (attr := simp)] lemma zpow_eq_empty : s ^ n = ∅ ↔ s = ∅ ∧ n ≠ 0 := by
constructor
· contrapose!
· contrapose! +distrib
rintro (hs | rfl)
· exact hs.zpow
· simp
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Group/UniqueProds/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ attribute [to_additive] TwoUniqueProds
lemma uniqueMul_of_twoUniqueMul {G} [Mul G] {A B : Finset G} (h : 1 < #A * #B →
∃ p1 ∈ A ×ˢ B, ∃ p2 ∈ A ×ˢ B, p1 ≠ p2 ∧ UniqueMul A B p1.1 p1.2 ∧ UniqueMul A B p2.1 p2.2)
(hA : A.Nonempty) (hB : B.Nonempty) : ∃ a ∈ A, ∃ b ∈ B, UniqueMul A B a b := by
set_option push_neg.use_distrib true in by_cases! hc : #A ≤ 1 ∧ #B ≤ 1
by_cases! +distrib hc : #A ≤ 1 ∧ #B ≤ 1
· exact UniqueMul.of_card_le_one hA hB hc.1 hc.2
rw [← Finset.card_pos] at hA hB
obtain ⟨p, hp, _, _, _, hu, _⟩ := h (Nat.one_lt_mul_iff.mpr ⟨hA, hB, hc⟩)
Expand Down Expand Up @@ -431,7 +431,7 @@ open UniqueMul in
let _ := isWellFounded_ssubset (α := ∀ i, G i) -- why need this?
apply IsWellFounded.induction (· ⊂ ·) A; intro A ihA B hA
apply IsWellFounded.induction (· ⊂ ·) B; intro B ihB hB
set_option push_neg.use_distrib true in by_cases! hc : #A ≤ 1 ∧ #B ≤ 1
by_cases! +distrib hc : #A ≤ 1 ∧ #B ≤ 1
· exact of_card_le_one hA hB hc.1 hc.2
obtain ⟨i, hc⟩ := exists_or.mpr (hc.imp exists_of_one_lt_card_pi exists_of_one_lt_card_pi)
obtain ⟨ai, hA, bi, hB, hi⟩ := uniqueMul_of_nonempty (hA.image (· i)) (hB.image (· i))
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Homology/Embedding/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ lemma notMem_range_embeddingUpIntLE_iff (n : ℤ) :
(∀ (i : ℕ), (embeddingUpIntLE p).f i ≠ n) ↔ p < n := by
constructor
· intro h
by_contra!
by_contra
exact h (p - n).natAbs (by simp; cutsat)
· intros
dsimp
Expand All @@ -264,7 +264,7 @@ lemma notMem_range_embeddingUpIntGE_iff (n : ℤ) :
(∀ (i : ℕ), (embeddingUpIntGE p).f i ≠ n) ↔ n < p := by
constructor
· intro h
by_contra!
by_contra
exact h (n - p).natAbs (by simp; cutsat)
· intros
dsimp
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Order/Archimedean/Class.lean
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ theorem mk_prod {ι : Type*} [LinearOrder ι] {s : Finset ι} (hnonempty : s.Non
have hminmem : s.min' hs ∈ (Finset.cons i s hi) :=
Finset.mem_cons_of_mem (Finset.min'_mem _ _)
have hne : mk (a i) ≠ mk (a (s.min' hs)) := by
by_contra!
obtain eq := hmono.injOn (by simp) hminmem this
by_contra h
obtain eq := hmono.injOn (by simp) hminmem h
rw [eq] at hi
exact hi (Finset.min'_mem _ hs)
rw [← ih] at hne
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ lemma isIso_of_nonDegenerate (x : X.nonDegenerate n)
obtain ⟨x, hx⟩ := x
induction m using SimplexCategory.rec with | _ m
rw [mem_nonDegenerate_iff_notMem_degenerate] at hx
by_contra!
refine hx ⟨_, not_le.1 (fun h ↦ this ?_), f, y, hy⟩
by_contra hf
refine hx ⟨_, not_le.1 (fun h ↦ hf ?_), f, y, hy⟩
rw [SimplexCategory.isIso_iff_of_epi]
exact le_antisymm h (SimplexCategory.len_le_of_epi f)

Expand Down
3 changes: 1 addition & 2 deletions Mathlib/Analysis/SpecialFunctions/BinaryEntropy.lean
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ lemma differentiableAt_binEntropy_iff_ne_zero_one :
· simp [log_inv, mul_neg, ← neg_mul, ← negMulLog_def, differentiableAt_negMulLog_iff] at h
· fun_prop (disch := simp)

set_option push_neg.use_distrib true in
/-- Binary entropy has derivative `log (1 - p) - log p`.
It's not differentiable at `0` or `1` but the junk values of `deriv` and `log` coincide there. -/
lemma deriv_binEntropy (p : ℝ) : deriv binEntropy p = log (1 - p) - log p := by
Expand All @@ -192,7 +191,7 @@ lemma deriv_binEntropy (p : ℝ) : deriv binEntropy p = log (1 - p) - log p := b
all_goals fun_prop (disch := assumption)
-- pathological case where `deriv = 0` since `binEntropy` is not differentiable there
· rw [deriv_zero_of_not_differentiableAt (differentiableAt_binEntropy_iff_ne_zero_one.not.2 hp)]
push_neg at hp
push_neg +distrib at hp
obtain rfl | rfl := hp <;> simp

/-! ### `q`-ary entropy -/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ instance IsWellOrderContinuous.restriction_setIci
dsimp only [f]
by_cases! h : j' ≤ j
· refine ⟨⟨⟨j, le_refl j⟩, ?_⟩, h⟩
by_contra!
simp only [Set.mem_Iio, not_lt] at this
by_contra h'
simp only [Set.mem_Iio, not_lt] at h'
apply hm.1
rintro ⟨k, hk⟩ hkm
exact this.trans hk
exact h'.trans hk
· exact ⟨⟨⟨j', h.le⟩, hj'⟩, by rfl⟩
exact (Functor.Final.isColimitWhiskerEquiv (F := hf.functor) _).2
(F.isColimitOfIsWellOrderContinuous m.1 (Set.Ici.isSuccLimit_coe m hm))⟩
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/Colex.lean
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toC

private lemma antisymm_aux (hst : toColex s ≤ toColex t) (hts : toColex t ≤ toColex s) : s ⊆ t := by
intro a has
by_contra! hat
by_contra hat
have ⟨_b, hb₁, hb₂, _⟩ := trans_aux hst hts has hat
exact hb₂ hb₁

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/SimpleGraph/Clique.lean
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ theorem cliqueFree_two : G.CliqueFree 2 ↔ G = ⊥ := by

lemma CliqueFree.mem_of_sup_edge_isNClique {x y : α} {t : Finset α} {n : ℕ} (h : G.CliqueFree n)
(hc : (G ⊔ edge x y).IsNClique n t) : x ∈ t := by
by_contra! hf
by_contra hf
have ht : (t : Set α) \ {x} = t := sdiff_eq_left.mpr <| Set.disjoint_singleton_right.mpr hf
exact h t ⟨ht ▸ hc.1.sdiff_of_sup_edge, hc.2⟩

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/SimpleGraph/Metric.lean
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ protected theorem Reachable.pos_dist_of_ne (h : G.Reachable u v) (hne : u ≠ v)
protected theorem Reachable.one_lt_dist_of_ne_of_not_adj (h : G.Reachable u v) (hne : u ≠ v)
(hnadj : ¬G.Adj u v) : 1 < G.dist u v :=
Nat.lt_of_le_of_ne (h.pos_dist_of_ne hne) (by
by_contra! hc
by_contra hc
obtain ⟨p, hp⟩ := Reachable.exists_walk_length_eq_dist h
exact hnadj (Walk.exists_length_eq_one_iff.mp ⟨p, hc ▸ hp⟩))

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Data/EReal/Operations.lean
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ lemma mul_ne_top (a b : EReal) :
rw [ne_eq, mul_eq_top]
-- push the negation while keeping the disjunctions, that is converting `¬(p ∧ q)` into `¬p ∨ ¬q`
-- rather than `p → ¬q`, since we already have disjunctions in the rhs
set_option push_neg.use_distrib true in push_neg
push_neg +distrib
rfl

lemma mul_eq_bot (a b : EReal) :
Expand All @@ -759,7 +759,7 @@ lemma mul_eq_bot (a b : EReal) :
lemma mul_ne_bot (a b : EReal) :
a * b ≠ ⊥ ↔ (a ≠ ⊥ ∨ b ≤ 0) ∧ (a ≤ 0 ∨ b ≠ ⊥) ∧ (a ≠ ⊤ ∨ 0 ≤ b) ∧ (0 ≤ a ∨ b ≠ ⊤) := by
rw [ne_eq, mul_eq_bot]
set_option push_neg.use_distrib true in push_neg
push_neg +distrib
rfl

/-- `EReal.toENNReal` is multiplicative. For the version with the nonnegativity
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Nat/Count.lean
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ theorem count_strict_mono {m n : ℕ} (hm : p m) (hmn : m < n) : count p m < cou
(count_lt_count_succ_iff.2 hm).trans_le <| count_monotone _ (Nat.succ_le_iff.2 hmn)

theorem count_injective {m n : ℕ} (hm : p m) (hn : p n) (heq : count p m = count p n) : m = n := by
by_contra! h : m ≠ n
by_contra! h
wlog hmn : m < n
· exact this hn hm heq.symm h.symm (by grind)
· simpa [heq] using count_strict_mono hm hmn
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Seq/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ theorem at_least_as_long_as_coind {a : Seq α} {b : Seq β}
by_cases ha : a.Terminates; swap
· simp [length'_of_not_terminates ha]
simp [length'_of_terminates ha, length'_le_iff]
by_contra! hb
by_contra hb
have hb_cons : b.drop (a.length ha) ≠ .nil := by
intro hb'
simp only [← length'_eq_zero_iff_nil, drop_length', tsub_eq_zero_iff_le, length'_le_iff] at hb'
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/GroupTheory/Perm/ClosureSwap.lean
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ theorem mem_closure_isSwap {S : Set (Perm α)} (hS : ∀ f ∈ S, f.IsSwap) {f :
· rw [← orbit_eq_iff.mpr (hf b), h1, orbit_eq_iff.mpr (hf a)]; apply mem_orbit_self
· rw [← orbit_eq_iff.mpr (hf b), h2]; apply hf
· exact hf b
· contrapose! hb
· contrapose hb
simp_rw [notMem_compl_iff, mem_fixedBy, Perm.smul_def, Perm.mul_apply, swap_apply_def,
apply_eq_iff_eq]
by_cases hb' : f b = b
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/GroupTheory/Perm/Cycle/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ theorem IsCycle.isConj_iff (hσ : IsCycle σ) (hτ : IsCycle τ) :
refine Finset.card_bij (fun a _ => π a) (fun _ ha => ?_) (fun _ _ _ _ ab => π.injective ab)
fun b hb ↦ ⟨π⁻¹ b, ?_, π.apply_inv_self b⟩
· simp [mem_support.1 ha]
contrapose! hb
contrapose hb
rw [mem_support, Classical.not_not] at hb
rw [mem_support, Classical.not_not, Perm.mul_apply, Perm.mul_apply, hb, Perm.apply_inv_self]
mpr := hσ.isConj hτ
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/LinearAlgebra/LinearIndependent/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ theorem not_linearIndependent_iffₒₛ :
∃ (s t : Finset ι) (f : ι → R),
Disjoint s t ∧ ∑ i ∈ s, f i • v i = ∑ i ∈ t, f i • v i ∧ ∃ i ∈ s, 0 < f i := by
simp only [linearIndependent_iffₒₛ, pos_iff_ne_zero]
set_option push_neg.use_distrib true in push_neg
push_neg +distrib
refine ⟨fun ⟨s, t, f, hst, heq, h⟩ => ?_,
fun ⟨s, t, f, hst, heq, hi⟩ => ⟨s, t, f, hst, heq, .inl hi⟩⟩
rcases h with ⟨i, hi, hfi⟩ | ⟨i, hi, hgi⟩
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ open LieModule Matrix

local notation "H" => cartanSubalgebra' b

set_option maxHeartbeats 210000 in
-- This declaration was already right at the heartbeats limit
private lemma instIsIrreducible_aux₀ {U : LieSubmodule K H (b.support ⊕ ι → K)}
(χ : H → K) (hχ : χ ≠ 0) (hχ' : genWeightSpace U χ ≠ ⊥) :
∃ i, v b i ∈ (genWeightSpace U χ).map U.incl := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/ModelTheory/Semantics.lean
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ variable (M N)
theorem realize_iff_of_model_completeTheory [N ⊨ L.completeTheory M] (φ : L.Sentence) :
N ⊨ φ ↔ M ⊨ φ := by
refine ⟨fun h => ?_, (L.completeTheory M).realize_sentence_of_mem⟩
contrapose! h
contrapose h
rw [← Sentence.realize_not] at *
exact (L.completeTheory M).realize_sentence_of_mem (mem_completeTheory.2 h)

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/NumberTheory/Padics/PadicVal/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ theorem maxPowDiv_eq_multiplicity {p n : ℕ} (hp : 1 < p) (hn : n ≠ 0) (h : F
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
ext p n
set_option push_neg.use_distrib true in by_cases! h : 1 < p ∧ 0 < n
by_cases! +distrib h : 1 < p ∧ 0 < n
· rw [padicValNat_def' h.1.ne' h.2.ne', maxPowDiv_eq_multiplicity h.1 h.2.ne']
exact Nat.finiteMultiplicity_iff.2 ⟨h.1.ne', h.2⟩
· rcases h with (h | h)
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/NumberTheory/WellApproximable.lean
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ theorem addWellApproximable_ae_empty_or_univ (δ : ℕ → ℝ) (hδ : Tendsto
rw [OrderIso.apply_blimsup e, ← hu₀ p]
exact blimsup_congr (Eventually.of_forall fun n hn =>
approxAddOrderOf.vadd_eq_of_mul_dvd (δ n) hn.1 hn.2)
set_option push_neg.use_distrib true in
by_cases! h : ∀ p : Nat.Primes, A p =ᵐ[μ] (∅ : Set 𝕊) ∧ B p =ᵐ[μ] (∅ : Set 𝕊)
by_cases! +distrib h : ∀ p : Nat.Primes, A p =ᵐ[μ] (∅ : Set 𝕊) ∧ B p =ᵐ[μ] (∅ : Set 𝕊)
· replace h : ∀ p : Nat.Primes, (u p +ᵥ E : Set _) =ᵐ[μ] E := by
intro p
replace hE₂ : E =ᵐ[μ] C p := hE₂ p (h p)
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Order/LiminfLimsup.lean
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ theorem cofinite.blimsup_set_eq :
blimsup s cofinite p = { x | { n | p n ∧ x ∈ s n }.Infinite } := by
simp only [blimsup_eq, le_eq_subset, eventually_cofinite, not_forall, sInf_eq_sInter, exists_prop]
ext x
refine ⟨fun h => ?_, fun hx t h => ?_⟩ <;> contrapose! h
refine ⟨fun h => ?_, fun hx t h => ?_⟩ <;> contrapose h
· simp only [mem_sInter, mem_setOf_eq, not_forall, exists_prop]
exact ⟨{x}ᶜ, by simpa using h, by simp⟩
· exact hx.mono fun i hi => ⟨hi.1, fun hit => h (hit hi.2)⟩
Expand Down Expand Up @@ -850,7 +850,7 @@ theorem limsup_le_iff {x : β} (h₁ : f.IsCoboundedUnder (· ≤ ·) u := by is
rcases h' y x_y with ⟨z, x_z, z_y⟩
exact (limsup_le_of_le h₁ ((h z x_z).mono (fun _ ↦ le_of_lt))).trans_lt z_y
· apply limsup_le_of_le h₁
set_option push_neg.use_distrib true in push_neg at h'
push_neg +distrib at h'
rcases h' with ⟨z, x_z, hz⟩
exact (h z x_z).mono <| fun w hw ↦ (or_iff_left (not_le_of_gt hw)).1 (hz (u w))

Expand Down Expand Up @@ -878,7 +878,7 @@ theorem le_limsup_iff {x : β} (h₁ : f.IsCoboundedUnder (· ≤ ·) u := by is
obtain ⟨z, y_z, z_x⟩ := h' y y_x
exact y_z.trans_le (le_limsup_of_frequently_le ((h z z_x).mono (fun _ ↦ le_of_lt)) h₂)
· apply le_limsup_of_frequently_le _ h₂
set_option push_neg.use_distrib true in push_neg at h'
push_neg +distrib at h'
rcases h' with ⟨z, z_x, hz⟩
exact (h z z_x).mono <| fun w hw ↦ (or_iff_right (not_le_of_gt hw)).1 (hz (u w))

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/HahnSeries/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def embDomain (f : Γ ↪o Γ') : HahnSeries Γ R → HahnSeries Γ' R := fun x
{ coeff := fun b : Γ' => if h : b ∈ f '' x.support then x.coeff (Classical.choose h) else 0
isPWO_support' :=
(x.isPWO_support.image_of_monotone f.monotone).mono fun b hb => by
contrapose! hb
contrapose hb
rw [Function.mem_support, dif_neg hb, Classical.not_not] }

@[simp]
Expand Down Expand Up @@ -454,7 +454,7 @@ theorem embDomain_notin_image_support {f : Γ ↪o Γ'} {x : HahnSeries Γ R} {b
theorem support_embDomain_subset {f : Γ ↪o Γ'} {x : HahnSeries Γ R} :
support (embDomain f x) ⊆ f '' x.support := by
intro g hg
contrapose! hg
contrapose hg
rw [mem_support, embDomain_notin_image_support hg, Classical.not_not]

theorem embDomain_notin_range {f : Γ ↪o Γ'} {x : HahnSeries Γ R} {b : Γ'} (hb : b ∉ Set.range f) :
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/HahnSeries/Multiplication.lean
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ instance instSMul : SMul (HahnSeries Γ R) (HahnModule Γ' R V) where
{ a : Γ' | (VAddAntidiagonal x.isPWO_support
((of R).symm y).isPWO_support a).Nonempty } := by
intro a ha
contrapose! ha
contrapose ha
simp [not_nonempty_iff_eq_empty.1 ha]
isPWO_support_vaddAntidiagonal.mono h }

Expand Down Expand Up @@ -346,7 +346,7 @@ theorem support_smul_subset_vadd_support' [MulZeroClass R] [SMulWithZero R V] {x
· exact x.isPWO_support
· exact y.isPWO_support
intro x hx
contrapose! hx
contrapose hx
simp only [Set.mem_setOf_eq, not_nonempty_iff_eq_empty] at hx
simp [hx, coeff_smul]

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ theorem subset_union_of_exact (hf : Function.Injective f) (hfg : Function.Exact
apply_fun f at hb
rw [map_smul, map_zero, h, ← mul_smul, ← LinearMap.toSpanSingleton_apply,
← LinearMap.mem_ker, ← hx] at hb
contrapose! hb
contrapose hb
exact p.primeCompl.mul_mem hb ha
· right
refine ⟨‹_›, g x, le_antisymm (fun b hb ↦ ?_) (fun b hb ↦ ?_)⟩
Expand All @@ -141,7 +141,7 @@ theorem subset_union_of_exact (hf : Function.Injective f) (hfg : Function.Exact
· rw [LinearMap.mem_ker, LinearMap.toSpanSingleton_apply, ← map_smul, ← LinearMap.mem_ker,
hfg.linearMap_ker_eq] at hb
obtain ⟨y, hy⟩ := hb
by_contra! H
by_contra H
exact h b H y hy

variable (R M M') in
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Ideal/Oka.lean
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ theorem isPrime_of_maximal_not {I : Ideal R} (hI : Maximal (¬P ·) I) : I.IsPri
Then all the ideals of `R` satisfy `P`. -/
theorem forall_of_forall_prime (hmax : ∀ I, ¬P I → ∃ I, Maximal (¬P ·) I)
(hprime : ∀ I, I.IsPrime → P I) (I : Ideal R) : P I := by
by_contra! hI
by_contra hI
obtain ⟨I, hI⟩ := hmax I hI
exact hI.prop <| hprime I (hP.isPrime_of_maximal_not hI)

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Localization/AtPrime/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ lemma AtPrime.eq_maximalIdeal_iff_comap_eq {J : Ideal (Localization.AtPrime I)}
theorem le_comap_primeCompl_iff {J : Ideal P} [J.IsPrime] {f : R →+* P} :
I.primeCompl ≤ J.primeCompl.comap f ↔ J.comap f ≤ I :=
⟨fun h x hx => by
contrapose! hx
contrapose hx
exact h hx,
fun h _ hx hfxJ => hx (h hfxJ)⟩

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Valuation/ValuativeRel/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ theorem rel_add_cases (x y : R) : x + y ≤ᵥ x ∨ x + y ≤ᵥ y :=
(rel_total y x).imp (fun h => rel_add .rfl h) (fun h => rel_add h .rfl)

lemma zero_srel_mul {x y : R} (hx : 0 <ᵥ x) (hy : 0 <ᵥ y) : 0 <ᵥ x * y := by
contrapose! hy
contrapose hy
rw [not_srel_iff] at hy ⊢
rw [show (0 : R) = x * 0 by simp, mul_comm x y, mul_comm x 0] at hy
exact rel_mul_cancel hx hy
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/SetTheory/Ordinal/Principal.lean
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ theorem exists_lt_add_of_not_principal_add (ha : ¬ Principal (· + ·) a) :

theorem principal_add_iff_add_lt_ne_self : Principal (· + ·) a ↔ ∀ b < a, ∀ c < a, b + c ≠ a :=
⟨fun ha _ hb _ hc => (ha hb hc).ne, fun H => by
by_contra! ha
by_contra ha
rcases exists_lt_add_of_not_principal_add ha with ⟨b, hb, c, hc, rfl⟩
exact (H b hb c hc).irrefl⟩

Expand Down
Loading
Loading