Skip to content

Commit 046951e

Browse files
committed
chore: forward-port #18591 (#3078)
1 parent 31b4870 commit 046951e

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

Mathlib/Algebra/Order/Field/Basic.lean

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2014 Robert Lewis. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Robert Lewis, Leonardo de Moura, Mario Carneiro, Floris van Doorn
55
! This file was ported from Lean 3 source module algebra.order.field.basic
6-
! leanprover-community/mathlib commit 5a82b0671532663333e205f422124a98bdfe673f
6+
! leanprover-community/mathlib commit acb3d204d4ee883eb686f45d486a2a6811a01329
77
! Please do not edit these lines, except to modify the commit id
88
! if you have ported upstream changes.
99
-/
@@ -581,7 +581,7 @@ theorem StrictMono.div_const {β : Type _} [Preorder β] {f : β → α} (hf : S
581581
#align strict_mono.div_const StrictMono.div_const
582582

583583
-- see Note [lower instance priority]
584-
instance (priority := 100) LinearOrderedField.toDenselyOrdered : DenselyOrdered α where
584+
instance (priority := 100) LinearOrderedSemiField.toDenselyOrdered : DenselyOrdered α where
585585
dense a₁ a₂ h :=
586586
⟨(a₁ + a₂) / 2,
587587
calc
@@ -592,7 +592,7 @@ instance (priority := 100) LinearOrderedField.toDenselyOrdered : DenselyOrdered
592592
(a₁ + a₂) / 2 < (a₂ + a₂) / 2 := div_lt_div_of_lt zero_lt_two (add_lt_add_right h _)
593593
_ = a₂ := add_self_div_two a₂
594594
595-
#align linear_ordered_field.to_densely_ordered LinearOrderedField.toDenselyOrdered
595+
#align linear_ordered_field.to_densely_ordered LinearOrderedSemiField.toDenselyOrdered
596596

597597
theorem min_div_div_right {c : α} (hc : 0 ≤ c) (a b : α) : min (a / c) (b / c) = min a b / c :=
598598
Eq.symm <| Monotone.map_min fun _ _ => div_le_div_of_le hc
@@ -997,11 +997,4 @@ theorem abs_div (a b : α) : |a / b| = |a| / |b| :=
997997
theorem abs_one_div (a : α) : |1 / a| = 1 / |a| := by rw [abs_div, abs_one]
998998
#align abs_one_div abs_one_div
999999

1000-
theorem pow_minus_two_nonneg : 0 ≤ a ^ (-2 : ℤ) := by
1001-
simp only [inv_nonneg, zpow_neg]
1002-
change 0 ≤ a ^ ((2 : ℕ) : ℤ)
1003-
rw [zpow_ofNat]
1004-
apply sq_nonneg
1005-
#align pow_minus_two_nonneg pow_minus_two_nonneg
1006-
10071000
end

Mathlib/Algebra/Order/Field/Power.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Robert Lewis, Leonardo de Moura, Mario Carneiro, Floris van Doorn
55
66
! This file was ported from Lean 3 source module algebra.order.field.power
7-
! leanprover-community/mathlib commit 422e70f7ce183d2900c586a8cda8381e788a0c62
7+
! leanprover-community/mathlib commit acb3d204d4ee883eb686f45d486a2a6811a01329
88
! Please do not edit these lines, except to modify the commit id
99
! if you have ported upstream changes.
1010
-/
@@ -135,6 +135,10 @@ theorem zpow_two_nonneg (a : α) : 0 ≤ a ^ (2 : ℤ) := by
135135
convert zpow_bit0_nonneg a 1
136136
#align zpow_two_nonneg zpow_two_nonneg
137137

138+
theorem zpow_neg_two_nonneg (a : α) : 0 ≤ a ^ (-2 : ℤ) :=
139+
zpow_bit0_nonneg _ (-1)
140+
#align zpow_neg_two_nonneg zpow_neg_two_nonneg
141+
138142
theorem zpow_bit0_pos (h : a ≠ 0) (n : ℤ) : 0 < a ^ bit0 n :=
139143
(zpow_bit0_nonneg a n).lt_of_ne (zpow_ne_zero _ h).symm
140144
#align zpow_bit0_pos zpow_bit0_pos

0 commit comments

Comments
 (0)