diff --git a/Mathlib/Data/ENat/Basic.lean b/Mathlib/Data/ENat/Basic.lean index 97df9293cace2a..18480b71ffeb58 100644 --- a/Mathlib/Data/ENat/Basic.lean +++ b/Mathlib/Data/ENat/Basic.lean @@ -313,15 +313,15 @@ lemma add_lt_add_iff_left {k : ℕ∞} (h : k ≠ ⊤) : k + n < k + m ↔ n < m lemma ne_top_iff_exists : n ≠ ⊤ ↔ ∃ m : ℕ, ↑m = n := WithTop.ne_top_iff_exists -lemma eq_top_iff_forall_ne : (∀ m : ℕ, ↑m ≠ n) ↔ n = ⊤ := WithTop.forall_ne_iff_eq_top +lemma eq_top_iff_forall_ne : n = ⊤ ↔ ∀ m : ℕ, ↑m ≠ n := WithTop.eq_top_iff_forall_ne +lemma eq_top_iff_forall_gt : n = ⊤ ↔ ∀ m : ℕ, m < n := WithTop.eq_top_iff_forall_gt +lemma eq_top_iff_forall_ge : n = ⊤ ↔ ∀ m : ℕ, m ≤ n := WithTop.eq_top_iff_forall_ge -lemma eq_top_iff_forall_lt : (∀ m : ℕ, m < n) ↔ n = ⊤ := WithTop.forall_gt_iff_eq_top - -lemma eq_top_iff_forall_le : (∀ m : ℕ, m ≤ n) ↔ n = ⊤ := WithTop.forall_ge_iff_eq_top +lemma forall_natCast_le_iff_le : (∀ a : ℕ, a ≤ m → a ≤ n) ↔ m ≤ n := WithTop.forall_coe_le_iff_le protected lemma exists_nat_gt (hn : n ≠ ⊤) : ∃ m : ℕ, n < m := by simp_rw [lt_iff_not_ge n] - exact not_forall.mp <| eq_top_iff_forall_le.mp.mt hn + exact not_forall.mp <| eq_top_iff_forall_ge.2.mt hn @[simp] lemma sub_eq_top_iff : a - b = ⊤ ↔ a = ⊤ ∧ b ≠ ⊤ := WithTop.sub_eq_top_iff lemma sub_ne_top_iff : a - b ≠ ⊤ ↔ a ≠ ⊤ ∨ b = ⊤ := WithTop.sub_ne_top_iff diff --git a/Mathlib/Data/Option/Basic.lean b/Mathlib/Data/Option/Basic.lean index f840944930e000..b6b21888ff5292 100644 --- a/Mathlib/Data/Option/Basic.lean +++ b/Mathlib/Data/Option/Basic.lean @@ -318,8 +318,10 @@ lemma isNone_eq_false_iff (a : Option α) : Option.isNone a = false ↔ Option.i lemma eq_none_or_eq_some (a : Option α) : a = none ∨ ∃ x, a = some x := Option.exists.mp exists_eq' -lemma forall_some_ne_iff_eq_none {o : Option α} : (∀ (x : α), some x ≠ o) ↔ o = none := by +lemma eq_none_iff_forall_some_ne {o : Option α} : o = none ↔ ∀ a : α, some a ≠ o := by apply not_iff_not.1 - simpa only [not_forall, not_not] using Option.ne_none_iff_exists.symm + simpa only [not_forall, not_not] using Option.ne_none_iff_exists + +@[deprecated (since := "2025-03-19")] alias forall_some_ne_iff_eq_none := eq_none_iff_forall_some_ne end Option diff --git a/Mathlib/Dynamics/TopologicalEntropy/NetEntropy.lean b/Mathlib/Dynamics/TopologicalEntropy/NetEntropy.lean index 24a9c6e8fca185..5ac7a833bee7a0 100644 --- a/Mathlib/Dynamics/TopologicalEntropy/NetEntropy.lean +++ b/Mathlib/Dynamics/TopologicalEntropy/NetEntropy.lean @@ -202,7 +202,7 @@ lemma netMaxcard_infinite_iff (T : X → X) (F : Set X) (U : Set (X × X)) (n : simp only [Nat.cast_lt, Subtype.exists, exists_prop] at h rcases h with ⟨s, s_net, s_k⟩ exact ⟨s, ⟨s_net, s_k.le⟩⟩ - · refine WithTop.forall_gt_iff_eq_top.1 fun k ↦ ?_ + · refine WithTop.eq_top_iff_forall_gt.2 fun k ↦ ?_ specialize h (k + 1) rcases h with ⟨s, s_net, s_card⟩ apply s_net.card_le_netMaxcard.trans_lt' diff --git a/Mathlib/Order/WithBot.lean b/Mathlib/Order/WithBot.lean index 16457046480b5a..e87a5e9ddf00f3 100644 --- a/Mathlib/Order/WithBot.lean +++ b/Mathlib/Order/WithBot.lean @@ -151,8 +151,10 @@ lemma map₂_coe_coe (f : α → β → γ) (a : α) (b : β) : map₂ f a b = f lemma ne_bot_iff_exists {x : WithBot α} : x ≠ ⊥ ↔ ∃ a : α, ↑a = x := Option.ne_none_iff_exists -lemma forall_ne_iff_eq_bot {x : WithBot α} : (∀ a : α, ↑a ≠ x) ↔ x = ⊥ := - Option.forall_some_ne_iff_eq_none +lemma eq_bot_iff_forall_ne {x : WithBot α} : x = ⊥ ↔ ∀ a : α, ↑a ≠ x := + Option.eq_none_iff_forall_some_ne + +@[deprecated (since := "2025-03-19")] alias forall_ne_iff_eq_bot := eq_bot_iff_forall_ne /-- Deconstruct a `x : WithBot α` to the underlying value in `α`, given a proof that `x ≠ ⊥`. -/ def unbot : ∀ x : WithBot α, x ≠ ⊥ → α | (x : α), _ => x @@ -325,14 +327,17 @@ alias le_coe_unbot' := le_coe_unbotD @[simp] theorem lt_coe_bot [OrderBot α] : x < (⊥ : α) ↔ x = ⊥ := by cases x <;> simp -lemma forall_lt_iff_eq_bot : (∀ b : α, x < b) ↔ x = ⊥ := by +lemma eq_bot_iff_forall_lt : x = ⊥ ↔ ∀ b : α, x < b := by cases x <;> simp; simpa using ⟨_, lt_irrefl _⟩ -lemma forall_le_iff_eq_bot [NoMinOrder α] : (∀ b : α, x ≤ b) ↔ x = ⊥ := by - refine ⟨fun h ↦ forall_lt_iff_eq_bot.1 fun y ↦ ?_, by simp +contextual⟩ +lemma eq_bot_iff_forall_le [NoMinOrder α] : x = ⊥ ↔ ∀ b : α, x ≤ b := by + refine ⟨by simp +contextual, fun h ↦ eq_bot_iff_forall_lt.2 fun y ↦ ?_⟩ obtain ⟨w, hw⟩ := exists_lt y exact (h w).trans_lt (coe_lt_coe.2 hw) +@[deprecated (since := "2025-03-19")] alias forall_lt_iff_eq_bot := eq_bot_iff_forall_lt +@[deprecated (since := "2025-03-19")] alias forall_le_iff_eq_bot := eq_bot_iff_forall_le + end Preorder instance semilatticeSup [SemilatticeSup α] : SemilatticeSup (WithBot α) where @@ -638,8 +643,10 @@ theorem ofDual_map (f : αᵒᵈ → βᵒᵈ) (a : WithTop αᵒᵈ) : lemma ne_top_iff_exists {x : WithTop α} : x ≠ ⊤ ↔ ∃ a : α, ↑a = x := Option.ne_none_iff_exists -lemma forall_ne_iff_eq_top {x : WithTop α} : (∀ a : α, ↑a ≠ x) ↔ x = ⊤ := - Option.forall_some_ne_iff_eq_none +lemma eq_top_iff_forall_ne {x : WithTop α} : x = ⊤ ↔ ∀ a : α, ↑a ≠ x := + Option.eq_none_iff_forall_some_ne + +@[deprecated (since := "2025-03-19")] alias forall_ne_iff_eq_top := eq_top_iff_forall_ne /-- Deconstruct a `x : WithTop α` to the underlying value in `α`, given a proof that `x ≠ ⊤`. -/ def untop : ∀ x : WithTop α, x ≠ ⊤ → α | (x : α), _ => x @@ -806,11 +813,19 @@ alias coe_untop'_le := coe_untopD_le @[simp] theorem coe_top_lt [OrderTop α] : (⊤ : α) < x ↔ x = ⊤ := by cases x <;> simp -lemma forall_gt_iff_eq_top : (∀ a : α, a < y) ↔ y = ⊤ := by +lemma eq_top_iff_forall_gt : y = ⊤ ↔ ∀ a : α, a < y := by cases y <;> simp; simpa using ⟨_, lt_irrefl _⟩ -lemma forall_ge_iff_eq_top [NoMaxOrder α] : (∀ a : α, a ≤ y) ↔ y = ⊤ := - WithBot.forall_le_iff_eq_bot (α := αᵒᵈ) +lemma eq_top_iff_forall_ge [NoMaxOrder α] : y = ⊤ ↔ ∀ a : α, a ≤ y := + WithBot.eq_bot_iff_forall_le (α := αᵒᵈ) + +@[deprecated (since := "2025-03-19")] alias forall_lt_iff_eq_top := eq_top_iff_forall_gt +@[deprecated (since := "2025-03-19")] alias forall_le_iff_eq_top := eq_top_iff_forall_ge + +lemma forall_coe_le_iff_le [NoMaxOrder α] {x y : WithTop α} : (∀ a : α, a ≤ x → a ≤ y) ↔ x ≤ y := by + obtain _ | x := x + · simp [WithTop.none_eq_top, eq_top_iff_forall_ge] + · exact ⟨fun h ↦ h _ le_rfl, fun hmn a ham ↦ ham.trans hmn⟩ end Preorder diff --git a/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean b/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean index 56d2e93ac46e09..ae5a68cba431a1 100644 --- a/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean +++ b/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean @@ -474,7 +474,7 @@ instance (R : Type*) [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] : obtain ⟨ϖ, hϖ⟩ := exists_irreducible R simp only [← Ideal.one_eq_top, smul_eq_mul, mul_one, SModEq.zero, hϖ.maximalIdeal_eq, Ideal.span_singleton_pow, Ideal.mem_span_singleton, ← addVal_le_iff_dvd, hϖ.addVal_pow] at hx - rwa [← addVal_eq_top_iff, ← WithTop.forall_ge_iff_eq_top] + rwa [← addVal_eq_top_iff, WithTop.eq_top_iff_forall_ge] end IsDiscreteValuationRing