Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Order/Archimedean/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ instance WithZero.instMulArchimedean (M) [CommMonoid M] [PartialOrder M] [MulArc
constructor
intro x y hxy
cases y with
| zero => exact absurd hxy (zero_le _).not_gt
| zero => cases hxy.pos.false
| coe y =>
cases x with
| zero => refine ⟨0, zero_le _
| zero => refine ⟨0, zero_le⟩
| coe x => simpa [← WithZero.coe_pow] using (MulArchimedean.arch x (by simpa using hxy))
12 changes: 6 additions & 6 deletions Mathlib/Algebra/Order/GroupWithZero/Canonical.lean
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ instance instBoundedOrder [OrderTop α] : BoundedOrder (WithZero α) :=
instance : IsBotZeroClass (WithZero α) where
isBot_zero _ := bot_le

-- TODO: deprecate
lemma zero_le (a : WithZero α) : 0 ≤ a := by simp
@[deprecated _root_.zero_le (since := "2026-05-06")]
protected lemma zero_le (a : WithZero α) : 0 ≤ a := by simp

/-- There is a general version `le_zero_iff`, but this lemma does not require a `PartialOrder`. -/
@[simp]
Expand Down Expand Up @@ -308,8 +308,8 @@ instance instPreorder : Preorder (WithZero α) := inferInstanceAs <| Preorder (W
instance instMulLeftMono [Mul α] [MulLeftMono α] :
MulLeftMono (WithZero α) := by
refine ⟨fun a b c hbc => ?_⟩
induction a; · exact zero_le _
induction b; · exact zero_le _
induction a; · exact zero_le
induction b; · exact zero_le
rcases WithZero.coe_le_iff.1 hbc with ⟨c, rfl, hbc'⟩
rw [← coe_mul _ c, ← coe_mul, coe_le_coe]
exact mul_le_mul_right hbc' _
Expand Down Expand Up @@ -398,7 +398,7 @@ instance instPartialOrder : PartialOrder (WithZero α) :=
instance instMulLeftReflectLT [Mul α] [MulLeftReflectLT α] :
MulLeftReflectLT (WithZero α) := by
refine ⟨fun a b c h => ?_⟩
have := ((zero_le _).trans_lt h).ne'
have := h.ne_zero
induction a
· simp at this
induction c
Expand Down Expand Up @@ -511,7 +511,7 @@ instance instCanonicallyOrderedAdd [AddZeroClass α] [Preorder α] [CanonicallyO

instance instLinearOrderedCommMonoidWithZero [CommMonoid α] [LinearOrder α]
[IsOrderedCancelMonoid α] : LinearOrderedCommMonoidWithZero (WithZero α) where
isBot_zero := WithZero.zero_le
isBot_zero _ := zero_le
mul_lt_mul_of_pos_left
| (a : α), _, 0, (c : α), _ => by simp [← WithZero.coe_mul]
| (a : α), _, (b : α), (c : α), hbc => by norm_cast at *; exact mul_lt_mul_right hbc _
Expand Down
16 changes: 3 additions & 13 deletions Mathlib/FieldTheory/RatFunc/Valuation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,9 @@ theorem InftyValuation.map_mul' (x y : RatFunc F) :

theorem InftyValuation.map_add_le_max' (x y : RatFunc F) :
inftyValuationDef F (x + y) ≤ max (inftyValuationDef F x) (inftyValuationDef F y) := by
by_cases hx : x = 0
· rw [hx, zero_add]
conv_rhs => rw [inftyValuationDef, if_pos (Eq.refl _)]
rw [max_eq_right (WithZero.zero_le (inftyValuationDef F y))]
· by_cases hy : y = 0
· rw [hy, add_zero]
conv_rhs => rw [max_comm, inftyValuationDef, if_pos (Eq.refl _)]
rw [max_eq_right (WithZero.zero_le (inftyValuationDef F x))]
· by_cases hxy : x + y = 0
· rw [inftyValuationDef, if_pos hxy]; exact zero_le'
· rw [inftyValuationDef, inftyValuationDef, inftyValuationDef, if_neg hx, if_neg hy,
if_neg hxy]
simpa using RatFunc.intDegree_add_le hy hxy
unfold inftyValuationDef
have := @RatFunc.intDegree_add_le F
aesop

@[simp]
theorem inftyValuation_of_nonzero {x : RatFunc F} (hx : x ≠ 0) :
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/RingTheory/DedekindDomain/AdicValuation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ theorem intValuation_zero_lt (x : nonZeroDivisors R) : 0 < v.intValuation x := b

/-- The `v`-adic valuation on `R` is bounded above by 1. -/
theorem intValuation_le_one (x : R) : v.intValuation x ≤ 1 := by
by_cases hx : x = 0
· rw [hx, Valuation.map_zero]; exact WithZero.zero_le 1
obtain rfl | hx := eq_or_ne x 0
· simp
· rw [v.intValuation_if_neg hx, ← exp_zero, exp_le_exp, Right.neg_nonpos_iff]
exact Int.natCast_nonneg _

Expand Down Expand Up @@ -711,7 +711,7 @@ lemma adicCompletion.mul_nonZeroDivisor_mem_adicCompletionIntegers (v : HeightOn
-- now manually translate the goal (an inequality in ℤᵐ⁰) to an inequality of "log" of ℤ
simp only [map_pow, mem_adicCompletionIntegers, map_mul, this, inv_pow, ← exp_nsmul, nsmul_one,
Int.natCast_natAbs]
exact mul_inv_le_one_of_le₀ (le_exp_log.trans (by simp [le_abs_self])) (zero_le _)
exact mul_inv_le_one_of_le₀ (le_exp_log.trans (by simp [le_abs_self])) zero_le

instance : FaithfulSMul (v.adicCompletionIntegers K) (v.adicCompletion K) :=
Subsemiring.faithfulSMul _
Expand Down
Loading