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 h.e'_3 R : Type u_1 S : Type u_2 inst✝¹ : CommRing R inst✝ : CommRing S m n : ℕ ⊢ T R ((m + 2) * n) + T R (m * n) = T R (2 * n + m * n) + T R (m * n)
/- Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Julian Kuelshammer, Heather Macbeth -/ import Mathlib.Data.Polynomial.Derivative import Mathlib.Tactic.LinearCombination #align_import ring_theory.polynomial.chebyshev from "leanprover-community/mathlib"@"d774451114d6045faeb6751c396bea1eb9058946" /-! # Chebyshev polynomials The Chebyshev polynomials are two families of polynomials indexed by `ℕ`, with integral coefficients. ## Main definitions * `Polynomial.Chebyshev.T`: the Chebyshev polynomials of the first kind. * `Polynomial.Chebyshev.U`: the Chebyshev polynomials of the second kind. ## Main statements * The formal derivative of the Chebyshev polynomials of the first kind is a scalar multiple of the Chebyshev polynomials of the second kind. * `Polynomial.Chebyshev.mul_T`, the product of the `m`-th and `(m + k)`-th Chebyshev polynomials of the first kind is the sum of the `(2 * m + k)`-th and `k`-th Chebyshev polynomials of the first kind. * `Polynomial.Chebyshev.T_mul`, the `(m * n)`-th Chebyshev polynomial of the first kind is the composition of the `m`-th and `n`-th Chebyshev polynomials of the first kind. ## Implementation details Since Chebyshev polynomials have interesting behaviour over the complex numbers and modulo `p`, we define them to have coefficients in an arbitrary commutative ring, even though technically `ℤ` would suffice. The benefit of allowing arbitrary coefficient rings, is that the statements afterwards are clean, and do not have `map (Int.castRingHom R)` interfering all the time. ## References [Lionel Ponton, _Roots of the Chebyshev polynomials: A purely algebraic approach_] [ponton2020chebyshev] ## TODO * Redefine and/or relate the definition of Chebyshev polynomials to `LinearRecurrence`. * Add explicit formula involving square roots for Chebyshev polynomials * Compute zeroes and extrema of Chebyshev polynomials. * Prove that the roots of the Chebyshev polynomials (except 0) are irrational. * Prove minimax properties of Chebyshev polynomials. -/ noncomputable section namespace Polynomial.Chebyshev set_option linter.uppercaseLean3 false -- `T` `U` `X` open Polynomial open Polynomial variable (R S : Type*) [CommRing R] [CommRing S] /-- `T n` is the `n`-th Chebyshev polynomial of the first kind -/ noncomputable def T : ℕ → R[X] | 0 => 1 | 1 => X | n + 2 => 2 * X * T (n + 1) - T n #align polynomial.chebyshev.T Polynomial.Chebyshev.T @[simp] theorem T_zero : T R 0 = 1 := rfl #align polynomial.chebyshev.T_zero Polynomial.Chebyshev.T_zero @[simp] theorem T_one : T R 1 = X := rfl #align polynomial.chebyshev.T_one Polynomial.Chebyshev.T_one @[simp] theorem T_add_two (n : ℕ) : T R (n + 2) = 2 * X * T R (n + 1) - T R n := by rw [T] #align polynomial.chebyshev.T_add_two Polynomial.Chebyshev.T_add_two theorem T_two : T R 2 = 2 * X ^ 2 - 1 := by simp only [T, sub_left_inj, sq, mul_assoc] #align polynomial.chebyshev.T_two Polynomial.Chebyshev.T_two theorem T_of_two_le (n : ℕ) (h : 2 ≤ n) : T R n = 2 * X * T R (n - 1) - T R (n - 2) := by obtain ⟨n, rfl⟩ := Nat.exists_eq_add_of_le h rw [add_comm] exact T_add_two R n #align polynomial.chebyshev.T_of_two_le Polynomial.Chebyshev.T_of_two_le /-- `U n` is the `n`-th Chebyshev polynomial of the second kind -/ noncomputable def U : ℕ → R[X] | 0 => 1 | 1 => 2 * X | n + 2 => 2 * X * U (n + 1) - U n #align polynomial.chebyshev.U Polynomial.Chebyshev.U @[simp] theorem U_zero : U R 0 = 1 := rfl #align polynomial.chebyshev.U_zero Polynomial.Chebyshev.U_zero @[simp] theorem U_one : U R 1 = 2 * X := rfl #align polynomial.chebyshev.U_one Polynomial.Chebyshev.U_one @[simp] theorem U_add_two (n : ℕ) : U R (n + 2) = 2 * X * U R (n + 1) - U R n := by rw [U] #align polynomial.chebyshev.U_add_two Polynomial.Chebyshev.U_add_two theorem U_two : U R 2 = 4 * X ^ 2 - 1 := by simp only [U] ring #align polynomial.chebyshev.U_two Polynomial.Chebyshev.U_two theorem U_of_two_le (n : ℕ) (h : 2 ≤ n) : U R n = 2 * X * U R (n - 1) - U R (n - 2) := by obtain ⟨n, rfl⟩ := Nat.exists_eq_add_of_le h rw [add_comm] exact U_add_two R n #align polynomial.chebyshev.U_of_two_le Polynomial.Chebyshev.U_of_two_le theorem U_eq_X_mul_U_add_T : ∀ n : ℕ, U R (n + 1) = X * U R n + T R (n + 1) | 0 => by simp only [T, U, two_mul, mul_one] | 1 => by simp only [T, U]; ring | n + 2 => calc U R (n + 2 + 1) = 2 * X * (X * U R (n + 1) + T R (n + 2)) - (X * U R n + T R (n + 1)) := by rw [U_add_two, U_eq_X_mul_U_add_T n, U_eq_X_mul_U_add_T (n + 1), U_eq_X_mul_U_add_T n] _ = X * (2 * X * U R (n + 1) - U R n) + (2 * X * T R (n + 2) - T R (n + 1)) := by ring _ = X * U R (n + 2) + T R (n + 2 + 1) := by simp only [U_add_two, T_add_two] #align polynomial.chebyshev.U_eq_X_mul_U_add_T Polynomial.Chebyshev.U_eq_X_mul_U_add_T theorem T_eq_U_sub_X_mul_U (n : ℕ) : T R (n + 1) = U R (n + 1) - X * U R n := by rw [U_eq_X_mul_U_add_T, add_comm (X * U R n), add_sub_cancel] #align polynomial.chebyshev.T_eq_U_sub_X_mul_U Polynomial.Chebyshev.T_eq_U_sub_X_mul_U theorem T_eq_X_mul_T_sub_pol_U : ∀ n : ℕ, T R (n + 2) = X * T R (n + 1) - (1 - X ^ 2) * U R n | 0 => by simp only [T, U]; ring | 1 => by simp only [T, U]; ring | n + 2 => calc T R (n + 2 + 2) = 2 * X * T R (n + 2 + 1) - T R (n + 2) := T_add_two _ _ _ = 2 * X * (X * T R (n + 2) - (1 - X ^ 2) * U R (n + 1)) - (X * T R (n + 1) - (1 - X ^ 2) * U R n) := by simp only [T_eq_X_mul_T_sub_pol_U] _ = X * (2 * X * T R (n + 2) - T R (n + 1)) - (1 - X ^ 2) * (2 * X * U R (n + 1) - U R n) := by ring _ = X * T R (n + 2 + 1) - (1 - X ^ 2) * U R (n + 2) := by rw [T_add_two _ (n + 1), U_add_two] #align polynomial.chebyshev.T_eq_X_mul_T_sub_pol_U Polynomial.Chebyshev.T_eq_X_mul_T_sub_pol_U theorem one_sub_X_sq_mul_U_eq_pol_in_T (n : ℕ) : (1 - X ^ 2) * U R n = X * T R (n + 1) - T R (n + 2) := by rw [T_eq_X_mul_T_sub_pol_U, ← sub_add, sub_self, zero_add] #align polynomial.chebyshev.one_sub_X_sq_mul_U_eq_pol_in_T Polynomial.Chebyshev.one_sub_X_sq_mul_U_eq_pol_in_T variable {R S} @[simp] theorem map_T (f : R →+* S) : ∀ n : ℕ, map f (T R n) = T S n | 0 => by simp only [T_zero, Polynomial.map_one] | 1 => by simp only [T_one, map_X] | n + 2 => by simp only [T_add_two, Polynomial.map_mul, Polynomial.map_sub, map_X, Polynomial.map_add, Polynomial.map_one, Polynomial.map_ofNat, map_T f (n + 1), map_T f n] #align polynomial.chebyshev.map_T Polynomial.Chebyshev.map_T @[simp] theorem map_U (f : R →+* S) : ∀ n : ℕ, map f (U R n) = U S n | 0 => by simp only [U_zero, Polynomial.map_one] | 1 => by simp [U_one, map_X, Polynomial.map_mul, Polynomial.map_add, Polynomial.map_one] | n + 2 => by simp only [U_add_two, Polynomial.map_mul, Polynomial.map_sub, map_X, Polynomial.map_add, Polynomial.map_one, map_U f (n + 1), map_U f n] norm_num #align polynomial.chebyshev.map_U Polynomial.Chebyshev.map_U theorem T_derivative_eq_U : ∀ n : ℕ, derivative (T R (n + 1)) = (n + 1) * U R n | 0 => by simp only [T_one, U_zero, derivative_X, Nat.cast_zero, zero_add, mul_one] | 1 => by simp [T_two, U_one, derivative_sub, derivative_one, derivative_mul, derivative_X_pow, add_mul] | n + 2 => calc derivative (T R (n + 2 + 1)) = 2 * T R (n + 2) + 2 * X * derivative (T R (n + 1 + 1)) - derivative (T R (n + 1)) := by rw [T_add_two _ (n + 1), derivative_sub, derivative_mul, derivative_mul, derivative_X, derivative_ofNat] ring_nf _ = 2 * (U R (n + 1 + 1) - X * U R (n + 1)) + 2 * X * (((n + 1 + 1) : R[X]) * U R (n + 1)) - ((n + 1) : R[X]) * U R n := by rw_mod_cast [T_derivative_eq_U (n + 1), T_derivative_eq_U n, T_eq_U_sub_X_mul_U _ (n + 1)] _ = (n + 1 : R[X]) * (2 * X * U R (n + 1) - U R n) + 2 * U R (n + 2) := by ring _ = (n + 1) * U R (n + 2) + 2 * U R (n + 2) := by rw [U_add_two] _ = (n + 2 + 1) * U R (n + 2) := by ring _ = (↑(n + 2) + 1) * U R (n + 2) := by norm_cast #align polynomial.chebyshev.T_derivative_eq_U Polynomial.Chebyshev.T_derivative_eq_U theorem one_sub_X_sq_mul_derivative_T_eq_poly_in_T (n : ℕ) : (1 - X ^ 2) * derivative (T R (n + 1)) = (n + 1 : R[X]) * (T R n - X * T R (n + 1)) := calc (1 - X ^ 2) * derivative (T R (n + 1)) = (1 - X ^ 2) * ((n + 1 : R[X]) * U R n) := by rw [T_derivative_eq_U] _ = (n + 1 : R[X]) * ((1 - X ^ 2) * U R n) := by ring _ = (n + 1 : R[X]) * (X * T R (n + 1) - (2 * X * T R (n + 1) - T R n)) := by rw [one_sub_X_sq_mul_U_eq_pol_in_T, T_add_two] _ = (n + 1 : R[X]) * (T R n - X * T R (n + 1)) := by ring #align polynomial.chebyshev.one_sub_X_sq_mul_derivative_T_eq_poly_in_T Polynomial.Chebyshev.one_sub_X_sq_mul_derivative_T_eq_poly_in_T theorem add_one_mul_T_eq_poly_in_U (n : ℕ) : ((n : R[X]) + 1) * T R (n + 1) = X * U R n - (1 - X ^ 2) * derivative (U R n) := by have h : derivative (T R (n + 2)) = U R (n + 1) - X * U R n + X * derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * derivative (U R n) := by conv_lhs => rw [T_eq_X_mul_T_sub_pol_U] simp only [derivative_sub, derivative_mul, derivative_X, derivative_one, derivative_X_pow, one_mul, T_derivative_eq_U] rw [T_eq_U_sub_X_mul_U, C_eq_nat_cast] ring calc ((n : R[X]) + 1) * T R (n + 1) = ((n : R[X]) + 1 + 1) * (X * U R n + T R (n + 1)) - X * ((n + 1 : R[X]) * U R n) - (X * U R n + T R (n + 1)) := by ring _ = derivative (T R (n + 2)) - X * derivative (T R (n + 1)) - U R (n + 1) := by rw [← U_eq_X_mul_U_add_T, ← T_derivative_eq_U, ← Nat.cast_one, ← Nat.cast_add, Nat.cast_one, ← T_derivative_eq_U (n + 1)] _ = U R (n + 1) - X * U R n + X * derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * derivative (U R n) - X * derivative (T R (n + 1)) - U R (n + 1) := by rw [h] _ = X * U R n - (1 - X ^ 2) * derivative (U R n) := by ring #align polynomial.chebyshev.add_one_mul_T_eq_poly_in_U Polynomial.Chebyshev.add_one_mul_T_eq_poly_in_U variable (R) /-- The product of two Chebyshev polynomials is the sum of two other Chebyshev polynomials. -/ theorem mul_T : ∀ m k, 2 * T R m * T R (m + k) = T R (2 * m + k) + T R k | 0 => by simp [two_mul, add_mul] | 1 => by simp [add_comm] | m + 2 => by intro k -- clean up the `T` nat indices in the goal suffices 2 * T R (m + 2) * T R (m + k + 2) = T R (2 * m + k + 4) + T R k by have h_nat₁ : 2 * (m + 2) + k = 2 * m + k + 4 := by ring have h_nat₂ : m + 2 + k = m + k + 2 := by ring simpa [h_nat₁, h_nat₂] using this -- clean up the `T` nat indices in the inductive hypothesis applied to `m + 1` and `k + 1` have H₁ : 2 * T R (m + 1) * T R (m + k + 2) = T R (2 * m + k + 3) + T R (k + 1) := by have h_nat₁ : m + 1 + (k + 1) = m + k + 2 := by ring have h_nat₂ : 2 * (m + 1) + (k + 1) = 2 * m + k + 3 := by ring simpa [h_nat₁, h_nat₂] using mul_T (m + 1) (k + 1) -- clean up the `T` nat indices in the inductive hypothesis applied to `m` and `k + 2` have H₂ : 2 * T R m * T R (m + k + 2) = T R (2 * m + k + 2) + T R (k + 2) := by have h_nat₁ : 2 * m + (k + 2) = 2 * m + k + 2 := by simp [add_assoc] have h_nat₂ : m + (k + 2) = m + k + 2 := by simp [add_assoc] simpa [h_nat₁, h_nat₂] using mul_T m (k + 2) -- state the `T` recurrence relation for a few useful indices have h₁ := T_add_two R m have h₂ : T R (2 * m + k + 4) = 2 * X * T R (2 * m + k + 3) - T R (2 * m + k + 2) := T_add_two R (2 * m + k + 2) have h₃ := T_add_two R k -- the desired identity is an appropriate linear combination of H₁, H₂, h₁, h₂, h₃ linear_combination 2 * T R (m + k + 2) * h₁ + 2 * (X : R[X]) * H₁ - H₂ - h₂ - h₃ #align polynomial.chebyshev.mul_T Polynomial.Chebyshev.mul_T /-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/ theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n) | 0 => by simp | 1 => by simp | m + 2 => by intro n have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n) := by convert mul_T R n (m * n) using 1 <;>
ring_nf
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/ theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n) | 0 => by simp | 1 => by simp | m + 2 => by intro n have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n) := by convert mul_T R n (m * n) using 1 <;>
Mathlib.RingTheory.Polynomial.Chebyshev.268_0.SRy1jgYRAFbFJky
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/ theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n) | 0 => by simp | 1 => by simp | m + 2 => by intro n have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n)
Mathlib_RingTheory_Polynomial_Chebyshev
R : Type u_1 S : Type u_2 inst✝¹ : CommRing R inst✝ : CommRing S m n : ℕ this : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n) ⊢ T R ((m + 2) * n) = comp (T R (m + 2)) (T R n)
/- Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Julian Kuelshammer, Heather Macbeth -/ import Mathlib.Data.Polynomial.Derivative import Mathlib.Tactic.LinearCombination #align_import ring_theory.polynomial.chebyshev from "leanprover-community/mathlib"@"d774451114d6045faeb6751c396bea1eb9058946" /-! # Chebyshev polynomials The Chebyshev polynomials are two families of polynomials indexed by `ℕ`, with integral coefficients. ## Main definitions * `Polynomial.Chebyshev.T`: the Chebyshev polynomials of the first kind. * `Polynomial.Chebyshev.U`: the Chebyshev polynomials of the second kind. ## Main statements * The formal derivative of the Chebyshev polynomials of the first kind is a scalar multiple of the Chebyshev polynomials of the second kind. * `Polynomial.Chebyshev.mul_T`, the product of the `m`-th and `(m + k)`-th Chebyshev polynomials of the first kind is the sum of the `(2 * m + k)`-th and `k`-th Chebyshev polynomials of the first kind. * `Polynomial.Chebyshev.T_mul`, the `(m * n)`-th Chebyshev polynomial of the first kind is the composition of the `m`-th and `n`-th Chebyshev polynomials of the first kind. ## Implementation details Since Chebyshev polynomials have interesting behaviour over the complex numbers and modulo `p`, we define them to have coefficients in an arbitrary commutative ring, even though technically `ℤ` would suffice. The benefit of allowing arbitrary coefficient rings, is that the statements afterwards are clean, and do not have `map (Int.castRingHom R)` interfering all the time. ## References [Lionel Ponton, _Roots of the Chebyshev polynomials: A purely algebraic approach_] [ponton2020chebyshev] ## TODO * Redefine and/or relate the definition of Chebyshev polynomials to `LinearRecurrence`. * Add explicit formula involving square roots for Chebyshev polynomials * Compute zeroes and extrema of Chebyshev polynomials. * Prove that the roots of the Chebyshev polynomials (except 0) are irrational. * Prove minimax properties of Chebyshev polynomials. -/ noncomputable section namespace Polynomial.Chebyshev set_option linter.uppercaseLean3 false -- `T` `U` `X` open Polynomial open Polynomial variable (R S : Type*) [CommRing R] [CommRing S] /-- `T n` is the `n`-th Chebyshev polynomial of the first kind -/ noncomputable def T : ℕ → R[X] | 0 => 1 | 1 => X | n + 2 => 2 * X * T (n + 1) - T n #align polynomial.chebyshev.T Polynomial.Chebyshev.T @[simp] theorem T_zero : T R 0 = 1 := rfl #align polynomial.chebyshev.T_zero Polynomial.Chebyshev.T_zero @[simp] theorem T_one : T R 1 = X := rfl #align polynomial.chebyshev.T_one Polynomial.Chebyshev.T_one @[simp] theorem T_add_two (n : ℕ) : T R (n + 2) = 2 * X * T R (n + 1) - T R n := by rw [T] #align polynomial.chebyshev.T_add_two Polynomial.Chebyshev.T_add_two theorem T_two : T R 2 = 2 * X ^ 2 - 1 := by simp only [T, sub_left_inj, sq, mul_assoc] #align polynomial.chebyshev.T_two Polynomial.Chebyshev.T_two theorem T_of_two_le (n : ℕ) (h : 2 ≤ n) : T R n = 2 * X * T R (n - 1) - T R (n - 2) := by obtain ⟨n, rfl⟩ := Nat.exists_eq_add_of_le h rw [add_comm] exact T_add_two R n #align polynomial.chebyshev.T_of_two_le Polynomial.Chebyshev.T_of_two_le /-- `U n` is the `n`-th Chebyshev polynomial of the second kind -/ noncomputable def U : ℕ → R[X] | 0 => 1 | 1 => 2 * X | n + 2 => 2 * X * U (n + 1) - U n #align polynomial.chebyshev.U Polynomial.Chebyshev.U @[simp] theorem U_zero : U R 0 = 1 := rfl #align polynomial.chebyshev.U_zero Polynomial.Chebyshev.U_zero @[simp] theorem U_one : U R 1 = 2 * X := rfl #align polynomial.chebyshev.U_one Polynomial.Chebyshev.U_one @[simp] theorem U_add_two (n : ℕ) : U R (n + 2) = 2 * X * U R (n + 1) - U R n := by rw [U] #align polynomial.chebyshev.U_add_two Polynomial.Chebyshev.U_add_two theorem U_two : U R 2 = 4 * X ^ 2 - 1 := by simp only [U] ring #align polynomial.chebyshev.U_two Polynomial.Chebyshev.U_two theorem U_of_two_le (n : ℕ) (h : 2 ≤ n) : U R n = 2 * X * U R (n - 1) - U R (n - 2) := by obtain ⟨n, rfl⟩ := Nat.exists_eq_add_of_le h rw [add_comm] exact U_add_two R n #align polynomial.chebyshev.U_of_two_le Polynomial.Chebyshev.U_of_two_le theorem U_eq_X_mul_U_add_T : ∀ n : ℕ, U R (n + 1) = X * U R n + T R (n + 1) | 0 => by simp only [T, U, two_mul, mul_one] | 1 => by simp only [T, U]; ring | n + 2 => calc U R (n + 2 + 1) = 2 * X * (X * U R (n + 1) + T R (n + 2)) - (X * U R n + T R (n + 1)) := by rw [U_add_two, U_eq_X_mul_U_add_T n, U_eq_X_mul_U_add_T (n + 1), U_eq_X_mul_U_add_T n] _ = X * (2 * X * U R (n + 1) - U R n) + (2 * X * T R (n + 2) - T R (n + 1)) := by ring _ = X * U R (n + 2) + T R (n + 2 + 1) := by simp only [U_add_two, T_add_two] #align polynomial.chebyshev.U_eq_X_mul_U_add_T Polynomial.Chebyshev.U_eq_X_mul_U_add_T theorem T_eq_U_sub_X_mul_U (n : ℕ) : T R (n + 1) = U R (n + 1) - X * U R n := by rw [U_eq_X_mul_U_add_T, add_comm (X * U R n), add_sub_cancel] #align polynomial.chebyshev.T_eq_U_sub_X_mul_U Polynomial.Chebyshev.T_eq_U_sub_X_mul_U theorem T_eq_X_mul_T_sub_pol_U : ∀ n : ℕ, T R (n + 2) = X * T R (n + 1) - (1 - X ^ 2) * U R n | 0 => by simp only [T, U]; ring | 1 => by simp only [T, U]; ring | n + 2 => calc T R (n + 2 + 2) = 2 * X * T R (n + 2 + 1) - T R (n + 2) := T_add_two _ _ _ = 2 * X * (X * T R (n + 2) - (1 - X ^ 2) * U R (n + 1)) - (X * T R (n + 1) - (1 - X ^ 2) * U R n) := by simp only [T_eq_X_mul_T_sub_pol_U] _ = X * (2 * X * T R (n + 2) - T R (n + 1)) - (1 - X ^ 2) * (2 * X * U R (n + 1) - U R n) := by ring _ = X * T R (n + 2 + 1) - (1 - X ^ 2) * U R (n + 2) := by rw [T_add_two _ (n + 1), U_add_two] #align polynomial.chebyshev.T_eq_X_mul_T_sub_pol_U Polynomial.Chebyshev.T_eq_X_mul_T_sub_pol_U theorem one_sub_X_sq_mul_U_eq_pol_in_T (n : ℕ) : (1 - X ^ 2) * U R n = X * T R (n + 1) - T R (n + 2) := by rw [T_eq_X_mul_T_sub_pol_U, ← sub_add, sub_self, zero_add] #align polynomial.chebyshev.one_sub_X_sq_mul_U_eq_pol_in_T Polynomial.Chebyshev.one_sub_X_sq_mul_U_eq_pol_in_T variable {R S} @[simp] theorem map_T (f : R →+* S) : ∀ n : ℕ, map f (T R n) = T S n | 0 => by simp only [T_zero, Polynomial.map_one] | 1 => by simp only [T_one, map_X] | n + 2 => by simp only [T_add_two, Polynomial.map_mul, Polynomial.map_sub, map_X, Polynomial.map_add, Polynomial.map_one, Polynomial.map_ofNat, map_T f (n + 1), map_T f n] #align polynomial.chebyshev.map_T Polynomial.Chebyshev.map_T @[simp] theorem map_U (f : R →+* S) : ∀ n : ℕ, map f (U R n) = U S n | 0 => by simp only [U_zero, Polynomial.map_one] | 1 => by simp [U_one, map_X, Polynomial.map_mul, Polynomial.map_add, Polynomial.map_one] | n + 2 => by simp only [U_add_two, Polynomial.map_mul, Polynomial.map_sub, map_X, Polynomial.map_add, Polynomial.map_one, map_U f (n + 1), map_U f n] norm_num #align polynomial.chebyshev.map_U Polynomial.Chebyshev.map_U theorem T_derivative_eq_U : ∀ n : ℕ, derivative (T R (n + 1)) = (n + 1) * U R n | 0 => by simp only [T_one, U_zero, derivative_X, Nat.cast_zero, zero_add, mul_one] | 1 => by simp [T_two, U_one, derivative_sub, derivative_one, derivative_mul, derivative_X_pow, add_mul] | n + 2 => calc derivative (T R (n + 2 + 1)) = 2 * T R (n + 2) + 2 * X * derivative (T R (n + 1 + 1)) - derivative (T R (n + 1)) := by rw [T_add_two _ (n + 1), derivative_sub, derivative_mul, derivative_mul, derivative_X, derivative_ofNat] ring_nf _ = 2 * (U R (n + 1 + 1) - X * U R (n + 1)) + 2 * X * (((n + 1 + 1) : R[X]) * U R (n + 1)) - ((n + 1) : R[X]) * U R n := by rw_mod_cast [T_derivative_eq_U (n + 1), T_derivative_eq_U n, T_eq_U_sub_X_mul_U _ (n + 1)] _ = (n + 1 : R[X]) * (2 * X * U R (n + 1) - U R n) + 2 * U R (n + 2) := by ring _ = (n + 1) * U R (n + 2) + 2 * U R (n + 2) := by rw [U_add_two] _ = (n + 2 + 1) * U R (n + 2) := by ring _ = (↑(n + 2) + 1) * U R (n + 2) := by norm_cast #align polynomial.chebyshev.T_derivative_eq_U Polynomial.Chebyshev.T_derivative_eq_U theorem one_sub_X_sq_mul_derivative_T_eq_poly_in_T (n : ℕ) : (1 - X ^ 2) * derivative (T R (n + 1)) = (n + 1 : R[X]) * (T R n - X * T R (n + 1)) := calc (1 - X ^ 2) * derivative (T R (n + 1)) = (1 - X ^ 2) * ((n + 1 : R[X]) * U R n) := by rw [T_derivative_eq_U] _ = (n + 1 : R[X]) * ((1 - X ^ 2) * U R n) := by ring _ = (n + 1 : R[X]) * (X * T R (n + 1) - (2 * X * T R (n + 1) - T R n)) := by rw [one_sub_X_sq_mul_U_eq_pol_in_T, T_add_two] _ = (n + 1 : R[X]) * (T R n - X * T R (n + 1)) := by ring #align polynomial.chebyshev.one_sub_X_sq_mul_derivative_T_eq_poly_in_T Polynomial.Chebyshev.one_sub_X_sq_mul_derivative_T_eq_poly_in_T theorem add_one_mul_T_eq_poly_in_U (n : ℕ) : ((n : R[X]) + 1) * T R (n + 1) = X * U R n - (1 - X ^ 2) * derivative (U R n) := by have h : derivative (T R (n + 2)) = U R (n + 1) - X * U R n + X * derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * derivative (U R n) := by conv_lhs => rw [T_eq_X_mul_T_sub_pol_U] simp only [derivative_sub, derivative_mul, derivative_X, derivative_one, derivative_X_pow, one_mul, T_derivative_eq_U] rw [T_eq_U_sub_X_mul_U, C_eq_nat_cast] ring calc ((n : R[X]) + 1) * T R (n + 1) = ((n : R[X]) + 1 + 1) * (X * U R n + T R (n + 1)) - X * ((n + 1 : R[X]) * U R n) - (X * U R n + T R (n + 1)) := by ring _ = derivative (T R (n + 2)) - X * derivative (T R (n + 1)) - U R (n + 1) := by rw [← U_eq_X_mul_U_add_T, ← T_derivative_eq_U, ← Nat.cast_one, ← Nat.cast_add, Nat.cast_one, ← T_derivative_eq_U (n + 1)] _ = U R (n + 1) - X * U R n + X * derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * derivative (U R n) - X * derivative (T R (n + 1)) - U R (n + 1) := by rw [h] _ = X * U R n - (1 - X ^ 2) * derivative (U R n) := by ring #align polynomial.chebyshev.add_one_mul_T_eq_poly_in_U Polynomial.Chebyshev.add_one_mul_T_eq_poly_in_U variable (R) /-- The product of two Chebyshev polynomials is the sum of two other Chebyshev polynomials. -/ theorem mul_T : ∀ m k, 2 * T R m * T R (m + k) = T R (2 * m + k) + T R k | 0 => by simp [two_mul, add_mul] | 1 => by simp [add_comm] | m + 2 => by intro k -- clean up the `T` nat indices in the goal suffices 2 * T R (m + 2) * T R (m + k + 2) = T R (2 * m + k + 4) + T R k by have h_nat₁ : 2 * (m + 2) + k = 2 * m + k + 4 := by ring have h_nat₂ : m + 2 + k = m + k + 2 := by ring simpa [h_nat₁, h_nat₂] using this -- clean up the `T` nat indices in the inductive hypothesis applied to `m + 1` and `k + 1` have H₁ : 2 * T R (m + 1) * T R (m + k + 2) = T R (2 * m + k + 3) + T R (k + 1) := by have h_nat₁ : m + 1 + (k + 1) = m + k + 2 := by ring have h_nat₂ : 2 * (m + 1) + (k + 1) = 2 * m + k + 3 := by ring simpa [h_nat₁, h_nat₂] using mul_T (m + 1) (k + 1) -- clean up the `T` nat indices in the inductive hypothesis applied to `m` and `k + 2` have H₂ : 2 * T R m * T R (m + k + 2) = T R (2 * m + k + 2) + T R (k + 2) := by have h_nat₁ : 2 * m + (k + 2) = 2 * m + k + 2 := by simp [add_assoc] have h_nat₂ : m + (k + 2) = m + k + 2 := by simp [add_assoc] simpa [h_nat₁, h_nat₂] using mul_T m (k + 2) -- state the `T` recurrence relation for a few useful indices have h₁ := T_add_two R m have h₂ : T R (2 * m + k + 4) = 2 * X * T R (2 * m + k + 3) - T R (2 * m + k + 2) := T_add_two R (2 * m + k + 2) have h₃ := T_add_two R k -- the desired identity is an appropriate linear combination of H₁, H₂, h₁, h₂, h₃ linear_combination 2 * T R (m + k + 2) * h₁ + 2 * (X : R[X]) * H₁ - H₂ - h₂ - h₃ #align polynomial.chebyshev.mul_T Polynomial.Chebyshev.mul_T /-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/ theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n) | 0 => by simp | 1 => by simp | m + 2 => by intro n have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n) := by convert mul_T R n (m * n) using 1 <;> ring_nf
simp [this, T_mul m, ← T_mul (m + 1)]
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/ theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n) | 0 => by simp | 1 => by simp | m + 2 => by intro n have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n) := by convert mul_T R n (m * n) using 1 <;> ring_nf
Mathlib.RingTheory.Polynomial.Chebyshev.268_0.SRy1jgYRAFbFJky
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/ theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n) | 0 => by simp | 1 => by simp | m + 2 => by intro n have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n)
Mathlib_RingTheory_Polynomial_Chebyshev
k G : Type u inst✝¹ : Field k inst✝ : Monoid G ⊢ Linear k (FdRep k G)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by
infer_instance
instance : Linear k (FdRep k G) := by
Mathlib.RepresentationTheory.FdRep.62_0.ADbOgJGW1JDvdmK
instance : Linear k (FdRep k G)
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G V : FdRep k G ⊢ AddCommGroup (CoeSort.coe V)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by
change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj
instance (V : FdRep k G) : AddCommGroup V := by
Mathlib.RepresentationTheory.FdRep.67_0.ADbOgJGW1JDvdmK
instance (V : FdRep k G) : AddCommGroup V
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G V : FdRep k G ⊢ AddCommGroup ↑((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj;
infer_instance
instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj;
Mathlib.RepresentationTheory.FdRep.67_0.ADbOgJGW1JDvdmK
instance (V : FdRep k G) : AddCommGroup V
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G V : FdRep k G ⊢ Module k (CoeSort.coe V)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by
change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj
instance (V : FdRep k G) : Module k V := by
Mathlib.RepresentationTheory.FdRep.70_0.ADbOgJGW1JDvdmK
instance (V : FdRep k G) : Module k V
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G V : FdRep k G ⊢ Module k ↑((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj;
infer_instance
instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj;
Mathlib.RepresentationTheory.FdRep.70_0.ADbOgJGW1JDvdmK
instance (V : FdRep k G) : Module k V
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G V : FdRep k G ⊢ FiniteDimensional k (CoeSort.coe V)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by
change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V)
instance (V : FdRep k G) : FiniteDimensional k V := by
Mathlib.RepresentationTheory.FdRep.73_0.ADbOgJGW1JDvdmK
instance (V : FdRep k G) : FiniteDimensional k V
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G V : FdRep k G ⊢ FiniteDimensional k ↑((forget₂ (FdRep k G) (FGModuleCat k)).obj V)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V);
infer_instance
instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V);
Mathlib.RepresentationTheory.FdRep.73_0.ADbOgJGW1JDvdmK
instance (V : FdRep k G) : FiniteDimensional k V
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G V W : FdRep k G i : V ≅ W g : G ⊢ (ρ W) g = (LinearEquiv.conj (isoToLinearEquiv i)) ((ρ V) g)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw`
erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply]
theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw`
Mathlib.RepresentationTheory.FdRep.91_0.ADbOgJGW1JDvdmK
theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g)
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G V W : FdRep k G i : V ≅ W g : G ⊢ (ρ W) g = ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i).inv ≫ (ρ V) g ≫ ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i).hom
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply]
rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)]
theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply]
Mathlib.RepresentationTheory.FdRep.91_0.ADbOgJGW1JDvdmK
theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g)
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G V W : FdRep k G i : V ≅ W g : G ⊢ ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i).hom ≫ (ρ W) g = (ρ V) g ≫ ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i).hom
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)]
exact (i.hom.comm g).symm
theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)]
Mathlib.RepresentationTheory.FdRep.91_0.ADbOgJGW1JDvdmK
theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g)
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G V : FdRep k G ⊢ Rep.ρ ((forget₂ (FdRep k G) (Rep k G)).obj V) = ρ V
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by
ext g v
theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by
Mathlib.RepresentationTheory.FdRep.109_0.ADbOgJGW1JDvdmK
theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ
Mathlib_RepresentationTheory_FdRep
case h.h k G : Type u inst✝¹ : Field k inst✝ : Monoid G V : FdRep k G g : G v : CoeSort.coe ((forget₂ (FdRep k G) (Rep k G)).obj V) ⊢ ((Rep.ρ ((forget₂ (FdRep k G) (Rep k G)).obj V)) g) v = ((ρ V) g) v
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v;
rfl
theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v;
Mathlib.RepresentationTheory.FdRep.109_0.ADbOgJGW1JDvdmK
theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G ⊢ MonoidalCategory (FdRep k G)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by
infer_instance
example : MonoidalCategory (FdRep k G) := by
Mathlib.RepresentationTheory.FdRep.114_0.ADbOgJGW1JDvdmK
example : MonoidalCategory (FdRep k G)
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G ⊢ MonoidalPreadditive (FdRep k G)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by
infer_instance
example : MonoidalPreadditive (FdRep k G) := by
Mathlib.RepresentationTheory.FdRep.116_0.ADbOgJGW1JDvdmK
example : MonoidalPreadditive (FdRep k G)
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G ⊢ MonoidalLinear k (FdRep k G)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by infer_instance example : MonoidalLinear k (FdRep k G) := by
infer_instance
example : MonoidalLinear k (FdRep k G) := by
Mathlib.RepresentationTheory.FdRep.118_0.ADbOgJGW1JDvdmK
example : MonoidalLinear k (FdRep k G)
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G ⊢ HasKernels (FdRep k G)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by infer_instance example : MonoidalLinear k (FdRep k G) := by infer_instance open FiniteDimensional open scoped Classical -- We need to provide this instance explicitely as otherwise `finrank_hom_simple_simple` gives a -- deterministic timeout. instance : HasKernels (FdRep k G) := by
infer_instance
instance : HasKernels (FdRep k G) := by
Mathlib.RepresentationTheory.FdRep.126_0.ADbOgJGW1JDvdmK
instance : HasKernels (FdRep k G)
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G X Y : FdRep k G x✝ : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y ⊢ (fun f => Action.Hom.mk ((forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom)) (AddHom.toFun { toAddHom := { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_1) = (fun f => Action.Hom.mk f.hom) (x + x_1)) }, map_smul' := (_ : ∀ (x : k) (x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), AddHom.toFun { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) } (x • x_1) = AddHom.toFun { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) } (x • x_1)) }.toAddHom x✝) = x✝
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by infer_instance example : MonoidalLinear k (FdRep k G) := by infer_instance open FiniteDimensional open scoped Classical -- We need to provide this instance explicitely as otherwise `finrank_hom_simple_simple` gives a -- deterministic timeout. instance : HasKernels (FdRep k G) := by infer_instance -- Verify that Schur's lemma applies out of the box. theorem finrank_hom_simple_simple [IsAlgClosed k] (V W : FdRep k G) [Simple V] [Simple W] : finrank k (V ⟶ W) = if Nonempty (V ≅ W) then 1 else 0 := CategoryTheory.finrank_hom_simple_simple k V W #align fdRep.finrank_hom_simple_simple FdRep.finrank_hom_simple_simple /-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by
ext
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by
Mathlib.RepresentationTheory.FdRep.134_0.ADbOgJGW1JDvdmK
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f
Mathlib_RepresentationTheory_FdRep
case h.h k G : Type u inst✝¹ : Field k inst✝ : Monoid G X Y : FdRep k G x✝¹ : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y x✝ : ↑((forget₂ (FdRep k G) (Rep k G)).obj X).V ⊢ ((fun f => Action.Hom.mk ((forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom)) (AddHom.toFun { toAddHom := { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_1) = (fun f => Action.Hom.mk f.hom) (x + x_1)) }, map_smul' := (_ : ∀ (x : k) (x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), AddHom.toFun { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) } (x • x_1) = AddHom.toFun { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) } (x • x_1)) }.toAddHom x✝¹)).hom x✝ = x✝¹.hom x✝
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by infer_instance example : MonoidalLinear k (FdRep k G) := by infer_instance open FiniteDimensional open scoped Classical -- We need to provide this instance explicitely as otherwise `finrank_hom_simple_simple` gives a -- deterministic timeout. instance : HasKernels (FdRep k G) := by infer_instance -- Verify that Schur's lemma applies out of the box. theorem finrank_hom_simple_simple [IsAlgClosed k] (V W : FdRep k G) [Simple V] [Simple W] : finrank k (V ⟶ W) = if Nonempty (V ≅ W) then 1 else 0 := CategoryTheory.finrank_hom_simple_simple k V W #align fdRep.finrank_hom_simple_simple FdRep.finrank_hom_simple_simple /-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by ext;
rfl
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by ext;
Mathlib.RepresentationTheory.FdRep.134_0.ADbOgJGW1JDvdmK
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Monoid G X Y : FdRep k G x✝ : X ⟶ Y ⊢ AddHom.toFun { toAddHom := { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_1) = (fun f => Action.Hom.mk f.hom) (x + x_1)) }, map_smul' := (_ : ∀ (x : k) (x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), AddHom.toFun { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) } (x • x_1) = AddHom.toFun { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) } (x • x_1)) }.toAddHom ((fun f => Action.Hom.mk ((forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom)) x✝) = x✝
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by infer_instance example : MonoidalLinear k (FdRep k G) := by infer_instance open FiniteDimensional open scoped Classical -- We need to provide this instance explicitely as otherwise `finrank_hom_simple_simple` gives a -- deterministic timeout. instance : HasKernels (FdRep k G) := by infer_instance -- Verify that Schur's lemma applies out of the box. theorem finrank_hom_simple_simple [IsAlgClosed k] (V W : FdRep k G) [Simple V] [Simple W] : finrank k (V ⟶ W) = if Nonempty (V ≅ W) then 1 else 0 := CategoryTheory.finrank_hom_simple_simple k V W #align fdRep.finrank_hom_simple_simple FdRep.finrank_hom_simple_simple /-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by ext; rfl right_inv _ := by
ext
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by ext; rfl right_inv _ := by
Mathlib.RepresentationTheory.FdRep.134_0.ADbOgJGW1JDvdmK
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f
Mathlib_RepresentationTheory_FdRep
case h.w k G : Type u inst✝¹ : Field k inst✝ : Monoid G X Y : FdRep k G x✝¹ : X ⟶ Y x✝ : (forget (FGModuleCat k)).obj X.V ⊢ (AddHom.toFun { toAddHom := { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_1) = (fun f => Action.Hom.mk f.hom) (x + x_1)) }, map_smul' := (_ : ∀ (x : k) (x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), AddHom.toFun { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) } (x • x_1) = AddHom.toFun { toFun := fun f => Action.Hom.mk f.hom, map_add' := (_ : ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y), (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) } (x • x_1)) }.toAddHom ((fun f => Action.Hom.mk ((forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom)) x✝¹)).hom x✝ = x✝¹.hom x✝
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by infer_instance example : MonoidalLinear k (FdRep k G) := by infer_instance open FiniteDimensional open scoped Classical -- We need to provide this instance explicitely as otherwise `finrank_hom_simple_simple` gives a -- deterministic timeout. instance : HasKernels (FdRep k G) := by infer_instance -- Verify that Schur's lemma applies out of the box. theorem finrank_hom_simple_simple [IsAlgClosed k] (V W : FdRep k G) [Simple V] [Simple W] : finrank k (V ⟶ W) = if Nonempty (V ≅ W) then 1 else 0 := CategoryTheory.finrank_hom_simple_simple k V W #align fdRep.finrank_hom_simple_simple FdRep.finrank_hom_simple_simple /-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by ext; rfl right_inv _ := by ext;
rfl
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by ext; rfl right_inv _ := by ext;
Mathlib.RepresentationTheory.FdRep.134_0.ADbOgJGW1JDvdmK
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Group G ⊢ RightRigidCategory (FdRep k G)
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by infer_instance example : MonoidalLinear k (FdRep k G) := by infer_instance open FiniteDimensional open scoped Classical -- We need to provide this instance explicitely as otherwise `finrank_hom_simple_simple` gives a -- deterministic timeout. instance : HasKernels (FdRep k G) := by infer_instance -- Verify that Schur's lemma applies out of the box. theorem finrank_hom_simple_simple [IsAlgClosed k] (V W : FdRep k G) [Simple V] [Simple W] : finrank k (V ⟶ W) = if Nonempty (V ≅ W) then 1 else 0 := CategoryTheory.finrank_hom_simple_simple k V W #align fdRep.finrank_hom_simple_simple FdRep.finrank_hom_simple_simple /-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by ext; rfl right_inv _ := by ext; rfl #align fdRep.forget₂_hom_linear_equiv FdRep.forget₂HomLinearEquiv end FdRep namespace FdRep variable {k G : Type u} [Field k] [Group G] -- Verify that the right rigid structure is available when the monoid is a group. noncomputable instance : RightRigidCategory (FdRep k G) := by
change RightRigidCategory (Action (FGModuleCat k) (GroupCat.of G))
noncomputable instance : RightRigidCategory (FdRep k G) := by
Mathlib.RepresentationTheory.FdRep.153_0.ADbOgJGW1JDvdmK
noncomputable instance : RightRigidCategory (FdRep k G)
Mathlib_RepresentationTheory_FdRep
k G : Type u inst✝¹ : Field k inst✝ : Group G ⊢ RightRigidCategory (Action (FGModuleCat k) ((forget₂ GroupCat MonCat).obj (GroupCat.of G)))
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by infer_instance example : MonoidalLinear k (FdRep k G) := by infer_instance open FiniteDimensional open scoped Classical -- We need to provide this instance explicitely as otherwise `finrank_hom_simple_simple` gives a -- deterministic timeout. instance : HasKernels (FdRep k G) := by infer_instance -- Verify that Schur's lemma applies out of the box. theorem finrank_hom_simple_simple [IsAlgClosed k] (V W : FdRep k G) [Simple V] [Simple W] : finrank k (V ⟶ W) = if Nonempty (V ≅ W) then 1 else 0 := CategoryTheory.finrank_hom_simple_simple k V W #align fdRep.finrank_hom_simple_simple FdRep.finrank_hom_simple_simple /-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by ext; rfl right_inv _ := by ext; rfl #align fdRep.forget₂_hom_linear_equiv FdRep.forget₂HomLinearEquiv end FdRep namespace FdRep variable {k G : Type u} [Field k] [Group G] -- Verify that the right rigid structure is available when the monoid is a group. noncomputable instance : RightRigidCategory (FdRep k G) := by change RightRigidCategory (Action (FGModuleCat k) (GroupCat.of G));
infer_instance
noncomputable instance : RightRigidCategory (FdRep k G) := by change RightRigidCategory (Action (FGModuleCat k) (GroupCat.of G));
Mathlib.RepresentationTheory.FdRep.153_0.ADbOgJGW1JDvdmK
noncomputable instance : RightRigidCategory (FdRep k G)
Mathlib_RepresentationTheory_FdRep
k G V : Type u inst✝⁴ : Field k inst✝³ : Group G inst✝² : AddCommGroup V inst✝¹ : Module k V inst✝ : FiniteDimensional k V ρV : Representation k G V W : FdRep k G ⊢ of (dual ρV) ⊗ W ≅ of (linHom ρV (ρ W))
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by infer_instance example : MonoidalLinear k (FdRep k G) := by infer_instance open FiniteDimensional open scoped Classical -- We need to provide this instance explicitely as otherwise `finrank_hom_simple_simple` gives a -- deterministic timeout. instance : HasKernels (FdRep k G) := by infer_instance -- Verify that Schur's lemma applies out of the box. theorem finrank_hom_simple_simple [IsAlgClosed k] (V W : FdRep k G) [Simple V] [Simple W] : finrank k (V ⟶ W) = if Nonempty (V ≅ W) then 1 else 0 := CategoryTheory.finrank_hom_simple_simple k V W #align fdRep.finrank_hom_simple_simple FdRep.finrank_hom_simple_simple /-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by ext; rfl right_inv _ := by ext; rfl #align fdRep.forget₂_hom_linear_equiv FdRep.forget₂HomLinearEquiv end FdRep namespace FdRep variable {k G : Type u} [Field k] [Group G] -- Verify that the right rigid structure is available when the monoid is a group. noncomputable instance : RightRigidCategory (FdRep k G) := by change RightRigidCategory (Action (FGModuleCat k) (GroupCat.of G)); infer_instance end FdRep namespace FdRep -- The variables in this section are slightly weird, living half in `Representation` and half in -- `FdRep`. When we have a better API for general monoidal closed and rigid categories and these -- structures on `FdRep`, we should remove the dependancy of statements about `FdRep` on -- `Representation.linHom` and `Representation.dual`. The isomorphism `dualTensorIsoLinHom` -- below should then just be obtained from general results about rigid categories. open Representation variable {k G V : Type u} [Field k] [Group G] variable [AddCommGroup V] [Module k V] variable [FiniteDimensional k V] variable (ρV : Representation k G V) (W : FdRep k G) open scoped MonoidalCategory /-- Auxiliary definition for `FdRep.dualTensorIsoLinHom`. -/ noncomputable def dualTensorIsoLinHomAux : (FdRep.of ρV.dual ⊗ W).V ≅ (FdRep.of (linHom ρV W.ρ)).V := -- Porting note: had to make all types explicit arguments @LinearEquiv.toFGModuleCatIso k _ (FdRep.of ρV.dual ⊗ W).V (V →ₗ[k] W) _ _ _ _ _ _ (dualTensorHomEquiv k V W) #align fdRep.dual_tensor_iso_lin_hom_aux FdRep.dualTensorIsoLinHomAux /-- When `V` and `W` are finite dimensional representations of a group `G`, the isomorphism `dualTensorHomEquiv k V W` of vector spaces induces an isomorphism of representations. -/ noncomputable def dualTensorIsoLinHom : FdRep.of ρV.dual ⊗ W ≅ FdRep.of (linHom ρV W.ρ) := by
refine Action.mkIso (dualTensorIsoLinHomAux ρV W) ?_
/-- When `V` and `W` are finite dimensional representations of a group `G`, the isomorphism `dualTensorHomEquiv k V W` of vector spaces induces an isomorphism of representations. -/ noncomputable def dualTensorIsoLinHom : FdRep.of ρV.dual ⊗ W ≅ FdRep.of (linHom ρV W.ρ) := by
Mathlib.RepresentationTheory.FdRep.182_0.ADbOgJGW1JDvdmK
/-- When `V` and `W` are finite dimensional representations of a group `G`, the isomorphism `dualTensorHomEquiv k V W` of vector spaces induces an isomorphism of representations. -/ noncomputable def dualTensorIsoLinHom : FdRep.of ρV.dual ⊗ W ≅ FdRep.of (linHom ρV W.ρ)
Mathlib_RepresentationTheory_FdRep
k G V : Type u inst✝⁴ : Field k inst✝³ : Group G inst✝² : AddCommGroup V inst✝¹ : Module k V inst✝ : FiniteDimensional k V ρV : Representation k G V W : FdRep k G ⊢ ∀ (g : ↑(MonCat.of G)), (of (dual ρV) ⊗ W).ρ g ≫ (dualTensorIsoLinHomAux ρV W).hom = (dualTensorIsoLinHomAux ρV W).hom ≫ (of (linHom ρV (ρ W))).ρ g
/- Copyright (c) 2022 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.RepresentationTheory.Rep import Mathlib.Algebra.Category.FGModuleCat.Limits import Mathlib.CategoryTheory.Preadditive.Schur import Mathlib.RepresentationTheory.Basic #align_import representation_theory.fdRep from "leanprover-community/mathlib"@"19a70dceb9dff0994b92d2dd049de7d84d28112b" /-! # `FdRep k G` is the category of finite dimensional `k`-linear representations of `G`. If `V : FdRep k G`, there is a coercion that allows you to treat `V` as a type, and this type comes equipped with `Module k V` and `FiniteDimensional k V` instances. Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`. Conversely, given a homomorphism `ρ : G →* (V →ₗ[k] V)`, you can construct the bundled representation as `Rep.of ρ`. We verify that `FdRep k G` is a `k`-linear monoidal category, and rigid when `G` is a group. `FdRep k G` has all finite limits. ## TODO * `FdRep k G ≌ FullSubcategory (FiniteDimensional k)` * Upgrade the right rigid structure to a rigid structure (this just needs to be done for `FGModuleCat`). * `FdRep k G` has all finite colimits. * `FdRep k G` is abelian. * `FdRep k G ≌ FGModuleCat (MonoidAlgebra k G)`. -/ suppress_compilation universe u open CategoryTheory open CategoryTheory.Limits set_option linter.uppercaseLean3 false -- `fdRep` /-- The category of finite dimensional `k`-linear representations of a monoid `G`. -/ abbrev FdRep (k G : Type u) [Field k] [Monoid G] := Action (FGModuleCat.{u} k) (MonCat.of G) #align fdRep FdRep namespace FdRep variable {k G : Type u} [Field k] [Monoid G] -- Porting note: `@[derive]` didn't work for `FdRep`. Add the 4 instances here. instance : LargeCategory (FdRep k G) := inferInstance instance : ConcreteCategory (FdRep k G) := inferInstance instance : Preadditive (FdRep k G) := inferInstance instance : HasFiniteLimits (FdRep k G) := inferInstance instance : Linear k (FdRep k G) := by infer_instance instance : CoeSort (FdRep k G) (Type u) := ConcreteCategory.hasCoeToSort _ instance (V : FdRep k G) : AddCommGroup V := by change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : Module k V := by change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; infer_instance instance (V : FdRep k G) : FiniteDimensional k V := by change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); infer_instance /-- All hom spaces are finite dimensional. -/ instance (V W : FdRep k G) : FiniteDimensional k (V ⟶ W) := FiniteDimensional.of_injective ((forget₂ (FdRep k G) (FGModuleCat k)).mapLinearMap k) (Functor.map_injective (forget₂ (FdRep k G) (FGModuleCat k))) /-- The monoid homomorphism corresponding to the action of `G` onto `V : FdRep k G`. -/ def ρ (V : FdRep k G) : G →* V →ₗ[k] V := Action.ρ V #align fdRep.ρ FdRep.ρ /-- The underlying `LinearEquiv` of an isomorphism of representations. -/ def isoToLinearEquiv {V W : FdRep k G} (i : V ≅ W) : V ≃ₗ[k] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i) #align fdRep.iso_to_linear_equiv FdRep.isoToLinearEquiv theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) : W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by -- Porting note: Changed `rw` to `erw` erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply] rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)] exact (i.hom.comm g).symm #align fdRep.iso.conj_ρ FdRep.Iso.conj_ρ /-- Lift an unbundled representation to `FdRep`. -/ @[simps ρ] def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V] (ρ : Representation k G V) : FdRep k G := ⟨FGModuleCat.of k V, ρ⟩ #align fdRep.of FdRep.of instance : HasForget₂ (FdRep k G) (Rep k G) where forget₂ := (forget₂ (FGModuleCat k) (ModuleCat k)).mapAction (MonCat.of G) theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by ext g v; rfl #align fdRep.forget₂_ρ FdRep.forget₂_ρ -- Verify that the monoidal structure is available. example : MonoidalCategory (FdRep k G) := by infer_instance example : MonoidalPreadditive (FdRep k G) := by infer_instance example : MonoidalLinear k (FdRep k G) := by infer_instance open FiniteDimensional open scoped Classical -- We need to provide this instance explicitely as otherwise `finrank_hom_simple_simple` gives a -- deterministic timeout. instance : HasKernels (FdRep k G) := by infer_instance -- Verify that Schur's lemma applies out of the box. theorem finrank_hom_simple_simple [IsAlgClosed k] (V W : FdRep k G) [Simple V] [Simple W] : finrank k (V ⟶ W) = if Nonempty (V ≅ W) then 1 else 0 := CategoryTheory.finrank_hom_simple_simple k V W #align fdRep.finrank_hom_simple_simple FdRep.finrank_hom_simple_simple /-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/ def forget₂HomLinearEquiv (X Y : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y where toFun f := ⟨f.hom, f.comm⟩ map_add' _ _ := rfl map_smul' _ _ := rfl invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩ left_inv _ := by ext; rfl right_inv _ := by ext; rfl #align fdRep.forget₂_hom_linear_equiv FdRep.forget₂HomLinearEquiv end FdRep namespace FdRep variable {k G : Type u} [Field k] [Group G] -- Verify that the right rigid structure is available when the monoid is a group. noncomputable instance : RightRigidCategory (FdRep k G) := by change RightRigidCategory (Action (FGModuleCat k) (GroupCat.of G)); infer_instance end FdRep namespace FdRep -- The variables in this section are slightly weird, living half in `Representation` and half in -- `FdRep`. When we have a better API for general monoidal closed and rigid categories and these -- structures on `FdRep`, we should remove the dependancy of statements about `FdRep` on -- `Representation.linHom` and `Representation.dual`. The isomorphism `dualTensorIsoLinHom` -- below should then just be obtained from general results about rigid categories. open Representation variable {k G V : Type u} [Field k] [Group G] variable [AddCommGroup V] [Module k V] variable [FiniteDimensional k V] variable (ρV : Representation k G V) (W : FdRep k G) open scoped MonoidalCategory /-- Auxiliary definition for `FdRep.dualTensorIsoLinHom`. -/ noncomputable def dualTensorIsoLinHomAux : (FdRep.of ρV.dual ⊗ W).V ≅ (FdRep.of (linHom ρV W.ρ)).V := -- Porting note: had to make all types explicit arguments @LinearEquiv.toFGModuleCatIso k _ (FdRep.of ρV.dual ⊗ W).V (V →ₗ[k] W) _ _ _ _ _ _ (dualTensorHomEquiv k V W) #align fdRep.dual_tensor_iso_lin_hom_aux FdRep.dualTensorIsoLinHomAux /-- When `V` and `W` are finite dimensional representations of a group `G`, the isomorphism `dualTensorHomEquiv k V W` of vector spaces induces an isomorphism of representations. -/ noncomputable def dualTensorIsoLinHom : FdRep.of ρV.dual ⊗ W ≅ FdRep.of (linHom ρV W.ρ) := by refine Action.mkIso (dualTensorIsoLinHomAux ρV W) ?_
convert dualTensorHom_comm ρV W.ρ
/-- When `V` and `W` are finite dimensional representations of a group `G`, the isomorphism `dualTensorHomEquiv k V W` of vector spaces induces an isomorphism of representations. -/ noncomputable def dualTensorIsoLinHom : FdRep.of ρV.dual ⊗ W ≅ FdRep.of (linHom ρV W.ρ) := by refine Action.mkIso (dualTensorIsoLinHomAux ρV W) ?_
Mathlib.RepresentationTheory.FdRep.182_0.ADbOgJGW1JDvdmK
/-- When `V` and `W` are finite dimensional representations of a group `G`, the isomorphism `dualTensorHomEquiv k V W` of vector spaces induces an isomorphism of representations. -/ noncomputable def dualTensorIsoLinHom : FdRep.of ρV.dual ⊗ W ≅ FdRep.of (linHom ρV W.ρ)
Mathlib_RepresentationTheory_FdRep
α : Type u_1 s : Set α inst✝² : Preorder α inst✝¹ : SupSet α inst✝ : Inhabited ↑s t : Set ↑s h' : Set.Nonempty t h'' : BddAbove t h : sSup (Subtype.val '' t) ∈ s ⊢ sSup (Subtype.val '' t) = ↑(sSup t)
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by
simp [dif_pos, h, h', h'']
theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by
Mathlib.Order.CompleteLatticeIntervals.57_0.e28Rmw8JX0zQo3b
theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α)
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝² : Preorder α inst✝¹ : SupSet α inst✝ : Inhabited ↑s ⊢ sSup ∅ = default
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by
simp [sSup]
theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by
Mathlib.Order.CompleteLatticeIntervals.62_0.e28Rmw8JX0zQo3b
theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝² : Preorder α inst✝¹ : SupSet α inst✝ : Inhabited ↑s t : Set ↑s ht : ¬BddAbove t ⊢ sSup t = default
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by
simp [sSup, ht]
theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by
Mathlib.Order.CompleteLatticeIntervals.66_0.e28Rmw8JX0zQo3b
theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝² : Preorder α inst✝¹ : InfSet α inst✝ : Inhabited ↑s t : Set ↑s h' : Set.Nonempty t h'' : BddBelow t h : sInf (Subtype.val '' t) ∈ s ⊢ sInf (Subtype.val '' t) = ↑(sInf t)
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by
simp [dif_pos, h, h', h'']
theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by
Mathlib.Order.CompleteLatticeIntervals.97_0.e28Rmw8JX0zQo3b
theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α)
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝² : Preorder α inst✝¹ : InfSet α inst✝ : Inhabited ↑s ⊢ sInf ∅ = default
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by
simp [sInf]
theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by
Mathlib.Order.CompleteLatticeIntervals.102_0.e28Rmw8JX0zQo3b
theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝² : Preorder α inst✝¹ : InfSet α inst✝ : Inhabited ↑s t : Set ↑s ht : ¬BddBelow t ⊢ sInf t = default
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by
simp [sInf, ht]
theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by
Mathlib.Order.CompleteLatticeIntervals.106_0.e28Rmw8JX0zQo3b
theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance ⊢ ∀ (s_1 : Set ↑s) (a : ↑s), BddAbove s_1 → a ∈ s_1 → a ≤ sSup s_1
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by
rintro t c h_bdd hct
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance t : Set ↑s c : ↑s h_bdd : BddAbove t hct : c ∈ t ⊢ c ≤ sSup t
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct
rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)]
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance t : Set ↑s c : ↑s h_bdd : BddAbove t hct : c ∈ t ⊢ ↑c ≤ sSup (Subtype.val '' t)
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)]
exact (Subtype.mono_coe _).le_csSup_image hct h_bdd
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)]
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance ⊢ ∀ (s_1 : Set ↑s) (a : ↑s), Set.Nonempty s_1 → a ∈ upperBounds s_1 → sSup s_1 ≤ a
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by
rintro t B ht hB
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance t : Set ↑s B : ↑s ht : Set.Nonempty t hB : B ∈ upperBounds t ⊢ sSup t ≤ B
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB
rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)]
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance t : Set ↑s B : ↑s ht : Set.Nonempty t hB : B ∈ upperBounds t ⊢ sSup (Subtype.val '' t) ≤ ↑B
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)]
exact (Subtype.mono_coe s).csSup_image_le ht hB
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)]
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance ⊢ ∀ (s_1 : Set ↑s) (a : ↑s), BddBelow s_1 → a ∈ s_1 → sInf s_1 ≤ a
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by
rintro t c h_bdd hct
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance t : Set ↑s c : ↑s h_bdd : BddBelow t hct : c ∈ t ⊢ sInf t ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct
rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)]
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance t : Set ↑s c : ↑s h_bdd : BddBelow t hct : c ∈ t ⊢ sInf (Subtype.val '' t) ≤ ↑c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)]
exact (Subtype.mono_coe s).csInf_image_le hct h_bdd
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)]
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance ⊢ ∀ (s_1 : Set ↑s) (a : ↑s), Set.Nonempty s_1 → a ∈ lowerBounds s_1 → a ≤ sInf s_1
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by
intro t B ht hB
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance t : Set ↑s B : ↑s ht : Set.Nonempty t hB : B ∈ lowerBounds t ⊢ B ≤ sInf t
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB
rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)]
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance t : Set ↑s B : ↑s ht : Set.Nonempty t hB : B ∈ lowerBounds t ⊢ ↑B ≤ sInf (Subtype.val '' t)
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)]
exact (Subtype.mono_coe s).le_csInf_image ht hB
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)]
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance t : Set ↑s ht : ¬BddAbove t ⊢ sSup t = sSup ∅
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by
simp [ht]
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝¹ : ConditionallyCompleteLinearOrder α inst✝ : Inhabited ↑s h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s src✝³ : SupSet ↑s := subsetSupSet s src✝² : InfSet ↑s := subsetInfSet s src✝¹ : Lattice ↑s := DistribLattice.toLattice src✝ : LinearOrder ↑s := inferInstance t : Set ↑s ht : ¬BddBelow t ⊢ sInf t = sInf ∅
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by
simp [ht]
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by
Mathlib.Order.CompleteLatticeIntervals.120_0.e28Rmw8JX0zQo3b
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s✝ : Set α inst✝ : ConditionallyCompleteLinearOrder α s : Set α hs : OrdConnected s t : Set ↑s ht : Set.Nonempty t h_bdd : BddAbove t ⊢ sSup (Subtype.val '' t) ∈ s
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by
obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by
Mathlib.Order.CompleteLatticeIntervals.150_0.e28Rmw8JX0zQo3b
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s
Mathlib_Order_CompleteLatticeIntervals
case intro α : Type u_1 s✝ : Set α inst✝ : ConditionallyCompleteLinearOrder α s : Set α hs : OrdConnected s t : Set ↑s h_bdd : BddAbove t c : ↑s hct : c ∈ t ⊢ sSup (Subtype.val '' t) ∈ s
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
Mathlib.Order.CompleteLatticeIntervals.150_0.e28Rmw8JX0zQo3b
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s
Mathlib_Order_CompleteLatticeIntervals
case intro.intro α : Type u_1 s✝ : Set α inst✝ : ConditionallyCompleteLinearOrder α s : Set α hs : OrdConnected s t : Set ↑s c : ↑s hct : c ∈ t B : ↑s hB : B ∈ upperBounds t ⊢ sSup (Subtype.val '' t) ∈ s
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd
refine' hs.out c.2 B.2 ⟨_, _⟩
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd
Mathlib.Order.CompleteLatticeIntervals.150_0.e28Rmw8JX0zQo3b
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s
Mathlib_Order_CompleteLatticeIntervals
case intro.intro.refine'_1 α : Type u_1 s✝ : Set α inst✝ : ConditionallyCompleteLinearOrder α s : Set α hs : OrdConnected s t : Set ↑s c : ↑s hct : c ∈ t B : ↑s hB : B ∈ upperBounds t ⊢ ↑c ≤ sSup (Subtype.val '' t)
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ ·
exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ ·
Mathlib.Order.CompleteLatticeIntervals.150_0.e28Rmw8JX0zQo3b
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s
Mathlib_Order_CompleteLatticeIntervals
case intro.intro.refine'_2 α : Type u_1 s✝ : Set α inst✝ : ConditionallyCompleteLinearOrder α s : Set α hs : OrdConnected s t : Set ↑s c : ↑s hct : c ∈ t B : ↑s hB : B ∈ upperBounds t ⊢ sSup (Subtype.val '' t) ≤ ↑B
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ ·
exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ ·
Mathlib.Order.CompleteLatticeIntervals.150_0.e28Rmw8JX0zQo3b
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s✝ : Set α inst✝ : ConditionallyCompleteLinearOrder α s : Set α hs : OrdConnected s t : Set ↑s ht : Set.Nonempty t h_bdd : BddBelow t ⊢ sInf (Subtype.val '' t) ∈ s
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by
obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by
Mathlib.Order.CompleteLatticeIntervals.161_0.e28Rmw8JX0zQo3b
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s
Mathlib_Order_CompleteLatticeIntervals
case intro α : Type u_1 s✝ : Set α inst✝ : ConditionallyCompleteLinearOrder α s : Set α hs : OrdConnected s t : Set ↑s h_bdd : BddBelow t c : ↑s hct : c ∈ t ⊢ sInf (Subtype.val '' t) ∈ s
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
Mathlib.Order.CompleteLatticeIntervals.161_0.e28Rmw8JX0zQo3b
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s
Mathlib_Order_CompleteLatticeIntervals
case intro.intro α : Type u_1 s✝ : Set α inst✝ : ConditionallyCompleteLinearOrder α s : Set α hs : OrdConnected s t : Set ↑s c : ↑s hct : c ∈ t B : ↑s hB : B ∈ lowerBounds t ⊢ sInf (Subtype.val '' t) ∈ s
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd
refine' hs.out B.2 c.2 ⟨_, _⟩
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd
Mathlib.Order.CompleteLatticeIntervals.161_0.e28Rmw8JX0zQo3b
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s
Mathlib_Order_CompleteLatticeIntervals
case intro.intro.refine'_1 α : Type u_1 s✝ : Set α inst✝ : ConditionallyCompleteLinearOrder α s : Set α hs : OrdConnected s t : Set ↑s c : ↑s hct : c ∈ t B : ↑s hB : B ∈ lowerBounds t ⊢ ↑B ≤ sInf (Subtype.val '' t)
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ ·
exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ ·
Mathlib.Order.CompleteLatticeIntervals.161_0.e28Rmw8JX0zQo3b
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s
Mathlib_Order_CompleteLatticeIntervals
case intro.intro.refine'_2 α : Type u_1 s✝ : Set α inst✝ : ConditionallyCompleteLinearOrder α s : Set α hs : OrdConnected s t : Set ↑s c : ↑s hct : c ∈ t B : ↑s hB : B ∈ lowerBounds t ⊢ sInf (Subtype.val '' t) ≤ ↑c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB ·
exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB ·
Mathlib.Order.CompleteLatticeIntervals.161_0.e28Rmw8JX0zQo3b
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) hS : ¬S = ∅ ⊢ sSup (Subtype.val '' S) ∈ Icc a b
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) hS : Set.Nonempty S ⊢ sSup (Subtype.val '' S) ∈ Icc a b
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) hS : Set.Nonempty S ⊢ a ≤ sSup (Subtype.val '' S)
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
obtain ⟨c, hc⟩ := hS
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case intro α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S ⊢ a ≤ sSup (Subtype.val '' S)
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS
exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S ⊢ c ≤ sSup S
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by
by_cases hS : S = ∅
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case pos α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S hS : S = ∅ ⊢ c ≤ sSup S
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;>
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;>
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case neg α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S hS : ¬S = ∅ ⊢ c ≤ sSup S
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;>
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;>
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case pos α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S hS : S = ∅ ⊢ c ≤ { val := a, property := (_ : a ≤ a ∧ a ≤ b) }
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] ·
simp [hS] at hc
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] ·
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case neg α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S hS : ¬S = ∅ ⊢ c ≤ { val := sSup (Subtype.val '' S), property := (_ : a ≤ sSup (Subtype.val '' S) ∧ sSup (Subtype.val '' S) ≤ b) }
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc ·
exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc ·
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : ∀ b_1 ∈ S, b_1 ≤ c ⊢ sSup S ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by
by_cases hS : S = ∅
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case pos α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : ∀ b_1 ∈ S, b_1 ≤ c hS : S = ∅ ⊢ sSup S ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;>
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;>
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case neg α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : ∀ b_1 ∈ S, b_1 ≤ c hS : ¬S = ∅ ⊢ sSup S ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;>
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;>
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case pos α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : ∀ b_1 ∈ S, b_1 ≤ c hS : S = ∅ ⊢ { val := a, property := (_ : a ≤ a ∧ a ≤ b) } ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] ·
exact c.2.1
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] ·
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case neg α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : ∀ b_1 ∈ S, b_1 ≤ c hS : ¬S = ∅ ⊢ { val := sSup (Subtype.val '' S), property := (_ : a ≤ sSup (Subtype.val '' S) ∧ sSup (Subtype.val '' S) ≤ b) } ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 ·
exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h)
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 ·
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) hS : ¬S = ∅ ⊢ sInf (Subtype.val '' S) ∈ Icc a b
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by
rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) hS : Set.Nonempty S ⊢ sInf (Subtype.val '' S) ∈ Icc a b
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) hS : Set.Nonempty S ⊢ sInf (Subtype.val '' S) ≤ b
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩
obtain ⟨c, hc⟩ := hS
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case intro α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S ⊢ sInf (Subtype.val '' S) ≤ b
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS
exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S ⊢ sInf S ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by
by_cases hS : S = ∅
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case pos α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S hS : S = ∅ ⊢ sInf S ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;>
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;>
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case neg α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S hS : ¬S = ∅ ⊢ sInf S ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;>
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;>
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case pos α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S hS : S = ∅ ⊢ { val := b, property := (_ : a ≤ b ∧ b ≤ b) } ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] ·
simp [hS] at hc
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] ·
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case neg α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : c ∈ S hS : ¬S = ∅ ⊢ { val := sInf (Subtype.val '' S), property := (_ : a ≤ sInf (Subtype.val '' S) ∧ sInf (Subtype.val '' S) ≤ b) } ≤ c
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc ·
exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc ·
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : ∀ b_1 ∈ S, c ≤ b_1 ⊢ c ≤ sInf S
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩ le_sInf S c hc := by
by_cases hS : S = ∅
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩ le_sInf S c hc := by
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case pos α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : ∀ b_1 ∈ S, c ≤ b_1 hS : S = ∅ ⊢ c ≤ sInf S
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩ le_sInf S c hc := by by_cases hS : S = ∅ <;>
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩ le_sInf S c hc := by by_cases hS : S = ∅ <;>
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case neg α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : ∀ b_1 ∈ S, c ≤ b_1 hS : ¬S = ∅ ⊢ c ≤ sInf S
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩ le_sInf S c hc := by by_cases hS : S = ∅ <;>
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩ le_sInf S c hc := by by_cases hS : S = ∅ <;>
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case pos α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : ∀ b_1 ∈ S, c ≤ b_1 hS : S = ∅ ⊢ c ≤ { val := b, property := (_ : a ≤ b ∧ b ≤ b) }
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩ le_sInf S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] ·
exact c.2.2
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩ le_sInf S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] ·
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
case neg α : Type u_1 s : Set α inst✝ : ConditionallyCompleteLattice α a b : α h : a ≤ b src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h S : Set ↑(Icc a b) c : ↑(Icc a b) hc : ∀ b_1 ∈ S, c ≤ b_1 hS : ¬S = ∅ ⊢ c ≤ { val := sInf (Subtype.val '' S), property := (_ : a ≤ sInf (Subtype.val '' S) ∧ sInf (Subtype.val '' S) ≤ b) }
/- Copyright (c) 2022 Heather Macbeth. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Heather Macbeth -/ import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.LatticeIntervals import Mathlib.Data.Set.Intervals.OrdConnected #align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" /-! # Subtypes of conditionally complete linear orders In this file we give conditions on a subset of a conditionally complete linear order, to ensure that the subtype is itself conditionally complete. We check that an `OrdConnected` set satisfies these conditions. ## TODO Add appropriate instances for all `Set.Ixx`. This requires a refactor that will allow different default values for `sSup` and `sInf`. -/ open Classical open Set variable {α : Type*} (s : Set α) section SupSet variable [Preorder α] [SupSet α] /-- `SupSet` structure on a nonempty subset `s` of a preorder with `SupSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetSupSet [Inhabited s] : SupSet s where sSup t := if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Sup subsetSupSet attribute [local instance] subsetSupSet @[simp] theorem subset_sSup_def [Inhabited s] : @sSup s _ = fun t => if ht : t.Nonempty ∧ BddAbove t ∧ sSup ((↑) '' t : Set α) ∈ s then ⟨sSup ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Sup_def subset_sSup_def theorem subset_sSup_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddAbove t) (h : sSup ((↑) '' t : Set α) ∈ s) : sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Sup_of_within subset_sSup_of_within theorem subset_sSup_emptyset [Inhabited s] : sSup (∅ : Set s) = default := by simp [sSup] theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) : sSup t = default := by simp [sSup, ht] end SupSet section InfSet variable [Preorder α] [InfSet α] /-- `InfSet` structure on a nonempty subset `s` of a preorder with `InfSet`. This definition is non-canonical (it uses `default s`); it should be used only as here, as an auxiliary instance in the construction of the `ConditionallyCompleteLinearOrder` structure. -/ noncomputable def subsetInfSet [Inhabited s] : InfSet s where sInf t := if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default #align subset_has_Inf subsetInfSet attribute [local instance] subsetInfSet @[simp] theorem subset_sInf_def [Inhabited s] : @sInf s _ = fun t => if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else default := rfl #align subset_Inf_def subset_sInf_def theorem subset_sInf_of_within [Inhabited s] {t : Set s} (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) : sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by simp [dif_pos, h, h', h''] #align subset_Inf_of_within subset_sInf_of_within theorem subset_sInf_emptyset [Inhabited s] : sInf (∅ : Set s) = default := by simp [sInf] theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) : sInf t = default := by simp [sInf, ht] end InfSet section OrdConnected variable [ConditionallyCompleteLinearOrder α] attribute [local instance] subsetSupSet attribute [local instance] subsetInfSet /-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and the `sInf` of all its nonempty bounded-below subsets. See note [reducible non-instances]. -/ @[reducible] noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s] (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s) (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) : ConditionallyCompleteLinearOrder s := { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with le_csSup := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ⟨c, hct⟩ h_bdd (h_Sup ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe _).le_csSup_image hct h_bdd csSup_le := by rintro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sSup_of_within s ht ⟨B, hB⟩ (h_Sup ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).csSup_image_le ht hB le_csInf := by intro t B ht hB rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ht ⟨B, hB⟩ (h_Inf ht ⟨B, hB⟩)] exact (Subtype.mono_coe s).le_csInf_image ht hB csInf_le := by rintro t c h_bdd hct rw [← Subtype.coe_le_coe, ← subset_sInf_of_within s ⟨c, hct⟩ h_bdd (h_Inf ⟨c, hct⟩ h_bdd)] exact (Subtype.mono_coe s).csInf_image_le hct h_bdd csSup_of_not_bddAbove := fun t ht ↦ by simp [ht] csInf_of_not_bddBelow := fun t ht ↦ by simp [ht] } #align subset_conditionally_complete_linear_order subsetConditionallyCompleteLinearOrder /-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/ theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd refine' hs.out c.2 B.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩ · exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB #align Sup_within_of_ord_connected sSup_within_of_ordConnected /-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/ theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty) (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd refine' hs.out B.2 c.2 ⟨_, _⟩ · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB · exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩ #align Inf_within_of_ord_connected sInf_within_of_ordConnected /-- A nonempty `OrdConnected` set in a conditionally complete linear order is naturally a conditionally complete linear order. -/ noncomputable instance ordConnectedSubsetConditionallyCompleteLinearOrder [Inhabited s] [OrdConnected s] : ConditionallyCompleteLinearOrder s := subsetConditionallyCompleteLinearOrder s (fun h => sSup_within_of_ordConnected h) (fun h => sInf_within_of_ordConnected h) #align ord_connected_subset_conditionally_complete_linear_order ordConnectedSubsetConditionallyCompleteLinearOrder end OrdConnected section Icc /-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩ le_sInf S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.2 ·
exact le_csInf ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h)
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __ := Set.Icc.boundedOrder h sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩ obtain ⟨c, hc⟩ := hS exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩ le_sSup S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩ sSup_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.1 · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑)) (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h) sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩ obtain ⟨c, hc⟩ := hS exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2⟩ sInf_le S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · simp [hS] at hc · exact csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩ le_sInf S c hc := by by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false] · exact c.2.2 ·
Mathlib.Order.CompleteLatticeIntervals.185_0.e28Rmw8JX0zQo3b
/-- Complete lattice structure on `Set.Icc` -/ noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where __
Mathlib_Order_CompleteLatticeIntervals
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁ p₂ : P ⊢ c ∈ perpBisector p₁ p₂ ↔ inner ((Equiv.pointReflection c) p₁ -ᵥ p₂) (p₂ -ᵥ p₁) = 0
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by
rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc]
theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by
Mathlib.Geometry.Euclidean.PerpBisector.54_0.WKtplj3xHYGfYbJ
theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁ p₂ : P ⊢ 2⁻¹ * inner (c -ᵥ p₁ + (c -ᵥ p₂)) (p₂ -ᵥ p₁) = 0 ↔ inner (c -ᵥ p₁ + (c -ᵥ p₂)) (p₂ -ᵥ p₁) = 0
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc]
simp
theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc]
Mathlib.Geometry.Euclidean.PerpBisector.54_0.WKtplj3xHYGfYbJ
theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁ p₂ : P ⊢ c ∈ perpBisector p₁ ((Equiv.pointReflection p₂) p₁) ↔ inner (c -ᵥ p₂) (p₁ -ᵥ p₂) = 0
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by
rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev]
theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by
Mathlib.Geometry.Euclidean.PerpBisector.60_0.WKtplj3xHYGfYbJ
theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁✝ p₂✝ p₁ p₂ : P ⊢ midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by
simp [mem_perpBisector_iff_inner_eq_zero]
theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by
Mathlib.Geometry.Euclidean.PerpBisector.66_0.WKtplj3xHYGfYbJ
theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_1 P : Type u_2 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁✝ p₂✝ p₁ p₂ : P ⊢ direction (perpBisector p₁ p₂) = (Submodule.span ℝ {p₂ -ᵥ p₁})ᗮ
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by
erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction]
@[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by
Mathlib.Geometry.Euclidean.PerpBisector.73_0.WKtplj3xHYGfYbJ
@[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_1 P : Type u_2 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁✝ p₂✝ p₁ p₂ : P ⊢ LinearMap.ker ((innerₛₗ ℝ) (p₂ -ᵥ p₁)) = (Submodule.span ℝ {p₂ -ᵥ p₁})ᗮ
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction]
ext x
@[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction]
Mathlib.Geometry.Euclidean.PerpBisector.73_0.WKtplj3xHYGfYbJ
@[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ
Mathlib_Geometry_Euclidean_PerpBisector
case h V : Type u_1 P : Type u_2 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁✝ p₂✝ p₁ p₂ : P x : V ⊢ x ∈ LinearMap.ker ((innerₛₗ ℝ) (p₂ -ᵥ p₁)) ↔ x ∈ (Submodule.span ℝ {p₂ -ᵥ p₁})ᗮ
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x
exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm
@[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x
Mathlib.Geometry.Euclidean.PerpBisector.73_0.WKtplj3xHYGfYbJ
@[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁ p₂ : P ⊢ c ∈ perpBisector p₁ p₂ ↔ inner (c -ᵥ p₁) (p₂ -ᵥ p₁) = inner (c -ᵥ p₂) (p₁ -ᵥ p₂)
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by
rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left]
theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by
Mathlib.Geometry.Euclidean.PerpBisector.81_0.WKtplj3xHYGfYbJ
theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁ p₂ : P ⊢ inner (c -ᵥ p₁ + (c -ᵥ p₂)) (p₂ -ᵥ p₁) = 0 ↔ 2⁻¹ * inner (c -ᵥ p₁ + (c -ᵥ p₂)) (p₂ -ᵥ p₁) = 0
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left];
simp
theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left];
Mathlib.Geometry.Euclidean.PerpBisector.81_0.WKtplj3xHYGfYbJ
theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁ p₂ : P ⊢ c ∈ perpBisector p₁ p₂ ↔ inner (c -ᵥ p₁) (p₂ -ᵥ p₁) = dist p₁ p₂ ^ 2 / 2
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left]; simp theorem mem_perpBisector_iff_inner_eq : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = (dist p₁ p₂) ^ 2 / 2 := by
rw [mem_perpBisector_iff_inner_eq_zero, ← vsub_sub_vsub_cancel_right _ _ p₁, inner_sub_left, sub_eq_zero, midpoint_vsub_left, invOf_eq_inv, real_inner_smul_left, real_inner_self_eq_norm_sq, dist_eq_norm_vsub' V, div_eq_inv_mul]
theorem mem_perpBisector_iff_inner_eq : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = (dist p₁ p₂) ^ 2 / 2 := by
Mathlib.Geometry.Euclidean.PerpBisector.87_0.WKtplj3xHYGfYbJ
theorem mem_perpBisector_iff_inner_eq : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = (dist p₁ p₂) ^ 2 / 2
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁ p₂ : P ⊢ c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left]; simp theorem mem_perpBisector_iff_inner_eq : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = (dist p₁ p₂) ^ 2 / 2 := by rw [mem_perpBisector_iff_inner_eq_zero, ← vsub_sub_vsub_cancel_right _ _ p₁, inner_sub_left, sub_eq_zero, midpoint_vsub_left, invOf_eq_inv, real_inner_smul_left, real_inner_self_eq_norm_sq, dist_eq_norm_vsub' V, div_eq_inv_mul] theorem mem_perpBisector_iff_dist_eq : c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂ := by
rw [dist_eq_norm_vsub V, dist_eq_norm_vsub V, ← real_inner_add_sub_eq_zero_iff, vsub_sub_vsub_cancel_left, inner_add_left, add_eq_zero_iff_eq_neg, ← inner_neg_right, neg_vsub_eq_vsub_rev, mem_perpBisector_iff_inner_eq_inner]
theorem mem_perpBisector_iff_dist_eq : c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂ := by
Mathlib.Geometry.Euclidean.PerpBisector.93_0.WKtplj3xHYGfYbJ
theorem mem_perpBisector_iff_dist_eq : c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁ p₂ : P ⊢ c ∈ perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left]; simp theorem mem_perpBisector_iff_inner_eq : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = (dist p₁ p₂) ^ 2 / 2 := by rw [mem_perpBisector_iff_inner_eq_zero, ← vsub_sub_vsub_cancel_right _ _ p₁, inner_sub_left, sub_eq_zero, midpoint_vsub_left, invOf_eq_inv, real_inner_smul_left, real_inner_self_eq_norm_sq, dist_eq_norm_vsub' V, div_eq_inv_mul] theorem mem_perpBisector_iff_dist_eq : c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂ := by rw [dist_eq_norm_vsub V, dist_eq_norm_vsub V, ← real_inner_add_sub_eq_zero_iff, vsub_sub_vsub_cancel_left, inner_add_left, add_eq_zero_iff_eq_neg, ← inner_neg_right, neg_vsub_eq_vsub_rev, mem_perpBisector_iff_inner_eq_inner] theorem mem_perpBisector_iff_dist_eq' : c ∈ perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c := by
simp only [mem_perpBisector_iff_dist_eq, dist_comm]
theorem mem_perpBisector_iff_dist_eq' : c ∈ perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c := by
Mathlib.Geometry.Euclidean.PerpBisector.98_0.WKtplj3xHYGfYbJ
theorem mem_perpBisector_iff_dist_eq' : c ∈ perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁✝ p₂✝ p₁ p₂ : P ⊢ perpBisector p₁ p₂ = perpBisector p₂ p₁
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left]; simp theorem mem_perpBisector_iff_inner_eq : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = (dist p₁ p₂) ^ 2 / 2 := by rw [mem_perpBisector_iff_inner_eq_zero, ← vsub_sub_vsub_cancel_right _ _ p₁, inner_sub_left, sub_eq_zero, midpoint_vsub_left, invOf_eq_inv, real_inner_smul_left, real_inner_self_eq_norm_sq, dist_eq_norm_vsub' V, div_eq_inv_mul] theorem mem_perpBisector_iff_dist_eq : c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂ := by rw [dist_eq_norm_vsub V, dist_eq_norm_vsub V, ← real_inner_add_sub_eq_zero_iff, vsub_sub_vsub_cancel_left, inner_add_left, add_eq_zero_iff_eq_neg, ← inner_neg_right, neg_vsub_eq_vsub_rev, mem_perpBisector_iff_inner_eq_inner] theorem mem_perpBisector_iff_dist_eq' : c ∈ perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c := by simp only [mem_perpBisector_iff_dist_eq, dist_comm] theorem perpBisector_comm (p₁ p₂ : P) : perpBisector p₁ p₂ = perpBisector p₂ p₁ := by
ext c
theorem perpBisector_comm (p₁ p₂ : P) : perpBisector p₁ p₂ = perpBisector p₂ p₁ := by
Mathlib.Geometry.Euclidean.PerpBisector.101_0.WKtplj3xHYGfYbJ
theorem perpBisector_comm (p₁ p₂ : P) : perpBisector p₁ p₂ = perpBisector p₂ p₁
Mathlib_Geometry_Euclidean_PerpBisector
case h V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c✝ c₁ c₂ p₁✝ p₂✝ p₁ p₂ c : P ⊢ c ∈ perpBisector p₁ p₂ ↔ c ∈ perpBisector p₂ p₁
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left]; simp theorem mem_perpBisector_iff_inner_eq : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = (dist p₁ p₂) ^ 2 / 2 := by rw [mem_perpBisector_iff_inner_eq_zero, ← vsub_sub_vsub_cancel_right _ _ p₁, inner_sub_left, sub_eq_zero, midpoint_vsub_left, invOf_eq_inv, real_inner_smul_left, real_inner_self_eq_norm_sq, dist_eq_norm_vsub' V, div_eq_inv_mul] theorem mem_perpBisector_iff_dist_eq : c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂ := by rw [dist_eq_norm_vsub V, dist_eq_norm_vsub V, ← real_inner_add_sub_eq_zero_iff, vsub_sub_vsub_cancel_left, inner_add_left, add_eq_zero_iff_eq_neg, ← inner_neg_right, neg_vsub_eq_vsub_rev, mem_perpBisector_iff_inner_eq_inner] theorem mem_perpBisector_iff_dist_eq' : c ∈ perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c := by simp only [mem_perpBisector_iff_dist_eq, dist_comm] theorem perpBisector_comm (p₁ p₂ : P) : perpBisector p₁ p₂ = perpBisector p₂ p₁ := by ext c;
simp only [mem_perpBisector_iff_dist_eq, eq_comm]
theorem perpBisector_comm (p₁ p₂ : P) : perpBisector p₁ p₂ = perpBisector p₂ p₁ := by ext c;
Mathlib.Geometry.Euclidean.PerpBisector.101_0.WKtplj3xHYGfYbJ
theorem perpBisector_comm (p₁ p₂ : P) : perpBisector p₁ p₂ = perpBisector p₂ p₁
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁ p₂ : P ⊢ p₂ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left]; simp theorem mem_perpBisector_iff_inner_eq : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = (dist p₁ p₂) ^ 2 / 2 := by rw [mem_perpBisector_iff_inner_eq_zero, ← vsub_sub_vsub_cancel_right _ _ p₁, inner_sub_left, sub_eq_zero, midpoint_vsub_left, invOf_eq_inv, real_inner_smul_left, real_inner_self_eq_norm_sq, dist_eq_norm_vsub' V, div_eq_inv_mul] theorem mem_perpBisector_iff_dist_eq : c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂ := by rw [dist_eq_norm_vsub V, dist_eq_norm_vsub V, ← real_inner_add_sub_eq_zero_iff, vsub_sub_vsub_cancel_left, inner_add_left, add_eq_zero_iff_eq_neg, ← inner_neg_right, neg_vsub_eq_vsub_rev, mem_perpBisector_iff_inner_eq_inner] theorem mem_perpBisector_iff_dist_eq' : c ∈ perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c := by simp only [mem_perpBisector_iff_dist_eq, dist_comm] theorem perpBisector_comm (p₁ p₂ : P) : perpBisector p₁ p₂ = perpBisector p₂ p₁ := by ext c; simp only [mem_perpBisector_iff_dist_eq, eq_comm] @[simp] theorem right_mem_perpBisector : p₂ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂ := by
simpa [mem_perpBisector_iff_inner_eq_inner] using eq_comm
@[simp] theorem right_mem_perpBisector : p₂ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂ := by
Mathlib.Geometry.Euclidean.PerpBisector.104_0.WKtplj3xHYGfYbJ
@[simp] theorem right_mem_perpBisector : p₂ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂
Mathlib_Geometry_Euclidean_PerpBisector
V : Type u_2 P : Type u_1 inst✝³ : NormedAddCommGroup V inst✝² : InnerProductSpace ℝ V inst✝¹ : MetricSpace P inst✝ : NormedAddTorsor V P c c₁ c₂ p₁ p₂ : P ⊢ p₁ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂
/- Copyright (c) 2023 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Joseph Myers -/ import Mathlib.Analysis.InnerProductSpace.Orthogonal #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" /-! # Perpendicular bisector of a segment We define `AffineSubspace.perpBisector p₁ p₂` to be the perpendicular bisector of the segment `[p₁, p₂]`, as a bundled affine subspace. We also prove that a point belongs to the perpendicular bisector if and only if it is equidistant from `p₁` and `p₂`, as well as a few linear equations that define this subspace. ## Keywords euclidean geometry, perpendicular, perpendicular bisector, line segment bisector, equidistant -/ set_option autoImplicit true open Set open scoped BigOperators RealInnerProductSpace variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} /-- Perpendicular bisector of a segment in a Euclidean affine space. -/ def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `p₂ -ᵥ p₁` is orthogonal to `c -ᵥ midpoint ℝ p₁ p₂`. -/ theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl /-- A point `c` belongs the perpendicular bisector of `[p₁, p₂] iff `c -ᵥ midpoint ℝ p₁ p₂` is orthogonal to `p₂ -ᵥ p₁`. -/ theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left]; simp theorem mem_perpBisector_iff_inner_eq : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = (dist p₁ p₂) ^ 2 / 2 := by rw [mem_perpBisector_iff_inner_eq_zero, ← vsub_sub_vsub_cancel_right _ _ p₁, inner_sub_left, sub_eq_zero, midpoint_vsub_left, invOf_eq_inv, real_inner_smul_left, real_inner_self_eq_norm_sq, dist_eq_norm_vsub' V, div_eq_inv_mul] theorem mem_perpBisector_iff_dist_eq : c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂ := by rw [dist_eq_norm_vsub V, dist_eq_norm_vsub V, ← real_inner_add_sub_eq_zero_iff, vsub_sub_vsub_cancel_left, inner_add_left, add_eq_zero_iff_eq_neg, ← inner_neg_right, neg_vsub_eq_vsub_rev, mem_perpBisector_iff_inner_eq_inner] theorem mem_perpBisector_iff_dist_eq' : c ∈ perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c := by simp only [mem_perpBisector_iff_dist_eq, dist_comm] theorem perpBisector_comm (p₁ p₂ : P) : perpBisector p₁ p₂ = perpBisector p₂ p₁ := by ext c; simp only [mem_perpBisector_iff_dist_eq, eq_comm] @[simp] theorem right_mem_perpBisector : p₂ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂ := by simpa [mem_perpBisector_iff_inner_eq_inner] using eq_comm @[simp] theorem left_mem_perpBisector : p₁ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂ := by
rw [perpBisector_comm, right_mem_perpBisector, eq_comm]
@[simp] theorem left_mem_perpBisector : p₁ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂ := by
Mathlib.Geometry.Euclidean.PerpBisector.107_0.WKtplj3xHYGfYbJ
@[simp] theorem left_mem_perpBisector : p₁ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂
Mathlib_Geometry_Euclidean_PerpBisector