state
stringlengths 0
159k
| srcUpToTactic
stringlengths 387
167k
| nextTactic
stringlengths 3
9k
| declUpToTactic
stringlengths 22
11.5k
| declId
stringlengths 38
95
| decl
stringlengths 16
1.89k
| file_tag
stringlengths 17
73
|
---|---|---|---|---|---|---|
case zero
P : β β Prop
xβ r : β
hr : 1 < r
hxβ : 0 < xβ
base : β x β Ico xβ (r * xβ), P x
step : β n β₯ 1, (β z β Ico xβ (r ^ n * xβ), P z) β β z β Ico (r ^ n * xβ) (r ^ (n + 1) * xβ), P z
β’ β x β Ico xβ (r ^ (Nat.zero + 1) * xβ), P x | /-
Copyright (c) 2022 Bolton Bailey. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Bolton Bailey, Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle SΓΆnne
-/
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Data.Int.Log
#align_import analysis.special_functions.log.base from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690"
/-!
# Real logarithm base `b`
In this file we define `Real.logb` to be the logarithm of a real number in a given base `b`. We
define this as the division of the natural logarithms of the argument and the base, so that we have
a globally defined function with `logb b 0 = 0`, `logb b (-x) = logb b x` `logb 0 x = 0` and
`logb (-b) x = logb b x`.
We prove some basic properties of this function and its relation to `rpow`.
## Tags
logarithm, continuity
-/
open Set Filter Function
open Topology
noncomputable section
namespace Real
variable {b x y : β}
/-- The real logarithm in a given base. As with the natural logarithm, we define `logb b x` to
be `logb b |x|` for `x < 0`, and `0` for `x = 0`.-/
-- @[pp_nodot] -- Porting note: removed
noncomputable def logb (b x : β) : β :=
log x / log b
#align real.logb Real.logb
theorem log_div_log : log x / log b = logb b x :=
rfl
#align real.log_div_log Real.log_div_log
@[simp]
theorem logb_zero : logb b 0 = 0 := by simp [logb]
#align real.logb_zero Real.logb_zero
@[simp]
theorem logb_one : logb b 1 = 0 := by simp [logb]
#align real.logb_one Real.logb_one
@[simp]
lemma logb_self_eq_one (hb : 1 < b) : logb b b = 1 :=
div_self (log_pos hb).ne'
lemma logb_self_eq_one_iff : logb b b = 1 β b β 0 β§ b β 1 β§ b β -1 :=
Iff.trans β¨fun h h' => by simp [logb, h'] at h, div_selfβ© log_ne_zero
@[simp]
theorem logb_abs (x : β) : logb b |x| = logb b x := by rw [logb, logb, log_abs]
#align real.logb_abs Real.logb_abs
@[simp]
theorem logb_neg_eq_logb (x : β) : logb b (-x) = logb b x := by
rw [β logb_abs x, β logb_abs (-x), abs_neg]
#align real.logb_neg_eq_logb Real.logb_neg_eq_logb
theorem logb_mul (hx : x β 0) (hy : y β 0) : logb b (x * y) = logb b x + logb b y := by
simp_rw [logb, log_mul hx hy, add_div]
#align real.logb_mul Real.logb_mul
theorem logb_div (hx : x β 0) (hy : y β 0) : logb b (x / y) = logb b x - logb b y := by
simp_rw [logb, log_div hx hy, sub_div]
#align real.logb_div Real.logb_div
@[simp]
theorem logb_inv (x : β) : logb b xβ»ΒΉ = -logb b x := by simp [logb, neg_div]
#align real.logb_inv Real.logb_inv
theorem inv_logb (a b : β) : (logb a b)β»ΒΉ = logb b a := by simp_rw [logb, inv_div]
#align real.inv_logb Real.inv_logb
theorem inv_logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a * b) c)β»ΒΉ = (logb a c)β»ΒΉ + (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_mul hβ hβ
#align real.inv_logb_mul_base Real.inv_logb_mul_base
theorem inv_logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a / b) c)β»ΒΉ = (logb a c)β»ΒΉ - (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_div hβ hβ
#align real.inv_logb_div_base Real.inv_logb_div_base
theorem logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a * b) c = ((logb a c)β»ΒΉ + (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_mul_base hβ hβ c, inv_inv]
#align real.logb_mul_base Real.logb_mul_base
theorem logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a / b) c = ((logb a c)β»ΒΉ - (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_div_base hβ hβ c, inv_inv]
#align real.logb_div_base Real.logb_div_base
theorem mul_logb {a b c : β} (hβ : b β 0) (hβ : b β 1) (hβ : b β -1) :
logb a b * logb b c = logb a c := by
unfold logb
rw [mul_comm, div_mul_div_cancel _ (log_ne_zero.mpr β¨hβ, hβ, hββ©)]
#align real.mul_logb Real.mul_logb
theorem div_logb {a b c : β} (hβ : c β 0) (hβ : c β 1) (hβ : c β -1) :
logb a c / logb b c = logb a b :=
div_div_div_cancel_left' _ _ <| log_ne_zero.mpr β¨hβ, hβ, hββ©
#align real.div_logb Real.div_logb
section BPosAndNeOne
variable (b_pos : 0 < b) (b_ne_one : b β 1)
private theorem log_b_ne_zero : log b β 0 := by
have b_ne_zero : b β 0; linarith
have b_ne_minus_one : b β -1; linarith
simp [b_ne_one, b_ne_zero, b_ne_minus_one]
@[simp]
theorem logb_rpow : logb b (b ^ x) = x := by
rw [logb, div_eq_iff, log_rpow b_pos]
exact log_b_ne_zero b_pos b_ne_one
#align real.logb_rpow Real.logb_rpow
theorem rpow_logb_eq_abs (hx : x β 0) : b ^ logb b x = |x| := by
apply log_injOn_pos
simp only [Set.mem_Ioi]
apply rpow_pos_of_pos b_pos
simp only [abs_pos, mem_Ioi, Ne.def, hx, not_false_iff]
rw [log_rpow b_pos, logb, log_abs]
field_simp [log_b_ne_zero b_pos b_ne_one]
#align real.rpow_logb_eq_abs Real.rpow_logb_eq_abs
@[simp]
theorem rpow_logb (hx : 0 < x) : b ^ logb b x = x := by
rw [rpow_logb_eq_abs b_pos b_ne_one hx.ne']
exact abs_of_pos hx
#align real.rpow_logb Real.rpow_logb
theorem rpow_logb_of_neg (hx : x < 0) : b ^ logb b x = -x := by
rw [rpow_logb_eq_abs b_pos b_ne_one (ne_of_lt hx)]
exact abs_of_neg hx
#align real.rpow_logb_of_neg Real.rpow_logb_of_neg
theorem surjOn_logb : SurjOn (logb b) (Ioi 0) univ := fun x _ =>
β¨rpow b x, rpow_pos_of_pos b_pos x, logb_rpow b_pos b_ne_oneβ©
#align real.surj_on_logb Real.surjOn_logb
theorem logb_surjective : Surjective (logb b) := fun x => β¨b ^ x, logb_rpow b_pos b_ne_oneβ©
#align real.logb_surjective Real.logb_surjective
@[simp]
theorem range_logb : range (logb b) = univ :=
(logb_surjective b_pos b_ne_one).range_eq
#align real.range_logb Real.range_logb
theorem surjOn_logb' : SurjOn (logb b) (Iio 0) univ := by
intro x _
use -b ^ x
constructor
Β· simp only [Right.neg_neg_iff, Set.mem_Iio]
apply rpow_pos_of_pos b_pos
Β· rw [logb_neg_eq_logb, logb_rpow b_pos b_ne_one]
#align real.surj_on_logb' Real.surjOn_logb'
end BPosAndNeOne
section OneLtB
variable (hb : 1 < b)
private theorem b_pos : 0 < b := by linarith
-- Porting note: prime added to avoid clashing with `b_ne_one` further down the file
private theorem b_ne_one' : b β 1 := by linarith
@[simp]
theorem logb_le_logb (h : 0 < x) (hβ : 0 < y) : logb b x β€ logb b y β x β€ y := by
rw [logb, logb, div_le_div_right (log_pos hb), log_le_log_iff h hβ]
#align real.logb_le_logb Real.logb_le_logb
@[gcongr]
theorem logb_le_logb_of_le (h : 0 < x) (hxy : x β€ y) : logb b x β€ logb b y :=
(logb_le_logb hb h (by linarith)).mpr hxy
@[gcongr]
theorem logb_lt_logb (hx : 0 < x) (hxy : x < y) : logb b x < logb b y := by
rw [logb, logb, div_lt_div_right (log_pos hb)]
exact log_lt_log hx hxy
#align real.logb_lt_logb Real.logb_lt_logb
@[simp]
theorem logb_lt_logb_iff (hx : 0 < x) (hy : 0 < y) : logb b x < logb b y β x < y := by
rw [logb, logb, div_lt_div_right (log_pos hb)]
exact log_lt_log_iff hx hy
#align real.logb_lt_logb_iff Real.logb_lt_logb_iff
theorem logb_le_iff_le_rpow (hx : 0 < x) : logb b x β€ y β x β€ b ^ y := by
rw [β rpow_le_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hx]
#align real.logb_le_iff_le_rpow Real.logb_le_iff_le_rpow
theorem logb_lt_iff_lt_rpow (hx : 0 < x) : logb b x < y β x < b ^ y := by
rw [β rpow_lt_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hx]
#align real.logb_lt_iff_lt_rpow Real.logb_lt_iff_lt_rpow
theorem le_logb_iff_rpow_le (hy : 0 < y) : x β€ logb b y β b ^ x β€ y := by
rw [β rpow_le_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hy]
#align real.le_logb_iff_rpow_le Real.le_logb_iff_rpow_le
theorem lt_logb_iff_rpow_lt (hy : 0 < y) : x < logb b y β b ^ x < y := by
rw [β rpow_lt_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hy]
#align real.lt_logb_iff_rpow_lt Real.lt_logb_iff_rpow_lt
theorem logb_pos_iff (hx : 0 < x) : 0 < logb b x β 1 < x := by
rw [β @logb_one b]
rw [logb_lt_logb_iff hb zero_lt_one hx]
#align real.logb_pos_iff Real.logb_pos_iff
theorem logb_pos (hx : 1 < x) : 0 < logb b x := by
rw [logb_pos_iff hb (lt_trans zero_lt_one hx)]
exact hx
#align real.logb_pos Real.logb_pos
theorem logb_neg_iff (h : 0 < x) : logb b x < 0 β x < 1 := by
rw [β logb_one]
exact logb_lt_logb_iff hb h zero_lt_one
#align real.logb_neg_iff Real.logb_neg_iff
theorem logb_neg (h0 : 0 < x) (h1 : x < 1) : logb b x < 0 :=
(logb_neg_iff hb h0).2 h1
#align real.logb_neg Real.logb_neg
theorem logb_nonneg_iff (hx : 0 < x) : 0 β€ logb b x β 1 β€ x := by
rw [β not_lt, logb_neg_iff hb hx, not_lt]
#align real.logb_nonneg_iff Real.logb_nonneg_iff
theorem logb_nonneg (hx : 1 β€ x) : 0 β€ logb b x :=
(logb_nonneg_iff hb (zero_lt_one.trans_le hx)).2 hx
#align real.logb_nonneg Real.logb_nonneg
theorem logb_nonpos_iff (hx : 0 < x) : logb b x β€ 0 β x β€ 1 := by
rw [β not_lt, logb_pos_iff hb hx, not_lt]
#align real.logb_nonpos_iff Real.logb_nonpos_iff
theorem logb_nonpos_iff' (hx : 0 β€ x) : logb b x β€ 0 β x β€ 1 := by
rcases hx.eq_or_lt with (rfl | hx)
Β· simp [le_refl, zero_le_one]
exact logb_nonpos_iff hb hx
#align real.logb_nonpos_iff' Real.logb_nonpos_iff'
theorem logb_nonpos (hx : 0 β€ x) (h'x : x β€ 1) : logb b x β€ 0 :=
(logb_nonpos_iff' hb hx).2 h'x
#align real.logb_nonpos Real.logb_nonpos
theorem strictMonoOn_logb : StrictMonoOn (logb b) (Set.Ioi 0) := fun _ hx _ _ hxy =>
logb_lt_logb hb hx hxy
#align real.strict_mono_on_logb Real.strictMonoOn_logb
theorem strictAntiOn_logb : StrictAntiOn (logb b) (Set.Iio 0) := by
rintro x (hx : x < 0) y (hy : y < 0) hxy
rw [β logb_abs y, β logb_abs x]
refine' logb_lt_logb hb (abs_pos.2 hy.ne) _
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
#align real.strict_anti_on_logb Real.strictAntiOn_logb
theorem logb_injOn_pos : Set.InjOn (logb b) (Set.Ioi 0) :=
(strictMonoOn_logb hb).injOn
#align real.logb_inj_on_pos Real.logb_injOn_pos
theorem eq_one_of_pos_of_logb_eq_zero (hβ : 0 < x) (hβ : logb b x = 0) : x = 1 :=
logb_injOn_pos hb (Set.mem_Ioi.2 hβ) (Set.mem_Ioi.2 zero_lt_one) (hβ.trans Real.logb_one.symm)
#align real.eq_one_of_pos_of_logb_eq_zero Real.eq_one_of_pos_of_logb_eq_zero
theorem logb_ne_zero_of_pos_of_ne_one (hx_pos : 0 < x) (hx : x β 1) : logb b x β 0 :=
mt (eq_one_of_pos_of_logb_eq_zero hb hx_pos) hx
#align real.logb_ne_zero_of_pos_of_ne_one Real.logb_ne_zero_of_pos_of_ne_one
theorem tendsto_logb_atTop : Tendsto (logb b) atTop atTop :=
Tendsto.atTop_div_const (log_pos hb) tendsto_log_atTop
#align real.tendsto_logb_at_top Real.tendsto_logb_atTop
end OneLtB
section BPosAndBLtOne
variable (b_pos : 0 < b) (b_lt_one : b < 1)
private theorem b_ne_one : b β 1 := by linarith
@[simp]
theorem logb_le_logb_of_base_lt_one (h : 0 < x) (hβ : 0 < y) : logb b x β€ logb b y β y β€ x := by
rw [logb, logb, div_le_div_right_of_neg (log_neg b_pos b_lt_one), log_le_log_iff hβ h]
#align real.logb_le_logb_of_base_lt_one Real.logb_le_logb_of_base_lt_one
theorem logb_lt_logb_of_base_lt_one (hx : 0 < x) (hxy : x < y) : logb b y < logb b x := by
rw [logb, logb, div_lt_div_right_of_neg (log_neg b_pos b_lt_one)]
exact log_lt_log hx hxy
#align real.logb_lt_logb_of_base_lt_one Real.logb_lt_logb_of_base_lt_one
@[simp]
theorem logb_lt_logb_iff_of_base_lt_one (hx : 0 < x) (hy : 0 < y) :
logb b x < logb b y β y < x := by
rw [logb, logb, div_lt_div_right_of_neg (log_neg b_pos b_lt_one)]
exact log_lt_log_iff hy hx
#align real.logb_lt_logb_iff_of_base_lt_one Real.logb_lt_logb_iff_of_base_lt_one
theorem logb_le_iff_le_rpow_of_base_lt_one (hx : 0 < x) : logb b x β€ y β b ^ y β€ x := by
rw [β rpow_le_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hx]
#align real.logb_le_iff_le_rpow_of_base_lt_one Real.logb_le_iff_le_rpow_of_base_lt_one
theorem logb_lt_iff_lt_rpow_of_base_lt_one (hx : 0 < x) : logb b x < y β b ^ y < x := by
rw [β rpow_lt_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hx]
#align real.logb_lt_iff_lt_rpow_of_base_lt_one Real.logb_lt_iff_lt_rpow_of_base_lt_one
theorem le_logb_iff_rpow_le_of_base_lt_one (hy : 0 < y) : x β€ logb b y β y β€ b ^ x := by
rw [β rpow_le_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hy]
#align real.le_logb_iff_rpow_le_of_base_lt_one Real.le_logb_iff_rpow_le_of_base_lt_one
theorem lt_logb_iff_rpow_lt_of_base_lt_one (hy : 0 < y) : x < logb b y β y < b ^ x := by
rw [β rpow_lt_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hy]
#align real.lt_logb_iff_rpow_lt_of_base_lt_one Real.lt_logb_iff_rpow_lt_of_base_lt_one
theorem logb_pos_iff_of_base_lt_one (hx : 0 < x) : 0 < logb b x β x < 1 := by
rw [β @logb_one b, logb_lt_logb_iff_of_base_lt_one b_pos b_lt_one zero_lt_one hx]
#align real.logb_pos_iff_of_base_lt_one Real.logb_pos_iff_of_base_lt_one
theorem logb_pos_of_base_lt_one (hx : 0 < x) (hx' : x < 1) : 0 < logb b x := by
rw [logb_pos_iff_of_base_lt_one b_pos b_lt_one hx]
exact hx'
#align real.logb_pos_of_base_lt_one Real.logb_pos_of_base_lt_one
theorem logb_neg_iff_of_base_lt_one (h : 0 < x) : logb b x < 0 β 1 < x := by
rw [β @logb_one b, logb_lt_logb_iff_of_base_lt_one b_pos b_lt_one h zero_lt_one]
#align real.logb_neg_iff_of_base_lt_one Real.logb_neg_iff_of_base_lt_one
theorem logb_neg_of_base_lt_one (h1 : 1 < x) : logb b x < 0 :=
(logb_neg_iff_of_base_lt_one b_pos b_lt_one (lt_trans zero_lt_one h1)).2 h1
#align real.logb_neg_of_base_lt_one Real.logb_neg_of_base_lt_one
theorem logb_nonneg_iff_of_base_lt_one (hx : 0 < x) : 0 β€ logb b x β x β€ 1 := by
rw [β not_lt, logb_neg_iff_of_base_lt_one b_pos b_lt_one hx, not_lt]
#align real.logb_nonneg_iff_of_base_lt_one Real.logb_nonneg_iff_of_base_lt_one
theorem logb_nonneg_of_base_lt_one (hx : 0 < x) (hx' : x β€ 1) : 0 β€ logb b x := by
rw [logb_nonneg_iff_of_base_lt_one b_pos b_lt_one hx]
exact hx'
#align real.logb_nonneg_of_base_lt_one Real.logb_nonneg_of_base_lt_one
theorem logb_nonpos_iff_of_base_lt_one (hx : 0 < x) : logb b x β€ 0 β 1 β€ x := by
rw [β not_lt, logb_pos_iff_of_base_lt_one b_pos b_lt_one hx, not_lt]
#align real.logb_nonpos_iff_of_base_lt_one Real.logb_nonpos_iff_of_base_lt_one
theorem strictAntiOn_logb_of_base_lt_one : StrictAntiOn (logb b) (Set.Ioi 0) := fun _ hx _ _ hxy =>
logb_lt_logb_of_base_lt_one b_pos b_lt_one hx hxy
#align real.strict_anti_on_logb_of_base_lt_one Real.strictAntiOn_logb_of_base_lt_one
theorem strictMonoOn_logb_of_base_lt_one : StrictMonoOn (logb b) (Set.Iio 0) := by
rintro x (hx : x < 0) y (hy : y < 0) hxy
rw [β logb_abs y, β logb_abs x]
refine' logb_lt_logb_of_base_lt_one b_pos b_lt_one (abs_pos.2 hy.ne) _
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
#align real.strict_mono_on_logb_of_base_lt_one Real.strictMonoOn_logb_of_base_lt_one
theorem logb_injOn_pos_of_base_lt_one : Set.InjOn (logb b) (Set.Ioi 0) :=
(strictAntiOn_logb_of_base_lt_one b_pos b_lt_one).injOn
#align real.logb_inj_on_pos_of_base_lt_one Real.logb_injOn_pos_of_base_lt_one
theorem eq_one_of_pos_of_logb_eq_zero_of_base_lt_one (hβ : 0 < x) (hβ : logb b x = 0) : x = 1 :=
logb_injOn_pos_of_base_lt_one b_pos b_lt_one (Set.mem_Ioi.2 hβ) (Set.mem_Ioi.2 zero_lt_one)
(hβ.trans Real.logb_one.symm)
#align real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one Real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one
theorem logb_ne_zero_of_pos_of_ne_one_of_base_lt_one (hx_pos : 0 < x) (hx : x β 1) : logb b x β 0 :=
mt (eq_one_of_pos_of_logb_eq_zero_of_base_lt_one b_pos b_lt_one hx_pos) hx
#align real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one Real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one
theorem tendsto_logb_atTop_of_base_lt_one : Tendsto (logb b) atTop atBot := by
rw [tendsto_atTop_atBot]
intro e
use 1 β b ^ e
intro a
simp only [and_imp, sup_le_iff]
intro ha
rw [logb_le_iff_le_rpow_of_base_lt_one b_pos b_lt_one]
tauto
exact lt_of_lt_of_le zero_lt_one ha
#align real.tendsto_logb_at_top_of_base_lt_one Real.tendsto_logb_atTop_of_base_lt_one
end BPosAndBLtOne
theorem floor_logb_nat_cast {b : β} {r : β} (hb : 1 < b) (hr : 0 β€ r) :
βlogb b rβ = Int.log b r := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [logb_zero, Int.log_zero_right, Int.floor_zero]
have hb1' : 1 < (b : β) := Nat.one_lt_cast.mpr hb
apply le_antisymm
Β· rw [β Int.zpow_le_iff_le_log hb hr, β rpow_int_cast b]
refine' le_of_le_of_eq _ (rpow_logb (zero_lt_one.trans hb1') hb1'.ne' hr)
exact rpow_le_rpow_of_exponent_le hb1'.le (Int.floor_le _)
Β· rw [Int.le_floor, le_logb_iff_rpow_le hb1' hr, rpow_int_cast]
exact Int.zpow_log_le_self hb hr
#align real.floor_logb_nat_cast Real.floor_logb_nat_cast
theorem ceil_logb_nat_cast {b : β} {r : β} (hb : 1 < b) (hr : 0 β€ r) :
βlogb b rβ = Int.clog b r := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [logb_zero, Int.clog_zero_right, Int.ceil_zero]
have hb1' : 1 < (b : β) := Nat.one_lt_cast.mpr hb
apply le_antisymm
Β· rw [Int.ceil_le, logb_le_iff_le_rpow hb1' hr, rpow_int_cast]
refine' Int.self_le_zpow_clog hb r
Β· rw [β Int.le_zpow_iff_clog_le hb hr, β rpow_int_cast b]
refine' (rpow_logb (zero_lt_one.trans hb1') hb1'.ne' hr).symm.trans_le _
exact rpow_le_rpow_of_exponent_le hb1'.le (Int.le_ceil _)
#align real.ceil_logb_nat_cast Real.ceil_logb_nat_cast
@[simp]
theorem logb_eq_zero : logb b x = 0 β b = 0 β¨ b = 1 β¨ b = -1 β¨ x = 0 β¨ x = 1 β¨ x = -1 := by
simp_rw [logb, div_eq_zero_iff, log_eq_zero]
tauto
#align real.logb_eq_zero Real.logb_eq_zero
-- TODO add other limits and continuous API lemmas analogous to those in Log.lean
open BigOperators
theorem logb_prod {Ξ± : Type*} (s : Finset Ξ±) (f : Ξ± β β) (hf : β x β s, f x β 0) :
logb b (β i in s, f i) = β i in s, logb b (f i) := by
classical
induction' s using Finset.induction_on with a s ha ih
Β· simp
simp only [Finset.mem_insert, forall_eq_or_imp] at hf
simp [ha, ih hf.2, logb_mul hf.1 (Finset.prod_ne_zero_iff.2 hf.2)]
#align real.logb_prod Real.logb_prod
end Real
section Induction
/-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x := by
suffices β n : β, β x β Set.Ico xβ (r ^ (n + 1) * xβ), P x by
intro x hx
have hx' : 0 < x / xβ := div_pos (hxβ.trans_le hx) hxβ
refine this βlogb r (x / xβ)ββ x ?_
rw [mem_Ico, β div_lt_iff hxβ, β rpow_nat_cast, β logb_lt_iff_lt_rpow hr hx', Nat.cast_add,
Nat.cast_one]
exact β¨hx, Nat.lt_floor_add_one _β©
intro n
induction n with
| | zero => simpa using base | /-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x := by
suffices β n : β, β x β Set.Ico xβ (r ^ (n + 1) * xβ), P x by
intro x hx
have hx' : 0 < x / xβ := div_pos (hxβ.trans_le hx) hxβ
refine this βlogb r (x / xβ)ββ x ?_
rw [mem_Ico, β div_lt_iff hxβ, β rpow_nat_cast, β logb_lt_iff_lt_rpow hr hx', Nat.cast_add,
Nat.cast_one]
exact β¨hx, Nat.lt_floor_add_one _β©
intro n
induction n with
| Mathlib.Analysis.SpecialFunctions.Log.Base.445_0.egNyp4fdqSCAE7f | /-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x | Mathlib_Analysis_SpecialFunctions_Log_Base |
case zero
P : β β Prop
xβ r : β
hr : 1 < r
hxβ : 0 < xβ
base : β x β Ico xβ (r * xβ), P x
step : β n β₯ 1, (β z β Ico xβ (r ^ n * xβ), P z) β β z β Ico (r ^ n * xβ) (r ^ (n + 1) * xβ), P z
β’ β x β Ico xβ (r ^ (Nat.zero + 1) * xβ), P x | /-
Copyright (c) 2022 Bolton Bailey. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Bolton Bailey, Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle SΓΆnne
-/
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Data.Int.Log
#align_import analysis.special_functions.log.base from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690"
/-!
# Real logarithm base `b`
In this file we define `Real.logb` to be the logarithm of a real number in a given base `b`. We
define this as the division of the natural logarithms of the argument and the base, so that we have
a globally defined function with `logb b 0 = 0`, `logb b (-x) = logb b x` `logb 0 x = 0` and
`logb (-b) x = logb b x`.
We prove some basic properties of this function and its relation to `rpow`.
## Tags
logarithm, continuity
-/
open Set Filter Function
open Topology
noncomputable section
namespace Real
variable {b x y : β}
/-- The real logarithm in a given base. As with the natural logarithm, we define `logb b x` to
be `logb b |x|` for `x < 0`, and `0` for `x = 0`.-/
-- @[pp_nodot] -- Porting note: removed
noncomputable def logb (b x : β) : β :=
log x / log b
#align real.logb Real.logb
theorem log_div_log : log x / log b = logb b x :=
rfl
#align real.log_div_log Real.log_div_log
@[simp]
theorem logb_zero : logb b 0 = 0 := by simp [logb]
#align real.logb_zero Real.logb_zero
@[simp]
theorem logb_one : logb b 1 = 0 := by simp [logb]
#align real.logb_one Real.logb_one
@[simp]
lemma logb_self_eq_one (hb : 1 < b) : logb b b = 1 :=
div_self (log_pos hb).ne'
lemma logb_self_eq_one_iff : logb b b = 1 β b β 0 β§ b β 1 β§ b β -1 :=
Iff.trans β¨fun h h' => by simp [logb, h'] at h, div_selfβ© log_ne_zero
@[simp]
theorem logb_abs (x : β) : logb b |x| = logb b x := by rw [logb, logb, log_abs]
#align real.logb_abs Real.logb_abs
@[simp]
theorem logb_neg_eq_logb (x : β) : logb b (-x) = logb b x := by
rw [β logb_abs x, β logb_abs (-x), abs_neg]
#align real.logb_neg_eq_logb Real.logb_neg_eq_logb
theorem logb_mul (hx : x β 0) (hy : y β 0) : logb b (x * y) = logb b x + logb b y := by
simp_rw [logb, log_mul hx hy, add_div]
#align real.logb_mul Real.logb_mul
theorem logb_div (hx : x β 0) (hy : y β 0) : logb b (x / y) = logb b x - logb b y := by
simp_rw [logb, log_div hx hy, sub_div]
#align real.logb_div Real.logb_div
@[simp]
theorem logb_inv (x : β) : logb b xβ»ΒΉ = -logb b x := by simp [logb, neg_div]
#align real.logb_inv Real.logb_inv
theorem inv_logb (a b : β) : (logb a b)β»ΒΉ = logb b a := by simp_rw [logb, inv_div]
#align real.inv_logb Real.inv_logb
theorem inv_logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a * b) c)β»ΒΉ = (logb a c)β»ΒΉ + (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_mul hβ hβ
#align real.inv_logb_mul_base Real.inv_logb_mul_base
theorem inv_logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a / b) c)β»ΒΉ = (logb a c)β»ΒΉ - (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_div hβ hβ
#align real.inv_logb_div_base Real.inv_logb_div_base
theorem logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a * b) c = ((logb a c)β»ΒΉ + (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_mul_base hβ hβ c, inv_inv]
#align real.logb_mul_base Real.logb_mul_base
theorem logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a / b) c = ((logb a c)β»ΒΉ - (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_div_base hβ hβ c, inv_inv]
#align real.logb_div_base Real.logb_div_base
theorem mul_logb {a b c : β} (hβ : b β 0) (hβ : b β 1) (hβ : b β -1) :
logb a b * logb b c = logb a c := by
unfold logb
rw [mul_comm, div_mul_div_cancel _ (log_ne_zero.mpr β¨hβ, hβ, hββ©)]
#align real.mul_logb Real.mul_logb
theorem div_logb {a b c : β} (hβ : c β 0) (hβ : c β 1) (hβ : c β -1) :
logb a c / logb b c = logb a b :=
div_div_div_cancel_left' _ _ <| log_ne_zero.mpr β¨hβ, hβ, hββ©
#align real.div_logb Real.div_logb
section BPosAndNeOne
variable (b_pos : 0 < b) (b_ne_one : b β 1)
private theorem log_b_ne_zero : log b β 0 := by
have b_ne_zero : b β 0; linarith
have b_ne_minus_one : b β -1; linarith
simp [b_ne_one, b_ne_zero, b_ne_minus_one]
@[simp]
theorem logb_rpow : logb b (b ^ x) = x := by
rw [logb, div_eq_iff, log_rpow b_pos]
exact log_b_ne_zero b_pos b_ne_one
#align real.logb_rpow Real.logb_rpow
theorem rpow_logb_eq_abs (hx : x β 0) : b ^ logb b x = |x| := by
apply log_injOn_pos
simp only [Set.mem_Ioi]
apply rpow_pos_of_pos b_pos
simp only [abs_pos, mem_Ioi, Ne.def, hx, not_false_iff]
rw [log_rpow b_pos, logb, log_abs]
field_simp [log_b_ne_zero b_pos b_ne_one]
#align real.rpow_logb_eq_abs Real.rpow_logb_eq_abs
@[simp]
theorem rpow_logb (hx : 0 < x) : b ^ logb b x = x := by
rw [rpow_logb_eq_abs b_pos b_ne_one hx.ne']
exact abs_of_pos hx
#align real.rpow_logb Real.rpow_logb
theorem rpow_logb_of_neg (hx : x < 0) : b ^ logb b x = -x := by
rw [rpow_logb_eq_abs b_pos b_ne_one (ne_of_lt hx)]
exact abs_of_neg hx
#align real.rpow_logb_of_neg Real.rpow_logb_of_neg
theorem surjOn_logb : SurjOn (logb b) (Ioi 0) univ := fun x _ =>
β¨rpow b x, rpow_pos_of_pos b_pos x, logb_rpow b_pos b_ne_oneβ©
#align real.surj_on_logb Real.surjOn_logb
theorem logb_surjective : Surjective (logb b) := fun x => β¨b ^ x, logb_rpow b_pos b_ne_oneβ©
#align real.logb_surjective Real.logb_surjective
@[simp]
theorem range_logb : range (logb b) = univ :=
(logb_surjective b_pos b_ne_one).range_eq
#align real.range_logb Real.range_logb
theorem surjOn_logb' : SurjOn (logb b) (Iio 0) univ := by
intro x _
use -b ^ x
constructor
Β· simp only [Right.neg_neg_iff, Set.mem_Iio]
apply rpow_pos_of_pos b_pos
Β· rw [logb_neg_eq_logb, logb_rpow b_pos b_ne_one]
#align real.surj_on_logb' Real.surjOn_logb'
end BPosAndNeOne
section OneLtB
variable (hb : 1 < b)
private theorem b_pos : 0 < b := by linarith
-- Porting note: prime added to avoid clashing with `b_ne_one` further down the file
private theorem b_ne_one' : b β 1 := by linarith
@[simp]
theorem logb_le_logb (h : 0 < x) (hβ : 0 < y) : logb b x β€ logb b y β x β€ y := by
rw [logb, logb, div_le_div_right (log_pos hb), log_le_log_iff h hβ]
#align real.logb_le_logb Real.logb_le_logb
@[gcongr]
theorem logb_le_logb_of_le (h : 0 < x) (hxy : x β€ y) : logb b x β€ logb b y :=
(logb_le_logb hb h (by linarith)).mpr hxy
@[gcongr]
theorem logb_lt_logb (hx : 0 < x) (hxy : x < y) : logb b x < logb b y := by
rw [logb, logb, div_lt_div_right (log_pos hb)]
exact log_lt_log hx hxy
#align real.logb_lt_logb Real.logb_lt_logb
@[simp]
theorem logb_lt_logb_iff (hx : 0 < x) (hy : 0 < y) : logb b x < logb b y β x < y := by
rw [logb, logb, div_lt_div_right (log_pos hb)]
exact log_lt_log_iff hx hy
#align real.logb_lt_logb_iff Real.logb_lt_logb_iff
theorem logb_le_iff_le_rpow (hx : 0 < x) : logb b x β€ y β x β€ b ^ y := by
rw [β rpow_le_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hx]
#align real.logb_le_iff_le_rpow Real.logb_le_iff_le_rpow
theorem logb_lt_iff_lt_rpow (hx : 0 < x) : logb b x < y β x < b ^ y := by
rw [β rpow_lt_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hx]
#align real.logb_lt_iff_lt_rpow Real.logb_lt_iff_lt_rpow
theorem le_logb_iff_rpow_le (hy : 0 < y) : x β€ logb b y β b ^ x β€ y := by
rw [β rpow_le_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hy]
#align real.le_logb_iff_rpow_le Real.le_logb_iff_rpow_le
theorem lt_logb_iff_rpow_lt (hy : 0 < y) : x < logb b y β b ^ x < y := by
rw [β rpow_lt_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hy]
#align real.lt_logb_iff_rpow_lt Real.lt_logb_iff_rpow_lt
theorem logb_pos_iff (hx : 0 < x) : 0 < logb b x β 1 < x := by
rw [β @logb_one b]
rw [logb_lt_logb_iff hb zero_lt_one hx]
#align real.logb_pos_iff Real.logb_pos_iff
theorem logb_pos (hx : 1 < x) : 0 < logb b x := by
rw [logb_pos_iff hb (lt_trans zero_lt_one hx)]
exact hx
#align real.logb_pos Real.logb_pos
theorem logb_neg_iff (h : 0 < x) : logb b x < 0 β x < 1 := by
rw [β logb_one]
exact logb_lt_logb_iff hb h zero_lt_one
#align real.logb_neg_iff Real.logb_neg_iff
theorem logb_neg (h0 : 0 < x) (h1 : x < 1) : logb b x < 0 :=
(logb_neg_iff hb h0).2 h1
#align real.logb_neg Real.logb_neg
theorem logb_nonneg_iff (hx : 0 < x) : 0 β€ logb b x β 1 β€ x := by
rw [β not_lt, logb_neg_iff hb hx, not_lt]
#align real.logb_nonneg_iff Real.logb_nonneg_iff
theorem logb_nonneg (hx : 1 β€ x) : 0 β€ logb b x :=
(logb_nonneg_iff hb (zero_lt_one.trans_le hx)).2 hx
#align real.logb_nonneg Real.logb_nonneg
theorem logb_nonpos_iff (hx : 0 < x) : logb b x β€ 0 β x β€ 1 := by
rw [β not_lt, logb_pos_iff hb hx, not_lt]
#align real.logb_nonpos_iff Real.logb_nonpos_iff
theorem logb_nonpos_iff' (hx : 0 β€ x) : logb b x β€ 0 β x β€ 1 := by
rcases hx.eq_or_lt with (rfl | hx)
Β· simp [le_refl, zero_le_one]
exact logb_nonpos_iff hb hx
#align real.logb_nonpos_iff' Real.logb_nonpos_iff'
theorem logb_nonpos (hx : 0 β€ x) (h'x : x β€ 1) : logb b x β€ 0 :=
(logb_nonpos_iff' hb hx).2 h'x
#align real.logb_nonpos Real.logb_nonpos
theorem strictMonoOn_logb : StrictMonoOn (logb b) (Set.Ioi 0) := fun _ hx _ _ hxy =>
logb_lt_logb hb hx hxy
#align real.strict_mono_on_logb Real.strictMonoOn_logb
theorem strictAntiOn_logb : StrictAntiOn (logb b) (Set.Iio 0) := by
rintro x (hx : x < 0) y (hy : y < 0) hxy
rw [β logb_abs y, β logb_abs x]
refine' logb_lt_logb hb (abs_pos.2 hy.ne) _
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
#align real.strict_anti_on_logb Real.strictAntiOn_logb
theorem logb_injOn_pos : Set.InjOn (logb b) (Set.Ioi 0) :=
(strictMonoOn_logb hb).injOn
#align real.logb_inj_on_pos Real.logb_injOn_pos
theorem eq_one_of_pos_of_logb_eq_zero (hβ : 0 < x) (hβ : logb b x = 0) : x = 1 :=
logb_injOn_pos hb (Set.mem_Ioi.2 hβ) (Set.mem_Ioi.2 zero_lt_one) (hβ.trans Real.logb_one.symm)
#align real.eq_one_of_pos_of_logb_eq_zero Real.eq_one_of_pos_of_logb_eq_zero
theorem logb_ne_zero_of_pos_of_ne_one (hx_pos : 0 < x) (hx : x β 1) : logb b x β 0 :=
mt (eq_one_of_pos_of_logb_eq_zero hb hx_pos) hx
#align real.logb_ne_zero_of_pos_of_ne_one Real.logb_ne_zero_of_pos_of_ne_one
theorem tendsto_logb_atTop : Tendsto (logb b) atTop atTop :=
Tendsto.atTop_div_const (log_pos hb) tendsto_log_atTop
#align real.tendsto_logb_at_top Real.tendsto_logb_atTop
end OneLtB
section BPosAndBLtOne
variable (b_pos : 0 < b) (b_lt_one : b < 1)
private theorem b_ne_one : b β 1 := by linarith
@[simp]
theorem logb_le_logb_of_base_lt_one (h : 0 < x) (hβ : 0 < y) : logb b x β€ logb b y β y β€ x := by
rw [logb, logb, div_le_div_right_of_neg (log_neg b_pos b_lt_one), log_le_log_iff hβ h]
#align real.logb_le_logb_of_base_lt_one Real.logb_le_logb_of_base_lt_one
theorem logb_lt_logb_of_base_lt_one (hx : 0 < x) (hxy : x < y) : logb b y < logb b x := by
rw [logb, logb, div_lt_div_right_of_neg (log_neg b_pos b_lt_one)]
exact log_lt_log hx hxy
#align real.logb_lt_logb_of_base_lt_one Real.logb_lt_logb_of_base_lt_one
@[simp]
theorem logb_lt_logb_iff_of_base_lt_one (hx : 0 < x) (hy : 0 < y) :
logb b x < logb b y β y < x := by
rw [logb, logb, div_lt_div_right_of_neg (log_neg b_pos b_lt_one)]
exact log_lt_log_iff hy hx
#align real.logb_lt_logb_iff_of_base_lt_one Real.logb_lt_logb_iff_of_base_lt_one
theorem logb_le_iff_le_rpow_of_base_lt_one (hx : 0 < x) : logb b x β€ y β b ^ y β€ x := by
rw [β rpow_le_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hx]
#align real.logb_le_iff_le_rpow_of_base_lt_one Real.logb_le_iff_le_rpow_of_base_lt_one
theorem logb_lt_iff_lt_rpow_of_base_lt_one (hx : 0 < x) : logb b x < y β b ^ y < x := by
rw [β rpow_lt_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hx]
#align real.logb_lt_iff_lt_rpow_of_base_lt_one Real.logb_lt_iff_lt_rpow_of_base_lt_one
theorem le_logb_iff_rpow_le_of_base_lt_one (hy : 0 < y) : x β€ logb b y β y β€ b ^ x := by
rw [β rpow_le_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hy]
#align real.le_logb_iff_rpow_le_of_base_lt_one Real.le_logb_iff_rpow_le_of_base_lt_one
theorem lt_logb_iff_rpow_lt_of_base_lt_one (hy : 0 < y) : x < logb b y β y < b ^ x := by
rw [β rpow_lt_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hy]
#align real.lt_logb_iff_rpow_lt_of_base_lt_one Real.lt_logb_iff_rpow_lt_of_base_lt_one
theorem logb_pos_iff_of_base_lt_one (hx : 0 < x) : 0 < logb b x β x < 1 := by
rw [β @logb_one b, logb_lt_logb_iff_of_base_lt_one b_pos b_lt_one zero_lt_one hx]
#align real.logb_pos_iff_of_base_lt_one Real.logb_pos_iff_of_base_lt_one
theorem logb_pos_of_base_lt_one (hx : 0 < x) (hx' : x < 1) : 0 < logb b x := by
rw [logb_pos_iff_of_base_lt_one b_pos b_lt_one hx]
exact hx'
#align real.logb_pos_of_base_lt_one Real.logb_pos_of_base_lt_one
theorem logb_neg_iff_of_base_lt_one (h : 0 < x) : logb b x < 0 β 1 < x := by
rw [β @logb_one b, logb_lt_logb_iff_of_base_lt_one b_pos b_lt_one h zero_lt_one]
#align real.logb_neg_iff_of_base_lt_one Real.logb_neg_iff_of_base_lt_one
theorem logb_neg_of_base_lt_one (h1 : 1 < x) : logb b x < 0 :=
(logb_neg_iff_of_base_lt_one b_pos b_lt_one (lt_trans zero_lt_one h1)).2 h1
#align real.logb_neg_of_base_lt_one Real.logb_neg_of_base_lt_one
theorem logb_nonneg_iff_of_base_lt_one (hx : 0 < x) : 0 β€ logb b x β x β€ 1 := by
rw [β not_lt, logb_neg_iff_of_base_lt_one b_pos b_lt_one hx, not_lt]
#align real.logb_nonneg_iff_of_base_lt_one Real.logb_nonneg_iff_of_base_lt_one
theorem logb_nonneg_of_base_lt_one (hx : 0 < x) (hx' : x β€ 1) : 0 β€ logb b x := by
rw [logb_nonneg_iff_of_base_lt_one b_pos b_lt_one hx]
exact hx'
#align real.logb_nonneg_of_base_lt_one Real.logb_nonneg_of_base_lt_one
theorem logb_nonpos_iff_of_base_lt_one (hx : 0 < x) : logb b x β€ 0 β 1 β€ x := by
rw [β not_lt, logb_pos_iff_of_base_lt_one b_pos b_lt_one hx, not_lt]
#align real.logb_nonpos_iff_of_base_lt_one Real.logb_nonpos_iff_of_base_lt_one
theorem strictAntiOn_logb_of_base_lt_one : StrictAntiOn (logb b) (Set.Ioi 0) := fun _ hx _ _ hxy =>
logb_lt_logb_of_base_lt_one b_pos b_lt_one hx hxy
#align real.strict_anti_on_logb_of_base_lt_one Real.strictAntiOn_logb_of_base_lt_one
theorem strictMonoOn_logb_of_base_lt_one : StrictMonoOn (logb b) (Set.Iio 0) := by
rintro x (hx : x < 0) y (hy : y < 0) hxy
rw [β logb_abs y, β logb_abs x]
refine' logb_lt_logb_of_base_lt_one b_pos b_lt_one (abs_pos.2 hy.ne) _
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
#align real.strict_mono_on_logb_of_base_lt_one Real.strictMonoOn_logb_of_base_lt_one
theorem logb_injOn_pos_of_base_lt_one : Set.InjOn (logb b) (Set.Ioi 0) :=
(strictAntiOn_logb_of_base_lt_one b_pos b_lt_one).injOn
#align real.logb_inj_on_pos_of_base_lt_one Real.logb_injOn_pos_of_base_lt_one
theorem eq_one_of_pos_of_logb_eq_zero_of_base_lt_one (hβ : 0 < x) (hβ : logb b x = 0) : x = 1 :=
logb_injOn_pos_of_base_lt_one b_pos b_lt_one (Set.mem_Ioi.2 hβ) (Set.mem_Ioi.2 zero_lt_one)
(hβ.trans Real.logb_one.symm)
#align real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one Real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one
theorem logb_ne_zero_of_pos_of_ne_one_of_base_lt_one (hx_pos : 0 < x) (hx : x β 1) : logb b x β 0 :=
mt (eq_one_of_pos_of_logb_eq_zero_of_base_lt_one b_pos b_lt_one hx_pos) hx
#align real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one Real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one
theorem tendsto_logb_atTop_of_base_lt_one : Tendsto (logb b) atTop atBot := by
rw [tendsto_atTop_atBot]
intro e
use 1 β b ^ e
intro a
simp only [and_imp, sup_le_iff]
intro ha
rw [logb_le_iff_le_rpow_of_base_lt_one b_pos b_lt_one]
tauto
exact lt_of_lt_of_le zero_lt_one ha
#align real.tendsto_logb_at_top_of_base_lt_one Real.tendsto_logb_atTop_of_base_lt_one
end BPosAndBLtOne
theorem floor_logb_nat_cast {b : β} {r : β} (hb : 1 < b) (hr : 0 β€ r) :
βlogb b rβ = Int.log b r := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [logb_zero, Int.log_zero_right, Int.floor_zero]
have hb1' : 1 < (b : β) := Nat.one_lt_cast.mpr hb
apply le_antisymm
Β· rw [β Int.zpow_le_iff_le_log hb hr, β rpow_int_cast b]
refine' le_of_le_of_eq _ (rpow_logb (zero_lt_one.trans hb1') hb1'.ne' hr)
exact rpow_le_rpow_of_exponent_le hb1'.le (Int.floor_le _)
Β· rw [Int.le_floor, le_logb_iff_rpow_le hb1' hr, rpow_int_cast]
exact Int.zpow_log_le_self hb hr
#align real.floor_logb_nat_cast Real.floor_logb_nat_cast
theorem ceil_logb_nat_cast {b : β} {r : β} (hb : 1 < b) (hr : 0 β€ r) :
βlogb b rβ = Int.clog b r := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [logb_zero, Int.clog_zero_right, Int.ceil_zero]
have hb1' : 1 < (b : β) := Nat.one_lt_cast.mpr hb
apply le_antisymm
Β· rw [Int.ceil_le, logb_le_iff_le_rpow hb1' hr, rpow_int_cast]
refine' Int.self_le_zpow_clog hb r
Β· rw [β Int.le_zpow_iff_clog_le hb hr, β rpow_int_cast b]
refine' (rpow_logb (zero_lt_one.trans hb1') hb1'.ne' hr).symm.trans_le _
exact rpow_le_rpow_of_exponent_le hb1'.le (Int.le_ceil _)
#align real.ceil_logb_nat_cast Real.ceil_logb_nat_cast
@[simp]
theorem logb_eq_zero : logb b x = 0 β b = 0 β¨ b = 1 β¨ b = -1 β¨ x = 0 β¨ x = 1 β¨ x = -1 := by
simp_rw [logb, div_eq_zero_iff, log_eq_zero]
tauto
#align real.logb_eq_zero Real.logb_eq_zero
-- TODO add other limits and continuous API lemmas analogous to those in Log.lean
open BigOperators
theorem logb_prod {Ξ± : Type*} (s : Finset Ξ±) (f : Ξ± β β) (hf : β x β s, f x β 0) :
logb b (β i in s, f i) = β i in s, logb b (f i) := by
classical
induction' s using Finset.induction_on with a s ha ih
Β· simp
simp only [Finset.mem_insert, forall_eq_or_imp] at hf
simp [ha, ih hf.2, logb_mul hf.1 (Finset.prod_ne_zero_iff.2 hf.2)]
#align real.logb_prod Real.logb_prod
end Real
section Induction
/-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x := by
suffices β n : β, β x β Set.Ico xβ (r ^ (n + 1) * xβ), P x by
intro x hx
have hx' : 0 < x / xβ := div_pos (hxβ.trans_le hx) hxβ
refine this βlogb r (x / xβ)ββ x ?_
rw [mem_Ico, β div_lt_iff hxβ, β rpow_nat_cast, β logb_lt_iff_lt_rpow hr hx', Nat.cast_add,
Nat.cast_one]
exact β¨hx, Nat.lt_floor_add_one _β©
intro n
induction n with
| zero => | simpa using base | /-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x := by
suffices β n : β, β x β Set.Ico xβ (r ^ (n + 1) * xβ), P x by
intro x hx
have hx' : 0 < x / xβ := div_pos (hxβ.trans_le hx) hxβ
refine this βlogb r (x / xβ)ββ x ?_
rw [mem_Ico, β div_lt_iff hxβ, β rpow_nat_cast, β logb_lt_iff_lt_rpow hr hx', Nat.cast_add,
Nat.cast_one]
exact β¨hx, Nat.lt_floor_add_one _β©
intro n
induction n with
| zero => | Mathlib.Analysis.SpecialFunctions.Log.Base.445_0.egNyp4fdqSCAE7f | /-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x | Mathlib_Analysis_SpecialFunctions_Log_Base |
case succ
P : β β Prop
xβ r : β
hr : 1 < r
hxβ : 0 < xβ
base : β x β Ico xβ (r * xβ), P x
step : β n β₯ 1, (β z β Ico xβ (r ^ n * xβ), P z) β β z β Ico (r ^ n * xβ) (r ^ (n + 1) * xβ), P z
n : β
ih : β x β Ico xβ (r ^ (n + 1) * xβ), P x
β’ β x β Ico xβ (r ^ (Nat.succ n + 1) * xβ), P x | /-
Copyright (c) 2022 Bolton Bailey. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Bolton Bailey, Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle SΓΆnne
-/
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Data.Int.Log
#align_import analysis.special_functions.log.base from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690"
/-!
# Real logarithm base `b`
In this file we define `Real.logb` to be the logarithm of a real number in a given base `b`. We
define this as the division of the natural logarithms of the argument and the base, so that we have
a globally defined function with `logb b 0 = 0`, `logb b (-x) = logb b x` `logb 0 x = 0` and
`logb (-b) x = logb b x`.
We prove some basic properties of this function and its relation to `rpow`.
## Tags
logarithm, continuity
-/
open Set Filter Function
open Topology
noncomputable section
namespace Real
variable {b x y : β}
/-- The real logarithm in a given base. As with the natural logarithm, we define `logb b x` to
be `logb b |x|` for `x < 0`, and `0` for `x = 0`.-/
-- @[pp_nodot] -- Porting note: removed
noncomputable def logb (b x : β) : β :=
log x / log b
#align real.logb Real.logb
theorem log_div_log : log x / log b = logb b x :=
rfl
#align real.log_div_log Real.log_div_log
@[simp]
theorem logb_zero : logb b 0 = 0 := by simp [logb]
#align real.logb_zero Real.logb_zero
@[simp]
theorem logb_one : logb b 1 = 0 := by simp [logb]
#align real.logb_one Real.logb_one
@[simp]
lemma logb_self_eq_one (hb : 1 < b) : logb b b = 1 :=
div_self (log_pos hb).ne'
lemma logb_self_eq_one_iff : logb b b = 1 β b β 0 β§ b β 1 β§ b β -1 :=
Iff.trans β¨fun h h' => by simp [logb, h'] at h, div_selfβ© log_ne_zero
@[simp]
theorem logb_abs (x : β) : logb b |x| = logb b x := by rw [logb, logb, log_abs]
#align real.logb_abs Real.logb_abs
@[simp]
theorem logb_neg_eq_logb (x : β) : logb b (-x) = logb b x := by
rw [β logb_abs x, β logb_abs (-x), abs_neg]
#align real.logb_neg_eq_logb Real.logb_neg_eq_logb
theorem logb_mul (hx : x β 0) (hy : y β 0) : logb b (x * y) = logb b x + logb b y := by
simp_rw [logb, log_mul hx hy, add_div]
#align real.logb_mul Real.logb_mul
theorem logb_div (hx : x β 0) (hy : y β 0) : logb b (x / y) = logb b x - logb b y := by
simp_rw [logb, log_div hx hy, sub_div]
#align real.logb_div Real.logb_div
@[simp]
theorem logb_inv (x : β) : logb b xβ»ΒΉ = -logb b x := by simp [logb, neg_div]
#align real.logb_inv Real.logb_inv
theorem inv_logb (a b : β) : (logb a b)β»ΒΉ = logb b a := by simp_rw [logb, inv_div]
#align real.inv_logb Real.inv_logb
theorem inv_logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a * b) c)β»ΒΉ = (logb a c)β»ΒΉ + (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_mul hβ hβ
#align real.inv_logb_mul_base Real.inv_logb_mul_base
theorem inv_logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a / b) c)β»ΒΉ = (logb a c)β»ΒΉ - (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_div hβ hβ
#align real.inv_logb_div_base Real.inv_logb_div_base
theorem logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a * b) c = ((logb a c)β»ΒΉ + (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_mul_base hβ hβ c, inv_inv]
#align real.logb_mul_base Real.logb_mul_base
theorem logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a / b) c = ((logb a c)β»ΒΉ - (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_div_base hβ hβ c, inv_inv]
#align real.logb_div_base Real.logb_div_base
theorem mul_logb {a b c : β} (hβ : b β 0) (hβ : b β 1) (hβ : b β -1) :
logb a b * logb b c = logb a c := by
unfold logb
rw [mul_comm, div_mul_div_cancel _ (log_ne_zero.mpr β¨hβ, hβ, hββ©)]
#align real.mul_logb Real.mul_logb
theorem div_logb {a b c : β} (hβ : c β 0) (hβ : c β 1) (hβ : c β -1) :
logb a c / logb b c = logb a b :=
div_div_div_cancel_left' _ _ <| log_ne_zero.mpr β¨hβ, hβ, hββ©
#align real.div_logb Real.div_logb
section BPosAndNeOne
variable (b_pos : 0 < b) (b_ne_one : b β 1)
private theorem log_b_ne_zero : log b β 0 := by
have b_ne_zero : b β 0; linarith
have b_ne_minus_one : b β -1; linarith
simp [b_ne_one, b_ne_zero, b_ne_minus_one]
@[simp]
theorem logb_rpow : logb b (b ^ x) = x := by
rw [logb, div_eq_iff, log_rpow b_pos]
exact log_b_ne_zero b_pos b_ne_one
#align real.logb_rpow Real.logb_rpow
theorem rpow_logb_eq_abs (hx : x β 0) : b ^ logb b x = |x| := by
apply log_injOn_pos
simp only [Set.mem_Ioi]
apply rpow_pos_of_pos b_pos
simp only [abs_pos, mem_Ioi, Ne.def, hx, not_false_iff]
rw [log_rpow b_pos, logb, log_abs]
field_simp [log_b_ne_zero b_pos b_ne_one]
#align real.rpow_logb_eq_abs Real.rpow_logb_eq_abs
@[simp]
theorem rpow_logb (hx : 0 < x) : b ^ logb b x = x := by
rw [rpow_logb_eq_abs b_pos b_ne_one hx.ne']
exact abs_of_pos hx
#align real.rpow_logb Real.rpow_logb
theorem rpow_logb_of_neg (hx : x < 0) : b ^ logb b x = -x := by
rw [rpow_logb_eq_abs b_pos b_ne_one (ne_of_lt hx)]
exact abs_of_neg hx
#align real.rpow_logb_of_neg Real.rpow_logb_of_neg
theorem surjOn_logb : SurjOn (logb b) (Ioi 0) univ := fun x _ =>
β¨rpow b x, rpow_pos_of_pos b_pos x, logb_rpow b_pos b_ne_oneβ©
#align real.surj_on_logb Real.surjOn_logb
theorem logb_surjective : Surjective (logb b) := fun x => β¨b ^ x, logb_rpow b_pos b_ne_oneβ©
#align real.logb_surjective Real.logb_surjective
@[simp]
theorem range_logb : range (logb b) = univ :=
(logb_surjective b_pos b_ne_one).range_eq
#align real.range_logb Real.range_logb
theorem surjOn_logb' : SurjOn (logb b) (Iio 0) univ := by
intro x _
use -b ^ x
constructor
Β· simp only [Right.neg_neg_iff, Set.mem_Iio]
apply rpow_pos_of_pos b_pos
Β· rw [logb_neg_eq_logb, logb_rpow b_pos b_ne_one]
#align real.surj_on_logb' Real.surjOn_logb'
end BPosAndNeOne
section OneLtB
variable (hb : 1 < b)
private theorem b_pos : 0 < b := by linarith
-- Porting note: prime added to avoid clashing with `b_ne_one` further down the file
private theorem b_ne_one' : b β 1 := by linarith
@[simp]
theorem logb_le_logb (h : 0 < x) (hβ : 0 < y) : logb b x β€ logb b y β x β€ y := by
rw [logb, logb, div_le_div_right (log_pos hb), log_le_log_iff h hβ]
#align real.logb_le_logb Real.logb_le_logb
@[gcongr]
theorem logb_le_logb_of_le (h : 0 < x) (hxy : x β€ y) : logb b x β€ logb b y :=
(logb_le_logb hb h (by linarith)).mpr hxy
@[gcongr]
theorem logb_lt_logb (hx : 0 < x) (hxy : x < y) : logb b x < logb b y := by
rw [logb, logb, div_lt_div_right (log_pos hb)]
exact log_lt_log hx hxy
#align real.logb_lt_logb Real.logb_lt_logb
@[simp]
theorem logb_lt_logb_iff (hx : 0 < x) (hy : 0 < y) : logb b x < logb b y β x < y := by
rw [logb, logb, div_lt_div_right (log_pos hb)]
exact log_lt_log_iff hx hy
#align real.logb_lt_logb_iff Real.logb_lt_logb_iff
theorem logb_le_iff_le_rpow (hx : 0 < x) : logb b x β€ y β x β€ b ^ y := by
rw [β rpow_le_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hx]
#align real.logb_le_iff_le_rpow Real.logb_le_iff_le_rpow
theorem logb_lt_iff_lt_rpow (hx : 0 < x) : logb b x < y β x < b ^ y := by
rw [β rpow_lt_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hx]
#align real.logb_lt_iff_lt_rpow Real.logb_lt_iff_lt_rpow
theorem le_logb_iff_rpow_le (hy : 0 < y) : x β€ logb b y β b ^ x β€ y := by
rw [β rpow_le_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hy]
#align real.le_logb_iff_rpow_le Real.le_logb_iff_rpow_le
theorem lt_logb_iff_rpow_lt (hy : 0 < y) : x < logb b y β b ^ x < y := by
rw [β rpow_lt_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hy]
#align real.lt_logb_iff_rpow_lt Real.lt_logb_iff_rpow_lt
theorem logb_pos_iff (hx : 0 < x) : 0 < logb b x β 1 < x := by
rw [β @logb_one b]
rw [logb_lt_logb_iff hb zero_lt_one hx]
#align real.logb_pos_iff Real.logb_pos_iff
theorem logb_pos (hx : 1 < x) : 0 < logb b x := by
rw [logb_pos_iff hb (lt_trans zero_lt_one hx)]
exact hx
#align real.logb_pos Real.logb_pos
theorem logb_neg_iff (h : 0 < x) : logb b x < 0 β x < 1 := by
rw [β logb_one]
exact logb_lt_logb_iff hb h zero_lt_one
#align real.logb_neg_iff Real.logb_neg_iff
theorem logb_neg (h0 : 0 < x) (h1 : x < 1) : logb b x < 0 :=
(logb_neg_iff hb h0).2 h1
#align real.logb_neg Real.logb_neg
theorem logb_nonneg_iff (hx : 0 < x) : 0 β€ logb b x β 1 β€ x := by
rw [β not_lt, logb_neg_iff hb hx, not_lt]
#align real.logb_nonneg_iff Real.logb_nonneg_iff
theorem logb_nonneg (hx : 1 β€ x) : 0 β€ logb b x :=
(logb_nonneg_iff hb (zero_lt_one.trans_le hx)).2 hx
#align real.logb_nonneg Real.logb_nonneg
theorem logb_nonpos_iff (hx : 0 < x) : logb b x β€ 0 β x β€ 1 := by
rw [β not_lt, logb_pos_iff hb hx, not_lt]
#align real.logb_nonpos_iff Real.logb_nonpos_iff
theorem logb_nonpos_iff' (hx : 0 β€ x) : logb b x β€ 0 β x β€ 1 := by
rcases hx.eq_or_lt with (rfl | hx)
Β· simp [le_refl, zero_le_one]
exact logb_nonpos_iff hb hx
#align real.logb_nonpos_iff' Real.logb_nonpos_iff'
theorem logb_nonpos (hx : 0 β€ x) (h'x : x β€ 1) : logb b x β€ 0 :=
(logb_nonpos_iff' hb hx).2 h'x
#align real.logb_nonpos Real.logb_nonpos
theorem strictMonoOn_logb : StrictMonoOn (logb b) (Set.Ioi 0) := fun _ hx _ _ hxy =>
logb_lt_logb hb hx hxy
#align real.strict_mono_on_logb Real.strictMonoOn_logb
theorem strictAntiOn_logb : StrictAntiOn (logb b) (Set.Iio 0) := by
rintro x (hx : x < 0) y (hy : y < 0) hxy
rw [β logb_abs y, β logb_abs x]
refine' logb_lt_logb hb (abs_pos.2 hy.ne) _
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
#align real.strict_anti_on_logb Real.strictAntiOn_logb
theorem logb_injOn_pos : Set.InjOn (logb b) (Set.Ioi 0) :=
(strictMonoOn_logb hb).injOn
#align real.logb_inj_on_pos Real.logb_injOn_pos
theorem eq_one_of_pos_of_logb_eq_zero (hβ : 0 < x) (hβ : logb b x = 0) : x = 1 :=
logb_injOn_pos hb (Set.mem_Ioi.2 hβ) (Set.mem_Ioi.2 zero_lt_one) (hβ.trans Real.logb_one.symm)
#align real.eq_one_of_pos_of_logb_eq_zero Real.eq_one_of_pos_of_logb_eq_zero
theorem logb_ne_zero_of_pos_of_ne_one (hx_pos : 0 < x) (hx : x β 1) : logb b x β 0 :=
mt (eq_one_of_pos_of_logb_eq_zero hb hx_pos) hx
#align real.logb_ne_zero_of_pos_of_ne_one Real.logb_ne_zero_of_pos_of_ne_one
theorem tendsto_logb_atTop : Tendsto (logb b) atTop atTop :=
Tendsto.atTop_div_const (log_pos hb) tendsto_log_atTop
#align real.tendsto_logb_at_top Real.tendsto_logb_atTop
end OneLtB
section BPosAndBLtOne
variable (b_pos : 0 < b) (b_lt_one : b < 1)
private theorem b_ne_one : b β 1 := by linarith
@[simp]
theorem logb_le_logb_of_base_lt_one (h : 0 < x) (hβ : 0 < y) : logb b x β€ logb b y β y β€ x := by
rw [logb, logb, div_le_div_right_of_neg (log_neg b_pos b_lt_one), log_le_log_iff hβ h]
#align real.logb_le_logb_of_base_lt_one Real.logb_le_logb_of_base_lt_one
theorem logb_lt_logb_of_base_lt_one (hx : 0 < x) (hxy : x < y) : logb b y < logb b x := by
rw [logb, logb, div_lt_div_right_of_neg (log_neg b_pos b_lt_one)]
exact log_lt_log hx hxy
#align real.logb_lt_logb_of_base_lt_one Real.logb_lt_logb_of_base_lt_one
@[simp]
theorem logb_lt_logb_iff_of_base_lt_one (hx : 0 < x) (hy : 0 < y) :
logb b x < logb b y β y < x := by
rw [logb, logb, div_lt_div_right_of_neg (log_neg b_pos b_lt_one)]
exact log_lt_log_iff hy hx
#align real.logb_lt_logb_iff_of_base_lt_one Real.logb_lt_logb_iff_of_base_lt_one
theorem logb_le_iff_le_rpow_of_base_lt_one (hx : 0 < x) : logb b x β€ y β b ^ y β€ x := by
rw [β rpow_le_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hx]
#align real.logb_le_iff_le_rpow_of_base_lt_one Real.logb_le_iff_le_rpow_of_base_lt_one
theorem logb_lt_iff_lt_rpow_of_base_lt_one (hx : 0 < x) : logb b x < y β b ^ y < x := by
rw [β rpow_lt_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hx]
#align real.logb_lt_iff_lt_rpow_of_base_lt_one Real.logb_lt_iff_lt_rpow_of_base_lt_one
theorem le_logb_iff_rpow_le_of_base_lt_one (hy : 0 < y) : x β€ logb b y β y β€ b ^ x := by
rw [β rpow_le_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hy]
#align real.le_logb_iff_rpow_le_of_base_lt_one Real.le_logb_iff_rpow_le_of_base_lt_one
theorem lt_logb_iff_rpow_lt_of_base_lt_one (hy : 0 < y) : x < logb b y β y < b ^ x := by
rw [β rpow_lt_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hy]
#align real.lt_logb_iff_rpow_lt_of_base_lt_one Real.lt_logb_iff_rpow_lt_of_base_lt_one
theorem logb_pos_iff_of_base_lt_one (hx : 0 < x) : 0 < logb b x β x < 1 := by
rw [β @logb_one b, logb_lt_logb_iff_of_base_lt_one b_pos b_lt_one zero_lt_one hx]
#align real.logb_pos_iff_of_base_lt_one Real.logb_pos_iff_of_base_lt_one
theorem logb_pos_of_base_lt_one (hx : 0 < x) (hx' : x < 1) : 0 < logb b x := by
rw [logb_pos_iff_of_base_lt_one b_pos b_lt_one hx]
exact hx'
#align real.logb_pos_of_base_lt_one Real.logb_pos_of_base_lt_one
theorem logb_neg_iff_of_base_lt_one (h : 0 < x) : logb b x < 0 β 1 < x := by
rw [β @logb_one b, logb_lt_logb_iff_of_base_lt_one b_pos b_lt_one h zero_lt_one]
#align real.logb_neg_iff_of_base_lt_one Real.logb_neg_iff_of_base_lt_one
theorem logb_neg_of_base_lt_one (h1 : 1 < x) : logb b x < 0 :=
(logb_neg_iff_of_base_lt_one b_pos b_lt_one (lt_trans zero_lt_one h1)).2 h1
#align real.logb_neg_of_base_lt_one Real.logb_neg_of_base_lt_one
theorem logb_nonneg_iff_of_base_lt_one (hx : 0 < x) : 0 β€ logb b x β x β€ 1 := by
rw [β not_lt, logb_neg_iff_of_base_lt_one b_pos b_lt_one hx, not_lt]
#align real.logb_nonneg_iff_of_base_lt_one Real.logb_nonneg_iff_of_base_lt_one
theorem logb_nonneg_of_base_lt_one (hx : 0 < x) (hx' : x β€ 1) : 0 β€ logb b x := by
rw [logb_nonneg_iff_of_base_lt_one b_pos b_lt_one hx]
exact hx'
#align real.logb_nonneg_of_base_lt_one Real.logb_nonneg_of_base_lt_one
theorem logb_nonpos_iff_of_base_lt_one (hx : 0 < x) : logb b x β€ 0 β 1 β€ x := by
rw [β not_lt, logb_pos_iff_of_base_lt_one b_pos b_lt_one hx, not_lt]
#align real.logb_nonpos_iff_of_base_lt_one Real.logb_nonpos_iff_of_base_lt_one
theorem strictAntiOn_logb_of_base_lt_one : StrictAntiOn (logb b) (Set.Ioi 0) := fun _ hx _ _ hxy =>
logb_lt_logb_of_base_lt_one b_pos b_lt_one hx hxy
#align real.strict_anti_on_logb_of_base_lt_one Real.strictAntiOn_logb_of_base_lt_one
theorem strictMonoOn_logb_of_base_lt_one : StrictMonoOn (logb b) (Set.Iio 0) := by
rintro x (hx : x < 0) y (hy : y < 0) hxy
rw [β logb_abs y, β logb_abs x]
refine' logb_lt_logb_of_base_lt_one b_pos b_lt_one (abs_pos.2 hy.ne) _
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
#align real.strict_mono_on_logb_of_base_lt_one Real.strictMonoOn_logb_of_base_lt_one
theorem logb_injOn_pos_of_base_lt_one : Set.InjOn (logb b) (Set.Ioi 0) :=
(strictAntiOn_logb_of_base_lt_one b_pos b_lt_one).injOn
#align real.logb_inj_on_pos_of_base_lt_one Real.logb_injOn_pos_of_base_lt_one
theorem eq_one_of_pos_of_logb_eq_zero_of_base_lt_one (hβ : 0 < x) (hβ : logb b x = 0) : x = 1 :=
logb_injOn_pos_of_base_lt_one b_pos b_lt_one (Set.mem_Ioi.2 hβ) (Set.mem_Ioi.2 zero_lt_one)
(hβ.trans Real.logb_one.symm)
#align real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one Real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one
theorem logb_ne_zero_of_pos_of_ne_one_of_base_lt_one (hx_pos : 0 < x) (hx : x β 1) : logb b x β 0 :=
mt (eq_one_of_pos_of_logb_eq_zero_of_base_lt_one b_pos b_lt_one hx_pos) hx
#align real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one Real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one
theorem tendsto_logb_atTop_of_base_lt_one : Tendsto (logb b) atTop atBot := by
rw [tendsto_atTop_atBot]
intro e
use 1 β b ^ e
intro a
simp only [and_imp, sup_le_iff]
intro ha
rw [logb_le_iff_le_rpow_of_base_lt_one b_pos b_lt_one]
tauto
exact lt_of_lt_of_le zero_lt_one ha
#align real.tendsto_logb_at_top_of_base_lt_one Real.tendsto_logb_atTop_of_base_lt_one
end BPosAndBLtOne
theorem floor_logb_nat_cast {b : β} {r : β} (hb : 1 < b) (hr : 0 β€ r) :
βlogb b rβ = Int.log b r := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [logb_zero, Int.log_zero_right, Int.floor_zero]
have hb1' : 1 < (b : β) := Nat.one_lt_cast.mpr hb
apply le_antisymm
Β· rw [β Int.zpow_le_iff_le_log hb hr, β rpow_int_cast b]
refine' le_of_le_of_eq _ (rpow_logb (zero_lt_one.trans hb1') hb1'.ne' hr)
exact rpow_le_rpow_of_exponent_le hb1'.le (Int.floor_le _)
Β· rw [Int.le_floor, le_logb_iff_rpow_le hb1' hr, rpow_int_cast]
exact Int.zpow_log_le_self hb hr
#align real.floor_logb_nat_cast Real.floor_logb_nat_cast
theorem ceil_logb_nat_cast {b : β} {r : β} (hb : 1 < b) (hr : 0 β€ r) :
βlogb b rβ = Int.clog b r := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [logb_zero, Int.clog_zero_right, Int.ceil_zero]
have hb1' : 1 < (b : β) := Nat.one_lt_cast.mpr hb
apply le_antisymm
Β· rw [Int.ceil_le, logb_le_iff_le_rpow hb1' hr, rpow_int_cast]
refine' Int.self_le_zpow_clog hb r
Β· rw [β Int.le_zpow_iff_clog_le hb hr, β rpow_int_cast b]
refine' (rpow_logb (zero_lt_one.trans hb1') hb1'.ne' hr).symm.trans_le _
exact rpow_le_rpow_of_exponent_le hb1'.le (Int.le_ceil _)
#align real.ceil_logb_nat_cast Real.ceil_logb_nat_cast
@[simp]
theorem logb_eq_zero : logb b x = 0 β b = 0 β¨ b = 1 β¨ b = -1 β¨ x = 0 β¨ x = 1 β¨ x = -1 := by
simp_rw [logb, div_eq_zero_iff, log_eq_zero]
tauto
#align real.logb_eq_zero Real.logb_eq_zero
-- TODO add other limits and continuous API lemmas analogous to those in Log.lean
open BigOperators
theorem logb_prod {Ξ± : Type*} (s : Finset Ξ±) (f : Ξ± β β) (hf : β x β s, f x β 0) :
logb b (β i in s, f i) = β i in s, logb b (f i) := by
classical
induction' s using Finset.induction_on with a s ha ih
Β· simp
simp only [Finset.mem_insert, forall_eq_or_imp] at hf
simp [ha, ih hf.2, logb_mul hf.1 (Finset.prod_ne_zero_iff.2 hf.2)]
#align real.logb_prod Real.logb_prod
end Real
section Induction
/-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x := by
suffices β n : β, β x β Set.Ico xβ (r ^ (n + 1) * xβ), P x by
intro x hx
have hx' : 0 < x / xβ := div_pos (hxβ.trans_le hx) hxβ
refine this βlogb r (x / xβ)ββ x ?_
rw [mem_Ico, β div_lt_iff hxβ, β rpow_nat_cast, β logb_lt_iff_lt_rpow hr hx', Nat.cast_add,
Nat.cast_one]
exact β¨hx, Nat.lt_floor_add_one _β©
intro n
induction n with
| zero => simpa using base
| | succ n ih =>
exact fun x hx => (Ico_subset_Ico_union_Ico hx).elim (ih x) (step (n + 1) (by simp) ih _) | /-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x := by
suffices β n : β, β x β Set.Ico xβ (r ^ (n + 1) * xβ), P x by
intro x hx
have hx' : 0 < x / xβ := div_pos (hxβ.trans_le hx) hxβ
refine this βlogb r (x / xβ)ββ x ?_
rw [mem_Ico, β div_lt_iff hxβ, β rpow_nat_cast, β logb_lt_iff_lt_rpow hr hx', Nat.cast_add,
Nat.cast_one]
exact β¨hx, Nat.lt_floor_add_one _β©
intro n
induction n with
| zero => simpa using base
| Mathlib.Analysis.SpecialFunctions.Log.Base.445_0.egNyp4fdqSCAE7f | /-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x | Mathlib_Analysis_SpecialFunctions_Log_Base |
case succ
P : β β Prop
xβ r : β
hr : 1 < r
hxβ : 0 < xβ
base : β x β Ico xβ (r * xβ), P x
step : β n β₯ 1, (β z β Ico xβ (r ^ n * xβ), P z) β β z β Ico (r ^ n * xβ) (r ^ (n + 1) * xβ), P z
n : β
ih : β x β Ico xβ (r ^ (n + 1) * xβ), P x
β’ β x β Ico xβ (r ^ (Nat.succ n + 1) * xβ), P x | /-
Copyright (c) 2022 Bolton Bailey. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Bolton Bailey, Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle SΓΆnne
-/
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Data.Int.Log
#align_import analysis.special_functions.log.base from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690"
/-!
# Real logarithm base `b`
In this file we define `Real.logb` to be the logarithm of a real number in a given base `b`. We
define this as the division of the natural logarithms of the argument and the base, so that we have
a globally defined function with `logb b 0 = 0`, `logb b (-x) = logb b x` `logb 0 x = 0` and
`logb (-b) x = logb b x`.
We prove some basic properties of this function and its relation to `rpow`.
## Tags
logarithm, continuity
-/
open Set Filter Function
open Topology
noncomputable section
namespace Real
variable {b x y : β}
/-- The real logarithm in a given base. As with the natural logarithm, we define `logb b x` to
be `logb b |x|` for `x < 0`, and `0` for `x = 0`.-/
-- @[pp_nodot] -- Porting note: removed
noncomputable def logb (b x : β) : β :=
log x / log b
#align real.logb Real.logb
theorem log_div_log : log x / log b = logb b x :=
rfl
#align real.log_div_log Real.log_div_log
@[simp]
theorem logb_zero : logb b 0 = 0 := by simp [logb]
#align real.logb_zero Real.logb_zero
@[simp]
theorem logb_one : logb b 1 = 0 := by simp [logb]
#align real.logb_one Real.logb_one
@[simp]
lemma logb_self_eq_one (hb : 1 < b) : logb b b = 1 :=
div_self (log_pos hb).ne'
lemma logb_self_eq_one_iff : logb b b = 1 β b β 0 β§ b β 1 β§ b β -1 :=
Iff.trans β¨fun h h' => by simp [logb, h'] at h, div_selfβ© log_ne_zero
@[simp]
theorem logb_abs (x : β) : logb b |x| = logb b x := by rw [logb, logb, log_abs]
#align real.logb_abs Real.logb_abs
@[simp]
theorem logb_neg_eq_logb (x : β) : logb b (-x) = logb b x := by
rw [β logb_abs x, β logb_abs (-x), abs_neg]
#align real.logb_neg_eq_logb Real.logb_neg_eq_logb
theorem logb_mul (hx : x β 0) (hy : y β 0) : logb b (x * y) = logb b x + logb b y := by
simp_rw [logb, log_mul hx hy, add_div]
#align real.logb_mul Real.logb_mul
theorem logb_div (hx : x β 0) (hy : y β 0) : logb b (x / y) = logb b x - logb b y := by
simp_rw [logb, log_div hx hy, sub_div]
#align real.logb_div Real.logb_div
@[simp]
theorem logb_inv (x : β) : logb b xβ»ΒΉ = -logb b x := by simp [logb, neg_div]
#align real.logb_inv Real.logb_inv
theorem inv_logb (a b : β) : (logb a b)β»ΒΉ = logb b a := by simp_rw [logb, inv_div]
#align real.inv_logb Real.inv_logb
theorem inv_logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a * b) c)β»ΒΉ = (logb a c)β»ΒΉ + (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_mul hβ hβ
#align real.inv_logb_mul_base Real.inv_logb_mul_base
theorem inv_logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a / b) c)β»ΒΉ = (logb a c)β»ΒΉ - (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_div hβ hβ
#align real.inv_logb_div_base Real.inv_logb_div_base
theorem logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a * b) c = ((logb a c)β»ΒΉ + (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_mul_base hβ hβ c, inv_inv]
#align real.logb_mul_base Real.logb_mul_base
theorem logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a / b) c = ((logb a c)β»ΒΉ - (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_div_base hβ hβ c, inv_inv]
#align real.logb_div_base Real.logb_div_base
theorem mul_logb {a b c : β} (hβ : b β 0) (hβ : b β 1) (hβ : b β -1) :
logb a b * logb b c = logb a c := by
unfold logb
rw [mul_comm, div_mul_div_cancel _ (log_ne_zero.mpr β¨hβ, hβ, hββ©)]
#align real.mul_logb Real.mul_logb
theorem div_logb {a b c : β} (hβ : c β 0) (hβ : c β 1) (hβ : c β -1) :
logb a c / logb b c = logb a b :=
div_div_div_cancel_left' _ _ <| log_ne_zero.mpr β¨hβ, hβ, hββ©
#align real.div_logb Real.div_logb
section BPosAndNeOne
variable (b_pos : 0 < b) (b_ne_one : b β 1)
private theorem log_b_ne_zero : log b β 0 := by
have b_ne_zero : b β 0; linarith
have b_ne_minus_one : b β -1; linarith
simp [b_ne_one, b_ne_zero, b_ne_minus_one]
@[simp]
theorem logb_rpow : logb b (b ^ x) = x := by
rw [logb, div_eq_iff, log_rpow b_pos]
exact log_b_ne_zero b_pos b_ne_one
#align real.logb_rpow Real.logb_rpow
theorem rpow_logb_eq_abs (hx : x β 0) : b ^ logb b x = |x| := by
apply log_injOn_pos
simp only [Set.mem_Ioi]
apply rpow_pos_of_pos b_pos
simp only [abs_pos, mem_Ioi, Ne.def, hx, not_false_iff]
rw [log_rpow b_pos, logb, log_abs]
field_simp [log_b_ne_zero b_pos b_ne_one]
#align real.rpow_logb_eq_abs Real.rpow_logb_eq_abs
@[simp]
theorem rpow_logb (hx : 0 < x) : b ^ logb b x = x := by
rw [rpow_logb_eq_abs b_pos b_ne_one hx.ne']
exact abs_of_pos hx
#align real.rpow_logb Real.rpow_logb
theorem rpow_logb_of_neg (hx : x < 0) : b ^ logb b x = -x := by
rw [rpow_logb_eq_abs b_pos b_ne_one (ne_of_lt hx)]
exact abs_of_neg hx
#align real.rpow_logb_of_neg Real.rpow_logb_of_neg
theorem surjOn_logb : SurjOn (logb b) (Ioi 0) univ := fun x _ =>
β¨rpow b x, rpow_pos_of_pos b_pos x, logb_rpow b_pos b_ne_oneβ©
#align real.surj_on_logb Real.surjOn_logb
theorem logb_surjective : Surjective (logb b) := fun x => β¨b ^ x, logb_rpow b_pos b_ne_oneβ©
#align real.logb_surjective Real.logb_surjective
@[simp]
theorem range_logb : range (logb b) = univ :=
(logb_surjective b_pos b_ne_one).range_eq
#align real.range_logb Real.range_logb
theorem surjOn_logb' : SurjOn (logb b) (Iio 0) univ := by
intro x _
use -b ^ x
constructor
Β· simp only [Right.neg_neg_iff, Set.mem_Iio]
apply rpow_pos_of_pos b_pos
Β· rw [logb_neg_eq_logb, logb_rpow b_pos b_ne_one]
#align real.surj_on_logb' Real.surjOn_logb'
end BPosAndNeOne
section OneLtB
variable (hb : 1 < b)
private theorem b_pos : 0 < b := by linarith
-- Porting note: prime added to avoid clashing with `b_ne_one` further down the file
private theorem b_ne_one' : b β 1 := by linarith
@[simp]
theorem logb_le_logb (h : 0 < x) (hβ : 0 < y) : logb b x β€ logb b y β x β€ y := by
rw [logb, logb, div_le_div_right (log_pos hb), log_le_log_iff h hβ]
#align real.logb_le_logb Real.logb_le_logb
@[gcongr]
theorem logb_le_logb_of_le (h : 0 < x) (hxy : x β€ y) : logb b x β€ logb b y :=
(logb_le_logb hb h (by linarith)).mpr hxy
@[gcongr]
theorem logb_lt_logb (hx : 0 < x) (hxy : x < y) : logb b x < logb b y := by
rw [logb, logb, div_lt_div_right (log_pos hb)]
exact log_lt_log hx hxy
#align real.logb_lt_logb Real.logb_lt_logb
@[simp]
theorem logb_lt_logb_iff (hx : 0 < x) (hy : 0 < y) : logb b x < logb b y β x < y := by
rw [logb, logb, div_lt_div_right (log_pos hb)]
exact log_lt_log_iff hx hy
#align real.logb_lt_logb_iff Real.logb_lt_logb_iff
theorem logb_le_iff_le_rpow (hx : 0 < x) : logb b x β€ y β x β€ b ^ y := by
rw [β rpow_le_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hx]
#align real.logb_le_iff_le_rpow Real.logb_le_iff_le_rpow
theorem logb_lt_iff_lt_rpow (hx : 0 < x) : logb b x < y β x < b ^ y := by
rw [β rpow_lt_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hx]
#align real.logb_lt_iff_lt_rpow Real.logb_lt_iff_lt_rpow
theorem le_logb_iff_rpow_le (hy : 0 < y) : x β€ logb b y β b ^ x β€ y := by
rw [β rpow_le_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hy]
#align real.le_logb_iff_rpow_le Real.le_logb_iff_rpow_le
theorem lt_logb_iff_rpow_lt (hy : 0 < y) : x < logb b y β b ^ x < y := by
rw [β rpow_lt_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hy]
#align real.lt_logb_iff_rpow_lt Real.lt_logb_iff_rpow_lt
theorem logb_pos_iff (hx : 0 < x) : 0 < logb b x β 1 < x := by
rw [β @logb_one b]
rw [logb_lt_logb_iff hb zero_lt_one hx]
#align real.logb_pos_iff Real.logb_pos_iff
theorem logb_pos (hx : 1 < x) : 0 < logb b x := by
rw [logb_pos_iff hb (lt_trans zero_lt_one hx)]
exact hx
#align real.logb_pos Real.logb_pos
theorem logb_neg_iff (h : 0 < x) : logb b x < 0 β x < 1 := by
rw [β logb_one]
exact logb_lt_logb_iff hb h zero_lt_one
#align real.logb_neg_iff Real.logb_neg_iff
theorem logb_neg (h0 : 0 < x) (h1 : x < 1) : logb b x < 0 :=
(logb_neg_iff hb h0).2 h1
#align real.logb_neg Real.logb_neg
theorem logb_nonneg_iff (hx : 0 < x) : 0 β€ logb b x β 1 β€ x := by
rw [β not_lt, logb_neg_iff hb hx, not_lt]
#align real.logb_nonneg_iff Real.logb_nonneg_iff
theorem logb_nonneg (hx : 1 β€ x) : 0 β€ logb b x :=
(logb_nonneg_iff hb (zero_lt_one.trans_le hx)).2 hx
#align real.logb_nonneg Real.logb_nonneg
theorem logb_nonpos_iff (hx : 0 < x) : logb b x β€ 0 β x β€ 1 := by
rw [β not_lt, logb_pos_iff hb hx, not_lt]
#align real.logb_nonpos_iff Real.logb_nonpos_iff
theorem logb_nonpos_iff' (hx : 0 β€ x) : logb b x β€ 0 β x β€ 1 := by
rcases hx.eq_or_lt with (rfl | hx)
Β· simp [le_refl, zero_le_one]
exact logb_nonpos_iff hb hx
#align real.logb_nonpos_iff' Real.logb_nonpos_iff'
theorem logb_nonpos (hx : 0 β€ x) (h'x : x β€ 1) : logb b x β€ 0 :=
(logb_nonpos_iff' hb hx).2 h'x
#align real.logb_nonpos Real.logb_nonpos
theorem strictMonoOn_logb : StrictMonoOn (logb b) (Set.Ioi 0) := fun _ hx _ _ hxy =>
logb_lt_logb hb hx hxy
#align real.strict_mono_on_logb Real.strictMonoOn_logb
theorem strictAntiOn_logb : StrictAntiOn (logb b) (Set.Iio 0) := by
rintro x (hx : x < 0) y (hy : y < 0) hxy
rw [β logb_abs y, β logb_abs x]
refine' logb_lt_logb hb (abs_pos.2 hy.ne) _
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
#align real.strict_anti_on_logb Real.strictAntiOn_logb
theorem logb_injOn_pos : Set.InjOn (logb b) (Set.Ioi 0) :=
(strictMonoOn_logb hb).injOn
#align real.logb_inj_on_pos Real.logb_injOn_pos
theorem eq_one_of_pos_of_logb_eq_zero (hβ : 0 < x) (hβ : logb b x = 0) : x = 1 :=
logb_injOn_pos hb (Set.mem_Ioi.2 hβ) (Set.mem_Ioi.2 zero_lt_one) (hβ.trans Real.logb_one.symm)
#align real.eq_one_of_pos_of_logb_eq_zero Real.eq_one_of_pos_of_logb_eq_zero
theorem logb_ne_zero_of_pos_of_ne_one (hx_pos : 0 < x) (hx : x β 1) : logb b x β 0 :=
mt (eq_one_of_pos_of_logb_eq_zero hb hx_pos) hx
#align real.logb_ne_zero_of_pos_of_ne_one Real.logb_ne_zero_of_pos_of_ne_one
theorem tendsto_logb_atTop : Tendsto (logb b) atTop atTop :=
Tendsto.atTop_div_const (log_pos hb) tendsto_log_atTop
#align real.tendsto_logb_at_top Real.tendsto_logb_atTop
end OneLtB
section BPosAndBLtOne
variable (b_pos : 0 < b) (b_lt_one : b < 1)
private theorem b_ne_one : b β 1 := by linarith
@[simp]
theorem logb_le_logb_of_base_lt_one (h : 0 < x) (hβ : 0 < y) : logb b x β€ logb b y β y β€ x := by
rw [logb, logb, div_le_div_right_of_neg (log_neg b_pos b_lt_one), log_le_log_iff hβ h]
#align real.logb_le_logb_of_base_lt_one Real.logb_le_logb_of_base_lt_one
theorem logb_lt_logb_of_base_lt_one (hx : 0 < x) (hxy : x < y) : logb b y < logb b x := by
rw [logb, logb, div_lt_div_right_of_neg (log_neg b_pos b_lt_one)]
exact log_lt_log hx hxy
#align real.logb_lt_logb_of_base_lt_one Real.logb_lt_logb_of_base_lt_one
@[simp]
theorem logb_lt_logb_iff_of_base_lt_one (hx : 0 < x) (hy : 0 < y) :
logb b x < logb b y β y < x := by
rw [logb, logb, div_lt_div_right_of_neg (log_neg b_pos b_lt_one)]
exact log_lt_log_iff hy hx
#align real.logb_lt_logb_iff_of_base_lt_one Real.logb_lt_logb_iff_of_base_lt_one
theorem logb_le_iff_le_rpow_of_base_lt_one (hx : 0 < x) : logb b x β€ y β b ^ y β€ x := by
rw [β rpow_le_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hx]
#align real.logb_le_iff_le_rpow_of_base_lt_one Real.logb_le_iff_le_rpow_of_base_lt_one
theorem logb_lt_iff_lt_rpow_of_base_lt_one (hx : 0 < x) : logb b x < y β b ^ y < x := by
rw [β rpow_lt_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hx]
#align real.logb_lt_iff_lt_rpow_of_base_lt_one Real.logb_lt_iff_lt_rpow_of_base_lt_one
theorem le_logb_iff_rpow_le_of_base_lt_one (hy : 0 < y) : x β€ logb b y β y β€ b ^ x := by
rw [β rpow_le_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hy]
#align real.le_logb_iff_rpow_le_of_base_lt_one Real.le_logb_iff_rpow_le_of_base_lt_one
theorem lt_logb_iff_rpow_lt_of_base_lt_one (hy : 0 < y) : x < logb b y β y < b ^ x := by
rw [β rpow_lt_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hy]
#align real.lt_logb_iff_rpow_lt_of_base_lt_one Real.lt_logb_iff_rpow_lt_of_base_lt_one
theorem logb_pos_iff_of_base_lt_one (hx : 0 < x) : 0 < logb b x β x < 1 := by
rw [β @logb_one b, logb_lt_logb_iff_of_base_lt_one b_pos b_lt_one zero_lt_one hx]
#align real.logb_pos_iff_of_base_lt_one Real.logb_pos_iff_of_base_lt_one
theorem logb_pos_of_base_lt_one (hx : 0 < x) (hx' : x < 1) : 0 < logb b x := by
rw [logb_pos_iff_of_base_lt_one b_pos b_lt_one hx]
exact hx'
#align real.logb_pos_of_base_lt_one Real.logb_pos_of_base_lt_one
theorem logb_neg_iff_of_base_lt_one (h : 0 < x) : logb b x < 0 β 1 < x := by
rw [β @logb_one b, logb_lt_logb_iff_of_base_lt_one b_pos b_lt_one h zero_lt_one]
#align real.logb_neg_iff_of_base_lt_one Real.logb_neg_iff_of_base_lt_one
theorem logb_neg_of_base_lt_one (h1 : 1 < x) : logb b x < 0 :=
(logb_neg_iff_of_base_lt_one b_pos b_lt_one (lt_trans zero_lt_one h1)).2 h1
#align real.logb_neg_of_base_lt_one Real.logb_neg_of_base_lt_one
theorem logb_nonneg_iff_of_base_lt_one (hx : 0 < x) : 0 β€ logb b x β x β€ 1 := by
rw [β not_lt, logb_neg_iff_of_base_lt_one b_pos b_lt_one hx, not_lt]
#align real.logb_nonneg_iff_of_base_lt_one Real.logb_nonneg_iff_of_base_lt_one
theorem logb_nonneg_of_base_lt_one (hx : 0 < x) (hx' : x β€ 1) : 0 β€ logb b x := by
rw [logb_nonneg_iff_of_base_lt_one b_pos b_lt_one hx]
exact hx'
#align real.logb_nonneg_of_base_lt_one Real.logb_nonneg_of_base_lt_one
theorem logb_nonpos_iff_of_base_lt_one (hx : 0 < x) : logb b x β€ 0 β 1 β€ x := by
rw [β not_lt, logb_pos_iff_of_base_lt_one b_pos b_lt_one hx, not_lt]
#align real.logb_nonpos_iff_of_base_lt_one Real.logb_nonpos_iff_of_base_lt_one
theorem strictAntiOn_logb_of_base_lt_one : StrictAntiOn (logb b) (Set.Ioi 0) := fun _ hx _ _ hxy =>
logb_lt_logb_of_base_lt_one b_pos b_lt_one hx hxy
#align real.strict_anti_on_logb_of_base_lt_one Real.strictAntiOn_logb_of_base_lt_one
theorem strictMonoOn_logb_of_base_lt_one : StrictMonoOn (logb b) (Set.Iio 0) := by
rintro x (hx : x < 0) y (hy : y < 0) hxy
rw [β logb_abs y, β logb_abs x]
refine' logb_lt_logb_of_base_lt_one b_pos b_lt_one (abs_pos.2 hy.ne) _
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
#align real.strict_mono_on_logb_of_base_lt_one Real.strictMonoOn_logb_of_base_lt_one
theorem logb_injOn_pos_of_base_lt_one : Set.InjOn (logb b) (Set.Ioi 0) :=
(strictAntiOn_logb_of_base_lt_one b_pos b_lt_one).injOn
#align real.logb_inj_on_pos_of_base_lt_one Real.logb_injOn_pos_of_base_lt_one
theorem eq_one_of_pos_of_logb_eq_zero_of_base_lt_one (hβ : 0 < x) (hβ : logb b x = 0) : x = 1 :=
logb_injOn_pos_of_base_lt_one b_pos b_lt_one (Set.mem_Ioi.2 hβ) (Set.mem_Ioi.2 zero_lt_one)
(hβ.trans Real.logb_one.symm)
#align real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one Real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one
theorem logb_ne_zero_of_pos_of_ne_one_of_base_lt_one (hx_pos : 0 < x) (hx : x β 1) : logb b x β 0 :=
mt (eq_one_of_pos_of_logb_eq_zero_of_base_lt_one b_pos b_lt_one hx_pos) hx
#align real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one Real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one
theorem tendsto_logb_atTop_of_base_lt_one : Tendsto (logb b) atTop atBot := by
rw [tendsto_atTop_atBot]
intro e
use 1 β b ^ e
intro a
simp only [and_imp, sup_le_iff]
intro ha
rw [logb_le_iff_le_rpow_of_base_lt_one b_pos b_lt_one]
tauto
exact lt_of_lt_of_le zero_lt_one ha
#align real.tendsto_logb_at_top_of_base_lt_one Real.tendsto_logb_atTop_of_base_lt_one
end BPosAndBLtOne
theorem floor_logb_nat_cast {b : β} {r : β} (hb : 1 < b) (hr : 0 β€ r) :
βlogb b rβ = Int.log b r := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [logb_zero, Int.log_zero_right, Int.floor_zero]
have hb1' : 1 < (b : β) := Nat.one_lt_cast.mpr hb
apply le_antisymm
Β· rw [β Int.zpow_le_iff_le_log hb hr, β rpow_int_cast b]
refine' le_of_le_of_eq _ (rpow_logb (zero_lt_one.trans hb1') hb1'.ne' hr)
exact rpow_le_rpow_of_exponent_le hb1'.le (Int.floor_le _)
Β· rw [Int.le_floor, le_logb_iff_rpow_le hb1' hr, rpow_int_cast]
exact Int.zpow_log_le_self hb hr
#align real.floor_logb_nat_cast Real.floor_logb_nat_cast
theorem ceil_logb_nat_cast {b : β} {r : β} (hb : 1 < b) (hr : 0 β€ r) :
βlogb b rβ = Int.clog b r := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [logb_zero, Int.clog_zero_right, Int.ceil_zero]
have hb1' : 1 < (b : β) := Nat.one_lt_cast.mpr hb
apply le_antisymm
Β· rw [Int.ceil_le, logb_le_iff_le_rpow hb1' hr, rpow_int_cast]
refine' Int.self_le_zpow_clog hb r
Β· rw [β Int.le_zpow_iff_clog_le hb hr, β rpow_int_cast b]
refine' (rpow_logb (zero_lt_one.trans hb1') hb1'.ne' hr).symm.trans_le _
exact rpow_le_rpow_of_exponent_le hb1'.le (Int.le_ceil _)
#align real.ceil_logb_nat_cast Real.ceil_logb_nat_cast
@[simp]
theorem logb_eq_zero : logb b x = 0 β b = 0 β¨ b = 1 β¨ b = -1 β¨ x = 0 β¨ x = 1 β¨ x = -1 := by
simp_rw [logb, div_eq_zero_iff, log_eq_zero]
tauto
#align real.logb_eq_zero Real.logb_eq_zero
-- TODO add other limits and continuous API lemmas analogous to those in Log.lean
open BigOperators
theorem logb_prod {Ξ± : Type*} (s : Finset Ξ±) (f : Ξ± β β) (hf : β x β s, f x β 0) :
logb b (β i in s, f i) = β i in s, logb b (f i) := by
classical
induction' s using Finset.induction_on with a s ha ih
Β· simp
simp only [Finset.mem_insert, forall_eq_or_imp] at hf
simp [ha, ih hf.2, logb_mul hf.1 (Finset.prod_ne_zero_iff.2 hf.2)]
#align real.logb_prod Real.logb_prod
end Real
section Induction
/-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x := by
suffices β n : β, β x β Set.Ico xβ (r ^ (n + 1) * xβ), P x by
intro x hx
have hx' : 0 < x / xβ := div_pos (hxβ.trans_le hx) hxβ
refine this βlogb r (x / xβ)ββ x ?_
rw [mem_Ico, β div_lt_iff hxβ, β rpow_nat_cast, β logb_lt_iff_lt_rpow hr hx', Nat.cast_add,
Nat.cast_one]
exact β¨hx, Nat.lt_floor_add_one _β©
intro n
induction n with
| zero => simpa using base
| succ n ih =>
| exact fun x hx => (Ico_subset_Ico_union_Ico hx).elim (ih x) (step (n + 1) (by simp) ih _) | /-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x := by
suffices β n : β, β x β Set.Ico xβ (r ^ (n + 1) * xβ), P x by
intro x hx
have hx' : 0 < x / xβ := div_pos (hxβ.trans_le hx) hxβ
refine this βlogb r (x / xβ)ββ x ?_
rw [mem_Ico, β div_lt_iff hxβ, β rpow_nat_cast, β logb_lt_iff_lt_rpow hr hx', Nat.cast_add,
Nat.cast_one]
exact β¨hx, Nat.lt_floor_add_one _β©
intro n
induction n with
| zero => simpa using base
| succ n ih =>
| Mathlib.Analysis.SpecialFunctions.Log.Base.445_0.egNyp4fdqSCAE7f | /-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x | Mathlib_Analysis_SpecialFunctions_Log_Base |
P : β β Prop
xβ r : β
hr : 1 < r
hxβ : 0 < xβ
base : β x β Ico xβ (r * xβ), P x
step : β n β₯ 1, (β z β Ico xβ (r ^ n * xβ), P z) β β z β Ico (r ^ n * xβ) (r ^ (n + 1) * xβ), P z
n : β
ih : β x β Ico xβ (r ^ (n + 1) * xβ), P x
x : β
hx : x β Ico xβ (r ^ (Nat.succ n + 1) * xβ)
β’ n + 1 β₯ 1 | /-
Copyright (c) 2022 Bolton Bailey. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Bolton Bailey, Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle SΓΆnne
-/
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Data.Int.Log
#align_import analysis.special_functions.log.base from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690"
/-!
# Real logarithm base `b`
In this file we define `Real.logb` to be the logarithm of a real number in a given base `b`. We
define this as the division of the natural logarithms of the argument and the base, so that we have
a globally defined function with `logb b 0 = 0`, `logb b (-x) = logb b x` `logb 0 x = 0` and
`logb (-b) x = logb b x`.
We prove some basic properties of this function and its relation to `rpow`.
## Tags
logarithm, continuity
-/
open Set Filter Function
open Topology
noncomputable section
namespace Real
variable {b x y : β}
/-- The real logarithm in a given base. As with the natural logarithm, we define `logb b x` to
be `logb b |x|` for `x < 0`, and `0` for `x = 0`.-/
-- @[pp_nodot] -- Porting note: removed
noncomputable def logb (b x : β) : β :=
log x / log b
#align real.logb Real.logb
theorem log_div_log : log x / log b = logb b x :=
rfl
#align real.log_div_log Real.log_div_log
@[simp]
theorem logb_zero : logb b 0 = 0 := by simp [logb]
#align real.logb_zero Real.logb_zero
@[simp]
theorem logb_one : logb b 1 = 0 := by simp [logb]
#align real.logb_one Real.logb_one
@[simp]
lemma logb_self_eq_one (hb : 1 < b) : logb b b = 1 :=
div_self (log_pos hb).ne'
lemma logb_self_eq_one_iff : logb b b = 1 β b β 0 β§ b β 1 β§ b β -1 :=
Iff.trans β¨fun h h' => by simp [logb, h'] at h, div_selfβ© log_ne_zero
@[simp]
theorem logb_abs (x : β) : logb b |x| = logb b x := by rw [logb, logb, log_abs]
#align real.logb_abs Real.logb_abs
@[simp]
theorem logb_neg_eq_logb (x : β) : logb b (-x) = logb b x := by
rw [β logb_abs x, β logb_abs (-x), abs_neg]
#align real.logb_neg_eq_logb Real.logb_neg_eq_logb
theorem logb_mul (hx : x β 0) (hy : y β 0) : logb b (x * y) = logb b x + logb b y := by
simp_rw [logb, log_mul hx hy, add_div]
#align real.logb_mul Real.logb_mul
theorem logb_div (hx : x β 0) (hy : y β 0) : logb b (x / y) = logb b x - logb b y := by
simp_rw [logb, log_div hx hy, sub_div]
#align real.logb_div Real.logb_div
@[simp]
theorem logb_inv (x : β) : logb b xβ»ΒΉ = -logb b x := by simp [logb, neg_div]
#align real.logb_inv Real.logb_inv
theorem inv_logb (a b : β) : (logb a b)β»ΒΉ = logb b a := by simp_rw [logb, inv_div]
#align real.inv_logb Real.inv_logb
theorem inv_logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a * b) c)β»ΒΉ = (logb a c)β»ΒΉ + (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_mul hβ hβ
#align real.inv_logb_mul_base Real.inv_logb_mul_base
theorem inv_logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
(logb (a / b) c)β»ΒΉ = (logb a c)β»ΒΉ - (logb b c)β»ΒΉ := by
simp_rw [inv_logb]; exact logb_div hβ hβ
#align real.inv_logb_div_base Real.inv_logb_div_base
theorem logb_mul_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a * b) c = ((logb a c)β»ΒΉ + (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_mul_base hβ hβ c, inv_inv]
#align real.logb_mul_base Real.logb_mul_base
theorem logb_div_base {a b : β} (hβ : a β 0) (hβ : b β 0) (c : β) :
logb (a / b) c = ((logb a c)β»ΒΉ - (logb b c)β»ΒΉ)β»ΒΉ := by rw [β inv_logb_div_base hβ hβ c, inv_inv]
#align real.logb_div_base Real.logb_div_base
theorem mul_logb {a b c : β} (hβ : b β 0) (hβ : b β 1) (hβ : b β -1) :
logb a b * logb b c = logb a c := by
unfold logb
rw [mul_comm, div_mul_div_cancel _ (log_ne_zero.mpr β¨hβ, hβ, hββ©)]
#align real.mul_logb Real.mul_logb
theorem div_logb {a b c : β} (hβ : c β 0) (hβ : c β 1) (hβ : c β -1) :
logb a c / logb b c = logb a b :=
div_div_div_cancel_left' _ _ <| log_ne_zero.mpr β¨hβ, hβ, hββ©
#align real.div_logb Real.div_logb
section BPosAndNeOne
variable (b_pos : 0 < b) (b_ne_one : b β 1)
private theorem log_b_ne_zero : log b β 0 := by
have b_ne_zero : b β 0; linarith
have b_ne_minus_one : b β -1; linarith
simp [b_ne_one, b_ne_zero, b_ne_minus_one]
@[simp]
theorem logb_rpow : logb b (b ^ x) = x := by
rw [logb, div_eq_iff, log_rpow b_pos]
exact log_b_ne_zero b_pos b_ne_one
#align real.logb_rpow Real.logb_rpow
theorem rpow_logb_eq_abs (hx : x β 0) : b ^ logb b x = |x| := by
apply log_injOn_pos
simp only [Set.mem_Ioi]
apply rpow_pos_of_pos b_pos
simp only [abs_pos, mem_Ioi, Ne.def, hx, not_false_iff]
rw [log_rpow b_pos, logb, log_abs]
field_simp [log_b_ne_zero b_pos b_ne_one]
#align real.rpow_logb_eq_abs Real.rpow_logb_eq_abs
@[simp]
theorem rpow_logb (hx : 0 < x) : b ^ logb b x = x := by
rw [rpow_logb_eq_abs b_pos b_ne_one hx.ne']
exact abs_of_pos hx
#align real.rpow_logb Real.rpow_logb
theorem rpow_logb_of_neg (hx : x < 0) : b ^ logb b x = -x := by
rw [rpow_logb_eq_abs b_pos b_ne_one (ne_of_lt hx)]
exact abs_of_neg hx
#align real.rpow_logb_of_neg Real.rpow_logb_of_neg
theorem surjOn_logb : SurjOn (logb b) (Ioi 0) univ := fun x _ =>
β¨rpow b x, rpow_pos_of_pos b_pos x, logb_rpow b_pos b_ne_oneβ©
#align real.surj_on_logb Real.surjOn_logb
theorem logb_surjective : Surjective (logb b) := fun x => β¨b ^ x, logb_rpow b_pos b_ne_oneβ©
#align real.logb_surjective Real.logb_surjective
@[simp]
theorem range_logb : range (logb b) = univ :=
(logb_surjective b_pos b_ne_one).range_eq
#align real.range_logb Real.range_logb
theorem surjOn_logb' : SurjOn (logb b) (Iio 0) univ := by
intro x _
use -b ^ x
constructor
Β· simp only [Right.neg_neg_iff, Set.mem_Iio]
apply rpow_pos_of_pos b_pos
Β· rw [logb_neg_eq_logb, logb_rpow b_pos b_ne_one]
#align real.surj_on_logb' Real.surjOn_logb'
end BPosAndNeOne
section OneLtB
variable (hb : 1 < b)
private theorem b_pos : 0 < b := by linarith
-- Porting note: prime added to avoid clashing with `b_ne_one` further down the file
private theorem b_ne_one' : b β 1 := by linarith
@[simp]
theorem logb_le_logb (h : 0 < x) (hβ : 0 < y) : logb b x β€ logb b y β x β€ y := by
rw [logb, logb, div_le_div_right (log_pos hb), log_le_log_iff h hβ]
#align real.logb_le_logb Real.logb_le_logb
@[gcongr]
theorem logb_le_logb_of_le (h : 0 < x) (hxy : x β€ y) : logb b x β€ logb b y :=
(logb_le_logb hb h (by linarith)).mpr hxy
@[gcongr]
theorem logb_lt_logb (hx : 0 < x) (hxy : x < y) : logb b x < logb b y := by
rw [logb, logb, div_lt_div_right (log_pos hb)]
exact log_lt_log hx hxy
#align real.logb_lt_logb Real.logb_lt_logb
@[simp]
theorem logb_lt_logb_iff (hx : 0 < x) (hy : 0 < y) : logb b x < logb b y β x < y := by
rw [logb, logb, div_lt_div_right (log_pos hb)]
exact log_lt_log_iff hx hy
#align real.logb_lt_logb_iff Real.logb_lt_logb_iff
theorem logb_le_iff_le_rpow (hx : 0 < x) : logb b x β€ y β x β€ b ^ y := by
rw [β rpow_le_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hx]
#align real.logb_le_iff_le_rpow Real.logb_le_iff_le_rpow
theorem logb_lt_iff_lt_rpow (hx : 0 < x) : logb b x < y β x < b ^ y := by
rw [β rpow_lt_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hx]
#align real.logb_lt_iff_lt_rpow Real.logb_lt_iff_lt_rpow
theorem le_logb_iff_rpow_le (hy : 0 < y) : x β€ logb b y β b ^ x β€ y := by
rw [β rpow_le_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hy]
#align real.le_logb_iff_rpow_le Real.le_logb_iff_rpow_le
theorem lt_logb_iff_rpow_lt (hy : 0 < y) : x < logb b y β b ^ x < y := by
rw [β rpow_lt_rpow_left_iff hb, rpow_logb (b_pos hb) (b_ne_one' hb) hy]
#align real.lt_logb_iff_rpow_lt Real.lt_logb_iff_rpow_lt
theorem logb_pos_iff (hx : 0 < x) : 0 < logb b x β 1 < x := by
rw [β @logb_one b]
rw [logb_lt_logb_iff hb zero_lt_one hx]
#align real.logb_pos_iff Real.logb_pos_iff
theorem logb_pos (hx : 1 < x) : 0 < logb b x := by
rw [logb_pos_iff hb (lt_trans zero_lt_one hx)]
exact hx
#align real.logb_pos Real.logb_pos
theorem logb_neg_iff (h : 0 < x) : logb b x < 0 β x < 1 := by
rw [β logb_one]
exact logb_lt_logb_iff hb h zero_lt_one
#align real.logb_neg_iff Real.logb_neg_iff
theorem logb_neg (h0 : 0 < x) (h1 : x < 1) : logb b x < 0 :=
(logb_neg_iff hb h0).2 h1
#align real.logb_neg Real.logb_neg
theorem logb_nonneg_iff (hx : 0 < x) : 0 β€ logb b x β 1 β€ x := by
rw [β not_lt, logb_neg_iff hb hx, not_lt]
#align real.logb_nonneg_iff Real.logb_nonneg_iff
theorem logb_nonneg (hx : 1 β€ x) : 0 β€ logb b x :=
(logb_nonneg_iff hb (zero_lt_one.trans_le hx)).2 hx
#align real.logb_nonneg Real.logb_nonneg
theorem logb_nonpos_iff (hx : 0 < x) : logb b x β€ 0 β x β€ 1 := by
rw [β not_lt, logb_pos_iff hb hx, not_lt]
#align real.logb_nonpos_iff Real.logb_nonpos_iff
theorem logb_nonpos_iff' (hx : 0 β€ x) : logb b x β€ 0 β x β€ 1 := by
rcases hx.eq_or_lt with (rfl | hx)
Β· simp [le_refl, zero_le_one]
exact logb_nonpos_iff hb hx
#align real.logb_nonpos_iff' Real.logb_nonpos_iff'
theorem logb_nonpos (hx : 0 β€ x) (h'x : x β€ 1) : logb b x β€ 0 :=
(logb_nonpos_iff' hb hx).2 h'x
#align real.logb_nonpos Real.logb_nonpos
theorem strictMonoOn_logb : StrictMonoOn (logb b) (Set.Ioi 0) := fun _ hx _ _ hxy =>
logb_lt_logb hb hx hxy
#align real.strict_mono_on_logb Real.strictMonoOn_logb
theorem strictAntiOn_logb : StrictAntiOn (logb b) (Set.Iio 0) := by
rintro x (hx : x < 0) y (hy : y < 0) hxy
rw [β logb_abs y, β logb_abs x]
refine' logb_lt_logb hb (abs_pos.2 hy.ne) _
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
#align real.strict_anti_on_logb Real.strictAntiOn_logb
theorem logb_injOn_pos : Set.InjOn (logb b) (Set.Ioi 0) :=
(strictMonoOn_logb hb).injOn
#align real.logb_inj_on_pos Real.logb_injOn_pos
theorem eq_one_of_pos_of_logb_eq_zero (hβ : 0 < x) (hβ : logb b x = 0) : x = 1 :=
logb_injOn_pos hb (Set.mem_Ioi.2 hβ) (Set.mem_Ioi.2 zero_lt_one) (hβ.trans Real.logb_one.symm)
#align real.eq_one_of_pos_of_logb_eq_zero Real.eq_one_of_pos_of_logb_eq_zero
theorem logb_ne_zero_of_pos_of_ne_one (hx_pos : 0 < x) (hx : x β 1) : logb b x β 0 :=
mt (eq_one_of_pos_of_logb_eq_zero hb hx_pos) hx
#align real.logb_ne_zero_of_pos_of_ne_one Real.logb_ne_zero_of_pos_of_ne_one
theorem tendsto_logb_atTop : Tendsto (logb b) atTop atTop :=
Tendsto.atTop_div_const (log_pos hb) tendsto_log_atTop
#align real.tendsto_logb_at_top Real.tendsto_logb_atTop
end OneLtB
section BPosAndBLtOne
variable (b_pos : 0 < b) (b_lt_one : b < 1)
private theorem b_ne_one : b β 1 := by linarith
@[simp]
theorem logb_le_logb_of_base_lt_one (h : 0 < x) (hβ : 0 < y) : logb b x β€ logb b y β y β€ x := by
rw [logb, logb, div_le_div_right_of_neg (log_neg b_pos b_lt_one), log_le_log_iff hβ h]
#align real.logb_le_logb_of_base_lt_one Real.logb_le_logb_of_base_lt_one
theorem logb_lt_logb_of_base_lt_one (hx : 0 < x) (hxy : x < y) : logb b y < logb b x := by
rw [logb, logb, div_lt_div_right_of_neg (log_neg b_pos b_lt_one)]
exact log_lt_log hx hxy
#align real.logb_lt_logb_of_base_lt_one Real.logb_lt_logb_of_base_lt_one
@[simp]
theorem logb_lt_logb_iff_of_base_lt_one (hx : 0 < x) (hy : 0 < y) :
logb b x < logb b y β y < x := by
rw [logb, logb, div_lt_div_right_of_neg (log_neg b_pos b_lt_one)]
exact log_lt_log_iff hy hx
#align real.logb_lt_logb_iff_of_base_lt_one Real.logb_lt_logb_iff_of_base_lt_one
theorem logb_le_iff_le_rpow_of_base_lt_one (hx : 0 < x) : logb b x β€ y β b ^ y β€ x := by
rw [β rpow_le_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hx]
#align real.logb_le_iff_le_rpow_of_base_lt_one Real.logb_le_iff_le_rpow_of_base_lt_one
theorem logb_lt_iff_lt_rpow_of_base_lt_one (hx : 0 < x) : logb b x < y β b ^ y < x := by
rw [β rpow_lt_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hx]
#align real.logb_lt_iff_lt_rpow_of_base_lt_one Real.logb_lt_iff_lt_rpow_of_base_lt_one
theorem le_logb_iff_rpow_le_of_base_lt_one (hy : 0 < y) : x β€ logb b y β y β€ b ^ x := by
rw [β rpow_le_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hy]
#align real.le_logb_iff_rpow_le_of_base_lt_one Real.le_logb_iff_rpow_le_of_base_lt_one
theorem lt_logb_iff_rpow_lt_of_base_lt_one (hy : 0 < y) : x < logb b y β y < b ^ x := by
rw [β rpow_lt_rpow_left_iff_of_base_lt_one b_pos b_lt_one, rpow_logb b_pos (b_ne_one b_lt_one) hy]
#align real.lt_logb_iff_rpow_lt_of_base_lt_one Real.lt_logb_iff_rpow_lt_of_base_lt_one
theorem logb_pos_iff_of_base_lt_one (hx : 0 < x) : 0 < logb b x β x < 1 := by
rw [β @logb_one b, logb_lt_logb_iff_of_base_lt_one b_pos b_lt_one zero_lt_one hx]
#align real.logb_pos_iff_of_base_lt_one Real.logb_pos_iff_of_base_lt_one
theorem logb_pos_of_base_lt_one (hx : 0 < x) (hx' : x < 1) : 0 < logb b x := by
rw [logb_pos_iff_of_base_lt_one b_pos b_lt_one hx]
exact hx'
#align real.logb_pos_of_base_lt_one Real.logb_pos_of_base_lt_one
theorem logb_neg_iff_of_base_lt_one (h : 0 < x) : logb b x < 0 β 1 < x := by
rw [β @logb_one b, logb_lt_logb_iff_of_base_lt_one b_pos b_lt_one h zero_lt_one]
#align real.logb_neg_iff_of_base_lt_one Real.logb_neg_iff_of_base_lt_one
theorem logb_neg_of_base_lt_one (h1 : 1 < x) : logb b x < 0 :=
(logb_neg_iff_of_base_lt_one b_pos b_lt_one (lt_trans zero_lt_one h1)).2 h1
#align real.logb_neg_of_base_lt_one Real.logb_neg_of_base_lt_one
theorem logb_nonneg_iff_of_base_lt_one (hx : 0 < x) : 0 β€ logb b x β x β€ 1 := by
rw [β not_lt, logb_neg_iff_of_base_lt_one b_pos b_lt_one hx, not_lt]
#align real.logb_nonneg_iff_of_base_lt_one Real.logb_nonneg_iff_of_base_lt_one
theorem logb_nonneg_of_base_lt_one (hx : 0 < x) (hx' : x β€ 1) : 0 β€ logb b x := by
rw [logb_nonneg_iff_of_base_lt_one b_pos b_lt_one hx]
exact hx'
#align real.logb_nonneg_of_base_lt_one Real.logb_nonneg_of_base_lt_one
theorem logb_nonpos_iff_of_base_lt_one (hx : 0 < x) : logb b x β€ 0 β 1 β€ x := by
rw [β not_lt, logb_pos_iff_of_base_lt_one b_pos b_lt_one hx, not_lt]
#align real.logb_nonpos_iff_of_base_lt_one Real.logb_nonpos_iff_of_base_lt_one
theorem strictAntiOn_logb_of_base_lt_one : StrictAntiOn (logb b) (Set.Ioi 0) := fun _ hx _ _ hxy =>
logb_lt_logb_of_base_lt_one b_pos b_lt_one hx hxy
#align real.strict_anti_on_logb_of_base_lt_one Real.strictAntiOn_logb_of_base_lt_one
theorem strictMonoOn_logb_of_base_lt_one : StrictMonoOn (logb b) (Set.Iio 0) := by
rintro x (hx : x < 0) y (hy : y < 0) hxy
rw [β logb_abs y, β logb_abs x]
refine' logb_lt_logb_of_base_lt_one b_pos b_lt_one (abs_pos.2 hy.ne) _
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
#align real.strict_mono_on_logb_of_base_lt_one Real.strictMonoOn_logb_of_base_lt_one
theorem logb_injOn_pos_of_base_lt_one : Set.InjOn (logb b) (Set.Ioi 0) :=
(strictAntiOn_logb_of_base_lt_one b_pos b_lt_one).injOn
#align real.logb_inj_on_pos_of_base_lt_one Real.logb_injOn_pos_of_base_lt_one
theorem eq_one_of_pos_of_logb_eq_zero_of_base_lt_one (hβ : 0 < x) (hβ : logb b x = 0) : x = 1 :=
logb_injOn_pos_of_base_lt_one b_pos b_lt_one (Set.mem_Ioi.2 hβ) (Set.mem_Ioi.2 zero_lt_one)
(hβ.trans Real.logb_one.symm)
#align real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one Real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one
theorem logb_ne_zero_of_pos_of_ne_one_of_base_lt_one (hx_pos : 0 < x) (hx : x β 1) : logb b x β 0 :=
mt (eq_one_of_pos_of_logb_eq_zero_of_base_lt_one b_pos b_lt_one hx_pos) hx
#align real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one Real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one
theorem tendsto_logb_atTop_of_base_lt_one : Tendsto (logb b) atTop atBot := by
rw [tendsto_atTop_atBot]
intro e
use 1 β b ^ e
intro a
simp only [and_imp, sup_le_iff]
intro ha
rw [logb_le_iff_le_rpow_of_base_lt_one b_pos b_lt_one]
tauto
exact lt_of_lt_of_le zero_lt_one ha
#align real.tendsto_logb_at_top_of_base_lt_one Real.tendsto_logb_atTop_of_base_lt_one
end BPosAndBLtOne
theorem floor_logb_nat_cast {b : β} {r : β} (hb : 1 < b) (hr : 0 β€ r) :
βlogb b rβ = Int.log b r := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [logb_zero, Int.log_zero_right, Int.floor_zero]
have hb1' : 1 < (b : β) := Nat.one_lt_cast.mpr hb
apply le_antisymm
Β· rw [β Int.zpow_le_iff_le_log hb hr, β rpow_int_cast b]
refine' le_of_le_of_eq _ (rpow_logb (zero_lt_one.trans hb1') hb1'.ne' hr)
exact rpow_le_rpow_of_exponent_le hb1'.le (Int.floor_le _)
Β· rw [Int.le_floor, le_logb_iff_rpow_le hb1' hr, rpow_int_cast]
exact Int.zpow_log_le_self hb hr
#align real.floor_logb_nat_cast Real.floor_logb_nat_cast
theorem ceil_logb_nat_cast {b : β} {r : β} (hb : 1 < b) (hr : 0 β€ r) :
βlogb b rβ = Int.clog b r := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [logb_zero, Int.clog_zero_right, Int.ceil_zero]
have hb1' : 1 < (b : β) := Nat.one_lt_cast.mpr hb
apply le_antisymm
Β· rw [Int.ceil_le, logb_le_iff_le_rpow hb1' hr, rpow_int_cast]
refine' Int.self_le_zpow_clog hb r
Β· rw [β Int.le_zpow_iff_clog_le hb hr, β rpow_int_cast b]
refine' (rpow_logb (zero_lt_one.trans hb1') hb1'.ne' hr).symm.trans_le _
exact rpow_le_rpow_of_exponent_le hb1'.le (Int.le_ceil _)
#align real.ceil_logb_nat_cast Real.ceil_logb_nat_cast
@[simp]
theorem logb_eq_zero : logb b x = 0 β b = 0 β¨ b = 1 β¨ b = -1 β¨ x = 0 β¨ x = 1 β¨ x = -1 := by
simp_rw [logb, div_eq_zero_iff, log_eq_zero]
tauto
#align real.logb_eq_zero Real.logb_eq_zero
-- TODO add other limits and continuous API lemmas analogous to those in Log.lean
open BigOperators
theorem logb_prod {Ξ± : Type*} (s : Finset Ξ±) (f : Ξ± β β) (hf : β x β s, f x β 0) :
logb b (β i in s, f i) = β i in s, logb b (f i) := by
classical
induction' s using Finset.induction_on with a s ha ih
Β· simp
simp only [Finset.mem_insert, forall_eq_or_imp] at hf
simp [ha, ih hf.2, logb_mul hf.1 (Finset.prod_ne_zero_iff.2 hf.2)]
#align real.logb_prod Real.logb_prod
end Real
section Induction
/-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x := by
suffices β n : β, β x β Set.Ico xβ (r ^ (n + 1) * xβ), P x by
intro x hx
have hx' : 0 < x / xβ := div_pos (hxβ.trans_le hx) hxβ
refine this βlogb r (x / xβ)ββ x ?_
rw [mem_Ico, β div_lt_iff hxβ, β rpow_nat_cast, β logb_lt_iff_lt_rpow hr hx', Nat.cast_add,
Nat.cast_one]
exact β¨hx, Nat.lt_floor_add_one _β©
intro n
induction n with
| zero => simpa using base
| succ n ih =>
exact fun x hx => (Ico_subset_Ico_union_Ico hx).elim (ih x) (step (n + 1) (by | simp | /-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x := by
suffices β n : β, β x β Set.Ico xβ (r ^ (n + 1) * xβ), P x by
intro x hx
have hx' : 0 < x / xβ := div_pos (hxβ.trans_le hx) hxβ
refine this βlogb r (x / xβ)ββ x ?_
rw [mem_Ico, β div_lt_iff hxβ, β rpow_nat_cast, β logb_lt_iff_lt_rpow hr hx', Nat.cast_add,
Nat.cast_one]
exact β¨hx, Nat.lt_floor_add_one _β©
intro n
induction n with
| zero => simpa using base
| succ n ih =>
exact fun x hx => (Ico_subset_Ico_union_Ico hx).elim (ih x) (step (n + 1) (by | Mathlib.Analysis.SpecialFunctions.Log.Base.445_0.egNyp4fdqSCAE7f | /-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[xβ, r * xβ)` and if `P` for `[xβ, r^n * xβ)` implies `P` for `[r^n * xβ, r^(n+1) * xβ)`,
then `P` is true for all `x β₯ xβ`. -/
lemma Real.induction_Ico_mul {P : β β Prop} (xβ r : β) (hr : 1 < r) (hxβ : 0 < xβ)
(base : β x β Set.Ico xβ (r * xβ), P x)
(step : β n : β, n β₯ 1 β (β z β Set.Ico xβ (r ^ n * xβ), P z) β
(β z β Set.Ico (r ^ n * xβ) (r ^ (n+1) * xβ), P z)) :
β x β₯ xβ, P x | Mathlib_Analysis_SpecialFunctions_Log_Base |
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
β’ (aβ, bβ) < (aβ, bβ) β (aβ, bβ) β€ (aβ, bβ) β§ Β¬(aβ, bβ) β€ (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
| constructor | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
β’ (aβ, bβ) < (aβ, bβ) β (aβ, bβ) β€ (aβ, bβ) β§ Β¬(aβ, bβ) β€ (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· | rintro (β¨_, _, hltβ© | β¨_, hltβ©) | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.left
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
hlt : aβ < aβ
β’ (aβ, bβ) β€ (aβ, bβ) β§ Β¬(aβ, bβ) β€ (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· | constructor | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.left.left
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
hlt : aβ < aβ
β’ (aβ, bβ) β€ (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· | exact left _ _ hlt | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.left.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
hlt : aβ < aβ
β’ Β¬(aβ, bβ) β€ (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· | rintro β¨β© | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.left.right.left
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
hlt : aβ < aβ
hβ : aβ < aβ
β’ False | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· | apply lt_asymm hlt | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.left.right.left
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
hlt : aβ < aβ
hβ : aβ < aβ
β’ aβ < aβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; | assumption | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.left.right.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : aβ < aβ
hβ : bβ β€ bβ
β’ False | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· | exact lt_irrefl _ hlt | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : bβ < bβ
β’ (aβ, bβ) β€ (aβ, bβ) β§ Β¬(aβ, bβ) β€ (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· | constructor | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.right.left
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : bβ < bβ
β’ (aβ, bβ) β€ (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· | right | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.right.left.h
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : bβ < bβ
β’ bβ β€ bβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
| rw [lt_iff_le_not_le] at hlt | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.right.left.h
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : bβ β€ bβ β§ Β¬bβ β€ bβ
β’ bβ β€ bβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
| exact hlt.1 | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.right.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : bβ < bβ
β’ Β¬(aβ, bβ) β€ (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· | rintro β¨β© | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.right.right.left
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : bβ < bβ
hβ : aβ < aβ
β’ False | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· | apply lt_irrefl aβ | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.right.right.left
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : bβ < bβ
hβ : aβ < aβ
β’ aβ < aβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
| assumption | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.right.right.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : bβ < bβ
hβ : bβ β€ bβ
β’ False | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· | rw [lt_iff_le_not_le] at hlt | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.right.right.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : bβ β€ bβ β§ Β¬bβ β€ bβ
hβ : bβ β€ bβ
β’ False | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
| apply hlt.2 | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mp.right.right.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hlt : bβ β€ bβ β§ Β¬bβ β€ bβ
hβ : bβ β€ bβ
β’ bβ β€ bβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
| assumption | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
β’ (aβ, bβ) β€ (aβ, bβ) β§ Β¬(aβ, bβ) β€ (aβ, bβ) β (aβ, bβ) < (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· | rintro β¨β¨β©, hβrβ© | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr.intro.left
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
hβr : Β¬(aβ, bβ) β€ (aβ, bβ)
hβ : aβ < aβ
β’ (aβ, bβ) < (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· | left | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr.intro.left.h
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
hβr : Β¬(aβ, bβ) β€ (aβ, bβ)
hβ : aβ < aβ
β’ aβ < aβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
| assumption | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr.intro.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hβr : Β¬(aβ, bβ) β€ (aβ, bβ)
hβ : bβ β€ bβ
β’ (aβ, bβ) < (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· | right | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr.intro.right.h
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hβr : Β¬(aβ, bβ) β€ (aβ, bβ)
hβ : bβ β€ bβ
β’ bβ < bβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
| rw [lt_iff_le_not_le] | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr.intro.right.h
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hβr : Β¬(aβ, bβ) β€ (aβ, bβ)
hβ : bβ β€ bβ
β’ bβ β€ bβ β§ Β¬bβ β€ bβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
| constructor | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr.intro.right.h.left
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hβr : Β¬(aβ, bβ) β€ (aβ, bβ)
hβ : bβ β€ bβ
β’ bβ β€ bβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· | assumption | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr.intro.right.h.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hβr : Β¬(aβ, bβ) β€ (aβ, bβ)
hβ : bβ β€ bβ
β’ Β¬bβ β€ bβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· | intro h | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· | Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr.intro.right.h.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hβr : Β¬(aβ, bβ) β€ (aβ, bβ)
hβ : bβ β€ bβ
h : bβ β€ bβ
β’ False | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
| apply hβr | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr.intro.right.h.right
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hβr : Β¬(aβ, bβ) β€ (aβ, bβ)
hβ : bβ β€ bβ
h : bβ β€ bβ
β’ (aβ, bβ) β€ (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
| right | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mpr.intro.right.h.right.h
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : Preorder Ξ±
instβ : Preorder Ξ²
srcβΒΉ : LE (Lex (Ξ± Γ Ξ²)) := instLE Ξ± Ξ²
srcβ : LT (Lex (Ξ± Γ Ξ²)) := instLT Ξ± Ξ²
xβ xβ : Lex (Ξ± Γ Ξ²)
aβ : Ξ±
bβ bβ : Ξ²
hβr : Β¬(aβ, bβ) β€ (aβ, bβ)
hβ : bβ β€ bβ
h : bβ β€ bβ
β’ bβ β€ bβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
| exact h | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
| Mathlib.Data.Prod.Lex.69_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒΉ : PartialOrder Ξ±
instβ : Preorder Ξ²
β’ Monotone βtoLex | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
| rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ© | theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
| Mathlib.Data.Prod.Lex.115_0.6Yc4sDJ4nVbbQgh | theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mk.mk.intro
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒΉ : PartialOrder Ξ±
instβ : Preorder Ξ²
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
ha : (aβ, bβ).1 β€ (aβ, bβ).1
hb : (aβ, bβ).2 β€ (aβ, bβ).2
β’ toLex (aβ, bβ) β€ toLex (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
| obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt | theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
| Mathlib.Data.Prod.Lex.115_0.6Yc4sDJ4nVbbQgh | theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mk.mk.intro.inl
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒΉ : PartialOrder Ξ±
instβ : Preorder Ξ²
aβ : Ξ±
bβ bβ : Ξ²
ha : (aβ, bβ).1 β€ (aβ, bβ).1
hb : (aβ, bβ).2 β€ (aβ, bβ).2
β’ toLex (aβ, bβ) β€ toLex (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· | exact right _ hb | theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· | Mathlib.Data.Prod.Lex.115_0.6Yc4sDJ4nVbbQgh | theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mk.mk.intro.inr
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒΉ : PartialOrder Ξ±
instβ : Preorder Ξ²
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
haβ : (aβ, bβ).1 β€ (aβ, bβ).1
hb : (aβ, bβ).2 β€ (aβ, bβ).2
ha : (aβ, bβ).1 < (aβ, bβ).1
β’ toLex (aβ, bβ) β€ toLex (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· | exact left _ _ ha | theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· | Mathlib.Data.Prod.Lex.115_0.6Yc4sDJ4nVbbQgh | theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒΉ : PartialOrder Ξ±
instβ : Preorder Ξ²
β’ StrictMono βtoLex | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
| rintro β¨aβ, bββ© β¨aβ, bββ© h | theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
| Mathlib.Data.Prod.Lex.126_0.6Yc4sDJ4nVbbQgh | theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mk.mk
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒΉ : PartialOrder Ξ±
instβ : Preorder Ξ²
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
h : (aβ, bβ) < (aβ, bβ)
β’ toLex (aβ, bβ) < toLex (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
| obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt | theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
| Mathlib.Data.Prod.Lex.126_0.6Yc4sDJ4nVbbQgh | theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mk.mk.inl
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒΉ : PartialOrder Ξ±
instβ : Preorder Ξ²
aβ : Ξ±
bβ bβ : Ξ²
h : (aβ, bβ) < (aβ, bβ)
β’ toLex (aβ, bβ) < toLex (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· | exact right _ (Prod.mk_lt_mk_iff_right.1 h) | theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· | Mathlib.Data.Prod.Lex.126_0.6Yc4sDJ4nVbbQgh | theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
case mk.mk.inr
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒΉ : PartialOrder Ξ±
instβ : Preorder Ξ²
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
h : (aβ, bβ) < (aβ, bβ)
ha : (aβ, bβ).1 < (aβ, bβ).1
β’ toLex (aβ, bβ) < toLex (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· | exact left _ _ ha | theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· | Mathlib.Data.Prod.Lex.126_0.6Yc4sDJ4nVbbQgh | theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : PartialOrder Ξ±
instβ : PartialOrder Ξ²
srcβ : Preorder (Lex (Ξ± Γ Ξ²)) := preorder Ξ± Ξ²
β’ β (a b : Lex (Ξ± Γ Ξ²)), a β€ b β b β€ a β a = b | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
| haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans } | /-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
| Mathlib.Data.Prod.Lex.135_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : PartialOrder Ξ±
instβ : PartialOrder Ξ²
srcβ : Preorder (Lex (Ξ± Γ Ξ²)) := preorder Ξ± Ξ²
this : IsStrictOrder Ξ± fun x x_1 => x < x_1
β’ β (a b : Lex (Ξ± Γ Ξ²)), a β€ b β b β€ a β a = b | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
| haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ© | /-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
| Mathlib.Data.Prod.Lex.135_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
Ξ±β : Type u_1
Ξ²β : Type u_2
Ξ³ : Type u_3
Ξ± : Type u_4
Ξ² : Type u_5
instβΒΉ : PartialOrder Ξ±
instβ : PartialOrder Ξ²
srcβ : Preorder (Lex (Ξ± Γ Ξ²)) := preorder Ξ± Ξ²
thisβ : IsStrictOrder Ξ± fun x x_1 => x < x_1
this : IsAntisymm Ξ² fun x x_1 => x β€ x_1
β’ β (a b : Lex (Ξ± Γ Ξ²)), a β€ b β b β€ a β a = b | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
| exact @antisymm _ (Prod.Lex _ _) _ | /-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
| Mathlib.Data.Prod.Lex.135_0.6Yc4sDJ4nVbbQgh | /-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) | Mathlib_Data_Prod_Lex |
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ³ : Preorder Ξ±
instβΒ² : Preorder Ξ²
instβΒΉ : DenselyOrdered Ξ±
instβ : DenselyOrdered Ξ²
β’ β (aβ aβ : Lex (Ξ± Γ Ξ²)), aβ < aβ β β a, aβ < a β§ a < aβ | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
| rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©) | instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
| Mathlib.Data.Prod.Lex.171_0.6Yc4sDJ4nVbbQgh | instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense | Mathlib_Data_Prod_Lex |
case left
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ³ : Preorder Ξ±
instβΒ² : Preorder Ξ²
instβΒΉ : DenselyOrdered Ξ±
instβ : DenselyOrdered Ξ²
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
h : aβ < aβ
β’ β a, (aβ, bβ) < a β§ a < (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· | obtain β¨c, hβ, hββ© := exists_between h | instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· | Mathlib.Data.Prod.Lex.171_0.6Yc4sDJ4nVbbQgh | instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense | Mathlib_Data_Prod_Lex |
case left.intro.intro
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ³ : Preorder Ξ±
instβΒ² : Preorder Ξ²
instβΒΉ : DenselyOrdered Ξ±
instβ : DenselyOrdered Ξ²
aβ : Ξ±
bβ : Ξ²
aβ : Ξ±
bβ : Ξ²
h : aβ < aβ
c : Ξ±
hβ : aβ < c
hβ : c < aβ
β’ β a, (aβ, bβ) < a β§ a < (aβ, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
| exact β¨(c, bβ), left _ _ hβ, left _ _ hββ© | instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
| Mathlib.Data.Prod.Lex.171_0.6Yc4sDJ4nVbbQgh | instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense | Mathlib_Data_Prod_Lex |
case right
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ³ : Preorder Ξ±
instβΒ² : Preorder Ξ²
instβΒΉ : DenselyOrdered Ξ±
instβ : DenselyOrdered Ξ²
a : Ξ±
bβ bβ : Ξ²
h : bβ < bβ
β’ β a_1, (a, bβ) < a_1 β§ a_1 < (a, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· | obtain β¨c, hβ, hββ© := exists_between h | instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· | Mathlib.Data.Prod.Lex.171_0.6Yc4sDJ4nVbbQgh | instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense | Mathlib_Data_Prod_Lex |
case right.intro.intro
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ³ : Preorder Ξ±
instβΒ² : Preorder Ξ²
instβΒΉ : DenselyOrdered Ξ±
instβ : DenselyOrdered Ξ²
a : Ξ±
bβ bβ : Ξ²
h : bβ < bβ
c : Ξ²
hβ : bβ < c
hβ : c < bβ
β’ β a_1, (a, bβ) < a_1 β§ a_1 < (a, bβ) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
| exact β¨(a, c), right _ hβ, right _ hββ© | instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
| Mathlib.Data.Prod.Lex.171_0.6Yc4sDJ4nVbbQgh | instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense | Mathlib_Data_Prod_Lex |
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMaxOrder Ξ±
β’ β (a : Lex (Ξ± Γ Ξ²)), β b, a < b | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
| rintro β¨a, bβ© | instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
| Mathlib.Data.Prod.Lex.180_0.6Yc4sDJ4nVbbQgh | instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt | Mathlib_Data_Prod_Lex |
case mk
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMaxOrder Ξ±
a : Ξ±
b : Ξ²
β’ β b_1, (a, b) < b_1 | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
| obtain β¨c, hβ© := exists_gt a | instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
| Mathlib.Data.Prod.Lex.180_0.6Yc4sDJ4nVbbQgh | instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt | Mathlib_Data_Prod_Lex |
case mk.intro
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMaxOrder Ξ±
a : Ξ±
b : Ξ²
c : Ξ±
h : a < c
β’ β b_1, (a, b) < b_1 | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
| exact β¨β¨c, bβ©, left _ _ hβ© | instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
| Mathlib.Data.Prod.Lex.180_0.6Yc4sDJ4nVbbQgh | instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt | Mathlib_Data_Prod_Lex |
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMinOrder Ξ±
β’ β (a : Lex (Ξ± Γ Ξ²)), β b, b < a | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_max_order_of_left Prod.Lex.noMaxOrder_of_left
instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
| rintro β¨a, bβ© | instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
| Mathlib.Data.Prod.Lex.187_0.6Yc4sDJ4nVbbQgh | instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt | Mathlib_Data_Prod_Lex |
case mk
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMinOrder Ξ±
a : Ξ±
b : Ξ²
β’ β b_1, b_1 < (a, b) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_max_order_of_left Prod.Lex.noMaxOrder_of_left
instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
| obtain β¨c, hβ© := exists_lt a | instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
| Mathlib.Data.Prod.Lex.187_0.6Yc4sDJ4nVbbQgh | instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt | Mathlib_Data_Prod_Lex |
case mk.intro
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMinOrder Ξ±
a : Ξ±
b : Ξ²
c : Ξ±
h : c < a
β’ β b_1, b_1 < (a, b) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_max_order_of_left Prod.Lex.noMaxOrder_of_left
instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_lt a
| exact β¨β¨c, bβ©, left _ _ hβ© | instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_lt a
| Mathlib.Data.Prod.Lex.187_0.6Yc4sDJ4nVbbQgh | instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt | Mathlib_Data_Prod_Lex |
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMaxOrder Ξ²
β’ β (a : Lex (Ξ± Γ Ξ²)), β b, a < b | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_max_order_of_left Prod.Lex.noMaxOrder_of_left
instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_lt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_min_order_of_left Prod.Lex.noMinOrder_of_left
instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
| rintro β¨a, bβ© | instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
| Mathlib.Data.Prod.Lex.194_0.6Yc4sDJ4nVbbQgh | instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt | Mathlib_Data_Prod_Lex |
case mk
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMaxOrder Ξ²
a : Ξ±
b : Ξ²
β’ β b_1, (a, b) < b_1 | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_max_order_of_left Prod.Lex.noMaxOrder_of_left
instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_lt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_min_order_of_left Prod.Lex.noMinOrder_of_left
instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
| obtain β¨c, hβ© := exists_gt b | instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
| Mathlib.Data.Prod.Lex.194_0.6Yc4sDJ4nVbbQgh | instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt | Mathlib_Data_Prod_Lex |
case mk.intro
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMaxOrder Ξ²
a : Ξ±
b c : Ξ²
h : b < c
β’ β b_1, (a, b) < b_1 | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_max_order_of_left Prod.Lex.noMaxOrder_of_left
instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_lt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_min_order_of_left Prod.Lex.noMinOrder_of_left
instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt b
| exact β¨β¨a, cβ©, right _ hβ© | instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt b
| Mathlib.Data.Prod.Lex.194_0.6Yc4sDJ4nVbbQgh | instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt | Mathlib_Data_Prod_Lex |
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMinOrder Ξ²
β’ β (a : Lex (Ξ± Γ Ξ²)), β b, b < a | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_max_order_of_left Prod.Lex.noMaxOrder_of_left
instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_lt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_min_order_of_left Prod.Lex.noMinOrder_of_left
instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt b
exact β¨β¨a, cβ©, right _ hβ©
#align prod.lex.no_max_order_of_right Prod.Lex.noMaxOrder_of_right
instance noMinOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ²] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
| rintro β¨a, bβ© | instance noMinOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ²] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
| Mathlib.Data.Prod.Lex.201_0.6Yc4sDJ4nVbbQgh | instance noMinOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ²] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt | Mathlib_Data_Prod_Lex |
case mk
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMinOrder Ξ²
a : Ξ±
b : Ξ²
β’ β b_1, b_1 < (a, b) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_max_order_of_left Prod.Lex.noMaxOrder_of_left
instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_lt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_min_order_of_left Prod.Lex.noMinOrder_of_left
instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt b
exact β¨β¨a, cβ©, right _ hβ©
#align prod.lex.no_max_order_of_right Prod.Lex.noMaxOrder_of_right
instance noMinOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ²] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
| obtain β¨c, hβ© := exists_lt b | instance noMinOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ²] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
| Mathlib.Data.Prod.Lex.201_0.6Yc4sDJ4nVbbQgh | instance noMinOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ²] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt | Mathlib_Data_Prod_Lex |
case mk.intro
Ξ± : Type u_1
Ξ² : Type u_2
Ξ³ : Type u_3
instβΒ² : Preorder Ξ±
instβΒΉ : Preorder Ξ²
instβ : NoMinOrder Ξ²
a : Ξ±
b c : Ξ²
h : c < b
β’ β b_1, b_1 < (a, b) | /-
Copyright (c) 2019 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Minchao Wu
-/
import Mathlib.Order.BoundedOrder
#align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
/-!
# Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
## Main declarations
* `Prod.Lex.<pre/partial/linear>Order`: Instances lifting the orders on `Ξ±` and `Ξ²` to `Ξ± Γβ Ξ²`.
## Notation
* `Ξ± Γβ Ξ²`: `Ξ± Γ Ξ²` equipped with the lexicographic order
## See also
Related files are:
* `Data.Finset.CoLex`: Colexicographic order on finite sets.
* `Data.List.Lex`: Lexicographic order on lists.
* `Data.Pi.Lex`: Lexicographic order on `Ξ β i, Ξ± i`.
* `Data.PSigma.Order`: Lexicographic order on `Ξ£' i, Ξ± i`.
* `Data.Sigma.Order`: Lexicographic order on `Ξ£ i, Ξ± i`.
-/
variable {Ξ± Ξ² Ξ³ : Type*}
namespace Prod.Lex
-- porting note: `Prod.Lex` is not protected in core, hence the `_root_.` prefix
-- This will be fixed in nightly-2022-11-30
@[inherit_doc] notation:35 Ξ± " Γβ " Ξ²:34 => _root_.Lex (Prod Ξ± Ξ²)
instance decidableEq (Ξ± Ξ² : Type*) [DecidableEq Ξ±] [DecidableEq Ξ²] : DecidableEq (Ξ± Γβ Ξ²) :=
instDecidableEqProd
#align prod.lex.decidable_eq Prod.Lex.decidableEq
instance inhabited (Ξ± Ξ² : Type*) [Inhabited Ξ±] [Inhabited Ξ²] : Inhabited (Ξ± Γβ Ξ²) :=
instInhabitedProd
#align prod.lex.inhabited Prod.Lex.inhabited
/-- Dictionary / lexicographic ordering on pairs. -/
instance instLE (Ξ± Ξ² : Type*) [LT Ξ±] [LE Ξ²] : LE (Ξ± Γβ Ξ²) where le := Prod.Lex (Β· < Β·) (Β· β€ Β·)
#align prod.lex.has_le Prod.Lex.instLE
instance instLT (Ξ± Ξ² : Type*) [LT Ξ±] [LT Ξ²] : LT (Ξ± Γβ Ξ²) where lt := Prod.Lex (Β· < Β·) (Β· < Β·)
#align prod.lex.has_lt Prod.Lex.instLT
theorem le_iff [LT Ξ±] [LE Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a β€ toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 β€ b.2 :=
Prod.lex_def (Β· < Β·) (Β· β€ Β·)
#align prod.lex.le_iff Prod.Lex.le_iff
theorem lt_iff [LT Ξ±] [LT Ξ²] (a b : Ξ± Γ Ξ²) :
toLex a < toLex b β a.1 < b.1 β¨ a.1 = b.1 β§ a.2 < b.2 :=
Prod.lex_def (Β· < Β·) (Β· < Β·)
#align prod.lex.lt_iff Prod.Lex.lt_iff
example (x : Ξ±) (y : Ξ²) : toLex (x, y) = toLex (x, y) := rfl
/-- Dictionary / lexicographic preorder for pairs. -/
instance preorder (Ξ± Ξ² : Type*) [Preorder Ξ±] [Preorder Ξ²] : Preorder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.instLE Ξ± Ξ², Prod.Lex.instLT Ξ± Ξ² with
le_refl := refl_of <| Prod.Lex _ _,
le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _,
lt_iff_le_not_le := fun xβ xβ =>
match xβ, xβ with
| (aβ, bβ), (aβ, bβ) => by
constructor
Β· rintro (β¨_, _, hltβ© | β¨_, hltβ©)
Β· constructor
Β· exact left _ _ hlt
Β· rintro β¨β©
Β· apply lt_asymm hlt; assumption
Β· exact lt_irrefl _ hlt
Β· constructor
Β· right
rw [lt_iff_le_not_le] at hlt
exact hlt.1
Β· rintro β¨β©
Β· apply lt_irrefl aβ
assumption
Β· rw [lt_iff_le_not_le] at hlt
apply hlt.2
assumption
Β· rintro β¨β¨β©, hβrβ©
Β· left
assumption
Β· right
rw [lt_iff_le_not_le]
constructor
Β· assumption
Β· intro h
apply hβr
right
exact h }
#align prod.lex.preorder Prod.Lex.preorder
section Preorder
variable [PartialOrder Ξ±] [Preorder Ξ²]
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_mono : @Monotone _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© β¨ha, hbβ©
obtain rfl | ha : aβ = aβ β¨ _ := ha.eq_or_lt
Β· exact right _ hb
Β· exact left _ _ ha
#align prod.lex.to_lex_mono Prod.Lex.toLex_mono
-- porting note: type class search sees right through the type synonrm for `Ξ± Γβ Ξ²` and uses the
-- `Preorder` structure for `Ξ± Γ Ξ²` instead
-- This is hopefully the same problems as in https://github.com/leanprover/lean4/issues/1891
-- and will be fixed in nightly-2022-11-30
theorem toLex_strictMono : @StrictMono _ _ _ (Prod.Lex.preorder Ξ± Ξ²) (toLex : Ξ± Γ Ξ² β Ξ± Γβ Ξ²) := by
rintro β¨aβ, bββ© β¨aβ, bββ© h
obtain rfl | ha : aβ = aβ β¨ _ := h.le.1.eq_or_lt
Β· exact right _ (Prod.mk_lt_mk_iff_right.1 h)
Β· exact left _ _ ha
#align prod.lex.to_lex_strict_mono Prod.Lex.toLex_strictMono
end Preorder
/-- Dictionary / lexicographic partial order for pairs. -/
instance partialOrder (Ξ± Ξ² : Type*) [PartialOrder Ξ±] [PartialOrder Ξ²] : PartialOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.preorder Ξ± Ξ² with
le_antisymm := by
haveI : IsStrictOrder Ξ± (Β· < Β·) := { irrefl := lt_irrefl, trans := fun _ _ _ => lt_trans }
haveI : IsAntisymm Ξ² (Β· β€ Β·) := β¨fun _ _ => le_antisymmβ©
exact @antisymm _ (Prod.Lex _ _) _ }
#align prod.lex.partial_order Prod.Lex.partialOrder
/-- Dictionary / lexicographic linear order for pairs. -/
instance linearOrder (Ξ± Ξ² : Type*) [LinearOrder Ξ±] [LinearOrder Ξ²] : LinearOrder (Ξ± Γβ Ξ²) :=
{ Prod.Lex.partialOrder Ξ± Ξ² with
le_total := total_of (Prod.Lex _ _),
decidableLE := Prod.Lex.decidable _ _,
decidableLT := Prod.Lex.decidable _ _,
decidableEq := Lex.decidableEq _ _, }
#align prod.lex.linear_order Prod.Lex.linearOrder
instance [Ord Ξ±] [Ord Ξ²] : Ord (Ξ± Γβ Ξ²) where
compare := compareLex (compareOn (Β·.1)) (compareOn (Β·.2))
instance orderBot [PartialOrder Ξ±] [Preorder Ξ²] [OrderBot Ξ±] [OrderBot Ξ²] : OrderBot (Ξ± Γβ Ξ²) where
bot := toLex β₯
bot_le _ := toLex_mono bot_le
#align prod.lex.order_bot Prod.Lex.orderBot
instance orderTop [PartialOrder Ξ±] [Preorder Ξ²] [OrderTop Ξ±] [OrderTop Ξ²] : OrderTop (Ξ± Γβ Ξ²) where
top := toLex β€
le_top _ := toLex_mono le_top
#align prod.lex.order_top Prod.Lex.orderTop
instance boundedOrder [PartialOrder Ξ±] [Preorder Ξ²] [BoundedOrder Ξ±] [BoundedOrder Ξ²] :
BoundedOrder (Ξ± Γβ Ξ²) :=
{ Lex.orderBot, Lex.orderTop with }
#align prod.lex.bounded_order Prod.Lex.boundedOrder
instance [Preorder Ξ±] [Preorder Ξ²] [DenselyOrdered Ξ±] [DenselyOrdered Ξ²] :
DenselyOrdered (Ξ± Γβ Ξ²) where
dense := by
rintro _ _ (@β¨aβ, bβ, aβ, bβ, hβ© | @β¨a, bβ, bβ, hβ©)
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(c, bβ), left _ _ hβ, left _ _ hββ©
Β· obtain β¨c, hβ, hββ© := exists_between h
exact β¨(a, c), right _ hβ, right _ hββ©
instance noMaxOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ±] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_max_order_of_left Prod.Lex.noMaxOrder_of_left
instance noMinOrder_of_left [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ±] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_lt a
exact β¨β¨c, bβ©, left _ _ hβ©
#align prod.lex.no_min_order_of_left Prod.Lex.noMinOrder_of_left
instance noMaxOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMaxOrder Ξ²] : NoMaxOrder (Ξ± Γβ Ξ²) where
exists_gt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_gt b
exact β¨β¨a, cβ©, right _ hβ©
#align prod.lex.no_max_order_of_right Prod.Lex.noMaxOrder_of_right
instance noMinOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ²] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_lt b
| exact β¨β¨a, cβ©, right _ hβ© | instance noMinOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ²] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt := by
rintro β¨a, bβ©
obtain β¨c, hβ© := exists_lt b
| Mathlib.Data.Prod.Lex.201_0.6Yc4sDJ4nVbbQgh | instance noMinOrder_of_right [Preorder Ξ±] [Preorder Ξ²] [NoMinOrder Ξ²] : NoMinOrder (Ξ± Γβ Ξ²) where
exists_lt | Mathlib_Data_Prod_Lex |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : SeminormedRing π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
add_le : β (x y : E), f (x + y) β€ f x + f y
smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x
β’ f 0 = 0 | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by | rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul] | /-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by | Mathlib.Analysis.Seminorm.75_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : SeminormedRing π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
add_le : β (x y : E), f (x + y) β€ f x + f y
smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x
x : E
β’ f (-x) = f x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by | rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul] | /-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by | Mathlib.Analysis.Seminorm.75_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : NormedField π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
map_zero : f 0 = 0
add_le : β (x y : E), f (x + y) β€ f x + f y
smul_le : β (r : π) (x : E), f (r β’ x) β€ βrβ * f x
r : π
x : E
β’ f (r β’ x) = βrβ * f x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
| refine' le_antisymm (smul_le r x) _ | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
| Mathlib.Analysis.Seminorm.87_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : NormedField π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
map_zero : f 0 = 0
add_le : β (x y : E), f (x + y) β€ f x + f y
smul_le : β (r : π) (x : E), f (r β’ x) β€ βrβ * f x
r : π
x : E
β’ βrβ * f x β€ f (r β’ x) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
| by_cases h : r = 0 | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
| Mathlib.Analysis.Seminorm.87_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E | Mathlib_Analysis_Seminorm |
case pos
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : NormedField π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
map_zero : f 0 = 0
add_le : β (x y : E), f (x + y) β€ f x + f y
smul_le : β (r : π) (x : E), f (r β’ x) β€ βrβ * f x
r : π
x : E
h : r = 0
β’ βrβ * f x β€ f (r β’ x) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· | simp [h, map_zero] | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· | Mathlib.Analysis.Seminorm.87_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E | Mathlib_Analysis_Seminorm |
case neg
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : NormedField π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
map_zero : f 0 = 0
add_le : β (x y : E), f (x + y) β€ f x + f y
smul_le : β (r : π) (x : E), f (r β’ x) β€ βrβ * f x
r : π
x : E
h : Β¬r = 0
β’ βrβ * f x β€ f (r β’ x) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
| rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))] | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
| Mathlib.Analysis.Seminorm.87_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E | Mathlib_Analysis_Seminorm |
case neg
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : NormedField π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
map_zero : f 0 = 0
add_le : β (x y : E), f (x + y) β€ f x + f y
smul_le : β (r : π) (x : E), f (r β’ x) β€ βrβ * f x
r : π
x : E
h : Β¬r = 0
β’ βrββ»ΒΉ * (βrβ * f x) β€ βrββ»ΒΉ * f (r β’ x) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
| rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)] | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
| Mathlib.Analysis.Seminorm.87_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E | Mathlib_Analysis_Seminorm |
case neg
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : NormedField π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
map_zero : f 0 = 0
add_le : β (x y : E), f (x + y) β€ f x + f y
smul_le : β (r : π) (x : E), f (r β’ x) β€ βrβ * f x
r : π
x : E
h : Β¬r = 0
β’ f x β€ βrββ»ΒΉ * f (r β’ x) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
| specialize smul_le rβ»ΒΉ (r β’ x) | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
| Mathlib.Analysis.Seminorm.87_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E | Mathlib_Analysis_Seminorm |
case neg
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : NormedField π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
map_zero : f 0 = 0
add_le : β (x y : E), f (x + y) β€ f x + f y
r : π
x : E
h : Β¬r = 0
smul_le : f (rβ»ΒΉ β’ r β’ x) β€ βrβ»ΒΉβ * f (r β’ x)
β’ f x β€ βrββ»ΒΉ * f (r β’ x) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
| rw [norm_inv] at smul_le | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
| Mathlib.Analysis.Seminorm.87_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E | Mathlib_Analysis_Seminorm |
case neg
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : NormedField π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
map_zero : f 0 = 0
add_le : β (x y : E), f (x + y) β€ f x + f y
r : π
x : E
h : Β¬r = 0
smul_le : f (rβ»ΒΉ β’ r β’ x) β€ βrββ»ΒΉ * f (r β’ x)
β’ f x β€ βrββ»ΒΉ * f (r β’ x) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
| convert smul_le | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
| Mathlib.Analysis.Seminorm.87_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E | Mathlib_Analysis_Seminorm |
case h.e'_3.h.e'_1
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : NormedField π
instβΒΉ : AddCommGroup E
instβ : Module π E
f : E β β
map_zero : f 0 = 0
add_le : β (x y : E), f (x + y) β€ f x + f y
r : π
x : E
h : Β¬r = 0
smul_le : f (rβ»ΒΉ β’ r β’ x) β€ βrββ»ΒΉ * f (r β’ x)
β’ x = rβ»ΒΉ β’ r β’ x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
| simp [h] | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
| Mathlib.Analysis.Seminorm.87_0.ywwMCgoKeIFKDZ3 | /-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : SeminormedRing π
instβΒΉ : AddGroup E
instβ : SMul π E
f g : Seminorm π E
h : (fun f => f.toFun) f = (fun f => f.toFun) g
β’ f = g | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
| rcases f with β¨β¨_β©β© | instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
| Mathlib.Analysis.Seminorm.120_0.ywwMCgoKeIFKDZ3 | instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f | Mathlib_Analysis_Seminorm |
case mk.mk
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : SeminormedRing π
instβΒΉ : AddGroup E
instβ : SMul π E
g : Seminorm π E
toFunβ : E β β
map_zero'β : toFunβ 0 = 0
add_le'β : β (r s : E), toFunβ (r + s) β€ toFunβ r + toFunβ s
neg'β : β (r : E), toFunβ (-r) = toFunβ r
smul'β :
β (a : π) (x : E),
AddGroupSeminorm.toFun { toFun := toFunβ, map_zero' := map_zero'β, add_le' := add_le'β, neg' := neg'β } (a β’ x) =
βaβ * AddGroupSeminorm.toFun { toFun := toFunβ, map_zero' := map_zero'β, add_le' := add_le'β, neg' := neg'β } x
h :
(fun f => f.toFun)
{ toAddGroupSeminorm := { toFun := toFunβ, map_zero' := map_zero'β, add_le' := add_le'β, neg' := neg'β },
smul' := smul'β } =
(fun f => f.toFun) g
β’ { toAddGroupSeminorm := { toFun := toFunβ, map_zero' := map_zero'β, add_le' := add_le'β, neg' := neg'β },
smul' := smul'β } =
g | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
| rcases g with β¨β¨_β©β© | instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
| Mathlib.Analysis.Seminorm.120_0.ywwMCgoKeIFKDZ3 | instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f | Mathlib_Analysis_Seminorm |
case mk.mk.mk.mk
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : SeminormedRing π
instβΒΉ : AddGroup E
instβ : SMul π E
toFunβΒΉ : E β β
map_zero'βΒΉ : toFunβΒΉ 0 = 0
add_le'βΒΉ : β (r s : E), toFunβΒΉ (r + s) β€ toFunβΒΉ r + toFunβΒΉ s
neg'βΒΉ : β (r : E), toFunβΒΉ (-r) = toFunβΒΉ r
smul'βΒΉ :
β (a : π) (x : E),
AddGroupSeminorm.toFun { toFun := toFunβΒΉ, map_zero' := map_zero'βΒΉ, add_le' := add_le'βΒΉ, neg' := neg'βΒΉ }
(a β’ x) =
βaβ *
AddGroupSeminorm.toFun { toFun := toFunβΒΉ, map_zero' := map_zero'βΒΉ, add_le' := add_le'βΒΉ, neg' := neg'βΒΉ } x
toFunβ : E β β
map_zero'β : toFunβ 0 = 0
add_le'β : β (r s : E), toFunβ (r + s) β€ toFunβ r + toFunβ s
neg'β : β (r : E), toFunβ (-r) = toFunβ r
smul'β :
β (a : π) (x : E),
AddGroupSeminorm.toFun { toFun := toFunβ, map_zero' := map_zero'β, add_le' := add_le'β, neg' := neg'β } (a β’ x) =
βaβ * AddGroupSeminorm.toFun { toFun := toFunβ, map_zero' := map_zero'β, add_le' := add_le'β, neg' := neg'β } x
h :
(fun f => f.toFun)
{ toAddGroupSeminorm := { toFun := toFunβΒΉ, map_zero' := map_zero'βΒΉ, add_le' := add_le'βΒΉ, neg' := neg'βΒΉ },
smul' := smul'βΒΉ } =
(fun f => f.toFun)
{ toAddGroupSeminorm := { toFun := toFunβ, map_zero' := map_zero'β, add_le' := add_le'β, neg' := neg'β },
smul' := smul'β }
β’ { toAddGroupSeminorm := { toFun := toFunβΒΉ, map_zero' := map_zero'βΒΉ, add_le' := add_le'βΒΉ, neg' := neg'βΒΉ },
smul' := smul'βΒΉ } =
{ toAddGroupSeminorm := { toFun := toFunβ, map_zero' := map_zero'β, add_le' := add_le'β, neg' := neg'β },
smul' := smul'β } | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
| congr | instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
| Mathlib.Analysis.Seminorm.120_0.ywwMCgoKeIFKDZ3 | instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instββ΅ : SeminormedRing π
instββ΄ : AddGroup E
instβΒ³ : SMul π E
pβ : Seminorm π E
c : π
x y : E
rβ : β
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
r : R
p : Seminorm π E
srcβ : AddGroupSeminorm E := r β’ p.toAddGroupSeminorm
xβΒΉ : π
xβ : E
β’ AddGroupSeminorm.toFun
{ toFun := fun x => r β’ p x, map_zero' := (_ : AddGroupSeminorm.toFun srcβ 0 = 0),
add_le' :=
(_ :
β (r s : E),
AddGroupSeminorm.toFun srcβ (r + s) β€ AddGroupSeminorm.toFun srcβ r + AddGroupSeminorm.toFun srcβ s),
neg' := (_ : β (r : E), AddGroupSeminorm.toFun srcβ (-r) = AddGroupSeminorm.toFun srcβ r) }
(xβΒΉ β’ xβ) =
βxβΒΉβ *
AddGroupSeminorm.toFun
{ toFun := fun x => r β’ p x, map_zero' := (_ : AddGroupSeminorm.toFun srcβ 0 = 0),
add_le' :=
(_ :
β (r s : E),
AddGroupSeminorm.toFun srcβ (r + s) β€ AddGroupSeminorm.toFun srcβ r + AddGroupSeminorm.toFun srcβ s),
neg' := (_ : β (r : E), AddGroupSeminorm.toFun srcβ (-r) = AddGroupSeminorm.toFun srcβ r) }
xβ | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
| simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul] | /-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
| Mathlib.Analysis.Seminorm.160_0.ywwMCgoKeIFKDZ3 | /-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instββ΅ : SeminormedRing π
instββ΄ : AddGroup E
instβΒ³ : SMul π E
pβ : Seminorm π E
c : π
x y : E
rβ : β
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
r : R
p : Seminorm π E
srcβ : AddGroupSeminorm E := r β’ p.toAddGroupSeminorm
xβΒΉ : π
xβ : E
β’ β(r β’ 1) * p (xβΒΉ β’ xβ) = βxβΒΉβ * (β(r β’ 1) * p xβ) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
| rw [map_smul_eq_mul, mul_left_comm] | /-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
| Mathlib.Analysis.Seminorm.160_0.ywwMCgoKeIFKDZ3 | /-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : SeminormedRing π
instβΒΉ : AddGroup E
instβ : SMul π E
pβ : Seminorm π E
c : π
xβ y : E
r : β
p q : Seminorm π E
srcβ : AddGroupSeminorm E := p.toAddGroupSeminorm + q.toAddGroupSeminorm
a : π
x : E
β’ AddGroupSeminorm.toFun
{ toFun := fun x => p x + q x, map_zero' := (_ : AddGroupSeminorm.toFun srcβ 0 = 0),
add_le' :=
(_ :
β (r s : E),
AddGroupSeminorm.toFun srcβ (r + s) β€ AddGroupSeminorm.toFun srcβ r + AddGroupSeminorm.toFun srcβ s),
neg' := (_ : β (r : E), AddGroupSeminorm.toFun srcβ (-r) = AddGroupSeminorm.toFun srcβ r) }
(a β’ x) =
βaβ *
AddGroupSeminorm.toFun
{ toFun := fun x => p x + q x, map_zero' := (_ : AddGroupSeminorm.toFun srcβ 0 = 0),
add_le' :=
(_ :
β (r s : E),
AddGroupSeminorm.toFun srcβ (r + s) β€ AddGroupSeminorm.toFun srcβ r + AddGroupSeminorm.toFun srcβ s),
neg' := (_ : β (r : E), AddGroupSeminorm.toFun srcβ (-r) = AddGroupSeminorm.toFun srcβ r) }
x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by | simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] | instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by | Mathlib.Analysis.Seminorm.185_0.ywwMCgoKeIFKDZ3 | instance instAdd : Add (Seminorm π E) where
add p q | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒ² : SeminormedRing π
instβΒΉ : AddGroup E
instβ : SMul π E
p : Seminorm π E
c : π
x y : E
r : β
xβΒΉ : Seminorm π E
xβ : β
β’ β(xβ β’ xβΒΉ) = xβ β’ βxβΒΉ | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by | rfl | instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by | Mathlib.Analysis.Seminorm.200_0.ywwMCgoKeIFKDZ3 | instance instAddMonoid : AddMonoid (Seminorm π E) | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instββΆ : SeminormedRing π
instββ΅ : AddGroup E
instββ΄ : SMul π E
p : Seminorm π E
c : π
x y : E
r : β
instβΒ³ : Monoid R
instβΒ² : MulAction R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
β’ β (c : R) (x : Seminorm π E), β(c β’ x) = c β’ βx | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by | intros | instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by | Mathlib.Analysis.Seminorm.206_0.ywwMCgoKeIFKDZ3 | instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instββΆ : SeminormedRing π
instββ΅ : AddGroup E
instββ΄ : SMul π E
p : Seminorm π E
c : π
x y : E
r : β
instβΒ³ : Monoid R
instβΒ² : MulAction R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
cβ : R
xβ : Seminorm π E
β’ β(cβ β’ xβ) = cβ β’ βxβ | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; | rfl | instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; | Mathlib.Analysis.Seminorm.206_0.ywwMCgoKeIFKDZ3 | instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instββΆ : SeminormedRing π
instββ΅ : AddGroup E
instββ΄ : SMul π E
p : Seminorm π E
c : π
x y : E
r : β
instβΒ³ : Monoid R
instβΒ² : DistribMulAction R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
β’ β (c : R) (x : Seminorm π E), (coeFnAddMonoidHom π E) (c β’ x) = c β’ (coeFnAddMonoidHom π E) x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by | intros | instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by | Mathlib.Analysis.Seminorm.226_0.ywwMCgoKeIFKDZ3 | instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instββΆ : SeminormedRing π
instββ΅ : AddGroup E
instββ΄ : SMul π E
p : Seminorm π E
c : π
x y : E
r : β
instβΒ³ : Monoid R
instβΒ² : DistribMulAction R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
cβ : R
xβ : Seminorm π E
β’ (coeFnAddMonoidHom π E) (cβ β’ xβ) = cβ β’ (coeFnAddMonoidHom π E) xβ | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; | rfl | instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; | Mathlib.Analysis.Seminorm.226_0.ywwMCgoKeIFKDZ3 | instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instββΆ : SeminormedRing π
instββ΅ : AddGroup E
instββ΄ : SMul π E
p : Seminorm π E
c : π
x y : E
r : β
instβΒ³ : Semiring R
instβΒ² : Module R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
β’ β (c : R) (x : Seminorm π E), (coeFnAddMonoidHom π E) (c β’ x) = c β’ (coeFnAddMonoidHom π E) x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by | intros | instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by | Mathlib.Analysis.Seminorm.230_0.ywwMCgoKeIFKDZ3 | instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instββΆ : SeminormedRing π
instββ΅ : AddGroup E
instββ΄ : SMul π E
p : Seminorm π E
c : π
x y : E
r : β
instβΒ³ : Semiring R
instβΒ² : Module R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
cβ : R
xβ : Seminorm π E
β’ (coeFnAddMonoidHom π E) (cβ β’ xβ) = cβ β’ (coeFnAddMonoidHom π E) xβ | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; | rfl | instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; | Mathlib.Analysis.Seminorm.230_0.ywwMCgoKeIFKDZ3 | instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instββ΅ : SeminormedRing π
instββ΄ : AddGroup E
instβΒ³ : SMul π E
pβ : Seminorm π E
c : π
xβ yβ : E
rβ : β
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
r : R
p q : Seminorm π E
x y : β
β’ r β’ max x y = max (r β’ x) (r β’ y) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
| simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg | theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
| Mathlib.Analysis.Seminorm.251_0.ywwMCgoKeIFKDZ3 | theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p : Seminorm πβ Eβ
f : E βββ[Οββ] Eβ
srcβ : AddGroupSeminorm E := AddGroupSeminorm.comp p.toAddGroupSeminorm (LinearMap.toAddMonoidHom f)
xβΒΉ : π
xβ : E
β’ AddGroupSeminorm.toFun
{ toFun := fun x => p (f x), map_zero' := (_ : AddGroupSeminorm.toFun srcβ 0 = 0),
add_le' :=
(_ :
β (r s : E),
AddGroupSeminorm.toFun srcβ (r + s) β€ AddGroupSeminorm.toFun srcβ r + AddGroupSeminorm.toFun srcβ s),
neg' := (_ : β (r : E), AddGroupSeminorm.toFun srcβ (-r) = AddGroupSeminorm.toFun srcβ r) }
(xβΒΉ β’ xβ) =
βxβΒΉβ *
AddGroupSeminorm.toFun
{ toFun := fun x => p (f x), map_zero' := (_ : AddGroupSeminorm.toFun srcβ 0 = 0),
add_le' :=
(_ :
β (r s : E),
AddGroupSeminorm.toFun srcβ (r + s) β€ AddGroupSeminorm.toFun srcβ r + AddGroupSeminorm.toFun srcβ s),
neg' := (_ : β (r : E), AddGroupSeminorm.toFun srcβ (-r) = AddGroupSeminorm.toFun srcβ r) }
xβ | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by | simp only [map_smulββ] | /-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by | Mathlib.Analysis.Seminorm.309_0.ywwMCgoKeIFKDZ3 | /-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p : Seminorm πβ Eβ
f : E βββ[Οββ] Eβ
srcβ : AddGroupSeminorm E := AddGroupSeminorm.comp p.toAddGroupSeminorm (LinearMap.toAddMonoidHom f)
xβΒΉ : π
xβ : E
β’ p (Οββ xβΒΉ β’ f xβ) = βxβΒΉβ * p (f xβ) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; | rw [map_smul_eq_mul, RingHomIsometric.is_iso] | /-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; | Mathlib.Analysis.Seminorm.309_0.ywwMCgoKeIFKDZ3 | /-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p q : Seminorm π E
a b : ββ₯0
hpq : p β€ q
hab : a β€ b
β’ a β’ p β€ b β’ q | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
| simp_rw [le_def] | theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
| Mathlib.Analysis.Seminorm.386_0.ywwMCgoKeIFKDZ3 | theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p q : Seminorm π E
a b : ββ₯0
hpq : p β€ q
hab : a β€ b
β’ β (x : E), (a β’ p) x β€ (b β’ q) x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
| intro x | theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
| Mathlib.Analysis.Seminorm.386_0.ywwMCgoKeIFKDZ3 | theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p q : Seminorm π E
a b : ββ₯0
hpq : p β€ q
hab : a β€ b
x : E
β’ (a β’ p) x β€ (b β’ q) x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
intro x
| exact mul_le_mul hab (hpq x) (map_nonneg p x) (NNReal.coe_nonneg b) | theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
intro x
| Mathlib.Analysis.Seminorm.386_0.ywwMCgoKeIFKDZ3 | theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p : ΞΉ β Seminorm π E
s : Finset ΞΉ
x : E
β’ (Finset.sup s p) x = β(Finset.sup s fun i => { val := (p i) x, property := (_ : 0 β€ (p i) x) }) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
intro x
exact mul_le_mul hab (hpq x) (map_nonneg p x) (NNReal.coe_nonneg b)
#align seminorm.smul_le_smul Seminorm.smul_le_smul
theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
| induction' s using Finset.cons_induction_on with a s ha ih | theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
| Mathlib.Analysis.Seminorm.393_0.ywwMCgoKeIFKDZ3 | theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) | Mathlib_Analysis_Seminorm |
case hβ
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p : ΞΉ β Seminorm π E
x : E
β’ (Finset.sup β
p) x = β(Finset.sup β
fun i => { val := (p i) x, property := (_ : 0 β€ (p i) x) }) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
intro x
exact mul_le_mul hab (hpq x) (map_nonneg p x) (NNReal.coe_nonneg b)
#align seminorm.smul_le_smul Seminorm.smul_le_smul
theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
induction' s using Finset.cons_induction_on with a s ha ih
Β· | rw [Finset.sup_empty, Finset.sup_empty, coe_bot, _root_.bot_eq_zero, Pi.zero_apply] | theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
induction' s using Finset.cons_induction_on with a s ha ih
Β· | Mathlib.Analysis.Seminorm.393_0.ywwMCgoKeIFKDZ3 | theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) | Mathlib_Analysis_Seminorm |
case hβ
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p : ΞΉ β Seminorm π E
x : E
β’ 0 = β0 | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
intro x
exact mul_le_mul hab (hpq x) (map_nonneg p x) (NNReal.coe_nonneg b)
#align seminorm.smul_le_smul Seminorm.smul_le_smul
theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
induction' s using Finset.cons_induction_on with a s ha ih
Β· rw [Finset.sup_empty, Finset.sup_empty, coe_bot, _root_.bot_eq_zero, Pi.zero_apply]
| norm_cast | theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
induction' s using Finset.cons_induction_on with a s ha ih
Β· rw [Finset.sup_empty, Finset.sup_empty, coe_bot, _root_.bot_eq_zero, Pi.zero_apply]
| Mathlib.Analysis.Seminorm.393_0.ywwMCgoKeIFKDZ3 | theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) | Mathlib_Analysis_Seminorm |
case hβ
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p : ΞΉ β Seminorm π E
x : E
a : ΞΉ
s : Finset ΞΉ
ha : a β s
ih : (Finset.sup s p) x = β(Finset.sup s fun i => { val := (p i) x, property := (_ : 0 β€ (p i) x) })
β’ (Finset.sup (Finset.cons a s ha) p) x =
β(Finset.sup (Finset.cons a s ha) fun i => { val := (p i) x, property := (_ : 0 β€ (p i) x) }) | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
intro x
exact mul_le_mul hab (hpq x) (map_nonneg p x) (NNReal.coe_nonneg b)
#align seminorm.smul_le_smul Seminorm.smul_le_smul
theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
induction' s using Finset.cons_induction_on with a s ha ih
Β· rw [Finset.sup_empty, Finset.sup_empty, coe_bot, _root_.bot_eq_zero, Pi.zero_apply]
norm_cast
Β· | rw [Finset.sup_cons, Finset.sup_cons, coe_sup, sup_eq_max, Pi.sup_apply, sup_eq_max,
NNReal.coe_max, NNReal.coe_mk, ih] | theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
induction' s using Finset.cons_induction_on with a s ha ih
Β· rw [Finset.sup_empty, Finset.sup_empty, coe_bot, _root_.bot_eq_zero, Pi.zero_apply]
norm_cast
Β· | Mathlib.Analysis.Seminorm.393_0.ywwMCgoKeIFKDZ3 | theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p : ΞΉ β Seminorm π E
s : Finset ΞΉ
hs : Finset.Nonempty s
x : E
β’ β i β s, (Finset.sup s p) x = (p i) x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
intro x
exact mul_le_mul hab (hpq x) (map_nonneg p x) (NNReal.coe_nonneg b)
#align seminorm.smul_le_smul Seminorm.smul_le_smul
theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
induction' s using Finset.cons_induction_on with a s ha ih
Β· rw [Finset.sup_empty, Finset.sup_empty, coe_bot, _root_.bot_eq_zero, Pi.zero_apply]
norm_cast
Β· rw [Finset.sup_cons, Finset.sup_cons, coe_sup, sup_eq_max, Pi.sup_apply, sup_eq_max,
NNReal.coe_max, NNReal.coe_mk, ih]
#align seminorm.finset_sup_apply Seminorm.finset_sup_apply
theorem exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) {s : Finset ΞΉ} (hs : s.Nonempty) (x : E) :
β i β s, s.sup p x = p i x := by
| rcases Finset.exists_mem_eq_sup s hs (fun i β¦ (β¨p i x, map_nonneg _ _β© : ββ₯0)) with β¨i, hi, hixβ© | theorem exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) {s : Finset ΞΉ} (hs : s.Nonempty) (x : E) :
β i β s, s.sup p x = p i x := by
| Mathlib.Analysis.Seminorm.402_0.ywwMCgoKeIFKDZ3 | theorem exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) {s : Finset ΞΉ} (hs : s.Nonempty) (x : E) :
β i β s, s.sup p x = p i x | Mathlib_Analysis_Seminorm |
case intro.intro
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p : ΞΉ β Seminorm π E
s : Finset ΞΉ
hs : Finset.Nonempty s
x : E
i : ΞΉ
hi : i β s
hix :
(Finset.sup s fun i => { val := (p i) x, property := (_ : 0 β€ (p i) x) }) =
{ val := (p i) x, property := (_ : 0 β€ (p i) x) }
β’ β i β s, (Finset.sup s p) x = (p i) x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
intro x
exact mul_le_mul hab (hpq x) (map_nonneg p x) (NNReal.coe_nonneg b)
#align seminorm.smul_le_smul Seminorm.smul_le_smul
theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
induction' s using Finset.cons_induction_on with a s ha ih
Β· rw [Finset.sup_empty, Finset.sup_empty, coe_bot, _root_.bot_eq_zero, Pi.zero_apply]
norm_cast
Β· rw [Finset.sup_cons, Finset.sup_cons, coe_sup, sup_eq_max, Pi.sup_apply, sup_eq_max,
NNReal.coe_max, NNReal.coe_mk, ih]
#align seminorm.finset_sup_apply Seminorm.finset_sup_apply
theorem exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) {s : Finset ΞΉ} (hs : s.Nonempty) (x : E) :
β i β s, s.sup p x = p i x := by
rcases Finset.exists_mem_eq_sup s hs (fun i β¦ (β¨p i x, map_nonneg _ _β© : ββ₯0)) with β¨i, hi, hixβ©
| rw [finset_sup_apply] | theorem exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) {s : Finset ΞΉ} (hs : s.Nonempty) (x : E) :
β i β s, s.sup p x = p i x := by
rcases Finset.exists_mem_eq_sup s hs (fun i β¦ (β¨p i x, map_nonneg _ _β© : ββ₯0)) with β¨i, hi, hixβ©
| Mathlib.Analysis.Seminorm.402_0.ywwMCgoKeIFKDZ3 | theorem exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) {s : Finset ΞΉ} (hs : s.Nonempty) (x : E) :
β i β s, s.sup p x = p i x | Mathlib_Analysis_Seminorm |
case intro.intro
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p : ΞΉ β Seminorm π E
s : Finset ΞΉ
hs : Finset.Nonempty s
x : E
i : ΞΉ
hi : i β s
hix :
(Finset.sup s fun i => { val := (p i) x, property := (_ : 0 β€ (p i) x) }) =
{ val := (p i) x, property := (_ : 0 β€ (p i) x) }
β’ β i β s, β(Finset.sup s fun i => { val := (p i) x, property := (_ : 0 β€ (p i) x) }) = (p i) x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
intro x
exact mul_le_mul hab (hpq x) (map_nonneg p x) (NNReal.coe_nonneg b)
#align seminorm.smul_le_smul Seminorm.smul_le_smul
theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
induction' s using Finset.cons_induction_on with a s ha ih
Β· rw [Finset.sup_empty, Finset.sup_empty, coe_bot, _root_.bot_eq_zero, Pi.zero_apply]
norm_cast
Β· rw [Finset.sup_cons, Finset.sup_cons, coe_sup, sup_eq_max, Pi.sup_apply, sup_eq_max,
NNReal.coe_max, NNReal.coe_mk, ih]
#align seminorm.finset_sup_apply Seminorm.finset_sup_apply
theorem exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) {s : Finset ΞΉ} (hs : s.Nonempty) (x : E) :
β i β s, s.sup p x = p i x := by
rcases Finset.exists_mem_eq_sup s hs (fun i β¦ (β¨p i x, map_nonneg _ _β© : ββ₯0)) with β¨i, hi, hixβ©
rw [finset_sup_apply]
| exact β¨i, hi, congr_arg _ hixβ© | theorem exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) {s : Finset ΞΉ} (hs : s.Nonempty) (x : E) :
β i β s, s.sup p x = p i x := by
rcases Finset.exists_mem_eq_sup s hs (fun i β¦ (β¨p i x, map_nonneg _ _β© : ββ₯0)) with β¨i, hi, hixβ©
rw [finset_sup_apply]
| Mathlib.Analysis.Seminorm.402_0.ywwMCgoKeIFKDZ3 | theorem exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) {s : Finset ΞΉ} (hs : s.Nonempty) (x : E) :
β i β s, s.sup p x = p i x | Mathlib_Analysis_Seminorm |
R : Type u_1
R' : Type u_2
π : Type u_3
πβ : Type u_4
πβ : Type u_5
π : Type u_6
E : Type u_7
Eβ : Type u_8
Eβ : Type u_9
F : Type u_10
G : Type u_11
ΞΉ : Type u_12
instβΒΉβΈ : SeminormedRing π
instβΒΉβ· : SeminormedRing πβ
instβΒΉβΆ : SeminormedRing πβ
Οββ : π β+* πβ
instβΒΉβ΅ : RingHomIsometric Οββ
Οββ : πβ β+* πβ
instβΒΉβ΄ : RingHomIsometric Οββ
Οββ : π β+* πβ
instβΒΉΒ³ : RingHomIsometric Οββ
instβΒΉΒ² : AddCommGroup E
instβΒΉΒΉ : AddCommGroup Eβ
instβΒΉβ° : AddCommGroup Eβ
instββΉ : AddCommGroup F
instββΈ : AddCommGroup G
instββ· : Module π E
instββΆ : Module πβ Eβ
instββ΅ : Module πβ Eβ
instββ΄ : Module π F
instβΒ³ : Module π G
instβΒ² : SMul R β
instβΒΉ : SMul R ββ₯0
instβ : IsScalarTower R ββ₯0 β
p : ΞΉ β Seminorm π E
s : Finset ΞΉ
x : E
β’ (Finset.sup s p) x = 0 β¨ β i β s, (Finset.sup s p) x = (p i) x | /-
Copyright (c) 2019 Jean Lo. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean Lo, YaΓ«l Dillies, Moritz Doll
-/
import Mathlib.Data.Real.Pointwise
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.LocallyConvex.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
/-!
# Seminorms
This file defines seminorms.
A seminorm is a function to the reals which is positive-semidefinite, absolutely homogeneous, and
subadditive. They are closely related to convex sets, and a topological vector space is locally
convex if and only if its topology is induced by a family of seminorms.
## Main declarations
For a module over a normed ring:
* `Seminorm`: A function to the reals that is positive-semidefinite, absolutely homogeneous, and
subadditive.
* `normSeminorm π E`: The norm on `E` as a seminorm.
## References
* [H. H. Schaefer, *Topological Vector Spaces*][schaefer1966]
## Tags
seminorm, locally convex, LCTVS
-/
set_option autoImplicit true
open NormedField Set Filter
open scoped BigOperators NNReal Pointwise Topology Uniformity
variable {R R' π πβ πβ π E Eβ Eβ F G ΞΉ : Type*}
/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (π : Type*) (E : Type*) [SeminormedRing π] [AddGroup E] [SMul π E] extends
AddGroupSeminorm E where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
smul' : β (a : π) (x : E), toFun (a β’ x) = βaβ * toFun x
#align seminorm Seminorm
attribute [nolint docBlame] Seminorm.toAddGroupSeminorm
/-- `SeminormClass F π E` states that `F` is a type of seminorms on the `π`-module `E`.
You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (π E : outParam <| Type*) [SeminormedRing π] [AddGroup E]
[SMul π E] extends AddGroupSeminormClass F E β where
/-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
and the original seminorm. -/
map_smul_eq_mul (f : F) (a : π) (x : E) : f (a β’ x) = βaβ * f x
#align seminorm_class SeminormClass
export SeminormClass (map_smul_eq_mul)
-- Porting note: dangerous instances no longer exist
-- attribute [nolint dangerousInstance] SeminormClass.toAddGroupSeminormClass
section Of
/-- Alternative constructor for a `Seminorm` on an `AddCommGroup E` that is a module over a
`SeminormedRing π`. -/
def Seminorm.of [SeminormedRing π] [AddCommGroup E] [Module π E] (f : E β β)
(add_le : β x y : E, f (x + y) β€ f x + f y) (smul : β (a : π) (x : E), f (a β’ x) = βaβ * f x) :
Seminorm π E where
toFun := f
map_zero' := by rw [β zero_smul π (0 : E), smul, norm_zero, zero_mul]
add_le' := add_le
smul' := smul
neg' x := by rw [β neg_one_smul π, smul, norm_neg, β smul, one_smul]
#align seminorm.of Seminorm.of
/-- Alternative constructor for a `Seminorm` over a normed field `π` that only assumes `f 0 = 0`
and an inequality for the scalar multiplication. -/
def Seminorm.ofSMulLE [NormedField π] [AddCommGroup E] [Module π E] (f : E β β) (map_zero : f 0 = 0)
(add_le : β x y, f (x + y) β€ f x + f y) (smul_le : β (r : π) (x), f (r β’ x) β€ βrβ * f x) :
Seminorm π E :=
Seminorm.of f add_le fun r x => by
refine' le_antisymm (smul_le r x) _
by_cases h : r = 0
Β· simp [h, map_zero]
rw [β mul_le_mul_left (inv_pos.mpr (norm_pos_iff.mpr h))]
rw [inv_mul_cancel_leftβ (norm_ne_zero_iff.mpr h)]
specialize smul_le rβ»ΒΉ (r β’ x)
rw [norm_inv] at smul_le
convert smul_le
simp [h]
#align seminorm.of_smul_le Seminorm.ofSMulLE
end Of
namespace Seminorm
section SeminormedRing
variable [SeminormedRing π]
section AddGroup
variable [AddGroup E]
section SMul
variable [SMul π E]
instance instSeminormClass : SeminormClass (Seminorm π E) π E where
coe f := f.toFun
coe_injective' f g h := by
rcases f with β¨β¨_β©β©
rcases g with β¨β¨_β©β©
congr
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_neg_eq_map f := f.neg'
map_smul_eq_mul f := f.smul'
#align seminorm.seminorm_class Seminorm.instSeminormClass
/-- Helper instance for when there's too many metavariables to apply `FunLike.hasCoeToFun`. -/
instance instCoeFun : CoeFun (Seminorm π E) fun _ => E β β :=
FunLike.hasCoeToFun
@[ext]
theorem ext {p q : Seminorm π E} (h : β x, (p : E β β) x = q x) : p = q :=
FunLike.ext p q h
#align seminorm.ext Seminorm.ext
instance instZero : Zero (Seminorm π E) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with
smul' := fun _ _ => (mul_zero _).symm }β©
@[simp]
theorem coe_zero : β(0 : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_zero Seminorm.coe_zero
@[simp]
theorem zero_apply (x : E) : (0 : Seminorm π E) x = 0 :=
rfl
#align seminorm.zero_apply Seminorm.zero_apply
instance : Inhabited (Seminorm π E) :=
β¨0β©
variable (p : Seminorm π E) (c : π) (x y : E) (r : β)
/-- Any action on `β` which factors through `ββ₯0` applies to a seminorm. -/
instance instSMul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] : SMul R (Seminorm π E) where
smul r p :=
{ r β’ p.toAddGroupSeminorm with
toFun := fun x => r β’ p x
smul' := fun _ _ => by
simp only [β smul_one_smul ββ₯0 r (_ : β), NNReal.smul_def, smul_eq_mul]
rw [map_smul_eq_mul, mul_left_comm] }
instance [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] [SMul R' β] [SMul R' ββ₯0]
[IsScalarTower R' ββ₯0 β] [SMul R R'] [IsScalarTower R R' β] :
IsScalarTower R R' (Seminorm π E) where
smul_assoc r a p := ext fun x => smul_assoc r a (p x)
theorem coe_smul [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E) :
β(r β’ p) = r β’ βp :=
rfl
#align seminorm.coe_smul Seminorm.coe_smul
@[simp]
theorem smul_apply [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p : Seminorm π E)
(x : E) : (r β’ p) x = r β’ p x :=
rfl
#align seminorm.smul_apply Seminorm.smul_apply
instance instAdd : Add (Seminorm π E) where
add p q :=
{ p.toAddGroupSeminorm + q.toAddGroupSeminorm with
toFun := fun x => p x + q x
smul' := fun a x => by simp only [map_smul_eq_mul, map_smul_eq_mul, mul_add] }
theorem coe_add (p q : Seminorm π E) : β(p + q) = p + q :=
rfl
#align seminorm.coe_add Seminorm.coe_add
@[simp]
theorem add_apply (p q : Seminorm π E) (x : E) : (p + q) x = p x + q x :=
rfl
#align seminorm.add_apply Seminorm.add_apply
instance instAddMonoid : AddMonoid (Seminorm π E) :=
FunLike.coe_injective.addMonoid _ rfl coe_add fun _ _ => by rfl
instance instOrderedCancelAddCommMonoid : OrderedCancelAddCommMonoid (Seminorm π E) :=
FunLike.coe_injective.orderedCancelAddCommMonoid _ rfl coe_add fun _ _ => rfl
instance instMulAction [Monoid R] [MulAction R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
MulAction R (Seminorm π E) :=
FunLike.coe_injective.mulAction _ (by intros; rfl)
variable (π E)
/-- `coeFn` as an `AddMonoidHom`. Helper definition for showing that `Seminorm π E` is a module. -/
@[simps]
def coeFnAddMonoidHom : AddMonoidHom (Seminorm π E) (E β β) where
toFun := (β)
map_zero' := coe_zero
map_add' := coe_add
#align seminorm.coe_fn_add_monoid_hom Seminorm.coeFnAddMonoidHom
theorem coeFnAddMonoidHom_injective : Function.Injective (coeFnAddMonoidHom π E) :=
show @Function.Injective (Seminorm π E) (E β β) (β) from FunLike.coe_injective
#align seminorm.coe_fn_add_monoid_hom_injective Seminorm.coeFnAddMonoidHom_injective
variable {π E}
instance instDistribMulAction [Monoid R] [DistribMulAction R β] [SMul R ββ₯0]
[IsScalarTower R ββ₯0 β] : DistribMulAction R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).distribMulAction _ (by intros; rfl)
instance instModule [Semiring R] [Module R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] :
Module R (Seminorm π E) :=
(coeFnAddMonoidHom_injective π E).module R _ (by intros; rfl)
instance instSup : Sup (Seminorm π E) where
sup p q :=
{ p.toAddGroupSeminorm β q.toAddGroupSeminorm with
toFun := p β q
smul' := fun x v =>
(congr_argβ max (map_smul_eq_mul p x v) (map_smul_eq_mul q x v)).trans <|
(mul_max_of_nonneg _ _ <| norm_nonneg x).symm }
@[simp]
theorem coe_sup (p q : Seminorm π E) : β(p β q) = (p : E β β) β (q : E β β) :=
rfl
#align seminorm.coe_sup Seminorm.coe_sup
theorem sup_apply (p q : Seminorm π E) (x : E) : (p β q) x = p x β q x :=
rfl
#align seminorm.sup_apply Seminorm.sup_apply
theorem smul_sup [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β] (r : R) (p q : Seminorm π E) :
r β’ (p β q) = r β’ p β r β’ q :=
have real.smul_max : β x y : β, r β’ max x y = max (r β’ x) (r β’ y) := fun x y => by
simpa only [β smul_eq_mul, β NNReal.smul_def, smul_one_smul ββ₯0 r (_ : β)] using
mul_max_of_nonneg x y (r β’ (1 : ββ₯0) : ββ₯0).coe_nonneg
ext fun x => real.smul_max _ _
#align seminorm.smul_sup Seminorm.smul_sup
instance instPartialOrder : PartialOrder (Seminorm π E) :=
PartialOrder.lift _ FunLike.coe_injective
@[simp, norm_cast]
theorem coe_le_coe {p q : Seminorm π E} : (p : E β β) β€ q β p β€ q :=
Iff.rfl
#align seminorm.coe_le_coe Seminorm.coe_le_coe
@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm π E} : (p : E β β) < q β p < q :=
Iff.rfl
#align seminorm.coe_lt_coe Seminorm.coe_lt_coe
theorem le_def {p q : Seminorm π E} : p β€ q β β x, p x β€ q x :=
Iff.rfl
#align seminorm.le_def Seminorm.le_def
theorem lt_def {p q : Seminorm π E} : p < q β p β€ q β§ β x, p x < q x :=
@Pi.lt_def _ _ _ p q
#align seminorm.lt_def Seminorm.lt_def
instance instSemilatticeSup : SemilatticeSup (Seminorm π E) :=
Function.Injective.semilatticeSup _ FunLike.coe_injective coe_sup
end SMul
end AddGroup
section Module
variable [SeminormedRing πβ] [SeminormedRing πβ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : πβ β+* πβ} [RingHomIsometric Οββ]
variable {Οββ : π β+* πβ} [RingHomIsometric Οββ]
variable [AddCommGroup E] [AddCommGroup Eβ] [AddCommGroup Eβ]
variable [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module πβ Eβ] [Module πβ Eβ] [Module π F] [Module π G]
-- Porting note: even though this instance is found immediately by typeclass search,
-- it seems to be needed below!?
noncomputable instance smul_nnreal_real : SMul ββ₯0 β := inferInstance
variable [SMul R β] [SMul R ββ₯0] [IsScalarTower R ββ₯0 β]
/-- Composition of a seminorm with a linear map is a seminorm. -/
def comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : Seminorm π E :=
{ p.toAddGroupSeminorm.comp f.toAddMonoidHom with
toFun := fun x => p (f x)
-- Porting note: the `simp only` below used to be part of the `rw`.
-- I'm not sure why this change was needed, and am worried by it!
smul' := fun _ _ => by simp only [map_smulββ]; rw [map_smul_eq_mul, RingHomIsometric.is_iso] }
#align seminorm.comp Seminorm.comp
theorem coe_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) : β(p.comp f) = p β f :=
rfl
#align seminorm.coe_comp Seminorm.coe_comp
@[simp]
theorem comp_apply (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (x : E) : (p.comp f) x = p (f x) :=
rfl
#align seminorm.comp_apply Seminorm.comp_apply
@[simp]
theorem comp_id (p : Seminorm π E) : p.comp LinearMap.id = p :=
ext fun _ => rfl
#align seminorm.comp_id Seminorm.comp_id
@[simp]
theorem comp_zero (p : Seminorm πβ Eβ) : p.comp (0 : E βββ[Οββ] Eβ) = 0 :=
ext fun _ => map_zero p
#align seminorm.comp_zero Seminorm.comp_zero
@[simp]
theorem zero_comp (f : E βββ[Οββ] Eβ) : (0 : Seminorm πβ Eβ).comp f = 0 :=
ext fun _ => rfl
#align seminorm.zero_comp Seminorm.zero_comp
theorem comp_comp [RingHomCompTriple Οββ Οββ Οββ] (p : Seminorm πβ Eβ) (g : Eβ βββ[Οββ] Eβ)
(f : E βββ[Οββ] Eβ) : p.comp (g.comp f) = (p.comp g).comp f :=
ext fun _ => rfl
#align seminorm.comp_comp Seminorm.comp_comp
theorem add_comp (p q : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) :
(p + q).comp f = p.comp f + q.comp f :=
ext fun _ => rfl
#align seminorm.add_comp Seminorm.add_comp
theorem comp_add_le (p : Seminorm πβ Eβ) (f g : E βββ[Οββ] Eβ) :
p.comp (f + g) β€ p.comp f + p.comp g := fun _ => map_add_le_add p _ _
#align seminorm.comp_add_le Seminorm.comp_add_le
theorem smul_comp (p : Seminorm πβ Eβ) (f : E βββ[Οββ] Eβ) (c : R) :
(c β’ p).comp f = c β’ p.comp f :=
ext fun _ => rfl
#align seminorm.smul_comp Seminorm.smul_comp
theorem comp_mono {p q : Seminorm πβ Eβ} (f : E βββ[Οββ] Eβ) (hp : p β€ q) : p.comp f β€ q.comp f :=
fun _ => hp _
#align seminorm.comp_mono Seminorm.comp_mono
/-- The composition as an `AddMonoidHom`. -/
@[simps]
def pullback (f : E βββ[Οββ] Eβ) : Seminorm πβ Eβ β+ Seminorm π E where
toFun := fun p => p.comp f
map_zero' := zero_comp f
map_add' := fun p q => add_comp p q f
#align seminorm.pullback Seminorm.pullback
instance instOrderBot : OrderBot (Seminorm π E) where
bot := 0
bot_le := map_nonneg
@[simp]
theorem coe_bot : β(β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.coe_bot Seminorm.coe_bot
theorem bot_eq_zero : (β₯ : Seminorm π E) = 0 :=
rfl
#align seminorm.bot_eq_zero Seminorm.bot_eq_zero
theorem smul_le_smul {p q : Seminorm π E} {a b : ββ₯0} (hpq : p β€ q) (hab : a β€ b) :
a β’ p β€ b β’ q := by
simp_rw [le_def]
intro x
exact mul_le_mul hab (hpq x) (map_nonneg p x) (NNReal.coe_nonneg b)
#align seminorm.smul_le_smul Seminorm.smul_le_smul
theorem finset_sup_apply (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = β(s.sup fun i => β¨p i x, map_nonneg (p i) xβ© : ββ₯0) := by
induction' s using Finset.cons_induction_on with a s ha ih
Β· rw [Finset.sup_empty, Finset.sup_empty, coe_bot, _root_.bot_eq_zero, Pi.zero_apply]
norm_cast
Β· rw [Finset.sup_cons, Finset.sup_cons, coe_sup, sup_eq_max, Pi.sup_apply, sup_eq_max,
NNReal.coe_max, NNReal.coe_mk, ih]
#align seminorm.finset_sup_apply Seminorm.finset_sup_apply
theorem exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) {s : Finset ΞΉ} (hs : s.Nonempty) (x : E) :
β i β s, s.sup p x = p i x := by
rcases Finset.exists_mem_eq_sup s hs (fun i β¦ (β¨p i x, map_nonneg _ _β© : ββ₯0)) with β¨i, hi, hixβ©
rw [finset_sup_apply]
exact β¨i, hi, congr_arg _ hixβ©
theorem zero_or_exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = 0 β¨ β i β s, s.sup p x = p i x := by
| rcases Finset.eq_empty_or_nonempty s with (rfl|hs) | theorem zero_or_exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = 0 β¨ β i β s, s.sup p x = p i x := by
| Mathlib.Analysis.Seminorm.408_0.ywwMCgoKeIFKDZ3 | theorem zero_or_exists_apply_eq_finset_sup (p : ΞΉ β Seminorm π E) (s : Finset ΞΉ) (x : E) :
s.sup p x = 0 β¨ β i β s, s.sup p x = p i x | Mathlib_Analysis_Seminorm |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.