Context stringlengths 57 85k | file_name stringlengths 21 79 | start int64 14 2.42k | end int64 18 2.43k | theorem stringlengths 25 2.71k | proof stringlengths 5 10.6k |
|---|---|---|---|---|---|
import Mathlib.RingTheory.TensorProduct.Basic
import Mathlib.Algebra.Module.ULift
#align_import ring_theory.is_tensor_product from "leanprover-community/mathlib"@"c4926d76bb9c5a4a62ed2f03d998081786132105"
universe u vβ vβ vβ vβ
open TensorProduct
section IsTensorProduct
variable {R : Type*} [CommSemiring R]
variable {Mβ Mβ M M' : Type*}
variable [AddCommMonoid Mβ] [AddCommMonoid Mβ] [AddCommMonoid M] [AddCommMonoid M']
variable [Module R Mβ] [Module R Mβ] [Module R M] [Module R M']
variable (f : Mβ ββ[R] Mβ ββ[R] M)
variable {Nβ Nβ N : Type*} [AddCommMonoid Nβ] [AddCommMonoid Nβ] [AddCommMonoid N]
variable [Module R Nβ] [Module R Nβ] [Module R N]
variable {g : Nβ ββ[R] Nβ ββ[R] N}
def IsTensorProduct : Prop :=
Function.Bijective (TensorProduct.lift f)
#align is_tensor_product IsTensorProduct
variable (R M N) {f}
theorem TensorProduct.isTensorProduct : IsTensorProduct (TensorProduct.mk R M N) := by
delta IsTensorProduct
convert_to Function.Bijective (LinearMap.id : M β[R] N ββ[R] M β[R] N) using 2
Β· apply TensorProduct.ext'
simp
Β· exact Function.bijective_id
#align tensor_product.is_tensor_product TensorProduct.isTensorProduct
variable {R M N}
@[simps! apply]
noncomputable def IsTensorProduct.equiv (h : IsTensorProduct f) : Mβ β[R] Mβ ββ[R] M :=
LinearEquiv.ofBijective _ h
#align is_tensor_product.equiv IsTensorProduct.equiv
@[simp]
theorem IsTensorProduct.equiv_toLinearMap (h : IsTensorProduct f) :
h.equiv.toLinearMap = TensorProduct.lift f :=
rfl
#align is_tensor_product.equiv_to_linear_map IsTensorProduct.equiv_toLinearMap
@[simp]
theorem IsTensorProduct.equiv_symm_apply (h : IsTensorProduct f) (xβ : Mβ) (xβ : Mβ) :
h.equiv.symm (f xβ xβ) = xβ ββ xβ := by
apply h.equiv.injective
refine (h.equiv.apply_symm_apply _).trans ?_
simp
#align is_tensor_product.equiv_symm_apply IsTensorProduct.equiv_symm_apply
noncomputable def IsTensorProduct.lift (h : IsTensorProduct f) (f' : Mβ ββ[R] Mβ ββ[R] M') :
M ββ[R] M' :=
(TensorProduct.lift f').comp h.equiv.symm.toLinearMap
#align is_tensor_product.lift IsTensorProduct.lift
| Mathlib/RingTheory/IsTensorProduct.lean | 97 | 100 | theorem IsTensorProduct.lift_eq (h : IsTensorProduct f) (f' : Mβ ββ[R] Mβ ββ[R] M') (xβ : Mβ)
(xβ : Mβ) : h.lift f' (f xβ xβ) = f' xβ xβ := by |
delta IsTensorProduct.lift
simp
|
import Mathlib.Data.Sigma.Lex
import Mathlib.Order.BoundedOrder
import Mathlib.Mathport.Notation
import Mathlib.Data.Sigma.Basic
#align_import data.sigma.order from "leanprover-community/mathlib"@"1fc36cc9c8264e6e81253f88be7fb2cb6c92d76a"
namespace Sigma
variable {ΞΉ : Type*} {Ξ± : ΞΉ β Type*}
-- Porting note: I made this `le` instead of `LE` because the output type is `Prop`
protected inductive le [β i, LE (Ξ± i)] : β _a _b : Ξ£ i, Ξ± i, Prop
| fiber (i : ΞΉ) (a b : Ξ± i) : a β€ b β Sigma.le β¨i, aβ© β¨i, bβ©
#align sigma.le Sigma.le
protected inductive lt [β i, LT (Ξ± i)] : β _a _b : Ξ£i, Ξ± i, Prop
| fiber (i : ΞΉ) (a b : Ξ± i) : a < b β Sigma.lt β¨i, aβ© β¨i, bβ©
#align sigma.lt Sigma.lt
protected instance LE [β i, LE (Ξ± i)] : LE (Ξ£i, Ξ± i) where
le := Sigma.le
protected instance LT [β i, LT (Ξ± i)] : LT (Ξ£i, Ξ± i) where
lt := Sigma.lt
@[simp]
theorem mk_le_mk_iff [β i, LE (Ξ± i)] {i : ΞΉ} {a b : Ξ± i} : (β¨i, aβ© : Sigma Ξ±) β€ β¨i, bβ© β a β€ b :=
β¨fun β¨_, _, _, hβ© => h, Sigma.le.fiber _ _ _β©
#align sigma.mk_le_mk_iff Sigma.mk_le_mk_iff
@[simp]
theorem mk_lt_mk_iff [β i, LT (Ξ± i)] {i : ΞΉ} {a b : Ξ± i} : (β¨i, aβ© : Sigma Ξ±) < β¨i, bβ© β a < b :=
β¨fun β¨_, _, _, hβ© => h, Sigma.lt.fiber _ _ _β©
#align sigma.mk_lt_mk_iff Sigma.mk_lt_mk_iff
| Mathlib/Data/Sigma/Order.lean | 79 | 86 | theorem le_def [β i, LE (Ξ± i)] {a b : Ξ£i, Ξ± i} : a β€ b β β h : a.1 = b.1, h.rec a.2 β€ b.2 := by |
constructor
Β· rintro β¨i, a, b, hβ©
exact β¨rfl, hβ©
Β· obtain β¨i, aβ© := a
obtain β¨j, bβ© := b
rintro β¨rfl : i = j, hβ©
exact le.fiber _ _ _ h
|
import Mathlib.Algebra.Group.Pi.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.CategoryTheory.Limits.Shapes.Images
import Mathlib.CategoryTheory.IsomorphismClasses
import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects
#align_import category_theory.limits.shapes.zero_morphisms from "leanprover-community/mathlib"@"f7707875544ef1f81b32cb68c79e0e24e45a0e76"
noncomputable section
universe v u
universe v' u'
open CategoryTheory
open CategoryTheory.Category
open scoped Classical
namespace CategoryTheory.Limits
variable (C : Type u) [Category.{v} C]
variable (D : Type u') [Category.{v'} D]
class HasZeroMorphisms where
[zero : β X Y : C, Zero (X βΆ Y)]
comp_zero : β {X Y : C} (f : X βΆ Y) (Z : C), f β« (0 : Y βΆ Z) = (0 : X βΆ Z) := by aesop_cat
zero_comp : β (X : C) {Y Z : C} (f : Y βΆ Z), (0 : X βΆ Y) β« f = (0 : X βΆ Z) := by aesop_cat
#align category_theory.limits.has_zero_morphisms CategoryTheory.Limits.HasZeroMorphisms
#align category_theory.limits.has_zero_morphisms.comp_zero' CategoryTheory.Limits.HasZeroMorphisms.comp_zero
#align category_theory.limits.has_zero_morphisms.zero_comp' CategoryTheory.Limits.HasZeroMorphisms.zero_comp
attribute [instance] HasZeroMorphisms.zero
variable {C}
@[simp]
theorem comp_zero [HasZeroMorphisms C] {X Y : C} {f : X βΆ Y} {Z : C} :
f β« (0 : Y βΆ Z) = (0 : X βΆ Z) :=
HasZeroMorphisms.comp_zero f Z
#align category_theory.limits.comp_zero CategoryTheory.Limits.comp_zero
@[simp]
theorem zero_comp [HasZeroMorphisms C] {X : C} {Y Z : C} {f : Y βΆ Z} :
(0 : X βΆ Y) β« f = (0 : X βΆ Z) :=
HasZeroMorphisms.zero_comp X f
#align category_theory.limits.zero_comp CategoryTheory.Limits.zero_comp
instance hasZeroMorphismsPEmpty : HasZeroMorphisms (Discrete PEmpty) where
zero := by aesop_cat
#align category_theory.limits.has_zero_morphisms_pempty CategoryTheory.Limits.hasZeroMorphismsPEmpty
instance hasZeroMorphismsPUnit : HasZeroMorphisms (Discrete PUnit) where
zero X Y := by repeat (constructor)
#align category_theory.limits.has_zero_morphisms_punit CategoryTheory.Limits.hasZeroMorphismsPUnit
open Opposite HasZeroMorphisms
instance hasZeroMorphismsOpposite [HasZeroMorphisms C] : HasZeroMorphisms Cα΅α΅ where
zero X Y := β¨(0 : unop Y βΆ unop X).opβ©
comp_zero f Z := congr_arg Quiver.Hom.op (HasZeroMorphisms.zero_comp (unop Z) f.unop)
zero_comp X {Y Z} (f : Y βΆ Z) :=
congrArg Quiver.Hom.op (HasZeroMorphisms.comp_zero f.unop (unop X))
#align category_theory.limits.has_zero_morphisms_opposite CategoryTheory.Limits.hasZeroMorphismsOpposite
section
variable [HasZeroMorphisms C]
@[simp] lemma op_zero (X Y : C) : (0 : X βΆ Y).op = 0 := rfl
#align category_theory.op_zero CategoryTheory.Limits.op_zero
@[simp] lemma unop_zero (X Y : Cα΅α΅) : (0 : X βΆ Y).unop = 0 := rfl
#align category_theory.unop_zero CategoryTheory.Limits.unop_zero
theorem zero_of_comp_mono {X Y Z : C} {f : X βΆ Y} (g : Y βΆ Z) [Mono g] (h : f β« g = 0) : f = 0 := by
rw [β zero_comp, cancel_mono] at h
exact h
#align category_theory.limits.zero_of_comp_mono CategoryTheory.Limits.zero_of_comp_mono
| Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean | 145 | 147 | theorem zero_of_epi_comp {X Y Z : C} (f : X βΆ Y) {g : Y βΆ Z} [Epi f] (h : f β« g = 0) : g = 0 := by |
rw [β comp_zero, cancel_epi] at h
exact h
|
import Mathlib.Analysis.Calculus.FDeriv.Basic
import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace
#align_import analysis.calculus.deriv.basic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
noncomputable section
open scoped Classical Topology Filter ENNReal NNReal
open Filter Asymptotics Set
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
def HasDerivAtFilter (f : π β F) (f' : F) (x : π) (L : Filter π) :=
HasFDerivAtFilter f (smulRight (1 : π βL[π] π) f') x L
#align has_deriv_at_filter HasDerivAtFilter
def HasDerivWithinAt (f : π β F) (f' : F) (s : Set π) (x : π) :=
HasDerivAtFilter f f' x (π[s] x)
#align has_deriv_within_at HasDerivWithinAt
def HasDerivAt (f : π β F) (f' : F) (x : π) :=
HasDerivAtFilter f f' x (π x)
#align has_deriv_at HasDerivAt
def HasStrictDerivAt (f : π β F) (f' : F) (x : π) :=
HasStrictFDerivAt f (smulRight (1 : π βL[π] π) f') x
#align has_strict_deriv_at HasStrictDerivAt
def derivWithin (f : π β F) (s : Set π) (x : π) :=
fderivWithin π f s x 1
#align deriv_within derivWithin
def deriv (f : π β F) (x : π) :=
fderiv π f x 1
#align deriv deriv
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
theorem hasFDerivAtFilter_iff_hasDerivAtFilter {f' : π βL[π] F} :
HasFDerivAtFilter f f' x L β HasDerivAtFilter f (f' 1) x L := by simp [HasDerivAtFilter]
#align has_fderiv_at_filter_iff_has_deriv_at_filter hasFDerivAtFilter_iff_hasDerivAtFilter
theorem HasFDerivAtFilter.hasDerivAtFilter {f' : π βL[π] F} :
HasFDerivAtFilter f f' x L β HasDerivAtFilter f (f' 1) x L :=
hasFDerivAtFilter_iff_hasDerivAtFilter.mp
#align has_fderiv_at_filter.has_deriv_at_filter HasFDerivAtFilter.hasDerivAtFilter
theorem hasFDerivWithinAt_iff_hasDerivWithinAt {f' : π βL[π] F} :
HasFDerivWithinAt f f' s x β HasDerivWithinAt f (f' 1) s x :=
hasFDerivAtFilter_iff_hasDerivAtFilter
#align has_fderiv_within_at_iff_has_deriv_within_at hasFDerivWithinAt_iff_hasDerivWithinAt
theorem hasDerivWithinAt_iff_hasFDerivWithinAt {f' : F} :
HasDerivWithinAt f f' s x β HasFDerivWithinAt f (smulRight (1 : π βL[π] π) f') s x :=
Iff.rfl
#align has_deriv_within_at_iff_has_fderiv_within_at hasDerivWithinAt_iff_hasFDerivWithinAt
theorem HasFDerivWithinAt.hasDerivWithinAt {f' : π βL[π] F} :
HasFDerivWithinAt f f' s x β HasDerivWithinAt f (f' 1) s x :=
hasFDerivWithinAt_iff_hasDerivWithinAt.mp
#align has_fderiv_within_at.has_deriv_within_at HasFDerivWithinAt.hasDerivWithinAt
theorem HasDerivWithinAt.hasFDerivWithinAt {f' : F} :
HasDerivWithinAt f f' s x β HasFDerivWithinAt f (smulRight (1 : π βL[π] π) f') s x :=
hasDerivWithinAt_iff_hasFDerivWithinAt.mp
#align has_deriv_within_at.has_fderiv_within_at HasDerivWithinAt.hasFDerivWithinAt
theorem hasFDerivAt_iff_hasDerivAt {f' : π βL[π] F} : HasFDerivAt f f' x β HasDerivAt f (f' 1) x :=
hasFDerivAtFilter_iff_hasDerivAtFilter
#align has_fderiv_at_iff_has_deriv_at hasFDerivAt_iff_hasDerivAt
theorem HasFDerivAt.hasDerivAt {f' : π βL[π] F} : HasFDerivAt f f' x β HasDerivAt f (f' 1) x :=
hasFDerivAt_iff_hasDerivAt.mp
#align has_fderiv_at.has_deriv_at HasFDerivAt.hasDerivAt
theorem hasStrictFDerivAt_iff_hasStrictDerivAt {f' : π βL[π] F} :
HasStrictFDerivAt f f' x β HasStrictDerivAt f (f' 1) x := by
simp [HasStrictDerivAt, HasStrictFDerivAt]
#align has_strict_fderiv_at_iff_has_strict_deriv_at hasStrictFDerivAt_iff_hasStrictDerivAt
protected theorem HasStrictFDerivAt.hasStrictDerivAt {f' : π βL[π] F} :
HasStrictFDerivAt f f' x β HasStrictDerivAt f (f' 1) x :=
hasStrictFDerivAt_iff_hasStrictDerivAt.mp
#align has_strict_fderiv_at.has_strict_deriv_at HasStrictFDerivAt.hasStrictDerivAt
theorem hasStrictDerivAt_iff_hasStrictFDerivAt :
HasStrictDerivAt f f' x β HasStrictFDerivAt f (smulRight (1 : π βL[π] π) f') x :=
Iff.rfl
#align has_strict_deriv_at_iff_has_strict_fderiv_at hasStrictDerivAt_iff_hasStrictFDerivAt
alias β¨HasStrictDerivAt.hasStrictFDerivAt, _β© := hasStrictDerivAt_iff_hasStrictFDerivAt
#align has_strict_deriv_at.has_strict_fderiv_at HasStrictDerivAt.hasStrictFDerivAt
theorem hasDerivAt_iff_hasFDerivAt {f' : F} :
HasDerivAt f f' x β HasFDerivAt f (smulRight (1 : π βL[π] π) f') x :=
Iff.rfl
#align has_deriv_at_iff_has_fderiv_at hasDerivAt_iff_hasFDerivAt
alias β¨HasDerivAt.hasFDerivAt, _β© := hasDerivAt_iff_hasFDerivAt
#align has_deriv_at.has_fderiv_at HasDerivAt.hasFDerivAt
theorem derivWithin_zero_of_not_differentiableWithinAt (h : Β¬DifferentiableWithinAt π f s x) :
derivWithin f s x = 0 := by
unfold derivWithin
rw [fderivWithin_zero_of_not_differentiableWithinAt h]
simp
#align deriv_within_zero_of_not_differentiable_within_at derivWithin_zero_of_not_differentiableWithinAt
theorem derivWithin_zero_of_isolated (h : π[s \ {x}] x = β₯) : derivWithin f s x = 0 := by
rw [derivWithin, fderivWithin_zero_of_isolated h, ContinuousLinearMap.zero_apply]
theorem derivWithin_zero_of_nmem_closure (h : x β closure s) : derivWithin f s x = 0 := by
rw [derivWithin, fderivWithin_zero_of_nmem_closure h, ContinuousLinearMap.zero_apply]
theorem differentiableWithinAt_of_derivWithin_ne_zero (h : derivWithin f s x β 0) :
DifferentiableWithinAt π f s x :=
not_imp_comm.1 derivWithin_zero_of_not_differentiableWithinAt h
#align differentiable_within_at_of_deriv_within_ne_zero differentiableWithinAt_of_derivWithin_ne_zero
theorem deriv_zero_of_not_differentiableAt (h : Β¬DifferentiableAt π f x) : deriv f x = 0 := by
unfold deriv
rw [fderiv_zero_of_not_differentiableAt h]
simp
#align deriv_zero_of_not_differentiable_at deriv_zero_of_not_differentiableAt
theorem differentiableAt_of_deriv_ne_zero (h : deriv f x β 0) : DifferentiableAt π f x :=
not_imp_comm.1 deriv_zero_of_not_differentiableAt h
#align differentiable_at_of_deriv_ne_zero differentiableAt_of_deriv_ne_zero
theorem UniqueDiffWithinAt.eq_deriv (s : Set π) (H : UniqueDiffWithinAt π s x)
(h : HasDerivWithinAt f f' s x) (hβ : HasDerivWithinAt f fβ' s x) : f' = fβ' :=
smulRight_one_eq_iff.mp <| UniqueDiffWithinAt.eq H h hβ
#align unique_diff_within_at.eq_deriv UniqueDiffWithinAt.eq_deriv
theorem hasDerivAtFilter_iff_isLittleO :
HasDerivAtFilter f f' x L β (fun x' : π => f x' - f x - (x' - x) β’ f') =o[L] fun x' => x' - x :=
hasFDerivAtFilter_iff_isLittleO ..
#align has_deriv_at_filter_iff_is_o hasDerivAtFilter_iff_isLittleO
theorem hasDerivAtFilter_iff_tendsto :
HasDerivAtFilter f f' x L β
Tendsto (fun x' : π => βx' - xββ»ΒΉ * βf x' - f x - (x' - x) β’ f'β) L (π 0) :=
hasFDerivAtFilter_iff_tendsto
#align has_deriv_at_filter_iff_tendsto hasDerivAtFilter_iff_tendsto
theorem hasDerivWithinAt_iff_isLittleO :
HasDerivWithinAt f f' s x β
(fun x' : π => f x' - f x - (x' - x) β’ f') =o[π[s] x] fun x' => x' - x :=
hasFDerivAtFilter_iff_isLittleO ..
#align has_deriv_within_at_iff_is_o hasDerivWithinAt_iff_isLittleO
theorem hasDerivWithinAt_iff_tendsto :
HasDerivWithinAt f f' s x β
Tendsto (fun x' => βx' - xββ»ΒΉ * βf x' - f x - (x' - x) β’ f'β) (π[s] x) (π 0) :=
hasFDerivAtFilter_iff_tendsto
#align has_deriv_within_at_iff_tendsto hasDerivWithinAt_iff_tendsto
theorem hasDerivAt_iff_isLittleO :
HasDerivAt f f' x β (fun x' : π => f x' - f x - (x' - x) β’ f') =o[π x] fun x' => x' - x :=
hasFDerivAtFilter_iff_isLittleO ..
#align has_deriv_at_iff_is_o hasDerivAt_iff_isLittleO
theorem hasDerivAt_iff_tendsto :
HasDerivAt f f' x β Tendsto (fun x' => βx' - xββ»ΒΉ * βf x' - f x - (x' - x) β’ f'β) (π x) (π 0) :=
hasFDerivAtFilter_iff_tendsto
#align has_deriv_at_iff_tendsto hasDerivAt_iff_tendsto
theorem HasDerivAtFilter.isBigO_sub (h : HasDerivAtFilter f f' x L) :
(fun x' => f x' - f x) =O[L] fun x' => x' - x :=
HasFDerivAtFilter.isBigO_sub h
set_option linter.uppercaseLean3 false in
#align has_deriv_at_filter.is_O_sub HasDerivAtFilter.isBigO_sub
nonrec theorem HasDerivAtFilter.isBigO_sub_rev (hf : HasDerivAtFilter f f' x L) (hf' : f' β 0) :
(fun x' => x' - x) =O[L] fun x' => f x' - f x :=
suffices AntilipschitzWith βf'βββ»ΒΉ (smulRight (1 : π βL[π] π) f') from hf.isBigO_sub_rev this
AddMonoidHomClass.antilipschitz_of_bound (smulRight (1 : π βL[π] π) f') fun x => by
simp [norm_smul, β div_eq_inv_mul, mul_div_cancel_rightβ _ (mt norm_eq_zero.1 hf')]
set_option linter.uppercaseLean3 false in
#align has_deriv_at_filter.is_O_sub_rev HasDerivAtFilter.isBigO_sub_rev
theorem HasStrictDerivAt.hasDerivAt (h : HasStrictDerivAt f f' x) : HasDerivAt f f' x :=
h.hasFDerivAt
#align has_strict_deriv_at.has_deriv_at HasStrictDerivAt.hasDerivAt
theorem hasDerivWithinAt_congr_set' {s t : Set π} (y : π) (h : s =αΆ [π[{y}αΆ] x] t) :
HasDerivWithinAt f f' s x β HasDerivWithinAt f f' t x :=
hasFDerivWithinAt_congr_set' y h
#align has_deriv_within_at_congr_set' hasDerivWithinAt_congr_set'
theorem hasDerivWithinAt_congr_set {s t : Set π} (h : s =αΆ [π x] t) :
HasDerivWithinAt f f' s x β HasDerivWithinAt f f' t x :=
hasFDerivWithinAt_congr_set h
#align has_deriv_within_at_congr_set hasDerivWithinAt_congr_set
alias β¨HasDerivWithinAt.congr_set, _β© := hasDerivWithinAt_congr_set
#align has_deriv_within_at.congr_set HasDerivWithinAt.congr_set
@[simp]
theorem hasDerivWithinAt_diff_singleton :
HasDerivWithinAt f f' (s \ {x}) x β HasDerivWithinAt f f' s x :=
hasFDerivWithinAt_diff_singleton _
#align has_deriv_within_at_diff_singleton hasDerivWithinAt_diff_singleton
@[simp]
theorem hasDerivWithinAt_Ioi_iff_Ici [PartialOrder π] :
HasDerivWithinAt f f' (Ioi x) x β HasDerivWithinAt f f' (Ici x) x := by
rw [β Ici_diff_left, hasDerivWithinAt_diff_singleton]
#align has_deriv_within_at_Ioi_iff_Ici hasDerivWithinAt_Ioi_iff_Ici
alias β¨HasDerivWithinAt.Ici_of_Ioi, HasDerivWithinAt.Ioi_of_Iciβ© := hasDerivWithinAt_Ioi_iff_Ici
#align has_deriv_within_at.Ici_of_Ioi HasDerivWithinAt.Ici_of_Ioi
#align has_deriv_within_at.Ioi_of_Ici HasDerivWithinAt.Ioi_of_Ici
@[simp]
theorem hasDerivWithinAt_Iio_iff_Iic [PartialOrder π] :
HasDerivWithinAt f f' (Iio x) x β HasDerivWithinAt f f' (Iic x) x := by
rw [β Iic_diff_right, hasDerivWithinAt_diff_singleton]
#align has_deriv_within_at_Iio_iff_Iic hasDerivWithinAt_Iio_iff_Iic
alias β¨HasDerivWithinAt.Iic_of_Iio, HasDerivWithinAt.Iio_of_Iicβ© := hasDerivWithinAt_Iio_iff_Iic
#align has_deriv_within_at.Iic_of_Iio HasDerivWithinAt.Iic_of_Iio
#align has_deriv_within_at.Iio_of_Iic HasDerivWithinAt.Iio_of_Iic
theorem HasDerivWithinAt.Ioi_iff_Ioo [LinearOrder π] [OrderClosedTopology π] {x y : π} (h : x < y) :
HasDerivWithinAt f f' (Ioo x y) x β HasDerivWithinAt f f' (Ioi x) x :=
hasFDerivWithinAt_inter <| Iio_mem_nhds h
#align has_deriv_within_at.Ioi_iff_Ioo HasDerivWithinAt.Ioi_iff_Ioo
alias β¨HasDerivWithinAt.Ioi_of_Ioo, HasDerivWithinAt.Ioo_of_Ioiβ© := HasDerivWithinAt.Ioi_iff_Ioo
#align has_deriv_within_at.Ioi_of_Ioo HasDerivWithinAt.Ioi_of_Ioo
#align has_deriv_within_at.Ioo_of_Ioi HasDerivWithinAt.Ioo_of_Ioi
theorem hasDerivAt_iff_isLittleO_nhds_zero :
HasDerivAt f f' x β (fun h => f (x + h) - f x - h β’ f') =o[π 0] fun h => h :=
hasFDerivAt_iff_isLittleO_nhds_zero
#align has_deriv_at_iff_is_o_nhds_zero hasDerivAt_iff_isLittleO_nhds_zero
theorem HasDerivAtFilter.mono (h : HasDerivAtFilter f f' x Lβ) (hst : Lβ β€ Lβ) :
HasDerivAtFilter f f' x Lβ :=
HasFDerivAtFilter.mono h hst
#align has_deriv_at_filter.mono HasDerivAtFilter.mono
theorem HasDerivWithinAt.mono (h : HasDerivWithinAt f f' t x) (hst : s β t) :
HasDerivWithinAt f f' s x :=
HasFDerivWithinAt.mono h hst
#align has_deriv_within_at.mono HasDerivWithinAt.mono
theorem HasDerivWithinAt.mono_of_mem (h : HasDerivWithinAt f f' t x) (hst : t β π[s] x) :
HasDerivWithinAt f f' s x :=
HasFDerivWithinAt.mono_of_mem h hst
#align has_deriv_within_at.mono_of_mem HasDerivWithinAt.mono_of_mem
#align has_deriv_within_at.nhds_within HasDerivWithinAt.mono_of_mem
theorem HasDerivAt.hasDerivAtFilter (h : HasDerivAt f f' x) (hL : L β€ π x) :
HasDerivAtFilter f f' x L :=
HasFDerivAt.hasFDerivAtFilter h hL
#align has_deriv_at.has_deriv_at_filter HasDerivAt.hasDerivAtFilter
theorem HasDerivAt.hasDerivWithinAt (h : HasDerivAt f f' x) : HasDerivWithinAt f f' s x :=
HasFDerivAt.hasFDerivWithinAt h
#align has_deriv_at.has_deriv_within_at HasDerivAt.hasDerivWithinAt
theorem HasDerivWithinAt.differentiableWithinAt (h : HasDerivWithinAt f f' s x) :
DifferentiableWithinAt π f s x :=
HasFDerivWithinAt.differentiableWithinAt h
#align has_deriv_within_at.differentiable_within_at HasDerivWithinAt.differentiableWithinAt
theorem HasDerivAt.differentiableAt (h : HasDerivAt f f' x) : DifferentiableAt π f x :=
HasFDerivAt.differentiableAt h
#align has_deriv_at.differentiable_at HasDerivAt.differentiableAt
@[simp]
theorem hasDerivWithinAt_univ : HasDerivWithinAt f f' univ x β HasDerivAt f f' x :=
hasFDerivWithinAt_univ
#align has_deriv_within_at_univ hasDerivWithinAt_univ
theorem HasDerivAt.unique (hβ : HasDerivAt f fβ' x) (hβ : HasDerivAt f fβ' x) : fβ' = fβ' :=
smulRight_one_eq_iff.mp <| hβ.hasFDerivAt.unique hβ
#align has_deriv_at.unique HasDerivAt.unique
theorem hasDerivWithinAt_inter' (h : t β π[s] x) :
HasDerivWithinAt f f' (s β© t) x β HasDerivWithinAt f f' s x :=
hasFDerivWithinAt_inter' h
#align has_deriv_within_at_inter' hasDerivWithinAt_inter'
theorem hasDerivWithinAt_inter (h : t β π x) :
HasDerivWithinAt f f' (s β© t) x β HasDerivWithinAt f f' s x :=
hasFDerivWithinAt_inter h
#align has_deriv_within_at_inter hasDerivWithinAt_inter
theorem HasDerivWithinAt.union (hs : HasDerivWithinAt f f' s x) (ht : HasDerivWithinAt f f' t x) :
HasDerivWithinAt f f' (s βͺ t) x :=
hs.hasFDerivWithinAt.union ht.hasFDerivWithinAt
#align has_deriv_within_at.union HasDerivWithinAt.union
theorem HasDerivWithinAt.hasDerivAt (h : HasDerivWithinAt f f' s x) (hs : s β π x) :
HasDerivAt f f' x :=
HasFDerivWithinAt.hasFDerivAt h hs
#align has_deriv_within_at.has_deriv_at HasDerivWithinAt.hasDerivAt
theorem DifferentiableWithinAt.hasDerivWithinAt (h : DifferentiableWithinAt π f s x) :
HasDerivWithinAt f (derivWithin f s x) s x :=
h.hasFDerivWithinAt.hasDerivWithinAt
#align differentiable_within_at.has_deriv_within_at DifferentiableWithinAt.hasDerivWithinAt
theorem DifferentiableAt.hasDerivAt (h : DifferentiableAt π f x) : HasDerivAt f (deriv f x) x :=
h.hasFDerivAt.hasDerivAt
#align differentiable_at.has_deriv_at DifferentiableAt.hasDerivAt
@[simp]
theorem hasDerivAt_deriv_iff : HasDerivAt f (deriv f x) x β DifferentiableAt π f x :=
β¨fun h => h.differentiableAt, fun h => h.hasDerivAtβ©
#align has_deriv_at_deriv_iff hasDerivAt_deriv_iff
@[simp]
theorem hasDerivWithinAt_derivWithin_iff :
HasDerivWithinAt f (derivWithin f s x) s x β DifferentiableWithinAt π f s x :=
β¨fun h => h.differentiableWithinAt, fun h => h.hasDerivWithinAtβ©
#align has_deriv_within_at_deriv_within_iff hasDerivWithinAt_derivWithin_iff
theorem DifferentiableOn.hasDerivAt (h : DifferentiableOn π f s) (hs : s β π x) :
HasDerivAt f (deriv f x) x :=
(h.hasFDerivAt hs).hasDerivAt
#align differentiable_on.has_deriv_at DifferentiableOn.hasDerivAt
theorem HasDerivAt.deriv (h : HasDerivAt f f' x) : deriv f x = f' :=
h.differentiableAt.hasDerivAt.unique h
#align has_deriv_at.deriv HasDerivAt.deriv
theorem deriv_eq {f' : π β F} (h : β x, HasDerivAt f (f' x) x) : deriv f = f' :=
funext fun x => (h x).deriv
#align deriv_eq deriv_eq
theorem HasDerivWithinAt.derivWithin (h : HasDerivWithinAt f f' s x)
(hxs : UniqueDiffWithinAt π s x) : derivWithin f s x = f' :=
hxs.eq_deriv _ h.differentiableWithinAt.hasDerivWithinAt h
#align has_deriv_within_at.deriv_within HasDerivWithinAt.derivWithin
theorem fderivWithin_derivWithin : (fderivWithin π f s x : π β F) 1 = derivWithin f s x :=
rfl
#align fderiv_within_deriv_within fderivWithin_derivWithin
theorem derivWithin_fderivWithin :
smulRight (1 : π βL[π] π) (derivWithin f s x) = fderivWithin π f s x := by simp [derivWithin]
#align deriv_within_fderiv_within derivWithin_fderivWithin
theorem norm_derivWithin_eq_norm_fderivWithin : βderivWithin f s xβ = βfderivWithin π f s xβ := by
simp [β derivWithin_fderivWithin]
theorem fderiv_deriv : (fderiv π f x : π β F) 1 = deriv f x :=
rfl
#align fderiv_deriv fderiv_deriv
theorem deriv_fderiv : smulRight (1 : π βL[π] π) (deriv f x) = fderiv π f x := by simp [deriv]
#align deriv_fderiv deriv_fderiv
theorem norm_deriv_eq_norm_fderiv : βderiv f xβ = βfderiv π f xβ := by
simp [β deriv_fderiv]
theorem DifferentiableAt.derivWithin (h : DifferentiableAt π f x) (hxs : UniqueDiffWithinAt π s x) :
derivWithin f s x = deriv f x := by
unfold derivWithin deriv
rw [h.fderivWithin hxs]
#align differentiable_at.deriv_within DifferentiableAt.derivWithin
theorem HasDerivWithinAt.deriv_eq_zero (hd : HasDerivWithinAt f 0 s x)
(H : UniqueDiffWithinAt π s x) : deriv f x = 0 :=
(em' (DifferentiableAt π f x)).elim deriv_zero_of_not_differentiableAt fun h =>
H.eq_deriv _ h.hasDerivAt.hasDerivWithinAt hd
#align has_deriv_within_at.deriv_eq_zero HasDerivWithinAt.deriv_eq_zero
theorem derivWithin_of_mem (st : t β π[s] x) (ht : UniqueDiffWithinAt π s x)
(h : DifferentiableWithinAt π f t x) : derivWithin f s x = derivWithin f t x :=
((DifferentiableWithinAt.hasDerivWithinAt h).mono_of_mem st).derivWithin ht
#align deriv_within_of_mem derivWithin_of_mem
theorem derivWithin_subset (st : s β t) (ht : UniqueDiffWithinAt π s x)
(h : DifferentiableWithinAt π f t x) : derivWithin f s x = derivWithin f t x :=
((DifferentiableWithinAt.hasDerivWithinAt h).mono st).derivWithin ht
#align deriv_within_subset derivWithin_subset
theorem derivWithin_congr_set' (y : π) (h : s =αΆ [π[{y}αΆ] x] t) :
derivWithin f s x = derivWithin f t x := by simp only [derivWithin, fderivWithin_congr_set' y h]
#align deriv_within_congr_set' derivWithin_congr_set'
theorem derivWithin_congr_set (h : s =αΆ [π x] t) : derivWithin f s x = derivWithin f t x := by
simp only [derivWithin, fderivWithin_congr_set h]
#align deriv_within_congr_set derivWithin_congr_set
@[simp]
theorem derivWithin_univ : derivWithin f univ = deriv f := by
ext
unfold derivWithin deriv
rw [fderivWithin_univ]
#align deriv_within_univ derivWithin_univ
theorem derivWithin_inter (ht : t β π x) : derivWithin f (s β© t) x = derivWithin f s x := by
unfold derivWithin
rw [fderivWithin_inter ht]
#align deriv_within_inter derivWithin_inter
theorem derivWithin_of_mem_nhds (h : s β π x) : derivWithin f s x = deriv f x := by
simp only [derivWithin, deriv, fderivWithin_of_mem_nhds h]
theorem derivWithin_of_isOpen (hs : IsOpen s) (hx : x β s) : derivWithin f s x = deriv f x :=
derivWithin_of_mem_nhds (hs.mem_nhds hx)
#align deriv_within_of_open derivWithin_of_isOpen
lemma deriv_eqOn {f' : π β F} (hs : IsOpen s) (hf' : β x β s, HasDerivWithinAt f (f' x) s x) :
s.EqOn (deriv f) f' := fun x hx β¦ by
rw [β derivWithin_of_isOpen hs hx, (hf' _ hx).derivWithin <| hs.uniqueDiffWithinAt hx]
theorem deriv_mem_iff {f : π β F} {s : Set F} {x : π} :
deriv f x β s β
DifferentiableAt π f x β§ deriv f x β s β¨ Β¬DifferentiableAt π f x β§ (0 : F) β s := by
by_cases hx : DifferentiableAt π f x <;> simp [deriv_zero_of_not_differentiableAt, *]
#align deriv_mem_iff deriv_mem_iff
| Mathlib/Analysis/Calculus/Deriv/Basic.lean | 546 | 551 | theorem derivWithin_mem_iff {f : π β F} {t : Set π} {s : Set F} {x : π} :
derivWithin f t x β s β
DifferentiableWithinAt π f t x β§ derivWithin f t x β s β¨
Β¬DifferentiableWithinAt π f t x β§ (0 : F) β s := by |
by_cases hx : DifferentiableWithinAt π f t x <;>
simp [derivWithin_zero_of_not_differentiableWithinAt, *]
|
import Mathlib.Analysis.MeanInequalities
import Mathlib.Analysis.MeanInequalitiesPow
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity
import Mathlib.Data.Set.Image
import Mathlib.Topology.Algebra.Order.LiminfLimsup
#align_import analysis.normed_space.lp_space from "leanprover-community/mathlib"@"de83b43717abe353f425855fcf0cedf9ea0fe8a4"
noncomputable section
open scoped NNReal ENNReal Function
variable {Ξ± : Type*} {E : Ξ± β Type*} {p q : ββ₯0β} [β i, NormedAddCommGroup (E i)]
def Memβp (f : β i, E i) (p : ββ₯0β) : Prop :=
if p = 0 then Set.Finite { i | f i β 0 }
else if p = β then BddAbove (Set.range fun i => βf iβ)
else Summable fun i => βf iβ ^ p.toReal
#align mem_βp Memβp
theorem memβp_zero_iff {f : β i, E i} : Memβp f 0 β Set.Finite { i | f i β 0 } := by
dsimp [Memβp]
rw [if_pos rfl]
#align mem_βp_zero_iff memβp_zero_iff
theorem memβp_zero {f : β i, E i} (hf : Set.Finite { i | f i β 0 }) : Memβp f 0 :=
memβp_zero_iff.2 hf
#align mem_βp_zero memβp_zero
theorem memβp_infty_iff {f : β i, E i} : Memβp f β β BddAbove (Set.range fun i => βf iβ) := by
dsimp [Memβp]
rw [if_neg ENNReal.top_ne_zero, if_pos rfl]
#align mem_βp_infty_iff memβp_infty_iff
theorem memβp_infty {f : β i, E i} (hf : BddAbove (Set.range fun i => βf iβ)) : Memβp f β :=
memβp_infty_iff.2 hf
#align mem_βp_infty memβp_infty
theorem memβp_gen_iff (hp : 0 < p.toReal) {f : β i, E i} :
Memβp f p β Summable fun i => βf iβ ^ p.toReal := by
rw [ENNReal.toReal_pos_iff] at hp
dsimp [Memβp]
rw [if_neg hp.1.ne', if_neg hp.2.ne]
#align mem_βp_gen_iff memβp_gen_iff
| Mathlib/Analysis/NormedSpace/lpSpace.lean | 106 | 114 | theorem memβp_gen {f : β i, E i} (hf : Summable fun i => βf iβ ^ p.toReal) : Memβp f p := by |
rcases p.trichotomy with (rfl | rfl | hp)
Β· apply memβp_zero
have H : Summable fun _ : Ξ± => (1 : β) := by simpa using hf
exact (Set.Finite.of_summable_const (by norm_num) H).subset (Set.subset_univ _)
Β· apply memβp_infty
have H : Summable fun _ : Ξ± => (1 : β) := by simpa using hf
simpa using ((Set.Finite.of_summable_const (by norm_num) H).image fun i => βf iβ).bddAbove
exact (memβp_gen_iff hp).2 hf
|
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.Basic
import Mathlib.RingTheory.Ideal.Maps
import Mathlib.RingTheory.MvPowerSeries.Basic
#align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60"
noncomputable section
open Finset (antidiagonal mem_antidiagonal)
def PowerSeries (R : Type*) :=
MvPowerSeries Unit R
#align power_series PowerSeries
namespace PowerSeries
open Finsupp (single)
variable {R : Type*}
section
-- Porting note: not available in Lean 4
-- local reducible PowerSeries
scoped notation:9000 R "β¦Xβ§" => PowerSeries R
instance [Inhabited R] : Inhabited Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance [Zero R] : Zero Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance [AddMonoid R] : AddMonoid Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance [AddGroup R] : AddGroup Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance [AddCommMonoid R] : AddCommMonoid Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance [AddCommGroup R] : AddCommGroup Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance [Semiring R] : Semiring Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance [CommSemiring R] : CommSemiring Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance [Ring R] : Ring Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance [CommRing R] : CommRing Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance [Nontrivial R] : Nontrivial Rβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R Aβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S]
[IsScalarTower R S A] : IsScalarTower R S Aβ¦Xβ§ :=
Pi.isScalarTower
instance {A} [Semiring A] [CommSemiring R] [Algebra R A] : Algebra R Aβ¦Xβ§ := by
dsimp only [PowerSeries]
infer_instance
end
section Semiring
variable (R) [Semiring R]
def coeff (n : β) : Rβ¦Xβ§ ββ[R] R :=
MvPowerSeries.coeff R (single () n)
#align power_series.coeff PowerSeries.coeff
def monomial (n : β) : R ββ[R] Rβ¦Xβ§ :=
MvPowerSeries.monomial R (single () n)
#align power_series.monomial PowerSeries.monomial
variable {R}
theorem coeff_def {s : Unit ββ β} {n : β} (h : s () = n) : coeff R n = MvPowerSeries.coeff R s := by
erw [coeff, β h, β Finsupp.unique_single s]
#align power_series.coeff_def PowerSeries.coeff_def
@[ext]
theorem ext {Ο Ο : Rβ¦Xβ§} (h : β n, coeff R n Ο = coeff R n Ο) : Ο = Ο :=
MvPowerSeries.ext fun n => by
rw [β coeff_def]
Β· apply h
rfl
#align power_series.ext PowerSeries.ext
theorem ext_iff {Ο Ο : Rβ¦Xβ§} : Ο = Ο β β n, coeff R n Ο = coeff R n Ο :=
β¨fun h n => congr_arg (coeff R n) h, extβ©
#align power_series.ext_iff PowerSeries.ext_iff
instance [Subsingleton R] : Subsingleton Rβ¦Xβ§ := by
simp only [subsingleton_iff, ext_iff]
exact fun _ _ _ β¦ (subsingleton_iff).mp (by infer_instance) _ _
def mk {R} (f : β β R) : Rβ¦Xβ§ := fun s => f (s ())
#align power_series.mk PowerSeries.mk
@[simp]
theorem coeff_mk (n : β) (f : β β R) : coeff R n (mk f) = f n :=
congr_arg f Finsupp.single_eq_same
#align power_series.coeff_mk PowerSeries.coeff_mk
theorem coeff_monomial (m n : β) (a : R) : coeff R m (monomial R n a) = if m = n then a else 0 :=
calc
coeff R m (monomial R n a) = _ := MvPowerSeries.coeff_monomial _ _ _
_ = if m = n then a else 0 := by simp only [Finsupp.unique_single_eq_iff]
#align power_series.coeff_monomial PowerSeries.coeff_monomial
theorem monomial_eq_mk (n : β) (a : R) : monomial R n a = mk fun m => if m = n then a else 0 :=
ext fun m => by rw [coeff_monomial, coeff_mk]
#align power_series.monomial_eq_mk PowerSeries.monomial_eq_mk
@[simp]
theorem coeff_monomial_same (n : β) (a : R) : coeff R n (monomial R n a) = a :=
MvPowerSeries.coeff_monomial_same _ _
#align power_series.coeff_monomial_same PowerSeries.coeff_monomial_same
@[simp]
theorem coeff_comp_monomial (n : β) : (coeff R n).comp (monomial R n) = LinearMap.id :=
LinearMap.ext <| coeff_monomial_same n
#align power_series.coeff_comp_monomial PowerSeries.coeff_comp_monomial
variable (R)
def constantCoeff : Rβ¦Xβ§ β+* R :=
MvPowerSeries.constantCoeff Unit R
#align power_series.constant_coeff PowerSeries.constantCoeff
def C : R β+* Rβ¦Xβ§ :=
MvPowerSeries.C Unit R
set_option linter.uppercaseLean3 false in
#align power_series.C PowerSeries.C
variable {R}
def X : Rβ¦Xβ§ :=
MvPowerSeries.X ()
set_option linter.uppercaseLean3 false in
#align power_series.X PowerSeries.X
theorem commute_X (Ο : Rβ¦Xβ§) : Commute Ο X :=
MvPowerSeries.commute_X _ _
set_option linter.uppercaseLean3 false in
#align power_series.commute_X PowerSeries.commute_X
@[simp]
theorem coeff_zero_eq_constantCoeff : β(coeff R 0) = constantCoeff R := by
rw [coeff, Finsupp.single_zero]
rfl
#align power_series.coeff_zero_eq_constant_coeff PowerSeries.coeff_zero_eq_constantCoeff
theorem coeff_zero_eq_constantCoeff_apply (Ο : Rβ¦Xβ§) : coeff R 0 Ο = constantCoeff R Ο := by
rw [coeff_zero_eq_constantCoeff]
#align power_series.coeff_zero_eq_constant_coeff_apply PowerSeries.coeff_zero_eq_constantCoeff_apply
@[simp]
theorem monomial_zero_eq_C : β(monomial R 0) = C R := by
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [monomial, Finsupp.single_zero, MvPowerSeries.monomial_zero_eq_C]
set_option linter.uppercaseLean3 false in
#align power_series.monomial_zero_eq_C PowerSeries.monomial_zero_eq_C
theorem monomial_zero_eq_C_apply (a : R) : monomial R 0 a = C R a := by simp
set_option linter.uppercaseLean3 false in
#align power_series.monomial_zero_eq_C_apply PowerSeries.monomial_zero_eq_C_apply
theorem coeff_C (n : β) (a : R) : coeff R n (C R a : Rβ¦Xβ§) = if n = 0 then a else 0 := by
rw [β monomial_zero_eq_C_apply, coeff_monomial]
set_option linter.uppercaseLean3 false in
#align power_series.coeff_C PowerSeries.coeff_C
@[simp]
theorem coeff_zero_C (a : R) : coeff R 0 (C R a) = a := by
rw [coeff_C, if_pos rfl]
set_option linter.uppercaseLean3 false in
#align power_series.coeff_zero_C PowerSeries.coeff_zero_C
theorem coeff_ne_zero_C {a : R} {n : β} (h : n β 0) : coeff R n (C R a) = 0 := by
rw [coeff_C, if_neg h]
@[simp]
theorem coeff_succ_C {a : R} {n : β} : coeff R (n + 1) (C R a) = 0 :=
coeff_ne_zero_C n.succ_ne_zero
theorem C_injective : Function.Injective (C R) := by
intro a b H
have := (ext_iff (Ο := C R a) (Ο := C R b)).mp H 0
rwa [coeff_zero_C, coeff_zero_C] at this
protected theorem subsingleton_iff : Subsingleton Rβ¦Xβ§ β Subsingleton R := by
refine β¨fun h β¦ ?_, fun _ β¦ inferInstanceβ©
rw [subsingleton_iff] at h β’
exact fun a b β¦ C_injective (h (C R a) (C R b))
theorem X_eq : (X : Rβ¦Xβ§) = monomial R 1 1 :=
rfl
set_option linter.uppercaseLean3 false in
#align power_series.X_eq PowerSeries.X_eq
theorem coeff_X (n : β) : coeff R n (X : Rβ¦Xβ§) = if n = 1 then 1 else 0 := by
rw [X_eq, coeff_monomial]
set_option linter.uppercaseLean3 false in
#align power_series.coeff_X PowerSeries.coeff_X
@[simp]
theorem coeff_zero_X : coeff R 0 (X : Rβ¦Xβ§) = 0 := by
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [coeff, Finsupp.single_zero, X, MvPowerSeries.coeff_zero_X]
set_option linter.uppercaseLean3 false in
#align power_series.coeff_zero_X PowerSeries.coeff_zero_X
@[simp]
theorem coeff_one_X : coeff R 1 (X : Rβ¦Xβ§) = 1 := by rw [coeff_X, if_pos rfl]
set_option linter.uppercaseLean3 false in
#align power_series.coeff_one_X PowerSeries.coeff_one_X
@[simp]
theorem X_ne_zero [Nontrivial R] : (X : Rβ¦Xβ§) β 0 := fun H => by
simpa only [coeff_one_X, one_ne_zero, map_zero] using congr_arg (coeff R 1) H
set_option linter.uppercaseLean3 false in
#align power_series.X_ne_zero PowerSeries.X_ne_zero
theorem X_pow_eq (n : β) : (X : Rβ¦Xβ§) ^ n = monomial R n 1 :=
MvPowerSeries.X_pow_eq _ n
set_option linter.uppercaseLean3 false in
#align power_series.X_pow_eq PowerSeries.X_pow_eq
theorem coeff_X_pow (m n : β) : coeff R m ((X : Rβ¦Xβ§) ^ n) = if m = n then 1 else 0 := by
rw [X_pow_eq, coeff_monomial]
set_option linter.uppercaseLean3 false in
#align power_series.coeff_X_pow PowerSeries.coeff_X_pow
@[simp]
theorem coeff_X_pow_self (n : β) : coeff R n ((X : Rβ¦Xβ§) ^ n) = 1 := by
rw [coeff_X_pow, if_pos rfl]
set_option linter.uppercaseLean3 false in
#align power_series.coeff_X_pow_self PowerSeries.coeff_X_pow_self
@[simp]
theorem coeff_one (n : β) : coeff R n (1 : Rβ¦Xβ§) = if n = 0 then 1 else 0 :=
coeff_C n 1
#align power_series.coeff_one PowerSeries.coeff_one
theorem coeff_zero_one : coeff R 0 (1 : Rβ¦Xβ§) = 1 :=
coeff_zero_C 1
#align power_series.coeff_zero_one PowerSeries.coeff_zero_one
theorem coeff_mul (n : β) (Ο Ο : Rβ¦Xβ§) :
coeff R n (Ο * Ο) = β p β antidiagonal n, coeff R p.1 Ο * coeff R p.2 Ο := by
-- `rw` can't see that `PowerSeries = MvPowerSeries Unit`, so use `.trans`
refine (MvPowerSeries.coeff_mul _ Ο Ο).trans ?_
rw [Finsupp.antidiagonal_single, Finset.sum_map]
rfl
#align power_series.coeff_mul PowerSeries.coeff_mul
@[simp]
theorem coeff_mul_C (n : β) (Ο : Rβ¦Xβ§) (a : R) : coeff R n (Ο * C R a) = coeff R n Ο * a :=
MvPowerSeries.coeff_mul_C _ Ο a
set_option linter.uppercaseLean3 false in
#align power_series.coeff_mul_C PowerSeries.coeff_mul_C
@[simp]
theorem coeff_C_mul (n : β) (Ο : Rβ¦Xβ§) (a : R) : coeff R n (C R a * Ο) = a * coeff R n Ο :=
MvPowerSeries.coeff_C_mul _ Ο a
set_option linter.uppercaseLean3 false in
#align power_series.coeff_C_mul PowerSeries.coeff_C_mul
@[simp]
theorem coeff_smul {S : Type*} [Semiring S] [Module R S] (n : β) (Ο : PowerSeries S) (a : R) :
coeff S n (a β’ Ο) = a β’ coeff S n Ο :=
rfl
#align power_series.coeff_smul PowerSeries.coeff_smul
@[simp]
theorem constantCoeff_smul {S : Type*} [Semiring S] [Module R S] (Ο : PowerSeries S) (a : R) :
constantCoeff S (a β’ Ο) = a β’ constantCoeff S Ο :=
rfl
theorem smul_eq_C_mul (f : Rβ¦Xβ§) (a : R) : a β’ f = C R a * f := by
ext
simp
set_option linter.uppercaseLean3 false in
#align power_series.smul_eq_C_mul PowerSeries.smul_eq_C_mul
@[simp]
theorem coeff_succ_mul_X (n : β) (Ο : Rβ¦Xβ§) : coeff R (n + 1) (Ο * X) = coeff R n Ο := by
simp only [coeff, Finsupp.single_add]
convert Ο.coeff_add_mul_monomial (single () n) (single () 1) _
rw [mul_one]; rfl
set_option linter.uppercaseLean3 false in
#align power_series.coeff_succ_mul_X PowerSeries.coeff_succ_mul_X
@[simp]
theorem coeff_succ_X_mul (n : β) (Ο : Rβ¦Xβ§) : coeff R (n + 1) (X * Ο) = coeff R n Ο := by
simp only [coeff, Finsupp.single_add, add_comm n 1]
convert Ο.coeff_add_monomial_mul (single () 1) (single () n) _
rw [one_mul]; rfl
set_option linter.uppercaseLean3 false in
#align power_series.coeff_succ_X_mul PowerSeries.coeff_succ_X_mul
@[simp]
theorem constantCoeff_C (a : R) : constantCoeff R (C R a) = a :=
rfl
set_option linter.uppercaseLean3 false in
#align power_series.constant_coeff_C PowerSeries.constantCoeff_C
@[simp]
theorem constantCoeff_comp_C : (constantCoeff R).comp (C R) = RingHom.id R :=
rfl
set_option linter.uppercaseLean3 false in
#align power_series.constant_coeff_comp_C PowerSeries.constantCoeff_comp_C
-- Porting note (#10618): simp can prove this.
-- @[simp]
theorem constantCoeff_zero : constantCoeff R 0 = 0 :=
rfl
#align power_series.constant_coeff_zero PowerSeries.constantCoeff_zero
-- Porting note (#10618): simp can prove this.
-- @[simp]
theorem constantCoeff_one : constantCoeff R 1 = 1 :=
rfl
#align power_series.constant_coeff_one PowerSeries.constantCoeff_one
@[simp]
theorem constantCoeff_X : constantCoeff R X = 0 :=
MvPowerSeries.coeff_zero_X _
set_option linter.uppercaseLean3 false in
#align power_series.constant_coeff_X PowerSeries.constantCoeff_X
@[simp]
theorem constantCoeff_mk {f : β β R} : constantCoeff R (mk f) = f 0 := rfl
theorem coeff_zero_mul_X (Ο : Rβ¦Xβ§) : coeff R 0 (Ο * X) = 0 := by simp
set_option linter.uppercaseLean3 false in
#align power_series.coeff_zero_mul_X PowerSeries.coeff_zero_mul_X
theorem coeff_zero_X_mul (Ο : Rβ¦Xβ§) : coeff R 0 (X * Ο) = 0 := by simp
set_option linter.uppercaseLean3 false in
#align power_series.coeff_zero_X_mul PowerSeries.coeff_zero_X_mul
theorem constantCoeff_surj : Function.Surjective (constantCoeff R) :=
fun r => β¨(C R) r, constantCoeff_C rβ©
-- The following section duplicates the API of `Data.Polynomial.Coeff` and should attempt to keep
-- up to date with that
section
theorem coeff_C_mul_X_pow (x : R) (k n : β) :
coeff R n (C R x * X ^ k : Rβ¦Xβ§) = if n = k then x else 0 := by
simp [X_pow_eq, coeff_monomial]
set_option linter.uppercaseLean3 false in
#align power_series.coeff_C_mul_X_pow PowerSeries.coeff_C_mul_X_pow
@[simp]
| Mathlib/RingTheory/PowerSeries/Basic.lean | 438 | 448 | theorem coeff_mul_X_pow (p : Rβ¦Xβ§) (n d : β) :
coeff R (d + n) (p * X ^ n) = coeff R d p := by |
rw [coeff_mul, Finset.sum_eq_single (d, n), coeff_X_pow, if_pos rfl, mul_one]
Β· rintro β¨i, jβ© h1 h2
rw [coeff_X_pow, if_neg, mul_zero]
rintro rfl
apply h2
rw [mem_antidiagonal, add_right_cancel_iff] at h1
subst h1
rfl
Β· exact fun h1 => (h1 (mem_antidiagonal.2 rfl)).elim
|
import Aesop.Nanos
import Aesop.Util.UnionFind
import Aesop.Util.UnorderedArraySet
import Batteries.Data.String
import Batteries.Lean.Expr
import Batteries.Lean.Meta.DiscrTree
import Batteries.Lean.PersistentHashSet
import Lean.Meta.Tactic.TryThis
open Lean
open Lean.Meta Lean.Elab.Tactic
namespace Aesop.Array
| .lake/packages/aesop/Aesop/Util/Basic.lean | 21 | 24 | theorem size_modify (a : Array Ξ±) (i : Nat) (f : Ξ± β Ξ±) :
(a.modify i f).size = a.size := by |
simp only [Array.modify, Id.run, Array.modifyM]
split <;> simp
|
import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine
import Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle
#align_import geometry.euclidean.angle.oriented.right_angle from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open scoped EuclideanGeometry
open scoped Real
open scoped RealInnerProductSpace
namespace Orientation
open FiniteDimensional
variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace β V]
variable [hd2 : Fact (finrank β V = 2)] (o : Orientation β V (Fin 2))
theorem oangle_add_right_eq_arccos_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle x (x + y) = Real.arccos (βxβ / βx + yβ) := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs,
InnerProductGeometry.angle_add_eq_arccos_of_inner_eq_zero
(o.inner_eq_zero_of_oangle_eq_pi_div_two h)]
#align orientation.oangle_add_right_eq_arccos_of_oangle_eq_pi_div_two Orientation.oangle_add_right_eq_arccos_of_oangle_eq_pi_div_two
theorem oangle_add_left_eq_arccos_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle (x + y) y = Real.arccos (βyβ / βx + yβ) := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).oangle_add_right_eq_arccos_of_oangle_eq_pi_div_two h
#align orientation.oangle_add_left_eq_arccos_of_oangle_eq_pi_div_two Orientation.oangle_add_left_eq_arccos_of_oangle_eq_pi_div_two
theorem oangle_add_right_eq_arcsin_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle x (x + y) = Real.arcsin (βyβ / βx + yβ) := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs,
InnerProductGeometry.angle_add_eq_arcsin_of_inner_eq_zero
(o.inner_eq_zero_of_oangle_eq_pi_div_two h)
(Or.inl (o.left_ne_zero_of_oangle_eq_pi_div_two h))]
#align orientation.oangle_add_right_eq_arcsin_of_oangle_eq_pi_div_two Orientation.oangle_add_right_eq_arcsin_of_oangle_eq_pi_div_two
theorem oangle_add_left_eq_arcsin_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle (x + y) y = Real.arcsin (βxβ / βx + yβ) := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).oangle_add_right_eq_arcsin_of_oangle_eq_pi_div_two h
#align orientation.oangle_add_left_eq_arcsin_of_oangle_eq_pi_div_two Orientation.oangle_add_left_eq_arcsin_of_oangle_eq_pi_div_two
theorem oangle_add_right_eq_arctan_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle x (x + y) = Real.arctan (βyβ / βxβ) := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs,
InnerProductGeometry.angle_add_eq_arctan_of_inner_eq_zero
(o.inner_eq_zero_of_oangle_eq_pi_div_two h) (o.left_ne_zero_of_oangle_eq_pi_div_two h)]
#align orientation.oangle_add_right_eq_arctan_of_oangle_eq_pi_div_two Orientation.oangle_add_right_eq_arctan_of_oangle_eq_pi_div_two
theorem oangle_add_left_eq_arctan_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle (x + y) y = Real.arctan (βxβ / βyβ) := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).oangle_add_right_eq_arctan_of_oangle_eq_pi_div_two h
#align orientation.oangle_add_left_eq_arctan_of_oangle_eq_pi_div_two Orientation.oangle_add_left_eq_arctan_of_oangle_eq_pi_div_two
theorem cos_oangle_add_right_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
Real.Angle.cos (o.oangle x (x + y)) = βxβ / βx + yβ := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs, Real.Angle.cos_coe,
InnerProductGeometry.cos_angle_add_of_inner_eq_zero (o.inner_eq_zero_of_oangle_eq_pi_div_two h)]
#align orientation.cos_oangle_add_right_of_oangle_eq_pi_div_two Orientation.cos_oangle_add_right_of_oangle_eq_pi_div_two
theorem cos_oangle_add_left_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
Real.Angle.cos (o.oangle (x + y) y) = βyβ / βx + yβ := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).cos_oangle_add_right_of_oangle_eq_pi_div_two h
#align orientation.cos_oangle_add_left_of_oangle_eq_pi_div_two Orientation.cos_oangle_add_left_of_oangle_eq_pi_div_two
theorem sin_oangle_add_right_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
Real.Angle.sin (o.oangle x (x + y)) = βyβ / βx + yβ := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs, Real.Angle.sin_coe,
InnerProductGeometry.sin_angle_add_of_inner_eq_zero (o.inner_eq_zero_of_oangle_eq_pi_div_two h)
(Or.inl (o.left_ne_zero_of_oangle_eq_pi_div_two h))]
#align orientation.sin_oangle_add_right_of_oangle_eq_pi_div_two Orientation.sin_oangle_add_right_of_oangle_eq_pi_div_two
theorem sin_oangle_add_left_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
Real.Angle.sin (o.oangle (x + y) y) = βxβ / βx + yβ := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).sin_oangle_add_right_of_oangle_eq_pi_div_two h
#align orientation.sin_oangle_add_left_of_oangle_eq_pi_div_two Orientation.sin_oangle_add_left_of_oangle_eq_pi_div_two
theorem tan_oangle_add_right_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
Real.Angle.tan (o.oangle x (x + y)) = βyβ / βxβ := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs, Real.Angle.tan_coe,
InnerProductGeometry.tan_angle_add_of_inner_eq_zero (o.inner_eq_zero_of_oangle_eq_pi_div_two h)]
#align orientation.tan_oangle_add_right_of_oangle_eq_pi_div_two Orientation.tan_oangle_add_right_of_oangle_eq_pi_div_two
theorem tan_oangle_add_left_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
Real.Angle.tan (o.oangle (x + y) y) = βxβ / βyβ := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).tan_oangle_add_right_of_oangle_eq_pi_div_two h
#align orientation.tan_oangle_add_left_of_oangle_eq_pi_div_two Orientation.tan_oangle_add_left_of_oangle_eq_pi_div_two
theorem cos_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : Real.Angle.cos (o.oangle x (x + y)) * βx + yβ = βxβ := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs, Real.Angle.cos_coe,
InnerProductGeometry.cos_angle_add_mul_norm_of_inner_eq_zero
(o.inner_eq_zero_of_oangle_eq_pi_div_two h)]
#align orientation.cos_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two Orientation.cos_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two
theorem cos_oangle_add_left_mul_norm_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : Real.Angle.cos (o.oangle (x + y) y) * βx + yβ = βyβ := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).cos_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two h
#align orientation.cos_oangle_add_left_mul_norm_of_oangle_eq_pi_div_two Orientation.cos_oangle_add_left_mul_norm_of_oangle_eq_pi_div_two
theorem sin_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : Real.Angle.sin (o.oangle x (x + y)) * βx + yβ = βyβ := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs, Real.Angle.sin_coe,
InnerProductGeometry.sin_angle_add_mul_norm_of_inner_eq_zero
(o.inner_eq_zero_of_oangle_eq_pi_div_two h)]
#align orientation.sin_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two Orientation.sin_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two
theorem sin_oangle_add_left_mul_norm_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : Real.Angle.sin (o.oangle (x + y) y) * βx + yβ = βxβ := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).sin_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two h
#align orientation.sin_oangle_add_left_mul_norm_of_oangle_eq_pi_div_two Orientation.sin_oangle_add_left_mul_norm_of_oangle_eq_pi_div_two
theorem tan_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : Real.Angle.tan (o.oangle x (x + y)) * βxβ = βyβ := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs, Real.Angle.tan_coe,
InnerProductGeometry.tan_angle_add_mul_norm_of_inner_eq_zero
(o.inner_eq_zero_of_oangle_eq_pi_div_two h)
(Or.inl (o.left_ne_zero_of_oangle_eq_pi_div_two h))]
#align orientation.tan_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two Orientation.tan_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two
theorem tan_oangle_add_left_mul_norm_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : Real.Angle.tan (o.oangle (x + y) y) * βyβ = βxβ := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).tan_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two h
#align orientation.tan_oangle_add_left_mul_norm_of_oangle_eq_pi_div_two Orientation.tan_oangle_add_left_mul_norm_of_oangle_eq_pi_div_two
theorem norm_div_cos_oangle_add_right_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : βxβ / Real.Angle.cos (o.oangle x (x + y)) = βx + yβ := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs, Real.Angle.cos_coe,
InnerProductGeometry.norm_div_cos_angle_add_of_inner_eq_zero
(o.inner_eq_zero_of_oangle_eq_pi_div_two h)
(Or.inl (o.left_ne_zero_of_oangle_eq_pi_div_two h))]
#align orientation.norm_div_cos_oangle_add_right_of_oangle_eq_pi_div_two Orientation.norm_div_cos_oangle_add_right_of_oangle_eq_pi_div_two
theorem norm_div_cos_oangle_add_left_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : βyβ / Real.Angle.cos (o.oangle (x + y) y) = βx + yβ := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).norm_div_cos_oangle_add_right_of_oangle_eq_pi_div_two h
#align orientation.norm_div_cos_oangle_add_left_of_oangle_eq_pi_div_two Orientation.norm_div_cos_oangle_add_left_of_oangle_eq_pi_div_two
theorem norm_div_sin_oangle_add_right_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : βyβ / Real.Angle.sin (o.oangle x (x + y)) = βx + yβ := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs, Real.Angle.sin_coe,
InnerProductGeometry.norm_div_sin_angle_add_of_inner_eq_zero
(o.inner_eq_zero_of_oangle_eq_pi_div_two h)
(Or.inr (o.right_ne_zero_of_oangle_eq_pi_div_two h))]
#align orientation.norm_div_sin_oangle_add_right_of_oangle_eq_pi_div_two Orientation.norm_div_sin_oangle_add_right_of_oangle_eq_pi_div_two
theorem norm_div_sin_oangle_add_left_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : βxβ / Real.Angle.sin (o.oangle (x + y) y) = βx + yβ := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).norm_div_sin_oangle_add_right_of_oangle_eq_pi_div_two h
#align orientation.norm_div_sin_oangle_add_left_of_oangle_eq_pi_div_two Orientation.norm_div_sin_oangle_add_left_of_oangle_eq_pi_div_two
theorem norm_div_tan_oangle_add_right_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : βyβ / Real.Angle.tan (o.oangle x (x + y)) = βxβ := by
have hs : (o.oangle x (x + y)).sign = 1 := by
rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs, Real.Angle.tan_coe,
InnerProductGeometry.norm_div_tan_angle_add_of_inner_eq_zero
(o.inner_eq_zero_of_oangle_eq_pi_div_two h)
(Or.inr (o.right_ne_zero_of_oangle_eq_pi_div_two h))]
#align orientation.norm_div_tan_oangle_add_right_of_oangle_eq_pi_div_two Orientation.norm_div_tan_oangle_add_right_of_oangle_eq_pi_div_two
theorem norm_div_tan_oangle_add_left_of_oangle_eq_pi_div_two {x y : V}
(h : o.oangle x y = β(Ο / 2)) : βxβ / Real.Angle.tan (o.oangle (x + y) y) = βyβ := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
rw [add_comm]
exact (-o).norm_div_tan_oangle_add_right_of_oangle_eq_pi_div_two h
#align orientation.norm_div_tan_oangle_add_left_of_oangle_eq_pi_div_two Orientation.norm_div_tan_oangle_add_left_of_oangle_eq_pi_div_two
theorem oangle_sub_right_eq_arccos_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle y (y - x) = Real.arccos (βyβ / βy - xβ) := by
have hs : (o.oangle y (y - x)).sign = 1 := by
rw [oangle_sign_sub_right_swap, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs,
InnerProductGeometry.angle_sub_eq_arccos_of_inner_eq_zero
(o.inner_rev_eq_zero_of_oangle_eq_pi_div_two h)]
#align orientation.oangle_sub_right_eq_arccos_of_oangle_eq_pi_div_two Orientation.oangle_sub_right_eq_arccos_of_oangle_eq_pi_div_two
theorem oangle_sub_left_eq_arccos_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle (x - y) x = Real.arccos (βxβ / βx - yβ) := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
exact (-o).oangle_sub_right_eq_arccos_of_oangle_eq_pi_div_two h
#align orientation.oangle_sub_left_eq_arccos_of_oangle_eq_pi_div_two Orientation.oangle_sub_left_eq_arccos_of_oangle_eq_pi_div_two
theorem oangle_sub_right_eq_arcsin_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle y (y - x) = Real.arcsin (βxβ / βy - xβ) := by
have hs : (o.oangle y (y - x)).sign = 1 := by
rw [oangle_sign_sub_right_swap, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs,
InnerProductGeometry.angle_sub_eq_arcsin_of_inner_eq_zero
(o.inner_rev_eq_zero_of_oangle_eq_pi_div_two h)
(Or.inl (o.right_ne_zero_of_oangle_eq_pi_div_two h))]
#align orientation.oangle_sub_right_eq_arcsin_of_oangle_eq_pi_div_two Orientation.oangle_sub_right_eq_arcsin_of_oangle_eq_pi_div_two
theorem oangle_sub_left_eq_arcsin_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle (x - y) x = Real.arcsin (βyβ / βx - yβ) := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
exact (-o).oangle_sub_right_eq_arcsin_of_oangle_eq_pi_div_two h
#align orientation.oangle_sub_left_eq_arcsin_of_oangle_eq_pi_div_two Orientation.oangle_sub_left_eq_arcsin_of_oangle_eq_pi_div_two
theorem oangle_sub_right_eq_arctan_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle y (y - x) = Real.arctan (βxβ / βyβ) := by
have hs : (o.oangle y (y - x)).sign = 1 := by
rw [oangle_sign_sub_right_swap, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs,
InnerProductGeometry.angle_sub_eq_arctan_of_inner_eq_zero
(o.inner_rev_eq_zero_of_oangle_eq_pi_div_two h) (o.right_ne_zero_of_oangle_eq_pi_div_two h)]
#align orientation.oangle_sub_right_eq_arctan_of_oangle_eq_pi_div_two Orientation.oangle_sub_right_eq_arctan_of_oangle_eq_pi_div_two
theorem oangle_sub_left_eq_arctan_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
o.oangle (x - y) x = Real.arctan (βyβ / βxβ) := by
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
exact (-o).oangle_sub_right_eq_arctan_of_oangle_eq_pi_div_two h
#align orientation.oangle_sub_left_eq_arctan_of_oangle_eq_pi_div_two Orientation.oangle_sub_left_eq_arctan_of_oangle_eq_pi_div_two
theorem cos_oangle_sub_right_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
Real.Angle.cos (o.oangle y (y - x)) = βyβ / βy - xβ := by
have hs : (o.oangle y (y - x)).sign = 1 := by
rw [oangle_sign_sub_right_swap, h, Real.Angle.sign_coe_pi_div_two]
rw [o.oangle_eq_angle_of_sign_eq_one hs, Real.Angle.cos_coe,
InnerProductGeometry.cos_angle_sub_of_inner_eq_zero
(o.inner_rev_eq_zero_of_oangle_eq_pi_div_two h)]
#align orientation.cos_oangle_sub_right_of_oangle_eq_pi_div_two Orientation.cos_oangle_sub_right_of_oangle_eq_pi_div_two
| Mathlib/Geometry/Euclidean/Angle/Oriented/RightAngle.lean | 331 | 334 | theorem cos_oangle_sub_left_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = β(Ο / 2)) :
Real.Angle.cos (o.oangle (x - y) x) = βxβ / βx - yβ := by |
rw [β neg_inj, oangle_rev, β oangle_neg_orientation_eq_neg, neg_inj] at h β’
exact (-o).cos_oangle_sub_right_of_oangle_eq_pi_div_two h
|
import Mathlib.MeasureTheory.Integral.Lebesgue
open Set hiding restrict restrict_apply
open Filter ENNReal NNReal MeasureTheory.Measure
namespace MeasureTheory
variable {Ξ± : Type*} {m0 : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±}
noncomputable
def Measure.withDensity {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (f : Ξ± β ββ₯0β) : Measure Ξ± :=
Measure.ofMeasurable (fun s _ => β«β» a in s, f a βΞΌ) (by simp) fun s hs hd =>
lintegral_iUnion hs hd _
#align measure_theory.measure.with_density MeasureTheory.Measure.withDensity
@[simp]
theorem withDensity_apply (f : Ξ± β ββ₯0β) {s : Set Ξ±} (hs : MeasurableSet s) :
ΞΌ.withDensity f s = β«β» a in s, f a βΞΌ :=
Measure.ofMeasurable_apply s hs
#align measure_theory.with_density_apply MeasureTheory.withDensity_apply
theorem withDensity_apply_le (f : Ξ± β ββ₯0β) (s : Set Ξ±) :
β«β» a in s, f a βΞΌ β€ ΞΌ.withDensity f s := by
let t := toMeasurable (ΞΌ.withDensity f) s
calc
β«β» a in s, f a βΞΌ β€ β«β» a in t, f a βΞΌ :=
lintegral_mono_set (subset_toMeasurable (withDensity ΞΌ f) s)
_ = ΞΌ.withDensity f t :=
(withDensity_apply f (measurableSet_toMeasurable (withDensity ΞΌ f) s)).symm
_ = ΞΌ.withDensity f s := measure_toMeasurable s
theorem withDensity_apply' [SFinite ΞΌ] (f : Ξ± β ββ₯0β) (s : Set Ξ±) :
ΞΌ.withDensity f s = β«β» a in s, f a βΞΌ := by
apply le_antisymm ?_ (withDensity_apply_le f s)
let t := toMeasurable ΞΌ s
calc
ΞΌ.withDensity f s β€ ΞΌ.withDensity f t := measure_mono (subset_toMeasurable ΞΌ s)
_ = β«β» a in t, f a βΞΌ := withDensity_apply f (measurableSet_toMeasurable ΞΌ s)
_ = β«β» a in s, f a βΞΌ := by congr 1; exact restrict_toMeasurable_of_sFinite s
@[simp]
lemma withDensity_zero_left (f : Ξ± β ββ₯0β) : (0 : Measure Ξ±).withDensity f = 0 := by
ext s hs
rw [withDensity_apply _ hs]
simp
theorem withDensity_congr_ae {f g : Ξ± β ββ₯0β} (h : f =α΅[ΞΌ] g) :
ΞΌ.withDensity f = ΞΌ.withDensity g := by
refine Measure.ext fun s hs => ?_
rw [withDensity_apply _ hs, withDensity_apply _ hs]
exact lintegral_congr_ae (ae_restrict_of_ae h)
#align measure_theory.with_density_congr_ae MeasureTheory.withDensity_congr_ae
lemma withDensity_mono {f g : Ξ± β ββ₯0β} (hfg : f β€α΅[ΞΌ] g) :
ΞΌ.withDensity f β€ ΞΌ.withDensity g := by
refine le_iff.2 fun s hs β¦ ?_
rw [withDensity_apply _ hs, withDensity_apply _ hs]
refine set_lintegral_mono_ae' hs ?_
filter_upwards [hfg] with x h_le using fun _ β¦ h_le
theorem withDensity_add_left {f : Ξ± β ββ₯0β} (hf : Measurable f) (g : Ξ± β ββ₯0β) :
ΞΌ.withDensity (f + g) = ΞΌ.withDensity f + ΞΌ.withDensity g := by
refine Measure.ext fun s hs => ?_
rw [withDensity_apply _ hs, Measure.add_apply, withDensity_apply _ hs, withDensity_apply _ hs,
β lintegral_add_left hf]
simp only [Pi.add_apply]
#align measure_theory.with_density_add_left MeasureTheory.withDensity_add_left
theorem withDensity_add_right (f : Ξ± β ββ₯0β) {g : Ξ± β ββ₯0β} (hg : Measurable g) :
ΞΌ.withDensity (f + g) = ΞΌ.withDensity f + ΞΌ.withDensity g := by
simpa only [add_comm] using withDensity_add_left hg f
#align measure_theory.with_density_add_right MeasureTheory.withDensity_add_right
theorem withDensity_add_measure {m : MeasurableSpace Ξ±} (ΞΌ Ξ½ : Measure Ξ±) (f : Ξ± β ββ₯0β) :
(ΞΌ + Ξ½).withDensity f = ΞΌ.withDensity f + Ξ½.withDensity f := by
ext1 s hs
simp only [withDensity_apply f hs, restrict_add, lintegral_add_measure, Measure.add_apply]
#align measure_theory.with_density_add_measure MeasureTheory.withDensity_add_measure
theorem withDensity_sum {ΞΉ : Type*} {m : MeasurableSpace Ξ±} (ΞΌ : ΞΉ β Measure Ξ±) (f : Ξ± β ββ₯0β) :
(sum ΞΌ).withDensity f = sum fun n => (ΞΌ n).withDensity f := by
ext1 s hs
simp_rw [sum_apply _ hs, withDensity_apply f hs, restrict_sum ΞΌ hs, lintegral_sum_measure]
#align measure_theory.with_density_sum MeasureTheory.withDensity_sum
theorem withDensity_smul (r : ββ₯0β) {f : Ξ± β ββ₯0β} (hf : Measurable f) :
ΞΌ.withDensity (r β’ f) = r β’ ΞΌ.withDensity f := by
refine Measure.ext fun s hs => ?_
rw [withDensity_apply _ hs, Measure.coe_smul, Pi.smul_apply, withDensity_apply _ hs,
smul_eq_mul, β lintegral_const_mul r hf]
simp only [Pi.smul_apply, smul_eq_mul]
#align measure_theory.with_density_smul MeasureTheory.withDensity_smul
theorem withDensity_smul' (r : ββ₯0β) (f : Ξ± β ββ₯0β) (hr : r β β) :
ΞΌ.withDensity (r β’ f) = r β’ ΞΌ.withDensity f := by
refine Measure.ext fun s hs => ?_
rw [withDensity_apply _ hs, Measure.coe_smul, Pi.smul_apply, withDensity_apply _ hs,
smul_eq_mul, β lintegral_const_mul' r f hr]
simp only [Pi.smul_apply, smul_eq_mul]
#align measure_theory.with_density_smul' MeasureTheory.withDensity_smul'
theorem withDensity_smul_measure (r : ββ₯0β) (f : Ξ± β ββ₯0β) :
(r β’ ΞΌ).withDensity f = r β’ ΞΌ.withDensity f := by
ext s hs
rw [withDensity_apply _ hs, Measure.coe_smul, Pi.smul_apply, withDensity_apply _ hs,
smul_eq_mul, set_lintegral_smul_measure]
theorem isFiniteMeasure_withDensity {f : Ξ± β ββ₯0β} (hf : β«β» a, f a βΞΌ β β) :
IsFiniteMeasure (ΞΌ.withDensity f) :=
{ measure_univ_lt_top := by
rwa [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ, lt_top_iff_ne_top] }
#align measure_theory.is_finite_measure_with_density MeasureTheory.isFiniteMeasure_withDensity
theorem withDensity_absolutelyContinuous {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (f : Ξ± β ββ₯0β) :
ΞΌ.withDensity f βͺ ΞΌ := by
refine AbsolutelyContinuous.mk fun s hsβ hsβ => ?_
rw [withDensity_apply _ hsβ]
exact set_lintegral_measure_zero _ _ hsβ
#align measure_theory.with_density_absolutely_continuous MeasureTheory.withDensity_absolutelyContinuous
@[simp]
theorem withDensity_zero : ΞΌ.withDensity 0 = 0 := by
ext1 s hs
simp [withDensity_apply _ hs]
#align measure_theory.with_density_zero MeasureTheory.withDensity_zero
@[simp]
theorem withDensity_one : ΞΌ.withDensity 1 = ΞΌ := by
ext1 s hs
simp [withDensity_apply _ hs]
#align measure_theory.with_density_one MeasureTheory.withDensity_one
@[simp]
theorem withDensity_const (c : ββ₯0β) : ΞΌ.withDensity (fun _ β¦ c) = c β’ ΞΌ := by
ext1 s hs
simp [withDensity_apply _ hs]
theorem withDensity_tsum {f : β β Ξ± β ββ₯0β} (h : β i, Measurable (f i)) :
ΞΌ.withDensity (β' n, f n) = sum fun n => ΞΌ.withDensity (f n) := by
ext1 s hs
simp_rw [sum_apply _ hs, withDensity_apply _ hs]
change β«β» x in s, (β' n, f n) x βΞΌ = β' i : β, β«β» x, f i x βΞΌ.restrict s
rw [β lintegral_tsum fun i => (h i).aemeasurable]
exact lintegral_congr fun x => tsum_apply (Pi.summable.2 fun _ => ENNReal.summable)
#align measure_theory.with_density_tsum MeasureTheory.withDensity_tsum
theorem withDensity_indicator {s : Set Ξ±} (hs : MeasurableSet s) (f : Ξ± β ββ₯0β) :
ΞΌ.withDensity (s.indicator f) = (ΞΌ.restrict s).withDensity f := by
ext1 t ht
rw [withDensity_apply _ ht, lintegral_indicator _ hs, restrict_comm hs, β
withDensity_apply _ ht]
#align measure_theory.with_density_indicator MeasureTheory.withDensity_indicator
theorem withDensity_indicator_one {s : Set Ξ±} (hs : MeasurableSet s) :
ΞΌ.withDensity (s.indicator 1) = ΞΌ.restrict s := by
rw [withDensity_indicator hs, withDensity_one]
#align measure_theory.with_density_indicator_one MeasureTheory.withDensity_indicator_one
theorem withDensity_ofReal_mutuallySingular {f : Ξ± β β} (hf : Measurable f) :
(ΞΌ.withDensity fun x => ENNReal.ofReal <| f x) ββ
ΞΌ.withDensity fun x => ENNReal.ofReal <| -f x := by
set S : Set Ξ± := { x | f x < 0 }
have hS : MeasurableSet S := measurableSet_lt hf measurable_const
refine β¨S, hS, ?_, ?_β©
Β· rw [withDensity_apply _ hS, lintegral_eq_zero_iff hf.ennreal_ofReal, EventuallyEq]
exact (ae_restrict_mem hS).mono fun x hx => ENNReal.ofReal_eq_zero.2 (le_of_lt hx)
Β· rw [withDensity_apply _ hS.compl, lintegral_eq_zero_iff hf.neg.ennreal_ofReal, EventuallyEq]
exact
(ae_restrict_mem hS.compl).mono fun x hx =>
ENNReal.ofReal_eq_zero.2 (not_lt.1 <| mt neg_pos.1 hx)
#align measure_theory.with_density_of_real_mutually_singular MeasureTheory.withDensity_ofReal_mutuallySingular
theorem restrict_withDensity {s : Set Ξ±} (hs : MeasurableSet s) (f : Ξ± β ββ₯0β) :
(ΞΌ.withDensity f).restrict s = (ΞΌ.restrict s).withDensity f := by
ext1 t ht
rw [restrict_apply ht, withDensity_apply _ ht, withDensity_apply _ (ht.inter hs),
restrict_restrict ht]
#align measure_theory.restrict_with_density MeasureTheory.restrict_withDensity
| Mathlib/MeasureTheory/Measure/WithDensity.lean | 216 | 220 | theorem restrict_withDensity' [SFinite ΞΌ] (s : Set Ξ±) (f : Ξ± β ββ₯0β) :
(ΞΌ.withDensity f).restrict s = (ΞΌ.restrict s).withDensity f := by |
ext1 t ht
rw [restrict_apply ht, withDensity_apply _ ht, withDensity_apply' _ (t β© s),
restrict_restrict ht]
|
import Mathlib.Data.Set.Subsingleton
import Mathlib.Logic.Equiv.Defs
import Mathlib.Algebra.Group.Defs
#align_import data.part from "leanprover-community/mathlib"@"80c43012d26f63026d362c3aba28f3c3bafb07e6"
open Function
structure Part.{u} (Ξ± : Type u) : Type u where
Dom : Prop
get : Dom β Ξ±
#align part Part
namespace Part
variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*}
def toOption (o : Part Ξ±) [Decidable o.Dom] : Option Ξ± :=
if h : Dom o then some (o.get h) else none
#align part.to_option Part.toOption
@[simp] lemma toOption_isSome (o : Part Ξ±) [Decidable o.Dom] : o.toOption.isSome β o.Dom := by
by_cases h : o.Dom <;> simp [h, toOption]
#align part.to_option_is_some Part.toOption_isSome
@[simp] lemma toOption_isNone (o : Part Ξ±) [Decidable o.Dom] : o.toOption.isNone β Β¬o.Dom := by
by_cases h : o.Dom <;> simp [h, toOption]
#align part.to_option_is_none Part.toOption_isNone
theorem ext' : β {o p : Part Ξ±}, (o.Dom β p.Dom) β (β hβ hβ, o.get hβ = p.get hβ) β o = p
| β¨od, oβ©, β¨pd, pβ©, H1, H2 => by
have t : od = pd := propext H1
cases t; rw [show o = p from funext fun p => H2 p p]
#align part.ext' Part.ext'
@[simp]
theorem eta : β o : Part Ξ±, (β¨o.Dom, fun h => o.get hβ© : Part Ξ±) = o
| β¨_, _β© => rfl
#align part.eta Part.eta
protected def Mem (a : Ξ±) (o : Part Ξ±) : Prop :=
β h, o.get h = a
#align part.mem Part.Mem
instance : Membership Ξ± (Part Ξ±) :=
β¨Part.Memβ©
theorem mem_eq (a : Ξ±) (o : Part Ξ±) : (a β o) = β h, o.get h = a :=
rfl
#align part.mem_eq Part.mem_eq
theorem dom_iff_mem : β {o : Part Ξ±}, o.Dom β β y, y β o
| β¨_, fβ© => β¨fun h => β¨f h, h, rflβ©, fun β¨_, h, rflβ© => hβ©
#align part.dom_iff_mem Part.dom_iff_mem
theorem get_mem {o : Part Ξ±} (h) : get o h β o :=
β¨_, rflβ©
#align part.get_mem Part.get_mem
@[simp]
theorem mem_mk_iff {p : Prop} {o : p β Ξ±} {a : Ξ±} : a β Part.mk p o β β h, o h = a :=
Iff.rfl
#align part.mem_mk_iff Part.mem_mk_iff
@[ext]
theorem ext {o p : Part Ξ±} (H : β a, a β o β a β p) : o = p :=
(ext' β¨fun h => ((H _).1 β¨h, rflβ©).fst, fun h => ((H _).2 β¨h, rflβ©).fstβ©) fun _ _ =>
((H _).2 β¨_, rflβ©).snd
#align part.ext Part.ext
def none : Part Ξ± :=
β¨False, False.recβ©
#align part.none Part.none
instance : Inhabited (Part Ξ±) :=
β¨noneβ©
@[simp]
theorem not_mem_none (a : Ξ±) : a β @none Ξ± := fun h => h.fst
#align part.not_mem_none Part.not_mem_none
def some (a : Ξ±) : Part Ξ± :=
β¨True, fun _ => aβ©
#align part.some Part.some
@[simp]
theorem some_dom (a : Ξ±) : (some a).Dom :=
trivial
#align part.some_dom Part.some_dom
theorem mem_unique : β {a b : Ξ±} {o : Part Ξ±}, a β o β b β o β a = b
| _, _, β¨_, _β©, β¨_, rflβ©, β¨_, rflβ© => rfl
#align part.mem_unique Part.mem_unique
theorem Mem.left_unique : Relator.LeftUnique ((Β· β Β·) : Ξ± β Part Ξ± β Prop) := fun _ _ _ =>
mem_unique
#align part.mem.left_unique Part.Mem.left_unique
theorem get_eq_of_mem {o : Part Ξ±} {a} (h : a β o) (h') : get o h' = a :=
mem_unique β¨_, rflβ© h
#align part.get_eq_of_mem Part.get_eq_of_mem
protected theorem subsingleton (o : Part Ξ±) : Set.Subsingleton { a | a β o } := fun _ ha _ hb =>
mem_unique ha hb
#align part.subsingleton Part.subsingleton
@[simp]
theorem get_some {a : Ξ±} (ha : (some a).Dom) : get (some a) ha = a :=
rfl
#align part.get_some Part.get_some
theorem mem_some (a : Ξ±) : a β some a :=
β¨trivial, rflβ©
#align part.mem_some Part.mem_some
@[simp]
theorem mem_some_iff {a b} : b β (some a : Part Ξ±) β b = a :=
β¨fun β¨_, eβ© => e.symm, fun e => β¨trivial, e.symmβ©β©
#align part.mem_some_iff Part.mem_some_iff
theorem eq_some_iff {a : Ξ±} {o : Part Ξ±} : o = some a β a β o :=
β¨fun e => e.symm βΈ mem_some _, fun β¨h, eβ© => e βΈ ext' (iff_true_intro h) fun _ _ => rflβ©
#align part.eq_some_iff Part.eq_some_iff
theorem eq_none_iff {o : Part Ξ±} : o = none β β a, a β o :=
β¨fun e => e.symm βΈ not_mem_none, fun h => ext (by simpa)β©
#align part.eq_none_iff Part.eq_none_iff
theorem eq_none_iff' {o : Part Ξ±} : o = none β Β¬o.Dom :=
β¨fun e => e.symm βΈ id, fun h => eq_none_iff.2 fun _ h' => h h'.fstβ©
#align part.eq_none_iff' Part.eq_none_iff'
@[simp]
theorem not_none_dom : Β¬(none : Part Ξ±).Dom :=
id
#align part.not_none_dom Part.not_none_dom
@[simp]
| Mathlib/Data/Part.lean | 192 | 194 | theorem some_ne_none (x : Ξ±) : some x β none := by |
intro h
exact true_ne_false (congr_arg Dom h)
|
import Mathlib.AlgebraicTopology.SimplexCategory
import Mathlib.CategoryTheory.Comma.Arrow
import Mathlib.CategoryTheory.Limits.FunctorCategory
import Mathlib.CategoryTheory.Opposites
#align_import algebraic_topology.simplicial_object from "leanprover-community/mathlib"@"5ed51dc37c6b891b79314ee11a50adc2b1df6fd6"
open Opposite
open CategoryTheory
open CategoryTheory.Limits
universe v u v' u'
namespace CategoryTheory
variable (C : Type u) [Category.{v} C]
-- porting note (#5171): removed @[nolint has_nonempty_instance]
def SimplicialObject :=
SimplexCategoryα΅α΅ β₯€ C
#align category_theory.simplicial_object CategoryTheory.SimplicialObject
@[simps!]
instance : Category (SimplicialObject C) := by
dsimp only [SimplicialObject]
infer_instance
namespace SimplicialObject
set_option quotPrecheck false in
scoped[Simplicial]
notation3:1000 X " _[" n "]" =>
(X : CategoryTheory.SimplicialObject _).obj (Opposite.op (SimplexCategory.mk n))
open Simplicial
instance {J : Type v} [SmallCategory J] [HasLimitsOfShape J C] :
HasLimitsOfShape J (SimplicialObject C) := by
dsimp [SimplicialObject]
infer_instance
instance [HasLimits C] : HasLimits (SimplicialObject C) :=
β¨inferInstanceβ©
instance {J : Type v} [SmallCategory J] [HasColimitsOfShape J C] :
HasColimitsOfShape J (SimplicialObject C) := by
dsimp [SimplicialObject]
infer_instance
instance [HasColimits C] : HasColimits (SimplicialObject C) :=
β¨inferInstanceβ©
variable {C}
-- Porting note (#10688): added to ease automation
@[ext]
lemma hom_ext {X Y : SimplicialObject C} (f g : X βΆ Y)
(h : β (n : SimplexCategoryα΅α΅), f.app n = g.app n) : f = g :=
NatTrans.ext _ _ (by ext; apply h)
variable (X : SimplicialObject C)
def Ξ΄ {n} (i : Fin (n + 2)) : X _[n + 1] βΆ X _[n] :=
X.map (SimplexCategory.Ξ΄ i).op
#align category_theory.simplicial_object.Ξ΄ CategoryTheory.SimplicialObject.Ξ΄
def Ο {n} (i : Fin (n + 1)) : X _[n] βΆ X _[n + 1] :=
X.map (SimplexCategory.Ο i).op
#align category_theory.simplicial_object.Ο CategoryTheory.SimplicialObject.Ο
def eqToIso {n m : β} (h : n = m) : X _[n] β
X _[m] :=
X.mapIso (CategoryTheory.eqToIso (by congr))
#align category_theory.simplicial_object.eq_to_iso CategoryTheory.SimplicialObject.eqToIso
@[simp]
| Mathlib/AlgebraicTopology/SimplicialObject.lean | 100 | 102 | theorem eqToIso_refl {n : β} (h : n = n) : X.eqToIso h = Iso.refl _ := by |
ext
simp [eqToIso]
|
import Mathlib.CategoryTheory.Sites.Sheaf
#align_import category_theory.sites.plus from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace CategoryTheory.GrothendieckTopology
open CategoryTheory
open CategoryTheory.Limits
open Opposite
universe w v u
variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C)
variable {D : Type w} [Category.{max v u} D]
noncomputable section
variable [β (P : Cα΅α΅ β₯€ D) (X : C) (S : J.Cover X), HasMultiequalizer (S.index P)]
variable (P : Cα΅α΅ β₯€ D)
@[simps]
def diagram (X : C) : (J.Cover X)α΅α΅ β₯€ D where
obj S := multiequalizer (S.unop.index P)
map {S _} f :=
Multiequalizer.lift _ _ (fun I => Multiequalizer.ΞΉ (S.unop.index P) (I.map f.unop)) fun I =>
Multiequalizer.condition (S.unop.index P) (I.map f.unop)
#align category_theory.grothendieck_topology.diagram CategoryTheory.GrothendieckTopology.diagram
@[simps]
def diagramPullback {X Y : C} (f : X βΆ Y) : J.diagram P Y βΆ (J.pullback f).op β J.diagram P X where
app S :=
Multiequalizer.lift _ _ (fun I => Multiequalizer.ΞΉ (S.unop.index P) I.base) fun I =>
Multiequalizer.condition (S.unop.index P) I.base
naturality S T f := Multiequalizer.hom_ext _ _ _ (fun I => by dsimp; simp; rfl)
#align category_theory.grothendieck_topology.diagram_pullback CategoryTheory.GrothendieckTopology.diagramPullback
@[simps]
def diagramNatTrans {P Q : Cα΅α΅ β₯€ D} (Ξ· : P βΆ Q) (X : C) : J.diagram P X βΆ J.diagram Q X where
app W :=
Multiequalizer.lift _ _ (fun i => Multiequalizer.ΞΉ _ _ β« Ξ·.app _) (fun i => by
dsimp only
erw [Category.assoc, Category.assoc, β Ξ·.naturality, β Ξ·.naturality,
Multiequalizer.condition_assoc]
rfl)
#align category_theory.grothendieck_topology.diagram_nat_trans CategoryTheory.GrothendieckTopology.diagramNatTrans
@[simp]
theorem diagramNatTrans_id (X : C) (P : Cα΅α΅ β₯€ D) :
J.diagramNatTrans (π P) X = π (J.diagram P X) := by
ext : 2
refine Multiequalizer.hom_ext _ _ _ (fun i => ?_)
dsimp
simp only [limit.lift_Ο, Multifork.ofΞΉ_pt, Multifork.ofΞΉ_Ο_app, Category.id_comp]
erw [Category.comp_id]
#align category_theory.grothendieck_topology.diagram_nat_trans_id CategoryTheory.GrothendieckTopology.diagramNatTrans_id
@[simp]
theorem diagramNatTrans_zero [Preadditive D] (X : C) (P Q : Cα΅α΅ β₯€ D) :
J.diagramNatTrans (0 : P βΆ Q) X = 0 := by
ext : 2
refine Multiequalizer.hom_ext _ _ _ (fun i => ?_)
dsimp
rw [zero_comp, Multiequalizer.lift_ΞΉ, comp_zero]
#align category_theory.grothendieck_topology.diagram_nat_trans_zero CategoryTheory.GrothendieckTopology.diagramNatTrans_zero
@[simp]
theorem diagramNatTrans_comp {P Q R : Cα΅α΅ β₯€ D} (Ξ· : P βΆ Q) (Ξ³ : Q βΆ R) (X : C) :
J.diagramNatTrans (Ξ· β« Ξ³) X = J.diagramNatTrans Ξ· X β« J.diagramNatTrans Ξ³ X := by
ext : 2
refine Multiequalizer.hom_ext _ _ _ (fun i => ?_)
dsimp
simp
#align category_theory.grothendieck_topology.diagram_nat_trans_comp CategoryTheory.GrothendieckTopology.diagramNatTrans_comp
variable (D)
@[simps]
def diagramFunctor (X : C) : (Cα΅α΅ β₯€ D) β₯€ (J.Cover X)α΅α΅ β₯€ D where
obj P := J.diagram P X
map Ξ· := J.diagramNatTrans Ξ· X
#align category_theory.grothendieck_topology.diagram_functor CategoryTheory.GrothendieckTopology.diagramFunctor
variable {D}
variable [β X : C, HasColimitsOfShape (J.Cover X)α΅α΅ D]
def plusObj : Cα΅α΅ β₯€ D where
obj X := colimit (J.diagram P X.unop)
map f := colimMap (J.diagramPullback P f.unop) β« colimit.pre _ _
map_id := by
intro X
refine colimit.hom_ext (fun S => ?_)
dsimp
simp only [diagramPullback_app, colimit.ΞΉ_pre, ΞΉ_colimMap_assoc, Category.comp_id]
let e := S.unop.pullbackId
dsimp only [Functor.op, pullback_obj]
erw [β colimit.w _ e.inv.op, β Category.assoc]
convert Category.id_comp (colimit.ΞΉ (diagram J P (unop X)) S)
refine Multiequalizer.hom_ext _ _ _ (fun I => ?_)
dsimp
simp only [Multiequalizer.lift_ΞΉ, Category.id_comp, Category.assoc]
dsimp [Cover.Arrow.map, Cover.Arrow.base]
cases I
congr
simp
map_comp := by
intro X Y Z f g
refine colimit.hom_ext (fun S => ?_)
dsimp
simp only [diagramPullback_app, colimit.ΞΉ_pre_assoc, colimit.ΞΉ_pre, ΞΉ_colimMap_assoc,
Category.assoc]
let e := S.unop.pullbackComp g.unop f.unop
dsimp only [Functor.op, pullback_obj]
erw [β colimit.w _ e.inv.op, β Category.assoc, β Category.assoc]
congr 1
refine Multiequalizer.hom_ext _ _ _ (fun I => ?_)
dsimp
simp only [Multiequalizer.lift_ΞΉ, Category.assoc]
cases I
dsimp only [Cover.Arrow.base, Cover.Arrow.map]
congr 2
simp
#align category_theory.grothendieck_topology.plus_obj CategoryTheory.GrothendieckTopology.plusObj
def plusMap {P Q : Cα΅α΅ β₯€ D} (Ξ· : P βΆ Q) : J.plusObj P βΆ J.plusObj Q where
app X := colimMap (J.diagramNatTrans Ξ· X.unop)
naturality := by
intro X Y f
dsimp [plusObj]
ext
simp only [diagramPullback_app, ΞΉ_colimMap, colimit.ΞΉ_pre_assoc, colimit.ΞΉ_pre,
ΞΉ_colimMap_assoc, Category.assoc]
simp_rw [β Category.assoc]
congr 1
exact Multiequalizer.hom_ext _ _ _ (fun I => by dsimp; simp)
#align category_theory.grothendieck_topology.plus_map CategoryTheory.GrothendieckTopology.plusMap
@[simp]
theorem plusMap_id (P : Cα΅α΅ β₯€ D) : J.plusMap (π P) = π _ := by
ext : 2
dsimp only [plusMap, plusObj]
rw [J.diagramNatTrans_id, NatTrans.id_app]
ext
dsimp
simp
#align category_theory.grothendieck_topology.plus_map_id CategoryTheory.GrothendieckTopology.plusMap_id
@[simp]
theorem plusMap_zero [Preadditive D] (P Q : Cα΅α΅ β₯€ D) : J.plusMap (0 : P βΆ Q) = 0 := by
ext : 2
refine colimit.hom_ext (fun S => ?_)
erw [comp_zero, colimit.ΞΉ_map, J.diagramNatTrans_zero, zero_comp]
#align category_theory.grothendieck_topology.plus_map_zero CategoryTheory.GrothendieckTopology.plusMap_zero
@[simp, reassoc]
| Mathlib/CategoryTheory/Sites/Plus.lean | 182 | 186 | theorem plusMap_comp {P Q R : Cα΅α΅ β₯€ D} (Ξ· : P βΆ Q) (Ξ³ : Q βΆ R) :
J.plusMap (Ξ· β« Ξ³) = J.plusMap Ξ· β« J.plusMap Ξ³ := by |
ext : 2
refine colimit.hom_ext (fun S => ?_)
simp [plusMap, J.diagramNatTrans_comp]
|
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent
import Mathlib.Analysis.Normed.Group.Lemmas
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.AffineIsometry
import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace
import Mathlib.Analysis.NormedSpace.RieszLemma
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Topology.Algebra.Module.FiniteDimension
import Mathlib.Topology.Algebra.InfiniteSum.Module
import Mathlib.Topology.Instances.Matrix
#align_import analysis.normed_space.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057"
universe u v w x
noncomputable section
open Set FiniteDimensional TopologicalSpace Filter Asymptotics Classical Topology
NNReal Metric
section CompleteField
variable {π : Type u} [NontriviallyNormedField π] {E : Type v} [NormedAddCommGroup E]
[NormedSpace π E] {F : Type w} [NormedAddCommGroup F] [NormedSpace π F] {F' : Type x}
[AddCommGroup F'] [Module π F'] [TopologicalSpace F'] [TopologicalAddGroup F']
[ContinuousSMul π F'] [CompleteSpace π]
theorem ContinuousLinearMap.continuous_det : Continuous fun f : E βL[π] E => f.det := by
change Continuous fun f : E βL[π] E => LinearMap.det (f : E ββ[π] E)
-- Porting note: this could be easier with `det_cases`
by_cases h : β s : Finset E, Nonempty (Basis (β₯s) π E)
Β· rcases h with β¨s, β¨bβ©β©
haveI : FiniteDimensional π E := FiniteDimensional.of_fintype_basis b
simp_rw [LinearMap.det_eq_det_toMatrix_of_finset b]
refine Continuous.matrix_det ?_
exact
((LinearMap.toMatrix b b).toLinearMap.comp
(ContinuousLinearMap.coeLM π)).continuous_of_finiteDimensional
Β· -- Porting note: was `unfold LinearMap.det`
rw [LinearMap.det_def]
simpa only [h, MonoidHom.one_apply, dif_neg, not_false_iff] using continuous_const
#align continuous_linear_map.continuous_det ContinuousLinearMap.continuous_det
irreducible_def lipschitzExtensionConstant (E' : Type*) [NormedAddCommGroup E'] [NormedSpace β E']
[FiniteDimensional β E'] : ββ₯0 :=
let A := (Basis.ofVectorSpace β E').equivFun.toContinuousLinearEquiv
max (βA.symm.toContinuousLinearMapββ * βA.toContinuousLinearMapββ) 1
#align lipschitz_extension_constant lipschitzExtensionConstant
theorem lipschitzExtensionConstant_pos (E' : Type*) [NormedAddCommGroup E'] [NormedSpace β E']
[FiniteDimensional β E'] : 0 < lipschitzExtensionConstant E' := by
rw [lipschitzExtensionConstant]
exact zero_lt_one.trans_le (le_max_right _ _)
#align lipschitz_extension_constant_pos lipschitzExtensionConstant_pos
theorem LipschitzOnWith.extend_finite_dimension {Ξ± : Type*} [PseudoMetricSpace Ξ±] {E' : Type*}
[NormedAddCommGroup E'] [NormedSpace β E'] [FiniteDimensional β E'] {s : Set Ξ±} {f : Ξ± β E'}
{K : ββ₯0} (hf : LipschitzOnWith K f s) :
β g : Ξ± β E', LipschitzWith (lipschitzExtensionConstant E' * K) g β§ EqOn f g s := by
let ΞΉ : Type _ := Basis.ofVectorSpaceIndex β E'
let A := (Basis.ofVectorSpace β E').equivFun.toContinuousLinearEquiv
have LA : LipschitzWith βA.toContinuousLinearMapββ A := by apply A.lipschitz
have L : LipschitzOnWith (βA.toContinuousLinearMapββ * K) (A β f) s :=
LA.comp_lipschitzOnWith hf
obtain β¨g, hg, gsβ© :
β g : Ξ± β ΞΉ β β, LipschitzWith (βA.toContinuousLinearMapββ * K) g β§ EqOn (A β f) g s :=
L.extend_pi
refine β¨A.symm β g, ?_, ?_β©
Β· have LAsymm : LipschitzWith βA.symm.toContinuousLinearMapββ A.symm := by
apply A.symm.lipschitz
apply (LAsymm.comp hg).weaken
rw [lipschitzExtensionConstant, β mul_assoc]
exact mul_le_mul' (le_max_left _ _) le_rfl
Β· intro x hx
have : A (f x) = g x := gs hx
simp only [(Β· β Β·), β this, A.symm_apply_apply]
#align lipschitz_on_with.extend_finite_dimension LipschitzOnWith.extend_finite_dimension
theorem LinearMap.exists_antilipschitzWith [FiniteDimensional π E] (f : E ββ[π] F)
(hf : LinearMap.ker f = β₯) : β K > 0, AntilipschitzWith K f := by
cases subsingleton_or_nontrivial E
Β· exact β¨1, zero_lt_one, AntilipschitzWith.of_subsingletonβ©
Β· rw [LinearMap.ker_eq_bot] at hf
let e : E βL[π] LinearMap.range f := (LinearEquiv.ofInjective f hf).toContinuousLinearEquiv
exact β¨_, e.nnnorm_symm_pos, e.antilipschitzβ©
#align linear_map.exists_antilipschitz_with LinearMap.exists_antilipschitzWith
open Function in
theorem LinearMap.injective_iff_antilipschitz [FiniteDimensional π E] (f : E ββ[π] F) :
Injective f β β K > 0, AntilipschitzWith K f := by
constructor
Β· rw [β LinearMap.ker_eq_bot]
exact f.exists_antilipschitzWith
Β· rintro β¨K, -, Hβ©
exact H.injective
open Function in
theorem ContinuousLinearMap.isOpen_injective [FiniteDimensional π E] :
IsOpen { L : E βL[π] F | Injective L } := by
rw [isOpen_iff_eventually]
rintro Οβ hΟβ
rcases Οβ.injective_iff_antilipschitz.mp hΟβ with β¨K, K_pos, Hβ©
have : βαΆ Ο in π Οβ, βΟ - Οβββ < Kβ»ΒΉ := eventually_nnnorm_sub_lt _ <| inv_pos_of_pos K_pos
filter_upwards [this] with Ο hΟ
apply Ο.injective_iff_antilipschitz.mpr
exact β¨(Kβ»ΒΉ - βΟ - Οβββ)β»ΒΉ, inv_pos_of_pos (tsub_pos_of_lt hΟ),
H.add_sub_lipschitzWith (Ο - Οβ).lipschitz hΟβ©
protected theorem LinearIndependent.eventually {ΞΉ} [Finite ΞΉ] {f : ΞΉ β E}
(hf : LinearIndependent π f) : βαΆ g in π f, LinearIndependent π g := by
cases nonempty_fintype ΞΉ
simp only [Fintype.linearIndependent_iff'] at hf β’
rcases LinearMap.exists_antilipschitzWith _ hf with β¨K, K0, hKβ©
have : Tendsto (fun g : ΞΉ β E => β i, βg i - f iβ) (π f) (π <| β i, βf i - f iβ) :=
tendsto_finset_sum _ fun i _ =>
Tendsto.norm <| ((continuous_apply i).tendsto _).sub tendsto_const_nhds
simp only [sub_self, norm_zero, Finset.sum_const_zero] at this
refine (this.eventually (gt_mem_nhds <| inv_pos.2 K0)).mono fun g hg => ?_
replace hg : β i, βg i - f iββ < Kβ»ΒΉ := by
rw [β NNReal.coe_lt_coe]
push_cast
exact hg
rw [LinearMap.ker_eq_bot]
refine (hK.add_sub_lipschitzWith (LipschitzWith.of_dist_le_mul fun v u => ?_) hg).injective
simp only [dist_eq_norm, LinearMap.lsum_apply, Pi.sub_apply, LinearMap.sum_apply,
LinearMap.comp_apply, LinearMap.proj_apply, LinearMap.smulRight_apply, LinearMap.id_apply, β
Finset.sum_sub_distrib, β smul_sub, β sub_smul, NNReal.coe_sum, coe_nnnorm, Finset.sum_mul]
refine norm_sum_le_of_le _ fun i _ => ?_
rw [norm_smul, mul_comm]
gcongr
exact norm_le_pi_norm (v - u) i
#align linear_independent.eventually LinearIndependent.eventually
theorem isOpen_setOf_linearIndependent {ΞΉ : Type*} [Finite ΞΉ] :
IsOpen { f : ΞΉ β E | LinearIndependent π f } :=
isOpen_iff_mem_nhds.2 fun _ => LinearIndependent.eventually
#align is_open_set_of_linear_independent isOpen_setOf_linearIndependent
theorem isOpen_setOf_nat_le_rank (n : β) :
IsOpen { f : E βL[π] F | βn β€ (f : E ββ[π] F).rank } := by
simp only [LinearMap.le_rank_iff_exists_linearIndependent_finset, setOf_exists, β exists_prop]
refine isOpen_biUnion fun t _ => ?_
have : Continuous fun f : E βL[π] F => fun x : (t : Set E) => f x :=
continuous_pi fun x => (ContinuousLinearMap.apply π F (x : E)).continuous
exact isOpen_setOf_linearIndependent.preimage this
#align is_open_set_of_nat_le_rank isOpen_setOf_nat_le_rank
theorem Basis.opNNNorm_le {ΞΉ : Type*} [Fintype ΞΉ] (v : Basis ΞΉ π E) {u : E βL[π] F} (M : ββ₯0)
(hu : β i, βu (v i)ββ β€ M) : βuββ β€ Fintype.card ΞΉ β’ βv.equivFunL.toContinuousLinearMapββ * M :=
u.opNNNorm_le_bound _ fun e => by
set Ο := v.equivFunL.toContinuousLinearMap
calc
βu eββ = βu (β i, v.equivFun e i β’ v i)ββ := by rw [v.sum_equivFun]
_ = ββ i, v.equivFun e i β’ (u <| v i)ββ := by simp [map_sum, LinearMap.map_smul]
_ β€ β i, βv.equivFun e i β’ (u <| v i)ββ := nnnorm_sum_le _ _
_ = β i, βv.equivFun e iββ * βu (v i)ββ := by simp only [nnnorm_smul]
_ β€ β i, βv.equivFun e iββ * M := by gcongr; apply hu
_ = (β i, βv.equivFun e iββ) * M := by rw [Finset.sum_mul]
_ β€ Fintype.card ΞΉ β’ (βΟββ * βeββ) * M := by
gcongr
calc
β i, βv.equivFun e iββ β€ Fintype.card ΞΉ β’ βΟ eββ := Pi.sum_nnnorm_apply_le_nnnorm _
_ β€ Fintype.card ΞΉ β’ (βΟββ * βeββ) := nsmul_le_nsmul_right (Ο.le_opNNNorm e) _
_ = Fintype.card ΞΉ β’ βΟββ * M * βeββ := by simp only [smul_mul_assoc, mul_right_comm]
#align basis.op_nnnorm_le Basis.opNNNorm_le
@[deprecated (since := "2024-02-02")] alias Basis.op_nnnorm_le := Basis.opNNNorm_le
theorem Basis.opNorm_le {ΞΉ : Type*} [Fintype ΞΉ] (v : Basis ΞΉ π E) {u : E βL[π] F} {M : β}
(hM : 0 β€ M) (hu : β i, βu (v i)β β€ M) :
βuβ β€ Fintype.card ΞΉ β’ βv.equivFunL.toContinuousLinearMapβ * M := by
simpa using NNReal.coe_le_coe.mpr (v.opNNNorm_le β¨M, hMβ© hu)
#align basis.op_norm_le Basis.opNorm_le
@[deprecated (since := "2024-02-02")] alias Basis.op_norm_le := Basis.opNorm_le
| Mathlib/Analysis/NormedSpace/FiniteDimension.lean | 326 | 332 | theorem Basis.exists_opNNNorm_le {ΞΉ : Type*} [Finite ΞΉ] (v : Basis ΞΉ π E) :
β C > (0 : ββ₯0), β {u : E βL[π] F} (M : ββ₯0), (β i, βu (v i)ββ β€ M) β βuββ β€ C * M := by |
cases nonempty_fintype ΞΉ
exact
β¨max (Fintype.card ΞΉ β’ βv.equivFunL.toContinuousLinearMapββ) 1,
zero_lt_one.trans_le (le_max_right _ _), fun {u} M hu =>
(v.opNNNorm_le M hu).trans <| mul_le_mul_of_nonneg_right (le_max_left _ _) (zero_le M)β©
|
import Mathlib.Data.ZMod.Basic
import Mathlib.GroupTheory.Index
import Mathlib.GroupTheory.GroupAction.ConjAct
import Mathlib.GroupTheory.GroupAction.Quotient
import Mathlib.GroupTheory.Perm.Cycle.Type
import Mathlib.GroupTheory.SpecificGroups.Cyclic
import Mathlib.Tactic.IntervalCases
#align_import group_theory.p_group from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
open Fintype MulAction
variable (p : β) (G : Type*) [Group G]
def IsPGroup : Prop :=
β g : G, β k : β, g ^ p ^ k = 1
#align is_p_group IsPGroup
variable {p} {G}
namespace IsPGroup
theorem iff_orderOf [hp : Fact p.Prime] : IsPGroup p G β β g : G, β k : β, orderOf g = p ^ k :=
forall_congr' fun g =>
β¨fun β¨k, hkβ© =>
Exists.imp (fun _ h => h.right)
((Nat.dvd_prime_pow hp.out).mp (orderOf_dvd_of_pow_eq_one hk)),
Exists.imp fun k hk => by rw [β hk, pow_orderOf_eq_one]β©
#align is_p_group.iff_order_of IsPGroup.iff_orderOf
theorem of_card [Fintype G] {n : β} (hG : card G = p ^ n) : IsPGroup p G := fun g =>
β¨n, by rw [β hG, pow_card_eq_one]β©
#align is_p_group.of_card IsPGroup.of_card
theorem of_bot : IsPGroup p (β₯ : Subgroup G) :=
of_card (by rw [β Nat.card_eq_fintype_card, Subgroup.card_bot, pow_zero])
#align is_p_group.of_bot IsPGroup.of_bot
theorem iff_card [Fact p.Prime] [Fintype G] : IsPGroup p G β β n : β, card G = p ^ n := by
have hG : card G β 0 := card_ne_zero
refine β¨fun h => ?_, fun β¨n, hnβ© => of_card hnβ©
suffices β q β Nat.factors (card G), q = p by
use (card G).factors.length
rw [β List.prod_replicate, β List.eq_replicate_of_mem this, Nat.prod_factors hG]
intro q hq
obtain β¨hq1, hq2β© := (Nat.mem_factors hG).mp hq
haveI : Fact q.Prime := β¨hq1β©
obtain β¨g, hgβ© := exists_prime_orderOf_dvd_card q hq2
obtain β¨k, hkβ© := (iff_orderOf.mp h) g
exact (hq1.pow_eq_iff.mp (hg.symm.trans hk).symm).1.symm
#align is_p_group.iff_card IsPGroup.iff_card
alias β¨exists_card_eq, _β© := iff_card
section GIsPGroup
variable (hG : IsPGroup p G)
theorem of_injective {H : Type*} [Group H] (Ο : H β* G) (hΟ : Function.Injective Ο) :
IsPGroup p H := by
simp_rw [IsPGroup, β hΟ.eq_iff, Ο.map_pow, Ο.map_one]
exact fun h => hG (Ο h)
#align is_p_group.of_injective IsPGroup.of_injective
theorem to_subgroup (H : Subgroup G) : IsPGroup p H :=
hG.of_injective H.subtype Subtype.coe_injective
#align is_p_group.to_subgroup IsPGroup.to_subgroup
| Mathlib/GroupTheory/PGroup.lean | 84 | 87 | theorem of_surjective {H : Type*} [Group H] (Ο : G β* H) (hΟ : Function.Surjective Ο) :
IsPGroup p H := by |
refine fun h => Exists.elim (hΟ h) fun g hg => Exists.imp (fun k hk => ?_) (hG g)
rw [β hg, β Ο.map_pow, hk, Ο.map_one]
|
import Mathlib.Analysis.Convex.Topology
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.Seminorm
import Mathlib.Analysis.LocallyConvex.Bounded
import Mathlib.Analysis.RCLike.Basic
#align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d"
open NormedField Set
open scoped Pointwise Topology NNReal
noncomputable section
variable {π E F : Type*}
section AddCommGroup
variable [AddCommGroup E] [Module β E]
def gauge (s : Set E) (x : E) : β :=
sInf { r : β | 0 < r β§ x β r β’ s }
#align gauge gauge
variable {s t : Set E} {x : E} {a : β}
theorem gauge_def : gauge s x = sInf ({ r β Set.Ioi (0 : β) | x β r β’ s }) :=
rfl
#align gauge_def gauge_def
theorem gauge_def' : gauge s x = sInf {r β Set.Ioi (0 : β) | rβ»ΒΉ β’ x β s} := by
congrm sInf {r | ?_}
exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ hr.ne' _ _
#align gauge_def' gauge_def'
private theorem gauge_set_bddBelow : BddBelow { r : β | 0 < r β§ x β r β’ s } :=
β¨0, fun _ hr => hr.1.leβ©
theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent β s) :
{ r : β | 0 < r β§ x β r β’ s }.Nonempty :=
let β¨r, hrβ, hrββ© := (absorbs x).exists_pos
β¨r, hrβ, hrβ r (Real.norm_of_nonneg hrβ.le).ge rflβ©
#align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty
theorem gauge_mono (hs : Absorbent β s) (h : s β t) : gauge t β€ gauge s := fun _ =>
csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => β¨hr.1, smul_set_mono h hr.2β©
#align gauge_mono gauge_mono
theorem exists_lt_of_gauge_lt (absorbs : Absorbent β s) (h : gauge s x < a) :
β b, 0 < b β§ b < a β§ x β b β’ s := by
obtain β¨b, β¨hb, hxβ©, hbaβ© := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h
exact β¨b, hb, hba, hxβ©
#align exists_lt_of_gauge_lt exists_lt_of_gauge_lt
@[simp]
theorem gauge_zero : gauge s 0 = 0 := by
rw [gauge_def']
by_cases h : (0 : E) β s
Β· simp only [smul_zero, sep_true, h, csInf_Ioi]
Β· simp only [smul_zero, sep_false, h, Real.sInf_empty]
#align gauge_zero gauge_zero
@[simp]
theorem gauge_zero' : gauge (0 : Set E) = 0 := by
ext x
rw [gauge_def']
obtain rfl | hx := eq_or_ne x 0
Β· simp only [csInf_Ioi, mem_zero, Pi.zero_apply, eq_self_iff_true, sep_true, smul_zero]
Β· simp only [mem_zero, Pi.zero_apply, inv_eq_zero, smul_eq_zero]
convert Real.sInf_empty
exact eq_empty_iff_forall_not_mem.2 fun r hr => hr.2.elim (ne_of_gt hr.1) hx
#align gauge_zero' gauge_zero'
@[simp]
theorem gauge_empty : gauge (β
: Set E) = 0 := by
ext
simp only [gauge_def', Real.sInf_empty, mem_empty_iff_false, Pi.zero_apply, sep_false]
#align gauge_empty gauge_empty
theorem gauge_of_subset_zero (h : s β 0) : gauge s = 0 := by
obtain rfl | rfl := subset_singleton_iff_eq.1 h
exacts [gauge_empty, gauge_zero']
#align gauge_of_subset_zero gauge_of_subset_zero
theorem gauge_nonneg (x : E) : 0 β€ gauge s x :=
Real.sInf_nonneg _ fun _ hx => hx.1.le
#align gauge_nonneg gauge_nonneg
theorem gauge_neg (symmetric : β x β s, -x β s) (x : E) : gauge s (-x) = gauge s x := by
have : β x, -x β s β x β s := fun x => β¨fun h => by simpa using symmetric _ h, symmetric xβ©
simp_rw [gauge_def', smul_neg, this]
#align gauge_neg gauge_neg
theorem gauge_neg_set_neg (x : E) : gauge (-s) (-x) = gauge s x := by
simp_rw [gauge_def', smul_neg, neg_mem_neg]
#align gauge_neg_set_neg gauge_neg_set_neg
| Mathlib/Analysis/Convex/Gauge.lean | 138 | 139 | theorem gauge_neg_set_eq_gauge_neg (x : E) : gauge (-s) x = gauge s (-x) := by |
rw [β gauge_neg_set_neg, neg_neg]
|
import Mathlib.Logic.Pairwise
import Mathlib.Order.CompleteBooleanAlgebra
import Mathlib.Order.Directed
import Mathlib.Order.GaloisConnection
#align_import data.set.lattice from "leanprover-community/mathlib"@"b86832321b586c6ac23ef8cdef6a7a27e42b13bd"
open Function Set
universe u
variable {Ξ± Ξ² Ξ³ : Type*} {ΞΉ ΞΉ' ΞΉβ : Sort*} {ΞΊ ΞΊβ ΞΊβ : ΞΉ β Sort*} {ΞΊ' : ΞΉ' β Sort*}
namespace Set
theorem mem_iUnionβ {x : Ξ³} {s : β i, ΞΊ i β Set Ξ³} : (x β β (i) (j), s i j) β β i j, x β s i j := by
simp_rw [mem_iUnion]
#align set.mem_Unionβ Set.mem_iUnionβ
theorem mem_iInterβ {x : Ξ³} {s : β i, ΞΊ i β Set Ξ³} : (x β β (i) (j), s i j) β β i j, x β s i j := by
simp_rw [mem_iInter]
#align set.mem_Interβ Set.mem_iInterβ
theorem mem_iUnion_of_mem {s : ΞΉ β Set Ξ±} {a : Ξ±} (i : ΞΉ) (ha : a β s i) : a β β i, s i :=
mem_iUnion.2 β¨i, haβ©
#align set.mem_Union_of_mem Set.mem_iUnion_of_mem
theorem mem_iUnionβ_of_mem {s : β i, ΞΊ i β Set Ξ±} {a : Ξ±} {i : ΞΉ} (j : ΞΊ i) (ha : a β s i j) :
a β β (i) (j), s i j :=
mem_iUnionβ.2 β¨i, j, haβ©
#align set.mem_Unionβ_of_mem Set.mem_iUnionβ_of_mem
theorem mem_iInter_of_mem {s : ΞΉ β Set Ξ±} {a : Ξ±} (h : β i, a β s i) : a β β i, s i :=
mem_iInter.2 h
#align set.mem_Inter_of_mem Set.mem_iInter_of_mem
theorem mem_iInterβ_of_mem {s : β i, ΞΊ i β Set Ξ±} {a : Ξ±} (h : β i j, a β s i j) :
a β β (i) (j), s i j :=
mem_iInterβ.2 h
#align set.mem_Interβ_of_mem Set.mem_iInterβ_of_mem
instance completeAtomicBooleanAlgebra : CompleteAtomicBooleanAlgebra (Set Ξ±) :=
{ instBooleanAlgebraSet with
le_sSup := fun s t t_in a a_in => β¨t, t_in, a_inβ©
sSup_le := fun s t h a β¨t', β¨t'_in, a_inβ©β© => h t' t'_in a_in
le_sInf := fun s t h a a_in t' t'_in => h t' t'_in a_in
sInf_le := fun s t t_in a h => h _ t_in
iInf_iSup_eq := by intros; ext; simp [Classical.skolem] }
instance : OrderTop (Set Ξ±) where
top := univ
le_top := by simp
@[congr]
theorem iUnion_congr_Prop {p q : Prop} {fβ : p β Set Ξ±} {fβ : q β Set Ξ±} (pq : p β q)
(f : β x, fβ (pq.mpr x) = fβ x) : iUnion fβ = iUnion fβ :=
iSup_congr_Prop pq f
#align set.Union_congr_Prop Set.iUnion_congr_Prop
@[congr]
theorem iInter_congr_Prop {p q : Prop} {fβ : p β Set Ξ±} {fβ : q β Set Ξ±} (pq : p β q)
(f : β x, fβ (pq.mpr x) = fβ x) : iInter fβ = iInter fβ :=
iInf_congr_Prop pq f
#align set.Inter_congr_Prop Set.iInter_congr_Prop
theorem iUnion_plift_up (f : PLift ΞΉ β Set Ξ±) : β i, f (PLift.up i) = β i, f i :=
iSup_plift_up _
#align set.Union_plift_up Set.iUnion_plift_up
theorem iUnion_plift_down (f : ΞΉ β Set Ξ±) : β i, f (PLift.down i) = β i, f i :=
iSup_plift_down _
#align set.Union_plift_down Set.iUnion_plift_down
theorem iInter_plift_up (f : PLift ΞΉ β Set Ξ±) : β i, f (PLift.up i) = β i, f i :=
iInf_plift_up _
#align set.Inter_plift_up Set.iInter_plift_up
theorem iInter_plift_down (f : ΞΉ β Set Ξ±) : β i, f (PLift.down i) = β i, f i :=
iInf_plift_down _
#align set.Inter_plift_down Set.iInter_plift_down
theorem iUnion_eq_if {p : Prop} [Decidable p] (s : Set Ξ±) : β _ : p, s = if p then s else β
:=
iSup_eq_if _
#align set.Union_eq_if Set.iUnion_eq_if
theorem iUnion_eq_dif {p : Prop} [Decidable p] (s : p β Set Ξ±) :
β h : p, s h = if h : p then s h else β
:=
iSup_eq_dif _
#align set.Union_eq_dif Set.iUnion_eq_dif
theorem iInter_eq_if {p : Prop} [Decidable p] (s : Set Ξ±) : β _ : p, s = if p then s else univ :=
iInf_eq_if _
#align set.Inter_eq_if Set.iInter_eq_if
theorem iInf_eq_dif {p : Prop} [Decidable p] (s : p β Set Ξ±) :
β h : p, s h = if h : p then s h else univ :=
_root_.iInf_eq_dif _
#align set.Infi_eq_dif Set.iInf_eq_dif
theorem exists_set_mem_of_union_eq_top {ΞΉ : Type*} (t : Set ΞΉ) (s : ΞΉ β Set Ξ²)
(w : β i β t, s i = β€) (x : Ξ²) : β i β t, x β s i := by
have p : x β β€ := Set.mem_univ x
rw [β w, Set.mem_iUnion] at p
simpa using p
#align set.exists_set_mem_of_union_eq_top Set.exists_set_mem_of_union_eq_top
theorem nonempty_of_union_eq_top_of_nonempty {ΞΉ : Type*} (t : Set ΞΉ) (s : ΞΉ β Set Ξ±)
(H : Nonempty Ξ±) (w : β i β t, s i = β€) : t.Nonempty := by
obtain β¨x, m, -β© := exists_set_mem_of_union_eq_top t s w H.some
exact β¨x, mβ©
#align set.nonempty_of_union_eq_top_of_nonempty Set.nonempty_of_union_eq_top_of_nonempty
theorem nonempty_of_nonempty_iUnion
{s : ΞΉ β Set Ξ±} (h_Union : (β i, s i).Nonempty) : Nonempty ΞΉ := by
obtain β¨x, hxβ© := h_Union
exact β¨Classical.choose <| mem_iUnion.mp hxβ©
theorem nonempty_of_nonempty_iUnion_eq_univ
{s : ΞΉ β Set Ξ±} [Nonempty Ξ±] (h_Union : β i, s i = univ) : Nonempty ΞΉ :=
nonempty_of_nonempty_iUnion (s := s) (by simpa only [h_Union] using univ_nonempty)
theorem setOf_exists (p : ΞΉ β Ξ² β Prop) : { x | β i, p i x } = β i, { x | p i x } :=
ext fun _ => mem_iUnion.symm
#align set.set_of_exists Set.setOf_exists
theorem setOf_forall (p : ΞΉ β Ξ² β Prop) : { x | β i, p i x } = β i, { x | p i x } :=
ext fun _ => mem_iInter.symm
#align set.set_of_forall Set.setOf_forall
theorem iUnion_subset {s : ΞΉ β Set Ξ±} {t : Set Ξ±} (h : β i, s i β t) : β i, s i β t :=
iSup_le h
#align set.Union_subset Set.iUnion_subset
theorem iUnionβ_subset {s : β i, ΞΊ i β Set Ξ±} {t : Set Ξ±} (h : β i j, s i j β t) :
β (i) (j), s i j β t :=
iUnion_subset fun x => iUnion_subset (h x)
#align set.Unionβ_subset Set.iUnionβ_subset
theorem subset_iInter {t : Set Ξ²} {s : ΞΉ β Set Ξ²} (h : β i, t β s i) : t β β i, s i :=
le_iInf h
#align set.subset_Inter Set.subset_iInter
theorem subset_iInterβ {s : Set Ξ±} {t : β i, ΞΊ i β Set Ξ±} (h : β i j, s β t i j) :
s β β (i) (j), t i j :=
subset_iInter fun x => subset_iInter <| h x
#align set.subset_Interβ Set.subset_iInterβ
@[simp]
theorem iUnion_subset_iff {s : ΞΉ β Set Ξ±} {t : Set Ξ±} : β i, s i β t β β i, s i β t :=
β¨fun h _ => Subset.trans (le_iSup s _) h, iUnion_subsetβ©
#align set.Union_subset_iff Set.iUnion_subset_iff
theorem iUnionβ_subset_iff {s : β i, ΞΊ i β Set Ξ±} {t : Set Ξ±} :
β (i) (j), s i j β t β β i j, s i j β t := by simp_rw [iUnion_subset_iff]
#align set.Unionβ_subset_iff Set.iUnionβ_subset_iff
@[simp]
theorem subset_iInter_iff {s : Set Ξ±} {t : ΞΉ β Set Ξ±} : (s β β i, t i) β β i, s β t i :=
le_iInf_iff
#align set.subset_Inter_iff Set.subset_iInter_iff
-- Porting note (#10618): removing `simp`. `simp` can prove it
theorem subset_iInterβ_iff {s : Set Ξ±} {t : β i, ΞΊ i β Set Ξ±} :
(s β β (i) (j), t i j) β β i j, s β t i j := by simp_rw [subset_iInter_iff]
#align set.subset_Interβ_iff Set.subset_iInterβ_iff
theorem subset_iUnion : β (s : ΞΉ β Set Ξ²) (i : ΞΉ), s i β β i, s i :=
le_iSup
#align set.subset_Union Set.subset_iUnion
theorem iInter_subset : β (s : ΞΉ β Set Ξ²) (i : ΞΉ), β i, s i β s i :=
iInf_le
#align set.Inter_subset Set.iInter_subset
theorem subset_iUnionβ {s : β i, ΞΊ i β Set Ξ±} (i : ΞΉ) (j : ΞΊ i) : s i j β β (i') (j'), s i' j' :=
le_iSupβ i j
#align set.subset_Unionβ Set.subset_iUnionβ
theorem iInterβ_subset {s : β i, ΞΊ i β Set Ξ±} (i : ΞΉ) (j : ΞΊ i) : β (i) (j), s i j β s i j :=
iInfβ_le i j
#align set.Interβ_subset Set.iInterβ_subset
theorem subset_iUnion_of_subset {s : Set Ξ±} {t : ΞΉ β Set Ξ±} (i : ΞΉ) (h : s β t i) : s β β i, t i :=
le_iSup_of_le i h
#align set.subset_Union_of_subset Set.subset_iUnion_of_subset
theorem iInter_subset_of_subset {s : ΞΉ β Set Ξ±} {t : Set Ξ±} (i : ΞΉ) (h : s i β t) :
β i, s i β t :=
iInf_le_of_le i h
#align set.Inter_subset_of_subset Set.iInter_subset_of_subset
theorem subset_iUnionβ_of_subset {s : Set Ξ±} {t : β i, ΞΊ i β Set Ξ±} (i : ΞΉ) (j : ΞΊ i)
(h : s β t i j) : s β β (i) (j), t i j :=
le_iSupβ_of_le i j h
#align set.subset_Unionβ_of_subset Set.subset_iUnionβ_of_subset
theorem iInterβ_subset_of_subset {s : β i, ΞΊ i β Set Ξ±} {t : Set Ξ±} (i : ΞΉ) (j : ΞΊ i)
(h : s i j β t) : β (i) (j), s i j β t :=
iInfβ_le_of_le i j h
#align set.Interβ_subset_of_subset Set.iInterβ_subset_of_subset
theorem iUnion_mono {s t : ΞΉ β Set Ξ±} (h : β i, s i β t i) : β i, s i β β i, t i :=
iSup_mono h
#align set.Union_mono Set.iUnion_mono
@[gcongr]
theorem iUnion_mono'' {s t : ΞΉ β Set Ξ±} (h : β i, s i β t i) : iUnion s β iUnion t :=
iSup_mono h
theorem iUnionβ_mono {s t : β i, ΞΊ i β Set Ξ±} (h : β i j, s i j β t i j) :
β (i) (j), s i j β β (i) (j), t i j :=
iSupβ_mono h
#align set.Unionβ_mono Set.iUnionβ_mono
theorem iInter_mono {s t : ΞΉ β Set Ξ±} (h : β i, s i β t i) : β i, s i β β i, t i :=
iInf_mono h
#align set.Inter_mono Set.iInter_mono
@[gcongr]
theorem iInter_mono'' {s t : ΞΉ β Set Ξ±} (h : β i, s i β t i) : iInter s β iInter t :=
iInf_mono h
theorem iInterβ_mono {s t : β i, ΞΊ i β Set Ξ±} (h : β i j, s i j β t i j) :
β (i) (j), s i j β β (i) (j), t i j :=
iInfβ_mono h
#align set.Interβ_mono Set.iInterβ_mono
theorem iUnion_mono' {s : ΞΉ β Set Ξ±} {t : ΞΉβ β Set Ξ±} (h : β i, β j, s i β t j) :
β i, s i β β i, t i :=
iSup_mono' h
#align set.Union_mono' Set.iUnion_mono'
theorem iUnionβ_mono' {s : β i, ΞΊ i β Set Ξ±} {t : β i', ΞΊ' i' β Set Ξ±}
(h : β i j, β i' j', s i j β t i' j') : β (i) (j), s i j β β (i') (j'), t i' j' :=
iSupβ_mono' h
#align set.Unionβ_mono' Set.iUnionβ_mono'
theorem iInter_mono' {s : ΞΉ β Set Ξ±} {t : ΞΉ' β Set Ξ±} (h : β j, β i, s i β t j) :
β i, s i β β j, t j :=
Set.subset_iInter fun j =>
let β¨i, hiβ© := h j
iInter_subset_of_subset i hi
#align set.Inter_mono' Set.iInter_mono'
theorem iInterβ_mono' {s : β i, ΞΊ i β Set Ξ±} {t : β i', ΞΊ' i' β Set Ξ±}
(h : β i' j', β i j, s i j β t i' j') : β (i) (j), s i j β β (i') (j'), t i' j' :=
subset_iInterβ_iff.2 fun i' j' =>
let β¨_, _, hstβ© := h i' j'
(iInterβ_subset _ _).trans hst
#align set.Interβ_mono' Set.iInterβ_mono'
theorem iUnionβ_subset_iUnion (ΞΊ : ΞΉ β Sort*) (s : ΞΉ β Set Ξ±) :
β (i) (_ : ΞΊ i), s i β β i, s i :=
iUnion_mono fun _ => iUnion_subset fun _ => Subset.rfl
#align set.Unionβ_subset_Union Set.iUnionβ_subset_iUnion
theorem iInter_subset_iInterβ (ΞΊ : ΞΉ β Sort*) (s : ΞΉ β Set Ξ±) :
β i, s i β β (i) (_ : ΞΊ i), s i :=
iInter_mono fun _ => subset_iInter fun _ => Subset.rfl
#align set.Inter_subset_Interβ Set.iInter_subset_iInterβ
theorem iUnion_setOf (P : ΞΉ β Ξ± β Prop) : β i, { x : Ξ± | P i x } = { x : Ξ± | β i, P i x } := by
ext
exact mem_iUnion
#align set.Union_set_of Set.iUnion_setOf
theorem iInter_setOf (P : ΞΉ β Ξ± β Prop) : β i, { x : Ξ± | P i x } = { x : Ξ± | β i, P i x } := by
ext
exact mem_iInter
#align set.Inter_set_of Set.iInter_setOf
theorem iUnion_congr_of_surjective {f : ΞΉ β Set Ξ±} {g : ΞΉβ β Set Ξ±} (h : ΞΉ β ΞΉβ) (h1 : Surjective h)
(h2 : β x, g (h x) = f x) : β x, f x = β y, g y :=
h1.iSup_congr h h2
#align set.Union_congr_of_surjective Set.iUnion_congr_of_surjective
theorem iInter_congr_of_surjective {f : ΞΉ β Set Ξ±} {g : ΞΉβ β Set Ξ±} (h : ΞΉ β ΞΉβ) (h1 : Surjective h)
(h2 : β x, g (h x) = f x) : β x, f x = β y, g y :=
h1.iInf_congr h h2
#align set.Inter_congr_of_surjective Set.iInter_congr_of_surjective
lemma iUnion_congr {s t : ΞΉ β Set Ξ±} (h : β i, s i = t i) : β i, s i = β i, t i := iSup_congr h
#align set.Union_congr Set.iUnion_congr
lemma iInter_congr {s t : ΞΉ β Set Ξ±} (h : β i, s i = t i) : β i, s i = β i, t i := iInf_congr h
#align set.Inter_congr Set.iInter_congr
lemma iUnionβ_congr {s t : β i, ΞΊ i β Set Ξ±} (h : β i j, s i j = t i j) :
β (i) (j), s i j = β (i) (j), t i j :=
iUnion_congr fun i => iUnion_congr <| h i
#align set.Unionβ_congr Set.iUnionβ_congr
lemma iInterβ_congr {s t : β i, ΞΊ i β Set Ξ±} (h : β i j, s i j = t i j) :
β (i) (j), s i j = β (i) (j), t i j :=
iInter_congr fun i => iInter_congr <| h i
#align set.Interβ_congr Set.iInterβ_congr
@[simp]
theorem compl_iUnion (s : ΞΉ β Set Ξ²) : (β i, s i)αΆ = β i, (s i)αΆ :=
compl_iSup
#align set.compl_Union Set.compl_iUnion
theorem compl_iUnionβ (s : β i, ΞΊ i β Set Ξ±) : (β (i) (j), s i j)αΆ = β (i) (j), (s i j)αΆ := by
simp_rw [compl_iUnion]
#align set.compl_Unionβ Set.compl_iUnionβ
@[simp]
theorem compl_iInter (s : ΞΉ β Set Ξ²) : (β i, s i)αΆ = β i, (s i)αΆ :=
compl_iInf
#align set.compl_Inter Set.compl_iInter
theorem compl_iInterβ (s : β i, ΞΊ i β Set Ξ±) : (β (i) (j), s i j)αΆ = β (i) (j), (s i j)αΆ := by
simp_rw [compl_iInter]
#align set.compl_Interβ Set.compl_iInterβ
-- classical -- complete_boolean_algebra
theorem iUnion_eq_compl_iInter_compl (s : ΞΉ β Set Ξ²) : β i, s i = (β i, (s i)αΆ)αΆ := by
simp only [compl_iInter, compl_compl]
#align set.Union_eq_compl_Inter_compl Set.iUnion_eq_compl_iInter_compl
-- classical -- complete_boolean_algebra
theorem iInter_eq_compl_iUnion_compl (s : ΞΉ β Set Ξ²) : β i, s i = (β i, (s i)αΆ)αΆ := by
simp only [compl_iUnion, compl_compl]
#align set.Inter_eq_compl_Union_compl Set.iInter_eq_compl_iUnion_compl
theorem inter_iUnion (s : Set Ξ²) (t : ΞΉ β Set Ξ²) : (s β© β i, t i) = β i, s β© t i :=
inf_iSup_eq _ _
#align set.inter_Union Set.inter_iUnion
theorem iUnion_inter (s : Set Ξ²) (t : ΞΉ β Set Ξ²) : (β i, t i) β© s = β i, t i β© s :=
iSup_inf_eq _ _
#align set.Union_inter Set.iUnion_inter
theorem iUnion_union_distrib (s : ΞΉ β Set Ξ²) (t : ΞΉ β Set Ξ²) :
β i, s i βͺ t i = (β i, s i) βͺ β i, t i :=
iSup_sup_eq
#align set.Union_union_distrib Set.iUnion_union_distrib
theorem iInter_inter_distrib (s : ΞΉ β Set Ξ²) (t : ΞΉ β Set Ξ²) :
β i, s i β© t i = (β i, s i) β© β i, t i :=
iInf_inf_eq
#align set.Inter_inter_distrib Set.iInter_inter_distrib
theorem union_iUnion [Nonempty ΞΉ] (s : Set Ξ²) (t : ΞΉ β Set Ξ²) : (s βͺ β i, t i) = β i, s βͺ t i :=
sup_iSup
#align set.union_Union Set.union_iUnion
theorem iUnion_union [Nonempty ΞΉ] (s : Set Ξ²) (t : ΞΉ β Set Ξ²) : (β i, t i) βͺ s = β i, t i βͺ s :=
iSup_sup
#align set.Union_union Set.iUnion_union
theorem inter_iInter [Nonempty ΞΉ] (s : Set Ξ²) (t : ΞΉ β Set Ξ²) : (s β© β i, t i) = β i, s β© t i :=
inf_iInf
#align set.inter_Inter Set.inter_iInter
theorem iInter_inter [Nonempty ΞΉ] (s : Set Ξ²) (t : ΞΉ β Set Ξ²) : (β i, t i) β© s = β i, t i β© s :=
iInf_inf
#align set.Inter_inter Set.iInter_inter
-- classical
theorem union_iInter (s : Set Ξ²) (t : ΞΉ β Set Ξ²) : (s βͺ β i, t i) = β i, s βͺ t i :=
sup_iInf_eq _ _
#align set.union_Inter Set.union_iInter
theorem iInter_union (s : ΞΉ β Set Ξ²) (t : Set Ξ²) : (β i, s i) βͺ t = β i, s i βͺ t :=
iInf_sup_eq _ _
#align set.Inter_union Set.iInter_union
theorem iUnion_diff (s : Set Ξ²) (t : ΞΉ β Set Ξ²) : (β i, t i) \ s = β i, t i \ s :=
iUnion_inter _ _
#align set.Union_diff Set.iUnion_diff
theorem diff_iUnion [Nonempty ΞΉ] (s : Set Ξ²) (t : ΞΉ β Set Ξ²) : (s \ β i, t i) = β i, s \ t i := by
rw [diff_eq, compl_iUnion, inter_iInter]; rfl
#align set.diff_Union Set.diff_iUnion
theorem diff_iInter (s : Set Ξ²) (t : ΞΉ β Set Ξ²) : (s \ β i, t i) = β i, s \ t i := by
rw [diff_eq, compl_iInter, inter_iUnion]; rfl
#align set.diff_Inter Set.diff_iInter
theorem iUnion_inter_subset {ΞΉ Ξ±} {s t : ΞΉ β Set Ξ±} : β i, s i β© t i β (β i, s i) β© β i, t i :=
le_iSup_inf_iSup s t
#align set.Union_inter_subset Set.iUnion_inter_subset
theorem iUnion_inter_of_monotone {ΞΉ Ξ±} [Preorder ΞΉ] [IsDirected ΞΉ (Β· β€ Β·)] {s t : ΞΉ β Set Ξ±}
(hs : Monotone s) (ht : Monotone t) : β i, s i β© t i = (β i, s i) β© β i, t i :=
iSup_inf_of_monotone hs ht
#align set.Union_inter_of_monotone Set.iUnion_inter_of_monotone
theorem iUnion_inter_of_antitone {ΞΉ Ξ±} [Preorder ΞΉ] [IsDirected ΞΉ (swap (Β· β€ Β·))] {s t : ΞΉ β Set Ξ±}
(hs : Antitone s) (ht : Antitone t) : β i, s i β© t i = (β i, s i) β© β i, t i :=
iSup_inf_of_antitone hs ht
#align set.Union_inter_of_antitone Set.iUnion_inter_of_antitone
theorem iInter_union_of_monotone {ΞΉ Ξ±} [Preorder ΞΉ] [IsDirected ΞΉ (swap (Β· β€ Β·))] {s t : ΞΉ β Set Ξ±}
(hs : Monotone s) (ht : Monotone t) : β i, s i βͺ t i = (β i, s i) βͺ β i, t i :=
iInf_sup_of_monotone hs ht
#align set.Inter_union_of_monotone Set.iInter_union_of_monotone
theorem iInter_union_of_antitone {ΞΉ Ξ±} [Preorder ΞΉ] [IsDirected ΞΉ (Β· β€ Β·)] {s t : ΞΉ β Set Ξ±}
(hs : Antitone s) (ht : Antitone t) : β i, s i βͺ t i = (β i, s i) βͺ β i, t i :=
iInf_sup_of_antitone hs ht
#align set.Inter_union_of_antitone Set.iInter_union_of_antitone
theorem iUnion_iInter_subset {s : ΞΉ β ΞΉ' β Set Ξ±} : (β j, β i, s i j) β β i, β j, s i j :=
iSup_iInf_le_iInf_iSup (flip s)
#align set.Union_Inter_subset Set.iUnion_iInter_subset
theorem iUnion_option {ΞΉ} (s : Option ΞΉ β Set Ξ±) : β o, s o = s none βͺ β i, s (some i) :=
iSup_option s
#align set.Union_option Set.iUnion_option
theorem iInter_option {ΞΉ} (s : Option ΞΉ β Set Ξ±) : β o, s o = s none β© β i, s (some i) :=
iInf_option s
#align set.Inter_option Set.iInter_option
section
variable (p : ΞΉ β Prop) [DecidablePred p]
theorem iUnion_dite (f : β i, p i β Set Ξ±) (g : β i, Β¬p i β Set Ξ±) :
β i, (if h : p i then f i h else g i h) = (β (i) (h : p i), f i h) βͺ β (i) (h : Β¬p i), g i h :=
iSup_dite _ _ _
#align set.Union_dite Set.iUnion_dite
theorem iUnion_ite (f g : ΞΉ β Set Ξ±) :
β i, (if p i then f i else g i) = (β (i) (_ : p i), f i) βͺ β (i) (_ : Β¬p i), g i :=
iUnion_dite _ _ _
#align set.Union_ite Set.iUnion_ite
theorem iInter_dite (f : β i, p i β Set Ξ±) (g : β i, Β¬p i β Set Ξ±) :
β i, (if h : p i then f i h else g i h) = (β (i) (h : p i), f i h) β© β (i) (h : Β¬p i), g i h :=
iInf_dite _ _ _
#align set.Inter_dite Set.iInter_dite
theorem iInter_ite (f g : ΞΉ β Set Ξ±) :
β i, (if p i then f i else g i) = (β (i) (_ : p i), f i) β© β (i) (_ : Β¬p i), g i :=
iInter_dite _ _ _
#align set.Inter_ite Set.iInter_ite
end
theorem image_projection_prod {ΞΉ : Type*} {Ξ± : ΞΉ β Type*} {v : β i : ΞΉ, Set (Ξ± i)}
(hv : (pi univ v).Nonempty) (i : ΞΉ) :
((fun x : β i : ΞΉ, Ξ± i => x i) '' β k, (fun x : β j : ΞΉ, Ξ± j => x k) β»ΒΉ' v k) = v i := by
classical
apply Subset.antisymm
Β· simp [iInter_subset]
Β· intro y y_in
simp only [mem_image, mem_iInter, mem_preimage]
rcases hv with β¨z, hzβ©
refine β¨Function.update z i y, ?_, update_same i y zβ©
rw [@forall_update_iff ΞΉ Ξ± _ z i y fun i t => t β v i]
exact β¨y_in, fun j _ => by simpa using hz jβ©
#align set.image_projection_prod Set.image_projection_prod
theorem iInter_false {s : False β Set Ξ±} : iInter s = univ :=
iInf_false
#align set.Inter_false Set.iInter_false
theorem iUnion_false {s : False β Set Ξ±} : iUnion s = β
:=
iSup_false
#align set.Union_false Set.iUnion_false
@[simp]
theorem iInter_true {s : True β Set Ξ±} : iInter s = s trivial :=
iInf_true
#align set.Inter_true Set.iInter_true
@[simp]
theorem iUnion_true {s : True β Set Ξ±} : iUnion s = s trivial :=
iSup_true
#align set.Union_true Set.iUnion_true
@[simp]
theorem iInter_exists {p : ΞΉ β Prop} {f : Exists p β Set Ξ±} :
β x, f x = β (i) (h : p i), f β¨i, hβ© :=
iInf_exists
#align set.Inter_exists Set.iInter_exists
@[simp]
theorem iUnion_exists {p : ΞΉ β Prop} {f : Exists p β Set Ξ±} :
β x, f x = β (i) (h : p i), f β¨i, hβ© :=
iSup_exists
#align set.Union_exists Set.iUnion_exists
@[simp]
theorem iUnion_empty : (β _ : ΞΉ, β
: Set Ξ±) = β
:=
iSup_bot
#align set.Union_empty Set.iUnion_empty
@[simp]
theorem iInter_univ : (β _ : ΞΉ, univ : Set Ξ±) = univ :=
iInf_top
#align set.Inter_univ Set.iInter_univ
section
variable {s : ΞΉ β Set Ξ±}
@[simp]
theorem iUnion_eq_empty : β i, s i = β
β β i, s i = β
:=
iSup_eq_bot
#align set.Union_eq_empty Set.iUnion_eq_empty
@[simp]
theorem iInter_eq_univ : β i, s i = univ β β i, s i = univ :=
iInf_eq_top
#align set.Inter_eq_univ Set.iInter_eq_univ
@[simp]
theorem nonempty_iUnion : (β i, s i).Nonempty β β i, (s i).Nonempty := by
simp [nonempty_iff_ne_empty]
#align set.nonempty_Union Set.nonempty_iUnion
-- Porting note (#10618): removing `simp`. `simp` can prove it
theorem nonempty_biUnion {t : Set Ξ±} {s : Ξ± β Set Ξ²} :
(β i β t, s i).Nonempty β β i β t, (s i).Nonempty := by simp
#align set.nonempty_bUnion Set.nonempty_biUnion
theorem iUnion_nonempty_index (s : Set Ξ±) (t : s.Nonempty β Set Ξ²) :
β h, t h = β x β s, t β¨x, βΉ_βΊβ© :=
iSup_exists
#align set.Union_nonempty_index Set.iUnion_nonempty_index
end
@[simp]
theorem iInter_iInter_eq_left {b : Ξ²} {s : β x : Ξ², x = b β Set Ξ±} :
β (x) (h : x = b), s x h = s b rfl :=
iInf_iInf_eq_left
#align set.Inter_Inter_eq_left Set.iInter_iInter_eq_left
@[simp]
theorem iInter_iInter_eq_right {b : Ξ²} {s : β x : Ξ², b = x β Set Ξ±} :
β (x) (h : b = x), s x h = s b rfl :=
iInf_iInf_eq_right
#align set.Inter_Inter_eq_right Set.iInter_iInter_eq_right
@[simp]
theorem iUnion_iUnion_eq_left {b : Ξ²} {s : β x : Ξ², x = b β Set Ξ±} :
β (x) (h : x = b), s x h = s b rfl :=
iSup_iSup_eq_left
#align set.Union_Union_eq_left Set.iUnion_iUnion_eq_left
@[simp]
theorem iUnion_iUnion_eq_right {b : Ξ²} {s : β x : Ξ², b = x β Set Ξ±} :
β (x) (h : b = x), s x h = s b rfl :=
iSup_iSup_eq_right
#align set.Union_Union_eq_right Set.iUnion_iUnion_eq_right
theorem iInter_or {p q : Prop} (s : p β¨ q β Set Ξ±) :
β h, s h = (β h : p, s (Or.inl h)) β© β h : q, s (Or.inr h) :=
iInf_or
#align set.Inter_or Set.iInter_or
theorem iUnion_or {p q : Prop} (s : p β¨ q β Set Ξ±) :
β h, s h = (β i, s (Or.inl i)) βͺ β j, s (Or.inr j) :=
iSup_or
#align set.Union_or Set.iUnion_or
theorem iUnion_and {p q : Prop} (s : p β§ q β Set Ξ±) : β h, s h = β (hp) (hq), s β¨hp, hqβ© :=
iSup_and
#align set.Union_and Set.iUnion_and
theorem iInter_and {p q : Prop} (s : p β§ q β Set Ξ±) : β h, s h = β (hp) (hq), s β¨hp, hqβ© :=
iInf_and
#align set.Inter_and Set.iInter_and
theorem iUnion_comm (s : ΞΉ β ΞΉ' β Set Ξ±) : β (i) (i'), s i i' = β (i') (i), s i i' :=
iSup_comm
#align set.Union_comm Set.iUnion_comm
theorem iInter_comm (s : ΞΉ β ΞΉ' β Set Ξ±) : β (i) (i'), s i i' = β (i') (i), s i i' :=
iInf_comm
#align set.Inter_comm Set.iInter_comm
theorem iUnion_sigma {Ξ³ : Ξ± β Type*} (s : Sigma Ξ³ β Set Ξ²) : β ia, s ia = β i, β a, s β¨i, aβ© :=
iSup_sigma
theorem iUnion_sigma' {Ξ³ : Ξ± β Type*} (s : β i, Ξ³ i β Set Ξ²) :
β i, β a, s i a = β ia : Sigma Ξ³, s ia.1 ia.2 :=
iSup_sigma' _
theorem iInter_sigma {Ξ³ : Ξ± β Type*} (s : Sigma Ξ³ β Set Ξ²) : β ia, s ia = β i, β a, s β¨i, aβ© :=
iInf_sigma
theorem iInter_sigma' {Ξ³ : Ξ± β Type*} (s : β i, Ξ³ i β Set Ξ²) :
β i, β a, s i a = β ia : Sigma Ξ³, s ia.1 ia.2 :=
iInf_sigma' _
theorem iUnionβ_comm (s : β iβ, ΞΊβ iβ β β iβ, ΞΊβ iβ β Set Ξ±) :
β (iβ) (jβ) (iβ) (jβ), s iβ jβ iβ jβ = β (iβ) (jβ) (iβ) (jβ), s iβ jβ iβ jβ :=
iSupβ_comm _
#align set.Unionβ_comm Set.iUnionβ_comm
theorem iInterβ_comm (s : β iβ, ΞΊβ iβ β β iβ, ΞΊβ iβ β Set Ξ±) :
β (iβ) (jβ) (iβ) (jβ), s iβ jβ iβ jβ = β (iβ) (jβ) (iβ) (jβ), s iβ jβ iβ jβ :=
iInfβ_comm _
#align set.Interβ_comm Set.iInterβ_comm
@[simp]
theorem biUnion_and (p : ΞΉ β Prop) (q : ΞΉ β ΞΉ' β Prop) (s : β x y, p x β§ q x y β Set Ξ±) :
β (x : ΞΉ) (y : ΞΉ') (h : p x β§ q x y), s x y h =
β (x : ΞΉ) (hx : p x) (y : ΞΉ') (hy : q x y), s x y β¨hx, hyβ© := by
simp only [iUnion_and, @iUnion_comm _ ΞΉ']
#align set.bUnion_and Set.biUnion_and
@[simp]
theorem biUnion_and' (p : ΞΉ' β Prop) (q : ΞΉ β ΞΉ' β Prop) (s : β x y, p y β§ q x y β Set Ξ±) :
β (x : ΞΉ) (y : ΞΉ') (h : p y β§ q x y), s x y h =
β (y : ΞΉ') (hy : p y) (x : ΞΉ) (hx : q x y), s x y β¨hy, hxβ© := by
simp only [iUnion_and, @iUnion_comm _ ΞΉ]
#align set.bUnion_and' Set.biUnion_and'
@[simp]
theorem biInter_and (p : ΞΉ β Prop) (q : ΞΉ β ΞΉ' β Prop) (s : β x y, p x β§ q x y β Set Ξ±) :
β (x : ΞΉ) (y : ΞΉ') (h : p x β§ q x y), s x y h =
β (x : ΞΉ) (hx : p x) (y : ΞΉ') (hy : q x y), s x y β¨hx, hyβ© := by
simp only [iInter_and, @iInter_comm _ ΞΉ']
#align set.bInter_and Set.biInter_and
@[simp]
theorem biInter_and' (p : ΞΉ' β Prop) (q : ΞΉ β ΞΉ' β Prop) (s : β x y, p y β§ q x y β Set Ξ±) :
β (x : ΞΉ) (y : ΞΉ') (h : p y β§ q x y), s x y h =
β (y : ΞΉ') (hy : p y) (x : ΞΉ) (hx : q x y), s x y β¨hy, hxβ© := by
simp only [iInter_and, @iInter_comm _ ΞΉ]
#align set.bInter_and' Set.biInter_and'
@[simp]
theorem iUnion_iUnion_eq_or_left {b : Ξ²} {p : Ξ² β Prop} {s : β x : Ξ², x = b β¨ p x β Set Ξ±} :
β (x) (h), s x h = s b (Or.inl rfl) βͺ β (x) (h : p x), s x (Or.inr h) := by
simp only [iUnion_or, iUnion_union_distrib, iUnion_iUnion_eq_left]
#align set.Union_Union_eq_or_left Set.iUnion_iUnion_eq_or_left
@[simp]
theorem iInter_iInter_eq_or_left {b : Ξ²} {p : Ξ² β Prop} {s : β x : Ξ², x = b β¨ p x β Set Ξ±} :
β (x) (h), s x h = s b (Or.inl rfl) β© β (x) (h : p x), s x (Or.inr h) := by
simp only [iInter_or, iInter_inter_distrib, iInter_iInter_eq_left]
#align set.Inter_Inter_eq_or_left Set.iInter_iInter_eq_or_left
theorem mem_biUnion {s : Set Ξ±} {t : Ξ± β Set Ξ²} {x : Ξ±} {y : Ξ²} (xs : x β s) (ytx : y β t x) :
y β β x β s, t x :=
mem_iUnionβ_of_mem xs ytx
#align set.mem_bUnion Set.mem_biUnion
theorem mem_biInter {s : Set Ξ±} {t : Ξ± β Set Ξ²} {y : Ξ²} (h : β x β s, y β t x) :
y β β x β s, t x :=
mem_iInterβ_of_mem h
#align set.mem_bInter Set.mem_biInter
theorem subset_biUnion_of_mem {s : Set Ξ±} {u : Ξ± β Set Ξ²} {x : Ξ±} (xs : x β s) :
u x β β x β s, u x :=
-- Porting note: Why is this not just `subset_iUnionβ x xs`?
@subset_iUnionβ Ξ² Ξ± (Β· β s) (fun i _ => u i) x xs
#align set.subset_bUnion_of_mem Set.subset_biUnion_of_mem
theorem biInter_subset_of_mem {s : Set Ξ±} {t : Ξ± β Set Ξ²} {x : Ξ±} (xs : x β s) :
β x β s, t x β t x :=
iInterβ_subset x xs
#align set.bInter_subset_of_mem Set.biInter_subset_of_mem
theorem biUnion_subset_biUnion_left {s s' : Set Ξ±} {t : Ξ± β Set Ξ²} (h : s β s') :
β x β s, t x β β x β s', t x :=
iUnionβ_subset fun _ hx => subset_biUnion_of_mem <| h hx
#align set.bUnion_subset_bUnion_left Set.biUnion_subset_biUnion_left
theorem biInter_subset_biInter_left {s s' : Set Ξ±} {t : Ξ± β Set Ξ²} (h : s' β s) :
β x β s, t x β β x β s', t x :=
subset_iInterβ fun _ hx => biInter_subset_of_mem <| h hx
#align set.bInter_subset_bInter_left Set.biInter_subset_biInter_left
theorem biUnion_mono {s s' : Set Ξ±} {t t' : Ξ± β Set Ξ²} (hs : s' β s) (h : β x β s, t x β t' x) :
β x β s', t x β β x β s, t' x :=
(biUnion_subset_biUnion_left hs).trans <| iUnionβ_mono h
#align set.bUnion_mono Set.biUnion_mono
theorem biInter_mono {s s' : Set Ξ±} {t t' : Ξ± β Set Ξ²} (hs : s β s') (h : β x β s, t x β t' x) :
β x β s', t x β β x β s, t' x :=
(biInter_subset_biInter_left hs).trans <| iInterβ_mono h
#align set.bInter_mono Set.biInter_mono
theorem biUnion_eq_iUnion (s : Set Ξ±) (t : β x β s, Set Ξ²) :
β x β s, t x βΉ_βΊ = β x : s, t x x.2 :=
iSup_subtype'
#align set.bUnion_eq_Union Set.biUnion_eq_iUnion
theorem biInter_eq_iInter (s : Set Ξ±) (t : β x β s, Set Ξ²) :
β x β s, t x βΉ_βΊ = β x : s, t x x.2 :=
iInf_subtype'
#align set.bInter_eq_Inter Set.biInter_eq_iInter
theorem iUnion_subtype (p : Ξ± β Prop) (s : { x // p x } β Set Ξ²) :
β x : { x // p x }, s x = β (x) (hx : p x), s β¨x, hxβ© :=
iSup_subtype
#align set.Union_subtype Set.iUnion_subtype
theorem iInter_subtype (p : Ξ± β Prop) (s : { x // p x } β Set Ξ²) :
β x : { x // p x }, s x = β (x) (hx : p x), s β¨x, hxβ© :=
iInf_subtype
#align set.Inter_subtype Set.iInter_subtype
theorem biInter_empty (u : Ξ± β Set Ξ²) : β x β (β
: Set Ξ±), u x = univ :=
iInf_emptyset
#align set.bInter_empty Set.biInter_empty
theorem biInter_univ (u : Ξ± β Set Ξ²) : β x β @univ Ξ±, u x = β x, u x :=
iInf_univ
#align set.bInter_univ Set.biInter_univ
@[simp]
theorem biUnion_self (s : Set Ξ±) : β x β s, s = s :=
Subset.antisymm (iUnionβ_subset fun _ _ => Subset.refl s) fun _ hx => mem_biUnion hx hx
#align set.bUnion_self Set.biUnion_self
@[simp]
theorem iUnion_nonempty_self (s : Set Ξ±) : β _ : s.Nonempty, s = s := by
rw [iUnion_nonempty_index, biUnion_self]
#align set.Union_nonempty_self Set.iUnion_nonempty_self
theorem biInter_singleton (a : Ξ±) (s : Ξ± β Set Ξ²) : β x β ({a} : Set Ξ±), s x = s a :=
iInf_singleton
#align set.bInter_singleton Set.biInter_singleton
theorem biInter_union (s t : Set Ξ±) (u : Ξ± β Set Ξ²) :
β x β s βͺ t, u x = (β x β s, u x) β© β x β t, u x :=
iInf_union
#align set.bInter_union Set.biInter_union
theorem biInter_insert (a : Ξ±) (s : Set Ξ±) (t : Ξ± β Set Ξ²) :
β x β insert a s, t x = t a β© β x β s, t x := by simp
#align set.bInter_insert Set.biInter_insert
theorem biInter_pair (a b : Ξ±) (s : Ξ± β Set Ξ²) : β x β ({a, b} : Set Ξ±), s x = s a β© s b := by
rw [biInter_insert, biInter_singleton]
#align set.bInter_pair Set.biInter_pair
theorem biInter_inter {ΞΉ Ξ± : Type*} {s : Set ΞΉ} (hs : s.Nonempty) (f : ΞΉ β Set Ξ±) (t : Set Ξ±) :
β i β s, f i β© t = (β i β s, f i) β© t := by
haveI : Nonempty s := hs.to_subtype
simp [biInter_eq_iInter, β iInter_inter]
#align set.bInter_inter Set.biInter_inter
theorem inter_biInter {ΞΉ Ξ± : Type*} {s : Set ΞΉ} (hs : s.Nonempty) (f : ΞΉ β Set Ξ±) (t : Set Ξ±) :
β i β s, t β© f i = t β© β i β s, f i := by
rw [inter_comm, β biInter_inter hs]
simp [inter_comm]
#align set.inter_bInter Set.inter_biInter
theorem biUnion_empty (s : Ξ± β Set Ξ²) : β x β (β
: Set Ξ±), s x = β
:=
iSup_emptyset
#align set.bUnion_empty Set.biUnion_empty
theorem biUnion_univ (s : Ξ± β Set Ξ²) : β x β @univ Ξ±, s x = β x, s x :=
iSup_univ
#align set.bUnion_univ Set.biUnion_univ
theorem biUnion_singleton (a : Ξ±) (s : Ξ± β Set Ξ²) : β x β ({a} : Set Ξ±), s x = s a :=
iSup_singleton
#align set.bUnion_singleton Set.biUnion_singleton
@[simp]
theorem biUnion_of_singleton (s : Set Ξ±) : β x β s, {x} = s :=
ext <| by simp
#align set.bUnion_of_singleton Set.biUnion_of_singleton
theorem biUnion_union (s t : Set Ξ±) (u : Ξ± β Set Ξ²) :
β x β s βͺ t, u x = (β x β s, u x) βͺ β x β t, u x :=
iSup_union
#align set.bUnion_union Set.biUnion_union
@[simp]
theorem iUnion_coe_set {Ξ± Ξ² : Type*} (s : Set Ξ±) (f : s β Set Ξ²) :
β i, f i = β i β s, f β¨i, βΉi β sβΊβ© :=
iUnion_subtype _ _
#align set.Union_coe_set Set.iUnion_coe_set
@[simp]
theorem iInter_coe_set {Ξ± Ξ² : Type*} (s : Set Ξ±) (f : s β Set Ξ²) :
β i, f i = β i β s, f β¨i, βΉi β sβΊβ© :=
iInter_subtype _ _
#align set.Inter_coe_set Set.iInter_coe_set
theorem biUnion_insert (a : Ξ±) (s : Set Ξ±) (t : Ξ± β Set Ξ²) :
β x β insert a s, t x = t a βͺ β x β s, t x := by simp
#align set.bUnion_insert Set.biUnion_insert
theorem biUnion_pair (a b : Ξ±) (s : Ξ± β Set Ξ²) : β x β ({a, b} : Set Ξ±), s x = s a βͺ s b := by
simp
#align set.bUnion_pair Set.biUnion_pair
theorem inter_iUnionβ (s : Set Ξ±) (t : β i, ΞΊ i β Set Ξ±) :
(s β© β (i) (j), t i j) = β (i) (j), s β© t i j := by simp only [inter_iUnion]
#align set.inter_Unionβ Set.inter_iUnionβ
theorem iUnionβ_inter (s : β i, ΞΊ i β Set Ξ±) (t : Set Ξ±) :
(β (i) (j), s i j) β© t = β (i) (j), s i j β© t := by simp_rw [iUnion_inter]
#align set.Unionβ_inter Set.iUnionβ_inter
theorem union_iInterβ (s : Set Ξ±) (t : β i, ΞΊ i β Set Ξ±) :
(s βͺ β (i) (j), t i j) = β (i) (j), s βͺ t i j := by simp_rw [union_iInter]
#align set.union_Interβ Set.union_iInterβ
theorem iInterβ_union (s : β i, ΞΊ i β Set Ξ±) (t : Set Ξ±) :
(β (i) (j), s i j) βͺ t = β (i) (j), s i j βͺ t := by simp_rw [iInter_union]
#align set.Interβ_union Set.iInterβ_union
theorem mem_sUnion_of_mem {x : Ξ±} {t : Set Ξ±} {S : Set (Set Ξ±)} (hx : x β t) (ht : t β S) :
x β ββS :=
β¨t, ht, hxβ©
#align set.mem_sUnion_of_mem Set.mem_sUnion_of_mem
-- is this theorem really necessary?
theorem not_mem_of_not_mem_sUnion {x : Ξ±} {t : Set Ξ±} {S : Set (Set Ξ±)} (hx : x β ββS)
(ht : t β S) : x β t := fun h => hx β¨t, ht, hβ©
#align set.not_mem_of_not_mem_sUnion Set.not_mem_of_not_mem_sUnion
theorem sInter_subset_of_mem {S : Set (Set Ξ±)} {t : Set Ξ±} (tS : t β S) : ββ S β t :=
sInf_le tS
#align set.sInter_subset_of_mem Set.sInter_subset_of_mem
theorem subset_sUnion_of_mem {S : Set (Set Ξ±)} {t : Set Ξ±} (tS : t β S) : t β ββS :=
le_sSup tS
#align set.subset_sUnion_of_mem Set.subset_sUnion_of_mem
theorem subset_sUnion_of_subset {s : Set Ξ±} (t : Set (Set Ξ±)) (u : Set Ξ±) (hβ : s β u)
(hβ : u β t) : s β ββt :=
Subset.trans hβ (subset_sUnion_of_mem hβ)
#align set.subset_sUnion_of_subset Set.subset_sUnion_of_subset
theorem sUnion_subset {S : Set (Set Ξ±)} {t : Set Ξ±} (h : β t' β S, t' β t) : ββS β t :=
sSup_le h
#align set.sUnion_subset Set.sUnion_subset
@[simp]
theorem sUnion_subset_iff {s : Set (Set Ξ±)} {t : Set Ξ±} : ββs β t β β t' β s, t' β t :=
sSup_le_iff
#align set.sUnion_subset_iff Set.sUnion_subset_iff
lemma sUnion_mono_subsets {s : Set (Set Ξ±)} {f : Set Ξ± β Set Ξ±} (hf : β t : Set Ξ±, t β f t) :
ββ s β ββ (f '' s) :=
fun _ β¨t, htx, hxtβ© β¦ β¨f t, mem_image_of_mem f htx, hf t hxtβ©
lemma sUnion_mono_supsets {s : Set (Set Ξ±)} {f : Set Ξ± β Set Ξ±} (hf : β t : Set Ξ±, f t β t) :
ββ (f '' s) β ββ s :=
-- If t β f '' s is arbitrary; t = f u for some u : Set Ξ±.
fun _ β¨_, β¨u, hus, hutβ©, hxtβ© β¦ β¨u, hus, (hut βΈ hf u) hxtβ©
theorem subset_sInter {S : Set (Set Ξ±)} {t : Set Ξ±} (h : β t' β S, t β t') : t β ββ S :=
le_sInf h
#align set.subset_sInter Set.subset_sInter
@[simp]
theorem subset_sInter_iff {S : Set (Set Ξ±)} {t : Set Ξ±} : t β ββ S β β t' β S, t β t' :=
le_sInf_iff
#align set.subset_sInter_iff Set.subset_sInter_iff
@[gcongr]
theorem sUnion_subset_sUnion {S T : Set (Set Ξ±)} (h : S β T) : ββS β ββT :=
sUnion_subset fun _ hs => subset_sUnion_of_mem (h hs)
#align set.sUnion_subset_sUnion Set.sUnion_subset_sUnion
@[gcongr]
theorem sInter_subset_sInter {S T : Set (Set Ξ±)} (h : S β T) : ββ T β ββ S :=
subset_sInter fun _ hs => sInter_subset_of_mem (h hs)
#align set.sInter_subset_sInter Set.sInter_subset_sInter
@[simp]
theorem sUnion_empty : βββ
= (β
: Set Ξ±) :=
sSup_empty
#align set.sUnion_empty Set.sUnion_empty
@[simp]
theorem sInter_empty : ββ β
= (univ : Set Ξ±) :=
sInf_empty
#align set.sInter_empty Set.sInter_empty
@[simp]
theorem sUnion_singleton (s : Set Ξ±) : ββ{s} = s :=
sSup_singleton
#align set.sUnion_singleton Set.sUnion_singleton
@[simp]
theorem sInter_singleton (s : Set Ξ±) : ββ {s} = s :=
sInf_singleton
#align set.sInter_singleton Set.sInter_singleton
@[simp]
theorem sUnion_eq_empty {S : Set (Set Ξ±)} : ββS = β
β β s β S, s = β
:=
sSup_eq_bot
#align set.sUnion_eq_empty Set.sUnion_eq_empty
@[simp]
theorem sInter_eq_univ {S : Set (Set Ξ±)} : ββ S = univ β β s β S, s = univ :=
sInf_eq_top
#align set.sInter_eq_univ Set.sInter_eq_univ
theorem subset_powerset_iff {s : Set (Set Ξ±)} {t : Set Ξ±} : s β π« t β ββ s β t :=
sUnion_subset_iff.symm
theorem sUnion_powerset_gc :
GaloisConnection (ββ Β· : Set (Set Ξ±) β Set Ξ±) (π« Β· : Set Ξ± β Set (Set Ξ±)) :=
gc_sSup_Iic
def sUnion_powerset_gi :
GaloisInsertion (ββ Β· : Set (Set Ξ±) β Set Ξ±) (π« Β· : Set Ξ± β Set (Set Ξ±)) :=
gi_sSup_Iic
theorem sUnion_mem_empty_univ {S : Set (Set Ξ±)} (h : S β {β
, univ}) :
ββ S β ({β
, univ} : Set (Set Ξ±)) := by
simp only [mem_insert_iff, mem_singleton_iff, or_iff_not_imp_left, sUnion_eq_empty, not_forall]
rintro β¨s, hs, hneβ©
obtain rfl : s = univ := (h hs).resolve_left hne
exact univ_subset_iff.1 <| subset_sUnion_of_mem hs
@[simp]
theorem nonempty_sUnion {S : Set (Set Ξ±)} : (ββS).Nonempty β β s β S, Set.Nonempty s := by
simp [nonempty_iff_ne_empty]
#align set.nonempty_sUnion Set.nonempty_sUnion
theorem Nonempty.of_sUnion {s : Set (Set Ξ±)} (h : (ββs).Nonempty) : s.Nonempty :=
let β¨s, hs, _β© := nonempty_sUnion.1 h
β¨s, hsβ©
#align set.nonempty.of_sUnion Set.Nonempty.of_sUnion
theorem Nonempty.of_sUnion_eq_univ [Nonempty Ξ±] {s : Set (Set Ξ±)} (h : ββs = univ) : s.Nonempty :=
Nonempty.of_sUnion <| h.symm βΈ univ_nonempty
#align set.nonempty.of_sUnion_eq_univ Set.Nonempty.of_sUnion_eq_univ
theorem sUnion_union (S T : Set (Set Ξ±)) : ββ(S βͺ T) = ββS βͺ ββT :=
sSup_union
#align set.sUnion_union Set.sUnion_union
theorem sInter_union (S T : Set (Set Ξ±)) : ββ (S βͺ T) = ββ S β© ββ T :=
sInf_union
#align set.sInter_union Set.sInter_union
@[simp]
theorem sUnion_insert (s : Set Ξ±) (T : Set (Set Ξ±)) : ββinsert s T = s βͺ ββT :=
sSup_insert
#align set.sUnion_insert Set.sUnion_insert
@[simp]
theorem sInter_insert (s : Set Ξ±) (T : Set (Set Ξ±)) : ββ insert s T = s β© ββ T :=
sInf_insert
#align set.sInter_insert Set.sInter_insert
@[simp]
theorem sUnion_diff_singleton_empty (s : Set (Set Ξ±)) : ββ(s \ {β
}) = ββs :=
sSup_diff_singleton_bot s
#align set.sUnion_diff_singleton_empty Set.sUnion_diff_singleton_empty
@[simp]
theorem sInter_diff_singleton_univ (s : Set (Set Ξ±)) : ββ (s \ {univ}) = ββ s :=
sInf_diff_singleton_top s
#align set.sInter_diff_singleton_univ Set.sInter_diff_singleton_univ
theorem sUnion_pair (s t : Set Ξ±) : ββ{s, t} = s βͺ t :=
sSup_pair
#align set.sUnion_pair Set.sUnion_pair
theorem sInter_pair (s t : Set Ξ±) : ββ {s, t} = s β© t :=
sInf_pair
#align set.sInter_pair Set.sInter_pair
@[simp]
theorem sUnion_image (f : Ξ± β Set Ξ²) (s : Set Ξ±) : ββ(f '' s) = β x β s, f x :=
sSup_image
#align set.sUnion_image Set.sUnion_image
@[simp]
theorem sInter_image (f : Ξ± β Set Ξ²) (s : Set Ξ±) : ββ (f '' s) = β x β s, f x :=
sInf_image
#align set.sInter_image Set.sInter_image
@[simp]
theorem sUnion_range (f : ΞΉ β Set Ξ²) : ββrange f = β x, f x :=
rfl
#align set.sUnion_range Set.sUnion_range
@[simp]
theorem sInter_range (f : ΞΉ β Set Ξ²) : ββ range f = β x, f x :=
rfl
#align set.sInter_range Set.sInter_range
theorem iUnion_eq_univ_iff {f : ΞΉ β Set Ξ±} : β i, f i = univ β β x, β i, x β f i := by
simp only [eq_univ_iff_forall, mem_iUnion]
#align set.Union_eq_univ_iff Set.iUnion_eq_univ_iff
theorem iUnionβ_eq_univ_iff {s : β i, ΞΊ i β Set Ξ±} :
β (i) (j), s i j = univ β β a, β i j, a β s i j := by
simp only [iUnion_eq_univ_iff, mem_iUnion]
#align set.Unionβ_eq_univ_iff Set.iUnionβ_eq_univ_iff
theorem sUnion_eq_univ_iff {c : Set (Set Ξ±)} : ββc = univ β β a, β b β c, a β b := by
simp only [eq_univ_iff_forall, mem_sUnion]
#align set.sUnion_eq_univ_iff Set.sUnion_eq_univ_iff
-- classical
theorem iInter_eq_empty_iff {f : ΞΉ β Set Ξ±} : β i, f i = β
β β x, β i, x β f i := by
simp [Set.eq_empty_iff_forall_not_mem]
#align set.Inter_eq_empty_iff Set.iInter_eq_empty_iff
-- classical
theorem iInterβ_eq_empty_iff {s : β i, ΞΊ i β Set Ξ±} :
β (i) (j), s i j = β
β β a, β i j, a β s i j := by
simp only [eq_empty_iff_forall_not_mem, mem_iInter, not_forall]
#align set.Interβ_eq_empty_iff Set.iInterβ_eq_empty_iff
-- classical
theorem sInter_eq_empty_iff {c : Set (Set Ξ±)} : ββ c = β
β β a, β b β c, a β b := by
simp [Set.eq_empty_iff_forall_not_mem]
#align set.sInter_eq_empty_iff Set.sInter_eq_empty_iff
-- classical
@[simp]
theorem nonempty_iInter {f : ΞΉ β Set Ξ±} : (β i, f i).Nonempty β β x, β i, x β f i := by
simp [nonempty_iff_ne_empty, iInter_eq_empty_iff]
#align set.nonempty_Inter Set.nonempty_iInter
-- classical
-- Porting note (#10618): removing `simp`. `simp` can prove it
theorem nonempty_iInterβ {s : β i, ΞΊ i β Set Ξ±} :
(β (i) (j), s i j).Nonempty β β a, β i j, a β s i j := by
simp
#align set.nonempty_Interβ Set.nonempty_iInterβ
-- classical
@[simp]
theorem nonempty_sInter {c : Set (Set Ξ±)} : (ββ c).Nonempty β β a, β b β c, a β b := by
simp [nonempty_iff_ne_empty, sInter_eq_empty_iff]
#align set.nonempty_sInter Set.nonempty_sInter
-- classical
theorem compl_sUnion (S : Set (Set Ξ±)) : (ββS)αΆ = ββ (compl '' S) :=
ext fun x => by simp
#align set.compl_sUnion Set.compl_sUnion
-- classical
theorem sUnion_eq_compl_sInter_compl (S : Set (Set Ξ±)) : ββS = (ββ (compl '' S))αΆ := by
rw [β compl_compl (ββS), compl_sUnion]
#align set.sUnion_eq_compl_sInter_compl Set.sUnion_eq_compl_sInter_compl
-- classical
theorem compl_sInter (S : Set (Set Ξ±)) : (ββ S)αΆ = ββ(compl '' S) := by
rw [sUnion_eq_compl_sInter_compl, compl_compl_image]
#align set.compl_sInter Set.compl_sInter
-- classical
theorem sInter_eq_compl_sUnion_compl (S : Set (Set Ξ±)) : ββ S = (ββ(compl '' S))αΆ := by
rw [β compl_compl (ββ S), compl_sInter]
#align set.sInter_eq_compl_sUnion_compl Set.sInter_eq_compl_sUnion_compl
theorem inter_empty_of_inter_sUnion_empty {s t : Set Ξ±} {S : Set (Set Ξ±)} (hs : t β S)
(h : s β© ββS = β
) : s β© t = β
:=
eq_empty_of_subset_empty <| by
rw [β h]; exact inter_subset_inter_right _ (subset_sUnion_of_mem hs)
#align set.inter_empty_of_inter_sUnion_empty Set.inter_empty_of_inter_sUnion_empty
theorem range_sigma_eq_iUnion_range {Ξ³ : Ξ± β Type*} (f : Sigma Ξ³ β Ξ²) :
range f = β a, range fun b => f β¨a, bβ© :=
Set.ext <| by simp
#align set.range_sigma_eq_Union_range Set.range_sigma_eq_iUnion_range
theorem iUnion_eq_range_sigma (s : Ξ± β Set Ξ²) : β i, s i = range fun a : Ξ£i, s i => a.2 := by
simp [Set.ext_iff]
#align set.Union_eq_range_sigma Set.iUnion_eq_range_sigma
theorem iUnion_eq_range_psigma (s : ΞΉ β Set Ξ²) : β i, s i = range fun a : Ξ£'i, s i => a.2 := by
simp [Set.ext_iff]
#align set.Union_eq_range_psigma Set.iUnion_eq_range_psigma
theorem iUnion_image_preimage_sigma_mk_eq_self {ΞΉ : Type*} {Ο : ΞΉ β Type*} (s : Set (Sigma Ο)) :
β i, Sigma.mk i '' (Sigma.mk i β»ΒΉ' s) = s := by
ext x
simp only [mem_iUnion, mem_image, mem_preimage]
constructor
Β· rintro β¨i, a, h, rflβ©
exact h
Β· intro h
cases' x with i a
exact β¨i, a, h, rflβ©
#align set.Union_image_preimage_sigma_mk_eq_self Set.iUnion_image_preimage_sigma_mk_eq_self
theorem Sigma.univ (X : Ξ± β Type*) : (Set.univ : Set (Ξ£a, X a)) = β a, range (Sigma.mk a) :=
Set.ext fun x =>
iff_of_true trivial β¨range (Sigma.mk x.1), Set.mem_range_self _, x.2, Sigma.eta xβ©
#align set.sigma.univ Set.Sigma.univ
alias sUnion_mono := sUnion_subset_sUnion
#align set.sUnion_mono Set.sUnion_mono
theorem iUnion_subset_iUnion_const {s : Set Ξ±} (h : ΞΉ β ΞΉβ) : β _ : ΞΉ, s β β _ : ΞΉβ, s :=
iSup_const_mono (Ξ± := Set Ξ±) h
#align set.Union_subset_Union_const Set.iUnion_subset_iUnion_const
@[simp]
theorem iUnion_singleton_eq_range {Ξ± Ξ² : Type*} (f : Ξ± β Ξ²) : β x : Ξ±, {f x} = range f := by
ext x
simp [@eq_comm _ x]
#align set.Union_singleton_eq_range Set.iUnion_singleton_eq_range
theorem iUnion_of_singleton (Ξ± : Type*) : (β x, {x} : Set Ξ±) = univ := by simp [Set.ext_iff]
#align set.Union_of_singleton Set.iUnion_of_singleton
theorem iUnion_of_singleton_coe (s : Set Ξ±) : β i : s, ({(i : Ξ±)} : Set Ξ±) = s := by simp
#align set.Union_of_singleton_coe Set.iUnion_of_singleton_coe
theorem sUnion_eq_biUnion {s : Set (Set Ξ±)} : ββs = β (i : Set Ξ±) (_ : i β s), i := by
rw [β sUnion_image, image_id']
#align set.sUnion_eq_bUnion Set.sUnion_eq_biUnion
theorem sInter_eq_biInter {s : Set (Set Ξ±)} : ββ s = β (i : Set Ξ±) (_ : i β s), i := by
rw [β sInter_image, image_id']
#align set.sInter_eq_bInter Set.sInter_eq_biInter
theorem sUnion_eq_iUnion {s : Set (Set Ξ±)} : ββs = β i : s, i := by
simp only [β sUnion_range, Subtype.range_coe]
#align set.sUnion_eq_Union Set.sUnion_eq_iUnion
theorem sInter_eq_iInter {s : Set (Set Ξ±)} : ββ s = β i : s, i := by
simp only [β sInter_range, Subtype.range_coe]
#align set.sInter_eq_Inter Set.sInter_eq_iInter
@[simp]
theorem iUnion_of_empty [IsEmpty ΞΉ] (s : ΞΉ β Set Ξ±) : β i, s i = β
:=
iSup_of_empty _
#align set.Union_of_empty Set.iUnion_of_empty
@[simp]
theorem iInter_of_empty [IsEmpty ΞΉ] (s : ΞΉ β Set Ξ±) : β i, s i = univ :=
iInf_of_empty _
#align set.Inter_of_empty Set.iInter_of_empty
theorem union_eq_iUnion {sβ sβ : Set Ξ±} : sβ βͺ sβ = β b : Bool, cond b sβ sβ :=
sup_eq_iSup sβ sβ
#align set.union_eq_Union Set.union_eq_iUnion
theorem inter_eq_iInter {sβ sβ : Set Ξ±} : sβ β© sβ = β b : Bool, cond b sβ sβ :=
inf_eq_iInf sβ sβ
#align set.inter_eq_Inter Set.inter_eq_iInter
theorem sInter_union_sInter {S T : Set (Set Ξ±)} :
ββ S βͺ ββ T = β p β S ΓΛ’ T, (p : Set Ξ± Γ Set Ξ±).1 βͺ p.2 :=
sInf_sup_sInf
#align set.sInter_union_sInter Set.sInter_union_sInter
theorem sUnion_inter_sUnion {s t : Set (Set Ξ±)} :
ββs β© ββt = β p β s ΓΛ’ t, (p : Set Ξ± Γ Set Ξ±).1 β© p.2 :=
sSup_inf_sSup
#align set.sUnion_inter_sUnion Set.sUnion_inter_sUnion
theorem biUnion_iUnion (s : ΞΉ β Set Ξ±) (t : Ξ± β Set Ξ²) :
β x β β i, s i, t x = β (i) (x β s i), t x := by simp [@iUnion_comm _ ΞΉ]
#align set.bUnion_Union Set.biUnion_iUnion
theorem biInter_iUnion (s : ΞΉ β Set Ξ±) (t : Ξ± β Set Ξ²) :
β x β β i, s i, t x = β (i) (x β s i), t x := by simp [@iInter_comm _ ΞΉ]
#align set.bInter_Union Set.biInter_iUnion
theorem sUnion_iUnion (s : ΞΉ β Set (Set Ξ±)) : βββ i, s i = β i, ββs i := by
simp only [sUnion_eq_biUnion, biUnion_iUnion]
#align set.sUnion_Union Set.sUnion_iUnion
theorem sInter_iUnion (s : ΞΉ β Set (Set Ξ±)) : ββ β i, s i = β i, ββ s i := by
simp only [sInter_eq_biInter, biInter_iUnion]
#align set.sInter_Union Set.sInter_iUnion
theorem iUnion_range_eq_sUnion {Ξ± Ξ² : Type*} (C : Set (Set Ξ±)) {f : β s : C, Ξ² β (s : Type _)}
(hf : β s : C, Surjective (f s)) : β y : Ξ², range (fun s : C => (f s y).val) = ββC := by
ext x; constructor
Β· rintro β¨s, β¨y, rflβ©, β¨s, hsβ©, rflβ©
refine β¨_, hs, ?_β©
exact (f β¨s, hsβ© y).2
Β· rintro β¨s, hs, hxβ©
cases' hf β¨s, hsβ© β¨x, hxβ© with y hy
refine β¨_, β¨y, rflβ©, β¨s, hsβ©, ?_β©
exact congr_arg Subtype.val hy
#align set.Union_range_eq_sUnion Set.iUnion_range_eq_sUnion
theorem iUnion_range_eq_iUnion (C : ΞΉ β Set Ξ±) {f : β x : ΞΉ, Ξ² β C x}
(hf : β x : ΞΉ, Surjective (f x)) : β y : Ξ², range (fun x : ΞΉ => (f x y).val) = β x, C x := by
ext x; rw [mem_iUnion, mem_iUnion]; constructor
Β· rintro β¨y, i, rflβ©
exact β¨i, (f i y).2β©
Β· rintro β¨i, hxβ©
cases' hf i β¨x, hxβ© with y hy
exact β¨y, i, congr_arg Subtype.val hyβ©
#align set.Union_range_eq_Union Set.iUnion_range_eq_iUnion
theorem union_distrib_iInter_left (s : ΞΉ β Set Ξ±) (t : Set Ξ±) : (t βͺ β i, s i) = β i, t βͺ s i :=
sup_iInf_eq _ _
#align set.union_distrib_Inter_left Set.union_distrib_iInter_left
theorem union_distrib_iInterβ_left (s : Set Ξ±) (t : β i, ΞΊ i β Set Ξ±) :
(s βͺ β (i) (j), t i j) = β (i) (j), s βͺ t i j := by simp_rw [union_distrib_iInter_left]
#align set.union_distrib_Interβ_left Set.union_distrib_iInterβ_left
theorem union_distrib_iInter_right (s : ΞΉ β Set Ξ±) (t : Set Ξ±) : (β i, s i) βͺ t = β i, s i βͺ t :=
iInf_sup_eq _ _
#align set.union_distrib_Inter_right Set.union_distrib_iInter_right
theorem union_distrib_iInterβ_right (s : β i, ΞΊ i β Set Ξ±) (t : Set Ξ±) :
(β (i) (j), s i j) βͺ t = β (i) (j), s i j βͺ t := by simp_rw [union_distrib_iInter_right]
#align set.union_distrib_Interβ_right Set.union_distrib_iInterβ_right
section Function
@[simp]
theorem mapsTo_sUnion {S : Set (Set Ξ±)} {t : Set Ξ²} {f : Ξ± β Ξ²} :
MapsTo f (ββ S) t β β s β S, MapsTo f s t :=
sUnion_subset_iff
#align set.maps_to_sUnion Set.mapsTo_sUnion
@[simp]
theorem mapsTo_iUnion {s : ΞΉ β Set Ξ±} {t : Set Ξ²} {f : Ξ± β Ξ²} :
MapsTo f (β i, s i) t β β i, MapsTo f (s i) t :=
iUnion_subset_iff
#align set.maps_to_Union Set.mapsTo_iUnion
theorem mapsTo_iUnionβ {s : β i, ΞΊ i β Set Ξ±} {t : Set Ξ²} {f : Ξ± β Ξ²} :
MapsTo f (β (i) (j), s i j) t β β i j, MapsTo f (s i j) t :=
iUnionβ_subset_iff
#align set.maps_to_Unionβ Set.mapsTo_iUnionβ
theorem mapsTo_iUnion_iUnion {s : ΞΉ β Set Ξ±} {t : ΞΉ β Set Ξ²} {f : Ξ± β Ξ²}
(H : β i, MapsTo f (s i) (t i)) : MapsTo f (β i, s i) (β i, t i) :=
mapsTo_iUnion.2 fun i β¦ (H i).mono_right (subset_iUnion t i)
#align set.maps_to_Union_Union Set.mapsTo_iUnion_iUnion
theorem mapsTo_iUnionβ_iUnionβ {s : β i, ΞΊ i β Set Ξ±} {t : β i, ΞΊ i β Set Ξ²} {f : Ξ± β Ξ²}
(H : β i j, MapsTo f (s i j) (t i j)) : MapsTo f (β (i) (j), s i j) (β (i) (j), t i j) :=
mapsTo_iUnion_iUnion fun i => mapsTo_iUnion_iUnion (H i)
#align set.maps_to_Unionβ_Unionβ Set.mapsTo_iUnionβ_iUnionβ
@[simp]
theorem mapsTo_sInter {s : Set Ξ±} {T : Set (Set Ξ²)} {f : Ξ± β Ξ²} :
MapsTo f s (ββ T) β β t β T, MapsTo f s t :=
forallβ_swap
#align set.maps_to_sInter Set.mapsTo_sInter
@[simp]
theorem mapsTo_iInter {s : Set Ξ±} {t : ΞΉ β Set Ξ²} {f : Ξ± β Ξ²} :
MapsTo f s (β i, t i) β β i, MapsTo f s (t i) :=
mapsTo_sInter.trans forall_mem_range
#align set.maps_to_Inter Set.mapsTo_iInter
theorem mapsTo_iInterβ {s : Set Ξ±} {t : β i, ΞΊ i β Set Ξ²} {f : Ξ± β Ξ²} :
MapsTo f s (β (i) (j), t i j) β β i j, MapsTo f s (t i j) := by
simp only [mapsTo_iInter]
#align set.maps_to_Interβ Set.mapsTo_iInterβ
theorem mapsTo_iInter_iInter {s : ΞΉ β Set Ξ±} {t : ΞΉ β Set Ξ²} {f : Ξ± β Ξ²}
(H : β i, MapsTo f (s i) (t i)) : MapsTo f (β i, s i) (β i, t i) :=
mapsTo_iInter.2 fun i => (H i).mono_left (iInter_subset s i)
#align set.maps_to_Inter_Inter Set.mapsTo_iInter_iInter
theorem mapsTo_iInterβ_iInterβ {s : β i, ΞΊ i β Set Ξ±} {t : β i, ΞΊ i β Set Ξ²} {f : Ξ± β Ξ²}
(H : β i j, MapsTo f (s i j) (t i j)) : MapsTo f (β (i) (j), s i j) (β (i) (j), t i j) :=
mapsTo_iInter_iInter fun i => mapsTo_iInter_iInter (H i)
#align set.maps_to_Interβ_Interβ Set.mapsTo_iInterβ_iInterβ
theorem image_iInter_subset (s : ΞΉ β Set Ξ±) (f : Ξ± β Ξ²) : (f '' β i, s i) β β i, f '' s i :=
(mapsTo_iInter_iInter fun i => mapsTo_image f (s i)).image_subset
#align set.image_Inter_subset Set.image_iInter_subset
theorem image_iInterβ_subset (s : β i, ΞΊ i β Set Ξ±) (f : Ξ± β Ξ²) :
(f '' β (i) (j), s i j) β β (i) (j), f '' s i j :=
(mapsTo_iInterβ_iInterβ fun i hi => mapsTo_image f (s i hi)).image_subset
#align set.image_Interβ_subset Set.image_iInterβ_subset
theorem image_sInter_subset (S : Set (Set Ξ±)) (f : Ξ± β Ξ²) : f '' ββ S β β s β S, f '' s := by
rw [sInter_eq_biInter]
apply image_iInterβ_subset
#align set.image_sInter_subset Set.image_sInter_subset
section
open Function
variable (s : Set Ξ²) {f : Ξ± β Ξ²} {U : ΞΉ β Set Ξ²} (hU : iUnion U = univ)
| Mathlib/Data/Set/Lattice.lean | 1,498 | 1,503 | theorem injective_iff_injective_of_iUnion_eq_univ :
Injective f β β i, Injective ((U i).restrictPreimage f) := by |
refine β¨fun H i => (U i).restrictPreimage_injective H, fun H x y e => ?_β©
obtain β¨i, hiβ© := Set.mem_iUnion.mp
(show f x β Set.iUnion U by rw [hU]; trivial)
injection @H i β¨x, hiβ© β¨y, show f y β U i from e βΈ hiβ© (Subtype.ext e)
|
import Mathlib.MeasureTheory.Function.SimpleFunc
import Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable
#align_import measure_theory.function.simple_func_dense from "leanprover-community/mathlib"@"7317149f12f55affbc900fc873d0d422485122b9"
open Set Function Filter TopologicalSpace ENNReal EMetric Finset
open scoped Classical
open Topology ENNReal MeasureTheory
variable {Ξ± Ξ² ΞΉ E F π : Type*}
noncomputable section
namespace MeasureTheory
local infixr:25 " ββ " => SimpleFunc
namespace SimpleFunc
variable [MeasurableSpace Ξ±] [PseudoEMetricSpace Ξ±] [OpensMeasurableSpace Ξ±]
noncomputable def nearestPtInd (e : β β Ξ±) : β β Ξ± ββ β
| 0 => const Ξ± 0
| N + 1 =>
piecewise (β k β€ N, { x | edist (e (N + 1)) x < edist (e k) x })
(MeasurableSet.iInter fun _ =>
MeasurableSet.iInter fun _ =>
measurableSet_lt measurable_edist_right measurable_edist_right)
(const Ξ± <| N + 1) (nearestPtInd e N)
#align measure_theory.simple_func.nearest_pt_ind MeasureTheory.SimpleFunc.nearestPtInd
noncomputable def nearestPt (e : β β Ξ±) (N : β) : Ξ± ββ Ξ± :=
(nearestPtInd e N).map e
#align measure_theory.simple_func.nearest_pt MeasureTheory.SimpleFunc.nearestPt
@[simp]
theorem nearestPtInd_zero (e : β β Ξ±) : nearestPtInd e 0 = const Ξ± 0 :=
rfl
#align measure_theory.simple_func.nearest_pt_ind_zero MeasureTheory.SimpleFunc.nearestPtInd_zero
@[simp]
theorem nearestPt_zero (e : β β Ξ±) : nearestPt e 0 = const Ξ± (e 0) :=
rfl
#align measure_theory.simple_func.nearest_pt_zero MeasureTheory.SimpleFunc.nearestPt_zero
theorem nearestPtInd_succ (e : β β Ξ±) (N : β) (x : Ξ±) :
nearestPtInd e (N + 1) x =
if β k β€ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else nearestPtInd e N x := by
simp only [nearestPtInd, coe_piecewise, Set.piecewise]
congr
simp
#align measure_theory.simple_func.nearest_pt_ind_succ MeasureTheory.SimpleFunc.nearestPtInd_succ
theorem nearestPtInd_le (e : β β Ξ±) (N : β) (x : Ξ±) : nearestPtInd e N x β€ N := by
induction' N with N ihN; Β· simp
simp only [nearestPtInd_succ]
split_ifs
exacts [le_rfl, ihN.trans N.le_succ]
#align measure_theory.simple_func.nearest_pt_ind_le MeasureTheory.SimpleFunc.nearestPtInd_le
theorem edist_nearestPt_le (e : β β Ξ±) (x : Ξ±) {k N : β} (hk : k β€ N) :
edist (nearestPt e N x) x β€ edist (e k) x := by
induction' N with N ihN generalizing k
Β· simp [nonpos_iff_eq_zero.1 hk, le_refl]
Β· simp only [nearestPt, nearestPtInd_succ, map_apply]
split_ifs with h
Β· rcases hk.eq_or_lt with (rfl | hk)
exacts [le_rfl, (h k (Nat.lt_succ_iff.1 hk)).le]
Β· push_neg at h
rcases h with β¨l, hlN, hxlβ©
rcases hk.eq_or_lt with (rfl | hk)
exacts [(ihN hlN).trans hxl, ihN (Nat.lt_succ_iff.1 hk)]
#align measure_theory.simple_func.edist_nearest_pt_le MeasureTheory.SimpleFunc.edist_nearestPt_le
theorem tendsto_nearestPt {e : β β Ξ±} {x : Ξ±} (hx : x β closure (range e)) :
Tendsto (fun N => nearestPt e N x) atTop (π x) := by
refine (atTop_basis.tendsto_iff nhds_basis_eball).2 fun Ξ΅ hΞ΅ => ?_
rcases EMetric.mem_closure_iff.1 hx Ξ΅ hΞ΅ with β¨_, β¨N, rflβ©, hNβ©
rw [edist_comm] at hN
exact β¨N, trivial, fun n hn => (edist_nearestPt_le e x hn).trans_lt hNβ©
#align measure_theory.simple_func.tendsto_nearest_pt MeasureTheory.SimpleFunc.tendsto_nearestPt
variable [MeasurableSpace Ξ²] {f : Ξ² β Ξ±}
noncomputable def approxOn (f : Ξ² β Ξ±) (hf : Measurable f) (s : Set Ξ±) (yβ : Ξ±) (hβ : yβ β s)
[SeparableSpace s] (n : β) : Ξ² ββ Ξ± :=
haveI : Nonempty s := β¨β¨yβ, hββ©β©
comp (nearestPt (fun k => Nat.casesOn k yβ ((β) β denseSeq s) : β β Ξ±) n) f hf
#align measure_theory.simple_func.approx_on MeasureTheory.SimpleFunc.approxOn
@[simp]
theorem approxOn_zero {f : Ξ² β Ξ±} (hf : Measurable f) {s : Set Ξ±} {yβ : Ξ±} (hβ : yβ β s)
[SeparableSpace s] (x : Ξ²) : approxOn f hf s yβ hβ 0 x = yβ :=
rfl
#align measure_theory.simple_func.approx_on_zero MeasureTheory.SimpleFunc.approxOn_zero
| Mathlib/MeasureTheory/Function/SimpleFuncDense.lean | 140 | 145 | theorem approxOn_mem {f : Ξ² β Ξ±} (hf : Measurable f) {s : Set Ξ±} {yβ : Ξ±} (hβ : yβ β s)
[SeparableSpace s] (n : β) (x : Ξ²) : approxOn f hf s yβ hβ n x β s := by |
haveI : Nonempty s := β¨β¨yβ, hββ©β©
suffices β n, (Nat.casesOn n yβ ((β) β denseSeq s) : Ξ±) β s by apply this
rintro (_ | n)
exacts [hβ, Subtype.mem _]
|
import Mathlib.Data.ENNReal.Inv
#align_import data.real.ennreal from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520"
open Set NNReal ENNReal
namespace ENNReal
section iInf
variable {ΞΉ : Sort*} {f g : ΞΉ β ββ₯0β}
variable {a b c d : ββ₯0β} {r p q : ββ₯0}
theorem toNNReal_iInf (hf : β i, f i β β) : (iInf f).toNNReal = β¨
i, (f i).toNNReal := by
cases isEmpty_or_nonempty ΞΉ
Β· rw [iInf_of_empty, top_toNNReal, NNReal.iInf_empty]
Β· lift f to ΞΉ β ββ₯0 using hf
simp_rw [β coe_iInf, toNNReal_coe]
#align ennreal.to_nnreal_infi ENNReal.toNNReal_iInf
theorem toNNReal_sInf (s : Set ββ₯0β) (hs : β r β s, r β β) :
(sInf s).toNNReal = sInf (ENNReal.toNNReal '' s) := by
have hf : β i, ((β) : s β ββ₯0β) i β β := fun β¨r, rsβ© => hs r rs
-- Porting note: `β sInf_image'` had to be replaced by `β image_eq_range` as the lemmas are used
-- in a different order.
simpa only [β sInf_range, β image_eq_range, Subtype.range_coe_subtype] using (toNNReal_iInf hf)
#align ennreal.to_nnreal_Inf ENNReal.toNNReal_sInf
theorem toNNReal_iSup (hf : β i, f i β β) : (iSup f).toNNReal = β¨ i, (f i).toNNReal := by
lift f to ΞΉ β ββ₯0 using hf
simp_rw [toNNReal_coe]
by_cases h : BddAbove (range f)
Β· rw [β coe_iSup h, toNNReal_coe]
Β· rw [NNReal.iSup_of_not_bddAbove h, iSup_coe_eq_top.2 h, top_toNNReal]
#align ennreal.to_nnreal_supr ENNReal.toNNReal_iSup
theorem toNNReal_sSup (s : Set ββ₯0β) (hs : β r β s, r β β) :
(sSup s).toNNReal = sSup (ENNReal.toNNReal '' s) := by
have hf : β i, ((β) : s β ββ₯0β) i β β := fun β¨r, rsβ© => hs r rs
-- Porting note: `β sSup_image'` had to be replaced by `β image_eq_range` as the lemmas are used
-- in a different order.
simpa only [β sSup_range, β image_eq_range, Subtype.range_coe_subtype] using (toNNReal_iSup hf)
#align ennreal.to_nnreal_Sup ENNReal.toNNReal_sSup
theorem toReal_iInf (hf : β i, f i β β) : (iInf f).toReal = β¨
i, (f i).toReal := by
simp only [ENNReal.toReal, toNNReal_iInf hf, NNReal.coe_iInf]
#align ennreal.to_real_infi ENNReal.toReal_iInf
theorem toReal_sInf (s : Set ββ₯0β) (hf : β r β s, r β β) :
(sInf s).toReal = sInf (ENNReal.toReal '' s) := by
simp only [ENNReal.toReal, toNNReal_sInf s hf, NNReal.coe_sInf, Set.image_image]
#align ennreal.to_real_Inf ENNReal.toReal_sInf
theorem toReal_iSup (hf : β i, f i β β) : (iSup f).toReal = β¨ i, (f i).toReal := by
simp only [ENNReal.toReal, toNNReal_iSup hf, NNReal.coe_iSup]
#align ennreal.to_real_supr ENNReal.toReal_iSup
theorem toReal_sSup (s : Set ββ₯0β) (hf : β r β s, r β β) :
(sSup s).toReal = sSup (ENNReal.toReal '' s) := by
simp only [ENNReal.toReal, toNNReal_sSup s hf, NNReal.coe_sSup, Set.image_image]
#align ennreal.to_real_Sup ENNReal.toReal_sSup
theorem iInf_add : iInf f + a = β¨
i, f i + a :=
le_antisymm (le_iInf fun _ => add_le_add (iInf_le _ _) <| le_rfl)
(tsub_le_iff_right.1 <| le_iInf fun _ => tsub_le_iff_right.2 <| iInf_le _ _)
#align ennreal.infi_add ENNReal.iInf_add
theorem iSup_sub : (β¨ i, f i) - a = β¨ i, f i - a :=
le_antisymm (tsub_le_iff_right.2 <| iSup_le fun i => tsub_le_iff_right.1 <| le_iSup (f Β· - a) i)
(iSup_le fun _ => tsub_le_tsub (le_iSup _ _) (le_refl a))
#align ennreal.supr_sub ENNReal.iSup_sub
| Mathlib/Data/ENNReal/Real.lean | 600 | 603 | theorem sub_iInf : (a - β¨
i, f i) = β¨ i, a - f i := by |
refine eq_of_forall_ge_iff fun c => ?_
rw [tsub_le_iff_right, add_comm, iInf_add]
simp [tsub_le_iff_right, sub_eq_add_neg, add_comm]
|
import Mathlib.Data.Nat.Choose.Basic
import Mathlib.Data.List.Perm
import Mathlib.Data.List.Range
#align_import data.list.sublists from "leanprover-community/mathlib"@"ccad6d5093bd2f5c6ca621fc74674cce51355af6"
universe u v w
variable {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w}
open Nat
namespace List
@[simp]
theorem sublists'_nil : sublists' (@nil Ξ±) = [[]] :=
rfl
#align list.sublists'_nil List.sublists'_nil
@[simp]
theorem sublists'_singleton (a : Ξ±) : sublists' [a] = [[], [a]] :=
rfl
#align list.sublists'_singleton List.sublists'_singleton
#noalign list.map_sublists'_aux
#noalign list.sublists'_aux_append
#noalign list.sublists'_aux_eq_sublists'
-- Porting note: Not the same as `sublists'_aux` from Lean3
def sublists'Aux (a : Ξ±) (rβ rβ : List (List Ξ±)) : List (List Ξ±) :=
rβ.foldl (init := rβ) fun r l => r ++ [a :: l]
#align list.sublists'_aux List.sublists'Aux
theorem sublists'Aux_eq_array_foldl (a : Ξ±) : β (rβ rβ : List (List Ξ±)),
sublists'Aux a rβ rβ = ((rβ.toArray).foldl (init := rβ.toArray)
(fun r l => r.push (a :: l))).toList := by
intro rβ rβ
rw [sublists'Aux, Array.foldl_eq_foldl_data]
have := List.foldl_hom Array.toList (fun r l => r.push (a :: l))
(fun r l => r ++ [a :: l]) rβ rβ.toArray (by simp)
simpa using this
theorem sublists'_eq_sublists'Aux (l : List Ξ±) :
sublists' l = l.foldr (fun a r => sublists'Aux a r r) [[]] := by
simp only [sublists', sublists'Aux_eq_array_foldl]
rw [β List.foldr_hom Array.toList]
Β· rfl
Β· intros _ _; congr <;> simp
theorem sublists'Aux_eq_map (a : Ξ±) (rβ : List (List Ξ±)) : β (rβ : List (List Ξ±)),
sublists'Aux a rβ rβ = rβ ++ map (cons a) rβ :=
List.reverseRecOn rβ (fun _ => by simp [sublists'Aux]) fun rβ l ih rβ => by
rw [map_append, map_singleton, β append_assoc, β ih, sublists'Aux, foldl_append, foldl]
simp [sublists'Aux]
-- Porting note: simp can prove `sublists'_singleton`
@[simp 900]
theorem sublists'_cons (a : Ξ±) (l : List Ξ±) :
sublists' (a :: l) = sublists' l ++ map (cons a) (sublists' l) := by
simp [sublists'_eq_sublists'Aux, foldr_cons, sublists'Aux_eq_map]
#align list.sublists'_cons List.sublists'_cons
@[simp]
theorem mem_sublists' {s t : List Ξ±} : s β sublists' t β s <+ t := by
induction' t with a t IH generalizing s
Β· simp only [sublists'_nil, mem_singleton]
exact β¨fun h => by rw [h], eq_nil_of_sublist_nilβ©
simp only [sublists'_cons, mem_append, IH, mem_map]
constructor <;> intro h
Β· rcases h with (h | β¨s, h, rflβ©)
Β· exact sublist_cons_of_sublist _ h
Β· exact h.cons_cons _
Β· cases' h with _ _ _ h s _ _ h
Β· exact Or.inl h
Β· exact Or.inr β¨s, h, rflβ©
#align list.mem_sublists' List.mem_sublists'
@[simp]
theorem length_sublists' : β l : List Ξ±, length (sublists' l) = 2 ^ length l
| [] => rfl
| a :: l => by
simp_arith only [sublists'_cons, length_append, length_sublists' l,
length_map, length, Nat.pow_succ']
#align list.length_sublists' List.length_sublists'
@[simp]
theorem sublists_nil : sublists (@nil Ξ±) = [[]] :=
rfl
#align list.sublists_nil List.sublists_nil
@[simp]
theorem sublists_singleton (a : Ξ±) : sublists [a] = [[], [a]] :=
rfl
#align list.sublists_singleton List.sublists_singleton
-- Porting note: Not the same as `sublists_aux` from Lean3
def sublistsAux (a : Ξ±) (r : List (List Ξ±)) : List (List Ξ±) :=
r.foldl (init := []) fun r l => r ++ [l, a :: l]
#align list.sublists_aux List.sublistsAux
theorem sublistsAux_eq_array_foldl :
sublistsAux = fun (a : Ξ±) (r : List (List Ξ±)) =>
(r.toArray.foldl (init := #[])
fun r l => (r.push l).push (a :: l)).toList := by
funext a r
simp only [sublistsAux, Array.foldl_eq_foldl_data, Array.mkEmpty]
have := foldl_hom Array.toList (fun r l => (r.push l).push (a :: l))
(fun (r : List (List Ξ±)) l => r ++ [l, a :: l]) r #[]
(by simp)
simpa using this
theorem sublistsAux_eq_bind :
sublistsAux = fun (a : Ξ±) (r : List (List Ξ±)) => r.bind fun l => [l, a :: l] :=
funext fun a => funext fun r =>
List.reverseRecOn r
(by simp [sublistsAux])
(fun r l ih => by
rw [append_bind, β ih, bind_singleton, sublistsAux, foldl_append]
simp [sublistsAux])
@[csimp] theorem sublists_eq_sublistsFast : @sublists = @sublistsFast := by
ext Ξ± l : 2
trans l.foldr sublistsAux [[]]
Β· rw [sublistsAux_eq_bind, sublists]
Β· simp only [sublistsFast, sublistsAux_eq_array_foldl, Array.foldr_eq_foldr_data]
rw [β foldr_hom Array.toList]
Β· rfl
Β· intros _ _; congr <;> simp
#noalign list.sublists_auxβ_eq_sublists_aux
#noalign list.sublists_aux_cons_eq_sublists_auxβ
#noalign list.sublists_aux_eq_foldr.aux
#noalign list.sublists_aux_eq_foldr
#noalign list.sublists_aux_cons_cons
#noalign list.sublists_auxβ_append
#noalign list.sublists_auxβ_concat
#noalign list.sublists_auxβ_bind
#noalign list.sublists_aux_cons_append
theorem sublists_append (lβ lβ : List Ξ±) :
sublists (lβ ++ lβ) = (sublists lβ) >>= (fun x => (sublists lβ).map (Β· ++ x)) := by
simp only [sublists, foldr_append]
induction lβ with
| nil => simp
| cons a lβ ih =>
rw [foldr_cons, ih]
simp [List.bind, join_join, Function.comp]
#align list.sublists_append List.sublists_append
-- Porting note (#10756): new theorem
theorem sublists_cons (a : Ξ±) (l : List Ξ±) :
sublists (a :: l) = sublists l >>= (fun x => [x, a :: x]) :=
show sublists ([a] ++ l) = _ by
rw [sublists_append]
simp only [sublists_singleton, map_cons, bind_eq_bind, nil_append, cons_append, map_nil]
@[simp]
| Mathlib/Data/List/Sublists.lean | 177 | 180 | theorem sublists_concat (l : List Ξ±) (a : Ξ±) :
sublists (l ++ [a]) = sublists l ++ map (fun x => x ++ [a]) (sublists l) := by |
rw [sublists_append, sublists_singleton, bind_eq_bind, cons_bind, cons_bind, nil_bind,
map_id'' append_nil, append_nil]
|
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.FractionalIdeal.Basic
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
open IsLocalization Pointwise nonZeroDivisors
namespace FractionalIdeal
open Set Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
section
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P ββ[R] P') {I : Submodule R P} :
IsFractional S I β IsFractional S (Submodule.map g.toLinearMap I)
| β¨a, a_nonzero, hIβ© =>
β¨a, a_nonzero, fun b hb => by
obtain β¨b', b'_mem, hb'β© := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain β¨x, hxβ© := hI b' b'_mem
use x
rw [β g.commutes, hx, g.map_smul, hb']β©
#align is_fractional.map IsFractional.map
def map (g : P ββ[R] P') : FractionalIdeal S P β FractionalIdeal S P' := fun I =>
β¨Submodule.map g.toLinearMap I, I.isFractional.map gβ©
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P ββ[R] P') (I : FractionalIdeal S P) :
β(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P ββ[R] P'} {y : P'} :
y β I.map g β β x, x β I β§ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P ββ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' ββ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
Β· rintro β¨_, β¨y, hy, rflβ©, rflβ©
exact β¨y, hy, (g.commutes y).symmβ©
Β· rintro β¨y, hy, rflβ©
exact β¨_, β¨y, hy, rflβ©, g.commutes yβ©
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g β€
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
exact coeToSubmodule_injective (Submodule.map_mul _ _ _)
#align fractional_ideal.map_mul FractionalIdeal.map_mul
@[simp]
theorem map_map_symm (g : P ββ[R] P') : (I.map (g : P ββ[R] P')).map (g.symm : P' ββ[R] P) = I := by
rw [β map_comp, g.symm_comp, map_id]
#align fractional_ideal.map_map_symm FractionalIdeal.map_map_symm
@[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ββ[R] P') :
(I.map (g.symm : P' ββ[R] P)).map (g : P ββ[R] P') = I := by
rw [β map_comp, g.comp_symm, map_id]
#align fractional_ideal.map_symm_map FractionalIdeal.map_symm_map
theorem map_mem_map {f : P ββ[R] P'} (h : Function.Injective f) {x : P} {I : FractionalIdeal S P} :
f x β map f I β x β I :=
mem_map.trans β¨fun β¨_, hx', x'_eqβ© => h x'_eq βΈ hx', fun h => β¨x, h, rflβ©β©
#align fractional_ideal.map_mem_map FractionalIdeal.map_mem_map
theorem map_injective (f : P ββ[R] P') (h : Function.Injective f) :
Function.Injective (map f : FractionalIdeal S P β FractionalIdeal S P') := fun _ _ hIJ =>
ext fun _ => (map_mem_map h).symm.trans (hIJ.symm βΈ map_mem_map h)
#align fractional_ideal.map_injective FractionalIdeal.map_injective
def mapEquiv (g : P ββ[R] P') : FractionalIdeal S P β+* FractionalIdeal S P' where
toFun := map g
invFun := map g.symm
map_add' I J := map_add I J _
map_mul' I J := map_mul I J _
left_inv I := by rw [β map_comp, AlgEquiv.symm_comp, map_id]
right_inv I := by rw [β map_comp, AlgEquiv.comp_symm, map_id]
#align fractional_ideal.map_equiv FractionalIdeal.mapEquiv
@[simp]
theorem coeFun_mapEquiv (g : P ββ[R] P') :
(mapEquiv g : FractionalIdeal S P β FractionalIdeal S P') = map g :=
rfl
#align fractional_ideal.coe_fun_map_equiv FractionalIdeal.coeFun_mapEquiv
@[simp]
theorem mapEquiv_apply (g : P ββ[R] P') (I : FractionalIdeal S P) : mapEquiv g I = map (βg) I :=
rfl
#align fractional_ideal.map_equiv_apply FractionalIdeal.mapEquiv_apply
@[simp]
theorem mapEquiv_symm (g : P ββ[R] P') :
((mapEquiv g).symm : FractionalIdeal S P' β+* _) = mapEquiv g.symm :=
rfl
#align fractional_ideal.map_equiv_symm FractionalIdeal.mapEquiv_symm
@[simp]
theorem mapEquiv_refl : mapEquiv AlgEquiv.refl = RingEquiv.refl (FractionalIdeal S P) :=
RingEquiv.ext fun x => by simp
#align fractional_ideal.map_equiv_refl FractionalIdeal.mapEquiv_refl
theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) β β a β S, β b : P, b β s β IsInteger R (a β’ b) :=
β¨fun β¨a, a_mem, hβ© => β¨a, a_mem, fun b hb => h b (subset_span hb)β©, fun β¨a, a_mem, hβ© =>
β¨a, a_mem, fun b hb =>
span_induction hb h
(by
rw [smul_zero]
exact isInteger_zero)
(fun x y hx hy => by
rw [smul_add]
exact isInteger_add hx hy)
fun s x hx => by
rw [smul_comm]
exact isInteger_smul hxβ©β©
#align fractional_ideal.is_fractional_span_iff FractionalIdeal.isFractional_span_iff
| Mathlib/RingTheory/FractionalIdeal/Operations.lean | 191 | 195 | theorem isFractional_of_fg {I : Submodule R P} (hI : I.FG) : IsFractional S I := by |
rcases hI with β¨I, rflβ©
rcases exist_integer_multiples_of_finset S I with β¨β¨s, hs1β©, hsβ©
rw [isFractional_span_iff]
exact β¨s, hs1, hsβ©
|
import Mathlib.Analysis.RCLike.Basic
import Mathlib.Dynamics.BirkhoffSum.Average
open Function Set Filter
open scoped Topology ENNReal Uniformity
section
variable {Ξ± E : Type*}
theorem Function.IsFixedPt.tendsto_birkhoffAverage
(R : Type*) [DivisionSemiring R] [CharZero R]
[AddCommMonoid E] [TopologicalSpace E] [Module R E]
{f : Ξ± β Ξ±} {x : Ξ±} (h : f.IsFixedPt x) (g : Ξ± β E) :
Tendsto (birkhoffAverage R f g Β· x) atTop (π (g x)) :=
tendsto_const_nhds.congr' <| (eventually_ne_atTop 0).mono fun _n hn β¦
(h.birkhoffAverage_eq R g hn).symm
variable [NormedAddCommGroup E]
theorem dist_birkhoffSum_apply_birkhoffSum (f : Ξ± β Ξ±) (g : Ξ± β E) (n : β) (x : Ξ±) :
dist (birkhoffSum f g n (f x)) (birkhoffSum f g n x) = dist (g (f^[n] x)) (g x) := by
simp only [dist_eq_norm, birkhoffSum_apply_sub_birkhoffSum]
theorem dist_birkhoffSum_birkhoffSum_le (f : Ξ± β Ξ±) (g : Ξ± β E) (n : β) (x y : Ξ±) :
dist (birkhoffSum f g n x) (birkhoffSum f g n y) β€
β k β Finset.range n, dist (g (f^[k] x)) (g (f^[k] y)) :=
dist_sum_sum_le _ _ _
variable (π : Type*) [RCLike π] [Module π E] [BoundedSMul π E]
theorem dist_birkhoffAverage_birkhoffAverage (f : Ξ± β Ξ±) (g : Ξ± β E) (n : β) (x y : Ξ±) :
dist (birkhoffAverage π f g n x) (birkhoffAverage π f g n y) =
dist (birkhoffSum f g n x) (birkhoffSum f g n y) / n := by
simp [birkhoffAverage, dist_smulβ, div_eq_inv_mul]
theorem dist_birkhoffAverage_birkhoffAverage_le (f : Ξ± β Ξ±) (g : Ξ± β E) (n : β) (x y : Ξ±) :
dist (birkhoffAverage π f g n x) (birkhoffAverage π f g n y) β€
(β k β Finset.range n, dist (g (f^[k] x)) (g (f^[k] y))) / n :=
(dist_birkhoffAverage_birkhoffAverage _ _ _ _ _ _).trans_le <| by
gcongr; apply dist_birkhoffSum_birkhoffSum_le
theorem dist_birkhoffAverage_apply_birkhoffAverage (f : Ξ± β Ξ±) (g : Ξ± β E) (n : β) (x : Ξ±) :
dist (birkhoffAverage π f g n (f x)) (birkhoffAverage π f g n x) =
dist (g (f^[n] x)) (g x) / n := by
simp [dist_birkhoffAverage_birkhoffAverage, dist_birkhoffSum_apply_birkhoffSum]
| Mathlib/Dynamics/BirkhoffSum/NormedSpace.lean | 75 | 84 | theorem tendsto_birkhoffAverage_apply_sub_birkhoffAverage {f : Ξ± β Ξ±} {g : Ξ± β E} {x : Ξ±}
(h : Bornology.IsBounded (range (g <| f^[Β·] x))) :
Tendsto (fun n β¦ birkhoffAverage π f g n (f x) - birkhoffAverage π f g n x) atTop (π 0) := by |
rcases Metric.isBounded_range_iff.1 h with β¨C, hCβ©
have : Tendsto (fun n : β β¦ C / n) atTop (π 0) :=
tendsto_const_nhds.div_atTop tendsto_natCast_atTop_atTop
refine squeeze_zero_norm (fun n β¦ ?_) this
rw [β dist_eq_norm, dist_birkhoffAverage_apply_birkhoffAverage]
gcongr
exact hC n 0
|
import Mathlib.GroupTheory.Solvable
import Mathlib.FieldTheory.PolynomialGaloisGroup
import Mathlib.RingTheory.RootsOfUnity.Basic
#align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a"
noncomputable section
open scoped Classical Polynomial IntermediateField
open Polynomial IntermediateField
section AbelRuffini
variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E]
theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance
#align gal_zero_is_solvable gal_zero_isSolvable
theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance
#align gal_one_is_solvable gal_one_isSolvable
theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by infer_instance
set_option linter.uppercaseLean3 false in
#align gal_C_is_solvable gal_C_isSolvable
theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal := by infer_instance
set_option linter.uppercaseLean3 false in
#align gal_X_is_solvable gal_X_isSolvable
theorem gal_X_sub_C_isSolvable (x : F) : IsSolvable (X - C x).Gal := by infer_instance
set_option linter.uppercaseLean3 false in
#align gal_X_sub_C_is_solvable gal_X_sub_C_isSolvable
theorem gal_X_pow_isSolvable (n : β) : IsSolvable (X ^ n : F[X]).Gal := by infer_instance
set_option linter.uppercaseLean3 false in
#align gal_X_pow_is_solvable gal_X_pow_isSolvable
theorem gal_mul_isSolvable {p q : F[X]} (_ : IsSolvable p.Gal) (_ : IsSolvable q.Gal) :
IsSolvable (p * q).Gal :=
solvable_of_solvable_injective (Gal.restrictProd_injective p q)
#align gal_mul_is_solvable gal_mul_isSolvable
theorem gal_prod_isSolvable {s : Multiset F[X]} (hs : β p β s, IsSolvable (Gal p)) :
IsSolvable s.prod.Gal := by
apply Multiset.induction_on' s
Β· exact gal_one_isSolvable
Β· intro p t hps _ ht
rw [Multiset.insert_eq_cons, Multiset.prod_cons]
exact gal_mul_isSolvable (hs p hps) ht
#align gal_prod_is_solvable gal_prod_isSolvable
theorem gal_isSolvable_of_splits {p q : F[X]}
(_ : Fact (p.Splits (algebraMap F q.SplittingField))) (hq : IsSolvable q.Gal) :
IsSolvable p.Gal :=
haveI : IsSolvable (q.SplittingField ββ[F] q.SplittingField) := hq
solvable_of_surjective (AlgEquiv.restrictNormalHom_surjective q.SplittingField)
#align gal_is_solvable_of_splits gal_isSolvable_of_splits
theorem gal_isSolvable_tower (p q : F[X]) (hpq : p.Splits (algebraMap F q.SplittingField))
(hp : IsSolvable p.Gal) (hq : IsSolvable (q.map (algebraMap F p.SplittingField)).Gal) :
IsSolvable q.Gal := by
let K := p.SplittingField
let L := q.SplittingField
haveI : Fact (p.Splits (algebraMap F L)) := β¨hpqβ©
let Ο : (L ββ[K] L) β* (q.map (algebraMap F K)).Gal :=
(IsSplittingField.algEquiv L (q.map (algebraMap F K))).autCongr
have Ο_inj : Function.Injective Ο.toMonoidHom := Ο.injective
haveI : IsSolvable (K ββ[F] K) := hp
haveI : IsSolvable (L ββ[K] L) := solvable_of_solvable_injective Ο_inj
exact isSolvable_of_isScalarTower F p.SplittingField q.SplittingField
#align gal_is_solvable_tower gal_isSolvable_tower
variable (F)
inductive IsSolvableByRad : E β Prop
| base (Ξ± : F) : IsSolvableByRad (algebraMap F E Ξ±)
| add (Ξ± Ξ² : E) : IsSolvableByRad Ξ± β IsSolvableByRad Ξ² β IsSolvableByRad (Ξ± + Ξ²)
| neg (Ξ± : E) : IsSolvableByRad Ξ± β IsSolvableByRad (-Ξ±)
| mul (Ξ± Ξ² : E) : IsSolvableByRad Ξ± β IsSolvableByRad Ξ² β IsSolvableByRad (Ξ± * Ξ²)
| inv (Ξ± : E) : IsSolvableByRad Ξ± β IsSolvableByRad Ξ±β»ΒΉ
| rad (Ξ± : E) (n : β) (hn : n β 0) : IsSolvableByRad (Ξ± ^ n) β IsSolvableByRad Ξ±
#align is_solvable_by_rad IsSolvableByRad
variable (E)
def solvableByRad : IntermediateField F E where
carrier := IsSolvableByRad F
zero_mem' := by
change IsSolvableByRad F 0
convert IsSolvableByRad.base (E := E) (0 : F); rw [RingHom.map_zero]
add_mem' := by apply IsSolvableByRad.add
one_mem' := by
change IsSolvableByRad F 1
convert IsSolvableByRad.base (E := E) (1 : F); rw [RingHom.map_one]
mul_mem' := by apply IsSolvableByRad.mul
inv_mem' := IsSolvableByRad.inv
algebraMap_mem' := IsSolvableByRad.base
#align solvable_by_rad solvableByRad
namespace solvableByRad
variable {F} {E} {Ξ± : E}
| Mathlib/FieldTheory/AbelRuffini.lean | 248 | 280 | theorem induction (P : solvableByRad F E β Prop)
(base : β Ξ± : F, P (algebraMap F (solvableByRad F E) Ξ±))
(add : β Ξ± Ξ² : solvableByRad F E, P Ξ± β P Ξ² β P (Ξ± + Ξ²))
(neg : β Ξ± : solvableByRad F E, P Ξ± β P (-Ξ±))
(mul : β Ξ± Ξ² : solvableByRad F E, P Ξ± β P Ξ² β P (Ξ± * Ξ²))
(inv : β Ξ± : solvableByRad F E, P Ξ± β P Ξ±β»ΒΉ)
(rad : β Ξ± : solvableByRad F E, β n : β, n β 0 β P (Ξ± ^ n) β P Ξ±) (Ξ± : solvableByRad F E) :
P Ξ± := by |
revert Ξ±
suffices β Ξ± : E, IsSolvableByRad F Ξ± β β Ξ² : solvableByRad F E, βΞ² = Ξ± β§ P Ξ² by
intro Ξ±
obtain β¨Ξ±β, hΞ±β, PΞ±β© := this Ξ± (Subtype.mem Ξ±)
convert PΞ±
exact Subtype.ext hΞ±β.symm
apply IsSolvableByRad.rec
Β· exact fun Ξ± => β¨algebraMap F (solvableByRad F E) Ξ±, rfl, base Ξ±β©
Β· intro Ξ± Ξ² _ _ PΞ± PΞ²
obtain β¨β¨Ξ±β, hΞ±β, PΞ±β©, Ξ²β, hΞ²β, PΞ²β© := PΞ±, PΞ²
exact β¨Ξ±β + Ξ²β, by rw [β hΞ±β, β hΞ²β]; rfl, add Ξ±β Ξ²β PΞ± PΞ²β©
Β· intro Ξ± _ PΞ±
obtain β¨Ξ±β, hΞ±β, PΞ±β© := PΞ±
exact β¨-Ξ±β, by rw [β hΞ±β]; rfl, neg Ξ±β PΞ±β©
Β· intro Ξ± Ξ² _ _ PΞ± PΞ²
obtain β¨β¨Ξ±β, hΞ±β, PΞ±β©, Ξ²β, hΞ²β, PΞ²β© := PΞ±, PΞ²
exact β¨Ξ±β * Ξ²β, by rw [β hΞ±β, β hΞ²β]; rfl, mul Ξ±β Ξ²β PΞ± PΞ²β©
Β· intro Ξ± _ PΞ±
obtain β¨Ξ±β, hΞ±β, PΞ±β© := PΞ±
exact β¨Ξ±ββ»ΒΉ, by rw [β hΞ±β]; rfl, inv Ξ±β PΞ±β©
Β· intro Ξ± n hn hΞ± PΞ±
obtain β¨Ξ±β, hΞ±β, PΞ±β© := PΞ±
refine β¨β¨Ξ±, IsSolvableByRad.rad Ξ± n hn hΞ±β©, rfl, rad _ n hn ?_β©
convert PΞ±
exact Subtype.ext (Eq.trans ((solvableByRad F E).coe_pow _ n) hΞ±β.symm)
|
import Mathlib.MeasureTheory.Measure.MeasureSpace
open scoped ENNReal NNReal Topology
open Set MeasureTheory Measure Filter MeasurableSpace ENNReal Function
variable {R Ξ± Ξ² Ξ΄ Ξ³ ΞΉ : Type*}
namespace MeasureTheory
variable {m0 : MeasurableSpace Ξ±} [MeasurableSpace Ξ²] [MeasurableSpace Ξ³]
variable {ΞΌ ΞΌβ ΞΌβ ΞΌβ Ξ½ Ξ½' Ξ½β Ξ½β : Measure Ξ±} {s s' t : Set Ξ±}
namespace Measure
noncomputable def restrictβ {m0 : MeasurableSpace Ξ±} (s : Set Ξ±) : Measure Ξ± ββ[ββ₯0β] Measure Ξ± :=
liftLinear (OuterMeasure.restrict s) fun ΞΌ s' hs' t => by
suffices ΞΌ (s β© t) = ΞΌ (s β© t β© s') + ΞΌ ((s β© t) \ s') by
simpa [β Set.inter_assoc, Set.inter_comm _ s, β inter_diff_assoc]
exact le_toOuterMeasure_caratheodory _ _ hs' _
#align measure_theory.measure.restrictβ MeasureTheory.Measure.restrictβ
noncomputable def restrict {_m0 : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (s : Set Ξ±) : Measure Ξ± :=
restrictβ s ΞΌ
#align measure_theory.measure.restrict MeasureTheory.Measure.restrict
@[simp]
theorem restrictβ_apply {_m0 : MeasurableSpace Ξ±} (s : Set Ξ±) (ΞΌ : Measure Ξ±) :
restrictβ s ΞΌ = ΞΌ.restrict s :=
rfl
#align measure_theory.measure.restrictβ_apply MeasureTheory.Measure.restrictβ_apply
theorem restrict_toOuterMeasure_eq_toOuterMeasure_restrict (h : MeasurableSet s) :
(ΞΌ.restrict s).toOuterMeasure = OuterMeasure.restrict s ΞΌ.toOuterMeasure := by
simp_rw [restrict, restrictβ, liftLinear, LinearMap.coe_mk, AddHom.coe_mk,
toMeasure_toOuterMeasure, OuterMeasure.restrict_trim h, ΞΌ.trimmed]
#align measure_theory.measure.restrict_to_outer_measure_eq_to_outer_measure_restrict MeasureTheory.Measure.restrict_toOuterMeasure_eq_toOuterMeasure_restrict
theorem restrict_applyβ (ht : NullMeasurableSet t (ΞΌ.restrict s)) : ΞΌ.restrict s t = ΞΌ (t β© s) := by
rw [β restrictβ_apply, restrictβ, liftLinear_applyβ _ ht, OuterMeasure.restrict_apply,
coe_toOuterMeasure]
#align measure_theory.measure.restrict_applyβ MeasureTheory.Measure.restrict_applyβ
@[simp]
theorem restrict_apply (ht : MeasurableSet t) : ΞΌ.restrict s t = ΞΌ (t β© s) :=
restrict_applyβ ht.nullMeasurableSet
#align measure_theory.measure.restrict_apply MeasureTheory.Measure.restrict_apply
theorem restrict_mono' {_m0 : MeasurableSpace Ξ±} β¦s s' : Set Ξ±β¦ β¦ΞΌ Ξ½ : Measure Ξ±β¦ (hs : s β€α΅[ΞΌ] s')
(hΞΌΞ½ : ΞΌ β€ Ξ½) : ΞΌ.restrict s β€ Ξ½.restrict s' :=
Measure.le_iff.2 fun t ht => calc
ΞΌ.restrict s t = ΞΌ (t β© s) := restrict_apply ht
_ β€ ΞΌ (t β© s') := (measure_mono_ae <| hs.mono fun _x hx β¨hxt, hxsβ© => β¨hxt, hx hxsβ©)
_ β€ Ξ½ (t β© s') := le_iff'.1 hΞΌΞ½ (t β© s')
_ = Ξ½.restrict s' t := (restrict_apply ht).symm
#align measure_theory.measure.restrict_mono' MeasureTheory.Measure.restrict_mono'
@[mono]
theorem restrict_mono {_m0 : MeasurableSpace Ξ±} β¦s s' : Set Ξ±β¦ (hs : s β s') β¦ΞΌ Ξ½ : Measure Ξ±β¦
(hΞΌΞ½ : ΞΌ β€ Ξ½) : ΞΌ.restrict s β€ Ξ½.restrict s' :=
restrict_mono' (ae_of_all _ hs) hΞΌΞ½
#align measure_theory.measure.restrict_mono MeasureTheory.Measure.restrict_mono
theorem restrict_mono_ae (h : s β€α΅[ΞΌ] t) : ΞΌ.restrict s β€ ΞΌ.restrict t :=
restrict_mono' h (le_refl ΞΌ)
#align measure_theory.measure.restrict_mono_ae MeasureTheory.Measure.restrict_mono_ae
theorem restrict_congr_set (h : s =α΅[ΞΌ] t) : ΞΌ.restrict s = ΞΌ.restrict t :=
le_antisymm (restrict_mono_ae h.le) (restrict_mono_ae h.symm.le)
#align measure_theory.measure.restrict_congr_set MeasureTheory.Measure.restrict_congr_set
@[simp]
theorem restrict_apply' (hs : MeasurableSet s) : ΞΌ.restrict s t = ΞΌ (t β© s) := by
rw [β toOuterMeasure_apply,
Measure.restrict_toOuterMeasure_eq_toOuterMeasure_restrict hs,
OuterMeasure.restrict_apply s t _, toOuterMeasure_apply]
#align measure_theory.measure.restrict_apply' MeasureTheory.Measure.restrict_apply'
theorem restrict_applyβ' (hs : NullMeasurableSet s ΞΌ) : ΞΌ.restrict s t = ΞΌ (t β© s) := by
rw [β restrict_congr_set hs.toMeasurable_ae_eq,
restrict_apply' (measurableSet_toMeasurable _ _),
measure_congr ((ae_eq_refl t).inter hs.toMeasurable_ae_eq)]
#align measure_theory.measure.restrict_applyβ' MeasureTheory.Measure.restrict_applyβ'
theorem restrict_le_self : ΞΌ.restrict s β€ ΞΌ :=
Measure.le_iff.2 fun t ht => calc
ΞΌ.restrict s t = ΞΌ (t β© s) := restrict_apply ht
_ β€ ΞΌ t := measure_mono inter_subset_left
#align measure_theory.measure.restrict_le_self MeasureTheory.Measure.restrict_le_self
variable (ΞΌ)
theorem restrict_eq_self (h : s β t) : ΞΌ.restrict t s = ΞΌ s :=
(le_iff'.1 restrict_le_self s).antisymm <|
calc
ΞΌ s β€ ΞΌ (toMeasurable (ΞΌ.restrict t) s β© t) :=
measure_mono (subset_inter (subset_toMeasurable _ _) h)
_ = ΞΌ.restrict t s := by
rw [β restrict_apply (measurableSet_toMeasurable _ _), measure_toMeasurable]
#align measure_theory.measure.restrict_eq_self MeasureTheory.Measure.restrict_eq_self
@[simp]
theorem restrict_apply_self (s : Set Ξ±) : (ΞΌ.restrict s) s = ΞΌ s :=
restrict_eq_self ΞΌ Subset.rfl
#align measure_theory.measure.restrict_apply_self MeasureTheory.Measure.restrict_apply_self
variable {ΞΌ}
theorem restrict_apply_univ (s : Set Ξ±) : ΞΌ.restrict s univ = ΞΌ s := by
rw [restrict_apply MeasurableSet.univ, Set.univ_inter]
#align measure_theory.measure.restrict_apply_univ MeasureTheory.Measure.restrict_apply_univ
theorem le_restrict_apply (s t : Set Ξ±) : ΞΌ (t β© s) β€ ΞΌ.restrict s t :=
calc
ΞΌ (t β© s) = ΞΌ.restrict s (t β© s) := (restrict_eq_self ΞΌ inter_subset_right).symm
_ β€ ΞΌ.restrict s t := measure_mono inter_subset_left
#align measure_theory.measure.le_restrict_apply MeasureTheory.Measure.le_restrict_apply
theorem restrict_apply_le (s t : Set Ξ±) : ΞΌ.restrict s t β€ ΞΌ t :=
Measure.le_iff'.1 restrict_le_self _
theorem restrict_apply_superset (h : s β t) : ΞΌ.restrict s t = ΞΌ s :=
((measure_mono (subset_univ _)).trans_eq <| restrict_apply_univ _).antisymm
((restrict_apply_self ΞΌ s).symm.trans_le <| measure_mono h)
#align measure_theory.measure.restrict_apply_superset MeasureTheory.Measure.restrict_apply_superset
@[simp]
theorem restrict_add {_m0 : MeasurableSpace Ξ±} (ΞΌ Ξ½ : Measure Ξ±) (s : Set Ξ±) :
(ΞΌ + Ξ½).restrict s = ΞΌ.restrict s + Ξ½.restrict s :=
(restrictβ s).map_add ΞΌ Ξ½
#align measure_theory.measure.restrict_add MeasureTheory.Measure.restrict_add
@[simp]
theorem restrict_zero {_m0 : MeasurableSpace Ξ±} (s : Set Ξ±) : (0 : Measure Ξ±).restrict s = 0 :=
(restrictβ s).map_zero
#align measure_theory.measure.restrict_zero MeasureTheory.Measure.restrict_zero
@[simp]
theorem restrict_smul {_m0 : MeasurableSpace Ξ±} (c : ββ₯0β) (ΞΌ : Measure Ξ±) (s : Set Ξ±) :
(c β’ ΞΌ).restrict s = c β’ ΞΌ.restrict s :=
(restrictβ s).map_smul c ΞΌ
#align measure_theory.measure.restrict_smul MeasureTheory.Measure.restrict_smul
theorem restrict_restrictβ (hs : NullMeasurableSet s (ΞΌ.restrict t)) :
(ΞΌ.restrict t).restrict s = ΞΌ.restrict (s β© t) :=
ext fun u hu => by
simp only [Set.inter_assoc, restrict_apply hu,
restrict_applyβ (hu.nullMeasurableSet.inter hs)]
#align measure_theory.measure.restrict_restrictβ MeasureTheory.Measure.restrict_restrictβ
@[simp]
theorem restrict_restrict (hs : MeasurableSet s) : (ΞΌ.restrict t).restrict s = ΞΌ.restrict (s β© t) :=
restrict_restrictβ hs.nullMeasurableSet
#align measure_theory.measure.restrict_restrict MeasureTheory.Measure.restrict_restrict
theorem restrict_restrict_of_subset (h : s β t) : (ΞΌ.restrict t).restrict s = ΞΌ.restrict s := by
ext1 u hu
rw [restrict_apply hu, restrict_apply hu, restrict_eq_self]
exact inter_subset_right.trans h
#align measure_theory.measure.restrict_restrict_of_subset MeasureTheory.Measure.restrict_restrict_of_subset
theorem restrict_restrictβ' (ht : NullMeasurableSet t ΞΌ) :
(ΞΌ.restrict t).restrict s = ΞΌ.restrict (s β© t) :=
ext fun u hu => by simp only [restrict_apply hu, restrict_applyβ' ht, inter_assoc]
#align measure_theory.measure.restrict_restrictβ' MeasureTheory.Measure.restrict_restrictβ'
theorem restrict_restrict' (ht : MeasurableSet t) :
(ΞΌ.restrict t).restrict s = ΞΌ.restrict (s β© t) :=
restrict_restrictβ' ht.nullMeasurableSet
#align measure_theory.measure.restrict_restrict' MeasureTheory.Measure.restrict_restrict'
theorem restrict_comm (hs : MeasurableSet s) :
(ΞΌ.restrict t).restrict s = (ΞΌ.restrict s).restrict t := by
rw [restrict_restrict hs, restrict_restrict' hs, inter_comm]
#align measure_theory.measure.restrict_comm MeasureTheory.Measure.restrict_comm
theorem restrict_apply_eq_zero (ht : MeasurableSet t) : ΞΌ.restrict s t = 0 β ΞΌ (t β© s) = 0 := by
rw [restrict_apply ht]
#align measure_theory.measure.restrict_apply_eq_zero MeasureTheory.Measure.restrict_apply_eq_zero
theorem measure_inter_eq_zero_of_restrict (h : ΞΌ.restrict s t = 0) : ΞΌ (t β© s) = 0 :=
nonpos_iff_eq_zero.1 (h βΈ le_restrict_apply _ _)
#align measure_theory.measure.measure_inter_eq_zero_of_restrict MeasureTheory.Measure.measure_inter_eq_zero_of_restrict
theorem restrict_apply_eq_zero' (hs : MeasurableSet s) : ΞΌ.restrict s t = 0 β ΞΌ (t β© s) = 0 := by
rw [restrict_apply' hs]
#align measure_theory.measure.restrict_apply_eq_zero' MeasureTheory.Measure.restrict_apply_eq_zero'
@[simp]
theorem restrict_eq_zero : ΞΌ.restrict s = 0 β ΞΌ s = 0 := by
rw [β measure_univ_eq_zero, restrict_apply_univ]
#align measure_theory.measure.restrict_eq_zero MeasureTheory.Measure.restrict_eq_zero
instance restrict.neZero [NeZero (ΞΌ s)] : NeZero (ΞΌ.restrict s) :=
β¨mt restrict_eq_zero.mp <| NeZero.ne _β©
theorem restrict_zero_set {s : Set Ξ±} (h : ΞΌ s = 0) : ΞΌ.restrict s = 0 :=
restrict_eq_zero.2 h
#align measure_theory.measure.restrict_zero_set MeasureTheory.Measure.restrict_zero_set
@[simp]
theorem restrict_empty : ΞΌ.restrict β
= 0 :=
restrict_zero_set measure_empty
#align measure_theory.measure.restrict_empty MeasureTheory.Measure.restrict_empty
@[simp]
theorem restrict_univ : ΞΌ.restrict univ = ΞΌ :=
ext fun s hs => by simp [hs]
#align measure_theory.measure.restrict_univ MeasureTheory.Measure.restrict_univ
theorem restrict_inter_add_diffβ (s : Set Ξ±) (ht : NullMeasurableSet t ΞΌ) :
ΞΌ.restrict (s β© t) + ΞΌ.restrict (s \ t) = ΞΌ.restrict s := by
ext1 u hu
simp only [add_apply, restrict_apply hu, β inter_assoc, diff_eq]
exact measure_inter_add_diffβ (u β© s) ht
#align measure_theory.measure.restrict_inter_add_diffβ MeasureTheory.Measure.restrict_inter_add_diffβ
theorem restrict_inter_add_diff (s : Set Ξ±) (ht : MeasurableSet t) :
ΞΌ.restrict (s β© t) + ΞΌ.restrict (s \ t) = ΞΌ.restrict s :=
restrict_inter_add_diffβ s ht.nullMeasurableSet
#align measure_theory.measure.restrict_inter_add_diff MeasureTheory.Measure.restrict_inter_add_diff
theorem restrict_union_add_interβ (s : Set Ξ±) (ht : NullMeasurableSet t ΞΌ) :
ΞΌ.restrict (s βͺ t) + ΞΌ.restrict (s β© t) = ΞΌ.restrict s + ΞΌ.restrict t := by
rw [β restrict_inter_add_diffβ (s βͺ t) ht, union_inter_cancel_right, union_diff_right, β
restrict_inter_add_diffβ s ht, add_comm, β add_assoc, add_right_comm]
#align measure_theory.measure.restrict_union_add_interβ MeasureTheory.Measure.restrict_union_add_interβ
theorem restrict_union_add_inter (s : Set Ξ±) (ht : MeasurableSet t) :
ΞΌ.restrict (s βͺ t) + ΞΌ.restrict (s β© t) = ΞΌ.restrict s + ΞΌ.restrict t :=
restrict_union_add_interβ s ht.nullMeasurableSet
#align measure_theory.measure.restrict_union_add_inter MeasureTheory.Measure.restrict_union_add_inter
theorem restrict_union_add_inter' (hs : MeasurableSet s) (t : Set Ξ±) :
ΞΌ.restrict (s βͺ t) + ΞΌ.restrict (s β© t) = ΞΌ.restrict s + ΞΌ.restrict t := by
simpa only [union_comm, inter_comm, add_comm] using restrict_union_add_inter t hs
#align measure_theory.measure.restrict_union_add_inter' MeasureTheory.Measure.restrict_union_add_inter'
theorem restrict_unionβ (h : AEDisjoint ΞΌ s t) (ht : NullMeasurableSet t ΞΌ) :
ΞΌ.restrict (s βͺ t) = ΞΌ.restrict s + ΞΌ.restrict t := by
simp [β restrict_union_add_interβ s ht, restrict_zero_set h]
#align measure_theory.measure.restrict_unionβ MeasureTheory.Measure.restrict_unionβ
theorem restrict_union (h : Disjoint s t) (ht : MeasurableSet t) :
ΞΌ.restrict (s βͺ t) = ΞΌ.restrict s + ΞΌ.restrict t :=
restrict_unionβ h.aedisjoint ht.nullMeasurableSet
#align measure_theory.measure.restrict_union MeasureTheory.Measure.restrict_union
| Mathlib/MeasureTheory/Measure/Restrict.lean | 281 | 283 | theorem restrict_union' (h : Disjoint s t) (hs : MeasurableSet s) :
ΞΌ.restrict (s βͺ t) = ΞΌ.restrict s + ΞΌ.restrict t := by |
rw [union_comm, restrict_union h.symm hs, add_comm]
|
import Mathlib.Algebra.Associated
import Mathlib.Algebra.Star.Unitary
import Mathlib.RingTheory.Int.Basic
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.Ring
#align_import number_theory.zsqrtd.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
@[ext]
structure Zsqrtd (d : β€) where
re : β€
im : β€
deriving DecidableEq
#align zsqrtd Zsqrtd
#align zsqrtd.ext Zsqrtd.ext_iff
prefix:100 "β€β" => Zsqrtd
namespace Zsqrtd
section
variable {d : β€}
def ofInt (n : β€) : β€βd :=
β¨n, 0β©
#align zsqrtd.of_int Zsqrtd.ofInt
theorem ofInt_re (n : β€) : (ofInt n : β€βd).re = n :=
rfl
#align zsqrtd.of_int_re Zsqrtd.ofInt_re
theorem ofInt_im (n : β€) : (ofInt n : β€βd).im = 0 :=
rfl
#align zsqrtd.of_int_im Zsqrtd.ofInt_im
instance : Zero (β€βd) :=
β¨ofInt 0β©
@[simp]
theorem zero_re : (0 : β€βd).re = 0 :=
rfl
#align zsqrtd.zero_re Zsqrtd.zero_re
@[simp]
theorem zero_im : (0 : β€βd).im = 0 :=
rfl
#align zsqrtd.zero_im Zsqrtd.zero_im
instance : Inhabited (β€βd) :=
β¨0β©
instance : One (β€βd) :=
β¨ofInt 1β©
@[simp]
theorem one_re : (1 : β€βd).re = 1 :=
rfl
#align zsqrtd.one_re Zsqrtd.one_re
@[simp]
theorem one_im : (1 : β€βd).im = 0 :=
rfl
#align zsqrtd.one_im Zsqrtd.one_im
def sqrtd : β€βd :=
β¨0, 1β©
#align zsqrtd.sqrtd Zsqrtd.sqrtd
@[simp]
theorem sqrtd_re : (sqrtd : β€βd).re = 0 :=
rfl
#align zsqrtd.sqrtd_re Zsqrtd.sqrtd_re
@[simp]
theorem sqrtd_im : (sqrtd : β€βd).im = 1 :=
rfl
#align zsqrtd.sqrtd_im Zsqrtd.sqrtd_im
instance : Add (β€βd) :=
β¨fun z w => β¨z.1 + w.1, z.2 + w.2β©β©
@[simp]
theorem add_def (x y x' y' : β€) : (β¨x, yβ© + β¨x', y'β© : β€βd) = β¨x + x', y + y'β© :=
rfl
#align zsqrtd.add_def Zsqrtd.add_def
@[simp]
theorem add_re (z w : β€βd) : (z + w).re = z.re + w.re :=
rfl
#align zsqrtd.add_re Zsqrtd.add_re
@[simp]
theorem add_im (z w : β€βd) : (z + w).im = z.im + w.im :=
rfl
#align zsqrtd.add_im Zsqrtd.add_im
#noalign zsqrtd.bit0_re
#noalign zsqrtd.bit0_im
#noalign zsqrtd.bit1_re
#noalign zsqrtd.bit1_im
instance : Neg (β€βd) :=
β¨fun z => β¨-z.1, -z.2β©β©
@[simp]
theorem neg_re (z : β€βd) : (-z).re = -z.re :=
rfl
#align zsqrtd.neg_re Zsqrtd.neg_re
@[simp]
theorem neg_im (z : β€βd) : (-z).im = -z.im :=
rfl
#align zsqrtd.neg_im Zsqrtd.neg_im
instance : Mul (β€βd) :=
β¨fun z w => β¨z.1 * w.1 + d * z.2 * w.2, z.1 * w.2 + z.2 * w.1β©β©
@[simp]
theorem mul_re (z w : β€βd) : (z * w).re = z.re * w.re + d * z.im * w.im :=
rfl
#align zsqrtd.mul_re Zsqrtd.mul_re
@[simp]
theorem mul_im (z w : β€βd) : (z * w).im = z.re * w.im + z.im * w.re :=
rfl
#align zsqrtd.mul_im Zsqrtd.mul_im
instance addCommGroup : AddCommGroup (β€βd) := by
refine
{ add := (Β· + Β·)
zero := (0 : β€βd)
sub := fun a b => a + -b
neg := Neg.neg
nsmul := @nsmulRec (β€βd) β¨0β© β¨(Β· + Β·)β©
zsmul := @zsmulRec (β€βd) β¨0β© β¨(Β· + Β·)β© β¨Neg.negβ© (@nsmulRec (β€βd) β¨0β© β¨(Β· + Β·)β©)
add_assoc := ?_
zero_add := ?_
add_zero := ?_
add_left_neg := ?_
add_comm := ?_ } <;>
intros <;>
ext <;>
simp [add_comm, add_left_comm]
@[simp]
theorem sub_re (z w : β€βd) : (z - w).re = z.re - w.re :=
rfl
@[simp]
theorem sub_im (z w : β€βd) : (z - w).im = z.im - w.im :=
rfl
instance addGroupWithOne : AddGroupWithOne (β€βd) :=
{ Zsqrtd.addCommGroup with
natCast := fun n => ofInt n
intCast := ofInt
one := 1 }
instance commRing : CommRing (β€βd) := by
refine
{ Zsqrtd.addGroupWithOne with
mul := (Β· * Β·)
npow := @npowRec (β€βd) β¨1β© β¨(Β· * Β·)β©,
add_comm := ?_
left_distrib := ?_
right_distrib := ?_
zero_mul := ?_
mul_zero := ?_
mul_assoc := ?_
one_mul := ?_
mul_one := ?_
mul_comm := ?_ } <;>
intros <;>
ext <;>
simp <;>
ring
instance : AddMonoid (β€βd) := by infer_instance
instance : Monoid (β€βd) := by infer_instance
instance : CommMonoid (β€βd) := by infer_instance
instance : CommSemigroup (β€βd) := by infer_instance
instance : Semigroup (β€βd) := by infer_instance
instance : AddCommSemigroup (β€βd) := by infer_instance
instance : AddSemigroup (β€βd) := by infer_instance
instance : CommSemiring (β€βd) := by infer_instance
instance : Semiring (β€βd) := by infer_instance
instance : Ring (β€βd) := by infer_instance
instance : Distrib (β€βd) := by infer_instance
instance : Star (β€βd) where
star z := β¨z.1, -z.2β©
@[simp]
theorem star_mk (x y : β€) : star (β¨x, yβ© : β€βd) = β¨x, -yβ© :=
rfl
#align zsqrtd.star_mk Zsqrtd.star_mk
@[simp]
theorem star_re (z : β€βd) : (star z).re = z.re :=
rfl
#align zsqrtd.star_re Zsqrtd.star_re
@[simp]
theorem star_im (z : β€βd) : (star z).im = -z.im :=
rfl
#align zsqrtd.star_im Zsqrtd.star_im
instance : StarRing (β€βd) where
star_involutive x := Zsqrtd.ext _ _ rfl (neg_neg _)
star_mul a b := by ext <;> simp <;> ring
star_add a b := Zsqrtd.ext _ _ rfl (neg_add _ _)
-- Porting note: proof was `by decide`
instance nontrivial : Nontrivial (β€βd) :=
β¨β¨0, 1, (Zsqrtd.ext_iff 0 1).not.mpr (by simp)β©β©
@[simp]
theorem natCast_re (n : β) : (n : β€βd).re = n :=
rfl
#align zsqrtd.coe_nat_re Zsqrtd.natCast_re
@[simp]
theorem ofNat_re (n : β) [n.AtLeastTwo] : (no_index (OfNat.ofNat n) : β€βd).re = n :=
rfl
@[simp]
theorem natCast_im (n : β) : (n : β€βd).im = 0 :=
rfl
#align zsqrtd.coe_nat_im Zsqrtd.natCast_im
@[simp]
theorem ofNat_im (n : β) [n.AtLeastTwo] : (no_index (OfNat.ofNat n) : β€βd).im = 0 :=
rfl
theorem natCast_val (n : β) : (n : β€βd) = β¨n, 0β© :=
rfl
#align zsqrtd.coe_nat_val Zsqrtd.natCast_val
@[simp]
theorem intCast_re (n : β€) : (n : β€βd).re = n := by cases n <;> rfl
#align zsqrtd.coe_int_re Zsqrtd.intCast_re
@[simp]
theorem intCast_im (n : β€) : (n : β€βd).im = 0 := by cases n <;> rfl
#align zsqrtd.coe_int_im Zsqrtd.intCast_im
theorem intCast_val (n : β€) : (n : β€βd) = β¨n, 0β© := by ext <;> simp
#align zsqrtd.coe_int_val Zsqrtd.intCast_val
instance : CharZero (β€βd) where cast_injective m n := by simp [Zsqrtd.ext_iff]
@[simp]
theorem ofInt_eq_intCast (n : β€) : (ofInt n : β€βd) = n := by ext <;> simp [ofInt_re, ofInt_im]
#align zsqrtd.of_int_eq_coe Zsqrtd.ofInt_eq_intCast
@[deprecated (since := "2024-04-05")] alias coe_nat_re := natCast_re
@[deprecated (since := "2024-04-05")] alias coe_nat_im := natCast_im
@[deprecated (since := "2024-04-05")] alias coe_nat_val := natCast_val
@[deprecated (since := "2024-04-05")] alias coe_int_re := intCast_re
@[deprecated (since := "2024-04-05")] alias coe_int_im := intCast_im
@[deprecated (since := "2024-04-05")] alias coe_int_val := intCast_val
@[deprecated (since := "2024-04-05")] alias ofInt_eq_coe := ofInt_eq_intCast
@[simp]
theorem smul_val (n x y : β€) : (n : β€βd) * β¨x, yβ© = β¨n * x, n * yβ© := by ext <;> simp
#align zsqrtd.smul_val Zsqrtd.smul_val
theorem smul_re (a : β€) (b : β€βd) : (βa * b).re = a * b.re := by simp
#align zsqrtd.smul_re Zsqrtd.smul_re
theorem smul_im (a : β€) (b : β€βd) : (βa * b).im = a * b.im := by simp
#align zsqrtd.smul_im Zsqrtd.smul_im
@[simp]
theorem muld_val (x y : β€) : sqrtd (d := d) * β¨x, yβ© = β¨d * y, xβ© := by ext <;> simp
#align zsqrtd.muld_val Zsqrtd.muld_val
@[simp]
theorem dmuld : sqrtd (d := d) * sqrtd (d := d) = d := by ext <;> simp
#align zsqrtd.dmuld Zsqrtd.dmuld
@[simp]
theorem smuld_val (n x y : β€) : sqrtd * (n : β€βd) * β¨x, yβ© = β¨d * n * y, n * xβ© := by ext <;> simp
#align zsqrtd.smuld_val Zsqrtd.smuld_val
theorem decompose {x y : β€} : (β¨x, yβ© : β€βd) = x + sqrtd (d := d) * y := by ext <;> simp
#align zsqrtd.decompose Zsqrtd.decompose
theorem mul_star {x y : β€} : (β¨x, yβ© * star β¨x, yβ© : β€βd) = x * x - d * y * y := by
ext <;> simp [sub_eq_add_neg, mul_comm]
#align zsqrtd.mul_star Zsqrtd.mul_star
@[deprecated (since := "2024-05-25")] alias coe_int_add := Int.cast_add
@[deprecated (since := "2024-05-25")] alias coe_int_sub := Int.cast_sub
@[deprecated (since := "2024-05-25")] alias coe_int_mul := Int.cast_mul
@[deprecated (since := "2024-05-25")] alias coe_int_inj := Int.cast_inj
theorem intCast_dvd (z : β€) (a : β€βd) : βz β£ a β z β£ a.re β§ z β£ a.im := by
constructor
Β· rintro β¨x, rflβ©
simp only [add_zero, intCast_re, zero_mul, mul_im, dvd_mul_right, and_self_iff,
mul_re, mul_zero, intCast_im]
Β· rintro β¨β¨r, hrβ©, β¨i, hiβ©β©
use β¨r, iβ©
rw [smul_val, Zsqrtd.ext_iff]
exact β¨hr, hiβ©
#align zsqrtd.coe_int_dvd_iff Zsqrtd.intCast_dvd
@[simp, norm_cast]
theorem intCast_dvd_intCast (a b : β€) : (a : β€βd) β£ b β a β£ b := by
rw [intCast_dvd]
constructor
Β· rintro β¨hre, -β©
rwa [intCast_re] at hre
Β· rw [intCast_re, intCast_im]
exact fun hc => β¨hc, dvd_zero aβ©
#align zsqrtd.coe_int_dvd_coe_int Zsqrtd.intCast_dvd_intCast
@[deprecated (since := "2024-05-25")] alias coe_int_dvd_iff := intCast_dvd
@[deprecated (since := "2024-05-25")] alias coe_int_dvd_coe_int := intCast_dvd_intCast
protected theorem eq_of_smul_eq_smul_left {a : β€} {b c : β€βd} (ha : a β 0) (h : βa * b = a * c) :
b = c := by
rw [Zsqrtd.ext_iff] at h β’
apply And.imp _ _ h <;> simpa only [smul_re, smul_im] using mul_left_cancelβ ha
#align zsqrtd.eq_of_smul_eq_smul_left Zsqrtd.eq_of_smul_eq_smul_left
def SqLe (a c b d : β) : Prop :=
c * a * a β€ d * b * b
#align zsqrtd.sq_le Zsqrtd.SqLe
theorem sqLe_of_le {c d x y z w : β} (xz : z β€ x) (yw : y β€ w) (xy : SqLe x c y d) : SqLe z c w d :=
le_trans (mul_le_mul (Nat.mul_le_mul_left _ xz) xz (Nat.zero_le _) (Nat.zero_le _)) <|
le_trans xy (mul_le_mul (Nat.mul_le_mul_left _ yw) yw (Nat.zero_le _) (Nat.zero_le _))
#align zsqrtd.sq_le_of_le Zsqrtd.sqLe_of_le
theorem sqLe_add_mixed {c d x y z w : β} (xy : SqLe x c y d) (zw : SqLe z c w d) :
c * (x * z) β€ d * (y * w) :=
Nat.mul_self_le_mul_self_iff.1 <| by
simpa [mul_comm, mul_left_comm] using mul_le_mul xy zw (Nat.zero_le _) (Nat.zero_le _)
#align zsqrtd.sq_le_add_mixed Zsqrtd.sqLe_add_mixed
theorem sqLe_add {c d x y z w : β} (xy : SqLe x c y d) (zw : SqLe z c w d) :
SqLe (x + z) c (y + w) d := by
have xz := sqLe_add_mixed xy zw
simp? [SqLe, mul_assoc] at xy zw says simp only [SqLe, mul_assoc] at xy zw
simp [SqLe, mul_add, mul_comm, mul_left_comm, add_le_add, *]
#align zsqrtd.sq_le_add Zsqrtd.sqLe_add
theorem sqLe_cancel {c d x y z w : β} (zw : SqLe y d x c) (h : SqLe (x + z) c (y + w) d) :
SqLe z c w d := by
apply le_of_not_gt
intro l
refine not_le_of_gt ?_ h
simp only [SqLe, mul_add, mul_comm, mul_left_comm, add_assoc, gt_iff_lt]
have hm := sqLe_add_mixed zw (le_of_lt l)
simp only [SqLe, mul_assoc, gt_iff_lt] at l zw
exact
lt_of_le_of_lt (add_le_add_right zw _)
(add_lt_add_left (add_lt_add_of_le_of_lt hm (add_lt_add_of_le_of_lt hm l)) _)
#align zsqrtd.sq_le_cancel Zsqrtd.sqLe_cancel
theorem sqLe_smul {c d x y : β} (n : β) (xy : SqLe x c y d) : SqLe (n * x) c (n * y) d := by
simpa [SqLe, mul_left_comm, mul_assoc] using Nat.mul_le_mul_left (n * n) xy
#align zsqrtd.sq_le_smul Zsqrtd.sqLe_smul
theorem sqLe_mul {d x y z w : β} :
(SqLe x 1 y d β SqLe z 1 w d β SqLe (x * w + y * z) d (x * z + d * y * w) 1) β§
(SqLe x 1 y d β SqLe w d z 1 β SqLe (x * z + d * y * w) 1 (x * w + y * z) d) β§
(SqLe y d x 1 β SqLe z 1 w d β SqLe (x * z + d * y * w) 1 (x * w + y * z) d) β§
(SqLe y d x 1 β SqLe w d z 1 β SqLe (x * w + y * z) d (x * z + d * y * w) 1) := by
refine β¨?_, ?_, ?_, ?_β© <;>
Β· intro xy zw
have :=
Int.mul_nonneg (sub_nonneg_of_le (Int.ofNat_le_ofNat_of_le xy))
(sub_nonneg_of_le (Int.ofNat_le_ofNat_of_le zw))
refine Int.le_of_ofNat_le_ofNat (le_of_sub_nonneg ?_)
convert this using 1
simp only [one_mul, Int.ofNat_add, Int.ofNat_mul]
ring
#align zsqrtd.sq_le_mul Zsqrtd.sqLe_mul
open Int in
def Nonnegg (c d : β) : β€ β β€ β Prop
| (a : β), (b : β) => True
| (a : β), -[b+1] => SqLe (b + 1) c a d
| -[a+1], (b : β) => SqLe (a + 1) d b c
| -[_+1], -[_+1] => False
#align zsqrtd.nonnegg Zsqrtd.Nonnegg
theorem nonnegg_comm {c d : β} {x y : β€} : Nonnegg c d x y = Nonnegg d c y x := by
induction x <;> induction y <;> rfl
#align zsqrtd.nonnegg_comm Zsqrtd.nonnegg_comm
theorem nonnegg_neg_pos {c d} : β {a b : β}, Nonnegg c d (-a) b β SqLe a d b c
| 0, b => β¨by simp [SqLe, Nat.zero_le], fun _ => trivialβ©
| a + 1, b => by rw [β Int.negSucc_coe]; rfl
#align zsqrtd.nonnegg_neg_pos Zsqrtd.nonnegg_neg_pos
theorem nonnegg_pos_neg {c d} {a b : β} : Nonnegg c d a (-b) β SqLe b c a d := by
rw [nonnegg_comm]; exact nonnegg_neg_pos
#align zsqrtd.nonnegg_pos_neg Zsqrtd.nonnegg_pos_neg
open Int in
theorem nonnegg_cases_right {c d} {a : β} :
β {b : β€}, (β x : β, b = -x β SqLe x c a d) β Nonnegg c d a b
| (b : Nat), _ => trivial
| -[b+1], h => h (b + 1) rfl
#align zsqrtd.nonnegg_cases_right Zsqrtd.nonnegg_cases_right
theorem nonnegg_cases_left {c d} {b : β} {a : β€} (h : β x : β, a = -x β SqLe x d b c) :
Nonnegg c d a b :=
cast nonnegg_comm (nonnegg_cases_right h)
#align zsqrtd.nonnegg_cases_left Zsqrtd.nonnegg_cases_left
end
section
variable {d : β}
def Nonneg : β€βd β Prop
| β¨a, bβ© => Nonnegg d 1 a b
#align zsqrtd.nonneg Zsqrtd.Nonneg
instance : LE (β€βd) :=
β¨fun a b => Nonneg (b - a)β©
instance : LT (β€βd) :=
β¨fun a b => Β¬b β€ aβ©
instance decidableNonnegg (c d a b) : Decidable (Nonnegg c d a b) := by
cases a <;> cases b <;> unfold Nonnegg SqLe <;> infer_instance
#align zsqrtd.decidable_nonnegg Zsqrtd.decidableNonnegg
instance decidableNonneg : β a : β€βd, Decidable (Nonneg a)
| β¨_, _β© => Zsqrtd.decidableNonnegg _ _ _ _
#align zsqrtd.decidable_nonneg Zsqrtd.decidableNonneg
instance decidableLE : @DecidableRel (β€βd) (Β· β€ Β·) := fun _ _ => decidableNonneg _
#align zsqrtd.decidable_le Zsqrtd.decidableLE
open Int in
theorem nonneg_cases : β {a : β€βd}, Nonneg a β β x y : β, a = β¨x, yβ© β¨ a = β¨x, -yβ© β¨ a = β¨-x, yβ©
| β¨(x : β), (y : β)β©, _ => β¨x, y, Or.inl rflβ©
| β¨(x : β), -[y+1]β©, _ => β¨x, y + 1, Or.inr <| Or.inl rflβ©
| β¨-[x+1], (y : β)β©, _ => β¨x + 1, y, Or.inr <| Or.inr rflβ©
| β¨-[_+1], -[_+1]β©, h => False.elim h
#align zsqrtd.nonneg_cases Zsqrtd.nonneg_cases
open Int in
theorem nonneg_add_lem {x y z w : β} (xy : Nonneg (β¨x, -yβ© : β€βd)) (zw : Nonneg (β¨-z, wβ© : β€βd)) :
Nonneg (β¨x, -yβ© + β¨-z, wβ© : β€βd) := by
have : Nonneg β¨Int.subNatNat x z, Int.subNatNat w yβ© :=
Int.subNatNat_elim x z
(fun m n i => SqLe y d m 1 β SqLe n 1 w d β Nonneg β¨i, Int.subNatNat w yβ©)
(fun j k =>
Int.subNatNat_elim w y
(fun m n i => SqLe n d (k + j) 1 β SqLe k 1 m d β Nonneg β¨Int.ofNat j, iβ©)
(fun _ _ _ _ => trivial) fun m n xy zw => sqLe_cancel zw xy)
(fun j k =>
Int.subNatNat_elim w y
(fun m n i => SqLe n d k 1 β SqLe (k + j + 1) 1 m d β Nonneg β¨-[j+1], iβ©)
(fun m n xy zw => sqLe_cancel xy zw) fun m n xy zw =>
let t := Nat.le_trans zw (sqLe_of_le (Nat.le_add_right n (m + 1)) le_rfl xy)
have : k + j + 1 β€ k :=
Nat.mul_self_le_mul_self_iff.1 (by simpa [one_mul] using t)
absurd this (not_le_of_gt <| Nat.succ_le_succ <| Nat.le_add_right _ _))
(nonnegg_pos_neg.1 xy) (nonnegg_neg_pos.1 zw)
rw [add_def, neg_add_eq_sub]
rwa [Int.subNatNat_eq_coe, Int.subNatNat_eq_coe] at this
#align zsqrtd.nonneg_add_lem Zsqrtd.nonneg_add_lem
theorem Nonneg.add {a b : β€βd} (ha : Nonneg a) (hb : Nonneg b) : Nonneg (a + b) := by
rcases nonneg_cases ha with β¨x, y, rfl | rfl | rflβ© <;>
rcases nonneg_cases hb with β¨z, w, rfl | rfl | rflβ©
Β· trivial
Β· refine nonnegg_cases_right fun i h => sqLe_of_le ?_ ?_ (nonnegg_pos_neg.1 hb)
Β· dsimp only at h
exact Int.ofNat_le.1 (le_of_neg_le_neg (Int.le.intro y (by simp [add_comm, *])))
Β· apply Nat.le_add_left
Β· refine nonnegg_cases_left fun i h => sqLe_of_le ?_ ?_ (nonnegg_neg_pos.1 hb)
Β· dsimp only at h
exact Int.ofNat_le.1 (le_of_neg_le_neg (Int.le.intro x (by simp [add_comm, *])))
Β· apply Nat.le_add_left
Β· refine nonnegg_cases_right fun i h => sqLe_of_le ?_ ?_ (nonnegg_pos_neg.1 ha)
Β· dsimp only at h
exact Int.ofNat_le.1 (le_of_neg_le_neg (Int.le.intro w (by simp [*])))
Β· apply Nat.le_add_right
Β· have : Nonneg β¨_, _β© :=
nonnegg_pos_neg.2 (sqLe_add (nonnegg_pos_neg.1 ha) (nonnegg_pos_neg.1 hb))
rw [Nat.cast_add, Nat.cast_add, neg_add] at this
rwa [add_def]
-- Porting note: was
-- simpa [add_comm] using
-- nonnegg_pos_neg.2 (sqLe_add (nonnegg_pos_neg.1 ha) (nonnegg_pos_neg.1 hb))
Β· exact nonneg_add_lem ha hb
Β· refine nonnegg_cases_left fun i h => sqLe_of_le ?_ ?_ (nonnegg_neg_pos.1 ha)
Β· dsimp only at h
exact Int.ofNat_le.1 (le_of_neg_le_neg (Int.le.intro _ h))
Β· apply Nat.le_add_right
Β· dsimp
rw [add_comm, add_comm (y : β€)]
exact nonneg_add_lem hb ha
Β· have : Nonneg β¨_, _β© :=
nonnegg_neg_pos.2 (sqLe_add (nonnegg_neg_pos.1 ha) (nonnegg_neg_pos.1 hb))
rw [Nat.cast_add, Nat.cast_add, neg_add] at this
rwa [add_def]
-- Porting note: was
-- simpa [add_comm] using
-- nonnegg_neg_pos.2 (sqLe_add (nonnegg_neg_pos.1 ha) (nonnegg_neg_pos.1 hb))
#align zsqrtd.nonneg.add Zsqrtd.Nonneg.add
theorem nonneg_iff_zero_le {a : β€βd} : Nonneg a β 0 β€ a :=
show _ β Nonneg _ by simp
#align zsqrtd.nonneg_iff_zero_le Zsqrtd.nonneg_iff_zero_le
theorem le_of_le_le {x y z w : β€} (xz : x β€ z) (yw : y β€ w) : (β¨x, yβ© : β€βd) β€ β¨z, wβ© :=
show Nonneg β¨z - x, w - yβ© from
match z - x, w - y, Int.le.dest_sub xz, Int.le.dest_sub yw with
| _, _, β¨_, rflβ©, β¨_, rflβ© => trivial
#align zsqrtd.le_of_le_le Zsqrtd.le_of_le_le
open Int in
protected theorem nonneg_total : β a : β€βd, Nonneg a β¨ Nonneg (-a)
| β¨(x : β), (y : β)β© => Or.inl trivial
| β¨-[_+1], -[_+1]β© => Or.inr trivial
| β¨0, -[_+1]β© => Or.inr trivial
| β¨-[_+1], 0β© => Or.inr trivial
| β¨(_ + 1 : β), -[_+1]β© => Nat.le_total _ _
| β¨-[_+1], (_ + 1 : β)β© => Nat.le_total _ _
#align zsqrtd.nonneg_total Zsqrtd.nonneg_total
protected theorem le_total (a b : β€βd) : a β€ b β¨ b β€ a := by
have t := (b - a).nonneg_total
rwa [neg_sub] at t
#align zsqrtd.le_total Zsqrtd.le_total
instance preorder : Preorder (β€βd) where
le := (Β· β€ Β·)
le_refl a := show Nonneg (a - a) by simp only [sub_self]; trivial
le_trans a b c hab hbc := by simpa [sub_add_sub_cancel'] using hab.add hbc
lt := (Β· < Β·)
lt_iff_le_not_le a b := (and_iff_right_of_imp (Zsqrtd.le_total _ _).resolve_left).symm
open Int in
theorem le_arch (a : β€βd) : β n : β, a β€ n := by
obtain β¨x, y, (h : a β€ β¨x, yβ©)β© : β x y : β, Nonneg (β¨x, yβ© + -a) :=
match -a with
| β¨Int.ofNat x, Int.ofNat yβ© => β¨0, 0, by trivialβ©
| β¨Int.ofNat x, -[y+1]β© => β¨0, y + 1, by simp [add_def, Int.negSucc_coe, add_assoc]; trivialβ©
| β¨-[x+1], Int.ofNat yβ© => β¨x + 1, 0, by simp [Int.negSucc_coe, add_assoc]; trivialβ©
| β¨-[x+1], -[y+1]β© => β¨x + 1, y + 1, by simp [Int.negSucc_coe, add_assoc]; trivialβ©
refine β¨x + d * y, h.trans ?_β©
change Nonneg β¨βx + d * y - βx, 0 - βyβ©
cases' y with y
Β· simp
trivial
have h : β y, SqLe y d (d * y) 1 := fun y => by
simpa [SqLe, mul_comm, mul_left_comm] using Nat.mul_le_mul_right (y * y) (Nat.le_mul_self d)
rw [show (x : β€) + d * Nat.succ y - x = d * Nat.succ y by simp]
exact h (y + 1)
#align zsqrtd.le_arch Zsqrtd.le_arch
protected theorem add_le_add_left (a b : β€βd) (ab : a β€ b) (c : β€βd) : c + a β€ c + b :=
show Nonneg _ by rw [add_sub_add_left_eq_sub]; exact ab
#align zsqrtd.add_le_add_left Zsqrtd.add_le_add_left
protected theorem le_of_add_le_add_left (a b c : β€βd) (h : c + a β€ c + b) : a β€ b := by
simpa using Zsqrtd.add_le_add_left _ _ h (-c)
#align zsqrtd.le_of_add_le_add_left Zsqrtd.le_of_add_le_add_left
protected theorem add_lt_add_left (a b : β€βd) (h : a < b) (c) : c + a < c + b := fun h' =>
h (Zsqrtd.le_of_add_le_add_left _ _ _ h')
#align zsqrtd.add_lt_add_left Zsqrtd.add_lt_add_left
theorem nonneg_smul {a : β€βd} {n : β} (ha : Nonneg a) : Nonneg ((n : β€βd) * a) := by
rw [β Int.cast_natCast n]
exact
match a, nonneg_cases ha, ha with
| _, β¨x, y, Or.inl rflβ©, _ => by rw [smul_val]; trivial
| _, β¨x, y, Or.inr <| Or.inl rflβ©, ha => by
rw [smul_val]; simpa using nonnegg_pos_neg.2 (sqLe_smul n <| nonnegg_pos_neg.1 ha)
| _, β¨x, y, Or.inr <| Or.inr rflβ©, ha => by
rw [smul_val]; simpa using nonnegg_neg_pos.2 (sqLe_smul n <| nonnegg_neg_pos.1 ha)
#align zsqrtd.nonneg_smul Zsqrtd.nonneg_smul
theorem nonneg_muld {a : β€βd} (ha : Nonneg a) : Nonneg (sqrtd * a) :=
match a, nonneg_cases ha, ha with
| _, β¨_, _, Or.inl rflβ©, _ => trivial
| _, β¨x, y, Or.inr <| Or.inl rflβ©, ha => by
simp only [muld_val, mul_neg]
apply nonnegg_neg_pos.2
simpa [SqLe, mul_comm, mul_left_comm] using Nat.mul_le_mul_left d (nonnegg_pos_neg.1 ha)
| _, β¨x, y, Or.inr <| Or.inr rflβ©, ha => by
simp only [muld_val]
apply nonnegg_pos_neg.2
simpa [SqLe, mul_comm, mul_left_comm] using Nat.mul_le_mul_left d (nonnegg_neg_pos.1 ha)
#align zsqrtd.nonneg_muld Zsqrtd.nonneg_muld
theorem nonneg_mul_lem {x y : β} {a : β€βd} (ha : Nonneg a) : Nonneg (β¨x, yβ© * a) := by
have : (β¨x, yβ© * a : β€βd) = (x : β€βd) * a + sqrtd * ((y : β€βd) * a) := by
rw [decompose, right_distrib, mul_assoc, Int.cast_natCast, Int.cast_natCast]
rw [this]
exact (nonneg_smul ha).add (nonneg_muld <| nonneg_smul ha)
#align zsqrtd.nonneg_mul_lem Zsqrtd.nonneg_mul_lem
| Mathlib/NumberTheory/Zsqrtd/Basic.lean | 813 | 848 | theorem nonneg_mul {a b : β€βd} (ha : Nonneg a) (hb : Nonneg b) : Nonneg (a * b) :=
match a, b, nonneg_cases ha, nonneg_cases hb, ha, hb with
| _, _, β¨_, _, Or.inl rflβ©, β¨_, _, Or.inl rflβ©, _, _ => trivial
| _, _, β¨x, y, Or.inl rflβ©, β¨z, w, Or.inr <| Or.inr rflβ©, _, hb => nonneg_mul_lem hb
| _, _, β¨x, y, Or.inl rflβ©, β¨z, w, Or.inr <| Or.inl rflβ©, _, hb => nonneg_mul_lem hb
| _, _, β¨x, y, Or.inr <| Or.inr rflβ©, β¨z, w, Or.inl rflβ©, ha, _ => by
rw [mul_comm]; exact nonneg_mul_lem ha
| _, _, β¨x, y, Or.inr <| Or.inl rflβ©, β¨z, w, Or.inl rflβ©, ha, _ => by
rw [mul_comm]; exact nonneg_mul_lem ha
| _, _, β¨x, y, Or.inr <| Or.inr rflβ©, β¨z, w, Or.inr <| Or.inr rflβ©, ha, hb => by
rw [calc
(β¨-x, yβ© * β¨-z, wβ© : β€βd) = β¨_, _β© := rfl
_ = β¨x * z + d * y * w, -(x * w + y * z)β© := by | simp [add_comm]
]
exact nonnegg_pos_neg.2 (sqLe_mul.left (nonnegg_neg_pos.1 ha) (nonnegg_neg_pos.1 hb))
| _, _, β¨x, y, Or.inr <| Or.inr rflβ©, β¨z, w, Or.inr <| Or.inl rflβ©, ha, hb => by
rw [calc
(β¨-x, yβ© * β¨z, -wβ© : β€βd) = β¨_, _β© := rfl
_ = β¨-(x * z + d * y * w), x * w + y * zβ© := by simp [add_comm]
]
exact nonnegg_neg_pos.2 (sqLe_mul.right.left (nonnegg_neg_pos.1 ha) (nonnegg_pos_neg.1 hb))
| _, _, β¨x, y, Or.inr <| Or.inl rflβ©, β¨z, w, Or.inr <| Or.inr rflβ©, ha, hb => by
rw [calc
(β¨x, -yβ© * β¨-z, wβ© : β€βd) = β¨_, _β© := rfl
_ = β¨-(x * z + d * y * w), x * w + y * zβ© := by simp [add_comm]
]
exact
nonnegg_neg_pos.2 (sqLe_mul.right.right.left (nonnegg_pos_neg.1 ha) (nonnegg_neg_pos.1 hb))
| _, _, β¨x, y, Or.inr <| Or.inl rflβ©, β¨z, w, Or.inr <| Or.inl rflβ©, ha, hb => by
rw [calc
(β¨x, -yβ© * β¨z, -wβ© : β€βd) = β¨_, _β© := rfl
_ = β¨x * z + d * y * w, -(x * w + y * z)β© := by simp [add_comm]
]
exact
nonnegg_pos_neg.2
(sqLe_mul.right.right.right (nonnegg_pos_neg.1 ha) (nonnegg_pos_neg.1 hb))
|
import Mathlib.Algebra.GroupWithZero.Divisibility
import Mathlib.Algebra.Order.Group.Int
import Mathlib.Algebra.Order.Ring.Nat
import Mathlib.Algebra.Ring.Rat
import Mathlib.Data.PNat.Defs
#align_import data.rat.lemmas from "leanprover-community/mathlib"@"550b58538991c8977703fdeb7c9d51a5aa27df11"
namespace Rat
open Rat
theorem num_dvd (a) {b : β€} (b0 : b β 0) : (a /. b).num β£ a := by
cases' e : a /. b with n d h c
rw [Rat.mk'_eq_divInt, divInt_eq_iff b0 (mod_cast h)] at e
refine Int.natAbs_dvd.1 <| Int.dvd_natAbs.1 <| Int.natCast_dvd_natCast.2 <|
c.dvd_of_dvd_mul_right ?_
have := congr_arg Int.natAbs e
simp only [Int.natAbs_mul, Int.natAbs_ofNat] at this; simp [this]
#align rat.num_dvd Rat.num_dvd
theorem den_dvd (a b : β€) : ((a /. b).den : β€) β£ b := by
by_cases b0 : b = 0; Β· simp [b0]
cases' e : a /. b with n d h c
rw [mk'_eq_divInt, divInt_eq_iff b0 (ne_of_gt (Int.natCast_pos.2 (Nat.pos_of_ne_zero h)))] at e
refine Int.dvd_natAbs.1 <| Int.natCast_dvd_natCast.2 <| c.symm.dvd_of_dvd_mul_left ?_
rw [β Int.natAbs_mul, β Int.natCast_dvd_natCast, Int.dvd_natAbs, β e]; simp
#align rat.denom_dvd Rat.den_dvd
theorem num_den_mk {q : β} {n d : β€} (hd : d β 0) (qdf : q = n /. d) :
β c : β€, n = c * q.num β§ d = c * q.den := by
obtain rfl | hn := eq_or_ne n 0
Β· simp [qdf]
have : q.num * d = n * βq.den := by
refine (divInt_eq_iff ?_ hd).mp ?_
Β· exact Int.natCast_ne_zero.mpr (Rat.den_nz _)
Β· rwa [num_divInt_den]
have hqdn : q.num β£ n := by
rw [qdf]
exact Rat.num_dvd _ hd
refine β¨n / q.num, ?_, ?_β©
Β· rw [Int.ediv_mul_cancel hqdn]
Β· refine Int.eq_mul_div_of_mul_eq_mul_of_dvd_left ?_ hqdn this
rw [qdf]
exact Rat.num_ne_zero.2 ((divInt_ne_zero hd).mpr hn)
#align rat.num_denom_mk Rat.num_den_mk
#noalign rat.mk_pnat_num
#noalign rat.mk_pnat_denom
theorem num_mk (n d : β€) : (n /. d).num = d.sign * n / n.gcd d := by
have (m : β) : Int.natAbs (m + 1) = m + 1 := by
rw [β Nat.cast_one, β Nat.cast_add, Int.natAbs_cast]
rcases d with ((_ | _) | _) <;>
rw [β Int.div_eq_ediv_of_dvd] <;>
simp [divInt, mkRat, Rat.normalize, Nat.succPNat, Int.sign, Int.gcd,
Int.zero_ediv, Int.ofNat_dvd_left, Nat.gcd_dvd_left, this]
#align rat.num_mk Rat.num_mk
theorem den_mk (n d : β€) : (n /. d).den = if d = 0 then 1 else d.natAbs / n.gcd d := by
have (m : β) : Int.natAbs (m + 1) = m + 1 := by
rw [β Nat.cast_one, β Nat.cast_add, Int.natAbs_cast]
rcases d with ((_ | _) | _) <;>
simp [divInt, mkRat, Rat.normalize, Nat.succPNat, Int.sign, Int.gcd,
if_neg (Nat.cast_add_one_ne_zero _), this]
#align rat.denom_mk Rat.den_mk
#noalign rat.mk_pnat_denom_dvd
theorem add_den_dvd (qβ qβ : β) : (qβ + qβ).den β£ qβ.den * qβ.den := by
rw [add_def, normalize_eq]
apply Nat.div_dvd_of_dvd
apply Nat.gcd_dvd_right
#align rat.add_denom_dvd Rat.add_den_dvd
theorem mul_den_dvd (qβ qβ : β) : (qβ * qβ).den β£ qβ.den * qβ.den := by
rw [mul_def, normalize_eq]
apply Nat.div_dvd_of_dvd
apply Nat.gcd_dvd_right
#align rat.mul_denom_dvd Rat.mul_den_dvd
theorem mul_num (qβ qβ : β) :
(qβ * qβ).num = qβ.num * qβ.num / Nat.gcd (qβ.num * qβ.num).natAbs (qβ.den * qβ.den) := by
rw [mul_def, normalize_eq]
#align rat.mul_num Rat.mul_num
| Mathlib/Data/Rat/Lemmas.lean | 98 | 101 | theorem mul_den (qβ qβ : β) :
(qβ * qβ).den =
qβ.den * qβ.den / Nat.gcd (qβ.num * qβ.num).natAbs (qβ.den * qβ.den) := by |
rw [mul_def, normalize_eq]
|
import Mathlib.Analysis.SpecialFunctions.Exp
import Mathlib.Data.Nat.Factorization.Basic
import Mathlib.Analysis.NormedSpace.Real
#align_import analysis.special_functions.log.basic from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690"
open Set Filter Function
open Topology
noncomputable section
namespace Real
variable {x y : β}
-- @[pp_nodot] -- Porting note: removed
noncomputable def log (x : β) : β :=
if hx : x = 0 then 0 else expOrderIso.symm β¨|x|, abs_pos.2 hxβ©
#align real.log Real.log
theorem log_of_ne_zero (hx : x β 0) : log x = expOrderIso.symm β¨|x|, abs_pos.2 hxβ© :=
dif_neg hx
#align real.log_of_ne_zero Real.log_of_ne_zero
theorem log_of_pos (hx : 0 < x) : log x = expOrderIso.symm β¨x, hxβ© := by
rw [log_of_ne_zero hx.ne']
congr
exact abs_of_pos hx
#align real.log_of_pos Real.log_of_pos
theorem exp_log_eq_abs (hx : x β 0) : exp (log x) = |x| := by
rw [log_of_ne_zero hx, β coe_expOrderIso_apply, OrderIso.apply_symm_apply, Subtype.coe_mk]
#align real.exp_log_eq_abs Real.exp_log_eq_abs
theorem exp_log (hx : 0 < x) : exp (log x) = x := by
rw [exp_log_eq_abs hx.ne']
exact abs_of_pos hx
#align real.exp_log Real.exp_log
theorem exp_log_of_neg (hx : x < 0) : exp (log x) = -x := by
rw [exp_log_eq_abs (ne_of_lt hx)]
exact abs_of_neg hx
#align real.exp_log_of_neg Real.exp_log_of_neg
theorem le_exp_log (x : β) : x β€ exp (log x) := by
by_cases h_zero : x = 0
Β· rw [h_zero, log, dif_pos rfl, exp_zero]
exact zero_le_one
Β· rw [exp_log_eq_abs h_zero]
exact le_abs_self _
#align real.le_exp_log Real.le_exp_log
@[simp]
theorem log_exp (x : β) : log (exp x) = x :=
exp_injective <| exp_log (exp_pos x)
#align real.log_exp Real.log_exp
theorem surjOn_log : SurjOn log (Ioi 0) univ := fun x _ => β¨exp x, exp_pos x, log_exp xβ©
#align real.surj_on_log Real.surjOn_log
theorem log_surjective : Surjective log := fun x => β¨exp x, log_exp xβ©
#align real.log_surjective Real.log_surjective
@[simp]
theorem range_log : range log = univ :=
log_surjective.range_eq
#align real.range_log Real.range_log
@[simp]
theorem log_zero : log 0 = 0 :=
dif_pos rfl
#align real.log_zero Real.log_zero
@[simp]
theorem log_one : log 1 = 0 :=
exp_injective <| by rw [exp_log zero_lt_one, exp_zero]
#align real.log_one Real.log_one
@[simp]
| Mathlib/Analysis/SpecialFunctions/Log/Basic.lean | 104 | 107 | theorem log_abs (x : β) : log |x| = log x := by |
by_cases h : x = 0
Β· simp [h]
Β· rw [β exp_eq_exp, exp_log_eq_abs h, exp_log_eq_abs (abs_pos.2 h).ne', abs_abs]
|
import Mathlib.Algebra.Algebra.Subalgebra.Pointwise
import Mathlib.AlgebraicGeometry.PrimeSpectrum.Maximal
import Mathlib.AlgebraicGeometry.PrimeSpectrum.Noetherian
import Mathlib.RingTheory.ChainOfDivisors
import Mathlib.RingTheory.DedekindDomain.Basic
import Mathlib.RingTheory.FractionalIdeal.Operations
#align_import ring_theory.dedekind_domain.ideal from "leanprover-community/mathlib"@"2bbc7e3884ba234309d2a43b19144105a753292e"
variable (R A K : Type*) [CommRing R] [CommRing A] [Field K]
open scoped nonZeroDivisors Polynomial
section Inverse
namespace FractionalIdeal
variable {Rβ : Type*} [CommRing Rβ] [IsDomain Rβ] [Algebra Rβ K] [IsFractionRing Rβ K]
variable {I J : FractionalIdeal Rββ° K}
noncomputable instance : Inv (FractionalIdeal Rββ° K) := β¨fun I => 1 / Iβ©
theorem inv_eq : Iβ»ΒΉ = 1 / I := rfl
#align fractional_ideal.inv_eq FractionalIdeal.inv_eq
theorem inv_zero' : (0 : FractionalIdeal Rββ° K)β»ΒΉ = 0 := div_zero
#align fractional_ideal.inv_zero' FractionalIdeal.inv_zero'
theorem inv_nonzero {J : FractionalIdeal Rββ° K} (h : J β 0) :
Jβ»ΒΉ = β¨(1 : FractionalIdeal Rββ° K) / J, fractional_div_of_nonzero hβ© := div_nonzero h
#align fractional_ideal.inv_nonzero FractionalIdeal.inv_nonzero
theorem coe_inv_of_nonzero {J : FractionalIdeal Rββ° K} (h : J β 0) :
(βJβ»ΒΉ : Submodule Rβ K) = IsLocalization.coeSubmodule K β€ / (J : Submodule Rβ K) := by
simp_rw [inv_nonzero _ h, coe_one, coe_mk, IsLocalization.coeSubmodule_top]
#align fractional_ideal.coe_inv_of_nonzero FractionalIdeal.coe_inv_of_nonzero
variable {K}
theorem mem_inv_iff (hI : I β 0) {x : K} : x β Iβ»ΒΉ β β y β I, x * y β (1 : FractionalIdeal Rββ° K) :=
mem_div_iff_of_nonzero hI
#align fractional_ideal.mem_inv_iff FractionalIdeal.mem_inv_iff
theorem inv_anti_mono (hI : I β 0) (hJ : J β 0) (hIJ : I β€ J) : Jβ»ΒΉ β€ Iβ»ΒΉ := by
-- Porting note: in Lean3, introducing `x` would just give `x β Jβ»ΒΉ β x β Iβ»ΒΉ`, but
-- in Lean4, it goes all the way down to the subtypes
intro x
simp only [val_eq_coe, mem_coe, mem_inv_iff hJ, mem_inv_iff hI]
exact fun h y hy => h y (hIJ hy)
#align fractional_ideal.inv_anti_mono FractionalIdeal.inv_anti_mono
theorem le_self_mul_inv {I : FractionalIdeal Rββ° K} (hI : I β€ (1 : FractionalIdeal Rββ° K)) :
I β€ I * Iβ»ΒΉ :=
le_self_mul_one_div hI
#align fractional_ideal.le_self_mul_inv FractionalIdeal.le_self_mul_inv
variable (K)
theorem coe_ideal_le_self_mul_inv (I : Ideal Rβ) :
(I : FractionalIdeal Rββ° K) β€ I * (I : FractionalIdeal Rββ° K)β»ΒΉ :=
le_self_mul_inv coeIdeal_le_one
#align fractional_ideal.coe_ideal_le_self_mul_inv FractionalIdeal.coe_ideal_le_self_mul_inv
| Mathlib/RingTheory/DedekindDomain/Ideal.lean | 108 | 122 | theorem right_inverse_eq (I J : FractionalIdeal Rββ° K) (h : I * J = 1) : J = Iβ»ΒΉ := by |
have hI : I β 0 := ne_zero_of_mul_eq_one I J h
suffices h' : I * (1 / I) = 1 from
congr_arg Units.inv <| @Units.ext _ _ (Units.mkOfMulEqOne _ _ h) (Units.mkOfMulEqOne _ _ h') rfl
apply le_antisymm
Β· apply mul_le.mpr _
intro x hx y hy
rw [mul_comm]
exact (mem_div_iff_of_nonzero hI).mp hy x hx
rw [β h]
apply mul_left_mono I
apply (le_div_iff_of_nonzero hI).mpr _
intro y hy x hx
rw [mul_comm]
exact mul_mem_mul hx hy
|
import Mathlib.Order.Interval.Set.Monotone
import Mathlib.Probability.Process.HittingTime
import Mathlib.Probability.Martingale.Basic
import Mathlib.Tactic.AdaptationNote
#align_import probability.martingale.upcrossing from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
open TopologicalSpace Filter
open scoped NNReal ENNReal MeasureTheory ProbabilityTheory Topology
namespace MeasureTheory
variable {Ξ© ΞΉ : Type*} {m0 : MeasurableSpace Ξ©} {ΞΌ : Measure Ξ©}
noncomputable def lowerCrossingTimeAux [Preorder ΞΉ] [InfSet ΞΉ] (a : β) (f : ΞΉ β Ξ© β β) (c N : ΞΉ) :
Ξ© β ΞΉ :=
hitting f (Set.Iic a) c N
#align measure_theory.lower_crossing_time_aux MeasureTheory.lowerCrossingTimeAux
noncomputable def upperCrossingTime [Preorder ΞΉ] [OrderBot ΞΉ] [InfSet ΞΉ] (a b : β) (f : ΞΉ β Ξ© β β)
(N : ΞΉ) : β β Ξ© β ΞΉ
| 0 => β₯
| n + 1 => fun Ο =>
hitting f (Set.Ici b) (lowerCrossingTimeAux a f (upperCrossingTime a b f N n Ο) N Ο) N Ο
#align measure_theory.upper_crossing_time MeasureTheory.upperCrossingTime
noncomputable def lowerCrossingTime [Preorder ΞΉ] [OrderBot ΞΉ] [InfSet ΞΉ] (a b : β) (f : ΞΉ β Ξ© β β)
(N : ΞΉ) (n : β) : Ξ© β ΞΉ := fun Ο => hitting f (Set.Iic a) (upperCrossingTime a b f N n Ο) N Ο
#align measure_theory.lower_crossing_time MeasureTheory.lowerCrossingTime
section
variable [Preorder ΞΉ] [OrderBot ΞΉ] [InfSet ΞΉ]
variable {a b : β} {f : ΞΉ β Ξ© β β} {N : ΞΉ} {n m : β} {Ο : Ξ©}
@[simp]
theorem upperCrossingTime_zero : upperCrossingTime a b f N 0 = β₯ :=
rfl
#align measure_theory.upper_crossing_time_zero MeasureTheory.upperCrossingTime_zero
@[simp]
theorem lowerCrossingTime_zero : lowerCrossingTime a b f N 0 = hitting f (Set.Iic a) β₯ N :=
rfl
#align measure_theory.lower_crossing_time_zero MeasureTheory.lowerCrossingTime_zero
theorem upperCrossingTime_succ : upperCrossingTime a b f N (n + 1) Ο =
hitting f (Set.Ici b) (lowerCrossingTimeAux a f (upperCrossingTime a b f N n Ο) N Ο) N Ο := by
rw [upperCrossingTime]
#align measure_theory.upper_crossing_time_succ MeasureTheory.upperCrossingTime_succ
theorem upperCrossingTime_succ_eq (Ο : Ξ©) : upperCrossingTime a b f N (n + 1) Ο =
hitting f (Set.Ici b) (lowerCrossingTime a b f N n Ο) N Ο := by
simp only [upperCrossingTime_succ]
rfl
#align measure_theory.upper_crossing_time_succ_eq MeasureTheory.upperCrossingTime_succ_eq
end
section ConditionallyCompleteLinearOrderBot
variable [ConditionallyCompleteLinearOrderBot ΞΉ]
variable {a b : β} {f : ΞΉ β Ξ© β β} {N : ΞΉ} {n m : β} {Ο : Ξ©}
theorem upperCrossingTime_le : upperCrossingTime a b f N n Ο β€ N := by
cases n
Β· simp only [upperCrossingTime_zero, Pi.bot_apply, bot_le, Nat.zero_eq]
Β· simp only [upperCrossingTime_succ, hitting_le]
#align measure_theory.upper_crossing_time_le MeasureTheory.upperCrossingTime_le
@[simp]
theorem upperCrossingTime_zero' : upperCrossingTime a b f β₯ n Ο = β₯ :=
eq_bot_iff.2 upperCrossingTime_le
#align measure_theory.upper_crossing_time_zero' MeasureTheory.upperCrossingTime_zero'
| Mathlib/Probability/Martingale/Upcrossing.lean | 197 | 198 | theorem lowerCrossingTime_le : lowerCrossingTime a b f N n Ο β€ N := by |
simp only [lowerCrossingTime, hitting_le Ο]
|
import Mathlib.Algebra.Algebra.Unitization
import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul
suppress_compilation
variable (π A : Type*) [NontriviallyNormedField π] [NonUnitalNormedRing A]
variable [NormedSpace π A] [IsScalarTower π A A] [SMulCommClass π A A]
open ContinuousLinearMap
namespace Unitization
def splitMul : Unitization π A ββ[π] π Γ (A βL[π] A) :=
(lift 0).prod (lift <| NonUnitalAlgHom.Lmul π A)
variable {π A}
@[simp]
theorem splitMul_apply (x : Unitization π A) :
splitMul π A x = (x.fst, algebraMap π (A βL[π] A) x.fst + mul π A x.snd) :=
show (x.fst + 0, _) = (x.fst, _) by rw [add_zero]; rfl
theorem splitMul_injective_of_clm_mul_injective
(h : Function.Injective (mul π A)) :
Function.Injective (splitMul π A) := by
rw [injective_iff_map_eq_zero]
intro x hx
induction x
rw [map_add] at hx
simp only [splitMul_apply, fst_inl, snd_inl, map_zero, add_zero, fst_inr, snd_inr,
zero_add, Prod.mk_add_mk, Prod.mk_eq_zero] at hx
obtain β¨rfl, hxβ© := hx
simp only [map_zero, zero_add, inl_zero] at hx β’
rw [β map_zero (mul π A)] at hx
rw [h hx, inr_zero]
variable [RegularNormedAlgebra π A]
variable (π A)
theorem splitMul_injective : Function.Injective (splitMul π A) :=
splitMul_injective_of_clm_mul_injective (isometry_mul π A).injective
variable {π A}
section Aux
noncomputable abbrev normedRingAux : NormedRing (Unitization π A) :=
NormedRing.induced (Unitization π A) (π Γ (A βL[π] A)) (splitMul π A) (splitMul_injective π A)
attribute [local instance] Unitization.normedRingAux
noncomputable abbrev normedAlgebraAux : NormedAlgebra π (Unitization π A) :=
NormedAlgebra.induced π (Unitization π A) (π Γ (A βL[π] A)) (splitMul π A)
attribute [local instance] Unitization.normedAlgebraAux
theorem norm_def (x : Unitization π A) : βxβ = βsplitMul π A xβ :=
rfl
theorem nnnorm_def (x : Unitization π A) : βxββ = βsplitMul π A xββ :=
rfl
| Mathlib/Analysis/NormedSpace/Unitization.lean | 139 | 141 | theorem norm_eq_sup (x : Unitization π A) :
βxβ = βx.fstβ β βalgebraMap π (A βL[π] A) x.fst + mul π A x.sndβ := by |
rw [norm_def, splitMul_apply, Prod.norm_def, sup_eq_max]
|
import Mathlib.RingTheory.TensorProduct.Basic
#align_import algebra.module.bimodule from "leanprover-community/mathlib"@"58cef51f7a819e7227224461e392dee423302f2d"
open TensorProduct
attribute [local instance] TensorProduct.Algebra.module
namespace Subbimodule
section Algebra
variable {R A B M : Type*}
variable [CommSemiring R] [AddCommMonoid M] [Module R M]
variable [Semiring A] [Semiring B] [Module A M] [Module B M]
variable [Algebra R A] [Algebra R B]
variable [IsScalarTower R A M] [IsScalarTower R B M]
variable [SMulCommClass A B M]
@[simps]
def mk (p : AddSubmonoid M) (hA : β (a : A) {m : M}, m β p β a β’ m β p)
(hB : β (b : B) {m : M}, m β p β b β’ m β p) : Submodule (A β[R] B) M :=
{ p with
carrier := p
smul_mem' := fun ab m =>
TensorProduct.induction_on ab (fun _ => by simpa only [zero_smul] using p.zero_mem)
(fun a b hm => by simpa only [TensorProduct.Algebra.smul_def] using hA a (hB b hm))
fun z w hz hw hm => by simpa only [add_smul] using p.add_mem (hz hm) (hw hm) }
#align subbimodule.mk Subbimodule.mk
theorem smul_mem (p : Submodule (A β[R] B) M) (a : A) {m : M} (hm : m β p) : a β’ m β p := by
suffices a β’ m = a ββ[R] (1 : B) β’ m by exact this.symm βΈ p.smul_mem _ hm
simp [TensorProduct.Algebra.smul_def]
#align subbimodule.smul_mem Subbimodule.smul_mem
| Mathlib/Algebra/Module/Bimodule.lean | 95 | 97 | theorem smul_mem' (p : Submodule (A β[R] B) M) (b : B) {m : M} (hm : m β p) : b β’ m β p := by |
suffices b β’ m = (1 : A) ββ[R] b β’ m by exact this.symm βΈ p.smul_mem _ hm
simp [TensorProduct.Algebra.smul_def]
|
import Mathlib.Dynamics.Ergodic.MeasurePreserving
import Mathlib.MeasureTheory.Function.SimpleFunc
import Mathlib.MeasureTheory.Measure.MutuallySingular
import Mathlib.MeasureTheory.Measure.Count
import Mathlib.Topology.IndicatorConstPointwise
import Mathlib.MeasureTheory.Constructions.BorelSpace.Real
#align_import measure_theory.integral.lebesgue from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520"
assert_not_exists NormedSpace
set_option autoImplicit true
noncomputable section
open Set hiding restrict restrict_apply
open Filter ENNReal
open Function (support)
open scoped Classical
open Topology NNReal ENNReal MeasureTheory
namespace MeasureTheory
local infixr:25 " ββ " => SimpleFunc
variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*}
section Lintegral
open SimpleFunc
variable {m : MeasurableSpace Ξ±} {ΞΌ Ξ½ : Measure Ξ±}
irreducible_def lintegral {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (f : Ξ± β ββ₯0β) : ββ₯0β :=
β¨ (g : Ξ± ββ ββ₯0β) (_ : βg β€ f), g.lintegral ΞΌ
#align measure_theory.lintegral MeasureTheory.lintegral
@[inherit_doc MeasureTheory.lintegral]
notation3 "β«β» "(...)", "r:60:(scoped f => f)" β"ΞΌ:70 => lintegral ΞΌ r
@[inherit_doc MeasureTheory.lintegral]
notation3 "β«β» "(...)", "r:60:(scoped f => lintegral volume f) => r
@[inherit_doc MeasureTheory.lintegral]
notation3"β«β» "(...)" in "s", "r:60:(scoped f => f)" β"ΞΌ:70 => lintegral (Measure.restrict ΞΌ s) r
@[inherit_doc MeasureTheory.lintegral]
notation3"β«β» "(...)" in "s", "r:60:(scoped f => lintegral (Measure.restrict volume s) f) => r
theorem SimpleFunc.lintegral_eq_lintegral {m : MeasurableSpace Ξ±} (f : Ξ± ββ ββ₯0β) (ΞΌ : Measure Ξ±) :
β«β» a, f a βΞΌ = f.lintegral ΞΌ := by
rw [MeasureTheory.lintegral]
exact le_antisymm (iSupβ_le fun g hg => lintegral_mono hg <| le_rfl)
(le_iSupβ_of_le f le_rfl le_rfl)
#align measure_theory.simple_func.lintegral_eq_lintegral MeasureTheory.SimpleFunc.lintegral_eq_lintegral
@[mono]
| Mathlib/MeasureTheory/Integral/Lebesgue.lean | 90 | 93 | theorem lintegral_mono' {m : MeasurableSpace Ξ±} β¦ΞΌ Ξ½ : Measure Ξ±β¦ (hΞΌΞ½ : ΞΌ β€ Ξ½) β¦f g : Ξ± β ββ₯0ββ¦
(hfg : f β€ g) : β«β» a, f a βΞΌ β€ β«β» a, g a βΞ½ := by |
rw [lintegral, lintegral]
exact iSup_mono fun Ο => iSup_mono' fun hΟ => β¨le_trans hΟ hfg, lintegral_mono (le_refl Ο) hΞΌΞ½β©
|
import Mathlib.CategoryTheory.PathCategory
import Mathlib.CategoryTheory.Functor.FullyFaithful
import Mathlib.CategoryTheory.Bicategory.Free
import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete
#align_import category_theory.bicategory.coherence from "leanprover-community/mathlib"@"f187f1074fa1857c94589cc653c786cadc4c35ff"
open Quiver (Path)
open Quiver.Path
namespace CategoryTheory
open Bicategory Category
universe v u
namespace FreeBicategory
variable {B : Type u} [Quiver.{v + 1} B]
@[simp]
def inclusionPathAux {a : B} : β {b : B}, Path a b β Hom a b
| _, nil => Hom.id a
| _, cons p f => (inclusionPathAux p).comp (Hom.of f)
#align category_theory.free_bicategory.inclusion_path_aux CategoryTheory.FreeBicategory.inclusionPathAux
local instance homCategory' (a b : B) : Category (Hom a b) :=
homCategory a b
def inclusionPath (a b : B) : Discrete (Path.{v + 1} a b) β₯€ Hom a b :=
Discrete.functor inclusionPathAux
#align category_theory.free_bicategory.inclusion_path CategoryTheory.FreeBicategory.inclusionPath
def preinclusion (B : Type u) [Quiver.{v + 1} B] :
PrelaxFunctor (LocallyDiscrete (Paths B)) (FreeBicategory B) where
obj a := a.as
map := @fun a b f => (@inclusionPath B _ a.as b.as).obj f
mapβ Ξ· := (inclusionPath _ _).map Ξ·
#align category_theory.free_bicategory.preinclusion CategoryTheory.FreeBicategory.preinclusion
@[simp]
theorem preinclusion_obj (a : B) : (preinclusion B).obj β¨aβ© = a :=
rfl
#align category_theory.free_bicategory.preinclusion_obj CategoryTheory.FreeBicategory.preinclusion_obj
@[simp]
| Mathlib/CategoryTheory/Bicategory/Coherence.lean | 94 | 98 | theorem preinclusion_mapβ {a b : B} (f g : Discrete (Path.{v + 1} a b)) (Ξ· : f βΆ g) :
(preinclusion B).mapβ Ξ· = eqToHom (congr_arg _ (Discrete.ext _ _ (Discrete.eq_of_hom Ξ·))) := by |
rcases Ξ· with β¨β¨β©β©
cases Discrete.ext _ _ (by assumption)
convert (inclusionPath a b).map_id _
|
import Mathlib.Topology.Compactness.SigmaCompact
import Mathlib.Topology.Connected.TotallyDisconnected
import Mathlib.Topology.Inseparable
#align_import topology.separation from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d"
open Function Set Filter Topology TopologicalSpace
open scoped Classical
universe u v
variable {X : Type*} {Y : Type*} [TopologicalSpace X]
section Separation
def SeparatedNhds : Set X β Set X β Prop := fun s t : Set X =>
β U V : Set X, IsOpen U β§ IsOpen V β§ s β U β§ t β V β§ Disjoint U V
#align separated_nhds SeparatedNhds
theorem separatedNhds_iff_disjoint {s t : Set X} : SeparatedNhds s t β Disjoint (πΛ’ s) (πΛ’ t) := by
simp only [(hasBasis_nhdsSet s).disjoint_iff (hasBasis_nhdsSet t), SeparatedNhds, exists_prop, β
exists_and_left, and_assoc, and_comm, and_left_comm]
#align separated_nhds_iff_disjoint separatedNhds_iff_disjoint
alias β¨SeparatedNhds.disjoint_nhdsSet, _β© := separatedNhds_iff_disjoint
class T0Space (X : Type u) [TopologicalSpace X] : Prop where
t0 : β β¦x y : Xβ¦, Inseparable x y β x = y
#align t0_space T0Space
theorem t0Space_iff_inseparable (X : Type u) [TopologicalSpace X] :
T0Space X β β x y : X, Inseparable x y β x = y :=
β¨fun β¨hβ© => h, fun h => β¨hβ©β©
#align t0_space_iff_inseparable t0Space_iff_inseparable
theorem t0Space_iff_not_inseparable (X : Type u) [TopologicalSpace X] :
T0Space X β Pairwise fun x y : X => Β¬Inseparable x y := by
simp only [t0Space_iff_inseparable, Ne, not_imp_not, Pairwise]
#align t0_space_iff_not_inseparable t0Space_iff_not_inseparable
theorem Inseparable.eq [T0Space X] {x y : X} (h : Inseparable x y) : x = y :=
T0Space.t0 h
#align inseparable.eq Inseparable.eq
protected theorem Inducing.injective [TopologicalSpace Y] [T0Space X] {f : X β Y}
(hf : Inducing f) : Injective f := fun _ _ h =>
(hf.inseparable_iff.1 <| .of_eq h).eq
#align inducing.injective Inducing.injective
protected theorem Inducing.embedding [TopologicalSpace Y] [T0Space X] {f : X β Y}
(hf : Inducing f) : Embedding f :=
β¨hf, hf.injectiveβ©
#align inducing.embedding Inducing.embedding
lemma embedding_iff_inducing [TopologicalSpace Y] [T0Space X] {f : X β Y} :
Embedding f β Inducing f :=
β¨Embedding.toInducing, Inducing.embeddingβ©
#align embedding_iff_inducing embedding_iff_inducing
theorem t0Space_iff_nhds_injective (X : Type u) [TopologicalSpace X] :
T0Space X β Injective (π : X β Filter X) :=
t0Space_iff_inseparable X
#align t0_space_iff_nhds_injective t0Space_iff_nhds_injective
theorem nhds_injective [T0Space X] : Injective (π : X β Filter X) :=
(t0Space_iff_nhds_injective X).1 βΉ_βΊ
#align nhds_injective nhds_injective
theorem inseparable_iff_eq [T0Space X] {x y : X} : Inseparable x y β x = y :=
nhds_injective.eq_iff
#align inseparable_iff_eq inseparable_iff_eq
@[simp]
theorem nhds_eq_nhds_iff [T0Space X] {a b : X} : π a = π b β a = b :=
nhds_injective.eq_iff
#align nhds_eq_nhds_iff nhds_eq_nhds_iff
@[simp]
theorem inseparable_eq_eq [T0Space X] : Inseparable = @Eq X :=
funextβ fun _ _ => propext inseparable_iff_eq
#align inseparable_eq_eq inseparable_eq_eq
theorem TopologicalSpace.IsTopologicalBasis.inseparable_iff {b : Set (Set X)}
(hb : IsTopologicalBasis b) {x y : X} : Inseparable x y β β s β b, (x β s β y β s) :=
β¨fun h s hs β¦ inseparable_iff_forall_open.1 h _ (hb.isOpen hs),
fun h β¦ hb.nhds_hasBasis.eq_of_same_basis <| by
convert hb.nhds_hasBasis using 2
exact and_congr_right (h _)β©
theorem TopologicalSpace.IsTopologicalBasis.eq_iff [T0Space X] {b : Set (Set X)}
(hb : IsTopologicalBasis b) {x y : X} : x = y β β s β b, (x β s β y β s) :=
inseparable_iff_eq.symm.trans hb.inseparable_iff
theorem t0Space_iff_exists_isOpen_xor'_mem (X : Type u) [TopologicalSpace X] :
T0Space X β Pairwise fun x y => β U : Set X, IsOpen U β§ Xor' (x β U) (y β U) := by
simp only [t0Space_iff_not_inseparable, xor_iff_not_iff, not_forall, exists_prop,
inseparable_iff_forall_open, Pairwise]
#align t0_space_iff_exists_is_open_xor_mem t0Space_iff_exists_isOpen_xor'_mem
theorem exists_isOpen_xor'_mem [T0Space X] {x y : X} (h : x β y) :
β U : Set X, IsOpen U β§ Xor' (x β U) (y β U) :=
(t0Space_iff_exists_isOpen_xor'_mem X).1 βΉ_βΊ h
#align exists_is_open_xor_mem exists_isOpen_xor'_mem
def specializationOrder (X) [TopologicalSpace X] [T0Space X] : PartialOrder X :=
{ specializationPreorder X, PartialOrder.lift (OrderDual.toDual β π) nhds_injective with }
#align specialization_order specializationOrder
instance SeparationQuotient.instT0Space : T0Space (SeparationQuotient X) :=
β¨fun x y => Quotient.inductionOnβ' x y fun _ _ h =>
SeparationQuotient.mk_eq_mk.2 <| SeparationQuotient.inducing_mk.inseparable_iff.1 hβ©
theorem minimal_nonempty_closed_subsingleton [T0Space X] {s : Set X} (hs : IsClosed s)
(hmin : β t, t β s β t.Nonempty β IsClosed t β t = s) : s.Subsingleton := by
clear Y -- Porting note: added
refine fun x hx y hy => of_not_not fun hxy => ?_
rcases exists_isOpen_xor'_mem hxy with β¨U, hUo, hUβ©
wlog h : x β U β§ y β U
Β· refine this hs hmin y hy x hx (Ne.symm hxy) U hUo hU.symm (hU.resolve_left h)
cases' h with hxU hyU
have : s \ U = s := hmin (s \ U) diff_subset β¨y, hy, hyUβ© (hs.sdiff hUo)
exact (this.symm.subset hx).2 hxU
#align minimal_nonempty_closed_subsingleton minimal_nonempty_closed_subsingleton
theorem minimal_nonempty_closed_eq_singleton [T0Space X] {s : Set X} (hs : IsClosed s)
(hne : s.Nonempty) (hmin : β t, t β s β t.Nonempty β IsClosed t β t = s) : β x, s = {x} :=
exists_eq_singleton_iff_nonempty_subsingleton.2
β¨hne, minimal_nonempty_closed_subsingleton hs hminβ©
#align minimal_nonempty_closed_eq_singleton minimal_nonempty_closed_eq_singleton
theorem IsClosed.exists_closed_singleton [T0Space X] [CompactSpace X] {S : Set X}
(hS : IsClosed S) (hne : S.Nonempty) : β x : X, x β S β§ IsClosed ({x} : Set X) := by
obtain β¨V, Vsub, Vne, Vcls, hVβ© := hS.exists_minimal_nonempty_closed_subset hne
rcases minimal_nonempty_closed_eq_singleton Vcls Vne hV with β¨x, rflβ©
exact β¨x, Vsub (mem_singleton x), Vclsβ©
#align is_closed.exists_closed_singleton IsClosed.exists_closed_singleton
theorem minimal_nonempty_open_subsingleton [T0Space X] {s : Set X} (hs : IsOpen s)
(hmin : β t, t β s β t.Nonempty β IsOpen t β t = s) : s.Subsingleton := by
clear Y -- Porting note: added
refine fun x hx y hy => of_not_not fun hxy => ?_
rcases exists_isOpen_xor'_mem hxy with β¨U, hUo, hUβ©
wlog h : x β U β§ y β U
Β· exact this hs hmin y hy x hx (Ne.symm hxy) U hUo hU.symm (hU.resolve_left h)
cases' h with hxU hyU
have : s β© U = s := hmin (s β© U) inter_subset_left β¨x, hx, hxUβ© (hs.inter hUo)
exact hyU (this.symm.subset hy).2
#align minimal_nonempty_open_subsingleton minimal_nonempty_open_subsingleton
theorem minimal_nonempty_open_eq_singleton [T0Space X] {s : Set X} (hs : IsOpen s)
(hne : s.Nonempty) (hmin : β t, t β s β t.Nonempty β IsOpen t β t = s) : β x, s = {x} :=
exists_eq_singleton_iff_nonempty_subsingleton.2 β¨hne, minimal_nonempty_open_subsingleton hs hminβ©
#align minimal_nonempty_open_eq_singleton minimal_nonempty_open_eq_singleton
theorem exists_isOpen_singleton_of_isOpen_finite [T0Space X] {s : Set X} (hfin : s.Finite)
(hne : s.Nonempty) (ho : IsOpen s) : β x β s, IsOpen ({x} : Set X) := by
lift s to Finset X using hfin
induction' s using Finset.strongInductionOn with s ihs
rcases em (β t, t β s β§ t.Nonempty β§ IsOpen (t : Set X)) with (β¨t, hts, htne, htoβ© | ht)
Β· rcases ihs t hts htne hto with β¨x, hxt, hxoβ©
exact β¨x, hts.1 hxt, hxoβ©
Β· -- Porting note: was `rcases minimal_nonempty_open_eq_singleton ho hne _ with β¨x, hxβ©`
-- https://github.com/leanprover/std4/issues/116
rsuffices β¨x, hxβ© : β x, s.toSet = {x}
Β· exact β¨x, hx.symm βΈ rfl, hx βΈ hoβ©
refine minimal_nonempty_open_eq_singleton ho hne ?_
refine fun t hts htne hto => of_not_not fun hts' => ht ?_
lift t to Finset X using s.finite_toSet.subset hts
exact β¨t, ssubset_iff_subset_ne.2 β¨hts, mt Finset.coe_inj.2 hts'β©, htne, htoβ©
#align exists_open_singleton_of_open_finite exists_isOpen_singleton_of_isOpen_finite
theorem exists_open_singleton_of_finite [T0Space X] [Finite X] [Nonempty X] :
β x : X, IsOpen ({x} : Set X) :=
let β¨x, _, hβ© := exists_isOpen_singleton_of_isOpen_finite (Set.toFinite _)
univ_nonempty isOpen_univ
β¨x, hβ©
#align exists_open_singleton_of_fintype exists_open_singleton_of_finite
theorem t0Space_of_injective_of_continuous [TopologicalSpace Y] {f : X β Y}
(hf : Function.Injective f) (hf' : Continuous f) [T0Space Y] : T0Space X :=
β¨fun _ _ h => hf <| (h.map hf').eqβ©
#align t0_space_of_injective_of_continuous t0Space_of_injective_of_continuous
protected theorem Embedding.t0Space [TopologicalSpace Y] [T0Space Y] {f : X β Y}
(hf : Embedding f) : T0Space X :=
t0Space_of_injective_of_continuous hf.inj hf.continuous
#align embedding.t0_space Embedding.t0Space
instance Subtype.t0Space [T0Space X] {p : X β Prop} : T0Space (Subtype p) :=
embedding_subtype_val.t0Space
#align subtype.t0_space Subtype.t0Space
theorem t0Space_iff_or_not_mem_closure (X : Type u) [TopologicalSpace X] :
T0Space X β Pairwise fun a b : X => a β closure ({b} : Set X) β¨ b β closure ({a} : Set X) := by
simp only [t0Space_iff_not_inseparable, inseparable_iff_mem_closure, not_and_or]
#align t0_space_iff_or_not_mem_closure t0Space_iff_or_not_mem_closure
instance Prod.instT0Space [TopologicalSpace Y] [T0Space X] [T0Space Y] : T0Space (X Γ Y) :=
β¨fun _ _ h => Prod.ext (h.map continuous_fst).eq (h.map continuous_snd).eqβ©
instance Pi.instT0Space {ΞΉ : Type*} {X : ΞΉ β Type*} [β i, TopologicalSpace (X i)]
[β i, T0Space (X i)] :
T0Space (β i, X i) :=
β¨fun _ _ h => funext fun i => (h.map (continuous_apply i)).eqβ©
#align pi.t0_space Pi.instT0Space
instance ULift.instT0Space [T0Space X] : T0Space (ULift X) :=
embedding_uLift_down.t0Space
theorem T0Space.of_cover (h : β x y, Inseparable x y β β s : Set X, x β s β§ y β s β§ T0Space s) :
T0Space X := by
refine β¨fun x y hxy => ?_β©
rcases h x y hxy with β¨s, hxs, hys, hsβ©
lift x to s using hxs; lift y to s using hys
rw [β subtype_inseparable_iff] at hxy
exact congr_arg Subtype.val hxy.eq
#align t0_space.of_cover T0Space.of_cover
theorem T0Space.of_open_cover (h : β x, β s : Set X, x β s β§ IsOpen s β§ T0Space s) : T0Space X :=
T0Space.of_cover fun x _ hxy =>
let β¨s, hxs, hso, hsβ© := h x
β¨s, hxs, (hxy.mem_open_iff hso).1 hxs, hsβ©
#align t0_space.of_open_cover T0Space.of_open_cover
@[mk_iff]
class R0Space (X : Type u) [TopologicalSpace X] : Prop where
specializes_symmetric : Symmetric (Specializes : X β X β Prop)
export R0Space (specializes_symmetric)
class T1Space (X : Type u) [TopologicalSpace X] : Prop where
t1 : β x, IsClosed ({x} : Set X)
#align t1_space T1Space
theorem isClosed_singleton [T1Space X] {x : X} : IsClosed ({x} : Set X) :=
T1Space.t1 x
#align is_closed_singleton isClosed_singleton
theorem isOpen_compl_singleton [T1Space X] {x : X} : IsOpen ({x}αΆ : Set X) :=
isClosed_singleton.isOpen_compl
#align is_open_compl_singleton isOpen_compl_singleton
theorem isOpen_ne [T1Space X] {x : X} : IsOpen { y | y β x } :=
isOpen_compl_singleton
#align is_open_ne isOpen_ne
@[to_additive]
theorem Continuous.isOpen_mulSupport [T1Space X] [One X] [TopologicalSpace Y] {f : Y β X}
(hf : Continuous f) : IsOpen (mulSupport f) :=
isOpen_ne.preimage hf
#align continuous.is_open_mul_support Continuous.isOpen_mulSupport
#align continuous.is_open_support Continuous.isOpen_support
theorem Ne.nhdsWithin_compl_singleton [T1Space X] {x y : X} (h : x β y) : π[{y}αΆ] x = π x :=
isOpen_ne.nhdsWithin_eq h
#align ne.nhds_within_compl_singleton Ne.nhdsWithin_compl_singleton
theorem Ne.nhdsWithin_diff_singleton [T1Space X] {x y : X} (h : x β y) (s : Set X) :
π[s \ {y}] x = π[s] x := by
rw [diff_eq, inter_comm, nhdsWithin_inter_of_mem]
exact mem_nhdsWithin_of_mem_nhds (isOpen_ne.mem_nhds h)
#align ne.nhds_within_diff_singleton Ne.nhdsWithin_diff_singleton
lemma nhdsWithin_compl_singleton_le [T1Space X] (x y : X) : π[{x}αΆ] x β€ π[{y}αΆ] x := by
rcases eq_or_ne x y with rfl|hy
Β· exact Eq.le rfl
Β· rw [Ne.nhdsWithin_compl_singleton hy]
exact nhdsWithin_le_nhds
theorem isOpen_setOf_eventually_nhdsWithin [T1Space X] {p : X β Prop} :
IsOpen { x | βαΆ y in π[β ] x, p y } := by
refine isOpen_iff_mem_nhds.mpr fun a ha => ?_
filter_upwards [eventually_nhds_nhdsWithin.mpr ha] with b hb
rcases eq_or_ne a b with rfl | h
Β· exact hb
Β· rw [h.symm.nhdsWithin_compl_singleton] at hb
exact hb.filter_mono nhdsWithin_le_nhds
#align is_open_set_of_eventually_nhds_within isOpen_setOf_eventually_nhdsWithin
protected theorem Set.Finite.isClosed [T1Space X] {s : Set X} (hs : Set.Finite s) : IsClosed s := by
rw [β biUnion_of_singleton s]
exact hs.isClosed_biUnion fun i _ => isClosed_singleton
#align set.finite.is_closed Set.Finite.isClosed
theorem TopologicalSpace.IsTopologicalBasis.exists_mem_of_ne [T1Space X] {b : Set (Set X)}
(hb : IsTopologicalBasis b) {x y : X} (h : x β y) : β a β b, x β a β§ y β a := by
rcases hb.isOpen_iff.1 isOpen_ne x h with β¨a, ab, xa, haβ©
exact β¨a, ab, xa, fun h => ha h rflβ©
#align topological_space.is_topological_basis.exists_mem_of_ne TopologicalSpace.IsTopologicalBasis.exists_mem_of_ne
protected theorem Finset.isClosed [T1Space X] (s : Finset X) : IsClosed (s : Set X) :=
s.finite_toSet.isClosed
#align finset.is_closed Finset.isClosed
theorem t1Space_TFAE (X : Type u) [TopologicalSpace X] :
List.TFAE [T1Space X,
β x, IsClosed ({ x } : Set X),
β x, IsOpen ({ x }αΆ : Set X),
Continuous (@CofiniteTopology.of X),
β β¦x y : Xβ¦, x β y β {y}αΆ β π x,
β β¦x y : Xβ¦, x β y β β s β π x, y β s,
β β¦x y : Xβ¦, x β y β β U : Set X, IsOpen U β§ x β U β§ y β U,
β β¦x y : Xβ¦, x β y β Disjoint (π x) (pure y),
β β¦x y : Xβ¦, x β y β Disjoint (pure x) (π y),
β β¦x y : Xβ¦, x β€³ y β x = y] := by
tfae_have 1 β 2
Β· exact β¨fun h => h.1, fun h => β¨hβ©β©
tfae_have 2 β 3
Β· simp only [isOpen_compl_iff]
tfae_have 5 β 3
Β· refine forall_swap.trans ?_
simp only [isOpen_iff_mem_nhds, mem_compl_iff, mem_singleton_iff]
tfae_have 5 β 6
Β· simp only [β subset_compl_singleton_iff, exists_mem_subset_iff]
tfae_have 5 β 7
Β· simp only [(nhds_basis_opens _).mem_iff, subset_compl_singleton_iff, exists_prop, and_assoc,
and_left_comm]
tfae_have 5 β 8
Β· simp only [β principal_singleton, disjoint_principal_right]
tfae_have 8 β 9
Β· exact forall_swap.trans (by simp only [disjoint_comm, ne_comm])
tfae_have 1 β 4
Β· simp only [continuous_def, CofiniteTopology.isOpen_iff']
rintro H s (rfl | hs)
exacts [isOpen_empty, compl_compl s βΈ (@Set.Finite.isClosed _ _ H _ hs).isOpen_compl]
tfae_have 4 β 2
Β· exact fun h x => (CofiniteTopology.isClosed_iff.2 <| Or.inr (finite_singleton _)).preimage h
tfae_have 2 β 10
Β· simp only [β closure_subset_iff_isClosed, specializes_iff_mem_closure, subset_def,
mem_singleton_iff, eq_comm]
tfae_finish
#align t1_space_tfae t1Space_TFAE
theorem t1Space_iff_continuous_cofinite_of : T1Space X β Continuous (@CofiniteTopology.of X) :=
(t1Space_TFAE X).out 0 3
#align t1_space_iff_continuous_cofinite_of t1Space_iff_continuous_cofinite_of
theorem CofiniteTopology.continuous_of [T1Space X] : Continuous (@CofiniteTopology.of X) :=
t1Space_iff_continuous_cofinite_of.mp βΉ_βΊ
#align cofinite_topology.continuous_of CofiniteTopology.continuous_of
theorem t1Space_iff_exists_open :
T1Space X β Pairwise fun x y => β U : Set X, IsOpen U β§ x β U β§ y β U :=
(t1Space_TFAE X).out 0 6
#align t1_space_iff_exists_open t1Space_iff_exists_open
theorem t1Space_iff_disjoint_pure_nhds : T1Space X β β β¦x y : Xβ¦, x β y β Disjoint (pure x) (π y) :=
(t1Space_TFAE X).out 0 8
#align t1_space_iff_disjoint_pure_nhds t1Space_iff_disjoint_pure_nhds
theorem t1Space_iff_disjoint_nhds_pure : T1Space X β β β¦x y : Xβ¦, x β y β Disjoint (π x) (pure y) :=
(t1Space_TFAE X).out 0 7
#align t1_space_iff_disjoint_nhds_pure t1Space_iff_disjoint_nhds_pure
theorem t1Space_iff_specializes_imp_eq : T1Space X β β β¦x y : Xβ¦, x β€³ y β x = y :=
(t1Space_TFAE X).out 0 9
#align t1_space_iff_specializes_imp_eq t1Space_iff_specializes_imp_eq
theorem disjoint_pure_nhds [T1Space X] {x y : X} (h : x β y) : Disjoint (pure x) (π y) :=
t1Space_iff_disjoint_pure_nhds.mp βΉ_βΊ h
#align disjoint_pure_nhds disjoint_pure_nhds
theorem disjoint_nhds_pure [T1Space X] {x y : X} (h : x β y) : Disjoint (π x) (pure y) :=
t1Space_iff_disjoint_nhds_pure.mp βΉ_βΊ h
#align disjoint_nhds_pure disjoint_nhds_pure
theorem Specializes.eq [T1Space X] {x y : X} (h : x β€³ y) : x = y :=
t1Space_iff_specializes_imp_eq.1 βΉ_βΊ h
#align specializes.eq Specializes.eq
theorem specializes_iff_eq [T1Space X] {x y : X} : x β€³ y β x = y :=
β¨Specializes.eq, fun h => h βΈ specializes_rflβ©
#align specializes_iff_eq specializes_iff_eq
@[simp] theorem specializes_eq_eq [T1Space X] : (Β· β€³ Β·) = @Eq X :=
funextβ fun _ _ => propext specializes_iff_eq
#align specializes_eq_eq specializes_eq_eq
@[simp]
theorem pure_le_nhds_iff [T1Space X] {a b : X} : pure a β€ π b β a = b :=
specializes_iff_pure.symm.trans specializes_iff_eq
#align pure_le_nhds_iff pure_le_nhds_iff
@[simp]
theorem nhds_le_nhds_iff [T1Space X] {a b : X} : π a β€ π b β a = b :=
specializes_iff_eq
#align nhds_le_nhds_iff nhds_le_nhds_iff
instance (priority := 100) [T1Space X] : R0Space X where
specializes_symmetric _ _ := by rw [specializes_iff_eq, specializes_iff_eq]; exact Eq.symm
instance : T1Space (CofiniteTopology X) :=
t1Space_iff_continuous_cofinite_of.mpr continuous_id
theorem t1Space_antitone : Antitone (@T1Space X) := fun a _ h _ =>
@T1Space.mk _ a fun x => (T1Space.t1 x).mono h
#align t1_space_antitone t1Space_antitone
theorem continuousWithinAt_update_of_ne [T1Space X] [DecidableEq X] [TopologicalSpace Y] {f : X β Y}
{s : Set X} {x x' : X} {y : Y} (hne : x' β x) :
ContinuousWithinAt (Function.update f x y) s x' β ContinuousWithinAt f s x' :=
EventuallyEq.congr_continuousWithinAt
(mem_nhdsWithin_of_mem_nhds <| mem_of_superset (isOpen_ne.mem_nhds hne) fun _y' hy' =>
Function.update_noteq hy' _ _)
(Function.update_noteq hne _ _)
#align continuous_within_at_update_of_ne continuousWithinAt_update_of_ne
theorem continuousAt_update_of_ne [T1Space X] [DecidableEq X] [TopologicalSpace Y]
{f : X β Y} {x x' : X} {y : Y} (hne : x' β x) :
ContinuousAt (Function.update f x y) x' β ContinuousAt f x' := by
simp only [β continuousWithinAt_univ, continuousWithinAt_update_of_ne hne]
#align continuous_at_update_of_ne continuousAt_update_of_ne
| Mathlib/Topology/Separation.lean | 664 | 676 | theorem continuousOn_update_iff [T1Space X] [DecidableEq X] [TopologicalSpace Y] {f : X β Y}
{s : Set X} {x : X} {y : Y} :
ContinuousOn (Function.update f x y) s β
ContinuousOn f (s \ {x}) β§ (x β s β Tendsto f (π[s \ {x}] x) (π y)) := by |
rw [ContinuousOn, β and_forall_ne x, and_comm]
refine and_congr β¨fun H z hz => ?_, fun H z hzx hzs => ?_β© (forall_congr' fun _ => ?_)
Β· specialize H z hz.2 hz.1
rw [continuousWithinAt_update_of_ne hz.2] at H
exact H.mono diff_subset
Β· rw [continuousWithinAt_update_of_ne hzx]
refine (H z β¨hzs, hzxβ©).mono_of_mem (inter_mem_nhdsWithin _ ?_)
exact isOpen_ne.mem_nhds hzx
Β· exact continuousWithinAt_update_same
|
import Mathlib.LinearAlgebra.Dimension.Finrank
import Mathlib.LinearAlgebra.InvariantBasisNumber
#align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5"
noncomputable section
universe u v w w'
variable {R : Type u} {M : Type v} [Ring R] [AddCommGroup M] [Module R M]
variable {ΞΉ : Type w} {ΞΉ' : Type w'}
open Cardinal Basis Submodule Function Set
attribute [local instance] nontrivial_of_invariantBasisNumber
section RankCondition
variable [RankCondition R]
theorem Basis.le_span'' {ΞΉ : Type*} [Fintype ΞΉ] (b : Basis ΞΉ R M) {w : Set M} [Fintype w]
(s : span R w = β€) : Fintype.card ΞΉ β€ Fintype.card w := by
-- We construct a surjective linear map `(w β R) ββ[R] (ΞΉ β R)`,
-- by expressing a linear combination in `w` as a linear combination in `ΞΉ`.
fapply card_le_of_surjective' R
Β· exact b.repr.toLinearMap.comp (Finsupp.total w M R (β))
Β· apply Surjective.comp (g := b.repr.toLinearMap)
Β· apply LinearEquiv.surjective
rw [β LinearMap.range_eq_top, Finsupp.range_total]
simpa using s
#align basis.le_span'' Basis.le_span''
| Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean | 125 | 132 | theorem basis_le_span' {ΞΉ : Type*} (b : Basis ΞΉ R M) {w : Set M} [Fintype w] (s : span R w = β€) :
#ΞΉ β€ Fintype.card w := by |
haveI := nontrivial_of_invariantBasisNumber R
haveI := basis_finite_of_finite_spans w (toFinite _) s b
cases nonempty_fintype ΞΉ
rw [Cardinal.mk_fintype ΞΉ]
simp only [Cardinal.natCast_le]
exact Basis.le_span'' b s
|
import Mathlib.MeasureTheory.OuterMeasure.OfFunction
import Mathlib.MeasureTheory.PiSystem
#align_import measure_theory.measure.outer_measure from "leanprover-community/mathlib"@"343e80208d29d2d15f8050b929aa50fe4ce71b55"
noncomputable section
open Set Function Filter
open scoped Classical NNReal Topology ENNReal
namespace MeasureTheory
namespace OuterMeasure
section CaratheodoryMeasurable
universe u
variable {Ξ± : Type u} (m : OuterMeasure Ξ±)
attribute [local simp] Set.inter_comm Set.inter_left_comm Set.inter_assoc
variable {s sβ sβ : Set Ξ±}
def IsCaratheodory (s : Set Ξ±) : Prop :=
β t, m t = m (t β© s) + m (t \ s)
#align measure_theory.outer_measure.is_caratheodory MeasureTheory.OuterMeasure.IsCaratheodory
theorem isCaratheodory_iff_le' {s : Set Ξ±} :
IsCaratheodory m s β β t, m (t β© s) + m (t \ s) β€ m t :=
forall_congr' fun _ => le_antisymm_iff.trans <| and_iff_right <| measure_le_inter_add_diff _ _ _
#align measure_theory.outer_measure.is_caratheodory_iff_le' MeasureTheory.OuterMeasure.isCaratheodory_iff_le'
@[simp]
| Mathlib/MeasureTheory/OuterMeasure/Caratheodory.lean | 62 | 62 | theorem isCaratheodory_empty : IsCaratheodory m β
:= by | simp [IsCaratheodory, m.empty, diff_empty]
|
import Mathlib.CategoryTheory.NatIso
#align_import category_theory.bicategory.basic from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514"
namespace CategoryTheory
universe w v u
open Category Iso
-- intended to be used with explicit universe parameters
@[nolint checkUnivs]
class Bicategory (B : Type u) extends CategoryStruct.{v} B where
-- category structure on the collection of 1-morphisms:
homCategory : β a b : B, Category.{w} (a βΆ b) := by infer_instance
-- left whiskering:
whiskerLeft {a b c : B} (f : a βΆ b) {g h : b βΆ c} (Ξ· : g βΆ h) : f β« g βΆ f β« h
-- right whiskering:
whiskerRight {a b c : B} {f g : a βΆ b} (Ξ· : f βΆ g) (h : b βΆ c) : f β« h βΆ g β« h
-- associator:
associator {a b c d : B} (f : a βΆ b) (g : b βΆ c) (h : c βΆ d) : (f β« g) β« h β
f β« g β« h
-- left unitor:
leftUnitor {a b : B} (f : a βΆ b) : π a β« f β
f
-- right unitor:
rightUnitor {a b : B} (f : a βΆ b) : f β« π b β
f
-- axioms for left whiskering:
whiskerLeft_id : β {a b c} (f : a βΆ b) (g : b βΆ c), whiskerLeft f (π g) = π (f β« g) := by
aesop_cat
whiskerLeft_comp :
β {a b c} (f : a βΆ b) {g h i : b βΆ c} (Ξ· : g βΆ h) (ΞΈ : h βΆ i),
whiskerLeft f (Ξ· β« ΞΈ) = whiskerLeft f Ξ· β« whiskerLeft f ΞΈ := by
aesop_cat
id_whiskerLeft :
β {a b} {f g : a βΆ b} (Ξ· : f βΆ g),
whiskerLeft (π a) Ξ· = (leftUnitor f).hom β« Ξ· β« (leftUnitor g).inv := by
aesop_cat
comp_whiskerLeft :
β {a b c d} (f : a βΆ b) (g : b βΆ c) {h h' : c βΆ d} (Ξ· : h βΆ h'),
whiskerLeft (f β« g) Ξ· =
(associator f g h).hom β« whiskerLeft f (whiskerLeft g Ξ·) β« (associator f g h').inv := by
aesop_cat
-- axioms for right whiskering:
id_whiskerRight : β {a b c} (f : a βΆ b) (g : b βΆ c), whiskerRight (π f) g = π (f β« g) := by
aesop_cat
comp_whiskerRight :
β {a b c} {f g h : a βΆ b} (Ξ· : f βΆ g) (ΞΈ : g βΆ h) (i : b βΆ c),
whiskerRight (Ξ· β« ΞΈ) i = whiskerRight Ξ· i β« whiskerRight ΞΈ i := by
aesop_cat
whiskerRight_id :
β {a b} {f g : a βΆ b} (Ξ· : f βΆ g),
whiskerRight Ξ· (π b) = (rightUnitor f).hom β« Ξ· β« (rightUnitor g).inv := by
aesop_cat
whiskerRight_comp :
β {a b c d} {f f' : a βΆ b} (Ξ· : f βΆ f') (g : b βΆ c) (h : c βΆ d),
whiskerRight Ξ· (g β« h) =
(associator f g h).inv β« whiskerRight (whiskerRight Ξ· g) h β« (associator f' g h).hom := by
aesop_cat
-- associativity of whiskerings:
whisker_assoc :
β {a b c d} (f : a βΆ b) {g g' : b βΆ c} (Ξ· : g βΆ g') (h : c βΆ d),
whiskerRight (whiskerLeft f Ξ·) h =
(associator f g h).hom β« whiskerLeft f (whiskerRight Ξ· h) β« (associator f g' h).inv := by
aesop_cat
-- exchange law of left and right whiskerings:
whisker_exchange :
β {a b c} {f g : a βΆ b} {h i : b βΆ c} (Ξ· : f βΆ g) (ΞΈ : h βΆ i),
whiskerLeft f ΞΈ β« whiskerRight Ξ· i = whiskerRight Ξ· h β« whiskerLeft g ΞΈ := by
aesop_cat
-- pentagon identity:
pentagon :
β {a b c d e} (f : a βΆ b) (g : b βΆ c) (h : c βΆ d) (i : d βΆ e),
whiskerRight (associator f g h).hom i β«
(associator f (g β« h) i).hom β« whiskerLeft f (associator g h i).hom =
(associator (f β« g) h i).hom β« (associator f g (h β« i)).hom := by
aesop_cat
-- triangle identity:
triangle :
β {a b c} (f : a βΆ b) (g : b βΆ c),
(associator f (π b) g).hom β« whiskerLeft f (leftUnitor g).hom
= whiskerRight (rightUnitor f).hom g := by
aesop_cat
#align category_theory.bicategory CategoryTheory.Bicategory
#align category_theory.bicategory.hom_category CategoryTheory.Bicategory.homCategory
#align category_theory.bicategory.whisker_left CategoryTheory.Bicategory.whiskerLeft
#align category_theory.bicategory.whisker_right CategoryTheory.Bicategory.whiskerRight
#align category_theory.bicategory.left_unitor CategoryTheory.Bicategory.leftUnitor
#align category_theory.bicategory.right_unitor CategoryTheory.Bicategory.rightUnitor
#align category_theory.bicategory.whisker_left_id' CategoryTheory.Bicategory.whiskerLeft_id
#align category_theory.bicategory.whisker_left_comp' CategoryTheory.Bicategory.whiskerLeft_comp
#align category_theory.bicategory.id_whisker_left' CategoryTheory.Bicategory.id_whiskerLeft
#align category_theory.bicategory.comp_whisker_left' CategoryTheory.Bicategory.comp_whiskerLeft
#align category_theory.bicategory.id_whisker_right' CategoryTheory.Bicategory.id_whiskerRight
#align category_theory.bicategory.comp_whisker_right' CategoryTheory.Bicategory.comp_whiskerRight
#align category_theory.bicategory.whisker_right_id' CategoryTheory.Bicategory.whiskerRight_id
#align category_theory.bicategory.whisker_right_comp' CategoryTheory.Bicategory.whiskerRight_comp
#align category_theory.bicategory.whisker_assoc' CategoryTheory.Bicategory.whisker_assoc
#align category_theory.bicategory.whisker_exchange' CategoryTheory.Bicategory.whisker_exchange
#align category_theory.bicategory.pentagon' CategoryTheory.Bicategory.pentagon
#align category_theory.bicategory.triangle' CategoryTheory.Bicategory.triangle
namespace Bicategory
scoped infixr:81 " β " => Bicategory.whiskerLeft
scoped infixl:81 " β· " => Bicategory.whiskerRight
scoped notation "Ξ±_" => Bicategory.associator
scoped notation "Ξ»_" => Bicategory.leftUnitor
scoped notation "Ο_" => Bicategory.rightUnitor
attribute [instance] homCategory
attribute [reassoc]
whiskerLeft_comp id_whiskerLeft comp_whiskerLeft comp_whiskerRight whiskerRight_id
whiskerRight_comp whisker_assoc whisker_exchange
attribute [reassoc (attr := simp)] pentagon triangle
attribute [simp]
whiskerLeft_id whiskerLeft_comp id_whiskerLeft comp_whiskerLeft id_whiskerRight comp_whiskerRight
whiskerRight_id whiskerRight_comp whisker_assoc
variable {B : Type u} [Bicategory.{w, v} B] {a b c d e : B}
@[reassoc (attr := simp)]
theorem whiskerLeft_hom_inv (f : a βΆ b) {g h : b βΆ c} (Ξ· : g β
h) :
f β Ξ·.hom β« f β Ξ·.inv = π (f β« g) := by rw [β whiskerLeft_comp, hom_inv_id, whiskerLeft_id]
#align category_theory.bicategory.hom_inv_whisker_left CategoryTheory.Bicategory.whiskerLeft_hom_inv
@[reassoc (attr := simp)]
theorem hom_inv_whiskerRight {f g : a βΆ b} (Ξ· : f β
g) (h : b βΆ c) :
Ξ·.hom β· h β« Ξ·.inv β· h = π (f β« h) := by rw [β comp_whiskerRight, hom_inv_id, id_whiskerRight]
#align category_theory.bicategory.hom_inv_whisker_right CategoryTheory.Bicategory.hom_inv_whiskerRight
@[reassoc (attr := simp)]
theorem whiskerLeft_inv_hom (f : a βΆ b) {g h : b βΆ c} (Ξ· : g β
h) :
f β Ξ·.inv β« f β Ξ·.hom = π (f β« h) := by rw [β whiskerLeft_comp, inv_hom_id, whiskerLeft_id]
#align category_theory.bicategory.inv_hom_whisker_left CategoryTheory.Bicategory.whiskerLeft_inv_hom
@[reassoc (attr := simp)]
theorem inv_hom_whiskerRight {f g : a βΆ b} (Ξ· : f β
g) (h : b βΆ c) :
Ξ·.inv β· h β« Ξ·.hom β· h = π (g β« h) := by rw [β comp_whiskerRight, inv_hom_id, id_whiskerRight]
#align category_theory.bicategory.inv_hom_whisker_right CategoryTheory.Bicategory.inv_hom_whiskerRight
@[simps]
def whiskerLeftIso (f : a βΆ b) {g h : b βΆ c} (Ξ· : g β
h) : f β« g β
f β« h where
hom := f β Ξ·.hom
inv := f β Ξ·.inv
#align category_theory.bicategory.whisker_left_iso CategoryTheory.Bicategory.whiskerLeftIso
instance whiskerLeft_isIso (f : a βΆ b) {g h : b βΆ c} (Ξ· : g βΆ h) [IsIso Ξ·] : IsIso (f β Ξ·) :=
(whiskerLeftIso f (asIso Ξ·)).isIso_hom
#align category_theory.bicategory.whisker_left_is_iso CategoryTheory.Bicategory.whiskerLeft_isIso
@[simp]
theorem inv_whiskerLeft (f : a βΆ b) {g h : b βΆ c} (Ξ· : g βΆ h) [IsIso Ξ·] :
inv (f β Ξ·) = f β inv Ξ· := by
apply IsIso.inv_eq_of_hom_inv_id
simp only [β whiskerLeft_comp, whiskerLeft_id, IsIso.hom_inv_id]
#align category_theory.bicategory.inv_whisker_left CategoryTheory.Bicategory.inv_whiskerLeft
@[simps!]
def whiskerRightIso {f g : a βΆ b} (Ξ· : f β
g) (h : b βΆ c) : f β« h β
g β« h where
hom := Ξ·.hom β· h
inv := Ξ·.inv β· h
#align category_theory.bicategory.whisker_right_iso CategoryTheory.Bicategory.whiskerRightIso
instance whiskerRight_isIso {f g : a βΆ b} (Ξ· : f βΆ g) (h : b βΆ c) [IsIso Ξ·] : IsIso (Ξ· β· h) :=
(whiskerRightIso (asIso Ξ·) h).isIso_hom
#align category_theory.bicategory.whisker_right_is_iso CategoryTheory.Bicategory.whiskerRight_isIso
@[simp]
theorem inv_whiskerRight {f g : a βΆ b} (Ξ· : f βΆ g) (h : b βΆ c) [IsIso Ξ·] :
inv (Ξ· β· h) = inv Ξ· β· h := by
apply IsIso.inv_eq_of_hom_inv_id
simp only [β comp_whiskerRight, id_whiskerRight, IsIso.hom_inv_id]
#align category_theory.bicategory.inv_whisker_right CategoryTheory.Bicategory.inv_whiskerRight
@[reassoc (attr := simp)]
theorem pentagon_inv (f : a βΆ b) (g : b βΆ c) (h : c βΆ d) (i : d βΆ e) :
f β (Ξ±_ g h i).inv β« (Ξ±_ f (g β« h) i).inv β« (Ξ±_ f g h).inv β· i =
(Ξ±_ f g (h β« i)).inv β« (Ξ±_ (f β« g) h i).inv :=
eq_of_inv_eq_inv (by simp)
#align category_theory.bicategory.pentagon_inv CategoryTheory.Bicategory.pentagon_inv
@[reassoc (attr := simp)]
| Mathlib/CategoryTheory/Bicategory/Basic.lean | 259 | 263 | theorem pentagon_inv_inv_hom_hom_inv (f : a βΆ b) (g : b βΆ c) (h : c βΆ d) (i : d βΆ e) :
(Ξ±_ f (g β« h) i).inv β« (Ξ±_ f g h).inv β· i β« (Ξ±_ (f β« g) h i).hom =
f β (Ξ±_ g h i).hom β« (Ξ±_ f g (h β« i)).inv := by |
rw [β cancel_epi (f β (Ξ±_ g h i).inv), β cancel_mono (Ξ±_ (f β« g) h i).inv]
simp
|
import Mathlib.Analysis.Calculus.ContDiff.Basic
import Mathlib.Analysis.Calculus.Deriv.Mul
import Mathlib.Analysis.Calculus.Deriv.Shift
import Mathlib.Analysis.Calculus.IteratedDeriv.Defs
variable
{π : Type*} [NontriviallyNormedField π]
{F : Type*} [NormedAddCommGroup F] [NormedSpace π F]
{R : Type*} [Semiring R] [Module R F] [SMulCommClass π R F] [ContinuousConstSMul R F]
{n : β} {x : π} {s : Set π} (hx : x β s) (h : UniqueDiffOn π s) {f g : π β F}
theorem iteratedDerivWithin_add (hf : ContDiffOn π n f s) (hg : ContDiffOn π n g s) :
iteratedDerivWithin n (f + g) s x =
iteratedDerivWithin n f s x + iteratedDerivWithin n g s x := by
simp_rw [iteratedDerivWithin, iteratedFDerivWithin_add_apply hf hg h hx,
ContinuousMultilinearMap.add_apply]
theorem iteratedDerivWithin_congr (hfg : Set.EqOn f g s) :
Set.EqOn (iteratedDerivWithin n f s) (iteratedDerivWithin n g s) s := by
induction n generalizing f g with
| zero => rwa [iteratedDerivWithin_zero]
| succ n IH =>
intro y hy
have : UniqueDiffWithinAt π s y := h.uniqueDiffWithinAt hy
rw [iteratedDerivWithin_succ this, iteratedDerivWithin_succ this]
exact derivWithin_congr (IH hfg) (IH hfg hy)
theorem iteratedDerivWithin_const_add (hn : 0 < n) (c : F) :
iteratedDerivWithin n (fun z => c + f z) s x = iteratedDerivWithin n f s x := by
obtain β¨n, rflβ© := n.exists_eq_succ_of_ne_zero hn.ne'
rw [iteratedDerivWithin_succ' h hx, iteratedDerivWithin_succ' h hx]
refine iteratedDerivWithin_congr h ?_ hx
intro y hy
exact derivWithin_const_add (h.uniqueDiffWithinAt hy) _
theorem iteratedDerivWithin_const_neg (hn : 0 < n) (c : F) :
iteratedDerivWithin n (fun z => c - f z) s x = iteratedDerivWithin n (fun z => -f z) s x := by
obtain β¨n, rflβ© := n.exists_eq_succ_of_ne_zero hn.ne'
rw [iteratedDerivWithin_succ' h hx, iteratedDerivWithin_succ' h hx]
refine iteratedDerivWithin_congr h ?_ hx
intro y hy
have : UniqueDiffWithinAt π s y := h.uniqueDiffWithinAt hy
rw [derivWithin.neg this]
exact derivWithin_const_sub this _
| Mathlib/Analysis/Calculus/IteratedDeriv/Lemmas.lean | 58 | 62 | theorem iteratedDerivWithin_const_smul (c : R) (hf : ContDiffOn π n f s) :
iteratedDerivWithin n (c β’ f) s x = c β’ iteratedDerivWithin n f s x := by |
simp_rw [iteratedDerivWithin]
rw [iteratedFDerivWithin_const_smul_apply hf h hx]
simp only [ContinuousMultilinearMap.smul_apply]
|
import Mathlib.Algebra.FreeMonoid.Basic
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.GroupTheory.Congruence.Basic
import Mathlib.GroupTheory.FreeGroup.IsFreeGroup
import Mathlib.Data.List.Chain
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Data.Set.Pointwise.SMul
#align_import group_theory.free_product from "leanprover-community/mathlib"@"9114ddffa023340c9ec86965e00cdd6fe26fcdf6"
open Set
variable {ΞΉ : Type*} (M : ΞΉ β Type*) [β i, Monoid (M i)]
inductive Monoid.CoprodI.Rel : FreeMonoid (Ξ£i, M i) β FreeMonoid (Ξ£i, M i) β Prop
| of_one (i : ΞΉ) : Monoid.CoprodI.Rel (FreeMonoid.of β¨i, 1β©) 1
| of_mul {i : ΞΉ} (x y : M i) :
Monoid.CoprodI.Rel (FreeMonoid.of β¨i, xβ© * FreeMonoid.of β¨i, yβ©) (FreeMonoid.of β¨i, x * yβ©)
#align free_product.rel Monoid.CoprodI.Rel
def Monoid.CoprodI : Type _ := (conGen (Monoid.CoprodI.Rel M)).Quotient
#align free_product Monoid.CoprodI
-- Porting note: could not de derived
instance : Monoid (Monoid.CoprodI M) := by
delta Monoid.CoprodI; infer_instance
instance : Inhabited (Monoid.CoprodI M) :=
β¨1β©
namespace Monoid.CoprodI
@[ext]
structure Word where
toList : List (Ξ£i, M i)
ne_one : β l β toList, Sigma.snd l β 1
chain_ne : toList.Chain' fun l l' => Sigma.fst l β Sigma.fst l'
#align free_product.word Monoid.CoprodI.Word
variable {M}
def of {i : ΞΉ} : M i β* CoprodI M where
toFun x := Con.mk' _ (FreeMonoid.of <| Sigma.mk i x)
map_one' := (Con.eq _).mpr (ConGen.Rel.of _ _ (CoprodI.Rel.of_one i))
map_mul' x y := Eq.symm <| (Con.eq _).mpr (ConGen.Rel.of _ _ (CoprodI.Rel.of_mul x y))
#align free_product.of Monoid.CoprodI.of
theorem of_apply {i} (m : M i) : of m = Con.mk' _ (FreeMonoid.of <| Sigma.mk i m) :=
rfl
#align free_product.of_apply Monoid.CoprodI.of_apply
variable {N : Type*} [Monoid N]
-- Porting note: higher `ext` priority
@[ext 1100]
theorem ext_hom (f g : CoprodI M β* N) (h : β i, f.comp (of : M i β* _) = g.comp of) : f = g :=
(MonoidHom.cancel_right Con.mk'_surjective).mp <|
FreeMonoid.hom_eq fun β¨i, xβ© => by
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [MonoidHom.comp_apply, MonoidHom.comp_apply, β of_apply, β MonoidHom.comp_apply, β
MonoidHom.comp_apply, h]; rfl
#align free_product.ext_hom Monoid.CoprodI.ext_hom
@[simps symm_apply]
def lift : (β i, M i β* N) β (CoprodI M β* N) where
toFun fi :=
Con.lift _ (FreeMonoid.lift fun p : Ξ£i, M i => fi p.fst p.snd) <|
Con.conGen_le <| by
simp_rw [Con.ker_rel]
rintro _ _ (i | β¨x, yβ©)
Β· change FreeMonoid.lift _ (FreeMonoid.of _) = FreeMonoid.lift _ 1
simp only [MonoidHom.map_one, FreeMonoid.lift_eval_of]
Β· change
FreeMonoid.lift _ (FreeMonoid.of _ * FreeMonoid.of _) =
FreeMonoid.lift _ (FreeMonoid.of _)
simp only [MonoidHom.map_mul, FreeMonoid.lift_eval_of]
invFun f i := f.comp of
left_inv := by
intro fi
ext i x
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [MonoidHom.comp_apply, of_apply, Con.lift_mk', FreeMonoid.lift_eval_of]
right_inv := by
intro f
ext i x
rfl
#align free_product.lift Monoid.CoprodI.lift
@[simp]
theorem lift_comp_of {N} [Monoid N] (fi : β i, M i β* N) i : (lift fi).comp of = fi i :=
congr_fun (lift.symm_apply_apply fi) i
@[simp]
theorem lift_of {N} [Monoid N] (fi : β i, M i β* N) {i} (m : M i) : lift fi (of m) = fi i m :=
DFunLike.congr_fun (lift_comp_of ..) m
#align free_product.lift_of Monoid.CoprodI.lift_of
@[simp]
theorem lift_comp_of' {N} [Monoid N] (f : CoprodI M β* N) :
lift (fun i β¦ f.comp (of (i := i))) = f :=
lift.apply_symm_apply f
@[simp]
theorem lift_of' : lift (fun i β¦ (of : M i β* CoprodI M)) = .id (CoprodI M) :=
lift_comp_of' (.id _)
theorem of_leftInverse [DecidableEq ΞΉ] (i : ΞΉ) :
Function.LeftInverse (lift <| Pi.mulSingle i (MonoidHom.id (M i))) of := fun x => by
simp only [lift_of, Pi.mulSingle_eq_same, MonoidHom.id_apply]
#align free_product.of_left_inverse Monoid.CoprodI.of_leftInverse
theorem of_injective (i : ΞΉ) : Function.Injective (of : M i β* _) := by
classical exact (of_leftInverse i).injective
#align free_product.of_injective Monoid.CoprodI.of_injective
theorem mrange_eq_iSup {N} [Monoid N] (f : β i, M i β* N) :
MonoidHom.mrange (lift f) = β¨ i, MonoidHom.mrange (f i) := by
rw [lift, Equiv.coe_fn_mk, Con.lift_range, FreeMonoid.mrange_lift,
range_sigma_eq_iUnion_range, Submonoid.closure_iUnion]
simp only [MonoidHom.mclosure_range]
#align free_product.mrange_eq_supr Monoid.CoprodI.mrange_eq_iSup
theorem lift_mrange_le {N} [Monoid N] (f : β i, M i β* N) {s : Submonoid N} :
MonoidHom.mrange (lift f) β€ s β β i, MonoidHom.mrange (f i) β€ s := by
simp [mrange_eq_iSup]
#align free_product.lift_mrange_le Monoid.CoprodI.lift_mrange_le
@[simp]
theorem iSup_mrange_of : β¨ i, MonoidHom.mrange (of : M i β* CoprodI M) = β€ := by
simp [β mrange_eq_iSup]
@[simp]
theorem mclosure_iUnion_range_of :
Submonoid.closure (β i, Set.range (of : M i β* CoprodI M)) = β€ := by
simp [Submonoid.closure_iUnion]
@[elab_as_elim]
| Mathlib/GroupTheory/CoprodI.lean | 225 | 231 | theorem induction_left {C : CoprodI M β Prop} (m : CoprodI M) (one : C 1)
(mul : β {i} (m : M i) x, C x β C (of m * x)) : C m := by |
induction m using Submonoid.induction_of_closure_eq_top_left mclosure_iUnion_range_of with
| one => exact one
| mul x hx y ihy =>
obtain β¨i, m, rflβ© : β (i : ΞΉ) (m : M i), of m = x := by simpa using hx
exact mul m y ihy
|
import Mathlib.Topology.Order.MonotoneContinuity
import Mathlib.Topology.Algebra.Order.LiminfLimsup
import Mathlib.Topology.Instances.NNReal
import Mathlib.Topology.EMetricSpace.Lipschitz
import Mathlib.Topology.Metrizable.Basic
import Mathlib.Topology.Order.T5
#align_import topology.instances.ennreal from "leanprover-community/mathlib"@"ec4b2eeb50364487f80421c0b4c41328a611f30d"
noncomputable section
open Set Filter Metric Function
open scoped Classical Topology ENNReal NNReal Filter
variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*}
namespace ENNReal
variable {a b c d : ββ₯0β} {r p q : ββ₯0} {x y z : ββ₯0β} {Ξ΅ Ξ΅β Ξ΅β : ββ₯0β} {s : Set ββ₯0β}
section Liminf
theorem exists_frequently_lt_of_liminf_ne_top {ΞΉ : Type*} {l : Filter ΞΉ} {x : ΞΉ β β}
(hx : liminf (fun n => (Real.nnabs (x n) : ββ₯0β)) l β β) : β R, βαΆ n in l, x n < R := by
by_contra h
simp_rw [not_exists, not_frequently, not_lt] at h
refine hx (ENNReal.eq_top_of_forall_nnreal_le fun r => le_limsInf_of_le (by isBoundedDefault) ?_)
simp only [eventually_map, ENNReal.coe_le_coe]
filter_upwards [h r] with i hi using hi.trans (le_abs_self (x i))
#align ennreal.exists_frequently_lt_of_liminf_ne_top ENNReal.exists_frequently_lt_of_liminf_ne_top
theorem exists_frequently_lt_of_liminf_ne_top' {ΞΉ : Type*} {l : Filter ΞΉ} {x : ΞΉ β β}
(hx : liminf (fun n => (Real.nnabs (x n) : ββ₯0β)) l β β) : β R, βαΆ n in l, R < x n := by
by_contra h
simp_rw [not_exists, not_frequently, not_lt] at h
refine hx (ENNReal.eq_top_of_forall_nnreal_le fun r => le_limsInf_of_le (by isBoundedDefault) ?_)
simp only [eventually_map, ENNReal.coe_le_coe]
filter_upwards [h (-r)] with i hi using(le_neg.1 hi).trans (neg_le_abs _)
#align ennreal.exists_frequently_lt_of_liminf_ne_top' ENNReal.exists_frequently_lt_of_liminf_ne_top'
| Mathlib/Topology/Instances/ENNReal.lean | 748 | 771 | theorem exists_upcrossings_of_not_bounded_under {ΞΉ : Type*} {l : Filter ΞΉ} {x : ΞΉ β β}
(hf : liminf (fun i => (Real.nnabs (x i) : ββ₯0β)) l β β)
(hbdd : Β¬IsBoundedUnder (Β· β€ Β·) l fun i => |x i|) :
β a b : β, a < b β§ (βαΆ i in l, x i < a) β§ βαΆ i in l, βb < x i := by |
rw [isBoundedUnder_le_abs, not_and_or] at hbdd
obtain hbdd | hbdd := hbdd
Β· obtain β¨R, hRβ© := exists_frequently_lt_of_liminf_ne_top hf
obtain β¨q, hqβ© := exists_rat_gt R
refine β¨q, q + 1, (lt_add_iff_pos_right _).2 zero_lt_one, ?_, ?_β©
Β· refine fun hcon => hR ?_
filter_upwards [hcon] with x hx using not_lt.2 (lt_of_lt_of_le hq (not_lt.1 hx)).le
Β· simp only [IsBoundedUnder, IsBounded, eventually_map, eventually_atTop, ge_iff_le,
not_exists, not_forall, not_le, exists_prop] at hbdd
refine fun hcon => hbdd β(q + 1) ?_
filter_upwards [hcon] with x hx using not_lt.1 hx
Β· obtain β¨R, hRβ© := exists_frequently_lt_of_liminf_ne_top' hf
obtain β¨q, hqβ© := exists_rat_lt R
refine β¨q - 1, q, (sub_lt_self_iff _).2 zero_lt_one, ?_, ?_β©
Β· simp only [IsBoundedUnder, IsBounded, eventually_map, eventually_atTop, ge_iff_le,
not_exists, not_forall, not_le, exists_prop] at hbdd
refine fun hcon => hbdd β(q - 1) ?_
filter_upwards [hcon] with x hx using not_lt.1 hx
Β· refine fun hcon => hR ?_
filter_upwards [hcon] with x hx using not_lt.2 ((not_lt.1 hx).trans hq.le)
|
import Mathlib.Analysis.Calculus.BumpFunction.Basic
import Mathlib.MeasureTheory.Integral.SetIntegral
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
#align_import analysis.calculus.bump_function_inner from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
noncomputable section
open Function Filter Set Metric MeasureTheory FiniteDimensional Measure
open scoped Topology
namespace ContDiffBump
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [HasContDiffBump E]
[MeasurableSpace E] {c : E} (f : ContDiffBump c) {x : E} {n : ββ} {ΞΌ : Measure E}
protected def normed (ΞΌ : Measure E) : E β β := fun x => f x / β« x, f x βΞΌ
#align cont_diff_bump.normed ContDiffBump.normed
theorem normed_def {ΞΌ : Measure E} (x : E) : f.normed ΞΌ x = f x / β« x, f x βΞΌ :=
rfl
#align cont_diff_bump.normed_def ContDiffBump.normed_def
theorem nonneg_normed (x : E) : 0 β€ f.normed ΞΌ x :=
div_nonneg f.nonneg <| integral_nonneg f.nonneg'
#align cont_diff_bump.nonneg_normed ContDiffBump.nonneg_normed
theorem contDiff_normed {n : ββ} : ContDiff β n (f.normed ΞΌ) :=
f.contDiff.div_const _
#align cont_diff_bump.cont_diff_normed ContDiffBump.contDiff_normed
theorem continuous_normed : Continuous (f.normed ΞΌ) :=
f.continuous.div_const _
#align cont_diff_bump.continuous_normed ContDiffBump.continuous_normed
theorem normed_sub (x : E) : f.normed ΞΌ (c - x) = f.normed ΞΌ (c + x) := by
simp_rw [f.normed_def, f.sub]
#align cont_diff_bump.normed_sub ContDiffBump.normed_sub
theorem normed_neg (f : ContDiffBump (0 : E)) (x : E) : f.normed ΞΌ (-x) = f.normed ΞΌ x := by
simp_rw [f.normed_def, f.neg]
#align cont_diff_bump.normed_neg ContDiffBump.normed_neg
variable [BorelSpace E] [FiniteDimensional β E] [IsLocallyFiniteMeasure ΞΌ]
protected theorem integrable : Integrable f ΞΌ :=
f.continuous.integrable_of_hasCompactSupport f.hasCompactSupport
#align cont_diff_bump.integrable ContDiffBump.integrable
protected theorem integrable_normed : Integrable (f.normed ΞΌ) ΞΌ :=
f.integrable.div_const _
#align cont_diff_bump.integrable_normed ContDiffBump.integrable_normed
variable [ΞΌ.IsOpenPosMeasure]
theorem integral_pos : 0 < β« x, f x βΞΌ := by
refine (integral_pos_iff_support_of_nonneg f.nonneg' f.integrable).mpr ?_
rw [f.support_eq]
exact measure_ball_pos ΞΌ c f.rOut_pos
#align cont_diff_bump.integral_pos ContDiffBump.integral_pos
theorem integral_normed : β« x, f.normed ΞΌ x βΞΌ = 1 := by
simp_rw [ContDiffBump.normed, div_eq_mul_inv, mul_comm (f _), β smul_eq_mul, integral_smul]
exact inv_mul_cancel f.integral_pos.ne'
#align cont_diff_bump.integral_normed ContDiffBump.integral_normed
theorem support_normed_eq : Function.support (f.normed ΞΌ) = Metric.ball c f.rOut := by
unfold ContDiffBump.normed
rw [support_div, f.support_eq, support_const f.integral_pos.ne', inter_univ]
#align cont_diff_bump.support_normed_eq ContDiffBump.support_normed_eq
theorem tsupport_normed_eq : tsupport (f.normed ΞΌ) = Metric.closedBall c f.rOut := by
rw [tsupport, f.support_normed_eq, closure_ball _ f.rOut_pos.ne']
#align cont_diff_bump.tsupport_normed_eq ContDiffBump.tsupport_normed_eq
theorem hasCompactSupport_normed : HasCompactSupport (f.normed ΞΌ) := by
simp only [HasCompactSupport, f.tsupport_normed_eq (ΞΌ := ΞΌ), isCompact_closedBall]
#align cont_diff_bump.has_compact_support_normed ContDiffBump.hasCompactSupport_normed
theorem tendsto_support_normed_smallSets {ΞΉ} {Ο : ΞΉ β ContDiffBump c} {l : Filter ΞΉ}
(hΟ : Tendsto (fun i => (Ο i).rOut) l (π 0)) :
Tendsto (fun i => Function.support fun x => (Ο i).normed ΞΌ x) l (π c).smallSets := by
simp_rw [NormedAddCommGroup.tendsto_nhds_zero, Real.norm_eq_abs,
abs_eq_self.mpr (Ο _).rOut_pos.le] at hΟ
rw [nhds_basis_ball.smallSets.tendsto_right_iff]
refine fun Ξ΅ hΞ΅ β¦ (hΟ Ξ΅ hΞ΅).mono fun i hi β¦ ?_
rw [(Ο i).support_normed_eq]
exact ball_subset_ball hi.le
#align cont_diff_bump.tendsto_support_normed_small_sets ContDiffBump.tendsto_support_normed_smallSets
variable (ΞΌ)
| Mathlib/Analysis/Calculus/BumpFunction/Normed.lean | 106 | 108 | theorem integral_normed_smul {X} [NormedAddCommGroup X] [NormedSpace β X]
[CompleteSpace X] (z : X) : β« x, f.normed ΞΌ x β’ z βΞΌ = z := by |
simp_rw [integral_smul_const, f.integral_normed (ΞΌ := ΞΌ), one_smul]
|
import Mathlib.Order.Lattice
import Mathlib.Data.List.Sort
import Mathlib.Logic.Equiv.Fin
import Mathlib.Logic.Equiv.Functor
import Mathlib.Data.Fintype.Card
import Mathlib.Order.RelSeries
#align_import order.jordan_holder from "leanprover-community/mathlib"@"91288e351d51b3f0748f0a38faa7613fb0ae2ada"
universe u
open Set RelSeries
class JordanHolderLattice (X : Type u) [Lattice X] where
IsMaximal : X β X β Prop
lt_of_isMaximal : β {x y}, IsMaximal x y β x < y
sup_eq_of_isMaximal : β {x y z}, IsMaximal x z β IsMaximal y z β x β y β x β y = z
isMaximal_inf_left_of_isMaximal_sup :
β {x y}, IsMaximal x (x β y) β IsMaximal y (x β y) β IsMaximal (x β y) x
Iso : X Γ X β X Γ X β Prop
iso_symm : β {x y}, Iso x y β Iso y x
iso_trans : β {x y z}, Iso x y β Iso y z β Iso x z
second_iso : β {x y}, IsMaximal x (x β y) β Iso (x, x β y) (x β y, y)
#align jordan_holder_lattice JordanHolderLattice
open JordanHolderLattice
attribute [symm] iso_symm
attribute [trans] iso_trans
abbrev CompositionSeries (X : Type u) [Lattice X] [JordanHolderLattice X] : Type u :=
RelSeries (IsMaximal (X := X))
#align composition_series CompositionSeries
namespace CompositionSeries
variable {X : Type u} [Lattice X] [JordanHolderLattice X]
#noalign composition_series.has_coe_to_fun
#align composition_series.has_inhabited RelSeries.instInhabited
#align composition_series.step RelSeries.membership
theorem lt_succ (s : CompositionSeries X) (i : Fin s.length) :
s (Fin.castSucc i) < s (Fin.succ i) :=
lt_of_isMaximal (s.step _)
#align composition_series.lt_succ CompositionSeries.lt_succ
protected theorem strictMono (s : CompositionSeries X) : StrictMono s :=
Fin.strictMono_iff_lt_succ.2 s.lt_succ
#align composition_series.strict_mono CompositionSeries.strictMono
protected theorem injective (s : CompositionSeries X) : Function.Injective s :=
s.strictMono.injective
#align composition_series.injective CompositionSeries.injective
@[simp]
protected theorem inj (s : CompositionSeries X) {i j : Fin s.length.succ} : s i = s j β i = j :=
s.injective.eq_iff
#align composition_series.inj CompositionSeries.inj
#align composition_series.has_mem RelSeries.membership
#align composition_series.mem_def RelSeries.mem_def
theorem total {s : CompositionSeries X} {x y : X} (hx : x β s) (hy : y β s) : x β€ y β¨ y β€ x := by
rcases Set.mem_range.1 hx with β¨i, rflβ©
rcases Set.mem_range.1 hy with β¨j, rflβ©
rw [s.strictMono.le_iff_le, s.strictMono.le_iff_le]
exact le_total i j
#align composition_series.total CompositionSeries.total
#align composition_series.to_list RelSeries.toList
#align composition_series.ext_fun RelSeries.ext
#align composition_series.length_to_list RelSeries.length_toList
#align composition_series.to_list_ne_nil RelSeries.toList_ne_nil
#align composition_series.to_list_injective RelSeries.toList_injective
#align composition_series.chain'_to_list RelSeries.toList_chain'
theorem toList_sorted (s : CompositionSeries X) : s.toList.Sorted (Β· < Β·) :=
List.pairwise_iff_get.2 fun i j h => by
dsimp only [RelSeries.toList]
rw [List.get_ofFn, List.get_ofFn]
exact s.strictMono h
#align composition_series.to_list_sorted CompositionSeries.toList_sorted
theorem toList_nodup (s : CompositionSeries X) : s.toList.Nodup :=
s.toList_sorted.nodup
#align composition_series.to_list_nodup CompositionSeries.toList_nodup
#align composition_series.mem_to_list RelSeries.mem_toList
#align composition_series.of_list RelSeries.fromListChain'
#align composition_series.length_of_list RelSeries.fromListChain'_length
#noalign composition_series.of_list_to_list
#noalign composition_series.of_list_to_list'
#noalign composition_series.to_list_of_list
@[ext]
theorem ext {sβ sβ : CompositionSeries X} (h : β x, x β sβ β x β sβ) : sβ = sβ :=
toList_injective <|
List.eq_of_perm_of_sorted
(by
classical
exact List.perm_of_nodup_nodup_toFinset_eq sβ.toList_nodup sβ.toList_nodup
(Finset.ext <| by simpa only [List.mem_toFinset, RelSeries.mem_toList]))
sβ.toList_sorted sβ.toList_sorted
#align composition_series.ext CompositionSeries.ext
#align composition_series.top RelSeries.last
#align composition_series.top_mem RelSeries.last_mem
@[simp]
theorem le_last {s : CompositionSeries X} (i : Fin (s.length + 1)) : s i β€ s.last :=
s.strictMono.monotone (Fin.le_last _)
#align composition_series.le_top CompositionSeries.le_last
theorem le_last_of_mem {s : CompositionSeries X} {x : X} (hx : x β s) : x β€ s.last :=
let β¨_i, hiβ© := Set.mem_range.2 hx
hi βΈ le_last _
#align composition_series.le_top_of_mem CompositionSeries.le_last_of_mem
#align composition_series.bot RelSeries.head
#align composition_series.bot_mem RelSeries.head_mem
@[simp]
theorem head_le {s : CompositionSeries X} (i : Fin (s.length + 1)) : s.head β€ s i :=
s.strictMono.monotone (Fin.zero_le _)
#align composition_series.bot_le CompositionSeries.head_le
theorem head_le_of_mem {s : CompositionSeries X} {x : X} (hx : x β s) : s.head β€ x :=
let β¨_i, hiβ© := Set.mem_range.2 hx
hi βΈ head_le _
#align composition_series.bot_le_of_mem CompositionSeries.head_le_of_mem
-- The aligned versions of the following two lemmas are not exactly the same as the original
-- but they are mathematically equivalent.
#align composition_series.length_pos_of_mem_ne RelSeries.length_pos_of_nontrivial
#align composition_series.forall_mem_eq_of_length_eq_zero RelSeries.subsingleton_of_length_eq_zero
#align composition_series.erase_top RelSeries.eraseLast
#align composition_series.top_erase_top RelSeries.last_eraseLast
| Mathlib/Order/JordanHolder.lean | 251 | 252 | theorem last_eraseLast_le (s : CompositionSeries X) : s.eraseLast.last β€ s.last := by |
simp [eraseLast, last, s.strictMono.le_iff_le, Fin.le_iff_val_le_val, tsub_le_self]
|
import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv
#align_import linear_algebra.affine_space.affine_subspace from "leanprover-community/mathlib"@"e96bdfbd1e8c98a09ff75f7ac6204d142debc840"
noncomputable section
open Affine
open Set
section
variable (k : Type*) {V : Type*} {P : Type*} [Ring k] [AddCommGroup V] [Module k V]
variable [AffineSpace V P]
def vectorSpan (s : Set P) : Submodule k V :=
Submodule.span k (s -α΅₯ s)
#align vector_span vectorSpan
theorem vectorSpan_def (s : Set P) : vectorSpan k s = Submodule.span k (s -α΅₯ s) :=
rfl
#align vector_span_def vectorSpan_def
theorem vectorSpan_mono {sβ sβ : Set P} (h : sβ β sβ) : vectorSpan k sβ β€ vectorSpan k sβ :=
Submodule.span_mono (vsub_self_mono h)
#align vector_span_mono vectorSpan_mono
variable (P)
@[simp]
theorem vectorSpan_empty : vectorSpan k (β
: Set P) = (β₯ : Submodule k V) := by
rw [vectorSpan_def, vsub_empty, Submodule.span_empty]
#align vector_span_empty vectorSpan_empty
variable {P}
@[simp]
theorem vectorSpan_singleton (p : P) : vectorSpan k ({p} : Set P) = β₯ := by simp [vectorSpan_def]
#align vector_span_singleton vectorSpan_singleton
theorem vsub_set_subset_vectorSpan (s : Set P) : s -α΅₯ s β β(vectorSpan k s) :=
Submodule.subset_span
#align vsub_set_subset_vector_span vsub_set_subset_vectorSpan
theorem vsub_mem_vectorSpan {s : Set P} {p1 p2 : P} (hp1 : p1 β s) (hp2 : p2 β s) :
p1 -α΅₯ p2 β vectorSpan k s :=
vsub_set_subset_vectorSpan k s (vsub_mem_vsub hp1 hp2)
#align vsub_mem_vector_span vsub_mem_vectorSpan
def spanPoints (s : Set P) : Set P :=
{ p | β p1 β s, β v β vectorSpan k s, p = v +α΅₯ p1 }
#align span_points spanPoints
theorem mem_spanPoints (p : P) (s : Set P) : p β s β p β spanPoints k s
| hp => β¨p, hp, 0, Submodule.zero_mem _, (zero_vadd V p).symmβ©
#align mem_span_points mem_spanPoints
theorem subset_spanPoints (s : Set P) : s β spanPoints k s := fun p => mem_spanPoints k p s
#align subset_span_points subset_spanPoints
@[simp]
theorem spanPoints_nonempty (s : Set P) : (spanPoints k s).Nonempty β s.Nonempty := by
constructor
Β· contrapose
rw [Set.not_nonempty_iff_eq_empty, Set.not_nonempty_iff_eq_empty]
intro h
simp [h, spanPoints]
Β· exact fun h => h.mono (subset_spanPoints _ _)
#align span_points_nonempty spanPoints_nonempty
theorem vadd_mem_spanPoints_of_mem_spanPoints_of_mem_vectorSpan {s : Set P} {p : P} {v : V}
(hp : p β spanPoints k s) (hv : v β vectorSpan k s) : v +α΅₯ p β spanPoints k s := by
rcases hp with β¨p2, β¨hp2, β¨v2, β¨hv2, hv2pβ©β©β©β©
rw [hv2p, vadd_vadd]
exact β¨p2, hp2, v + v2, (vectorSpan k s).add_mem hv hv2, rflβ©
#align vadd_mem_span_points_of_mem_span_points_of_mem_vector_span vadd_mem_spanPoints_of_mem_spanPoints_of_mem_vectorSpan
theorem vsub_mem_vectorSpan_of_mem_spanPoints_of_mem_spanPoints {s : Set P} {p1 p2 : P}
(hp1 : p1 β spanPoints k s) (hp2 : p2 β spanPoints k s) : p1 -α΅₯ p2 β vectorSpan k s := by
rcases hp1 with β¨p1a, β¨hp1a, β¨v1, β¨hv1, hv1pβ©β©β©β©
rcases hp2 with β¨p2a, β¨hp2a, β¨v2, β¨hv2, hv2pβ©β©β©β©
rw [hv1p, hv2p, vsub_vadd_eq_vsub_sub (v1 +α΅₯ p1a), vadd_vsub_assoc, add_comm, add_sub_assoc]
have hv1v2 : v1 - v2 β vectorSpan k s := (vectorSpan k s).sub_mem hv1 hv2
refine (vectorSpan k s).add_mem ?_ hv1v2
exact vsub_mem_vectorSpan k hp1a hp2a
#align vsub_mem_vector_span_of_mem_span_points_of_mem_span_points vsub_mem_vectorSpan_of_mem_spanPoints_of_mem_spanPoints
end
structure AffineSubspace (k : Type*) {V : Type*} (P : Type*) [Ring k] [AddCommGroup V]
[Module k V] [AffineSpace V P] where
carrier : Set P
smul_vsub_vadd_mem :
β (c : k) {p1 p2 p3 : P},
p1 β carrier β p2 β carrier β p3 β carrier β c β’ (p1 -α΅₯ p2 : V) +α΅₯ p3 β carrier
#align affine_subspace AffineSubspace
namespace AffineSubspace
variable (k : Type*) {V : Type*} (P : Type*) [Ring k] [AddCommGroup V] [Module k V]
[AffineSpace V P]
instance : SetLike (AffineSubspace k P) P where
coe := carrier
coe_injective' p q _ := by cases p; cases q; congr
-- Porting note: removed `simp`, proof is `simp only [SetLike.mem_coe]`
theorem mem_coe (p : P) (s : AffineSubspace k P) : p β (s : Set P) β p β s :=
Iff.rfl
#align affine_subspace.mem_coe AffineSubspace.mem_coe
variable {k P}
def direction (s : AffineSubspace k P) : Submodule k V :=
vectorSpan k (s : Set P)
#align affine_subspace.direction AffineSubspace.direction
theorem direction_eq_vectorSpan (s : AffineSubspace k P) : s.direction = vectorSpan k (s : Set P) :=
rfl
#align affine_subspace.direction_eq_vector_span AffineSubspace.direction_eq_vectorSpan
def directionOfNonempty {s : AffineSubspace k P} (h : (s : Set P).Nonempty) : Submodule k V where
carrier := (s : Set P) -α΅₯ s
zero_mem' := by
cases' h with p hp
exact vsub_self p βΈ vsub_mem_vsub hp hp
add_mem' := by
rintro _ _ β¨p1, hp1, p2, hp2, rflβ© β¨p3, hp3, p4, hp4, rflβ©
rw [β vadd_vsub_assoc]
refine vsub_mem_vsub ?_ hp4
convert s.smul_vsub_vadd_mem 1 hp1 hp2 hp3
rw [one_smul]
smul_mem' := by
rintro c _ β¨p1, hp1, p2, hp2, rflβ©
rw [β vadd_vsub (c β’ (p1 -α΅₯ p2)) p2]
refine vsub_mem_vsub ?_ hp2
exact s.smul_vsub_vadd_mem c hp1 hp2 hp2
#align affine_subspace.direction_of_nonempty AffineSubspace.directionOfNonempty
theorem directionOfNonempty_eq_direction {s : AffineSubspace k P} (h : (s : Set P).Nonempty) :
directionOfNonempty h = s.direction := by
refine le_antisymm ?_ (Submodule.span_le.2 Set.Subset.rfl)
rw [β SetLike.coe_subset_coe, directionOfNonempty, direction, Submodule.coe_set_mk,
AddSubmonoid.coe_set_mk]
exact vsub_set_subset_vectorSpan k _
#align affine_subspace.direction_of_nonempty_eq_direction AffineSubspace.directionOfNonempty_eq_direction
theorem coe_direction_eq_vsub_set {s : AffineSubspace k P} (h : (s : Set P).Nonempty) :
(s.direction : Set V) = (s : Set P) -α΅₯ s :=
directionOfNonempty_eq_direction h βΈ rfl
#align affine_subspace.coe_direction_eq_vsub_set AffineSubspace.coe_direction_eq_vsub_set
theorem mem_direction_iff_eq_vsub {s : AffineSubspace k P} (h : (s : Set P).Nonempty) (v : V) :
v β s.direction β β p1 β s, β p2 β s, v = p1 -α΅₯ p2 := by
rw [β SetLike.mem_coe, coe_direction_eq_vsub_set h, Set.mem_vsub]
simp only [SetLike.mem_coe, eq_comm]
#align affine_subspace.mem_direction_iff_eq_vsub AffineSubspace.mem_direction_iff_eq_vsub
theorem vadd_mem_of_mem_direction {s : AffineSubspace k P} {v : V} (hv : v β s.direction) {p : P}
(hp : p β s) : v +α΅₯ p β s := by
rw [mem_direction_iff_eq_vsub β¨p, hpβ©] at hv
rcases hv with β¨p1, hp1, p2, hp2, hvβ©
rw [hv]
convert s.smul_vsub_vadd_mem 1 hp1 hp2 hp
rw [one_smul]
exact s.mem_coe k P _
#align affine_subspace.vadd_mem_of_mem_direction AffineSubspace.vadd_mem_of_mem_direction
theorem vsub_mem_direction {s : AffineSubspace k P} {p1 p2 : P} (hp1 : p1 β s) (hp2 : p2 β s) :
p1 -α΅₯ p2 β s.direction :=
vsub_mem_vectorSpan k hp1 hp2
#align affine_subspace.vsub_mem_direction AffineSubspace.vsub_mem_direction
theorem vadd_mem_iff_mem_direction {s : AffineSubspace k P} (v : V) {p : P} (hp : p β s) :
v +α΅₯ p β s β v β s.direction :=
β¨fun h => by simpa using vsub_mem_direction h hp, fun h => vadd_mem_of_mem_direction h hpβ©
#align affine_subspace.vadd_mem_iff_mem_direction AffineSubspace.vadd_mem_iff_mem_direction
theorem vadd_mem_iff_mem_of_mem_direction {s : AffineSubspace k P} {v : V} (hv : v β s.direction)
{p : P} : v +α΅₯ p β s β p β s := by
refine β¨fun h => ?_, fun h => vadd_mem_of_mem_direction hv hβ©
convert vadd_mem_of_mem_direction (Submodule.neg_mem _ hv) h
simp
#align affine_subspace.vadd_mem_iff_mem_of_mem_direction AffineSubspace.vadd_mem_iff_mem_of_mem_direction
theorem coe_direction_eq_vsub_set_right {s : AffineSubspace k P} {p : P} (hp : p β s) :
(s.direction : Set V) = (Β· -α΅₯ p) '' s := by
rw [coe_direction_eq_vsub_set β¨p, hpβ©]
refine le_antisymm ?_ ?_
Β· rintro v β¨p1, hp1, p2, hp2, rflβ©
exact β¨p1 -α΅₯ p2 +α΅₯ p, vadd_mem_of_mem_direction (vsub_mem_direction hp1 hp2) hp, vadd_vsub _ _β©
Β· rintro v β¨p2, hp2, rflβ©
exact β¨p2, hp2, p, hp, rflβ©
#align affine_subspace.coe_direction_eq_vsub_set_right AffineSubspace.coe_direction_eq_vsub_set_right
theorem coe_direction_eq_vsub_set_left {s : AffineSubspace k P} {p : P} (hp : p β s) :
(s.direction : Set V) = (p -α΅₯ Β·) '' s := by
ext v
rw [SetLike.mem_coe, β Submodule.neg_mem_iff, β SetLike.mem_coe,
coe_direction_eq_vsub_set_right hp, Set.mem_image, Set.mem_image]
conv_lhs =>
congr
ext
rw [β neg_vsub_eq_vsub_rev, neg_inj]
#align affine_subspace.coe_direction_eq_vsub_set_left AffineSubspace.coe_direction_eq_vsub_set_left
theorem mem_direction_iff_eq_vsub_right {s : AffineSubspace k P} {p : P} (hp : p β s) (v : V) :
v β s.direction β β p2 β s, v = p2 -α΅₯ p := by
rw [β SetLike.mem_coe, coe_direction_eq_vsub_set_right hp]
exact β¨fun β¨p2, hp2, hvβ© => β¨p2, hp2, hv.symmβ©, fun β¨p2, hp2, hvβ© => β¨p2, hp2, hv.symmβ©β©
#align affine_subspace.mem_direction_iff_eq_vsub_right AffineSubspace.mem_direction_iff_eq_vsub_right
theorem mem_direction_iff_eq_vsub_left {s : AffineSubspace k P} {p : P} (hp : p β s) (v : V) :
v β s.direction β β p2 β s, v = p -α΅₯ p2 := by
rw [β SetLike.mem_coe, coe_direction_eq_vsub_set_left hp]
exact β¨fun β¨p2, hp2, hvβ© => β¨p2, hp2, hv.symmβ©, fun β¨p2, hp2, hvβ© => β¨p2, hp2, hv.symmβ©β©
#align affine_subspace.mem_direction_iff_eq_vsub_left AffineSubspace.mem_direction_iff_eq_vsub_left
theorem vsub_right_mem_direction_iff_mem {s : AffineSubspace k P} {p : P} (hp : p β s) (p2 : P) :
p2 -α΅₯ p β s.direction β p2 β s := by
rw [mem_direction_iff_eq_vsub_right hp]
simp
#align affine_subspace.vsub_right_mem_direction_iff_mem AffineSubspace.vsub_right_mem_direction_iff_mem
theorem vsub_left_mem_direction_iff_mem {s : AffineSubspace k P} {p : P} (hp : p β s) (p2 : P) :
p -α΅₯ p2 β s.direction β p2 β s := by
rw [mem_direction_iff_eq_vsub_left hp]
simp
#align affine_subspace.vsub_left_mem_direction_iff_mem AffineSubspace.vsub_left_mem_direction_iff_mem
theorem coe_injective : Function.Injective ((β) : AffineSubspace k P β Set P) :=
SetLike.coe_injective
#align affine_subspace.coe_injective AffineSubspace.coe_injective
@[ext]
theorem ext {p q : AffineSubspace k P} (h : β x, x β p β x β q) : p = q :=
SetLike.ext h
#align affine_subspace.ext AffineSubspace.ext
-- Porting note: removed `simp`, proof is `simp only [SetLike.ext'_iff]`
theorem ext_iff (sβ sβ : AffineSubspace k P) : (sβ : Set P) = sβ β sβ = sβ :=
SetLike.ext'_iff.symm
#align affine_subspace.ext_iff AffineSubspace.ext_iff
theorem ext_of_direction_eq {s1 s2 : AffineSubspace k P} (hd : s1.direction = s2.direction)
(hn : ((s1 : Set P) β© s2).Nonempty) : s1 = s2 := by
ext p
have hq1 := Set.mem_of_mem_inter_left hn.some_mem
have hq2 := Set.mem_of_mem_inter_right hn.some_mem
constructor
Β· intro hp
rw [β vsub_vadd p hn.some]
refine vadd_mem_of_mem_direction ?_ hq2
rw [β hd]
exact vsub_mem_direction hp hq1
Β· intro hp
rw [β vsub_vadd p hn.some]
refine vadd_mem_of_mem_direction ?_ hq1
rw [hd]
exact vsub_mem_direction hp hq2
#align affine_subspace.ext_of_direction_eq AffineSubspace.ext_of_direction_eq
-- See note [reducible non instances]
abbrev toAddTorsor (s : AffineSubspace k P) [Nonempty s] : AddTorsor s.direction s where
vadd a b := β¨(a : V) +α΅₯ (b : P), vadd_mem_of_mem_direction a.2 b.2β©
zero_vadd := fun a => by
ext
exact zero_vadd _ _
add_vadd a b c := by
ext
apply add_vadd
vsub a b := β¨(a : P) -α΅₯ (b : P), (vsub_left_mem_direction_iff_mem a.2 _).mpr b.2β©
vsub_vadd' a b := by
ext
apply AddTorsor.vsub_vadd'
vadd_vsub' a b := by
ext
apply AddTorsor.vadd_vsub'
#align affine_subspace.to_add_torsor AffineSubspace.toAddTorsor
attribute [local instance] toAddTorsor
@[simp, norm_cast]
theorem coe_vsub (s : AffineSubspace k P) [Nonempty s] (a b : s) : β(a -α΅₯ b) = (a : P) -α΅₯ (b : P) :=
rfl
#align affine_subspace.coe_vsub AffineSubspace.coe_vsub
@[simp, norm_cast]
theorem coe_vadd (s : AffineSubspace k P) [Nonempty s] (a : s.direction) (b : s) :
β(a +α΅₯ b) = (a : V) +α΅₯ (b : P) :=
rfl
#align affine_subspace.coe_vadd AffineSubspace.coe_vadd
protected def subtype (s : AffineSubspace k P) [Nonempty s] : s βα΅[k] P where
toFun := (β)
linear := s.direction.subtype
map_vadd' _ _ := rfl
#align affine_subspace.subtype AffineSubspace.subtype
@[simp]
theorem subtype_linear (s : AffineSubspace k P) [Nonempty s] :
s.subtype.linear = s.direction.subtype := rfl
#align affine_subspace.subtype_linear AffineSubspace.subtype_linear
theorem subtype_apply (s : AffineSubspace k P) [Nonempty s] (p : s) : s.subtype p = p :=
rfl
#align affine_subspace.subtype_apply AffineSubspace.subtype_apply
@[simp]
theorem coeSubtype (s : AffineSubspace k P) [Nonempty s] : (s.subtype : s β P) = ((β) : s β P) :=
rfl
#align affine_subspace.coe_subtype AffineSubspace.coeSubtype
theorem injective_subtype (s : AffineSubspace k P) [Nonempty s] : Function.Injective s.subtype :=
Subtype.coe_injective
#align affine_subspace.injective_subtype AffineSubspace.injective_subtype
theorem eq_iff_direction_eq_of_mem {sβ sβ : AffineSubspace k P} {p : P} (hβ : p β sβ)
(hβ : p β sβ) : sβ = sβ β sβ.direction = sβ.direction :=
β¨fun h => h βΈ rfl, fun h => ext_of_direction_eq h β¨p, hβ, hββ©β©
#align affine_subspace.eq_iff_direction_eq_of_mem AffineSubspace.eq_iff_direction_eq_of_mem
def mk' (p : P) (direction : Submodule k V) : AffineSubspace k P where
carrier := { q | β v β direction, q = v +α΅₯ p }
smul_vsub_vadd_mem c p1 p2 p3 hp1 hp2 hp3 := by
rcases hp1 with β¨v1, hv1, hp1β©
rcases hp2 with β¨v2, hv2, hp2β©
rcases hp3 with β¨v3, hv3, hp3β©
use c β’ (v1 - v2) + v3, direction.add_mem (direction.smul_mem c (direction.sub_mem hv1 hv2)) hv3
simp [hp1, hp2, hp3, vadd_vadd]
#align affine_subspace.mk' AffineSubspace.mk'
theorem self_mem_mk' (p : P) (direction : Submodule k V) : p β mk' p direction :=
β¨0, β¨direction.zero_mem, (zero_vadd _ _).symmβ©β©
#align affine_subspace.self_mem_mk' AffineSubspace.self_mem_mk'
theorem vadd_mem_mk' {v : V} (p : P) {direction : Submodule k V} (hv : v β direction) :
v +α΅₯ p β mk' p direction :=
β¨v, hv, rflβ©
#align affine_subspace.vadd_mem_mk' AffineSubspace.vadd_mem_mk'
theorem mk'_nonempty (p : P) (direction : Submodule k V) : (mk' p direction : Set P).Nonempty :=
β¨p, self_mem_mk' p directionβ©
#align affine_subspace.mk'_nonempty AffineSubspace.mk'_nonempty
@[simp]
theorem direction_mk' (p : P) (direction : Submodule k V) :
(mk' p direction).direction = direction := by
ext v
rw [mem_direction_iff_eq_vsub (mk'_nonempty _ _)]
constructor
Β· rintro β¨p1, β¨v1, hv1, hp1β©, p2, β¨v2, hv2, hp2β©, hvβ©
rw [hv, hp1, hp2, vadd_vsub_vadd_cancel_right]
exact direction.sub_mem hv1 hv2
Β· exact fun hv => β¨v +α΅₯ p, vadd_mem_mk' _ hv, p, self_mem_mk' _ _, (vadd_vsub _ _).symmβ©
#align affine_subspace.direction_mk' AffineSubspace.direction_mk'
theorem mem_mk'_iff_vsub_mem {pβ pβ : P} {direction : Submodule k V} :
pβ β mk' pβ direction β pβ -α΅₯ pβ β direction := by
refine β¨fun h => ?_, fun h => ?_β©
Β· rw [β direction_mk' pβ direction]
exact vsub_mem_direction h (self_mem_mk' _ _)
Β· rw [β vsub_vadd pβ pβ]
exact vadd_mem_mk' pβ h
#align affine_subspace.mem_mk'_iff_vsub_mem AffineSubspace.mem_mk'_iff_vsub_mem
@[simp]
theorem mk'_eq {s : AffineSubspace k P} {p : P} (hp : p β s) : mk' p s.direction = s :=
ext_of_direction_eq (direction_mk' p s.direction) β¨p, Set.mem_inter (self_mem_mk' _ _) hpβ©
#align affine_subspace.mk'_eq AffineSubspace.mk'_eq
| Mathlib/LinearAlgebra/AffineSpace/AffineSubspace.lean | 496 | 505 | theorem spanPoints_subset_coe_of_subset_coe {s : Set P} {s1 : AffineSubspace k P} (h : s β s1) :
spanPoints k s β s1 := by |
rintro p β¨p1, hp1, v, hv, hpβ©
rw [hp]
have hp1s1 : p1 β (s1 : Set P) := Set.mem_of_mem_of_subset hp1 h
refine vadd_mem_of_mem_direction ?_ hp1s1
have hs : vectorSpan k s β€ s1.direction := vectorSpan_mono k h
rw [SetLike.le_def] at hs
rw [β SetLike.mem_coe]
exact Set.mem_of_mem_of_subset hv hs
|
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.Identities
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.Polynomial.Nilpotent
import Mathlib.RingTheory.Polynomial.Tower
open Set Function
noncomputable section
namespace Polynomial
variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] (P : R[X]) {x : S}
def newtonMap (x : S) : S :=
x - (Ring.inverse <| aeval x (derivative P)) * aeval x P
theorem newtonMap_apply :
P.newtonMap x = x - (Ring.inverse <| aeval x (derivative P)) * (aeval x P) :=
rfl
variable {P}
theorem newtonMap_apply_of_isUnit (h : IsUnit <| aeval x (derivative P)) :
P.newtonMap x = x - h.unitβ»ΒΉ * aeval x P := by
simp [newtonMap_apply, Ring.inverse, h]
| Mathlib/Dynamics/Newton.lean | 57 | 59 | theorem newtonMap_apply_of_not_isUnit (h : Β¬ (IsUnit <| aeval x (derivative P))) :
P.newtonMap x = x := by |
simp [newtonMap_apply, Ring.inverse, h]
|
import Mathlib.Data.Set.Prod
#align_import data.set.n_ary from "leanprover-community/mathlib"@"5e526d18cea33550268dcbbddcb822d5cde40654"
open Function
namespace Set
variable {Ξ± Ξ±' Ξ² Ξ²' Ξ³ Ξ³' Ξ΄ Ξ΄' Ξ΅ Ξ΅' ΞΆ ΞΆ' Ξ½ : Type*} {f f' : Ξ± β Ξ² β Ξ³} {g g' : Ξ± β Ξ² β Ξ³ β Ξ΄}
variable {s s' : Set Ξ±} {t t' : Set Ξ²} {u u' : Set Ξ³} {v : Set Ξ΄} {a a' : Ξ±} {b b' : Ξ²} {c c' : Ξ³}
{d d' : Ξ΄}
theorem mem_image2_iff (hf : Injective2 f) : f a b β image2 f s t β a β s β§ b β t :=
β¨by
rintro β¨a', ha', b', hb', hβ©
rcases hf h with β¨rfl, rflβ©
exact β¨ha', hb'β©, fun β¨ha, hbβ© => mem_image2_of_mem ha hbβ©
#align set.mem_image2_iff Set.mem_image2_iff
theorem image2_subset (hs : s β s') (ht : t β t') : image2 f s t β image2 f s' t' := by
rintro _ β¨a, ha, b, hb, rflβ©
exact mem_image2_of_mem (hs ha) (ht hb)
#align set.image2_subset Set.image2_subset
theorem image2_subset_left (ht : t β t') : image2 f s t β image2 f s t' :=
image2_subset Subset.rfl ht
#align set.image2_subset_left Set.image2_subset_left
theorem image2_subset_right (hs : s β s') : image2 f s t β image2 f s' t :=
image2_subset hs Subset.rfl
#align set.image2_subset_right Set.image2_subset_right
theorem image_subset_image2_left (hb : b β t) : (fun a => f a b) '' s β image2 f s t :=
forall_mem_image.2 fun _ ha => mem_image2_of_mem ha hb
#align set.image_subset_image2_left Set.image_subset_image2_left
theorem image_subset_image2_right (ha : a β s) : f a '' t β image2 f s t :=
forall_mem_image.2 fun _ => mem_image2_of_mem ha
#align set.image_subset_image2_right Set.image_subset_image2_right
theorem forall_image2_iff {p : Ξ³ β Prop} :
(β z β image2 f s t, p z) β β x β s, β y β t, p (f x y) :=
β¨fun h x hx y hy => h _ β¨x, hx, y, hy, rflβ©, fun h _ β¨x, hx, y, hy, hzβ© => hz βΈ h x hx y hyβ©
#align set.forall_image2_iff Set.forall_image2_iff
@[simp]
theorem image2_subset_iff {u : Set Ξ³} : image2 f s t β u β β x β s, β y β t, f x y β u :=
forall_image2_iff
#align set.image2_subset_iff Set.image2_subset_iff
theorem image2_subset_iff_left : image2 f s t β u β β a β s, (fun b => f a b) '' t β u := by
simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage]
#align set.image2_subset_iff_left Set.image2_subset_iff_left
theorem image2_subset_iff_right : image2 f s t β u β β b β t, (fun a => f a b) '' s β u := by
simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage, @forallβ_swap Ξ±]
#align set.image2_subset_iff_right Set.image2_subset_iff_right
variable (f)
-- Porting note: Removing `simp` - LHS does not simplify
lemma image_prod : (fun x : Ξ± Γ Ξ² β¦ f x.1 x.2) '' s ΓΛ’ t = image2 f s t :=
ext fun _ β¦ by simp [and_assoc]
#align set.image_prod Set.image_prod
@[simp] lemma image_uncurry_prod (s : Set Ξ±) (t : Set Ξ²) : uncurry f '' s ΓΛ’ t = image2 f s t :=
image_prod _
#align set.image_uncurry_prod Set.image_uncurry_prod
@[simp] lemma image2_mk_eq_prod : image2 Prod.mk s t = s ΓΛ’ t := ext <| by simp
#align set.image2_mk_eq_prod Set.image2_mk_eq_prod
-- Porting note: Removing `simp` - LHS does not simplify
lemma image2_curry (f : Ξ± Γ Ξ² β Ξ³) (s : Set Ξ±) (t : Set Ξ²) :
image2 (fun a b β¦ f (a, b)) s t = f '' s ΓΛ’ t := by
simp [β image_uncurry_prod, uncurry]
#align set.image2_curry Set.image2_curry
theorem image2_swap (s : Set Ξ±) (t : Set Ξ²) : image2 f s t = image2 (fun a b => f b a) t s := by
ext
constructor <;> rintro β¨a, ha, b, hb, rflβ© <;> exact β¨b, hb, a, ha, rflβ©
#align set.image2_swap Set.image2_swap
variable {f}
theorem image2_union_left : image2 f (s βͺ s') t = image2 f s t βͺ image2 f s' t := by
simp_rw [β image_prod, union_prod, image_union]
#align set.image2_union_left Set.image2_union_left
theorem image2_union_right : image2 f s (t βͺ t') = image2 f s t βͺ image2 f s t' := by
rw [β image2_swap, image2_union_left, image2_swap f, image2_swap f]
#align set.image2_union_right Set.image2_union_right
lemma image2_inter_left (hf : Injective2 f) :
image2 f (s β© s') t = image2 f s t β© image2 f s' t := by
simp_rw [β image_uncurry_prod, inter_prod, image_inter hf.uncurry]
#align set.image2_inter_left Set.image2_inter_left
lemma image2_inter_right (hf : Injective2 f) :
image2 f s (t β© t') = image2 f s t β© image2 f s t' := by
simp_rw [β image_uncurry_prod, prod_inter, image_inter hf.uncurry]
#align set.image2_inter_right Set.image2_inter_right
@[simp]
theorem image2_empty_left : image2 f β
t = β
:=
ext <| by simp
#align set.image2_empty_left Set.image2_empty_left
@[simp]
theorem image2_empty_right : image2 f s β
= β
:=
ext <| by simp
#align set.image2_empty_right Set.image2_empty_right
theorem Nonempty.image2 : s.Nonempty β t.Nonempty β (image2 f s t).Nonempty :=
fun β¨_, haβ© β¨_, hbβ© => β¨_, mem_image2_of_mem ha hbβ©
#align set.nonempty.image2 Set.Nonempty.image2
@[simp]
theorem image2_nonempty_iff : (image2 f s t).Nonempty β s.Nonempty β§ t.Nonempty :=
β¨fun β¨_, a, ha, b, hb, _β© => β¨β¨a, haβ©, b, hbβ©, fun h => h.1.image2 h.2β©
#align set.image2_nonempty_iff Set.image2_nonempty_iff
theorem Nonempty.of_image2_left (h : (Set.image2 f s t).Nonempty) : s.Nonempty :=
(image2_nonempty_iff.1 h).1
#align set.nonempty.of_image2_left Set.Nonempty.of_image2_left
theorem Nonempty.of_image2_right (h : (Set.image2 f s t).Nonempty) : t.Nonempty :=
(image2_nonempty_iff.1 h).2
#align set.nonempty.of_image2_right Set.Nonempty.of_image2_right
@[simp]
theorem image2_eq_empty_iff : image2 f s t = β
β s = β
β¨ t = β
:= by
rw [β not_nonempty_iff_eq_empty, image2_nonempty_iff, not_and_or]
simp [not_nonempty_iff_eq_empty]
#align set.image2_eq_empty_iff Set.image2_eq_empty_iff
theorem Subsingleton.image2 (hs : s.Subsingleton) (ht : t.Subsingleton) (f : Ξ± β Ξ² β Ξ³) :
(image2 f s t).Subsingleton := by
rw [β image_prod]
apply (hs.prod ht).image
theorem image2_inter_subset_left : image2 f (s β© s') t β image2 f s t β© image2 f s' t :=
Monotone.map_inf_le (fun _ _ β¦ image2_subset_right) s s'
#align set.image2_inter_subset_left Set.image2_inter_subset_left
theorem image2_inter_subset_right : image2 f s (t β© t') β image2 f s t β© image2 f s t' :=
Monotone.map_inf_le (fun _ _ β¦ image2_subset_left) t t'
#align set.image2_inter_subset_right Set.image2_inter_subset_right
@[simp]
theorem image2_singleton_left : image2 f {a} t = f a '' t :=
ext fun x => by simp
#align set.image2_singleton_left Set.image2_singleton_left
@[simp]
theorem image2_singleton_right : image2 f s {b} = (fun a => f a b) '' s :=
ext fun x => by simp
#align set.image2_singleton_right Set.image2_singleton_right
theorem image2_singleton : image2 f {a} {b} = {f a b} := by simp
#align set.image2_singleton Set.image2_singleton
@[simp]
theorem image2_insert_left : image2 f (insert a s) t = (fun b => f a b) '' t βͺ image2 f s t := by
rw [insert_eq, image2_union_left, image2_singleton_left]
#align set.image2_insert_left Set.image2_insert_left
@[simp]
theorem image2_insert_right : image2 f s (insert b t) = (fun a => f a b) '' s βͺ image2 f s t := by
rw [insert_eq, image2_union_right, image2_singleton_right]
#align set.image2_insert_right Set.image2_insert_right
@[congr]
theorem image2_congr (h : β a β s, β b β t, f a b = f' a b) : image2 f s t = image2 f' s t := by
ext
constructor <;> rintro β¨a, ha, b, hb, rflβ© <;> exact β¨a, ha, b, hb, by rw [h a ha b hb]β©
#align set.image2_congr Set.image2_congr
theorem image2_congr' (h : β a b, f a b = f' a b) : image2 f s t = image2 f' s t :=
image2_congr fun a _ b _ => h a b
#align set.image2_congr' Set.image2_congr'
#noalign set.image3
#noalign set.mem_image3
#noalign set.image3_mono
#noalign set.image3_congr
#noalign set.image3_congr'
#noalign set.image2_image2_left
#noalign set.image2_image2_right
theorem image_image2 (f : Ξ± β Ξ² β Ξ³) (g : Ξ³ β Ξ΄) :
g '' image2 f s t = image2 (fun a b => g (f a b)) s t := by
simp only [β image_prod, image_image]
#align set.image_image2 Set.image_image2
theorem image2_image_left (f : Ξ³ β Ξ² β Ξ΄) (g : Ξ± β Ξ³) :
image2 f (g '' s) t = image2 (fun a b => f (g a) b) s t := by
ext; simp
#align set.image2_image_left Set.image2_image_left
theorem image2_image_right (f : Ξ± β Ξ³ β Ξ΄) (g : Ξ² β Ξ³) :
image2 f s (g '' t) = image2 (fun a b => f a (g b)) s t := by
ext; simp
#align set.image2_image_right Set.image2_image_right
@[simp]
theorem image2_left (h : t.Nonempty) : image2 (fun x _ => x) s t = s := by
simp [nonempty_def.mp h, ext_iff]
#align set.image2_left Set.image2_left
@[simp]
| Mathlib/Data/Set/NAry.lean | 230 | 231 | theorem image2_right (h : s.Nonempty) : image2 (fun _ y => y) s t = t := by |
simp [nonempty_def.mp h, ext_iff]
|
import Mathlib.LinearAlgebra.AffineSpace.Basis
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
#align_import linear_algebra.affine_space.matrix from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
open Affine Matrix
open Set
universe uβ uβ uβ uβ
variable {ΞΉ : Type uβ} {k : Type uβ} {V : Type uβ} {P : Type uβ}
variable [AddCommGroup V] [AffineSpace V P]
namespace AffineBasis
section Ring
variable [Ring k] [Module k V] (b : AffineBasis ΞΉ k P)
noncomputable def toMatrix {ΞΉ' : Type*} (q : ΞΉ' β P) : Matrix ΞΉ' ΞΉ k :=
fun i j => b.coord j (q i)
#align affine_basis.to_matrix AffineBasis.toMatrix
@[simp]
theorem toMatrix_apply {ΞΉ' : Type*} (q : ΞΉ' β P) (i : ΞΉ') (j : ΞΉ) :
b.toMatrix q i j = b.coord j (q i) := rfl
#align affine_basis.to_matrix_apply AffineBasis.toMatrix_apply
@[simp]
theorem toMatrix_self [DecidableEq ΞΉ] : b.toMatrix b = (1 : Matrix ΞΉ ΞΉ k) := by
ext i j
rw [toMatrix_apply, coord_apply, Matrix.one_eq_pi_single, Pi.single_apply]
#align affine_basis.to_matrix_self AffineBasis.toMatrix_self
variable {ΞΉ' : Type*}
| Mathlib/LinearAlgebra/AffineSpace/Matrix.lean | 55 | 56 | theorem toMatrix_row_sum_one [Fintype ΞΉ] (q : ΞΉ' β P) (i : ΞΉ') : β j, b.toMatrix q i j = 1 := by |
simp
|
import Mathlib.CategoryTheory.EpiMono
import Mathlib.CategoryTheory.Limits.HasLimits
#align_import category_theory.limits.shapes.equalizers from "leanprover-community/mathlib"@"4698e35ca56a0d4fa53aa5639c3364e0a77f4eba"
section
open CategoryTheory Opposite
namespace CategoryTheory.Limits
-- attribute [local tidy] tactic.case_bash -- Porting note: no tidy nor cases_bash
universe v vβ u uβ
inductive WalkingParallelPair : Type
| zero
| one
deriving DecidableEq, Inhabited
#align category_theory.limits.walking_parallel_pair CategoryTheory.Limits.WalkingParallelPair
open WalkingParallelPair
inductive WalkingParallelPairHom : WalkingParallelPair β WalkingParallelPair β Type
| left : WalkingParallelPairHom zero one
| right : WalkingParallelPairHom zero one
| id (X : WalkingParallelPair) : WalkingParallelPairHom X X
deriving DecidableEq
#align category_theory.limits.walking_parallel_pair_hom CategoryTheory.Limits.WalkingParallelPairHom
attribute [-simp, nolint simpNF] WalkingParallelPairHom.id.sizeOf_spec
instance : Inhabited (WalkingParallelPairHom zero one) where default := WalkingParallelPairHom.left
open WalkingParallelPairHom
def WalkingParallelPairHom.comp :
-- Porting note: changed X Y Z to implicit to match comp fields in precategory
β { X Y Z : WalkingParallelPair } (_ : WalkingParallelPairHom X Y)
(_ : WalkingParallelPairHom Y Z), WalkingParallelPairHom X Z
| _, _, _, id _, h => h
| _, _, _, left, id one => left
| _, _, _, right, id one => right
#align category_theory.limits.walking_parallel_pair_hom.comp CategoryTheory.Limits.WalkingParallelPairHom.comp
-- Porting note: adding these since they are simple and aesop couldn't directly prove them
theorem WalkingParallelPairHom.id_comp
{X Y : WalkingParallelPair} (g : WalkingParallelPairHom X Y) : comp (id X) g = g :=
rfl
theorem WalkingParallelPairHom.comp_id
{X Y : WalkingParallelPair} (f : WalkingParallelPairHom X Y) : comp f (id Y) = f := by
cases f <;> rfl
theorem WalkingParallelPairHom.assoc {X Y Z W : WalkingParallelPair}
(f : WalkingParallelPairHom X Y) (g: WalkingParallelPairHom Y Z)
(h : WalkingParallelPairHom Z W) : comp (comp f g) h = comp f (comp g h) := by
cases f <;> cases g <;> cases h <;> rfl
instance walkingParallelPairHomCategory : SmallCategory WalkingParallelPair where
Hom := WalkingParallelPairHom
id := id
comp := comp
comp_id := comp_id
id_comp := id_comp
assoc := assoc
#align category_theory.limits.walking_parallel_pair_hom_category CategoryTheory.Limits.walkingParallelPairHomCategory
@[simp]
theorem walkingParallelPairHom_id (X : WalkingParallelPair) : WalkingParallelPairHom.id X = π X :=
rfl
#align category_theory.limits.walking_parallel_pair_hom_id CategoryTheory.Limits.walkingParallelPairHom_id
-- Porting note: simpNF asked me to do this because the LHS of the non-primed version reduced
@[simp]
theorem WalkingParallelPairHom.id.sizeOf_spec' (X : WalkingParallelPair) :
(WalkingParallelPairHom._sizeOf_inst X X).sizeOf (π X) = 1 + sizeOf X := by cases X <;> rfl
def walkingParallelPairOp : WalkingParallelPair β₯€ WalkingParallelPairα΅α΅ where
obj x := op <| by cases x; exacts [one, zero]
map f := by
cases f <;> apply Quiver.Hom.op
exacts [left, right, WalkingParallelPairHom.id _]
map_comp := by rintro _ _ _ (_|_|_) g <;> cases g <;> rfl
#align category_theory.limits.walking_parallel_pair_op CategoryTheory.Limits.walkingParallelPairOp
@[simp]
theorem walkingParallelPairOp_zero : walkingParallelPairOp.obj zero = op one := rfl
#align category_theory.limits.walking_parallel_pair_op_zero CategoryTheory.Limits.walkingParallelPairOp_zero
@[simp]
theorem walkingParallelPairOp_one : walkingParallelPairOp.obj one = op zero := rfl
#align category_theory.limits.walking_parallel_pair_op_one CategoryTheory.Limits.walkingParallelPairOp_one
@[simp]
theorem walkingParallelPairOp_left :
walkingParallelPairOp.map left = @Quiver.Hom.op _ _ zero one left := rfl
#align category_theory.limits.walking_parallel_pair_op_left CategoryTheory.Limits.walkingParallelPairOp_left
@[simp]
theorem walkingParallelPairOp_right :
walkingParallelPairOp.map right = @Quiver.Hom.op _ _ zero one right := rfl
#align category_theory.limits.walking_parallel_pair_op_right CategoryTheory.Limits.walkingParallelPairOp_right
@[simps functor inverse]
def walkingParallelPairOpEquiv : WalkingParallelPair β WalkingParallelPairα΅α΅ where
functor := walkingParallelPairOp
inverse := walkingParallelPairOp.leftOp
unitIso :=
NatIso.ofComponents (fun j => eqToIso (by cases j <;> rfl))
(by rintro _ _ (_ | _ | _) <;> simp)
counitIso :=
NatIso.ofComponents (fun j => eqToIso (by
induction' j with X
cases X <;> rfl))
(fun {i} {j} f => by
induction' i with i
induction' j with j
let g := f.unop
have : f = g.op := rfl
rw [this]
cases i <;> cases j <;> cases g <;> rfl)
functor_unitIso_comp := fun j => by cases j <;> rfl
#align category_theory.limits.walking_parallel_pair_op_equiv CategoryTheory.Limits.walkingParallelPairOpEquiv
@[simp]
theorem walkingParallelPairOpEquiv_unitIso_zero :
walkingParallelPairOpEquiv.unitIso.app zero = Iso.refl zero := rfl
#align category_theory.limits.walking_parallel_pair_op_equiv_unit_iso_zero CategoryTheory.Limits.walkingParallelPairOpEquiv_unitIso_zero
@[simp]
theorem walkingParallelPairOpEquiv_unitIso_one :
walkingParallelPairOpEquiv.unitIso.app one = Iso.refl one := rfl
#align category_theory.limits.walking_parallel_pair_op_equiv_unit_iso_one CategoryTheory.Limits.walkingParallelPairOpEquiv_unitIso_one
@[simp]
theorem walkingParallelPairOpEquiv_counitIso_zero :
walkingParallelPairOpEquiv.counitIso.app (op zero) = Iso.refl (op zero) := rfl
#align category_theory.limits.walking_parallel_pair_op_equiv_counit_iso_zero CategoryTheory.Limits.walkingParallelPairOpEquiv_counitIso_zero
@[simp]
theorem walkingParallelPairOpEquiv_counitIso_one :
walkingParallelPairOpEquiv.counitIso.app (op one) = Iso.refl (op one) :=
rfl
#align category_theory.limits.walking_parallel_pair_op_equiv_counit_iso_one CategoryTheory.Limits.walkingParallelPairOpEquiv_counitIso_one
variable {C : Type u} [Category.{v} C]
variable {X Y : C}
def parallelPair (f g : X βΆ Y) : WalkingParallelPair β₯€ C where
obj x :=
match x with
| zero => X
| one => Y
map h :=
match h with
| WalkingParallelPairHom.id _ => π _
| left => f
| right => g
-- `sorry` can cope with this, but it's too slow:
map_comp := by
rintro _ _ _ β¨β© g <;> cases g <;> {dsimp; simp}
#align category_theory.limits.parallel_pair CategoryTheory.Limits.parallelPair
@[simp]
theorem parallelPair_obj_zero (f g : X βΆ Y) : (parallelPair f g).obj zero = X := rfl
#align category_theory.limits.parallel_pair_obj_zero CategoryTheory.Limits.parallelPair_obj_zero
@[simp]
theorem parallelPair_obj_one (f g : X βΆ Y) : (parallelPair f g).obj one = Y := rfl
#align category_theory.limits.parallel_pair_obj_one CategoryTheory.Limits.parallelPair_obj_one
@[simp]
theorem parallelPair_map_left (f g : X βΆ Y) : (parallelPair f g).map left = f := rfl
#align category_theory.limits.parallel_pair_map_left CategoryTheory.Limits.parallelPair_map_left
@[simp]
theorem parallelPair_map_right (f g : X βΆ Y) : (parallelPair f g).map right = g := rfl
#align category_theory.limits.parallel_pair_map_right CategoryTheory.Limits.parallelPair_map_right
@[simp]
| Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean | 241 | 242 | theorem parallelPair_functor_obj {F : WalkingParallelPair β₯€ C} (j : WalkingParallelPair) :
(parallelPair (F.map left) (F.map right)).obj j = F.obj j := by | cases j <;> rfl
|
import Mathlib.Algebra.Exact
import Mathlib.RingTheory.TensorProduct.Basic
section Modules
open TensorProduct LinearMap
section Semiring
variable {R : Type*} [CommSemiring R] {M N P Q: Type*}
[AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] [AddCommMonoid Q]
[Module R M] [Module R N] [Module R P] [Module R Q]
{f : M ββ[R] N} (g : N ββ[R] P)
lemma le_comap_range_lTensor (q : Q) :
LinearMap.range g β€ (LinearMap.range (lTensor Q g)).comap (TensorProduct.mk R Q P q) := by
rintro x β¨n, rflβ©
exact β¨q ββ[R] n, rflβ©
lemma le_comap_range_rTensor (q : Q) :
LinearMap.range g β€ (LinearMap.range (rTensor Q g)).comap
((TensorProduct.mk R P Q).flip q) := by
rintro x β¨n, rflβ©
exact β¨n ββ[R] q, rflβ©
variable (Q) {g}
theorem LinearMap.lTensor_surjective (hg : Function.Surjective g) :
Function.Surjective (lTensor Q g) := by
intro z
induction z using TensorProduct.induction_on with
| zero => exact β¨0, map_zero _β©
| tmul q p =>
obtain β¨n, rflβ© := hg p
exact β¨q ββ[R] n, rflβ©
| add x y hx hy =>
obtain β¨x, rflβ© := hx
obtain β¨y, rflβ© := hy
exact β¨x + y, map_add _ _ _β©
theorem LinearMap.lTensor_range :
range (lTensor Q g) =
range (lTensor Q (Submodule.subtype (range g))) := by
have : g = (Submodule.subtype _).comp g.rangeRestrict := rfl
nth_rewrite 1 [this]
rw [lTensor_comp]
apply range_comp_of_range_eq_top
rw [range_eq_top]
apply lTensor_surjective
rw [β range_eq_top, range_rangeRestrict]
theorem LinearMap.rTensor_surjective (hg : Function.Surjective g) :
Function.Surjective (rTensor Q g) := by
intro z
induction z using TensorProduct.induction_on with
| zero => exact β¨0, map_zero _β©
| tmul p q =>
obtain β¨n, rflβ© := hg p
exact β¨n ββ[R] q, rflβ©
| add x y hx hy =>
obtain β¨x, rflβ© := hx
obtain β¨y, rflβ© := hy
exact β¨x + y, map_add _ _ _β©
| Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean | 149 | 158 | theorem LinearMap.rTensor_range :
range (rTensor Q g) =
range (rTensor Q (Submodule.subtype (range g))) := by |
have : g = (Submodule.subtype _).comp g.rangeRestrict := rfl
nth_rewrite 1 [this]
rw [rTensor_comp]
apply range_comp_of_range_eq_top
rw [range_eq_top]
apply rTensor_surjective
rw [β range_eq_top, range_rangeRestrict]
|
import Mathlib.Algebra.Group.Aut
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Logic.Function.Basic
#align_import group_theory.semidirect_product from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
variable (N : Type*) (G : Type*) {H : Type*} [Group N] [Group G] [Group H]
@[ext]
structure SemidirectProduct (Ο : G β* MulAut N) where
left : N
right : G
deriving DecidableEq
#align semidirect_product SemidirectProduct
-- Porting note: these lemmas are autogenerated by the inductive definition and are not
-- in simple form due to the existence of mk_eq_inl_mul_inr
attribute [nolint simpNF] SemidirectProduct.mk.injEq
attribute [nolint simpNF] SemidirectProduct.mk.sizeOf_spec
-- Porting note: unknown attribute
-- attribute [pp_using_anonymous_constructor] SemidirectProduct
@[inherit_doc]
notation:35 N " β[" Ο:35 "] " G:35 => SemidirectProduct N G Ο
namespace SemidirectProduct
variable {N G}
variable {Ο : G β* MulAut N}
instance : Mul (SemidirectProduct N G Ο) where
mul a b := β¨a.1 * Ο a.2 b.1, a.2 * b.2β©
lemma mul_def (a b : SemidirectProduct N G Ο) : a * b = β¨a.1 * Ο a.2 b.1, a.2 * b.2β© := rfl
@[simp]
theorem mul_left (a b : N β[Ο] G) : (a * b).left = a.left * Ο a.right b.left := rfl
#align semidirect_product.mul_left SemidirectProduct.mul_left
@[simp]
theorem mul_right (a b : N β[Ο] G) : (a * b).right = a.right * b.right := rfl
#align semidirect_product.mul_right SemidirectProduct.mul_right
instance : One (SemidirectProduct N G Ο) where one := β¨1, 1β©
@[simp]
theorem one_left : (1 : N β[Ο] G).left = 1 := rfl
#align semidirect_product.one_left SemidirectProduct.one_left
@[simp]
theorem one_right : (1 : N β[Ο] G).right = 1 := rfl
#align semidirect_product.one_right SemidirectProduct.one_right
instance : Inv (SemidirectProduct N G Ο) where
inv x := β¨Ο x.2β»ΒΉ x.1β»ΒΉ, x.2β»ΒΉβ©
@[simp]
theorem inv_left (a : N β[Ο] G) : aβ»ΒΉ.left = Ο a.rightβ»ΒΉ a.leftβ»ΒΉ := rfl
#align semidirect_product.inv_left SemidirectProduct.inv_left
@[simp]
theorem inv_right (a : N β[Ο] G) : aβ»ΒΉ.right = a.rightβ»ΒΉ := rfl
#align semidirect_product.inv_right SemidirectProduct.inv_right
instance : Group (N β[Ο] G) where
mul_assoc a b c := SemidirectProduct.ext _ _ (by simp [mul_assoc]) (by simp [mul_assoc])
one_mul a := SemidirectProduct.ext _ _ (by simp) (one_mul a.2)
mul_one a := SemidirectProduct.ext _ _ (by simp) (mul_one _)
mul_left_inv a := SemidirectProduct.ext _ _ (by simp) (by simp)
instance : Inhabited (N β[Ο] G) := β¨1β©
def inl : N β* N β[Ο] G where
toFun n := β¨n, 1β©
map_one' := rfl
map_mul' := by intros; ext <;>
simp only [mul_left, map_one, MulAut.one_apply, mul_right, mul_one]
#align semidirect_product.inl SemidirectProduct.inl
@[simp]
theorem left_inl (n : N) : (inl n : N β[Ο] G).left = n := rfl
#align semidirect_product.left_inl SemidirectProduct.left_inl
@[simp]
theorem right_inl (n : N) : (inl n : N β[Ο] G).right = 1 := rfl
#align semidirect_product.right_inl SemidirectProduct.right_inl
theorem inl_injective : Function.Injective (inl : N β N β[Ο] G) :=
Function.injective_iff_hasLeftInverse.2 β¨left, left_inlβ©
#align semidirect_product.inl_injective SemidirectProduct.inl_injective
@[simp]
theorem inl_inj {nβ nβ : N} : (inl nβ : N β[Ο] G) = inl nβ β nβ = nβ :=
inl_injective.eq_iff
#align semidirect_product.inl_inj SemidirectProduct.inl_inj
def inr : G β* N β[Ο] G where
toFun g := β¨1, gβ©
map_one' := rfl
map_mul' := by intros; ext <;> simp
#align semidirect_product.inr SemidirectProduct.inr
@[simp]
theorem left_inr (g : G) : (inr g : N β[Ο] G).left = 1 := rfl
#align semidirect_product.left_inr SemidirectProduct.left_inr
@[simp]
theorem right_inr (g : G) : (inr g : N β[Ο] G).right = g := rfl
#align semidirect_product.right_inr SemidirectProduct.right_inr
theorem inr_injective : Function.Injective (inr : G β N β[Ο] G) :=
Function.injective_iff_hasLeftInverse.2 β¨right, right_inrβ©
#align semidirect_product.inr_injective SemidirectProduct.inr_injective
@[simp]
theorem inr_inj {gβ gβ : G} : (inr gβ : N β[Ο] G) = inr gβ β gβ = gβ :=
inr_injective.eq_iff
#align semidirect_product.inr_inj SemidirectProduct.inr_inj
theorem inl_aut (g : G) (n : N) : (inl (Ο g n) : N β[Ο] G) = inr g * inl n * inr gβ»ΒΉ := by
ext <;> simp
#align semidirect_product.inl_aut SemidirectProduct.inl_aut
theorem inl_aut_inv (g : G) (n : N) : (inl ((Ο g)β»ΒΉ n) : N β[Ο] G) = inr gβ»ΒΉ * inl n * inr g := by
rw [β MonoidHom.map_inv, inl_aut, inv_inv]
#align semidirect_product.inl_aut_inv SemidirectProduct.inl_aut_inv
@[simp]
theorem mk_eq_inl_mul_inr (g : G) (n : N) : (β¨n, gβ© : N β[Ο] G) = inl n * inr g := by ext <;> simp
#align semidirect_product.mk_eq_inl_mul_inr SemidirectProduct.mk_eq_inl_mul_inr
@[simp]
theorem inl_left_mul_inr_right (x : N β[Ο] G) : inl x.left * inr x.right = x := by ext <;> simp
#align semidirect_product.inl_left_mul_inr_right SemidirectProduct.inl_left_mul_inr_right
def rightHom : N β[Ο] G β* G where
toFun := SemidirectProduct.right
map_one' := rfl
map_mul' _ _ := rfl
#align semidirect_product.right_hom SemidirectProduct.rightHom
@[simp]
theorem rightHom_eq_right : (rightHom : N β[Ο] G β G) = right := rfl
#align semidirect_product.right_hom_eq_right SemidirectProduct.rightHom_eq_right
@[simp]
theorem rightHom_comp_inl : (rightHom : N β[Ο] G β* G).comp inl = 1 := by ext; simp [rightHom]
#align semidirect_product.right_hom_comp_inl SemidirectProduct.rightHom_comp_inl
@[simp]
theorem rightHom_comp_inr : (rightHom : N β[Ο] G β* G).comp inr = MonoidHom.id _ := by
ext; simp [rightHom]
#align semidirect_product.right_hom_comp_inr SemidirectProduct.rightHom_comp_inr
@[simp]
theorem rightHom_inl (n : N) : rightHom (inl n : N β[Ο] G) = 1 := by simp [rightHom]
#align semidirect_product.right_hom_inl SemidirectProduct.rightHom_inl
@[simp]
theorem rightHom_inr (g : G) : rightHom (inr g : N β[Ο] G) = g := by simp [rightHom]
#align semidirect_product.right_hom_inr SemidirectProduct.rightHom_inr
theorem rightHom_surjective : Function.Surjective (rightHom : N β[Ο] G β G) :=
Function.surjective_iff_hasRightInverse.2 β¨inr, rightHom_inrβ©
#align semidirect_product.right_hom_surjective SemidirectProduct.rightHom_surjective
theorem range_inl_eq_ker_rightHom : (inl : N β* N β[Ο] G).range = rightHom.ker :=
le_antisymm (fun _ β¦ by simp (config := { contextual := true }) [MonoidHom.mem_ker, eq_comm])
fun x hx β¦ β¨x.left, by ext <;> simp_all [MonoidHom.mem_ker]β©
#align semidirect_product.range_inl_eq_ker_right_hom SemidirectProduct.range_inl_eq_ker_rightHom
section Map
variable {Nβ : Type*} {Gβ : Type*} [Group Nβ] [Group Gβ] {Οβ : Gβ β* MulAut Nβ}
def map (fβ : N β* Nβ) (fβ : G β* Gβ)
(h : β g : G, fβ.comp (Ο g).toMonoidHom = (Οβ (fβ g)).toMonoidHom.comp fβ) :
N β[Ο] G β* Nβ β[Οβ] Gβ where
toFun x := β¨fβ x.1, fβ x.2β©
map_one' := by simp
map_mul' x y := by
replace h := DFunLike.ext_iff.1 (h x.right) y.left
ext <;> simp_all
#align semidirect_product.map SemidirectProduct.map
variable (fβ : N β* Nβ) (fβ : G β* Gβ)
(h : β g : G, fβ.comp (Ο g).toMonoidHom = (Οβ (fβ g)).toMonoidHom.comp fβ)
@[simp]
theorem map_left (g : N β[Ο] G) : (map fβ fβ h g).left = fβ g.left := rfl
#align semidirect_product.map_left SemidirectProduct.map_left
@[simp]
theorem map_right (g : N β[Ο] G) : (map fβ fβ h g).right = fβ g.right := rfl
#align semidirect_product.map_right SemidirectProduct.map_right
@[simp]
theorem rightHom_comp_map : rightHom.comp (map fβ fβ h) = fβ.comp rightHom := rfl
#align semidirect_product.right_hom_comp_map SemidirectProduct.rightHom_comp_map
@[simp]
| Mathlib/GroupTheory/SemidirectProduct.lean | 292 | 292 | theorem map_inl (n : N) : map fβ fβ h (inl n) = inl (fβ n) := by | simp [map]
|
import Mathlib.Data.List.Range
import Mathlib.Data.List.Perm
#align_import data.list.sigma from "leanprover-community/mathlib"@"f808feb6c18afddb25e66a71d317643cf7fb5fbb"
universe u v
namespace List
variable {Ξ± : Type u} {Ξ² : Ξ± β Type v} {l lβ lβ : List (Sigma Ξ²)}
def keys : List (Sigma Ξ²) β List Ξ± :=
map Sigma.fst
#align list.keys List.keys
@[simp]
theorem keys_nil : @keys Ξ± Ξ² [] = [] :=
rfl
#align list.keys_nil List.keys_nil
@[simp]
theorem keys_cons {s} {l : List (Sigma Ξ²)} : (s :: l).keys = s.1 :: l.keys :=
rfl
#align list.keys_cons List.keys_cons
theorem mem_keys_of_mem {s : Sigma Ξ²} {l : List (Sigma Ξ²)} : s β l β s.1 β l.keys :=
mem_map_of_mem Sigma.fst
#align list.mem_keys_of_mem List.mem_keys_of_mem
theorem exists_of_mem_keys {a} {l : List (Sigma Ξ²)} (h : a β l.keys) :
β b : Ξ² a, Sigma.mk a b β l :=
let β¨β¨_, b'β©, m, eβ© := exists_of_mem_map h
Eq.recOn e (Exists.intro b' m)
#align list.exists_of_mem_keys List.exists_of_mem_keys
theorem mem_keys {a} {l : List (Sigma Ξ²)} : a β l.keys β β b : Ξ² a, Sigma.mk a b β l :=
β¨exists_of_mem_keys, fun β¨_, hβ© => mem_keys_of_mem hβ©
#align list.mem_keys List.mem_keys
theorem not_mem_keys {a} {l : List (Sigma Ξ²)} : a β l.keys β β b : Ξ² a, Sigma.mk a b β l :=
(not_congr mem_keys).trans not_exists
#align list.not_mem_keys List.not_mem_keys
theorem not_eq_key {a} {l : List (Sigma Ξ²)} : a β l.keys β β s : Sigma Ξ², s β l β a β s.1 :=
Iff.intro (fun hβ s hβ e => absurd (mem_keys_of_mem hβ) (by rwa [e] at hβ)) fun f hβ =>
let β¨b, hββ© := exists_of_mem_keys hβ
f _ hβ rfl
#align list.not_eq_key List.not_eq_key
def NodupKeys (l : List (Sigma Ξ²)) : Prop :=
l.keys.Nodup
#align list.nodupkeys List.NodupKeys
theorem nodupKeys_iff_pairwise {l} : NodupKeys l β Pairwise (fun s s' : Sigma Ξ² => s.1 β s'.1) l :=
pairwise_map
#align list.nodupkeys_iff_pairwise List.nodupKeys_iff_pairwise
theorem NodupKeys.pairwise_ne {l} (h : NodupKeys l) :
Pairwise (fun s s' : Sigma Ξ² => s.1 β s'.1) l :=
nodupKeys_iff_pairwise.1 h
#align list.nodupkeys.pairwise_ne List.NodupKeys.pairwise_ne
@[simp]
theorem nodupKeys_nil : @NodupKeys Ξ± Ξ² [] :=
Pairwise.nil
#align list.nodupkeys_nil List.nodupKeys_nil
@[simp]
theorem nodupKeys_cons {s : Sigma Ξ²} {l : List (Sigma Ξ²)} :
NodupKeys (s :: l) β s.1 β l.keys β§ NodupKeys l := by simp [keys, NodupKeys]
#align list.nodupkeys_cons List.nodupKeys_cons
theorem not_mem_keys_of_nodupKeys_cons {s : Sigma Ξ²} {l : List (Sigma Ξ²)} (h : NodupKeys (s :: l)) :
s.1 β l.keys :=
(nodupKeys_cons.1 h).1
#align list.not_mem_keys_of_nodupkeys_cons List.not_mem_keys_of_nodupKeys_cons
theorem nodupKeys_of_nodupKeys_cons {s : Sigma Ξ²} {l : List (Sigma Ξ²)} (h : NodupKeys (s :: l)) :
NodupKeys l :=
(nodupKeys_cons.1 h).2
#align list.nodupkeys_of_nodupkeys_cons List.nodupKeys_of_nodupKeys_cons
theorem NodupKeys.eq_of_fst_eq {l : List (Sigma Ξ²)} (nd : NodupKeys l) {s s' : Sigma Ξ²} (h : s β l)
(h' : s' β l) : s.1 = s'.1 β s = s' :=
@Pairwise.forall_of_forall _ (fun s s' : Sigma Ξ² => s.1 = s'.1 β s = s') _
(fun _ _ H h => (H h.symm).symm) (fun _ _ _ => rfl)
((nodupKeys_iff_pairwise.1 nd).imp fun h h' => (h h').elim) _ h _ h'
#align list.nodupkeys.eq_of_fst_eq List.NodupKeys.eq_of_fst_eq
theorem NodupKeys.eq_of_mk_mem {a : Ξ±} {b b' : Ξ² a} {l : List (Sigma Ξ²)} (nd : NodupKeys l)
(h : Sigma.mk a b β l) (h' : Sigma.mk a b' β l) : b = b' := by
cases nd.eq_of_fst_eq h h' rfl; rfl
#align list.nodupkeys.eq_of_mk_mem List.NodupKeys.eq_of_mk_mem
theorem nodupKeys_singleton (s : Sigma Ξ²) : NodupKeys [s] :=
nodup_singleton _
#align list.nodupkeys_singleton List.nodupKeys_singleton
theorem NodupKeys.sublist {lβ lβ : List (Sigma Ξ²)} (h : lβ <+ lβ) : NodupKeys lβ β NodupKeys lβ :=
Nodup.sublist <| h.map _
#align list.nodupkeys.sublist List.NodupKeys.sublist
protected theorem NodupKeys.nodup {l : List (Sigma Ξ²)} : NodupKeys l β Nodup l :=
Nodup.of_map _
#align list.nodupkeys.nodup List.NodupKeys.nodup
theorem perm_nodupKeys {lβ lβ : List (Sigma Ξ²)} (h : lβ ~ lβ) : NodupKeys lβ β NodupKeys lβ :=
(h.map _).nodup_iff
#align list.perm_nodupkeys List.perm_nodupKeys
theorem nodupKeys_join {L : List (List (Sigma Ξ²))} :
NodupKeys (join L) β (β l β L, NodupKeys l) β§ Pairwise Disjoint (L.map keys) := by
rw [nodupKeys_iff_pairwise, pairwise_join, pairwise_map]
refine and_congr (forallβ_congr fun l _ => by simp [nodupKeys_iff_pairwise]) ?_
apply iff_of_eq; congr with (lβ lβ)
simp [keys, disjoint_iff_ne]
#align list.nodupkeys_join List.nodupKeys_join
theorem nodup_enum_map_fst (l : List Ξ±) : (l.enum.map Prod.fst).Nodup := by simp [List.nodup_range]
#align list.nodup_enum_map_fst List.nodup_enum_map_fst
theorem mem_ext {lβ lβ : List (Sigma Ξ²)} (ndβ : lβ.Nodup) (ndβ : lβ.Nodup)
(h : β x, x β lβ β x β lβ) : lβ ~ lβ :=
(perm_ext_iff_of_nodup ndβ ndβ).2 h
#align list.mem_ext List.mem_ext
variable [DecidableEq Ξ±]
-- Porting note: renaming to `dlookup` since `lookup` already exists
def dlookup (a : Ξ±) : List (Sigma Ξ²) β Option (Ξ² a)
| [] => none
| β¨a', bβ© :: l => if h : a' = a then some (Eq.recOn h b) else dlookup a l
#align list.lookup List.dlookup
@[simp]
theorem dlookup_nil (a : Ξ±) : dlookup a [] = @none (Ξ² a) :=
rfl
#align list.lookup_nil List.dlookup_nil
@[simp]
theorem dlookup_cons_eq (l) (a : Ξ±) (b : Ξ² a) : dlookup a (β¨a, bβ© :: l) = some b :=
dif_pos rfl
#align list.lookup_cons_eq List.dlookup_cons_eq
@[simp]
theorem dlookup_cons_ne (l) {a} : β s : Sigma Ξ², a β s.1 β dlookup a (s :: l) = dlookup a l
| β¨_, _β©, h => dif_neg h.symm
#align list.lookup_cons_ne List.dlookup_cons_ne
theorem dlookup_isSome {a : Ξ±} : β {l : List (Sigma Ξ²)}, (dlookup a l).isSome β a β l.keys
| [] => by simp
| β¨a', bβ© :: l => by
by_cases h : a = a'
Β· subst a'
simp
Β· simp [h, dlookup_isSome]
#align list.lookup_is_some List.dlookup_isSome
theorem dlookup_eq_none {a : Ξ±} {l : List (Sigma Ξ²)} : dlookup a l = none β a β l.keys := by
simp [β dlookup_isSome, Option.isNone_iff_eq_none]
#align list.lookup_eq_none List.dlookup_eq_none
theorem of_mem_dlookup {a : Ξ±} {b : Ξ² a} :
β {l : List (Sigma Ξ²)}, b β dlookup a l β Sigma.mk a b β l
| β¨a', b'β© :: l, H => by
by_cases h : a = a'
Β· subst a'
simp? at H says simp only [dlookup_cons_eq, Option.mem_def, Option.some.injEq] at H
simp [H]
Β· simp only [ne_eq, h, not_false_iff, dlookup_cons_ne] at H
simp [of_mem_dlookup H]
#align list.of_mem_lookup List.of_mem_dlookup
theorem mem_dlookup {a} {b : Ξ² a} {l : List (Sigma Ξ²)} (nd : l.NodupKeys) (h : Sigma.mk a b β l) :
b β dlookup a l := by
cases' Option.isSome_iff_exists.mp (dlookup_isSome.mpr (mem_keys_of_mem h)) with b' h'
cases nd.eq_of_mk_mem h (of_mem_dlookup h')
exact h'
#align list.mem_lookup List.mem_dlookup
theorem map_dlookup_eq_find (a : Ξ±) :
β l : List (Sigma Ξ²), (dlookup a l).map (Sigma.mk a) = find? (fun s => a = s.1) l
| [] => rfl
| β¨a', b'β© :: l => by
by_cases h : a = a'
Β· subst a'
simp
Β· simpa [h] using map_dlookup_eq_find a l
#align list.map_lookup_eq_find List.map_dlookup_eq_find
theorem mem_dlookup_iff {a : Ξ±} {b : Ξ² a} {l : List (Sigma Ξ²)} (nd : l.NodupKeys) :
b β dlookup a l β Sigma.mk a b β l :=
β¨of_mem_dlookup, mem_dlookup ndβ©
#align list.mem_lookup_iff List.mem_dlookup_iff
theorem perm_dlookup (a : Ξ±) {lβ lβ : List (Sigma Ξ²)} (ndβ : lβ.NodupKeys) (ndβ : lβ.NodupKeys)
(p : lβ ~ lβ) : dlookup a lβ = dlookup a lβ := by
ext b; simp only [mem_dlookup_iff ndβ, mem_dlookup_iff ndβ]; exact p.mem_iff
#align list.perm_lookup List.perm_dlookup
theorem lookup_ext {lβ lβ : List (Sigma Ξ²)} (ndβ : lβ.NodupKeys) (ndβ : lβ.NodupKeys)
(h : β x y, y β lβ.dlookup x β y β lβ.dlookup x) : lβ ~ lβ :=
mem_ext ndβ.nodup ndβ.nodup fun β¨a, bβ© => by
rw [β mem_dlookup_iff, β mem_dlookup_iff, h] <;> assumption
#align list.lookup_ext List.lookup_ext
def lookupAll (a : Ξ±) : List (Sigma Ξ²) β List (Ξ² a)
| [] => []
| β¨a', bβ© :: l => if h : a' = a then Eq.recOn h b :: lookupAll a l else lookupAll a l
#align list.lookup_all List.lookupAll
@[simp]
theorem lookupAll_nil (a : Ξ±) : lookupAll a [] = @nil (Ξ² a) :=
rfl
#align list.lookup_all_nil List.lookupAll_nil
@[simp]
theorem lookupAll_cons_eq (l) (a : Ξ±) (b : Ξ² a) : lookupAll a (β¨a, bβ© :: l) = b :: lookupAll a l :=
dif_pos rfl
#align list.lookup_all_cons_eq List.lookupAll_cons_eq
@[simp]
theorem lookupAll_cons_ne (l) {a} : β s : Sigma Ξ², a β s.1 β lookupAll a (s :: l) = lookupAll a l
| β¨_, _β©, h => dif_neg h.symm
#align list.lookup_all_cons_ne List.lookupAll_cons_ne
theorem lookupAll_eq_nil {a : Ξ±} :
β {l : List (Sigma Ξ²)}, lookupAll a l = [] β β b : Ξ² a, Sigma.mk a b β l
| [] => by simp
| β¨a', bβ© :: l => by
by_cases h : a = a'
Β· subst a'
simp only [lookupAll_cons_eq, mem_cons, Sigma.mk.inj_iff, heq_eq_eq, true_and, not_or,
false_iff, not_forall, not_and, not_not]
use b
simp
Β· simp [h, lookupAll_eq_nil]
#align list.lookup_all_eq_nil List.lookupAll_eq_nil
theorem head?_lookupAll (a : Ξ±) : β l : List (Sigma Ξ²), head? (lookupAll a l) = dlookup a l
| [] => by simp
| β¨a', bβ© :: l => by
by_cases h : a = a'
Β· subst h; simp
Β· rw [lookupAll_cons_ne, dlookup_cons_ne, head?_lookupAll a l] <;> assumption
#align list.head_lookup_all List.head?_lookupAll
theorem mem_lookupAll {a : Ξ±} {b : Ξ² a} :
β {l : List (Sigma Ξ²)}, b β lookupAll a l β Sigma.mk a b β l
| [] => by simp
| β¨a', b'β© :: l => by
by_cases h : a = a'
Β· subst h
simp [*, mem_lookupAll]
Β· simp [*, mem_lookupAll]
#align list.mem_lookup_all List.mem_lookupAll
theorem lookupAll_sublist (a : Ξ±) : β l : List (Sigma Ξ²), (lookupAll a l).map (Sigma.mk a) <+ l
| [] => by simp
| β¨a', b'β© :: l => by
by_cases h : a = a'
Β· subst h
simp only [ne_eq, not_true, lookupAll_cons_eq, List.map]
exact (lookupAll_sublist a l).consβ _
Β· simp only [ne_eq, h, not_false_iff, lookupAll_cons_ne]
exact (lookupAll_sublist a l).cons _
#align list.lookup_all_sublist List.lookupAll_sublist
theorem lookupAll_length_le_one (a : Ξ±) {l : List (Sigma Ξ²)} (h : l.NodupKeys) :
length (lookupAll a l) β€ 1 := by
have := Nodup.sublist ((lookupAll_sublist a l).map _) h
rw [map_map] at this
rwa [β nodup_replicate, β map_const]
#align list.lookup_all_length_le_one List.lookupAll_length_le_one
theorem lookupAll_eq_dlookup (a : Ξ±) {l : List (Sigma Ξ²)} (h : l.NodupKeys) :
lookupAll a l = (dlookup a l).toList := by
rw [β head?_lookupAll]
have h1 := lookupAll_length_le_one a h; revert h1
rcases lookupAll a l with (_ | β¨b, _ | β¨c, lβ©β©) <;> intro h1 <;> try rfl
exact absurd h1 (by simp)
#align list.lookup_all_eq_lookup List.lookupAll_eq_dlookup
theorem lookupAll_nodup (a : Ξ±) {l : List (Sigma Ξ²)} (h : l.NodupKeys) : (lookupAll a l).Nodup := by
(rw [lookupAll_eq_dlookup a h]; apply Option.toList_nodup)
#align list.lookup_all_nodup List.lookupAll_nodup
theorem perm_lookupAll (a : Ξ±) {lβ lβ : List (Sigma Ξ²)} (ndβ : lβ.NodupKeys) (ndβ : lβ.NodupKeys)
(p : lβ ~ lβ) : lookupAll a lβ = lookupAll a lβ := by
simp [lookupAll_eq_dlookup, ndβ, ndβ, perm_dlookup a ndβ ndβ p]
#align list.perm_lookup_all List.perm_lookupAll
def kreplace (a : Ξ±) (b : Ξ² a) : List (Sigma Ξ²) β List (Sigma Ξ²) :=
lookmap fun s => if a = s.1 then some β¨a, bβ© else none
#align list.kreplace List.kreplace
theorem kreplace_of_forall_not (a : Ξ±) (b : Ξ² a) {l : List (Sigma Ξ²)}
(H : β b : Ξ² a, Sigma.mk a b β l) : kreplace a b l = l :=
lookmap_of_forall_not _ <| by
rintro β¨a', b'β© h; dsimp; split_ifs
Β· subst a'
exact H _ h
Β· rfl
#align list.kreplace_of_forall_not List.kreplace_of_forall_not
theorem kreplace_self {a : Ξ±} {b : Ξ² a} {l : List (Sigma Ξ²)} (nd : NodupKeys l)
(h : Sigma.mk a b β l) : kreplace a b l = l := by
refine (lookmap_congr ?_).trans (lookmap_id' (Option.guard fun (s : Sigma Ξ²) => a = s.1) ?_ _)
Β· rintro β¨a', b'β© h'
dsimp [Option.guard]
split_ifs
Β· subst a'
simp [nd.eq_of_mk_mem h h']
Β· rfl
Β· rintro β¨aβ, bββ© β¨aβ, bββ©
dsimp [Option.guard]
split_ifs
Β· simp
Β· rintro β¨β©
#align list.kreplace_self List.kreplace_self
theorem keys_kreplace (a : Ξ±) (b : Ξ² a) : β l : List (Sigma Ξ²), (kreplace a b l).keys = l.keys :=
lookmap_map_eq _ _ <| by
rintro β¨aβ, bββ© β¨aβ, bββ©
dsimp
split_ifs with h <;> simp (config := { contextual := true }) [h]
#align list.keys_kreplace List.keys_kreplace
theorem kreplace_nodupKeys (a : Ξ±) (b : Ξ² a) {l : List (Sigma Ξ²)} :
(kreplace a b l).NodupKeys β l.NodupKeys := by simp [NodupKeys, keys_kreplace]
#align list.kreplace_nodupkeys List.kreplace_nodupKeys
theorem Perm.kreplace {a : Ξ±} {b : Ξ² a} {lβ lβ : List (Sigma Ξ²)} (nd : lβ.NodupKeys) :
lβ ~ lβ β kreplace a b lβ ~ kreplace a b lβ :=
perm_lookmap _ <| by
refine nd.pairwise_ne.imp ?_
intro x y h z hβ w hβ
split_ifs at hβ hβ with h_2 h_1 <;> cases hβ <;> cases hβ
exact (h (h_2.symm.trans h_1)).elim
#align list.perm.kreplace List.Perm.kreplace
def kerase (a : Ξ±) : List (Sigma Ξ²) β List (Sigma Ξ²) :=
eraseP fun s => a = s.1
#align list.kerase List.kerase
-- Porting note (#10618): removing @[simp], `simp` can prove it
theorem kerase_nil {a} : @kerase _ Ξ² _ a [] = [] :=
rfl
#align list.kerase_nil List.kerase_nil
@[simp]
theorem kerase_cons_eq {a} {s : Sigma Ξ²} {l : List (Sigma Ξ²)} (h : a = s.1) :
kerase a (s :: l) = l := by simp [kerase, h]
#align list.kerase_cons_eq List.kerase_cons_eq
@[simp]
theorem kerase_cons_ne {a} {s : Sigma Ξ²} {l : List (Sigma Ξ²)} (h : a β s.1) :
kerase a (s :: l) = s :: kerase a l := by simp [kerase, h]
#align list.kerase_cons_ne List.kerase_cons_ne
@[simp]
theorem kerase_of_not_mem_keys {a} {l : List (Sigma Ξ²)} (h : a β l.keys) : kerase a l = l := by
induction' l with _ _ ih <;> [rfl; (simp [not_or] at h; simp [h.1, ih h.2])]
#align list.kerase_of_not_mem_keys List.kerase_of_not_mem_keys
theorem kerase_sublist (a : Ξ±) (l : List (Sigma Ξ²)) : kerase a l <+ l :=
eraseP_sublist _
#align list.kerase_sublist List.kerase_sublist
theorem kerase_keys_subset (a) (l : List (Sigma Ξ²)) : (kerase a l).keys β l.keys :=
((kerase_sublist a l).map _).subset
#align list.kerase_keys_subset List.kerase_keys_subset
theorem mem_keys_of_mem_keys_kerase {aβ aβ} {l : List (Sigma Ξ²)} :
aβ β (kerase aβ l).keys β aβ β l.keys :=
@kerase_keys_subset _ _ _ _ _ _
#align list.mem_keys_of_mem_keys_kerase List.mem_keys_of_mem_keys_kerase
theorem exists_of_kerase {a : Ξ±} {l : List (Sigma Ξ²)} (h : a β l.keys) :
β (b : Ξ² a) (lβ lβ : List (Sigma Ξ²)),
a β lβ.keys β§ l = lβ ++ β¨a, bβ© :: lβ β§ kerase a l = lβ ++ lβ := by
induction l with
| nil => cases h
| cons hd tl ih =>
by_cases e : a = hd.1
Β· subst e
exact β¨hd.2, [], tl, by simp, by cases hd; rfl, by simpβ©
Β· simp only [keys_cons, mem_cons] at h
cases' h with h h
Β· exact absurd h e
rcases ih h with β¨b, tlβ, tlβ, hβ, hβ, hββ©
exact β¨b, hd :: tlβ, tlβ, not_mem_cons_of_ne_of_not_mem e hβ, by (rw [hβ]; rfl), by
simp [e, hβ]β©
#align list.exists_of_kerase List.exists_of_kerase
@[simp]
theorem mem_keys_kerase_of_ne {aβ aβ} {l : List (Sigma Ξ²)} (h : aβ β aβ) :
aβ β (kerase aβ l).keys β aβ β l.keys :=
(Iff.intro mem_keys_of_mem_keys_kerase) fun p =>
if q : aβ β l.keys then
match l, kerase aβ l, exists_of_kerase q, p with
| _, _, β¨_, _, _, _, rfl, rflβ©, p => by simpa [keys, h] using p
else by simp [q, p]
#align list.mem_keys_kerase_of_ne List.mem_keys_kerase_of_ne
theorem keys_kerase {a} {l : List (Sigma Ξ²)} : (kerase a l).keys = l.keys.erase a := by
rw [keys, kerase, erase_eq_eraseP, eraseP_map, Function.comp]
simp only [beq_eq_decide]
congr
funext
simp
#align list.keys_kerase List.keys_kerase
theorem kerase_kerase {a a'} {l : List (Sigma Ξ²)} :
(kerase a' l).kerase a = (kerase a l).kerase a' := by
by_cases h : a = a'
Β· subst a'; rfl
induction' l with x xs
Β· rfl
Β· by_cases a' = x.1
Β· subst a'
simp [kerase_cons_ne h, kerase_cons_eq rfl]
by_cases h' : a = x.1
Β· subst a
simp [kerase_cons_eq rfl, kerase_cons_ne (Ne.symm h)]
Β· simp [kerase_cons_ne, *]
#align list.kerase_kerase List.kerase_kerase
theorem NodupKeys.kerase (a : Ξ±) : NodupKeys l β (kerase a l).NodupKeys :=
NodupKeys.sublist <| kerase_sublist _ _
#align list.nodupkeys.kerase List.NodupKeys.kerase
theorem Perm.kerase {a : Ξ±} {lβ lβ : List (Sigma Ξ²)} (nd : lβ.NodupKeys) :
lβ ~ lβ β kerase a lβ ~ kerase a lβ := by
apply Perm.eraseP
apply (nodupKeys_iff_pairwise.1 nd).imp
intros; simp_all
#align list.perm.kerase List.Perm.kerase
@[simp]
| Mathlib/Data/List/Sigma.lean | 491 | 500 | theorem not_mem_keys_kerase (a) {l : List (Sigma Ξ²)} (nd : l.NodupKeys) :
a β (kerase a l).keys := by |
induction l with
| nil => simp
| cons hd tl ih =>
simp? at nd says simp only [nodupKeys_cons] at nd
by_cases h : a = hd.1
Β· subst h
simp [nd.1]
Β· simp [h, ih nd.2]
|
import Mathlib.CategoryTheory.Abelian.Basic
import Mathlib.CategoryTheory.Preadditive.Opposite
import Mathlib.CategoryTheory.Limits.Opposites
#align_import category_theory.abelian.opposite from "leanprover-community/mathlib"@"a5ff45a1c92c278b03b52459a620cfd9c49ebc80"
noncomputable section
namespace CategoryTheory
open CategoryTheory.Limits
variable (C : Type*) [Category C] [Abelian C]
-- Porting note: these local instances do not seem to be necessary
--attribute [local instance]
-- hasFiniteLimits_of_hasEqualizers_and_finite_products
-- hasFiniteColimits_of_hasCoequalizers_and_finite_coproducts
-- Abelian.hasFiniteBiproducts
instance : Abelian Cα΅α΅ := by
-- Porting note: priorities of `Abelian.has_kernels` and `Abelian.has_cokernels` have
-- been set to 90 in `Abelian.Basic` in order to prevent a timeout here
exact {
normalMonoOfMono := fun f => normalMonoOfNormalEpiUnop _ (normalEpiOfEpi f.unop)
normalEpiOfEpi := fun f => normalEpiOfNormalMonoUnop _ (normalMonoOfMono f.unop) }
section
variable {C}
variable {X Y : C} (f : X βΆ Y) {A B : Cα΅α΅} (g : A βΆ B)
-- TODO: Generalize (this will work whenever f has a cokernel)
-- (The abelian case is probably sufficient for most applications.)
@[simps]
def kernelOpUnop : (kernel f.op).unop β
cokernel f where
hom := (kernel.lift f.op (cokernel.Ο f).op <| by simp [β op_comp]).unop
inv :=
cokernel.desc f (kernel.ΞΉ f.op).unop <| by
rw [β f.unop_op, β unop_comp, f.unop_op]
simp
hom_inv_id := by
rw [β unop_id, β (cokernel.desc f _ _).unop_op, β unop_comp]
congr 1
ext
simp [β op_comp]
inv_hom_id := by
ext
simp [β unop_comp]
#align category_theory.kernel_op_unop CategoryTheory.kernelOpUnop
-- TODO: Generalize (this will work whenever f has a kernel)
-- (The abelian case is probably sufficient for most applications.)
@[simps]
def cokernelOpUnop : (cokernel f.op).unop β
kernel f where
hom :=
kernel.lift f (cokernel.Ο f.op).unop <| by
rw [β f.unop_op, β unop_comp, f.unop_op]
simp
inv := (cokernel.desc f.op (kernel.ΞΉ f).op <| by simp [β op_comp]).unop
hom_inv_id := by
rw [β unop_id, β (kernel.lift f _ _).unop_op, β unop_comp]
congr 1
ext
simp [β op_comp]
inv_hom_id := by
ext
simp [β unop_comp]
#align category_theory.cokernel_op_unop CategoryTheory.cokernelOpUnop
@[simps!]
def kernelUnopOp : Opposite.op (kernel g.unop) β
cokernel g :=
(cokernelOpUnop g.unop).op
#align category_theory.kernel_unop_op CategoryTheory.kernelUnopOp
@[simps!]
def cokernelUnopOp : Opposite.op (cokernel g.unop) β
kernel g :=
(kernelOpUnop g.unop).op
#align category_theory.cokernel_unop_op CategoryTheory.cokernelUnopOp
| Mathlib/CategoryTheory/Abelian/Opposite.lean | 95 | 98 | theorem cokernel.Ο_op :
(cokernel.Ο f.op).unop =
(cokernelOpUnop f).hom β« kernel.ΞΉ f β« eqToHom (Opposite.unop_op _).symm := by |
simp [cokernelOpUnop]
|
import Mathlib.Data.List.Basic
#align_import data.list.infix from "leanprover-community/mathlib"@"26f081a2fb920140ed5bc5cc5344e84bcc7cb2b2"
open Nat
variable {Ξ± Ξ² : Type*}
namespace List
variable {l lβ lβ lβ : List Ξ±} {a b : Ξ±} {m n : β}
section Fix
#align list.prefix_append List.prefix_append
#align list.suffix_append List.suffix_append
#align list.infix_append List.infix_append
#align list.infix_append' List.infix_append'
#align list.is_prefix.is_infix List.IsPrefix.isInfix
#align list.is_suffix.is_infix List.IsSuffix.isInfix
#align list.nil_prefix List.nil_prefix
#align list.nil_suffix List.nil_suffix
#align list.nil_infix List.nil_infix
#align list.prefix_refl List.prefix_refl
#align list.suffix_refl List.suffix_refl
#align list.infix_refl List.infix_refl
theorem prefix_rfl : l <+: l :=
prefix_refl _
#align list.prefix_rfl List.prefix_rfl
theorem suffix_rfl : l <:+ l :=
suffix_refl _
#align list.suffix_rfl List.suffix_rfl
theorem infix_rfl : l <:+: l :=
infix_refl _
#align list.infix_rfl List.infix_rfl
#align list.suffix_cons List.suffix_cons
theorem prefix_concat (a : Ξ±) (l) : l <+: concat l a := by simp
#align list.prefix_concat List.prefix_concat
theorem prefix_concat_iff {lβ lβ : List Ξ±} {a : Ξ±} :
lβ <+: lβ ++ [a] β lβ = lβ ++ [a] β¨ lβ <+: lβ := by
simpa only [β reverse_concat', reverse_inj, reverse_suffix] using
suffix_cons_iff (lβ := lβ.reverse) (lβ := lβ.reverse)
#align list.infix_cons List.infix_cons
#align list.infix_concat List.infix_concat
#align list.is_prefix.trans List.IsPrefix.trans
#align list.is_suffix.trans List.IsSuffix.trans
#align list.is_infix.trans List.IsInfix.trans
#align list.is_infix.sublist List.IsInfix.sublist
#align list.is_infix.subset List.IsInfix.subset
#align list.is_prefix.sublist List.IsPrefix.sublist
#align list.is_prefix.subset List.IsPrefix.subset
#align list.is_suffix.sublist List.IsSuffix.sublist
#align list.is_suffix.subset List.IsSuffix.subset
#align list.reverse_suffix List.reverse_suffix
#align list.reverse_prefix List.reverse_prefix
#align list.reverse_infix List.reverse_infix
protected alias β¨_, isSuffix.reverseβ© := reverse_prefix
#align list.is_suffix.reverse List.isSuffix.reverse
protected alias β¨_, isPrefix.reverseβ© := reverse_suffix
#align list.is_prefix.reverse List.isPrefix.reverse
protected alias β¨_, isInfix.reverseβ© := reverse_infix
#align list.is_infix.reverse List.isInfix.reverse
#align list.is_infix.length_le List.IsInfix.length_le
#align list.is_prefix.length_le List.IsPrefix.length_le
#align list.is_suffix.length_le List.IsSuffix.length_le
#align list.infix_nil_iff List.infix_nil
#align list.prefix_nil_iff List.prefix_nil
#align list.suffix_nil_iff List.suffix_nil
alias β¨eq_nil_of_infix_nil, _β© := infix_nil
#align list.eq_nil_of_infix_nil List.eq_nil_of_infix_nil
alias β¨eq_nil_of_prefix_nil, _β© := prefix_nil
#align list.eq_nil_of_prefix_nil List.eq_nil_of_prefix_nil
alias β¨eq_nil_of_suffix_nil, _β© := suffix_nil
#align list.eq_nil_of_suffix_nil List.eq_nil_of_suffix_nil
#align list.infix_iff_prefix_suffix List.infix_iff_prefix_suffix
theorem eq_of_infix_of_length_eq (h : lβ <:+: lβ) : lβ.length = lβ.length β lβ = lβ :=
h.sublist.eq_of_length
#align list.eq_of_infix_of_length_eq List.eq_of_infix_of_length_eq
theorem eq_of_prefix_of_length_eq (h : lβ <+: lβ) : lβ.length = lβ.length β lβ = lβ :=
h.sublist.eq_of_length
#align list.eq_of_prefix_of_length_eq List.eq_of_prefix_of_length_eq
theorem eq_of_suffix_of_length_eq (h : lβ <:+ lβ) : lβ.length = lβ.length β lβ = lβ :=
h.sublist.eq_of_length
#align list.eq_of_suffix_of_length_eq List.eq_of_suffix_of_length_eq
#align list.prefix_of_prefix_length_le List.prefix_of_prefix_length_le
#align list.prefix_or_prefix_of_prefix List.prefix_or_prefix_of_prefix
#align list.suffix_of_suffix_length_le List.suffix_of_suffix_length_le
#align list.suffix_or_suffix_of_suffix List.suffix_or_suffix_of_suffix
#align list.suffix_cons_iff List.suffix_cons_iff
#align list.infix_cons_iff List.infix_cons_iff
#align list.infix_of_mem_join List.infix_of_mem_join
#align list.prefix_append_right_inj List.prefix_append_right_inj
#align list.prefix_cons_inj List.prefix_cons_inj
#align list.take_prefix List.take_prefix
#align list.drop_suffix List.drop_suffix
#align list.take_sublist List.take_sublist
#align list.drop_sublist List.drop_sublist
#align list.take_subset List.take_subset
#align list.drop_subset List.drop_subset
#align list.mem_of_mem_take List.mem_of_mem_take
#align list.mem_of_mem_drop List.mem_of_mem_drop
lemma dropSlice_sublist (n m : β) (l : List Ξ±) : l.dropSlice n m <+ l :=
calc
l.dropSlice n m = take n l ++ drop m (drop n l) := by rw [dropSlice_eq, drop_drop, Nat.add_comm]
_ <+ take n l ++ drop n l := (Sublist.refl _).append (drop_sublist _ _)
_ = _ := take_append_drop _ _
#align list.slice_sublist List.dropSlice_sublist
lemma dropSlice_subset (n m : β) (l : List Ξ±) : l.dropSlice n m β l :=
(dropSlice_sublist n m l).subset
#align list.slice_subset List.dropSlice_subset
lemma mem_of_mem_dropSlice {n m : β} {l : List Ξ±} {a : Ξ±} (h : a β l.dropSlice n m) : a β l :=
dropSlice_subset n m l h
#align list.mem_of_mem_slice List.mem_of_mem_dropSlice
theorem takeWhile_prefix (p : Ξ± β Bool) : l.takeWhile p <+: l :=
β¨l.dropWhile p, takeWhile_append_dropWhile p lβ©
#align list.take_while_prefix List.takeWhile_prefix
theorem dropWhile_suffix (p : Ξ± β Bool) : l.dropWhile p <:+ l :=
β¨l.takeWhile p, takeWhile_append_dropWhile p lβ©
#align list.drop_while_suffix List.dropWhile_suffix
theorem dropLast_prefix : β l : List Ξ±, l.dropLast <+: l
| [] => β¨nil, by rw [dropLast, List.append_nil]β©
| a :: l => β¨_, dropLast_append_getLast (cons_ne_nil a l)β©
#align list.init_prefix List.dropLast_prefix
theorem tail_suffix (l : List Ξ±) : tail l <:+ l := by rw [β drop_one]; apply drop_suffix
#align list.tail_suffix List.tail_suffix
theorem dropLast_sublist (l : List Ξ±) : l.dropLast <+ l :=
(dropLast_prefix l).sublist
#align list.init_sublist List.dropLast_sublist
@[gcongr]
theorem drop_sublist_drop_left (l : List Ξ±) {m n : β} (h : m β€ n) : drop n l <+ drop m l := by
rw [β Nat.sub_add_cancel h, drop_add]
apply drop_sublist
theorem dropLast_subset (l : List Ξ±) : l.dropLast β l :=
(dropLast_sublist l).subset
#align list.init_subset List.dropLast_subset
theorem tail_subset (l : List Ξ±) : tail l β l :=
(tail_sublist l).subset
#align list.tail_subset List.tail_subset
theorem mem_of_mem_dropLast (h : a β l.dropLast) : a β l :=
dropLast_subset l h
#align list.mem_of_mem_init List.mem_of_mem_dropLast
theorem mem_of_mem_tail (h : a β l.tail) : a β l :=
tail_subset l h
#align list.mem_of_mem_tail List.mem_of_mem_tail
@[gcongr]
protected theorem Sublist.drop : β {lβ lβ : List Ξ±}, lβ <+ lβ β β n, lβ.drop n <+ lβ.drop n
| _, _, h, 0 => h
| _, _, h, n + 1 => by rw [β drop_tail, β drop_tail]; exact h.tail.drop n
theorem prefix_iff_eq_append : lβ <+: lβ β lβ ++ drop (length lβ) lβ = lβ :=
β¨by rintro β¨r, rflβ©; rw [drop_left], fun e => β¨_, eβ©β©
#align list.prefix_iff_eq_append List.prefix_iff_eq_append
theorem suffix_iff_eq_append : lβ <:+ lβ β take (length lβ - length lβ) lβ ++ lβ = lβ :=
β¨by rintro β¨r, rflβ©; simp only [length_append, Nat.add_sub_cancel_right, take_left], fun e =>
β¨_, eβ©β©
#align list.suffix_iff_eq_append List.suffix_iff_eq_append
theorem prefix_iff_eq_take : lβ <+: lβ β lβ = take (length lβ) lβ :=
β¨fun h => append_cancel_right <| (prefix_iff_eq_append.1 h).trans (take_append_drop _ _).symm,
fun e => e.symm βΈ take_prefix _ _β©
#align list.prefix_iff_eq_take List.prefix_iff_eq_take
theorem prefix_take_iff {x y : List Ξ±} {n : β} : x <+: y.take n β x <+: y β§ x.length β€ n := by
constructor
Β· intro h
constructor
Β· exact List.IsPrefix.trans h <| List.take_prefix n y
Β· replace h := h.length_le
rw [length_take, Nat.le_min] at h
exact h.left
Β· intro β¨hp, hlβ©
have hl' := hp.length_le
rw [List.prefix_iff_eq_take] at *
rw [hp, List.take_take]
simp [min_eq_left, hl, hl']
theorem concat_get_prefix {x y : List Ξ±} (h : x <+: y) (hl : x.length < y.length) :
x ++ [y.get β¨x.length, hlβ©] <+: y := by
use y.drop (x.length + 1)
nth_rw 1 [List.prefix_iff_eq_take.mp h]
convert List.take_append_drop (x.length + 1) y using 2
rw [β List.take_concat_get, List.concat_eq_append]; rfl
theorem suffix_iff_eq_drop : lβ <:+ lβ β lβ = drop (length lβ - length lβ) lβ :=
β¨fun h => append_cancel_left <| (suffix_iff_eq_append.1 h).trans (take_append_drop _ _).symm,
fun e => e.symm βΈ drop_suffix _ _β©
#align list.suffix_iff_eq_drop List.suffix_iff_eq_drop
instance decidablePrefix [DecidableEq Ξ±] : β lβ lβ : List Ξ±, Decidable (lβ <+: lβ)
| [], lβ => isTrue β¨lβ, rflβ©
| a :: lβ, [] => isFalse fun β¨t, teβ© => List.noConfusion te
| a :: lβ, b :: lβ =>
if h : a = b then
@decidable_of_decidable_of_iff _ _ (decidablePrefix lβ lβ) (by rw [β h, prefix_cons_inj])
else
isFalse fun β¨t, teβ© => h <| by injection te
#align list.decidable_prefix List.decidablePrefix
-- Alternatively, use mem_tails
instance decidableSuffix [DecidableEq Ξ±] : β lβ lβ : List Ξ±, Decidable (lβ <:+ lβ)
| [], lβ => isTrue β¨lβ, append_nil _β©
| a :: lβ, [] => isFalse <| mt (Sublist.length_le β IsSuffix.sublist) (by simp)
| lβ, b :: lβ =>
@decidable_of_decidable_of_iff _ _
(@instDecidableOr _ _ _ (lβ.decidableSuffix lβ))
suffix_cons_iff.symm
#align list.decidable_suffix List.decidableSuffix
instance decidableInfix [DecidableEq Ξ±] : β lβ lβ : List Ξ±, Decidable (lβ <:+: lβ)
| [], lβ => isTrue β¨[], lβ, rflβ©
| a :: lβ, [] => isFalse fun β¨s, t, teβ© => by simp at te
| lβ, b :: lβ =>
@decidable_of_decidable_of_iff _ _
(@instDecidableOr _ _ (lβ.decidablePrefix (b :: lβ)) (lβ.decidableInfix lβ))
infix_cons_iff.symm
#align list.decidable_infix List.decidableInfix
| Mathlib/Data/List/Infix.lean | 280 | 294 | theorem prefix_take_le_iff {L : List (List (Option Ξ±))} (hm : m < L.length) :
L.take m <+: L.take n β m β€ n := by |
simp only [prefix_iff_eq_take, length_take]
induction m generalizing L n with
| zero => simp [min_eq_left, eq_self_iff_true, Nat.zero_le, take]
| succ m IH =>
cases L with
| nil => simp_all
| cons l ls =>
cases n with
| zero =>
simp
| succ n =>
simp only [length_cons, succ_eq_add_one, Nat.add_lt_add_iff_right] at hm
simp [β @IH n ls hm, Nat.min_eq_left, Nat.le_of_lt hm]
|
import Mathlib.Data.PFunctor.Multivariate.W
import Mathlib.Data.QPF.Multivariate.Basic
#align_import data.qpf.multivariate.constructions.fix from "leanprover-community/mathlib"@"28aa996fc6fb4317f0083c4e6daf79878d81be33"
universe u v
namespace MvQPF
open TypeVec
open MvFunctor (LiftP LiftR)
open MvFunctor
variable {n : β} {F : TypeVec.{u} (n + 1) β Type u} [MvFunctor F] [q : MvQPF F]
def recF {Ξ± : TypeVec n} {Ξ² : Type u} (g : F (Ξ±.append1 Ξ²) β Ξ²) : q.P.W Ξ± β Ξ² :=
q.P.wRec fun a f' _f rec => g (abs β¨a, splitFun f' recβ©)
set_option linter.uppercaseLean3 false in
#align mvqpf.recF MvQPF.recF
theorem recF_eq {Ξ± : TypeVec n} {Ξ² : Type u} (g : F (Ξ±.append1 Ξ²) β Ξ²) (a : q.P.A)
(f' : q.P.drop.B a βΉ Ξ±) (f : q.P.last.B a β q.P.W Ξ±) :
recF g (q.P.wMk a f' f) = g (abs β¨a, splitFun f' (recF g β f)β©) := by
rw [recF, MvPFunctor.wRec_eq]; rfl
set_option linter.uppercaseLean3 false in
#align mvqpf.recF_eq MvQPF.recF_eq
theorem recF_eq' {Ξ± : TypeVec n} {Ξ² : Type u} (g : F (Ξ±.append1 Ξ²) β Ξ²) (x : q.P.W Ξ±) :
recF g x = g (abs (appendFun id (recF g) <$$> q.P.wDest' x)) := by
apply q.P.w_cases _ x
intro a f' f
rw [recF_eq, q.P.wDest'_wMk, MvPFunctor.map_eq, appendFun_comp_splitFun, TypeVec.id_comp]
set_option linter.uppercaseLean3 false in
#align mvqpf.recF_eq' MvQPF.recF_eq'
inductive WEquiv {Ξ± : TypeVec n} : q.P.W Ξ± β q.P.W Ξ± β Prop
| ind (a : q.P.A) (f' : q.P.drop.B a βΉ Ξ±) (fβ fβ : q.P.last.B a β q.P.W Ξ±) :
(β x, WEquiv (fβ x) (fβ x)) β WEquiv (q.P.wMk a f' fβ) (q.P.wMk a f' fβ)
| abs (aβ : q.P.A) (f'β : q.P.drop.B aβ βΉ Ξ±) (fβ : q.P.last.B aβ β q.P.W Ξ±) (aβ : q.P.A)
(f'β : q.P.drop.B aβ βΉ Ξ±) (fβ : q.P.last.B aβ β q.P.W Ξ±) :
abs β¨aβ, q.P.appendContents f'β fββ© = abs β¨aβ, q.P.appendContents f'β fββ© β
WEquiv (q.P.wMk aβ f'β fβ) (q.P.wMk aβ f'β fβ)
| trans (u v w : q.P.W Ξ±) : WEquiv u v β WEquiv v w β WEquiv u w
set_option linter.uppercaseLean3 false in
#align mvqpf.Wequiv MvQPF.WEquiv
theorem recF_eq_of_wEquiv (Ξ± : TypeVec n) {Ξ² : Type u} (u : F (Ξ±.append1 Ξ²) β Ξ²) (x y : q.P.W Ξ±) :
WEquiv x y β recF u x = recF u y := by
apply q.P.w_cases _ x
intro aβ f'β fβ
apply q.P.w_cases _ y
intro aβ f'β fβ
intro h
-- Porting note: induction on h doesn't work.
refine @WEquiv.recOn _ _ _ _ _ (fun a a' _ β¦ recF u a = recF u a') _ _ h ?_ ?_ ?_
Β· intros a f' fβ fβ _h ih; simp only [recF_eq, Function.comp]
congr; funext; congr; funext; apply ih
Β· intros aβ f'β fβ aβ f'β fβ h; simp only [recF_eq', abs_map, MvPFunctor.wDest'_wMk, h]
Β· intros x y z _eβ _eβ ihβ ihβ; exact Eq.trans ihβ ihβ
set_option linter.uppercaseLean3 false in
#align mvqpf.recF_eq_of_Wequiv MvQPF.recF_eq_of_wEquiv
theorem wEquiv.abs' {Ξ± : TypeVec n} (x y : q.P.W Ξ±)
(h : MvQPF.abs (q.P.wDest' x) = MvQPF.abs (q.P.wDest' y)) :
WEquiv x y := by
revert h
apply q.P.w_cases _ x
intro aβ f'β fβ
apply q.P.w_cases _ y
intro aβ f'β fβ
apply WEquiv.abs
set_option linter.uppercaseLean3 false in
#align mvqpf.Wequiv.abs' MvQPF.wEquiv.abs'
theorem wEquiv.refl {Ξ± : TypeVec n} (x : q.P.W Ξ±) : WEquiv x x := by
apply q.P.w_cases _ x; intro a f' f; exact WEquiv.abs a f' f a f' f rfl
set_option linter.uppercaseLean3 false in
#align mvqpf.Wequiv.refl MvQPF.wEquiv.refl
theorem wEquiv.symm {Ξ± : TypeVec n} (x y : q.P.W Ξ±) : WEquiv x y β WEquiv y x := by
intro h; induction h with
| ind a f' fβ fβ _h ih => exact WEquiv.ind _ _ _ _ ih
| abs aβ f'β fβ aβ f'β fβ h => exact WEquiv.abs _ _ _ _ _ _ h.symm
| trans x y z _eβ _eβ ihβ ihβ => exact MvQPF.WEquiv.trans _ _ _ ihβ ihβ
set_option linter.uppercaseLean3 false in
#align mvqpf.Wequiv.symm MvQPF.wEquiv.symm
def wrepr {Ξ± : TypeVec n} : q.P.W Ξ± β q.P.W Ξ± :=
recF (q.P.wMk' β repr)
set_option linter.uppercaseLean3 false in
#align mvqpf.Wrepr MvQPF.wrepr
theorem wrepr_wMk {Ξ± : TypeVec n} (a : q.P.A) (f' : q.P.drop.B a βΉ Ξ±)
(f : q.P.last.B a β q.P.W Ξ±) :
wrepr (q.P.wMk a f' f) =
q.P.wMk' (repr (abs (appendFun id wrepr <$$> β¨a, q.P.appendContents f' fβ©))) := by
rw [wrepr, recF_eq', q.P.wDest'_wMk]; rfl
set_option linter.uppercaseLean3 false in
#align mvqpf.Wrepr_W_mk MvQPF.wrepr_wMk
theorem wrepr_equiv {Ξ± : TypeVec n} (x : q.P.W Ξ±) : WEquiv (wrepr x) x := by
apply q.P.w_ind _ x; intro a f' f ih
apply WEquiv.trans _ (q.P.wMk' (appendFun id wrepr <$$> β¨a, q.P.appendContents f' fβ©))
Β· apply wEquiv.abs'
rw [wrepr_wMk, q.P.wDest'_wMk', q.P.wDest'_wMk', abs_repr]
rw [q.P.map_eq, MvPFunctor.wMk', appendFun_comp_splitFun, id_comp]
apply WEquiv.ind; exact ih
set_option linter.uppercaseLean3 false in
#align mvqpf.Wrepr_equiv MvQPF.wrepr_equiv
| Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean | 157 | 170 | theorem wEquiv_map {Ξ± Ξ² : TypeVec n} (g : Ξ± βΉ Ξ²) (x y : q.P.W Ξ±) :
WEquiv x y β WEquiv (g <$$> x) (g <$$> y) := by |
intro h; induction h with
| ind a f' fβ fβ h ih => rw [q.P.w_map_wMk, q.P.w_map_wMk]; apply WEquiv.ind; exact ih
| abs aβ f'β fβ aβ f'β fβ h =>
rw [q.P.w_map_wMk, q.P.w_map_wMk]; apply WEquiv.abs
show
abs (q.P.objAppend1 aβ (g β f'β) fun x => q.P.wMap g (fβ x)) =
abs (q.P.objAppend1 aβ (g β f'β) fun x => q.P.wMap g (fβ x))
rw [β q.P.map_objAppend1, β q.P.map_objAppend1, abs_map, abs_map, h]
| trans x y z _ _ ihβ ihβ =>
apply MvQPF.WEquiv.trans
Β· apply ihβ
Β· apply ihβ
|
import Mathlib.Data.List.Nodup
import Mathlib.Data.List.Zip
import Mathlib.Data.Nat.Defs
import Mathlib.Data.List.Infix
#align_import data.list.rotate from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u
variable {Ξ± : Type u}
open Nat Function
namespace List
| Mathlib/Data/List/Rotate.lean | 37 | 37 | theorem rotate_mod (l : List Ξ±) (n : β) : l.rotate (n % l.length) = l.rotate n := by | simp [rotate]
|
import Mathlib.Order.RelClasses
import Mathlib.Order.Interval.Set.Basic
#align_import order.bounded from "leanprover-community/mathlib"@"aba57d4d3dae35460225919dcd82fe91355162f9"
namespace Set
variable {Ξ± : Type*} {r : Ξ± β Ξ± β Prop} {s t : Set Ξ±}
theorem Bounded.mono (hst : s β t) (hs : Bounded r t) : Bounded r s :=
hs.imp fun _ ha b hb => ha b (hst hb)
#align set.bounded.mono Set.Bounded.mono
theorem Unbounded.mono (hst : s β t) (hs : Unbounded r s) : Unbounded r t := fun a =>
let β¨b, hb, hb'β© := hs a
β¨b, hst hb, hb'β©
#align set.unbounded.mono Set.Unbounded.mono
theorem unbounded_le_of_forall_exists_lt [Preorder Ξ±] (h : β a, β b β s, a < b) :
Unbounded (Β· β€ Β·) s := fun a =>
let β¨b, hb, hb'β© := h a
β¨b, hb, fun hba => hba.not_lt hb'β©
#align set.unbounded_le_of_forall_exists_lt Set.unbounded_le_of_forall_exists_lt
theorem unbounded_le_iff [LinearOrder Ξ±] : Unbounded (Β· β€ Β·) s β β a, β b β s, a < b := by
simp only [Unbounded, not_le]
#align set.unbounded_le_iff Set.unbounded_le_iff
theorem unbounded_lt_of_forall_exists_le [Preorder Ξ±] (h : β a, β b β s, a β€ b) :
Unbounded (Β· < Β·) s := fun a =>
let β¨b, hb, hb'β© := h a
β¨b, hb, fun hba => hba.not_le hb'β©
#align set.unbounded_lt_of_forall_exists_le Set.unbounded_lt_of_forall_exists_le
theorem unbounded_lt_iff [LinearOrder Ξ±] : Unbounded (Β· < Β·) s β β a, β b β s, a β€ b := by
simp only [Unbounded, not_lt]
#align set.unbounded_lt_iff Set.unbounded_lt_iff
theorem unbounded_ge_of_forall_exists_gt [Preorder Ξ±] (h : β a, β b β s, b < a) :
Unbounded (Β· β₯ Β·) s :=
@unbounded_le_of_forall_exists_lt Ξ±α΅α΅ _ _ h
#align set.unbounded_ge_of_forall_exists_gt Set.unbounded_ge_of_forall_exists_gt
theorem unbounded_ge_iff [LinearOrder Ξ±] : Unbounded (Β· β₯ Β·) s β β a, β b β s, b < a :=
β¨fun h a =>
let β¨b, hb, hbaβ© := h a
β¨b, hb, lt_of_not_ge hbaβ©,
unbounded_ge_of_forall_exists_gtβ©
#align set.unbounded_ge_iff Set.unbounded_ge_iff
theorem unbounded_gt_of_forall_exists_ge [Preorder Ξ±] (h : β a, β b β s, b β€ a) :
Unbounded (Β· > Β·) s := fun a =>
let β¨b, hb, hb'β© := h a
β¨b, hb, fun hba => not_le_of_gt hba hb'β©
#align set.unbounded_gt_of_forall_exists_ge Set.unbounded_gt_of_forall_exists_ge
theorem unbounded_gt_iff [LinearOrder Ξ±] : Unbounded (Β· > Β·) s β β a, β b β s, b β€ a :=
β¨fun h a =>
let β¨b, hb, hbaβ© := h a
β¨b, hb, le_of_not_gt hbaβ©,
unbounded_gt_of_forall_exists_geβ©
#align set.unbounded_gt_iff Set.unbounded_gt_iff
theorem Bounded.rel_mono {r' : Ξ± β Ξ± β Prop} (h : Bounded r s) (hrr' : r β€ r') : Bounded r' s :=
let β¨a, haβ© := h
β¨a, fun b hb => hrr' b a (ha b hb)β©
#align set.bounded.rel_mono Set.Bounded.rel_mono
theorem bounded_le_of_bounded_lt [Preorder Ξ±] (h : Bounded (Β· < Β·) s) : Bounded (Β· β€ Β·) s :=
h.rel_mono fun _ _ => le_of_lt
#align set.bounded_le_of_bounded_lt Set.bounded_le_of_bounded_lt
theorem Unbounded.rel_mono {r' : Ξ± β Ξ± β Prop} (hr : r' β€ r) (h : Unbounded r s) : Unbounded r' s :=
fun a =>
let β¨b, hb, hbaβ© := h a
β¨b, hb, fun hba' => hba (hr b a hba')β©
#align set.unbounded.rel_mono Set.Unbounded.rel_mono
theorem unbounded_lt_of_unbounded_le [Preorder Ξ±] (h : Unbounded (Β· β€ Β·) s) : Unbounded (Β· < Β·) s :=
h.rel_mono fun _ _ => le_of_lt
#align set.unbounded_lt_of_unbounded_le Set.unbounded_lt_of_unbounded_le
theorem bounded_le_iff_bounded_lt [Preorder Ξ±] [NoMaxOrder Ξ±] :
Bounded (Β· β€ Β·) s β Bounded (Β· < Β·) s := by
refine β¨fun h => ?_, bounded_le_of_bounded_ltβ©
cases' h with a ha
cases' exists_gt a with b hb
exact β¨b, fun c hc => lt_of_le_of_lt (ha c hc) hbβ©
#align set.bounded_le_iff_bounded_lt Set.bounded_le_iff_bounded_lt
theorem unbounded_lt_iff_unbounded_le [Preorder Ξ±] [NoMaxOrder Ξ±] :
Unbounded (Β· < Β·) s β Unbounded (Β· β€ Β·) s := by
simp_rw [β not_bounded_iff, bounded_le_iff_bounded_lt]
#align set.unbounded_lt_iff_unbounded_le Set.unbounded_lt_iff_unbounded_le
theorem bounded_ge_of_bounded_gt [Preorder Ξ±] (h : Bounded (Β· > Β·) s) : Bounded (Β· β₯ Β·) s :=
let β¨a, haβ© := h
β¨a, fun b hb => le_of_lt (ha b hb)β©
#align set.bounded_ge_of_bounded_gt Set.bounded_ge_of_bounded_gt
theorem unbounded_gt_of_unbounded_ge [Preorder Ξ±] (h : Unbounded (Β· β₯ Β·) s) : Unbounded (Β· > Β·) s :=
fun a =>
let β¨b, hb, hbaβ© := h a
β¨b, hb, fun hba' => hba (le_of_lt hba')β©
#align set.unbounded_gt_of_unbounded_ge Set.unbounded_gt_of_unbounded_ge
theorem bounded_ge_iff_bounded_gt [Preorder Ξ±] [NoMinOrder Ξ±] :
Bounded (Β· β₯ Β·) s β Bounded (Β· > Β·) s :=
@bounded_le_iff_bounded_lt Ξ±α΅α΅ _ _ _
#align set.bounded_ge_iff_bounded_gt Set.bounded_ge_iff_bounded_gt
theorem unbounded_gt_iff_unbounded_ge [Preorder Ξ±] [NoMinOrder Ξ±] :
Unbounded (Β· > Β·) s β Unbounded (Β· β₯ Β·) s :=
@unbounded_lt_iff_unbounded_le Ξ±α΅α΅ _ _ _
#align set.unbounded_gt_iff_unbounded_ge Set.unbounded_gt_iff_unbounded_ge
theorem unbounded_le_univ [LE Ξ±] [NoTopOrder Ξ±] : Unbounded (Β· β€ Β·) (@Set.univ Ξ±) := fun a =>
let β¨b, hbβ© := exists_not_le a
β¨b, β¨β©, hbβ©
#align set.unbounded_le_univ Set.unbounded_le_univ
theorem unbounded_lt_univ [Preorder Ξ±] [NoTopOrder Ξ±] : Unbounded (Β· < Β·) (@Set.univ Ξ±) :=
unbounded_lt_of_unbounded_le unbounded_le_univ
#align set.unbounded_lt_univ Set.unbounded_lt_univ
theorem unbounded_ge_univ [LE Ξ±] [NoBotOrder Ξ±] : Unbounded (Β· β₯ Β·) (@Set.univ Ξ±) := fun a =>
let β¨b, hbβ© := exists_not_ge a
β¨b, β¨β©, hbβ©
#align set.unbounded_ge_univ Set.unbounded_ge_univ
theorem unbounded_gt_univ [Preorder Ξ±] [NoBotOrder Ξ±] : Unbounded (Β· > Β·) (@Set.univ Ξ±) :=
unbounded_gt_of_unbounded_ge unbounded_ge_univ
#align set.unbounded_gt_univ Set.unbounded_gt_univ
theorem bounded_self (a : Ξ±) : Bounded r { b | r b a } :=
β¨a, fun _ => idβ©
#align set.bounded_self Set.bounded_self
theorem bounded_lt_Iio [Preorder Ξ±] (a : Ξ±) : Bounded (Β· < Β·) (Iio a) :=
bounded_self a
#align set.bounded_lt_Iio Set.bounded_lt_Iio
theorem bounded_le_Iio [Preorder Ξ±] (a : Ξ±) : Bounded (Β· β€ Β·) (Iio a) :=
bounded_le_of_bounded_lt (bounded_lt_Iio a)
#align set.bounded_le_Iio Set.bounded_le_Iio
theorem bounded_le_Iic [Preorder Ξ±] (a : Ξ±) : Bounded (Β· β€ Β·) (Iic a) :=
bounded_self a
#align set.bounded_le_Iic Set.bounded_le_Iic
theorem bounded_lt_Iic [Preorder Ξ±] [NoMaxOrder Ξ±] (a : Ξ±) : Bounded (Β· < Β·) (Iic a) := by
simp only [β bounded_le_iff_bounded_lt, bounded_le_Iic]
#align set.bounded_lt_Iic Set.bounded_lt_Iic
theorem bounded_gt_Ioi [Preorder Ξ±] (a : Ξ±) : Bounded (Β· > Β·) (Ioi a) :=
bounded_self a
#align set.bounded_gt_Ioi Set.bounded_gt_Ioi
theorem bounded_ge_Ioi [Preorder Ξ±] (a : Ξ±) : Bounded (Β· β₯ Β·) (Ioi a) :=
bounded_ge_of_bounded_gt (bounded_gt_Ioi a)
#align set.bounded_ge_Ioi Set.bounded_ge_Ioi
theorem bounded_ge_Ici [Preorder Ξ±] (a : Ξ±) : Bounded (Β· β₯ Β·) (Ici a) :=
bounded_self a
#align set.bounded_ge_Ici Set.bounded_ge_Ici
theorem bounded_gt_Ici [Preorder Ξ±] [NoMinOrder Ξ±] (a : Ξ±) : Bounded (Β· > Β·) (Ici a) := by
simp only [β bounded_ge_iff_bounded_gt, bounded_ge_Ici]
#align set.bounded_gt_Ici Set.bounded_gt_Ici
theorem bounded_lt_Ioo [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· < Β·) (Ioo a b) :=
(bounded_lt_Iio b).mono Set.Ioo_subset_Iio_self
#align set.bounded_lt_Ioo Set.bounded_lt_Ioo
theorem bounded_lt_Ico [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· < Β·) (Ico a b) :=
(bounded_lt_Iio b).mono Set.Ico_subset_Iio_self
#align set.bounded_lt_Ico Set.bounded_lt_Ico
theorem bounded_lt_Ioc [Preorder Ξ±] [NoMaxOrder Ξ±] (a b : Ξ±) : Bounded (Β· < Β·) (Ioc a b) :=
(bounded_lt_Iic b).mono Set.Ioc_subset_Iic_self
#align set.bounded_lt_Ioc Set.bounded_lt_Ioc
theorem bounded_lt_Icc [Preorder Ξ±] [NoMaxOrder Ξ±] (a b : Ξ±) : Bounded (Β· < Β·) (Icc a b) :=
(bounded_lt_Iic b).mono Set.Icc_subset_Iic_self
#align set.bounded_lt_Icc Set.bounded_lt_Icc
theorem bounded_le_Ioo [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· β€ Β·) (Ioo a b) :=
(bounded_le_Iio b).mono Set.Ioo_subset_Iio_self
#align set.bounded_le_Ioo Set.bounded_le_Ioo
theorem bounded_le_Ico [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· β€ Β·) (Ico a b) :=
(bounded_le_Iio b).mono Set.Ico_subset_Iio_self
#align set.bounded_le_Ico Set.bounded_le_Ico
theorem bounded_le_Ioc [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· β€ Β·) (Ioc a b) :=
(bounded_le_Iic b).mono Set.Ioc_subset_Iic_self
#align set.bounded_le_Ioc Set.bounded_le_Ioc
theorem bounded_le_Icc [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· β€ Β·) (Icc a b) :=
(bounded_le_Iic b).mono Set.Icc_subset_Iic_self
#align set.bounded_le_Icc Set.bounded_le_Icc
theorem bounded_gt_Ioo [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· > Β·) (Ioo a b) :=
(bounded_gt_Ioi a).mono Set.Ioo_subset_Ioi_self
#align set.bounded_gt_Ioo Set.bounded_gt_Ioo
theorem bounded_gt_Ioc [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· > Β·) (Ioc a b) :=
(bounded_gt_Ioi a).mono Set.Ioc_subset_Ioi_self
#align set.bounded_gt_Ioc Set.bounded_gt_Ioc
theorem bounded_gt_Ico [Preorder Ξ±] [NoMinOrder Ξ±] (a b : Ξ±) : Bounded (Β· > Β·) (Ico a b) :=
(bounded_gt_Ici a).mono Set.Ico_subset_Ici_self
#align set.bounded_gt_Ico Set.bounded_gt_Ico
theorem bounded_gt_Icc [Preorder Ξ±] [NoMinOrder Ξ±] (a b : Ξ±) : Bounded (Β· > Β·) (Icc a b) :=
(bounded_gt_Ici a).mono Set.Icc_subset_Ici_self
#align set.bounded_gt_Icc Set.bounded_gt_Icc
theorem bounded_ge_Ioo [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· β₯ Β·) (Ioo a b) :=
(bounded_ge_Ioi a).mono Set.Ioo_subset_Ioi_self
#align set.bounded_ge_Ioo Set.bounded_ge_Ioo
theorem bounded_ge_Ioc [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· β₯ Β·) (Ioc a b) :=
(bounded_ge_Ioi a).mono Set.Ioc_subset_Ioi_self
#align set.bounded_ge_Ioc Set.bounded_ge_Ioc
theorem bounded_ge_Ico [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· β₯ Β·) (Ico a b) :=
(bounded_ge_Ici a).mono Set.Ico_subset_Ici_self
#align set.bounded_ge_Ico Set.bounded_ge_Ico
theorem bounded_ge_Icc [Preorder Ξ±] (a b : Ξ±) : Bounded (Β· β₯ Β·) (Icc a b) :=
(bounded_ge_Ici a).mono Set.Icc_subset_Ici_self
#align set.bounded_ge_Icc Set.bounded_ge_Icc
theorem unbounded_le_Ioi [SemilatticeSup Ξ±] [NoMaxOrder Ξ±] (a : Ξ±) :
Unbounded (Β· β€ Β·) (Ioi a) := fun b =>
let β¨c, hcβ© := exists_gt (a β b)
β¨c, le_sup_left.trans_lt hc, (le_sup_right.trans_lt hc).not_leβ©
#align set.unbounded_le_Ioi Set.unbounded_le_Ioi
theorem unbounded_le_Ici [SemilatticeSup Ξ±] [NoMaxOrder Ξ±] (a : Ξ±) :
Unbounded (Β· β€ Β·) (Ici a) :=
(unbounded_le_Ioi a).mono Set.Ioi_subset_Ici_self
#align set.unbounded_le_Ici Set.unbounded_le_Ici
theorem unbounded_lt_Ioi [SemilatticeSup Ξ±] [NoMaxOrder Ξ±] (a : Ξ±) :
Unbounded (Β· < Β·) (Ioi a) :=
unbounded_lt_of_unbounded_le (unbounded_le_Ioi a)
#align set.unbounded_lt_Ioi Set.unbounded_lt_Ioi
theorem unbounded_lt_Ici [SemilatticeSup Ξ±] (a : Ξ±) : Unbounded (Β· < Β·) (Ici a) := fun b =>
β¨a β b, le_sup_left, le_sup_right.not_ltβ©
#align set.unbounded_lt_Ici Set.unbounded_lt_Ici
theorem bounded_inter_not (H : β a b, β m, β c, r c a β¨ r c b β r c m) (a : Ξ±) :
Bounded r (s β© { b | Β¬r b a }) β Bounded r s := by
refine β¨?_, Bounded.mono inter_subset_leftβ©
rintro β¨b, hbβ©
cases' H a b with m hm
exact β¨m, fun c hc => hm c (or_iff_not_imp_left.2 fun hca => hb c β¨hc, hcaβ©)β©
#align set.bounded_inter_not Set.bounded_inter_not
theorem unbounded_inter_not (H : β a b, β m, β c, r c a β¨ r c b β r c m) (a : Ξ±) :
Unbounded r (s β© { b | Β¬r b a }) β Unbounded r s := by
simp_rw [β not_bounded_iff, bounded_inter_not H]
#align set.unbounded_inter_not Set.unbounded_inter_not
theorem bounded_le_inter_not_le [SemilatticeSup Ξ±] (a : Ξ±) :
Bounded (Β· β€ Β·) (s β© { b | Β¬b β€ a }) β Bounded (Β· β€ Β·) s :=
bounded_inter_not (fun x y => β¨x β y, fun _ h => h.elim le_sup_of_le_left le_sup_of_le_rightβ©) a
#align set.bounded_le_inter_not_le Set.bounded_le_inter_not_le
theorem unbounded_le_inter_not_le [SemilatticeSup Ξ±] (a : Ξ±) :
Unbounded (Β· β€ Β·) (s β© { b | Β¬b β€ a }) β Unbounded (Β· β€ Β·) s := by
rw [β not_bounded_iff, β not_bounded_iff, not_iff_not]
exact bounded_le_inter_not_le a
#align set.unbounded_le_inter_not_le Set.unbounded_le_inter_not_le
theorem bounded_le_inter_lt [LinearOrder Ξ±] (a : Ξ±) :
Bounded (Β· β€ Β·) (s β© { b | a < b }) β Bounded (Β· β€ Β·) s := by
simp_rw [β not_le, bounded_le_inter_not_le]
#align set.bounded_le_inter_lt Set.bounded_le_inter_lt
| Mathlib/Order/Bounded.lean | 333 | 336 | theorem unbounded_le_inter_lt [LinearOrder Ξ±] (a : Ξ±) :
Unbounded (Β· β€ Β·) (s β© { b | a < b }) β Unbounded (Β· β€ Β·) s := by |
convert @unbounded_le_inter_not_le _ s _ a
exact lt_iff_not_le
|
import Mathlib.Topology.Separation
import Mathlib.Topology.UniformSpace.Basic
import Mathlib.Topology.UniformSpace.Cauchy
#align_import topology.uniform_space.uniform_convergence from "leanprover-community/mathlib"@"2705404e701abc6b3127da906f40bae062a169c9"
noncomputable section
open Topology Uniformity Filter Set
universe u v w x
variable {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} {ΞΉ : Type x} [UniformSpace Ξ²]
variable {F : ΞΉ β Ξ± β Ξ²} {f : Ξ± β Ξ²} {s s' : Set Ξ±} {x : Ξ±} {p : Filter ΞΉ} {p' : Filter Ξ±}
{g : ΞΉ β Ξ±}
def TendstoUniformlyOnFilter (F : ΞΉ β Ξ± β Ξ²) (f : Ξ± β Ξ²) (p : Filter ΞΉ) (p' : Filter Ξ±) :=
β u β π€ Ξ², βαΆ n : ΞΉ Γ Ξ± in p ΓΛ’ p', (f n.snd, F n.fst n.snd) β u
#align tendsto_uniformly_on_filter TendstoUniformlyOnFilter
theorem tendstoUniformlyOnFilter_iff_tendsto :
TendstoUniformlyOnFilter F f p p' β
Tendsto (fun q : ΞΉ Γ Ξ± => (f q.2, F q.1 q.2)) (p ΓΛ’ p') (π€ Ξ²) :=
Iff.rfl
#align tendsto_uniformly_on_filter_iff_tendsto tendstoUniformlyOnFilter_iff_tendsto
def TendstoUniformlyOn (F : ΞΉ β Ξ± β Ξ²) (f : Ξ± β Ξ²) (p : Filter ΞΉ) (s : Set Ξ±) :=
β u β π€ Ξ², βαΆ n in p, β x : Ξ±, x β s β (f x, F n x) β u
#align tendsto_uniformly_on TendstoUniformlyOn
theorem tendstoUniformlyOn_iff_tendstoUniformlyOnFilter :
TendstoUniformlyOn F f p s β TendstoUniformlyOnFilter F f p (π s) := by
simp only [TendstoUniformlyOn, TendstoUniformlyOnFilter]
apply forallβ_congr
simp_rw [eventually_prod_principal_iff]
simp
#align tendsto_uniformly_on_iff_tendsto_uniformly_on_filter tendstoUniformlyOn_iff_tendstoUniformlyOnFilter
alias β¨TendstoUniformlyOn.tendstoUniformlyOnFilter, TendstoUniformlyOnFilter.tendstoUniformlyOnβ© :=
tendstoUniformlyOn_iff_tendstoUniformlyOnFilter
#align tendsto_uniformly_on.tendsto_uniformly_on_filter TendstoUniformlyOn.tendstoUniformlyOnFilter
#align tendsto_uniformly_on_filter.tendsto_uniformly_on TendstoUniformlyOnFilter.tendstoUniformlyOn
theorem tendstoUniformlyOn_iff_tendsto {F : ΞΉ β Ξ± β Ξ²} {f : Ξ± β Ξ²} {p : Filter ΞΉ} {s : Set Ξ±} :
TendstoUniformlyOn F f p s β
Tendsto (fun q : ΞΉ Γ Ξ± => (f q.2, F q.1 q.2)) (p ΓΛ’ π s) (π€ Ξ²) := by
simp [tendstoUniformlyOn_iff_tendstoUniformlyOnFilter, tendstoUniformlyOnFilter_iff_tendsto]
#align tendsto_uniformly_on_iff_tendsto tendstoUniformlyOn_iff_tendsto
def TendstoUniformly (F : ΞΉ β Ξ± β Ξ²) (f : Ξ± β Ξ²) (p : Filter ΞΉ) :=
β u β π€ Ξ², βαΆ n in p, β x : Ξ±, (f x, F n x) β u
#align tendsto_uniformly TendstoUniformly
-- Porting note: moved from below
theorem tendstoUniformlyOn_univ : TendstoUniformlyOn F f p univ β TendstoUniformly F f p := by
simp [TendstoUniformlyOn, TendstoUniformly]
#align tendsto_uniformly_on_univ tendstoUniformlyOn_univ
theorem tendstoUniformly_iff_tendstoUniformlyOnFilter :
TendstoUniformly F f p β TendstoUniformlyOnFilter F f p β€ := by
rw [β tendstoUniformlyOn_univ, tendstoUniformlyOn_iff_tendstoUniformlyOnFilter, principal_univ]
#align tendsto_uniformly_iff_tendsto_uniformly_on_filter tendstoUniformly_iff_tendstoUniformlyOnFilter
theorem TendstoUniformly.tendstoUniformlyOnFilter (h : TendstoUniformly F f p) :
TendstoUniformlyOnFilter F f p β€ := by rwa [β tendstoUniformly_iff_tendstoUniformlyOnFilter]
#align tendsto_uniformly.tendsto_uniformly_on_filter TendstoUniformly.tendstoUniformlyOnFilter
theorem tendstoUniformlyOn_iff_tendstoUniformly_comp_coe :
TendstoUniformlyOn F f p s β TendstoUniformly (fun i (x : s) => F i x) (f β (β)) p :=
forallβ_congr fun u _ => by simp
#align tendsto_uniformly_on_iff_tendsto_uniformly_comp_coe tendstoUniformlyOn_iff_tendstoUniformly_comp_coe
theorem tendstoUniformly_iff_tendsto {F : ΞΉ β Ξ± β Ξ²} {f : Ξ± β Ξ²} {p : Filter ΞΉ} :
TendstoUniformly F f p β Tendsto (fun q : ΞΉ Γ Ξ± => (f q.2, F q.1 q.2)) (p ΓΛ’ β€) (π€ Ξ²) := by
simp [tendstoUniformly_iff_tendstoUniformlyOnFilter, tendstoUniformlyOnFilter_iff_tendsto]
#align tendsto_uniformly_iff_tendsto tendstoUniformly_iff_tendsto
theorem TendstoUniformlyOnFilter.tendsto_at (h : TendstoUniformlyOnFilter F f p p')
(hx : π {x} β€ p') : Tendsto (fun n => F n x) p <| π (f x) := by
refine Uniform.tendsto_nhds_right.mpr fun u hu => mem_map.mpr ?_
filter_upwards [(h u hu).curry]
intro i h
simpa using h.filter_mono hx
#align tendsto_uniformly_on_filter.tendsto_at TendstoUniformlyOnFilter.tendsto_at
theorem TendstoUniformlyOn.tendsto_at (h : TendstoUniformlyOn F f p s) {x : Ξ±} (hx : x β s) :
Tendsto (fun n => F n x) p <| π (f x) :=
h.tendstoUniformlyOnFilter.tendsto_at
(le_principal_iff.mpr <| mem_principal.mpr <| singleton_subset_iff.mpr <| hx)
#align tendsto_uniformly_on.tendsto_at TendstoUniformlyOn.tendsto_at
theorem TendstoUniformly.tendsto_at (h : TendstoUniformly F f p) (x : Ξ±) :
Tendsto (fun n => F n x) p <| π (f x) :=
h.tendstoUniformlyOnFilter.tendsto_at le_top
#align tendsto_uniformly.tendsto_at TendstoUniformly.tendsto_at
-- Porting note: tendstoUniformlyOn_univ moved up
theorem TendstoUniformlyOnFilter.mono_left {p'' : Filter ΞΉ} (h : TendstoUniformlyOnFilter F f p p')
(hp : p'' β€ p) : TendstoUniformlyOnFilter F f p'' p' := fun u hu =>
(h u hu).filter_mono (p'.prod_mono_left hp)
#align tendsto_uniformly_on_filter.mono_left TendstoUniformlyOnFilter.mono_left
theorem TendstoUniformlyOnFilter.mono_right {p'' : Filter Ξ±} (h : TendstoUniformlyOnFilter F f p p')
(hp : p'' β€ p') : TendstoUniformlyOnFilter F f p p'' := fun u hu =>
(h u hu).filter_mono (p.prod_mono_right hp)
#align tendsto_uniformly_on_filter.mono_right TendstoUniformlyOnFilter.mono_right
theorem TendstoUniformlyOn.mono {s' : Set Ξ±} (h : TendstoUniformlyOn F f p s) (h' : s' β s) :
TendstoUniformlyOn F f p s' :=
tendstoUniformlyOn_iff_tendstoUniformlyOnFilter.mpr
(h.tendstoUniformlyOnFilter.mono_right (le_principal_iff.mpr <| mem_principal.mpr h'))
#align tendsto_uniformly_on.mono TendstoUniformlyOn.mono
theorem TendstoUniformlyOnFilter.congr {F' : ΞΉ β Ξ± β Ξ²} (hf : TendstoUniformlyOnFilter F f p p')
(hff' : βαΆ n : ΞΉ Γ Ξ± in p ΓΛ’ p', F n.fst n.snd = F' n.fst n.snd) :
TendstoUniformlyOnFilter F' f p p' := by
refine fun u hu => ((hf u hu).and hff').mono fun n h => ?_
rw [β h.right]
exact h.left
#align tendsto_uniformly_on_filter.congr TendstoUniformlyOnFilter.congr
theorem TendstoUniformlyOn.congr {F' : ΞΉ β Ξ± β Ξ²} (hf : TendstoUniformlyOn F f p s)
(hff' : βαΆ n in p, Set.EqOn (F n) (F' n) s) : TendstoUniformlyOn F' f p s := by
rw [tendstoUniformlyOn_iff_tendstoUniformlyOnFilter] at hf β’
refine hf.congr ?_
rw [eventually_iff] at hff' β’
simp only [Set.EqOn] at hff'
simp only [mem_prod_principal, hff', mem_setOf_eq]
#align tendsto_uniformly_on.congr TendstoUniformlyOn.congr
theorem TendstoUniformlyOn.congr_right {g : Ξ± β Ξ²} (hf : TendstoUniformlyOn F f p s)
(hfg : EqOn f g s) : TendstoUniformlyOn F g p s := fun u hu => by
filter_upwards [hf u hu] with i hi a ha using hfg ha βΈ hi a ha
#align tendsto_uniformly_on.congr_right TendstoUniformlyOn.congr_right
protected theorem TendstoUniformly.tendstoUniformlyOn (h : TendstoUniformly F f p) :
TendstoUniformlyOn F f p s :=
(tendstoUniformlyOn_univ.2 h).mono (subset_univ s)
#align tendsto_uniformly.tendsto_uniformly_on TendstoUniformly.tendstoUniformlyOn
theorem TendstoUniformlyOnFilter.comp (h : TendstoUniformlyOnFilter F f p p') (g : Ξ³ β Ξ±) :
TendstoUniformlyOnFilter (fun n => F n β g) (f β g) p (p'.comap g) := by
rw [tendstoUniformlyOnFilter_iff_tendsto] at h β’
exact h.comp (tendsto_id.prod_map tendsto_comap)
#align tendsto_uniformly_on_filter.comp TendstoUniformlyOnFilter.comp
theorem TendstoUniformlyOn.comp (h : TendstoUniformlyOn F f p s) (g : Ξ³ β Ξ±) :
TendstoUniformlyOn (fun n => F n β g) (f β g) p (g β»ΒΉ' s) := by
rw [tendstoUniformlyOn_iff_tendstoUniformlyOnFilter] at h β’
simpa [TendstoUniformlyOn, comap_principal] using TendstoUniformlyOnFilter.comp h g
#align tendsto_uniformly_on.comp TendstoUniformlyOn.comp
theorem TendstoUniformly.comp (h : TendstoUniformly F f p) (g : Ξ³ β Ξ±) :
TendstoUniformly (fun n => F n β g) (f β g) p := by
rw [tendstoUniformly_iff_tendstoUniformlyOnFilter] at h β’
simpa [principal_univ, comap_principal] using h.comp g
#align tendsto_uniformly.comp TendstoUniformly.comp
theorem UniformContinuous.comp_tendstoUniformlyOnFilter [UniformSpace Ξ³] {g : Ξ² β Ξ³}
(hg : UniformContinuous g) (h : TendstoUniformlyOnFilter F f p p') :
TendstoUniformlyOnFilter (fun i => g β F i) (g β f) p p' := fun _u hu => h _ (hg hu)
#align uniform_continuous.comp_tendsto_uniformly_on_filter UniformContinuous.comp_tendstoUniformlyOnFilter
theorem UniformContinuous.comp_tendstoUniformlyOn [UniformSpace Ξ³] {g : Ξ² β Ξ³}
(hg : UniformContinuous g) (h : TendstoUniformlyOn F f p s) :
TendstoUniformlyOn (fun i => g β F i) (g β f) p s := fun _u hu => h _ (hg hu)
#align uniform_continuous.comp_tendsto_uniformly_on UniformContinuous.comp_tendstoUniformlyOn
theorem UniformContinuous.comp_tendstoUniformly [UniformSpace Ξ³] {g : Ξ² β Ξ³}
(hg : UniformContinuous g) (h : TendstoUniformly F f p) :
TendstoUniformly (fun i => g β F i) (g β f) p := fun _u hu => h _ (hg hu)
#align uniform_continuous.comp_tendsto_uniformly UniformContinuous.comp_tendstoUniformly
theorem TendstoUniformlyOnFilter.prod_map {ΞΉ' Ξ±' Ξ²' : Type*} [UniformSpace Ξ²'] {F' : ΞΉ' β Ξ±' β Ξ²'}
{f' : Ξ±' β Ξ²'} {q : Filter ΞΉ'} {q' : Filter Ξ±'} (h : TendstoUniformlyOnFilter F f p p')
(h' : TendstoUniformlyOnFilter F' f' q q') :
TendstoUniformlyOnFilter (fun i : ΞΉ Γ ΞΉ' => Prod.map (F i.1) (F' i.2)) (Prod.map f f')
(p ΓΛ’ q) (p' ΓΛ’ q') := by
rw [tendstoUniformlyOnFilter_iff_tendsto] at h h' β’
rw [uniformity_prod_eq_comap_prod, tendsto_comap_iff, β map_swap4_prod, tendsto_map'_iff]
convert h.prod_map h' -- seems to be faster than `exact` here
#align tendsto_uniformly_on_filter.prod_map TendstoUniformlyOnFilter.prod_map
theorem TendstoUniformlyOn.prod_map {ΞΉ' Ξ±' Ξ²' : Type*} [UniformSpace Ξ²'] {F' : ΞΉ' β Ξ±' β Ξ²'}
{f' : Ξ±' β Ξ²'} {p' : Filter ΞΉ'} {s' : Set Ξ±'} (h : TendstoUniformlyOn F f p s)
(h' : TendstoUniformlyOn F' f' p' s') :
TendstoUniformlyOn (fun i : ΞΉ Γ ΞΉ' => Prod.map (F i.1) (F' i.2)) (Prod.map f f') (p ΓΛ’ p')
(s ΓΛ’ s') := by
rw [tendstoUniformlyOn_iff_tendstoUniformlyOnFilter] at h h' β’
simpa only [prod_principal_principal] using h.prod_map h'
#align tendsto_uniformly_on.prod_map TendstoUniformlyOn.prod_map
theorem TendstoUniformly.prod_map {ΞΉ' Ξ±' Ξ²' : Type*} [UniformSpace Ξ²'] {F' : ΞΉ' β Ξ±' β Ξ²'}
{f' : Ξ±' β Ξ²'} {p' : Filter ΞΉ'} (h : TendstoUniformly F f p) (h' : TendstoUniformly F' f' p') :
TendstoUniformly (fun i : ΞΉ Γ ΞΉ' => Prod.map (F i.1) (F' i.2)) (Prod.map f f') (p ΓΛ’ p') := by
rw [β tendstoUniformlyOn_univ, β univ_prod_univ] at *
exact h.prod_map h'
#align tendsto_uniformly.prod_map TendstoUniformly.prod_map
theorem TendstoUniformlyOnFilter.prod {ΞΉ' Ξ²' : Type*} [UniformSpace Ξ²'] {F' : ΞΉ' β Ξ± β Ξ²'}
{f' : Ξ± β Ξ²'} {q : Filter ΞΉ'} (h : TendstoUniformlyOnFilter F f p p')
(h' : TendstoUniformlyOnFilter F' f' q p') :
TendstoUniformlyOnFilter (fun (i : ΞΉ Γ ΞΉ') a => (F i.1 a, F' i.2 a)) (fun a => (f a, f' a))
(p ΓΛ’ q) p' :=
fun u hu => ((h.prod_map h') u hu).diag_of_prod_right
#align tendsto_uniformly_on_filter.prod TendstoUniformlyOnFilter.prod
theorem TendstoUniformlyOn.prod {ΞΉ' Ξ²' : Type*} [UniformSpace Ξ²'] {F' : ΞΉ' β Ξ± β Ξ²'} {f' : Ξ± β Ξ²'}
{p' : Filter ΞΉ'} (h : TendstoUniformlyOn F f p s) (h' : TendstoUniformlyOn F' f' p' s) :
TendstoUniformlyOn (fun (i : ΞΉ Γ ΞΉ') a => (F i.1 a, F' i.2 a)) (fun a => (f a, f' a))
(p.prod p') s :=
(congr_arg _ s.inter_self).mp ((h.prod_map h').comp fun a => (a, a))
#align tendsto_uniformly_on.prod TendstoUniformlyOn.prod
theorem TendstoUniformly.prod {ΞΉ' Ξ²' : Type*} [UniformSpace Ξ²'] {F' : ΞΉ' β Ξ± β Ξ²'} {f' : Ξ± β Ξ²'}
{p' : Filter ΞΉ'} (h : TendstoUniformly F f p) (h' : TendstoUniformly F' f' p') :
TendstoUniformly (fun (i : ΞΉ Γ ΞΉ') a => (F i.1 a, F' i.2 a)) (fun a => (f a, f' a))
(p ΓΛ’ p') :=
(h.prod_map h').comp fun a => (a, a)
#align tendsto_uniformly.prod TendstoUniformly.prod
theorem tendsto_prod_filter_iff {c : Ξ²} :
Tendsto (βΏF) (p ΓΛ’ p') (π c) β TendstoUniformlyOnFilter F (fun _ => c) p p' := by
simp_rw [nhds_eq_comap_uniformity, tendsto_comap_iff]
rfl
#align tendsto_prod_filter_iff tendsto_prod_filter_iff
| Mathlib/Topology/UniformSpace/UniformConvergence.lean | 331 | 334 | theorem tendsto_prod_principal_iff {c : Ξ²} :
Tendsto (βΏF) (p ΓΛ’ π s) (π c) β TendstoUniformlyOn F (fun _ => c) p s := by |
rw [tendstoUniformlyOn_iff_tendstoUniformlyOnFilter]
exact tendsto_prod_filter_iff
|
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.GroupWithZero.Units.Equiv
import Mathlib.Algebra.Order.Field.Defs
import Mathlib.Algebra.Order.Ring.Abs
import Mathlib.Order.Bounds.OrderIso
import Mathlib.Tactic.Positivity.Core
#align_import algebra.order.field.basic from "leanprover-community/mathlib"@"84771a9f5f0bd5e5d6218811556508ddf476dcbd"
open Function OrderDual
variable {ΞΉ Ξ± Ξ² : Type*}
section LinearOrderedSemifield
variable [LinearOrderedSemifield Ξ±] {a b c d e : Ξ±} {m n : β€}
@[simps! (config := { simpRhs := true })]
def OrderIso.mulLeftβ (a : Ξ±) (ha : 0 < a) : Ξ± βo Ξ± :=
{ Equiv.mulLeftβ a ha.ne' with map_rel_iff' := @fun _ _ => mul_le_mul_left ha }
#align order_iso.mul_leftβ OrderIso.mulLeftβ
#align order_iso.mul_leftβ_symm_apply OrderIso.mulLeftβ_symm_apply
#align order_iso.mul_leftβ_apply OrderIso.mulLeftβ_apply
@[simps! (config := { simpRhs := true })]
def OrderIso.mulRightβ (a : Ξ±) (ha : 0 < a) : Ξ± βo Ξ± :=
{ Equiv.mulRightβ a ha.ne' with map_rel_iff' := @fun _ _ => mul_le_mul_right ha }
#align order_iso.mul_rightβ OrderIso.mulRightβ
#align order_iso.mul_rightβ_symm_apply OrderIso.mulRightβ_symm_apply
#align order_iso.mul_rightβ_apply OrderIso.mulRightβ_apply
theorem le_div_iff (hc : 0 < c) : a β€ b / c β a * c β€ b :=
β¨fun h => div_mul_cancelβ b (ne_of_lt hc).symm βΈ mul_le_mul_of_nonneg_right h hc.le, fun h =>
calc
a = a * c * (1 / c) := mul_mul_div a (ne_of_lt hc).symm
_ β€ b * (1 / c) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hc).le
_ = b / c := (div_eq_mul_one_div b c).symm
β©
#align le_div_iff le_div_iff
theorem le_div_iff' (hc : 0 < c) : a β€ b / c β c * a β€ b := by rw [mul_comm, le_div_iff hc]
#align le_div_iff' le_div_iff'
theorem div_le_iff (hb : 0 < b) : a / b β€ c β a β€ c * b :=
β¨fun h =>
calc
a = a / b * b := by rw [div_mul_cancelβ _ (ne_of_lt hb).symm]
_ β€ c * b := mul_le_mul_of_nonneg_right h hb.le
,
fun h =>
calc
a / b = a * (1 / b) := div_eq_mul_one_div a b
_ β€ c * b * (1 / b) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hb).le
_ = c * b / b := (div_eq_mul_one_div (c * b) b).symm
_ = c := by refine (div_eq_iff (ne_of_gt hb)).mpr rfl
β©
#align div_le_iff div_le_iff
theorem div_le_iff' (hb : 0 < b) : a / b β€ c β a β€ b * c := by rw [mul_comm, div_le_iff hb]
#align div_le_iff' div_le_iff'
lemma div_le_commβ (hb : 0 < b) (hc : 0 < c) : a / b β€ c β a / c β€ b := by
rw [div_le_iff hb, div_le_iff' hc]
theorem lt_div_iff (hc : 0 < c) : a < b / c β a * c < b :=
lt_iff_lt_of_le_iff_le <| div_le_iff hc
#align lt_div_iff lt_div_iff
theorem lt_div_iff' (hc : 0 < c) : a < b / c β c * a < b := by rw [mul_comm, lt_div_iff hc]
#align lt_div_iff' lt_div_iff'
theorem div_lt_iff (hc : 0 < c) : b / c < a β b < a * c :=
lt_iff_lt_of_le_iff_le (le_div_iff hc)
#align div_lt_iff div_lt_iff
theorem div_lt_iff' (hc : 0 < c) : b / c < a β b < c * a := by rw [mul_comm, div_lt_iff hc]
#align div_lt_iff' div_lt_iff'
lemma div_lt_commβ (hb : 0 < b) (hc : 0 < c) : a / b < c β a / c < b := by
rw [div_lt_iff hb, div_lt_iff' hc]
theorem inv_mul_le_iff (h : 0 < b) : bβ»ΒΉ * a β€ c β a β€ b * c := by
rw [inv_eq_one_div, mul_comm, β div_eq_mul_one_div]
exact div_le_iff' h
#align inv_mul_le_iff inv_mul_le_iff
theorem inv_mul_le_iff' (h : 0 < b) : bβ»ΒΉ * a β€ c β a β€ c * b := by rw [inv_mul_le_iff h, mul_comm]
#align inv_mul_le_iff' inv_mul_le_iff'
theorem mul_inv_le_iff (h : 0 < b) : a * bβ»ΒΉ β€ c β a β€ b * c := by rw [mul_comm, inv_mul_le_iff h]
#align mul_inv_le_iff mul_inv_le_iff
theorem mul_inv_le_iff' (h : 0 < b) : a * bβ»ΒΉ β€ c β a β€ c * b := by rw [mul_comm, inv_mul_le_iff' h]
#align mul_inv_le_iff' mul_inv_le_iff'
theorem div_self_le_one (a : Ξ±) : a / a β€ 1 :=
if h : a = 0 then by simp [h] else by simp [h]
#align div_self_le_one div_self_le_one
theorem inv_mul_lt_iff (h : 0 < b) : bβ»ΒΉ * a < c β a < b * c := by
rw [inv_eq_one_div, mul_comm, β div_eq_mul_one_div]
exact div_lt_iff' h
#align inv_mul_lt_iff inv_mul_lt_iff
theorem inv_mul_lt_iff' (h : 0 < b) : bβ»ΒΉ * a < c β a < c * b := by rw [inv_mul_lt_iff h, mul_comm]
#align inv_mul_lt_iff' inv_mul_lt_iff'
theorem mul_inv_lt_iff (h : 0 < b) : a * bβ»ΒΉ < c β a < b * c := by rw [mul_comm, inv_mul_lt_iff h]
#align mul_inv_lt_iff mul_inv_lt_iff
theorem mul_inv_lt_iff' (h : 0 < b) : a * bβ»ΒΉ < c β a < c * b := by rw [mul_comm, inv_mul_lt_iff' h]
#align mul_inv_lt_iff' mul_inv_lt_iff'
theorem inv_pos_le_iff_one_le_mul (ha : 0 < a) : aβ»ΒΉ β€ b β 1 β€ b * a := by
rw [inv_eq_one_div]
exact div_le_iff ha
#align inv_pos_le_iff_one_le_mul inv_pos_le_iff_one_le_mul
theorem inv_pos_le_iff_one_le_mul' (ha : 0 < a) : aβ»ΒΉ β€ b β 1 β€ a * b := by
rw [inv_eq_one_div]
exact div_le_iff' ha
#align inv_pos_le_iff_one_le_mul' inv_pos_le_iff_one_le_mul'
theorem inv_pos_lt_iff_one_lt_mul (ha : 0 < a) : aβ»ΒΉ < b β 1 < b * a := by
rw [inv_eq_one_div]
exact div_lt_iff ha
#align inv_pos_lt_iff_one_lt_mul inv_pos_lt_iff_one_lt_mul
theorem inv_pos_lt_iff_one_lt_mul' (ha : 0 < a) : aβ»ΒΉ < b β 1 < a * b := by
rw [inv_eq_one_div]
exact div_lt_iff' ha
#align inv_pos_lt_iff_one_lt_mul' inv_pos_lt_iff_one_lt_mul'
theorem div_le_of_nonneg_of_le_mul (hb : 0 β€ b) (hc : 0 β€ c) (h : a β€ c * b) : a / b β€ c := by
rcases eq_or_lt_of_le hb with (rfl | hb')
Β· simp only [div_zero, hc]
Β· rwa [div_le_iff hb']
#align div_le_of_nonneg_of_le_mul div_le_of_nonneg_of_le_mul
lemma mul_le_of_nonneg_of_le_div (hb : 0 β€ b) (hc : 0 β€ c) (h : a β€ b / c) : a * c β€ b := by
obtain rfl | hc := hc.eq_or_lt
Β· simpa using hb
Β· rwa [le_div_iff hc] at h
#align mul_le_of_nonneg_of_le_div mul_le_of_nonneg_of_le_div
theorem div_le_one_of_le (h : a β€ b) (hb : 0 β€ b) : a / b β€ 1 :=
div_le_of_nonneg_of_le_mul hb zero_le_one <| by rwa [one_mul]
#align div_le_one_of_le div_le_one_of_le
lemma mul_inv_le_one_of_le (h : a β€ b) (hb : 0 β€ b) : a * bβ»ΒΉ β€ 1 := by
simpa only [β div_eq_mul_inv] using div_le_one_of_le h hb
lemma inv_mul_le_one_of_le (h : a β€ b) (hb : 0 β€ b) : bβ»ΒΉ * a β€ 1 := by
simpa only [β div_eq_inv_mul] using div_le_one_of_le h hb
@[gcongr]
theorem inv_le_inv_of_le (ha : 0 < a) (h : a β€ b) : bβ»ΒΉ β€ aβ»ΒΉ := by
rwa [β one_div a, le_div_iff' ha, β div_eq_mul_inv, div_le_iff (ha.trans_le h), one_mul]
#align inv_le_inv_of_le inv_le_inv_of_le
theorem inv_le_inv (ha : 0 < a) (hb : 0 < b) : aβ»ΒΉ β€ bβ»ΒΉ β b β€ a := by
rw [β one_div, div_le_iff ha, β div_eq_inv_mul, le_div_iff hb, one_mul]
#align inv_le_inv inv_le_inv
theorem inv_le (ha : 0 < a) (hb : 0 < b) : aβ»ΒΉ β€ b β bβ»ΒΉ β€ a := by
rw [β inv_le_inv hb (inv_pos.2 ha), inv_inv]
#align inv_le inv_le
theorem inv_le_of_inv_le (ha : 0 < a) (h : aβ»ΒΉ β€ b) : bβ»ΒΉ β€ a :=
(inv_le ha ((inv_pos.2 ha).trans_le h)).1 h
#align inv_le_of_inv_le inv_le_of_inv_le
theorem le_inv (ha : 0 < a) (hb : 0 < b) : a β€ bβ»ΒΉ β b β€ aβ»ΒΉ := by
rw [β inv_le_inv (inv_pos.2 hb) ha, inv_inv]
#align le_inv le_inv
theorem inv_lt_inv (ha : 0 < a) (hb : 0 < b) : aβ»ΒΉ < bβ»ΒΉ β b < a :=
lt_iff_lt_of_le_iff_le (inv_le_inv hb ha)
#align inv_lt_inv inv_lt_inv
@[gcongr]
theorem inv_lt_inv_of_lt (hb : 0 < b) (h : b < a) : aβ»ΒΉ < bβ»ΒΉ :=
(inv_lt_inv (hb.trans h) hb).2 h
#align inv_lt_inv_of_lt inv_lt_inv_of_lt
theorem inv_lt (ha : 0 < a) (hb : 0 < b) : aβ»ΒΉ < b β bβ»ΒΉ < a :=
lt_iff_lt_of_le_iff_le (le_inv hb ha)
#align inv_lt inv_lt
theorem inv_lt_of_inv_lt (ha : 0 < a) (h : aβ»ΒΉ < b) : bβ»ΒΉ < a :=
(inv_lt ha ((inv_pos.2 ha).trans h)).1 h
#align inv_lt_of_inv_lt inv_lt_of_inv_lt
theorem lt_inv (ha : 0 < a) (hb : 0 < b) : a < bβ»ΒΉ β b < aβ»ΒΉ :=
lt_iff_lt_of_le_iff_le (inv_le hb ha)
#align lt_inv lt_inv
theorem inv_lt_one (ha : 1 < a) : aβ»ΒΉ < 1 := by
rwa [inv_lt (zero_lt_one.trans ha) zero_lt_one, inv_one]
#align inv_lt_one inv_lt_one
theorem one_lt_inv (hβ : 0 < a) (hβ : a < 1) : 1 < aβ»ΒΉ := by
rwa [lt_inv (@zero_lt_one Ξ± _ _ _ _ _) hβ, inv_one]
#align one_lt_inv one_lt_inv
theorem inv_le_one (ha : 1 β€ a) : aβ»ΒΉ β€ 1 := by
rwa [inv_le (zero_lt_one.trans_le ha) zero_lt_one, inv_one]
#align inv_le_one inv_le_one
theorem one_le_inv (hβ : 0 < a) (hβ : a β€ 1) : 1 β€ aβ»ΒΉ := by
rwa [le_inv (@zero_lt_one Ξ± _ _ _ _ _) hβ, inv_one]
#align one_le_inv one_le_inv
theorem inv_lt_one_iff_of_pos (hβ : 0 < a) : aβ»ΒΉ < 1 β 1 < a :=
β¨fun hβ => inv_inv a βΈ one_lt_inv (inv_pos.2 hβ) hβ, inv_lt_oneβ©
#align inv_lt_one_iff_of_pos inv_lt_one_iff_of_pos
theorem inv_lt_one_iff : aβ»ΒΉ < 1 β a β€ 0 β¨ 1 < a := by
rcases le_or_lt a 0 with ha | ha
Β· simp [ha, (inv_nonpos.2 ha).trans_lt zero_lt_one]
Β· simp only [ha.not_le, false_or_iff, inv_lt_one_iff_of_pos ha]
#align inv_lt_one_iff inv_lt_one_iff
theorem one_lt_inv_iff : 1 < aβ»ΒΉ β 0 < a β§ a < 1 :=
β¨fun h => β¨inv_pos.1 (zero_lt_one.trans h), inv_inv a βΈ inv_lt_one hβ©, and_imp.2 one_lt_invβ©
#align one_lt_inv_iff one_lt_inv_iff
theorem inv_le_one_iff : aβ»ΒΉ β€ 1 β a β€ 0 β¨ 1 β€ a := by
rcases em (a = 1) with (rfl | ha)
Β· simp [le_rfl]
Β· simp only [Ne.le_iff_lt (Ne.symm ha), Ne.le_iff_lt (mt inv_eq_one.1 ha), inv_lt_one_iff]
#align inv_le_one_iff inv_le_one_iff
theorem one_le_inv_iff : 1 β€ aβ»ΒΉ β 0 < a β§ a β€ 1 :=
β¨fun h => β¨inv_pos.1 (zero_lt_one.trans_le h), inv_inv a βΈ inv_le_one hβ©, and_imp.2 one_le_invβ©
#align one_le_inv_iff one_le_inv_iff
@[mono, gcongr]
lemma div_le_div_of_nonneg_right (hab : a β€ b) (hc : 0 β€ c) : a / c β€ b / c := by
rw [div_eq_mul_one_div a c, div_eq_mul_one_div b c]
exact mul_le_mul_of_nonneg_right hab (one_div_nonneg.2 hc)
#align div_le_div_of_le_of_nonneg div_le_div_of_nonneg_right
@[gcongr]
lemma div_lt_div_of_pos_right (h : a < b) (hc : 0 < c) : a / c < b / c := by
rw [div_eq_mul_one_div a c, div_eq_mul_one_div b c]
exact mul_lt_mul_of_pos_right h (one_div_pos.2 hc)
#align div_lt_div_of_lt div_lt_div_of_pos_right
-- Not a `mono` lemma b/c `div_le_div` is strictly more general
@[gcongr]
lemma div_le_div_of_nonneg_left (ha : 0 β€ a) (hc : 0 < c) (h : c β€ b) : a / b β€ a / c := by
rw [div_eq_mul_inv, div_eq_mul_inv]
exact mul_le_mul_of_nonneg_left ((inv_le_inv (hc.trans_le h) hc).mpr h) ha
#align div_le_div_of_le_left div_le_div_of_nonneg_left
@[gcongr]
lemma div_lt_div_of_pos_left (ha : 0 < a) (hc : 0 < c) (h : c < b) : a / b < a / c := by
simpa only [div_eq_mul_inv, mul_lt_mul_left ha, inv_lt_inv (hc.trans h) hc]
#align div_lt_div_of_lt_left div_lt_div_of_pos_left
-- 2024-02-16
@[deprecated] alias div_le_div_of_le_of_nonneg := div_le_div_of_nonneg_right
@[deprecated] alias div_lt_div_of_lt := div_lt_div_of_pos_right
@[deprecated] alias div_le_div_of_le_left := div_le_div_of_nonneg_left
@[deprecated] alias div_lt_div_of_lt_left := div_lt_div_of_pos_left
@[deprecated div_le_div_of_nonneg_right (since := "2024-02-16")]
lemma div_le_div_of_le (hc : 0 β€ c) (hab : a β€ b) : a / c β€ b / c :=
div_le_div_of_nonneg_right hab hc
#align div_le_div_of_le div_le_div_of_le
theorem div_le_div_right (hc : 0 < c) : a / c β€ b / c β a β€ b :=
β¨le_imp_le_of_lt_imp_lt fun hab β¦ div_lt_div_of_pos_right hab hc,
fun hab β¦ div_le_div_of_nonneg_right hab hc.leβ©
#align div_le_div_right div_le_div_right
theorem div_lt_div_right (hc : 0 < c) : a / c < b / c β a < b :=
lt_iff_lt_of_le_iff_le <| div_le_div_right hc
#align div_lt_div_right div_lt_div_right
theorem div_lt_div_left (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : a / b < a / c β c < b := by
simp only [div_eq_mul_inv, mul_lt_mul_left ha, inv_lt_inv hb hc]
#align div_lt_div_left div_lt_div_left
theorem div_le_div_left (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : a / b β€ a / c β c β€ b :=
le_iff_le_iff_lt_iff_lt.2 (div_lt_div_left ha hc hb)
#align div_le_div_left div_le_div_left
theorem div_lt_div_iff (b0 : 0 < b) (d0 : 0 < d) : a / b < c / d β a * d < c * b := by
rw [lt_div_iff d0, div_mul_eq_mul_div, div_lt_iff b0]
#align div_lt_div_iff div_lt_div_iff
theorem div_le_div_iff (b0 : 0 < b) (d0 : 0 < d) : a / b β€ c / d β a * d β€ c * b := by
rw [le_div_iff d0, div_mul_eq_mul_div, div_le_iff b0]
#align div_le_div_iff div_le_div_iff
@[mono, gcongr]
theorem div_le_div (hc : 0 β€ c) (hac : a β€ c) (hd : 0 < d) (hbd : d β€ b) : a / b β€ c / d := by
rw [div_le_div_iff (hd.trans_le hbd) hd]
exact mul_le_mul hac hbd hd.le hc
#align div_le_div div_le_div
@[gcongr]
theorem div_lt_div (hac : a < c) (hbd : d β€ b) (c0 : 0 β€ c) (d0 : 0 < d) : a / b < c / d :=
(div_lt_div_iff (d0.trans_le hbd) d0).2 (mul_lt_mul hac hbd d0 c0)
#align div_lt_div div_lt_div
theorem div_lt_div' (hac : a β€ c) (hbd : d < b) (c0 : 0 < c) (d0 : 0 < d) : a / b < c / d :=
(div_lt_div_iff (d0.trans hbd) d0).2 (mul_lt_mul' hac hbd d0.le c0)
#align div_lt_div' div_lt_div'
theorem div_le_self (ha : 0 β€ a) (hb : 1 β€ b) : a / b β€ a := by
simpa only [div_one] using div_le_div_of_nonneg_left ha zero_lt_one hb
#align div_le_self div_le_self
theorem div_lt_self (ha : 0 < a) (hb : 1 < b) : a / b < a := by
simpa only [div_one] using div_lt_div_of_pos_left ha zero_lt_one hb
#align div_lt_self div_lt_self
| Mathlib/Algebra/Order/Field/Basic.lean | 360 | 361 | theorem le_div_self (ha : 0 β€ a) (hbβ : 0 < b) (hbβ : b β€ 1) : a β€ a / b := by |
simpa only [div_one] using div_le_div_of_nonneg_left ha hbβ hbβ
|
import Mathlib.Data.List.Sublists
import Mathlib.Data.Multiset.Bind
#align_import data.multiset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
namespace Multiset
open List
variable {Ξ± : Type*}
-- Porting note (#11215): TODO: Write a more efficient version
def powersetAux (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists l).map (β)
#align multiset.powerset_aux Multiset.powersetAux
theorem powersetAux_eq_map_coe {l : List Ξ±} : powersetAux l = (sublists l).map (β) :=
rfl
#align multiset.powerset_aux_eq_map_coe Multiset.powersetAux_eq_map_coe
@[simp]
theorem mem_powersetAux {l : List Ξ±} {s} : s β powersetAux l β s β€ βl :=
Quotient.inductionOn s <| by simp [powersetAux_eq_map_coe, Subperm, and_comm]
#align multiset.mem_powerset_aux Multiset.mem_powersetAux
def powersetAux' (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists' l).map (β)
#align multiset.powerset_aux' Multiset.powersetAux'
theorem powersetAux_perm_powersetAux' {l : List Ξ±} : powersetAux l ~ powersetAux' l := by
rw [powersetAux_eq_map_coe]; exact (sublists_perm_sublists' _).map _
#align multiset.powerset_aux_perm_powerset_aux' Multiset.powersetAux_perm_powersetAux'
@[simp]
theorem powersetAux'_nil : powersetAux' (@nil Ξ±) = [0] :=
rfl
#align multiset.powerset_aux'_nil Multiset.powersetAux'_nil
@[simp]
theorem powersetAux'_cons (a : Ξ±) (l : List Ξ±) :
powersetAux' (a :: l) = powersetAux' l ++ List.map (cons a) (powersetAux' l) := by
simp only [powersetAux', sublists'_cons, map_append, List.map_map, append_cancel_left_eq]; rfl
#align multiset.powerset_aux'_cons Multiset.powersetAux'_cons
theorem powerset_aux'_perm {lβ lβ : List Ξ±} (p : lβ ~ lβ) : powersetAux' lβ ~ powersetAux' lβ := by
induction' p with a lβ lβ p IH a b l lβ lβ lβ _ _ IHβ IHβ
Β· simp
Β· simp only [powersetAux'_cons]
exact IH.append (IH.map _)
Β· simp only [powersetAux'_cons, map_append, List.map_map, append_assoc]
apply Perm.append_left
rw [β append_assoc, β append_assoc,
(by funext s; simp [cons_swap] : cons b β cons a = cons a β cons b)]
exact perm_append_comm.append_right _
Β· exact IHβ.trans IHβ
#align multiset.powerset_aux'_perm Multiset.powerset_aux'_perm
theorem powersetAux_perm {lβ lβ : List Ξ±} (p : lβ ~ lβ) : powersetAux lβ ~ powersetAux lβ :=
powersetAux_perm_powersetAux'.trans <|
(powerset_aux'_perm p).trans powersetAux_perm_powersetAux'.symm
#align multiset.powerset_aux_perm Multiset.powersetAux_perm
--Porting note (#11083): slightly slower implementation due to `map ofList`
def powerset (s : Multiset Ξ±) : Multiset (Multiset Ξ±) :=
Quot.liftOn s
(fun l => (powersetAux l : Multiset (Multiset Ξ±)))
(fun _ _ h => Quot.sound (powersetAux_perm h))
#align multiset.powerset Multiset.powerset
theorem powerset_coe (l : List Ξ±) : @powerset Ξ± l = ((sublists l).map (β) : List (Multiset Ξ±)) :=
congr_arg ((β) : List (Multiset Ξ±) β Multiset (Multiset Ξ±)) powersetAux_eq_map_coe
#align multiset.powerset_coe Multiset.powerset_coe
@[simp]
theorem powerset_coe' (l : List Ξ±) : @powerset Ξ± l = ((sublists' l).map (β) : List (Multiset Ξ±)) :=
Quot.sound powersetAux_perm_powersetAux'
#align multiset.powerset_coe' Multiset.powerset_coe'
@[simp]
theorem powerset_zero : @powerset Ξ± 0 = {0} :=
rfl
#align multiset.powerset_zero Multiset.powerset_zero
@[simp]
theorem powerset_cons (a : Ξ±) (s) : powerset (a ::β s) = powerset s + map (cons a) (powerset s) :=
Quotient.inductionOn s fun l => by
simp only [quot_mk_to_coe, cons_coe, powerset_coe', sublists'_cons, map_append, List.map_map,
map_coe, coe_add, coe_eq_coe]; rfl
#align multiset.powerset_cons Multiset.powerset_cons
@[simp]
theorem mem_powerset {s t : Multiset Ξ±} : s β powerset t β s β€ t :=
Quotient.inductionOnβ s t <| by simp [Subperm, and_comm]
#align multiset.mem_powerset Multiset.mem_powerset
theorem map_single_le_powerset (s : Multiset Ξ±) : s.map singleton β€ powerset s :=
Quotient.inductionOn s fun l => by
simp only [powerset_coe, quot_mk_to_coe, coe_le, map_coe]
show l.map (((β) : List Ξ± β Multiset Ξ±) β pure) <+~ (sublists l).map (β)
rw [β List.map_map]
exact ((map_pure_sublist_sublists _).map _).subperm
#align multiset.map_single_le_powerset Multiset.map_single_le_powerset
@[simp]
theorem card_powerset (s : Multiset Ξ±) : card (powerset s) = 2 ^ card s :=
Quotient.inductionOn s <| by simp
#align multiset.card_powerset Multiset.card_powerset
theorem revzip_powersetAux {l : List Ξ±} β¦xβ¦ (h : x β revzip (powersetAux l)) : x.1 + x.2 = βl := by
rw [revzip, powersetAux_eq_map_coe, β map_reverse, zip_map, β revzip, List.mem_map] at h
simp only [Prod.map_apply, Prod.exists] at h
rcases h with β¨lβ, lβ, h, rfl, rflβ©
exact Quot.sound (revzip_sublists _ _ _ h)
#align multiset.revzip_powerset_aux Multiset.revzip_powersetAux
theorem revzip_powersetAux' {l : List Ξ±} β¦xβ¦ (h : x β revzip (powersetAux' l)) :
x.1 + x.2 = βl := by
rw [revzip, powersetAux', β map_reverse, zip_map, β revzip, List.mem_map] at h
simp only [Prod.map_apply, Prod.exists] at h
rcases h with β¨lβ, lβ, h, rfl, rflβ©
exact Quot.sound (revzip_sublists' _ _ _ h)
#align multiset.revzip_powerset_aux' Multiset.revzip_powersetAux'
theorem revzip_powersetAux_lemma {Ξ± : Type*} [DecidableEq Ξ±] (l : List Ξ±) {l' : List (Multiset Ξ±)}
(H : β β¦x : _ Γ _β¦, x β revzip l' β x.1 + x.2 = βl) :
revzip l' = l'.map fun x => (x, (l : Multiset Ξ±) - x) := by
have :
Forallβ (fun (p : Multiset Ξ± Γ Multiset Ξ±) (s : Multiset Ξ±) => p = (s, βl - s)) (revzip l')
((revzip l').map Prod.fst) := by
rw [forallβ_map_right_iff, forallβ_same]
rintro β¨s, tβ© h
dsimp
rw [β H h, add_tsub_cancel_left]
rw [β forallβ_eq_eq_eq, forallβ_map_right_iff]
simpa using this
#align multiset.revzip_powerset_aux_lemma Multiset.revzip_powersetAux_lemma
theorem revzip_powersetAux_perm_aux' {l : List Ξ±} :
revzip (powersetAux l) ~ revzip (powersetAux' l) := by
haveI := Classical.decEq Ξ±
rw [revzip_powersetAux_lemma l revzip_powersetAux, revzip_powersetAux_lemma l revzip_powersetAux']
exact powersetAux_perm_powersetAux'.map _
#align multiset.revzip_powerset_aux_perm_aux' Multiset.revzip_powersetAux_perm_aux'
theorem revzip_powersetAux_perm {lβ lβ : List Ξ±} (p : lβ ~ lβ) :
revzip (powersetAux lβ) ~ revzip (powersetAux lβ) := by
haveI := Classical.decEq Ξ±
simp only [fun l : List Ξ± => revzip_powersetAux_lemma l revzip_powersetAux, coe_eq_coe.2 p,
ge_iff_le]
exact (powersetAux_perm p).map _
#align multiset.revzip_powerset_aux_perm Multiset.revzip_powersetAux_perm
def powersetCardAux (n : β) (l : List Ξ±) : List (Multiset Ξ±) :=
sublistsLenAux n l (β) []
#align multiset.powerset_len_aux Multiset.powersetCardAux
theorem powersetCardAux_eq_map_coe {n} {l : List Ξ±} :
powersetCardAux n l = (sublistsLen n l).map (β) := by
rw [powersetCardAux, sublistsLenAux_eq, append_nil]
#align multiset.powerset_len_aux_eq_map_coe Multiset.powersetCardAux_eq_map_coe
@[simp]
theorem mem_powersetCardAux {n} {l : List Ξ±} {s} : s β powersetCardAux n l β s β€ βl β§ card s = n :=
Quotient.inductionOn s <| by
simp only [quot_mk_to_coe, powersetCardAux_eq_map_coe, List.mem_map, mem_sublistsLen,
coe_eq_coe, coe_le, Subperm, exists_prop, coe_card]
exact fun lβ =>
β¨fun β¨lβ, β¨s, eβ©, pβ© => β¨β¨_, p, sβ©, p.symm.length_eq.trans eβ©,
fun β¨β¨lβ, p, sβ©, eβ© => β¨_, β¨s, p.length_eq.trans eβ©, pβ©β©
#align multiset.mem_powerset_len_aux Multiset.mem_powersetCardAux
@[simp]
theorem powersetCardAux_zero (l : List Ξ±) : powersetCardAux 0 l = [0] := by
simp [powersetCardAux_eq_map_coe]
#align multiset.powerset_len_aux_zero Multiset.powersetCardAux_zero
@[simp]
theorem powersetCardAux_nil (n : β) : powersetCardAux (n + 1) (@nil Ξ±) = [] :=
rfl
#align multiset.powerset_len_aux_nil Multiset.powersetCardAux_nil
@[simp]
theorem powersetCardAux_cons (n : β) (a : Ξ±) (l : List Ξ±) :
powersetCardAux (n + 1) (a :: l) =
powersetCardAux (n + 1) l ++ List.map (cons a) (powersetCardAux n l) := by
simp only [powersetCardAux_eq_map_coe, sublistsLen_succ_cons, map_append, List.map_map,
append_cancel_left_eq]; rfl
#align multiset.powerset_len_aux_cons Multiset.powersetCardAux_cons
theorem powersetCardAux_perm {n} {lβ lβ : List Ξ±} (p : lβ ~ lβ) :
powersetCardAux n lβ ~ powersetCardAux n lβ := by
induction' n with n IHn generalizing lβ lβ
Β· simp
induction' p with a lβ lβ p IH a b l lβ lβ lβ _ _ IHβ IHβ
Β· rfl
Β· simp only [powersetCardAux_cons]
exact IH.append ((IHn p).map _)
Β· simp only [powersetCardAux_cons, append_assoc]
apply Perm.append_left
cases n
Β· simp [Perm.swap]
simp only [powersetCardAux_cons, map_append, List.map_map]
rw [β append_assoc, β append_assoc,
(by funext s; simp [cons_swap] : cons b β cons a = cons a β cons b)]
exact perm_append_comm.append_right _
Β· exact IHβ.trans IHβ
#align multiset.powerset_len_aux_perm Multiset.powersetCardAux_perm
def powersetCard (n : β) (s : Multiset Ξ±) : Multiset (Multiset Ξ±) :=
Quot.liftOn s (fun l => (powersetCardAux n l : Multiset (Multiset Ξ±))) fun _ _ h =>
Quot.sound (powersetCardAux_perm h)
#align multiset.powerset_len Multiset.powersetCard
theorem powersetCard_coe' (n) (l : List Ξ±) : @powersetCard Ξ± n l = powersetCardAux n l :=
rfl
#align multiset.powerset_len_coe' Multiset.powersetCard_coe'
theorem powersetCard_coe (n) (l : List Ξ±) :
@powersetCard Ξ± n l = ((sublistsLen n l).map (β) : List (Multiset Ξ±)) :=
congr_arg ((β) : List (Multiset Ξ±) β Multiset (Multiset Ξ±)) powersetCardAux_eq_map_coe
#align multiset.powerset_len_coe Multiset.powersetCard_coe
@[simp]
theorem powersetCard_zero_left (s : Multiset Ξ±) : powersetCard 0 s = {0} :=
Quotient.inductionOn s fun l => by simp [powersetCard_coe']
#align multiset.powerset_len_zero_left Multiset.powersetCard_zero_left
theorem powersetCard_zero_right (n : β) : @powersetCard Ξ± (n + 1) 0 = 0 :=
rfl
#align multiset.powerset_len_zero_right Multiset.powersetCard_zero_right
@[simp]
theorem powersetCard_cons (n : β) (a : Ξ±) (s) :
powersetCard (n + 1) (a ::β s) = powersetCard (n + 1) s + map (cons a) (powersetCard n s) :=
Quotient.inductionOn s fun l => by simp [powersetCard_coe']
#align multiset.powerset_len_cons Multiset.powersetCard_cons
theorem powersetCard_one (s : Multiset Ξ±) : powersetCard 1 s = s.map singleton :=
Quotient.inductionOn s fun l β¦ by
simp [powersetCard_coe, sublistsLen_one, map_reverse, Function.comp]
@[simp]
theorem mem_powersetCard {n : β} {s t : Multiset Ξ±} : s β powersetCard n t β s β€ t β§ card s = n :=
Quotient.inductionOn t fun l => by simp [powersetCard_coe']
#align multiset.mem_powerset_len Multiset.mem_powersetCard
@[simp]
theorem card_powersetCard (n : β) (s : Multiset Ξ±) :
card (powersetCard n s) = Nat.choose (card s) n :=
Quotient.inductionOn s <| by simp [powersetCard_coe]
#align multiset.card_powerset_len Multiset.card_powersetCard
theorem powersetCard_le_powerset (n : β) (s : Multiset Ξ±) : powersetCard n s β€ powerset s :=
Quotient.inductionOn s fun l => by
simp only [quot_mk_to_coe, powersetCard_coe, powerset_coe', coe_le]
exact ((sublistsLen_sublist_sublists' _ _).map _).subperm
#align multiset.powerset_len_le_powerset Multiset.powersetCard_le_powerset
theorem powersetCard_mono (n : β) {s t : Multiset Ξ±} (h : s β€ t) :
powersetCard n s β€ powersetCard n t :=
leInductionOn h fun {lβ lβ} h => by
simp only [powersetCard_coe, coe_le]
exact ((sublistsLen_sublist_of_sublist _ h).map _).subperm
#align multiset.powerset_len_mono Multiset.powersetCard_mono
@[simp]
theorem powersetCard_eq_empty {Ξ± : Type*} (n : β) {s : Multiset Ξ±} (h : card s < n) :
powersetCard n s = 0 :=
card_eq_zero.mp (Nat.choose_eq_zero_of_lt h βΈ card_powersetCard _ _)
#align multiset.powerset_len_empty Multiset.powersetCard_eq_empty
@[simp]
theorem powersetCard_card_add (s : Multiset Ξ±) {i : β} (hi : 0 < i) :
s.powersetCard (card s + i) = 0 :=
powersetCard_eq_empty _ (Nat.lt_add_of_pos_right hi)
#align multiset.powerset_len_card_add Multiset.powersetCard_card_add
| Mathlib/Data/Multiset/Powerset.lean | 300 | 304 | theorem powersetCard_map {Ξ² : Type*} (f : Ξ± β Ξ²) (n : β) (s : Multiset Ξ±) :
powersetCard n (s.map f) = (powersetCard n s).map (map f) := by |
induction' s using Multiset.induction with t s ih generalizing n
Β· cases n <;> simp [powersetCard_zero_left, powersetCard_zero_right]
Β· cases n <;> simp [ih, map_comp_cons]
|
import Mathlib.AlgebraicTopology.SimplicialObject
import Mathlib.CategoryTheory.Limits.Shapes.Products
#align_import algebraic_topology.split_simplicial_object from "leanprover-community/mathlib"@"dd1f8496baa505636a82748e6b652165ea888733"
noncomputable section
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits Opposite SimplexCategory
open Simplicial
universe u
variable {C : Type*} [Category C]
namespace SimplicialObject
namespace Splitting
def IndexSet (Ξ : SimplexCategoryα΅α΅) :=
Ξ£Ξ' : SimplexCategoryα΅α΅, { Ξ± : Ξ.unop βΆ Ξ'.unop // Epi Ξ± }
#align simplicial_object.splitting.index_set SimplicialObject.Splitting.IndexSet
namespace IndexSet
@[simps]
def mk {Ξ Ξ' : SimplexCategory} (f : Ξ βΆ Ξ') [Epi f] : IndexSet (op Ξ) :=
β¨op Ξ', f, inferInstanceβ©
#align simplicial_object.splitting.index_set.mk SimplicialObject.Splitting.IndexSet.mk
variable {Ξ : SimplexCategoryα΅α΅} (A : IndexSet Ξ)
def e :=
A.2.1
#align simplicial_object.splitting.index_set.e SimplicialObject.Splitting.IndexSet.e
instance : Epi A.e :=
A.2.2
theorem ext' : A = β¨A.1, β¨A.e, A.2.2β©β© := rfl
#align simplicial_object.splitting.index_set.ext' SimplicialObject.Splitting.IndexSet.ext'
theorem ext (Aβ Aβ : IndexSet Ξ) (hβ : Aβ.1 = Aβ.1) (hβ : Aβ.e β« eqToHom (by rw [hβ]) = Aβ.e) :
Aβ = Aβ := by
rcases Aβ with β¨Ξβ, β¨Ξ±β, hΞ±ββ©β©
rcases Aβ with β¨Ξβ, β¨Ξ±β, hΞ±ββ©β©
simp only at hβ
subst hβ
simp only [eqToHom_refl, comp_id, IndexSet.e] at hβ
simp only [hβ]
#align simplicial_object.splitting.index_set.ext SimplicialObject.Splitting.IndexSet.ext
instance : Fintype (IndexSet Ξ) :=
Fintype.ofInjective
(fun A =>
β¨β¨A.1.unop.len, Nat.lt_succ_iff.mpr (len_le_of_epi (inferInstance : Epi A.e))β©,
A.e.toOrderHomβ© :
IndexSet Ξ β Sigma fun k : Fin (Ξ.unop.len + 1) => Fin (Ξ.unop.len + 1) β Fin (k + 1))
(by
rintro β¨Ξβ, Ξ±ββ© β¨Ξβ, Ξ±ββ© hβ
induction' Ξβ using Opposite.rec with Ξβ
induction' Ξβ using Opposite.rec with Ξβ
simp only [unop_op, Sigma.mk.inj_iff, Fin.mk.injEq] at hβ
have hβ : Ξβ = Ξβ := by
ext1
simpa only [Fin.mk_eq_mk] using hβ.1
subst hβ
refine ext _ _ rfl ?_
ext : 2
exact eq_of_heq hβ.2)
variable (Ξ)
@[simps]
def id : IndexSet Ξ :=
β¨Ξ, β¨π _, by infer_instanceβ©β©
#align simplicial_object.splitting.index_set.id SimplicialObject.Splitting.IndexSet.id
instance : Inhabited (IndexSet Ξ) :=
β¨id Ξβ©
variable {Ξ}
@[simp]
def EqId : Prop :=
A = id _
#align simplicial_object.splitting.index_set.eq_id SimplicialObject.Splitting.IndexSet.EqId
theorem eqId_iff_eq : A.EqId β A.1 = Ξ := by
constructor
Β· intro h
dsimp at h
rw [h]
rfl
Β· intro h
rcases A with β¨_, β¨f, hfβ©β©
simp only at h
subst h
refine ext _ _ rfl ?_
haveI := hf
simp only [eqToHom_refl, comp_id]
exact eq_id_of_epi f
#align simplicial_object.splitting.index_set.eq_id_iff_eq SimplicialObject.Splitting.IndexSet.eqId_iff_eq
| Mathlib/AlgebraicTopology/SplitSimplicialObject.lean | 143 | 151 | theorem eqId_iff_len_eq : A.EqId β A.1.unop.len = Ξ.unop.len := by |
rw [eqId_iff_eq]
constructor
Β· intro h
rw [h]
Β· intro h
rw [β unop_inj_iff]
ext
exact h
|
import Mathlib.Analysis.Calculus.ContDiff.Basic
import Mathlib.Analysis.Calculus.Deriv.Linear
import Mathlib.Analysis.Complex.Conformal
import Mathlib.Analysis.Calculus.Conformal.NormedSpace
#align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
section RealDerivOfComplex
open Complex
variable {e : β β β} {e' : β} {z : β}
theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) :
HasStrictDerivAt (fun x : β => (e x).re) e'.re z := by
have A : HasStrictFDerivAt ((β) : β β β) ofRealCLM z := ofRealCLM.hasStrictFDerivAt
have B :
HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β βL[β] β).restrictScalars β)
(ofRealCLM z) :=
h.hasStrictFDerivAt.restrictScalars β
have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt
-- Porting note: this should be by:
-- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt
-- but for some reason simp can not use `ContinuousLinearMap.comp_apply`
convert (C.comp z (B.comp z A)).hasStrictDerivAt
rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply]
simp
#align has_strict_deriv_at.real_of_complex HasStrictDerivAt.real_of_complex
theorem HasDerivAt.real_of_complex (h : HasDerivAt e e' z) :
HasDerivAt (fun x : β => (e x).re) e'.re z := by
have A : HasFDerivAt ((β) : β β β) ofRealCLM z := ofRealCLM.hasFDerivAt
have B :
HasFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β βL[β] β).restrictScalars β)
(ofRealCLM z) :=
h.hasFDerivAt.restrictScalars β
have C : HasFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasFDerivAt
-- Porting note: this should be by:
-- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt
-- but for some reason simp can not use `ContinuousLinearMap.comp_apply`
convert (C.comp z (B.comp z A)).hasDerivAt
rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply]
simp
#align has_deriv_at.real_of_complex HasDerivAt.real_of_complex
theorem ContDiffAt.real_of_complex {n : ββ} (h : ContDiffAt β n e z) :
ContDiffAt β n (fun x : β => (e x).re) z := by
have A : ContDiffAt β n ((β) : β β β) z := ofRealCLM.contDiff.contDiffAt
have B : ContDiffAt β n e z := h.restrict_scalars β
have C : ContDiffAt β n re (e z) := reCLM.contDiff.contDiffAt
exact C.comp z (B.comp z A)
#align cont_diff_at.real_of_complex ContDiffAt.real_of_complex
theorem ContDiff.real_of_complex {n : ββ} (h : ContDiff β n e) :
ContDiff β n fun x : β => (e x).re :=
contDiff_iff_contDiffAt.2 fun _ => h.contDiffAt.real_of_complex
#align cont_diff.real_of_complex ContDiff.real_of_complex
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E]
theorem HasStrictDerivAt.complexToReal_fderiv' {f : β β E} {x : β} {f' : E}
(h : HasStrictDerivAt f f' x) :
HasStrictFDerivAt f (reCLM.smulRight f' + I β’ imCLM.smulRight f') x := by
simpa only [Complex.restrictScalars_one_smulRight'] using
h.hasStrictFDerivAt.restrictScalars β
#align has_strict_deriv_at.complex_to_real_fderiv' HasStrictDerivAt.complexToReal_fderiv'
theorem HasDerivAt.complexToReal_fderiv' {f : β β E} {x : β} {f' : E} (h : HasDerivAt f f' x) :
HasFDerivAt f (reCLM.smulRight f' + I β’ imCLM.smulRight f') x := by
simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivAt.restrictScalars β
#align has_deriv_at.complex_to_real_fderiv' HasDerivAt.complexToReal_fderiv'
| Mathlib/Analysis/Complex/RealDeriv.lean | 111 | 115 | theorem HasDerivWithinAt.complexToReal_fderiv' {f : β β E} {s : Set β} {x : β} {f' : E}
(h : HasDerivWithinAt f f' s x) :
HasFDerivWithinAt f (reCLM.smulRight f' + I β’ imCLM.smulRight f') s x := by |
simpa only [Complex.restrictScalars_one_smulRight'] using
h.hasFDerivWithinAt.restrictScalars β
|
import Mathlib.Data.List.Basic
#align_import data.list.count from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
assert_not_exists Set.range
assert_not_exists GroupWithZero
assert_not_exists Ring
open Nat
variable {Ξ± : Type*} {l : List Ξ±}
namespace List
section CountP
variable (p q : Ξ± β Bool)
#align list.countp_nil List.countP_nil
#align list.countp_cons_of_pos List.countP_cons_of_pos
#align list.countp_cons_of_neg List.countP_cons_of_neg
#align list.countp_cons List.countP_cons
#align list.length_eq_countp_add_countp List.length_eq_countP_add_countP
#align list.countp_eq_length_filter List.countP_eq_length_filter
#align list.countp_le_length List.countP_le_length
#align list.countp_append List.countP_append
#align list.countp_pos List.countP_pos
#align list.countp_eq_zero List.countP_eq_zero
#align list.countp_eq_length List.countP_eq_length
| Mathlib/Data/List/Count.lean | 54 | 57 | theorem length_filter_lt_length_iff_exists (l) :
length (filter p l) < length l β β x β l, Β¬p x := by |
simpa [length_eq_countP_add_countP p l, countP_eq_length_filter] using
countP_pos (fun x => Β¬p x) (l := l)
|
import Mathlib.CategoryTheory.Abelian.Homology
import Mathlib.CategoryTheory.Abelian.ProjectiveResolution
import Mathlib.Algebra.Homology.Additive
#align_import category_theory.abelian.left_derived from "leanprover-community/mathlib"@"8001ea54ece3bd5c0d0932f1e4f6d0f142ea20d9"
universe v u
namespace CategoryTheory
open Category Limits
variable {C : Type u} [Category.{v} C] {D : Type*} [Category D]
[Abelian C] [HasProjectiveResolutions C] [Abelian D]
noncomputable def Functor.leftDerivedToHomotopyCategory (F : C β₯€ D) [F.Additive] :
C β₯€ HomotopyCategory D (ComplexShape.down β) :=
projectiveResolutions C β F.mapHomotopyCategory _
noncomputable def ProjectiveResolution.isoLeftDerivedToHomotopyCategoryObj {X : C}
(P : ProjectiveResolution X) (F : C β₯€ D) [F.Additive] :
F.leftDerivedToHomotopyCategory.obj X β
(F.mapHomologicalComplex _ β HomotopyCategory.quotient _ _).obj P.complex :=
(F.mapHomotopyCategory _).mapIso P.iso βͺβ«
(F.mapHomotopyCategoryFactors _).app P.complex
@[reassoc]
lemma ProjectiveResolution.isoLeftDerivedToHomotopyCategoryObj_inv_naturality
{X Y : C} (f : X βΆ Y) (P : ProjectiveResolution X) (Q : ProjectiveResolution Y)
(Ο : P.complex βΆ Q.complex) (comm : Ο.f 0 β« Q.Ο.f 0 = P.Ο.f 0 β« f)
(F : C β₯€ D) [F.Additive] :
(P.isoLeftDerivedToHomotopyCategoryObj F).inv β« F.leftDerivedToHomotopyCategory.map f =
(F.mapHomologicalComplex _ β HomotopyCategory.quotient _ _).map Ο β«
(Q.isoLeftDerivedToHomotopyCategoryObj F).inv := by
dsimp [Functor.leftDerivedToHomotopyCategory, isoLeftDerivedToHomotopyCategoryObj]
rw [assoc, β Functor.map_comp, iso_inv_naturality f P Q Ο comm, Functor.map_comp]
erw [(F.mapHomotopyCategoryFactors (ComplexShape.down β)).inv.naturality_assoc]
rfl
@[reassoc]
lemma ProjectiveResolution.isoLeftDerivedToHomotopyCategoryObj_hom_naturality
{X Y : C} (f : X βΆ Y) (P : ProjectiveResolution X) (Q : ProjectiveResolution Y)
(Ο : P.complex βΆ Q.complex) (comm : Ο.f 0 β« Q.Ο.f 0 = P.Ο.f 0 β« f)
(F : C β₯€ D) [F.Additive] :
F.leftDerivedToHomotopyCategory.map f β« (Q.isoLeftDerivedToHomotopyCategoryObj F).hom =
(P.isoLeftDerivedToHomotopyCategoryObj F).hom β«
(F.mapHomologicalComplex _ β HomotopyCategory.quotient _ _).map Ο := by
dsimp
rw [β cancel_epi (P.isoLeftDerivedToHomotopyCategoryObj F).inv, Iso.inv_hom_id_assoc,
isoLeftDerivedToHomotopyCategoryObj_inv_naturality_assoc f P Q Ο comm F,
Iso.inv_hom_id, comp_id]
noncomputable def Functor.leftDerived (F : C β₯€ D) [F.Additive] (n : β) : C β₯€ D :=
F.leftDerivedToHomotopyCategory β HomotopyCategory.homologyFunctor D _ n
#align category_theory.functor.left_derived CategoryTheory.Functor.leftDerived
noncomputable def ProjectiveResolution.isoLeftDerivedObj {X : C} (P : ProjectiveResolution X)
(F : C β₯€ D) [F.Additive] (n : β) :
(F.leftDerived n).obj X β
(HomologicalComplex.homologyFunctor D _ n).obj
((F.mapHomologicalComplex _).obj P.complex) :=
(HomotopyCategory.homologyFunctor D _ n).mapIso
(P.isoLeftDerivedToHomotopyCategoryObj F) βͺβ«
(HomotopyCategory.homologyFunctorFactors D (ComplexShape.down β) n).app _
@[reassoc]
lemma ProjectiveResolution.isoLeftDerivedObj_hom_naturality
{X Y : C} (f : X βΆ Y) (P : ProjectiveResolution X) (Q : ProjectiveResolution Y)
(Ο : P.complex βΆ Q.complex) (comm : Ο.f 0 β« Q.Ο.f 0 = P.Ο.f 0 β« f)
(F : C β₯€ D) [F.Additive] (n : β) :
(F.leftDerived n).map f β« (Q.isoLeftDerivedObj F n).hom =
(P.isoLeftDerivedObj F n).hom β«
(F.mapHomologicalComplex _ β HomologicalComplex.homologyFunctor _ _ n).map Ο := by
dsimp [isoLeftDerivedObj, Functor.leftDerived]
rw [assoc, β Functor.map_comp_assoc,
ProjectiveResolution.isoLeftDerivedToHomotopyCategoryObj_hom_naturality f P Q Ο comm F,
Functor.map_comp, assoc]
erw [(HomotopyCategory.homologyFunctorFactors D (ComplexShape.down β) n).hom.naturality]
rfl
@[reassoc]
lemma ProjectiveResolution.isoLeftDerivedObj_inv_naturality
{X Y : C} (f : X βΆ Y) (P : ProjectiveResolution X) (Q : ProjectiveResolution Y)
(Ο : P.complex βΆ Q.complex) (comm : Ο.f 0 β« Q.Ο.f 0 = P.Ο.f 0 β« f)
(F : C β₯€ D) [F.Additive] (n : β) :
(P.isoLeftDerivedObj F n).inv β« (F.leftDerived n).map f =
(F.mapHomologicalComplex _ β HomologicalComplex.homologyFunctor _ _ n).map Ο β«
(Q.isoLeftDerivedObj F n).inv := by
rw [β cancel_mono (Q.isoLeftDerivedObj F n).hom, assoc, assoc,
ProjectiveResolution.isoLeftDerivedObj_hom_naturality f P Q Ο comm F n,
Iso.inv_hom_id_assoc, Iso.inv_hom_id, comp_id]
lemma Functor.isZero_leftDerived_obj_projective_succ
(F : C β₯€ D) [F.Additive] (n : β) (X : C) [Projective X] :
IsZero ((F.leftDerived (n + 1)).obj X) := by
refine IsZero.of_iso ?_ ((ProjectiveResolution.self X).isoLeftDerivedObj F (n + 1))
erw [β HomologicalComplex.exactAt_iff_isZero_homology]
exact ShortComplex.exact_of_isZero_Xβ _ (F.map_isZero (by apply isZero_zero))
| Mathlib/CategoryTheory/Abelian/LeftDerived.lean | 157 | 168 | theorem Functor.leftDerived_map_eq (F : C β₯€ D) [F.Additive] (n : β) {X Y : C} (f : X βΆ Y)
{P : ProjectiveResolution X} {Q : ProjectiveResolution Y} (g : P.complex βΆ Q.complex)
(w : g β« Q.Ο = P.Ο β« (ChainComplex.singleβ C).map f) :
(F.leftDerived n).map f =
(P.isoLeftDerivedObj F n).hom β«
(F.mapHomologicalComplex _ β HomologicalComplex.homologyFunctor _ _ n).map g β«
(Q.isoLeftDerivedObj F n).inv := by |
rw [β cancel_mono (Q.isoLeftDerivedObj F n).hom,
ProjectiveResolution.isoLeftDerivedObj_hom_naturality f P Q g _ F n,
assoc, assoc, Iso.inv_hom_id, comp_id]
rw [β HomologicalComplex.comp_f, w, HomologicalComplex.comp_f,
ChainComplex.singleβ_map_f_zero]
|
import Mathlib.SetTheory.Ordinal.Arithmetic
import Mathlib.SetTheory.Ordinal.Exponential
#align_import set_theory.ordinal.fixed_point from "leanprover-community/mathlib"@"0dd4319a17376eda5763cd0a7e0d35bbaaa50e83"
noncomputable section
universe u v
open Function Order
namespace Ordinal
section
variable {ΞΉ : Type u} {f : ΞΉ β Ordinal.{max u v} β Ordinal.{max u v}}
def nfpFamily (f : ΞΉ β Ordinal β Ordinal) (a : Ordinal) : Ordinal :=
sup (List.foldr f a)
#align ordinal.nfp_family Ordinal.nfpFamily
theorem nfpFamily_eq_sup (f : ΞΉ β Ordinal.{max u v} β Ordinal.{max u v}) (a : Ordinal.{max u v}) :
nfpFamily.{u, v} f a = sup.{u, v} (List.foldr f a) :=
rfl
#align ordinal.nfp_family_eq_sup Ordinal.nfpFamily_eq_sup
theorem foldr_le_nfpFamily (f : ΞΉ β Ordinal β Ordinal)
(a l) : List.foldr f a l β€ nfpFamily.{u, v} f a :=
le_sup.{u, v} _ _
#align ordinal.foldr_le_nfp_family Ordinal.foldr_le_nfpFamily
theorem le_nfpFamily (f : ΞΉ β Ordinal β Ordinal) (a) : a β€ nfpFamily f a :=
le_sup _ []
#align ordinal.le_nfp_family Ordinal.le_nfpFamily
theorem lt_nfpFamily {a b} : a < nfpFamily.{u, v} f b β β l, a < List.foldr f b l :=
lt_sup.{u, v}
#align ordinal.lt_nfp_family Ordinal.lt_nfpFamily
theorem nfpFamily_le_iff {a b} : nfpFamily.{u, v} f a β€ b β β l, List.foldr f a l β€ b :=
sup_le_iff
#align ordinal.nfp_family_le_iff Ordinal.nfpFamily_le_iff
theorem nfpFamily_le {a b} : (β l, List.foldr f a l β€ b) β nfpFamily.{u, v} f a β€ b :=
sup_le.{u, v}
#align ordinal.nfp_family_le Ordinal.nfpFamily_le
theorem nfpFamily_monotone (hf : β i, Monotone (f i)) : Monotone (nfpFamily.{u, v} f) :=
fun _ _ h => sup_le.{u, v} fun l => (List.foldr_monotone hf l h).trans (le_sup.{u, v} _ l)
#align ordinal.nfp_family_monotone Ordinal.nfpFamily_monotone
theorem apply_lt_nfpFamily (H : β i, IsNormal (f i)) {a b} (hb : b < nfpFamily.{u, v} f a) (i) :
f i b < nfpFamily.{u, v} f a :=
let β¨l, hlβ© := lt_nfpFamily.1 hb
lt_sup.2 β¨i::l, (H i).strictMono hlβ©
#align ordinal.apply_lt_nfp_family Ordinal.apply_lt_nfpFamily
theorem apply_lt_nfpFamily_iff [Nonempty ΞΉ] (H : β i, IsNormal (f i)) {a b} :
(β i, f i b < nfpFamily.{u, v} f a) β b < nfpFamily.{u, v} f a :=
β¨fun h =>
lt_nfpFamily.2 <|
let β¨l, hlβ© := lt_sup.1 <| h <| Classical.arbitrary ΞΉ
β¨l, ((H _).self_le b).trans_lt hlβ©,
apply_lt_nfpFamily Hβ©
#align ordinal.apply_lt_nfp_family_iff Ordinal.apply_lt_nfpFamily_iff
theorem nfpFamily_le_apply [Nonempty ΞΉ] (H : β i, IsNormal (f i)) {a b} :
(β i, nfpFamily.{u, v} f a β€ f i b) β nfpFamily.{u, v} f a β€ b := by
rw [β not_iff_not]
push_neg
exact apply_lt_nfpFamily_iff H
#align ordinal.nfp_family_le_apply Ordinal.nfpFamily_le_apply
theorem nfpFamily_le_fp (H : β i, Monotone (f i)) {a b} (ab : a β€ b) (h : β i, f i b β€ b) :
nfpFamily.{u, v} f a β€ b :=
sup_le fun l => by
by_cases hΞΉ : IsEmpty ΞΉ
Β· rwa [Unique.eq_default l]
Β· induction' l with i l IH generalizing a
Β· exact ab
exact (H i (IH ab)).trans (h i)
#align ordinal.nfp_family_le_fp Ordinal.nfpFamily_le_fp
theorem nfpFamily_fp {i} (H : IsNormal (f i)) (a) :
f i (nfpFamily.{u, v} f a) = nfpFamily.{u, v} f a := by
unfold nfpFamily
rw [@IsNormal.sup.{u, v, v} _ H _ _ β¨[]β©]
apply le_antisymm <;> refine Ordinal.sup_le fun l => ?_
Β· exact le_sup _ (i::l)
Β· exact (H.self_le _).trans (le_sup _ _)
#align ordinal.nfp_family_fp Ordinal.nfpFamily_fp
theorem apply_le_nfpFamily [hΞΉ : Nonempty ΞΉ] {f : ΞΉ β Ordinal β Ordinal} (H : β i, IsNormal (f i))
{a b} : (β i, f i b β€ nfpFamily.{u, v} f a) β b β€ nfpFamily.{u, v} f a := by
refine β¨fun h => ?_, fun h i => ?_β©
Β· cases' hΞΉ with i
exact ((H i).self_le b).trans (h i)
rw [β nfpFamily_fp (H i)]
exact (H i).monotone h
#align ordinal.apply_le_nfp_family Ordinal.apply_le_nfpFamily
theorem nfpFamily_eq_self {f : ΞΉ β Ordinal β Ordinal} {a} (h : β i, f i a = a) :
nfpFamily f a = a :=
le_antisymm (sup_le fun l => by rw [List.foldr_fixed' h l]) <| le_nfpFamily f a
#align ordinal.nfp_family_eq_self Ordinal.nfpFamily_eq_self
-- Todo: This is actually a special case of the fact the intersection of club sets is a club set.
theorem fp_family_unbounded (H : β i, IsNormal (f i)) :
(β i, Function.fixedPoints (f i)).Unbounded (Β· < Β·) := fun a =>
β¨nfpFamily.{u, v} f a, fun s β¨i, hiβ© => by
rw [β hi, mem_fixedPoints_iff]
exact nfpFamily_fp.{u, v} (H i) a, (le_nfpFamily f a).not_ltβ©
#align ordinal.fp_family_unbounded Ordinal.fp_family_unbounded
def derivFamily (f : ΞΉ β Ordinal β Ordinal) (o : Ordinal) : Ordinal :=
limitRecOn o (nfpFamily.{u, v} f 0) (fun _ IH => nfpFamily.{u, v} f (succ IH))
fun a _ => bsup.{max u v, u} a
#align ordinal.deriv_family Ordinal.derivFamily
@[simp]
theorem derivFamily_zero (f : ΞΉ β Ordinal β Ordinal) :
derivFamily.{u, v} f 0 = nfpFamily.{u, v} f 0 :=
limitRecOn_zero _ _ _
#align ordinal.deriv_family_zero Ordinal.derivFamily_zero
@[simp]
theorem derivFamily_succ (f : ΞΉ β Ordinal β Ordinal) (o) :
derivFamily.{u, v} f (succ o) = nfpFamily.{u, v} f (succ (derivFamily.{u, v} f o)) :=
limitRecOn_succ _ _ _ _
#align ordinal.deriv_family_succ Ordinal.derivFamily_succ
theorem derivFamily_limit (f : ΞΉ β Ordinal β Ordinal) {o} :
IsLimit o β derivFamily.{u, v} f o = bsup.{max u v, u} o fun a _ => derivFamily.{u, v} f a :=
limitRecOn_limit _ _ _ _
#align ordinal.deriv_family_limit Ordinal.derivFamily_limit
theorem derivFamily_isNormal (f : ΞΉ β Ordinal β Ordinal) : IsNormal (derivFamily f) :=
β¨fun o => by rw [derivFamily_succ, β succ_le_iff]; apply le_nfpFamily, fun o l a => by
rw [derivFamily_limit _ l, bsup_le_iff]β©
#align ordinal.deriv_family_is_normal Ordinal.derivFamily_isNormal
theorem derivFamily_fp {i} (H : IsNormal (f i)) (o : Ordinal.{max u v}) :
f i (derivFamily.{u, v} f o) = derivFamily.{u, v} f o := by
induction' o using limitRecOn with o _ o l IH
Β· rw [derivFamily_zero]
exact nfpFamily_fp H 0
Β· rw [derivFamily_succ]
exact nfpFamily_fp H _
Β· rw [derivFamily_limit _ l,
IsNormal.bsup.{max u v, u, max u v} H (fun a _ => derivFamily f a) l.1]
refine eq_of_forall_ge_iff fun c => ?_
simp (config := { contextual := true }) only [bsup_le_iff, IH]
#align ordinal.deriv_family_fp Ordinal.derivFamily_fp
theorem le_iff_derivFamily (H : β i, IsNormal (f i)) {a} :
(β i, f i a β€ a) β β o, derivFamily.{u, v} f o = a :=
β¨fun ha => by
suffices β (o) (_ : a β€ derivFamily.{u, v} f o), β o, derivFamily.{u, v} f o = a from
this a ((derivFamily_isNormal _).self_le _)
intro o
induction' o using limitRecOn with o IH o l IH
Β· intro hβ
refine β¨0, le_antisymm ?_ hββ©
rw [derivFamily_zero]
exact nfpFamily_le_fp (fun i => (H i).monotone) (Ordinal.zero_le _) ha
Β· intro hβ
rcases le_or_lt a (derivFamily.{u, v} f o) with h | h
Β· exact IH h
refine β¨succ o, le_antisymm ?_ hββ©
rw [derivFamily_succ]
exact nfpFamily_le_fp (fun i => (H i).monotone) (succ_le_of_lt h) ha
Β· intro hβ
cases' eq_or_lt_of_le hβ with h h
Β· exact β¨_, h.symmβ©
rw [derivFamily_limit _ l, β not_le, bsup_le_iff, not_forallβ] at h
exact
let β¨o', h, hlβ© := h
IH o' h (le_of_not_le hl),
fun β¨o, eβ© i => e βΈ (derivFamily_fp (H i) _).leβ©
#align ordinal.le_iff_deriv_family Ordinal.le_iff_derivFamily
theorem fp_iff_derivFamily (H : β i, IsNormal (f i)) {a} :
(β i, f i a = a) β β o, derivFamily.{u, v} f o = a :=
Iff.trans β¨fun h i => le_of_eq (h i), fun h i => (H i).le_iff_eq.1 (h i)β© (le_iff_derivFamily H)
#align ordinal.fp_iff_deriv_family Ordinal.fp_iff_derivFamily
theorem derivFamily_eq_enumOrd (H : β i, IsNormal (f i)) :
derivFamily.{u, v} f = enumOrd (β i, Function.fixedPoints (f i)) := by
rw [β eq_enumOrd _ (fp_family_unbounded.{u, v} H)]
use (derivFamily_isNormal f).strictMono
rw [Set.range_eq_iff]
refine β¨?_, fun a ha => ?_β©
Β· rintro a S β¨i, hiβ©
rw [β hi]
exact derivFamily_fp (H i) a
rw [Set.mem_iInter] at ha
rwa [β fp_iff_derivFamily H]
#align ordinal.deriv_family_eq_enum_ord Ordinal.derivFamily_eq_enumOrd
end
section
variable {o : Ordinal.{u}} {f : β b < o, Ordinal.{max u v} β Ordinal.{max u v}}
def nfpBFamily (o : Ordinal) (f : β b < o, Ordinal β Ordinal) : Ordinal β Ordinal :=
nfpFamily (familyOfBFamily o f)
#align ordinal.nfp_bfamily Ordinal.nfpBFamily
theorem nfpBFamily_eq_nfpFamily {o : Ordinal} (f : β b < o, Ordinal β Ordinal) :
nfpBFamily.{u, v} o f = nfpFamily.{u, v} (familyOfBFamily o f) :=
rfl
#align ordinal.nfp_bfamily_eq_nfp_family Ordinal.nfpBFamily_eq_nfpFamily
theorem foldr_le_nfpBFamily {o : Ordinal}
(f : β b < o, Ordinal β Ordinal) (a l) :
List.foldr (familyOfBFamily o f) a l β€ nfpBFamily.{u, v} o f a :=
le_sup.{u, v} _ _
#align ordinal.foldr_le_nfp_bfamily Ordinal.foldr_le_nfpBFamily
theorem le_nfpBFamily {o : Ordinal} (f : β b < o, Ordinal β Ordinal) (a) :
a β€ nfpBFamily.{u, v} o f a :=
le_sup.{u, v} _ []
#align ordinal.le_nfp_bfamily Ordinal.le_nfpBFamily
theorem lt_nfpBFamily {a b} :
a < nfpBFamily.{u, v} o f b β β l, a < List.foldr (familyOfBFamily o f) b l :=
lt_sup.{u, v}
#align ordinal.lt_nfp_bfamily Ordinal.lt_nfpBFamily
theorem nfpBFamily_le_iff {o : Ordinal} {f : β b < o, Ordinal β Ordinal} {a b} :
nfpBFamily.{u, v} o f a β€ b β β l, List.foldr (familyOfBFamily o f) a l β€ b :=
sup_le_iff.{u, v}
#align ordinal.nfp_bfamily_le_iff Ordinal.nfpBFamily_le_iff
theorem nfpBFamily_le {o : Ordinal} {f : β b < o, Ordinal β Ordinal} {a b} :
(β l, List.foldr (familyOfBFamily o f) a l β€ b) β nfpBFamily.{u, v} o f a β€ b :=
sup_le.{u, v}
#align ordinal.nfp_bfamily_le Ordinal.nfpBFamily_le
theorem nfpBFamily_monotone (hf : β i hi, Monotone (f i hi)) : Monotone (nfpBFamily.{u, v} o f) :=
nfpFamily_monotone fun _ => hf _ _
#align ordinal.nfp_bfamily_monotone Ordinal.nfpBFamily_monotone
theorem apply_lt_nfpBFamily (H : β i hi, IsNormal (f i hi)) {a b} (hb : b < nfpBFamily.{u, v} o f a)
(i hi) : f i hi b < nfpBFamily.{u, v} o f a := by
rw [β familyOfBFamily_enum o f]
apply apply_lt_nfpFamily (fun _ => H _ _) hb
#align ordinal.apply_lt_nfp_bfamily Ordinal.apply_lt_nfpBFamily
theorem apply_lt_nfpBFamily_iff (ho : o β 0) (H : β i hi, IsNormal (f i hi)) {a b} :
(β i hi, f i hi b < nfpBFamily.{u, v} o f a) β b < nfpBFamily.{u, v} o f a :=
β¨fun h => by
haveI := out_nonempty_iff_ne_zero.2 ho
refine (apply_lt_nfpFamily_iff.{u, v} ?_).1 fun _ => h _ _
exact fun _ => H _ _, apply_lt_nfpBFamily Hβ©
#align ordinal.apply_lt_nfp_bfamily_iff Ordinal.apply_lt_nfpBFamily_iff
theorem nfpBFamily_le_apply (ho : o β 0) (H : β i hi, IsNormal (f i hi)) {a b} :
(β i hi, nfpBFamily.{u, v} o f a β€ f i hi b) β nfpBFamily.{u, v} o f a β€ b := by
rw [β not_iff_not]
push_neg
exact apply_lt_nfpBFamily_iff.{u, v} ho H
#align ordinal.nfp_bfamily_le_apply Ordinal.nfpBFamily_le_apply
theorem nfpBFamily_le_fp (H : β i hi, Monotone (f i hi)) {a b} (ab : a β€ b)
(h : β i hi, f i hi b β€ b) : nfpBFamily.{u, v} o f a β€ b :=
nfpFamily_le_fp (fun _ => H _ _) ab fun _ => h _ _
#align ordinal.nfp_bfamily_le_fp Ordinal.nfpBFamily_le_fp
theorem nfpBFamily_fp {i hi} (H : IsNormal (f i hi)) (a) :
f i hi (nfpBFamily.{u, v} o f a) = nfpBFamily.{u, v} o f a := by
rw [β familyOfBFamily_enum o f]
apply nfpFamily_fp
rw [familyOfBFamily_enum]
exact H
#align ordinal.nfp_bfamily_fp Ordinal.nfpBFamily_fp
theorem apply_le_nfpBFamily (ho : o β 0) (H : β i hi, IsNormal (f i hi)) {a b} :
(β i hi, f i hi b β€ nfpBFamily.{u, v} o f a) β b β€ nfpBFamily.{u, v} o f a := by
refine β¨fun h => ?_, fun h i hi => ?_β©
Β· have ho' : 0 < o := Ordinal.pos_iff_ne_zero.2 ho
exact ((H 0 ho').self_le b).trans (h 0 ho')
Β· rw [β nfpBFamily_fp (H i hi)]
exact (H i hi).monotone h
#align ordinal.apply_le_nfp_bfamily Ordinal.apply_le_nfpBFamily
theorem nfpBFamily_eq_self {a} (h : β i hi, f i hi a = a) : nfpBFamily.{u, v} o f a = a :=
nfpFamily_eq_self fun _ => h _ _
#align ordinal.nfp_bfamily_eq_self Ordinal.nfpBFamily_eq_self
theorem fp_bfamily_unbounded (H : β i hi, IsNormal (f i hi)) :
(β (i) (hi), Function.fixedPoints (f i hi)).Unbounded (Β· < Β·) := fun a =>
β¨nfpBFamily.{u, v} _ f a, by
rw [Set.mem_iInterβ]
exact fun i hi => nfpBFamily_fp (H i hi) _, (le_nfpBFamily f a).not_ltβ©
#align ordinal.fp_bfamily_unbounded Ordinal.fp_bfamily_unbounded
def derivBFamily (o : Ordinal) (f : β b < o, Ordinal β Ordinal) : Ordinal β Ordinal :=
derivFamily (familyOfBFamily o f)
#align ordinal.deriv_bfamily Ordinal.derivBFamily
theorem derivBFamily_eq_derivFamily {o : Ordinal} (f : β b < o, Ordinal β Ordinal) :
derivBFamily.{u, v} o f = derivFamily.{u, v} (familyOfBFamily o f) :=
rfl
#align ordinal.deriv_bfamily_eq_deriv_family Ordinal.derivBFamily_eq_derivFamily
theorem derivBFamily_isNormal {o : Ordinal} (f : β b < o, Ordinal β Ordinal) :
IsNormal (derivBFamily o f) :=
derivFamily_isNormal _
#align ordinal.deriv_bfamily_is_normal Ordinal.derivBFamily_isNormal
theorem derivBFamily_fp {i hi} (H : IsNormal (f i hi)) (a : Ordinal) :
f i hi (derivBFamily.{u, v} o f a) = derivBFamily.{u, v} o f a := by
rw [β familyOfBFamily_enum o f]
apply derivFamily_fp
rw [familyOfBFamily_enum]
exact H
#align ordinal.deriv_bfamily_fp Ordinal.derivBFamily_fp
theorem le_iff_derivBFamily (H : β i hi, IsNormal (f i hi)) {a} :
(β i hi, f i hi a β€ a) β β b, derivBFamily.{u, v} o f b = a := by
unfold derivBFamily
rw [β le_iff_derivFamily]
Β· refine β¨fun h i => h _ _, fun h i hi => ?_β©
rw [β familyOfBFamily_enum o f]
apply h
Β· exact fun _ => H _ _
#align ordinal.le_iff_deriv_bfamily Ordinal.le_iff_derivBFamily
| Mathlib/SetTheory/Ordinal/FixedPoint.lean | 384 | 389 | theorem fp_iff_derivBFamily (H : β i hi, IsNormal (f i hi)) {a} :
(β i hi, f i hi a = a) β β b, derivBFamily.{u, v} o f b = a := by |
rw [β le_iff_derivBFamily H]
refine β¨fun h i hi => le_of_eq (h i hi), fun h i hi => ?_β©
rw [β (H i hi).le_iff_eq]
exact h i hi
|
import Mathlib.MeasureTheory.MeasurableSpace.Basic
import Mathlib.Data.Set.MemPartition
import Mathlib.Order.Filter.CountableSeparatingOn
open Set MeasureTheory
namespace MeasurableSpace
variable {Ξ± Ξ² : Type*}
class CountablyGenerated (Ξ± : Type*) [m : MeasurableSpace Ξ±] : Prop where
isCountablyGenerated : β b : Set (Set Ξ±), b.Countable β§ m = generateFrom b
#align measurable_space.countably_generated MeasurableSpace.CountablyGenerated
def countableGeneratingSet (Ξ± : Type*) [MeasurableSpace Ξ±] [h : CountablyGenerated Ξ±] :
Set (Set Ξ±) :=
insert β
h.isCountablyGenerated.choose
lemma countable_countableGeneratingSet [MeasurableSpace Ξ±] [h : CountablyGenerated Ξ±] :
Set.Countable (countableGeneratingSet Ξ±) :=
Countable.insert _ h.isCountablyGenerated.choose_spec.1
lemma generateFrom_countableGeneratingSet [m : MeasurableSpace Ξ±] [h : CountablyGenerated Ξ±] :
generateFrom (countableGeneratingSet Ξ±) = m :=
(generateFrom_insert_empty _).trans <| h.isCountablyGenerated.choose_spec.2.symm
lemma empty_mem_countableGeneratingSet [MeasurableSpace Ξ±] [CountablyGenerated Ξ±] :
β
β countableGeneratingSet Ξ± := mem_insert _ _
lemma nonempty_countableGeneratingSet [MeasurableSpace Ξ±] [CountablyGenerated Ξ±] :
Set.Nonempty (countableGeneratingSet Ξ±) :=
β¨β
, mem_insert _ _β©
lemma measurableSet_countableGeneratingSet [MeasurableSpace Ξ±] [CountablyGenerated Ξ±]
{s : Set Ξ±} (hs : s β countableGeneratingSet Ξ±) :
MeasurableSet s := by
rw [β generateFrom_countableGeneratingSet (Ξ± := Ξ±)]
exact measurableSet_generateFrom hs
def natGeneratingSequence (Ξ± : Type*) [MeasurableSpace Ξ±] [CountablyGenerated Ξ±] : β β (Set Ξ±) :=
enumerateCountable (countable_countableGeneratingSet (Ξ± := Ξ±)) β
lemma generateFrom_natGeneratingSequence (Ξ± : Type*) [m : MeasurableSpace Ξ±]
[CountablyGenerated Ξ±] : generateFrom (range (natGeneratingSequence _)) = m := by
rw [natGeneratingSequence, range_enumerateCountable_of_mem _ empty_mem_countableGeneratingSet,
generateFrom_countableGeneratingSet]
lemma measurableSet_natGeneratingSequence [MeasurableSpace Ξ±] [CountablyGenerated Ξ±] (n : β) :
MeasurableSet (natGeneratingSequence Ξ± n) :=
measurableSet_countableGeneratingSet $ Set.enumerateCountable_mem _
empty_mem_countableGeneratingSet n
theorem CountablyGenerated.comap [m : MeasurableSpace Ξ²] [h : CountablyGenerated Ξ²] (f : Ξ± β Ξ²) :
@CountablyGenerated Ξ± (.comap f m) := by
rcases h with β¨β¨b, hbc, rflβ©β©
rw [comap_generateFrom]
letI := generateFrom (preimage f '' b)
exact β¨_, hbc.image _, rflβ©
theorem CountablyGenerated.sup {mβ mβ : MeasurableSpace Ξ²} (hβ : @CountablyGenerated Ξ² mβ)
(hβ : @CountablyGenerated Ξ² mβ) : @CountablyGenerated Ξ² (mβ β mβ) := by
rcases hβ with β¨β¨bβ, hbβc, rflβ©β©
rcases hβ with β¨β¨bβ, hbβc, rflβ©β©
exact @mk _ (_ β _) β¨_, hbβc.union hbβc, generateFrom_sup_generateFromβ©
instance (priority := 100) [MeasurableSpace Ξ±] [Countable Ξ±] : CountablyGenerated Ξ± where
isCountablyGenerated := by
refine β¨β y, {measurableAtom y}, countable_iUnion (fun i β¦ countable_singleton _), ?_β©
refine le_antisymm ?_ (generateFrom_le (by simp [MeasurableSet.measurableAtom_of_countable]))
intro s hs
have : s = β y β s, measurableAtom y := by
apply Subset.antisymm
Β· intro x hx
simpa using β¨x, hx, by simpβ©
Β· simp only [iUnion_subset_iff]
intro x hx
exact measurableAtom_subset hs hx
rw [this]
apply MeasurableSet.biUnion (to_countable s) (fun x _hx β¦ ?_)
apply measurableSet_generateFrom
simp
instance [MeasurableSpace Ξ±] [CountablyGenerated Ξ±] {p : Ξ± β Prop} :
CountablyGenerated { x // p x } := .comap _
instance [MeasurableSpace Ξ±] [CountablyGenerated Ξ±] [MeasurableSpace Ξ²] [CountablyGenerated Ξ²] :
CountablyGenerated (Ξ± Γ Ξ²) :=
.sup (.comap Prod.fst) (.comap Prod.snd)
section SeparatesPoints
class SeparatesPoints (Ξ± : Type*) [m : MeasurableSpace Ξ±] : Prop where
separates : β x y : Ξ±, (β s, MeasurableSet s β (x β s β y β s)) β x = y
theorem separatesPoints_def [MeasurableSpace Ξ±] [hs : SeparatesPoints Ξ±] {x y : Ξ±}
(h : β s, MeasurableSet s β (x β s β y β s)) : x = y := hs.separates _ _ h
theorem exists_measurableSet_of_ne [MeasurableSpace Ξ±] [SeparatesPoints Ξ±] {x y : Ξ±}
(h : x β y) : β s, MeasurableSet s β§ x β s β§ y β s := by
contrapose! h
exact separatesPoints_def h
theorem separatesPoints_iff [MeasurableSpace Ξ±] : SeparatesPoints Ξ± β
β x y : Ξ±, (β s, MeasurableSet s β (x β s β y β s)) β x = y :=
β¨fun h β¦ fun _ _ hxy β¦ h.separates _ _ fun _ hs xs β¦ (hxy _ hs).mp xs,
fun h β¦ β¨fun _ _ hxy β¦ h _ _ fun _ hs β¦
β¨fun xs β¦ hxy _ hs xs, not_imp_not.mp fun xs β¦ hxy _ hs.compl xsβ©β©β©
theorem separating_of_generateFrom (S : Set (Set Ξ±))
[h : @SeparatesPoints Ξ± (generateFrom S)] :
β x y : Ξ±, (β s β S, x β s β y β s) β x = y := by
letI := generateFrom S
intros x y hxy
rw [β forall_generateFrom_mem_iff_mem_iff] at hxy
exact separatesPoints_def $ fun _ hs β¦ (hxy _ hs).mp
theorem SeparatesPoints.mono {m m' : MeasurableSpace Ξ±} [hsep : @SeparatesPoints _ m] (h : m β€ m') :
@SeparatesPoints _ m' := @SeparatesPoints.mk _ m' fun _ _ hxy β¦
@SeparatesPoints.separates _ m hsep _ _ fun _ hs β¦ hxy _ (h _ hs)
class CountablySeparated (Ξ± : Type*) [MeasurableSpace Ξ±] : Prop where
countably_separated : HasCountableSeparatingOn Ξ± MeasurableSet univ
instance countablySeparated_of_hasCountableSeparatingOn [MeasurableSpace Ξ±]
[h : HasCountableSeparatingOn Ξ± MeasurableSet univ] : CountablySeparated Ξ± := β¨hβ©
instance hasCountableSeparatingOn_of_countablySeparated [MeasurableSpace Ξ±]
[h : CountablySeparated Ξ±] : HasCountableSeparatingOn Ξ± MeasurableSet univ :=
h.countably_separated
theorem countablySeparated_def [MeasurableSpace Ξ±] :
CountablySeparated Ξ± β HasCountableSeparatingOn Ξ± MeasurableSet univ :=
β¨fun h β¦ h.countably_separated, fun h β¦ β¨hβ©β©
theorem CountablySeparated.mono {m m' : MeasurableSpace Ξ±} [hsep : @CountablySeparated _ m]
(h : m β€ m') : @CountablySeparated _ m' := by
simp_rw [countablySeparated_def] at *
rcases hsep with β¨S, Sct, Smeas, hSβ©
use S, Sct, (fun s hs β¦ h _ <| Smeas _ hs), hS
theorem CountablySeparated.subtype_iff [MeasurableSpace Ξ±] {s : Set Ξ±} :
CountablySeparated s β HasCountableSeparatingOn Ξ± MeasurableSet s := by
rw [countablySeparated_def]
exact HasCountableSeparatingOn.subtype_iff
instance (priority := 100) Subtype.separatesPoints [MeasurableSpace Ξ±] [h : SeparatesPoints Ξ±]
{s : Set Ξ±} : SeparatesPoints s :=
β¨fun _ _ hxy β¦ Subtype.val_injective $ h.1 _ _ fun _ ht β¦ hxy _ $ measurable_subtype_coe htβ©
instance (priority := 100) Subtype.countablySeparated [MeasurableSpace Ξ±]
[h : CountablySeparated Ξ±] {s : Set Ξ±} : CountablySeparated s := by
rw [CountablySeparated.subtype_iff]
exact h.countably_separated.mono (fun s β¦ id) $ subset_univ _
instance (priority := 100) separatesPoints_of_measurableSingletonClass [MeasurableSpace Ξ±]
[MeasurableSingletonClass Ξ±] : SeparatesPoints Ξ± := by
refine β¨fun x y h β¦ ?_β©
specialize h _ (MeasurableSet.singleton x)
simp_rw [mem_singleton_iff, forall_true_left] at h
exact h.symm
instance hasCountableSeparatingOn_of_countablySeparated_subtype
[MeasurableSpace Ξ±] {s : Set Ξ±} [h : CountablySeparated s] :
HasCountableSeparatingOn _ MeasurableSet s := CountablySeparated.subtype_iff.mp h
instance countablySeparated_subtype_of_hasCountableSeparatingOn
[MeasurableSpace Ξ±] {s : Set Ξ±} [h : HasCountableSeparatingOn _ MeasurableSet s] :
CountablySeparated s := CountablySeparated.subtype_iff.mpr h
instance countablySeparated_of_separatesPoints [MeasurableSpace Ξ±]
[h : CountablyGenerated Ξ±] [SeparatesPoints Ξ±] : CountablySeparated Ξ± := by
rcases h with β¨b, hbc, hbβ©
refine β¨β¨b, hbc, fun t ht β¦ hb.symm βΈ .basic t ht, ?_β©β©
rw [hb] at βΉSeparatesPoints _βΊ
convert separating_of_generateFrom b
simp
variable (Ξ±)
theorem exists_countablyGenerated_le_of_countablySeparated [m : MeasurableSpace Ξ±]
[h : CountablySeparated Ξ±] :
β m' : MeasurableSpace Ξ±, @CountablyGenerated _ m' β§ @SeparatesPoints _ m' β§ m' β€ m := by
rcases h with β¨b, bct, hbm, hbβ©
refine β¨generateFrom b, ?_, ?_, generateFrom_le hbmβ©
Β· use b
rw [@separatesPoints_iff]
exact fun x y hxy β¦ hb _ trivial _ trivial fun _ hs β¦ hxy _ $ measurableSet_generateFrom hs
open scoped Classical
open Function
noncomputable
def mapNatBool [MeasurableSpace Ξ±] [CountablyGenerated Ξ±] (x : Ξ±) (n : β) :
Bool := x β natGeneratingSequence Ξ± n
| Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean | 251 | 257 | theorem measurable_mapNatBool [MeasurableSpace Ξ±] [CountablyGenerated Ξ±] :
Measurable (mapNatBool Ξ±) := by |
rw [measurable_pi_iff]
refine fun n β¦ measurable_to_bool ?_
simp only [preimage, mem_singleton_iff, mapNatBool,
Bool.decide_iff, setOf_mem_eq]
apply measurableSet_natGeneratingSequence
|
import Mathlib.Data.Fintype.Option
import Mathlib.Topology.Separation
import Mathlib.Topology.Sets.Opens
#align_import topology.alexandroff from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988"
open Set Filter Topology
variable {X : Type*}
def OnePoint (X : Type*) :=
Option X
#align alexandroff OnePoint
instance [Repr X] : Repr (OnePoint X) :=
β¨fun o _ =>
match o with
| none => "β"
| some a => "β" ++ repr aβ©
namespace OnePoint
@[match_pattern] def infty : OnePoint X := none
#align alexandroff.infty OnePoint.infty
@[inherit_doc]
scoped notation "β" => OnePoint.infty
@[coe, match_pattern] def some : X β OnePoint X := Option.some
instance : CoeTC X (OnePoint X) := β¨someβ©
instance : Inhabited (OnePoint X) := β¨ββ©
instance [Fintype X] : Fintype (OnePoint X) :=
inferInstanceAs (Fintype (Option X))
instance infinite [Infinite X] : Infinite (OnePoint X) :=
inferInstanceAs (Infinite (Option X))
#align alexandroff.infinite OnePoint.infinite
theorem coe_injective : Function.Injective ((β) : X β OnePoint X) :=
Option.some_injective X
#align alexandroff.coe_injective OnePoint.coe_injective
@[norm_cast]
theorem coe_eq_coe {x y : X} : (x : OnePoint X) = y β x = y :=
coe_injective.eq_iff
#align alexandroff.coe_eq_coe OnePoint.coe_eq_coe
@[simp]
theorem coe_ne_infty (x : X) : (x : OnePoint X) β β :=
nofun
#align alexandroff.coe_ne_infty OnePoint.coe_ne_infty
@[simp]
theorem infty_ne_coe (x : X) : β β (x : OnePoint X) :=
nofun
#align alexandroff.infty_ne_coe OnePoint.infty_ne_coe
@[elab_as_elim]
protected def rec {C : OnePoint X β Sort*} (hβ : C β) (hβ : β x : X, C x) :
β z : OnePoint X, C z
| β => hβ
| (x : X) => hβ x
#align alexandroff.rec OnePoint.rec
theorem isCompl_range_coe_infty : IsCompl (range ((β) : X β OnePoint X)) {β} :=
isCompl_range_some_none X
#align alexandroff.is_compl_range_coe_infty OnePoint.isCompl_range_coe_infty
-- Porting note: moved @[simp] to a new lemma
theorem range_coe_union_infty : range ((β) : X β OnePoint X) βͺ {β} = univ :=
range_some_union_none X
#align alexandroff.range_coe_union_infty OnePoint.range_coe_union_infty
@[simp]
theorem insert_infty_range_coe : insert β (range (@some X)) = univ :=
insert_none_range_some _
@[simp]
theorem range_coe_inter_infty : range ((β) : X β OnePoint X) β© {β} = β
:=
range_some_inter_none X
#align alexandroff.range_coe_inter_infty OnePoint.range_coe_inter_infty
@[simp]
theorem compl_range_coe : (range ((β) : X β OnePoint X))αΆ = {β} :=
compl_range_some X
#align alexandroff.compl_range_coe OnePoint.compl_range_coe
theorem compl_infty : ({β}αΆ : Set (OnePoint X)) = range ((β) : X β OnePoint X) :=
(@isCompl_range_coe_infty X).symm.compl_eq
#align alexandroff.compl_infty OnePoint.compl_infty
theorem compl_image_coe (s : Set X) : ((β) '' s : Set (OnePoint X))αΆ = (β) '' sαΆ βͺ {β} := by
rw [coe_injective.compl_image_eq, compl_range_coe]
#align alexandroff.compl_image_coe OnePoint.compl_image_coe
theorem ne_infty_iff_exists {x : OnePoint X} : x β β β β y : X, (y : OnePoint X) = x := by
induction x using OnePoint.rec <;> simp
#align alexandroff.ne_infty_iff_exists OnePoint.ne_infty_iff_exists
instance canLift : CanLift (OnePoint X) X (β) fun x => x β β :=
WithTop.canLift
#align alexandroff.can_lift OnePoint.canLift
theorem not_mem_range_coe_iff {x : OnePoint X} : x β range some β x = β := by
rw [β mem_compl_iff, compl_range_coe, mem_singleton_iff]
#align alexandroff.not_mem_range_coe_iff OnePoint.not_mem_range_coe_iff
theorem infty_not_mem_range_coe : β β range ((β) : X β OnePoint X) :=
not_mem_range_coe_iff.2 rfl
#align alexandroff.infty_not_mem_range_coe OnePoint.infty_not_mem_range_coe
theorem infty_not_mem_image_coe {s : Set X} : β β ((β) : X β OnePoint X) '' s :=
not_mem_subset (image_subset_range _ _) infty_not_mem_range_coe
#align alexandroff.infty_not_mem_image_coe OnePoint.infty_not_mem_image_coe
@[simp]
theorem coe_preimage_infty : ((β) : X β OnePoint X) β»ΒΉ' {β} = β
:= by
ext
simp
#align alexandroff.coe_preimage_infty OnePoint.coe_preimage_infty
variable [TopologicalSpace X]
instance : TopologicalSpace (OnePoint X) where
IsOpen s := (β β s β IsCompact (((β) : X β OnePoint X) β»ΒΉ' s)αΆ) β§
IsOpen (((β) : X β OnePoint X) β»ΒΉ' s)
isOpen_univ := by simp
isOpen_inter s t := by
rintro β¨hms, hsβ© β¨hmt, htβ©
refine β¨?_, hs.inter htβ©
rintro β¨hms', hmt'β©
simpa [compl_inter] using (hms hms').union (hmt hmt')
isOpen_sUnion S ho := by
suffices IsOpen ((β) β»ΒΉ' ββ S : Set X) by
refine β¨?_, thisβ©
rintro β¨s, hsS : s β S, hs : β β sβ©
refine IsCompact.of_isClosed_subset ((ho s hsS).1 hs) this.isClosed_compl ?_
exact compl_subset_compl.mpr (preimage_mono <| subset_sUnion_of_mem hsS)
rw [preimage_sUnion]
exact isOpen_biUnion fun s hs => (ho s hs).2
variable {s : Set (OnePoint X)} {t : Set X}
theorem isOpen_def :
IsOpen s β (β β s β IsCompact ((β) β»ΒΉ' s : Set X)αΆ) β§ IsOpen ((β) β»ΒΉ' s : Set X) :=
Iff.rfl
#align alexandroff.is_open_def OnePoint.isOpen_def
theorem isOpen_iff_of_mem' (h : β β s) :
IsOpen s β IsCompact ((β) β»ΒΉ' s : Set X)αΆ β§ IsOpen ((β) β»ΒΉ' s : Set X) := by
simp [isOpen_def, h]
#align alexandroff.is_open_iff_of_mem' OnePoint.isOpen_iff_of_mem'
theorem isOpen_iff_of_mem (h : β β s) :
IsOpen s β IsClosed ((β) β»ΒΉ' s : Set X)αΆ β§ IsCompact ((β) β»ΒΉ' s : Set X)αΆ := by
simp only [isOpen_iff_of_mem' h, isClosed_compl_iff, and_comm]
#align alexandroff.is_open_iff_of_mem OnePoint.isOpen_iff_of_mem
theorem isOpen_iff_of_not_mem (h : β β s) : IsOpen s β IsOpen ((β) β»ΒΉ' s : Set X) := by
simp [isOpen_def, h]
#align alexandroff.is_open_iff_of_not_mem OnePoint.isOpen_iff_of_not_mem
theorem isClosed_iff_of_mem (h : β β s) : IsClosed s β IsClosed ((β) β»ΒΉ' s : Set X) := by
have : β β sαΆ := fun H => H h
rw [β isOpen_compl_iff, isOpen_iff_of_not_mem this, β isOpen_compl_iff, preimage_compl]
#align alexandroff.is_closed_iff_of_mem OnePoint.isClosed_iff_of_mem
theorem isClosed_iff_of_not_mem (h : β β s) :
IsClosed s β IsClosed ((β) β»ΒΉ' s : Set X) β§ IsCompact ((β) β»ΒΉ' s : Set X) := by
rw [β isOpen_compl_iff, isOpen_iff_of_mem (mem_compl h), β preimage_compl, compl_compl]
#align alexandroff.is_closed_iff_of_not_mem OnePoint.isClosed_iff_of_not_mem
@[simp]
theorem isOpen_image_coe {s : Set X} : IsOpen ((β) '' s : Set (OnePoint X)) β IsOpen s := by
rw [isOpen_iff_of_not_mem infty_not_mem_image_coe, preimage_image_eq _ coe_injective]
#align alexandroff.is_open_image_coe OnePoint.isOpen_image_coe
theorem isOpen_compl_image_coe {s : Set X} :
IsOpen ((β) '' s : Set (OnePoint X))αΆ β IsClosed s β§ IsCompact s := by
rw [isOpen_iff_of_mem, β preimage_compl, compl_compl, preimage_image_eq _ coe_injective]
exact infty_not_mem_image_coe
#align alexandroff.is_open_compl_image_coe OnePoint.isOpen_compl_image_coe
@[simp]
theorem isClosed_image_coe {s : Set X} :
IsClosed ((β) '' s : Set (OnePoint X)) β IsClosed s β§ IsCompact s := by
rw [β isOpen_compl_iff, isOpen_compl_image_coe]
#align alexandroff.is_closed_image_coe OnePoint.isClosed_image_coe
def opensOfCompl (s : Set X) (hβ : IsClosed s) (hβ : IsCompact s) :
TopologicalSpace.Opens (OnePoint X) :=
β¨((β) '' s)αΆ, isOpen_compl_image_coe.2 β¨hβ, hββ©β©
#align alexandroff.opens_of_compl OnePoint.opensOfCompl
theorem infty_mem_opensOfCompl {s : Set X} (hβ : IsClosed s) (hβ : IsCompact s) :
β β opensOfCompl s hβ hβ :=
mem_compl infty_not_mem_image_coe
#align alexandroff.infty_mem_opens_of_compl OnePoint.infty_mem_opensOfCompl
@[continuity]
theorem continuous_coe : Continuous ((β) : X β OnePoint X) :=
continuous_def.mpr fun _s hs => hs.right
#align alexandroff.continuous_coe OnePoint.continuous_coe
theorem isOpenMap_coe : IsOpenMap ((β) : X β OnePoint X) := fun _ => isOpen_image_coe.2
#align alexandroff.is_open_map_coe OnePoint.isOpenMap_coe
theorem openEmbedding_coe : OpenEmbedding ((β) : X β OnePoint X) :=
openEmbedding_of_continuous_injective_open continuous_coe coe_injective isOpenMap_coe
#align alexandroff.open_embedding_coe OnePoint.openEmbedding_coe
theorem isOpen_range_coe : IsOpen (range ((β) : X β OnePoint X)) :=
openEmbedding_coe.isOpen_range
#align alexandroff.is_open_range_coe OnePoint.isOpen_range_coe
theorem isClosed_infty : IsClosed ({β} : Set (OnePoint X)) := by
rw [β compl_range_coe, isClosed_compl_iff]
exact isOpen_range_coe
#align alexandroff.is_closed_infty OnePoint.isClosed_infty
theorem nhds_coe_eq (x : X) : π βx = map ((β) : X β OnePoint X) (π x) :=
(openEmbedding_coe.map_nhds_eq x).symm
#align alexandroff.nhds_coe_eq OnePoint.nhds_coe_eq
theorem nhdsWithin_coe_image (s : Set X) (x : X) :
π[(β) '' s] (x : OnePoint X) = map (β) (π[s] x) :=
(openEmbedding_coe.toEmbedding.map_nhdsWithin_eq _ _).symm
#align alexandroff.nhds_within_coe_image OnePoint.nhdsWithin_coe_image
theorem nhdsWithin_coe (s : Set (OnePoint X)) (x : X) : π[s] βx = map (β) (π[(β) β»ΒΉ' s] x) :=
(openEmbedding_coe.map_nhdsWithin_preimage_eq _ _).symm
#align alexandroff.nhds_within_coe OnePoint.nhdsWithin_coe
theorem comap_coe_nhds (x : X) : comap ((β) : X β OnePoint X) (π x) = π x :=
(openEmbedding_coe.toInducing.nhds_eq_comap x).symm
#align alexandroff.comap_coe_nhds OnePoint.comap_coe_nhds
instance nhdsWithin_compl_coe_neBot (x : X) [h : NeBot (π[β ] x)] :
NeBot (π[β ] (x : OnePoint X)) := by
simpa [nhdsWithin_coe, preimage, coe_eq_coe] using h.map some
#align alexandroff.nhds_within_compl_coe_ne_bot OnePoint.nhdsWithin_compl_coe_neBot
| Mathlib/Topology/Compactification/OnePoint.lean | 308 | 315 | theorem nhdsWithin_compl_infty_eq : π[β ] (β : OnePoint X) = map (β) (coclosedCompact X) := by |
refine (nhdsWithin_basis_open β _).ext (hasBasis_coclosedCompact.map _) ?_ ?_
Β· rintro s β¨hs, hsoβ©
refine β¨_, (isOpen_iff_of_mem hs).mp hso, ?_β©
simp [Subset.rfl]
Β· rintro s β¨hβ, hββ©
refine β¨_, β¨mem_compl infty_not_mem_image_coe, isOpen_compl_image_coe.2 β¨hβ, hββ©β©, ?_β©
simp [compl_image_coe, β diff_eq, subset_preimage_image]
|
import Mathlib.Probability.ProbabilityMassFunction.Monad
#align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d"
universe u
namespace PMF
noncomputable section
variable {Ξ± Ξ² Ξ³ : Type*}
open scoped Classical
open NNReal ENNReal
section Map
def map (f : Ξ± β Ξ²) (p : PMF Ξ±) : PMF Ξ² :=
bind p (pure β f)
#align pmf.map PMF.map
variable (f : Ξ± β Ξ²) (p : PMF Ξ±) (b : Ξ²)
theorem monad_map_eq_map {Ξ± Ξ² : Type u} (f : Ξ± β Ξ²) (p : PMF Ξ±) : f <$> p = p.map f := rfl
#align pmf.monad_map_eq_map PMF.monad_map_eq_map
@[simp]
theorem map_apply : (map f p) b = β' a, if b = f a then p a else 0 := by simp [map]
#align pmf.map_apply PMF.map_apply
@[simp]
theorem support_map : (map f p).support = f '' p.support :=
Set.ext fun b => by simp [map, @eq_comm Ξ² b]
#align pmf.support_map PMF.support_map
theorem mem_support_map_iff : b β (map f p).support β β a β p.support, f a = b := by simp
#align pmf.mem_support_map_iff PMF.mem_support_map_iff
theorem bind_pure_comp : bind p (pure β f) = map f p := rfl
#align pmf.bind_pure_comp PMF.bind_pure_comp
theorem map_id : map id p = p :=
bind_pure _
#align pmf.map_id PMF.map_id
theorem map_comp (g : Ξ² β Ξ³) : (p.map f).map g = p.map (g β f) := by simp [map, Function.comp]
#align pmf.map_comp PMF.map_comp
theorem pure_map (a : Ξ±) : (pure a).map f = pure (f a) :=
pure_bind _ _
#align pmf.pure_map PMF.pure_map
theorem map_bind (q : Ξ± β PMF Ξ²) (f : Ξ² β Ξ³) : (p.bind q).map f = p.bind fun a => (q a).map f :=
bind_bind _ _ _
#align pmf.map_bind PMF.map_bind
@[simp]
theorem bind_map (p : PMF Ξ±) (f : Ξ± β Ξ²) (q : Ξ² β PMF Ξ³) : (p.map f).bind q = p.bind (q β f) :=
(bind_bind _ _ _).trans (congr_arg _ (funext fun _ => pure_bind _ _))
#align pmf.bind_map PMF.bind_map
@[simp]
theorem map_const : p.map (Function.const Ξ± b) = pure b := by
simp only [map, Function.comp, bind_const, Function.const]
#align pmf.map_const PMF.map_const
instance : LawfulFunctor PMF where
map_const := rfl
id_map := bind_pure
comp_map _ _ _ := (map_comp _ _ _).symm
instance : LawfulMonad PMF := LawfulMonad.mk'
(bind_pure_comp := fun f x => rfl)
(id_map := id_map)
(pure_bind := pure_bind)
(bind_assoc := bind_bind)
section OfFinset
def ofFinset (f : Ξ± β ββ₯0β) (s : Finset Ξ±) (h : β a β s, f a = 1)
(h' : β (a) (_ : a β s), f a = 0) : PMF Ξ± :=
β¨f, h βΈ hasSum_sum_of_ne_finset_zero h'β©
#align pmf.of_finset PMF.ofFinset
variable {f : Ξ± β ββ₯0β} {s : Finset Ξ±} (h : β a β s, f a = 1) (h' : β (a) (_ : a β s), f a = 0)
@[simp]
theorem ofFinset_apply (a : Ξ±) : ofFinset f s h h' a = f a := rfl
#align pmf.of_finset_apply PMF.ofFinset_apply
@[simp]
theorem support_ofFinset : (ofFinset f s h h').support = βs β© Function.support f :=
Set.ext fun a => by simpa [mem_support_iff] using mt (h' a)
#align pmf.support_of_finset PMF.support_ofFinset
| Mathlib/Probability/ProbabilityMassFunction/Constructions.lean | 172 | 173 | theorem mem_support_ofFinset_iff (a : Ξ±) : a β (ofFinset f s h h').support β a β s β§ f a β 0 := by |
simp
|
import Mathlib.MeasureTheory.Measure.Content
import Mathlib.MeasureTheory.Group.Prod
import Mathlib.Topology.Algebra.Group.Compact
#align_import measure_theory.measure.haar.basic from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
noncomputable section
open Set Inv Function TopologicalSpace MeasurableSpace
open scoped NNReal Classical ENNReal Pointwise Topology
namespace MeasureTheory
namespace Measure
section Group
variable {G : Type*} [Group G]
namespace haar
-- Porting note: Even in `noncomputable section`, a definition with `to_additive` require
-- `noncomputable` to generate an additive definition.
-- Please refer to leanprover/lean4#2077.
@[to_additive addIndex "additive version of `MeasureTheory.Measure.haar.index`"]
noncomputable def index (K V : Set G) : β :=
sInf <| Finset.card '' { t : Finset G | K β β g β t, (fun h => g * h) β»ΒΉ' V }
#align measure_theory.measure.haar.index MeasureTheory.Measure.haar.index
#align measure_theory.measure.haar.add_index MeasureTheory.Measure.haar.addIndex
@[to_additive addIndex_empty]
theorem index_empty {V : Set G} : index β
V = 0 := by
simp only [index, Nat.sInf_eq_zero]; left; use β
simp only [Finset.card_empty, empty_subset, mem_setOf_eq, eq_self_iff_true, and_self_iff]
#align measure_theory.measure.haar.index_empty MeasureTheory.Measure.haar.index_empty
#align measure_theory.measure.haar.add_index_empty MeasureTheory.Measure.haar.addIndex_empty
variable [TopologicalSpace G]
@[to_additive "additive version of `MeasureTheory.Measure.haar.prehaar`"]
noncomputable def prehaar (Kβ U : Set G) (K : Compacts G) : β :=
(index (K : Set G) U : β) / index Kβ U
#align measure_theory.measure.haar.prehaar MeasureTheory.Measure.haar.prehaar
#align measure_theory.measure.haar.add_prehaar MeasureTheory.Measure.haar.addPrehaar
@[to_additive]
theorem prehaar_empty (Kβ : PositiveCompacts G) {U : Set G} : prehaar (Kβ : Set G) U β₯ = 0 := by
rw [prehaar, Compacts.coe_bot, index_empty, Nat.cast_zero, zero_div]
#align measure_theory.measure.haar.prehaar_empty MeasureTheory.Measure.haar.prehaar_empty
#align measure_theory.measure.haar.add_prehaar_empty MeasureTheory.Measure.haar.addPrehaar_empty
@[to_additive]
theorem prehaar_nonneg (Kβ : PositiveCompacts G) {U : Set G} (K : Compacts G) :
0 β€ prehaar (Kβ : Set G) U K := by apply div_nonneg <;> norm_cast <;> apply zero_le
#align measure_theory.measure.haar.prehaar_nonneg MeasureTheory.Measure.haar.prehaar_nonneg
#align measure_theory.measure.haar.add_prehaar_nonneg MeasureTheory.Measure.haar.addPrehaar_nonneg
@[to_additive "additive version of `MeasureTheory.Measure.haar.haarProduct`"]
def haarProduct (Kβ : Set G) : Set (Compacts G β β) :=
pi univ fun K => Icc 0 <| index (K : Set G) Kβ
#align measure_theory.measure.haar.haar_product MeasureTheory.Measure.haar.haarProduct
#align measure_theory.measure.haar.add_haar_product MeasureTheory.Measure.haar.addHaarProduct
@[to_additive (attr := simp)]
theorem mem_prehaar_empty {Kβ : Set G} {f : Compacts G β β} :
f β haarProduct Kβ β β K : Compacts G, f K β Icc (0 : β) (index (K : Set G) Kβ) := by
simp only [haarProduct, Set.pi, forall_prop_of_true, mem_univ, mem_setOf_eq]
#align measure_theory.measure.haar.mem_prehaar_empty MeasureTheory.Measure.haar.mem_prehaar_empty
#align measure_theory.measure.haar.mem_add_prehaar_empty MeasureTheory.Measure.haar.mem_addPrehaar_empty
@[to_additive "additive version of `MeasureTheory.Measure.haar.clPrehaar`"]
def clPrehaar (Kβ : Set G) (V : OpenNhdsOf (1 : G)) : Set (Compacts G β β) :=
closure <| prehaar Kβ '' { U : Set G | U β V.1 β§ IsOpen U β§ (1 : G) β U }
#align measure_theory.measure.haar.cl_prehaar MeasureTheory.Measure.haar.clPrehaar
#align measure_theory.measure.haar.cl_add_prehaar MeasureTheory.Measure.haar.clAddPrehaar
variable [TopologicalGroup G]
@[to_additive addIndex_defined
"If `K` is compact and `V` has nonempty interior, then the index `(K : V)` is well-defined, there is
a finite set `t` satisfying the desired properties."]
theorem index_defined {K V : Set G} (hK : IsCompact K) (hV : (interior V).Nonempty) :
β n : β, n β Finset.card '' { t : Finset G | K β β g β t, (fun h => g * h) β»ΒΉ' V } := by
rcases compact_covered_by_mul_left_translates hK hV with β¨t, htβ©; exact β¨t.card, t, ht, rflβ©
#align measure_theory.measure.haar.index_defined MeasureTheory.Measure.haar.index_defined
#align measure_theory.measure.haar.add_index_defined MeasureTheory.Measure.haar.addIndex_defined
@[to_additive addIndex_elim]
| Mathlib/MeasureTheory/Measure/Haar/Basic.lean | 178 | 180 | theorem index_elim {K V : Set G} (hK : IsCompact K) (hV : (interior V).Nonempty) :
β t : Finset G, (K β β g β t, (fun h => g * h) β»ΒΉ' V) β§ Finset.card t = index K V := by |
have := Nat.sInf_mem (index_defined hK hV); rwa [mem_image] at this
|
import Mathlib.Topology.Sets.Opens
#align_import topology.sets.closeds from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988"
open Order OrderDual Set
variable {ΞΉ Ξ± Ξ² : Type*} [TopologicalSpace Ξ±] [TopologicalSpace Ξ²]
namespace TopologicalSpace
structure Closeds (Ξ± : Type*) [TopologicalSpace Ξ±] where
carrier : Set Ξ±
closed' : IsClosed carrier
#align topological_space.closeds TopologicalSpace.Closeds
namespace Closeds
instance : SetLike (Closeds Ξ±) Ξ± where
coe := Closeds.carrier
coe_injective' s t h := by cases s; cases t; congr
instance : CanLift (Set Ξ±) (Closeds Ξ±) (β) IsClosed where
prf s hs := β¨β¨s, hsβ©, rflβ©
theorem closed (s : Closeds Ξ±) : IsClosed (s : Set Ξ±) :=
s.closed'
#align topological_space.closeds.closed TopologicalSpace.Closeds.closed
def Simps.coe (s : Closeds Ξ±) : Set Ξ± := s
initialize_simps_projections Closeds (carrier β coe, as_prefix coe)
@[ext]
protected theorem ext {s t : Closeds Ξ±} (h : (s : Set Ξ±) = t) : s = t :=
SetLike.ext' h
#align topological_space.closeds.ext TopologicalSpace.Closeds.ext
@[simp]
theorem coe_mk (s : Set Ξ±) (h) : (mk s h : Set Ξ±) = s :=
rfl
#align topological_space.closeds.coe_mk TopologicalSpace.Closeds.coe_mk
@[simps]
protected def closure (s : Set Ξ±) : Closeds Ξ± :=
β¨closure s, isClosed_closureβ©
#align topological_space.closeds.closure TopologicalSpace.Closeds.closure
theorem gc : GaloisConnection Closeds.closure ((β) : Closeds Ξ± β Set Ξ±) := fun _ U =>
β¨subset_closure.trans, fun h => closure_minimal h U.closedβ©
#align topological_space.closeds.gc TopologicalSpace.Closeds.gc
def gi : GaloisInsertion (@Closeds.closure Ξ± _) (β) where
choice s hs := β¨s, closure_eq_iff_isClosed.1 <| hs.antisymm subset_closureβ©
gc := gc
le_l_u _ := subset_closure
choice_eq _s hs := SetLike.coe_injective <| subset_closure.antisymm hs
#align topological_space.closeds.gi TopologicalSpace.Closeds.gi
instance completeLattice : CompleteLattice (Closeds Ξ±) :=
CompleteLattice.copy
(GaloisInsertion.liftCompleteLattice gi)
-- le
_ rfl
-- top
β¨univ, isClosed_univβ© rfl
-- bot
β¨β
, isClosed_emptyβ© (SetLike.coe_injective closure_empty.symm)
-- sup
(fun s t => β¨s βͺ t, s.2.union t.2β©)
(funext fun s => funext fun t => SetLike.coe_injective (s.2.union t.2).closure_eq.symm)
-- inf
(fun s t => β¨s β© t, s.2.inter t.2β©) rfl
-- sSup
_ rfl
-- sInf
(fun S => β¨β s β S, βs, isClosed_biInter fun s _ => s.2β©)
(funext fun _ => SetLike.coe_injective sInf_image.symm)
instance : Inhabited (Closeds Ξ±) :=
β¨β₯β©
@[simp, norm_cast]
theorem coe_sup (s t : Closeds Ξ±) : (β(s β t) : Set Ξ±) = βs βͺ βt := by
rfl
#align topological_space.closeds.coe_sup TopologicalSpace.Closeds.coe_sup
@[simp, norm_cast]
theorem coe_inf (s t : Closeds Ξ±) : (β(s β t) : Set Ξ±) = βs β© βt :=
rfl
#align topological_space.closeds.coe_inf TopologicalSpace.Closeds.coe_inf
@[simp, norm_cast]
theorem coe_top : (β(β€ : Closeds Ξ±) : Set Ξ±) = univ :=
rfl
#align topological_space.closeds.coe_top TopologicalSpace.Closeds.coe_top
@[simp, norm_cast] -- Porting note (#10756): new theorem
theorem coe_eq_univ {s : Closeds Ξ±} : (s : Set Ξ±) = univ β s = β€ :=
SetLike.coe_injective.eq_iff' rfl
@[simp, norm_cast]
theorem coe_bot : (β(β₯ : Closeds Ξ±) : Set Ξ±) = β
:=
rfl
#align topological_space.closeds.coe_bot TopologicalSpace.Closeds.coe_bot
@[simp, norm_cast] -- Porting note (#10756): new theorem
theorem coe_eq_empty {s : Closeds Ξ±} : (s : Set Ξ±) = β
β s = β₯ :=
SetLike.coe_injective.eq_iff' rfl
theorem coe_nonempty {s : Closeds Ξ±} : (s : Set Ξ±).Nonempty β s β β₯ :=
nonempty_iff_ne_empty.trans coe_eq_empty.not
@[simp, norm_cast]
theorem coe_sInf {S : Set (Closeds Ξ±)} : (β(sInf S) : Set Ξ±) = β i β S, βi :=
rfl
#align topological_space.closeds.coe_Inf TopologicalSpace.Closeds.coe_sInf
@[simp]
lemma coe_sSup {S : Set (Closeds Ξ±)} : ((sSup S : Closeds Ξ±) : Set Ξ±) =
closure (ββ ((β) '' S)) := by rfl
@[simp, norm_cast]
theorem coe_finset_sup (f : ΞΉ β Closeds Ξ±) (s : Finset ΞΉ) :
(β(s.sup f) : Set Ξ±) = s.sup ((β) β f) :=
map_finset_sup (β¨β¨(β), coe_supβ©, coe_botβ© : SupBotHom (Closeds Ξ±) (Set Ξ±)) _ _
#align topological_space.closeds.coe_finset_sup TopologicalSpace.Closeds.coe_finset_sup
@[simp, norm_cast]
theorem coe_finset_inf (f : ΞΉ β Closeds Ξ±) (s : Finset ΞΉ) :
(β(s.inf f) : Set Ξ±) = s.inf ((β) β f) :=
map_finset_inf (β¨β¨(β), coe_infβ©, coe_topβ© : InfTopHom (Closeds Ξ±) (Set Ξ±)) _ _
#align topological_space.closeds.coe_finset_inf TopologicalSpace.Closeds.coe_finset_inf
-- Porting note: Lean 3 proofs didn't work as expected, so I reordered lemmas to fix&golf the proofs
@[simp]
theorem mem_sInf {S : Set (Closeds Ξ±)} {x : Ξ±} : x β sInf S β β s β S, x β s := mem_iInterβ
#align topological_space.closeds.mem_Inf TopologicalSpace.Closeds.mem_sInf
@[simp]
| Mathlib/Topology/Sets/Closeds.lean | 168 | 168 | theorem mem_iInf {ΞΉ} {x : Ξ±} {s : ΞΉ β Closeds Ξ±} : x β iInf s β β i, x β s i := by | simp [iInf]
|
import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear
import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm
import Mathlib.Analysis.NormedSpace.Span
suppress_compilation
open Bornology
open Filter hiding map_smul
open scoped Classical NNReal Topology Uniformity
-- the `β` subscript variables are for special cases about linear (as opposed to semilinear) maps
variable {π πβ πβ E Eβ F Fβ G Gβ π : Type*}
section Normed
variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
[NormedAddCommGroup Fβ]
open Metric ContinuousLinearMap
section
variable [NontriviallyNormedField π] [NontriviallyNormedField πβ] [NontriviallyNormedField πβ]
[NormedSpace π E] [NormedSpace πβ F] [NormedSpace πβ G] [NormedSpace π Fβ] (c : π)
{Οββ : π β+* πβ} {Οββ : πβ β+* πβ} (f g : E βSL[Οββ] F) (x y z : E)
namespace LinearMap
theorem bound_of_shell [RingHomIsometric Οββ] (f : E βββ[Οββ] F) {Ξ΅ C : β} (Ξ΅_pos : 0 < Ξ΅) {c : π}
(hc : 1 < βcβ) (hf : β x, Ξ΅ / βcβ β€ βxβ β βxβ < Ξ΅ β βf xβ β€ C * βxβ) (x : E) :
βf xβ β€ C * βxβ := by
by_cases hx : x = 0; Β· simp [hx]
exact SemilinearMapClass.bound_of_shell_semi_normed f Ξ΅_pos hc hf (norm_ne_zero_iff.2 hx)
#align linear_map.bound_of_shell LinearMap.bound_of_shell
| Mathlib/Analysis/NormedSpace/OperatorNorm/NormedSpace.lean | 52 | 64 | theorem bound_of_ball_bound {r : β} (r_pos : 0 < r) (c : β) (f : E ββ[π] Fβ)
(h : β z β Metric.ball (0 : E) r, βf zβ β€ c) : β C, β z : E, βf zβ β€ C * βzβ := by |
cases' @NontriviallyNormedField.non_trivial π _ with k hk
use c * (βkβ / r)
intro z
refine bound_of_shell _ r_pos hk (fun x hko hxo => ?_) _
calc
βf xβ β€ c := h _ (mem_ball_zero_iff.mpr hxo)
_ β€ c * (βxβ * βkβ / r) := le_mul_of_one_le_right ?_ ?_
_ = _ := by ring
Β· exact le_trans (norm_nonneg _) (h 0 (by simp [r_pos]))
Β· rw [div_le_iff (zero_lt_one.trans hk)] at hko
exact (one_le_div r_pos).mpr hko
|
import Mathlib.CategoryTheory.Comma.Over
import Mathlib.CategoryTheory.DiscreteCategory
import Mathlib.CategoryTheory.EpiMono
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
#align_import category_theory.limits.shapes.binary_products from "leanprover-community/mathlib"@"fec1d95fc61c750c1ddbb5b1f7f48b8e811a80d7"
noncomputable section
universe v u uβ
open CategoryTheory
namespace CategoryTheory.Limits
inductive WalkingPair : Type
| left
| right
deriving DecidableEq, Inhabited
#align category_theory.limits.walking_pair CategoryTheory.Limits.WalkingPair
open WalkingPair
def WalkingPair.swap : WalkingPair β WalkingPair where
toFun j := WalkingPair.recOn j right left
invFun j := WalkingPair.recOn j right left
left_inv j := by cases j; repeat rfl
right_inv j := by cases j; repeat rfl
#align category_theory.limits.walking_pair.swap CategoryTheory.Limits.WalkingPair.swap
@[simp]
theorem WalkingPair.swap_apply_left : WalkingPair.swap left = right :=
rfl
#align category_theory.limits.walking_pair.swap_apply_left CategoryTheory.Limits.WalkingPair.swap_apply_left
@[simp]
theorem WalkingPair.swap_apply_right : WalkingPair.swap right = left :=
rfl
#align category_theory.limits.walking_pair.swap_apply_right CategoryTheory.Limits.WalkingPair.swap_apply_right
@[simp]
theorem WalkingPair.swap_symm_apply_tt : WalkingPair.swap.symm left = right :=
rfl
#align category_theory.limits.walking_pair.swap_symm_apply_tt CategoryTheory.Limits.WalkingPair.swap_symm_apply_tt
@[simp]
theorem WalkingPair.swap_symm_apply_ff : WalkingPair.swap.symm right = left :=
rfl
#align category_theory.limits.walking_pair.swap_symm_apply_ff CategoryTheory.Limits.WalkingPair.swap_symm_apply_ff
def WalkingPair.equivBool : WalkingPair β Bool where
toFun j := WalkingPair.recOn j true false
-- to match equiv.sum_equiv_sigma_bool
invFun b := Bool.recOn b right left
left_inv j := by cases j; repeat rfl
right_inv b := by cases b; repeat rfl
#align category_theory.limits.walking_pair.equiv_bool CategoryTheory.Limits.WalkingPair.equivBool
@[simp]
theorem WalkingPair.equivBool_apply_left : WalkingPair.equivBool left = true :=
rfl
#align category_theory.limits.walking_pair.equiv_bool_apply_left CategoryTheory.Limits.WalkingPair.equivBool_apply_left
@[simp]
theorem WalkingPair.equivBool_apply_right : WalkingPair.equivBool right = false :=
rfl
#align category_theory.limits.walking_pair.equiv_bool_apply_right CategoryTheory.Limits.WalkingPair.equivBool_apply_right
@[simp]
theorem WalkingPair.equivBool_symm_apply_true : WalkingPair.equivBool.symm true = left :=
rfl
#align category_theory.limits.walking_pair.equiv_bool_symm_apply_tt CategoryTheory.Limits.WalkingPair.equivBool_symm_apply_true
@[simp]
theorem WalkingPair.equivBool_symm_apply_false : WalkingPair.equivBool.symm false = right :=
rfl
#align category_theory.limits.walking_pair.equiv_bool_symm_apply_ff CategoryTheory.Limits.WalkingPair.equivBool_symm_apply_false
variable {C : Type u}
def pairFunction (X Y : C) : WalkingPair β C := fun j => WalkingPair.casesOn j X Y
#align category_theory.limits.pair_function CategoryTheory.Limits.pairFunction
@[simp]
theorem pairFunction_left (X Y : C) : pairFunction X Y left = X :=
rfl
#align category_theory.limits.pair_function_left CategoryTheory.Limits.pairFunction_left
@[simp]
theorem pairFunction_right (X Y : C) : pairFunction X Y right = Y :=
rfl
#align category_theory.limits.pair_function_right CategoryTheory.Limits.pairFunction_right
variable [Category.{v} C]
def pair (X Y : C) : Discrete WalkingPair β₯€ C :=
Discrete.functor fun j => WalkingPair.casesOn j X Y
#align category_theory.limits.pair CategoryTheory.Limits.pair
@[simp]
theorem pair_obj_left (X Y : C) : (pair X Y).obj β¨leftβ© = X :=
rfl
#align category_theory.limits.pair_obj_left CategoryTheory.Limits.pair_obj_left
@[simp]
theorem pair_obj_right (X Y : C) : (pair X Y).obj β¨rightβ© = Y :=
rfl
#align category_theory.limits.pair_obj_right CategoryTheory.Limits.pair_obj_right
section
variable {F G : Discrete WalkingPair β₯€ C} (f : F.obj β¨leftβ© βΆ G.obj β¨leftβ©)
(g : F.obj β¨rightβ© βΆ G.obj β¨rightβ©)
attribute [local aesop safe tactic (rule_sets := [CategoryTheory])]
CategoryTheory.Discrete.discreteCases
def mapPair : F βΆ G where
app j := Discrete.recOn j fun j => WalkingPair.casesOn j f g
naturality := fun β¨Xβ© β¨Yβ© β¨β¨uβ©β© => by aesop_cat
#align category_theory.limits.map_pair CategoryTheory.Limits.mapPair
@[simp]
theorem mapPair_left : (mapPair f g).app β¨leftβ© = f :=
rfl
#align category_theory.limits.map_pair_left CategoryTheory.Limits.mapPair_left
@[simp]
theorem mapPair_right : (mapPair f g).app β¨rightβ© = g :=
rfl
#align category_theory.limits.map_pair_right CategoryTheory.Limits.mapPair_right
@[simps!]
def mapPairIso (f : F.obj β¨leftβ© β
G.obj β¨leftβ©) (g : F.obj β¨rightβ© β
G.obj β¨rightβ©) : F β
G :=
NatIso.ofComponents (fun j => Discrete.recOn j fun j => WalkingPair.casesOn j f g)
(fun β¨β¨uβ©β© => by aesop_cat)
#align category_theory.limits.map_pair_iso CategoryTheory.Limits.mapPairIso
end
@[simps!]
def diagramIsoPair (F : Discrete WalkingPair β₯€ C) :
F β
pair (F.obj β¨WalkingPair.leftβ©) (F.obj β¨WalkingPair.rightβ©) :=
mapPairIso (Iso.refl _) (Iso.refl _)
#align category_theory.limits.diagram_iso_pair CategoryTheory.Limits.diagramIsoPair
section
variable {D : Type u} [Category.{v} D]
def pairComp (X Y : C) (F : C β₯€ D) : pair X Y β F β
pair (F.obj X) (F.obj Y) :=
diagramIsoPair _
#align category_theory.limits.pair_comp CategoryTheory.Limits.pairComp
end
abbrev BinaryFan (X Y : C) :=
Cone (pair X Y)
#align category_theory.limits.binary_fan CategoryTheory.Limits.BinaryFan
abbrev BinaryFan.fst {X Y : C} (s : BinaryFan X Y) :=
s.Ο.app β¨WalkingPair.leftβ©
#align category_theory.limits.binary_fan.fst CategoryTheory.Limits.BinaryFan.fst
abbrev BinaryFan.snd {X Y : C} (s : BinaryFan X Y) :=
s.Ο.app β¨WalkingPair.rightβ©
#align category_theory.limits.binary_fan.snd CategoryTheory.Limits.BinaryFan.snd
@[simp]
theorem BinaryFan.Ο_app_left {X Y : C} (s : BinaryFan X Y) : s.Ο.app β¨WalkingPair.leftβ© = s.fst :=
rfl
#align category_theory.limits.binary_fan.Ο_app_left CategoryTheory.Limits.BinaryFan.Ο_app_left
@[simp]
theorem BinaryFan.Ο_app_right {X Y : C} (s : BinaryFan X Y) : s.Ο.app β¨WalkingPair.rightβ© = s.snd :=
rfl
#align category_theory.limits.binary_fan.Ο_app_right CategoryTheory.Limits.BinaryFan.Ο_app_right
def BinaryFan.IsLimit.mk {X Y : C} (s : BinaryFan X Y)
(lift : β {T : C} (_ : T βΆ X) (_ : T βΆ Y), T βΆ s.pt)
(hlβ : β {T : C} (f : T βΆ X) (g : T βΆ Y), lift f g β« s.fst = f)
(hlβ : β {T : C} (f : T βΆ X) (g : T βΆ Y), lift f g β« s.snd = g)
(uniq :
β {T : C} (f : T βΆ X) (g : T βΆ Y) (m : T βΆ s.pt) (_ : m β« s.fst = f) (_ : m β« s.snd = g),
m = lift f g) :
IsLimit s :=
Limits.IsLimit.mk (fun t => lift (BinaryFan.fst t) (BinaryFan.snd t))
(by
rintro t (rfl | rfl)
Β· exact hlβ _ _
Β· exact hlβ _ _)
fun t m h => uniq _ _ _ (h β¨WalkingPair.leftβ©) (h β¨WalkingPair.rightβ©)
#align category_theory.limits.binary_fan.is_limit.mk CategoryTheory.Limits.BinaryFan.IsLimit.mk
theorem BinaryFan.IsLimit.hom_ext {W X Y : C} {s : BinaryFan X Y} (h : IsLimit s) {f g : W βΆ s.pt}
(hβ : f β« s.fst = g β« s.fst) (hβ : f β« s.snd = g β« s.snd) : f = g :=
h.hom_ext fun j => Discrete.recOn j fun j => WalkingPair.casesOn j hβ hβ
#align category_theory.limits.binary_fan.is_limit.hom_ext CategoryTheory.Limits.BinaryFan.IsLimit.hom_ext
abbrev BinaryCofan (X Y : C) := Cocone (pair X Y)
#align category_theory.limits.binary_cofan CategoryTheory.Limits.BinaryCofan
abbrev BinaryCofan.inl {X Y : C} (s : BinaryCofan X Y) := s.ΞΉ.app β¨WalkingPair.leftβ©
#align category_theory.limits.binary_cofan.inl CategoryTheory.Limits.BinaryCofan.inl
abbrev BinaryCofan.inr {X Y : C} (s : BinaryCofan X Y) := s.ΞΉ.app β¨WalkingPair.rightβ©
#align category_theory.limits.binary_cofan.inr CategoryTheory.Limits.BinaryCofan.inr
@[simp]
theorem BinaryCofan.ΞΉ_app_left {X Y : C} (s : BinaryCofan X Y) :
s.ΞΉ.app β¨WalkingPair.leftβ© = s.inl := rfl
#align category_theory.limits.binary_cofan.ΞΉ_app_left CategoryTheory.Limits.BinaryCofan.ΞΉ_app_left
@[simp]
theorem BinaryCofan.ΞΉ_app_right {X Y : C} (s : BinaryCofan X Y) :
s.ΞΉ.app β¨WalkingPair.rightβ© = s.inr := rfl
#align category_theory.limits.binary_cofan.ΞΉ_app_right CategoryTheory.Limits.BinaryCofan.ΞΉ_app_right
def BinaryCofan.IsColimit.mk {X Y : C} (s : BinaryCofan X Y)
(desc : β {T : C} (_ : X βΆ T) (_ : Y βΆ T), s.pt βΆ T)
(hdβ : β {T : C} (f : X βΆ T) (g : Y βΆ T), s.inl β« desc f g = f)
(hdβ : β {T : C} (f : X βΆ T) (g : Y βΆ T), s.inr β« desc f g = g)
(uniq :
β {T : C} (f : X βΆ T) (g : Y βΆ T) (m : s.pt βΆ T) (_ : s.inl β« m = f) (_ : s.inr β« m = g),
m = desc f g) :
IsColimit s :=
Limits.IsColimit.mk (fun t => desc (BinaryCofan.inl t) (BinaryCofan.inr t))
(by
rintro t (rfl | rfl)
Β· exact hdβ _ _
Β· exact hdβ _ _)
fun t m h => uniq _ _ _ (h β¨WalkingPair.leftβ©) (h β¨WalkingPair.rightβ©)
#align category_theory.limits.binary_cofan.is_colimit.mk CategoryTheory.Limits.BinaryCofan.IsColimit.mk
theorem BinaryCofan.IsColimit.hom_ext {W X Y : C} {s : BinaryCofan X Y} (h : IsColimit s)
{f g : s.pt βΆ W} (hβ : s.inl β« f = s.inl β« g) (hβ : s.inr β« f = s.inr β« g) : f = g :=
h.hom_ext fun j => Discrete.recOn j fun j => WalkingPair.casesOn j hβ hβ
#align category_theory.limits.binary_cofan.is_colimit.hom_ext CategoryTheory.Limits.BinaryCofan.IsColimit.hom_ext
variable {X Y : C}
section
attribute [local aesop safe tactic (rule_sets := [CategoryTheory])]
CategoryTheory.Discrete.discreteCases
-- Porting note: would it be okay to use this more generally?
attribute [local aesop safe cases (rule_sets := [CategoryTheory])] Eq
@[simps pt]
def BinaryFan.mk {P : C} (Οβ : P βΆ X) (Οβ : P βΆ Y) : BinaryFan X Y where
pt := P
Ο :=
{ app := fun β¨jβ© => by cases j <;> simpa }
#align category_theory.limits.binary_fan.mk CategoryTheory.Limits.BinaryFan.mk
@[simps pt]
def BinaryCofan.mk {P : C} (ΞΉβ : X βΆ P) (ΞΉβ : Y βΆ P) : BinaryCofan X Y where
pt := P
ΞΉ :=
{ app := fun β¨jβ© => by cases j <;> simpa }
#align category_theory.limits.binary_cofan.mk CategoryTheory.Limits.BinaryCofan.mk
end
@[simp]
theorem BinaryFan.mk_fst {P : C} (Οβ : P βΆ X) (Οβ : P βΆ Y) : (BinaryFan.mk Οβ Οβ).fst = Οβ :=
rfl
#align category_theory.limits.binary_fan.mk_fst CategoryTheory.Limits.BinaryFan.mk_fst
@[simp]
theorem BinaryFan.mk_snd {P : C} (Οβ : P βΆ X) (Οβ : P βΆ Y) : (BinaryFan.mk Οβ Οβ).snd = Οβ :=
rfl
#align category_theory.limits.binary_fan.mk_snd CategoryTheory.Limits.BinaryFan.mk_snd
@[simp]
theorem BinaryCofan.mk_inl {P : C} (ΞΉβ : X βΆ P) (ΞΉβ : Y βΆ P) : (BinaryCofan.mk ΞΉβ ΞΉβ).inl = ΞΉβ :=
rfl
#align category_theory.limits.binary_cofan.mk_inl CategoryTheory.Limits.BinaryCofan.mk_inl
@[simp]
theorem BinaryCofan.mk_inr {P : C} (ΞΉβ : X βΆ P) (ΞΉβ : Y βΆ P) : (BinaryCofan.mk ΞΉβ ΞΉβ).inr = ΞΉβ :=
rfl
#align category_theory.limits.binary_cofan.mk_inr CategoryTheory.Limits.BinaryCofan.mk_inr
def isoBinaryFanMk {X Y : C} (c : BinaryFan X Y) : c β
BinaryFan.mk c.fst c.snd :=
Cones.ext (Iso.refl _) fun j => by cases' j with l; cases l; repeat simp
#align category_theory.limits.iso_binary_fan_mk CategoryTheory.Limits.isoBinaryFanMk
def isoBinaryCofanMk {X Y : C} (c : BinaryCofan X Y) : c β
BinaryCofan.mk c.inl c.inr :=
Cocones.ext (Iso.refl _) fun j => by cases' j with l; cases l; repeat simp
#align category_theory.limits.iso_binary_cofan_mk CategoryTheory.Limits.isoBinaryCofanMk
def BinaryFan.isLimitMk {W : C} {fst : W βΆ X} {snd : W βΆ Y} (lift : β s : BinaryFan X Y, s.pt βΆ W)
(fac_left : β s : BinaryFan X Y, lift s β« fst = s.fst)
(fac_right : β s : BinaryFan X Y, lift s β« snd = s.snd)
(uniq :
β (s : BinaryFan X Y) (m : s.pt βΆ W) (_ : m β« fst = s.fst) (_ : m β« snd = s.snd),
m = lift s) :
IsLimit (BinaryFan.mk fst snd) :=
{ lift := lift
fac := fun s j => by
rcases j with β¨β¨β©β©
exacts [fac_left s, fac_right s]
uniq := fun s m w => uniq s m (w β¨WalkingPair.leftβ©) (w β¨WalkingPair.rightβ©) }
#align category_theory.limits.binary_fan.is_limit_mk CategoryTheory.Limits.BinaryFan.isLimitMk
def BinaryCofan.isColimitMk {W : C} {inl : X βΆ W} {inr : Y βΆ W}
(desc : β s : BinaryCofan X Y, W βΆ s.pt)
(fac_left : β s : BinaryCofan X Y, inl β« desc s = s.inl)
(fac_right : β s : BinaryCofan X Y, inr β« desc s = s.inr)
(uniq :
β (s : BinaryCofan X Y) (m : W βΆ s.pt) (_ : inl β« m = s.inl) (_ : inr β« m = s.inr),
m = desc s) :
IsColimit (BinaryCofan.mk inl inr) :=
{ desc := desc
fac := fun s j => by
rcases j with β¨β¨β©β©
exacts [fac_left s, fac_right s]
uniq := fun s m w => uniq s m (w β¨WalkingPair.leftβ©) (w β¨WalkingPair.rightβ©) }
#align category_theory.limits.binary_cofan.is_colimit_mk CategoryTheory.Limits.BinaryCofan.isColimitMk
@[simps]
def BinaryFan.IsLimit.lift' {W X Y : C} {s : BinaryFan X Y} (h : IsLimit s) (f : W βΆ X)
(g : W βΆ Y) : { l : W βΆ s.pt // l β« s.fst = f β§ l β« s.snd = g } :=
β¨h.lift <| BinaryFan.mk f g, h.fac _ _, h.fac _ _β©
#align category_theory.limits.binary_fan.is_limit.lift' CategoryTheory.Limits.BinaryFan.IsLimit.lift'
@[simps]
def BinaryCofan.IsColimit.desc' {W X Y : C} {s : BinaryCofan X Y} (h : IsColimit s) (f : X βΆ W)
(g : Y βΆ W) : { l : s.pt βΆ W // s.inl β« l = f β§ s.inr β« l = g } :=
β¨h.desc <| BinaryCofan.mk f g, h.fac _ _, h.fac _ _β©
#align category_theory.limits.binary_cofan.is_colimit.desc' CategoryTheory.Limits.BinaryCofan.IsColimit.desc'
def BinaryFan.isLimitFlip {X Y : C} {c : BinaryFan X Y} (hc : IsLimit c) :
IsLimit (BinaryFan.mk c.snd c.fst) :=
BinaryFan.isLimitMk (fun s => hc.lift (BinaryFan.mk s.snd s.fst)) (fun _ => hc.fac _ _)
(fun _ => hc.fac _ _) fun s _ eβ eβ =>
BinaryFan.IsLimit.hom_ext hc
(eβ.trans (hc.fac (BinaryFan.mk s.snd s.fst) β¨WalkingPair.leftβ©).symm)
(eβ.trans (hc.fac (BinaryFan.mk s.snd s.fst) β¨WalkingPair.rightβ©).symm)
#align category_theory.limits.binary_fan.is_limit_flip CategoryTheory.Limits.BinaryFan.isLimitFlip
theorem BinaryFan.isLimit_iff_isIso_fst {X Y : C} (h : IsTerminal Y) (c : BinaryFan X Y) :
Nonempty (IsLimit c) β IsIso c.fst := by
constructor
Β· rintro β¨Hβ©
obtain β¨l, hl, -β© := BinaryFan.IsLimit.lift' H (π X) (h.from X)
exact
β¨β¨l,
BinaryFan.IsLimit.hom_ext H (by simpa [hl, -Category.comp_id] using Category.comp_id _)
(h.hom_ext _ _),
hlβ©β©
Β· intro
exact
β¨BinaryFan.IsLimit.mk _ (fun f _ => f β« inv c.fst) (fun _ _ => by simp)
(fun _ _ => h.hom_ext _ _) fun _ _ _ e _ => by simp [β e]β©
#align category_theory.limits.binary_fan.is_limit_iff_is_iso_fst CategoryTheory.Limits.BinaryFan.isLimit_iff_isIso_fst
theorem BinaryFan.isLimit_iff_isIso_snd {X Y : C} (h : IsTerminal X) (c : BinaryFan X Y) :
Nonempty (IsLimit c) β IsIso c.snd := by
refine Iff.trans ?_ (BinaryFan.isLimit_iff_isIso_fst h (BinaryFan.mk c.snd c.fst))
exact
β¨fun h => β¨BinaryFan.isLimitFlip h.someβ©, fun h =>
β¨(BinaryFan.isLimitFlip h.some).ofIsoLimit (isoBinaryFanMk c).symmβ©β©
#align category_theory.limits.binary_fan.is_limit_iff_is_iso_snd CategoryTheory.Limits.BinaryFan.isLimit_iff_isIso_snd
noncomputable def BinaryFan.isLimitCompLeftIso {X Y X' : C} (c : BinaryFan X Y) (f : X βΆ X')
[IsIso f] (h : IsLimit c) : IsLimit (BinaryFan.mk (c.fst β« f) c.snd) := by
fapply BinaryFan.isLimitMk
Β· exact fun s => h.lift (BinaryFan.mk (s.fst β« inv f) s.snd)
Β· intro s -- Porting note: simp timed out here
simp only [Category.comp_id,BinaryFan.Ο_app_left,IsIso.inv_hom_id,
BinaryFan.mk_fst,IsLimit.fac_assoc,eq_self_iff_true,Category.assoc]
Β· intro s -- Porting note: simp timed out here
simp only [BinaryFan.Ο_app_right,BinaryFan.mk_snd,eq_self_iff_true,IsLimit.fac]
Β· intro s m eβ eβ
-- Porting note: simpa timed out here also
apply BinaryFan.IsLimit.hom_ext h
Β· simpa only
[BinaryFan.Ο_app_left,BinaryFan.mk_fst,Category.assoc,IsLimit.fac,IsIso.eq_comp_inv]
Β· simpa only [BinaryFan.Ο_app_right,BinaryFan.mk_snd,IsLimit.fac]
#align category_theory.limits.binary_fan.is_limit_comp_left_iso CategoryTheory.Limits.BinaryFan.isLimitCompLeftIso
noncomputable def BinaryFan.isLimitCompRightIso {X Y Y' : C} (c : BinaryFan X Y) (f : Y βΆ Y')
[IsIso f] (h : IsLimit c) : IsLimit (BinaryFan.mk c.fst (c.snd β« f)) :=
BinaryFan.isLimitFlip <| BinaryFan.isLimitCompLeftIso _ f (BinaryFan.isLimitFlip h)
#align category_theory.limits.binary_fan.is_limit_comp_right_iso CategoryTheory.Limits.BinaryFan.isLimitCompRightIso
def BinaryCofan.isColimitFlip {X Y : C} {c : BinaryCofan X Y} (hc : IsColimit c) :
IsColimit (BinaryCofan.mk c.inr c.inl) :=
BinaryCofan.isColimitMk (fun s => hc.desc (BinaryCofan.mk s.inr s.inl)) (fun _ => hc.fac _ _)
(fun _ => hc.fac _ _) fun s _ eβ eβ =>
BinaryCofan.IsColimit.hom_ext hc
(eβ.trans (hc.fac (BinaryCofan.mk s.inr s.inl) β¨WalkingPair.leftβ©).symm)
(eβ.trans (hc.fac (BinaryCofan.mk s.inr s.inl) β¨WalkingPair.rightβ©).symm)
#align category_theory.limits.binary_cofan.is_colimit_flip CategoryTheory.Limits.BinaryCofan.isColimitFlip
theorem BinaryCofan.isColimit_iff_isIso_inl {X Y : C} (h : IsInitial Y) (c : BinaryCofan X Y) :
Nonempty (IsColimit c) β IsIso c.inl := by
constructor
Β· rintro β¨Hβ©
obtain β¨l, hl, -β© := BinaryCofan.IsColimit.desc' H (π X) (h.to X)
refine β¨β¨l, hl, BinaryCofan.IsColimit.hom_ext H (?_) (h.hom_ext _ _)β©β©
rw [Category.comp_id]
have e : (inl c β« l) β« inl c = π X β« inl c := congrArg (Β·β«inl c) hl
rwa [Category.assoc,Category.id_comp] at e
Β· intro
exact
β¨BinaryCofan.IsColimit.mk _ (fun f _ => inv c.inl β« f)
(fun _ _ => IsIso.hom_inv_id_assoc _ _) (fun _ _ => h.hom_ext _ _) fun _ _ _ e _ =>
(IsIso.eq_inv_comp _).mpr eβ©
#align category_theory.limits.binary_cofan.is_colimit_iff_is_iso_inl CategoryTheory.Limits.BinaryCofan.isColimit_iff_isIso_inl
theorem BinaryCofan.isColimit_iff_isIso_inr {X Y : C} (h : IsInitial X) (c : BinaryCofan X Y) :
Nonempty (IsColimit c) β IsIso c.inr := by
refine Iff.trans ?_ (BinaryCofan.isColimit_iff_isIso_inl h (BinaryCofan.mk c.inr c.inl))
exact
β¨fun h => β¨BinaryCofan.isColimitFlip h.someβ©, fun h =>
β¨(BinaryCofan.isColimitFlip h.some).ofIsoColimit (isoBinaryCofanMk c).symmβ©β©
#align category_theory.limits.binary_cofan.is_colimit_iff_is_iso_inr CategoryTheory.Limits.BinaryCofan.isColimit_iff_isIso_inr
noncomputable def BinaryCofan.isColimitCompLeftIso {X Y X' : C} (c : BinaryCofan X Y) (f : X' βΆ X)
[IsIso f] (h : IsColimit c) : IsColimit (BinaryCofan.mk (f β« c.inl) c.inr) := by
fapply BinaryCofan.isColimitMk
Β· exact fun s => h.desc (BinaryCofan.mk (inv f β« s.inl) s.inr)
Β· intro s
-- Porting note: simp timed out here too
simp only [IsColimit.fac,BinaryCofan.ΞΉ_app_left,eq_self_iff_true,
Category.assoc,BinaryCofan.mk_inl,IsIso.hom_inv_id_assoc]
Β· intro s
-- Porting note: simp timed out here too
simp only [IsColimit.fac,BinaryCofan.ΞΉ_app_right,eq_self_iff_true,BinaryCofan.mk_inr]
Β· intro s m eβ eβ
apply BinaryCofan.IsColimit.hom_ext h
Β· rw [β cancel_epi f]
-- Porting note: simp timed out here too
simpa only [IsColimit.fac,BinaryCofan.ΞΉ_app_left,eq_self_iff_true,
Category.assoc,BinaryCofan.mk_inl,IsIso.hom_inv_id_assoc] using eβ
-- Porting note: simp timed out here too
Β· simpa only [IsColimit.fac,BinaryCofan.ΞΉ_app_right,eq_self_iff_true,BinaryCofan.mk_inr]
#align category_theory.limits.binary_cofan.is_colimit_comp_left_iso CategoryTheory.Limits.BinaryCofan.isColimitCompLeftIso
noncomputable def BinaryCofan.isColimitCompRightIso {X Y Y' : C} (c : BinaryCofan X Y) (f : Y' βΆ Y)
[IsIso f] (h : IsColimit c) : IsColimit (BinaryCofan.mk c.inl (f β« c.inr)) :=
BinaryCofan.isColimitFlip <| BinaryCofan.isColimitCompLeftIso _ f (BinaryCofan.isColimitFlip h)
#align category_theory.limits.binary_cofan.is_colimit_comp_right_iso CategoryTheory.Limits.BinaryCofan.isColimitCompRightIso
abbrev HasBinaryProduct (X Y : C) :=
HasLimit (pair X Y)
#align category_theory.limits.has_binary_product CategoryTheory.Limits.HasBinaryProduct
abbrev HasBinaryCoproduct (X Y : C) :=
HasColimit (pair X Y)
#align category_theory.limits.has_binary_coproduct CategoryTheory.Limits.HasBinaryCoproduct
abbrev prod (X Y : C) [HasBinaryProduct X Y] :=
limit (pair X Y)
#align category_theory.limits.prod CategoryTheory.Limits.prod
abbrev coprod (X Y : C) [HasBinaryCoproduct X Y] :=
colimit (pair X Y)
#align category_theory.limits.coprod CategoryTheory.Limits.coprod
notation:20 X " β¨― " Y:20 => prod X Y
notation:20 X " β¨Ώ " Y:20 => coprod X Y
abbrev prod.fst {X Y : C} [HasBinaryProduct X Y] : X β¨― Y βΆ X :=
limit.Ο (pair X Y) β¨WalkingPair.leftβ©
#align category_theory.limits.prod.fst CategoryTheory.Limits.prod.fst
abbrev prod.snd {X Y : C} [HasBinaryProduct X Y] : X β¨― Y βΆ Y :=
limit.Ο (pair X Y) β¨WalkingPair.rightβ©
#align category_theory.limits.prod.snd CategoryTheory.Limits.prod.snd
abbrev coprod.inl {X Y : C} [HasBinaryCoproduct X Y] : X βΆ X β¨Ώ Y :=
colimit.ΞΉ (pair X Y) β¨WalkingPair.leftβ©
#align category_theory.limits.coprod.inl CategoryTheory.Limits.coprod.inl
abbrev coprod.inr {X Y : C} [HasBinaryCoproduct X Y] : Y βΆ X β¨Ώ Y :=
colimit.ΞΉ (pair X Y) β¨WalkingPair.rightβ©
#align category_theory.limits.coprod.inr CategoryTheory.Limits.coprod.inr
def prodIsProd (X Y : C) [HasBinaryProduct X Y] :
IsLimit (BinaryFan.mk (prod.fst : X β¨― Y βΆ X) prod.snd) :=
(limit.isLimit _).ofIsoLimit (Cones.ext (Iso.refl _) (fun β¨uβ© => by
cases u
Β· dsimp; simp only [Category.id_comp]; rfl
Β· dsimp; simp only [Category.id_comp]; rfl
))
#align category_theory.limits.prod_is_prod CategoryTheory.Limits.prodIsProd
def coprodIsCoprod (X Y : C) [HasBinaryCoproduct X Y] :
IsColimit (BinaryCofan.mk (coprod.inl : X βΆ X β¨Ώ Y) coprod.inr) :=
(colimit.isColimit _).ofIsoColimit (Cocones.ext (Iso.refl _) (fun β¨uβ© => by
cases u
Β· dsimp; simp only [Category.comp_id]
Β· dsimp; simp only [Category.comp_id]
))
#align category_theory.limits.coprod_is_coprod CategoryTheory.Limits.coprodIsCoprod
@[ext 1100]
theorem prod.hom_ext {W X Y : C} [HasBinaryProduct X Y] {f g : W βΆ X β¨― Y}
(hβ : f β« prod.fst = g β« prod.fst) (hβ : f β« prod.snd = g β« prod.snd) : f = g :=
BinaryFan.IsLimit.hom_ext (limit.isLimit _) hβ hβ
#align category_theory.limits.prod.hom_ext CategoryTheory.Limits.prod.hom_ext
@[ext 1100]
theorem coprod.hom_ext {W X Y : C} [HasBinaryCoproduct X Y] {f g : X β¨Ώ Y βΆ W}
(hβ : coprod.inl β« f = coprod.inl β« g) (hβ : coprod.inr β« f = coprod.inr β« g) : f = g :=
BinaryCofan.IsColimit.hom_ext (colimit.isColimit _) hβ hβ
#align category_theory.limits.coprod.hom_ext CategoryTheory.Limits.coprod.hom_ext
abbrev prod.lift {W X Y : C} [HasBinaryProduct X Y] (f : W βΆ X) (g : W βΆ Y) : W βΆ X β¨― Y :=
limit.lift _ (BinaryFan.mk f g)
#align category_theory.limits.prod.lift CategoryTheory.Limits.prod.lift
abbrev diag (X : C) [HasBinaryProduct X X] : X βΆ X β¨― X :=
prod.lift (π _) (π _)
#align category_theory.limits.diag CategoryTheory.Limits.diag
abbrev coprod.desc {W X Y : C} [HasBinaryCoproduct X Y] (f : X βΆ W) (g : Y βΆ W) : X β¨Ώ Y βΆ W :=
colimit.desc _ (BinaryCofan.mk f g)
#align category_theory.limits.coprod.desc CategoryTheory.Limits.coprod.desc
abbrev codiag (X : C) [HasBinaryCoproduct X X] : X β¨Ώ X βΆ X :=
coprod.desc (π _) (π _)
#align category_theory.limits.codiag CategoryTheory.Limits.codiag
-- Porting note (#10618): simp removes as simp can prove this
@[reassoc]
theorem prod.lift_fst {W X Y : C} [HasBinaryProduct X Y] (f : W βΆ X) (g : W βΆ Y) :
prod.lift f g β« prod.fst = f :=
limit.lift_Ο _ _
#align category_theory.limits.prod.lift_fst CategoryTheory.Limits.prod.lift_fst
#align category_theory.limits.prod.lift_fst_assoc CategoryTheory.Limits.prod.lift_fst_assoc
-- Porting note (#10618): simp removes as simp can prove this
@[reassoc]
theorem prod.lift_snd {W X Y : C} [HasBinaryProduct X Y] (f : W βΆ X) (g : W βΆ Y) :
prod.lift f g β« prod.snd = g :=
limit.lift_Ο _ _
#align category_theory.limits.prod.lift_snd CategoryTheory.Limits.prod.lift_snd
#align category_theory.limits.prod.lift_snd_assoc CategoryTheory.Limits.prod.lift_snd_assoc
-- The simp linter says simp can prove the reassoc version of this lemma.
-- Porting note: it can also prove the og version
@[reassoc]
theorem coprod.inl_desc {W X Y : C} [HasBinaryCoproduct X Y] (f : X βΆ W) (g : Y βΆ W) :
coprod.inl β« coprod.desc f g = f :=
colimit.ΞΉ_desc _ _
#align category_theory.limits.coprod.inl_desc CategoryTheory.Limits.coprod.inl_desc
#align category_theory.limits.coprod.inl_desc_assoc CategoryTheory.Limits.coprod.inl_desc_assoc
-- The simp linter says simp can prove the reassoc version of this lemma.
-- Porting note: it can also prove the og version
@[reassoc]
theorem coprod.inr_desc {W X Y : C} [HasBinaryCoproduct X Y] (f : X βΆ W) (g : Y βΆ W) :
coprod.inr β« coprod.desc f g = g :=
colimit.ΞΉ_desc _ _
#align category_theory.limits.coprod.inr_desc CategoryTheory.Limits.coprod.inr_desc
#align category_theory.limits.coprod.inr_desc_assoc CategoryTheory.Limits.coprod.inr_desc_assoc
instance prod.mono_lift_of_mono_left {W X Y : C} [HasBinaryProduct X Y] (f : W βΆ X) (g : W βΆ Y)
[Mono f] : Mono (prod.lift f g) :=
mono_of_mono_fac <| prod.lift_fst _ _
#align category_theory.limits.prod.mono_lift_of_mono_left CategoryTheory.Limits.prod.mono_lift_of_mono_left
instance prod.mono_lift_of_mono_right {W X Y : C} [HasBinaryProduct X Y] (f : W βΆ X) (g : W βΆ Y)
[Mono g] : Mono (prod.lift f g) :=
mono_of_mono_fac <| prod.lift_snd _ _
#align category_theory.limits.prod.mono_lift_of_mono_right CategoryTheory.Limits.prod.mono_lift_of_mono_right
instance coprod.epi_desc_of_epi_left {W X Y : C} [HasBinaryCoproduct X Y] (f : X βΆ W) (g : Y βΆ W)
[Epi f] : Epi (coprod.desc f g) :=
epi_of_epi_fac <| coprod.inl_desc _ _
#align category_theory.limits.coprod.epi_desc_of_epi_left CategoryTheory.Limits.coprod.epi_desc_of_epi_left
instance coprod.epi_desc_of_epi_right {W X Y : C} [HasBinaryCoproduct X Y] (f : X βΆ W) (g : Y βΆ W)
[Epi g] : Epi (coprod.desc f g) :=
epi_of_epi_fac <| coprod.inr_desc _ _
#align category_theory.limits.coprod.epi_desc_of_epi_right CategoryTheory.Limits.coprod.epi_desc_of_epi_right
def prod.lift' {W X Y : C} [HasBinaryProduct X Y] (f : W βΆ X) (g : W βΆ Y) :
{ l : W βΆ X β¨― Y // l β« prod.fst = f β§ l β« prod.snd = g } :=
β¨prod.lift f g, prod.lift_fst _ _, prod.lift_snd _ _β©
#align category_theory.limits.prod.lift' CategoryTheory.Limits.prod.lift'
def coprod.desc' {W X Y : C} [HasBinaryCoproduct X Y] (f : X βΆ W) (g : Y βΆ W) :
{ l : X β¨Ώ Y βΆ W // coprod.inl β« l = f β§ coprod.inr β« l = g } :=
β¨coprod.desc f g, coprod.inl_desc _ _, coprod.inr_desc _ _β©
#align category_theory.limits.coprod.desc' CategoryTheory.Limits.coprod.desc'
def prod.map {W X Y Z : C} [HasBinaryProduct W X] [HasBinaryProduct Y Z] (f : W βΆ Y) (g : X βΆ Z) :
W β¨― X βΆ Y β¨― Z :=
limMap (mapPair f g)
#align category_theory.limits.prod.map CategoryTheory.Limits.prod.map
def coprod.map {W X Y Z : C} [HasBinaryCoproduct W X] [HasBinaryCoproduct Y Z] (f : W βΆ Y)
(g : X βΆ Z) : W β¨Ώ X βΆ Y β¨Ώ Z :=
colimMap (mapPair f g)
#align category_theory.limits.coprod.map CategoryTheory.Limits.coprod.map
section CoprodLemmas
-- @[reassoc (attr := simp)]
@[simp] -- Porting note: removing reassoc tag since result is not hygienic (two h's)
theorem coprod.desc_comp {V W X Y : C} [HasBinaryCoproduct X Y] (f : V βΆ W) (g : X βΆ V)
(h : Y βΆ V) : coprod.desc g h β« f = coprod.desc (g β« f) (h β« f) := by
ext <;> simp
#align category_theory.limits.coprod.desc_comp CategoryTheory.Limits.coprod.desc_comp
-- Porting note: hand generated reassoc here. Simp can prove it
theorem coprod.desc_comp_assoc {C : Type u} [Category C] {V W X Y : C}
[HasBinaryCoproduct X Y] (f : V βΆ W) (g : X βΆ V) (h : Y βΆ V) {Z : C} (l : W βΆ Z) :
coprod.desc g h β« f β« l = coprod.desc (g β« f) (h β« f) β« l := by simp
#align category_theory.limits.coprod.desc_comp_assoc CategoryTheory.Limits.coprod.desc_comp
theorem coprod.diag_comp {X Y : C} [HasBinaryCoproduct X X] (f : X βΆ Y) :
codiag X β« f = coprod.desc f f := by simp
#align category_theory.limits.coprod.diag_comp CategoryTheory.Limits.coprod.diag_comp
@[reassoc (attr := simp)]
theorem coprod.inl_map {W X Y Z : C} [HasBinaryCoproduct W X] [HasBinaryCoproduct Y Z] (f : W βΆ Y)
(g : X βΆ Z) : coprod.inl β« coprod.map f g = f β« coprod.inl :=
ΞΉ_colimMap _ _
#align category_theory.limits.coprod.inl_map CategoryTheory.Limits.coprod.inl_map
#align category_theory.limits.coprod.inl_map_assoc CategoryTheory.Limits.coprod.inl_map_assoc
@[reassoc (attr := simp)]
theorem coprod.inr_map {W X Y Z : C} [HasBinaryCoproduct W X] [HasBinaryCoproduct Y Z] (f : W βΆ Y)
(g : X βΆ Z) : coprod.inr β« coprod.map f g = g β« coprod.inr :=
ΞΉ_colimMap _ _
#align category_theory.limits.coprod.inr_map CategoryTheory.Limits.coprod.inr_map
#align category_theory.limits.coprod.inr_map_assoc CategoryTheory.Limits.coprod.inr_map_assoc
@[simp]
theorem coprod.map_id_id {X Y : C} [HasBinaryCoproduct X Y] : coprod.map (π X) (π Y) = π _ := by
ext <;> simp
#align category_theory.limits.coprod.map_id_id CategoryTheory.Limits.coprod.map_id_id
@[simp]
| Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean | 872 | 873 | theorem coprod.desc_inl_inr {X Y : C} [HasBinaryCoproduct X Y] :
coprod.desc coprod.inl coprod.inr = π (X β¨Ώ Y) := by | ext <;> simp
|
import Mathlib.Data.Int.Bitwise
import Mathlib.Data.Int.Order.Lemmas
import Mathlib.Data.Set.Function
import Mathlib.Order.Interval.Set.Basic
#align_import data.int.lemmas from "leanprover-community/mathlib"@"09597669f02422ed388036273d8848119699c22f"
open Nat
namespace Int
theorem le_natCast_sub (m n : β) : (m - n : β€) β€ β(m - n : β) := by
by_cases h : m β₯ n
Β· exact le_of_eq (Int.ofNat_sub h).symm
Β· simp [le_of_not_ge h, ofNat_le]
#align int.le_coe_nat_sub Int.le_natCast_sub
-- Porting note (#10618): simp can prove this @[simp]
theorem succ_natCast_pos (n : β) : 0 < (n : β€) + 1 :=
lt_add_one_iff.mpr (by simp)
#align int.succ_coe_nat_pos Int.succ_natCast_pos
variable {a b : β€} {n : β}
theorem natAbs_eq_iff_sq_eq {a b : β€} : a.natAbs = b.natAbs β a ^ 2 = b ^ 2 := by
rw [sq, sq]
exact natAbs_eq_iff_mul_self_eq
#align int.nat_abs_eq_iff_sq_eq Int.natAbs_eq_iff_sq_eq
| Mathlib/Data/Int/Lemmas.lean | 50 | 52 | theorem natAbs_lt_iff_sq_lt {a b : β€} : a.natAbs < b.natAbs β a ^ 2 < b ^ 2 := by |
rw [sq, sq]
exact natAbs_lt_iff_mul_self_lt
|
import Mathlib.Algebra.MonoidAlgebra.Division
import Mathlib.Algebra.MvPolynomial.Basic
#align_import data.mv_polynomial.division from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951"
variable {Ο R : Type*} [CommSemiring R]
namespace MvPolynomial
| Mathlib/Algebra/MvPolynomial/Division.lean | 221 | 240 | theorem monomial_dvd_monomial {r s : R} {i j : Ο ββ β} :
monomial i r β£ monomial j s β (s = 0 β¨ i β€ j) β§ r β£ s := by |
constructor
Β· rintro β¨x, hxβ©
rw [MvPolynomial.ext_iff] at hx
have hj := hx j
have hi := hx i
classical
simp_rw [coeff_monomial, if_pos] at hj hi
simp_rw [coeff_monomial_mul'] at hi hj
split_ifs at hi hj with hi hi
Β· exact β¨Or.inr hi, _, hjβ©
Β· exact β¨Or.inl hj, hj.symm βΈ dvd_zero _β©
-- Porting note: two goals remain at this point in Lean 4
Β· simp_all only [or_true, dvd_mul_right, and_self]
Β· simp_all only [ite_self, le_refl, ite_true, dvd_mul_right, or_false, and_self]
Β· rintro β¨h | hij, d, rflβ©
Β· simp_rw [h, monomial_zero, dvd_zero]
Β· refine β¨monomial (j - i) d, ?_β©
rw [monomial_mul, add_tsub_cancel_of_le hij]
|
import Mathlib.Analysis.Normed.Group.Seminorm
import Mathlib.Order.LiminfLimsup
import Mathlib.Topology.Instances.Rat
import Mathlib.Topology.MetricSpace.Algebra
import Mathlib.Topology.MetricSpace.IsometricSMul
import Mathlib.Topology.Sequences
#align_import analysis.normed.group.basic from "leanprover-community/mathlib"@"41bef4ae1254365bc190aee63b947674d2977f01"
variable {π π Ξ± ΞΉ ΞΊ E F G : Type*}
open Filter Function Metric Bornology
open ENNReal Filter NNReal Uniformity Pointwise Topology
@[notation_class]
class Norm (E : Type*) where
norm : E β β
#align has_norm Norm
@[notation_class]
class NNNorm (E : Type*) where
nnnorm : E β ββ₯0
#align has_nnnorm NNNorm
export Norm (norm)
export NNNorm (nnnorm)
@[inherit_doc]
notation "β" e "β" => norm e
@[inherit_doc]
notation "β" e "ββ" => nnnorm e
class SeminormedAddGroup (E : Type*) extends Norm E, AddGroup E, PseudoMetricSpace E where
dist := fun x y => βx - yβ
dist_eq : β x y, dist x y = βx - yβ := by aesop
#align seminormed_add_group SeminormedAddGroup
@[to_additive]
class SeminormedGroup (E : Type*) extends Norm E, Group E, PseudoMetricSpace E where
dist := fun x y => βx / yβ
dist_eq : β x y, dist x y = βx / yβ := by aesop
#align seminormed_group SeminormedGroup
class NormedAddGroup (E : Type*) extends Norm E, AddGroup E, MetricSpace E where
dist := fun x y => βx - yβ
dist_eq : β x y, dist x y = βx - yβ := by aesop
#align normed_add_group NormedAddGroup
@[to_additive]
class NormedGroup (E : Type*) extends Norm E, Group E, MetricSpace E where
dist := fun x y => βx / yβ
dist_eq : β x y, dist x y = βx / yβ := by aesop
#align normed_group NormedGroup
class SeminormedAddCommGroup (E : Type*) extends Norm E, AddCommGroup E,
PseudoMetricSpace E where
dist := fun x y => βx - yβ
dist_eq : β x y, dist x y = βx - yβ := by aesop
#align seminormed_add_comm_group SeminormedAddCommGroup
@[to_additive]
class SeminormedCommGroup (E : Type*) extends Norm E, CommGroup E, PseudoMetricSpace E where
dist := fun x y => βx / yβ
dist_eq : β x y, dist x y = βx / yβ := by aesop
#align seminormed_comm_group SeminormedCommGroup
class NormedAddCommGroup (E : Type*) extends Norm E, AddCommGroup E, MetricSpace E where
dist := fun x y => βx - yβ
dist_eq : β x y, dist x y = βx - yβ := by aesop
#align normed_add_comm_group NormedAddCommGroup
@[to_additive]
class NormedCommGroup (E : Type*) extends Norm E, CommGroup E, MetricSpace E where
dist := fun x y => βx / yβ
dist_eq : β x y, dist x y = βx / yβ := by aesop
#align normed_comm_group NormedCommGroup
-- See note [lower instance priority]
@[to_additive]
instance (priority := 100) NormedGroup.toSeminormedGroup [NormedGroup E] : SeminormedGroup E :=
{ βΉNormedGroup EβΊ with }
#align normed_group.to_seminormed_group NormedGroup.toSeminormedGroup
#align normed_add_group.to_seminormed_add_group NormedAddGroup.toSeminormedAddGroup
-- See note [lower instance priority]
@[to_additive]
instance (priority := 100) NormedCommGroup.toSeminormedCommGroup [NormedCommGroup E] :
SeminormedCommGroup E :=
{ βΉNormedCommGroup EβΊ with }
#align normed_comm_group.to_seminormed_comm_group NormedCommGroup.toSeminormedCommGroup
#align normed_add_comm_group.to_seminormed_add_comm_group NormedAddCommGroup.toSeminormedAddCommGroup
-- See note [lower instance priority]
@[to_additive]
instance (priority := 100) SeminormedCommGroup.toSeminormedGroup [SeminormedCommGroup E] :
SeminormedGroup E :=
{ βΉSeminormedCommGroup EβΊ with }
#align seminormed_comm_group.to_seminormed_group SeminormedCommGroup.toSeminormedGroup
#align seminormed_add_comm_group.to_seminormed_add_group SeminormedAddCommGroup.toSeminormedAddGroup
-- See note [lower instance priority]
@[to_additive]
instance (priority := 100) NormedCommGroup.toNormedGroup [NormedCommGroup E] : NormedGroup E :=
{ βΉNormedCommGroup EβΊ with }
#align normed_comm_group.to_normed_group NormedCommGroup.toNormedGroup
#align normed_add_comm_group.to_normed_add_group NormedAddCommGroup.toNormedAddGroup
-- See note [reducible non-instances]
@[to_additive (attr := reducible) "Construct a `NormedAddGroup` from a `SeminormedAddGroup`
satisfying `β x, βxβ = 0 β x = 0`. This avoids having to go back to the `(Pseudo)MetricSpace`
level when declaring a `NormedAddGroup` instance as a special case of a more general
`SeminormedAddGroup` instance."]
def NormedGroup.ofSeparation [SeminormedGroup E] (h : β x : E, βxβ = 0 β x = 1) :
NormedGroup E where
dist_eq := βΉSeminormedGroup EβΊ.dist_eq
toMetricSpace :=
{ eq_of_dist_eq_zero := fun hxy =>
div_eq_one.1 <| h _ <| by exact (βΉSeminormedGroup EβΊ.dist_eq _ _).symm.trans hxy }
-- Porting note: the `rwa` no longer worked, but it was easy enough to provide the term.
-- however, notice that if you make `x` and `y` accessible, then the following does work:
-- `have := βΉSeminormedGroup EβΊ.dist_eq x y; rwa [β this]`, so I'm not sure why the `rwa`
-- was broken.
#align normed_group.of_separation NormedGroup.ofSeparation
#align normed_add_group.of_separation NormedAddGroup.ofSeparation
-- See note [reducible non-instances]
@[to_additive (attr := reducible) "Construct a `NormedAddCommGroup` from a
`SeminormedAddCommGroup` satisfying `β x, βxβ = 0 β x = 0`. This avoids having to go back to the
`(Pseudo)MetricSpace` level when declaring a `NormedAddCommGroup` instance as a special case
of a more general `SeminormedAddCommGroup` instance."]
def NormedCommGroup.ofSeparation [SeminormedCommGroup E] (h : β x : E, βxβ = 0 β x = 1) :
NormedCommGroup E :=
{ βΉSeminormedCommGroup EβΊ, NormedGroup.ofSeparation h with }
#align normed_comm_group.of_separation NormedCommGroup.ofSeparation
#align normed_add_comm_group.of_separation NormedAddCommGroup.ofSeparation
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a seminormed group from a translation-invariant distance."]
def SeminormedGroup.ofMulDist [Norm E] [Group E] [PseudoMetricSpace E]
(hβ : β x : E, βxβ = dist x 1) (hβ : β x y z : E, dist x y β€ dist (x * z) (y * z)) :
SeminormedGroup E where
dist_eq x y := by
rw [hβ]; apply le_antisymm
Β· simpa only [div_eq_mul_inv, β mul_right_inv y] using hβ _ _ _
Β· simpa only [div_mul_cancel, one_mul] using hβ (x / y) 1 y
#align seminormed_group.of_mul_dist SeminormedGroup.ofMulDist
#align seminormed_add_group.of_add_dist SeminormedAddGroup.ofAddDist
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a seminormed group from a translation-invariant pseudodistance."]
def SeminormedGroup.ofMulDist' [Norm E] [Group E] [PseudoMetricSpace E]
(hβ : β x : E, βxβ = dist x 1) (hβ : β x y z : E, dist (x * z) (y * z) β€ dist x y) :
SeminormedGroup E where
dist_eq x y := by
rw [hβ]; apply le_antisymm
Β· simpa only [div_mul_cancel, one_mul] using hβ (x / y) 1 y
Β· simpa only [div_eq_mul_inv, β mul_right_inv y] using hβ _ _ _
#align seminormed_group.of_mul_dist' SeminormedGroup.ofMulDist'
#align seminormed_add_group.of_add_dist' SeminormedAddGroup.ofAddDist'
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a seminormed group from a translation-invariant pseudodistance."]
def SeminormedCommGroup.ofMulDist [Norm E] [CommGroup E] [PseudoMetricSpace E]
(hβ : β x : E, βxβ = dist x 1) (hβ : β x y z : E, dist x y β€ dist (x * z) (y * z)) :
SeminormedCommGroup E :=
{ SeminormedGroup.ofMulDist hβ hβ with
mul_comm := mul_comm }
#align seminormed_comm_group.of_mul_dist SeminormedCommGroup.ofMulDist
#align seminormed_add_comm_group.of_add_dist SeminormedAddCommGroup.ofAddDist
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a seminormed group from a translation-invariant pseudodistance."]
def SeminormedCommGroup.ofMulDist' [Norm E] [CommGroup E] [PseudoMetricSpace E]
(hβ : β x : E, βxβ = dist x 1) (hβ : β x y z : E, dist (x * z) (y * z) β€ dist x y) :
SeminormedCommGroup E :=
{ SeminormedGroup.ofMulDist' hβ hβ with
mul_comm := mul_comm }
#align seminormed_comm_group.of_mul_dist' SeminormedCommGroup.ofMulDist'
#align seminormed_add_comm_group.of_add_dist' SeminormedAddCommGroup.ofAddDist'
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a normed group from a translation-invariant distance."]
def NormedGroup.ofMulDist [Norm E] [Group E] [MetricSpace E] (hβ : β x : E, βxβ = dist x 1)
(hβ : β x y z : E, dist x y β€ dist (x * z) (y * z)) : NormedGroup E :=
{ SeminormedGroup.ofMulDist hβ hβ with
eq_of_dist_eq_zero := eq_of_dist_eq_zero }
#align normed_group.of_mul_dist NormedGroup.ofMulDist
#align normed_add_group.of_add_dist NormedAddGroup.ofAddDist
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a normed group from a translation-invariant pseudodistance."]
def NormedGroup.ofMulDist' [Norm E] [Group E] [MetricSpace E] (hβ : β x : E, βxβ = dist x 1)
(hβ : β x y z : E, dist (x * z) (y * z) β€ dist x y) : NormedGroup E :=
{ SeminormedGroup.ofMulDist' hβ hβ with
eq_of_dist_eq_zero := eq_of_dist_eq_zero }
#align normed_group.of_mul_dist' NormedGroup.ofMulDist'
#align normed_add_group.of_add_dist' NormedAddGroup.ofAddDist'
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a normed group from a translation-invariant pseudodistance."]
def NormedCommGroup.ofMulDist [Norm E] [CommGroup E] [MetricSpace E]
(hβ : β x : E, βxβ = dist x 1) (hβ : β x y z : E, dist x y β€ dist (x * z) (y * z)) :
NormedCommGroup E :=
{ NormedGroup.ofMulDist hβ hβ with
mul_comm := mul_comm }
#align normed_comm_group.of_mul_dist NormedCommGroup.ofMulDist
#align normed_add_comm_group.of_add_dist NormedAddCommGroup.ofAddDist
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a normed group from a translation-invariant pseudodistance."]
def NormedCommGroup.ofMulDist' [Norm E] [CommGroup E] [MetricSpace E]
(hβ : β x : E, βxβ = dist x 1) (hβ : β x y z : E, dist (x * z) (y * z) β€ dist x y) :
NormedCommGroup E :=
{ NormedGroup.ofMulDist' hβ hβ with
mul_comm := mul_comm }
#align normed_comm_group.of_mul_dist' NormedCommGroup.ofMulDist'
#align normed_add_comm_group.of_add_dist' NormedAddCommGroup.ofAddDist'
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a seminormed group from a seminorm, i.e., registering the pseudodistance
and the pseudometric space structure from the seminorm properties. Note that in most cases this
instance creates bad definitional equalities (e.g., it does not take into account a possibly
existing `UniformSpace` instance on `E`)."]
def GroupSeminorm.toSeminormedGroup [Group E] (f : GroupSeminorm E) : SeminormedGroup E where
dist x y := f (x / y)
norm := f
dist_eq x y := rfl
dist_self x := by simp only [div_self', map_one_eq_zero]
dist_triangle := le_map_div_add_map_div f
dist_comm := map_div_rev f
edist_dist x y := by exact ENNReal.coe_nnreal_eq _
-- Porting note: how did `mathlib3` solve this automatically?
#align group_seminorm.to_seminormed_group GroupSeminorm.toSeminormedGroup
#align add_group_seminorm.to_seminormed_add_group AddGroupSeminorm.toSeminormedAddGroup
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a seminormed group from a seminorm, i.e., registering the pseudodistance
and the pseudometric space structure from the seminorm properties. Note that in most cases this
instance creates bad definitional equalities (e.g., it does not take into account a possibly
existing `UniformSpace` instance on `E`)."]
def GroupSeminorm.toSeminormedCommGroup [CommGroup E] (f : GroupSeminorm E) :
SeminormedCommGroup E :=
{ f.toSeminormedGroup with
mul_comm := mul_comm }
#align group_seminorm.to_seminormed_comm_group GroupSeminorm.toSeminormedCommGroup
#align add_group_seminorm.to_seminormed_add_comm_group AddGroupSeminorm.toSeminormedAddCommGroup
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a normed group from a norm, i.e., registering the distance and the metric
space structure from the norm properties. Note that in most cases this instance creates bad
definitional equalities (e.g., it does not take into account a possibly existing `UniformSpace`
instance on `E`)."]
def GroupNorm.toNormedGroup [Group E] (f : GroupNorm E) : NormedGroup E :=
{ f.toGroupSeminorm.toSeminormedGroup with
eq_of_dist_eq_zero := fun h => div_eq_one.1 <| eq_one_of_map_eq_zero f h }
#align group_norm.to_normed_group GroupNorm.toNormedGroup
#align add_group_norm.to_normed_add_group AddGroupNorm.toNormedAddGroup
-- See note [reducible non-instances]
@[to_additive (attr := reducible)
"Construct a normed group from a norm, i.e., registering the distance and the metric
space structure from the norm properties. Note that in most cases this instance creates bad
definitional equalities (e.g., it does not take into account a possibly existing `UniformSpace`
instance on `E`)."]
def GroupNorm.toNormedCommGroup [CommGroup E] (f : GroupNorm E) : NormedCommGroup E :=
{ f.toNormedGroup with
mul_comm := mul_comm }
#align group_norm.to_normed_comm_group GroupNorm.toNormedCommGroup
#align add_group_norm.to_normed_add_comm_group AddGroupNorm.toNormedAddCommGroup
instance PUnit.normedAddCommGroup : NormedAddCommGroup PUnit where
norm := Function.const _ 0
dist_eq _ _ := rfl
@[simp]
theorem PUnit.norm_eq_zero (r : PUnit) : βrβ = 0 :=
rfl
#align punit.norm_eq_zero PUnit.norm_eq_zero
section SeminormedGroup
variable [SeminormedGroup E] [SeminormedGroup F] [SeminormedGroup G] {s : Set E}
{a aβ aβ b bβ bβ : E} {r rβ rβ : β}
@[to_additive]
theorem dist_eq_norm_div (a b : E) : dist a b = βa / bβ :=
SeminormedGroup.dist_eq _ _
#align dist_eq_norm_div dist_eq_norm_div
#align dist_eq_norm_sub dist_eq_norm_sub
@[to_additive]
theorem dist_eq_norm_div' (a b : E) : dist a b = βb / aβ := by rw [dist_comm, dist_eq_norm_div]
#align dist_eq_norm_div' dist_eq_norm_div'
#align dist_eq_norm_sub' dist_eq_norm_sub'
alias dist_eq_norm := dist_eq_norm_sub
#align dist_eq_norm dist_eq_norm
alias dist_eq_norm' := dist_eq_norm_sub'
#align dist_eq_norm' dist_eq_norm'
@[to_additive]
instance NormedGroup.to_isometricSMul_right : IsometricSMul Eα΅α΅α΅ E :=
β¨fun a => Isometry.of_dist_eq fun b c => by simp [dist_eq_norm_div]β©
#align normed_group.to_has_isometric_smul_right NormedGroup.to_isometricSMul_right
#align normed_add_group.to_has_isometric_vadd_right NormedAddGroup.to_isometricVAdd_right
@[to_additive (attr := simp)]
theorem dist_one_right (a : E) : dist a 1 = βaβ := by rw [dist_eq_norm_div, div_one]
#align dist_one_right dist_one_right
#align dist_zero_right dist_zero_right
@[to_additive]
theorem inseparable_one_iff_norm {a : E} : Inseparable a 1 β βaβ = 0 := by
rw [Metric.inseparable_iff, dist_one_right]
@[to_additive (attr := simp)]
theorem dist_one_left : dist (1 : E) = norm :=
funext fun a => by rw [dist_comm, dist_one_right]
#align dist_one_left dist_one_left
#align dist_zero_left dist_zero_left
@[to_additive]
theorem Isometry.norm_map_of_map_one {f : E β F} (hi : Isometry f) (hβ : f 1 = 1) (x : E) :
βf xβ = βxβ := by rw [β dist_one_right, β hβ, hi.dist_eq, dist_one_right]
#align isometry.norm_map_of_map_one Isometry.norm_map_of_map_one
#align isometry.norm_map_of_map_zero Isometry.norm_map_of_map_zero
@[to_additive (attr := simp) comap_norm_atTop]
theorem comap_norm_atTop' : comap norm atTop = cobounded E := by
simpa only [dist_one_right] using comap_dist_right_atTop (1 : E)
@[to_additive Filter.HasBasis.cobounded_of_norm]
lemma Filter.HasBasis.cobounded_of_norm' {ΞΉ : Sort*} {p : ΞΉ β Prop} {s : ΞΉ β Set β}
(h : HasBasis atTop p s) : HasBasis (cobounded E) p fun i β¦ norm β»ΒΉ' s i :=
comap_norm_atTop' (E := E) βΈ h.comap _
@[to_additive Filter.hasBasis_cobounded_norm]
lemma Filter.hasBasis_cobounded_norm' : HasBasis (cobounded E) (fun _ β¦ True) ({x | Β· β€ βxβ}) :=
atTop_basis.cobounded_of_norm'
@[to_additive (attr := simp) tendsto_norm_atTop_iff_cobounded]
theorem tendsto_norm_atTop_iff_cobounded' {f : Ξ± β E} {l : Filter Ξ±} :
Tendsto (βf Β·β) l atTop β Tendsto f l (cobounded E) := by
rw [β comap_norm_atTop', tendsto_comap_iff]; rfl
@[to_additive tendsto_norm_cobounded_atTop]
theorem tendsto_norm_cobounded_atTop' : Tendsto norm (cobounded E) atTop :=
tendsto_norm_atTop_iff_cobounded'.2 tendsto_id
@[to_additive eventually_cobounded_le_norm]
lemma eventually_cobounded_le_norm' (a : β) : βαΆ x in cobounded E, a β€ βxβ :=
tendsto_norm_cobounded_atTop'.eventually_ge_atTop a
@[to_additive tendsto_norm_cocompact_atTop]
theorem tendsto_norm_cocompact_atTop' [ProperSpace E] : Tendsto norm (cocompact E) atTop :=
cobounded_eq_cocompact (Ξ± := E) βΈ tendsto_norm_cobounded_atTop'
#align tendsto_norm_cocompact_at_top' tendsto_norm_cocompact_atTop'
#align tendsto_norm_cocompact_at_top tendsto_norm_cocompact_atTop
@[to_additive]
theorem norm_div_rev (a b : E) : βa / bβ = βb / aβ := by
simpa only [dist_eq_norm_div] using dist_comm a b
#align norm_div_rev norm_div_rev
#align norm_sub_rev norm_sub_rev
@[to_additive (attr := simp) norm_neg]
| Mathlib/Analysis/Normed/Group/Basic.lean | 483 | 483 | theorem norm_inv' (a : E) : βaβ»ΒΉβ = βaβ := by | simpa using norm_div_rev 1 a
|
import Mathlib.Init.Logic
import Mathlib.Init.Function
import Mathlib.Init.Algebra.Classes
import Batteries.Util.LibraryNote
import Batteries.Tactic.Lint.Basic
#align_import logic.basic from "leanprover-community/mathlib"@"3365b20c2ffa7c35e47e5209b89ba9abdddf3ffe"
#align_import init.ite_simp from "leanprover-community/lean"@"4a03bdeb31b3688c31d02d7ff8e0ff2e5d6174db"
open Function
attribute [local instance 10] Classical.propDecidable
open Function
alias Membership.mem.ne_of_not_mem := ne_of_mem_of_not_mem
alias Membership.mem.ne_of_not_mem' := ne_of_mem_of_not_mem'
#align has_mem.mem.ne_of_not_mem Membership.mem.ne_of_not_mem
#align has_mem.mem.ne_of_not_mem' Membership.mem.ne_of_not_mem'
section Equality
-- todo: change name
theorem forall_cond_comm {Ξ±} {s : Ξ± β Prop} {p : Ξ± β Ξ± β Prop} :
(β a, s a β β b, s b β p a b) β β a b, s a β s b β p a b :=
β¨fun h a b ha hb β¦ h a ha b hb, fun h a ha b hb β¦ h a b ha hbβ©
#align ball_cond_comm forall_cond_comm
theorem forall_mem_comm {Ξ± Ξ²} [Membership Ξ± Ξ²] {s : Ξ²} {p : Ξ± β Ξ± β Prop} :
(β a (_ : a β s) b (_ : b β s), p a b) β β a b, a β s β b β s β p a b :=
forall_cond_comm
#align ball_mem_comm forall_mem_comm
@[deprecated (since := "2024-03-23")] alias ball_cond_comm := forall_cond_comm
@[deprecated (since := "2024-03-23")] alias ball_mem_comm := forall_mem_comm
#align ne_of_apply_ne ne_of_apply_ne
lemma ne_of_eq_of_ne {Ξ± : Sort*} {a b c : Ξ±} (hβ : a = b) (hβ : b β c) : a β c := hβ.symm βΈ hβ
lemma ne_of_ne_of_eq {Ξ± : Sort*} {a b c : Ξ±} (hβ : a β b) (hβ : b = c) : a β c := hβ βΈ hβ
alias Eq.trans_ne := ne_of_eq_of_ne
alias Ne.trans_eq := ne_of_ne_of_eq
#align eq.trans_ne Eq.trans_ne
#align ne.trans_eq Ne.trans_eq
theorem eq_equivalence {Ξ± : Sort*} : Equivalence (@Eq Ξ±) :=
β¨Eq.refl, @Eq.symm _, @Eq.trans _β©
#align eq_equivalence eq_equivalence
-- These were migrated to Batteries but the `@[simp]` attributes were (mysteriously?) removed.
attribute [simp] eq_mp_eq_cast eq_mpr_eq_cast
#align eq_mp_eq_cast eq_mp_eq_cast
#align eq_mpr_eq_cast eq_mpr_eq_cast
#align cast_cast cast_cast
-- @[simp] -- FIXME simp ignores proof rewrites
theorem congr_refl_left {Ξ± Ξ² : Sort*} (f : Ξ± β Ξ²) {a b : Ξ±} (h : a = b) :
congr (Eq.refl f) h = congr_arg f h := rfl
#align congr_refl_left congr_refl_left
-- @[simp] -- FIXME simp ignores proof rewrites
theorem congr_refl_right {Ξ± Ξ² : Sort*} {f g : Ξ± β Ξ²} (h : f = g) (a : Ξ±) :
congr h (Eq.refl a) = congr_fun h a := rfl
#align congr_refl_right congr_refl_right
-- @[simp] -- FIXME simp ignores proof rewrites
theorem congr_arg_refl {Ξ± Ξ² : Sort*} (f : Ξ± β Ξ²) (a : Ξ±) :
congr_arg f (Eq.refl a) = Eq.refl (f a) :=
rfl
#align congr_arg_refl congr_arg_refl
-- @[simp] -- FIXME simp ignores proof rewrites
theorem congr_fun_rfl {Ξ± Ξ² : Sort*} (f : Ξ± β Ξ²) (a : Ξ±) : congr_fun (Eq.refl f) a = Eq.refl (f a) :=
rfl
#align congr_fun_rfl congr_fun_rfl
-- @[simp] -- FIXME simp ignores proof rewrites
theorem congr_fun_congr_arg {Ξ± Ξ² Ξ³ : Sort*} (f : Ξ± β Ξ² β Ξ³) {a a' : Ξ±} (p : a = a') (b : Ξ²) :
congr_fun (congr_arg f p) b = congr_arg (fun a β¦ f a b) p := rfl
#align congr_fun_congr_arg congr_fun_congr_arg
#align heq_of_cast_eq heq_of_cast_eq
#align cast_eq_iff_heq cast_eq_iff_heq
theorem Eq.rec_eq_cast {Ξ± : Sort _} {P : Ξ± β Sort _} {x y : Ξ±} (h : x = y) (z : P x) :
h βΈ z = cast (congr_arg P h) z := by induction h; rfl
-- Porting note (#10756): new theorem. More general version of `eqRec_heq`
theorem eqRec_heq' {Ξ± : Sort*} {a' : Ξ±} {motive : (a : Ξ±) β a' = a β Sort*}
(p : motive a' (rfl : a' = a')) {a : Ξ±} (t : a' = a) :
HEq (@Eq.rec Ξ± a' motive p a t) p := by
subst t; rfl
set_option autoImplicit true in
theorem rec_heq_of_heq {C : Ξ± β Sort*} {x : C a} {y : Ξ²} (e : a = b) (h : HEq x y) :
HEq (e βΈ x) y := by subst e; exact h
#align rec_heq_of_heq rec_heq_of_heq
set_option autoImplicit true in
theorem rec_heq_iff_heq {C : Ξ± β Sort*} {x : C a} {y : Ξ²} {e : a = b} :
HEq (e βΈ x) y β HEq x y := by subst e; rfl
#align rec_heq_iff_heq rec_heq_iff_heq
set_option autoImplicit true in
| Mathlib/Logic/Basic.lean | 611 | 612 | theorem heq_rec_iff_heq {C : Ξ± β Sort*} {x : Ξ²} {y : C a} {e : a = b} :
HEq x (e βΈ y) β HEq x y := by | subst e; rfl
|
import Mathlib.Algebra.Quaternion
import Mathlib.Tactic.Ring
#align_import algebra.quaternion_basis from "leanprover-community/mathlib"@"3aa5b8a9ed7a7cabd36e6e1d022c9858ab8a8c2d"
open Quaternion
namespace QuaternionAlgebra
structure Basis {R : Type*} (A : Type*) [CommRing R] [Ring A] [Algebra R A] (cβ cβ : R) where
(i j k : A)
i_mul_i : i * i = cβ β’ (1 : A)
j_mul_j : j * j = cβ β’ (1 : A)
i_mul_j : i * j = k
j_mul_i : j * i = -k
#align quaternion_algebra.basis QuaternionAlgebra.Basis
variable {R : Type*} {A B : Type*} [CommRing R] [Ring A] [Ring B] [Algebra R A] [Algebra R B]
variable {cβ cβ : R}
namespace Basis
@[ext]
protected theorem ext β¦qβ qβ : Basis A cβ cββ¦ (hi : qβ.i = qβ.i) (hj : qβ.j = qβ.j) : qβ = qβ := by
cases qβ; rename_i qβ_i_mul_j _
cases qβ; rename_i qβ_i_mul_j _
congr
rw [β qβ_i_mul_j, β qβ_i_mul_j]
congr
#align quaternion_algebra.basis.ext QuaternionAlgebra.Basis.ext
variable (R)
@[simps i j k]
protected def self : Basis β[R,cβ,cβ] cβ cβ where
i := β¨0, 1, 0, 0β©
i_mul_i := by ext <;> simp
j := β¨0, 0, 1, 0β©
j_mul_j := by ext <;> simp
k := β¨0, 0, 0, 1β©
i_mul_j := by ext <;> simp
j_mul_i := by ext <;> simp
#align quaternion_algebra.basis.self QuaternionAlgebra.Basis.self
variable {R}
instance : Inhabited (Basis β[R,cβ,cβ] cβ cβ) :=
β¨Basis.self Rβ©
variable (q : Basis A cβ cβ)
attribute [simp] i_mul_i j_mul_j i_mul_j j_mul_i
@[simp]
theorem i_mul_k : q.i * q.k = cβ β’ q.j := by
rw [β i_mul_j, β mul_assoc, i_mul_i, smul_mul_assoc, one_mul]
#align quaternion_algebra.basis.i_mul_k QuaternionAlgebra.Basis.i_mul_k
@[simp]
| Mathlib/Algebra/QuaternionBasis.lean | 89 | 90 | theorem k_mul_i : q.k * q.i = -cβ β’ q.j := by |
rw [β i_mul_j, mul_assoc, j_mul_i, mul_neg, i_mul_k, neg_smul]
|
import Mathlib.Topology.Maps
import Mathlib.Topology.NhdsSet
#align_import topology.constructions from "leanprover-community/mathlib"@"f7ebde7ee0d1505dfccac8644ae12371aa3c1c9f"
noncomputable section
open scoped Classical
open Topology TopologicalSpace Set Filter Function
universe u v
variable {X : Type u} {Y : Type v} {Z W Ξ΅ ΞΆ : Type*}
section Constructions
instance instTopologicalSpaceSubtype {p : X β Prop} [t : TopologicalSpace X] :
TopologicalSpace (Subtype p) :=
induced (β) t
instance {r : X β X β Prop} [t : TopologicalSpace X] : TopologicalSpace (Quot r) :=
coinduced (Quot.mk r) t
instance instTopologicalSpaceQuotient {s : Setoid X} [t : TopologicalSpace X] :
TopologicalSpace (Quotient s) :=
coinduced Quotient.mk' t
instance instTopologicalSpaceProd [tβ : TopologicalSpace X] [tβ : TopologicalSpace Y] :
TopologicalSpace (X Γ Y) :=
induced Prod.fst tβ β induced Prod.snd tβ
instance instTopologicalSpaceSum [tβ : TopologicalSpace X] [tβ : TopologicalSpace Y] :
TopologicalSpace (X β Y) :=
coinduced Sum.inl tβ β coinduced Sum.inr tβ
instance instTopologicalSpaceSigma {ΞΉ : Type*} {X : ΞΉ β Type v} [tβ : β i, TopologicalSpace (X i)] :
TopologicalSpace (Sigma X) :=
β¨ i, coinduced (Sigma.mk i) (tβ i)
instance Pi.topologicalSpace {ΞΉ : Type*} {Y : ΞΉ β Type v} [tβ : (i : ΞΉ) β TopologicalSpace (Y i)] :
TopologicalSpace ((i : ΞΉ) β Y i) :=
β¨
i, induced (fun f => f i) (tβ i)
#align Pi.topological_space Pi.topologicalSpace
instance ULift.topologicalSpace [t : TopologicalSpace X] : TopologicalSpace (ULift.{v, u} X) :=
t.induced ULift.down
#align ulift.topological_space ULift.topologicalSpace
section
variable [TopologicalSpace X]
open Additive Multiplicative
instance : TopologicalSpace (Additive X) := βΉTopologicalSpace XβΊ
instance : TopologicalSpace (Multiplicative X) := βΉTopologicalSpace XβΊ
instance [DiscreteTopology X] : DiscreteTopology (Additive X) := βΉDiscreteTopology XβΊ
instance [DiscreteTopology X] : DiscreteTopology (Multiplicative X) := βΉDiscreteTopology XβΊ
theorem continuous_ofMul : Continuous (ofMul : X β Additive X) := continuous_id
#align continuous_of_mul continuous_ofMul
theorem continuous_toMul : Continuous (toMul : Additive X β X) := continuous_id
#align continuous_to_mul continuous_toMul
theorem continuous_ofAdd : Continuous (ofAdd : X β Multiplicative X) := continuous_id
#align continuous_of_add continuous_ofAdd
theorem continuous_toAdd : Continuous (toAdd : Multiplicative X β X) := continuous_id
#align continuous_to_add continuous_toAdd
theorem isOpenMap_ofMul : IsOpenMap (ofMul : X β Additive X) := IsOpenMap.id
#align is_open_map_of_mul isOpenMap_ofMul
theorem isOpenMap_toMul : IsOpenMap (toMul : Additive X β X) := IsOpenMap.id
#align is_open_map_to_mul isOpenMap_toMul
theorem isOpenMap_ofAdd : IsOpenMap (ofAdd : X β Multiplicative X) := IsOpenMap.id
#align is_open_map_of_add isOpenMap_ofAdd
theorem isOpenMap_toAdd : IsOpenMap (toAdd : Multiplicative X β X) := IsOpenMap.id
#align is_open_map_to_add isOpenMap_toAdd
theorem isClosedMap_ofMul : IsClosedMap (ofMul : X β Additive X) := IsClosedMap.id
#align is_closed_map_of_mul isClosedMap_ofMul
theorem isClosedMap_toMul : IsClosedMap (toMul : Additive X β X) := IsClosedMap.id
#align is_closed_map_to_mul isClosedMap_toMul
theorem isClosedMap_ofAdd : IsClosedMap (ofAdd : X β Multiplicative X) := IsClosedMap.id
#align is_closed_map_of_add isClosedMap_ofAdd
theorem isClosedMap_toAdd : IsClosedMap (toAdd : Multiplicative X β X) := IsClosedMap.id
#align is_closed_map_to_add isClosedMap_toAdd
theorem nhds_ofMul (x : X) : π (ofMul x) = map ofMul (π x) := rfl
#align nhds_of_mul nhds_ofMul
theorem nhds_ofAdd (x : X) : π (ofAdd x) = map ofAdd (π x) := rfl
#align nhds_of_add nhds_ofAdd
theorem nhds_toMul (x : Additive X) : π (toMul x) = map toMul (π x) := rfl
#align nhds_to_mul nhds_toMul
theorem nhds_toAdd (x : Multiplicative X) : π (toAdd x) = map toAdd (π x) := rfl
#align nhds_to_add nhds_toAdd
end
section
variable [TopologicalSpace X]
open OrderDual
instance : TopologicalSpace Xα΅α΅ := βΉTopologicalSpace XβΊ
instance [DiscreteTopology X] : DiscreteTopology Xα΅α΅ := βΉDiscreteTopology XβΊ
theorem continuous_toDual : Continuous (toDual : X β Xα΅α΅) := continuous_id
#align continuous_to_dual continuous_toDual
theorem continuous_ofDual : Continuous (ofDual : Xα΅α΅ β X) := continuous_id
#align continuous_of_dual continuous_ofDual
theorem isOpenMap_toDual : IsOpenMap (toDual : X β Xα΅α΅) := IsOpenMap.id
#align is_open_map_to_dual isOpenMap_toDual
theorem isOpenMap_ofDual : IsOpenMap (ofDual : Xα΅α΅ β X) := IsOpenMap.id
#align is_open_map_of_dual isOpenMap_ofDual
theorem isClosedMap_toDual : IsClosedMap (toDual : X β Xα΅α΅) := IsClosedMap.id
#align is_closed_map_to_dual isClosedMap_toDual
theorem isClosedMap_ofDual : IsClosedMap (ofDual : Xα΅α΅ β X) := IsClosedMap.id
#align is_closed_map_of_dual isClosedMap_ofDual
theorem nhds_toDual (x : X) : π (toDual x) = map toDual (π x) := rfl
#align nhds_to_dual nhds_toDual
theorem nhds_ofDual (x : X) : π (ofDual x) = map ofDual (π x) := rfl
#align nhds_of_dual nhds_ofDual
end
theorem Quotient.preimage_mem_nhds [TopologicalSpace X] [s : Setoid X] {V : Set <| Quotient s}
{x : X} (hs : V β π (Quotient.mk' x)) : Quotient.mk' β»ΒΉ' V β π x :=
preimage_nhds_coinduced hs
#align quotient.preimage_mem_nhds Quotient.preimage_mem_nhds
theorem Dense.quotient [Setoid X] [TopologicalSpace X] {s : Set X} (H : Dense s) :
Dense (Quotient.mk' '' s) :=
Quotient.surjective_Quotient_mk''.denseRange.dense_image continuous_coinduced_rng H
#align dense.quotient Dense.quotient
theorem DenseRange.quotient [Setoid X] [TopologicalSpace X] {f : Y β X} (hf : DenseRange f) :
DenseRange (Quotient.mk' β f) :=
Quotient.surjective_Quotient_mk''.denseRange.comp hf continuous_coinduced_rng
#align dense_range.quotient DenseRange.quotient
theorem continuous_map_of_le {Ξ± : Type*} [TopologicalSpace Ξ±]
{s t : Setoid Ξ±} (h : s β€ t) : Continuous (Setoid.map_of_le h) :=
continuous_coinduced_rng
theorem continuous_map_sInf {Ξ± : Type*} [TopologicalSpace Ξ±]
{S : Set (Setoid Ξ±)} {s : Setoid Ξ±} (h : s β S) : Continuous (Setoid.map_sInf h) :=
continuous_coinduced_rng
instance {p : X β Prop} [TopologicalSpace X] [DiscreteTopology X] : DiscreteTopology (Subtype p) :=
β¨bot_unique fun s _ => β¨(β) '' s, isOpen_discrete _, preimage_image_eq _ Subtype.val_injectiveβ©β©
instance Sum.discreteTopology [TopologicalSpace X] [TopologicalSpace Y] [h : DiscreteTopology X]
[hY : DiscreteTopology Y] : DiscreteTopology (X β Y) :=
β¨sup_eq_bot_iff.2 <| by simp [h.eq_bot, hY.eq_bot]β©
#align sum.discrete_topology Sum.discreteTopology
instance Sigma.discreteTopology {ΞΉ : Type*} {Y : ΞΉ β Type v} [β i, TopologicalSpace (Y i)]
[h : β i, DiscreteTopology (Y i)] : DiscreteTopology (Sigma Y) :=
β¨iSup_eq_bot.2 fun _ => by simp only [(h _).eq_bot, coinduced_bot]β©
#align sigma.discrete_topology Sigma.discreteTopology
def CofiniteTopology (X : Type*) := X
#align cofinite_topology CofiniteTopology
section Sigma
variable {ΞΉ ΞΊ : Type*} {Ο : ΞΉ β Type*} {Ο : ΞΊ β Type*} [β i, TopologicalSpace (Ο i)]
[β k, TopologicalSpace (Ο k)] [TopologicalSpace X]
@[continuity]
theorem continuous_sigmaMk {i : ΞΉ} : Continuous (@Sigma.mk ΞΉ Ο i) :=
continuous_iSup_rng continuous_coinduced_rng
#align continuous_sigma_mk continuous_sigmaMk
-- Porting note: the proof was `by simp only [isOpen_iSup_iff, isOpen_coinduced]`
theorem isOpen_sigma_iff {s : Set (Sigma Ο)} : IsOpen s β β i, IsOpen (Sigma.mk i β»ΒΉ' s) := by
delta instTopologicalSpaceSigma
rw [isOpen_iSup_iff]
rfl
#align is_open_sigma_iff isOpen_sigma_iff
theorem isClosed_sigma_iff {s : Set (Sigma Ο)} : IsClosed s β β i, IsClosed (Sigma.mk i β»ΒΉ' s) := by
simp only [β isOpen_compl_iff, isOpen_sigma_iff, preimage_compl]
#align is_closed_sigma_iff isClosed_sigma_iff
theorem isOpenMap_sigmaMk {i : ΞΉ} : IsOpenMap (@Sigma.mk ΞΉ Ο i) := by
intro s hs
rw [isOpen_sigma_iff]
intro j
rcases eq_or_ne j i with (rfl | hne)
Β· rwa [preimage_image_eq _ sigma_mk_injective]
Β· rw [preimage_image_sigmaMk_of_ne hne]
exact isOpen_empty
#align is_open_map_sigma_mk isOpenMap_sigmaMk
theorem isOpen_range_sigmaMk {i : ΞΉ} : IsOpen (range (@Sigma.mk ΞΉ Ο i)) :=
isOpenMap_sigmaMk.isOpen_range
#align is_open_range_sigma_mk isOpen_range_sigmaMk
| Mathlib/Topology/Constructions.lean | 1,605 | 1,612 | theorem isClosedMap_sigmaMk {i : ΞΉ} : IsClosedMap (@Sigma.mk ΞΉ Ο i) := by |
intro s hs
rw [isClosed_sigma_iff]
intro j
rcases eq_or_ne j i with (rfl | hne)
Β· rwa [preimage_image_eq _ sigma_mk_injective]
Β· rw [preimage_image_sigmaMk_of_ne hne]
exact isClosed_empty
|
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.LinearCombination
import Mathlib.Lean.Expr.ExtraRecognizers
import Mathlib.Data.Set.Subsingleton
#align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
noncomputable section
open Function Set Submodule
open Cardinal
universe u' u
variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*}
variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*}
section Module
variable {v : ΞΉ β M}
variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M'']
variable [Module R M] [Module R M'] [Module R M'']
variable {a b : R} {x y : M}
variable (R) (v)
def LinearIndependent : Prop :=
LinearMap.ker (Finsupp.total ΞΉ M R v) = β₯
#align linear_independent LinearIndependent
open Lean PrettyPrinter.Delaborator SubExpr in
@[delab app.LinearIndependent]
def delabLinearIndependent : Delab :=
whenPPOption getPPNotation <|
whenNotPPOption getPPAnalysisSkip <|
withOptionAtCurrPos `pp.analysis.skip true do
let e β getExpr
guard <| e.isAppOfArity ``LinearIndependent 7
let some _ := (e.getArg! 0).coeTypeSet? | failure
let optionsPerPos β if (e.getArg! 3).isLambda then
withNaryArg 3 do return (β read).optionsPerPos.setBool (β getPos) pp.funBinderTypes.name true
else
withNaryArg 0 do return (β read).optionsPerPos.setBool (β getPos) `pp.analysis.namedArg true
withTheReader Context ({Β· with optionsPerPos}) delab
variable {R} {v}
theorem linearIndependent_iff :
LinearIndependent R v β β l, Finsupp.total ΞΉ M R v l = 0 β l = 0 := by
simp [LinearIndependent, LinearMap.ker_eq_bot']
#align linear_independent_iff linearIndependent_iff
theorem linearIndependent_iff' :
LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β β i β s, g i = 0 :=
linearIndependent_iff.trans
β¨fun hf s g hg i his =>
have h :=
hf (β i β s, Finsupp.single i (g i)) <| by
simpa only [map_sum, Finsupp.total_single] using hg
calc
g i = (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single i (g i)) := by
{ rw [Finsupp.lapply_apply, Finsupp.single_eq_same] }
_ = β j β s, (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single j (g j)) :=
Eq.symm <|
Finset.sum_eq_single i
(fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji])
fun hnis => hnis.elim his
_ = (β j β s, Finsupp.single j (g j)) i := (map_sum ..).symm
_ = 0 := DFunLike.ext_iff.1 h i,
fun hf l hl =>
Finsupp.ext fun i =>
_root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hniβ©
#align linear_independent_iff' linearIndependent_iff'
theorem linearIndependent_iff'' :
LinearIndependent R v β
β (s : Finset ΞΉ) (g : ΞΉ β R), (β i β s, g i = 0) β
β i β s, g i β’ v i = 0 β β i, g i = 0 := by
classical
exact linearIndependent_iff'.trans
β¨fun H s g hg hv i => if his : i β s then H s g hv i his else hg i his, fun H s g hg i hi => by
convert
H s (fun j => if j β s then g j else 0) (fun j hj => if_neg hj)
(by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i
exact (if_pos hi).symmβ©
#align linear_independent_iff'' linearIndependent_iff''
theorem not_linearIndependent_iff :
Β¬LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β§ β i β s, g i β 0 := by
rw [linearIndependent_iff']
simp only [exists_prop, not_forall]
#align not_linear_independent_iff not_linearIndependent_iff
theorem Fintype.linearIndependent_iff [Fintype ΞΉ] :
LinearIndependent R v β β g : ΞΉ β R, β i, g i β’ v i = 0 β β i, g i = 0 := by
refine
β¨fun H g => by simpa using linearIndependent_iff'.1 H Finset.univ g, fun H =>
linearIndependent_iff''.2 fun s g hg hs i => H _ ?_ _β©
rw [β hs]
refine (Finset.sum_subset (Finset.subset_univ _) fun i _ hi => ?_).symm
rw [hg i hi, zero_smul]
#align fintype.linear_independent_iff Fintype.linearIndependent_iff
theorem Fintype.linearIndependent_iff' [Fintype ΞΉ] [DecidableEq ΞΉ] :
LinearIndependent R v β
LinearMap.ker (LinearMap.lsum R (fun _ β¦ R) β fun i β¦ LinearMap.id.smulRight (v i)) = β₯ := by
simp [Fintype.linearIndependent_iff, LinearMap.ker_eq_bot', funext_iff]
#align fintype.linear_independent_iff' Fintype.linearIndependent_iff'
theorem Fintype.not_linearIndependent_iff [Fintype ΞΉ] :
Β¬LinearIndependent R v β β g : ΞΉ β R, β i, g i β’ v i = 0 β§ β i, g i β 0 := by
simpa using not_iff_not.2 Fintype.linearIndependent_iff
#align fintype.not_linear_independent_iff Fintype.not_linearIndependent_iff
theorem linearIndependent_empty_type [IsEmpty ΞΉ] : LinearIndependent R v :=
linearIndependent_iff.mpr fun v _hv => Subsingleton.elim v 0
#align linear_independent_empty_type linearIndependent_empty_type
theorem LinearIndependent.ne_zero [Nontrivial R] (i : ΞΉ) (hv : LinearIndependent R v) : v i β 0 :=
fun h =>
zero_ne_one' R <|
Eq.symm
(by
suffices (Finsupp.single i 1 : ΞΉ ββ R) i = 0 by simpa
rw [linearIndependent_iff.1 hv (Finsupp.single i 1)]
Β· simp
Β· simp [h])
#align linear_independent.ne_zero LinearIndependent.ne_zero
lemma LinearIndependent.eq_zero_of_pair {x y : M} (h : LinearIndependent R ![x, y])
{s t : R} (h' : s β’ x + t β’ y = 0) : s = 0 β§ t = 0 := by
have := linearIndependent_iff'.1 h Finset.univ ![s, t]
simp only [Fin.sum_univ_two, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, h',
Finset.mem_univ, forall_true_left] at this
exact β¨this 0, this 1β©
lemma LinearIndependent.pair_iff {x y : M} :
LinearIndependent R ![x, y] β β (s t : R), s β’ x + t β’ y = 0 β s = 0 β§ t = 0 := by
refine β¨fun h s t hst β¦ h.eq_zero_of_pair hst, fun h β¦ ?_β©
apply Fintype.linearIndependent_iff.2
intro g hg
simp only [Fin.sum_univ_two, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons] at hg
intro i
fin_cases i
exacts [(h _ _ hg).1, (h _ _ hg).2]
theorem LinearIndependent.comp (h : LinearIndependent R v) (f : ΞΉ' β ΞΉ) (hf : Injective f) :
LinearIndependent R (v β f) := by
rw [linearIndependent_iff, Finsupp.total_comp]
intro l hl
have h_map_domain : β x, (Finsupp.mapDomain f l) (f x) = 0 := by
rw [linearIndependent_iff.1 h (Finsupp.mapDomain f l) hl]; simp
ext x
convert h_map_domain x
rw [Finsupp.mapDomain_apply hf]
#align linear_independent.comp LinearIndependent.comp
theorem linearIndependent_iff_finset_linearIndependent :
LinearIndependent R v β β (s : Finset ΞΉ), LinearIndependent R (v β (Subtype.val : s β ΞΉ)) :=
β¨fun H _ β¦ H.comp _ Subtype.val_injective, fun H β¦ linearIndependent_iff'.2 fun s g hg i hi β¦
Fintype.linearIndependent_iff.1 (H s) (g β Subtype.val)
(hg βΈ Finset.sum_attach s fun j β¦ g j β’ v j) β¨i, hiβ©β©
theorem LinearIndependent.coe_range (i : LinearIndependent R v) :
LinearIndependent R ((β) : range v β M) := by simpa using i.comp _ (rangeSplitting_injective v)
#align linear_independent.coe_range LinearIndependent.coe_range
theorem LinearIndependent.map (hv : LinearIndependent R v) {f : M ββ[R] M'}
(hf_inj : Disjoint (span R (range v)) (LinearMap.ker f)) : LinearIndependent R (f β v) := by
rw [disjoint_iff_inf_le, β Set.image_univ, Finsupp.span_image_eq_map_total,
map_inf_eq_map_inf_comap, map_le_iff_le_comap, comap_bot, Finsupp.supported_univ, top_inf_eq]
at hf_inj
unfold LinearIndependent at hv β’
rw [hv, le_bot_iff] at hf_inj
haveI : Inhabited M := β¨0β©
rw [Finsupp.total_comp, Finsupp.lmapDomain_total _ _ f, LinearMap.ker_comp,
hf_inj]
exact fun _ => rfl
#align linear_independent.map LinearIndependent.map
theorem Submodule.range_ker_disjoint {f : M ββ[R] M'}
(hv : LinearIndependent R (f β v)) :
Disjoint (span R (range v)) (LinearMap.ker f) := by
rw [LinearIndependent, Finsupp.total_comp, Finsupp.lmapDomain_total R _ f (fun _ β¦ rfl),
LinearMap.ker_comp] at hv
rw [disjoint_iff_inf_le, β Set.image_univ, Finsupp.span_image_eq_map_total,
map_inf_eq_map_inf_comap, hv, inf_bot_eq, map_bot]
theorem LinearIndependent.map' (hv : LinearIndependent R v) (f : M ββ[R] M')
(hf_inj : LinearMap.ker f = β₯) : LinearIndependent R (f β v) :=
hv.map <| by simp [hf_inj]
#align linear_independent.map' LinearIndependent.map'
theorem LinearIndependent.map_of_injective_injective {R' : Type*} {M' : Type*}
[Semiring R'] [AddCommMonoid M'] [Module R' M'] (hv : LinearIndependent R v)
(i : R' β R) (j : M β+ M') (hi : β r, i r = 0 β r = 0) (hj : β m, j m = 0 β m = 0)
(hc : β (r : R') (m : M), j (i r β’ m) = r β’ j m) : LinearIndependent R' (j β v) := by
rw [linearIndependent_iff'] at hv β’
intro S r' H s hs
simp_rw [comp_apply, β hc, β map_sum] at H
exact hi _ <| hv _ _ (hj _ H) s hs
theorem LinearIndependent.map_of_surjective_injective {R' : Type*} {M' : Type*}
[Semiring R'] [AddCommMonoid M'] [Module R' M'] (hv : LinearIndependent R v)
(i : ZeroHom R R') (j : M β+ M') (hi : Surjective i) (hj : β m, j m = 0 β m = 0)
(hc : β (r : R) (m : M), j (r β’ m) = i r β’ j m) : LinearIndependent R' (j β v) := by
obtain β¨i', hi'β© := hi.hasRightInverse
refine hv.map_of_injective_injective i' j (fun _ h β¦ ?_) hj fun r m β¦ ?_
Β· apply_fun i at h
rwa [hi', i.map_zero] at h
rw [hc (i' r) m, hi']
theorem LinearIndependent.of_comp (f : M ββ[R] M') (hfv : LinearIndependent R (f β v)) :
LinearIndependent R v :=
linearIndependent_iff'.2 fun s g hg i his =>
have : (β i β s, g i β’ f (v i)) = 0 := by
simp_rw [β map_smul, β map_sum, hg, f.map_zero]
linearIndependent_iff'.1 hfv s g this i his
#align linear_independent.of_comp LinearIndependent.of_comp
protected theorem LinearMap.linearIndependent_iff (f : M ββ[R] M') (hf_inj : LinearMap.ker f = β₯) :
LinearIndependent R (f β v) β LinearIndependent R v :=
β¨fun h => h.of_comp f, fun h => h.map <| by simp only [hf_inj, disjoint_bot_right]β©
#align linear_map.linear_independent_iff LinearMap.linearIndependent_iff
@[nontriviality]
theorem linearIndependent_of_subsingleton [Subsingleton R] : LinearIndependent R v :=
linearIndependent_iff.2 fun _l _hl => Subsingleton.elim _ _
#align linear_independent_of_subsingleton linearIndependent_of_subsingleton
theorem linearIndependent_equiv (e : ΞΉ β ΞΉ') {f : ΞΉ' β M} :
LinearIndependent R (f β e) β LinearIndependent R f :=
β¨fun h => Function.comp_id f βΈ e.self_comp_symm βΈ h.comp _ e.symm.injective, fun h =>
h.comp _ e.injectiveβ©
#align linear_independent_equiv linearIndependent_equiv
theorem linearIndependent_equiv' (e : ΞΉ β ΞΉ') {f : ΞΉ' β M} {g : ΞΉ β M} (h : f β e = g) :
LinearIndependent R g β LinearIndependent R f :=
h βΈ linearIndependent_equiv e
#align linear_independent_equiv' linearIndependent_equiv'
theorem linearIndependent_subtype_range {ΞΉ} {f : ΞΉ β M} (hf : Injective f) :
LinearIndependent R ((β) : range f β M) β LinearIndependent R f :=
Iff.symm <| linearIndependent_equiv' (Equiv.ofInjective f hf) rfl
#align linear_independent_subtype_range linearIndependent_subtype_range
alias β¨LinearIndependent.of_subtype_range, _β© := linearIndependent_subtype_range
#align linear_independent.of_subtype_range LinearIndependent.of_subtype_range
theorem linearIndependent_image {ΞΉ} {s : Set ΞΉ} {f : ΞΉ β M} (hf : Set.InjOn f s) :
(LinearIndependent R fun x : s => f x) β LinearIndependent R fun x : f '' s => (x : M) :=
linearIndependent_equiv' (Equiv.Set.imageOfInjOn _ _ hf) rfl
#align linear_independent_image linearIndependent_image
theorem linearIndependent_span (hs : LinearIndependent R v) :
LinearIndependent R (M := span R (range v))
(fun i : ΞΉ => β¨v i, subset_span (mem_range_self i)β©) :=
LinearIndependent.of_comp (span R (range v)).subtype hs
#align linear_independent_span linearIndependent_span
theorem LinearIndependent.fin_cons' {m : β} (x : M) (v : Fin m β M) (hli : LinearIndependent R v)
(x_ortho : β (c : R) (y : Submodule.span R (Set.range v)), c β’ x + y = (0 : M) β c = 0) :
LinearIndependent R (Fin.cons x v : Fin m.succ β M) := by
rw [Fintype.linearIndependent_iff] at hli β’
rintro g total_eq j
simp_rw [Fin.sum_univ_succ, Fin.cons_zero, Fin.cons_succ] at total_eq
have : g 0 = 0 := by
refine x_ortho (g 0) β¨β i : Fin m, g i.succ β’ v i, ?_β© total_eq
exact sum_mem fun i _ => smul_mem _ _ (subset_span β¨i, rflβ©)
rw [this, zero_smul, zero_add] at total_eq
exact Fin.cases this (hli _ total_eq) j
#align linear_independent.fin_cons' LinearIndependent.fin_cons'
theorem LinearIndependent.restrict_scalars [Semiring K] [SMulWithZero R K] [Module K M]
[IsScalarTower R K M] (hinj : Function.Injective fun r : R => r β’ (1 : K))
(li : LinearIndependent K v) : LinearIndependent R v := by
refine linearIndependent_iff'.mpr fun s g hg i hi => hinj ?_
dsimp only; rw [zero_smul]
refine (linearIndependent_iff'.mp li : _) _ (g Β· β’ (1:K)) ?_ i hi
simp_rw [smul_assoc, one_smul]
exact hg
#align linear_independent.restrict_scalars LinearIndependent.restrict_scalars
theorem linearIndependent_finset_map_embedding_subtype (s : Set M)
(li : LinearIndependent R ((β) : s β M)) (t : Finset s) :
LinearIndependent R ((β) : Finset.map (Embedding.subtype s) t β M) := by
let f : t.map (Embedding.subtype s) β s := fun x =>
β¨x.1, by
obtain β¨x, hβ© := x
rw [Finset.mem_map] at h
obtain β¨a, _ha, rflβ© := h
simp only [Subtype.coe_prop, Embedding.coe_subtype]β©
convert LinearIndependent.comp li f ?_
rintro β¨x, hxβ© β¨y, hyβ©
rw [Finset.mem_map] at hx hy
obtain β¨a, _ha, rflβ© := hx
obtain β¨b, _hb, rflβ© := hy
simp only [f, imp_self, Subtype.mk_eq_mk]
#align linear_independent_finset_map_embedding_subtype linearIndependent_finset_map_embedding_subtype
| Mathlib/LinearAlgebra/LinearIndependent.lean | 419 | 427 | theorem linearIndependent_bounded_of_finset_linearIndependent_bounded {n : β}
(H : β s : Finset M, (LinearIndependent R fun i : s => (i : M)) β s.card β€ n) :
β s : Set M, LinearIndependent R ((β) : s β M) β #s β€ n := by |
intro s li
apply Cardinal.card_le_of
intro t
rw [β Finset.card_map (Embedding.subtype s)]
apply H
apply linearIndependent_finset_map_embedding_subtype _ li
|
import Mathlib.CategoryTheory.EpiMono
import Mathlib.CategoryTheory.Limits.Shapes.StrongEpi
import Mathlib.CategoryTheory.LiftingProperties.Adjunction
#align_import category_theory.functor.epi_mono from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514"
open CategoryTheory
universe vβ vβ vβ uβ uβ uβ
namespace CategoryTheory.Functor
variable {C : Type uβ} [Category.{vβ} C] {D : Type uβ} [Category.{vβ} D] {E : Type uβ}
[Category.{vβ} E]
class PreservesMonomorphisms (F : C β₯€ D) : Prop where
preserves : β {X Y : C} (f : X βΆ Y) [Mono f], Mono (F.map f)
#align category_theory.functor.preserves_monomorphisms CategoryTheory.Functor.PreservesMonomorphisms
instance map_mono (F : C β₯€ D) [PreservesMonomorphisms F] {X Y : C} (f : X βΆ Y) [Mono f] :
Mono (F.map f) :=
PreservesMonomorphisms.preserves f
#align category_theory.functor.map_mono CategoryTheory.Functor.map_mono
class PreservesEpimorphisms (F : C β₯€ D) : Prop where
preserves : β {X Y : C} (f : X βΆ Y) [Epi f], Epi (F.map f)
#align category_theory.functor.preserves_epimorphisms CategoryTheory.Functor.PreservesEpimorphisms
instance map_epi (F : C β₯€ D) [PreservesEpimorphisms F] {X Y : C} (f : X βΆ Y) [Epi f] :
Epi (F.map f) :=
PreservesEpimorphisms.preserves f
#align category_theory.functor.map_epi CategoryTheory.Functor.map_epi
class ReflectsMonomorphisms (F : C β₯€ D) : Prop where
reflects : β {X Y : C} (f : X βΆ Y), Mono (F.map f) β Mono f
#align category_theory.functor.reflects_monomorphisms CategoryTheory.Functor.ReflectsMonomorphisms
theorem mono_of_mono_map (F : C β₯€ D) [ReflectsMonomorphisms F] {X Y : C} {f : X βΆ Y}
(h : Mono (F.map f)) : Mono f :=
ReflectsMonomorphisms.reflects f h
#align category_theory.functor.mono_of_mono_map CategoryTheory.Functor.mono_of_mono_map
class ReflectsEpimorphisms (F : C β₯€ D) : Prop where
reflects : β {X Y : C} (f : X βΆ Y), Epi (F.map f) β Epi f
#align category_theory.functor.reflects_epimorphisms CategoryTheory.Functor.ReflectsEpimorphisms
theorem epi_of_epi_map (F : C β₯€ D) [ReflectsEpimorphisms F] {X Y : C} {f : X βΆ Y}
(h : Epi (F.map f)) : Epi f :=
ReflectsEpimorphisms.reflects f h
#align category_theory.functor.epi_of_epi_map CategoryTheory.Functor.epi_of_epi_map
instance preservesMonomorphisms_comp (F : C β₯€ D) (G : D β₯€ E) [PreservesMonomorphisms F]
[PreservesMonomorphisms G] : PreservesMonomorphisms (F β G) where
preserves f h := by
rw [comp_map]
exact inferInstance
#align category_theory.functor.preserves_monomorphisms_comp CategoryTheory.Functor.preservesMonomorphisms_comp
instance preservesEpimorphisms_comp (F : C β₯€ D) (G : D β₯€ E) [PreservesEpimorphisms F]
[PreservesEpimorphisms G] : PreservesEpimorphisms (F β G) where
preserves f h := by
rw [comp_map]
exact inferInstance
#align category_theory.functor.preserves_epimorphisms_comp CategoryTheory.Functor.preservesEpimorphisms_comp
instance reflectsMonomorphisms_comp (F : C β₯€ D) (G : D β₯€ E) [ReflectsMonomorphisms F]
[ReflectsMonomorphisms G] : ReflectsMonomorphisms (F β G) where
reflects _ h := F.mono_of_mono_map (G.mono_of_mono_map h)
#align category_theory.functor.reflects_monomorphisms_comp CategoryTheory.Functor.reflectsMonomorphisms_comp
instance reflectsEpimorphisms_comp (F : C β₯€ D) (G : D β₯€ E) [ReflectsEpimorphisms F]
[ReflectsEpimorphisms G] : ReflectsEpimorphisms (F β G) where
reflects _ h := F.epi_of_epi_map (G.epi_of_epi_map h)
#align category_theory.functor.reflects_epimorphisms_comp CategoryTheory.Functor.reflectsEpimorphisms_comp
theorem preservesEpimorphisms_of_preserves_of_reflects (F : C β₯€ D) (G : D β₯€ E)
[PreservesEpimorphisms (F β G)] [ReflectsEpimorphisms G] : PreservesEpimorphisms F :=
β¨fun f _ => G.epi_of_epi_map <| show Epi ((F β G).map f) from inferInstanceβ©
#align category_theory.functor.preserves_epimorphisms_of_preserves_of_reflects CategoryTheory.Functor.preservesEpimorphisms_of_preserves_of_reflects
theorem preservesMonomorphisms_of_preserves_of_reflects (F : C β₯€ D) (G : D β₯€ E)
[PreservesMonomorphisms (F β G)] [ReflectsMonomorphisms G] : PreservesMonomorphisms F :=
β¨fun f _ => G.mono_of_mono_map <| show Mono ((F β G).map f) from inferInstanceβ©
#align category_theory.functor.preserves_monomorphisms_of_preserves_of_reflects CategoryTheory.Functor.preservesMonomorphisms_of_preserves_of_reflects
theorem reflectsEpimorphisms_of_preserves_of_reflects (F : C β₯€ D) (G : D β₯€ E)
[PreservesEpimorphisms G] [ReflectsEpimorphisms (F β G)] : ReflectsEpimorphisms F :=
β¨fun f _ => (F β G).epi_of_epi_map <| show Epi (G.map (F.map f)) from inferInstanceβ©
#align category_theory.functor.reflects_epimorphisms_of_preserves_of_reflects CategoryTheory.Functor.reflectsEpimorphisms_of_preserves_of_reflects
theorem reflectsMonomorphisms_of_preserves_of_reflects (F : C β₯€ D) (G : D β₯€ E)
[PreservesMonomorphisms G] [ReflectsMonomorphisms (F β G)] : ReflectsMonomorphisms F :=
β¨fun f _ => (F β G).mono_of_mono_map <| show Mono (G.map (F.map f)) from inferInstanceβ©
#align category_theory.functor.reflects_monomorphisms_of_preserves_of_reflects CategoryTheory.Functor.reflectsMonomorphisms_of_preserves_of_reflects
theorem preservesMonomorphisms.of_iso {F G : C β₯€ D} [PreservesMonomorphisms F] (Ξ± : F β
G) :
PreservesMonomorphisms G :=
{ preserves := fun {X} {Y} f h => by
haveI : Mono (F.map f β« (Ξ±.app Y).hom) := mono_comp _ _
convert (mono_comp _ _ : Mono ((Ξ±.app X).inv β« F.map f β« (Ξ±.app Y).hom))
rw [Iso.eq_inv_comp, Iso.app_hom, Iso.app_hom, NatTrans.naturality] }
#align category_theory.functor.preserves_monomorphisms.of_iso CategoryTheory.Functor.preservesMonomorphisms.of_iso
theorem preservesMonomorphisms.iso_iff {F G : C β₯€ D} (Ξ± : F β
G) :
PreservesMonomorphisms F β PreservesMonomorphisms G :=
β¨fun _ => preservesMonomorphisms.of_iso Ξ±, fun _ => preservesMonomorphisms.of_iso Ξ±.symmβ©
#align category_theory.functor.preserves_monomorphisms.iso_iff CategoryTheory.Functor.preservesMonomorphisms.iso_iff
theorem preservesEpimorphisms.of_iso {F G : C β₯€ D} [PreservesEpimorphisms F] (Ξ± : F β
G) :
PreservesEpimorphisms G :=
{ preserves := fun {X} {Y} f h => by
haveI : Epi (F.map f β« (Ξ±.app Y).hom) := epi_comp _ _
convert (epi_comp _ _ : Epi ((Ξ±.app X).inv β« F.map f β« (Ξ±.app Y).hom))
rw [Iso.eq_inv_comp, Iso.app_hom, Iso.app_hom, NatTrans.naturality] }
#align category_theory.functor.preserves_epimorphisms.of_iso CategoryTheory.Functor.preservesEpimorphisms.of_iso
theorem preservesEpimorphisms.iso_iff {F G : C β₯€ D} (Ξ± : F β
G) :
PreservesEpimorphisms F β PreservesEpimorphisms G :=
β¨fun _ => preservesEpimorphisms.of_iso Ξ±, fun _ => preservesEpimorphisms.of_iso Ξ±.symmβ©
#align category_theory.functor.preserves_epimorphisms.iso_iff CategoryTheory.Functor.preservesEpimorphisms.iso_iff
theorem reflectsMonomorphisms.of_iso {F G : C β₯€ D} [ReflectsMonomorphisms F] (Ξ± : F β
G) :
ReflectsMonomorphisms G :=
{ reflects := fun {X} {Y} f h => by
apply F.mono_of_mono_map
haveI : Mono (G.map f β« (Ξ±.app Y).inv) := mono_comp _ _
convert (mono_comp _ _ : Mono ((Ξ±.app X).hom β« G.map f β« (Ξ±.app Y).inv))
rw [β Category.assoc, Iso.eq_comp_inv, Iso.app_hom, Iso.app_hom, NatTrans.naturality] }
#align category_theory.functor.reflects_monomorphisms.of_iso CategoryTheory.Functor.reflectsMonomorphisms.of_iso
theorem reflectsMonomorphisms.iso_iff {F G : C β₯€ D} (Ξ± : F β
G) :
ReflectsMonomorphisms F β ReflectsMonomorphisms G :=
β¨fun _ => reflectsMonomorphisms.of_iso Ξ±, fun _ => reflectsMonomorphisms.of_iso Ξ±.symmβ©
#align category_theory.functor.reflects_monomorphisms.iso_iff CategoryTheory.Functor.reflectsMonomorphisms.iso_iff
theorem reflectsEpimorphisms.of_iso {F G : C β₯€ D} [ReflectsEpimorphisms F] (Ξ± : F β
G) :
ReflectsEpimorphisms G :=
{ reflects := fun {X} {Y} f h => by
apply F.epi_of_epi_map
haveI : Epi (G.map f β« (Ξ±.app Y).inv) := epi_comp _ _
convert (epi_comp _ _ : Epi ((Ξ±.app X).hom β« G.map f β« (Ξ±.app Y).inv))
rw [β Category.assoc, Iso.eq_comp_inv, Iso.app_hom, Iso.app_hom, NatTrans.naturality] }
#align category_theory.functor.reflects_epimorphisms.of_iso CategoryTheory.Functor.reflectsEpimorphisms.of_iso
theorem reflectsEpimorphisms.iso_iff {F G : C β₯€ D} (Ξ± : F β
G) :
ReflectsEpimorphisms F β ReflectsEpimorphisms G :=
β¨fun _ => reflectsEpimorphisms.of_iso Ξ±, fun _ => reflectsEpimorphisms.of_iso Ξ±.symmβ©
#align category_theory.functor.reflects_epimorphisms.iso_iff CategoryTheory.Functor.reflectsEpimorphisms.iso_iff
theorem preservesEpimorphsisms_of_adjunction {F : C β₯€ D} {G : D β₯€ C} (adj : F β£ G) :
PreservesEpimorphisms F :=
{ preserves := fun {X} {Y} f hf =>
β¨by
intro Z g h H
replace H := congr_arg (adj.homEquiv X Z) H
rwa [adj.homEquiv_naturality_left, adj.homEquiv_naturality_left, cancel_epi,
Equiv.apply_eq_iff_eq] at Hβ© }
#align category_theory.functor.preserves_epimorphsisms_of_adjunction CategoryTheory.Functor.preservesEpimorphsisms_of_adjunction
instance (priority := 100) preservesEpimorphisms_of_isLeftAdjoint (F : C β₯€ D) [IsLeftAdjoint F] :
PreservesEpimorphisms F :=
preservesEpimorphsisms_of_adjunction (Adjunction.ofIsLeftAdjoint F)
#align category_theory.functor.preserves_epimorphisms_of_is_left_adjoint CategoryTheory.Functor.preservesEpimorphisms_of_isLeftAdjoint
theorem preservesMonomorphisms_of_adjunction {F : C β₯€ D} {G : D β₯€ C} (adj : F β£ G) :
PreservesMonomorphisms G :=
{ preserves := fun {X} {Y} f hf =>
β¨by
intro Z g h H
replace H := congr_arg (adj.homEquiv Z Y).symm H
rwa [adj.homEquiv_naturality_right_symm, adj.homEquiv_naturality_right_symm, cancel_mono,
Equiv.apply_eq_iff_eq] at Hβ© }
#align category_theory.functor.preserves_monomorphisms_of_adjunction CategoryTheory.Functor.preservesMonomorphisms_of_adjunction
instance (priority := 100) preservesMonomorphisms_of_isRightAdjoint (F : C β₯€ D) [IsRightAdjoint F] :
PreservesMonomorphisms F :=
preservesMonomorphisms_of_adjunction (Adjunction.ofIsRightAdjoint F)
#align category_theory.functor.preserves_monomorphisms_of_is_right_adjoint CategoryTheory.Functor.preservesMonomorphisms_of_isRightAdjoint
instance (priority := 100) reflectsMonomorphisms_of_faithful (F : C β₯€ D) [Faithful F] :
ReflectsMonomorphisms F where
reflects {X} {Y} f hf :=
β¨fun {Z} g h hgh =>
F.map_injective ((cancel_mono (F.map f)).1 (by rw [β F.map_comp, hgh, F.map_comp]))β©
#align category_theory.functor.reflects_monomorphisms_of_faithful CategoryTheory.Functor.reflectsMonomorphisms_of_faithful
instance (priority := 100) reflectsEpimorphisms_of_faithful (F : C β₯€ D) [Faithful F] :
ReflectsEpimorphisms F where
reflects {X} {Y} f hf :=
β¨fun {Z} g h hgh =>
F.map_injective ((cancel_epi (F.map f)).1 (by rw [β F.map_comp, hgh, F.map_comp]))β©
#align category_theory.functor.reflects_epimorphisms_of_faithful CategoryTheory.Functor.reflectsEpimorphisms_of_faithful
section
variable (F : C β₯€ D) {X Y : C} (f : X βΆ Y)
noncomputable def splitEpiEquiv [Full F] [Faithful F] : SplitEpi f β SplitEpi (F.map f) where
toFun f := f.map F
invFun s := β¨F.preimage s.section_, by
apply F.map_injective
simp only [map_comp, map_preimage, map_id]
apply SplitEpi.idβ©
left_inv := by aesop_cat
right_inv x := by aesop_cat
#align category_theory.functor.split_epi_equiv CategoryTheory.Functor.splitEpiEquiv
@[simp]
| Mathlib/CategoryTheory/Functor/EpiMono.lean | 235 | 240 | theorem isSplitEpi_iff [Full F] [Faithful F] : IsSplitEpi (F.map f) β IsSplitEpi f := by |
constructor
Β· intro h
exact IsSplitEpi.mk' ((splitEpiEquiv F f).invFun h.exists_splitEpi.some)
Β· intro h
exact IsSplitEpi.mk' ((splitEpiEquiv F f).toFun h.exists_splitEpi.some)
|
import Mathlib.MeasureTheory.Constructions.Pi
import Mathlib.MeasureTheory.Integral.Lebesgue
open scoped Classical ENNReal
open Set Function Equiv Finset
noncomputable section
namespace MeasureTheory
section LMarginal
variable {Ξ΄ Ξ΄' : Type*} {Ο : Ξ΄ β Type*} [β x, MeasurableSpace (Ο x)]
variable {ΞΌ : β i, Measure (Ο i)} [β i, SigmaFinite (ΞΌ i)] [DecidableEq Ξ΄]
variable {s t : Finset Ξ΄} {f g : (β i, Ο i) β ββ₯0β} {x y : β i, Ο i} {i : Ξ΄}
def lmarginal (ΞΌ : β i, Measure (Ο i)) (s : Finset Ξ΄) (f : (β i, Ο i) β ββ₯0β)
(x : β i, Ο i) : ββ₯0β :=
β«β» y : β i : s, Ο i, f (updateFinset x s y) βMeasure.pi fun i : s => ΞΌ i
-- Note: this notation is not a binder. This is more convenient since it returns a function.
@[inherit_doc]
notation "β«β―β«β»_" s ", " f " β" ΞΌ:70 => lmarginal ΞΌ s f
@[inherit_doc]
notation "β«β―β«β»_" s ", " f => lmarginal (fun _ β¦ volume) s f
variable (ΞΌ)
theorem _root_.Measurable.lmarginal (hf : Measurable f) : Measurable (β«β―β«β»_s, f βΞΌ) := by
refine Measurable.lintegral_prod_right ?_
refine hf.comp ?_
rw [measurable_pi_iff]; intro i
by_cases hi : i β s
Β· simp [hi, updateFinset]
exact measurable_pi_iff.1 measurable_snd _
Β· simp [hi, updateFinset]
exact measurable_pi_iff.1 measurable_fst _
@[simp] theorem lmarginal_empty (f : (β i, Ο i) β ββ₯0β) : β«β―β«β»_β
, f βΞΌ = f := by
ext1 x
simp_rw [lmarginal, Measure.pi_of_empty fun i : (β
: Finset Ξ΄) => ΞΌ i]
apply lintegral_dirac'
exact Subsingleton.measurable
theorem lmarginal_congr {x y : β i, Ο i} (f : (β i, Ο i) β ββ₯0β)
(h : β i β s, x i = y i) :
(β«β―β«β»_s, f βΞΌ) x = (β«β―β«β»_s, f βΞΌ) y := by
dsimp [lmarginal, updateFinset_def]; rcongr; exact h _ βΉ_βΊ
theorem lmarginal_update_of_mem {i : Ξ΄} (hi : i β s)
(f : (β i, Ο i) β ββ₯0β) (x : β i, Ο i) (y : Ο i) :
(β«β―β«β»_s, f βΞΌ) (Function.update x i y) = (β«β―β«β»_s, f βΞΌ) x := by
apply lmarginal_congr
intro j hj
have : j β i := by rintro rfl; exact hj hi
apply update_noteq this
theorem lmarginal_union (f : (β i, Ο i) β ββ₯0β) (hf : Measurable f)
(hst : Disjoint s t) : β«β―β«β»_s βͺ t, f βΞΌ = β«β―β«β»_s, β«β―β«β»_t, f βΞΌ βΞΌ := by
ext1 x
let e := MeasurableEquiv.piFinsetUnion Ο hst
calc (β«β―β«β»_s βͺ t, f βΞΌ) x
= β«β» (y : (i : β₯(s βͺ t)) β Ο i), f (updateFinset x (s βͺ t) y)
β.pi fun i' : β₯(s βͺ t) β¦ ΞΌ i' := rfl
_ = β«β» (y : ((i : s) β Ο i) Γ ((j : t) β Ο j)), f (updateFinset x (s βͺ t) _)
β(Measure.pi fun i : s β¦ ΞΌ i).prod (.pi fun j : t β¦ ΞΌ j) := by
rw [measurePreserving_piFinsetUnion hst ΞΌ |>.lintegral_map_equiv]
_ = β«β» (y : (i : s) β Ο i), β«β» (z : (j : t) β Ο j), f (updateFinset x (s βͺ t) (e (y, z)))
β.pi fun j : t β¦ ΞΌ j β.pi fun i : s β¦ ΞΌ i := by
apply lintegral_prod
apply Measurable.aemeasurable
exact hf.comp <| measurable_updateFinset.comp e.measurable
_ = (β«β―β«β»_s, β«β―β«β»_t, f βΞΌ βΞΌ) x := by
simp_rw [lmarginal, updateFinset_updateFinset hst]
rfl
theorem lmarginal_union' (f : (β i, Ο i) β ββ₯0β) (hf : Measurable f) {s t : Finset Ξ΄}
(hst : Disjoint s t) : β«β―β«β»_s βͺ t, f βΞΌ = β«β―β«β»_t, β«β―β«β»_s, f βΞΌ βΞΌ := by
rw [Finset.union_comm, lmarginal_union ΞΌ f hf hst.symm]
variable {ΞΌ}
set_option backward.synthInstance.canonInstances false in -- See https://github.com/leanprover-community/mathlib4/issues/12532
theorem lmarginal_singleton (f : (β i, Ο i) β ββ₯0β) (i : Ξ΄) :
β«β―β«β»_{i}, f βΞΌ = fun x => β«β» xα΅’, f (Function.update x i xα΅’) βΞΌ i := by
let Ξ± : Type _ := ({i} : Finset Ξ΄)
let e := (MeasurableEquiv.piUnique fun j : Ξ± β¦ Ο j).symm
ext1 x
calc (β«β―β«β»_{i}, f βΞΌ) x
= β«β» (y : Ο (default : Ξ±)), f (updateFinset x {i} (e y)) βΞΌ (default : Ξ±) := by
simp_rw [lmarginal, measurePreserving_piUnique (fun j : ({i} : Finset Ξ΄) β¦ ΞΌ j) |>.symm _
|>.lintegral_map_equiv]
_ = β«β» xα΅’, f (Function.update x i xα΅’) βΞΌ i := by simp [update_eq_updateFinset]; rfl
theorem lmarginal_insert (f : (β i, Ο i) β ββ₯0β) (hf : Measurable f) {i : Ξ΄}
(hi : i β s) (x : β i, Ο i) :
(β«β―β«β»_insert i s, f βΞΌ) x = β«β» xα΅’, (β«β―β«β»_s, f βΞΌ) (Function.update x i xα΅’) βΞΌ i := by
rw [Finset.insert_eq, lmarginal_union ΞΌ f hf (Finset.disjoint_singleton_left.mpr hi),
lmarginal_singleton]
theorem lmarginal_erase (f : (β i, Ο i) β ββ₯0β) (hf : Measurable f) {i : Ξ΄}
(hi : i β s) (x : β i, Ο i) :
(β«β―β«β»_s, f βΞΌ) x = β«β» xα΅’, (β«β―β«β»_(erase s i), f βΞΌ) (Function.update x i xα΅’) βΞΌ i := by
simpa [insert_erase hi] using lmarginal_insert _ hf (not_mem_erase i s) x
| Mathlib/MeasureTheory/Integral/Marginal.lean | 172 | 176 | theorem lmarginal_insert' (f : (β i, Ο i) β ββ₯0β) (hf : Measurable f) {i : Ξ΄}
(hi : i β s) :
β«β―β«β»_insert i s, f βΞΌ = β«β―β«β»_s, (fun x β¦ β«β» xα΅’, f (Function.update x i xα΅’) βΞΌ i) βΞΌ := by |
rw [Finset.insert_eq, Finset.union_comm,
lmarginal_union (s := s) ΞΌ f hf (Finset.disjoint_singleton_right.mpr hi), lmarginal_singleton]
|
import Mathlib.Data.List.Cycle
import Mathlib.GroupTheory.Perm.Cycle.Type
import Mathlib.GroupTheory.Perm.List
#align_import group_theory.perm.cycle.concrete from "leanprover-community/mathlib"@"00638177efd1b2534fc5269363ebf42a7871df9a"
open Equiv Equiv.Perm List
variable {Ξ± : Type*}
namespace Equiv.Perm
section Fintype
variable [Fintype Ξ±] [DecidableEq Ξ±] (p : Equiv.Perm Ξ±) (x : Ξ±)
def toList : List Ξ± :=
(List.range (cycleOf p x).support.card).map fun k => (p ^ k) x
#align equiv.perm.to_list Equiv.Perm.toList
@[simp]
theorem toList_one : toList (1 : Perm Ξ±) x = [] := by simp [toList, cycleOf_one]
#align equiv.perm.to_list_one Equiv.Perm.toList_one
@[simp]
| Mathlib/GroupTheory/Perm/Cycle/Concrete.lean | 225 | 225 | theorem toList_eq_nil_iff {p : Perm Ξ±} {x} : toList p x = [] β x β p.support := by | simp [toList]
|
import Mathlib.RingTheory.Valuation.Integers
import Mathlib.RingTheory.Ideal.LocalRing
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.DiscreteValuationRing.Basic
import Mathlib.RingTheory.Bezout
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.valuation.valuation_ring from "leanprover-community/mathlib"@"c163ec99dfc664628ca15d215fce0a5b9c265b68"
universe u v w
class ValuationRing (A : Type u) [CommRing A] [IsDomain A] : Prop where
cond' : β a b : A, β c : A, a * c = b β¨ b * c = a
#align valuation_ring ValuationRing
-- Porting note: this lemma is needed since infer kinds are unsupported in Lean 4
lemma ValuationRing.cond {A : Type u} [CommRing A] [IsDomain A] [ValuationRing A] (a b : A) :
β c : A, a * c = b β¨ b * c = a := @ValuationRing.cond' A _ _ _ _ _
namespace ValuationRing
section
variable (A : Type u) [CommRing A]
variable (K : Type v) [Field K] [Algebra A K]
def ValueGroup : Type v := Quotient (MulAction.orbitRel AΛ£ K)
#align valuation_ring.value_group ValuationRing.ValueGroup
instance : Inhabited (ValueGroup A K) := β¨Quotient.mk'' 0β©
instance : LE (ValueGroup A K) :=
LE.mk fun x y =>
Quotient.liftOnβ' x y (fun a b => β c : A, c β’ b = a)
(by
rintro _ _ a b β¨c, rflβ© β¨d, rflβ©; ext
constructor
Β· rintro β¨e, heβ©; use (cβ»ΒΉ : AΛ£) * e * d
apply_fun fun t => cβ»ΒΉ β’ t at he
simpa [mul_smul] using he
Β· rintro β¨e, heβ©; dsimp
use c * e * (dβ»ΒΉ : AΛ£)
simp_rw [Units.smul_def, β he, mul_smul]
rw [β mul_smul _ _ b, Units.inv_mul, one_smul])
instance : Zero (ValueGroup A K) := β¨Quotient.mk'' 0β©
instance : One (ValueGroup A K) := β¨Quotient.mk'' 1β©
instance : Mul (ValueGroup A K) :=
Mul.mk fun x y =>
Quotient.liftOnβ' x y (fun a b => Quotient.mk'' <| a * b)
(by
rintro _ _ a b β¨c, rflβ© β¨d, rflβ©
apply Quotient.sound'
dsimp
use c * d
simp only [mul_smul, Algebra.smul_def, Units.smul_def, RingHom.map_mul, Units.val_mul]
ring)
instance : Inv (ValueGroup A K) :=
Inv.mk fun x =>
Quotient.liftOn' x (fun a => Quotient.mk'' aβ»ΒΉ)
(by
rintro _ a β¨b, rflβ©
apply Quotient.sound'
use bβ»ΒΉ
dsimp
rw [Units.smul_def, Units.smul_def, Algebra.smul_def, Algebra.smul_def, mul_inv,
map_units_inv])
variable [IsDomain A] [ValuationRing A] [IsFractionRing A K]
protected theorem le_total (a b : ValueGroup A K) : a β€ b β¨ b β€ a := by
rcases a with β¨aβ©; rcases b with β¨bβ©
obtain β¨xa, ya, hya, rflβ© : β a b : A, _ := IsFractionRing.div_surjective a
obtain β¨xb, yb, hyb, rflβ© : β a b : A, _ := IsFractionRing.div_surjective b
have : (algebraMap A K) ya β 0 := IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors hya
have : (algebraMap A K) yb β 0 := IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors hyb
obtain β¨c, h | hβ© := ValuationRing.cond (xa * yb) (xb * ya)
Β· right
use c
rw [Algebra.smul_def]
field_simp
simp only [β RingHom.map_mul, β h]; congr 1; ring
Β· left
use c
rw [Algebra.smul_def]
field_simp
simp only [β RingHom.map_mul, β h]; congr 1; ring
#align valuation_ring.le_total ValuationRing.le_total
-- Porting note: it is much faster to split the instance `LinearOrderedCommGroupWithZero`
-- into two parts
noncomputable instance linearOrder : LinearOrder (ValueGroup A K) where
le_refl := by rintro β¨β©; use 1; rw [one_smul]
le_trans := by rintro β¨aβ© β¨bβ© β¨cβ© β¨e, rflβ© β¨f, rflβ©; use e * f; rw [mul_smul]
le_antisymm := by
rintro β¨aβ© β¨bβ© β¨e, rflβ© β¨f, hfβ©
by_cases hb : b = 0; Β· simp [hb]
have : IsUnit e := by
apply isUnit_of_dvd_one
use f
rw [mul_comm]
rw [β mul_smul, Algebra.smul_def] at hf
nth_rw 2 [β one_mul b] at hf
rw [β (algebraMap A K).map_one] at hf
exact IsFractionRing.injective _ _ (mul_right_cancelβ hb hf).symm
apply Quotient.sound'
exact β¨this.unit, rflβ©
le_total := ValuationRing.le_total _ _
decidableLE := by classical infer_instance
noncomputable instance linearOrderedCommGroupWithZero :
LinearOrderedCommGroupWithZero (ValueGroup A K) :=
{ linearOrder .. with
mul_assoc := by rintro β¨aβ© β¨bβ© β¨cβ©; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
one_mul := by rintro β¨aβ©; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
mul_one := by rintro β¨aβ©; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
mul_comm := by rintro β¨aβ© β¨bβ©; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
mul_le_mul_left := by
rintro β¨aβ© β¨bβ© β¨c, rflβ© β¨dβ©
use c; simp only [Algebra.smul_def]; ring
zero_mul := by rintro β¨aβ©; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
mul_zero := by rintro β¨aβ©; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
zero_le_one := β¨0, by rw [zero_smul]β©
exists_pair_ne := by
use 0, 1
intro c; obtain β¨d, hdβ© := Quotient.exact' c
apply_fun fun t => dβ»ΒΉ β’ t at hd
simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl'
mul_inv_cancel := by
rintro β¨aβ© ha
apply Quotient.sound'
use 1
simp only [one_smul, ne_eq]
apply (mul_inv_cancel _).symm
contrapose ha
simp only [Classical.not_not] at ha β’
rw [ha]
rfl }
def valuation : Valuation K (ValueGroup A K) where
toFun := Quotient.mk''
map_zero' := rfl
map_one' := rfl
map_mul' _ _ := rfl
map_add_le_max' := by
intro a b
obtain β¨xa, ya, hya, rflβ© : β a b : A, _ := IsFractionRing.div_surjective a
obtain β¨xb, yb, hyb, rflβ© : β a b : A, _ := IsFractionRing.div_surjective b
have : (algebraMap A K) ya β 0 := IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors hya
have : (algebraMap A K) yb β 0 := IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors hyb
obtain β¨c, h | hβ© := ValuationRing.cond (xa * yb) (xb * ya)
Β· dsimp
apply le_trans _ (le_max_left _ _)
use c + 1
rw [Algebra.smul_def]
field_simp
simp only [β RingHom.map_mul, β RingHom.map_add, β (algebraMap A K).map_one, β h]
congr 1; ring
Β· apply le_trans _ (le_max_right _ _)
use c + 1
rw [Algebra.smul_def]
field_simp
simp only [β RingHom.map_mul, β RingHom.map_add, β (algebraMap A K).map_one, β h]
congr 1; ring
#align valuation_ring.valuation ValuationRing.valuation
theorem mem_integer_iff (x : K) : x β (valuation A K).integer β β a : A, algebraMap A K a = x := by
constructor
Β· rintro β¨c, rflβ©
use c
rw [Algebra.smul_def, mul_one]
Β· rintro β¨c, rflβ©
use c
rw [Algebra.smul_def, mul_one]
#align valuation_ring.mem_integer_iff ValuationRing.mem_integer_iff
noncomputable def equivInteger : A β+* (valuation A K).integer :=
RingEquiv.ofBijective
(show A ββ+* (valuation A K).integer from
{ toFun := fun a => β¨algebraMap A K a, (mem_integer_iff _ _ _).mpr β¨a, rflβ©β©
map_mul' := fun _ _ => by ext1; exact (algebraMap A K).map_mul _ _
map_zero' := by ext1; exact (algebraMap A K).map_zero
map_add' := fun _ _ => by ext1; exact (algebraMap A K).map_add _ _ })
(by
constructor
Β· intro x y h
apply_fun (algebraMap (valuation A K).integer K) at h
exact IsFractionRing.injective _ _ h
Β· rintro β¨-, haβ©
rw [mem_integer_iff] at ha
obtain β¨a, rflβ© := ha
exact β¨a, rflβ©)
#align valuation_ring.equiv_integer ValuationRing.equivInteger
@[simp]
theorem coe_equivInteger_apply (a : A) : (equivInteger A K a : K) = algebraMap A K a := rfl
#align valuation_ring.coe_equiv_integer_apply ValuationRing.coe_equivInteger_apply
| Mathlib/RingTheory/Valuation/ValuationRing.lean | 236 | 237 | theorem range_algebraMap_eq : (valuation A K).integer = (algebraMap A K).range := by |
ext; exact mem_integer_iff _ _ _
|
import Mathlib.Algebra.DirectSum.Internal
import Mathlib.Algebra.GradedMonoid
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Equiv
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.RingTheory.MvPolynomial.WeightedHomogeneous
import Mathlib.Algebra.Polynomial.Roots
#align_import ring_theory.mv_polynomial.homogeneous from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
namespace MvPolynomial
variable {Ο : Type*} {Ο : Type*} {R : Type*} {S : Type*}
def degree (d : Ο ββ β) := β i β d.support, d i
theorem weightedDegree_one (d : Ο ββ β) :
weightedDegree 1 d = degree d := by
simp [weightedDegree, degree, Finsupp.total, Finsupp.sum]
def IsHomogeneous [CommSemiring R] (Ο : MvPolynomial Ο R) (n : β) :=
IsWeightedHomogeneous 1 Ο n
#align mv_polynomial.is_homogeneous MvPolynomial.IsHomogeneous
variable [CommSemiring R]
theorem weightedTotalDegree_one (Ο : MvPolynomial Ο R) :
weightedTotalDegree (1 : Ο β β) Ο = Ο.totalDegree := by
simp only [totalDegree, weightedTotalDegree, weightedDegree, LinearMap.toAddMonoidHom_coe,
Finsupp.total, Pi.one_apply, Finsupp.coe_lsum, LinearMap.coe_smulRight, LinearMap.id_coe,
id, Algebra.id.smul_eq_mul, mul_one]
variable (Ο R)
def homogeneousSubmodule (n : β) : Submodule R (MvPolynomial Ο R) where
carrier := { x | x.IsHomogeneous n }
smul_mem' r a ha c hc := by
rw [coeff_smul] at hc
apply ha
intro h
apply hc
rw [h]
exact smul_zero r
zero_mem' d hd := False.elim (hd <| coeff_zero _)
add_mem' {a b} ha hb c hc := by
rw [coeff_add] at hc
obtain h | h : coeff c a β 0 β¨ coeff c b β 0 := by
contrapose! hc
simp only [hc, add_zero]
Β· exact ha h
Β· exact hb h
#align mv_polynomial.homogeneous_submodule MvPolynomial.homogeneousSubmodule
@[simp]
lemma weightedHomogeneousSubmodule_one (n : β) :
weightedHomogeneousSubmodule R 1 n = homogeneousSubmodule Ο R n := rfl
variable {Ο R}
@[simp]
theorem mem_homogeneousSubmodule [CommSemiring R] (n : β) (p : MvPolynomial Ο R) :
p β homogeneousSubmodule Ο R n β p.IsHomogeneous n := Iff.rfl
#align mv_polynomial.mem_homogeneous_submodule MvPolynomial.mem_homogeneousSubmodule
variable (Ο R)
theorem homogeneousSubmodule_eq_finsupp_supported [CommSemiring R] (n : β) :
homogeneousSubmodule Ο R n = Finsupp.supported _ R { d | degree d = n } := by
simp_rw [β weightedDegree_one]
exact weightedHomogeneousSubmodule_eq_finsupp_supported R 1 n
#align mv_polynomial.homogeneous_submodule_eq_finsupp_supported MvPolynomial.homogeneousSubmodule_eq_finsupp_supported
variable {Ο R}
theorem homogeneousSubmodule_mul [CommSemiring R] (m n : β) :
homogeneousSubmodule Ο R m * homogeneousSubmodule Ο R n β€ homogeneousSubmodule Ο R (m + n) :=
weightedHomogeneousSubmodule_mul 1 m n
#align mv_polynomial.homogeneous_submodule_mul MvPolynomial.homogeneousSubmodule_mul
section
variable [CommSemiring R]
theorem isHomogeneous_monomial {d : Ο ββ β} (r : R) {n : β} (hn : degree d = n) :
IsHomogeneous (monomial d r) n := by
simp_rw [β weightedDegree_one] at hn
exact isWeightedHomogeneous_monomial 1 d r hn
#align mv_polynomial.is_homogeneous_monomial MvPolynomial.isHomogeneous_monomial
variable (Ο)
theorem totalDegree_zero_iff_isHomogeneous {p : MvPolynomial Ο R} :
p.totalDegree = 0 β IsHomogeneous p 0 := by
rw [β weightedTotalDegree_one,
β isWeightedHomogeneous_zero_iff_weightedTotalDegree_eq_zero, IsHomogeneous]
alias β¨isHomogeneous_of_totalDegree_zero, _β© := totalDegree_zero_iff_isHomogeneous
#align mv_polynomial.is_homogeneous_of_total_degree_zero MvPolynomial.isHomogeneous_of_totalDegree_zero
theorem isHomogeneous_C (r : R) : IsHomogeneous (C r : MvPolynomial Ο R) 0 := by
apply isHomogeneous_monomial
simp only [degree, Finsupp.zero_apply, Finset.sum_const_zero]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.is_homogeneous_C MvPolynomial.isHomogeneous_C
variable (R)
theorem isHomogeneous_zero (n : β) : IsHomogeneous (0 : MvPolynomial Ο R) n :=
(homogeneousSubmodule Ο R n).zero_mem
#align mv_polynomial.is_homogeneous_zero MvPolynomial.isHomogeneous_zero
theorem isHomogeneous_one : IsHomogeneous (1 : MvPolynomial Ο R) 0 :=
isHomogeneous_C _ _
#align mv_polynomial.is_homogeneous_one MvPolynomial.isHomogeneous_one
variable {Ο}
| Mathlib/RingTheory/MvPolynomial/Homogeneous.lean | 150 | 153 | theorem isHomogeneous_X (i : Ο) : IsHomogeneous (X i : MvPolynomial Ο R) 1 := by |
apply isHomogeneous_monomial
rw [degree, Finsupp.support_single_ne_zero _ one_ne_zero, Finset.sum_singleton]
exact Finsupp.single_eq_same
|
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic
import Mathlib.MeasureTheory.Integral.MeanInequalities
#align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9"
open Filter
open scoped ENNReal Topology
namespace MeasureTheory
variable {Ξ± E : Type*} {m : MeasurableSpace Ξ±} [NormedAddCommGroup E]
{p : ββ₯0β} {q : β} {ΞΌ : Measure Ξ±} {f g : Ξ± β E}
theorem snorm'_add_le {f g : Ξ± β E} (hf : AEStronglyMeasurable f ΞΌ) (hg : AEStronglyMeasurable g ΞΌ)
(hq1 : 1 β€ q) : snorm' (f + g) q ΞΌ β€ snorm' f q ΞΌ + snorm' g q ΞΌ :=
calc
(β«β» a, (β(f + g) aββ : ββ₯0β) ^ q βΞΌ) ^ (1 / q) β€
(β«β» a, ((fun a => (βf aββ : ββ₯0β)) + fun a => (βg aββ : ββ₯0β)) a ^ q βΞΌ) ^ (1 / q) := by
gcongr with a
simp only [Pi.add_apply, β ENNReal.coe_add, ENNReal.coe_le_coe, nnnorm_add_le]
_ β€ snorm' f q ΞΌ + snorm' g q ΞΌ := ENNReal.lintegral_Lp_add_le hf.ennnorm hg.ennnorm hq1
#align measure_theory.snorm'_add_le MeasureTheory.snorm'_add_le
theorem snorm'_add_le_of_le_one {f g : Ξ± β E} (hf : AEStronglyMeasurable f ΞΌ) (hq0 : 0 β€ q)
(hq1 : q β€ 1) : snorm' (f + g) q ΞΌ β€ (2 : ββ₯0β) ^ (1 / q - 1) * (snorm' f q ΞΌ + snorm' g q ΞΌ) :=
calc
(β«β» a, (β(f + g) aββ : ββ₯0β) ^ q βΞΌ) ^ (1 / q) β€
(β«β» a, ((fun a => (βf aββ : ββ₯0β)) + fun a => (βg aββ : ββ₯0β)) a ^ q βΞΌ) ^ (1 / q) := by
gcongr with a
simp only [Pi.add_apply, β ENNReal.coe_add, ENNReal.coe_le_coe, nnnorm_add_le]
_ β€ (2 : ββ₯0β) ^ (1 / q - 1) * (snorm' f q ΞΌ + snorm' g q ΞΌ) :=
ENNReal.lintegral_Lp_add_le_of_le_one hf.ennnorm hq0 hq1
#align measure_theory.snorm'_add_le_of_le_one MeasureTheory.snorm'_add_le_of_le_one
theorem snormEssSup_add_le {f g : Ξ± β E} :
snormEssSup (f + g) ΞΌ β€ snormEssSup f ΞΌ + snormEssSup g ΞΌ := by
refine le_trans (essSup_mono_ae (eventually_of_forall fun x => ?_)) (ENNReal.essSup_add_le _ _)
simp_rw [Pi.add_apply, β ENNReal.coe_add, ENNReal.coe_le_coe]
exact nnnorm_add_le _ _
#align measure_theory.snorm_ess_sup_add_le MeasureTheory.snormEssSup_add_le
theorem snorm_add_le {f g : Ξ± β E} (hf : AEStronglyMeasurable f ΞΌ) (hg : AEStronglyMeasurable g ΞΌ)
(hp1 : 1 β€ p) : snorm (f + g) p ΞΌ β€ snorm f p ΞΌ + snorm g p ΞΌ := by
by_cases hp0 : p = 0
Β· simp [hp0]
by_cases hp_top : p = β
Β· simp [hp_top, snormEssSup_add_le]
have hp1_real : 1 β€ p.toReal := by
rwa [β ENNReal.one_toReal, ENNReal.toReal_le_toReal ENNReal.one_ne_top hp_top]
repeat rw [snorm_eq_snorm' hp0 hp_top]
exact snorm'_add_le hf hg hp1_real
#align measure_theory.snorm_add_le MeasureTheory.snorm_add_le
noncomputable def LpAddConst (p : ββ₯0β) : ββ₯0β :=
if p β Set.Ioo (0 : ββ₯0β) 1 then (2 : ββ₯0β) ^ (1 / p.toReal - 1) else 1
set_option linter.uppercaseLean3 false in
#align measure_theory.Lp_add_const MeasureTheory.LpAddConst
theorem LpAddConst_of_one_le {p : ββ₯0β} (hp : 1 β€ p) : LpAddConst p = 1 := by
rw [LpAddConst, if_neg]
intro h
exact lt_irrefl _ (h.2.trans_le hp)
set_option linter.uppercaseLean3 false in
#align measure_theory.Lp_add_const_of_one_le MeasureTheory.LpAddConst_of_one_le
theorem LpAddConst_zero : LpAddConst 0 = 1 := by
rw [LpAddConst, if_neg]
intro h
exact lt_irrefl _ h.1
set_option linter.uppercaseLean3 false in
#align measure_theory.Lp_add_const_zero MeasureTheory.LpAddConst_zero
theorem LpAddConst_lt_top (p : ββ₯0β) : LpAddConst p < β := by
rw [LpAddConst]
split_ifs with h
Β· apply ENNReal.rpow_lt_top_of_nonneg _ ENNReal.two_ne_top
simp only [one_div, sub_nonneg]
apply one_le_inv (ENNReal.toReal_pos h.1.ne' (h.2.trans ENNReal.one_lt_top).ne)
simpa using ENNReal.toReal_mono ENNReal.one_ne_top h.2.le
Β· exact ENNReal.one_lt_top
set_option linter.uppercaseLean3 false in
#align measure_theory.Lp_add_const_lt_top MeasureTheory.LpAddConst_lt_top
| Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean | 98 | 109 | theorem snorm_add_le' {f g : Ξ± β E} (hf : AEStronglyMeasurable f ΞΌ) (hg : AEStronglyMeasurable g ΞΌ)
(p : ββ₯0β) : snorm (f + g) p ΞΌ β€ LpAddConst p * (snorm f p ΞΌ + snorm g p ΞΌ) := by |
rcases eq_or_ne p 0 with (rfl | hp)
Β· simp only [snorm_exponent_zero, add_zero, mul_zero, le_zero_iff]
rcases lt_or_le p 1 with (h'p | h'p)
Β· simp only [snorm_eq_snorm' hp (h'p.trans ENNReal.one_lt_top).ne]
convert snorm'_add_le_of_le_one hf ENNReal.toReal_nonneg _
Β· have : p β Set.Ioo (0 : ββ₯0β) 1 := β¨hp.bot_lt, h'pβ©
simp only [LpAddConst, if_pos this]
Β· simpa using ENNReal.toReal_mono ENNReal.one_ne_top h'p.le
Β· simp [LpAddConst_of_one_le h'p]
exact snorm_add_le hf hg h'p
|
import Mathlib.Data.Vector.Basic
import Mathlib.Data.Vector.Snoc
set_option autoImplicit true
namespace Vector
section Fold
section Binary
variable (xs : Vector Ξ± n) (ys : Vector Ξ² n)
@[simp]
theorem mapAccumrβ_mapAccumr_left (fβ : Ξ³ β Ξ² β Οβ β Οβ Γ ΞΆ) (fβ : Ξ± β Οβ β Οβ Γ Ξ³) :
(mapAccumrβ fβ (mapAccumr fβ xs sβ).snd ys sβ)
= let m := (mapAccumrβ (fun x y s =>
let rβ := fβ x s.snd
let rβ := fβ rβ.snd y s.fst
((rβ.fst, rβ.fst), rβ.snd)
) xs ys (sβ, sβ))
(m.fst.fst, m.snd) := by
induction xs, ys using Vector.revInductionOnβ generalizing sβ sβ <;> simp_all
@[simp]
| Mathlib/Data/Vector/MapLemmas.lean | 71 | 73 | theorem mapβ_map_left (fβ : Ξ³ β Ξ² β ΞΆ) (fβ : Ξ± β Ξ³) :
mapβ fβ (map fβ xs) ys = mapβ (fun x y => fβ (fβ x) y) xs ys := by |
induction xs, ys using Vector.revInductionOnβ <;> simp_all
|
import Mathlib.Algebra.MonoidAlgebra.Basic
#align_import algebra.monoid_algebra.division from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951"
variable {k G : Type*} [Semiring k]
namespace AddMonoidAlgebra
section
variable [AddCancelCommMonoid G]
noncomputable def divOf (x : k[G]) (g : G) : k[G] :=
-- note: comapping by `+ g` has the effect of subtracting `g` from every element in
-- the support, and discarding the elements of the support from which `g` can't be subtracted.
-- If `G` is an additive group, such as `β€` when used for `LaurentPolynomial`,
-- then no discarding occurs.
@Finsupp.comapDomain.addMonoidHom _ _ _ _ (g + Β·) (add_right_injective g) x
#align add_monoid_algebra.div_of AddMonoidAlgebra.divOf
local infixl:70 " /α΅αΆ " => divOf
@[simp]
theorem divOf_apply (g : G) (x : k[G]) (g' : G) : (x /α΅αΆ g) g' = x (g + g') :=
rfl
#align add_monoid_algebra.div_of_apply AddMonoidAlgebra.divOf_apply
@[simp]
theorem support_divOf (g : G) (x : k[G]) :
(x /α΅αΆ g).support =
x.support.preimage (g + Β·) (Function.Injective.injOn (add_right_injective g)) :=
rfl
#align add_monoid_algebra.support_div_of AddMonoidAlgebra.support_divOf
@[simp]
theorem zero_divOf (g : G) : (0 : k[G]) /α΅αΆ g = 0 :=
map_zero (Finsupp.comapDomain.addMonoidHom _)
#align add_monoid_algebra.zero_div_of AddMonoidAlgebra.zero_divOf
@[simp]
theorem divOf_zero (x : k[G]) : x /α΅αΆ 0 = x := by
refine Finsupp.ext fun _ => ?_ -- Porting note: `ext` doesn't work
simp only [AddMonoidAlgebra.divOf_apply, zero_add]
#align add_monoid_algebra.div_of_zero AddMonoidAlgebra.divOf_zero
theorem add_divOf (x y : k[G]) (g : G) : (x + y) /α΅αΆ g = x /α΅αΆ g + y /α΅αΆ g :=
map_add (Finsupp.comapDomain.addMonoidHom _) _ _
#align add_monoid_algebra.add_div_of AddMonoidAlgebra.add_divOf
theorem divOf_add (x : k[G]) (a b : G) : x /α΅αΆ (a + b) = x /α΅αΆ a /α΅αΆ b := by
refine Finsupp.ext fun _ => ?_ -- Porting note: `ext` doesn't work
simp only [AddMonoidAlgebra.divOf_apply, add_assoc]
#align add_monoid_algebra.div_of_add AddMonoidAlgebra.divOf_add
@[simps]
noncomputable def divOfHom : Multiplicative G β* AddMonoid.End k[G] where
toFun g :=
{ toFun := fun x => divOf x (Multiplicative.toAdd g)
map_zero' := zero_divOf _
map_add' := fun x y => add_divOf x y (Multiplicative.toAdd g) }
map_one' := AddMonoidHom.ext divOf_zero
map_mul' gβ gβ :=
AddMonoidHom.ext fun _x =>
(congr_arg _ (add_comm (Multiplicative.toAdd gβ) (Multiplicative.toAdd gβ))).trans
(divOf_add _ _ _)
#align add_monoid_algebra.div_of_hom AddMonoidAlgebra.divOfHom
theorem of'_mul_divOf (a : G) (x : k[G]) : of' k G a * x /α΅αΆ a = x := by
refine Finsupp.ext fun _ => ?_ -- Porting note: `ext` doesn't work
rw [AddMonoidAlgebra.divOf_apply, of'_apply, single_mul_apply_aux, one_mul]
intro c
exact add_right_inj _
#align add_monoid_algebra.of'_mul_div_of AddMonoidAlgebra.of'_mul_divOf
theorem mul_of'_divOf (x : k[G]) (a : G) : x * of' k G a /α΅αΆ a = x := by
refine Finsupp.ext fun _ => ?_ -- Porting note: `ext` doesn't work
rw [AddMonoidAlgebra.divOf_apply, of'_apply, mul_single_apply_aux, mul_one]
intro c
rw [add_comm]
exact add_right_inj _
#align add_monoid_algebra.mul_of'_div_of AddMonoidAlgebra.mul_of'_divOf
theorem of'_divOf (a : G) : of' k G a /α΅αΆ a = 1 := by
simpa only [one_mul] using mul_of'_divOf (1 : k[G]) a
#align add_monoid_algebra.of'_div_of AddMonoidAlgebra.of'_divOf
noncomputable def modOf (x : k[G]) (g : G) : k[G] :=
letI := Classical.decPred fun gβ => β gβ, gβ = g + gβ
x.filter fun gβ => Β¬β gβ, gβ = g + gβ
#align add_monoid_algebra.mod_of AddMonoidAlgebra.modOf
local infixl:70 " %α΅αΆ " => modOf
@[simp]
theorem modOf_apply_of_not_exists_add (x : k[G]) (g : G) (g' : G)
(h : Β¬β d, g' = g + d) : (x %α΅αΆ g) g' = x g' := by
classical exact Finsupp.filter_apply_pos _ _ h
#align add_monoid_algebra.mod_of_apply_of_not_exists_add AddMonoidAlgebra.modOf_apply_of_not_exists_add
@[simp]
theorem modOf_apply_of_exists_add (x : k[G]) (g : G) (g' : G)
(h : β d, g' = g + d) : (x %α΅αΆ g) g' = 0 := by
classical exact Finsupp.filter_apply_neg _ _ <| by rwa [Classical.not_not]
#align add_monoid_algebra.mod_of_apply_of_exists_add AddMonoidAlgebra.modOf_apply_of_exists_add
@[simp]
theorem modOf_apply_add_self (x : k[G]) (g : G) (d : G) : (x %α΅αΆ g) (d + g) = 0 :=
modOf_apply_of_exists_add _ _ _ β¨_, add_comm _ _β©
#align add_monoid_algebra.mod_of_apply_add_self AddMonoidAlgebra.modOf_apply_add_self
-- @[simp] -- Porting note (#10618): simp can prove this
theorem modOf_apply_self_add (x : k[G]) (g : G) (d : G) : (x %α΅αΆ g) (g + d) = 0 :=
modOf_apply_of_exists_add _ _ _ β¨_, rflβ©
#align add_monoid_algebra.mod_of_apply_self_add AddMonoidAlgebra.modOf_apply_self_add
| Mathlib/Algebra/MonoidAlgebra/Division.lean | 154 | 159 | theorem of'_mul_modOf (g : G) (x : k[G]) : of' k G g * x %α΅αΆ g = 0 := by |
refine Finsupp.ext fun g' => ?_ -- Porting note: `ext g'` doesn't work
rw [Finsupp.zero_apply]
obtain β¨d, rflβ© | h := em (β d, g' = g + d)
Β· rw [modOf_apply_self_add]
Β· rw [modOf_apply_of_not_exists_add _ _ _ h, of'_apply, single_mul_apply_of_not_exists_add _ _ h]
|
import Mathlib.Combinatorics.SimpleGraph.Clique
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.Nat.Lattice
import Mathlib.Data.Setoid.Partition
import Mathlib.Order.Antichain
#align_import combinatorics.simple_graph.coloring from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Fintype Function
universe u v
namespace SimpleGraph
variable {V : Type u} (G : SimpleGraph V) {n : β}
abbrev Coloring (Ξ± : Type v) := G βg (β€ : SimpleGraph Ξ±)
#align simple_graph.coloring SimpleGraph.Coloring
variable {G} {Ξ± Ξ² : Type*} (C : G.Coloring Ξ±)
theorem Coloring.valid {v w : V} (h : G.Adj v w) : C v β C w :=
C.map_rel h
#align simple_graph.coloring.valid SimpleGraph.Coloring.valid
@[match_pattern]
def Coloring.mk (color : V β Ξ±) (valid : β {v w : V}, G.Adj v w β color v β color w) :
G.Coloring Ξ± :=
β¨color, @validβ©
#align simple_graph.coloring.mk SimpleGraph.Coloring.mk
def Coloring.colorClass (c : Ξ±) : Set V := { v : V | C v = c }
#align simple_graph.coloring.color_class SimpleGraph.Coloring.colorClass
def Coloring.colorClasses : Set (Set V) := (Setoid.ker C).classes
#align simple_graph.coloring.color_classes SimpleGraph.Coloring.colorClasses
theorem Coloring.mem_colorClass (v : V) : v β C.colorClass (C v) := rfl
#align simple_graph.coloring.mem_color_class SimpleGraph.Coloring.mem_colorClass
theorem Coloring.colorClasses_isPartition : Setoid.IsPartition C.colorClasses :=
Setoid.isPartition_classes (Setoid.ker C)
#align simple_graph.coloring.color_classes_is_partition SimpleGraph.Coloring.colorClasses_isPartition
theorem Coloring.mem_colorClasses {v : V} : C.colorClass (C v) β C.colorClasses :=
β¨v, rflβ©
#align simple_graph.coloring.mem_color_classes SimpleGraph.Coloring.mem_colorClasses
theorem Coloring.colorClasses_finite [Finite Ξ±] : C.colorClasses.Finite :=
Setoid.finite_classes_ker _
#align simple_graph.coloring.color_classes_finite SimpleGraph.Coloring.colorClasses_finite
theorem Coloring.card_colorClasses_le [Fintype Ξ±] [Fintype C.colorClasses] :
Fintype.card C.colorClasses β€ Fintype.card Ξ± := by
simp [colorClasses]
-- Porting note: brute force instance declaration `[Fintype (Setoid.classes (Setoid.ker C))]`
haveI : Fintype (Setoid.classes (Setoid.ker C)) := by assumption
convert Setoid.card_classes_ker_le C
#align simple_graph.coloring.card_color_classes_le SimpleGraph.Coloring.card_colorClasses_le
theorem Coloring.not_adj_of_mem_colorClass {c : Ξ±} {v w : V} (hv : v β C.colorClass c)
(hw : w β C.colorClass c) : Β¬G.Adj v w := fun h => C.valid h (Eq.trans hv (Eq.symm hw))
#align simple_graph.coloring.not_adj_of_mem_color_class SimpleGraph.Coloring.not_adj_of_mem_colorClass
theorem Coloring.color_classes_independent (c : Ξ±) : IsAntichain G.Adj (C.colorClass c) :=
fun _ hv _ hw _ => C.not_adj_of_mem_colorClass hv hw
#align simple_graph.coloring.color_classes_independent SimpleGraph.Coloring.color_classes_independent
-- TODO make this computable
noncomputable instance [Fintype V] [Fintype Ξ±] : Fintype (Coloring G Ξ±) := by
classical
change Fintype (RelHom G.Adj (β€ : SimpleGraph Ξ±).Adj)
apply Fintype.ofInjective _ RelHom.coe_fn_injective
variable (G)
def Colorable (n : β) : Prop := Nonempty (G.Coloring (Fin n))
#align simple_graph.colorable SimpleGraph.Colorable
def coloringOfIsEmpty [IsEmpty V] : G.Coloring Ξ± :=
Coloring.mk isEmptyElim fun {v} => isEmptyElim v
#align simple_graph.coloring_of_is_empty SimpleGraph.coloringOfIsEmpty
theorem colorable_of_isEmpty [IsEmpty V] (n : β) : G.Colorable n :=
β¨G.coloringOfIsEmptyβ©
#align simple_graph.colorable_of_is_empty SimpleGraph.colorable_of_isEmpty
theorem isEmpty_of_colorable_zero (h : G.Colorable 0) : IsEmpty V := by
constructor
intro v
obtain β¨i, hiβ© := h.some v
exact Nat.not_lt_zero _ hi
#align simple_graph.is_empty_of_colorable_zero SimpleGraph.isEmpty_of_colorable_zero
def selfColoring : G.Coloring V := Coloring.mk id fun {_ _} => G.ne_of_adj
#align simple_graph.self_coloring SimpleGraph.selfColoring
noncomputable def chromaticNumber : ββ := β¨
n β setOf G.Colorable, (n : ββ)
#align simple_graph.chromatic_number SimpleGraph.chromaticNumber
lemma chromaticNumber_eq_biInf {G : SimpleGraph V} :
G.chromaticNumber = β¨
n β setOf G.Colorable, (n : ββ) := rfl
lemma chromaticNumber_eq_iInf {G : SimpleGraph V} :
G.chromaticNumber = β¨
n : {m | G.Colorable m}, (n : ββ) := by
rw [chromaticNumber, iInf_subtype]
lemma Colorable.chromaticNumber_eq_sInf {G : SimpleGraph V} {n} (h : G.Colorable n) :
G.chromaticNumber = sInf {n' : β | G.Colorable n'} := by
rw [ENat.coe_sInf, chromaticNumber]
exact β¨_, hβ©
def recolorOfEmbedding {Ξ± Ξ² : Type*} (f : Ξ± βͺ Ξ²) : G.Coloring Ξ± βͺ G.Coloring Ξ² where
toFun C := (Embedding.completeGraph f).toHom.comp C
inj' := by -- this was strangely painful; seems like missing lemmas about embeddings
intro C C' h
dsimp only at h
ext v
apply (Embedding.completeGraph f).inj'
change ((Embedding.completeGraph f).toHom.comp C) v = _
rw [h]
rfl
#align simple_graph.recolor_of_embedding SimpleGraph.recolorOfEmbedding
@[simp] lemma coe_recolorOfEmbedding (f : Ξ± βͺ Ξ²) :
β(G.recolorOfEmbedding f) = (Embedding.completeGraph f).toHom.comp := rfl
def recolorOfEquiv {Ξ± Ξ² : Type*} (f : Ξ± β Ξ²) : G.Coloring Ξ± β G.Coloring Ξ² where
toFun := G.recolorOfEmbedding f.toEmbedding
invFun := G.recolorOfEmbedding f.symm.toEmbedding
left_inv C := by
ext v
apply Equiv.symm_apply_apply
right_inv C := by
ext v
apply Equiv.apply_symm_apply
#align simple_graph.recolor_of_equiv SimpleGraph.recolorOfEquiv
@[simp] lemma coe_recolorOfEquiv (f : Ξ± β Ξ²) :
β(G.recolorOfEquiv f) = (Embedding.completeGraph f).toHom.comp := rfl
noncomputable def recolorOfCardLE {Ξ± Ξ² : Type*} [Fintype Ξ±] [Fintype Ξ²]
(hn : Fintype.card Ξ± β€ Fintype.card Ξ²) : G.Coloring Ξ± βͺ G.Coloring Ξ² :=
G.recolorOfEmbedding <| (Function.Embedding.nonempty_of_card_le hn).some
#align simple_graph.recolor_of_card_le SimpleGraph.recolorOfCardLE
@[simp] lemma coe_recolorOfCardLE [Fintype Ξ±] [Fintype Ξ²] (hΞ±Ξ² : card Ξ± β€ card Ξ²) :
β(G.recolorOfCardLE hΞ±Ξ²) =
(Embedding.completeGraph (Embedding.nonempty_of_card_le hΞ±Ξ²).some).toHom.comp := rfl
variable {G}
theorem Colorable.mono {n m : β} (h : n β€ m) (hc : G.Colorable n) : G.Colorable m :=
β¨G.recolorOfCardLE (by simp [h]) hc.someβ©
#align simple_graph.colorable.mono SimpleGraph.Colorable.mono
theorem Coloring.colorable [Fintype Ξ±] (C : G.Coloring Ξ±) : G.Colorable (Fintype.card Ξ±) :=
β¨G.recolorOfCardLE (by simp) Cβ©
#align simple_graph.coloring.to_colorable SimpleGraph.Coloring.colorable
theorem colorable_of_fintype (G : SimpleGraph V) [Fintype V] : G.Colorable (Fintype.card V) :=
G.selfColoring.colorable
#align simple_graph.colorable_of_fintype SimpleGraph.colorable_of_fintype
noncomputable def Colorable.toColoring [Fintype Ξ±] {n : β} (hc : G.Colorable n)
(hn : n β€ Fintype.card Ξ±) : G.Coloring Ξ± := by
rw [β Fintype.card_fin n] at hn
exact G.recolorOfCardLE hn hc.some
#align simple_graph.colorable.to_coloring SimpleGraph.Colorable.toColoring
theorem Colorable.of_embedding {V' : Type*} {G' : SimpleGraph V'} (f : G βͺg G') {n : β}
(h : G'.Colorable n) : G.Colorable n :=
β¨(h.toColoring (by simp)).comp fβ©
#align simple_graph.colorable.of_embedding SimpleGraph.Colorable.of_embedding
theorem colorable_iff_exists_bdd_nat_coloring (n : β) :
G.Colorable n β β C : G.Coloring β, β v, C v < n := by
constructor
Β· rintro hc
have C : G.Coloring (Fin n) := hc.toColoring (by simp)
let f := Embedding.completeGraph (@Fin.valEmbedding n)
use f.toHom.comp C
intro v
cases' C with color valid
exact Fin.is_lt (color v)
Β· rintro β¨C, Cfβ©
refine β¨Coloring.mk ?_ ?_β©
Β· exact fun v => β¨C v, Cf vβ©
Β· rintro v w hvw
simp only [Fin.mk_eq_mk, Ne]
exact C.valid hvw
#align simple_graph.colorable_iff_exists_bdd_nat_coloring SimpleGraph.colorable_iff_exists_bdd_nat_coloring
theorem colorable_set_nonempty_of_colorable {n : β} (hc : G.Colorable n) :
{ n : β | G.Colorable n }.Nonempty :=
β¨n, hcβ©
#align simple_graph.colorable_set_nonempty_of_colorable SimpleGraph.colorable_set_nonempty_of_colorable
theorem chromaticNumber_bddBelow : BddBelow { n : β | G.Colorable n } :=
β¨0, fun _ _ => zero_le _β©
#align simple_graph.chromatic_number_bdd_below SimpleGraph.chromaticNumber_bddBelow
| Mathlib/Combinatorics/SimpleGraph/Coloring.lean | 276 | 280 | theorem Colorable.chromaticNumber_le {n : β} (hc : G.Colorable n) : G.chromaticNumber β€ n := by |
rw [hc.chromaticNumber_eq_sInf]
norm_cast
apply csInf_le chromaticNumber_bddBelow
exact hc
|
import Mathlib.FieldTheory.Finiteness
import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition
import Mathlib.LinearAlgebra.Dimension.DivisionRing
#align_import linear_algebra.finite_dimensional from "leanprover-community/mathlib"@"e95e4f92c8f8da3c7f693c3ec948bcf9b6683f51"
universe u v v' w
open Cardinal Submodule Module Function
abbrev FiniteDimensional (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] :=
Module.Finite K V
#align finite_dimensional FiniteDimensional
variable {K : Type u} {V : Type v}
namespace FiniteDimensional
open IsNoetherian
section DivisionRing
variable [DivisionRing K] [AddCommGroup V] [Module K V] {Vβ : Type v'} [AddCommGroup Vβ]
[Module K Vβ]
theorem of_injective (f : V ββ[K] Vβ) (w : Function.Injective f) [FiniteDimensional K Vβ] :
FiniteDimensional K V :=
have : IsNoetherian K Vβ := IsNoetherian.iff_fg.mpr βΉ_βΊ
Module.Finite.of_injective f w
#align finite_dimensional.of_injective FiniteDimensional.of_injective
theorem of_surjective (f : V ββ[K] Vβ) (w : Function.Surjective f) [FiniteDimensional K V] :
FiniteDimensional K Vβ :=
Module.Finite.of_surjective f w
#align finite_dimensional.of_surjective FiniteDimensional.of_surjective
variable (K V)
instance finiteDimensional_pi {ΞΉ : Type*} [Finite ΞΉ] : FiniteDimensional K (ΞΉ β K) :=
Finite.pi
#align finite_dimensional.finite_dimensional_pi FiniteDimensional.finiteDimensional_pi
instance finiteDimensional_pi' {ΞΉ : Type*} [Finite ΞΉ] (M : ΞΉ β Type*) [β i, AddCommGroup (M i)]
[β i, Module K (M i)] [β i, FiniteDimensional K (M i)] : FiniteDimensional K (β i, M i) :=
Finite.pi
#align finite_dimensional.finite_dimensional_pi' FiniteDimensional.finiteDimensional_pi'
noncomputable def fintypeOfFintype [Fintype K] [FiniteDimensional K V] : Fintype V :=
Module.fintypeOfFintype (@finsetBasis K V _ _ _ (iff_fg.2 inferInstance))
#align finite_dimensional.fintype_of_fintype FiniteDimensional.fintypeOfFintype
theorem finite_of_finite [Finite K] [FiniteDimensional K V] : Finite V := by
cases nonempty_fintype K
haveI := fintypeOfFintype K V
infer_instance
#align finite_dimensional.finite_of_finite FiniteDimensional.finite_of_finite
variable {K V}
theorem of_fintype_basis {ΞΉ : Type w} [Finite ΞΉ] (h : Basis ΞΉ K V) : FiniteDimensional K V :=
Module.Finite.of_basis h
#align finite_dimensional.of_fintype_basis FiniteDimensional.of_fintype_basis
noncomputable def fintypeBasisIndex {ΞΉ : Type*} [FiniteDimensional K V] (b : Basis ΞΉ K V) :
Fintype ΞΉ :=
@Fintype.ofFinite _ (Module.Finite.finite_basis b)
#align finite_dimensional.fintype_basis_index FiniteDimensional.fintypeBasisIndex
noncomputable instance [FiniteDimensional K V] : Fintype (Basis.ofVectorSpaceIndex K V) := by
letI : IsNoetherian K V := IsNoetherian.iff_fg.2 inferInstance
infer_instance
theorem of_finite_basis {ΞΉ : Type w} {s : Set ΞΉ} (h : Basis s K V) (hs : Set.Finite s) :
FiniteDimensional K V :=
haveI := hs.fintype
of_fintype_basis h
#align finite_dimensional.of_finite_basis FiniteDimensional.of_finite_basis
instance finiteDimensional_submodule [FiniteDimensional K V] (S : Submodule K V) :
FiniteDimensional K S := by
letI : IsNoetherian K V := iff_fg.2 ?_
Β· exact
iff_fg.1
(IsNoetherian.iff_rank_lt_aleph0.2
(lt_of_le_of_lt (rank_submodule_le _) (_root_.rank_lt_aleph0 K V)))
Β· infer_instance
#align finite_dimensional.finite_dimensional_submodule FiniteDimensional.finiteDimensional_submodule
instance finiteDimensional_quotient [FiniteDimensional K V] (S : Submodule K V) :
FiniteDimensional K (V β§Έ S) :=
Module.Finite.quotient K S
#align finite_dimensional.finite_dimensional_quotient FiniteDimensional.finiteDimensional_quotient
variable (K V)
theorem finrank_eq_rank' [FiniteDimensional K V] : (finrank K V : Cardinal.{v}) = Module.rank K V :=
finrank_eq_rank _ _
#align finite_dimensional.finrank_eq_rank' FiniteDimensional.finrank_eq_rank'
variable {K V}
theorem finrank_of_infinite_dimensional (h : Β¬FiniteDimensional K V) : finrank K V = 0 :=
FiniteDimensional.finrank_of_not_finite h
#align finite_dimensional.finrank_of_infinite_dimensional FiniteDimensional.finrank_of_infinite_dimensional
theorem of_finrank_pos (h : 0 < finrank K V) : FiniteDimensional K V :=
Module.finite_of_finrank_pos h
#align finite_dimensional.finite_dimensional_of_finrank FiniteDimensional.of_finrank_pos
theorem of_finrank_eq_succ {n : β} (hn : finrank K V = n.succ) :
FiniteDimensional K V :=
Module.finite_of_finrank_eq_succ hn
#align finite_dimensional.finite_dimensional_of_finrank_eq_succ FiniteDimensional.of_finrank_eq_succ
theorem of_fact_finrank_eq_succ (n : β) [hn : Fact (finrank K V = n + 1)] :
FiniteDimensional K V :=
of_finrank_eq_succ hn.out
#align finite_dimensional.fact_finite_dimensional_of_finrank_eq_succ FiniteDimensional.of_fact_finrank_eq_succ
theorem finiteDimensional_iff_of_rank_eq_nsmul {W} [AddCommGroup W] [Module K W] {n : β}
(hn : n β 0) (hVW : Module.rank K V = n β’ Module.rank K W) :
FiniteDimensional K V β FiniteDimensional K W :=
Module.finite_iff_of_rank_eq_nsmul hn hVW
#align finite_dimensional.finite_dimensional_iff_of_rank_eq_nsmul FiniteDimensional.finiteDimensional_iff_of_rank_eq_nsmul
theorem finrank_eq_card_basis' [FiniteDimensional K V] {ΞΉ : Type w} (h : Basis ΞΉ K V) :
(finrank K V : Cardinal.{w}) = #ΞΉ :=
Module.mk_finrank_eq_card_basis h
#align finite_dimensional.finrank_eq_card_basis' FiniteDimensional.finrank_eq_card_basis'
theorem _root_.LinearIndependent.lt_aleph0_of_finiteDimensional {ΞΉ : Type w} [FiniteDimensional K V]
{v : ΞΉ β V} (h : LinearIndependent K v) : #ΞΉ < β΅β :=
h.lt_aleph0_of_finite
#align finite_dimensional.lt_aleph_0_of_linear_independent LinearIndependent.lt_aleph0_of_finiteDimensional
@[deprecated (since := "2023-12-27")]
alias lt_aleph0_of_linearIndependent := LinearIndependent.lt_aleph0_of_finiteDimensional
| Mathlib/LinearAlgebra/FiniteDimensional.lean | 225 | 250 | theorem _root_.Submodule.eq_top_of_finrank_eq [FiniteDimensional K V] {S : Submodule K V}
(h : finrank K S = finrank K V) : S = β€ := by |
haveI : IsNoetherian K V := iff_fg.2 inferInstance
set bS := Basis.ofVectorSpace K S with bS_eq
have : LinearIndependent K ((β) : ((β) '' Basis.ofVectorSpaceIndex K S : Set V) β V) :=
LinearIndependent.image_subtype (f := Submodule.subtype S)
(by simpa [bS] using bS.linearIndependent) (by simp)
set b := Basis.extend this with b_eq
-- Porting note: `letI` now uses `this` so we need to give different names
letI i1 : Fintype (this.extend _) :=
(LinearIndependent.set_finite_of_isNoetherian (by simpa [b] using b.linearIndependent)).fintype
letI i2 : Fintype (((β) : S β V) '' Basis.ofVectorSpaceIndex K S) :=
(LinearIndependent.set_finite_of_isNoetherian this).fintype
letI i3 : Fintype (Basis.ofVectorSpaceIndex K S) :=
(LinearIndependent.set_finite_of_isNoetherian
(by simpa [bS] using bS.linearIndependent)).fintype
have : (β) '' Basis.ofVectorSpaceIndex K S = this.extend (Set.subset_univ _) :=
Set.eq_of_subset_of_card_le (this.subset_extend _)
(by
rw [Set.card_image_of_injective _ Subtype.coe_injective, β finrank_eq_card_basis bS, β
finrank_eq_card_basis b, h])
rw [β b.span_eq, b_eq, Basis.coe_extend, Subtype.range_coe, β this, β Submodule.coeSubtype,
span_image]
have := bS.span_eq
rw [bS_eq, Basis.coe_ofVectorSpace, Subtype.range_coe] at this
rw [this, Submodule.map_top (Submodule.subtype S), range_subtype]
|
import Mathlib.Logic.Encodable.Lattice
import Mathlib.MeasureTheory.MeasurableSpace.Defs
#align_import measure_theory.pi_system from "leanprover-community/mathlib"@"98e83c3d541c77cdb7da20d79611a780ff8e7d90"
open MeasurableSpace Set
open scoped Classical
open MeasureTheory
def IsPiSystem {Ξ±} (C : Set (Set Ξ±)) : Prop :=
βα΅ (s β C) (t β C), (s β© t : Set Ξ±).Nonempty β s β© t β C
#align is_pi_system IsPiSystem
theorem IsPiSystem.singleton {Ξ±} (S : Set Ξ±) : IsPiSystem ({S} : Set (Set Ξ±)) := by
intro s h_s t h_t _
rw [Set.mem_singleton_iff.1 h_s, Set.mem_singleton_iff.1 h_t, Set.inter_self,
Set.mem_singleton_iff]
#align is_pi_system.singleton IsPiSystem.singleton
theorem IsPiSystem.insert_empty {Ξ±} {S : Set (Set Ξ±)} (h_pi : IsPiSystem S) :
IsPiSystem (insert β
S) := by
intro s hs t ht hst
cases' hs with hs hs
Β· simp [hs]
Β· cases' ht with ht ht
Β· simp [ht]
Β· exact Set.mem_insert_of_mem _ (h_pi s hs t ht hst)
#align is_pi_system.insert_empty IsPiSystem.insert_empty
theorem IsPiSystem.insert_univ {Ξ±} {S : Set (Set Ξ±)} (h_pi : IsPiSystem S) :
IsPiSystem (insert Set.univ S) := by
intro s hs t ht hst
cases' hs with hs hs
Β· cases' ht with ht ht <;> simp [hs, ht]
Β· cases' ht with ht ht
Β· simp [hs, ht]
Β· exact Set.mem_insert_of_mem _ (h_pi s hs t ht hst)
#align is_pi_system.insert_univ IsPiSystem.insert_univ
theorem IsPiSystem.comap {Ξ± Ξ²} {S : Set (Set Ξ²)} (h_pi : IsPiSystem S) (f : Ξ± β Ξ²) :
IsPiSystem { s : Set Ξ± | β t β S, f β»ΒΉ' t = s } := by
rintro _ β¨s, hs_mem, rflβ© _ β¨t, ht_mem, rflβ© hst
rw [β Set.preimage_inter] at hst β’
exact β¨s β© t, h_pi s hs_mem t ht_mem (nonempty_of_nonempty_preimage hst), rflβ©
#align is_pi_system.comap IsPiSystem.comap
theorem isPiSystem_iUnion_of_directed_le {Ξ± ΞΉ} (p : ΞΉ β Set (Set Ξ±))
(hp_pi : β n, IsPiSystem (p n)) (hp_directed : Directed (Β· β€ Β·) p) :
IsPiSystem (β n, p n) := by
intro t1 ht1 t2 ht2 h
rw [Set.mem_iUnion] at ht1 ht2 β’
cases' ht1 with n ht1
cases' ht2 with m ht2
obtain β¨k, hpnk, hpmkβ© : β k, p n β€ p k β§ p m β€ p k := hp_directed n m
exact β¨k, hp_pi k t1 (hpnk ht1) t2 (hpmk ht2) hβ©
#align is_pi_system_Union_of_directed_le isPiSystem_iUnion_of_directed_le
theorem isPiSystem_iUnion_of_monotone {Ξ± ΞΉ} [SemilatticeSup ΞΉ] (p : ΞΉ β Set (Set Ξ±))
(hp_pi : β n, IsPiSystem (p n)) (hp_mono : Monotone p) : IsPiSystem (β n, p n) :=
isPiSystem_iUnion_of_directed_le p hp_pi (Monotone.directed_le hp_mono)
#align is_pi_system_Union_of_monotone isPiSystem_iUnion_of_monotone
section Order
variable {Ξ± : Type*} {ΞΉ ΞΉ' : Sort*} [LinearOrder Ξ±]
theorem isPiSystem_image_Iio (s : Set Ξ±) : IsPiSystem (Iio '' s) := by
rintro _ β¨a, ha, rflβ© _ β¨b, hb, rflβ© -
exact β¨a β b, inf_ind a b ha hb, Iio_inter_Iio.symmβ©
#align is_pi_system_image_Iio isPiSystem_image_Iio
theorem isPiSystem_Iio : IsPiSystem (range Iio : Set (Set Ξ±)) :=
@image_univ Ξ± _ Iio βΈ isPiSystem_image_Iio univ
#align is_pi_system_Iio isPiSystem_Iio
theorem isPiSystem_image_Ioi (s : Set Ξ±) : IsPiSystem (Ioi '' s) :=
@isPiSystem_image_Iio Ξ±α΅α΅ _ s
#align is_pi_system_image_Ioi isPiSystem_image_Ioi
theorem isPiSystem_Ioi : IsPiSystem (range Ioi : Set (Set Ξ±)) :=
@image_univ Ξ± _ Ioi βΈ isPiSystem_image_Ioi univ
#align is_pi_system_Ioi isPiSystem_Ioi
theorem isPiSystem_image_Iic (s : Set Ξ±) : IsPiSystem (Iic '' s) := by
rintro _ β¨a, ha, rflβ© _ β¨b, hb, rflβ© -
exact β¨a β b, inf_ind a b ha hb, Iic_inter_Iic.symmβ©
theorem isPiSystem_Iic : IsPiSystem (range Iic : Set (Set Ξ±)) :=
@image_univ Ξ± _ Iic βΈ isPiSystem_image_Iic univ
#align is_pi_system_Iic isPiSystem_Iic
theorem isPiSystem_image_Ici (s : Set Ξ±) : IsPiSystem (Ici '' s) :=
@isPiSystem_image_Iic Ξ±α΅α΅ _ s
theorem isPiSystem_Ici : IsPiSystem (range Ici : Set (Set Ξ±)) :=
@image_univ Ξ± _ Ici βΈ isPiSystem_image_Ici univ
#align is_pi_system_Ici isPiSystem_Ici
theorem isPiSystem_Ixx_mem {Ixx : Ξ± β Ξ± β Set Ξ±} {p : Ξ± β Ξ± β Prop}
(Hne : β {a b}, (Ixx a b).Nonempty β p a b)
(Hi : β {aβ bβ aβ bβ}, Ixx aβ bβ β© Ixx aβ bβ = Ixx (max aβ aβ) (min bβ bβ)) (s t : Set Ξ±) :
IsPiSystem { S | βα΅ (l β s) (u β t), p l u β§ Ixx l u = S } := by
rintro _ β¨lβ, hlsβ, uβ, hutβ, _, rflβ© _ β¨lβ, hlsβ, uβ, hutβ, _, rflβ©
simp only [Hi]
exact fun H => β¨lβ β lβ, sup_ind lβ lβ hlsβ hlsβ, uβ β uβ, inf_ind uβ uβ hutβ hutβ, Hne H, rflβ©
#align is_pi_system_Ixx_mem isPiSystem_Ixx_mem
| Mathlib/MeasureTheory/PiSystem.lean | 173 | 177 | theorem isPiSystem_Ixx {Ixx : Ξ± β Ξ± β Set Ξ±} {p : Ξ± β Ξ± β Prop}
(Hne : β {a b}, (Ixx a b).Nonempty β p a b)
(Hi : β {aβ bβ aβ bβ}, Ixx aβ bβ β© Ixx aβ bβ = Ixx (max aβ aβ) (min bβ bβ)) (f : ΞΉ β Ξ±)
(g : ΞΉ' β Ξ±) : @IsPiSystem Ξ± { S | β i j, p (f i) (g j) β§ Ixx (f i) (g j) = S } := by |
simpa only [exists_range_iff] using isPiSystem_Ixx_mem (@Hne) (@Hi) (range f) (range g)
|
import Mathlib.Data.ZMod.Basic
import Mathlib.GroupTheory.Coxeter.Basic
namespace CoxeterSystem
open List Matrix Function Classical
variable {B : Type*}
variable {W : Type*} [Group W]
variable {M : CoxeterMatrix B} (cs : CoxeterSystem M W)
local prefix:100 "s" => cs.simple
local prefix:100 "Ο" => cs.wordProd
private theorem exists_word_with_prod (w : W) : β n Ο, Ο.length = n β§ Ο Ο = w := by
rcases cs.wordProd_surjective w with β¨Ο, rflβ©
use Ο.length, Ο
noncomputable def length (w : W) : β := Nat.find (cs.exists_word_with_prod w)
local prefix:100 "β" => cs.length
theorem exists_reduced_word (w : W) : β Ο, Ο.length = β w β§ w = Ο Ο := by
have := Nat.find_spec (cs.exists_word_with_prod w)
tauto
theorem length_wordProd_le (Ο : List B) : β (Ο Ο) β€ Ο.length :=
Nat.find_min' (cs.exists_word_with_prod (Ο Ο)) β¨Ο, by tautoβ©
@[simp] theorem length_one : β (1 : W) = 0 := Nat.eq_zero_of_le_zero (cs.length_wordProd_le [])
@[simp]
theorem length_eq_zero_iff {w : W} : β w = 0 β w = 1 := by
constructor
Β· intro h
rcases cs.exists_reduced_word w with β¨Ο, hΟ, rflβ©
have : Ο = [] := eq_nil_of_length_eq_zero (hΟ.trans h)
rw [this, wordProd_nil]
Β· rintro rfl
exact cs.length_one
@[simp]
theorem length_inv (w : W) : β (wβ»ΒΉ) = β w := by
apply Nat.le_antisymm
Β· rcases cs.exists_reduced_word w with β¨Ο, hΟ, rflβ©
have := cs.length_wordProd_le (List.reverse Ο)
rwa [wordProd_reverse, length_reverse, hΟ] at this
Β· rcases cs.exists_reduced_word wβ»ΒΉ with β¨Ο, hΟ, h'Οβ©
have := cs.length_wordProd_le (List.reverse Ο)
rwa [wordProd_reverse, length_reverse, β h'Ο, hΟ, inv_inv] at this
theorem length_mul_le (wβ wβ : W) :
β (wβ * wβ) β€ β wβ + β wβ := by
rcases cs.exists_reduced_word wβ with β¨Οβ, hΟβ, rflβ©
rcases cs.exists_reduced_word wβ with β¨Οβ, hΟβ, rflβ©
have := cs.length_wordProd_le (Οβ ++ Οβ)
simpa [hΟβ, hΟβ, wordProd_append] using this
theorem length_mul_ge_length_sub_length (wβ wβ : W) :
β wβ - β wβ β€ β (wβ * wβ) := by
simpa [Nat.sub_le_of_le_add] using cs.length_mul_le (wβ * wβ) wββ»ΒΉ
theorem length_mul_ge_length_sub_length' (wβ wβ : W) :
β wβ - β wβ β€ β (wβ * wβ) := by
simpa [Nat.sub_le_of_le_add, add_comm] using cs.length_mul_le wββ»ΒΉ (wβ * wβ)
theorem length_mul_ge_max (wβ wβ : W) :
max (β wβ - β wβ) (β wβ - β wβ) β€ β (wβ * wβ) :=
max_le_iff.mpr β¨length_mul_ge_length_sub_length _ _ _, length_mul_ge_length_sub_length' _ _ _β©
def lengthParity : W β* Multiplicative (ZMod 2) := cs.lift β¨fun _ β¦ Multiplicative.ofAdd 1, by
simp_rw [CoxeterMatrix.IsLiftable, β ofAdd_add, (by decide : (1 + 1 : ZMod 2) = 0)]
simpβ©
theorem lengthParity_simple (i : B):
cs.lengthParity (s i) = Multiplicative.ofAdd 1 := cs.lift_apply_simple _ _
theorem lengthParity_comp_simple :
cs.lengthParity β cs.simple = fun _ β¦ Multiplicative.ofAdd 1 := funext cs.lengthParity_simple
theorem lengthParity_eq_ofAdd_length (w : W) :
cs.lengthParity w = Multiplicative.ofAdd (β(β w)) := by
rcases cs.exists_reduced_word w with β¨Ο, hΟ, rflβ©
rw [β hΟ, wordProd, map_list_prod, List.map_map, lengthParity_comp_simple, map_const',
prod_replicate, β ofAdd_nsmul, nsmul_one]
theorem length_mul_mod_two (wβ wβ : W) : β (wβ * wβ) % 2 = (β wβ + β wβ) % 2 := by
rw [β ZMod.natCast_eq_natCast_iff', Nat.cast_add]
simpa only [lengthParity_eq_ofAdd_length, ofAdd_add] using map_mul cs.lengthParity wβ wβ
@[simp]
theorem length_simple (i : B) : β (s i) = 1 := by
apply Nat.le_antisymm
Β· simpa using cs.length_wordProd_le [i]
Β· by_contra! length_lt_one
have : cs.lengthParity (s i) = Multiplicative.ofAdd 0 := by
rw [lengthParity_eq_ofAdd_length, Nat.lt_one_iff.mp length_lt_one, Nat.cast_zero]
have : Multiplicative.ofAdd (0 : ZMod 2) = Multiplicative.ofAdd 1 :=
this.symm.trans (cs.lengthParity_simple i)
contradiction
theorem length_eq_one_iff {w : W} : β w = 1 β β i : B, w = s i := by
constructor
Β· intro h
rcases cs.exists_reduced_word w with β¨Ο, hΟ, rflβ©
rcases List.length_eq_one.mp (hΟ.trans h) with β¨i, rflβ©
exact β¨i, cs.wordProd_singleton iβ©
Β· rintro β¨i, rflβ©
exact cs.length_simple i
theorem length_mul_simple_ne (w : W) (i : B) : β (w * s i) β β w := by
intro eq
have length_mod_two := cs.length_mul_mod_two w (s i)
rw [eq, length_simple] at length_mod_two
rcases Nat.mod_two_eq_zero_or_one (β w) with even | odd
Β· rw [even, Nat.succ_mod_two_eq_one_iff.mpr even] at length_mod_two
contradiction
Β· rw [odd, Nat.succ_mod_two_eq_zero_iff.mpr odd] at length_mod_two
contradiction
theorem length_simple_mul_ne (w : W) (i : B) : β (s i * w) β β w := by
convert cs.length_mul_simple_ne wβ»ΒΉ i using 1
Β· convert cs.length_inv ?_ using 2
simp
Β· simp
theorem length_mul_simple (w : W) (i : B) :
β (w * s i) = β w + 1 β¨ β (w * s i) + 1 = β w := by
rcases Nat.lt_or_gt_of_ne (cs.length_mul_simple_ne w i) with lt | gt
Β· -- lt : β (w * s i) < β w
right
have length_ge := cs.length_mul_ge_length_sub_length w (s i)
simp only [length_simple, tsub_le_iff_right] at length_ge
-- length_ge : β w β€ β (w * s i) + 1
linarith
Β· -- gt : β w < β (w * s i)
left
have length_le := cs.length_mul_le w (s i)
simp only [length_simple] at length_le
-- length_le : β (w * s i) β€ β w + 1
linarith
theorem length_simple_mul (w : W) (i : B) :
β (s i * w) = β w + 1 β¨ β (s i * w) + 1 = β w := by
have := cs.length_mul_simple wβ»ΒΉ i
rwa [(by simp : wβ»ΒΉ * (s i) = ((s i) * w)β»ΒΉ), length_inv, length_inv] at this
def IsReduced (Ο : List B) : Prop := β (Ο Ο) = Ο.length
@[simp]
theorem isReduced_reverse (Ο : List B) : cs.IsReduced (Ο.reverse) β cs.IsReduced Ο := by
simp [IsReduced]
theorem exists_reduced_word' (w : W) : β Ο : List B, cs.IsReduced Ο β§ w = Ο Ο := by
rcases cs.exists_reduced_word w with β¨Ο, hΟ, rflβ©
use Ο
tauto
private theorem isReduced_take_and_drop {Ο : List B} (hΟ : cs.IsReduced Ο) (j : β) :
cs.IsReduced (Ο.take j) β§ cs.IsReduced (Ο.drop j) := by
have hβ : β (Ο (Ο.take j)) β€ (Ο.take j).length := cs.length_wordProd_le (Ο.take j)
have hβ : β (Ο (Ο.drop j)) β€ (Ο.drop j).length := cs.length_wordProd_le (Ο.drop j)
have hβ := calc
(Ο.take j).length + (Ο.drop j).length
_ = Ο.length := by rw [β List.length_append, Ο.take_append_drop j];
_ = β (Ο Ο) := hΟ.symm
_ = β (Ο (Ο.take j) * Ο (Ο.drop j)) := by rw [β cs.wordProd_append, Ο.take_append_drop j];
_ β€ β (Ο (Ο.take j)) + β (Ο (Ο.drop j)) := cs.length_mul_le _ _
unfold IsReduced
exact β¨by linarith, by linarithβ©
theorem isReduced_take {Ο : List B} (hΟ : cs.IsReduced Ο) (j : β) : cs.IsReduced (Ο.take j) :=
(isReduced_take_and_drop _ hΟ _).1
theorem isReduced_drop {Ο : List B} (hΟ : cs.IsReduced Ο) (j : β) : cs.IsReduced (Ο.drop j) :=
(isReduced_take_and_drop _ hΟ _).2
theorem not_isReduced_alternatingWord (i i' : B) {m : β} (hM : M i i' β 0) (hm : m > M i i') :
Β¬cs.IsReduced (alternatingWord i i' m) := by
induction' hm with m _ ih
Β· -- Base case; m = M i i' + 1
suffices h : β (Ο (alternatingWord i i' (M i i' + 1))) < M i i' + 1 by
unfold IsReduced
rw [Nat.succ_eq_add_one, length_alternatingWord]
linarith
have : M i i' + 1 β€ M i i' * 2 := by linarith [Nat.one_le_iff_ne_zero.mpr hM]
rw [cs.prod_alternatingWord_eq_prod_alternatingWord_sub i i' _ this]
have : M i i' * 2 - (M i i' + 1) = M i i' - 1 := by
apply (Nat.sub_eq_iff_eq_add' this).mpr
rw [add_assoc, add_comm 1, Nat.sub_add_cancel (Nat.one_le_iff_ne_zero.mpr hM)]
exact mul_two _
rw [this]
calc
β (Ο (alternatingWord i' i (M i i' - 1)))
_ β€ (alternatingWord i' i (M i i' - 1)).length := cs.length_wordProd_le _
_ = M i i' - 1 := length_alternatingWord _ _ _
_ β€ M i i' := Nat.sub_le _ _
_ < M i i' + 1 := Nat.lt_succ_self _
Β· -- Inductive step
contrapose! ih
rw [alternatingWord_succ'] at ih
apply isReduced_drop (j := 1) at ih
simpa using ih
def IsLeftDescent (w : W) (i : B) : Prop := β (s i * w) < β w
def IsRightDescent (w : W) (i : B) : Prop := β (w * s i) < β w
| Mathlib/GroupTheory/Coxeter/Length.lean | 267 | 267 | theorem not_isLeftDescent_one (i : B) : Β¬cs.IsLeftDescent 1 i := by | simp [IsLeftDescent]
|
import Mathlib.Data.ZMod.Basic
import Mathlib.Algebra.Group.Nat
import Mathlib.Tactic.IntervalCases
import Mathlib.GroupTheory.SpecificGroups.Dihedral
import Mathlib.GroupTheory.SpecificGroups.Cyclic
#align_import group_theory.specific_groups.quaternion from "leanprover-community/mathlib"@"879155bff5af618b9062cbb2915347dafd749ad6"
inductive QuaternionGroup (n : β) : Type
| a : ZMod (2 * n) β QuaternionGroup n
| xa : ZMod (2 * n) β QuaternionGroup n
deriving DecidableEq
#align quaternion_group QuaternionGroup
namespace QuaternionGroup
variable {n : β}
private def mul : QuaternionGroup n β QuaternionGroup n β QuaternionGroup n
| a i, a j => a (i + j)
| a i, xa j => xa (j - i)
| xa i, a j => xa (i + j)
| xa i, xa j => a (n + j - i)
private def one : QuaternionGroup n :=
a 0
instance : Inhabited (QuaternionGroup n) :=
β¨oneβ©
private def inv : QuaternionGroup n β QuaternionGroup n
| a i => a (-i)
| xa i => xa (n + i)
instance : Group (QuaternionGroup n) where
mul := mul
mul_assoc := by
rintro (i | i) (j | j) (k | k) <;> simp only [(Β· * Β·), mul] <;> ring_nf
congr
calc
-(n : ZMod (2 * n)) = 0 - n := by rw [zero_sub]
_ = 2 * n - n := by norm_cast; simp
_ = n := by ring
one := one
one_mul := by
rintro (i | i)
Β· exact congr_arg a (zero_add i)
Β· exact congr_arg xa (sub_zero i)
mul_one := by
rintro (i | i)
Β· exact congr_arg a (add_zero i)
Β· exact congr_arg xa (add_zero i)
inv := inv
mul_left_inv := by
rintro (i | i)
Β· exact congr_arg a (neg_add_self i)
Β· exact congr_arg a (sub_self (n + i))
@[simp]
theorem a_mul_a (i j : ZMod (2 * n)) : a i * a j = a (i + j) :=
rfl
#align quaternion_group.a_mul_a QuaternionGroup.a_mul_a
@[simp]
theorem a_mul_xa (i j : ZMod (2 * n)) : a i * xa j = xa (j - i) :=
rfl
#align quaternion_group.a_mul_xa QuaternionGroup.a_mul_xa
@[simp]
theorem xa_mul_a (i j : ZMod (2 * n)) : xa i * a j = xa (i + j) :=
rfl
#align quaternion_group.xa_mul_a QuaternionGroup.xa_mul_a
@[simp]
theorem xa_mul_xa (i j : ZMod (2 * n)) : xa i * xa j = a ((n : ZMod (2 * n)) + j - i) :=
rfl
#align quaternion_group.xa_mul_xa QuaternionGroup.xa_mul_xa
theorem one_def : (1 : QuaternionGroup n) = a 0 :=
rfl
#align quaternion_group.one_def QuaternionGroup.one_def
private def fintypeHelper : Sum (ZMod (2 * n)) (ZMod (2 * n)) β QuaternionGroup n where
invFun i :=
match i with
| a j => Sum.inl j
| xa j => Sum.inr j
toFun i :=
match i with
| Sum.inl j => a j
| Sum.inr j => xa j
left_inv := by rintro (x | x) <;> rfl
right_inv := by rintro (x | x) <;> rfl
def quaternionGroupZeroEquivDihedralGroupZero : QuaternionGroup 0 β* DihedralGroup 0 where
toFun i :=
-- Porting note: Originally `QuaternionGroup.recOn i DihedralGroup.r DihedralGroup.sr`
match i with
| a j => DihedralGroup.r j
| xa j => DihedralGroup.sr j
invFun i :=
match i with
| DihedralGroup.r j => a j
| DihedralGroup.sr j => xa j
left_inv := by rintro (k | k) <;> rfl
right_inv := by rintro (k | k) <;> rfl
map_mul' := by rintro (k | k) (l | l) <;> simp
#align quaternion_group.quaternion_group_zero_equiv_dihedral_group_zero QuaternionGroup.quaternionGroupZeroEquivDihedralGroupZero
instance [NeZero n] : Fintype (QuaternionGroup n) :=
Fintype.ofEquiv _ fintypeHelper
instance : Nontrivial (QuaternionGroup n) :=
β¨β¨a 0, xa 0, by revert n; simpβ©β© -- Porting note: `revert n; simp` was `decide`
theorem card [NeZero n] : Fintype.card (QuaternionGroup n) = 4 * n := by
rw [β Fintype.card_eq.mpr β¨fintypeHelperβ©, Fintype.card_sum, ZMod.card, two_mul]
ring
#align quaternion_group.card QuaternionGroup.card
@[simp]
theorem a_one_pow (k : β) : (a 1 : QuaternionGroup n) ^ k = a k := by
induction' k with k IH
Β· rw [Nat.cast_zero]; rfl
Β· rw [pow_succ, IH, a_mul_a]
congr 1
norm_cast
#align quaternion_group.a_one_pow QuaternionGroup.a_one_pow
-- @[simp] -- Porting note: simp changes this to `a 0 = 1`, so this is no longer a good simp lemma.
| Mathlib/GroupTheory/SpecificGroups/Quaternion.lean | 189 | 192 | theorem a_one_pow_n : (a 1 : QuaternionGroup n) ^ (2 * n) = 1 := by |
rw [a_one_pow, one_def]
congr 1
exact ZMod.natCast_self _
|
import Mathlib.Data.Matrix.Basic
import Mathlib.Data.PEquiv
#align_import data.matrix.pequiv from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1"
namespace PEquiv
open Matrix
universe u v
variable {k l m n : Type*}
variable {Ξ± : Type v}
open Matrix
def toMatrix [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m β. n) : Matrix m n Ξ± :=
of fun i j => if j β f i then (1 : Ξ±) else 0
#align pequiv.to_matrix PEquiv.toMatrix
-- TODO: set as an equation lemma for `toMatrix`, see mathlib4#3024
@[simp]
theorem toMatrix_apply [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m β. n) (i j) :
toMatrix f i j = if j β f i then (1 : Ξ±) else 0 :=
rfl
#align pequiv.to_matrix_apply PEquiv.toMatrix_apply
theorem mul_matrix_apply [Fintype m] [DecidableEq m] [Semiring Ξ±] (f : l β. m) (M : Matrix m n Ξ±)
(i j) : (f.toMatrix * M :) i j = Option.casesOn (f i) 0 fun fi => M fi j := by
dsimp [toMatrix, Matrix.mul_apply]
cases' h : f i with fi
Β· simp [h]
Β· rw [Finset.sum_eq_single fi] <;> simp (config := { contextual := true }) [h, eq_comm]
#align pequiv.mul_matrix_apply PEquiv.mul_matrix_apply
theorem toMatrix_symm [DecidableEq m] [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m β. n) :
(f.symm.toMatrix : Matrix n m Ξ±) = f.toMatrixα΅ := by
ext
simp only [transpose, mem_iff_mem f, toMatrix_apply]
congr
#align pequiv.to_matrix_symm PEquiv.toMatrix_symm
@[simp]
theorem toMatrix_refl [DecidableEq n] [Zero Ξ±] [One Ξ±] :
((PEquiv.refl n).toMatrix : Matrix n n Ξ±) = 1 := by
ext
simp [toMatrix_apply, one_apply]
#align pequiv.to_matrix_refl PEquiv.toMatrix_refl
theorem matrix_mul_apply [Fintype m] [Semiring Ξ±] [DecidableEq n] (M : Matrix l m Ξ±) (f : m β. n)
(i j) : (M * f.toMatrix :) i j = Option.casesOn (f.symm j) 0 fun fj => M i fj := by
dsimp [toMatrix, Matrix.mul_apply]
cases' h : f.symm j with fj
Β· simp [h, β f.eq_some_iff]
Β· rw [Finset.sum_eq_single fj]
Β· simp [h, β f.eq_some_iff]
Β· rintro b - n
simp [h, β f.eq_some_iff, n.symm]
Β· simp
#align pequiv.matrix_mul_apply PEquiv.matrix_mul_apply
theorem toPEquiv_mul_matrix [Fintype m] [DecidableEq m] [Semiring Ξ±] (f : m β m)
(M : Matrix m n Ξ±) : f.toPEquiv.toMatrix * M = M.submatrix f id := by
ext i j
rw [mul_matrix_apply, Equiv.toPEquiv_apply, submatrix_apply, id]
#align pequiv.to_pequiv_mul_matrix PEquiv.toPEquiv_mul_matrix
theorem mul_toPEquiv_toMatrix {m n Ξ± : Type*} [Fintype n] [DecidableEq n] [Semiring Ξ±] (f : n β n)
(M : Matrix m n Ξ±) : M * f.toPEquiv.toMatrix = M.submatrix id f.symm :=
Matrix.ext fun i j => by
rw [PEquiv.matrix_mul_apply, β Equiv.toPEquiv_symm, Equiv.toPEquiv_apply,
Matrix.submatrix_apply, id]
#align pequiv.mul_to_pequiv_to_matrix PEquiv.mul_toPEquiv_toMatrix
theorem toMatrix_trans [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring Ξ±] (f : l β. m)
(g : m β. n) : ((f.trans g).toMatrix : Matrix l n Ξ±) = f.toMatrix * g.toMatrix := by
ext i j
rw [mul_matrix_apply]
dsimp [toMatrix, PEquiv.trans]
cases f i <;> simp
#align pequiv.to_matrix_trans PEquiv.toMatrix_trans
@[simp]
theorem toMatrix_bot [DecidableEq n] [Zero Ξ±] [One Ξ±] :
((β₯ : PEquiv m n).toMatrix : Matrix m n Ξ±) = 0 :=
rfl
#align pequiv.to_matrix_bot PEquiv.toMatrix_bot
theorem toMatrix_injective [DecidableEq n] [MonoidWithZero Ξ±] [Nontrivial Ξ±] :
Function.Injective (@toMatrix m n Ξ± _ _ _) := by
classical
intro f g
refine not_imp_not.1 ?_
simp only [Matrix.ext_iff.symm, toMatrix_apply, PEquiv.ext_iff, not_forall, exists_imp]
intro i hi
use i
cases' hf : f i with fi
Β· cases' hg : g i with gi
-- Porting note: was `cc`
Β· rw [hf, hg] at hi
exact (hi rfl).elim
Β· use gi
simp
Β· use fi
simp [hf.symm, Ne.symm hi]
#align pequiv.to_matrix_injective PEquiv.toMatrix_injective
theorem toMatrix_swap [DecidableEq n] [Ring Ξ±] (i j : n) :
(Equiv.swap i j).toPEquiv.toMatrix =
(1 : Matrix n n Ξ±) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
(single j i).toMatrix := by
ext
dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
split_ifs <;> simp_all
#align pequiv.to_matrix_swap PEquiv.toMatrix_swap
@[simp]
theorem single_mul_single [Fintype n] [DecidableEq k] [DecidableEq m] [DecidableEq n] [Semiring Ξ±]
(a : m) (b : n) (c : k) :
((single a b).toMatrix : Matrix _ _ Ξ±) * (single b c).toMatrix = (single a c).toMatrix := by
rw [β toMatrix_trans, single_trans_single]
#align pequiv.single_mul_single PEquiv.single_mul_single
theorem single_mul_single_of_ne [Fintype n] [DecidableEq n] [DecidableEq k] [DecidableEq m]
[Semiring Ξ±] {bβ bβ : n} (hb : bβ β bβ) (a : m) (c : k) :
(single a bβ).toMatrix * (single bβ c).toMatrix = (0 : Matrix _ _ Ξ±) := by
rw [β toMatrix_trans, single_trans_single_of_ne hb, toMatrix_bot]
#align pequiv.single_mul_single_of_ne PEquiv.single_mul_single_of_ne
@[simp]
| Mathlib/Data/Matrix/PEquiv.lean | 167 | 170 | theorem single_mul_single_right [Fintype n] [Fintype k] [DecidableEq n] [DecidableEq k]
[DecidableEq m] [Semiring Ξ±] (a : m) (b : n) (c : k) (M : Matrix k l Ξ±) :
(single a b).toMatrix * ((single b c).toMatrix * M) = (single a c).toMatrix * M := by |
rw [β Matrix.mul_assoc, single_mul_single]
|
import Mathlib.Geometry.Manifold.ContMDiff.Basic
open Set ChartedSpace SmoothManifoldWithCorners
open scoped Manifold
variable {π : Type*} [NontriviallyNormedField π]
-- declare a smooth manifold `M` over the pair `(E, H)`.
{E : Type*}
[NormedAddCommGroup E] [NormedSpace π E] {H : Type*} [TopologicalSpace H]
{I : ModelWithCorners π E H} {M : Type*} [TopologicalSpace M] [ChartedSpace H M]
[SmoothManifoldWithCorners I M]
-- declare a smooth manifold `M'` over the pair `(E', H')`.
{E' : Type*}
[NormedAddCommGroup E'] [NormedSpace π E'] {H' : Type*} [TopologicalSpace H']
{I' : ModelWithCorners π E' H'} {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
-- declare functions, sets, points and smoothness indices
{e : PartialHomeomorph M H} {x : M} {m n : ββ}
section Atlas
theorem contMDiff_model : ContMDiff I π(π, E) n I := by
intro x
refine (contMDiffAt_iff _ _).mpr β¨I.continuousAt, ?_β©
simp only [mfld_simps]
refine contDiffWithinAt_id.congr_of_eventuallyEq ?_ ?_
Β· exact Filter.eventuallyEq_of_mem self_mem_nhdsWithin fun xβ => I.right_inv
simp_rw [Function.comp_apply, I.left_inv, Function.id_def]
#align cont_mdiff_model contMDiff_model
| Mathlib/Geometry/Manifold/ContMDiff/Atlas.lean | 45 | 49 | theorem contMDiffOn_model_symm : ContMDiffOn π(π, E) I n I.symm (range I) := by |
rw [contMDiffOn_iff]
refine β¨I.continuousOn_symm, fun x y => ?_β©
simp only [mfld_simps]
exact contDiffOn_id.congr fun x' => I.right_inv
|
import Mathlib.Dynamics.Ergodic.MeasurePreserving
import Mathlib.LinearAlgebra.Determinant
import Mathlib.LinearAlgebra.Matrix.Diagonal
import Mathlib.LinearAlgebra.Matrix.Transvection
import Mathlib.MeasureTheory.Group.LIntegral
import Mathlib.MeasureTheory.Integral.Marginal
import Mathlib.MeasureTheory.Measure.Stieltjes
import Mathlib.MeasureTheory.Measure.Haar.OfBasis
#align_import measure_theory.measure.lebesgue.basic from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
assert_not_exists MeasureTheory.integral
noncomputable section
open scoped Classical
open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace
open ENNReal (ofReal)
open scoped ENNReal NNReal Topology
namespace Real
variable {ΞΉ : Type*} [Fintype ΞΉ]
theorem volume_eq_stieltjes_id : (volume : Measure β) = StieltjesFunction.id.measure := by
haveI : IsAddLeftInvariant StieltjesFunction.id.measure :=
β¨fun a =>
Eq.symm <|
Real.measure_ext_Ioo_rat fun p q => by
simp only [Measure.map_apply (measurable_const_add a) measurableSet_Ioo,
sub_sub_sub_cancel_right, StieltjesFunction.measure_Ioo, StieltjesFunction.id_leftLim,
StieltjesFunction.id_apply, id, preimage_const_add_Ioo]β©
have A : StieltjesFunction.id.measure (stdOrthonormalBasis β β).toBasis.parallelepiped = 1 := by
change StieltjesFunction.id.measure (parallelepiped (stdOrthonormalBasis β β)) = 1
rcases parallelepiped_orthonormalBasis_one_dim (stdOrthonormalBasis β β) with (H | H) <;>
simp only [H, StieltjesFunction.measure_Icc, StieltjesFunction.id_apply, id, tsub_zero,
StieltjesFunction.id_leftLim, sub_neg_eq_add, zero_add, ENNReal.ofReal_one]
conv_rhs =>
rw [addHaarMeasure_unique StieltjesFunction.id.measure
(stdOrthonormalBasis β β).toBasis.parallelepiped, A]
simp only [volume, Basis.addHaar, one_smul]
#align real.volume_eq_stieltjes_id Real.volume_eq_stieltjes_id
theorem volume_val (s) : volume s = StieltjesFunction.id.measure s := by
simp [volume_eq_stieltjes_id]
#align real.volume_val Real.volume_val
@[simp]
theorem volume_Ico {a b : β} : volume (Ico a b) = ofReal (b - a) := by simp [volume_val]
#align real.volume_Ico Real.volume_Ico
@[simp]
theorem volume_Icc {a b : β} : volume (Icc a b) = ofReal (b - a) := by simp [volume_val]
#align real.volume_Icc Real.volume_Icc
@[simp]
theorem volume_Ioo {a b : β} : volume (Ioo a b) = ofReal (b - a) := by simp [volume_val]
#align real.volume_Ioo Real.volume_Ioo
@[simp]
theorem volume_Ioc {a b : β} : volume (Ioc a b) = ofReal (b - a) := by simp [volume_val]
#align real.volume_Ioc Real.volume_Ioc
-- @[simp] -- Porting note (#10618): simp can prove this
theorem volume_singleton {a : β} : volume ({a} : Set β) = 0 := by simp [volume_val]
#align real.volume_singleton Real.volume_singleton
-- @[simp] -- Porting note (#10618): simp can prove this, after mathlib4#4628
theorem volume_univ : volume (univ : Set β) = β :=
ENNReal.eq_top_of_forall_nnreal_le fun r =>
calc
(r : ββ₯0β) = volume (Icc (0 : β) r) := by simp
_ β€ volume univ := measure_mono (subset_univ _)
#align real.volume_univ Real.volume_univ
@[simp]
theorem volume_ball (a r : β) : volume (Metric.ball a r) = ofReal (2 * r) := by
rw [ball_eq_Ioo, volume_Ioo, β sub_add, add_sub_cancel_left, two_mul]
#align real.volume_ball Real.volume_ball
@[simp]
theorem volume_closedBall (a r : β) : volume (Metric.closedBall a r) = ofReal (2 * r) := by
rw [closedBall_eq_Icc, volume_Icc, β sub_add, add_sub_cancel_left, two_mul]
#align real.volume_closed_ball Real.volume_closedBall
@[simp]
theorem volume_emetric_ball (a : β) (r : ββ₯0β) : volume (EMetric.ball a r) = 2 * r := by
rcases eq_or_ne r β with (rfl | hr)
Β· rw [Metric.emetric_ball_top, volume_univ, two_mul, _root_.top_add]
Β· lift r to ββ₯0 using hr
rw [Metric.emetric_ball_nnreal, volume_ball, two_mul, β NNReal.coe_add,
ENNReal.ofReal_coe_nnreal, ENNReal.coe_add, two_mul]
#align real.volume_emetric_ball Real.volume_emetric_ball
@[simp]
theorem volume_emetric_closedBall (a : β) (r : ββ₯0β) : volume (EMetric.closedBall a r) = 2 * r := by
rcases eq_or_ne r β with (rfl | hr)
Β· rw [EMetric.closedBall_top, volume_univ, two_mul, _root_.top_add]
Β· lift r to ββ₯0 using hr
rw [Metric.emetric_closedBall_nnreal, volume_closedBall, two_mul, β NNReal.coe_add,
ENNReal.ofReal_coe_nnreal, ENNReal.coe_add, two_mul]
#align real.volume_emetric_closed_ball Real.volume_emetric_closedBall
instance noAtoms_volume : NoAtoms (volume : Measure β) :=
β¨fun _ => volume_singletonβ©
#align real.has_no_atoms_volume Real.noAtoms_volume
@[simp]
theorem volume_interval {a b : β} : volume (uIcc a b) = ofReal |b - a| := by
rw [β Icc_min_max, volume_Icc, max_sub_min_eq_abs]
#align real.volume_interval Real.volume_interval
@[simp]
theorem volume_Ioi {a : β} : volume (Ioi a) = β :=
top_unique <|
le_of_tendsto' ENNReal.tendsto_nat_nhds_top fun n =>
calc
(n : ββ₯0β) = volume (Ioo a (a + n)) := by simp
_ β€ volume (Ioi a) := measure_mono Ioo_subset_Ioi_self
#align real.volume_Ioi Real.volume_Ioi
@[simp]
theorem volume_Ici {a : β} : volume (Ici a) = β := by rw [β measure_congr Ioi_ae_eq_Ici]; simp
#align real.volume_Ici Real.volume_Ici
@[simp]
| Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean | 158 | 163 | theorem volume_Iio {a : β} : volume (Iio a) = β :=
top_unique <|
le_of_tendsto' ENNReal.tendsto_nat_nhds_top fun n =>
calc
(n : ββ₯0β) = volume (Ioo (a - n) a) := by | simp
_ β€ volume (Iio a) := measure_mono Ioo_subset_Iio_self
|
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Fintype.BigOperators
import Mathlib.LinearAlgebra.AffineSpace.AffineMap
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.Tactic.FinCases
#align_import linear_algebra.affine_space.combination from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
noncomputable section
open Affine
namespace Finset
theorem univ_fin2 : (univ : Finset (Fin 2)) = {0, 1} := by
ext x
fin_cases x <;> simp
#align finset.univ_fin2 Finset.univ_fin2
variable {k : Type*} {V : Type*} {P : Type*} [Ring k] [AddCommGroup V] [Module k V]
variable [S : AffineSpace V P]
variable {ΞΉ : Type*} (s : Finset ΞΉ)
variable {ΞΉβ : Type*} (sβ : Finset ΞΉβ)
def weightedVSubOfPoint (p : ΞΉ β P) (b : P) : (ΞΉ β k) ββ[k] V :=
β i β s, (LinearMap.proj i : (ΞΉ β k) ββ[k] k).smulRight (p i -α΅₯ b)
#align finset.weighted_vsub_of_point Finset.weightedVSubOfPoint
@[simp]
theorem weightedVSubOfPoint_apply (w : ΞΉ β k) (p : ΞΉ β P) (b : P) :
s.weightedVSubOfPoint p b w = β i β s, w i β’ (p i -α΅₯ b) := by
simp [weightedVSubOfPoint, LinearMap.sum_apply]
#align finset.weighted_vsub_of_point_apply Finset.weightedVSubOfPoint_apply
@[simp (high)]
theorem weightedVSubOfPoint_apply_const (w : ΞΉ β k) (p : P) (b : P) :
s.weightedVSubOfPoint (fun _ => p) b w = (β i β s, w i) β’ (p -α΅₯ b) := by
rw [weightedVSubOfPoint_apply, sum_smul]
#align finset.weighted_vsub_of_point_apply_const Finset.weightedVSubOfPoint_apply_const
theorem weightedVSubOfPoint_congr {wβ wβ : ΞΉ β k} (hw : β i β s, wβ i = wβ i) {pβ pβ : ΞΉ β P}
(hp : β i β s, pβ i = pβ i) (b : P) :
s.weightedVSubOfPoint pβ b wβ = s.weightedVSubOfPoint pβ b wβ := by
simp_rw [weightedVSubOfPoint_apply]
refine sum_congr rfl fun i hi => ?_
rw [hw i hi, hp i hi]
#align finset.weighted_vsub_of_point_congr Finset.weightedVSubOfPoint_congr
theorem weightedVSubOfPoint_eq_of_weights_eq (p : ΞΉ β P) (j : ΞΉ) (wβ wβ : ΞΉ β k)
(hw : β i, i β j β wβ i = wβ i) :
s.weightedVSubOfPoint p (p j) wβ = s.weightedVSubOfPoint p (p j) wβ := by
simp only [Finset.weightedVSubOfPoint_apply]
congr
ext i
rcases eq_or_ne i j with h | h
Β· simp [h]
Β· simp [hw i h]
#align finset.weighted_vsub_of_point_eq_of_weights_eq Finset.weightedVSubOfPoint_eq_of_weights_eq
theorem weightedVSubOfPoint_eq_of_sum_eq_zero (w : ΞΉ β k) (p : ΞΉ β P) (h : β i β s, w i = 0)
(bβ bβ : P) : s.weightedVSubOfPoint p bβ w = s.weightedVSubOfPoint p bβ w := by
apply eq_of_sub_eq_zero
rw [weightedVSubOfPoint_apply, weightedVSubOfPoint_apply, β sum_sub_distrib]
conv_lhs =>
congr
Β· skip
Β· ext
rw [β smul_sub, vsub_sub_vsub_cancel_left]
rw [β sum_smul, h, zero_smul]
#align finset.weighted_vsub_of_point_eq_of_sum_eq_zero Finset.weightedVSubOfPoint_eq_of_sum_eq_zero
theorem weightedVSubOfPoint_vadd_eq_of_sum_eq_one (w : ΞΉ β k) (p : ΞΉ β P) (h : β i β s, w i = 1)
(bβ bβ : P) : s.weightedVSubOfPoint p bβ w +α΅₯ bβ = s.weightedVSubOfPoint p bβ w +α΅₯ bβ := by
erw [weightedVSubOfPoint_apply, weightedVSubOfPoint_apply, β @vsub_eq_zero_iff_eq V,
vadd_vsub_assoc, vsub_vadd_eq_vsub_sub, β add_sub_assoc, add_comm, add_sub_assoc, β
sum_sub_distrib]
conv_lhs =>
congr
Β· skip
Β· congr
Β· skip
Β· ext
rw [β smul_sub, vsub_sub_vsub_cancel_left]
rw [β sum_smul, h, one_smul, vsub_add_vsub_cancel, vsub_self]
#align finset.weighted_vsub_of_point_vadd_eq_of_sum_eq_one Finset.weightedVSubOfPoint_vadd_eq_of_sum_eq_one
@[simp (high)]
theorem weightedVSubOfPoint_erase [DecidableEq ΞΉ] (w : ΞΉ β k) (p : ΞΉ β P) (i : ΞΉ) :
(s.erase i).weightedVSubOfPoint p (p i) w = s.weightedVSubOfPoint p (p i) w := by
rw [weightedVSubOfPoint_apply, weightedVSubOfPoint_apply]
apply sum_erase
rw [vsub_self, smul_zero]
#align finset.weighted_vsub_of_point_erase Finset.weightedVSubOfPoint_erase
@[simp (high)]
theorem weightedVSubOfPoint_insert [DecidableEq ΞΉ] (w : ΞΉ β k) (p : ΞΉ β P) (i : ΞΉ) :
(insert i s).weightedVSubOfPoint p (p i) w = s.weightedVSubOfPoint p (p i) w := by
rw [weightedVSubOfPoint_apply, weightedVSubOfPoint_apply]
apply sum_insert_zero
rw [vsub_self, smul_zero]
#align finset.weighted_vsub_of_point_insert Finset.weightedVSubOfPoint_insert
theorem weightedVSubOfPoint_indicator_subset (w : ΞΉ β k) (p : ΞΉ β P) (b : P) {sβ sβ : Finset ΞΉ}
(h : sβ β sβ) :
sβ.weightedVSubOfPoint p b w = sβ.weightedVSubOfPoint p b (Set.indicator (βsβ) w) := by
rw [weightedVSubOfPoint_apply, weightedVSubOfPoint_apply]
exact Eq.symm <|
sum_indicator_subset_of_eq_zero w (fun i wi => wi β’ (p i -α΅₯ b : V)) h fun i => zero_smul k _
#align finset.weighted_vsub_of_point_indicator_subset Finset.weightedVSubOfPoint_indicator_subset
theorem weightedVSubOfPoint_map (e : ΞΉβ βͺ ΞΉ) (w : ΞΉ β k) (p : ΞΉ β P) (b : P) :
(sβ.map e).weightedVSubOfPoint p b w = sβ.weightedVSubOfPoint (p β e) b (w β e) := by
simp_rw [weightedVSubOfPoint_apply]
exact Finset.sum_map _ _ _
#align finset.weighted_vsub_of_point_map Finset.weightedVSubOfPoint_map
theorem sum_smul_vsub_eq_weightedVSubOfPoint_sub (w : ΞΉ β k) (pβ pβ : ΞΉ β P) (b : P) :
(β i β s, w i β’ (pβ i -α΅₯ pβ i)) =
s.weightedVSubOfPoint pβ b w - s.weightedVSubOfPoint pβ b w := by
simp_rw [weightedVSubOfPoint_apply, β sum_sub_distrib, β smul_sub, vsub_sub_vsub_cancel_right]
#align finset.sum_smul_vsub_eq_weighted_vsub_of_point_sub Finset.sum_smul_vsub_eq_weightedVSubOfPoint_sub
theorem sum_smul_vsub_const_eq_weightedVSubOfPoint_sub (w : ΞΉ β k) (pβ : ΞΉ β P) (pβ b : P) :
(β i β s, w i β’ (pβ i -α΅₯ pβ)) = s.weightedVSubOfPoint pβ b w - (β i β s, w i) β’ (pβ -α΅₯ b) := by
rw [sum_smul_vsub_eq_weightedVSubOfPoint_sub, weightedVSubOfPoint_apply_const]
#align finset.sum_smul_vsub_const_eq_weighted_vsub_of_point_sub Finset.sum_smul_vsub_const_eq_weightedVSubOfPoint_sub
theorem sum_smul_const_vsub_eq_sub_weightedVSubOfPoint (w : ΞΉ β k) (pβ : ΞΉ β P) (pβ b : P) :
(β i β s, w i β’ (pβ -α΅₯ pβ i)) = (β i β s, w i) β’ (pβ -α΅₯ b) - s.weightedVSubOfPoint pβ b w := by
rw [sum_smul_vsub_eq_weightedVSubOfPoint_sub, weightedVSubOfPoint_apply_const]
#align finset.sum_smul_const_vsub_eq_sub_weighted_vsub_of_point Finset.sum_smul_const_vsub_eq_sub_weightedVSubOfPoint
theorem weightedVSubOfPoint_sdiff [DecidableEq ΞΉ] {sβ : Finset ΞΉ} (h : sβ β s) (w : ΞΉ β k)
(p : ΞΉ β P) (b : P) :
(s \ sβ).weightedVSubOfPoint p b w + sβ.weightedVSubOfPoint p b w =
s.weightedVSubOfPoint p b w := by
simp_rw [weightedVSubOfPoint_apply, sum_sdiff h]
#align finset.weighted_vsub_of_point_sdiff Finset.weightedVSubOfPoint_sdiff
theorem weightedVSubOfPoint_sdiff_sub [DecidableEq ΞΉ] {sβ : Finset ΞΉ} (h : sβ β s) (w : ΞΉ β k)
(p : ΞΉ β P) (b : P) :
(s \ sβ).weightedVSubOfPoint p b w - sβ.weightedVSubOfPoint p b (-w) =
s.weightedVSubOfPoint p b w := by
rw [map_neg, sub_neg_eq_add, s.weightedVSubOfPoint_sdiff h]
#align finset.weighted_vsub_of_point_sdiff_sub Finset.weightedVSubOfPoint_sdiff_sub
theorem weightedVSubOfPoint_subtype_eq_filter (w : ΞΉ β k) (p : ΞΉ β P) (b : P) (pred : ΞΉ β Prop)
[DecidablePred pred] :
((s.subtype pred).weightedVSubOfPoint (fun i => p i) b fun i => w i) =
(s.filter pred).weightedVSubOfPoint p b w := by
rw [weightedVSubOfPoint_apply, weightedVSubOfPoint_apply, β sum_subtype_eq_sum_filter]
#align finset.weighted_vsub_of_point_subtype_eq_filter Finset.weightedVSubOfPoint_subtype_eq_filter
theorem weightedVSubOfPoint_filter_of_ne (w : ΞΉ β k) (p : ΞΉ β P) (b : P) {pred : ΞΉ β Prop}
[DecidablePred pred] (h : β i β s, w i β 0 β pred i) :
(s.filter pred).weightedVSubOfPoint p b w = s.weightedVSubOfPoint p b w := by
rw [weightedVSubOfPoint_apply, weightedVSubOfPoint_apply, sum_filter_of_ne]
intro i hi hne
refine h i hi ?_
intro hw
simp [hw] at hne
#align finset.weighted_vsub_of_point_filter_of_ne Finset.weightedVSubOfPoint_filter_of_ne
theorem weightedVSubOfPoint_const_smul (w : ΞΉ β k) (p : ΞΉ β P) (b : P) (c : k) :
s.weightedVSubOfPoint p b (c β’ w) = c β’ s.weightedVSubOfPoint p b w := by
simp_rw [weightedVSubOfPoint_apply, smul_sum, Pi.smul_apply, smul_smul, smul_eq_mul]
#align finset.weighted_vsub_of_point_const_smul Finset.weightedVSubOfPoint_const_smul
def weightedVSub (p : ΞΉ β P) : (ΞΉ β k) ββ[k] V :=
s.weightedVSubOfPoint p (Classical.choice S.nonempty)
#align finset.weighted_vsub Finset.weightedVSub
theorem weightedVSub_apply (w : ΞΉ β k) (p : ΞΉ β P) :
s.weightedVSub p w = β i β s, w i β’ (p i -α΅₯ Classical.choice S.nonempty) := by
simp [weightedVSub, LinearMap.sum_apply]
#align finset.weighted_vsub_apply Finset.weightedVSub_apply
theorem weightedVSub_eq_weightedVSubOfPoint_of_sum_eq_zero (w : ΞΉ β k) (p : ΞΉ β P)
(h : β i β s, w i = 0) (b : P) : s.weightedVSub p w = s.weightedVSubOfPoint p b w :=
s.weightedVSubOfPoint_eq_of_sum_eq_zero w p h _ _
#align finset.weighted_vsub_eq_weighted_vsub_of_point_of_sum_eq_zero Finset.weightedVSub_eq_weightedVSubOfPoint_of_sum_eq_zero
@[simp]
theorem weightedVSub_apply_const (w : ΞΉ β k) (p : P) (h : β i β s, w i = 0) :
s.weightedVSub (fun _ => p) w = 0 := by
rw [weightedVSub, weightedVSubOfPoint_apply_const, h, zero_smul]
#align finset.weighted_vsub_apply_const Finset.weightedVSub_apply_const
@[simp]
theorem weightedVSub_empty (w : ΞΉ β k) (p : ΞΉ β P) : (β
: Finset ΞΉ).weightedVSub p w = (0 : V) := by
simp [weightedVSub_apply]
#align finset.weighted_vsub_empty Finset.weightedVSub_empty
theorem weightedVSub_congr {wβ wβ : ΞΉ β k} (hw : β i β s, wβ i = wβ i) {pβ pβ : ΞΉ β P}
(hp : β i β s, pβ i = pβ i) : s.weightedVSub pβ wβ = s.weightedVSub pβ wβ :=
s.weightedVSubOfPoint_congr hw hp _
#align finset.weighted_vsub_congr Finset.weightedVSub_congr
theorem weightedVSub_indicator_subset (w : ΞΉ β k) (p : ΞΉ β P) {sβ sβ : Finset ΞΉ} (h : sβ β sβ) :
sβ.weightedVSub p w = sβ.weightedVSub p (Set.indicator (βsβ) w) :=
weightedVSubOfPoint_indicator_subset _ _ _ h
#align finset.weighted_vsub_indicator_subset Finset.weightedVSub_indicator_subset
theorem weightedVSub_map (e : ΞΉβ βͺ ΞΉ) (w : ΞΉ β k) (p : ΞΉ β P) :
(sβ.map e).weightedVSub p w = sβ.weightedVSub (p β e) (w β e) :=
sβ.weightedVSubOfPoint_map _ _ _ _
#align finset.weighted_vsub_map Finset.weightedVSub_map
theorem sum_smul_vsub_eq_weightedVSub_sub (w : ΞΉ β k) (pβ pβ : ΞΉ β P) :
(β i β s, w i β’ (pβ i -α΅₯ pβ i)) = s.weightedVSub pβ w - s.weightedVSub pβ w :=
s.sum_smul_vsub_eq_weightedVSubOfPoint_sub _ _ _ _
#align finset.sum_smul_vsub_eq_weighted_vsub_sub Finset.sum_smul_vsub_eq_weightedVSub_sub
theorem sum_smul_vsub_const_eq_weightedVSub (w : ΞΉ β k) (pβ : ΞΉ β P) (pβ : P)
(h : β i β s, w i = 0) : (β i β s, w i β’ (pβ i -α΅₯ pβ)) = s.weightedVSub pβ w := by
rw [sum_smul_vsub_eq_weightedVSub_sub, s.weightedVSub_apply_const _ _ h, sub_zero]
#align finset.sum_smul_vsub_const_eq_weighted_vsub Finset.sum_smul_vsub_const_eq_weightedVSub
theorem sum_smul_const_vsub_eq_neg_weightedVSub (w : ΞΉ β k) (pβ : ΞΉ β P) (pβ : P)
(h : β i β s, w i = 0) : (β i β s, w i β’ (pβ -α΅₯ pβ i)) = -s.weightedVSub pβ w := by
rw [sum_smul_vsub_eq_weightedVSub_sub, s.weightedVSub_apply_const _ _ h, zero_sub]
#align finset.sum_smul_const_vsub_eq_neg_weighted_vsub Finset.sum_smul_const_vsub_eq_neg_weightedVSub
theorem weightedVSub_sdiff [DecidableEq ΞΉ] {sβ : Finset ΞΉ} (h : sβ β s) (w : ΞΉ β k) (p : ΞΉ β P) :
(s \ sβ).weightedVSub p w + sβ.weightedVSub p w = s.weightedVSub p w :=
s.weightedVSubOfPoint_sdiff h _ _ _
#align finset.weighted_vsub_sdiff Finset.weightedVSub_sdiff
theorem weightedVSub_sdiff_sub [DecidableEq ΞΉ] {sβ : Finset ΞΉ} (h : sβ β s) (w : ΞΉ β k)
(p : ΞΉ β P) : (s \ sβ).weightedVSub p w - sβ.weightedVSub p (-w) = s.weightedVSub p w :=
s.weightedVSubOfPoint_sdiff_sub h _ _ _
#align finset.weighted_vsub_sdiff_sub Finset.weightedVSub_sdiff_sub
theorem weightedVSub_subtype_eq_filter (w : ΞΉ β k) (p : ΞΉ β P) (pred : ΞΉ β Prop)
[DecidablePred pred] :
((s.subtype pred).weightedVSub (fun i => p i) fun i => w i) =
(s.filter pred).weightedVSub p w :=
s.weightedVSubOfPoint_subtype_eq_filter _ _ _ _
#align finset.weighted_vsub_subtype_eq_filter Finset.weightedVSub_subtype_eq_filter
theorem weightedVSub_filter_of_ne (w : ΞΉ β k) (p : ΞΉ β P) {pred : ΞΉ β Prop} [DecidablePred pred]
(h : β i β s, w i β 0 β pred i) : (s.filter pred).weightedVSub p w = s.weightedVSub p w :=
s.weightedVSubOfPoint_filter_of_ne _ _ _ h
#align finset.weighted_vsub_filter_of_ne Finset.weightedVSub_filter_of_ne
theorem weightedVSub_const_smul (w : ΞΉ β k) (p : ΞΉ β P) (c : k) :
s.weightedVSub p (c β’ w) = c β’ s.weightedVSub p w :=
s.weightedVSubOfPoint_const_smul _ _ _ _
#align finset.weighted_vsub_const_smul Finset.weightedVSub_const_smul
instance : AffineSpace (ΞΉ β k) (ΞΉ β k) := Pi.instAddTorsor
variable (k)
def affineCombination (p : ΞΉ β P) : (ΞΉ β k) βα΅[k] P where
toFun w := s.weightedVSubOfPoint p (Classical.choice S.nonempty) w +α΅₯ Classical.choice S.nonempty
linear := s.weightedVSub p
map_vadd' wβ wβ := by simp_rw [vadd_vadd, weightedVSub, vadd_eq_add, LinearMap.map_add]
#align finset.affine_combination Finset.affineCombination
@[simp]
theorem affineCombination_linear (p : ΞΉ β P) :
(s.affineCombination k p).linear = s.weightedVSub p :=
rfl
#align finset.affine_combination_linear Finset.affineCombination_linear
variable {k}
theorem affineCombination_apply (w : ΞΉ β k) (p : ΞΉ β P) :
(s.affineCombination k p) w =
s.weightedVSubOfPoint p (Classical.choice S.nonempty) w +α΅₯ Classical.choice S.nonempty :=
rfl
#align finset.affine_combination_apply Finset.affineCombination_apply
@[simp]
theorem affineCombination_apply_const (w : ΞΉ β k) (p : P) (h : β i β s, w i = 1) :
s.affineCombination k (fun _ => p) w = p := by
rw [affineCombination_apply, s.weightedVSubOfPoint_apply_const, h, one_smul, vsub_vadd]
#align finset.affine_combination_apply_const Finset.affineCombination_apply_const
theorem affineCombination_congr {wβ wβ : ΞΉ β k} (hw : β i β s, wβ i = wβ i) {pβ pβ : ΞΉ β P}
(hp : β i β s, pβ i = pβ i) : s.affineCombination k pβ wβ = s.affineCombination k pβ wβ := by
simp_rw [affineCombination_apply, s.weightedVSubOfPoint_congr hw hp]
#align finset.affine_combination_congr Finset.affineCombination_congr
theorem affineCombination_eq_weightedVSubOfPoint_vadd_of_sum_eq_one (w : ΞΉ β k) (p : ΞΉ β P)
(h : β i β s, w i = 1) (b : P) :
s.affineCombination k p w = s.weightedVSubOfPoint p b w +α΅₯ b :=
s.weightedVSubOfPoint_vadd_eq_of_sum_eq_one w p h _ _
#align finset.affine_combination_eq_weighted_vsub_of_point_vadd_of_sum_eq_one Finset.affineCombination_eq_weightedVSubOfPoint_vadd_of_sum_eq_one
theorem weightedVSub_vadd_affineCombination (wβ wβ : ΞΉ β k) (p : ΞΉ β P) :
s.weightedVSub p wβ +α΅₯ s.affineCombination k p wβ = s.affineCombination k p (wβ + wβ) := by
rw [β vadd_eq_add, AffineMap.map_vadd, affineCombination_linear]
#align finset.weighted_vsub_vadd_affine_combination Finset.weightedVSub_vadd_affineCombination
theorem affineCombination_vsub (wβ wβ : ΞΉ β k) (p : ΞΉ β P) :
s.affineCombination k p wβ -α΅₯ s.affineCombination k p wβ = s.weightedVSub p (wβ - wβ) := by
rw [β AffineMap.linearMap_vsub, affineCombination_linear, vsub_eq_sub]
#align finset.affine_combination_vsub Finset.affineCombination_vsub
| Mathlib/LinearAlgebra/AffineSpace/Combination.lean | 431 | 444 | theorem attach_affineCombination_of_injective [DecidableEq P] (s : Finset P) (w : P β k) (f : s β P)
(hf : Function.Injective f) :
s.attach.affineCombination k f (w β f) = (image f univ).affineCombination k id w := by |
simp only [affineCombination, weightedVSubOfPoint_apply, id, vadd_right_cancel_iff,
Function.comp_apply, AffineMap.coe_mk]
let gβ : s β V := fun i => w (f i) β’ (f i -α΅₯ Classical.choice S.nonempty)
let gβ : P β V := fun i => w i β’ (i -α΅₯ Classical.choice S.nonempty)
change univ.sum gβ = (image f univ).sum gβ
have hgf : gβ = gβ β f := by
ext
simp
rw [hgf, sum_image]
Β· simp only [Function.comp_apply]
Β· exact fun _ _ _ _ hxy => hf hxy
|
import Mathlib.Analysis.BoxIntegral.Partition.Filter
import Mathlib.Analysis.BoxIntegral.Partition.Measure
import Mathlib.Topology.UniformSpace.Compact
import Mathlib.Init.Data.Bool.Lemmas
#align_import analysis.box_integral.basic from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open scoped Classical Topology NNReal Filter Uniformity BoxIntegral
open Set Finset Function Filter Metric BoxIntegral.IntegrationParams
noncomputable section
namespace BoxIntegral
universe u v w
variable {ΞΉ : Type u} {E : Type v} {F : Type w} [NormedAddCommGroup E] [NormedSpace β E]
[NormedAddCommGroup F] [NormedSpace β F] {I J : Box ΞΉ} {Ο : TaggedPrepartition I}
open TaggedPrepartition
local notation "ββΏ" => ΞΉ β β
def integralSum (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F) (Ο : TaggedPrepartition I) : F :=
β J β Ο.boxes, vol J (f (Ο.tag J))
#align box_integral.integral_sum BoxIntegral.integralSum
theorem integralSum_biUnionTagged (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F) (Ο : Prepartition I)
(Οi : β J, TaggedPrepartition J) :
integralSum f vol (Ο.biUnionTagged Οi) = β J β Ο.boxes, integralSum f vol (Οi J) := by
refine (Ο.sum_biUnion_boxes _ _).trans <| sum_congr rfl fun J hJ => sum_congr rfl fun J' hJ' => ?_
rw [Ο.tag_biUnionTagged hJ hJ']
#align box_integral.integral_sum_bUnion_tagged BoxIntegral.integralSum_biUnionTagged
theorem integralSum_biUnion_partition (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F)
(Ο : TaggedPrepartition I) (Οi : β J, Prepartition J) (hΟi : β J β Ο, (Οi J).IsPartition) :
integralSum f vol (Ο.biUnionPrepartition Οi) = integralSum f vol Ο := by
refine (Ο.sum_biUnion_boxes _ _).trans (sum_congr rfl fun J hJ => ?_)
calc
(β J' β (Οi J).boxes, vol J' (f (Ο.tag <| Ο.toPrepartition.biUnionIndex Οi J'))) =
β J' β (Οi J).boxes, vol J' (f (Ο.tag J)) :=
sum_congr rfl fun J' hJ' => by rw [Prepartition.biUnionIndex_of_mem _ hJ hJ']
_ = vol J (f (Ο.tag J)) :=
(vol.map β¨β¨fun g : E βL[β] F => g (f (Ο.tag J)), rflβ©, fun _ _ => rflβ©).sum_partition_boxes
le_top (hΟi J hJ)
#align box_integral.integral_sum_bUnion_partition BoxIntegral.integralSum_biUnion_partition
theorem integralSum_inf_partition (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F) (Ο : TaggedPrepartition I)
{Ο' : Prepartition I} (h : Ο'.IsPartition) :
integralSum f vol (Ο.infPrepartition Ο') = integralSum f vol Ο :=
integralSum_biUnion_partition f vol Ο _ fun _J hJ => h.restrict (Prepartition.le_of_mem _ hJ)
#align box_integral.integral_sum_inf_partition BoxIntegral.integralSum_inf_partition
theorem integralSum_fiberwise {Ξ±} (g : Box ΞΉ β Ξ±) (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F)
(Ο : TaggedPrepartition I) :
(β y β Ο.boxes.image g, integralSum f vol (Ο.filter (g Β· = y))) = integralSum f vol Ο :=
Ο.sum_fiberwise g fun J => vol J (f <| Ο.tag J)
#align box_integral.integral_sum_fiberwise BoxIntegral.integralSum_fiberwise
theorem integralSum_sub_partitions (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F)
{Οβ Οβ : TaggedPrepartition I} (hβ : Οβ.IsPartition) (hβ : Οβ.IsPartition) :
integralSum f vol Οβ - integralSum f vol Οβ =
β J β (Οβ.toPrepartition β Οβ.toPrepartition).boxes,
(vol J (f <| (Οβ.infPrepartition Οβ.toPrepartition).tag J) -
vol J (f <| (Οβ.infPrepartition Οβ.toPrepartition).tag J)) := by
rw [β integralSum_inf_partition f vol Οβ hβ, β integralSum_inf_partition f vol Οβ hβ,
integralSum, integralSum, Finset.sum_sub_distrib]
simp only [infPrepartition_toPrepartition, inf_comm]
#align box_integral.integral_sum_sub_partitions BoxIntegral.integralSum_sub_partitions
@[simp]
theorem integralSum_disjUnion (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F) {Οβ Οβ : TaggedPrepartition I}
(h : Disjoint Οβ.iUnion Οβ.iUnion) :
integralSum f vol (Οβ.disjUnion Οβ h) = integralSum f vol Οβ + integralSum f vol Οβ := by
refine (Prepartition.sum_disj_union_boxes h _).trans
(congr_argβ (Β· + Β·) (sum_congr rfl fun J hJ => ?_) (sum_congr rfl fun J hJ => ?_))
Β· rw [disjUnion_tag_of_mem_left _ hJ]
Β· rw [disjUnion_tag_of_mem_right _ hJ]
#align box_integral.integral_sum_disj_union BoxIntegral.integralSum_disjUnion
@[simp]
theorem integralSum_add (f g : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F) (Ο : TaggedPrepartition I) :
integralSum (f + g) vol Ο = integralSum f vol Ο + integralSum g vol Ο := by
simp only [integralSum, Pi.add_apply, (vol _).map_add, Finset.sum_add_distrib]
#align box_integral.integral_sum_add BoxIntegral.integralSum_add
@[simp]
theorem integralSum_neg (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F) (Ο : TaggedPrepartition I) :
integralSum (-f) vol Ο = -integralSum f vol Ο := by
simp only [integralSum, Pi.neg_apply, (vol _).map_neg, Finset.sum_neg_distrib]
#align box_integral.integral_sum_neg BoxIntegral.integralSum_neg
@[simp]
theorem integralSum_smul (c : β) (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F) (Ο : TaggedPrepartition I) :
integralSum (c β’ f) vol Ο = c β’ integralSum f vol Ο := by
simp only [integralSum, Finset.smul_sum, Pi.smul_apply, ContinuousLinearMap.map_smul]
#align box_integral.integral_sum_smul BoxIntegral.integralSum_smul
variable [Fintype ΞΉ]
def HasIntegral (I : Box ΞΉ) (l : IntegrationParams) (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F) (y : F) :
Prop :=
Tendsto (integralSum f vol) (l.toFilteriUnion I β€) (π y)
#align box_integral.has_integral BoxIntegral.HasIntegral
def Integrable (I : Box ΞΉ) (l : IntegrationParams) (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F) :=
β y, HasIntegral I l f vol y
#align box_integral.integrable BoxIntegral.Integrable
def integral (I : Box ΞΉ) (l : IntegrationParams) (f : ββΏ β E) (vol : ΞΉ βα΅α΅ E βL[β] F) :=
if h : Integrable I l f vol then h.choose else 0
#align box_integral.integral BoxIntegral.integral
-- Porting note: using the above notation ββΏ here causes the theorem below to be silently ignored
-- see https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Lean.204.20doesn't.20add.20lemma.20to.20the.20environment/near/363764522
-- and https://github.com/leanprover/lean4/issues/2257
variable {l : IntegrationParams} {f g : (ΞΉ β β) β E} {vol : ΞΉ βα΅α΅ E βL[β] F} {y y' : F}
theorem HasIntegral.tendsto (h : HasIntegral I l f vol y) :
Tendsto (integralSum f vol) (l.toFilteriUnion I β€) (π y) :=
h
#align box_integral.has_integral.tendsto BoxIntegral.HasIntegral.tendsto
theorem hasIntegral_iff : HasIntegral I l f vol y β
β Ξ΅ > (0 : β), β r : ββ₯0 β ββΏ β Ioi (0 : β), (β c, l.RCond (r c)) β§
β c Ο, l.MemBaseSet I c (r c) Ο β IsPartition Ο β dist (integralSum f vol Ο) y β€ Ξ΅ :=
((l.hasBasis_toFilteriUnion_top I).tendsto_iff nhds_basis_closedBall).trans <| by
simp [@forall_swap ββ₯0 (TaggedPrepartition I)]
#align box_integral.has_integral_iff BoxIntegral.hasIntegral_iff
theorem HasIntegral.of_mul (a : β)
(h : β Ξ΅ : β, 0 < Ξ΅ β β r : ββ₯0 β ββΏ β Ioi (0 : β), (β c, l.RCond (r c)) β§ β c Ο,
l.MemBaseSet I c (r c) Ο β IsPartition Ο β dist (integralSum f vol Ο) y β€ a * Ξ΅) :
HasIntegral I l f vol y := by
refine hasIntegral_iff.2 fun Ξ΅ hΞ΅ => ?_
rcases exists_pos_mul_lt hΞ΅ a with β¨Ξ΅', hΞ΅', haβ©
rcases h Ξ΅' hΞ΅' with β¨r, hr, Hβ©
exact β¨r, hr, fun c Ο hΟ hΟp => (H c Ο hΟ hΟp).trans ha.leβ©
#align box_integral.has_integral_of_mul BoxIntegral.HasIntegral.of_mul
theorem integrable_iff_cauchy [CompleteSpace F] :
Integrable I l f vol β Cauchy ((l.toFilteriUnion I β€).map (integralSum f vol)) :=
cauchy_map_iff_exists_tendsto.symm
#align box_integral.integrable_iff_cauchy BoxIntegral.integrable_iff_cauchy
theorem integrable_iff_cauchy_basis [CompleteSpace F] : Integrable I l f vol β
β Ξ΅ > (0 : β), β r : ββ₯0 β ββΏ β Ioi (0 : β), (β c, l.RCond (r c)) β§
β cβ cβ Οβ Οβ, l.MemBaseSet I cβ (r cβ) Οβ β Οβ.IsPartition β l.MemBaseSet I cβ (r cβ) Οβ β
Οβ.IsPartition β dist (integralSum f vol Οβ) (integralSum f vol Οβ) β€ Ξ΅ := by
rw [integrable_iff_cauchy, cauchy_map_iff',
(l.hasBasis_toFilteriUnion_top _).prod_self.tendsto_iff uniformity_basis_dist_le]
refine forallβ_congr fun Ξ΅ _ => exists_congr fun r => ?_
simp only [exists_prop, Prod.forall, Set.mem_iUnion, exists_imp, prod_mk_mem_set_prod_eq, and_imp,
mem_inter_iff, mem_setOf_eq]
exact
and_congr Iff.rfl
β¨fun H cβ cβ Οβ Οβ hβ hUβ hβ hUβ => H Οβ Οβ cβ hβ hUβ cβ hβ hUβ,
fun H Οβ Οβ cβ hβ hUβ cβ hβ hUβ => H cβ cβ Οβ Οβ hβ hUβ hβ hUββ©
#align box_integral.integrable_iff_cauchy_basis BoxIntegral.integrable_iff_cauchy_basis
theorem HasIntegral.mono {lβ lβ : IntegrationParams} (h : HasIntegral I lβ f vol y) (hl : lβ β€ lβ) :
HasIntegral I lβ f vol y :=
h.mono_left <| IntegrationParams.toFilteriUnion_mono _ hl _
#align box_integral.has_integral.mono BoxIntegral.HasIntegral.mono
protected theorem Integrable.hasIntegral (h : Integrable I l f vol) :
HasIntegral I l f vol (integral I l f vol) := by
rw [integral, dif_pos h]
exact Classical.choose_spec h
#align box_integral.integrable.has_integral BoxIntegral.Integrable.hasIntegral
theorem Integrable.mono {l'} (h : Integrable I l f vol) (hle : l' β€ l) : Integrable I l' f vol :=
β¨_, h.hasIntegral.mono hleβ©
#align box_integral.integrable.mono BoxIntegral.Integrable.mono
theorem HasIntegral.unique (h : HasIntegral I l f vol y) (h' : HasIntegral I l f vol y') : y = y' :=
tendsto_nhds_unique h h'
#align box_integral.has_integral.unique BoxIntegral.HasIntegral.unique
theorem HasIntegral.integrable (h : HasIntegral I l f vol y) : Integrable I l f vol :=
β¨_, hβ©
#align box_integral.has_integral.integrable BoxIntegral.HasIntegral.integrable
theorem HasIntegral.integral_eq (h : HasIntegral I l f vol y) : integral I l f vol = y :=
h.integrable.hasIntegral.unique h
#align box_integral.has_integral.integral_eq BoxIntegral.HasIntegral.integral_eq
nonrec theorem HasIntegral.add (h : HasIntegral I l f vol y) (h' : HasIntegral I l g vol y') :
HasIntegral I l (f + g) vol (y + y') := by
simpa only [HasIntegral, β integralSum_add] using h.add h'
#align box_integral.has_integral.add BoxIntegral.HasIntegral.add
theorem Integrable.add (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
Integrable I l (f + g) vol :=
(hf.hasIntegral.add hg.hasIntegral).integrable
#align box_integral.integrable.add BoxIntegral.Integrable.add
theorem integral_add (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
integral I l (f + g) vol = integral I l f vol + integral I l g vol :=
(hf.hasIntegral.add hg.hasIntegral).integral_eq
#align box_integral.integral_add BoxIntegral.integral_add
nonrec theorem HasIntegral.neg (hf : HasIntegral I l f vol y) : HasIntegral I l (-f) vol (-y) := by
simpa only [HasIntegral, β integralSum_neg] using hf.neg
#align box_integral.has_integral.neg BoxIntegral.HasIntegral.neg
theorem Integrable.neg (hf : Integrable I l f vol) : Integrable I l (-f) vol :=
hf.hasIntegral.neg.integrable
#align box_integral.integrable.neg BoxIntegral.Integrable.neg
theorem Integrable.of_neg (hf : Integrable I l (-f) vol) : Integrable I l f vol :=
neg_neg f βΈ hf.neg
#align box_integral.integrable.of_neg BoxIntegral.Integrable.of_neg
@[simp]
theorem integrable_neg : Integrable I l (-f) vol β Integrable I l f vol :=
β¨fun h => h.of_neg, fun h => h.negβ©
#align box_integral.integrable_neg BoxIntegral.integrable_neg
@[simp]
theorem integral_neg : integral I l (-f) vol = -integral I l f vol :=
if h : Integrable I l f vol then h.hasIntegral.neg.integral_eq
else by rw [integral, integral, dif_neg h, dif_neg (mt Integrable.of_neg h), neg_zero]
#align box_integral.integral_neg BoxIntegral.integral_neg
theorem HasIntegral.sub (h : HasIntegral I l f vol y) (h' : HasIntegral I l g vol y') :
HasIntegral I l (f - g) vol (y - y') := by simpa only [sub_eq_add_neg] using h.add h'.neg
#align box_integral.has_integral.sub BoxIntegral.HasIntegral.sub
theorem Integrable.sub (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
Integrable I l (f - g) vol :=
(hf.hasIntegral.sub hg.hasIntegral).integrable
#align box_integral.integrable.sub BoxIntegral.Integrable.sub
theorem integral_sub (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
integral I l (f - g) vol = integral I l f vol - integral I l g vol :=
(hf.hasIntegral.sub hg.hasIntegral).integral_eq
#align box_integral.integral_sub BoxIntegral.integral_sub
theorem hasIntegral_const (c : E) : HasIntegral I l (fun _ => c) vol (vol I c) :=
tendsto_const_nhds.congr' <| (l.eventually_isPartition I).mono fun _Ο hΟ => Eq.symm <|
(vol.map β¨β¨fun g : E βL[β] F β¦ g c, rflβ©, fun _ _ β¦ rflβ©).sum_partition_boxes le_top hΟ
#align box_integral.has_integral_const BoxIntegral.hasIntegral_const
@[simp]
theorem integral_const (c : E) : integral I l (fun _ => c) vol = vol I c :=
(hasIntegral_const c).integral_eq
#align box_integral.integral_const BoxIntegral.integral_const
theorem integrable_const (c : E) : Integrable I l (fun _ => c) vol :=
β¨_, hasIntegral_const cβ©
#align box_integral.integrable_const BoxIntegral.integrable_const
theorem hasIntegral_zero : HasIntegral I l (fun _ => (0 : E)) vol 0 := by
simpa only [β (vol I).map_zero] using hasIntegral_const (0 : E)
#align box_integral.has_integral_zero BoxIntegral.hasIntegral_zero
theorem integrable_zero : Integrable I l (fun _ => (0 : E)) vol :=
β¨0, hasIntegral_zeroβ©
#align box_integral.integrable_zero BoxIntegral.integrable_zero
theorem integral_zero : integral I l (fun _ => (0 : E)) vol = 0 :=
hasIntegral_zero.integral_eq
#align box_integral.integral_zero BoxIntegral.integral_zero
theorem HasIntegral.sum {Ξ± : Type*} {s : Finset Ξ±} {f : Ξ± β ββΏ β E} {g : Ξ± β F}
(h : β i β s, HasIntegral I l (f i) vol (g i)) :
HasIntegral I l (fun x => β i β s, f i x) vol (β i β s, g i) := by
induction' s using Finset.induction_on with a s ha ihs; Β· simp [hasIntegral_zero]
simp only [Finset.sum_insert ha]; rw [Finset.forall_mem_insert] at h
exact h.1.add (ihs h.2)
#align box_integral.has_integral_sum BoxIntegral.HasIntegral.sum
theorem HasIntegral.smul (hf : HasIntegral I l f vol y) (c : β) :
HasIntegral I l (c β’ f) vol (c β’ y) := by
simpa only [HasIntegral, β integralSum_smul] using
(tendsto_const_nhds : Tendsto _ _ (π c)).smul hf
#align box_integral.has_integral.smul BoxIntegral.HasIntegral.smul
theorem Integrable.smul (hf : Integrable I l f vol) (c : β) : Integrable I l (c β’ f) vol :=
(hf.hasIntegral.smul c).integrable
#align box_integral.integrable.smul BoxIntegral.Integrable.smul
theorem Integrable.of_smul {c : β} (hf : Integrable I l (c β’ f) vol) (hc : c β 0) :
Integrable I l f vol := by
simpa [inv_smul_smulβ hc] using hf.smul cβ»ΒΉ
#align box_integral.integrable.of_smul BoxIntegral.Integrable.of_smul
@[simp]
| Mathlib/Analysis/BoxIntegral/Basic.lean | 364 | 369 | theorem integral_smul (c : β) : integral I l (fun x => c β’ f x) vol = c β’ integral I l f vol := by |
rcases eq_or_ne c 0 with (rfl | hc); Β· simp only [zero_smul, integral_zero]
by_cases hf : Integrable I l f vol
Β· exact (hf.hasIntegral.smul c).integral_eq
Β· have : Β¬Integrable I l (fun x => c β’ f x) vol := mt (fun h => h.of_smul hc) hf
rw [integral, integral, dif_neg hf, dif_neg this, smul_zero]
|
import Mathlib.SetTheory.Ordinal.Arithmetic
#align_import set_theory.ordinal.exponential from "leanprover-community/mathlib"@"b67044ba53af18680e1dd246861d9584e968495d"
noncomputable section
open Function Cardinal Set Equiv Order
open scoped Classical
open Cardinal Ordinal
universe u v w
namespace Ordinal
instance pow : Pow Ordinal Ordinal :=
β¨fun a b => if a = 0 then 1 - b else limitRecOn b 1 (fun _ IH => IH * a) fun b _ => bsup.{u, u} bβ©
-- Porting note: Ambiguous notations.
-- local infixr:0 "^" => @Pow.pow Ordinal Ordinal Ordinal.instPowOrdinalOrdinal
theorem opow_def (a b : Ordinal) :
a ^ b = if a = 0 then 1 - b else limitRecOn b 1 (fun _ IH => IH * a) fun b _ => bsup.{u, u} b :=
rfl
#align ordinal.opow_def Ordinal.opow_def
-- Porting note: `if_pos rfl` β `if_true`
theorem zero_opow' (a : Ordinal) : 0 ^ a = 1 - a := by simp only [opow_def, if_true]
#align ordinal.zero_opow' Ordinal.zero_opow'
@[simp]
theorem zero_opow {a : Ordinal} (a0 : a β 0) : (0 : Ordinal) ^ a = 0 := by
rwa [zero_opow', Ordinal.sub_eq_zero_iff_le, one_le_iff_ne_zero]
#align ordinal.zero_opow Ordinal.zero_opow
@[simp]
theorem opow_zero (a : Ordinal) : a ^ (0 : Ordinal) = 1 := by
by_cases h : a = 0
Β· simp only [opow_def, if_pos h, sub_zero]
Β· simp only [opow_def, if_neg h, limitRecOn_zero]
#align ordinal.opow_zero Ordinal.opow_zero
@[simp]
theorem opow_succ (a b : Ordinal) : a ^ succ b = a ^ b * a :=
if h : a = 0 then by subst a; simp only [zero_opow (succ_ne_zero _), mul_zero]
else by simp only [opow_def, limitRecOn_succ, if_neg h]
#align ordinal.opow_succ Ordinal.opow_succ
theorem opow_limit {a b : Ordinal} (a0 : a β 0) (h : IsLimit b) :
a ^ b = bsup.{u, u} b fun c _ => a ^ c := by
simp only [opow_def, if_neg a0]; rw [limitRecOn_limit _ _ _ _ h]
#align ordinal.opow_limit Ordinal.opow_limit
theorem opow_le_of_limit {a b c : Ordinal} (a0 : a β 0) (h : IsLimit b) :
a ^ b β€ c β β b' < b, a ^ b' β€ c := by rw [opow_limit a0 h, bsup_le_iff]
#align ordinal.opow_le_of_limit Ordinal.opow_le_of_limit
theorem lt_opow_of_limit {a b c : Ordinal} (b0 : b β 0) (h : IsLimit c) :
a < b ^ c β β c' < c, a < b ^ c' := by
rw [β not_iff_not, not_exists]; simp only [not_lt, opow_le_of_limit b0 h, exists_prop, not_and]
#align ordinal.lt_opow_of_limit Ordinal.lt_opow_of_limit
@[simp]
theorem opow_one (a : Ordinal) : a ^ (1 : Ordinal) = a := by
rw [β succ_zero, opow_succ]; simp only [opow_zero, one_mul]
#align ordinal.opow_one Ordinal.opow_one
@[simp]
theorem one_opow (a : Ordinal) : (1 : Ordinal) ^ a = 1 := by
induction a using limitRecOn with
| Hβ => simp only [opow_zero]
| Hβ _ ih =>
simp only [opow_succ, ih, mul_one]
| Hβ b l IH =>
refine eq_of_forall_ge_iff fun c => ?_
rw [opow_le_of_limit Ordinal.one_ne_zero l]
exact β¨fun H => by simpa only [opow_zero] using H 0 l.pos, fun H b' h => by rwa [IH _ h]β©
#align ordinal.one_opow Ordinal.one_opow
theorem opow_pos {a : Ordinal} (b : Ordinal) (a0 : 0 < a) : 0 < a ^ b := by
have h0 : 0 < a ^ (0 : Ordinal) := by simp only [opow_zero, zero_lt_one]
induction b using limitRecOn with
| Hβ => exact h0
| Hβ b IH =>
rw [opow_succ]
exact mul_pos IH a0
| Hβ b l _ =>
exact (lt_opow_of_limit (Ordinal.pos_iff_ne_zero.1 a0) l).2 β¨0, l.pos, h0β©
#align ordinal.opow_pos Ordinal.opow_pos
theorem opow_ne_zero {a : Ordinal} (b : Ordinal) (a0 : a β 0) : a ^ b β 0 :=
Ordinal.pos_iff_ne_zero.1 <| opow_pos b <| Ordinal.pos_iff_ne_zero.2 a0
#align ordinal.opow_ne_zero Ordinal.opow_ne_zero
theorem opow_isNormal {a : Ordinal} (h : 1 < a) : IsNormal (a ^ Β·) :=
have a0 : 0 < a := zero_lt_one.trans h
β¨fun b => by simpa only [mul_one, opow_succ] using (mul_lt_mul_iff_left (opow_pos b a0)).2 h,
fun b l c => opow_le_of_limit (ne_of_gt a0) lβ©
#align ordinal.opow_is_normal Ordinal.opow_isNormal
theorem opow_lt_opow_iff_right {a b c : Ordinal} (a1 : 1 < a) : a ^ b < a ^ c β b < c :=
(opow_isNormal a1).lt_iff
#align ordinal.opow_lt_opow_iff_right Ordinal.opow_lt_opow_iff_right
theorem opow_le_opow_iff_right {a b c : Ordinal} (a1 : 1 < a) : a ^ b β€ a ^ c β b β€ c :=
(opow_isNormal a1).le_iff
#align ordinal.opow_le_opow_iff_right Ordinal.opow_le_opow_iff_right
theorem opow_right_inj {a b c : Ordinal} (a1 : 1 < a) : a ^ b = a ^ c β b = c :=
(opow_isNormal a1).inj
#align ordinal.opow_right_inj Ordinal.opow_right_inj
theorem opow_isLimit {a b : Ordinal} (a1 : 1 < a) : IsLimit b β IsLimit (a ^ b) :=
(opow_isNormal a1).isLimit
#align ordinal.opow_is_limit Ordinal.opow_isLimit
theorem opow_isLimit_left {a b : Ordinal} (l : IsLimit a) (hb : b β 0) : IsLimit (a ^ b) := by
rcases zero_or_succ_or_limit b with (e | β¨b, rflβ© | l')
Β· exact absurd e hb
Β· rw [opow_succ]
exact mul_isLimit (opow_pos _ l.pos) l
Β· exact opow_isLimit l.one_lt l'
#align ordinal.opow_is_limit_left Ordinal.opow_isLimit_left
theorem opow_le_opow_right {a b c : Ordinal} (hβ : 0 < a) (hβ : b β€ c) : a ^ b β€ a ^ c := by
rcases lt_or_eq_of_le (one_le_iff_pos.2 hβ) with hβ | hβ
Β· exact (opow_le_opow_iff_right hβ).2 hβ
Β· subst a
-- Porting note: `le_refl` is required.
simp only [one_opow, le_refl]
#align ordinal.opow_le_opow_right Ordinal.opow_le_opow_right
theorem opow_le_opow_left {a b : Ordinal} (c : Ordinal) (ab : a β€ b) : a ^ c β€ b ^ c := by
by_cases a0 : a = 0
-- Porting note: `le_refl` is required.
Β· subst a
by_cases c0 : c = 0
Β· subst c
simp only [opow_zero, le_refl]
Β· simp only [zero_opow c0, Ordinal.zero_le]
Β· induction c using limitRecOn with
| Hβ => simp only [opow_zero, le_refl]
| Hβ c IH =>
simpa only [opow_succ] using mul_le_mul' IH ab
| Hβ c l IH =>
exact
(opow_le_of_limit a0 l).2 fun b' h =>
(IH _ h).trans (opow_le_opow_right ((Ordinal.pos_iff_ne_zero.2 a0).trans_le ab) h.le)
#align ordinal.opow_le_opow_left Ordinal.opow_le_opow_left
theorem left_le_opow (a : Ordinal) {b : Ordinal} (b1 : 0 < b) : a β€ a ^ b := by
nth_rw 1 [β opow_one a]
cases' le_or_gt a 1 with a1 a1
Β· rcases lt_or_eq_of_le a1 with a0 | a1
Β· rw [lt_one_iff_zero] at a0
rw [a0, zero_opow Ordinal.one_ne_zero]
exact Ordinal.zero_le _
rw [a1, one_opow, one_opow]
rwa [opow_le_opow_iff_right a1, one_le_iff_pos]
#align ordinal.left_le_opow Ordinal.left_le_opow
theorem right_le_opow {a : Ordinal} (b : Ordinal) (a1 : 1 < a) : b β€ a ^ b :=
(opow_isNormal a1).self_le _
#align ordinal.right_le_opow Ordinal.right_le_opow
theorem opow_lt_opow_left_of_succ {a b c : Ordinal} (ab : a < b) : a ^ succ c < b ^ succ c := by
rw [opow_succ, opow_succ]
exact
(mul_le_mul_right' (opow_le_opow_left c ab.le) a).trans_lt
(mul_lt_mul_of_pos_left ab (opow_pos c ((Ordinal.zero_le a).trans_lt ab)))
#align ordinal.opow_lt_opow_left_of_succ Ordinal.opow_lt_opow_left_of_succ
| Mathlib/SetTheory/Ordinal/Exponential.lean | 187 | 208 | theorem opow_add (a b c : Ordinal) : a ^ (b + c) = a ^ b * a ^ c := by |
rcases eq_or_ne a 0 with (rfl | a0)
Β· rcases eq_or_ne c 0 with (rfl | c0)
Β· simp
have : b + c β 0 := ((Ordinal.pos_iff_ne_zero.2 c0).trans_le (le_add_left _ _)).ne'
simp only [zero_opow c0, zero_opow this, mul_zero]
rcases eq_or_lt_of_le (one_le_iff_ne_zero.2 a0) with (rfl | a1)
Β· simp only [one_opow, mul_one]
induction c using limitRecOn with
| Hβ => simp
| Hβ c IH =>
rw [add_succ, opow_succ, IH, opow_succ, mul_assoc]
| Hβ c l IH =>
refine
eq_of_forall_ge_iff fun d =>
(((opow_isNormal a1).trans (add_isNormal b)).limit_le l).trans ?_
dsimp only [Function.comp_def]
simp (config := { contextual := true }) only [IH]
exact
(((mul_isNormal <| opow_pos b (Ordinal.pos_iff_ne_zero.2 a0)).trans
(opow_isNormal a1)).limit_le
l).symm
|
import Mathlib.Algebra.BigOperators.Ring
import Mathlib.Combinatorics.SimpleGraph.Density
import Mathlib.Data.Nat.Cast.Field
import Mathlib.Order.Partition.Equipartition
import Mathlib.SetTheory.Ordinal.Basic
#align_import combinatorics.simple_graph.regularity.uniform from "leanprover-community/mathlib"@"bf7ef0e83e5b7e6c1169e97f055e58a2e4e9d52d"
open Finset
variable {Ξ± π : Type*} [LinearOrderedField π]
namespace SimpleGraph
variable (G : SimpleGraph Ξ±) [DecidableRel G.Adj] (Ξ΅ : π) {s t : Finset Ξ±} {a b : Ξ±}
def IsUniform (s t : Finset Ξ±) : Prop :=
β β¦s'β¦, s' β s β β β¦t'β¦, t' β t β (s.card : π) * Ξ΅ β€ s'.card β
(t.card : π) * Ξ΅ β€ t'.card β |(G.edgeDensity s' t' : π) - (G.edgeDensity s t : π)| < Ξ΅
#align simple_graph.is_uniform SimpleGraph.IsUniform
variable {G Ξ΅}
instance IsUniform.instDecidableRel : DecidableRel (G.IsUniform Ξ΅) := by
unfold IsUniform; infer_instance
theorem IsUniform.mono {Ξ΅' : π} (h : Ξ΅ β€ Ξ΅') (hΞ΅ : IsUniform G Ξ΅ s t) : IsUniform G Ξ΅' s t :=
fun s' hs' t' ht' hs ht => by
refine (hΞ΅ hs' ht' (le_trans ?_ hs) (le_trans ?_ ht)).trans_le h <;> gcongr
#align simple_graph.is_uniform.mono SimpleGraph.IsUniform.mono
theorem IsUniform.symm : Symmetric (IsUniform G Ξ΅) := fun s t h t' ht' s' hs' ht hs => by
rw [edgeDensity_comm _ t', edgeDensity_comm _ t]
exact h hs' ht' hs ht
#align simple_graph.is_uniform.symm SimpleGraph.IsUniform.symm
variable (G)
theorem isUniform_comm : IsUniform G Ξ΅ s t β IsUniform G Ξ΅ t s :=
β¨fun h => h.symm, fun h => h.symmβ©
#align simple_graph.is_uniform_comm SimpleGraph.isUniform_comm
lemma isUniform_one : G.IsUniform (1 : π) s t := by
intro s' hs' t' ht' hs ht
rw [mul_one] at hs ht
rw [eq_of_subset_of_card_le hs' (Nat.cast_le.1 hs),
eq_of_subset_of_card_le ht' (Nat.cast_le.1 ht), sub_self, abs_zero]
exact zero_lt_one
#align simple_graph.is_uniform_one SimpleGraph.isUniform_one
variable {G}
lemma IsUniform.pos (hG : G.IsUniform Ξ΅ s t) : 0 < Ξ΅ :=
not_le.1 fun hΞ΅ β¦ (hΞ΅.trans $ abs_nonneg _).not_lt $ hG (empty_subset _) (empty_subset _)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
@[simp] lemma isUniform_singleton : G.IsUniform Ξ΅ {a} {b} β 0 < Ξ΅ := by
refine β¨IsUniform.pos, fun hΞ΅ s' hs' t' ht' hs ht β¦ ?_β©
rw [card_singleton, Nat.cast_one, one_mul] at hs ht
obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
Β· replace hs : Ξ΅ β€ 0 := by simpa using hs
exact (hΞ΅.not_le hs).elim
obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
Β· replace ht : Ξ΅ β€ 0 := by simpa using ht
exact (hΞ΅.not_le ht).elim
Β· rwa [sub_self, abs_zero]
#align simple_graph.is_uniform_singleton SimpleGraph.isUniform_singleton
theorem not_isUniform_zero : Β¬G.IsUniform (0 : π) s t := fun h =>
(abs_nonneg _).not_lt <| h (empty_subset _) (empty_subset _) (by simp) (by simp)
#align simple_graph.not_is_uniform_zero SimpleGraph.not_isUniform_zero
theorem not_isUniform_iff :
Β¬G.IsUniform Ξ΅ s t β β s', s' β s β§ β t', t' β t β§ βs.card * Ξ΅ β€ s'.card β§
βt.card * Ξ΅ β€ t'.card β§ Ξ΅ β€ |G.edgeDensity s' t' - G.edgeDensity s t| := by
unfold IsUniform
simp only [not_forall, not_lt, exists_prop, exists_and_left, Rat.cast_abs, Rat.cast_sub]
#align simple_graph.not_is_uniform_iff SimpleGraph.not_isUniform_iff
open scoped Classical
variable (G)
noncomputable def nonuniformWitnesses (Ξ΅ : π) (s t : Finset Ξ±) : Finset Ξ± Γ Finset Ξ± :=
if h : Β¬G.IsUniform Ξ΅ s t then
((not_isUniform_iff.1 h).choose, (not_isUniform_iff.1 h).choose_spec.2.choose)
else (s, t)
#align simple_graph.nonuniform_witnesses SimpleGraph.nonuniformWitnesses
theorem left_nonuniformWitnesses_subset (h : Β¬G.IsUniform Ξ΅ s t) :
(G.nonuniformWitnesses Ξ΅ s t).1 β s := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.1
#align simple_graph.left_nonuniform_witnesses_subset SimpleGraph.left_nonuniformWitnesses_subset
theorem left_nonuniformWitnesses_card (h : Β¬G.IsUniform Ξ΅ s t) :
(s.card : π) * Ξ΅ β€ (G.nonuniformWitnesses Ξ΅ s t).1.card := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.2.1
#align simple_graph.left_nonuniform_witnesses_card SimpleGraph.left_nonuniformWitnesses_card
theorem right_nonuniformWitnesses_subset (h : Β¬G.IsUniform Ξ΅ s t) :
(G.nonuniformWitnesses Ξ΅ s t).2 β t := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.1
#align simple_graph.right_nonuniform_witnesses_subset SimpleGraph.right_nonuniformWitnesses_subset
theorem right_nonuniformWitnesses_card (h : Β¬G.IsUniform Ξ΅ s t) :
(t.card : π) * Ξ΅ β€ (G.nonuniformWitnesses Ξ΅ s t).2.card := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.2.2.1
#align simple_graph.right_nonuniform_witnesses_card SimpleGraph.right_nonuniformWitnesses_card
theorem nonuniformWitnesses_spec (h : Β¬G.IsUniform Ξ΅ s t) :
Ξ΅ β€
|G.edgeDensity (G.nonuniformWitnesses Ξ΅ s t).1 (G.nonuniformWitnesses Ξ΅ s t).2 -
G.edgeDensity s t| := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.2.2.2
#align simple_graph.nonuniform_witnesses_spec SimpleGraph.nonuniformWitnesses_spec
noncomputable def nonuniformWitness (Ξ΅ : π) (s t : Finset Ξ±) : Finset Ξ± :=
if WellOrderingRel s t then (G.nonuniformWitnesses Ξ΅ s t).1 else (G.nonuniformWitnesses Ξ΅ t s).2
#align simple_graph.nonuniform_witness SimpleGraph.nonuniformWitness
| Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean | 175 | 179 | theorem nonuniformWitness_subset (h : Β¬G.IsUniform Ξ΅ s t) : G.nonuniformWitness Ξ΅ s t β s := by |
unfold nonuniformWitness
split_ifs
Β· exact G.left_nonuniformWitnesses_subset h
Β· exact G.right_nonuniformWitnesses_subset fun i => h i.symm
|
import Mathlib.Analysis.NormedSpace.Multilinear.Basic
#align_import analysis.normed_space.multilinear from "leanprover-community/mathlib"@"f40476639bac089693a489c9e354ebd75dc0f886"
suppress_compilation
noncomputable section
open NNReal Finset Metric ContinuousMultilinearMap Fin Function
universe u v v' wE wEβ wE' wEi wG wG'
variable {π : Type u} {ΞΉ : Type v} {ΞΉ' : Type v'} {n : β} {E : ΞΉ β Type wE} {Eβ : ΞΉ β Type wEβ}
{E' : ΞΉ' β Type wE'} {Ei : Fin n.succ β Type wEi} {G : Type wG} {G' : Type wG'} [Fintype ΞΉ]
[Fintype ΞΉ'] [NontriviallyNormedField π] [β i, NormedAddCommGroup (E i)]
[β i, NormedSpace π (E i)] [β i, NormedAddCommGroup (Eβ i)] [β i, NormedSpace π (Eβ i)]
[β i, NormedAddCommGroup (E' i)] [β i, NormedSpace π (E' i)] [β i, NormedAddCommGroup (Ei i)]
[β i, NormedSpace π (Ei i)] [NormedAddCommGroup G] [NormedSpace π G] [NormedAddCommGroup G']
[NormedSpace π G']
theorem ContinuousLinearMap.norm_map_tail_le
(f : Ei 0 βL[π] ContinuousMultilinearMap π (fun i : Fin n => Ei i.succ) G) (m : β i, Ei i) :
βf (m 0) (tail m)β β€ βfβ * β i, βm iβ :=
calc
βf (m 0) (tail m)β β€ βf (m 0)β * β i, β(tail m) iβ := (f (m 0)).le_opNorm _
_ β€ βfβ * βm 0β * β i, βtail m iβ := mul_le_mul_of_nonneg_right (f.le_opNorm _) <| by positivity
_ = βfβ * (βm 0β * β i, β(tail m) iβ) := by ring
_ = βfβ * β i, βm iβ := by
rw [prod_univ_succ]
rfl
#align continuous_linear_map.norm_map_tail_le ContinuousLinearMap.norm_map_tail_le
theorem ContinuousMultilinearMap.norm_map_init_le
(f : ContinuousMultilinearMap π (fun i : Fin n => Ei <| castSucc i) (Ei (last n) βL[π] G))
(m : β i, Ei i) : βf (init m) (m (last n))β β€ βfβ * β i, βm iβ :=
calc
βf (init m) (m (last n))β β€ βf (init m)β * βm (last n)β := (f (init m)).le_opNorm _
_ β€ (βfβ * β i, β(init m) iβ) * βm (last n)β :=
(mul_le_mul_of_nonneg_right (f.le_opNorm _) (norm_nonneg _))
_ = βfβ * ((β i, β(init m) iβ) * βm (last n)β) := mul_assoc _ _ _
_ = βfβ * β i, βm iβ := by
rw [prod_univ_castSucc]
rfl
#align continuous_multilinear_map.norm_map_init_le ContinuousMultilinearMap.norm_map_init_le
theorem ContinuousMultilinearMap.norm_map_cons_le (f : ContinuousMultilinearMap π Ei G) (x : Ei 0)
(m : β i : Fin n, Ei i.succ) : βf (cons x m)β β€ βfβ * βxβ * β i, βm iβ :=
calc
βf (cons x m)β β€ βfβ * β i, βcons x m iβ := f.le_opNorm _
_ = βfβ * βxβ * β i, βm iβ := by
rw [prod_univ_succ]
simp [mul_assoc]
#align continuous_multilinear_map.norm_map_cons_le ContinuousMultilinearMap.norm_map_cons_le
theorem ContinuousMultilinearMap.norm_map_snoc_le (f : ContinuousMultilinearMap π Ei G)
(m : β i : Fin n, Ei <| castSucc i) (x : Ei (last n)) :
βf (snoc m x)β β€ (βfβ * β i, βm iβ) * βxβ :=
calc
βf (snoc m x)β β€ βfβ * β i, βsnoc m x iβ := f.le_opNorm _
_ = (βfβ * β i, βm iβ) * βxβ := by
rw [prod_univ_castSucc]
simp [mul_assoc]
#align continuous_multilinear_map.norm_map_snoc_le ContinuousMultilinearMap.norm_map_snoc_le
def ContinuousLinearMap.uncurryLeft
(f : Ei 0 βL[π] ContinuousMultilinearMap π (fun i : Fin n => Ei i.succ) G) :
ContinuousMultilinearMap π Ei G :=
(@LinearMap.uncurryLeft π n Ei G _ _ _ _ _
(ContinuousMultilinearMap.toMultilinearMapLinear.comp f.toLinearMap)).mkContinuous
βfβ fun m => by exact ContinuousLinearMap.norm_map_tail_le f m
#align continuous_linear_map.uncurry_left ContinuousLinearMap.uncurryLeft
@[simp]
theorem ContinuousLinearMap.uncurryLeft_apply
(f : Ei 0 βL[π] ContinuousMultilinearMap π (fun i : Fin n => Ei i.succ) G) (m : β i, Ei i) :
f.uncurryLeft m = f (m 0) (tail m) :=
rfl
#align continuous_linear_map.uncurry_left_apply ContinuousLinearMap.uncurryLeft_apply
def ContinuousMultilinearMap.curryLeft (f : ContinuousMultilinearMap π Ei G) :
Ei 0 βL[π] ContinuousMultilinearMap π (fun i : Fin n => Ei i.succ) G :=
LinearMap.mkContinuous
{ -- define a linear map into `n` continuous multilinear maps
-- from an `n+1` continuous multilinear map
toFun := fun x =>
(f.toMultilinearMap.curryLeft x).mkContinuous (βfβ * βxβ) (f.norm_map_cons_le x)
map_add' := fun x y => by
ext m
exact f.cons_add m x y
map_smul' := fun c x => by
ext m
exact
f.cons_smul m c x }-- then register its continuity thanks to its boundedness properties.
βfβ fun x => by
rw [LinearMap.coe_mk, AddHom.coe_mk]
exact MultilinearMap.mkContinuous_norm_le _ (mul_nonneg (norm_nonneg _) (norm_nonneg _)) _
#align continuous_multilinear_map.curry_left ContinuousMultilinearMap.curryLeft
@[simp]
theorem ContinuousMultilinearMap.curryLeft_apply (f : ContinuousMultilinearMap π Ei G) (x : Ei 0)
(m : β i : Fin n, Ei i.succ) : f.curryLeft x m = f (cons x m) :=
rfl
#align continuous_multilinear_map.curry_left_apply ContinuousMultilinearMap.curryLeft_apply
@[simp]
theorem ContinuousLinearMap.curry_uncurryLeft
(f : Ei 0 βL[π] ContinuousMultilinearMap π (fun i : Fin n => Ei i.succ) G) :
f.uncurryLeft.curryLeft = f := by
ext m x
rw [ContinuousMultilinearMap.curryLeft_apply, ContinuousLinearMap.uncurryLeft_apply, tail_cons,
cons_zero]
#align continuous_linear_map.curry_uncurry_left ContinuousLinearMap.curry_uncurryLeft
@[simp]
theorem ContinuousMultilinearMap.uncurry_curryLeft (f : ContinuousMultilinearMap π Ei G) :
f.curryLeft.uncurryLeft = f :=
ContinuousMultilinearMap.toMultilinearMap_injective <| f.toMultilinearMap.uncurry_curryLeft
#align continuous_multilinear_map.uncurry_curry_left ContinuousMultilinearMap.uncurry_curryLeft
variable (π Ei G)
def continuousMultilinearCurryLeftEquiv :
(Ei 0 βL[π] ContinuousMultilinearMap π (fun i : Fin n => Ei i.succ) G) ββα΅’[π]
ContinuousMultilinearMap π Ei G :=
LinearIsometryEquiv.ofBounds
{ toFun := ContinuousLinearMap.uncurryLeft
map_add' := fun fβ fβ => by
ext m
rfl
map_smul' := fun c f => by
ext m
rfl
invFun := ContinuousMultilinearMap.curryLeft
left_inv := ContinuousLinearMap.curry_uncurryLeft
right_inv := ContinuousMultilinearMap.uncurry_curryLeft }
(fun f => by
simp only [LinearEquiv.coe_mk]
exact MultilinearMap.mkContinuous_norm_le _ (norm_nonneg f) _)
(fun f => by
simp only [LinearEquiv.coe_symm_mk]
exact LinearMap.mkContinuous_norm_le _ (norm_nonneg f) _)
#align continuous_multilinear_curry_left_equiv continuousMultilinearCurryLeftEquiv
variable {π Ei G}
@[simp]
theorem continuousMultilinearCurryLeftEquiv_apply
(f : Ei 0 βL[π] ContinuousMultilinearMap π (fun i : Fin n => Ei i.succ) G) (v : β i, Ei i) :
continuousMultilinearCurryLeftEquiv π Ei G f v = f (v 0) (tail v) :=
rfl
#align continuous_multilinear_curry_left_equiv_apply continuousMultilinearCurryLeftEquiv_apply
@[simp]
theorem continuousMultilinearCurryLeftEquiv_symm_apply (f : ContinuousMultilinearMap π Ei G)
(x : Ei 0) (v : β i : Fin n, Ei i.succ) :
(continuousMultilinearCurryLeftEquiv π Ei G).symm f x v = f (cons x v) :=
rfl
#align continuous_multilinear_curry_left_equiv_symm_apply continuousMultilinearCurryLeftEquiv_symm_apply
@[simp]
theorem ContinuousMultilinearMap.curryLeft_norm (f : ContinuousMultilinearMap π Ei G) :
βf.curryLeftβ = βfβ :=
(continuousMultilinearCurryLeftEquiv π Ei G).symm.norm_map f
#align continuous_multilinear_map.curry_left_norm ContinuousMultilinearMap.curryLeft_norm
@[simp]
theorem ContinuousLinearMap.uncurryLeft_norm
(f : Ei 0 βL[π] ContinuousMultilinearMap π (fun i : Fin n => Ei i.succ) G) :
βf.uncurryLeftβ = βfβ :=
(continuousMultilinearCurryLeftEquiv π Ei G).norm_map f
#align continuous_linear_map.uncurry_left_norm ContinuousLinearMap.uncurryLeft_norm
def ContinuousMultilinearMap.uncurryRight
(f : ContinuousMultilinearMap π (fun i : Fin n => Ei <| castSucc i) (Ei (last n) βL[π] G)) :
ContinuousMultilinearMap π Ei G :=
let f' : MultilinearMap π (fun i : Fin n => Ei <| castSucc i) (Ei (last n) ββ[π] G) :=
{ toFun := fun m => (f m).toLinearMap
map_add' := fun m i x y => by simp
map_smul' := fun m i c x => by simp }
(@MultilinearMap.uncurryRight π n Ei G _ _ _ _ _ f').mkContinuous βfβ fun m =>
f.norm_map_init_le m
#align continuous_multilinear_map.uncurry_right ContinuousMultilinearMap.uncurryRight
@[simp]
theorem ContinuousMultilinearMap.uncurryRight_apply
(f : ContinuousMultilinearMap π (fun i : Fin n => Ei <| castSucc i) (Ei (last n) βL[π] G))
(m : β i, Ei i) : f.uncurryRight m = f (init m) (m (last n)) :=
rfl
#align continuous_multilinear_map.uncurry_right_apply ContinuousMultilinearMap.uncurryRight_apply
def ContinuousMultilinearMap.curryRight (f : ContinuousMultilinearMap π Ei G) :
ContinuousMultilinearMap π (fun i : Fin n => Ei <| castSucc i) (Ei (last n) βL[π] G) :=
let f' : MultilinearMap π (fun i : Fin n => Ei <| castSucc i) (Ei (last n) βL[π] G) :=
{ toFun := fun m =>
(f.toMultilinearMap.curryRight m).mkContinuous (βfβ * β i, βm iβ) fun x =>
f.norm_map_snoc_le m x
map_add' := fun m i x y => by
ext
simp
map_smul' := fun m i c x => by
ext
simp }
f'.mkContinuous βfβ fun m => by
simp only [f', MultilinearMap.coe_mk]
exact LinearMap.mkContinuous_norm_le _ (by positivity) _
#align continuous_multilinear_map.curry_right ContinuousMultilinearMap.curryRight
@[simp]
theorem ContinuousMultilinearMap.curryRight_apply (f : ContinuousMultilinearMap π Ei G)
(m : β i : Fin n, Ei <| castSucc i) (x : Ei (last n)) : f.curryRight m x = f (snoc m x) :=
rfl
#align continuous_multilinear_map.curry_right_apply ContinuousMultilinearMap.curryRight_apply
@[simp]
theorem ContinuousMultilinearMap.curry_uncurryRight
(f : ContinuousMultilinearMap π (fun i : Fin n => Ei <| castSucc i) (Ei (last n) βL[π] G)) :
f.uncurryRight.curryRight = f := by
ext m x
rw [ContinuousMultilinearMap.curryRight_apply, ContinuousMultilinearMap.uncurryRight_apply,
snoc_last, init_snoc]
#align continuous_multilinear_map.curry_uncurry_right ContinuousMultilinearMap.curry_uncurryRight
@[simp]
theorem ContinuousMultilinearMap.uncurry_curryRight (f : ContinuousMultilinearMap π Ei G) :
f.curryRight.uncurryRight = f := by
ext m
rw [uncurryRight_apply, curryRight_apply, snoc_init_self]
#align continuous_multilinear_map.uncurry_curry_right ContinuousMultilinearMap.uncurry_curryRight
variable (π Ei G)
def continuousMultilinearCurryRightEquiv :
ContinuousMultilinearMap π (fun i : Fin n => Ei <| castSucc i) (Ei (last n) βL[π] G) ββα΅’[π]
ContinuousMultilinearMap π Ei G :=
LinearIsometryEquiv.ofBounds
{ toFun := ContinuousMultilinearMap.uncurryRight
map_add' := fun fβ fβ => by
ext m
rfl
map_smul' := fun c f => by
ext m
rfl
invFun := ContinuousMultilinearMap.curryRight
left_inv := ContinuousMultilinearMap.curry_uncurryRight
right_inv := ContinuousMultilinearMap.uncurry_curryRight } (fun f => by
simp only [uncurryRight, LinearEquiv.coe_mk]
exact MultilinearMap.mkContinuous_norm_le _ (norm_nonneg f) _) fun f => by
simp only [curryRight, LinearEquiv.coe_symm_mk]
exact MultilinearMap.mkContinuous_norm_le _ (norm_nonneg f) _
#align continuous_multilinear_curry_right_equiv continuousMultilinearCurryRightEquiv
variable (n G')
def continuousMultilinearCurryRightEquiv' : (G[Γn]βL[π] G βL[π] G') ββα΅’[π] G[Γn.succ]βL[π] G' :=
continuousMultilinearCurryRightEquiv π (fun _ => G) G'
#align continuous_multilinear_curry_right_equiv' continuousMultilinearCurryRightEquiv'
variable {n π G Ei G'}
@[simp]
theorem continuousMultilinearCurryRightEquiv_apply
(f : ContinuousMultilinearMap π (fun i : Fin n => Ei <| castSucc i) (Ei (last n) βL[π] G))
(v : β i, Ei i) : (continuousMultilinearCurryRightEquiv π Ei G) f v = f (init v) (v (last n)) :=
rfl
#align continuous_multilinear_curry_right_equiv_apply continuousMultilinearCurryRightEquiv_apply
@[simp]
theorem continuousMultilinearCurryRightEquiv_symm_apply (f : ContinuousMultilinearMap π Ei G)
(v : β i : Fin n, Ei <| castSucc i) (x : Ei (last n)) :
(continuousMultilinearCurryRightEquiv π Ei G).symm f v x = f (snoc v x) :=
rfl
#align continuous_multilinear_curry_right_equiv_symm_apply continuousMultilinearCurryRightEquiv_symm_apply
@[simp]
theorem continuousMultilinearCurryRightEquiv_apply' (f : G[Γn]βL[π] G βL[π] G')
(v : Fin (n + 1) β G) :
continuousMultilinearCurryRightEquiv' π n G G' f v = f (init v) (v (last n)) :=
rfl
#align continuous_multilinear_curry_right_equiv_apply' continuousMultilinearCurryRightEquiv_apply'
@[simp]
theorem continuousMultilinearCurryRightEquiv_symm_apply' (f : G[Γn.succ]βL[π] G')
(v : Fin n β G) (x : G) :
(continuousMultilinearCurryRightEquiv' π n G G').symm f v x = f (snoc v x) :=
rfl
#align continuous_multilinear_curry_right_equiv_symm_apply' continuousMultilinearCurryRightEquiv_symm_apply'
@[simp]
theorem ContinuousMultilinearMap.curryRight_norm (f : ContinuousMultilinearMap π Ei G) :
βf.curryRightβ = βfβ :=
(continuousMultilinearCurryRightEquiv π Ei G).symm.norm_map f
#align continuous_multilinear_map.curry_right_norm ContinuousMultilinearMap.curryRight_norm
@[simp]
theorem ContinuousMultilinearMap.uncurryRight_norm
(f : ContinuousMultilinearMap π (fun i : Fin n => Ei <| castSucc i) (Ei (last n) βL[π] G)) :
βf.uncurryRightβ = βfβ :=
(continuousMultilinearCurryRightEquiv π Ei G).norm_map f
#align continuous_multilinear_map.uncurry_right_norm ContinuousMultilinearMap.uncurryRight_norm
section
def ContinuousMultilinearMap.uncurry0 (f : ContinuousMultilinearMap π (fun _ : Fin 0 => G) G') :
G' :=
f 0
#align continuous_multilinear_map.uncurry0 ContinuousMultilinearMap.uncurry0
variable (π G)
def ContinuousMultilinearMap.curry0 (x : G') : G[Γ0]βL[π] G' :=
ContinuousMultilinearMap.constOfIsEmpty π _ x
#align continuous_multilinear_map.curry0 ContinuousMultilinearMap.curry0
variable {G}
@[simp]
theorem ContinuousMultilinearMap.curry0_apply (x : G') (m : Fin 0 β G) :
ContinuousMultilinearMap.curry0 π G x m = x :=
rfl
#align continuous_multilinear_map.curry0_apply ContinuousMultilinearMap.curry0_apply
variable {π}
@[simp]
theorem ContinuousMultilinearMap.uncurry0_apply (f : G[Γ0]βL[π] G') : f.uncurry0 = f 0 :=
rfl
#align continuous_multilinear_map.uncurry0_apply ContinuousMultilinearMap.uncurry0_apply
@[simp]
theorem ContinuousMultilinearMap.apply_zero_curry0 (f : G[Γ0]βL[π] G') {x : Fin 0 β G} :
ContinuousMultilinearMap.curry0 π G (f x) = f := by
ext m
simp [Subsingleton.elim x m]
#align continuous_multilinear_map.apply_zero_curry0 ContinuousMultilinearMap.apply_zero_curry0
theorem ContinuousMultilinearMap.uncurry0_curry0 (f : G[Γ0]βL[π] G') :
ContinuousMultilinearMap.curry0 π G f.uncurry0 = f := by simp
#align continuous_multilinear_map.uncurry0_curry0 ContinuousMultilinearMap.uncurry0_curry0
variable (π G)
theorem ContinuousMultilinearMap.curry0_uncurry0 (x : G') :
(ContinuousMultilinearMap.curry0 π G x).uncurry0 = x :=
rfl
#align continuous_multilinear_map.curry0_uncurry0 ContinuousMultilinearMap.curry0_uncurry0
@[simp]
theorem ContinuousMultilinearMap.curry0_norm (x : G') :
βContinuousMultilinearMap.curry0 π G xβ = βxβ :=
norm_constOfIsEmpty _ _ _
#align continuous_multilinear_map.curry0_norm ContinuousMultilinearMap.curry0_norm
variable {π G}
@[simp]
| Mathlib/Analysis/NormedSpace/Multilinear/Curry.lean | 454 | 461 | theorem ContinuousMultilinearMap.fin0_apply_norm (f : G[Γ0]βL[π] G') {x : Fin 0 β G} :
βf xβ = βfβ := by |
obtain rfl : x = 0 := Subsingleton.elim _ _
refine le_antisymm (by simpa using f.le_opNorm 0) ?_
have : βContinuousMultilinearMap.curry0 π G f.uncurry0β β€ βf.uncurry0β :=
ContinuousMultilinearMap.opNorm_le_bound _ (norm_nonneg _) fun m => by
simp [-ContinuousMultilinearMap.apply_zero_curry0]
simpa [-Matrix.zero_empty] using this
|
import Mathlib.Topology.Algebra.InfiniteSum.Defs
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Topology.Algebra.Monoid
noncomputable section
open Filter Finset Function
open scoped Topology
variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*}
section HasProd
variable [CommMonoid Ξ±] [TopologicalSpace Ξ±]
variable {f g : Ξ² β Ξ±} {a b : Ξ±} {s : Finset Ξ²}
@[to_additive "Constant zero function has sum `0`"]
theorem hasProd_one : HasProd (fun _ β¦ 1 : Ξ² β Ξ±) 1 := by simp [HasProd, tendsto_const_nhds]
#align has_sum_zero hasSum_zero
@[to_additive]
theorem hasProd_empty [IsEmpty Ξ²] : HasProd f 1 := by
convert @hasProd_one Ξ± Ξ² _ _
#align has_sum_empty hasSum_empty
@[to_additive]
theorem multipliable_one : Multipliable (fun _ β¦ 1 : Ξ² β Ξ±) :=
hasProd_one.multipliable
#align summable_zero summable_zero
@[to_additive]
theorem multipliable_empty [IsEmpty Ξ²] : Multipliable f :=
hasProd_empty.multipliable
#align summable_empty summable_empty
@[to_additive]
theorem multipliable_congr (hfg : β b, f b = g b) : Multipliable f β Multipliable g :=
iff_of_eq (congr_arg Multipliable <| funext hfg)
#align summable_congr summable_congr
@[to_additive]
theorem Multipliable.congr (hf : Multipliable f) (hfg : β b, f b = g b) : Multipliable g :=
(multipliable_congr hfg).mp hf
#align summable.congr Summable.congr
@[to_additive]
lemma HasProd.congr_fun (hf : HasProd f a) (h : β x : Ξ², g x = f x) : HasProd g a :=
(funext h : g = f) βΈ hf
@[to_additive]
theorem HasProd.hasProd_of_prod_eq {g : Ξ³ β Ξ±}
(h_eq : β u : Finset Ξ³, β v : Finset Ξ², β v', v β v' β
β u', u β u' β§ β x β u', g x = β b β v', f b)
(hf : HasProd g a) : HasProd f a :=
le_trans (map_atTop_finset_prod_le_of_prod_eq h_eq) hf
#align has_sum.has_sum_of_sum_eq HasSum.hasSum_of_sum_eq
@[to_additive]
theorem hasProd_iff_hasProd {g : Ξ³ β Ξ±}
(hβ : β u : Finset Ξ³, β v : Finset Ξ², β v', v β v' β
β u', u β u' β§ β x β u', g x = β b β v', f b)
(hβ : β v : Finset Ξ², β u : Finset Ξ³, β u', u β u' β
β v', v β v' β§ β b β v', f b = β x β u', g x) :
HasProd f a β HasProd g a :=
β¨HasProd.hasProd_of_prod_eq hβ, HasProd.hasProd_of_prod_eq hββ©
#align has_sum_iff_has_sum hasSum_iff_hasSum
@[to_additive]
theorem Function.Injective.multipliable_iff {g : Ξ³ β Ξ²} (hg : Injective g)
(hf : β x β Set.range g, f x = 1) : Multipliable (f β g) β Multipliable f :=
exists_congr fun _ β¦ hg.hasProd_iff hf
#align function.injective.summable_iff Function.Injective.summable_iff
@[to_additive (attr := simp)] theorem hasProd_extend_one {g : Ξ² β Ξ³} (hg : Injective g) :
HasProd (extend g f 1) a β HasProd f a := by
rw [β hg.hasProd_iff, extend_comp hg]
exact extend_apply' _ _
@[to_additive (attr := simp)] theorem multipliable_extend_one {g : Ξ² β Ξ³} (hg : Injective g) :
Multipliable (extend g f 1) β Multipliable f :=
exists_congr fun _ β¦ hasProd_extend_one hg
@[to_additive]
theorem hasProd_subtype_iff_mulIndicator {s : Set Ξ²} :
HasProd (f β (β) : s β Ξ±) a β HasProd (s.mulIndicator f) a := by
rw [β Set.mulIndicator_range_comp, Subtype.range_coe,
hasProd_subtype_iff_of_mulSupport_subset Set.mulSupport_mulIndicator_subset]
#align has_sum_subtype_iff_indicator hasSum_subtype_iff_indicator
@[to_additive]
theorem multipliable_subtype_iff_mulIndicator {s : Set Ξ²} :
Multipliable (f β (β) : s β Ξ±) β Multipliable (s.mulIndicator f) :=
exists_congr fun _ β¦ hasProd_subtype_iff_mulIndicator
#align summable_subtype_iff_indicator summable_subtype_iff_indicator
@[to_additive (attr := simp)]
theorem hasProd_subtype_mulSupport : HasProd (f β (β) : mulSupport f β Ξ±) a β HasProd f a :=
hasProd_subtype_iff_of_mulSupport_subset <| Set.Subset.refl _
#align has_sum_subtype_support hasSum_subtype_support
@[to_additive]
protected theorem Finset.multipliable (s : Finset Ξ²) (f : Ξ² β Ξ±) :
Multipliable (f β (β) : (βs : Set Ξ²) β Ξ±) :=
(s.hasProd f).multipliable
#align finset.summable Finset.summable
@[to_additive]
protected theorem Set.Finite.multipliable {s : Set Ξ²} (hs : s.Finite) (f : Ξ² β Ξ±) :
Multipliable (f β (β) : s β Ξ±) := by
have := hs.toFinset.multipliable f
rwa [hs.coe_toFinset] at this
#align set.finite.summable Set.Finite.summable
@[to_additive]
theorem multipliable_of_finite_mulSupport (h : (mulSupport f).Finite) : Multipliable f := by
apply multipliable_of_ne_finset_one (s := h.toFinset); simp
@[to_additive]
theorem hasProd_single {f : Ξ² β Ξ±} (b : Ξ²) (hf : β (b') (_ : b' β b), f b' = 1) : HasProd f (f b) :=
suffices HasProd f (β b' β {b}, f b') by simpa using this
hasProd_prod_of_ne_finset_one <| by simpa [hf]
#align has_sum_single hasSum_single
@[to_additive (attr := simp)] lemma hasProd_unique [Unique Ξ²] (f : Ξ² β Ξ±) : HasProd f (f default) :=
hasProd_single default (fun _ hb β¦ False.elim <| hb <| Unique.uniq ..)
@[to_additive (attr := simp)]
lemma hasProd_singleton (m : Ξ²) (f : Ξ² β Ξ±) : HasProd (({m} : Set Ξ²).restrict f) (f m) :=
hasProd_unique (Set.restrict {m} f)
@[to_additive]
theorem hasProd_ite_eq (b : Ξ²) [DecidablePred (Β· = b)] (a : Ξ±) :
HasProd (fun b' β¦ if b' = b then a else 1) a := by
convert @hasProd_single _ _ _ _ (fun b' β¦ if b' = b then a else 1) b (fun b' hb' β¦ if_neg hb')
exact (if_pos rfl).symm
#align has_sum_ite_eq hasSum_ite_eq
@[to_additive]
theorem Equiv.hasProd_iff (e : Ξ³ β Ξ²) : HasProd (f β e) a β HasProd f a :=
e.injective.hasProd_iff <| by simp
#align equiv.has_sum_iff Equiv.hasSum_iff
@[to_additive]
theorem Function.Injective.hasProd_range_iff {g : Ξ³ β Ξ²} (hg : Injective g) :
HasProd (fun x : Set.range g β¦ f x) a β HasProd (f β g) a :=
(Equiv.ofInjective g hg).hasProd_iff.symm
#align function.injective.has_sum_range_iff Function.Injective.hasSum_range_iff
@[to_additive]
theorem Equiv.multipliable_iff (e : Ξ³ β Ξ²) : Multipliable (f β e) β Multipliable f :=
exists_congr fun _ β¦ e.hasProd_iff
#align equiv.summable_iff Equiv.summable_iff
@[to_additive]
theorem Equiv.hasProd_iff_of_mulSupport {g : Ξ³ β Ξ±} (e : mulSupport f β mulSupport g)
(he : β x : mulSupport f, g (e x) = f x) : HasProd f a β HasProd g a := by
have : (g β (β)) β e = f β (β) := funext he
rw [β hasProd_subtype_mulSupport, β this, e.hasProd_iff, hasProd_subtype_mulSupport]
#align equiv.has_sum_iff_of_support Equiv.hasSum_iff_of_support
@[to_additive]
theorem hasProd_iff_hasProd_of_ne_one_bij {g : Ξ³ β Ξ±} (i : mulSupport g β Ξ²)
(hi : Injective i) (hf : mulSupport f β Set.range i)
(hfg : β x, f (i x) = g x) : HasProd f a β HasProd g a :=
Iff.symm <|
Equiv.hasProd_iff_of_mulSupport
(Equiv.ofBijective (fun x β¦ β¨i x, fun hx β¦ x.coe_prop <| hfg x βΈ hxβ©)
β¨fun _ _ h β¦ hi <| Subtype.ext_iff.1 h, fun y β¦
(hf y.coe_prop).imp fun _ hx β¦ Subtype.ext hxβ©)
hfg
#align has_sum_iff_has_sum_of_ne_zero_bij hasSum_iff_hasSum_of_ne_zero_bij
@[to_additive]
theorem Equiv.multipliable_iff_of_mulSupport {g : Ξ³ β Ξ±} (e : mulSupport f β mulSupport g)
(he : β x : mulSupport f, g (e x) = f x) : Multipliable f β Multipliable g :=
exists_congr fun _ β¦ e.hasProd_iff_of_mulSupport he
#align equiv.summable_iff_of_support Equiv.summable_iff_of_support
@[to_additive]
protected theorem HasProd.map [CommMonoid Ξ³] [TopologicalSpace Ξ³] (hf : HasProd f a) {G}
[FunLike G Ξ± Ξ³] [MonoidHomClass G Ξ± Ξ³] (g : G) (hg : Continuous g) :
HasProd (g β f) (g a) := by
have : (g β fun s : Finset Ξ² β¦ β b β s, f b) = fun s : Finset Ξ² β¦ β b β s, (g β f) b :=
funext <| map_prod g _
unfold HasProd
rw [β this]
exact (hg.tendsto a).comp hf
#align has_sum.map HasSum.map
@[to_additive]
protected theorem Inducing.hasProd_iff [CommMonoid Ξ³] [TopologicalSpace Ξ³] {G}
[FunLike G Ξ± Ξ³] [MonoidHomClass G Ξ± Ξ³] {g : G} (hg : Inducing g) (f : Ξ² β Ξ±) (a : Ξ±) :
HasProd (g β f) (g a) β HasProd f a := by
simp_rw [HasProd, comp_apply, β map_prod]
exact hg.tendsto_nhds_iff.symm
@[to_additive]
protected theorem Multipliable.map [CommMonoid Ξ³] [TopologicalSpace Ξ³] (hf : Multipliable f) {G}
[FunLike G Ξ± Ξ³] [MonoidHomClass G Ξ± Ξ³] (g : G) (hg : Continuous g) : Multipliable (g β f) :=
(hf.hasProd.map g hg).multipliable
#align summable.map Summable.map
@[to_additive]
protected theorem Multipliable.map_iff_of_leftInverse [CommMonoid Ξ³] [TopologicalSpace Ξ³] {G G'}
[FunLike G Ξ± Ξ³] [MonoidHomClass G Ξ± Ξ³] [FunLike G' Ξ³ Ξ±] [MonoidHomClass G' Ξ³ Ξ±]
(g : G) (g' : G') (hg : Continuous g) (hg' : Continuous g') (hinv : Function.LeftInverse g' g) :
Multipliable (g β f) β Multipliable f :=
β¨fun h β¦ by
have := h.map _ hg'
rwa [β Function.comp.assoc, hinv.id] at this, fun h β¦ h.map _ hgβ©
#align summable.map_iff_of_left_inverse Summable.map_iff_of_leftInverse
@[to_additive]
theorem Multipliable.map_tprod [CommMonoid Ξ³] [TopologicalSpace Ξ³] [T2Space Ξ³] (hf : Multipliable f)
{G} [FunLike G Ξ± Ξ³] [MonoidHomClass G Ξ± Ξ³] (g : G) (hg : Continuous g) :
g (β' i, f i) = β' i, g (f i) := (HasProd.tprod_eq (HasProd.map hf.hasProd g hg)).symm
@[to_additive]
theorem Inducing.multipliable_iff_tprod_comp_mem_range [CommMonoid Ξ³] [TopologicalSpace Ξ³]
[T2Space Ξ³] {G} [FunLike G Ξ± Ξ³] [MonoidHomClass G Ξ± Ξ³] {g : G} (hg : Inducing g) (f : Ξ² β Ξ±) :
Multipliable f β Multipliable (g β f) β§ β' i, g (f i) β Set.range g := by
constructor
Β· intro hf
constructor
Β· exact hf.map g hg.continuous
Β· use β' i, f i
exact hf.map_tprod g hg.continuous
Β· rintro β¨hgf, a, haβ©
use a
have := hgf.hasProd
simp_rw [comp_apply, β ha] at this
exact (hg.hasProd_iff f a).mp this
@[to_additive "A special case of `Summable.map_iff_of_leftInverse` for convenience"]
protected theorem Multipliable.map_iff_of_equiv [CommMonoid Ξ³] [TopologicalSpace Ξ³] {G}
[EquivLike G Ξ± Ξ³] [MulEquivClass G Ξ± Ξ³] (g : G) (hg : Continuous g)
(hg' : Continuous (EquivLike.inv g : Ξ³ β Ξ±)) : Multipliable (g β f) β Multipliable f :=
Multipliable.map_iff_of_leftInverse g (g : Ξ± β* Ξ³).symm hg hg' (EquivLike.left_inv g)
#align summable.map_iff_of_equiv Summable.map_iff_of_equiv
@[to_additive]
theorem Function.Surjective.multipliable_iff_of_hasProd_iff {Ξ±' : Type*} [CommMonoid Ξ±']
[TopologicalSpace Ξ±'] {e : Ξ±' β Ξ±} (hes : Function.Surjective e) {f : Ξ² β Ξ±} {g : Ξ³ β Ξ±'}
(he : β {a}, HasProd f (e a) β HasProd g a) : Multipliable f β Multipliable g :=
hes.exists.trans <| exists_congr <| @he
#align function.surjective.summable_iff_of_has_sum_iff Function.Surjective.summable_iff_of_hasSum_iff
variable [ContinuousMul Ξ±]
@[to_additive]
theorem HasProd.mul (hf : HasProd f a) (hg : HasProd g b) :
HasProd (fun b β¦ f b * g b) (a * b) := by
dsimp only [HasProd] at hf hg β’
simp_rw [prod_mul_distrib]
exact hf.mul hg
#align has_sum.add HasSum.add
@[to_additive]
theorem Multipliable.mul (hf : Multipliable f) (hg : Multipliable g) :
Multipliable fun b β¦ f b * g b :=
(hf.hasProd.mul hg.hasProd).multipliable
#align summable.add Summable.add
@[to_additive]
theorem hasProd_prod {f : Ξ³ β Ξ² β Ξ±} {a : Ξ³ β Ξ±} {s : Finset Ξ³} :
(β i β s, HasProd (f i) (a i)) β HasProd (fun b β¦ β i β s, f i b) (β i β s, a i) := by
classical
exact Finset.induction_on s (by simp only [hasProd_one, prod_empty, forall_true_iff]) <| by
-- Porting note: with some help, `simp` used to be able to close the goal
simp (config := { contextual := true }) only [mem_insert, forall_eq_or_imp, not_false_iff,
prod_insert, and_imp]
exact fun x s _ IH hx h β¦ hx.mul (IH h)
#align has_sum_sum hasSum_sum
@[to_additive]
theorem multipliable_prod {f : Ξ³ β Ξ² β Ξ±} {s : Finset Ξ³} (hf : β i β s, Multipliable (f i)) :
Multipliable fun b β¦ β i β s, f i b :=
(hasProd_prod fun i hi β¦ (hf i hi).hasProd).multipliable
#align summable_sum summable_sum
@[to_additive]
theorem HasProd.mul_disjoint {s t : Set Ξ²} (hs : Disjoint s t) (ha : HasProd (f β (β) : s β Ξ±) a)
(hb : HasProd (f β (β) : t β Ξ±) b) : HasProd (f β (β) : (s βͺ t : Set Ξ²) β Ξ±) (a * b) := by
rw [hasProd_subtype_iff_mulIndicator] at *
rw [Set.mulIndicator_union_of_disjoint hs]
exact ha.mul hb
#align has_sum.add_disjoint HasSum.add_disjoint
@[to_additive]
| Mathlib/Topology/Algebra/InfiniteSum/Basic.lean | 308 | 313 | theorem hasProd_prod_disjoint {ΞΉ} (s : Finset ΞΉ) {t : ΞΉ β Set Ξ²} {a : ΞΉ β Ξ±}
(hs : (s : Set ΞΉ).Pairwise (Disjoint on t)) (hf : β i β s, HasProd (f β (β) : t i β Ξ±) (a i)) :
HasProd (f β (β) : (β i β s, t i) β Ξ±) (β i β s, a i) := by |
simp_rw [hasProd_subtype_iff_mulIndicator] at *
rw [Finset.mulIndicator_biUnion _ _ hs]
exact hasProd_prod hf
|
import Mathlib.LinearAlgebra.Basis.VectorSpace
import Mathlib.LinearAlgebra.Dimension.Finite
import Mathlib.SetTheory.Cardinal.Subfield
import Mathlib.LinearAlgebra.Dimension.RankNullity
#align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5"
noncomputable section
universe uβ u v v' v'' uβ' w w'
variable {K R : Type u} {V Vβ Vβ Vβ : Type v} {V' V'β : Type v'} {V'' : Type v''}
variable {ΞΉ : Type w} {ΞΉ' : Type w'} {Ξ· : Type uβ'} {Ο : Ξ· β Type*}
open Cardinal Basis Submodule Function Set
section Module
section Basis
open FiniteDimensional
variable [DivisionRing K] [AddCommGroup V] [Module K V]
theorem linearIndependent_of_top_le_span_of_card_eq_finrank {ΞΉ : Type*} [Fintype ΞΉ] {b : ΞΉ β V}
(spans : β€ β€ span K (Set.range b)) (card_eq : Fintype.card ΞΉ = finrank K V) :
LinearIndependent K b :=
linearIndependent_iff'.mpr fun s g dependent i i_mem_s => by
classical
by_contra gx_ne_zero
-- We'll derive a contradiction by showing `b '' (univ \ {i})` of cardinality `n - 1`
-- spans a vector space of dimension `n`.
refine not_le_of_gt (span_lt_top_of_card_lt_finrank
(show (b '' (Set.univ \ {i})).toFinset.card < finrank K V from ?_)) ?_
Β· calc
(b '' (Set.univ \ {i})).toFinset.card = ((Set.univ \ {i}).toFinset.image b).card := by
rw [Set.toFinset_card, Fintype.card_ofFinset]
_ β€ (Set.univ \ {i}).toFinset.card := Finset.card_image_le
_ = (Finset.univ.erase i).card := (congr_arg Finset.card (Finset.ext (by simp [and_comm])))
_ < Finset.univ.card := Finset.card_erase_lt_of_mem (Finset.mem_univ i)
_ = finrank K V := card_eq
-- We already have that `b '' univ` spans the whole space,
-- so we only need to show that the span of `b '' (univ \ {i})` contains each `b j`.
refine spans.trans (span_le.mpr ?_)
rintro _ β¨j, rfl, rflβ©
-- The case that `j β i` is easy because `b j β b '' (univ \ {i})`.
by_cases j_eq : j = i
swap
Β· refine subset_span β¨j, (Set.mem_diff _).mpr β¨Set.mem_univ _, ?_β©, rflβ©
exact mt Set.mem_singleton_iff.mp j_eq
-- To show `b i β span (b '' (univ \ {i}))`, we use that it's a weighted sum
-- of the other `b j`s.
rw [j_eq, SetLike.mem_coe, show b i = -((g i)β»ΒΉ β’ (s.erase i).sum fun j => g j β’ b j) from _]
Β· refine neg_mem (smul_mem _ _ (sum_mem fun k hk => ?_))
obtain β¨k_ne_i, _β© := Finset.mem_erase.mp hk
refine smul_mem _ _ (subset_span β¨k, ?_, rflβ©)
simp_all only [Set.mem_univ, Set.mem_diff, Set.mem_singleton_iff, and_self, not_false_eq_true]
-- To show `b i` is a weighted sum of the other `b j`s, we'll rewrite this sum
-- to have the form of the assumption `dependent`.
apply eq_neg_of_add_eq_zero_left
calc
(b i + (g i)β»ΒΉ β’ (s.erase i).sum fun j => g j β’ b j) =
(g i)β»ΒΉ β’ (g i β’ b i + (s.erase i).sum fun j => g j β’ b j) := by
rw [smul_add, β mul_smul, inv_mul_cancel gx_ne_zero, one_smul]
_ = (g i)β»ΒΉ β’ (0 : V) := congr_arg _ ?_
_ = 0 := smul_zero _
-- And then it's just a bit of manipulation with finite sums.
rwa [β Finset.insert_erase i_mem_s, Finset.sum_insert (Finset.not_mem_erase _ _)] at dependent
#align linear_independent_of_top_le_span_of_card_eq_finrank linearIndependent_of_top_le_span_of_card_eq_finrank
| Mathlib/LinearAlgebra/Dimension/DivisionRing.lean | 171 | 193 | theorem linearIndependent_iff_card_eq_finrank_span {ΞΉ : Type*} [Fintype ΞΉ] {b : ΞΉ β V} :
LinearIndependent K b β Fintype.card ΞΉ = (Set.range b).finrank K := by |
constructor
Β· intro h
exact (finrank_span_eq_card h).symm
Β· intro hc
let f := Submodule.subtype (span K (Set.range b))
let b' : ΞΉ β span K (Set.range b) := fun i =>
β¨b i, mem_span.2 fun p hp => hp (Set.mem_range_self _)β©
have hs : β€ β€ span K (Set.range b') := by
intro x
have h : span K (f '' Set.range b') = map f (span K (Set.range b')) := span_image f
have hf : f '' Set.range b' = Set.range b := by
ext x
simp [f, Set.mem_image, Set.mem_range]
rw [hf] at h
have hx : (x : V) β span K (Set.range b) := x.property
conv at hx =>
arg 2
rw [h]
simpa [f, mem_map] using hx
have hi : LinearMap.ker f = β₯ := ker_subtype _
convert (linearIndependent_of_top_le_span_of_card_eq_finrank hs hc).map' _ hi
|
import Mathlib.Algebra.Polynomial.Degree.Definitions
import Mathlib.Algebra.Polynomial.Eval
import Mathlib.Algebra.Polynomial.Monic
import Mathlib.Algebra.Polynomial.RingDivision
import Mathlib.Tactic.Abel
#align_import ring_theory.polynomial.pochhammer from "leanprover-community/mathlib"@"53b216bcc1146df1c4a0a86877890ea9f1f01589"
universe u v
open Polynomial
open Polynomial
section Semiring
variable (S : Type u) [Semiring S]
noncomputable def ascPochhammer : β β S[X]
| 0 => 1
| n + 1 => X * (ascPochhammer n).comp (X + 1)
#align pochhammer ascPochhammer
@[simp]
theorem ascPochhammer_zero : ascPochhammer S 0 = 1 :=
rfl
#align pochhammer_zero ascPochhammer_zero
@[simp]
theorem ascPochhammer_one : ascPochhammer S 1 = X := by simp [ascPochhammer]
#align pochhammer_one ascPochhammer_one
theorem ascPochhammer_succ_left (n : β) :
ascPochhammer S (n + 1) = X * (ascPochhammer S n).comp (X + 1) := by
rw [ascPochhammer]
#align pochhammer_succ_left ascPochhammer_succ_left
theorem monic_ascPochhammer (n : β) [Nontrivial S] [NoZeroDivisors S] :
Monic <| ascPochhammer S n := by
induction' n with n hn
Β· simp
Β· have : leadingCoeff (X + 1 : S[X]) = 1 := leadingCoeff_X_add_C 1
rw [ascPochhammer_succ_left, Monic.def, leadingCoeff_mul,
leadingCoeff_comp (ne_zero_of_eq_one <| natDegree_X_add_C 1 : natDegree (X + 1) β 0), hn,
monic_X, one_mul, one_mul, this, one_pow]
section
variable {S} {T : Type v} [Semiring T]
@[simp]
theorem ascPochhammer_map (f : S β+* T) (n : β) :
(ascPochhammer S n).map f = ascPochhammer T n := by
induction' n with n ih
Β· simp
Β· simp [ih, ascPochhammer_succ_left, map_comp]
#align pochhammer_map ascPochhammer_map
theorem ascPochhammer_evalβ (f : S β+* T) (n : β) (t : T) :
(ascPochhammer T n).eval t = (ascPochhammer S n).evalβ f t := by
rw [β ascPochhammer_map f]
exact eval_map f t
theorem ascPochhammer_eval_comp {R : Type*} [CommSemiring R] (n : β) (p : R[X]) [Algebra R S]
(x : S) : ((ascPochhammer S n).comp (p.map (algebraMap R S))).eval x =
(ascPochhammer S n).eval (p.evalβ (algebraMap R S) x) := by
rw [ascPochhammer_evalβ (algebraMap R S), β evalβ_comp', β ascPochhammer_map (algebraMap R S),
β map_comp, eval_map]
end
@[simp, norm_cast]
theorem ascPochhammer_eval_cast (n k : β) :
(((ascPochhammer β n).eval k : β) : S) = ((ascPochhammer S n).eval k : S) := by
rw [β ascPochhammer_map (algebraMap β S), eval_map, β eq_natCast (algebraMap β S),
evalβ_at_natCast,Nat.cast_id]
#align pochhammer_eval_cast ascPochhammer_eval_cast
theorem ascPochhammer_eval_zero {n : β} : (ascPochhammer S n).eval 0 = if n = 0 then 1 else 0 := by
cases n
Β· simp
Β· simp [X_mul, Nat.succ_ne_zero, ascPochhammer_succ_left]
#align pochhammer_eval_zero ascPochhammer_eval_zero
theorem ascPochhammer_zero_eval_zero : (ascPochhammer S 0).eval 0 = 1 := by simp
#align pochhammer_zero_eval_zero ascPochhammer_zero_eval_zero
@[simp]
theorem ascPochhammer_ne_zero_eval_zero {n : β} (h : n β 0) : (ascPochhammer S n).eval 0 = 0 := by
simp [ascPochhammer_eval_zero, h]
#align pochhammer_ne_zero_eval_zero ascPochhammer_ne_zero_eval_zero
theorem ascPochhammer_succ_right (n : β) :
ascPochhammer S (n + 1) = ascPochhammer S n * (X + (n : S[X])) := by
suffices h : ascPochhammer β (n + 1) = ascPochhammer β n * (X + (n : β[X])) by
apply_fun Polynomial.map (algebraMap β S) at h
simpa only [ascPochhammer_map, Polynomial.map_mul, Polynomial.map_add, map_X,
Polynomial.map_natCast] using h
induction' n with n ih
Β· simp
Β· conv_lhs =>
rw [ascPochhammer_succ_left, ih, mul_comp, β mul_assoc, β ascPochhammer_succ_left, add_comp,
X_comp, natCast_comp, add_assoc, add_comm (1 : β[X]), β Nat.cast_succ]
#align pochhammer_succ_right ascPochhammer_succ_right
theorem ascPochhammer_succ_eval {S : Type*} [Semiring S] (n : β) (k : S) :
(ascPochhammer S (n + 1)).eval k = (ascPochhammer S n).eval k * (k + n) := by
rw [ascPochhammer_succ_right, mul_add, eval_add, eval_mul_X, β Nat.cast_comm, β C_eq_natCast,
eval_C_mul, Nat.cast_comm, β mul_add]
#align pochhammer_succ_eval ascPochhammer_succ_eval
theorem ascPochhammer_succ_comp_X_add_one (n : β) :
(ascPochhammer S (n + 1)).comp (X + 1) =
ascPochhammer S (n + 1) + (n + 1) β’ (ascPochhammer S n).comp (X + 1) := by
suffices (ascPochhammer β (n + 1)).comp (X + 1) =
ascPochhammer β (n + 1) + (n + 1) * (ascPochhammer β n).comp (X + 1)
by simpa [map_comp] using congr_arg (Polynomial.map (Nat.castRingHom S)) this
nth_rw 2 [ascPochhammer_succ_left]
rw [β add_mul, ascPochhammer_succ_right β n, mul_comp, mul_comm, add_comp, X_comp, natCast_comp,
add_comm, β add_assoc]
ring
set_option linter.uppercaseLean3 false in
#align pochhammer_succ_comp_X_add_one ascPochhammer_succ_comp_X_add_one
theorem ascPochhammer_mul (n m : β) :
ascPochhammer S n * (ascPochhammer S m).comp (X + (n : S[X])) = ascPochhammer S (n + m) := by
induction' m with m ih
Β· simp
Β· rw [ascPochhammer_succ_right, Polynomial.mul_X_add_natCast_comp, β mul_assoc, ih,
β add_assoc, ascPochhammer_succ_right, Nat.cast_add, add_assoc]
#align pochhammer_mul ascPochhammer_mul
theorem ascPochhammer_nat_eq_ascFactorial (n : β) :
β k, (ascPochhammer β k).eval n = n.ascFactorial k
| 0 => by rw [ascPochhammer_zero, eval_one, Nat.ascFactorial_zero]
| t + 1 => by
rw [ascPochhammer_succ_right, eval_mul, ascPochhammer_nat_eq_ascFactorial n t, eval_add, eval_X,
eval_natCast, Nat.cast_id, Nat.ascFactorial_succ, mul_comm]
#align pochhammer_nat_eq_asc_factorial ascPochhammer_nat_eq_ascFactorial
| Mathlib/RingTheory/Polynomial/Pochhammer.lean | 172 | 174 | theorem ascPochhammer_nat_eq_descFactorial (a b : β) :
(ascPochhammer β b).eval a = (a + b - 1).descFactorial b := by |
rw [ascPochhammer_nat_eq_ascFactorial, Nat.add_descFactorial_eq_ascFactorial']
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.