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