Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k | goals listlengths 0 224 | goals_before listlengths 0 221 |
|---|---|---|---|---|---|---|---|
import Mathlib.Computability.DFA
import Mathlib.Data.Fintype.Powerset
#align_import computability.NFA from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514"
open Set
open Computability
universe u v
-- Porting note: Required as `NFA` is used in mathlib3
set_option linter.uppercaseLean3 false
structure NFA (Ξ± : Type u) (Ο : Type v) where
step : Ο β Ξ± β Set Ο
start : Set Ο
accept : Set Ο
#align NFA NFA
variable {Ξ± : Type u} {Ο Ο' : Type v} (M : NFA Ξ± Ο)
namespace NFA
instance : Inhabited (NFA Ξ± Ο) :=
β¨NFA.mk (fun _ _ => β
) β
β
β©
def stepSet (S : Set Ο) (a : Ξ±) : Set Ο :=
β s β S, M.step s a
#align NFA.step_set NFA.stepSet
| Mathlib/Computability/NFA.lean | 53 | 54 | theorem mem_stepSet (s : Ο) (S : Set Ο) (a : Ξ±) : s β M.stepSet S a β β t β S, s β M.step t a := by |
simp [stepSet]
| [
" s β M.stepSet S a β β t β S, s β M.step t a"
] | [
" s β M.stepSet S a β β t β S, s β M.step t a"
] |
import Mathlib.Combinatorics.Quiver.Path
import Mathlib.Combinatorics.Quiver.Push
#align_import combinatorics.quiver.symmetric from "leanprover-community/mathlib"@"706d88f2b8fdfeb0b22796433d7a6c1a010af9f2"
universe v u w v'
namespace Quiver
-- Porting note: no hasNonemptyInstance linter yet
def Symmetrify (V : Type*) := V
#align quiver.symmetrify Quiver.Symmetrify
instance symmetrifyQuiver (V : Type u) [Quiver V] : Quiver (Symmetrify V) :=
β¨fun a b : V β¦ Sum (a βΆ b) (b βΆ a)β©
variable (U V W : Type*) [Quiver.{u + 1} U] [Quiver.{v + 1} V] [Quiver.{w + 1} W]
class HasReverse where
reverse' : β {a b : V}, (a βΆ b) β (b βΆ a)
#align quiver.has_reverse Quiver.HasReverse
def reverse {V} [Quiver.{v + 1} V] [HasReverse V] {a b : V} : (a βΆ b) β (b βΆ a) :=
HasReverse.reverse'
#align quiver.reverse Quiver.reverse
class HasInvolutiveReverse extends HasReverse V where
inv' : β {a b : V} (f : a βΆ b), reverse (reverse f) = f
#align quiver.has_involutive_reverse Quiver.HasInvolutiveReverse
variable {U V W}
@[simp]
theorem reverse_reverse [h : HasInvolutiveReverse V] {a b : V} (f : a βΆ b) :
reverse (reverse f) = f := by apply h.inv'
#align quiver.reverse_reverse Quiver.reverse_reverse
@[simp]
theorem reverse_inj [h : HasInvolutiveReverse V] {a b : V}
(f g : a βΆ b) : reverse f = reverse g β f = g := by
constructor
Β· rintro h
simpa using congr_arg Quiver.reverse h
Β· rintro h
congr
#align quiver.reverse_inj Quiver.reverse_inj
theorem eq_reverse_iff [h : HasInvolutiveReverse V] {a b : V} (f : a βΆ b)
(g : b βΆ a) : f = reverse g β reverse f = g := by
rw [β reverse_inj, reverse_reverse]
#align quiver.eq_reverse_iff Quiver.eq_reverse_iff
instance : HasReverse (Symmetrify V) :=
β¨fun e => e.swapβ©
instance :
HasInvolutiveReverse
(Symmetrify V) where
toHasReverse := β¨fun e β¦ e.swapβ©
inv' e := congr_fun Sum.swap_swap_eq e
@[simp]
theorem symmetrify_reverse {a b : Symmetrify V} (e : a βΆ b) : reverse e = e.swap :=
rfl
#align quiver.symmetrify_reverse Quiver.symmetrify_reverse
section Paths
abbrev Hom.toPos {X Y : V} (f : X βΆ Y) : (Quiver.symmetrifyQuiver V).Hom X Y :=
Sum.inl f
#align quiver.hom.to_pos Quiver.Hom.toPos
abbrev Hom.toNeg {X Y : V} (f : X βΆ Y) : (Quiver.symmetrifyQuiver V).Hom Y X :=
Sum.inr f
#align quiver.hom.to_neg Quiver.Hom.toNeg
@[simp]
def Path.reverse [HasReverse V] {a : V} : β {b}, Path a b β Path b a
| _, Path.nil => Path.nil
| _, Path.cons p e => (Quiver.reverse e).toPath.comp p.reverse
#align quiver.path.reverse Quiver.Path.reverse
@[simp]
theorem Path.reverse_toPath [HasReverse V] {a b : V} (f : a βΆ b) :
f.toPath.reverse = (Quiver.reverse f).toPath :=
rfl
#align quiver.path.reverse_to_path Quiver.Path.reverse_toPath
@[simp]
theorem Path.reverse_comp [HasReverse V] {a b c : V} (p : Path a b) (q : Path b c) :
(p.comp q).reverse = q.reverse.comp p.reverse := by
induction' q with _ _ _ _ h
Β· simp
Β· simp [h]
#align quiver.path.reverse_comp Quiver.Path.reverse_comp
@[simp]
| Mathlib/Combinatorics/Quiver/Symmetric.lean | 158 | 163 | theorem Path.reverse_reverse [h : HasInvolutiveReverse V] {a b : V} (p : Path a b) :
p.reverse.reverse = p := by |
induction' p with _ _ _ _ h
Β· simp
Β· rw [Path.reverse, Path.reverse_comp, h, Path.reverse_toPath, Quiver.reverse_reverse]
rfl
| [
" reverse (reverse f) = f",
" reverse f = reverse g β f = g",
" reverse f = reverse g β f = g",
" f = g",
" f = g β reverse f = reverse g",
" reverse f = reverse g",
" f = reverse g β reverse f = g",
" (p.comp q).reverse = q.reverse.comp p.reverse",
" (p.comp nil).reverse = nil.reverse.comp p.revers... | [
" reverse (reverse f) = f",
" reverse f = reverse g β f = g",
" reverse f = reverse g β f = g",
" f = g",
" f = g β reverse f = reverse g",
" reverse f = reverse g",
" f = reverse g β reverse f = g",
" (p.comp q).reverse = q.reverse.comp p.reverse",
" (p.comp nil).reverse = nil.reverse.comp p.revers... |
import Mathlib.Topology.EMetricSpace.Basic
#align_import topology.metric_space.metric_separated from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2"
open EMetric Set
noncomputable section
def IsMetricSeparated {X : Type*} [EMetricSpace X] (s t : Set X) :=
β r, r β 0 β§ β x β s, β y β t, r β€ edist x y
#align is_metric_separated IsMetricSeparated
namespace IsMetricSeparated
variable {X : Type*} [EMetricSpace X] {s t : Set X} {x y : X}
@[symm]
theorem symm (h : IsMetricSeparated s t) : IsMetricSeparated t s :=
let β¨r, r0, hrβ© := h
β¨r, r0, fun y hy x hx => edist_comm x y βΈ hr x hx y hyβ©
#align is_metric_separated.symm IsMetricSeparated.symm
theorem comm : IsMetricSeparated s t β IsMetricSeparated t s :=
β¨symm, symmβ©
#align is_metric_separated.comm IsMetricSeparated.comm
@[simp]
theorem empty_left (s : Set X) : IsMetricSeparated β
s :=
β¨1, one_ne_zero, fun _x => False.elimβ©
#align is_metric_separated.empty_left IsMetricSeparated.empty_left
@[simp]
theorem empty_right (s : Set X) : IsMetricSeparated s β
:=
(empty_left s).symm
#align is_metric_separated.empty_right IsMetricSeparated.empty_right
protected theorem disjoint (h : IsMetricSeparated s t) : Disjoint s t :=
let β¨r, r0, hrβ© := h
Set.disjoint_left.mpr fun x hx1 hx2 => r0 <| by simpa using hr x hx1 x hx2
#align is_metric_separated.disjoint IsMetricSeparated.disjoint
theorem subset_compl_right (h : IsMetricSeparated s t) : s β tαΆ := fun _ hs ht =>
h.disjoint.le_bot β¨hs, htβ©
#align is_metric_separated.subset_compl_right IsMetricSeparated.subset_compl_right
@[mono]
theorem mono {s' t'} (hs : s β s') (ht : t β t') :
IsMetricSeparated s' t' β IsMetricSeparated s t := fun β¨r, r0, hrβ© =>
β¨r, r0, fun x hx y hy => hr x (hs hx) y (ht hy)β©
#align is_metric_separated.mono IsMetricSeparated.mono
theorem mono_left {s'} (h' : IsMetricSeparated s' t) (hs : s β s') : IsMetricSeparated s t :=
h'.mono hs Subset.rfl
#align is_metric_separated.mono_left IsMetricSeparated.mono_left
theorem mono_right {t'} (h' : IsMetricSeparated s t') (ht : t β t') : IsMetricSeparated s t :=
h'.mono Subset.rfl ht
#align is_metric_separated.mono_right IsMetricSeparated.mono_right
theorem union_left {s'} (h : IsMetricSeparated s t) (h' : IsMetricSeparated s' t) :
IsMetricSeparated (s βͺ s') t := by
rcases h, h' with β¨β¨r, r0, hrβ©, β¨r', r0', hr'β©β©
refine β¨min r r', ?_, fun x hx y hy => hx.elim ?_ ?_β©
Β· rw [β pos_iff_ne_zero] at r0 r0' β’
exact lt_min r0 r0'
Β· exact fun hx => (min_le_left _ _).trans (hr _ hx _ hy)
Β· exact fun hx => (min_le_right _ _).trans (hr' _ hx _ hy)
#align is_metric_separated.union_left IsMetricSeparated.union_left
@[simp]
theorem union_left_iff {s'} :
IsMetricSeparated (s βͺ s') t β IsMetricSeparated s t β§ IsMetricSeparated s' t :=
β¨fun h => β¨h.mono_left subset_union_left, h.mono_left subset_union_rightβ©, fun h =>
h.1.union_left h.2β©
#align is_metric_separated.union_left_iff IsMetricSeparated.union_left_iff
theorem union_right {t'} (h : IsMetricSeparated s t) (h' : IsMetricSeparated s t') :
IsMetricSeparated s (t βͺ t') :=
(h.symm.union_left h'.symm).symm
#align is_metric_separated.union_right IsMetricSeparated.union_right
@[simp]
theorem union_right_iff {t'} :
IsMetricSeparated s (t βͺ t') β IsMetricSeparated s t β§ IsMetricSeparated s t' :=
comm.trans <| union_left_iff.trans <| and_congr comm comm
#align is_metric_separated.union_right_iff IsMetricSeparated.union_right_iff
| Mathlib/Topology/MetricSpace/MetricSeparated.lean | 106 | 109 | theorem finite_iUnion_left_iff {ΞΉ : Type*} {I : Set ΞΉ} (hI : I.Finite) {s : ΞΉ β Set X}
{t : Set X} : IsMetricSeparated (β i β I, s i) t β β i β I, IsMetricSeparated (s i) t := by |
refine Finite.induction_on hI (by simp) @fun i I _ _ hI => ?_
rw [biUnion_insert, forall_mem_insert, union_left_iff, hI]
| [
" r = 0",
" IsMetricSeparated (s βͺ s') t",
" min r r' β 0",
" 0 < min r r'",
" x β s β min r r' β€ edist x y",
" x β s' β min r r' β€ edist x y",
" IsMetricSeparated (β i β I, s i) t β β i β I, IsMetricSeparated (s i) t",
" IsMetricSeparated (β i β β
, s i) t β β i β β
, IsMetricSeparated (s i) t",
" Is... | [
" r = 0",
" IsMetricSeparated (s βͺ s') t",
" min r r' β 0",
" 0 < min r r'",
" x β s β min r r' β€ edist x y",
" x β s' β min r r' β€ edist x y",
" IsMetricSeparated (β i β I, s i) t β β i β I, IsMetricSeparated (s i) t"
] |
import Mathlib.Analysis.Convolution
import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd
import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup
import Mathlib.Analysis.Analytic.IsolatedZeros
import Mathlib.Analysis.Complex.CauchyIntegral
#align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090"
noncomputable section
set_option linter.uppercaseLean3 false
open Filter intervalIntegral Set Real MeasureTheory
open scoped Nat Topology Real
section BetaIntegral
namespace Complex
noncomputable def betaIntegral (u v : β) : β :=
β« x : β in (0)..1, (x : β) ^ (u - 1) * (1 - (x : β)) ^ (v - 1)
#align complex.beta_integral Complex.betaIntegral
theorem betaIntegral_convergent_left {u : β} (hu : 0 < re u) (v : β) :
IntervalIntegrable (fun x =>
(x : β) ^ (u - 1) * (1 - (x : β)) ^ (v - 1) : β β β) volume 0 (1 / 2) := by
apply IntervalIntegrable.mul_continuousOn
Β· refine intervalIntegral.intervalIntegrable_cpow' ?_
rwa [sub_re, one_re, β zero_sub, sub_lt_sub_iff_right]
Β· apply ContinuousAt.continuousOn
intro x hx
rw [uIcc_of_le (by positivity : (0 : β) β€ 1 / 2)] at hx
apply ContinuousAt.cpow
Β· exact (continuous_const.sub continuous_ofReal).continuousAt
Β· exact continuousAt_const
Β· norm_cast
exact ofReal_mem_slitPlane.2 <| by linarith only [hx.2]
#align complex.beta_integral_convergent_left Complex.betaIntegral_convergent_left
| Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean | 80 | 90 | theorem betaIntegral_convergent {u v : β} (hu : 0 < re u) (hv : 0 < re v) :
IntervalIntegrable (fun x =>
(x : β) ^ (u - 1) * (1 - (x : β)) ^ (v - 1) : β β β) volume 0 1 := by |
refine (betaIntegral_convergent_left hu v).trans ?_
rw [IntervalIntegrable.iff_comp_neg]
convert ((betaIntegral_convergent_left hv u).comp_add_right 1).symm using 1
Β· ext1 x
conv_lhs => rw [mul_comm]
congr 2 <;> Β· push_cast; ring
Β· norm_num
Β· norm_num
| [
" IntervalIntegrable (fun x => βx ^ (u - 1) * (1 - βx) ^ (v - 1)) volume 0 (1 / 2)",
" IntervalIntegrable (fun x => βx ^ (u - 1)) volume 0 (1 / 2)",
" -1 < (u - 1).re",
" ContinuousOn (fun x => (1 - βx) ^ (v - 1)) (uIcc 0 (1 / 2))",
" β x β uIcc 0 (1 / 2), ContinuousAt (fun x => (1 - βx) ^ (v - 1)) x",
" ... | [
" IntervalIntegrable (fun x => βx ^ (u - 1) * (1 - βx) ^ (v - 1)) volume 0 (1 / 2)",
" IntervalIntegrable (fun x => βx ^ (u - 1)) volume 0 (1 / 2)",
" -1 < (u - 1).re",
" ContinuousOn (fun x => (1 - βx) ^ (v - 1)) (uIcc 0 (1 / 2))",
" β x β uIcc 0 (1 / 2), ContinuousAt (fun x => (1 - βx) ^ (v - 1)) x",
" ... |
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Algebra.Order.Archimedean
import Mathlib.Data.Set.Lattice
#align_import group_theory.archimedean from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6"
open Set
variable {G : Type*} [LinearOrderedAddCommGroup G] [Archimedean G]
| Mathlib/GroupTheory/Archimedean.lean | 40 | 54 | theorem AddSubgroup.cyclic_of_min {H : AddSubgroup G} {a : G}
(ha : IsLeast { g : G | g β H β§ 0 < g } a) : H = AddSubgroup.closure {a} := by |
obtain β¨β¨a_in, a_posβ©, a_minβ© := ha
refine le_antisymm ?_ (H.closure_le.mpr <| by simp [a_in])
intro g g_in
obtain β¨k, β¨nonneg, ltβ©, _β© := existsUnique_zsmul_near_of_pos' a_pos g
have h_zero : g - k β’ a = 0 := by
by_contra h
have h : a β€ g - k β’ a := by
refine a_min β¨?_, ?_β©
Β· exact AddSubgroup.sub_mem H g_in (AddSubgroup.zsmul_mem H a_in k)
Β· exact lt_of_le_of_ne nonneg (Ne.symm h)
have h' : Β¬a β€ g - k β’ a := not_le.mpr lt
contradiction
simp [sub_eq_zero.mp h_zero, AddSubgroup.mem_closure_singleton]
| [
" H = closure {a}",
" {a} β βH",
" H β€ closure {a}",
" g β closure {a}",
" g - k β’ a = 0",
" False",
" a β€ g - k β’ a",
" g - k β’ a β H",
" 0 < g - k β’ a"
] | [
" H = closure {a}"
] |
import Mathlib.Analysis.NormedSpace.FiniteDimension
import Mathlib.Analysis.RCLike.Basic
#align_import data.is_R_or_C.lemmas from "leanprover-community/mathlib"@"468b141b14016d54b479eb7a0fff1e360b7e3cf6"
variable {K E : Type*} [RCLike K]
namespace RCLike
@[simp, rclike_simps]
| Mathlib/Analysis/RCLike/Lemmas.lean | 71 | 74 | theorem reCLM_norm : β(reCLM : K βL[β] β)β = 1 := by |
apply le_antisymm (LinearMap.mkContinuous_norm_le _ zero_le_one _)
convert ContinuousLinearMap.ratio_le_opNorm (reCLM : K βL[β] β) (1 : K)
simp
| [
" βreCLMβ = 1",
" 1 β€ βreLm.mkContinuous 1 β―β",
" 1 = βreCLM 1β / β1β"
] | [
" βreCLMβ = 1"
] |
import Mathlib.Order.Interval.Finset.Nat
#align_import data.fin.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
assert_not_exists MonoidWithZero
open Finset Fin Function
namespace Fin
variable (n : β)
instance instLocallyFiniteOrder : LocallyFiniteOrder (Fin n) :=
OrderIso.locallyFiniteOrder Fin.orderIsoSubtype
instance instLocallyFiniteOrderBot : LocallyFiniteOrderBot (Fin n) :=
OrderIso.locallyFiniteOrderBot Fin.orderIsoSubtype
instance instLocallyFiniteOrderTop : β n, LocallyFiniteOrderTop (Fin n)
| 0 => IsEmpty.toLocallyFiniteOrderTop
| _ + 1 => inferInstance
variable {n} (a b : Fin n)
theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : β) b).fin n :=
rfl
#align fin.Icc_eq_finset_subtype Fin.Icc_eq_finset_subtype
theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : β) b).fin n :=
rfl
#align fin.Ico_eq_finset_subtype Fin.Ico_eq_finset_subtype
theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : β) b).fin n :=
rfl
#align fin.Ioc_eq_finset_subtype Fin.Ioc_eq_finset_subtype
theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : β) b).fin n :=
rfl
#align fin.Ioo_eq_finset_subtype Fin.Ioo_eq_finset_subtype
theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : β) b).fin n := rfl
#align fin.uIcc_eq_finset_subtype Fin.uIcc_eq_finset_subtype
@[simp]
theorem map_valEmbedding_Icc : (Icc a b).map Fin.valEmbedding = Icc βa βb := by
simp [Icc_eq_finset_subtype, Finset.fin, Finset.map_map, Icc_filter_lt_of_lt_right]
#align fin.map_subtype_embedding_Icc Fin.map_valEmbedding_Icc
@[simp]
theorem map_valEmbedding_Ico : (Ico a b).map Fin.valEmbedding = Ico βa βb := by
simp [Ico_eq_finset_subtype, Finset.fin, Finset.map_map]
#align fin.map_subtype_embedding_Ico Fin.map_valEmbedding_Ico
@[simp]
| Mathlib/Order/Interval/Finset/Fin.lean | 89 | 90 | theorem map_valEmbedding_Ioc : (Ioc a b).map Fin.valEmbedding = Ioc βa βb := by |
simp [Ioc_eq_finset_subtype, Finset.fin, Finset.map_map, Ioc_filter_lt_of_lt_right]
| [
" map valEmbedding (Icc a b) = Icc βa βb",
" map valEmbedding (Ico a b) = Ico βa βb",
" map valEmbedding (Ioc a b) = Ioc βa βb"
] | [
" map valEmbedding (Icc a b) = Icc βa βb",
" map valEmbedding (Ico a b) = Ico βa βb",
" map valEmbedding (Ioc a b) = Ioc βa βb"
] |
import Mathlib.Data.Finset.Image
#align_import data.finset.card from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
assert_not_exists MonoidWithZero
-- TODO: After a lot more work,
-- assert_not_exists OrderedCommMonoid
open Function Multiset Nat
variable {Ξ± Ξ² R : Type*}
namespace Finset
variable {s t : Finset Ξ±} {a b : Ξ±}
def card (s : Finset Ξ±) : β :=
Multiset.card s.1
#align finset.card Finset.card
theorem card_def (s : Finset Ξ±) : s.card = Multiset.card s.1 :=
rfl
#align finset.card_def Finset.card_def
@[simp] lemma card_val (s : Finset Ξ±) : Multiset.card s.1 = s.card := rfl
#align finset.card_val Finset.card_val
@[simp]
theorem card_mk {m nodup} : (β¨m, nodupβ© : Finset Ξ±).card = Multiset.card m :=
rfl
#align finset.card_mk Finset.card_mk
@[simp]
theorem card_empty : card (β
: Finset Ξ±) = 0 :=
rfl
#align finset.card_empty Finset.card_empty
@[gcongr]
theorem card_le_card : s β t β s.card β€ t.card :=
Multiset.card_le_card β val_le_iff.mpr
#align finset.card_le_of_subset Finset.card_le_card
@[mono]
theorem card_mono : Monotone (@card Ξ±) := by apply card_le_card
#align finset.card_mono Finset.card_mono
@[simp] lemma card_eq_zero : s.card = 0 β s = β
:= card_eq_zero.trans val_eq_zero
lemma card_ne_zero : s.card β 0 β s.Nonempty := card_eq_zero.ne.trans nonempty_iff_ne_empty.symm
lemma card_pos : 0 < s.card β s.Nonempty := Nat.pos_iff_ne_zero.trans card_ne_zero
#align finset.card_eq_zero Finset.card_eq_zero
#align finset.card_pos Finset.card_pos
alias β¨_, Nonempty.card_posβ© := card_pos
alias β¨_, Nonempty.card_ne_zeroβ© := card_ne_zero
#align finset.nonempty.card_pos Finset.Nonempty.card_pos
theorem card_ne_zero_of_mem (h : a β s) : s.card β 0 :=
(not_congr card_eq_zero).2 <| ne_empty_of_mem h
#align finset.card_ne_zero_of_mem Finset.card_ne_zero_of_mem
@[simp]
theorem card_singleton (a : Ξ±) : card ({a} : Finset Ξ±) = 1 :=
Multiset.card_singleton _
#align finset.card_singleton Finset.card_singleton
theorem card_singleton_inter [DecidableEq Ξ±] : ({a} β© s).card β€ 1 := by
cases' Finset.decidableMem a s with h h
Β· simp [Finset.singleton_inter_of_not_mem h]
Β· simp [Finset.singleton_inter_of_mem h]
#align finset.card_singleton_inter Finset.card_singleton_inter
@[simp]
theorem card_cons (h : a β s) : (s.cons a h).card = s.card + 1 :=
Multiset.card_cons _ _
#align finset.card_cons Finset.card_cons
section InsertErase
variable [DecidableEq Ξ±]
@[simp]
theorem card_insert_of_not_mem (h : a β s) : (insert a s).card = s.card + 1 := by
rw [β cons_eq_insert _ _ h, card_cons]
#align finset.card_insert_of_not_mem Finset.card_insert_of_not_mem
| Mathlib/Data/Finset/Card.lean | 111 | 111 | theorem card_insert_of_mem (h : a β s) : card (insert a s) = s.card := by | rw [insert_eq_of_mem h]
| [
" Monotone card",
" ({a} β© s).card β€ 1",
" (insert a s).card = s.card + 1",
" (insert a s).card = s.card"
] | [
" Monotone card",
" ({a} β© s).card β€ 1",
" (insert a s).card = s.card + 1",
" (insert a s).card = s.card"
] |
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {Ξ± : Type u} [Preorder Ξ±] {a : Ξ±} : Β¬a < a := _root_.lt_irrefl a
| Mathlib/Tactic/Linarith/Lemmas.lean | 27 | 28 | theorem eq_of_eq_of_eq {Ξ±} [OrderedSemiring Ξ±] {a b : Ξ±} (ha : a = 0) (hb : b = 0) : a + b = 0 := by |
simp [*]
| [
" a + b = 0"
] | [
" a + b = 0"
] |
import Mathlib.Combinatorics.Enumerative.DoubleCounting
import Mathlib.Combinatorics.SimpleGraph.AdjMatrix
import Mathlib.Combinatorics.SimpleGraph.Basic
import Mathlib.Data.Set.Finite
#align_import combinatorics.simple_graph.strongly_regular from "leanprover-community/mathlib"@"2b35fc7bea4640cb75e477e83f32fbd538920822"
open Finset
universe u
namespace SimpleGraph
variable {V : Type u} [Fintype V] [DecidableEq V]
variable (G : SimpleGraph V) [DecidableRel G.Adj]
structure IsSRGWith (n k β ΞΌ : β) : Prop where
card : Fintype.card V = n
regular : G.IsRegularOfDegree k
of_adj : β v w : V, G.Adj v w β Fintype.card (G.commonNeighbors v w) = β
of_not_adj : Pairwise fun v w => Β¬G.Adj v w β Fintype.card (G.commonNeighbors v w) = ΞΌ
set_option linter.uppercaseLean3 false in
#align simple_graph.is_SRG_with SimpleGraph.IsSRGWith
variable {G} {n k β ΞΌ : β}
theorem bot_strongly_regular : (β₯ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 β 0 where
card := rfl
regular := bot_degree
of_adj := fun v w h => h.elim
of_not_adj := fun v w _h => by
simp only [card_eq_zero, Fintype.card_ofFinset, forall_true_left, not_false_iff, bot_adj]
ext
simp [mem_commonNeighbors]
#align simple_graph.bot_strongly_regular SimpleGraph.bot_strongly_regular
theorem IsSRGWith.top :
(β€ : SimpleGraph V).IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) ΞΌ where
card := rfl
regular := IsRegularOfDegree.top
of_adj := fun v w h => by
rw [card_commonNeighbors_top]
exact h
of_not_adj := fun v w h h' => False.elim (h' ((top_adj v w).2 h))
set_option linter.uppercaseLean3 false in
#align simple_graph.is_SRG_with.top SimpleGraph.IsSRGWith.top
theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k β ΞΌ) :
(G.neighborFinset v βͺ G.neighborFinset w).card =
2 * k - Fintype.card (G.commonNeighbors v w) := by
apply Nat.add_right_cancel (m := Fintype.card (G.commonNeighbors v w))
rw [Nat.sub_add_cancel, β Set.toFinset_card]
-- Porting note: Set.toFinset_inter needs workaround to use unification to solve for one of the
-- instance arguments:
Β· simp [commonNeighbors, @Set.toFinset_inter _ _ _ _ _ _ (_),
β neighborFinset_def, Finset.card_union_add_card_inter, card_neighborFinset_eq_degree,
h.regular.degree_eq, two_mul]
Β· apply le_trans (card_commonNeighbors_le_degree_left _ _ _)
simp [h.regular.degree_eq, two_mul]
set_option linter.uppercaseLean3 false in
#align simple_graph.is_SRG_with.card_neighbor_finset_union_eq SimpleGraph.IsSRGWith.card_neighborFinset_union_eq
| Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean | 102 | 106 | theorem IsSRGWith.card_neighborFinset_union_of_not_adj {v w : V} (h : G.IsSRGWith n k β ΞΌ)
(hne : v β w) (ha : Β¬G.Adj v w) :
(G.neighborFinset v βͺ G.neighborFinset w).card = 2 * k - ΞΌ := by |
rw [β h.of_not_adj hne ha]
apply h.card_neighborFinset_union_eq
| [
" (fun v w => Β¬β₯.Adj v w β Fintype.card β(β₯.commonNeighbors v w) = 0) v w",
" filter (fun x => x β β₯.commonNeighbors v w) univ = β
",
" aβ β filter (fun x => x β β₯.commonNeighbors v w) univ β aβ β β
",
" Fintype.card β(β€.commonNeighbors v w) = Fintype.card V - 2",
" v β w",
" (G.neighborFinset v βͺ G.neighbo... | [
" (fun v w => Β¬β₯.Adj v w β Fintype.card β(β₯.commonNeighbors v w) = 0) v w",
" filter (fun x => x β β₯.commonNeighbors v w) univ = β
",
" aβ β filter (fun x => x β β₯.commonNeighbors v w) univ β aβ β β
",
" Fintype.card β(β€.commonNeighbors v w) = Fintype.card V - 2",
" v β w",
" (G.neighborFinset v βͺ G.neighbo... |
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]
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]
#align real.log_abs Real.log_abs
@[simp]
theorem log_neg_eq_log (x : β) : log (-x) = log x := by rw [β log_abs x, β log_abs (-x), abs_neg]
#align real.log_neg_eq_log Real.log_neg_eq_log
theorem sinh_log {x : β} (hx : 0 < x) : sinh (log x) = (x - xβ»ΒΉ) / 2 := by
rw [sinh_eq, exp_neg, exp_log hx]
#align real.sinh_log Real.sinh_log
| Mathlib/Analysis/SpecialFunctions/Log/Basic.lean | 118 | 119 | theorem cosh_log {x : β} (hx : 0 < x) : cosh (log x) = (x + xβ»ΒΉ) / 2 := by |
rw [cosh_eq, exp_neg, exp_log hx]
| [
" x.log = expOrderIso.symm β¨x, hxβ©",
" expOrderIso.symm β¨|x|, β―β© = expOrderIso.symm β¨x, hxβ©",
" |x| = x",
" rexp x.log = |x|",
" rexp x.log = x",
" rexp x.log = -x",
" |x| = -x",
" x β€ rexp x.log",
" 0 β€ 1",
" x β€ |x|",
" rexp (log 1) = rexp 0",
" |x|.log = x.log",
" (-x).log = x.log",
" x... | [
" x.log = expOrderIso.symm β¨x, hxβ©",
" expOrderIso.symm β¨|x|, β―β© = expOrderIso.symm β¨x, hxβ©",
" |x| = x",
" rexp x.log = |x|",
" rexp x.log = x",
" rexp x.log = -x",
" |x| = -x",
" x β€ rexp x.log",
" 0 β€ 1",
" x β€ |x|",
" rexp (log 1) = rexp 0",
" |x|.log = x.log",
" (-x).log = x.log",
" x... |
import Mathlib.Analysis.Convex.Hull
import Mathlib.LinearAlgebra.AffineSpace.Independent
#align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Finset Set
variable (π E : Type*) {ΞΉ : Type*} [OrderedRing π] [AddCommGroup E] [Module π E]
namespace Geometry
-- TODO: update to new binder order? not sure what binder order is correct for `down_closed`.
@[ext]
structure SimplicialComplex where
faces : Set (Finset E)
not_empty_mem : β
β faces
indep : β {s}, s β faces β AffineIndependent π ((β) : s β E)
down_closed : β {s t}, s β faces β t β s β t β β
β t β faces
inter_subset_convexHull : β {s t}, s β faces β t β faces β
convexHull π βs β© convexHull π βt β convexHull π (s β© t : Set E)
#align geometry.simplicial_complex Geometry.SimplicialComplex
namespace SimplicialComplex
variable {π E}
variable {K : SimplicialComplex π E} {s t : Finset E} {x : E}
instance : Membership (Finset E) (SimplicialComplex π E) :=
β¨fun s K => s β K.facesβ©
def space (K : SimplicialComplex π E) : Set E :=
β s β K.faces, convexHull π (s : Set E)
#align geometry.simplicial_complex.space Geometry.SimplicialComplex.space
-- Porting note: Expanded `β s β K.faces` to get the type to match more closely with Lean 3
theorem mem_space_iff : x β K.space β β s β K.faces, x β convexHull π (s : Set E) := by
simp [space]
#align geometry.simplicial_complex.mem_space_iff Geometry.SimplicialComplex.mem_space_iff
-- Porting note: Original proof was `:= subset_biUnion_of_mem hs`
theorem convexHull_subset_space (hs : s β K.faces) : convexHull π βs β K.space := by
convert subset_biUnion_of_mem hs
rfl
#align geometry.simplicial_complex.convex_hull_subset_space Geometry.SimplicialComplex.convexHull_subset_space
protected theorem subset_space (hs : s β K.faces) : (s : Set E) β K.space :=
(subset_convexHull π _).trans <| convexHull_subset_space hs
#align geometry.simplicial_complex.subset_space Geometry.SimplicialComplex.subset_space
theorem convexHull_inter_convexHull (hs : s β K.faces) (ht : t β K.faces) :
convexHull π βs β© convexHull π βt = convexHull π (s β© t : Set E) :=
(K.inter_subset_convexHull hs ht).antisymm <|
subset_inter (convexHull_mono Set.inter_subset_left) <|
convexHull_mono Set.inter_subset_right
#align geometry.simplicial_complex.convex_hull_inter_convex_hull Geometry.SimplicialComplex.convexHull_inter_convexHull
| Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean | 110 | 119 | theorem disjoint_or_exists_inter_eq_convexHull (hs : s β K.faces) (ht : t β K.faces) :
Disjoint (convexHull π (s : Set E)) (convexHull π βt) β¨
β u β K.faces, convexHull π (s : Set E) β© convexHull π βt = convexHull π βu := by |
classical
by_contra! h
refine h.2 (s β© t) (K.down_closed hs inter_subset_left fun hst => h.1 <|
disjoint_iff_inf_le.mpr <| (K.inter_subset_convexHull hs ht).trans ?_) ?_
Β· rw [β coe_inter, hst, coe_empty, convexHull_empty]
rfl
Β· rw [coe_inter, convexHull_inter_convexHull hs ht]
| [
" x β K.space β β s β K.faces, x β (convexHull π) βs",
" (convexHull π) βs β K.space",
" (convexHull π) βs = (convexHull π) βs",
" Disjoint ((convexHull π) βs) ((convexHull π) βt) β¨\n β u β K.faces, (convexHull π) βs β© (convexHull π) βt = (convexHull π) βu",
" False",
" (convexHull π) (βs β© β... | [
" x β K.space β β s β K.faces, x β (convexHull π) βs",
" (convexHull π) βs β K.space",
" (convexHull π) βs = (convexHull π) βs",
" Disjoint ((convexHull π) βs) ((convexHull π) βt) β¨\n β u β K.faces, (convexHull π) βs β© (convexHull π) βt = (convexHull π) βu"
] |
import Mathlib.Analysis.Convex.Between
import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic
import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
import Mathlib.Topology.MetricSpace.Holder
import Mathlib.Topology.MetricSpace.MetricSeparated
#align_import measure_theory.measure.hausdorff from "leanprover-community/mathlib"@"3d5c4a7a5fb0d982f97ed953161264f1dbd90ead"
open scoped NNReal ENNReal Topology
open EMetric Set Function Filter Encodable FiniteDimensional TopologicalSpace
noncomputable section
variable {ΞΉ X Y : Type*} [EMetricSpace X] [EMetricSpace Y]
namespace MeasureTheory
namespace OuterMeasure
def IsMetric (ΞΌ : OuterMeasure X) : Prop :=
β s t : Set X, IsMetricSeparated s t β ΞΌ (s βͺ t) = ΞΌ s + ΞΌ t
#align measure_theory.outer_measure.is_metric MeasureTheory.OuterMeasure.IsMetric
def mkMetric'.pre (m : Set X β ββ₯0β) (r : ββ₯0β) : OuterMeasure X :=
boundedBy <| extend fun s (_ : diam s β€ r) => m s
#align measure_theory.outer_measure.mk_metric'.pre MeasureTheory.OuterMeasure.mkMetric'.pre
def mkMetric' (m : Set X β ββ₯0β) : OuterMeasure X :=
β¨ r > 0, mkMetric'.pre m r
#align measure_theory.outer_measure.mk_metric' MeasureTheory.OuterMeasure.mkMetric'
def mkMetric (m : ββ₯0β β ββ₯0β) : OuterMeasure X :=
mkMetric' fun s => m (diam s)
#align measure_theory.outer_measure.mk_metric MeasureTheory.OuterMeasure.mkMetric
namespace mkMetric'
variable {m : Set X β ββ₯0β} {r : ββ₯0β} {ΞΌ : OuterMeasure X} {s : Set X}
| Mathlib/MeasureTheory/Measure/Hausdorff.lean | 270 | 271 | theorem le_pre : ΞΌ β€ pre m r β β s : Set X, diam s β€ r β ΞΌ s β€ m s := by |
simp only [pre, le_boundedBy, extend, le_iInf_iff]
| [
" ΞΌ β€ pre m r β β (s : Set X), diam s β€ r β ΞΌ s β€ m s"
] | [
" ΞΌ β€ pre m r β β (s : Set X), diam s β€ r β ΞΌ s β€ m s"
] |
import Mathlib.Algebra.Algebra.Subalgebra.Operations
import Mathlib.Algebra.Ring.Fin
import Mathlib.RingTheory.Ideal.Quotient
#align_import ring_theory.ideal.quotient_operations from "leanprover-community/mathlib"@"b88d81c84530450a8989e918608e5960f015e6c8"
universe u v w
namespace Ideal
open Function RingHom
variable {R : Type u} {S : Type v} {F : Type w} [CommRing R] [Semiring S]
@[simp]
theorem map_quotient_self (I : Ideal R) : map (Quotient.mk I) I = β₯ :=
eq_bot_iff.2 <|
Ideal.map_le_iff_le_comap.2 fun _ hx =>
(Submodule.mem_bot (R β§Έ I)).2 <| Ideal.Quotient.eq_zero_iff_mem.2 hx
#align ideal.map_quotient_self Ideal.map_quotient_self
@[simp]
theorem mk_ker {I : Ideal R} : ker (Quotient.mk I) = I := by
ext
rw [ker, mem_comap, Submodule.mem_bot, Quotient.eq_zero_iff_mem]
#align ideal.mk_ker Ideal.mk_ker
| Mathlib/RingTheory/Ideal/QuotientOperations.lean | 136 | 138 | theorem map_mk_eq_bot_of_le {I J : Ideal R} (h : I β€ J) : I.map (Quotient.mk J) = β₯ := by |
rw [map_eq_bot_iff_le_ker, mk_ker]
exact h
| [
" ker (Quotient.mk I) = I",
" xβ β ker (Quotient.mk I) β xβ β I",
" map (Quotient.mk J) I = β₯",
" I β€ J"
] | [
" ker (Quotient.mk I) = I",
" xβ β ker (Quotient.mk I) β xβ β I",
" map (Quotient.mk J) I = β₯"
] |
import Mathlib.MeasureTheory.Covering.VitaliFamily
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.MeasureTheory.Function.AEMeasurableOrder
import Mathlib.MeasureTheory.Integral.Lebesgue
import Mathlib.MeasureTheory.Integral.Average
import Mathlib.MeasureTheory.Decomposition.Lebesgue
#align_import measure_theory.covering.differentiation from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2"
open MeasureTheory Metric Set Filter TopologicalSpace MeasureTheory.Measure
open scoped Filter ENNReal MeasureTheory NNReal Topology
variable {Ξ± : Type*} [MetricSpace Ξ±] {m0 : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} (v : VitaliFamily ΞΌ)
{E : Type*} [NormedAddCommGroup E]
namespace VitaliFamily
noncomputable def limRatio (Ο : Measure Ξ±) (x : Ξ±) : ββ₯0β :=
limUnder (v.filterAt x) fun a => Ο a / ΞΌ a
#align vitali_family.lim_ratio VitaliFamily.limRatio
theorem ae_eventually_measure_pos [SecondCountableTopology Ξ±] :
βα΅ x βΞΌ, βαΆ a in v.filterAt x, 0 < ΞΌ a := by
set s := {x | Β¬βαΆ a in v.filterAt x, 0 < ΞΌ a} with hs
simp (config := { zeta := false }) only [not_lt, not_eventually, nonpos_iff_eq_zero] at hs
change ΞΌ s = 0
let f : Ξ± β Set (Set Ξ±) := fun _ => {a | ΞΌ a = 0}
have h : v.FineSubfamilyOn f s := by
intro x hx Ξ΅ Ξ΅pos
rw [hs] at hx
simp only [frequently_filterAt_iff, exists_prop, gt_iff_lt, mem_setOf_eq] at hx
rcases hx Ξ΅ Ξ΅pos with β¨a, a_sets, ax, ΞΌaβ©
exact β¨a, β¨a_sets, ΞΌaβ©, axβ©
refine le_antisymm ?_ bot_le
calc
ΞΌ s β€ β' x : h.index, ΞΌ (h.covering x) := h.measure_le_tsum
_ = β' x : h.index, 0 := by congr; ext1 x; exact h.covering_mem x.2
_ = 0 := by simp only [tsum_zero, add_zero]
#align vitali_family.ae_eventually_measure_pos VitaliFamily.ae_eventually_measure_pos
theorem eventually_measure_lt_top [IsLocallyFiniteMeasure ΞΌ] (x : Ξ±) :
βαΆ a in v.filterAt x, ΞΌ a < β :=
(ΞΌ.finiteAt_nhds x).eventually.filter_mono inf_le_left
#align vitali_family.eventually_measure_lt_top VitaliFamily.eventually_measure_lt_top
| Mathlib/MeasureTheory/Covering/Differentiation.lean | 125 | 149 | theorem measure_le_of_frequently_le [SecondCountableTopology Ξ±] [BorelSpace Ξ±] {Ο : Measure Ξ±}
(Ξ½ : Measure Ξ±) [IsLocallyFiniteMeasure Ξ½] (hΟ : Ο βͺ ΞΌ) (s : Set Ξ±)
(hs : β x β s, βαΆ a in v.filterAt x, Ο a β€ Ξ½ a) : Ο s β€ Ξ½ s := by |
-- this follows from a covering argument using the sets satisfying `Ο a β€ Ξ½ a`.
apply ENNReal.le_of_forall_pos_le_add fun Ξ΅ Ξ΅pos _ => ?_
obtain β¨U, sU, U_open, Ξ½Uβ© : β (U : Set Ξ±), s β U β§ IsOpen U β§ Ξ½ U β€ Ξ½ s + Ξ΅ :=
exists_isOpen_le_add s Ξ½ (ENNReal.coe_pos.2 Ξ΅pos).ne'
let f : Ξ± β Set (Set Ξ±) := fun _ => {a | Ο a β€ Ξ½ a β§ a β U}
have h : v.FineSubfamilyOn f s := by
apply v.fineSubfamilyOn_of_frequently f s fun x hx => ?_
have :=
(hs x hx).and_eventually
((v.eventually_filterAt_mem_setsAt x).and
(v.eventually_filterAt_subset_of_nhds (U_open.mem_nhds (sU hx))))
apply Frequently.mono this
rintro a β¨Οa, _, aUβ©
exact β¨Οa, aUβ©
haveI : Encodable h.index := h.index_countable.toEncodable
calc
Ο s β€ β' x : h.index, Ο (h.covering x) := h.measure_le_tsum_of_absolutelyContinuous hΟ
_ β€ β' x : h.index, Ξ½ (h.covering x) := ENNReal.tsum_le_tsum fun x => (h.covering_mem x.2).1
_ = Ξ½ (β x : h.index, h.covering x) := by
rw [measure_iUnion h.covering_disjoint_subtype fun i => h.measurableSet_u i.2]
_ β€ Ξ½ U := (measure_mono (iUnion_subset fun i => (h.covering_mem i.2).2))
_ β€ Ξ½ s + Ξ΅ := Ξ½U
| [
" βα΅ (x : Ξ±) βΞΌ, βαΆ (a : Set Ξ±) in v.filterAt x, 0 < ΞΌ a",
" ΞΌ s = 0",
" v.FineSubfamilyOn f s",
" β a β v.setsAt x β© f x, a β closedBall x Ξ΅",
" ΞΌ s β€ 0",
" β' (x : βh.index), ΞΌ (h.covering βx) = β' (x : βh.index), 0",
" (fun x => ΞΌ (h.covering βx)) = fun x => 0",
" ΞΌ (h.covering βx) = 0",
" β' (x ... | [
" βα΅ (x : Ξ±) βΞΌ, βαΆ (a : Set Ξ±) in v.filterAt x, 0 < ΞΌ a",
" ΞΌ s = 0",
" v.FineSubfamilyOn f s",
" β a β v.setsAt x β© f x, a β closedBall x Ξ΅",
" ΞΌ s β€ 0",
" β' (x : βh.index), ΞΌ (h.covering βx) = β' (x : βh.index), 0",
" (fun x => ΞΌ (h.covering βx)) = fun x => 0",
" ΞΌ (h.covering βx) = 0",
" β' (x ... |
import Mathlib.Algebra.Field.Defs
import Mathlib.Algebra.GroupWithZero.Units.Lemmas
import Mathlib.Algebra.Ring.Commute
import Mathlib.Algebra.Ring.Invertible
import Mathlib.Order.Synonym
#align_import algebra.field.basic from "leanprover-community/mathlib"@"05101c3df9d9cfe9430edc205860c79b6d660102"
open Function OrderDual Set
universe u
variable {Ξ± Ξ² K : Type*}
section DivisionMonoid
variable [DivisionMonoid K] [HasDistribNeg K] {a b : K}
theorem one_div_neg_one_eq_neg_one : (1 : K) / -1 = -1 :=
have : -1 * -1 = (1 : K) := by rw [neg_mul_neg, one_mul]
Eq.symm (eq_one_div_of_mul_eq_one_right this)
#align one_div_neg_one_eq_neg_one one_div_neg_one_eq_neg_one
theorem one_div_neg_eq_neg_one_div (a : K) : 1 / -a = -(1 / a) :=
calc
1 / -a = 1 / (-1 * a) := by rw [neg_eq_neg_one_mul]
_ = 1 / a * (1 / -1) := by rw [one_div_mul_one_div_rev]
_ = 1 / a * -1 := by rw [one_div_neg_one_eq_neg_one]
_ = -(1 / a) := by rw [mul_neg, mul_one]
#align one_div_neg_eq_neg_one_div one_div_neg_eq_neg_one_div
theorem div_neg_eq_neg_div (a b : K) : b / -a = -(b / a) :=
calc
b / -a = b * (1 / -a) := by rw [β inv_eq_one_div, division_def]
_ = b * -(1 / a) := by rw [one_div_neg_eq_neg_one_div]
_ = -(b * (1 / a)) := by rw [neg_mul_eq_mul_neg]
_ = -(b / a) := by rw [mul_one_div]
#align div_neg_eq_neg_div div_neg_eq_neg_div
theorem neg_div (a b : K) : -b / a = -(b / a) := by
rw [neg_eq_neg_one_mul, mul_div_assoc, β neg_eq_neg_one_mul]
#align neg_div neg_div
@[field_simps]
theorem neg_div' (a b : K) : -(b / a) = -b / a := by simp [neg_div]
#align neg_div' neg_div'
@[simp]
theorem neg_div_neg_eq (a b : K) : -a / -b = a / b := by rw [div_neg_eq_neg_div, neg_div, neg_neg]
#align neg_div_neg_eq neg_div_neg_eq
theorem neg_inv : -aβ»ΒΉ = (-a)β»ΒΉ := by rw [inv_eq_one_div, inv_eq_one_div, div_neg_eq_neg_div]
#align neg_inv neg_inv
theorem div_neg (a : K) : a / -b = -(a / b) := by rw [β div_neg_eq_neg_div]
#align div_neg div_neg
| Mathlib/Algebra/Field/Basic.lean | 135 | 135 | theorem inv_neg : (-a)β»ΒΉ = -aβ»ΒΉ := by | rw [neg_inv]
| [
" -1 * -1 = 1",
" 1 / -a = 1 / (-1 * a)",
" 1 / (-1 * a) = 1 / a * (1 / -1)",
" 1 / a * (1 / -1) = 1 / a * -1",
" 1 / a * -1 = -(1 / a)",
" b / -a = b * (1 / -a)",
" b * (1 / -a) = b * -(1 / a)",
" b * -(1 / a) = -(b * (1 / a))",
" -(b * (1 / a)) = -(b / a)",
" -b / a = -(b / a)",
" -(b / a) = -... | [
" -1 * -1 = 1",
" 1 / -a = 1 / (-1 * a)",
" 1 / (-1 * a) = 1 / a * (1 / -1)",
" 1 / a * (1 / -1) = 1 / a * -1",
" 1 / a * -1 = -(1 / a)",
" b / -a = b * (1 / -a)",
" b * (1 / -a) = b * -(1 / a)",
" b * -(1 / a) = -(b * (1 / a))",
" -(b * (1 / a)) = -(b / a)",
" -b / a = -(b / a)",
" -(b / a) = -... |
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order
#align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce"
open Set Filter MeasureTheory MeasurableSpace
open scoped Classical Topology NNReal ENNReal MeasureTheory
universe u v w x y
variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±}
namespace Real
theorem borel_eq_generateFrom_Ioo_rat :
borel β = .generateFrom (β (a : β) (b : β) (_ : a < b), {Ioo (a : β) (b : β)}) :=
isTopologicalBasis_Ioo_rat.borel_eq_generateFrom
#align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat
theorem borel_eq_generateFrom_Iio_rat : borel β = .generateFrom (β a : β, {Iio (a : β)}) := by
rw [borel_eq_generateFrom_Iio]
refine le_antisymm
(generateFrom_le ?_)
(generateFrom_mono <| iUnion_subset fun q β¦ singleton_subset_iff.mpr <| mem_range_self _)
rintro _ β¨a, rflβ©
have : IsLUB (range ((β) : β β β) β© Iio a) a := by
simp [isLUB_iff_le_iff, mem_upperBounds, β le_iff_forall_rat_lt_imp_le]
rw [β this.biUnion_Iio_eq, β image_univ, β image_inter_preimage, univ_inter, biUnion_image]
exact MeasurableSet.biUnion (to_countable _)
fun b _ => GenerateMeasurable.basic (Iio (b : β)) (by simp)
theorem borel_eq_generateFrom_Ioi_rat : borel β = .generateFrom (β a : β, {Ioi (a : β)}) := by
rw [borel_eq_generateFrom_Ioi]
refine le_antisymm
(generateFrom_le ?_)
(generateFrom_mono <| iUnion_subset fun q β¦ singleton_subset_iff.mpr <| mem_range_self _)
rintro _ β¨a, rflβ©
have : IsGLB (range ((β) : β β β) β© Ioi a) a := by
simp [isGLB_iff_le_iff, mem_lowerBounds, β le_iff_forall_lt_rat_imp_le]
rw [β this.biUnion_Ioi_eq, β image_univ, β image_inter_preimage, univ_inter, biUnion_image]
exact MeasurableSet.biUnion (to_countable _)
fun b _ => GenerateMeasurable.basic (Ioi (b : β)) (by simp)
theorem borel_eq_generateFrom_Iic_rat : borel β = .generateFrom (β a : β, {Iic (a : β)}) := by
rw [borel_eq_generateFrom_Ioi_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range]
refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;>
rintro _ β¨q, rflβ© <;>
dsimp only <;>
[rw [β compl_Iic]; rw [β compl_Ioi]] <;>
exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q))
theorem borel_eq_generateFrom_Ici_rat : borel β = .generateFrom (β a : β, {Ici (a : β)}) := by
rw [borel_eq_generateFrom_Iio_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range]
refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;>
rintro _ β¨q, rflβ© <;>
dsimp only <;>
[rw [β compl_Ici]; rw [β compl_Iio]] <;>
exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q))
theorem isPiSystem_Ioo_rat :
IsPiSystem (β (a : β) (b : β) (_ : a < b), {Ioo (a : β) (b : β)}) := by
convert isPiSystem_Ioo ((β) : β β β) ((β) : β β β)
ext x
simp [eq_comm]
#align real.is_pi_system_Ioo_rat Real.isPiSystem_Ioo_rat
theorem isPiSystem_Iio_rat : IsPiSystem (β a : β, {Iio (a : β)}) := by
convert isPiSystem_image_Iio (((β) : β β β) '' univ)
ext x
simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
theorem isPiSystem_Ioi_rat : IsPiSystem (β a : β, {Ioi (a : β)}) := by
convert isPiSystem_image_Ioi (((β) : β β β) '' univ)
ext x
simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
| Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean | 101 | 104 | theorem isPiSystem_Iic_rat : IsPiSystem (β a : β, {Iic (a : β)}) := by |
convert isPiSystem_image_Iic (((β) : β β β) '' univ)
ext x
simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
| [
" borel β = generateFrom (β a, {Iio βa})",
" generateFrom (range Iio) = generateFrom (β a, {Iio βa})",
" β t β range Iio, MeasurableSet t",
" MeasurableSet (Iio a)",
" IsLUB (range Rat.cast β© Iio a) a",
" MeasurableSet (β y β Rat.cast β»ΒΉ' Iio a, Iio βy)",
" Iio βb β β a, {Iio βa}",
" borel β = generat... | [
" borel β = generateFrom (β a, {Iio βa})",
" generateFrom (range Iio) = generateFrom (β a, {Iio βa})",
" β t β range Iio, MeasurableSet t",
" MeasurableSet (Iio a)",
" IsLUB (range Rat.cast β© Iio a) a",
" MeasurableSet (β y β Rat.cast β»ΒΉ' Iio a, Iio βy)",
" Iio βb β β a, {Iio βa}",
" borel β = generat... |
import Mathlib.Algebra.GroupWithZero.Indicator
import Mathlib.Topology.ContinuousOn
import Mathlib.Topology.Instances.ENNReal
#align_import topology.semicontinuous from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Topology ENNReal
open Set Function Filter
variable {Ξ± : Type*} [TopologicalSpace Ξ±] {Ξ² : Type*} [Preorder Ξ²] {f g : Ξ± β Ξ²} {x : Ξ±}
{s t : Set Ξ±} {y z : Ξ²}
def LowerSemicontinuousWithinAt (f : Ξ± β Ξ²) (s : Set Ξ±) (x : Ξ±) :=
β y < f x, βαΆ x' in π[s] x, y < f x'
#align lower_semicontinuous_within_at LowerSemicontinuousWithinAt
def LowerSemicontinuousOn (f : Ξ± β Ξ²) (s : Set Ξ±) :=
β x β s, LowerSemicontinuousWithinAt f s x
#align lower_semicontinuous_on LowerSemicontinuousOn
def LowerSemicontinuousAt (f : Ξ± β Ξ²) (x : Ξ±) :=
β y < f x, βαΆ x' in π x, y < f x'
#align lower_semicontinuous_at LowerSemicontinuousAt
def LowerSemicontinuous (f : Ξ± β Ξ²) :=
β x, LowerSemicontinuousAt f x
#align lower_semicontinuous LowerSemicontinuous
def UpperSemicontinuousWithinAt (f : Ξ± β Ξ²) (s : Set Ξ±) (x : Ξ±) :=
β y, f x < y β βαΆ x' in π[s] x, f x' < y
#align upper_semicontinuous_within_at UpperSemicontinuousWithinAt
def UpperSemicontinuousOn (f : Ξ± β Ξ²) (s : Set Ξ±) :=
β x β s, UpperSemicontinuousWithinAt f s x
#align upper_semicontinuous_on UpperSemicontinuousOn
def UpperSemicontinuousAt (f : Ξ± β Ξ²) (x : Ξ±) :=
β y, f x < y β βαΆ x' in π x, f x' < y
#align upper_semicontinuous_at UpperSemicontinuousAt
def UpperSemicontinuous (f : Ξ± β Ξ²) :=
β x, UpperSemicontinuousAt f x
#align upper_semicontinuous UpperSemicontinuous
theorem LowerSemicontinuousWithinAt.mono (h : LowerSemicontinuousWithinAt f s x) (hst : t β s) :
LowerSemicontinuousWithinAt f t x := fun y hy =>
Filter.Eventually.filter_mono (nhdsWithin_mono _ hst) (h y hy)
#align lower_semicontinuous_within_at.mono LowerSemicontinuousWithinAt.mono
theorem lowerSemicontinuousWithinAt_univ_iff :
LowerSemicontinuousWithinAt f univ x β LowerSemicontinuousAt f x := by
simp [LowerSemicontinuousWithinAt, LowerSemicontinuousAt, nhdsWithin_univ]
#align lower_semicontinuous_within_at_univ_iff lowerSemicontinuousWithinAt_univ_iff
theorem LowerSemicontinuousAt.lowerSemicontinuousWithinAt (s : Set Ξ±)
(h : LowerSemicontinuousAt f x) : LowerSemicontinuousWithinAt f s x := fun y hy =>
Filter.Eventually.filter_mono nhdsWithin_le_nhds (h y hy)
#align lower_semicontinuous_at.lower_semicontinuous_within_at LowerSemicontinuousAt.lowerSemicontinuousWithinAt
theorem LowerSemicontinuousOn.lowerSemicontinuousWithinAt (h : LowerSemicontinuousOn f s)
(hx : x β s) : LowerSemicontinuousWithinAt f s x :=
h x hx
#align lower_semicontinuous_on.lower_semicontinuous_within_at LowerSemicontinuousOn.lowerSemicontinuousWithinAt
theorem LowerSemicontinuousOn.mono (h : LowerSemicontinuousOn f s) (hst : t β s) :
LowerSemicontinuousOn f t := fun x hx => (h x (hst hx)).mono hst
#align lower_semicontinuous_on.mono LowerSemicontinuousOn.mono
theorem lowerSemicontinuousOn_univ_iff : LowerSemicontinuousOn f univ β LowerSemicontinuous f := by
simp [LowerSemicontinuousOn, LowerSemicontinuous, lowerSemicontinuousWithinAt_univ_iff]
#align lower_semicontinuous_on_univ_iff lowerSemicontinuousOn_univ_iff
theorem LowerSemicontinuous.lowerSemicontinuousAt (h : LowerSemicontinuous f) (x : Ξ±) :
LowerSemicontinuousAt f x :=
h x
#align lower_semicontinuous.lower_semicontinuous_at LowerSemicontinuous.lowerSemicontinuousAt
theorem LowerSemicontinuous.lowerSemicontinuousWithinAt (h : LowerSemicontinuous f) (s : Set Ξ±)
(x : Ξ±) : LowerSemicontinuousWithinAt f s x :=
(h x).lowerSemicontinuousWithinAt s
#align lower_semicontinuous.lower_semicontinuous_within_at LowerSemicontinuous.lowerSemicontinuousWithinAt
theorem LowerSemicontinuous.lowerSemicontinuousOn (h : LowerSemicontinuous f) (s : Set Ξ±) :
LowerSemicontinuousOn f s := fun x _hx => h.lowerSemicontinuousWithinAt s x
#align lower_semicontinuous.lower_semicontinuous_on LowerSemicontinuous.lowerSemicontinuousOn
theorem lowerSemicontinuousWithinAt_const : LowerSemicontinuousWithinAt (fun _x => z) s x :=
fun _y hy => Filter.eventually_of_forall fun _x => hy
#align lower_semicontinuous_within_at_const lowerSemicontinuousWithinAt_const
theorem lowerSemicontinuousAt_const : LowerSemicontinuousAt (fun _x => z) x := fun _y hy =>
Filter.eventually_of_forall fun _x => hy
#align lower_semicontinuous_at_const lowerSemicontinuousAt_const
theorem lowerSemicontinuousOn_const : LowerSemicontinuousOn (fun _x => z) s := fun _x _hx =>
lowerSemicontinuousWithinAt_const
#align lower_semicontinuous_on_const lowerSemicontinuousOn_const
theorem lowerSemicontinuous_const : LowerSemicontinuous fun _x : Ξ± => z := fun _x =>
lowerSemicontinuousAt_const
#align lower_semicontinuous_const lowerSemicontinuous_const
section
variable [Zero Ξ²]
| Mathlib/Topology/Semicontinuous.lean | 213 | 220 | theorem IsOpen.lowerSemicontinuous_indicator (hs : IsOpen s) (hy : 0 β€ y) :
LowerSemicontinuous (indicator s fun _x => y) := by |
intro x z hz
by_cases h : x β s <;> simp [h] at hz
Β· filter_upwards [hs.mem_nhds h]
simp (config := { contextual := true }) [hz]
Β· refine Filter.eventually_of_forall fun x' => ?_
by_cases h' : x' β s <;> simp [h', hz.trans_le hy, hz]
| [
" LowerSemicontinuousWithinAt f univ x β LowerSemicontinuousAt f x",
" LowerSemicontinuousOn f univ β LowerSemicontinuous f",
" LowerSemicontinuous (s.indicator fun _x => y)",
" βαΆ (x' : Ξ±) in π x, z < s.indicator (fun _x => y) x'",
" β a β s, z < s.indicator (fun _x => y) a",
" z < s.indicator (fun _x =... | [
" LowerSemicontinuousWithinAt f univ x β LowerSemicontinuousAt f x",
" LowerSemicontinuousOn f univ β LowerSemicontinuous f",
" LowerSemicontinuous (s.indicator fun _x => y)"
] |
import Mathlib.Algebra.Order.CauSeq.Basic
#align_import data.real.cau_seq_completion from "leanprover-community/mathlib"@"cf4c49c445991489058260d75dae0ff2b1abca28"
variable {Ξ± : Type*} [LinearOrderedField Ξ±]
namespace CauSeq
section
variable (Ξ² : Type*) [Ring Ξ²] (abv : Ξ² β Ξ±) [IsAbsoluteValue abv]
class IsComplete : Prop where
isComplete : β s : CauSeq Ξ² abv, β b : Ξ², s β const abv b
#align cau_seq.is_complete CauSeq.IsComplete
#align cau_seq.is_complete.is_complete CauSeq.IsComplete.isComplete
end
section
variable {Ξ² : Type*} [Ring Ξ²] {abv : Ξ² β Ξ±} [IsAbsoluteValue abv]
variable [IsComplete Ξ² abv]
theorem complete : β s : CauSeq Ξ² abv, β b : Ξ², s β const abv b :=
IsComplete.isComplete
#align cau_seq.complete CauSeq.complete
noncomputable def lim (s : CauSeq Ξ² abv) : Ξ² :=
Classical.choose (complete s)
#align cau_seq.lim CauSeq.lim
theorem equiv_lim (s : CauSeq Ξ² abv) : s β const abv (lim s) :=
Classical.choose_spec (complete s)
#align cau_seq.equiv_lim CauSeq.equiv_lim
theorem eq_lim_of_const_equiv {f : CauSeq Ξ² abv} {x : Ξ²} (h : CauSeq.const abv x β f) : x = lim f :=
const_equiv.mp <| Setoid.trans h <| equiv_lim f
#align cau_seq.eq_lim_of_const_equiv CauSeq.eq_lim_of_const_equiv
theorem lim_eq_of_equiv_const {f : CauSeq Ξ² abv} {x : Ξ²} (h : f β CauSeq.const abv x) : lim f = x :=
(eq_lim_of_const_equiv <| Setoid.symm h).symm
#align cau_seq.lim_eq_of_equiv_const CauSeq.lim_eq_of_equiv_const
theorem lim_eq_lim_of_equiv {f g : CauSeq Ξ² abv} (h : f β g) : lim f = lim g :=
lim_eq_of_equiv_const <| Setoid.trans h <| equiv_lim g
#align cau_seq.lim_eq_lim_of_equiv CauSeq.lim_eq_lim_of_equiv
@[simp]
theorem lim_const (x : Ξ²) : lim (const abv x) = x :=
lim_eq_of_equiv_const <| Setoid.refl _
#align cau_seq.lim_const CauSeq.lim_const
theorem lim_add (f g : CauSeq Ξ² abv) : lim f + lim g = lim (f + g) :=
eq_lim_of_const_equiv <|
show LimZero (const abv (lim f + lim g) - (f + g)) by
rw [const_add, add_sub_add_comm]
exact add_limZero (Setoid.symm (equiv_lim f)) (Setoid.symm (equiv_lim g))
#align cau_seq.lim_add CauSeq.lim_add
theorem lim_mul_lim (f g : CauSeq Ξ² abv) : lim f * lim g = lim (f * g) :=
eq_lim_of_const_equiv <|
show LimZero (const abv (lim f * lim g) - f * g) by
have h :
const abv (lim f * lim g) - f * g =
(const abv (lim f) - f) * g + const abv (lim f) * (const abv (lim g) - g) := by
apply Subtype.ext
rw [coe_add]
simp [sub_mul, mul_sub]
rw [h]
exact
add_limZero (mul_limZero_left _ (Setoid.symm (equiv_lim _)))
(mul_limZero_right _ (Setoid.symm (equiv_lim _)))
#align cau_seq.lim_mul_lim CauSeq.lim_mul_lim
theorem lim_mul (f : CauSeq Ξ² abv) (x : Ξ²) : lim f * x = lim (f * const abv x) := by
rw [β lim_mul_lim, lim_const]
#align cau_seq.lim_mul CauSeq.lim_mul
theorem lim_neg (f : CauSeq Ξ² abv) : lim (-f) = -lim f :=
lim_eq_of_equiv_const
(show LimZero (-f - const abv (-lim f)) by
rw [const_neg, sub_neg_eq_add, add_comm, β sub_eq_add_neg]
exact Setoid.symm (equiv_lim f))
#align cau_seq.lim_neg CauSeq.lim_neg
theorem lim_eq_zero_iff (f : CauSeq Ξ² abv) : lim f = 0 β LimZero f :=
β¨fun h => by
have hf := equiv_lim f
rw [h] at hf
exact (limZero_congr hf).mpr (const_limZero.mpr rfl),
fun h => by
have hβ : f = f - const abv 0 := ext fun n => by simp [sub_apply, const_apply]
rw [hβ] at h
exact lim_eq_of_equiv_const hβ©
#align cau_seq.lim_eq_zero_iff CauSeq.lim_eq_zero_iff
end
section
variable {Ξ² : Type*} [Field Ξ²] {abv : Ξ² β Ξ±} [IsAbsoluteValue abv] [IsComplete Ξ² abv]
| Mathlib/Algebra/Order/CauSeq/Completion.lean | 413 | 436 | theorem lim_inv {f : CauSeq Ξ² abv} (hf : Β¬LimZero f) : lim (inv f hf) = (lim f)β»ΒΉ :=
have hl : lim f β 0 := by | rwa [β lim_eq_zero_iff] at hf
lim_eq_of_equiv_const <|
show LimZero (inv f hf - const abv (lim f)β»ΒΉ) from
have hβ : β (g f : CauSeq Ξ² abv) (hf : Β¬LimZero f), LimZero (g - f * inv f hf * g) :=
fun g f hf => by
have hβ : g - f * inv f hf * g = 1 * g - f * inv f hf * g := by rw [one_mul g]
have hβ : f * inv f hf * g = (f * inv f hf) * g := by simp [mul_assoc]
have hβ : g - f * inv f hf * g = (1 - f * inv f hf) * g := by rw [hβ, hβ, β sub_mul]
have hβ
: g - f * inv f hf * g = g * (1 - f * inv f hf) := by rw [hβ, mul_comm]
have hβ : g - f * inv f hf * g = g * (1 - inv f hf * f) := by rw [hβ
, mul_comm f]
rw [hβ]; exact mul_limZero_right _ (Setoid.symm (CauSeq.inv_mul_cancel _))
have hβ :
LimZero
(inv f hf - const abv (lim f)β»ΒΉ -
(const abv (lim f) - f) * (inv f hf * const abv (lim f)β»ΒΉ)) := by
rw [sub_mul, β sub_add, sub_sub, sub_add_eq_sub_sub, sub_right_comm, sub_add]
show LimZero
(inv f hf - const abv (lim f) * (inv f hf * const abv (lim f)β»ΒΉ) -
(const abv (lim f)β»ΒΉ - f * (inv f hf * const abv (lim f)β»ΒΉ)))
exact sub_limZero
(by rw [β mul_assoc, mul_right_comm, const_inv hl]; exact hβ _ _ _)
(by rw [β mul_assoc]; exact hβ _ _ _)
(limZero_congr hβ).mpr <| mul_limZero_left _ (Setoid.symm (equiv_lim f))
| [
" (const abv (f.lim + g.lim) - (f + g)).LimZero",
" (const abv f.lim - f + (const abv g.lim - g)).LimZero",
" (const abv (f.lim * g.lim) - f * g).LimZero",
" const abv (f.lim * g.lim) - f * g = (const abv f.lim - f) * g + const abv f.lim * (const abv g.lim - g)",
" β(const abv (f.lim * g.lim) - f * g) = β((... | [
" (const abv (f.lim + g.lim) - (f + g)).LimZero",
" (const abv f.lim - f + (const abv g.lim - g)).LimZero",
" (const abv (f.lim * g.lim) - f * g).LimZero",
" const abv (f.lim * g.lim) - f * g = (const abv f.lim - f) * g + const abv f.lim * (const abv g.lim - g)",
" β(const abv (f.lim * g.lim) - f * g) = β((... |
import Mathlib.Algebra.Homology.ShortComplex.ModuleCat
import Mathlib.RepresentationTheory.GroupCohomology.Basic
import Mathlib.RepresentationTheory.Invariants
universe v u
noncomputable section
open CategoryTheory Limits Representation
variable {k G : Type u} [CommRing k] [Group G] (A : Rep k G)
namespace groupCohomology
section IsMulCocycle
section
variable {G M : Type*} [Mul G] [CommGroup M] [SMul G M]
def IsMulOneCocycle (f : G β M) : Prop := β g h : G, f (g * h) = g β’ f h * f g
def IsMulTwoCocycle (f : G Γ G β M) : Prop :=
β g h j : G, f (g * h, j) * f (g, h) = g β’ (f (h, j)) * f (g, h * j)
end
section
variable {G M : Type*} [Monoid G] [CommGroup M] [MulAction G M]
theorem map_one_of_isMulOneCocycle {f : G β M} (hf : IsMulOneCocycle f) :
f 1 = 1 := by
simpa only [mul_one, one_smul, self_eq_mul_right] using hf 1 1
theorem map_one_fst_of_isMulTwoCocycle {f : G Γ G β M} (hf : IsMulTwoCocycle f) (g : G) :
f (1, g) = f (1, 1) := by
simpa only [one_smul, one_mul, mul_one, mul_right_inj] using (hf 1 1 g).symm
theorem map_one_snd_of_isMulTwoCocycle {f : G Γ G β M} (hf : IsMulTwoCocycle f) (g : G) :
f (g, 1) = g β’ f (1, 1) := by
simpa only [mul_one, mul_left_inj] using hf g 1 1
end
section
variable {G M : Type*} [Group G] [CommGroup M] [MulAction G M]
@[simp] theorem map_inv_of_isMulOneCocycle {f : G β M} (hf : IsMulOneCocycle f) (g : G) :
g β’ f gβ»ΒΉ = (f g)β»ΒΉ := by
rw [β mul_eq_one_iff_eq_inv, β map_one_of_isMulOneCocycle hf, β mul_inv_self g, hf g gβ»ΒΉ]
| Mathlib/RepresentationTheory/GroupCohomology/LowDegree.lean | 546 | 551 | theorem smul_map_inv_div_map_inv_of_isMulTwoCocycle
{f : G Γ G β M} (hf : IsMulTwoCocycle f) (g : G) :
g β’ f (gβ»ΒΉ, g) / f (g, gβ»ΒΉ) = f (1, 1) / f (g, 1) := by |
have := hf g gβ»ΒΉ g
simp only [mul_right_inv, mul_left_inv, map_one_fst_of_isMulTwoCocycle hf g] at this
exact div_eq_div_iff_mul_eq_mul.2 this.symm
| [
" f 1 = 1",
" f (1, g) = f (1, 1)",
" f (g, 1) = g β’ f (1, 1)",
" g β’ f gβ»ΒΉ = (f g)β»ΒΉ",
" g β’ f (gβ»ΒΉ, g) / f (g, gβ»ΒΉ) = f (1, 1) / f (g, 1)"
] | [
" f 1 = 1",
" f (1, g) = f (1, 1)",
" f (g, 1) = g β’ f (1, 1)",
" g β’ f gβ»ΒΉ = (f g)β»ΒΉ",
" g β’ f (gβ»ΒΉ, g) / f (g, gβ»ΒΉ) = f (1, 1) / f (g, 1)"
] |
import Mathlib.Algebra.Order.Ring.Int
#align_import data.int.least_greatest from "leanprover-community/mathlib"@"3342d1b2178381196f818146ff79bc0e7ccd9e2d"
namespace Int
def leastOfBdd {P : β€ β Prop} [DecidablePred P] (b : β€) (Hb : β z : β€, P z β b β€ z)
(Hinh : β z : β€, P z) : { lb : β€ // P lb β§ β z : β€, P z β lb β€ z } :=
have EX : β n : β, P (b + n) :=
let β¨elt, Heltβ© := Hinh
match elt, le.dest (Hb _ Helt), Helt with
| _, β¨n, rflβ©, Hn => β¨n, Hnβ©
β¨b + (Nat.find EX : β€), Nat.find_spec EX, fun z h =>
match z, le.dest (Hb _ h), h with
| _, β¨_, rflβ©, h => add_le_add_left (Int.ofNat_le.2 <| Nat.find_min' _ h) _β©
#align int.least_of_bdd Int.leastOfBdd
| Mathlib/Data/Int/LeastGreatest.lean | 61 | 68 | theorem exists_least_of_bdd
{P : β€ β Prop}
(Hbdd : β b : β€ , β z : β€ , P z β b β€ z)
(Hinh : β z : β€ , P z) : β lb : β€ , P lb β§ β z : β€ , P z β lb β€ z := by |
classical
let β¨b , Hbβ© := Hbdd
let β¨lb , Hβ© := leastOfBdd b Hb Hinh
exact β¨lb , Hβ©
| [
" β lb, P lb β§ β (z : β€), P z β lb β€ z"
] | [
" β lb, P lb β§ β (z : β€), P z β lb β€ z"
] |
import Mathlib.GroupTheory.QuotientGroup
import Mathlib.GroupTheory.Solvable
import Mathlib.GroupTheory.PGroup
import Mathlib.GroupTheory.Sylow
import Mathlib.Data.Nat.Factorization.Basic
import Mathlib.Tactic.TFAE
#align_import group_theory.nilpotent from "leanprover-community/mathlib"@"2bbc7e3884ba234309d2a43b19144105a753292e"
open Subgroup
section WithGroup
variable {G : Type*} [Group G] (H : Subgroup G) [Normal H]
def upperCentralSeriesStep : Subgroup G where
carrier := { x : G | β y : G, x * y * xβ»ΒΉ * yβ»ΒΉ β H }
one_mem' y := by simp [Subgroup.one_mem]
mul_mem' {a b ha hb y} := by
convert Subgroup.mul_mem _ (ha (b * y * bβ»ΒΉ)) (hb y) using 1
group
inv_mem' {x hx y} := by
specialize hx yβ»ΒΉ
rw [mul_assoc, inv_inv] at hx β’
exact Subgroup.Normal.mem_comm inferInstance hx
#align upper_central_series_step upperCentralSeriesStep
theorem mem_upperCentralSeriesStep (x : G) :
x β upperCentralSeriesStep H β β y, x * y * xβ»ΒΉ * yβ»ΒΉ β H := Iff.rfl
#align mem_upper_central_series_step mem_upperCentralSeriesStep
open QuotientGroup
| Mathlib/GroupTheory/Nilpotent.lean | 112 | 119 | theorem upperCentralSeriesStep_eq_comap_center :
upperCentralSeriesStep H = Subgroup.comap (mk' H) (center (G β§Έ H)) := by |
ext
rw [mem_comap, mem_center_iff, forall_mk]
apply forall_congr'
intro y
rw [coe_mk', β QuotientGroup.mk_mul, β QuotientGroup.mk_mul, eq_comm, eq_iff_div_mem,
div_eq_mul_inv, mul_inv_rev, mul_assoc]
| [
" a * b * y * (a * b)β»ΒΉ * yβ»ΒΉ β H",
" a * b * y * (a * b)β»ΒΉ * yβ»ΒΉ = a * (b * y * bβ»ΒΉ) * aβ»ΒΉ * (b * y * bβ»ΒΉ)β»ΒΉ * (b * y * bβ»ΒΉ * yβ»ΒΉ)",
" 1 * y * 1β»ΒΉ * yβ»ΒΉ β H",
" xβ»ΒΉ * y * xβ»ΒΉβ»ΒΉ * yβ»ΒΉ β H",
" xβ»ΒΉ * y * (x * yβ»ΒΉ) β H",
" upperCentralSeriesStep H = comap (mk' H) (center (G β§Έ H))",
" xβ β upperCentralSerie... | [
" a * b * y * (a * b)β»ΒΉ * yβ»ΒΉ β H",
" a * b * y * (a * b)β»ΒΉ * yβ»ΒΉ = a * (b * y * bβ»ΒΉ) * aβ»ΒΉ * (b * y * bβ»ΒΉ)β»ΒΉ * (b * y * bβ»ΒΉ * yβ»ΒΉ)",
" 1 * y * 1β»ΒΉ * yβ»ΒΉ β H",
" xβ»ΒΉ * y * xβ»ΒΉβ»ΒΉ * yβ»ΒΉ β H",
" xβ»ΒΉ * y * (x * yβ»ΒΉ) β H",
" upperCentralSeriesStep H = comap (mk' H) (center (G β§Έ H))"
] |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
#align nat.xgcd_aux_rec Nat.xgcdAux_rec
def xgcd (x y : β) : β€ Γ β€ :=
(xgcdAux x 1 0 y 0 1).2
#align nat.xgcd Nat.xgcd
def gcdA (x y : β) : β€ :=
(xgcd x y).1
#align nat.gcd_a Nat.gcdA
def gcdB (x y : β) : β€ :=
(xgcd x y).2
#align nat.gcd_b Nat.gcdB
@[simp]
theorem gcdA_zero_left {s : β} : gcdA 0 s = 0 := by
unfold gcdA
rw [xgcd, xgcd_zero_left]
#align nat.gcd_a_zero_left Nat.gcdA_zero_left
@[simp]
theorem gcdB_zero_left {s : β} : gcdB 0 s = 1 := by
unfold gcdB
rw [xgcd, xgcd_zero_left]
#align nat.gcd_b_zero_left Nat.gcdB_zero_left
@[simp]
theorem gcdA_zero_right {s : β} (h : s β 0) : gcdA s 0 = 1 := by
unfold gcdA xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_a_zero_right Nat.gcdA_zero_right
@[simp]
theorem gcdB_zero_right {s : β} (h : s β 0) : gcdB s 0 = 0 := by
unfold gcdB xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_b_zero_right Nat.gcdB_zero_right
@[simp]
theorem xgcdAux_fst (x y) : β s t s' t', (xgcdAux x s t y s' t').1 = gcd x y :=
gcd.induction x y (by simp) fun x y h IH s t s' t' => by
simp only [h, xgcdAux_rec, IH]
rw [β gcd_rec]
#align nat.xgcd_aux_fst Nat.xgcdAux_fst
theorem xgcdAux_val (x y) : xgcdAux x 1 0 y 0 1 = (gcd x y, xgcd x y) := by
rw [xgcd, β xgcdAux_fst x y 1 0 0 1]
#align nat.xgcd_aux_val Nat.xgcdAux_val
theorem xgcd_val (x y) : xgcd x y = (gcdA x y, gcdB x y) := by
unfold gcdA gcdB; cases xgcd x y; rfl
#align nat.xgcd_val Nat.xgcd_val
section
variable (x y : β)
private def P : β Γ β€ Γ β€ β Prop
| (r, s, t) => (r : β€) = x * s + y * t
theorem xgcdAux_P {r r'} :
β {s t s' t'}, P x y (r, s, t) β P x y (r', s', t') β P x y (xgcdAux r s t r' s' t') := by
induction r, r' using gcd.induction with
| H0 => simp
| H1 a b h IH =>
intro s t s' t' p p'
rw [xgcdAux_rec h]; refine IH ?_ p; dsimp [P] at *
rw [Int.emod_def]; generalize (b / a : β€) = k
rw [p, p', Int.mul_sub, sub_add_eq_add_sub, Int.mul_sub, Int.add_mul, mul_comm k t,
mul_comm k s, β mul_assoc, β mul_assoc, add_comm (x * s * k), β add_sub_assoc, sub_sub]
set_option linter.uppercaseLean3 false in
#align nat.xgcd_aux_P Nat.xgcdAux_P
theorem gcd_eq_gcd_ab : (gcd x y : β€) = x * gcdA x y + y * gcdB x y := by
have := @xgcdAux_P x y x y 1 0 0 1 (by simp [P]) (by simp [P])
rwa [xgcdAux_val, xgcd_val] at this
#align nat.gcd_eq_gcd_ab Nat.gcd_eq_gcd_ab
end
| Mathlib/Data/Int/GCD.lean | 146 | 154 | theorem exists_mul_emod_eq_gcd {k n : β} (hk : gcd n k < k) : β m, n * m % k = gcd n k := by |
have hk' := Int.ofNat_ne_zero.2 (ne_of_gt (lt_of_le_of_lt (zero_le (gcd n k)) hk))
have key := congr_arg (fun (m : β€) => (m % k).toNat) (gcd_eq_gcd_ab n k)
simp only at key
rw [Int.add_mul_emod_self_left, β Int.natCast_mod, Int.toNat_natCast, mod_eq_of_lt hk] at key
refine β¨(n.gcdA k % k).toNat, Eq.trans (Int.ofNat.inj ?_) key.symmβ©
rw [Int.ofNat_eq_coe, Int.natCast_mod, Int.ofNat_mul, Int.toNat_of_nonneg (Int.emod_nonneg _ hk'),
Int.ofNat_eq_coe, Int.toNat_of_nonneg (Int.emod_nonneg _ hk'), Int.mul_emod, Int.emod_emod,
β Int.mul_emod]
| [
" (invImage\n (fun x =>\n PSigma.casesOn x fun a a_1 =>\n PSigma.casesOn a_1 fun a_2 a_3 =>\n PSigma.casesOn a_3 fun a_4 a_5 => PSigma.casesOn a_5 fun a_6 a_7 => PSigma.casesOn a_7 fun a_8 a_9 => a)\n instWellFoundedRelationOfSizeOf).1\n β¨r' % k.succ, β¨s' - βq * s, ... | [
" (invImage\n (fun x =>\n PSigma.casesOn x fun a a_1 =>\n PSigma.casesOn a_1 fun a_2 a_3 =>\n PSigma.casesOn a_3 fun a_4 a_5 => PSigma.casesOn a_5 fun a_6 a_7 => PSigma.casesOn a_7 fun a_8 a_9 => a)\n instWellFoundedRelationOfSizeOf).1\n β¨r' % k.succ, β¨s' - βq * s, ... |
import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties
import Mathlib.RingTheory.RingHom.FiniteType
#align_import algebraic_geometry.morphisms.finite_type from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe v u
namespace AlgebraicGeometry
variable {X Y : Scheme.{u}} (f : X βΆ Y)
@[mk_iff]
class LocallyOfFiniteType (f : X βΆ Y) : Prop where
finiteType_of_affine_subset :
β (U : Y.affineOpens) (V : X.affineOpens) (e : V.1 β€ (Opens.map f.1.base).obj U.1),
(Scheme.Hom.appLe f e).FiniteType
#align algebraic_geometry.locally_of_finite_type AlgebraicGeometry.LocallyOfFiniteType
theorem locallyOfFiniteType_eq : @LocallyOfFiniteType = affineLocally @RingHom.FiniteType := by
ext X Y f
rw [locallyOfFiniteType_iff, affineLocally_iff_affineOpens_le]
exact RingHom.finiteType_respectsIso
#align algebraic_geometry.locally_of_finite_type_eq AlgebraicGeometry.locallyOfFiniteType_eq
instance (priority := 900) locallyOfFiniteTypeOfIsOpenImmersion {X Y : Scheme} (f : X βΆ Y)
[IsOpenImmersion f] : LocallyOfFiniteType f :=
locallyOfFiniteType_eq.symm βΈ RingHom.finiteType_is_local.affineLocally_of_isOpenImmersion f
#align algebraic_geometry.locally_of_finite_type_of_is_open_immersion AlgebraicGeometry.locallyOfFiniteTypeOfIsOpenImmersion
instance locallyOfFiniteType_isStableUnderComposition :
MorphismProperty.IsStableUnderComposition @LocallyOfFiniteType :=
locallyOfFiniteType_eq.symm βΈ RingHom.finiteType_is_local.affineLocally_isStableUnderComposition
#align algebraic_geometry.locally_of_finite_type_stable_under_composition AlgebraicGeometry.locallyOfFiniteType_isStableUnderComposition
instance locallyOfFiniteTypeComp {X Y Z : Scheme} (f : X βΆ Y) (g : Y βΆ Z)
[hf : LocallyOfFiniteType f] [hg : LocallyOfFiniteType g] : LocallyOfFiniteType (f β« g) :=
MorphismProperty.comp_mem _ f g hf hg
#align algebraic_geometry.locally_of_finite_type_comp AlgebraicGeometry.locallyOfFiniteTypeComp
| Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean | 65 | 71 | theorem locallyOfFiniteTypeOfComp {X Y Z : Scheme} (f : X βΆ Y) (g : Y βΆ Z)
[hf : LocallyOfFiniteType (f β« g)] : LocallyOfFiniteType f := by |
revert hf
rw [locallyOfFiniteType_eq]
apply RingHom.finiteType_is_local.affineLocally_of_comp
introv H
exact RingHom.FiniteType.of_comp_finiteType H
| [
" @LocallyOfFiniteType = affineLocally @RingHom.FiniteType",
" LocallyOfFiniteType f β affineLocally (@RingHom.FiniteType) f",
" RingHom.RespectsIso @RingHom.FiniteType",
" LocallyOfFiniteType f",
" β [hf : LocallyOfFiniteType (f β« g)], LocallyOfFiniteType f",
" β [hf : affineLocally (@RingHom.FiniteType)... | [
" @LocallyOfFiniteType = affineLocally @RingHom.FiniteType",
" LocallyOfFiniteType f β affineLocally (@RingHom.FiniteType) f",
" RingHom.RespectsIso @RingHom.FiniteType",
" LocallyOfFiniteType f"
] |
import Mathlib.GroupTheory.Abelianization
import Mathlib.GroupTheory.Exponent
import Mathlib.GroupTheory.Transfer
#align_import group_theory.schreier from "leanprover-community/mathlib"@"8350c34a64b9bc3fc64335df8006bffcadc7baa6"
open scoped Pointwise
namespace Subgroup
open MemRightTransversals
variable {G : Type*} [Group G] {H : Subgroup G} {R S : Set G}
theorem closure_mul_image_mul_eq_top
(hR : R β rightTransversals (H : Set G)) (hR1 : (1 : G) β R) (hS : closure S = β€) :
(closure ((R * S).image fun g => g * (toFun hR g : G)β»ΒΉ)) * R = β€ := by
let f : G β R := fun g => toFun hR g
let U : Set G := (R * S).image fun g => g * (f g : G)β»ΒΉ
change (closure U : Set G) * R = β€
refine top_le_iff.mp fun g _ => ?_
refine closure_induction_right ?_ ?_ ?_ (eq_top_iff.mp hS (mem_top g))
Β· exact β¨1, (closure U).one_mem, 1, hR1, one_mul 1β©
Β· rintro - - s hs β¨u, hu, r, hr, rflβ©
rw [show u * r * s = u * (r * s * (f (r * s) : G)β»ΒΉ) * f (r * s) by group]
refine Set.mul_mem_mul ((closure U).mul_mem hu ?_) (f (r * s)).coe_prop
exact subset_closure β¨r * s, Set.mul_mem_mul hr hs, rflβ©
Β· rintro - - s hs β¨u, hu, r, hr, rflβ©
rw [show u * r * sβ»ΒΉ = u * (f (r * sβ»ΒΉ) * s * rβ»ΒΉ)β»ΒΉ * f (r * sβ»ΒΉ) by group]
refine Set.mul_mem_mul ((closure U).mul_mem hu ((closure U).inv_mem ?_)) (f (r * sβ»ΒΉ)).2
refine subset_closure β¨f (r * sβ»ΒΉ) * s, Set.mul_mem_mul (f (r * sβ»ΒΉ)).2 hs, ?_β©
rw [mul_right_inj, inv_inj, β Subtype.coe_mk r hr, β Subtype.ext_iff, Subtype.coe_mk]
apply (mem_rightTransversals_iff_existsUnique_mul_inv_mem.mp hR (f (r * sβ»ΒΉ) * s)).unique
(mul_inv_toFun_mem hR (f (r * sβ»ΒΉ) * s))
rw [mul_assoc, β inv_inv s, β mul_inv_rev, inv_inv]
exact toFun_mul_inv_mem hR (r * sβ»ΒΉ)
#align subgroup.closure_mul_image_mul_eq_top Subgroup.closure_mul_image_mul_eq_top
| Mathlib/GroupTheory/Schreier.lean | 64 | 79 | theorem closure_mul_image_eq (hR : R β rightTransversals (H : Set G)) (hR1 : (1 : G) β R)
(hS : closure S = β€) : closure ((R * S).image fun g => g * (toFun hR g : G)β»ΒΉ) = H := by |
have hU : closure ((R * S).image fun g => g * (toFun hR g : G)β»ΒΉ) β€ H := by
rw [closure_le]
rintro - β¨g, -, rflβ©
exact mul_inv_toFun_mem hR g
refine le_antisymm hU fun h hh => ?_
obtain β¨g, hg, r, hr, rflβ© :=
show h β _ from eq_top_iff.mp (closure_mul_image_mul_eq_top hR hR1 hS) (mem_top h)
suffices (β¨r, hrβ© : R) = (β¨1, hR1β© : R) by
simpa only [show r = 1 from Subtype.ext_iff.mp this, mul_one]
apply (mem_rightTransversals_iff_existsUnique_mul_inv_mem.mp hR r).unique
Β· rw [Subtype.coe_mk, mul_inv_self]
exact H.one_mem
Β· rw [Subtype.coe_mk, inv_one, mul_one]
exact (H.mul_mem_cancel_left (hU hg)).mp hh
| [
" β(closure ((fun g => g * (β(toFun hR g))β»ΒΉ) '' (R * S))) * R = β€",
" β(closure U) * R = β€",
" g β β(closure U) * R",
" 1 β β(closure U) * R",
" β x β closure S, β y β S, x β β(closure U) * R β x * y β β(closure U) * R",
" (fun x x_1 => x * x_1) u r * s β β(closure U) * R",
" u * r * s = u * (r * s * (... | [
" β(closure ((fun g => g * (β(toFun hR g))β»ΒΉ) '' (R * S))) * R = β€",
" β(closure U) * R = β€",
" g β β(closure U) * R",
" 1 β β(closure U) * R",
" β x β closure S, β y β S, x β β(closure U) * R β x * y β β(closure U) * R",
" (fun x x_1 => x * x_1) u r * s β β(closure U) * R",
" u * r * s = u * (r * s * (... |
import Mathlib.Analysis.Convolution
import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd
import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup
import Mathlib.Analysis.Analytic.IsolatedZeros
import Mathlib.Analysis.Complex.CauchyIntegral
#align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090"
noncomputable section
set_option linter.uppercaseLean3 false
open Filter intervalIntegral Set Real MeasureTheory
open scoped Nat Topology Real
section BetaIntegral
namespace Complex
noncomputable def betaIntegral (u v : β) : β :=
β« x : β in (0)..1, (x : β) ^ (u - 1) * (1 - (x : β)) ^ (v - 1)
#align complex.beta_integral Complex.betaIntegral
| Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean | 63 | 76 | theorem betaIntegral_convergent_left {u : β} (hu : 0 < re u) (v : β) :
IntervalIntegrable (fun x =>
(x : β) ^ (u - 1) * (1 - (x : β)) ^ (v - 1) : β β β) volume 0 (1 / 2) := by |
apply IntervalIntegrable.mul_continuousOn
Β· refine intervalIntegral.intervalIntegrable_cpow' ?_
rwa [sub_re, one_re, β zero_sub, sub_lt_sub_iff_right]
Β· apply ContinuousAt.continuousOn
intro x hx
rw [uIcc_of_le (by positivity : (0 : β) β€ 1 / 2)] at hx
apply ContinuousAt.cpow
Β· exact (continuous_const.sub continuous_ofReal).continuousAt
Β· exact continuousAt_const
Β· norm_cast
exact ofReal_mem_slitPlane.2 <| by linarith only [hx.2]
| [
" IntervalIntegrable (fun x => βx ^ (u - 1) * (1 - βx) ^ (v - 1)) volume 0 (1 / 2)",
" IntervalIntegrable (fun x => βx ^ (u - 1)) volume 0 (1 / 2)",
" -1 < (u - 1).re",
" ContinuousOn (fun x => (1 - βx) ^ (v - 1)) (uIcc 0 (1 / 2))",
" β x β uIcc 0 (1 / 2), ContinuousAt (fun x => (1 - βx) ^ (v - 1)) x",
" ... | [
" IntervalIntegrable (fun x => βx ^ (u - 1) * (1 - βx) ^ (v - 1)) volume 0 (1 / 2)"
] |
import Mathlib.Topology.Homotopy.Basic
import Mathlib.Topology.Connected.PathConnected
import Mathlib.Analysis.Convex.Basic
#align_import topology.homotopy.path from "leanprover-community/mathlib"@"bb9d1c5085e0b7ea619806a68c5021927cecb2a6"
universe u v
variable {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y]
variable {xβ xβ xβ xβ : X}
noncomputable section
open unitInterval
namespace Path
abbrev Homotopy (pβ pβ : Path xβ xβ) :=
ContinuousMap.HomotopyRel pβ.toContinuousMap pβ.toContinuousMap {0, 1}
#align path.homotopy Path.Homotopy
namespace Homotopy
section
variable {pβ pβ : Path xβ xβ}
theorem coeFn_injective : @Function.Injective (Homotopy pβ pβ) (I Γ I β X) (β) :=
DFunLike.coe_injective
#align path.homotopy.coe_fn_injective Path.Homotopy.coeFn_injective
@[simp]
theorem source (F : Homotopy pβ pβ) (t : I) : F (t, 0) = xβ :=
calc F (t, 0) = pβ 0 := ContinuousMap.HomotopyRel.eq_fst _ _ (.inl rfl)
_ = xβ := pβ.source
#align path.homotopy.source Path.Homotopy.source
@[simp]
theorem target (F : Homotopy pβ pβ) (t : I) : F (t, 1) = xβ :=
calc F (t, 1) = pβ 1 := ContinuousMap.HomotopyRel.eq_fst _ _ (.inr rfl)
_ = xβ := pβ.target
#align path.homotopy.target Path.Homotopy.target
def eval (F : Homotopy pβ pβ) (t : I) : Path xβ xβ where
toFun := F.toHomotopy.curry t
source' := by simp
target' := by simp
#align path.homotopy.eval Path.Homotopy.eval
@[simp]
theorem eval_zero (F : Homotopy pβ pβ) : F.eval 0 = pβ := by
ext t
simp [eval]
#align path.homotopy.eval_zero Path.Homotopy.eval_zero
@[simp]
| Mathlib/Topology/Homotopy/Path.lean | 89 | 91 | theorem eval_one (F : Homotopy pβ pβ) : F.eval 1 = pβ := by |
ext t
simp [eval]
| [
" { toFun := β(F.curry t), continuous_toFun := β― }.toFun 0 = xβ",
" { toFun := β(F.curry t), continuous_toFun := β― }.toFun 1 = xβ",
" F.eval 0 = pβ",
" (F.eval 0) t = pβ t",
" F.eval 1 = pβ",
" (F.eval 1) t = pβ t"
] | [
" { toFun := β(F.curry t), continuous_toFun := β― }.toFun 0 = xβ",
" { toFun := β(F.curry t), continuous_toFun := β― }.toFun 1 = xβ",
" F.eval 0 = pβ",
" (F.eval 0) t = pβ t",
" F.eval 1 = pβ"
] |
import Mathlib.Analysis.Convex.Hull
#align_import analysis.convex.extreme from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963"
open Function Set
open scoped Classical
open Affine
variable {π E F ΞΉ : Type*} {Ο : ΞΉ β Type*}
section SMul
variable (π) [OrderedSemiring π] [AddCommMonoid E] [SMul π E]
def IsExtreme (A B : Set E) : Prop :=
B β A β§ β β¦xββ¦, xβ β A β β β¦xββ¦, xβ β A β β β¦xβ¦, x β B β x β openSegment π xβ xβ β xβ β B β§ xβ β B
#align is_extreme IsExtreme
def Set.extremePoints (A : Set E) : Set E :=
{ x β A | β β¦xββ¦, xβ β A β β β¦xββ¦, xβ β A β x β openSegment π xβ xβ β xβ = x β§ xβ = x }
#align set.extreme_points Set.extremePoints
@[refl]
protected theorem IsExtreme.refl (A : Set E) : IsExtreme π A A :=
β¨Subset.rfl, fun _ hxβA _ hxβA _ _ _ β¦ β¨hxβA, hxβAβ©β©
#align is_extreme.refl IsExtreme.refl
variable {π} {A B C : Set E} {x : E}
protected theorem IsExtreme.rfl : IsExtreme π A A :=
IsExtreme.refl π A
#align is_extreme.rfl IsExtreme.rfl
@[trans]
protected theorem IsExtreme.trans (hAB : IsExtreme π A B) (hBC : IsExtreme π B C) :
IsExtreme π A C := by
refine β¨Subset.trans hBC.1 hAB.1, fun xβ hxβA xβ hxβA x hxC hx β¦ ?_β©
obtain β¨hxβB, hxβBβ© := hAB.2 hxβA hxβA (hBC.1 hxC) hx
exact hBC.2 hxβB hxβB hxC hx
#align is_extreme.trans IsExtreme.trans
protected theorem IsExtreme.antisymm : AntiSymmetric (IsExtreme π : Set E β Set E β Prop) :=
fun _ _ hAB hBA β¦ Subset.antisymm hBA.1 hAB.1
#align is_extreme.antisymm IsExtreme.antisymm
instance : IsPartialOrder (Set E) (IsExtreme π) where
refl := IsExtreme.refl π
trans _ _ _ := IsExtreme.trans
antisymm := IsExtreme.antisymm
| Mathlib/Analysis/Convex/Extreme.lean | 97 | 103 | theorem IsExtreme.inter (hAB : IsExtreme π A B) (hAC : IsExtreme π A C) :
IsExtreme π A (B β© C) := by |
use Subset.trans inter_subset_left hAB.1
rintro xβ hxβA xβ hxβA x β¨hxB, hxCβ© hx
obtain β¨hxβB, hxβBβ© := hAB.2 hxβA hxβA hxB hx
obtain β¨hxβC, hxβCβ© := hAC.2 hxβA hxβA hxC hx
exact β¨β¨hxβB, hxβCβ©, hxβB, hxβCβ©
| [
" IsExtreme π A C",
" xβ β C β§ xβ β C",
" IsExtreme π A (B β© C)",
" β β¦xβ : Eβ¦, xβ β A β β β¦xβ : Eβ¦, xβ β A β β β¦x : Eβ¦, x β B β© C β x β openSegment π xβ xβ β xβ β B β© C β§ xβ β B β© C",
" xβ β B β© C β§ xβ β B β© C"
] | [
" IsExtreme π A C",
" xβ β C β§ xβ β C",
" IsExtreme π A (B β© C)"
] |
import Mathlib.Algebra.BigOperators.Group.List
import Mathlib.Algebra.Group.Prod
import Mathlib.Data.Multiset.Basic
#align_import algebra.big_operators.multiset.basic from "leanprover-community/mathlib"@"6c5f73fd6f6cc83122788a80a27cdd54663609f4"
assert_not_exists MonoidWithZero
variable {F ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Multiset
section CommMonoid
variable [CommMonoid Ξ±] [CommMonoid Ξ²] {s t : Multiset Ξ±} {a : Ξ±} {m : Multiset ΞΉ} {f g : ΞΉ β Ξ±}
@[to_additive
"Sum of a multiset given a commutative additive monoid structure on `Ξ±`.
`sum {a, b, c} = a + b + c`"]
def prod : Multiset Ξ± β Ξ± :=
foldr (Β· * Β·) (fun x y z => by simp [mul_left_comm]) 1
#align multiset.prod Multiset.prod
#align multiset.sum Multiset.sum
@[to_additive]
theorem prod_eq_foldr (s : Multiset Ξ±) :
prod s = foldr (Β· * Β·) (fun x y z => by simp [mul_left_comm]) 1 s :=
rfl
#align multiset.prod_eq_foldr Multiset.prod_eq_foldr
#align multiset.sum_eq_foldr Multiset.sum_eq_foldr
@[to_additive]
theorem prod_eq_foldl (s : Multiset Ξ±) :
prod s = foldl (Β· * Β·) (fun x y z => by simp [mul_right_comm]) 1 s :=
(foldr_swap _ _ _ _).trans (by simp [mul_comm])
#align multiset.prod_eq_foldl Multiset.prod_eq_foldl
#align multiset.sum_eq_foldl Multiset.sum_eq_foldl
@[to_additive (attr := simp, norm_cast)]
theorem prod_coe (l : List Ξ±) : prod βl = l.prod :=
prod_eq_foldl _
#align multiset.coe_prod Multiset.prod_coe
#align multiset.coe_sum Multiset.sum_coe
@[to_additive (attr := simp)]
theorem prod_toList (s : Multiset Ξ±) : s.toList.prod = s.prod := by
conv_rhs => rw [β coe_toList s]
rw [prod_coe]
#align multiset.prod_to_list Multiset.prod_toList
#align multiset.sum_to_list Multiset.sum_toList
@[to_additive (attr := simp)]
theorem prod_zero : @prod Ξ± _ 0 = 1 :=
rfl
#align multiset.prod_zero Multiset.prod_zero
#align multiset.sum_zero Multiset.sum_zero
@[to_additive (attr := simp)]
theorem prod_cons (a : Ξ±) (s) : prod (a ::β s) = a * prod s :=
foldr_cons _ _ _ _ _
#align multiset.prod_cons Multiset.prod_cons
#align multiset.sum_cons Multiset.sum_cons
@[to_additive (attr := simp)]
theorem prod_erase [DecidableEq Ξ±] (h : a β s) : a * (s.erase a).prod = s.prod := by
rw [β s.coe_toList, coe_erase, prod_coe, prod_coe, List.prod_erase (mem_toList.2 h)]
#align multiset.prod_erase Multiset.prod_erase
#align multiset.sum_erase Multiset.sum_erase
@[to_additive (attr := simp)]
theorem prod_map_erase [DecidableEq ΞΉ] {a : ΞΉ} (h : a β m) :
f a * ((m.erase a).map f).prod = (m.map f).prod := by
rw [β m.coe_toList, coe_erase, map_coe, map_coe, prod_coe, prod_coe,
List.prod_map_erase f (mem_toList.2 h)]
#align multiset.prod_map_erase Multiset.prod_map_erase
#align multiset.sum_map_erase Multiset.sum_map_erase
@[to_additive (attr := simp)]
| Mathlib/Algebra/BigOperators/Group/Multiset.lean | 99 | 100 | theorem prod_singleton (a : Ξ±) : prod {a} = a := by |
simp only [mul_one, prod_cons, β cons_zero, eq_self_iff_true, prod_zero]
| [
" (fun x x_1 => x * x_1) x ((fun x x_1 => x * x_1) y z) = (fun x x_1 => x * x_1) y ((fun x x_1 => x * x_1) x z)",
" (fun x x_1 => x * x_1) ((fun x x_1 => x * x_1) x y) z = (fun x x_1 => x * x_1) ((fun x x_1 => x * x_1) x z) y",
" foldl (fun x y => y * x) β― 1 s = foldl (fun x x_1 => x * x_1) β― 1 s",
" s.toList... | [
" (fun x x_1 => x * x_1) x ((fun x x_1 => x * x_1) y z) = (fun x x_1 => x * x_1) y ((fun x x_1 => x * x_1) x z)",
" (fun x x_1 => x * x_1) ((fun x x_1 => x * x_1) x y) z = (fun x x_1 => x * x_1) ((fun x x_1 => x * x_1) x z) y",
" foldl (fun x y => y * x) β― 1 s = foldl (fun x x_1 => x * x_1) β― 1 s",
" s.toList... |
import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv
import Mathlib.Topology.Algebra.Module.Basic
open Function
structure ContinuousAffineEquiv (k Pβ Pβ : Type*) {Vβ Vβ : Type*} [Ring k]
[AddCommGroup Vβ] [Module k Vβ] [AddTorsor Vβ Pβ] [TopologicalSpace Pβ]
[AddCommGroup Vβ] [Module k Vβ] [AddTorsor Vβ Pβ] [TopologicalSpace Pβ]
extends Pβ βα΅[k] Pβ where
continuous_toFun : Continuous toFun := by continuity
continuous_invFun : Continuous invFun := by continuity
@[inherit_doc]
notation:25 Pβ " βα΅L[" k:25 "] " Pβ:0 => ContinuousAffineEquiv k Pβ Pβ
variable {k Pβ Pβ Pβ Pβ Vβ Vβ Vβ Vβ : Type*} [Ring k]
[AddCommGroup Vβ] [Module k Vβ] [AddTorsor Vβ Pβ]
[AddCommGroup Vβ] [Module k Vβ] [AddTorsor Vβ Pβ]
[AddCommGroup Vβ] [Module k Vβ] [AddTorsor Vβ Pβ]
[AddCommGroup Vβ] [Module k Vβ] [AddTorsor Vβ Pβ]
[TopologicalSpace Pβ] [AddCommMonoid Pβ] [Module k Pβ]
[TopologicalSpace Pβ] [AddCommMonoid Pβ] [Module k Pβ]
[TopologicalSpace Pβ] [TopologicalSpace Pβ]
namespace ContinuousAffineEquiv
-- Basic set-up: standard fields, coercions and ext lemmas
section Basic
def toHomeomorph (e : Pβ βα΅L[k] Pβ) : Pβ ββ Pβ where
__ := e
| Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean | 65 | 67 | theorem toAffineEquiv_injective : Injective (toAffineEquiv : (Pβ βα΅L[k] Pβ) β Pβ βα΅[k] Pβ) := by |
rintro β¨e, econt, einv_contβ© β¨e', e'cont, e'inv_contβ© H
congr
| [
" Injective toAffineEquiv",
" { toAffineEquiv := e, continuous_toFun := econt, continuous_invFun := einv_cont } =\n { toAffineEquiv := e', continuous_toFun := e'cont, continuous_invFun := e'inv_cont }"
] | [
" Injective toAffineEquiv"
] |
import Mathlib.LinearAlgebra.FiniteDimensional
import Mathlib.LinearAlgebra.FreeModule.Finite.Basic
import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition
import Mathlib.LinearAlgebra.Projection
import Mathlib.LinearAlgebra.SesquilinearForm
import Mathlib.RingTheory.TensorProduct.Basic
import Mathlib.RingTheory.Ideal.LocalRing
#align_import linear_algebra.dual from "leanprover-community/mathlib"@"b1c017582e9f18d8494e5c18602a8cb4a6f843ac"
noncomputable section
namespace Module
-- Porting note: max u v universe issues so name and specific below
universe uR uA uM uM' uM''
variable (R : Type uR) (A : Type uA) (M : Type uM)
variable [CommSemiring R] [AddCommMonoid M] [Module R M]
abbrev Dual :=
M ββ[R] R
#align module.dual Module.Dual
def dualPairing (R M) [CommSemiring R] [AddCommMonoid M] [Module R M] :
Module.Dual R M ββ[R] M ββ[R] R :=
LinearMap.id
#align module.dual_pairing Module.dualPairing
@[simp]
theorem dualPairing_apply (v x) : dualPairing R M v x = v x :=
rfl
#align module.dual_pairing_apply Module.dualPairing_apply
namespace Dual
instance : Inhabited (Dual R M) := β¨0β©
def eval : M ββ[R] Dual R (Dual R M) :=
LinearMap.flip LinearMap.id
#align module.dual.eval Module.Dual.eval
@[simp]
theorem eval_apply (v : M) (a : Dual R M) : eval R M v a = a v :=
rfl
#align module.dual.eval_apply Module.Dual.eval_apply
variable {R M} {M' : Type uM'}
variable [AddCommMonoid M'] [Module R M']
def transpose : (M ββ[R] M') ββ[R] Dual R M' ββ[R] Dual R M :=
(LinearMap.llcomp R M M' R).flip
#align module.dual.transpose Module.Dual.transpose
-- Porting note: with reducible def need to specify some parameters to transpose explicitly
theorem transpose_apply (u : M ββ[R] M') (l : Dual R M') : transpose (R := R) u l = l.comp u :=
rfl
#align module.dual.transpose_apply Module.Dual.transpose_apply
variable {M'' : Type uM''} [AddCommMonoid M''] [Module R M'']
-- Porting note: with reducible def need to specify some parameters to transpose explicitly
theorem transpose_comp (u : M' ββ[R] M'') (v : M ββ[R] M') :
transpose (R := R) (u.comp v) = (transpose (R := R) v).comp (transpose (R := R) u) :=
rfl
#align module.dual.transpose_comp Module.Dual.transpose_comp
end Dual
section Prod
variable (M' : Type uM') [AddCommMonoid M'] [Module R M']
@[simps!]
def dualProdDualEquivDual : (Module.Dual R M Γ Module.Dual R M') ββ[R] Module.Dual R (M Γ M') :=
LinearMap.coprodEquiv R
#align module.dual_prod_dual_equiv_dual Module.dualProdDualEquivDual
@[simp]
theorem dualProdDualEquivDual_apply (Ο : Module.Dual R M) (Ο : Module.Dual R M') :
dualProdDualEquivDual R M M' (Ο, Ο) = Ο.coprod Ο :=
rfl
#align module.dual_prod_dual_equiv_dual_apply Module.dualProdDualEquivDual_apply
end Prod
end Module
namespace Basis
universe u v w
open Module Module.Dual Submodule LinearMap Cardinal Function
universe uR uM uK uV uΞΉ
variable {R : Type uR} {M : Type uM} {K : Type uK} {V : Type uV} {ΞΉ : Type uΞΉ}
section
variable [CommSemiring R] [AddCommMonoid M] [Module R M] [Fintype ΞΉ]
variable (b : Basis ΞΉ R M)
@[simp]
| Mathlib/LinearAlgebra/Dual.lean | 388 | 392 | theorem sum_dual_apply_smul_coord (f : Module.Dual R M) :
(β x, f (b x) β’ b.coord x) = f := by |
ext m
simp_rw [LinearMap.sum_apply, LinearMap.smul_apply, smul_eq_mul, mul_comm (f _), β smul_eq_mul, β
f.map_smul, β _root_.map_sum, Basis.coord_apply, Basis.sum_repr]
| [
" β x : ΞΉ, f (b x) β’ b.coord x = f",
" (β x : ΞΉ, f (b x) β’ b.coord x) m = f m"
] | [
" β x : ΞΉ, f (b x) β’ b.coord x = f"
] |
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]
| Mathlib/RingTheory/PowerSeries/Basic.lean | 229 | 231 | theorem coeff_zero_eq_constantCoeff : β(coeff R 0) = constantCoeff R := by |
rw [coeff, Finsupp.single_zero]
rfl
| [
" Inhabited Rβ¦Xβ§",
" Inhabited (MvPowerSeries Unit R)",
" Zero Rβ¦Xβ§",
" Zero (MvPowerSeries Unit R)",
" AddMonoid Rβ¦Xβ§",
" AddMonoid (MvPowerSeries Unit R)",
" AddGroup Rβ¦Xβ§",
" AddGroup (MvPowerSeries Unit R)",
" AddCommMonoid Rβ¦Xβ§",
" AddCommMonoid (MvPowerSeries Unit R)",
" AddCommGroup Rβ¦Xβ§"... | [
" Inhabited Rβ¦Xβ§",
" Inhabited (MvPowerSeries Unit R)",
" Zero Rβ¦Xβ§",
" Zero (MvPowerSeries Unit R)",
" AddMonoid Rβ¦Xβ§",
" AddMonoid (MvPowerSeries Unit R)",
" AddGroup Rβ¦Xβ§",
" AddGroup (MvPowerSeries Unit R)",
" AddCommMonoid Rβ¦Xβ§",
" AddCommMonoid (MvPowerSeries Unit R)",
" AddCommGroup Rβ¦Xβ§"... |
import Mathlib.MeasureTheory.Function.L1Space
import Mathlib.MeasureTheory.Function.SimpleFuncDense
#align_import measure_theory.function.simple_func_dense_lp from "leanprover-community/mathlib"@"5a2df4cd59cb31e97a516d4603a14bed5c2f9425"
noncomputable section
set_option linter.uppercaseLean3 false
open Set Function Filter TopologicalSpace ENNReal EMetric Finset
open scoped Classical Topology ENNReal MeasureTheory
variable {Ξ± Ξ² ΞΉ E F π : Type*}
namespace MeasureTheory
local infixr:25 " ββ " => SimpleFunc
namespace SimpleFunc
section SimpleFuncProperties
variable [MeasurableSpace Ξ±]
variable [NormedAddCommGroup E] [NormedAddCommGroup F]
variable {ΞΌ : Measure Ξ±} {p : ββ₯0β}
theorem exists_forall_norm_le (f : Ξ± ββ F) : β C, β x, βf xβ β€ C :=
exists_forall_le (f.map fun x => βxβ)
#align measure_theory.simple_func.exists_forall_norm_le MeasureTheory.SimpleFunc.exists_forall_norm_le
theorem memβp_zero (f : Ξ± ββ E) (ΞΌ : Measure Ξ±) : Memβp f 0 ΞΌ :=
memβp_zero_iff_aestronglyMeasurable.mpr f.aestronglyMeasurable
#align measure_theory.simple_func.mem_βp_zero MeasureTheory.SimpleFunc.memβp_zero
theorem memβp_top (f : Ξ± ββ E) (ΞΌ : Measure Ξ±) : Memβp f β ΞΌ :=
let β¨C, hfCβ© := f.exists_forall_norm_le
memβp_top_of_bound f.aestronglyMeasurable C <| eventually_of_forall hfC
#align measure_theory.simple_func.mem_βp_top MeasureTheory.SimpleFunc.memβp_top
protected theorem snorm'_eq {p : β} (f : Ξ± ββ F) (ΞΌ : Measure Ξ±) :
snorm' f p ΞΌ = (β y β f.range, (βyββ : ββ₯0β) ^ p * ΞΌ (f β»ΒΉ' {y})) ^ (1 / p) := by
have h_map : (fun a => (βf aββ : ββ₯0β) ^ p) = f.map fun a : F => (βaββ : ββ₯0β) ^ p := by
simp; rfl
rw [snorm', h_map, lintegral_eq_lintegral, map_lintegral]
#align measure_theory.simple_func.snorm'_eq MeasureTheory.SimpleFunc.snorm'_eq
| Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean | 296 | 322 | theorem measure_preimage_lt_top_of_memβp (hp_pos : p β 0) (hp_ne_top : p β β) (f : Ξ± ββ E)
(hf : Memβp f p ΞΌ) (y : E) (hy_ne : y β 0) : ΞΌ (f β»ΒΉ' {y}) < β := by |
have hp_pos_real : 0 < p.toReal := ENNReal.toReal_pos hp_pos hp_ne_top
have hf_snorm := Memβp.snorm_lt_top hf
rw [snorm_eq_snorm' hp_pos hp_ne_top, f.snorm'_eq, β
@ENNReal.lt_rpow_one_div_iff _ _ (1 / p.toReal) (by simp [hp_pos_real]),
@ENNReal.top_rpow_of_pos (1 / (1 / p.toReal)) (by simp [hp_pos_real]),
ENNReal.sum_lt_top_iff] at hf_snorm
by_cases hyf : y β f.range
swap
Β· suffices h_empty : f β»ΒΉ' {y} = β
by
rw [h_empty, measure_empty]; exact ENNReal.coe_lt_top
ext1 x
rw [Set.mem_preimage, Set.mem_singleton_iff, mem_empty_iff_false, iff_false_iff]
refine fun hxy => hyf ?_
rw [mem_range, Set.mem_range]
exact β¨x, hxyβ©
specialize hf_snorm y hyf
rw [ENNReal.mul_lt_top_iff] at hf_snorm
cases hf_snorm with
| inl hf_snorm => exact hf_snorm.2
| inr hf_snorm =>
cases hf_snorm with
| inl hf_snorm =>
refine absurd ?_ hy_ne
simpa [hp_pos_real] using hf_snorm
| inr hf_snorm => simp [hf_snorm]
| [
" snorm' (βf) p ΞΌ = (β y β f.range, ββyββ ^ p * ΞΌ (βf β»ΒΉ' {y})) ^ (1 / p)",
" (fun a => βββf aββ ^ p) = β(map (fun a => ββaββ ^ p) f)",
" (fun a => βββf aββ ^ p) = (fun a => ββaββ ^ p) β βf",
" ΞΌ (βf β»ΒΉ' {y}) < β€",
" 0 < 1 / p.toReal",
" 0 < 1 / (1 / p.toReal)",
" 0 < β€",
" βf β»ΒΉ' {y} = β
",
" x β βf... | [
" snorm' (βf) p ΞΌ = (β y β f.range, ββyββ ^ p * ΞΌ (βf β»ΒΉ' {y})) ^ (1 / p)",
" (fun a => βββf aββ ^ p) = β(map (fun a => ββaββ ^ p) f)",
" (fun a => βββf aββ ^ p) = (fun a => ββaββ ^ p) β βf",
" ΞΌ (βf β»ΒΉ' {y}) < β€"
] |
import Mathlib.Topology.Algebra.Module.Basic
import Mathlib.LinearAlgebra.Multilinear.Basic
#align_import topology.algebra.module.multilinear from "leanprover-community/mathlib"@"f40476639bac089693a489c9e354ebd75dc0f886"
open Function Fin Set
universe u v w wβ wβ' wβ wβ wβ
variable {R : Type u} {ΞΉ : Type v} {n : β} {M : Fin n.succ β Type w} {Mβ : ΞΉ β Type wβ}
{Mβ' : ΞΉ β Type wβ'} {Mβ : Type wβ} {Mβ : Type wβ} {Mβ : Type wβ}
structure ContinuousMultilinearMap (R : Type u) {ΞΉ : Type v} (Mβ : ΞΉ β Type wβ) (Mβ : Type wβ)
[Semiring R] [β i, AddCommMonoid (Mβ i)] [AddCommMonoid Mβ] [β i, Module R (Mβ i)] [Module R Mβ]
[β i, TopologicalSpace (Mβ i)] [TopologicalSpace Mβ] extends MultilinearMap R Mβ Mβ where
cont : Continuous toFun
#align continuous_multilinear_map ContinuousMultilinearMap
attribute [inherit_doc ContinuousMultilinearMap] ContinuousMultilinearMap.cont
@[inherit_doc]
notation:25 M "[Γ" n "]βL[" R "] " M' => ContinuousMultilinearMap R (fun i : Fin n => M) M'
namespace ContinuousMultilinearMap
section Semiring
variable [Semiring R] [β i, AddCommMonoid (M i)] [β i, AddCommMonoid (Mβ i)]
[β i, AddCommMonoid (Mβ' i)] [AddCommMonoid Mβ] [AddCommMonoid Mβ] [AddCommMonoid Mβ]
[β i, Module R (M i)] [β i, Module R (Mβ i)] [β i, Module R (Mβ' i)] [Module R Mβ] [Module R Mβ]
[Module R Mβ] [β i, TopologicalSpace (M i)] [β i, TopologicalSpace (Mβ i)]
[β i, TopologicalSpace (Mβ' i)] [TopologicalSpace Mβ] [TopologicalSpace Mβ] [TopologicalSpace Mβ]
(f f' : ContinuousMultilinearMap R Mβ Mβ)
theorem toMultilinearMap_injective :
Function.Injective
(ContinuousMultilinearMap.toMultilinearMap :
ContinuousMultilinearMap R Mβ Mβ β MultilinearMap R Mβ Mβ)
| β¨f, hfβ©, β¨g, hgβ©, h => by subst h; rfl
#align continuous_multilinear_map.to_multilinear_map_injective ContinuousMultilinearMap.toMultilinearMap_injective
instance funLike : FunLike (ContinuousMultilinearMap R Mβ Mβ) (β i, Mβ i) Mβ where
coe f := f.toFun
coe_injective' _ _ h := toMultilinearMap_injective <| MultilinearMap.coe_injective h
instance continuousMapClass :
ContinuousMapClass (ContinuousMultilinearMap R Mβ Mβ) (β i, Mβ i) Mβ where
map_continuous := ContinuousMultilinearMap.cont
#align continuous_multilinear_map.continuous_map_class ContinuousMultilinearMap.continuousMapClass
instance : CoeFun (ContinuousMultilinearMap R Mβ Mβ) fun _ => (β i, Mβ i) β Mβ :=
β¨fun f => fβ©
def Simps.apply (Lβ : ContinuousMultilinearMap R Mβ Mβ) (v : β i, Mβ i) : Mβ :=
Lβ v
#align continuous_multilinear_map.simps.apply ContinuousMultilinearMap.Simps.apply
initialize_simps_projections ContinuousMultilinearMap (-toMultilinearMap,
toMultilinearMap_toFun β apply)
@[continuity]
theorem coe_continuous : Continuous (f : (β i, Mβ i) β Mβ) :=
f.cont
#align continuous_multilinear_map.coe_continuous ContinuousMultilinearMap.coe_continuous
@[simp]
theorem coe_coe : (f.toMultilinearMap : (β i, Mβ i) β Mβ) = f :=
rfl
#align continuous_multilinear_map.coe_coe ContinuousMultilinearMap.coe_coe
@[ext]
theorem ext {f f' : ContinuousMultilinearMap R Mβ Mβ} (H : β x, f x = f' x) : f = f' :=
DFunLike.ext _ _ H
#align continuous_multilinear_map.ext ContinuousMultilinearMap.ext
| Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean | 113 | 114 | theorem ext_iff {f f' : ContinuousMultilinearMap R Mβ Mβ} : f = f' β β x, f x = f' x := by |
rw [β toMultilinearMap_injective.eq_iff, MultilinearMap.ext_iff]; rfl
| [
" { toMultilinearMap := f, cont := hf } = { toMultilinearMap := g, cont := hg }",
" { toMultilinearMap := f, cont := hf } =\n { toMultilinearMap := { toMultilinearMap := f, cont := hf }.toMultilinearMap, cont := hg }",
" f = f' β β (x : (i : ΞΉ) β Mβ i), f x = f' x",
" (β (x : (i : ΞΉ) β Mβ i), f.toMultiline... | [
" { toMultilinearMap := f, cont := hf } = { toMultilinearMap := g, cont := hg }",
" { toMultilinearMap := f, cont := hf } =\n { toMultilinearMap := { toMultilinearMap := f, cont := hf }.toMultilinearMap, cont := hg }",
" f = f' β β (x : (i : ΞΉ) β Mβ i), f x = f' x"
] |
import Mathlib.NumberTheory.ZetaValues
import Mathlib.NumberTheory.LSeries.RiemannZeta
open Complex Real Set
open scoped Nat
namespace HurwitzZeta
variable {k : β} {x : β}
theorem cosZeta_two_mul_nat (hk : k β 0) (hx : x β Icc 0 1) :
cosZeta x (2 * k) = (-1) ^ (k + 1) * (2 * Ο) ^ (2 * k) / 2 / (2 * k)! *
((Polynomial.bernoulli (2 * k)).map (algebraMap β β)).eval (x : β) := by
rw [β (hasSum_nat_cosZeta x (?_ : 1 < re (2 * k))).tsum_eq]
refine Eq.trans ?_ <| (congr_arg ofReal' (hasSum_one_div_nat_pow_mul_cos hk hx).tsum_eq).trans ?_
Β· rw [ofReal_tsum]
refine tsum_congr fun n β¦ ?_
rw [mul_comm (1 / _), mul_one_div, ofReal_div, mul_assoc (2 * Ο), mul_comm x n, β mul_assoc,
β Nat.cast_ofNat (R := β), β Nat.cast_mul, cpow_natCast, ofReal_pow, ofReal_natCast]
Β· simp only [ofReal_mul, ofReal_div, ofReal_pow, ofReal_natCast, ofReal_ofNat,
ofReal_neg, ofReal_one]
congr 1
have : (Polynomial.bernoulli (2 * k)).map (algebraMap β β) = _ :=
(Polynomial.map_map (algebraMap β β) ofReal _).symm
rw [this, β ofReal_eq_coe, β ofReal_eq_coe]
apply Polynomial.map_aeval_eq_aeval_map
simp only [Algebra.id.map_eq_id, RingHomCompTriple.comp_eq]
Β· rw [β Nat.cast_ofNat, β Nat.cast_one, β Nat.cast_mul, natCast_re, Nat.cast_lt]
omega
theorem sinZeta_two_mul_nat_add_one (hk : k β 0) (hx : x β Icc 0 1) :
sinZeta x (2 * k + 1) = (-1) ^ (k + 1) * (2 * Ο) ^ (2 * k + 1) / 2 / (2 * k + 1)! *
((Polynomial.bernoulli (2 * k + 1)).map (algebraMap β β)).eval (x : β) := by
rw [β (hasSum_nat_sinZeta x (?_ : 1 < re (2 * k + 1))).tsum_eq]
refine Eq.trans ?_ <| (congr_arg ofReal' (hasSum_one_div_nat_pow_mul_sin hk hx).tsum_eq).trans ?_
Β· rw [ofReal_tsum]
refine tsum_congr fun n β¦ ?_
rw [mul_comm (1 / _), mul_one_div, ofReal_div, mul_assoc (2 * Ο), mul_comm x n, β mul_assoc]
congr 1
rw [β Nat.cast_ofNat, β Nat.cast_mul, β Nat.cast_add_one, cpow_natCast, ofReal_pow,
ofReal_natCast]
Β· simp only [ofReal_mul, ofReal_div, ofReal_pow, ofReal_natCast, ofReal_ofNat,
ofReal_neg, ofReal_one]
congr 1
have : (Polynomial.bernoulli (2 * k + 1)).map (algebraMap β β) = _ :=
(Polynomial.map_map (algebraMap β β) ofReal _).symm
rw [this, β ofReal_eq_coe, β ofReal_eq_coe]
apply Polynomial.map_aeval_eq_aeval_map
simp only [Algebra.id.map_eq_id, RingHomCompTriple.comp_eq]
Β· rw [β Nat.cast_ofNat, β Nat.cast_one, β Nat.cast_mul, β Nat.cast_add_one, natCast_re,
Nat.cast_lt, lt_add_iff_pos_left]
exact mul_pos two_pos (Nat.pos_of_ne_zero hk)
theorem cosZeta_two_mul_nat' (hk : k β 0) (hx : x β Icc (0 : β) 1) :
cosZeta x (2 * k) = (-1) ^ (k + 1) / (2 * k) / Gammaβ (2 * k) *
((Polynomial.bernoulli (2 * k)).map (algebraMap β β)).eval (x : β) := by
rw [cosZeta_two_mul_nat hk hx]
congr 1
have : (2 * k)! = (2 * k) * Complex.Gamma (2 * k) := by
rw [(by { norm_cast; omega } : 2 * (k : β) = β(2 * k - 1) + 1), Complex.Gamma_nat_eq_factorial,
β Nat.cast_add_one, β Nat.cast_mul, β Nat.factorial_succ, Nat.sub_add_cancel (by omega)]
simp_rw [this, Gammaβ, cpow_neg, β div_div, div_inv_eq_mul, div_mul_eq_mul_div, div_div,
mul_right_comm (2 : β) (k : β)]
norm_cast
theorem sinZeta_two_mul_nat_add_one' (hk : k β 0) (hx : x β Icc (0 : β) 1) :
sinZeta x (2 * k + 1) = (-1) ^ (k + 1) / (2 * k + 1) / Gammaβ (2 * k + 1) *
((Polynomial.bernoulli (2 * k + 1)).map (algebraMap β β)).eval (x : β) := by
rw [sinZeta_two_mul_nat_add_one hk hx]
congr 1
have : (2 * k + 1)! = (2 * k + 1) * Complex.Gamma (2 * k + 1) := by
rw [(by simp : Complex.Gamma (2 * k + 1) = Complex.Gamma (β(2 * k) + 1)),
Complex.Gamma_nat_eq_factorial, β Nat.cast_ofNat (R := β), β Nat.cast_mul,
β Nat.cast_add_one, β Nat.cast_mul, β Nat.factorial_succ]
simp_rw [this, Gammaβ, cpow_neg, β div_div, div_inv_eq_mul, div_mul_eq_mul_div, div_div]
rw [(by simp : 2 * (k : β) + 1 = β(2 * k + 1)), cpow_natCast]
ring
| Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean | 126 | 146 | theorem hurwitzZetaEven_one_sub_two_mul_nat (hk : k β 0) (hx : x β Icc (0 : β) 1) :
hurwitzZetaEven x (1 - 2 * k) =
-1 / (2 * k) * ((Polynomial.bernoulli (2 * k)).map (algebraMap β β)).eval (x : β) := by |
have h1 (n : β) : (2 * k : β) β -n := by
rw [β Int.cast_ofNat, β Int.cast_natCast, β Int.cast_mul, β Int.cast_natCast n, β Int.cast_neg,
Ne, Int.cast_inj, β Ne]
refine ne_of_gt ((neg_nonpos_of_nonneg n.cast_nonneg).trans_lt (mul_pos two_pos ?_))
exact Nat.cast_pos.mpr (Nat.pos_of_ne_zero hk)
have h2 : (2 * k : β) β 1 := by norm_cast; simp only [mul_eq_one, OfNat.ofNat_ne_one,
false_and, not_false_eq_true]
have h3 : Gammaβ (2 * k) β 0 := by
refine mul_ne_zero (mul_ne_zero two_ne_zero ?_) (Gamma_ne_zero h1)
simp only [ne_eq, cpow_eq_zero_iff, mul_eq_zero, OfNat.ofNat_ne_zero, ofReal_eq_zero,
pi_ne_zero, Nat.cast_eq_zero, false_or, false_and, not_false_eq_true]
rw [hurwitzZetaEven_one_sub _ h1 (Or.inr h2), β Gammaβ, cosZeta_two_mul_nat' hk hx, β mul_assoc,
β mul_div_assoc, mul_assoc, mul_div_cancel_leftβ _ h3, β mul_div_assoc]
congr 2
rw [mul_div_assoc, mul_div_cancel_leftβ _ two_ne_zero, β ofReal_natCast, β ofReal_mul,
β ofReal_cos, mul_comm Ο, β sub_zero (k * Ο), cos_nat_mul_pi_sub, Real.cos_zero, mul_one,
ofReal_pow, ofReal_neg, ofReal_one, pow_succ, mul_neg_one, mul_neg, β mul_pow, neg_one_mul,
neg_neg, one_pow]
| [
" cosZeta (βx) (2 * βk) =\n (-1) ^ (k + 1) * (2 * βΟ) ^ (2 * k) / 2 / β(2 * k)! *\n Polynomial.eval (βx) (Polynomial.map (algebraMap β β) (Polynomial.bernoulli (2 * k)))",
" 1 < (2 * βk).re",
" β' (b : β), β(2 * Ο * x * βb).cos / βb ^ (2 * βk) = β(β' (b : β), 1 / βb ^ (2 * k) * (2 * Ο * βb * x).cos)",
... | [
" cosZeta (βx) (2 * βk) =\n (-1) ^ (k + 1) * (2 * βΟ) ^ (2 * k) / 2 / β(2 * k)! *\n Polynomial.eval (βx) (Polynomial.map (algebraMap β β) (Polynomial.bernoulli (2 * k)))",
" 1 < (2 * βk).re",
" β' (b : β), β(2 * Ο * x * βb).cos / βb ^ (2 * βk) = β(β' (b : β), 1 / βb ^ (2 * k) * (2 * Ο * βb * x).cos)",
... |
import Mathlib.Data.Set.Function
import Mathlib.Logic.Relation
import Mathlib.Logic.Pairwise
#align_import data.set.pairwise.basic from "leanprover-community/mathlib"@"c4c2ed622f43768eff32608d4a0f8a6cec1c047d"
open Function Order Set
variable {Ξ± Ξ² Ξ³ ΞΉ ΞΉ' : Type*} {r p q : Ξ± β Ξ± β Prop}
section Pairwise
variable {f g : ΞΉ β Ξ±} {s t u : Set Ξ±} {a b : Ξ±}
theorem pairwise_on_bool (hr : Symmetric r) {a b : Ξ±} :
Pairwise (r on fun c => cond c a b) β r a b := by simpa [Pairwise, Function.onFun] using @hr a b
#align pairwise_on_bool pairwise_on_bool
theorem pairwise_disjoint_on_bool [SemilatticeInf Ξ±] [OrderBot Ξ±] {a b : Ξ±} :
Pairwise (Disjoint on fun c => cond c a b) β Disjoint a b :=
pairwise_on_bool Disjoint.symm
#align pairwise_disjoint_on_bool pairwise_disjoint_on_bool
theorem Symmetric.pairwise_on [LinearOrder ΞΉ] (hr : Symmetric r) (f : ΞΉ β Ξ±) :
Pairwise (r on f) β β β¦m nβ¦, m < n β r (f m) (f n) :=
β¨fun h _m _n hmn => h hmn.ne, fun h _m _n hmn => hmn.lt_or_lt.elim (@h _ _) fun h' => hr (h h')β©
#align symmetric.pairwise_on Symmetric.pairwise_on
theorem pairwise_disjoint_on [SemilatticeInf Ξ±] [OrderBot Ξ±] [LinearOrder ΞΉ] (f : ΞΉ β Ξ±) :
Pairwise (Disjoint on f) β β β¦m nβ¦, m < n β Disjoint (f m) (f n) :=
Symmetric.pairwise_on Disjoint.symm f
#align pairwise_disjoint_on pairwise_disjoint_on
theorem pairwise_disjoint_mono [SemilatticeInf Ξ±] [OrderBot Ξ±] (hs : Pairwise (Disjoint on f))
(h : g β€ f) : Pairwise (Disjoint on g) :=
hs.mono fun i j hij => Disjoint.mono (h i) (h j) hij
#align pairwise_disjoint.mono pairwise_disjoint_mono
namespace Set
theorem Pairwise.mono (h : t β s) (hs : s.Pairwise r) : t.Pairwise r :=
fun _x xt _y yt => hs (h xt) (h yt)
#align set.pairwise.mono Set.Pairwise.mono
theorem Pairwise.mono' (H : r β€ p) (hr : s.Pairwise r) : s.Pairwise p :=
hr.imp H
#align set.pairwise.mono' Set.Pairwise.mono'
theorem pairwise_top (s : Set Ξ±) : s.Pairwise β€ :=
pairwise_of_forall s _ fun _ _ => trivial
#align set.pairwise_top Set.pairwise_top
protected theorem Subsingleton.pairwise (h : s.Subsingleton) (r : Ξ± β Ξ± β Prop) : s.Pairwise r :=
fun _x hx _y hy hne => (hne (h hx hy)).elim
#align set.subsingleton.pairwise Set.Subsingleton.pairwise
@[simp]
theorem pairwise_empty (r : Ξ± β Ξ± β Prop) : (β
: Set Ξ±).Pairwise r :=
subsingleton_empty.pairwise r
#align set.pairwise_empty Set.pairwise_empty
@[simp]
theorem pairwise_singleton (a : Ξ±) (r : Ξ± β Ξ± β Prop) : Set.Pairwise {a} r :=
subsingleton_singleton.pairwise r
#align set.pairwise_singleton Set.pairwise_singleton
theorem pairwise_iff_of_refl [IsRefl Ξ± r] : s.Pairwise r β β β¦aβ¦, a β s β β β¦bβ¦, b β s β r a b :=
forallβ_congr fun _ _ _ _ => or_iff_not_imp_left.symm.trans <| or_iff_right_of_imp of_eq
#align set.pairwise_iff_of_refl Set.pairwise_iff_of_refl
alias β¨Pairwise.of_refl, _β© := pairwise_iff_of_refl
#align set.pairwise.of_refl Set.Pairwise.of_refl
theorem Nonempty.pairwise_iff_exists_forall [IsEquiv Ξ± r] {s : Set ΞΉ} (hs : s.Nonempty) :
s.Pairwise (r on f) β β z, β x β s, r (f x) z := by
constructor
Β· rcases hs with β¨y, hyβ©
refine fun H => β¨f y, fun x hx => ?_β©
rcases eq_or_ne x y with (rfl | hne)
Β· apply IsRefl.refl
Β· exact H hx hy hne
Β· rintro β¨z, hzβ© x hx y hy _
exact @IsTrans.trans Ξ± r _ (f x) z (f y) (hz _ hx) (IsSymm.symm _ _ <| hz _ hy)
#align set.nonempty.pairwise_iff_exists_forall Set.Nonempty.pairwise_iff_exists_forall
theorem Nonempty.pairwise_eq_iff_exists_eq {s : Set Ξ±} (hs : s.Nonempty) {f : Ξ± β ΞΉ} :
(s.Pairwise fun x y => f x = f y) β β z, β x β s, f x = z :=
hs.pairwise_iff_exists_forall
#align set.nonempty.pairwise_eq_iff_exists_eq Set.Nonempty.pairwise_eq_iff_exists_eq
theorem pairwise_iff_exists_forall [Nonempty ΞΉ] (s : Set Ξ±) (f : Ξ± β ΞΉ) {r : ΞΉ β ΞΉ β Prop}
[IsEquiv ΞΉ r] : s.Pairwise (r on f) β β z, β x β s, r (f x) z := by
rcases s.eq_empty_or_nonempty with (rfl | hne)
Β· simp
Β· exact hne.pairwise_iff_exists_forall
#align set.pairwise_iff_exists_forall Set.pairwise_iff_exists_forall
theorem pairwise_eq_iff_exists_eq [Nonempty ΞΉ] (s : Set Ξ±) (f : Ξ± β ΞΉ) :
(s.Pairwise fun x y => f x = f y) β β z, β x β s, f x = z :=
pairwise_iff_exists_forall s f
#align set.pairwise_eq_iff_exists_eq Set.pairwise_eq_iff_exists_eq
| Mathlib/Data/Set/Pairwise/Basic.lean | 137 | 143 | theorem pairwise_union :
(s βͺ t).Pairwise r β
s.Pairwise r β§ t.Pairwise r β§ β a β s, β b β t, a β b β r a b β§ r b a := by |
simp only [Set.Pairwise, mem_union, or_imp, forall_and]
exact
β¨fun H => β¨H.1.1, H.2.2, H.1.2, fun x hx y hy hne => H.2.1 y hy x hx hne.symmβ©,
fun H => β¨β¨H.1, H.2.2.1β©, fun x hx y hy hne => H.2.2.2 y hy x hx hne.symm, H.2.1β©β©
| [
" Pairwise (r on fun c => bif c then a else b) β r a b",
" s.Pairwise (r on f) β β z, β x β s, r (f x) z",
" s.Pairwise (r on f) β β z, β x β s, r (f x) z",
" r (f x) (f y)",
" r (f x) (f x)",
" (β z, β x β s, r (f x) z) β s.Pairwise (r on f)",
" (r on f) x y",
" β
.Pairwise (r on f) β β z, β x β β
, r ... | [
" Pairwise (r on fun c => bif c then a else b) β r a b",
" s.Pairwise (r on f) β β z, β x β s, r (f x) z",
" s.Pairwise (r on f) β β z, β x β s, r (f x) z",
" r (f x) (f y)",
" r (f x) (f x)",
" (β z, β x β s, r (f x) z) β s.Pairwise (r on f)",
" (r on f) x y",
" β
.Pairwise (r on f) β β z, β x β β
, r ... |
import Mathlib.LinearAlgebra.Matrix.DotProduct
import Mathlib.LinearAlgebra.Determinant
import Mathlib.LinearAlgebra.Matrix.Diagonal
#align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7"
open Matrix
namespace Matrix
open FiniteDimensional
variable {l m n o R : Type*} [Fintype n] [Fintype o]
section CommRing
variable [CommRing R]
noncomputable def rank (A : Matrix m n R) : β :=
finrank R <| LinearMap.range A.mulVecLin
#align matrix.rank Matrix.rank
@[simp]
theorem rank_one [StrongRankCondition R] [DecidableEq n] :
rank (1 : Matrix n n R) = Fintype.card n := by
rw [rank, mulVecLin_one, LinearMap.range_id, finrank_top, finrank_pi]
#align matrix.rank_one Matrix.rank_one
@[simp]
theorem rank_zero [Nontrivial R] : rank (0 : Matrix m n R) = 0 := by
rw [rank, mulVecLin_zero, LinearMap.range_zero, finrank_bot]
#align matrix.rank_zero Matrix.rank_zero
theorem rank_le_card_width [StrongRankCondition R] (A : Matrix m n R) :
A.rank β€ Fintype.card n := by
haveI : Module.Finite R (n β R) := Module.Finite.pi
haveI : Module.Free R (n β R) := Module.Free.pi _ _
exact A.mulVecLin.finrank_range_le.trans_eq (finrank_pi _)
#align matrix.rank_le_card_width Matrix.rank_le_card_width
theorem rank_le_width [StrongRankCondition R] {m n : β} (A : Matrix (Fin m) (Fin n) R) :
A.rank β€ n :=
A.rank_le_card_width.trans <| (Fintype.card_fin n).le
#align matrix.rank_le_width Matrix.rank_le_width
| Mathlib/Data/Matrix/Rank.lean | 71 | 74 | theorem rank_mul_le_left [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) :
(A * B).rank β€ A.rank := by |
rw [rank, rank, mulVecLin_mul]
exact Cardinal.toNat_le_toNat (LinearMap.rank_comp_le_left _ _) (rank_lt_aleph0 _ _)
| [
" rank 1 = Fintype.card n",
" rank 0 = 0",
" A.rank β€ Fintype.card n",
" (A * B).rank β€ A.rank",
" finrank R β₯(LinearMap.range (A.mulVecLin ββ B.mulVecLin)) β€ finrank R β₯(LinearMap.range A.mulVecLin)"
] | [
" rank 1 = Fintype.card n",
" rank 0 = 0",
" A.rank β€ Fintype.card n",
" (A * B).rank β€ A.rank"
] |
import Mathlib.Topology.Order.IsLUB
open Set Filter TopologicalSpace Topology Function
open OrderDual (toDual ofDual)
variable {Ξ± Ξ² Ξ³ : Type*}
section DenselyOrdered
variable [TopologicalSpace Ξ±] [LinearOrder Ξ±] [OrderTopology Ξ±] [DenselyOrdered Ξ±] {a b : Ξ±}
{s : Set Ξ±}
theorem closure_Ioi' {a : Ξ±} (h : (Ioi a).Nonempty) : closure (Ioi a) = Ici a := by
apply Subset.antisymm
Β· exact closure_minimal Ioi_subset_Ici_self isClosed_Ici
Β· rw [β diff_subset_closure_iff, Ici_diff_Ioi_same, singleton_subset_iff]
exact isGLB_Ioi.mem_closure h
#align closure_Ioi' closure_Ioi'
@[simp]
theorem closure_Ioi (a : Ξ±) [NoMaxOrder Ξ±] : closure (Ioi a) = Ici a :=
closure_Ioi' nonempty_Ioi
#align closure_Ioi closure_Ioi
theorem closure_Iio' (h : (Iio a).Nonempty) : closure (Iio a) = Iic a :=
closure_Ioi' (Ξ± := Ξ±α΅α΅) h
#align closure_Iio' closure_Iio'
@[simp]
theorem closure_Iio (a : Ξ±) [NoMinOrder Ξ±] : closure (Iio a) = Iic a :=
closure_Iio' nonempty_Iio
#align closure_Iio closure_Iio
@[simp]
theorem closure_Ioo {a b : Ξ±} (hab : a β b) : closure (Ioo a b) = Icc a b := by
apply Subset.antisymm
Β· exact closure_minimal Ioo_subset_Icc_self isClosed_Icc
Β· cases' hab.lt_or_lt with hab hab
Β· rw [β diff_subset_closure_iff, Icc_diff_Ioo_same hab.le]
have hab' : (Ioo a b).Nonempty := nonempty_Ioo.2 hab
simp only [insert_subset_iff, singleton_subset_iff]
exact β¨(isGLB_Ioo hab).mem_closure hab', (isLUB_Ioo hab).mem_closure hab'β©
Β· rw [Icc_eq_empty_of_lt hab]
exact empty_subset _
#align closure_Ioo closure_Ioo
@[simp]
theorem closure_Ioc {a b : Ξ±} (hab : a β b) : closure (Ioc a b) = Icc a b := by
apply Subset.antisymm
Β· exact closure_minimal Ioc_subset_Icc_self isClosed_Icc
Β· apply Subset.trans _ (closure_mono Ioo_subset_Ioc_self)
rw [closure_Ioo hab]
#align closure_Ioc closure_Ioc
@[simp]
theorem closure_Ico {a b : Ξ±} (hab : a β b) : closure (Ico a b) = Icc a b := by
apply Subset.antisymm
Β· exact closure_minimal Ico_subset_Icc_self isClosed_Icc
Β· apply Subset.trans _ (closure_mono Ioo_subset_Ico_self)
rw [closure_Ioo hab]
#align closure_Ico closure_Ico
@[simp]
theorem interior_Ici' {a : Ξ±} (ha : (Iio a).Nonempty) : interior (Ici a) = Ioi a := by
rw [β compl_Iio, interior_compl, closure_Iio' ha, compl_Iic]
#align interior_Ici' interior_Ici'
theorem interior_Ici [NoMinOrder Ξ±] {a : Ξ±} : interior (Ici a) = Ioi a :=
interior_Ici' nonempty_Iio
#align interior_Ici interior_Ici
@[simp]
theorem interior_Iic' {a : Ξ±} (ha : (Ioi a).Nonempty) : interior (Iic a) = Iio a :=
interior_Ici' (Ξ± := Ξ±α΅α΅) ha
#align interior_Iic' interior_Iic'
theorem interior_Iic [NoMaxOrder Ξ±] {a : Ξ±} : interior (Iic a) = Iio a :=
interior_Iic' nonempty_Ioi
#align interior_Iic interior_Iic
@[simp]
theorem interior_Icc [NoMinOrder Ξ±] [NoMaxOrder Ξ±] {a b : Ξ±} : interior (Icc a b) = Ioo a b := by
rw [β Ici_inter_Iic, interior_inter, interior_Ici, interior_Iic, Ioi_inter_Iio]
#align interior_Icc interior_Icc
@[simp]
theorem Icc_mem_nhds_iff [NoMinOrder Ξ±] [NoMaxOrder Ξ±] {a b x : Ξ±} :
Icc a b β π x β x β Ioo a b := by
rw [β interior_Icc, mem_interior_iff_mem_nhds]
@[simp]
theorem interior_Ico [NoMinOrder Ξ±] {a b : Ξ±} : interior (Ico a b) = Ioo a b := by
rw [β Ici_inter_Iio, interior_inter, interior_Ici, interior_Iio, Ioi_inter_Iio]
#align interior_Ico interior_Ico
@[simp]
theorem Ico_mem_nhds_iff [NoMinOrder Ξ±] {a b x : Ξ±} : Ico a b β π x β x β Ioo a b := by
rw [β interior_Ico, mem_interior_iff_mem_nhds]
@[simp]
theorem interior_Ioc [NoMaxOrder Ξ±] {a b : Ξ±} : interior (Ioc a b) = Ioo a b := by
rw [β Ioi_inter_Iic, interior_inter, interior_Ioi, interior_Iic, Ioi_inter_Iio]
#align interior_Ioc interior_Ioc
@[simp]
| Mathlib/Topology/Order/DenselyOrdered.lean | 125 | 126 | theorem Ioc_mem_nhds_iff [NoMaxOrder Ξ±] {a b x : Ξ±} : Ioc a b β π x β x β Ioo a b := by |
rw [β interior_Ioc, mem_interior_iff_mem_nhds]
| [
" closure (Ioi a) = Ici a",
" closure (Ioi a) β Ici a",
" Ici a β closure (Ioi a)",
" a β closure (Ioi a)",
" closure (Ioo a b) = Icc a b",
" closure (Ioo a b) β Icc a b",
" Icc a b β closure (Ioo a b)",
" {a, b} β closure (Ioo a b)",
" a β closure (Ioo a b) β§ b β closure (Ioo a b)",
" β
β closure... | [
" closure (Ioi a) = Ici a",
" closure (Ioi a) β Ici a",
" Ici a β closure (Ioi a)",
" a β closure (Ioi a)",
" closure (Ioo a b) = Icc a b",
" closure (Ioo a b) β Icc a b",
" Icc a b β closure (Ioo a b)",
" {a, b} β closure (Ioo a b)",
" a β closure (Ioo a b) β§ b β closure (Ioo a b)",
" β
β closure... |
import Mathlib.Order.Filter.AtTopBot
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.LinearCombination
import Mathlib.Tactic.Linarith.Frontend
#align_import algebra.quadratic_discriminant from "leanprover-community/mathlib"@"e085d1df33274f4b32f611f483aae678ba0b42df"
open Filter
section Ring
variable {R : Type*}
def discrim [Ring R] (a b c : R) : R :=
b ^ 2 - 4 * a * c
#align discrim discrim
@[simp] lemma discrim_neg [Ring R] (a b c : R) : discrim (-a) (-b) (-c) = discrim a b c := by
simp [discrim]
#align discrim_neg discrim_neg
variable [CommRing R] {a b c : R}
lemma discrim_eq_sq_of_quadratic_eq_zero {x : R} (h : a * x * x + b * x + c = 0) :
discrim a b c = (2 * a * x + b) ^ 2 := by
rw [discrim]
linear_combination -4 * a * h
#align discrim_eq_sq_of_quadratic_eq_zero discrim_eq_sq_of_quadratic_eq_zero
| Mathlib/Algebra/QuadraticDiscriminant.lean | 63 | 70 | theorem quadratic_eq_zero_iff_discrim_eq_sq [NeZero (2 : R)] [NoZeroDivisors R]
(ha : a β 0) (x : R) :
a * x * x + b * x + c = 0 β discrim a b c = (2 * a * x + b) ^ 2 := by |
refine β¨discrim_eq_sq_of_quadratic_eq_zero, fun h β¦ ?_β©
rw [discrim] at h
have ha : 2 * 2 * a β 0 := mul_ne_zero (mul_ne_zero (NeZero.ne _) (NeZero.ne _)) ha
apply mul_left_cancelβ ha
linear_combination -h
| [
" discrim (-a) (-b) (-c) = discrim a b c",
" discrim a b c = (2 * a * x + b) ^ 2",
" b ^ 2 - 4 * a * c = (2 * a * x + b) ^ 2",
" a * x * x + b * x + c = 0 β discrim a b c = (2 * a * x + b) ^ 2",
" a * x * x + b * x + c = 0",
" 2 * 2 * a * (a * x * x + b * x + c) = 2 * 2 * a * 0"
] | [
" discrim (-a) (-b) (-c) = discrim a b c",
" discrim a b c = (2 * a * x + b) ^ 2",
" b ^ 2 - 4 * a * c = (2 * a * x + b) ^ 2",
" a * x * x + b * x + c = 0 β discrim a b c = (2 * a * x + b) ^ 2"
] |
import Mathlib.Analysis.Calculus.Deriv.Mul
import Mathlib.Analysis.Calculus.Deriv.Comp
#align_import analysis.calculus.deriv.pow from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
open scoped Classical
open Topology Filter ENNReal
open Filter Asymptotics Set
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
variable {c : π β π} {c' : π}
variable (n : β)
theorem hasStrictDerivAt_pow :
β (n : β) (x : π), HasStrictDerivAt (fun x : π β¦ x ^ n) ((n : π) * x ^ (n - 1)) x
| 0, x => by simp [hasStrictDerivAt_const]
| 1, x => by simpa using hasStrictDerivAt_id x
| n + 1 + 1, x => by
simpa [pow_succ, add_mul, mul_assoc] using
(hasStrictDerivAt_pow (n + 1) x).mul (hasStrictDerivAt_id x)
#align has_strict_deriv_at_pow hasStrictDerivAt_pow
theorem hasDerivAt_pow (n : β) (x : π) :
HasDerivAt (fun x : π => x ^ n) ((n : π) * x ^ (n - 1)) x :=
(hasStrictDerivAt_pow n x).hasDerivAt
#align has_deriv_at_pow hasDerivAt_pow
theorem hasDerivWithinAt_pow (n : β) (x : π) (s : Set π) :
HasDerivWithinAt (fun x : π => x ^ n) ((n : π) * x ^ (n - 1)) s x :=
(hasDerivAt_pow n x).hasDerivWithinAt
#align has_deriv_within_at_pow hasDerivWithinAt_pow
theorem differentiableAt_pow : DifferentiableAt π (fun x : π => x ^ n) x :=
(hasDerivAt_pow n x).differentiableAt
#align differentiable_at_pow differentiableAt_pow
theorem differentiableWithinAt_pow :
DifferentiableWithinAt π (fun x : π => x ^ n) s x :=
(differentiableAt_pow n).differentiableWithinAt
#align differentiable_within_at_pow differentiableWithinAt_pow
theorem differentiable_pow : Differentiable π fun x : π => x ^ n := fun _ => differentiableAt_pow n
#align differentiable_pow differentiable_pow
theorem differentiableOn_pow : DifferentiableOn π (fun x : π => x ^ n) s :=
(differentiable_pow n).differentiableOn
#align differentiable_on_pow differentiableOn_pow
theorem deriv_pow : deriv (fun x : π => x ^ n) x = (n : π) * x ^ (n - 1) :=
(hasDerivAt_pow n x).deriv
#align deriv_pow deriv_pow
@[simp]
theorem deriv_pow' : (deriv fun x : π => x ^ n) = fun x => (n : π) * x ^ (n - 1) :=
funext fun _ => deriv_pow n
#align deriv_pow' deriv_pow'
theorem derivWithin_pow (hxs : UniqueDiffWithinAt π s x) :
derivWithin (fun x : π => x ^ n) s x = (n : π) * x ^ (n - 1) :=
(hasDerivWithinAt_pow n x s).derivWithin hxs
#align deriv_within_pow derivWithin_pow
theorem HasDerivWithinAt.pow (hc : HasDerivWithinAt c c' s x) :
HasDerivWithinAt (fun y => c y ^ n) ((n : π) * c x ^ (n - 1) * c') s x :=
(hasDerivAt_pow n (c x)).comp_hasDerivWithinAt x hc
#align has_deriv_within_at.pow HasDerivWithinAt.pow
| Mathlib/Analysis/Calculus/Deriv/Pow.lean | 99 | 102 | theorem HasDerivAt.pow (hc : HasDerivAt c c' x) :
HasDerivAt (fun y => c y ^ n) ((n : π) * c x ^ (n - 1) * c') x := by |
rw [β hasDerivWithinAt_univ] at *
exact hc.pow n
| [
" HasStrictDerivAt (fun x => x ^ 0) (β0 * x ^ (0 - 1)) x",
" HasStrictDerivAt (fun x => x ^ 1) (β1 * x ^ (1 - 1)) x",
" HasStrictDerivAt (fun x => x ^ (n + 1 + 1)) (β(n + 1 + 1) * x ^ (n + 1 + 1 - 1)) x",
" HasDerivAt (fun y => c y ^ n) (βn * c x ^ (n - 1) * c') x",
" HasDerivWithinAt (fun y => c y ^ n) (βn... | [
" HasStrictDerivAt (fun x => x ^ 0) (β0 * x ^ (0 - 1)) x",
" HasStrictDerivAt (fun x => x ^ 1) (β1 * x ^ (1 - 1)) x",
" HasStrictDerivAt (fun x => x ^ (n + 1 + 1)) (β(n + 1 + 1) * x ^ (n + 1 + 1 - 1)) x",
" HasDerivAt (fun y => c y ^ n) (βn * c x ^ (n - 1) * c') x"
] |
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Module.LinearMap.Basic
import Mathlib.Data.Finset.Preimage
import Mathlib.Data.Set.Finite
import Mathlib.GroupTheory.GroupAction.BigOperators
#align_import data.dfinsupp.basic from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
universe u uβ uβ v vβ vβ vβ w x y l
variable {ΞΉ : Type u} {Ξ³ : Type w} {Ξ² : ΞΉ β Type v} {Ξ²β : ΞΉ β Type vβ} {Ξ²β : ΞΉ β Type vβ}
variable (Ξ²)
structure DFinsupp [β i, Zero (Ξ² i)] : Type max u v where mk' ::
toFun : β i, Ξ² i
support' : Trunc { s : Multiset ΞΉ // β i, i β s β¨ toFun i = 0 }
#align dfinsupp DFinsupp
variable {Ξ²}
notation3 "Ξ β "(...)", "r:(scoped f => DFinsupp f) => r
namespace DFinsupp
section Basic
variable [β i, Zero (Ξ² i)] [β i, Zero (Ξ²β i)] [β i, Zero (Ξ²β i)]
instance instDFunLike : DFunLike (Ξ β i, Ξ² i) ΞΉ Ξ² :=
β¨fun f => f.toFun, fun β¨fβ, sββ© β¨fβ, sββ© β¦ fun (h : fβ = fβ) β¦ by
subst h
congr
apply Subsingleton.elim β©
#align dfinsupp.fun_like DFinsupp.instDFunLike
instance : CoeFun (Ξ β i, Ξ² i) fun _ => β i, Ξ² i :=
inferInstance
@[simp]
theorem toFun_eq_coe (f : Ξ β i, Ξ² i) : f.toFun = f :=
rfl
#align dfinsupp.to_fun_eq_coe DFinsupp.toFun_eq_coe
@[ext]
theorem ext {f g : Ξ β i, Ξ² i} (h : β i, f i = g i) : f = g :=
DFunLike.ext _ _ h
#align dfinsupp.ext DFinsupp.ext
#align dfinsupp.ext_iff DFunLike.ext_iff
#align dfinsupp.coe_fn_injective DFunLike.coe_injective
lemma ne_iff {f g : Ξ β i, Ξ² i} : f β g β β i, f i β g i := DFunLike.ne_iff
instance : Zero (Ξ β i, Ξ² i) :=
β¨β¨0, Trunc.mk <| β¨β
, fun _ => Or.inr rflβ©β©β©
instance : Inhabited (Ξ β i, Ξ² i) :=
β¨0β©
@[simp, norm_cast] lemma coe_mk' (f : β i, Ξ² i) (s) : β(β¨f, sβ© : Ξ β i, Ξ² i) = f := rfl
#align dfinsupp.coe_mk' DFinsupp.coe_mk'
@[simp, norm_cast] lemma coe_zero : β(0 : Ξ β i, Ξ² i) = 0 := rfl
#align dfinsupp.coe_zero DFinsupp.coe_zero
theorem zero_apply (i : ΞΉ) : (0 : Ξ β i, Ξ² i) i = 0 :=
rfl
#align dfinsupp.zero_apply DFinsupp.zero_apply
def mapRange (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) (x : Ξ β i, Ξ²β i) : Ξ β i, Ξ²β i :=
β¨fun i => f i (x i),
x.support'.map fun s => β¨s.1, fun i => (s.2 i).imp_right fun h : x i = 0 => by
rw [β hf i, β h]β©β©
#align dfinsupp.map_range DFinsupp.mapRange
@[simp]
theorem mapRange_apply (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) (g : Ξ β i, Ξ²β i) (i : ΞΉ) :
mapRange f hf g i = f i (g i) :=
rfl
#align dfinsupp.map_range_apply DFinsupp.mapRange_apply
@[simp]
theorem mapRange_id (h : β i, id (0 : Ξ²β i) = 0 := fun i => rfl) (g : Ξ β i : ΞΉ, Ξ²β i) :
mapRange (fun i => (id : Ξ²β i β Ξ²β i)) h g = g := by
ext
rfl
#align dfinsupp.map_range_id DFinsupp.mapRange_id
theorem mapRange_comp (f : β i, Ξ²β i β Ξ²β i) (fβ : β i, Ξ² i β Ξ²β i) (hf : β i, f i 0 = 0)
(hfβ : β i, fβ i 0 = 0) (h : β i, (f i β fβ i) 0 = 0) (g : Ξ β i : ΞΉ, Ξ² i) :
mapRange (fun i => f i β fβ i) h g = mapRange f hf (mapRange fβ hfβ g) := by
ext
simp only [mapRange_apply]; rfl
#align dfinsupp.map_range_comp DFinsupp.mapRange_comp
@[simp]
| Mathlib/Data/DFinsupp/Basic.lean | 158 | 161 | theorem mapRange_zero (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) :
mapRange f hf (0 : Ξ β i, Ξ²β i) = 0 := by |
ext
simp only [mapRange_apply, coe_zero, Pi.zero_apply, hf]
| [
" { toFun := fβ, support' := sββ } = { toFun := fβ, support' := sβ }",
" { toFun := fβ, support' := sββ } = { toFun := fβ, support' := sβ }",
" sββ = sβ",
" (fun i => f i (x i)) i = 0",
" mapRange (fun i => id) h g = g",
" (mapRange (fun i => id) h g) iβ = g iβ",
" mapRange (fun i => f i β fβ i) h g = m... | [
" { toFun := fβ, support' := sββ } = { toFun := fβ, support' := sβ }",
" { toFun := fβ, support' := sββ } = { toFun := fβ, support' := sβ }",
" sββ = sβ",
" (fun i => f i (x i)) i = 0",
" mapRange (fun i => id) h g = g",
" (mapRange (fun i => id) h g) iβ = g iβ",
" mapRange (fun i => f i β fβ i) h g = m... |
import Mathlib.Algebra.Order.Interval.Set.Instances
import Mathlib.Order.Interval.Set.ProjIcc
import Mathlib.Topology.Instances.Real
#align_import topology.unit_interval from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open scoped Classical
open Topology Filter
open Set Int Set.Icc
abbrev unitInterval : Set β :=
Set.Icc 0 1
#align unit_interval unitInterval
@[inherit_doc]
scoped[unitInterval] notation "I" => unitInterval
section partition
@[simp]
theorem projIcc_eq_zero {x : β} : projIcc (0 : β) 1 zero_le_one x = 0 β x β€ 0 :=
projIcc_eq_left zero_lt_one
#align proj_Icc_eq_zero projIcc_eq_zero
@[simp]
theorem projIcc_eq_one {x : β} : projIcc (0 : β) 1 zero_le_one x = 1 β 1 β€ x :=
projIcc_eq_right zero_lt_one
#align proj_Icc_eq_one projIcc_eq_one
section
variable {π : Type*} [LinearOrderedField π] [TopologicalSpace π] [TopologicalRing π]
-- We only need the ordering on `π` here to avoid talking about flipping the interval over.
-- At the end of the day I only care about `β`, so I'm hesitant to put work into generalizing.
| Mathlib/Topology/UnitInterval.lean | 323 | 324 | theorem affineHomeomorph_image_I (a b : π) (h : 0 < a) :
affineHomeomorph a b h.ne.symm '' Set.Icc 0 1 = Set.Icc b (a + b) := by | simp [h]
| [
" β(affineHomeomorph a b β―) '' Icc 0 1 = Icc b (a + b)"
] | [
" β(affineHomeomorph a b β―) '' Icc 0 1 = Icc b (a + b)"
] |
import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv
#align_import linear_algebra.quadratic_form.prod from "leanprover-community/mathlib"@"9b2755b951bc323c962bd072cd447b375cf58101"
universe u v w
variable {ΞΉ : Type*} {R : Type*} {Mβ Mβ Nβ Nβ : Type*} {Mα΅’ Nα΅’ : ΞΉ β Type*}
namespace QuadraticForm
section Prod
section Semiring
variable [CommSemiring R]
variable [AddCommMonoid Mβ] [AddCommMonoid Mβ] [AddCommMonoid Nβ] [AddCommMonoid Nβ]
variable [Module R Mβ] [Module R Mβ] [Module R Nβ] [Module R Nβ]
@[simps!]
def prod (Qβ : QuadraticForm R Mβ) (Qβ : QuadraticForm R Mβ) : QuadraticForm R (Mβ Γ Mβ) :=
Qβ.comp (LinearMap.fst _ _ _) + Qβ.comp (LinearMap.snd _ _ _)
#align quadratic_form.prod QuadraticForm.prod
@[simps toLinearEquiv]
def IsometryEquiv.prod
{Qβ : QuadraticForm R Mβ} {Qβ : QuadraticForm R Mβ}
{Qβ' : QuadraticForm R Nβ} {Qβ' : QuadraticForm R Nβ}
(eβ : Qβ.IsometryEquiv Qβ') (eβ : Qβ.IsometryEquiv Qβ') :
(Qβ.prod Qβ).IsometryEquiv (Qβ'.prod Qβ') where
map_app' x := congr_argβ (Β· + Β·) (eβ.map_app x.1) (eβ.map_app x.2)
toLinearEquiv := LinearEquiv.prod eβ.toLinearEquiv eβ.toLinearEquiv
#align quadratic_form.isometry.prod QuadraticForm.IsometryEquiv.prod
@[simps!]
def Isometry.inl (Qβ : QuadraticForm R Mβ) (Qβ : QuadraticForm R Mβ) : Qβ βqα΅’ (Qβ.prod Qβ) where
toLinearMap := LinearMap.inl R _ _
map_app' mβ := by simp
@[simps!]
def Isometry.inr (Qβ : QuadraticForm R Mβ) (Qβ : QuadraticForm R Mβ) : Qβ βqα΅’ (Qβ.prod Qβ) where
toLinearMap := LinearMap.inr R _ _
map_app' mβ := by simp
variable (Mβ) in
@[simps!]
def Isometry.fst (Qβ : QuadraticForm R Mβ) : (Qβ.prod (0 : QuadraticForm R Mβ)) βqα΅’ Qβ where
toLinearMap := LinearMap.fst R _ _
map_app' mβ := by simp
variable (Mβ) in
@[simps!]
def Isometry.snd (Qβ : QuadraticForm R Mβ) : ((0 : QuadraticForm R Mβ).prod Qβ) βqα΅’ Qβ where
toLinearMap := LinearMap.snd R _ _
map_app' mβ := by simp
@[simp]
lemma Isometry.fst_comp_inl (Qβ : QuadraticForm R Mβ) :
(fst Mβ Qβ).comp (inl Qβ (0 : QuadraticForm R Mβ)) = .id _ :=
ext fun _ => rfl
@[simp]
lemma Isometry.snd_comp_inr (Qβ : QuadraticForm R Mβ) :
(snd Mβ Qβ).comp (inr (0 : QuadraticForm R Mβ) Qβ) = .id _ :=
ext fun _ => rfl
@[simp]
lemma Isometry.snd_comp_inl (Qβ : QuadraticForm R Mβ) :
(snd Mβ Qβ).comp (inl (0 : QuadraticForm R Mβ) Qβ) = 0 :=
ext fun _ => rfl
@[simp]
lemma Isometry.fst_comp_inr (Qβ : QuadraticForm R Mβ) :
(fst Mβ Qβ).comp (inr Qβ (0 : QuadraticForm R Mβ)) = 0 :=
ext fun _ => rfl
theorem Equivalent.prod {Qβ : QuadraticForm R Mβ} {Qβ : QuadraticForm R Mβ}
{Qβ' : QuadraticForm R Nβ} {Qβ' : QuadraticForm R Nβ} (eβ : Qβ.Equivalent Qβ')
(eβ : Qβ.Equivalent Qβ') : (Qβ.prod Qβ).Equivalent (Qβ'.prod Qβ') :=
Nonempty.map2 IsometryEquiv.prod eβ eβ
#align quadratic_form.equivalent.prod QuadraticForm.Equivalent.prod
@[simps!]
def IsometryEquiv.prodComm (Qβ : QuadraticForm R Mβ) (Qβ : QuadraticForm R Mβ) :
(Qβ.prod Qβ).IsometryEquiv (Qβ.prod Qβ) where
toLinearEquiv := LinearEquiv.prodComm _ _ _
map_app' _ := add_comm _ _
@[simps!]
def IsometryEquiv.prodProdProdComm
(Qβ : QuadraticForm R Mβ) (Qβ : QuadraticForm R Mβ)
(Qβ : QuadraticForm R Nβ) (Qβ : QuadraticForm R Nβ) :
((Qβ.prod Qβ).prod (Qβ.prod Qβ)).IsometryEquiv ((Qβ.prod Qβ).prod (Qβ.prod Qβ)) where
toLinearEquiv := LinearEquiv.prodProdProdComm _ _ _ _ _
map_app' _ := add_add_add_comm _ _ _ _
theorem anisotropic_of_prod {R} [OrderedCommRing R] [Module R Mβ] [Module R Mβ]
{Qβ : QuadraticForm R Mβ} {Qβ : QuadraticForm R Mβ} (h : (Qβ.prod Qβ).Anisotropic) :
Qβ.Anisotropic β§ Qβ.Anisotropic := by
simp_rw [Anisotropic, prod_apply, Prod.forall, Prod.mk_eq_zero] at h
constructor
Β· intro x hx
refine (h x 0 ?_).1
rw [hx, zero_add, map_zero]
Β· intro x hx
refine (h 0 x ?_).2
rw [hx, add_zero, map_zero]
#align quadratic_form.anisotropic_of_prod QuadraticForm.anisotropic_of_prod
| Mathlib/LinearAlgebra/QuadraticForm/Prod.lean | 150 | 160 | theorem nonneg_prod_iff {R} [OrderedCommRing R] [Module R Mβ] [Module R Mβ]
{Qβ : QuadraticForm R Mβ} {Qβ : QuadraticForm R Mβ} :
(β x, 0 β€ (Qβ.prod Qβ) x) β (β x, 0 β€ Qβ x) β§ β x, 0 β€ Qβ x := by |
simp_rw [Prod.forall, prod_apply]
constructor
Β· intro h
constructor
Β· intro x; simpa only [add_zero, map_zero] using h x 0
Β· intro x; simpa only [zero_add, map_zero] using h 0 x
Β· rintro β¨hβ, hββ© xβ xβ
exact add_nonneg (hβ xβ) (hβ xβ)
| [
" (Qβ.prod Qβ) ((LinearMap.inl R Mβ Mβ).toFun mβ) = Qβ mβ",
" (Qβ.prod Qβ) ((LinearMap.inr R Mβ Mβ).toFun mβ) = Qβ mβ",
" Qβ ((LinearMap.fst R Mβ Mβ).toFun mβ) = (Qβ.prod 0) mβ",
" Qβ ((LinearMap.snd R Mβ Mβ).toFun mβ) = (prod 0 Qβ) mβ",
" Qβ.Anisotropic β§ Qβ.Anisotropic",
" Qβ.Anisotropic",
" x = 0",
... | [
" (Qβ.prod Qβ) ((LinearMap.inl R Mβ Mβ).toFun mβ) = Qβ mβ",
" (Qβ.prod Qβ) ((LinearMap.inr R Mβ Mβ).toFun mβ) = Qβ mβ",
" Qβ ((LinearMap.fst R Mβ Mβ).toFun mβ) = (Qβ.prod 0) mβ",
" Qβ ((LinearMap.snd R Mβ Mβ).toFun mβ) = (prod 0 Qβ) mβ",
" Qβ.Anisotropic β§ Qβ.Anisotropic",
" Qβ.Anisotropic",
" x = 0",
... |
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.Algebra.Polynomial.HasseDeriv
#align_import data.polynomial.taylor from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
namespace Polynomial
open Polynomial
variable {R : Type*} [Semiring R] (r : R) (f : R[X])
def taylor (r : R) : R[X] ββ[R] R[X] where
toFun f := f.comp (X + C r)
map_add' f g := add_comp
map_smul' c f := by simp only [smul_eq_C_mul, C_mul_comp, RingHom.id_apply]
#align polynomial.taylor Polynomial.taylor
theorem taylor_apply : taylor r f = f.comp (X + C r) :=
rfl
#align polynomial.taylor_apply Polynomial.taylor_apply
@[simp]
| Mathlib/Algebra/Polynomial/Taylor.lean | 46 | 46 | theorem taylor_X : taylor r X = X + C r := by | simp only [taylor_apply, X_comp]
| [
" { toFun := fun f => f.comp (X + C r), map_add' := β― }.toFun (c β’ f) =\n (RingHom.id R) c β’ { toFun := fun f => f.comp (X + C r), map_add' := β― }.toFun f",
" (taylor r) X = X + C r"
] | [
" { toFun := fun f => f.comp (X + C r), map_add' := β― }.toFun (c β’ f) =\n (RingHom.id R) c β’ { toFun := fun f => f.comp (X + C r), map_add' := β― }.toFun f",
" (taylor r) X = X + C r"
] |
import Mathlib.NumberTheory.Padics.PadicIntegers
import Mathlib.RingTheory.ZMod
#align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950"
noncomputable section
open scoped Classical
open Nat LocalRing Padic
namespace PadicInt
variable {p : β} [hp_prime : Fact p.Prime]
section RingHoms
variable (p) (r : β)
def modPart : β€ :=
r.num * gcdA r.den p % p
#align padic_int.mod_part PadicInt.modPart
variable {p}
theorem modPart_lt_p : modPart p r < p := by
convert Int.emod_lt _ _
Β· simp
Β· exact mod_cast hp_prime.1.ne_zero
#align padic_int.mod_part_lt_p PadicInt.modPart_lt_p
theorem modPart_nonneg : 0 β€ modPart p r :=
Int.emod_nonneg _ <| mod_cast hp_prime.1.ne_zero
#align padic_int.mod_part_nonneg PadicInt.modPart_nonneg
| Mathlib/NumberTheory/Padics/RingHoms.lean | 82 | 101 | theorem isUnit_den (r : β) (h : β(r : β_[p])β β€ 1) : IsUnit (r.den : β€_[p]) := by |
rw [isUnit_iff]
apply le_antisymm (r.den : β€_[p]).2
rw [β not_lt, coe_natCast]
intro norm_denom_lt
have hr : β(r * r.den : β_[p])β = β(r.num : β_[p])β := by
congr
rw_mod_cast [@Rat.mul_den_eq_num r]
rw [padicNormE.mul] at hr
have key : β(r.num : β_[p])β < 1 := by
calc
_ = _ := hr.symm
_ < 1 * 1 := mul_lt_mul' h norm_denom_lt (norm_nonneg _) zero_lt_one
_ = 1 := mul_one 1
have : βp β£ r.num β§ (p : β€) β£ r.den := by
simp only [β norm_int_lt_one_iff_dvd, β padic_norm_e_of_padicInt]
exact β¨key, norm_denom_ltβ©
apply hp_prime.1.not_dvd_one
rwa [β r.reduced.gcd_eq_one, Nat.dvd_gcd_iff, β Int.natCast_dvd, β Int.natCast_dvd_natCast]
| [
" modPart p r < βp",
" βp = |βp|",
" βp β 0",
" IsUnit βr.den",
" ββr.denβ = 1",
" 1 β€ βββr.denβ",
" Β¬ββr.denβ < 1",
" False",
" ββr * βr.denβ = ββr.numβ",
" βr * βr.den = βr.num",
" ββr.numβ < 1",
" βp β£ r.num β§ βp β£ βr.den",
" βββr.numβ < 1 β§ ββββr.denβ < 1",
" p β£ 1"
] | [
" modPart p r < βp",
" βp = |βp|",
" βp β 0",
" IsUnit βr.den"
] |
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.RingTheory.Ideal.LocalRing
import Mathlib.RingTheory.Valuation.PrimeMultiplicity
import Mathlib.RingTheory.AdicCompletion.Basic
#align_import ring_theory.discrete_valuation_ring.basic from "leanprover-community/mathlib"@"c163ec99dfc664628ca15d215fce0a5b9c265b68"
open scoped Classical
universe u
open Ideal LocalRing
class DiscreteValuationRing (R : Type u) [CommRing R] [IsDomain R]
extends IsPrincipalIdealRing R, LocalRing R : Prop where
not_a_field' : maximalIdeal R β β₯
#align discrete_valuation_ring DiscreteValuationRing
namespace DiscreteValuationRing
variable (R : Type*)
def HasUnitMulPowIrreducibleFactorization [CommRing R] : Prop :=
β p : R, Irreducible p β§ β {x : R}, x β 0 β β n : β, Associated (p ^ n) x
#align discrete_valuation_ring.has_unit_mul_pow_irreducible_factorization DiscreteValuationRing.HasUnitMulPowIrreducibleFactorization
namespace HasUnitMulPowIrreducibleFactorization
variable {R} [CommRing R] (hR : HasUnitMulPowIrreducibleFactorization R)
theorem unique_irreducible β¦p q : Rβ¦ (hp : Irreducible p) (hq : Irreducible q) :
Associated p q := by
rcases hR with β¨Ο, hΟ, hRβ©
suffices β {p : R} (_ : Irreducible p), Associated p Ο by
apply Associated.trans (this hp) (this hq).symm
clear hp hq p q
intro p hp
obtain β¨n, hnβ© := hR hp.ne_zero
have : Irreducible (Ο ^ n) := hn.symm.irreducible hp
rcases lt_trichotomy n 1 with (H | rfl | H)
Β· obtain rfl : n = 0 := by
clear hn this
revert H n
decide
simp [not_irreducible_one, pow_zero] at this
Β· simpa only [pow_one] using hn.symm
Β· obtain β¨n, rflβ© : β k, n = 1 + k + 1 := Nat.exists_eq_add_of_lt H
rw [pow_succ'] at this
rcases this.isUnit_or_isUnit rfl with (H0 | H0)
Β· exact (hΟ.not_unit H0).elim
Β· rw [add_comm, pow_succ'] at H0
exact (hΟ.not_unit (isUnit_of_mul_isUnit_left H0)).elim
#align discrete_valuation_ring.has_unit_mul_pow_irreducible_factorization.unique_irreducible DiscreteValuationRing.HasUnitMulPowIrreducibleFactorization.unique_irreducible
variable [IsDomain R]
theorem toUniqueFactorizationMonoid : UniqueFactorizationMonoid R :=
let p := Classical.choose hR
let spec := Classical.choose_spec hR
UniqueFactorizationMonoid.of_exists_prime_factors fun x hx => by
use Multiset.replicate (Classical.choose (spec.2 hx)) p
constructor
Β· intro q hq
have hpq := Multiset.eq_of_mem_replicate hq
rw [hpq]
refine β¨spec.1.ne_zero, spec.1.not_unit, ?_β©
intro a b h
by_cases ha : a = 0
Β· rw [ha]
simp only [true_or_iff, dvd_zero]
obtain β¨m, u, rflβ© := spec.2 ha
rw [mul_assoc, mul_left_comm, Units.dvd_mul_left] at h
rw [Units.dvd_mul_right]
by_cases hm : m = 0
Β· simp only [hm, one_mul, pow_zero] at h β’
right
exact h
left
obtain β¨m, rflβ© := Nat.exists_eq_succ_of_ne_zero hm
rw [pow_succ']
apply dvd_mul_of_dvd_left dvd_rfl _
Β· rw [Multiset.prod_replicate]
exact Classical.choose_spec (spec.2 hx)
#align discrete_valuation_ring.has_unit_mul_pow_irreducible_factorization.to_unique_factorization_monoid DiscreteValuationRing.HasUnitMulPowIrreducibleFactorization.toUniqueFactorizationMonoid
| Mathlib/RingTheory/DiscreteValuationRing/Basic.lean | 227 | 245 | theorem of_ufd_of_unique_irreducible [UniqueFactorizationMonoid R] (hβ : β p : R, Irreducible p)
(hβ : β β¦p q : Rβ¦, Irreducible p β Irreducible q β Associated p q) :
HasUnitMulPowIrreducibleFactorization R := by |
obtain β¨p, hpβ© := hβ
refine β¨p, hp, ?_β©
intro x hx
cases' WfDvdMonoid.exists_factors x hx with fx hfx
refine β¨Multiset.card fx, ?_β©
have H := hfx.2
rw [β Associates.mk_eq_mk_iff_associated] at H β’
rw [β H, β Associates.prod_mk, Associates.mk_pow, β Multiset.prod_replicate]
congr 1
symm
rw [Multiset.eq_replicate]
simp only [true_and_iff, and_imp, Multiset.card_map, eq_self_iff_true, Multiset.mem_map,
exists_imp]
rintro _ q hq rfl
rw [Associates.mk_eq_mk_iff_associated]
apply hβ (hfx.1 _ hq) hp
| [
" Associated p q",
" β {p : R}, Irreducible p β Associated p Ο",
" Associated p Ο",
" n = 0",
" β n < 1, n = 0",
" β f, (β b β f, Prime b) β§ Associated f.prod x",
" (β b β Multiset.replicate (Classical.choose β―) p, Prime b) β§\n Associated (Multiset.replicate (Classical.choose β―) p).prod x",
" β b β... | [
" Associated p q",
" β {p : R}, Irreducible p β Associated p Ο",
" Associated p Ο",
" n = 0",
" β n < 1, n = 0",
" β f, (β b β f, Prime b) β§ Associated f.prod x",
" (β b β Multiset.replicate (Classical.choose β―) p, Prime b) β§\n Associated (Multiset.replicate (Classical.choose β―) p).prod x",
" β b β... |
import Mathlib.Topology.Separation
import Mathlib.Algebra.Group.Defs
#align_import topology.algebra.semigroup from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514"
@[to_additive
"Any nonempty compact Hausdorff additive semigroup where right-addition is continuous
contains an idempotent, i.e. an `m` such that `m + m = m`"]
theorem exists_idempotent_of_compact_t2_of_continuous_mul_left {M} [Nonempty M] [Semigroup M]
[TopologicalSpace M] [CompactSpace M] [T2Space M]
(continuous_mul_left : β r : M, Continuous (Β· * r)) : β m : M, m * m = m := by
let S : Set (Set M) :=
{ N | IsClosed N β§ N.Nonempty β§ β (m) (_ : m β N) (m') (_ : m' β N), m * m' β N }
rsuffices β¨N, β¨N_closed, β¨m, hmβ©, N_mulβ©, N_minimalβ© : β N β S, β N' β S, N' β N β N' = N
Β· use m
have scaling_eq_self : (Β· * m) '' N = N := by
apply N_minimal
Β· refine β¨(continuous_mul_left m).isClosedMap _ N_closed, β¨_, β¨m, hm, rflβ©β©, ?_β©
rintro _ β¨m'', hm'', rflβ© _ β¨m', hm', rflβ©
exact β¨m'' * m * m', N_mul _ (N_mul _ hm'' _ hm) _ hm', mul_assoc _ _ _β©
Β· rintro _ β¨m', hm', rflβ©
exact N_mul _ hm' _ hm
have absorbing_eq_self : N β© { m' | m' * m = m } = N := by
apply N_minimal
Β· refine β¨N_closed.inter ((T1Space.t1 m).preimage (continuous_mul_left m)), ?_, ?_β©
Β· rwa [β scaling_eq_self] at hm
Β· rintro m'' β¨mem'', eq'' : _ = mβ© m' β¨mem', eq' : _ = mβ©
refine β¨N_mul _ mem'' _ mem', ?_β©
rw [Set.mem_setOf_eq, mul_assoc, eq', eq'']
apply Set.inter_subset_left
-- Thus `m * m = m` as desired.
rw [β absorbing_eq_self] at hm
exact hm.2
refine zorn_superset _ fun c hcs hc => ?_
refine
β¨ββ c, β¨isClosed_sInter fun t ht => (hcs ht).1, ?_, fun m hm m' hm' => ?_β©, fun s hs =>
Set.sInter_subset_of_mem hsβ©
Β· obtain rfl | hcnemp := c.eq_empty_or_nonempty
Β· rw [Set.sInter_empty]
apply Set.univ_nonempty
convert
@IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed _ _ _ hcnemp.coe_sort
((β) : c β Set M) ?_ ?_ ?_ ?_
Β· exact Set.sInter_eq_iInter
Β· refine DirectedOn.directed_val (IsChain.directedOn hc.symm)
exacts [fun i => (hcs i.prop).2.1, fun i => (hcs i.prop).1.isCompact, fun i => (hcs i.prop).1]
Β· rw [Set.mem_sInter]
exact fun t ht => (hcs ht).2.2 m (Set.mem_sInter.mp hm t ht) m' (Set.mem_sInter.mp hm' t ht)
#align exists_idempotent_of_compact_t2_of_continuous_mul_left exists_idempotent_of_compact_t2_of_continuous_mul_left
#align exists_idempotent_of_compact_t2_of_continuous_add_left exists_idempotent_of_compact_t2_of_continuous_add_left
@[to_additive exists_idempotent_in_compact_add_subsemigroup
"A version of
`exists_idempotent_of_compact_t2_of_continuous_add_left` where the idempotent lies in
some specified nonempty compact additive subsemigroup."]
| Mathlib/Topology/Algebra/Semigroup.lean | 82 | 95 | theorem exists_idempotent_in_compact_subsemigroup {M} [Semigroup M] [TopologicalSpace M] [T2Space M]
(continuous_mul_left : β r : M, Continuous (Β· * r)) (s : Set M) (snemp : s.Nonempty)
(s_compact : IsCompact s) (s_add : βα΅ (x β s) (y β s), x * y β s) :
β m β s, m * m = m := by |
let M' := { m // m β s }
letI : Semigroup M' :=
{ mul := fun p q => β¨p.1 * q.1, s_add _ p.2 _ q.2β©
mul_assoc := fun p q r => Subtype.eq (mul_assoc _ _ _) }
haveI : CompactSpace M' := isCompact_iff_compactSpace.mp s_compact
haveI : Nonempty M' := nonempty_subtype.mpr snemp
have : β p : M', Continuous (Β· * p) := fun p =>
((continuous_mul_left p.1).comp continuous_subtype_val).subtype_mk _
obtain β¨β¨m, hmβ©, idemβ© := exists_idempotent_of_compact_t2_of_continuous_mul_left this
exact β¨m, hm, Subtype.ext_iff.mp idemβ©
| [
" β m, m * m = m",
" m * m = m",
" (fun x => x * m) '' N = N",
" (fun x => x * m) '' N β S",
" β m_1 β (fun x => x * m) '' N, β m' β (fun x => x * m) '' N, m_1 * m' β (fun x => x * m) '' N",
" (fun x => x * m) m'' * (fun x => x * m) m' β (fun x => x * m) '' N",
" (fun x => x * m) '' N β N",
" (fun x =... | [
" β m, m * m = m",
" m * m = m",
" (fun x => x * m) '' N = N",
" (fun x => x * m) '' N β S",
" β m_1 β (fun x => x * m) '' N, β m' β (fun x => x * m) '' N, m_1 * m' β (fun x => x * m) '' N",
" (fun x => x * m) m'' * (fun x => x * m) m' β (fun x => x * m) '' N",
" (fun x => x * m) '' N β N",
" (fun x =... |
import Mathlib.Probability.ProbabilityMassFunction.Basic
import Mathlib.Probability.ProbabilityMassFunction.Constructions
import Mathlib.MeasureTheory.Integral.Bochner
namespace PMF
open MeasureTheory ENNReal TopologicalSpace
section General
variable {Ξ± : Type*} [MeasurableSpace Ξ±] [MeasurableSingletonClass Ξ±]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E]
theorem integral_eq_tsum (p : PMF Ξ±) (f : Ξ± β E) (hf : Integrable f p.toMeasure) :
β« a, f a β(p.toMeasure) = β' a, (p a).toReal β’ f a := calc
_ = β« a in p.support, f a β(p.toMeasure) := by rw [restrict_toMeasure_support p]
_ = β' (a : support p), (p.toMeasure {a.val}).toReal β’ f a := by
apply integral_countable f p.support_countable
rwa [restrict_toMeasure_support p]
_ = β' (a : support p), (p a).toReal β’ f a := by
congr with x; congr 2
apply PMF.toMeasure_apply_singleton p x (MeasurableSet.singleton _)
_ = β' a, (p a).toReal β’ f a :=
tsum_subtype_eq_of_support_subset <| by calc
(fun a β¦ (p a).toReal β’ f a).support β (fun a β¦ (p a).toReal).support :=
Function.support_smul_subset_left _ _
_ β support p := fun x h1 h2 => h1 (by simp [h2])
| Mathlib/Probability/ProbabilityMassFunction/Integrals.lean | 43 | 47 | theorem integral_eq_sum [Fintype Ξ±] (p : PMF Ξ±) (f : Ξ± β E) :
β« a, f a β(p.toMeasure) = β a, (p a).toReal β’ f a := by |
rw [integral_fintype _ (.of_finite _ f)]
congr with x; congr 2
exact PMF.toMeasure_apply_singleton p x (MeasurableSet.singleton _)
| [
" β« (a : Ξ±), f a βp.toMeasure = β« (a : Ξ±) in p.support, f a βp.toMeasure",
" β« (a : Ξ±) in p.support, f a βp.toMeasure = β' (a : βp.support), (p.toMeasure {βa}).toReal β’ f βa",
" Integrable f (p.toMeasure.restrict p.support)",
" β' (a : βp.support), (p.toMeasure {βa}).toReal β’ f βa = β' (a : βp.support), (p βa... | [
" β« (a : Ξ±), f a βp.toMeasure = β« (a : Ξ±) in p.support, f a βp.toMeasure",
" β« (a : Ξ±) in p.support, f a βp.toMeasure = β' (a : βp.support), (p.toMeasure {βa}).toReal β’ f βa",
" Integrable f (p.toMeasure.restrict p.support)",
" β' (a : βp.support), (p.toMeasure {βa}).toReal β’ f βa = β' (a : βp.support), (p βa... |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ΞΉ Ξ± Ξ² : Type*} {Ο : ΞΉ β Type*}
def symmDiff [Sup Ξ±] [SDiff Ξ±] (a b : Ξ±) : Ξ± :=
a \ b β b \ a
#align symm_diff symmDiff
def bihimp [Inf Ξ±] [HImp Ξ±] (a b : Ξ±) : Ξ± :=
(b β¨ a) β (a β¨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " β " => symmDiff
scoped[symmDiff] infixl:100 " β " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup Ξ±] [SDiff Ξ±] (a b : Ξ±) : a β b = a \ b β b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf Ξ±] [HImp Ξ±] (a b : Ξ±) : a β b = (b β¨ a) β (a β¨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p β q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p β q β (p β q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : β p q : Bool, p β q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra Ξ±] (a b c d : Ξ±)
@[simp]
theorem toDual_symmDiff : toDual (a β b) = toDual a β toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : Ξ±α΅α΅) : ofDual (a β b) = ofDual a β ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a β b = b β a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (Ξ± := Ξ±) (Β· β Β·) :=
β¨symmDiff_commβ©
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a β a = β₯ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a β β₯ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : β₯ β a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
theorem symmDiff_eq_bot {a b : Ξ±} : a β b = β₯ β a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
#align symm_diff_eq_bot symmDiff_eq_bot
theorem symmDiff_of_le {a b : Ξ±} (h : a β€ b) : a β b = b \ a := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
#align symm_diff_of_le symmDiff_of_le
theorem symmDiff_of_ge {a b : Ξ±} (h : b β€ a) : a β b = a \ b := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq]
#align symm_diff_of_ge symmDiff_of_ge
theorem symmDiff_le {a b c : Ξ±} (ha : a β€ b β c) (hb : b β€ a β c) : a β b β€ c :=
sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb
#align symm_diff_le symmDiff_le
theorem symmDiff_le_iff {a b c : Ξ±} : a β b β€ c β a β€ b β c β§ b β€ a β c := by
simp_rw [symmDiff, sup_le_iff, sdiff_le_iff]
#align symm_diff_le_iff symmDiff_le_iff
@[simp]
theorem symmDiff_le_sup {a b : Ξ±} : a β b β€ a β b :=
sup_le_sup sdiff_le sdiff_le
#align symm_diff_le_sup symmDiff_le_sup
theorem symmDiff_eq_sup_sdiff_inf : a β b = (a β b) \ (a β b) := by simp [sup_sdiff, symmDiff]
#align symm_diff_eq_sup_sdiff_inf symmDiff_eq_sup_sdiff_inf
| Mathlib/Order/SymmDiff.lean | 161 | 162 | theorem Disjoint.symmDiff_eq_sup {a b : Ξ±} (h : Disjoint a b) : a β b = a β b := by |
rw [symmDiff, h.sdiff_eq_left, h.sdiff_eq_right]
| [
" β (p q : Bool), p β q = xor p q",
" a β b = b β a",
" a β a = β₯",
" a β β₯ = a",
" β₯ β a = a",
" a β b = β₯ β a = b",
" a β b = b \\ a",
" a β b = a \\ b",
" a β b β€ c β a β€ b β c β§ b β€ a β c",
" a β b = (a β b) \\ (a β b)",
" a β b = a β b"
] | [
" β (p q : Bool), p β q = xor p q",
" a β b = b β a",
" a β a = β₯",
" a β β₯ = a",
" β₯ β a = a",
" a β b = β₯ β a = b",
" a β b = b \\ a",
" a β b = a \\ b",
" a β b β€ c β a β€ b β c β§ b β€ a β c",
" a β b = (a β b) \\ (a β b)",
" a β b = a β b"
] |
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.Topology.Semicontinuous
import Mathlib.MeasureTheory.Integral.Bochner
import Mathlib.Topology.Instances.EReal
#align_import measure_theory.integral.vitali_caratheodory from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2"
open scoped ENNReal NNReal
open MeasureTheory MeasureTheory.Measure
variable {Ξ± : Type*} [TopologicalSpace Ξ±] [MeasurableSpace Ξ±] [BorelSpace Ξ±] (ΞΌ : Measure Ξ±)
[WeaklyRegular ΞΌ]
namespace MeasureTheory
local infixr:25 " ββ " => SimpleFunc
| Mathlib/MeasureTheory/Integral/VitaliCaratheodory.lean | 93 | 152 | theorem SimpleFunc.exists_le_lowerSemicontinuous_lintegral_ge (f : Ξ± ββ ββ₯0) {Ξ΅ : ββ₯0β}
(Ξ΅0 : Ξ΅ β 0) :
β g : Ξ± β ββ₯0, (β x, f x β€ g x) β§ LowerSemicontinuous g β§
(β«β» x, g x βΞΌ) β€ (β«β» x, f x βΞΌ) + Ξ΅ := by |
induction' f using MeasureTheory.SimpleFunc.induction with c s hs fβ fβ _ hβ hβ generalizing Ξ΅
Β· let f := SimpleFunc.piecewise s hs (SimpleFunc.const Ξ± c) (SimpleFunc.const Ξ± 0)
by_cases h : β«β» x, f x βΞΌ = β€
Β· refine
β¨fun _ => c, fun x => ?_, lowerSemicontinuous_const, by
simp only [_root_.top_add, le_top, h]β©
simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero,
Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise]
exact Set.indicator_le_self _ _ _
by_cases hc : c = 0
Β· refine β¨fun _ => 0, ?_, lowerSemicontinuous_const, ?_β©
Β· classical
simp only [hc, Set.indicator_zero', Pi.zero_apply, SimpleFunc.const_zero, imp_true_iff,
eq_self_iff_true, SimpleFunc.coe_zero, Set.piecewise_eq_indicator,
SimpleFunc.coe_piecewise, le_zero_iff]
Β· simp only [lintegral_const, zero_mul, zero_le, ENNReal.coe_zero]
have ne_top : ΞΌ s β β€ := by
classical
simpa [f, hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const,
Function.const_apply, lintegral_const, ENNReal.coe_indicator, Set.univ_inter,
ENNReal.coe_ne_top, MeasurableSet.univ, ENNReal.mul_eq_top, SimpleFunc.const_zero,
or_false_iff, lintegral_indicator, ENNReal.coe_eq_zero, Ne, not_false_iff,
SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, false_and_iff,
restrict_apply] using h
have : ΞΌ s < ΞΌ s + Ξ΅ / c := by
have : (0 : ββ₯0β) < Ξ΅ / c := ENNReal.div_pos_iff.2 β¨Ξ΅0, ENNReal.coe_ne_topβ©
simpa using ENNReal.add_lt_add_left ne_top this
obtain β¨u, su, u_open, ΞΌuβ© : β (u : _), u β s β§ IsOpen u β§ ΞΌ u < ΞΌ s + Ξ΅ / c :=
s.exists_isOpen_lt_of_lt _ this
refine β¨Set.indicator u fun _ => c,
fun x => ?_, u_open.lowerSemicontinuous_indicator (zero_le _), ?_β©
Β· simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero,
Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise]
exact Set.indicator_le_indicator_of_subset su (fun x => zero_le _) _
Β· suffices (c : ββ₯0β) * ΞΌ u β€ c * ΞΌ s + Ξ΅ by
classical
simpa only [ENNReal.coe_indicator, u_open.measurableSet, lintegral_indicator,
lintegral_const, MeasurableSet.univ, Measure.restrict_apply, Set.univ_inter, const_zero,
coe_piecewise, coe_const, coe_zero, Set.piecewise_eq_indicator, Function.const_apply, hs]
calc
(c : ββ₯0β) * ΞΌ u β€ c * (ΞΌ s + Ξ΅ / c) := mul_le_mul_left' ΞΌu.le _
_ = c * ΞΌ s + Ξ΅ := by
simp_rw [mul_add]
rw [ENNReal.mul_div_cancel' _ ENNReal.coe_ne_top]
simpa using hc
Β· rcases hβ (ENNReal.half_pos Ξ΅0).ne' with β¨gβ, fβ_le_gβ, gβcont, gβintβ©
rcases hβ (ENNReal.half_pos Ξ΅0).ne' with β¨gβ, fβ_le_gβ, gβcont, gβintβ©
refine
β¨fun x => gβ x + gβ x, fun x => add_le_add (fβ_le_gβ x) (fβ_le_gβ x), gβcont.add gβcont, ?_β©
simp only [SimpleFunc.coe_add, ENNReal.coe_add, Pi.add_apply]
rw [lintegral_add_left fβ.measurable.coe_nnreal_ennreal,
lintegral_add_left gβcont.measurable.coe_nnreal_ennreal]
convert add_le_add gβint gβint using 1
conv_lhs => rw [β ENNReal.add_halves Ξ΅]
abel
| [
" β g, (β (x : Ξ±), βf x β€ g x) β§ LowerSemicontinuous g β§ β«β» (x : Ξ±), β(g x) βΞΌ β€ β«β» (x : Ξ±), β(βf x) βΞΌ + Ξ΅",
" β g,\n (β (x : Ξ±), β(piecewise s hs (const Ξ± c) (const Ξ± 0)) x β€ g x) β§\n LowerSemicontinuous g β§ β«β» (x : Ξ±), β(g x) βΞΌ β€ β«β» (x : Ξ±), β(β(piecewise s hs (const Ξ± c) (const Ξ± 0)) x) βΞΌ + Ξ΅",
" ... | [
" β g, (β (x : Ξ±), βf x β€ g x) β§ LowerSemicontinuous g β§ β«β» (x : Ξ±), β(g x) βΞΌ β€ β«β» (x : Ξ±), β(βf x) βΞΌ + Ξ΅"
] |
import Mathlib.Probability.Kernel.Disintegration.Unique
import Mathlib.Probability.Notation
#align_import probability.kernel.cond_distrib from "leanprover-community/mathlib"@"00abe0695d8767201e6d008afa22393978bb324d"
open MeasureTheory Set Filter TopologicalSpace
open scoped ENNReal MeasureTheory ProbabilityTheory
namespace ProbabilityTheory
variable {Ξ± Ξ² Ξ© F : Type*} [MeasurableSpace Ξ©] [StandardBorelSpace Ξ©]
[Nonempty Ξ©] [NormedAddCommGroup F] {mΞ± : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} [IsFiniteMeasure ΞΌ]
{X : Ξ± β Ξ²} {Y : Ξ± β Ξ©}
noncomputable irreducible_def condDistrib {_ : MeasurableSpace Ξ±} [MeasurableSpace Ξ²] (Y : Ξ± β Ξ©)
(X : Ξ± β Ξ²) (ΞΌ : Measure Ξ±) [IsFiniteMeasure ΞΌ] : kernel Ξ² Ξ© :=
(ΞΌ.map fun a => (X a, Y a)).condKernel
#align probability_theory.cond_distrib ProbabilityTheory.condDistrib
instance [MeasurableSpace Ξ²] : IsMarkovKernel (condDistrib Y X ΞΌ) := by
rw [condDistrib]; infer_instance
variable {mΞ² : MeasurableSpace Ξ²} {s : Set Ξ©} {t : Set Ξ²} {f : Ξ² Γ Ξ© β F}
lemma condDistrib_apply_of_ne_zero [MeasurableSingletonClass Ξ²]
(hY : Measurable Y) (x : Ξ²) (hX : ΞΌ.map X {x} β 0) (s : Set Ξ©) :
condDistrib Y X ΞΌ x s = (ΞΌ.map X {x})β»ΒΉ * ΞΌ.map (fun a => (X a, Y a)) ({x} ΓΛ’ s) := by
rw [condDistrib, Measure.condKernel_apply_of_ne_zero _ s]
Β· rw [Measure.fst_map_prod_mk hY]
Β· rwa [Measure.fst_map_prod_mk hY]
theorem condDistrib_ae_eq_of_measure_eq_compProd (hX : Measurable X) (hY : Measurable Y)
(ΞΊ : kernel Ξ² Ξ©) [IsFiniteKernel ΞΊ] (hΞΊ : ΞΌ.map (fun x => (X x, Y x)) = ΞΌ.map X ββ ΞΊ) :
βα΅ x βΞΌ.map X, ΞΊ x = condDistrib Y X ΞΌ x := by
have heq : ΞΌ.map X = (ΞΌ.map (fun x β¦ (X x, Y x))).fst := by
ext s hs
rw [Measure.map_apply hX hs, Measure.fst_apply hs, Measure.map_apply]
exacts [rfl, Measurable.prod hX hY, measurable_fst hs]
rw [heq, condDistrib]
refine eq_condKernel_of_measure_eq_compProd _ ?_
convert hΞΊ
exact heq.symm
section Integrability
theorem integrable_toReal_condDistrib (hX : AEMeasurable X ΞΌ) (hs : MeasurableSet s) :
Integrable (fun a => (condDistrib Y X ΞΌ (X a) s).toReal) ΞΌ := by
refine integrable_toReal_of_lintegral_ne_top ?_ ?_
Β· exact Measurable.comp_aemeasurable (kernel.measurable_coe _ hs) hX
Β· refine ne_of_lt ?_
calc
β«β» a, condDistrib Y X ΞΌ (X a) s βΞΌ β€ β«β» _, 1 βΞΌ := lintegral_mono fun a => prob_le_one
_ = ΞΌ univ := lintegral_one
_ < β := measure_lt_top _ _
#align probability_theory.integrable_to_real_cond_distrib ProbabilityTheory.integrable_toReal_condDistrib
| Mathlib/Probability/Kernel/CondDistrib.lean | 145 | 148 | theorem _root_.MeasureTheory.Integrable.condDistrib_ae_map
(hY : AEMeasurable Y ΞΌ) (hf_int : Integrable f (ΞΌ.map fun a => (X a, Y a))) :
βα΅ b βΞΌ.map X, Integrable (fun Ο => f (b, Ο)) (condDistrib Y X ΞΌ b) := by |
rw [condDistrib, β Measure.fst_map_prod_mkβ (X := X) hY]; exact hf_int.condKernel_ae
| [
" IsMarkovKernel (condDistrib Y X ΞΌ)",
" IsMarkovKernel (Measure.map (fun a => (X a, Y a)) ΞΌ).condKernel",
" ((condDistrib Y X ΞΌ) x) s = ((Measure.map X ΞΌ) {x})β»ΒΉ * (Measure.map (fun a => (X a, Y a)) ΞΌ) ({x} ΓΛ’ s)",
" ((Measure.map (fun a => (X a, Y a)) ΞΌ).fst {x})β»ΒΉ * (Measure.map (fun a => (X a, Y a)) ΞΌ) ({... | [
" IsMarkovKernel (condDistrib Y X ΞΌ)",
" IsMarkovKernel (Measure.map (fun a => (X a, Y a)) ΞΌ).condKernel",
" ((condDistrib Y X ΞΌ) x) s = ((Measure.map X ΞΌ) {x})β»ΒΉ * (Measure.map (fun a => (X a, Y a)) ΞΌ) ({x} ΓΛ’ s)",
" ((Measure.map (fun a => (X a, Y a)) ΞΌ).fst {x})β»ΒΉ * (Measure.map (fun a => (X a, Y a)) ΞΌ) ({... |
import Mathlib.Topology.Algebra.InfiniteSum.Basic
import Mathlib.Topology.Algebra.UniformGroup
noncomputable section
open Filter Finset Function
open scoped Topology
variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*}
section TopologicalGroup
variable [CommGroup Ξ±] [TopologicalSpace Ξ±] [TopologicalGroup Ξ±]
variable {f g : Ξ² β Ξ±} {a aβ aβ : Ξ±}
-- `by simpa using` speeds up elaboration. Why?
@[to_additive]
theorem HasProd.inv (h : HasProd f a) : HasProd (fun b β¦ (f b)β»ΒΉ) aβ»ΒΉ := by
simpa only using h.map (MonoidHom.id Ξ±)β»ΒΉ continuous_inv
#align has_sum.neg HasSum.neg
@[to_additive]
theorem Multipliable.inv (hf : Multipliable f) : Multipliable fun b β¦ (f b)β»ΒΉ :=
hf.hasProd.inv.multipliable
#align summable.neg Summable.neg
@[to_additive]
theorem Multipliable.of_inv (hf : Multipliable fun b β¦ (f b)β»ΒΉ) : Multipliable f := by
simpa only [inv_inv] using hf.inv
#align summable.of_neg Summable.of_neg
@[to_additive]
theorem multipliable_inv_iff : (Multipliable fun b β¦ (f b)β»ΒΉ) β Multipliable f :=
β¨Multipliable.of_inv, Multipliable.invβ©
#align summable_neg_iff summable_neg_iff
@[to_additive]
theorem HasProd.div (hf : HasProd f aβ) (hg : HasProd g aβ) :
HasProd (fun b β¦ f b / g b) (aβ / aβ) := by
simp only [div_eq_mul_inv]
exact hf.mul hg.inv
#align has_sum.sub HasSum.sub
@[to_additive]
theorem Multipliable.div (hf : Multipliable f) (hg : Multipliable g) :
Multipliable fun b β¦ f b / g b :=
(hf.hasProd.div hg.hasProd).multipliable
#align summable.sub Summable.sub
@[to_additive]
| Mathlib/Topology/Algebra/InfiniteSum/Group.lean | 63 | 65 | theorem Multipliable.trans_div (hg : Multipliable g) (hfg : Multipliable fun b β¦ f b / g b) :
Multipliable f := by |
simpa only [div_mul_cancel] using hfg.mul hg
| [
" HasProd (fun b => (f b)β»ΒΉ) aβ»ΒΉ",
" Multipliable f",
" HasProd (fun b => f b / g b) (aβ / aβ)",
" HasProd (fun b => f b * (g b)β»ΒΉ) (aβ * aββ»ΒΉ)"
] | [
" HasProd (fun b => (f b)β»ΒΉ) aβ»ΒΉ",
" Multipliable f",
" HasProd (fun b => f b / g b) (aβ / aβ)",
" HasProd (fun b => f b * (g b)β»ΒΉ) (aβ * aββ»ΒΉ)"
] |
import Mathlib.Analysis.NormedSpace.Exponential
#align_import analysis.normed_space.star.exponential from "leanprover-community/mathlib"@"1e3201306d4d9eb1fd54c60d7c4510ad5126f6f9"
open NormedSpace -- For `NormedSpace.exp`.
section Star
variable {A : Type*} [NormedRing A] [NormedAlgebra β A] [StarRing A] [ContinuousStar A]
[CompleteSpace A] [StarModule β A]
open Complex
@[simps]
noncomputable def selfAdjoint.expUnitary (a : selfAdjoint A) : unitary A :=
β¨exp β ((I β’ a.val) : A),
exp_mem_unitary_of_mem_skewAdjoint _ (a.prop.smul_mem_skewAdjoint conj_I)β©
#align self_adjoint.exp_unitary selfAdjoint.expUnitary
open selfAdjoint
theorem Commute.expUnitary_add {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) :
expUnitary (a + b) = expUnitary a * expUnitary b := by
ext
have hcomm : Commute (I β’ (a : A)) (I β’ (b : A)) := by
unfold Commute SemiconjBy
simp only [h.eq, Algebra.smul_mul_assoc, Algebra.mul_smul_comm]
simpa only [expUnitary_coe, AddSubgroup.coe_add, smul_add] using exp_add_of_commute hcomm
#align commute.exp_unitary_add Commute.expUnitary_add
| Mathlib/Analysis/NormedSpace/Star/Exponential.lean | 51 | 56 | theorem Commute.expUnitary {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) :
Commute (expUnitary a) (expUnitary b) :=
calc
selfAdjoint.expUnitary a * selfAdjoint.expUnitary b =
selfAdjoint.expUnitary b * selfAdjoint.expUnitary a := by |
rw [β h.expUnitary_add, β h.symm.expUnitary_add, add_comm]
| [
" expUnitary (a + b) = expUnitary a * expUnitary b",
" β(expUnitary (a + b)) = β(expUnitary a * expUnitary b)",
" Commute (I β’ βa) (I β’ βb)",
" I β’ βa * I β’ βb = I β’ βb * I β’ βa",
" selfAdjoint.expUnitary a * selfAdjoint.expUnitary b = selfAdjoint.expUnitary b * selfAdjoint.expUnitary a"
] | [
" expUnitary (a + b) = expUnitary a * expUnitary b",
" β(expUnitary (a + b)) = β(expUnitary a * expUnitary b)",
" Commute (I β’ βa) (I β’ βb)",
" I β’ βa * I β’ βb = I β’ βb * I β’ βa",
" selfAdjoint.expUnitary a * selfAdjoint.expUnitary b = selfAdjoint.expUnitary b * selfAdjoint.expUnitary a"
] |
import Mathlib.Algebra.Polynomial.Degree.Lemmas
open Polynomial
namespace Mathlib.Tactic.ComputeDegree
section recursion_lemmas
variable {R : Type*}
section semiring
variable [Semiring R]
theorem natDegree_C_le (a : R) : natDegree (C a) β€ 0 := (natDegree_C a).le
theorem natDegree_natCast_le (n : β) : natDegree (n : R[X]) β€ 0 := (natDegree_natCast _).le
theorem natDegree_zero_le : natDegree (0 : R[X]) β€ 0 := natDegree_zero.le
theorem natDegree_one_le : natDegree (1 : R[X]) β€ 0 := natDegree_one.le
@[deprecated (since := "2024-04-17")]
alias natDegree_nat_cast_le := natDegree_natCast_le
theorem coeff_add_of_eq {n : β} {a b : R} {f g : R[X]}
(h_add_left : f.coeff n = a) (h_add_right : g.coeff n = b) :
(f + g).coeff n = a + b := by subst βΉ_βΊ βΉ_βΊ; apply coeff_add
theorem coeff_mul_add_of_le_natDegree_of_eq_ite {d df dg : β} {a b : R} {f g : R[X]}
(h_mul_left : natDegree f β€ df) (h_mul_right : natDegree g β€ dg)
(h_mul_left : f.coeff df = a) (h_mul_right : g.coeff dg = b) (ddf : df + dg β€ d) :
(f * g).coeff d = if d = df + dg then a * b else 0 := by
split_ifs with h
Β· subst h_mul_left h_mul_right h
exact coeff_mul_of_natDegree_le βΉ_βΊ βΉ_βΊ
Β· apply coeff_eq_zero_of_natDegree_lt
apply lt_of_le_of_lt ?_ (lt_of_le_of_ne ddf ?_)
Β· exact natDegree_mul_le_of_le βΉ_βΊ βΉ_βΊ
Β· exact ne_comm.mp h
theorem coeff_pow_of_natDegree_le_of_eq_ite' {m n o : β} {a : R} {p : R[X]}
(h_pow : natDegree p β€ n) (h_exp : m * n β€ o) (h_pow_bas : coeff p n = a) :
coeff (p ^ m) o = if o = m * n then a ^ m else 0 := by
split_ifs with h
Β· subst h h_pow_bas
exact coeff_pow_of_natDegree_le βΉ_βΊ
Β· apply coeff_eq_zero_of_natDegree_lt
apply lt_of_le_of_lt ?_ (lt_of_le_of_ne βΉ_βΊ ?_)
Β· exact natDegree_pow_le_of_le m βΉ_βΊ
Β· exact Iff.mp ne_comm h
theorem natDegree_smul_le_of_le {n : β} {a : R} {f : R[X]} (hf : natDegree f β€ n) :
natDegree (a β’ f) β€ n :=
(natDegree_smul_le a f).trans hf
theorem degree_smul_le_of_le {n : β} {a : R} {f : R[X]} (hf : degree f β€ n) :
degree (a β’ f) β€ n :=
(degree_smul_le a f).trans hf
theorem coeff_smul {n : β} {a : R} {f : R[X]} : (a β’ f).coeff n = a * f.coeff n := rfl
section congr_lemmas
| Mathlib/Tactic/ComputeDegree.lean | 150 | 155 | theorem natDegree_eq_of_le_of_coeff_ne_zero' {deg m o : β} {c : R} {p : R[X]}
(h_natDeg_le : natDegree p β€ m) (coeff_eq : coeff p o = c)
(coeff_ne_zero : c β 0) (deg_eq_deg : m = deg) (coeff_eq_deg : o = deg) :
natDegree p = deg := by |
subst coeff_eq deg_eq_deg coeff_eq_deg
exact natDegree_eq_of_le_of_coeff_ne_zero βΉ_βΊ βΉ_βΊ
| [
" (f + g).coeff n = a + b",
" (f + g).coeff n = f.coeff n + g.coeff n",
" (f * g).coeff d = if d = df + dg then a * b else 0",
" (f * g).coeff d = a * b",
" (f * g).coeff (df + dg) = f.coeff df * g.coeff dg",
" (f * g).coeff d = 0",
" (f * g).natDegree < d",
" (f * g).natDegree β€ df + dg",
" df + dg... | [
" (f + g).coeff n = a + b",
" (f + g).coeff n = f.coeff n + g.coeff n",
" (f * g).coeff d = if d = df + dg then a * b else 0",
" (f * g).coeff d = a * b",
" (f * g).coeff (df + dg) = f.coeff df * g.coeff dg",
" (f * g).coeff d = 0",
" (f * g).natDegree < d",
" (f * g).natDegree β€ df + dg",
" df + dg... |
import Mathlib.Analysis.Complex.Basic
import Mathlib.FieldTheory.IntermediateField
import Mathlib.Topology.Algebra.Field
import Mathlib.Topology.Algebra.UniformRing
#align_import topology.instances.complex from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
section ComplexSubfield
open Complex Set
open ComplexConjugate
| Mathlib/Topology/Instances/Complex.lean | 25 | 44 | theorem Complex.subfield_eq_of_closed {K : Subfield β} (hc : IsClosed (K : Set β)) :
K = ofReal.fieldRange β¨ K = β€ := by |
suffices range (ofReal' : β β β) β K by
rw [range_subset_iff, β coe_algebraMap] at this
have :=
(Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
(Subfield.toIntermediateField K this).toSubalgebra
simp_rw [β SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this β’
exact this
suffices range (ofReal' : β β β) β closure (Set.range ((ofReal' : β β β) β ((β) : β β β))) by
refine subset_trans this ?_
rw [β IsClosed.closure_eq hc]
apply closure_mono
rintro _ β¨_, rflβ©
simp only [Function.comp_apply, ofReal_ratCast, SetLike.mem_coe, SubfieldClass.ratCast_mem]
nth_rw 1 [range_comp]
refine subset_trans ?_ (image_closure_subset_closure_image continuous_ofReal)
rw [DenseRange.closure_range Rat.denseEmbedding_coe_real.dense]
simp only [image_univ]
rfl
| [
" K = ofReal.fieldRange β¨ K = β€",
" βK = βofReal.fieldRange β¨ βK = ββ€",
" range ofReal' β βK",
" closure (range (ofReal' β Rat.cast)) β βK",
" closure (range (ofReal' β Rat.cast)) β closure βK",
" range (ofReal' β Rat.cast) β βK",
" (ofReal' β Rat.cast) wβ β βK",
" range ofReal' β closure (range (ofRe... | [
" K = ofReal.fieldRange β¨ K = β€"
] |
import Mathlib.RingTheory.Ideal.Maps
import Mathlib.Topology.Algebra.Nonarchimedean.Bases
import Mathlib.Topology.Algebra.UniformRing
#align_import topology.algebra.nonarchimedean.adic_topology from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
variable {R : Type*} [CommRing R]
open Set TopologicalAddGroup Submodule Filter
open Topology Pointwise
namespace Ideal
theorem adic_basis (I : Ideal R) : SubmodulesRingBasis fun n : β => (I ^ n β’ β€ : Ideal R) :=
{ inter := by
suffices β i j : β, β k, I ^ k β€ I ^ i β§ I ^ k β€ I ^ j by
simpa only [smul_eq_mul, mul_top, Algebra.id.map_eq_id, map_id, le_inf_iff] using this
intro i j
exact β¨max i j, pow_le_pow_right (le_max_left i j), pow_le_pow_right (le_max_right i j)β©
leftMul := by
suffices β (a : R) (i : β), β j : β, a β’ I ^ j β€ I ^ i by
simpa only [smul_top_eq_map, Algebra.id.map_eq_id, map_id] using this
intro r n
use n
rintro a β¨x, hx, rflβ©
exact (I ^ n).smul_mem r hx
mul := by
suffices β i : β, β j : β, (β(I ^ j) * β(I ^ j) : Set R) β (β(I ^ i) : Set R) by
simpa only [smul_top_eq_map, Algebra.id.map_eq_id, map_id] using this
intro n
use n
rintro a β¨x, _hx, b, hb, rflβ©
exact (I ^ n).smul_mem x hb }
#align ideal.adic_basis Ideal.adic_basis
def ringFilterBasis (I : Ideal R) :=
I.adic_basis.toRing_subgroups_basis.toRingFilterBasis
#align ideal.ring_filter_basis Ideal.ringFilterBasis
def adicTopology (I : Ideal R) : TopologicalSpace R :=
(adic_basis I).topology
#align ideal.adic_topology Ideal.adicTopology
theorem nonarchimedean (I : Ideal R) : @NonarchimedeanRing R _ I.adicTopology :=
I.adic_basis.toRing_subgroups_basis.nonarchimedean
#align ideal.nonarchimedean Ideal.nonarchimedean
| Mathlib/Topology/Algebra/Nonarchimedean/AdicTopology.lean | 92 | 103 | theorem hasBasis_nhds_zero_adic (I : Ideal R) :
HasBasis (@nhds R I.adicTopology (0 : R)) (fun _n : β => True) fun n =>
((I ^ n : Ideal R) : Set R) :=
β¨by
intro U
rw [I.ringFilterBasis.toAddGroupFilterBasis.nhds_zero_hasBasis.mem_iff]
constructor
Β· rintro β¨-, β¨i, rflβ©, hβ©
replace h : β(I ^ i) β U := by | simpa using h
exact β¨i, trivial, hβ©
Β· rintro β¨i, -, hβ©
exact β¨(I ^ i : Ideal R), β¨i, by simpβ©, hβ©β©
| [
" β (i j : β), β k, I ^ k β’ β€ β€ I ^ i β’ β€ β I ^ j β’ β€",
" β (i j : β), β k, I ^ k β€ I ^ i β§ I ^ k β€ I ^ j",
" β k, I ^ k β€ I ^ i β§ I ^ k β€ I ^ j",
" β (a : R) (i : β), β j, a β’ I ^ j β’ β€ β€ I ^ i β’ β€",
" β (a : R) (i : β), β j, a β’ I ^ j β€ I ^ i",
" β j, r β’ I ^ j β€ I ^ n",
" r β’ I ^ n β€ I ^ n",
" (Dis... | [
" β (i j : β), β k, I ^ k β’ β€ β€ I ^ i β’ β€ β I ^ j β’ β€",
" β (i j : β), β k, I ^ k β€ I ^ i β§ I ^ k β€ I ^ j",
" β k, I ^ k β€ I ^ i β§ I ^ k β€ I ^ j",
" β (a : R) (i : β), β j, a β’ I ^ j β’ β€ β€ I ^ i β’ β€",
" β (a : R) (i : β), β j, a β’ I ^ j β€ I ^ i",
" β j, r β’ I ^ j β€ I ^ n",
" r β’ I ^ n β€ I ^ n",
" (Dis... |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Algebra.Order.Module.OrderedSMul
import Mathlib.Algebra.Order.Group.Instances
import Mathlib.Data.Prod.Lex
import Mathlib.Data.Set.Image
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Order.Monotone.Monovary
import Mathlib.Tactic.Abel
#align_import algebra.order.rearrangement from "leanprover-community/mathlib"@"b3f25363ae62cb169e72cd6b8b1ac97bacf21ca7"
open Equiv Equiv.Perm Finset Function OrderDual
variable {ΞΉ Ξ± Ξ² : Type*}
section SMul
variable [LinearOrderedRing Ξ±] [LinearOrderedAddCommGroup Ξ²] [Module Ξ± Ξ²] [OrderedSMul Ξ± Ξ²]
{s : Finset ΞΉ} {Ο : Perm ΞΉ} {f : ΞΉ β Ξ±} {g : ΞΉ β Ξ²}
theorem MonovaryOn.sum_smul_comp_perm_le_sum_smul (hfg : MonovaryOn f g s)
(hΟ : { x | Ο x β x } β s) : (β i β s, f i β’ g (Ο i)) β€ β i β s, f i β’ g i := by
classical
revert hΟ Ο hfg
-- Porting note: Specify `p` to get around `β {Ο}` in the current goal.
apply Finset.induction_on_max_value (fun i β¦ toLex (g i, f i))
(p := fun t β¦ β {Ο : Perm ΞΉ}, MonovaryOn f g t β { x | Ο x β x } β t β
(β i β t, f i β’ g (Ο i)) β€ β i β t, f i β’ g i) s
Β· simp only [le_rfl, Finset.sum_empty, imp_true_iff]
intro a s has hamax hind Ο hfg hΟ
set Ο : Perm ΞΉ := Ο.trans (swap a (Ο a)) with hΟ
have hΟs : { x | Ο x β x } β s := by
intro x hx
simp only [Ο, Ne, Set.mem_setOf_eq, Equiv.coe_trans, Equiv.swap_comp_apply] at hx
split_ifs at hx with hβ hβ
Β· obtain rfl | hax := eq_or_ne x a
Β· contradiction
Β· exact mem_of_mem_insert_of_ne (hΟ fun h β¦ hax <| h.symm.trans hβ) hax
Β· exact (hx <| Ο.injective hβ.symm).elim
Β· exact mem_of_mem_insert_of_ne (hΟ hx) (ne_of_apply_ne _ hβ)
specialize hind (hfg.subset <| subset_insert _ _) hΟs
simp_rw [sum_insert has]
refine le_trans ?_ (add_le_add_left hind _)
obtain hΟa | hΟa := eq_or_ne a (Ο a)
Β· rw [hΟ, β hΟa, swap_self, trans_refl]
have h1s : Οβ»ΒΉ a β s := by
rw [Ne, β inv_eq_iff_eq] at hΟa
refine mem_of_mem_insert_of_ne (hΟ fun h β¦ hΟa ?_) hΟa
rwa [apply_inv_self, eq_comm] at h
simp only [β s.sum_erase_add _ h1s, add_comm]
rw [β add_assoc, β add_assoc]
simp only [hΟ, swap_apply_left, Function.comp_apply, Equiv.coe_trans, apply_inv_self]
refine add_le_add (smul_add_smul_le_smul_add_smul' ?_ ?_) (sum_congr rfl fun x hx β¦ ?_).le
Β· specialize hamax (Οβ»ΒΉ a) h1s
rw [Prod.Lex.le_iff] at hamax
cases' hamax with hamax hamax
Β· exact hfg (mem_insert_of_mem h1s) (mem_insert_self _ _) hamax
Β· exact hamax.2
Β· specialize hamax (Ο a) (mem_of_mem_insert_of_ne (hΟ <| Ο.injective.ne hΟa.symm) hΟa.symm)
rw [Prod.Lex.le_iff] at hamax
cases' hamax with hamax hamax
Β· exact hamax.le
Β· exact hamax.1.le
Β· rw [mem_erase, Ne, eq_inv_iff_eq] at hx
rw [swap_apply_of_ne_of_ne hx.1 (Ο.injective.ne _)]
rintro rfl
exact has hx.2
#align monovary_on.sum_smul_comp_perm_le_sum_smul MonovaryOn.sum_smul_comp_perm_le_sum_smul
| Mathlib/Algebra/Order/Rearrangement.lean | 114 | 137 | theorem MonovaryOn.sum_smul_comp_perm_eq_sum_smul_iff (hfg : MonovaryOn f g s)
(hΟ : { x | Ο x β x } β s) :
((β i β s, f i β’ g (Ο i)) = β i β s, f i β’ g i) β MonovaryOn f (g β Ο) s := by |
classical
refine β¨not_imp_not.1 fun h β¦ ?_, fun h β¦ (hfg.sum_smul_comp_perm_le_sum_smul hΟ).antisymm ?_β©
Β· rw [MonovaryOn] at h
push_neg at h
obtain β¨x, hx, y, hy, hgxy, hfxyβ© := h
set Ο : Perm ΞΉ := (Equiv.swap x y).trans Ο
have hΟs : { x | Ο x β x } β s := by
refine (set_support_mul_subset Ο <| swap x y).trans (Set.union_subset hΟ fun z hz β¦ ?_)
obtain β¨_, rfl | rflβ© := swap_apply_ne_self_iff.1 hz <;> assumption
refine ((hfg.sum_smul_comp_perm_le_sum_smul hΟs).trans_lt' ?_).ne
obtain rfl | hxy := eq_or_ne x y
Β· cases lt_irrefl _ hfxy
simp only [Ο, β s.sum_erase_add _ hx,
β (s.erase x).sum_erase_add _ (mem_erase.2 β¨hxy.symm, hyβ©),
add_assoc, Equiv.coe_trans, Function.comp_apply, swap_apply_right, swap_apply_left]
refine add_lt_add_of_le_of_lt (Finset.sum_congr rfl fun z hz β¦ ?_).le
(smul_add_smul_lt_smul_add_smul hfxy hgxy)
simp_rw [mem_erase] at hz
rw [swap_apply_of_ne_of_ne hz.2.1 hz.1]
Β· convert h.sum_smul_comp_perm_le_sum_smul ((set_support_inv_eq _).subset.trans hΟ) using 1
simp_rw [Function.comp_apply, apply_inv_self]
| [
" β i β s, f i β’ g (Ο i) β€ β i β s, f i β’ g i",
" β {Ο : Perm ΞΉ}, MonovaryOn f g βs β {x | Ο x β x} β βs β β i β s, f i β’ g (Ο i) β€ β i β s, f i β’ g i",
" β {Ο : Perm ΞΉ}, MonovaryOn f g ββ
β {x | Ο x β x} β ββ
β β i β β
, f i β’ g (Ο i) β€ β i β β
, f i β’ g i",
" β (a : ΞΉ) (s : Finset ΞΉ),\n a β s β\n (β x... | [
" β i β s, f i β’ g (Ο i) β€ β i β s, f i β’ g i",
" β {Ο : Perm ΞΉ}, MonovaryOn f g βs β {x | Ο x β x} β βs β β i β s, f i β’ g (Ο i) β€ β i β s, f i β’ g i",
" β {Ο : Perm ΞΉ}, MonovaryOn f g ββ
β {x | Ο x β x} β ββ
β β i β β
, f i β’ g (Ο i) β€ β i β β
, f i β’ g i",
" β (a : ΞΉ) (s : Finset ΞΉ),\n a β s β\n (β x... |
import Mathlib.Algebra.ContinuedFractions.Translations
#align_import algebra.continued_fractions.terminated_stable from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
namespace GeneralizedContinuedFraction
variable {K : Type*} {g : GeneralizedContinuedFraction K} {n m : β}
theorem terminated_stable (n_le_m : n β€ m) (terminated_at_n : g.TerminatedAt n) :
g.TerminatedAt m :=
g.s.terminated_stable n_le_m terminated_at_n
#align generalized_continued_fraction.terminated_stable GeneralizedContinuedFraction.terminated_stable
variable [DivisionRing K]
| Mathlib/Algebra/ContinuedFractions/TerminatedStable.lean | 31 | 34 | theorem continuantsAux_stable_step_of_terminated (terminated_at_n : g.TerminatedAt n) :
g.continuantsAux (n + 2) = g.continuantsAux (n + 1) := by |
rw [terminatedAt_iff_s_none] at terminated_at_n
simp only [continuantsAux, Nat.add_eq, Nat.add_zero, terminated_at_n]
| [
" g.continuantsAux (n + 2) = g.continuantsAux (n + 1)"
] | [
" g.continuantsAux (n + 2) = g.continuantsAux (n + 1)"
] |
import Batteries.Data.RBMap.Alter
import Batteries.Data.List.Lemmas
namespace Batteries
namespace RBNode
open RBColor
attribute [simp] fold foldl foldr Any forM foldlM Ordered
@[simp] theorem min?_reverse (t : RBNode Ξ±) : t.reverse.min? = t.max? := by
unfold RBNode.max?; split <;> simp [RBNode.min?]
unfold RBNode.min?; rw [min?.match_1.eq_3]
Β· apply min?_reverse
Β· simpa [reverse_eq_iff]
@[simp] theorem max?_reverse (t : RBNode Ξ±) : t.reverse.max? = t.min? := by
rw [β min?_reverse, reverse_reverse]
@[simp] theorem mem_nil {x} : Β¬x β (.nil : RBNode Ξ±) := by simp [(Β·βΒ·), EMem]
@[simp] theorem mem_node {y c a x b} :
y β (.node c a x b : RBNode Ξ±) β y = x β¨ y β a β¨ y β b := by simp [(Β·βΒ·), EMem]
| .lake/packages/batteries/Batteries/Data/RBMap/Lemmas.lean | 32 | 33 | theorem All_def {t : RBNode Ξ±} : t.All p β β x β t, p x := by |
induction t <;> simp [or_imp, forall_and, *]
| [
" t.reverse.min? = t.max?",
" t.reverse.min? =\n match t with\n | nil => none\n | node c l v nil => some v\n | node c l v r => r.max?",
" nil.reverse.min? = none",
" (node cβ lβ vβ nil).reverse.min? = some vβ",
" (node cβ lβ vβ rβ).reverse.min? = rβ.max?",
" (node cβ rβ.reverse vβ lβ.reverse).... | [
" t.reverse.min? = t.max?",
" t.reverse.min? =\n match t with\n | nil => none\n | node c l v nil => some v\n | node c l v r => r.max?",
" nil.reverse.min? = none",
" (node cβ lβ vβ nil).reverse.min? = some vβ",
" (node cβ lβ vβ rβ).reverse.min? = rβ.max?",
" (node cβ rβ.reverse vβ lβ.reverse).... |
import Mathlib.Algebra.CharZero.Defs
import Mathlib.Algebra.Group.Hom.Defs
import Mathlib.Algebra.Order.Monoid.Canonical.Defs
import Mathlib.Algebra.Order.Monoid.OrderDual
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Defs
import Mathlib.Order.WithBot
#align_import algebra.order.monoid.with_top from "leanprover-community/mathlib"@"0111834459f5d7400215223ea95ae38a1265a907"
universe u v
variable {Ξ± : Type u} {Ξ² : Type v}
open Function
namespace WithTop
section Add
variable [Add Ξ±] {a b c d : WithTop Ξ±} {x y : Ξ±}
instance add : Add (WithTop Ξ±) :=
β¨Option.mapβ (Β· + Β·)β©
#align with_top.has_add WithTop.add
@[simp, norm_cast] lemma coe_add (a b : Ξ±) : β(a + b) = (a + b : WithTop Ξ±) := rfl
#align with_top.coe_add WithTop.coe_add
#noalign with_top.coe_bit0
#noalign with_top.coe_bit1
@[simp]
theorem top_add (a : WithTop Ξ±) : β€ + a = β€ :=
rfl
#align with_top.top_add WithTop.top_add
@[simp]
| Mathlib/Algebra/Order/Monoid/WithTop.lean | 128 | 128 | theorem add_top (a : WithTop Ξ±) : a + β€ = β€ := by | cases a <;> rfl
| [
" a + β€ = β€",
" β€ + β€ = β€",
" βaβ + β€ = β€"
] | [
" a + β€ = β€"
] |
import Mathlib.RingTheory.RootsOfUnity.Basic
import Mathlib.RingTheory.AdjoinRoot
import Mathlib.FieldTheory.Galois
import Mathlib.LinearAlgebra.Eigenspace.Minpoly
import Mathlib.RingTheory.Norm
universe u
variable {K : Type u} [Field K]
open Polynomial IntermediateField AdjoinRoot
section Splits
lemma root_X_pow_sub_C_pow (n : β) (a : K) :
(AdjoinRoot.root (X ^ n - C a)) ^ n = AdjoinRoot.of _ a := by
rw [β sub_eq_zero, β AdjoinRoot.evalβ_root, evalβ_sub, evalβ_C, evalβ_pow, evalβ_X]
lemma root_X_pow_sub_C_ne_zero {n : β} (hn : 1 < n) (a : K) :
(AdjoinRoot.root (X ^ n - C a)) β 0 :=
mk_ne_zero_of_natDegree_lt (monic_X_pow_sub_C _ (Nat.not_eq_zero_of_lt hn))
X_ne_zero <| by rwa [natDegree_X_pow_sub_C, natDegree_X]
lemma root_X_pow_sub_C_ne_zero' {n : β} {a : K} (hn : 0 < n) (ha : a β 0) :
(AdjoinRoot.root (X ^ n - C a)) β 0 := by
obtain (rfl|hn) := (Nat.succ_le_iff.mpr hn).eq_or_lt
Β· rw [β Nat.one_eq_succ_zero, pow_one]
intro e
refine mk_ne_zero_of_natDegree_lt (monic_X_sub_C a) (C_ne_zero.mpr ha) (by simp) ?_
trans AdjoinRoot.mk (X - C a) (X - (X - C a))
Β· rw [sub_sub_cancel]
Β· rw [map_sub, mk_self, sub_zero, mk_X, e]
Β· exact root_X_pow_sub_C_ne_zero hn a
| Mathlib/FieldTheory/KummerExtension.lean | 74 | 82 | theorem X_pow_sub_C_splits_of_isPrimitiveRoot
{n : β} {ΞΆ : K} (hΞΆ : IsPrimitiveRoot ΞΆ n) {Ξ± a : K} (e : Ξ± ^ n = a) :
(X ^ n - C a).Splits (RingHom.id _) := by |
cases n.eq_zero_or_pos with
| inl hn =>
rw [hn, pow_zero, β C.map_one, β map_sub]
exact splits_C _ _
| inr hn =>
rw [splits_iff_card_roots, β nthRoots, hΞΆ.card_nthRoots, natDegree_X_pow_sub_C, if_pos β¨Ξ±, eβ©]
| [
" root (X ^ n - C a) ^ n = (of (X ^ n - C a)) a",
" X.natDegree < (X ^ n - C a).natDegree",
" root (X ^ n - C a) β 0",
" root (X ^ Nat.succ 0 - C a) β 0",
" root (X - C a) β 0",
" False",
" (C a).natDegree < (X - C a).natDegree",
" (AdjoinRoot.mk (X - C a)) (C a) = 0",
" (AdjoinRoot.mk (X - C a)) (C... | [
" root (X ^ n - C a) ^ n = (of (X ^ n - C a)) a",
" X.natDegree < (X ^ n - C a).natDegree",
" root (X ^ n - C a) β 0",
" root (X ^ Nat.succ 0 - C a) β 0",
" root (X - C a) β 0",
" False",
" (C a).natDegree < (X - C a).natDegree",
" (AdjoinRoot.mk (X - C a)) (C a) = 0",
" (AdjoinRoot.mk (X - C a)) (C... |
import Mathlib.ModelTheory.Ultraproducts
import Mathlib.ModelTheory.Bundled
import Mathlib.ModelTheory.Skolem
#align_import model_theory.satisfiability from "leanprover-community/mathlib"@"d565b3df44619c1498326936be16f1a935df0728"
set_option linter.uppercaseLean3 false
universe u v w w'
open Cardinal CategoryTheory
open Cardinal FirstOrder
namespace FirstOrder
namespace Language
variable {L : Language.{u, v}} {T : L.Theory} {Ξ± : Type w} {n : β}
namespace Theory
variable (T)
def IsSatisfiable : Prop :=
Nonempty (ModelType.{u, v, max u v} T)
#align first_order.language.Theory.is_satisfiable FirstOrder.Language.Theory.IsSatisfiable
def IsFinitelySatisfiable : Prop :=
β T0 : Finset L.Sentence, (T0 : L.Theory) β T β IsSatisfiable (T0 : L.Theory)
#align first_order.language.Theory.is_finitely_satisfiable FirstOrder.Language.Theory.IsFinitelySatisfiable
variable {T} {T' : L.Theory}
theorem Model.isSatisfiable (M : Type w) [Nonempty M] [L.Structure M] [M β¨ T] :
T.IsSatisfiable :=
β¨((β₯ : Substructure _ (ModelType.of T M)).elementarySkolemβReduct.toModel T).shrinkβ©
#align first_order.language.Theory.model.is_satisfiable FirstOrder.Language.Theory.Model.isSatisfiable
theorem IsSatisfiable.mono (h : T'.IsSatisfiable) (hs : T β T') : T.IsSatisfiable :=
β¨(Theory.Model.mono (ModelType.is_model h.some) hs).bundledβ©
#align first_order.language.Theory.is_satisfiable.mono FirstOrder.Language.Theory.IsSatisfiable.mono
theorem isSatisfiable_empty (L : Language.{u, v}) : IsSatisfiable (β
: L.Theory) :=
β¨defaultβ©
#align first_order.language.Theory.is_satisfiable_empty FirstOrder.Language.Theory.isSatisfiable_empty
theorem isSatisfiable_of_isSatisfiable_onTheory {L' : Language.{w, w'}} (Ο : L βα΄Έ L')
(h : (Ο.onTheory T).IsSatisfiable) : T.IsSatisfiable :=
Model.isSatisfiable (h.some.reduct Ο)
#align first_order.language.Theory.is_satisfiable_of_is_satisfiable_on_Theory FirstOrder.Language.Theory.isSatisfiable_of_isSatisfiable_onTheory
theorem isSatisfiable_onTheory_iff {L' : Language.{w, w'}} {Ο : L βα΄Έ L'} (h : Ο.Injective) :
(Ο.onTheory T).IsSatisfiable β T.IsSatisfiable := by
classical
refine β¨isSatisfiable_of_isSatisfiable_onTheory Ο, fun h' => ?_β©
haveI : Inhabited h'.some := Classical.inhabited_of_nonempty'
exact Model.isSatisfiable (h'.some.defaultExpansion h)
#align first_order.language.Theory.is_satisfiable_on_Theory_iff FirstOrder.Language.Theory.isSatisfiable_onTheory_iff
theorem IsSatisfiable.isFinitelySatisfiable (h : T.IsSatisfiable) : T.IsFinitelySatisfiable :=
fun _ => h.mono
#align first_order.language.Theory.is_satisfiable.is_finitely_satisfiable FirstOrder.Language.Theory.IsSatisfiable.isFinitelySatisfiable
theorem isSatisfiable_iff_isFinitelySatisfiable {T : L.Theory} :
T.IsSatisfiable β T.IsFinitelySatisfiable :=
β¨Theory.IsSatisfiable.isFinitelySatisfiable, fun h => by
classical
set M : Finset T β Type max u v := fun T0 : Finset T =>
(h (T0.map (Function.Embedding.subtype fun x => x β T)) T0.map_subtype_subset).some.Carrier
let M' := Filter.Product (Ultrafilter.of (Filter.atTop : Filter (Finset T))) M
have h' : M' β¨ T := by
refine β¨fun Ο hΟ => ?_β©
rw [Ultraproduct.sentence_realize]
refine
Filter.Eventually.filter_mono (Ultrafilter.of_le _)
(Filter.eventually_atTop.2
β¨{β¨Ο, hΟβ©}, fun s h' =>
Theory.realize_sentence_of_mem (s.map (Function.Embedding.subtype fun x => x β T))
?_β©)
simp only [Finset.coe_map, Function.Embedding.coe_subtype, Set.mem_image, Finset.mem_coe,
Subtype.exists, Subtype.coe_mk, exists_and_right, exists_eq_right]
exact β¨hΟ, h' (Finset.mem_singleton_self _)β©
exact β¨ModelType.of T M'β©β©
#align first_order.language.Theory.is_satisfiable_iff_is_finitely_satisfiable FirstOrder.Language.Theory.isSatisfiable_iff_isFinitelySatisfiable
| Mathlib/ModelTheory/Satisfiability.lean | 129 | 135 | theorem isSatisfiable_directed_union_iff {ΞΉ : Type*} [Nonempty ΞΉ] {T : ΞΉ β L.Theory}
(h : Directed (Β· β Β·) T) : Theory.IsSatisfiable (β i, T i) β β i, (T i).IsSatisfiable := by |
refine β¨fun h' i => h'.mono (Set.subset_iUnion _ _), fun h' => ?_β©
rw [isSatisfiable_iff_isFinitelySatisfiable, IsFinitelySatisfiable]
intro T0 hT0
obtain β¨i, hiβ© := h.exists_mem_subset_of_finset_subset_biUnion hT0
exact (h' i).mono hi
| [
" (Ο.onTheory T).IsSatisfiable β T.IsSatisfiable",
" (Ο.onTheory T).IsSatisfiable",
" T.IsSatisfiable",
" M' β¨ T",
" M' β¨ Ο",
" βαΆ (a : Finset βT) in β(Ultrafilter.of Filter.atTop), M a β¨ Ο",
" Ο β β(Finset.map (Function.Embedding.subtype fun x => x β T) s)",
" β (x : Ο β T), β¨Ο, β―β© β s",
" IsSatisf... | [
" (Ο.onTheory T).IsSatisfiable β T.IsSatisfiable",
" (Ο.onTheory T).IsSatisfiable",
" T.IsSatisfiable",
" M' β¨ T",
" M' β¨ Ο",
" βαΆ (a : Finset βT) in β(Ultrafilter.of Filter.atTop), M a β¨ Ο",
" Ο β β(Finset.map (Function.Embedding.subtype fun x => x β T) s)",
" β (x : Ο β T), β¨Ο, β―β© β s",
" IsSatisf... |
import Mathlib.Combinatorics.SetFamily.HarrisKleitman
import Mathlib.Combinatorics.SetFamily.Intersecting
#align_import combinatorics.set_family.kleitman from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514"
open Finset
open Fintype (card)
variable {ΞΉ Ξ± : Type*} [Fintype Ξ±] [DecidableEq Ξ±] [Nonempty Ξ±]
| Mathlib/Combinatorics/SetFamily/Kleitman.lean | 37 | 85 | theorem Finset.card_biUnion_le_of_intersecting (s : Finset ΞΉ) (f : ΞΉ β Finset (Finset Ξ±))
(hf : β i β s, (f i : Set (Finset Ξ±)).Intersecting) :
(s.biUnion f).card β€ 2 ^ Fintype.card Ξ± - 2 ^ (Fintype.card Ξ± - s.card) := by |
have : DecidableEq ΞΉ := by
classical
infer_instance
obtain hs | hs := le_total (Fintype.card Ξ±) s.card
Β· rw [tsub_eq_zero_of_le hs, pow_zero]
refine (card_le_card <| biUnion_subset.2 fun i hi a ha β¦
mem_compl.2 <| not_mem_singleton.2 <| (hf _ hi).ne_bot ha).trans_eq ?_
rw [card_compl, Fintype.card_finset, card_singleton]
induction' s using Finset.cons_induction with i s hi ih generalizing f
Β· simp
set f' : ΞΉ β Finset (Finset Ξ±) :=
fun j β¦ if hj : j β cons i s hi then (hf j hj).exists_card_eq.choose else β
have hfβ : β j, j β cons i s hi β f j β f' j β§ 2 * (f' j).card =
2 ^ Fintype.card Ξ± β§ (f' j : Set (Finset Ξ±)).Intersecting := by
rintro j hj
simp_rw [f', dif_pos hj, β Fintype.card_finset]
exact Classical.choose_spec (hf j hj).exists_card_eq
have hfβ : β j, j β cons i s hi β IsUpperSet (f' j : Set (Finset Ξ±)) := by
refine fun j hj β¦ (hfβ _ hj).2.2.isUpperSet' ((hfβ _ hj).2.2.is_max_iff_card_eq.2 ?_)
rw [Fintype.card_finset]
exact (hfβ _ hj).2.1
refine (card_le_card <| biUnion_mono fun j hj β¦ (hfβ _ hj).1).trans ?_
nth_rw 1 [cons_eq_insert i]
rw [biUnion_insert]
refine (card_mono <| @le_sup_sdiff _ _ _ <| f' i).trans ((card_union_le _ _).trans ?_)
rw [union_sdiff_left, sdiff_eq_inter_compl]
refine le_of_mul_le_mul_left ?_ (pow_pos (zero_lt_two' β) <| Fintype.card Ξ± + 1)
rw [pow_succ, mul_add, mul_assoc, mul_comm _ 2, mul_assoc]
refine (add_le_add
((mul_le_mul_left <| pow_pos (zero_lt_two' β) _).2
(hfβ _ <| mem_cons_self _ _).2.2.card_le) <|
(mul_le_mul_left <| zero_lt_two' β).2 <| IsUpperSet.card_inter_le_finset ?_ ?_).trans ?_
Β· rw [coe_biUnion]
exact isUpperSet_iUnionβ fun i hi β¦ hfβ _ <| subset_cons _ hi
Β· rw [coe_compl]
exact (hfβ _ <| mem_cons_self _ _).compl
rw [mul_tsub, card_compl, Fintype.card_finset, mul_left_comm, mul_tsub,
(hfβ _ <| mem_cons_self _ _).2.1, two_mul, add_tsub_cancel_left, β mul_tsub, β mul_two,
mul_assoc, β add_mul, mul_comm]
refine mul_le_mul_left' ?_ _
refine (add_le_add_left
(ih _ (fun i hi β¦ (hfβ _ <| subset_cons _ hi).2.2)
((card_le_card <| subset_cons _).trans hs)) _).trans ?_
rw [mul_tsub, two_mul, β pow_succ',
β add_tsub_assoc_of_le (pow_le_pow_right' (one_le_two : (1 : β) β€ 2) tsub_le_self),
tsub_add_eq_add_tsub hs, card_cons, add_tsub_add_eq_tsub_right]
| [
" (s.biUnion f).card β€ 2 ^ Fintype.card Ξ± - 2 ^ (Fintype.card Ξ± - s.card)",
" DecidableEq ΞΉ",
" (s.biUnion f).card β€ 2 ^ Fintype.card Ξ± - 1",
" {β₯}αΆ.card = 2 ^ Fintype.card Ξ± - 1",
" (β
.biUnion f).card β€ 2 ^ Fintype.card Ξ± - 2 ^ (Fintype.card Ξ± - β
.card)",
" ((cons i s hi).biUnion f).card β€ 2 ^ Fintype.ca... | [
" (s.biUnion f).card β€ 2 ^ Fintype.card Ξ± - 2 ^ (Fintype.card Ξ± - s.card)"
] |
import Mathlib.Data.Set.Lattice
#align_import data.set.intervals.disjoint from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432"
universe u v w
variable {ΞΉ : Sort u} {Ξ± : Type v} {Ξ² : Type w}
open Set
open OrderDual (toDual)
namespace Set
section LinearOrder
variable [LinearOrder Ξ±] {aβ aβ bβ bβ : Ξ±}
@[simp]
theorem Ico_disjoint_Ico : Disjoint (Ico aβ aβ) (Ico bβ bβ) β min aβ bβ β€ max aβ bβ := by
simp_rw [Set.disjoint_iff_inter_eq_empty, Ico_inter_Ico, Ico_eq_empty_iff, inf_eq_min, sup_eq_max,
not_lt]
#align set.Ico_disjoint_Ico Set.Ico_disjoint_Ico
@[simp]
theorem Ioc_disjoint_Ioc : Disjoint (Ioc aβ aβ) (Ioc bβ bβ) β min aβ bβ β€ max aβ bβ := by
have h : _ β min (toDual aβ) (toDual bβ) β€ max (toDual aβ) (toDual bβ) := Ico_disjoint_Ico
simpa only [dual_Ico] using h
#align set.Ioc_disjoint_Ioc Set.Ioc_disjoint_Ioc
@[simp]
theorem Ioo_disjoint_Ioo [DenselyOrdered Ξ±] :
Disjoint (Set.Ioo aβ aβ) (Set.Ioo bβ bβ) β min aβ bβ β€ max aβ bβ := by
simp_rw [Set.disjoint_iff_inter_eq_empty, Ioo_inter_Ioo, Ioo_eq_empty_iff, inf_eq_min, sup_eq_max,
not_lt]
theorem eq_of_Ico_disjoint {xβ xβ yβ yβ : Ξ±} (h : Disjoint (Ico xβ xβ) (Ico yβ yβ)) (hx : xβ < xβ)
(h2 : xβ β Ico yβ yβ) : yβ = xβ := by
rw [Ico_disjoint_Ico, min_eq_left (le_of_lt h2.2), le_max_iff] at h
apply le_antisymm h2.1
exact h.elim (fun h => absurd hx (not_lt_of_le h)) id
#align set.eq_of_Ico_disjoint Set.eq_of_Ico_disjoint
@[simp]
theorem iUnion_Ico_eq_Iio_self_iff {f : ΞΉ β Ξ±} {a : Ξ±} :
β i, Ico (f i) a = Iio a β β x < a, β i, f i β€ x := by
simp [β Ici_inter_Iio, β iUnion_inter, subset_def]
#align set.Union_Ico_eq_Iio_self_iff Set.iUnion_Ico_eq_Iio_self_iff
@[simp]
| Mathlib/Order/Interval/Set/Disjoint.lean | 176 | 178 | theorem iUnion_Ioc_eq_Ioi_self_iff {f : ΞΉ β Ξ±} {a : Ξ±} :
β i, Ioc a (f i) = Ioi a β β x, a < x β β i, x β€ f i := by |
simp [β Ioi_inter_Iic, β inter_iUnion, subset_def]
| [
" Disjoint (Ico aβ aβ) (Ico bβ bβ) β min aβ bβ β€ max aβ bβ",
" Disjoint (Ioc aβ aβ) (Ioc bβ bβ) β min aβ bβ β€ max aβ bβ",
" Disjoint (Ioo aβ aβ) (Ioo bβ bβ) β min aβ bβ β€ max aβ bβ",
" yβ = xβ",
" xβ β€ yβ",
" β i, Ico (f i) a = Iio a β β x < a, β i, f i β€ x",
" β i, Ioc a (f i) = Ioi a β β (x : Ξ±), a < ... | [
" Disjoint (Ico aβ aβ) (Ico bβ bβ) β min aβ bβ β€ max aβ bβ",
" Disjoint (Ioc aβ aβ) (Ioc bβ bβ) β min aβ bβ β€ max aβ bβ",
" Disjoint (Ioo aβ aβ) (Ioo bβ bβ) β min aβ bβ β€ max aβ bβ",
" yβ = xβ",
" xβ β€ yβ",
" β i, Ico (f i) a = Iio a β β x < a, β i, f i β€ x",
" β i, Ioc a (f i) = Ioi a β β (x : Ξ±), a < ... |
import Mathlib.Data.Finset.Basic
variable {ΞΉ : Sort _} {Ο : ΞΉ β Sort _} {x : β i, Ο i} [DecidableEq ΞΉ]
namespace Function
def updateFinset (x : β i, Ο i) (s : Finset ΞΉ) (y : β i : β₯s, Ο i) (i : ΞΉ) : Ο i :=
if hi : i β s then y β¨i, hiβ© else x i
open Finset Equiv
theorem updateFinset_def {s : Finset ΞΉ} {y} :
updateFinset x s y = fun i β¦ if hi : i β s then y β¨i, hiβ© else x i :=
rfl
@[simp] theorem updateFinset_empty {y} : updateFinset x β
y = x :=
rfl
theorem updateFinset_singleton {i y} :
updateFinset x {i} y = Function.update x i (y β¨i, mem_singleton_self iβ©) := by
congr with j
by_cases hj : j = i
Β· cases hj
simp only [dif_pos, Finset.mem_singleton, update_same, updateFinset]
Β· simp [hj, updateFinset]
| Mathlib/Data/Finset/Update.lean | 43 | 50 | theorem update_eq_updateFinset {i y} :
Function.update x i y = updateFinset x {i} (uniqueElim y) := by |
congr with j
by_cases hj : j = i
Β· cases hj
simp only [dif_pos, Finset.mem_singleton, update_same, updateFinset]
exact uniqueElim_default (Ξ± := fun j : ({i} : Finset ΞΉ) => Ο j) y
Β· simp [hj, updateFinset]
| [
" updateFinset x {i} y = update x i (y β¨i, β―β©)",
" updateFinset x {i} y j = update x i (y β¨i, β―β©) j",
" updateFinset x {i} y i = update x i (y β¨i, β―β©) i",
" update x i y = updateFinset x {i} (uniqueElim y)",
" update x i y j = updateFinset x {i} (uniqueElim y) j",
" update x i y i = updateFinset x {i} (un... | [
" updateFinset x {i} y = update x i (y β¨i, β―β©)",
" updateFinset x {i} y j = update x i (y β¨i, β―β©) j",
" updateFinset x {i} y i = update x i (y β¨i, β―β©) i",
" update x i y = updateFinset x {i} (uniqueElim y)"
] |
import Mathlib.RingTheory.Localization.Module
import Mathlib.RingTheory.Norm
import Mathlib.RingTheory.Discriminant
#align_import ring_theory.localization.norm from "leanprover-community/mathlib"@"2e59a6de168f95d16b16d217b808a36290398c0a"
open scoped nonZeroDivisors
variable (R : Type*) {S : Type*} [CommRing R] [CommRing S] [Algebra R S]
variable {Rβ Sβ : Type*} [CommRing Rβ] [Algebra R Rβ] [CommRing Sβ] [Algebra S Sβ]
variable (M : Submonoid R)
variable [IsLocalization M Rβ] [IsLocalization (Algebra.algebraMapSubmonoid S M) Sβ]
variable [Algebra Rβ Sβ] [Algebra R Sβ] [IsScalarTower R Rβ Sβ] [IsScalarTower R S Sβ]
open Algebra
theorem Algebra.map_leftMulMatrix_localization {ΞΉ : Type*} [Fintype ΞΉ] [DecidableEq ΞΉ]
(b : Basis ΞΉ R S) (a : S) :
(algebraMap R Rβ).mapMatrix (leftMulMatrix b a) =
leftMulMatrix (b.localizationLocalization Rβ M Sβ) (algebraMap S Sβ a) := by
ext i j
simp only [Matrix.map_apply, RingHom.mapMatrix_apply, leftMulMatrix_eq_repr_mul, β map_mul,
Basis.localizationLocalization_apply, Basis.localizationLocalization_repr_algebraMap]
theorem Algebra.norm_localization [Module.Free R S] [Module.Finite R S] (a : S) :
Algebra.norm Rβ (algebraMap S Sβ a) = algebraMap R Rβ (Algebra.norm R a) := by
cases subsingleton_or_nontrivial R
Β· haveI : Subsingleton Rβ := Module.subsingleton R Rβ
simp [eq_iff_true_of_subsingleton]
let b := Module.Free.chooseBasis R S
letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
rw [Algebra.norm_eq_matrix_det (b.localizationLocalization Rβ M Sβ),
Algebra.norm_eq_matrix_det b, RingHom.map_det, β Algebra.map_leftMulMatrix_localization]
#align algebra.norm_localization Algebra.norm_localization
variable {M} in
lemma Algebra.norm_eq_iff [Module.Free R S] [Module.Finite R S] {a : S} {b : R}
(hM : M β€ nonZeroDivisors R) : Algebra.norm R a = b β
(Algebra.norm Rβ) ((algebraMap S Sβ) a) = algebraMap R Rβ b :=
β¨fun h β¦ h.symm βΈ Algebra.norm_localization _ M _, fun h β¦
IsLocalization.injective Rβ hM <| h.symm βΈ (Algebra.norm_localization R M a).symmβ©
theorem Algebra.trace_localization [Module.Free R S] [Module.Finite R S] (a : S) :
Algebra.trace Rβ Sβ (algebraMap S Sβ a) = algebraMap R Rβ (Algebra.trace R S a) := by
cases subsingleton_or_nontrivial R
Β· haveI : Subsingleton Rβ := Module.subsingleton R Rβ
simp [eq_iff_true_of_subsingleton]
let b := Module.Free.chooseBasis R S
letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
rw [Algebra.trace_eq_matrix_trace (b.localizationLocalization Rβ M Sβ),
Algebra.trace_eq_matrix_trace b, β Algebra.map_leftMulMatrix_localization]
exact (AddMonoidHom.map_trace (algebraMap R Rβ).toAddMonoidHom _).symm
section LocalizationLocalization
variable (Sβ : Type*) [CommRing Sβ] [Algebra S Sβ] [Algebra Rβ Sβ] [Algebra R Sβ]
variable [IsScalarTower R Rβ Sβ] [IsScalarTower R S Sβ]
variable [IsLocalization (Algebra.algebraMapSubmonoid S M) Sβ]
variable {ΞΉ : Type*} [Fintype ΞΉ] [DecidableEq ΞΉ]
| Mathlib/RingTheory/Localization/NormTrace.lean | 101 | 109 | theorem Algebra.traceMatrix_localizationLocalization (b : Basis ΞΉ R S) :
Algebra.traceMatrix Rβ (b.localizationLocalization Rβ M Sβ) =
(algebraMap R Rβ).mapMatrix (Algebra.traceMatrix R b) := by |
have : Module.Finite R S := Module.Finite.of_basis b
have : Module.Free R S := Module.Free.of_basis b
ext i j : 2
simp_rw [RingHom.mapMatrix_apply, Matrix.map_apply, traceMatrix_apply, traceForm_apply,
Basis.localizationLocalization_apply, β map_mul]
exact Algebra.trace_localization R M _
| [
" (algebraMap R Rβ).mapMatrix ((leftMulMatrix b) a) =\n (leftMulMatrix (Basis.localizationLocalization Rβ M Sβ b)) ((algebraMap S Sβ) a)",
" (algebraMap R Rβ).mapMatrix ((leftMulMatrix b) a) i j =\n (leftMulMatrix (Basis.localizationLocalization Rβ M Sβ b)) ((algebraMap S Sβ) a) i j",
" (norm Rβ) ((algebr... | [
" (algebraMap R Rβ).mapMatrix ((leftMulMatrix b) a) =\n (leftMulMatrix (Basis.localizationLocalization Rβ M Sβ b)) ((algebraMap S Sβ) a)",
" (algebraMap R Rβ).mapMatrix ((leftMulMatrix b) a) i j =\n (leftMulMatrix (Basis.localizationLocalization Rβ M Sβ b)) ((algebraMap S Sβ) a) i j",
" (norm Rβ) ((algebr... |
import Mathlib.Algebra.Lie.OfAssociative
import Mathlib.Algebra.Lie.IdealOperations
#align_import algebra.lie.abelian from "leanprover-community/mathlib"@"8983bec7cdf6cb2dd1f21315c8a34ab00d7b2f6d"
universe u v w wβ wβ
class LieModule.IsTrivial (L : Type v) (M : Type w) [Bracket L M] [Zero M] : Prop where
trivial : β (x : L) (m : M), β
x, mβ = 0
#align lie_module.is_trivial LieModule.IsTrivial
@[simp]
theorem trivial_lie_zero (L : Type v) (M : Type w) [Bracket L M] [Zero M] [LieModule.IsTrivial L M]
(x : L) (m : M) : β
x, mβ = 0 :=
LieModule.IsTrivial.trivial x m
#align trivial_lie_zero trivial_lie_zero
instance LieModule.instIsTrivialOfSubsingleton {L M : Type*}
[LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton L] : LieModule.IsTrivial L M :=
β¨fun x m β¦ by rw [Subsingleton.eq_zero x, zero_lie]β©
instance LieModule.instIsTrivialOfSubsingleton' {L M : Type*}
[LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton M] : LieModule.IsTrivial L M :=
β¨fun x m β¦ by simp_rw [Subsingleton.eq_zero m, lie_zero]β©
abbrev IsLieAbelian (L : Type v) [Bracket L L] [Zero L] : Prop :=
LieModule.IsTrivial L L
#align is_lie_abelian IsLieAbelian
instance LieIdeal.isLieAbelian_of_trivial (R : Type u) (L : Type v) [CommRing R] [LieRing L]
[LieAlgebra R L] (I : LieIdeal R L) [h : LieModule.IsTrivial L I] : IsLieAbelian I where
trivial x y := by apply h.trivial
#align lie_ideal.is_lie_abelian_of_trivial LieIdeal.isLieAbelian_of_trivial
theorem Function.Injective.isLieAbelian {R : Type u} {Lβ : Type v} {Lβ : Type w} [CommRing R]
[LieRing Lβ] [LieRing Lβ] [LieAlgebra R Lβ] [LieAlgebra R Lβ] {f : Lβ βββ
Rβ Lβ}
(hβ : Function.Injective f) (_ : IsLieAbelian Lβ) : IsLieAbelian Lβ :=
{ trivial := fun x y => hβ <|
calc
f β
x, yβ = β
f x, f yβ := LieHom.map_lie f x y
_ = 0 := trivial_lie_zero _ _ _ _
_ = f 0 := f.map_zero.symm}
#align function.injective.is_lie_abelian Function.Injective.isLieAbelian
theorem Function.Surjective.isLieAbelian {R : Type u} {Lβ : Type v} {Lβ : Type w} [CommRing R]
[LieRing Lβ] [LieRing Lβ] [LieAlgebra R Lβ] [LieAlgebra R Lβ] {f : Lβ βββ
Rβ Lβ}
(hβ : Function.Surjective f) (hβ : IsLieAbelian Lβ) : IsLieAbelian Lβ :=
{ trivial := fun x y => by
obtain β¨u, rflβ© := hβ x
obtain β¨v, rflβ© := hβ y
rw [β LieHom.map_lie, trivial_lie_zero, LieHom.map_zero] }
#align function.surjective.is_lie_abelian Function.Surjective.isLieAbelian
theorem lie_abelian_iff_equiv_lie_abelian {R : Type u} {Lβ : Type v} {Lβ : Type w} [CommRing R]
[LieRing Lβ] [LieRing Lβ] [LieAlgebra R Lβ] [LieAlgebra R Lβ] (e : Lβ βββ
Rβ Lβ) :
IsLieAbelian Lβ β IsLieAbelian Lβ :=
β¨e.symm.injective.isLieAbelian, e.injective.isLieAbelianβ©
#align lie_abelian_iff_equiv_lie_abelian lie_abelian_iff_equiv_lie_abelian
theorem commutative_ring_iff_abelian_lie_ring {A : Type v} [Ring A] :
Std.Commutative (Ξ± := A) (Β· * Β·) β IsLieAbelian A := by
have hβ : Std.Commutative (Ξ± := A) (Β· * Β·) β β a b : A, a * b = b * a :=
β¨fun h => h.1, fun h => β¨hβ©β©
have hβ : IsLieAbelian A β β a b : A, β
a, bβ = 0 := β¨fun h => h.1, fun h => β¨hβ©β©
simp only [hβ, hβ, LieRing.of_associative_ring_bracket, sub_eq_zero]
#align commutative_ring_iff_abelian_lie_ring commutative_ring_iff_abelian_lie_ring
section Center
variable (R : Type u) (L : Type v) (M : Type w) (N : Type wβ)
variable [CommRing R] [LieRing L] [LieAlgebra R L]
variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
variable [AddCommGroup N] [Module R N] [LieRingModule L N] [LieModule R L N]
namespace LieModule
protected def ker : LieIdeal R L :=
(toEnd R L M).ker
#align lie_module.ker LieModule.ker
@[simp]
protected theorem mem_ker (x : L) : x β LieModule.ker R L M β β m : M, β
x, mβ = 0 := by
simp only [LieModule.ker, LieHom.mem_ker, LinearMap.ext_iff, LinearMap.zero_apply,
toEnd_apply_apply]
#align lie_module.mem_ker LieModule.mem_ker
def maxTrivSubmodule : LieSubmodule R L M where
carrier := { m | β x : L, β
x, mβ = 0 }
zero_mem' x := lie_zero x
add_mem' {x y} hx hy z := by rw [lie_add, hx, hy, add_zero]
smul_mem' c x hx y := by rw [lie_smul, hx, smul_zero]
lie_mem {x m} hm y := by rw [hm, lie_zero]
#align lie_module.max_triv_submodule LieModule.maxTrivSubmodule
@[simp]
theorem mem_maxTrivSubmodule (m : M) : m β maxTrivSubmodule R L M β β x : L, β
x, mβ = 0 :=
Iff.rfl
#align lie_module.mem_max_triv_submodule LieModule.mem_maxTrivSubmodule
instance : IsTrivial L (maxTrivSubmodule R L M) where trivial x m := Subtype.ext (m.property x)
@[simp]
| Mathlib/Algebra/Lie/Abelian.lean | 136 | 141 | theorem ideal_oper_maxTrivSubmodule_eq_bot (I : LieIdeal R L) :
β
I, maxTrivSubmodule R L Mβ = β₯ := by |
rw [β LieSubmodule.coe_toSubmodule_eq_iff, LieSubmodule.lieIdeal_oper_eq_linear_span,
LieSubmodule.bot_coeSubmodule, Submodule.span_eq_bot]
rintro m β¨β¨x, hxβ©, β¨β¨m, hmβ©, rflβ©β©
exact hm x
| [
" β
x, mβ = 0",
" β
x, yβ = 0",
" β
f u, yβ = 0",
" β
f u, f vβ = 0",
" (Std.Commutative fun x x_1 => x * x_1) β IsLieAbelian A",
" x β LieModule.ker R L M β β (m : M), β
x, mβ = 0",
" β
z, x + yβ = 0",
" β
y, c β’ xβ = 0",
" β
y, β
x, mββ = 0",
" β
I, maxTrivSubmodule R L Mβ = β₯",
" β x β {m | β x n, β
βx,... | [
" β
x, mβ = 0",
" β
x, yβ = 0",
" β
f u, yβ = 0",
" β
f u, f vβ = 0",
" (Std.Commutative fun x x_1 => x * x_1) β IsLieAbelian A",
" x β LieModule.ker R L M β β (m : M), β
x, mβ = 0",
" β
z, x + yβ = 0",
" β
y, c β’ xβ = 0",
" β
y, β
x, mββ = 0",
" β
I, maxTrivSubmodule R L Mβ = β₯"
] |
import Mathlib.Analysis.SpecialFunctions.Complex.Arg
import Mathlib.Analysis.SpecialFunctions.Log.Basic
#align_import analysis.special_functions.complex.log from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
namespace Complex
open Set Filter Bornology
open scoped Real Topology ComplexConjugate
-- Porting note: @[pp_nodot] does not exist in mathlib4
noncomputable def log (x : β) : β :=
x.abs.log + arg x * I
#align complex.log Complex.log
theorem log_re (x : β) : x.log.re = x.abs.log := by simp [log]
#align complex.log_re Complex.log_re
theorem log_im (x : β) : x.log.im = x.arg := by simp [log]
#align complex.log_im Complex.log_im
theorem neg_pi_lt_log_im (x : β) : -Ο < (log x).im := by simp only [log_im, neg_pi_lt_arg]
#align complex.neg_pi_lt_log_im Complex.neg_pi_lt_log_im
theorem log_im_le_pi (x : β) : (log x).im β€ Ο := by simp only [log_im, arg_le_pi]
#align complex.log_im_le_pi Complex.log_im_le_pi
theorem exp_log {x : β} (hx : x β 0) : exp (log x) = x := by
rw [log, exp_add_mul_I, β ofReal_sin, sin_arg, β ofReal_cos, cos_arg hx, β ofReal_exp,
Real.exp_log (abs.pos hx), mul_add, ofReal_div, ofReal_div,
mul_div_cancelβ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), β mul_assoc,
mul_div_cancelβ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), re_add_im]
#align complex.exp_log Complex.exp_log
@[simp]
theorem range_exp : Set.range exp = {0}αΆ :=
Set.ext fun x =>
β¨by
rintro β¨x, rflβ©
exact exp_ne_zero x, fun hx => β¨log x, exp_log hxβ©β©
#align complex.range_exp Complex.range_exp
theorem log_exp {x : β} (hxβ : -Ο < x.im) (hxβ : x.im β€ Ο) : log (exp x) = x := by
rw [log, abs_exp, Real.log_exp, exp_eq_exp_re_mul_sin_add_cos, β ofReal_exp,
arg_mul_cos_add_sin_mul_I (Real.exp_pos _) β¨hxβ, hxββ©, re_add_im]
#align complex.log_exp Complex.log_exp
theorem exp_inj_of_neg_pi_lt_of_le_pi {x y : β} (hxβ : -Ο < x.im) (hxβ : x.im β€ Ο) (hyβ : -Ο < y.im)
(hyβ : y.im β€ Ο) (hxy : exp x = exp y) : x = y := by
rw [β log_exp hxβ hxβ, β log_exp hyβ hyβ, hxy]
#align complex.exp_inj_of_neg_pi_lt_of_le_pi Complex.exp_inj_of_neg_pi_lt_of_le_pi
theorem ofReal_log {x : β} (hx : 0 β€ x) : (x.log : β) = log x :=
Complex.ext (by rw [log_re, ofReal_re, abs_of_nonneg hx])
(by rw [ofReal_im, log_im, arg_ofReal_of_nonneg hx])
#align complex.of_real_log Complex.ofReal_log
@[simp, norm_cast]
lemma natCast_log {n : β} : Real.log n = log n := ofReal_natCast n βΈ ofReal_log n.cast_nonneg
@[simp]
lemma ofNat_log {n : β} [n.AtLeastTwo] :
Real.log (no_index (OfNat.ofNat n)) = log (OfNat.ofNat n) :=
natCast_log
theorem log_ofReal_re (x : β) : (log (x : β)).re = Real.log x := by simp [log_re]
#align complex.log_of_real_re Complex.log_ofReal_re
theorem log_ofReal_mul {r : β} (hr : 0 < r) {x : β} (hx : x β 0) :
log (r * x) = Real.log r + log x := by
replace hx := Complex.abs.ne_zero_iff.mpr hx
simp_rw [log, map_mul, abs_ofReal, arg_real_mul _ hr, abs_of_pos hr, Real.log_mul hr.ne' hx,
ofReal_add, add_assoc]
#align complex.log_of_real_mul Complex.log_ofReal_mul
theorem log_mul_ofReal (r : β) (hr : 0 < r) (x : β) (hx : x β 0) :
log (x * r) = Real.log r + log x := by rw [mul_comm, log_ofReal_mul hr hx]
#align complex.log_mul_of_real Complex.log_mul_ofReal
lemma log_mul_eq_add_log_iff {x y : β} (hxβ : x β 0) (hyβ : y β 0) :
log (x * y) = log x + log y β arg x + arg y β Set.Ioc (-Ο) Ο := by
refine ext_iff.trans <| Iff.trans ?_ <| arg_mul_eq_add_arg_iff hxβ hyβ
simp_rw [add_re, add_im, log_re, log_im, AbsoluteValue.map_mul,
Real.log_mul (abs.ne_zero hxβ) (abs.ne_zero hyβ), true_and]
alias β¨_, log_mulβ© := log_mul_eq_add_log_iff
@[simp]
| Mathlib/Analysis/SpecialFunctions/Complex/Log.lean | 106 | 106 | theorem log_zero : log 0 = 0 := by | simp [log]
| [
" x.log.re = (abs x).log",
" x.log.im = x.arg",
" -Ο < x.log.im",
" x.log.im β€ Ο",
" cexp x.log = x",
" x β Set.range cexp β x β {0}αΆ",
" cexp x β {0}αΆ",
" (cexp x).log = x",
" x = y",
" (βx.log).re = (βx).log.re",
" (βx.log).im = (βx).log.im",
" (βx).log.re = x.log",
" (βr * x).log = βr.log... | [
" x.log.re = (abs x).log",
" x.log.im = x.arg",
" -Ο < x.log.im",
" x.log.im β€ Ο",
" cexp x.log = x",
" x β Set.range cexp β x β {0}αΆ",
" cexp x β {0}αΆ",
" (cexp x).log = x",
" x = y",
" (βx.log).re = (βx).log.re",
" (βx.log).im = (βx).log.im",
" (βx).log.re = x.log",
" (βr * x).log = βr.log... |
import Mathlib.Topology.Algebra.Module.Basic
import Mathlib.Analysis.Normed.MulAction
#align_import analysis.normed_space.continuous_linear_map from "leanprover-community/mathlib"@"fe18deda804e30c594e75a6e5fe0f7d14695289f"
open Metric ContinuousLinearMap
open Set Real
open NNReal
variable {π πβ E F G : Type*}
section SeminormedAddCommGroup
variable [Ring π] [Ring πβ]
variable [SeminormedAddCommGroup E] [SeminormedAddCommGroup F] [SeminormedAddCommGroup G]
variable [Module π E] [Module πβ F] [Module π G]
variable {Ο : π β+* πβ} (f : E βββ[Ο] F)
def LinearMap.mkContinuous (C : β) (h : β x, βf xβ β€ C * βxβ) : E βSL[Ο] F :=
β¨f, AddMonoidHomClass.continuous_of_bound f C hβ©
#align linear_map.mk_continuous LinearMap.mkContinuous
def LinearMap.mkContinuousOfExistsBound (h : β C, β x, βf xβ β€ C * βxβ) : E βSL[Ο] F :=
β¨f,
let β¨C, hCβ© := h
AddMonoidHomClass.continuous_of_bound f C hCβ©
#align linear_map.mk_continuous_of_exists_bound LinearMap.mkContinuousOfExistsBound
theorem continuous_of_linear_of_boundββ {f : E β F} (h_add : β x y, f (x + y) = f x + f y)
(h_smul : β (c : π) (x), f (c β’ x) = Ο c β’ f x) {C : β} (h_bound : β x, βf xβ β€ C * βxβ) :
Continuous f :=
let Ο : E βββ[Ο] F :=
{ toFun := f
map_add' := h_add
map_smul' := h_smul }
AddMonoidHomClass.continuous_of_bound Ο C h_bound
#align continuous_of_linear_of_boundββ continuous_of_linear_of_boundββ
theorem continuous_of_linear_of_bound {f : E β G} (h_add : β x y, f (x + y) = f x + f y)
(h_smul : β (c : π) (x), f (c β’ x) = c β’ f x) {C : β} (h_bound : β x, βf xβ β€ C * βxβ) :
Continuous f :=
let Ο : E ββ[π] G :=
{ toFun := f
map_add' := h_add
map_smul' := h_smul }
AddMonoidHomClass.continuous_of_bound Ο C h_bound
#align continuous_of_linear_of_bound continuous_of_linear_of_bound
@[simp, norm_cast]
theorem LinearMap.mkContinuous_coe (C : β) (h : β x, βf xβ β€ C * βxβ) :
(f.mkContinuous C h : E βββ[Ο] F) = f :=
rfl
#align linear_map.mk_continuous_coe LinearMap.mkContinuous_coe
@[simp]
theorem LinearMap.mkContinuous_apply (C : β) (h : β x, βf xβ β€ C * βxβ) (x : E) :
f.mkContinuous C h x = f x :=
rfl
#align linear_map.mk_continuous_apply LinearMap.mkContinuous_apply
@[simp, norm_cast]
theorem LinearMap.mkContinuousOfExistsBound_coe (h : β C, β x, βf xβ β€ C * βxβ) :
(f.mkContinuousOfExistsBound h : E βββ[Ο] F) = f :=
rfl
#align linear_map.mk_continuous_of_exists_bound_coe LinearMap.mkContinuousOfExistsBound_coe
@[simp]
theorem LinearMap.mkContinuousOfExistsBound_apply (h : β C, β x, βf xβ β€ C * βxβ) (x : E) :
f.mkContinuousOfExistsBound h x = f x :=
rfl
#align linear_map.mk_continuous_of_exists_bound_apply LinearMap.mkContinuousOfExistsBound_apply
section Seminormed
variable [Ring π] [Ring πβ]
variable [SeminormedAddCommGroup E] [SeminormedAddCommGroup F]
variable [Module π E] [Module πβ F]
variable {Ο : π β+* πβ} (f : E βββ[Ο] F)
def ContinuousLinearMap.ofHomothety (f : E βββ[Ο] F) (a : β) (hf : β x, βf xβ = a * βxβ) :
E βSL[Ο] F :=
f.mkContinuous a fun x => le_of_eq (hf x)
#align continuous_linear_map.of_homothety ContinuousLinearMap.ofHomothety
variable {Οββ : πβ β+* π} [RingHomInvPair Ο Οββ] [RingHomInvPair Οββ Ο]
| Mathlib/Analysis/NormedSpace/ContinuousLinearMap.lean | 198 | 205 | theorem ContinuousLinearEquiv.homothety_inverse (a : β) (ha : 0 < a) (f : E βββ[Ο] F) :
(β x : E, βf xβ = a * βxβ) β β y : F, βf.symm yβ = aβ»ΒΉ * βyβ := by |
intro hf y
calc
βf.symm yβ = aβ»ΒΉ * (a * βf.symm yβ) := by
rw [β mul_assoc, inv_mul_cancel (ne_of_lt ha).symm, one_mul]
_ = aβ»ΒΉ * βf (f.symm y)β := by rw [hf]
_ = aβ»ΒΉ * βyβ := by simp
| [
" (β (x : E), βf xβ = a * βxβ) β β (y : F), βf.symm yβ = aβ»ΒΉ * βyβ",
" βf.symm yβ = aβ»ΒΉ * βyβ",
" βf.symm yβ = aβ»ΒΉ * (a * βf.symm yβ)",
" aβ»ΒΉ * (a * βf.symm yβ) = aβ»ΒΉ * βf (f.symm y)β",
" aβ»ΒΉ * βf (f.symm y)β = aβ»ΒΉ * βyβ"
] | [
" (β (x : E), βf xβ = a * βxβ) β β (y : F), βf.symm yβ = aβ»ΒΉ * βyβ"
] |
import Mathlib.Computability.Halting
import Mathlib.Computability.TuringMachine
import Mathlib.Data.Num.Lemmas
import Mathlib.Tactic.DeriveFintype
#align_import computability.tm_to_partrec from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
open Function (update)
open Relation
namespace Turing
namespace ToPartrec
inductive Code
| zero'
| succ
| tail
| cons : Code β Code β Code
| comp : Code β Code β Code
| case : Code β Code β Code
| fix : Code β Code
deriving DecidableEq, Inhabited
#align turing.to_partrec.code Turing.ToPartrec.Code
#align turing.to_partrec.code.zero' Turing.ToPartrec.Code.zero'
#align turing.to_partrec.code.succ Turing.ToPartrec.Code.succ
#align turing.to_partrec.code.tail Turing.ToPartrec.Code.tail
#align turing.to_partrec.code.cons Turing.ToPartrec.Code.cons
#align turing.to_partrec.code.comp Turing.ToPartrec.Code.comp
#align turing.to_partrec.code.case Turing.ToPartrec.Code.case
#align turing.to_partrec.code.fix Turing.ToPartrec.Code.fix
def Code.eval : Code β List β β. List β
| Code.zero' => fun v => pure (0 :: v)
| Code.succ => fun v => pure [v.headI.succ]
| Code.tail => fun v => pure v.tail
| Code.cons f fs => fun v => do
let n β Code.eval f v
let ns β Code.eval fs v
pure (n.headI :: ns)
| Code.comp f g => fun v => g.eval v >>= f.eval
| Code.case f g => fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail)
| Code.fix f =>
PFun.fix fun v => (f.eval v).map fun v => if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail
#align turing.to_partrec.code.eval Turing.ToPartrec.Code.eval
namespace Code
@[simp]
theorem zero'_eval : zero'.eval = fun v => pure (0 :: v) := by simp [eval]
@[simp]
theorem succ_eval : succ.eval = fun v => pure [v.headI.succ] := by simp [eval]
@[simp]
theorem tail_eval : tail.eval = fun v => pure v.tail := by simp [eval]
@[simp]
theorem cons_eval (f fs) : (cons f fs).eval = fun v => do {
let n β Code.eval f v
let ns β Code.eval fs v
pure (n.headI :: ns) } := by simp [eval]
@[simp]
theorem comp_eval (f g) : (comp f g).eval = fun v => g.eval v >>= f.eval := by simp [eval]
@[simp]
theorem case_eval (f g) :
(case f g).eval = fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail) := by
simp [eval]
@[simp]
theorem fix_eval (f) : (fix f).eval =
PFun.fix fun v => (f.eval v).map fun v =>
if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail := by
simp [eval]
def nil : Code :=
tail.comp succ
#align turing.to_partrec.code.nil Turing.ToPartrec.Code.nil
@[simp]
theorem nil_eval (v) : nil.eval v = pure [] := by simp [nil]
#align turing.to_partrec.code.nil_eval Turing.ToPartrec.Code.nil_eval
def id : Code :=
tail.comp zero'
#align turing.to_partrec.code.id Turing.ToPartrec.Code.id
@[simp]
theorem id_eval (v) : id.eval v = pure v := by simp [id]
#align turing.to_partrec.code.id_eval Turing.ToPartrec.Code.id_eval
def head : Code :=
cons id nil
#align turing.to_partrec.code.head Turing.ToPartrec.Code.head
@[simp]
theorem head_eval (v) : head.eval v = pure [v.headI] := by simp [head]
#align turing.to_partrec.code.head_eval Turing.ToPartrec.Code.head_eval
def zero : Code :=
cons zero' nil
#align turing.to_partrec.code.zero Turing.ToPartrec.Code.zero
@[simp]
| Mathlib/Computability/TMToPartrec.lean | 201 | 201 | theorem zero_eval (v) : zero.eval v = pure [0] := by | simp [zero]
| [
" zero'.eval = fun v => pure (0 :: v)",
" succ.eval = fun v => pure [v.headI.succ]",
" tail.eval = fun v => pure v.tail",
" (f.cons fs).eval = fun v => do\n let n β f.eval v\n let ns β fs.eval v\n pure (n.headI :: ns)",
" (f.comp g).eval = fun v => g.eval v >>= f.eval",
" (f.case g).eval = fun v ... | [
" zero'.eval = fun v => pure (0 :: v)",
" succ.eval = fun v => pure [v.headI.succ]",
" tail.eval = fun v => pure v.tail",
" (f.cons fs).eval = fun v => do\n let n β f.eval v\n let ns β fs.eval v\n pure (n.headI :: ns)",
" (f.comp g).eval = fun v => g.eval v >>= f.eval",
" (f.case g).eval = fun v ... |
import Mathlib.Topology.Instances.Irrational
import Mathlib.Topology.Instances.Rat
import Mathlib.Topology.Compactification.OnePoint
#align_import topology.instances.rat_lemmas from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
open Set Metric Filter TopologicalSpace
open Topology OnePoint
local notation "ββ" => OnePoint β
namespace Rat
variable {p q : β} {s t : Set β}
theorem interior_compact_eq_empty (hs : IsCompact s) : interior s = β
:=
denseEmbedding_coe_real.toDenseInducing.interior_compact_eq_empty dense_irrational hs
#align rat.interior_compact_eq_empty Rat.interior_compact_eq_empty
theorem dense_compl_compact (hs : IsCompact s) : Dense sαΆ :=
interior_eq_empty_iff_dense_compl.1 (interior_compact_eq_empty hs)
#align rat.dense_compl_compact Rat.dense_compl_compact
instance cocompact_inf_nhds_neBot : NeBot (cocompact β β π p) := by
refine (hasBasis_cocompact.inf (nhds_basis_opens _)).neBot_iff.2 ?_
rintro β¨s, oβ© β¨hs, hpo, hoβ©; rw [inter_comm]
exact (dense_compl_compact hs).inter_open_nonempty _ ho β¨p, hpoβ©
#align rat.cocompact_inf_nhds_ne_bot Rat.cocompact_inf_nhds_neBot
| Mathlib/Topology/Instances/RatLemmas.lean | 56 | 62 | theorem not_countably_generated_cocompact : Β¬IsCountablyGenerated (cocompact β) := by |
intro H
rcases exists_seq_tendsto (cocompact β β π 0) with β¨x, hxβ©
rw [tendsto_inf] at hx; rcases hx with β¨hxc, hx0β©
obtain β¨n, hnβ© : β n : β, x n β insert (0 : β) (range x) :=
(hxc.eventually hx0.isCompact_insert_range.compl_mem_cocompact).exists
exact hn (Or.inr β¨n, rflβ©)
| [
" (cocompact β β π p).NeBot",
" β {i : Set β Γ Set β}, IsCompact i.1 β§ p β i.2 β§ IsOpen i.2 β (i.1αΆ β© i.2).Nonempty",
" ((s, o).1αΆ β© (s, o).2).Nonempty",
" ((s, o).2 β© (s, o).1αΆ).Nonempty",
" Β¬(cocompact β).IsCountablyGenerated",
" False"
] | [
" (cocompact β β π p).NeBot",
" β {i : Set β Γ Set β}, IsCompact i.1 β§ p β i.2 β§ IsOpen i.2 β (i.1αΆ β© i.2).Nonempty",
" ((s, o).1αΆ β© (s, o).2).Nonempty",
" ((s, o).2 β© (s, o).1αΆ).Nonempty",
" Β¬(cocompact β).IsCountablyGenerated"
] |
import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1
#align_import measure_theory.function.conditional_expectation.basic from "leanprover-community/mathlib"@"d8bbb04e2d2a44596798a9207ceefc0fb236e41e"
open TopologicalSpace MeasureTheory.Lp Filter
open scoped ENNReal Topology MeasureTheory
namespace MeasureTheory
variable {Ξ± F F' π : Type*} {p : ββ₯0β} [RCLike π]
-- π for β or β
-- F for a Lp submodule
[NormedAddCommGroup F]
[NormedSpace π F]
-- F' for integrals on a Lp submodule
[NormedAddCommGroup F']
[NormedSpace π F'] [NormedSpace β F'] [CompleteSpace F']
open scoped Classical
variable {m m0 : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {f g : Ξ± β F'} {s : Set Ξ±}
noncomputable irreducible_def condexp (m : MeasurableSpace Ξ±) {m0 : MeasurableSpace Ξ±}
(ΞΌ : Measure Ξ±) (f : Ξ± β F') : Ξ± β F' :=
if hm : m β€ m0 then
if h : SigmaFinite (ΞΌ.trim hm) β§ Integrable f ΞΌ then
if StronglyMeasurable[m] f then f
else (@aestronglyMeasurable'_condexpL1 _ _ _ _ _ m m0 ΞΌ hm h.1 _).mk
(@condexpL1 _ _ _ _ _ _ _ hm ΞΌ h.1 f)
else 0
else 0
#align measure_theory.condexp MeasureTheory.condexp
-- We define notation `ΞΌ[f|m]` for the conditional expectation of `f` with respect to `m`.
scoped notation ΞΌ "[" f "|" m "]" => MeasureTheory.condexp m ΞΌ f
theorem condexp_of_not_le (hm_not : Β¬m β€ m0) : ΞΌ[f|m] = 0 := by rw [condexp, dif_neg hm_not]
#align measure_theory.condexp_of_not_le MeasureTheory.condexp_of_not_le
theorem condexp_of_not_sigmaFinite (hm : m β€ m0) (hΞΌm_not : Β¬SigmaFinite (ΞΌ.trim hm)) :
ΞΌ[f|m] = 0 := by rw [condexp, dif_pos hm, dif_neg]; push_neg; exact fun h => absurd h hΞΌm_not
#align measure_theory.condexp_of_not_sigma_finite MeasureTheory.condexp_of_not_sigmaFinite
theorem condexp_of_sigmaFinite (hm : m β€ m0) [hΞΌm : SigmaFinite (ΞΌ.trim hm)] :
ΞΌ[f|m] =
if Integrable f ΞΌ then
if StronglyMeasurable[m] f then f
else aestronglyMeasurable'_condexpL1.mk (condexpL1 hm ΞΌ f)
else 0 := by
rw [condexp, dif_pos hm]
simp only [hΞΌm, Ne, true_and_iff]
by_cases hf : Integrable f ΞΌ
Β· rw [dif_pos hf, if_pos hf]
Β· rw [dif_neg hf, if_neg hf]
#align measure_theory.condexp_of_sigma_finite MeasureTheory.condexp_of_sigmaFinite
theorem condexp_of_stronglyMeasurable (hm : m β€ m0) [hΞΌm : SigmaFinite (ΞΌ.trim hm)] {f : Ξ± β F'}
(hf : StronglyMeasurable[m] f) (hfi : Integrable f ΞΌ) : ΞΌ[f|m] = f := by
rw [condexp_of_sigmaFinite hm, if_pos hfi, if_pos hf]
#align measure_theory.condexp_of_strongly_measurable MeasureTheory.condexp_of_stronglyMeasurable
theorem condexp_const (hm : m β€ m0) (c : F') [IsFiniteMeasure ΞΌ] :
ΞΌ[fun _ : Ξ± => c|m] = fun _ => c :=
condexp_of_stronglyMeasurable hm (@stronglyMeasurable_const _ _ m _ _) (integrable_const c)
#align measure_theory.condexp_const MeasureTheory.condexp_const
theorem condexp_ae_eq_condexpL1 (hm : m β€ m0) [hΞΌm : SigmaFinite (ΞΌ.trim hm)] (f : Ξ± β F') :
ΞΌ[f|m] =α΅[ΞΌ] condexpL1 hm ΞΌ f := by
rw [condexp_of_sigmaFinite hm]
by_cases hfi : Integrable f ΞΌ
Β· rw [if_pos hfi]
by_cases hfm : StronglyMeasurable[m] f
Β· rw [if_pos hfm]
exact (condexpL1_of_aestronglyMeasurable' (StronglyMeasurable.aeStronglyMeasurable' hfm)
hfi).symm
Β· rw [if_neg hfm]
exact (AEStronglyMeasurable'.ae_eq_mk aestronglyMeasurable'_condexpL1).symm
rw [if_neg hfi, condexpL1_undef hfi]
exact (coeFn_zero _ _ _).symm
set_option linter.uppercaseLean3 false in
#align measure_theory.condexp_ae_eq_condexp_L1 MeasureTheory.condexp_ae_eq_condexpL1
| Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean | 152 | 155 | theorem condexp_ae_eq_condexpL1CLM (hm : m β€ m0) [SigmaFinite (ΞΌ.trim hm)] (hf : Integrable f ΞΌ) :
ΞΌ[f|m] =α΅[ΞΌ] condexpL1CLM F' hm ΞΌ (hf.toL1 f) := by |
refine (condexp_ae_eq_condexpL1 hm f).trans (eventually_of_forall fun x => ?_)
rw [condexpL1_eq hf]
| [
" ΞΌ[f|m] = 0",
" Β¬(SigmaFinite (ΞΌ.trim hm) β§ Integrable f ΞΌ)",
" SigmaFinite (ΞΌ.trim hm) β Β¬Integrable f ΞΌ",
" ΞΌ[f|m] =\n if Integrable f ΞΌ then if StronglyMeasurable f then f else AEStronglyMeasurable'.mk ββ(condexpL1 hm ΞΌ f) β― else 0",
" (if h : SigmaFinite (ΞΌ.trim hm) β§ Integrable f ΞΌ then\n if S... | [
" ΞΌ[f|m] = 0",
" Β¬(SigmaFinite (ΞΌ.trim hm) β§ Integrable f ΞΌ)",
" SigmaFinite (ΞΌ.trim hm) β Β¬Integrable f ΞΌ",
" ΞΌ[f|m] =\n if Integrable f ΞΌ then if StronglyMeasurable f then f else AEStronglyMeasurable'.mk ββ(condexpL1 hm ΞΌ f) β― else 0",
" (if h : SigmaFinite (ΞΌ.trim hm) β§ Integrable f ΞΌ then\n if S... |
import Mathlib.Control.Functor.Multivariate
import Mathlib.Data.PFunctor.Univariate.Basic
#align_import data.pfunctor.multivariate.basic from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
universe u v
open MvFunctor
@[pp_with_univ]
structure MvPFunctor (n : β) where
A : Type u
B : A β TypeVec.{u} n
#align mvpfunctor MvPFunctor
namespace MvPFunctor
open MvFunctor (LiftP LiftR)
variable {n m : β} (P : MvPFunctor.{u} n)
@[coe]
def Obj (Ξ± : TypeVec.{u} n) : Type u :=
Ξ£ a : P.A, P.B a βΉ Ξ±
#align mvpfunctor.obj MvPFunctor.Obj
instance : CoeFun (MvPFunctor.{u} n) (fun _ => TypeVec.{u} n β Type u) where
coe := Obj
def map {Ξ± Ξ² : TypeVec n} (f : Ξ± βΉ Ξ²) : P Ξ± β P Ξ² := fun β¨a, gβ© => β¨a, TypeVec.comp f gβ©
#align mvpfunctor.map MvPFunctor.map
instance : Inhabited (MvPFunctor n) :=
β¨β¨default, defaultβ©β©
instance Obj.inhabited {Ξ± : TypeVec n} [Inhabited P.A] [β i, Inhabited (Ξ± i)] :
Inhabited (P Ξ±) :=
β¨β¨default, fun _ _ => defaultβ©β©
#align mvpfunctor.obj.inhabited MvPFunctor.Obj.inhabited
instance : MvFunctor.{u} P.Obj :=
β¨@MvPFunctor.map n Pβ©
theorem map_eq {Ξ± Ξ² : TypeVec n} (g : Ξ± βΉ Ξ²) (a : P.A) (f : P.B a βΉ Ξ±) :
@MvFunctor.map _ P.Obj _ _ _ g β¨a, fβ© = β¨a, g β fβ© :=
rfl
#align mvpfunctor.map_eq MvPFunctor.map_eq
theorem id_map {Ξ± : TypeVec n} : β x : P Ξ±, TypeVec.id <$$> x = x
| β¨_, _β© => rfl
#align mvpfunctor.id_map MvPFunctor.id_map
theorem comp_map {Ξ± Ξ² Ξ³ : TypeVec n} (f : Ξ± βΉ Ξ²) (g : Ξ² βΉ Ξ³) :
β x : P Ξ±, (g β f) <$$> x = g <$$> f <$$> x
| β¨_, _β© => rfl
#align mvpfunctor.comp_map MvPFunctor.comp_map
instance : LawfulMvFunctor.{u} P.Obj where
id_map := @id_map _ P
comp_map := @comp_map _ P
def const (n : β) (A : Type u) : MvPFunctor n :=
{ A
B := fun _ _ => PEmpty }
#align mvpfunctor.const MvPFunctor.const
section Const
variable (n) {A : Type u} {Ξ± Ξ² : TypeVec.{u} n}
def const.mk (x : A) {Ξ±} : const n A Ξ± :=
β¨x, fun _ a => PEmpty.elim aβ©
#align mvpfunctor.const.mk MvPFunctor.const.mk
variable {n}
def const.get (x : const n A Ξ±) : A :=
x.1
#align mvpfunctor.const.get MvPFunctor.const.get
@[simp]
theorem const.get_map (f : Ξ± βΉ Ξ²) (x : const n A Ξ±) : const.get (f <$$> x) = const.get x := by
cases x
rfl
#align mvpfunctor.const.get_map MvPFunctor.const.get_map
@[simp]
theorem const.get_mk (x : A) : const.get (const.mk n x : const n A Ξ±) = x := rfl
#align mvpfunctor.const.get_mk MvPFunctor.const.get_mk
@[simp]
| Mathlib/Data/PFunctor/Multivariate/Basic.lean | 116 | 119 | theorem const.mk_get (x : const n A Ξ±) : const.mk n (const.get x) = x := by |
cases x
dsimp [const.get, const.mk]
congr with (_β¨β©)
| [
" get (f <$$> x) = get x",
" get (f <$$> β¨fstβ, sndββ©) = get β¨fstβ, sndββ©",
" mk n (get x) = x",
" mk n (get β¨fstβ, sndββ©) = β¨fstβ, sndββ©",
" β¨fstβ, fun x a => PEmpty.elim aβ© = β¨fstβ, sndββ©"
] | [
" get (f <$$> x) = get x",
" get (f <$$> β¨fstβ, sndββ©) = get β¨fstβ, sndββ©",
" mk n (get x) = x"
] |
import Mathlib.Algebra.Module.Torsion
import Mathlib.RingTheory.DedekindDomain.Ideal
#align_import algebra.module.dedekind_domain from "leanprover-community/mathlib"@"cdc34484a07418af43daf8198beaf5c00324bca8"
universe u v
variable {R : Type u} [CommRing R] [IsDomain R] {M : Type v} [AddCommGroup M] [Module R M]
open scoped DirectSum
namespace Submodule
variable [IsDedekindDomain R]
open UniqueFactorizationMonoid
open scoped Classical
theorem isInternal_prime_power_torsion_of_is_torsion_by_ideal {I : Ideal R} (hI : I β β₯)
(hM : Module.IsTorsionBySet R M I) :
DirectSum.IsInternal fun p : (factors I).toFinset =>
torsionBySet R M (p ^ (factors I).count βp : Ideal R) := by
let P := factors I
have prime_of_mem := fun p (hp : p β P.toFinset) =>
prime_of_factor p (Multiset.mem_toFinset.mp hp)
apply torsionBySet_isInternal (p := fun p => p ^ P.count p) _
Β· convert hM
rw [β Finset.inf_eq_iInf, IsDedekindDomain.inf_prime_pow_eq_prod, β Finset.prod_multiset_count,
β associated_iff_eq]
Β· exact factors_prod hI
Β· exact prime_of_mem
Β· exact fun _ _ _ _ ij => ij
Β· intro p hp q hq pq; dsimp
rw [irreducible_pow_sup]
Β· suffices (normalizedFactors _).count p = 0 by rw [this, zero_min, pow_zero, Ideal.one_eq_top]
rw [Multiset.count_eq_zero,
normalizedFactors_of_irreducible_pow (prime_of_mem q hq).irreducible,
Multiset.mem_replicate]
exact fun H => pq <| H.2.trans <| normalize_eq q
Β· rw [β Ideal.zero_eq_bot]; apply pow_ne_zero; exact (prime_of_mem q hq).ne_zero
Β· exact (prime_of_mem p hp).irreducible
#align submodule.is_internal_prime_power_torsion_of_is_torsion_by_ideal Submodule.isInternal_prime_power_torsion_of_is_torsion_by_ideal
| Mathlib/Algebra/Module/DedekindDomain.lean | 65 | 72 | theorem isInternal_prime_power_torsion [Module.Finite R M] (hM : Module.IsTorsion R M) :
DirectSum.IsInternal fun p : (factors (β€ : Submodule R M).annihilator).toFinset =>
torsionBySet R M (p ^ (factors (β€ : Submodule R M).annihilator).count βp : Ideal R) := by |
have hM' := Module.isTorsionBySet_annihilator_top R M
have hI := Submodule.annihilator_top_inter_nonZeroDivisors hM
refine isInternal_prime_power_torsion_of_is_torsion_by_ideal ?_ hM'
rw [β Set.nonempty_iff_ne_empty] at hI; rw [Submodule.ne_bot_iff]
obtain β¨x, H, hxβ© := hI; exact β¨x, H, nonZeroDivisors.ne_zero hxβ©
| [
" DirectSum.IsInternal fun p => torsionBySet R M β(βp ^ Multiset.count (βp) (factors I))",
" Module.IsTorsionBySet R M β(β¨
i β (factors I).toFinset, i ^ Multiset.count i P)",
" β¨
i β (factors I).toFinset, i ^ Multiset.count i P = I",
" Associated (factors I).prod I",
" β i β (factors I).toFinset, Prime i",
... | [
" DirectSum.IsInternal fun p => torsionBySet R M β(βp ^ Multiset.count (βp) (factors I))",
" Module.IsTorsionBySet R M β(β¨
i β (factors I).toFinset, i ^ Multiset.count i P)",
" β¨
i β (factors I).toFinset, i ^ Multiset.count i P = I",
" Associated (factors I).prod I",
" β i β (factors I).toFinset, Prime i",
... |
import Mathlib.Algebra.Polynomial.Expand
import Mathlib.Algebra.Polynomial.Laurent
import Mathlib.LinearAlgebra.Matrix.Charpoly.Basic
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.RingTheory.Polynomial.Nilpotent
#align_import linear_algebra.matrix.charpoly.coeff from "leanprover-community/mathlib"@"9745b093210e9dac443af24da9dba0f9e2b6c912"
noncomputable section
-- porting note: whenever there was `β i : n, X - C (M i i)`, I replaced it with
-- `β i : n, (X - C (M i i))`, since otherwise Lean would parse as `(β i : n, X) - C (M i i)`
universe u v w z
open Finset Matrix Polynomial
variable {R : Type u} [CommRing R]
variable {n G : Type v} [DecidableEq n] [Fintype n]
variable {Ξ± Ξ² : Type v} [DecidableEq Ξ±]
variable {M : Matrix n n R}
namespace Matrix
theorem charmatrix_apply_natDegree [Nontrivial R] (i j : n) :
(charmatrix M i j).natDegree = ite (i = j) 1 0 := by
by_cases h : i = j <;> simp [h, β degree_eq_iff_natDegree_eq_of_pos (Nat.succ_pos 0)]
#align charmatrix_apply_nat_degree Matrix.charmatrix_apply_natDegree
theorem charmatrix_apply_natDegree_le (i j : n) :
(charmatrix M i j).natDegree β€ ite (i = j) 1 0 := by
split_ifs with h <;> simp [h, natDegree_X_le]
#align charmatrix_apply_nat_degree_le Matrix.charmatrix_apply_natDegree_le
variable (M)
| Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean | 61 | 78 | theorem charpoly_sub_diagonal_degree_lt :
(M.charpoly - β i : n, (X - C (M i i))).degree < β(Fintype.card n - 1) := by |
rw [charpoly, det_apply', β insert_erase (mem_univ (Equiv.refl n)),
sum_insert (not_mem_erase (Equiv.refl n) univ), add_comm]
simp only [charmatrix_apply_eq, one_mul, Equiv.Perm.sign_refl, id, Int.cast_one,
Units.val_one, add_sub_cancel_right, Equiv.coe_refl]
rw [β mem_degreeLT]
apply Submodule.sum_mem (degreeLT R (Fintype.card n - 1))
intro c hc; rw [β C_eq_intCast, C_mul']
apply Submodule.smul_mem (degreeLT R (Fintype.card n - 1)) ββ(Equiv.Perm.sign c)
rw [mem_degreeLT]
apply lt_of_le_of_lt degree_le_natDegree _
rw [Nat.cast_lt]
apply lt_of_le_of_lt _ (Equiv.Perm.fixed_point_card_lt_of_ne_one (ne_of_mem_erase hc))
apply le_trans (Polynomial.natDegree_prod_le univ fun i : n => charmatrix M (c i) i) _
rw [card_eq_sum_ones]; rw [sum_filter]; apply sum_le_sum
intros
apply charmatrix_apply_natDegree_le
| [
" (M.charmatrix i j).natDegree = if i = j then 1 else 0",
" (M.charmatrix i j).natDegree β€ if i = j then 1 else 0",
" (M.charmatrix i j).natDegree β€ 1",
" (M.charmatrix i j).natDegree β€ 0",
" (M.charpoly - β i : n, (X - C (M i i))).degree < β(Fintype.card n - 1)",
" (β x β univ.erase (Equiv.refl n), ββ(Eq... | [
" (M.charmatrix i j).natDegree = if i = j then 1 else 0",
" (M.charmatrix i j).natDegree β€ if i = j then 1 else 0",
" (M.charmatrix i j).natDegree β€ 1",
" (M.charmatrix i j).natDegree β€ 0",
" (M.charpoly - β i : n, (X - C (M i i))).degree < β(Fintype.card n - 1)"
] |
import Mathlib.FieldTheory.Galois
#align_import field_theory.polynomial_galois_group from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a"
noncomputable section
open scoped Polynomial
open FiniteDimensional
namespace Polynomial
variable {F : Type*} [Field F] (p q : F[X]) (E : Type*) [Field E] [Algebra F E]
def Gal :=
p.SplittingField ββ[F] p.SplittingField
-- Porting note(https://github.com/leanprover-community/mathlib4/issues/5020):
-- deriving Group, Fintype
#align polynomial.gal Polynomial.Gal
namespace Gal
instance instGroup : Group (Gal p) :=
inferInstanceAs (Group (p.SplittingField ββ[F] p.SplittingField))
instance instFintype : Fintype (Gal p) :=
inferInstanceAs (Fintype (p.SplittingField ββ[F] p.SplittingField))
instance : CoeFun p.Gal fun _ => p.SplittingField β p.SplittingField :=
-- Porting note: was AlgEquiv.hasCoeToFun
inferInstanceAs (CoeFun (p.SplittingField ββ[F] p.SplittingField) _)
instance applyMulSemiringAction : MulSemiringAction p.Gal p.SplittingField :=
AlgEquiv.applyMulSemiringAction
#align polynomial.gal.apply_mul_semiring_action Polynomial.Gal.applyMulSemiringAction
@[ext]
| Mathlib/FieldTheory/PolynomialGaloisGroup.lean | 74 | 79 | theorem ext {Ο Ο : p.Gal} (h : β x β p.rootSet p.SplittingField, Ο x = Ο x) : Ο = Ο := by |
refine
AlgEquiv.ext fun x =>
(AlgHom.mem_equalizer Ο.toAlgHom Ο.toAlgHom x).mp
((SetLike.ext_iff.mp ?_ x).mpr Algebra.mem_top)
rwa [eq_top_iff, β SplittingField.adjoin_rootSet, Algebra.adjoin_le_iff]
| [
" Ο = Ο",
" (βΟ).equalizer βΟ = β€"
] | [
" Ο = Ο"
] |
import Mathlib.Algebra.Regular.Basic
import Mathlib.LinearAlgebra.Matrix.MvPolynomial
import Mathlib.LinearAlgebra.Matrix.Polynomial
import Mathlib.RingTheory.Polynomial.Basic
#align_import linear_algebra.matrix.adjugate from "leanprover-community/mathlib"@"a99f85220eaf38f14f94e04699943e185a5e1d1a"
namespace Matrix
universe u v w
variable {m : Type u} {n : Type v} {Ξ± : Type w}
variable [DecidableEq n] [Fintype n] [DecidableEq m] [Fintype m] [CommRing Ξ±]
open Matrix Polynomial Equiv Equiv.Perm Finset
section Cramer
variable (A : Matrix n n Ξ±) (b : n β Ξ±)
def cramerMap (i : n) : Ξ± :=
(A.updateColumn i b).det
#align matrix.cramer_map Matrix.cramerMap
theorem cramerMap_is_linear (i : n) : IsLinearMap Ξ± fun b => cramerMap A b i :=
{ map_add := det_updateColumn_add _ _
map_smul := det_updateColumn_smul _ _ }
#align matrix.cramer_map_is_linear Matrix.cramerMap_is_linear
theorem cramer_is_linear : IsLinearMap Ξ± (cramerMap A) := by
constructor <;> intros <;> ext i
Β· apply (cramerMap_is_linear A i).1
Β· apply (cramerMap_is_linear A i).2
#align matrix.cramer_is_linear Matrix.cramer_is_linear
def cramer (A : Matrix n n Ξ±) : (n β Ξ±) ββ[Ξ±] (n β Ξ±) :=
IsLinearMap.mk' (cramerMap A) (cramer_is_linear A)
#align matrix.cramer Matrix.cramer
theorem cramer_apply (i : n) : cramer A b i = (A.updateColumn i b).det :=
rfl
#align matrix.cramer_apply Matrix.cramer_apply
theorem cramer_transpose_apply (i : n) : cramer Aα΅ b i = (A.updateRow i b).det := by
rw [cramer_apply, updateColumn_transpose, det_transpose]
#align matrix.cramer_transpose_apply Matrix.cramer_transpose_apply
theorem cramer_transpose_row_self (i : n) : Aα΅.cramer (A i) = Pi.single i A.det := by
ext j
rw [cramer_apply, Pi.single_apply]
split_ifs with h
Β· -- i = j: this entry should be `A.det`
subst h
simp only [updateColumn_transpose, det_transpose, updateRow_eq_self]
Β· -- i β j: this entry should be 0
rw [updateColumn_transpose, det_transpose]
apply det_zero_of_row_eq h
rw [updateRow_self, updateRow_ne (Ne.symm h)]
#align matrix.cramer_transpose_row_self Matrix.cramer_transpose_row_self
theorem cramer_row_self (i : n) (h : β j, b j = A j i) : A.cramer b = Pi.single i A.det := by
rw [β transpose_transpose A, det_transpose]
convert cramer_transpose_row_self Aα΅ i
exact funext h
#align matrix.cramer_row_self Matrix.cramer_row_self
@[simp]
theorem cramer_one : cramer (1 : Matrix n n Ξ±) = 1 := by
-- Porting note: was `ext i j`
refine LinearMap.pi_ext' (fun (i : n) => LinearMap.ext_ring (funext (fun (j : n) => ?_)))
convert congr_fun (cramer_row_self (1 : Matrix n n Ξ±) (Pi.single i 1) i _) j
Β· simp
Β· intro j
rw [Matrix.one_eq_pi_single, Pi.single_comm]
#align matrix.cramer_one Matrix.cramer_one
theorem cramer_smul (r : Ξ±) (A : Matrix n n Ξ±) :
cramer (r β’ A) = r ^ (Fintype.card n - 1) β’ cramer A :=
LinearMap.ext fun _ => funext fun _ => det_updateColumn_smul' _ _ _ _
#align matrix.cramer_smul Matrix.cramer_smul
@[simp]
theorem cramer_subsingleton_apply [Subsingleton n] (A : Matrix n n Ξ±) (b : n β Ξ±) (i : n) :
cramer A b i = b i := by rw [cramer_apply, det_eq_elem_of_subsingleton _ i, updateColumn_self]
#align matrix.cramer_subsingleton_apply Matrix.cramer_subsingleton_apply
theorem cramer_zero [Nontrivial n] : cramer (0 : Matrix n n Ξ±) = 0 := by
ext i j
obtain β¨j', hj'β© : β j', j' β j := exists_ne j
apply det_eq_zero_of_column_eq_zero j'
intro j''
simp [updateColumn_ne hj']
#align matrix.cramer_zero Matrix.cramer_zero
theorem sum_cramer {Ξ²} (s : Finset Ξ²) (f : Ξ² β n β Ξ±) :
(β x β s, cramer A (f x)) = cramer A (β x β s, f x) :=
(map_sum (cramer A) ..).symm
#align matrix.sum_cramer Matrix.sum_cramer
| Mathlib/LinearAlgebra/Matrix/Adjugate.lean | 160 | 170 | theorem sum_cramer_apply {Ξ²} (s : Finset Ξ²) (f : n β Ξ² β Ξ±) (i : n) :
(β x β s, cramer A (fun j => f j x) i) = cramer A (fun j : n => β x β s, f j x) i :=
calc
(β x β s, cramer A (fun j => f j x) i) = (β x β s, cramer A fun j => f j x) i :=
(Finset.sum_apply i s _).symm
_ = cramer A (fun j : n => β x β s, f j x) i := by |
rw [sum_cramer, cramer_apply, cramer_apply]
simp only [updateColumn]
congr with j
congr
apply Finset.sum_apply
| [
" IsLinearMap Ξ± A.cramerMap",
" β (x y : n β Ξ±), A.cramerMap (x + y) = A.cramerMap x + A.cramerMap y",
" β (c : Ξ±) (x : n β Ξ±), A.cramerMap (c β’ x) = c β’ A.cramerMap x",
" A.cramerMap (xβ + yβ) = A.cramerMap xβ + A.cramerMap yβ",
" A.cramerMap (cβ β’ xβ) = cβ β’ A.cramerMap xβ",
" A.cramerMap (xβ + yβ) i = ... | [
" IsLinearMap Ξ± A.cramerMap",
" β (x y : n β Ξ±), A.cramerMap (x + y) = A.cramerMap x + A.cramerMap y",
" β (c : Ξ±) (x : n β Ξ±), A.cramerMap (c β’ x) = c β’ A.cramerMap x",
" A.cramerMap (xβ + yβ) = A.cramerMap xβ + A.cramerMap yβ",
" A.cramerMap (cβ β’ xβ) = cβ β’ A.cramerMap xβ",
" A.cramerMap (xβ + yβ) i = ... |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Comp
import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars
#align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
open scoped Classical
open Topology Filter ENNReal
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]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
section CompositionVector
open ContinuousLinearMap
variable {l : F β E} {l' : F βL[π] E} {y : F}
variable (x)
theorem HasFDerivWithinAt.comp_hasDerivWithinAt {t : Set F} (hl : HasFDerivWithinAt l l' t (f x))
(hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) :
HasDerivWithinAt (l β f) (l' f') s x := by
simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (Β· β Β·)] using
(hl.comp x hf.hasFDerivWithinAt hst).hasDerivWithinAt
#align has_fderiv_within_at.comp_has_deriv_within_at HasFDerivWithinAt.comp_hasDerivWithinAt
theorem HasFDerivWithinAt.comp_hasDerivWithinAt_of_eq {t : Set F}
(hl : HasFDerivWithinAt l l' t y)
(hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) (hy : y = f x) :
HasDerivWithinAt (l β f) (l' f') s x := by
rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf hst
theorem HasFDerivAt.comp_hasDerivWithinAt (hl : HasFDerivAt l l' (f x))
(hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (l β f) (l' f') s x :=
hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf (mapsTo_univ _ _)
#align has_fderiv_at.comp_has_deriv_within_at HasFDerivAt.comp_hasDerivWithinAt
theorem HasFDerivAt.comp_hasDerivWithinAt_of_eq (hl : HasFDerivAt l l' y)
(hf : HasDerivWithinAt f f' s x) (hy : y = f x) :
HasDerivWithinAt (l β f) (l' f') s x := by
rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf
theorem HasFDerivAt.comp_hasDerivAt (hl : HasFDerivAt l l' (f x)) (hf : HasDerivAt f f' x) :
HasDerivAt (l β f) (l' f') x :=
hasDerivWithinAt_univ.mp <| hl.comp_hasDerivWithinAt x hf.hasDerivWithinAt
#align has_fderiv_at.comp_has_deriv_at HasFDerivAt.comp_hasDerivAt
theorem HasFDerivAt.comp_hasDerivAt_of_eq
(hl : HasFDerivAt l l' y) (hf : HasDerivAt f f' x) (hy : y = f x) :
HasDerivAt (l β f) (l' f') x := by
rw [hy] at hl; exact hl.comp_hasDerivAt x hf
theorem HasStrictFDerivAt.comp_hasStrictDerivAt (hl : HasStrictFDerivAt l l' (f x))
(hf : HasStrictDerivAt f f' x) : HasStrictDerivAt (l β f) (l' f') x := by
simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (Β· β Β·)] using
(hl.comp x hf.hasStrictFDerivAt).hasStrictDerivAt
#align has_strict_fderiv_at.comp_has_strict_deriv_at HasStrictFDerivAt.comp_hasStrictDerivAt
theorem HasStrictFDerivAt.comp_hasStrictDerivAt_of_eq (hl : HasStrictFDerivAt l l' y)
(hf : HasStrictDerivAt f f' x) (hy : y = f x) :
HasStrictDerivAt (l β f) (l' f') x := by
rw [hy] at hl; exact hl.comp_hasStrictDerivAt x hf
theorem fderivWithin.comp_derivWithin {t : Set F} (hl : DifferentiableWithinAt π l t (f x))
(hf : DifferentiableWithinAt π f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt π s x) :
derivWithin (l β f) s x = (fderivWithin π l t (f x) : F β E) (derivWithin f s x) :=
(hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf.hasDerivWithinAt hs).derivWithin hxs
#align fderiv_within.comp_deriv_within fderivWithin.comp_derivWithin
| Mathlib/Analysis/Calculus/Deriv/Comp.lean | 404 | 408 | theorem fderivWithin.comp_derivWithin_of_eq {t : Set F} (hl : DifferentiableWithinAt π l t y)
(hf : DifferentiableWithinAt π f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt π s x)
(hy : y = f x) :
derivWithin (l β f) s x = (fderivWithin π l t (f x) : F β E) (derivWithin f s x) := by |
rw [hy] at hl; exact fderivWithin.comp_derivWithin x hl hf hs hxs
| [
" HasDerivWithinAt (l β f) (l' f') s x",
" HasDerivAt (l β f) (l' f') x",
" HasStrictDerivAt (l β f) (l' f') x",
" derivWithin (l β f) s x = (fderivWithin π l t (f x)) (derivWithin f s x)"
] | [
" HasDerivWithinAt (l β f) (l' f') s x",
" HasDerivAt (l β f) (l' f') x",
" HasStrictDerivAt (l β f) (l' f') x",
" derivWithin (l β f) s x = (fderivWithin π l t (f x)) (derivWithin f s x)"
] |
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
section regionBetween
variable {Ξ± : Type*}
def regionBetween (f g : Ξ± β β) (s : Set Ξ±) : Set (Ξ± Γ β) :=
{ p : Ξ± Γ β | p.1 β s β§ p.2 β Ioo (f p.1) (g p.1) }
#align region_between regionBetween
theorem regionBetween_subset (f g : Ξ± β β) (s : Set Ξ±) : regionBetween f g s β s ΓΛ’ univ := by
simpa only [prod_univ, regionBetween, Set.preimage, setOf_subset_setOf] using fun a => And.left
#align region_between_subset regionBetween_subset
variable [MeasurableSpace Ξ±] {ΞΌ : Measure Ξ±} {f g : Ξ± β β} {s : Set Ξ±}
theorem measurableSet_regionBetween (hf : Measurable f) (hg : Measurable g) (hs : MeasurableSet s) :
MeasurableSet (regionBetween f g s) := by
dsimp only [regionBetween, Ioo, mem_setOf_eq, setOf_and]
refine
MeasurableSet.inter ?_
((measurableSet_lt (hf.comp measurable_fst) measurable_snd).inter
(measurableSet_lt measurable_snd (hg.comp measurable_fst)))
exact measurable_fst hs
#align measurable_set_region_between measurableSet_regionBetween
theorem measurableSet_region_between_oc (hf : Measurable f) (hg : Measurable g)
(hs : MeasurableSet s) :
MeasurableSet { p : Ξ± Γ β | p.fst β s β§ p.snd β Ioc (f p.fst) (g p.fst) } := by
dsimp only [regionBetween, Ioc, mem_setOf_eq, setOf_and]
refine
MeasurableSet.inter ?_
((measurableSet_lt (hf.comp measurable_fst) measurable_snd).inter
(measurableSet_le measurable_snd (hg.comp measurable_fst)))
exact measurable_fst hs
#align measurable_set_region_between_oc measurableSet_region_between_oc
theorem measurableSet_region_between_co (hf : Measurable f) (hg : Measurable g)
(hs : MeasurableSet s) :
MeasurableSet { p : Ξ± Γ β | p.fst β s β§ p.snd β Ico (f p.fst) (g p.fst) } := by
dsimp only [regionBetween, Ico, mem_setOf_eq, setOf_and]
refine
MeasurableSet.inter ?_
((measurableSet_le (hf.comp measurable_fst) measurable_snd).inter
(measurableSet_lt measurable_snd (hg.comp measurable_fst)))
exact measurable_fst hs
#align measurable_set_region_between_co measurableSet_region_between_co
theorem measurableSet_region_between_cc (hf : Measurable f) (hg : Measurable g)
(hs : MeasurableSet s) :
MeasurableSet { p : Ξ± Γ β | p.fst β s β§ p.snd β Icc (f p.fst) (g p.fst) } := by
dsimp only [regionBetween, Icc, mem_setOf_eq, setOf_and]
refine
MeasurableSet.inter ?_
((measurableSet_le (hf.comp measurable_fst) measurable_snd).inter
(measurableSet_le measurable_snd (hg.comp measurable_fst)))
exact measurable_fst hs
#align measurable_set_region_between_cc measurableSet_region_between_cc
| Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean | 506 | 508 | theorem measurableSet_graph (hf : Measurable f) :
MeasurableSet { p : Ξ± Γ β | p.snd = f p.fst } := by |
simpa using measurableSet_region_between_cc hf hf MeasurableSet.univ
| [
" regionBetween f g s β s ΓΛ’ univ",
" MeasurableSet (regionBetween f g s)",
" MeasurableSet ({a | a.1 β s} β© {a | a.2 β {a_1 | f a.1 < a_1} β© {a_1 | a_1 < g a.1}})",
" MeasurableSet {a | a.1 β s}",
" MeasurableSet {p | p.1 β s β§ p.2 β Ioc (f p.1) (g p.1)}",
" MeasurableSet ({a | a.1 β s} β© {a | a.2 β {a_1... | [
" regionBetween f g s β s ΓΛ’ univ",
" MeasurableSet (regionBetween f g s)",
" MeasurableSet ({a | a.1 β s} β© {a | a.2 β {a_1 | f a.1 < a_1} β© {a_1 | a_1 < g a.1}})",
" MeasurableSet {a | a.1 β s}",
" MeasurableSet {p | p.1 β s β§ p.2 β Ioc (f p.1) (g p.1)}",
" MeasurableSet ({a | a.1 β s} β© {a | a.2 β {a_1... |
import Mathlib.Logic.Function.Iterate
import Mathlib.Init.Data.Int.Order
import Mathlib.Order.Compare
import Mathlib.Order.Max
import Mathlib.Order.RelClasses
import Mathlib.Tactic.Choose
#align_import order.monotone.basic from "leanprover-community/mathlib"@"554bb38de8ded0dafe93b7f18f0bfee6ef77dc5d"
open Function OrderDual
universe u v w
variable {ΞΉ : Type*} {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} {Ξ΄ : Type*} {Ο : ΞΉ β Type*}
{r : Ξ± β Ξ± β Prop}
namespace List
section Preorder
variable [Preorder Ξ±]
| Mathlib/Order/Monotone/Basic.lean | 1,014 | 1,018 | theorem Nat.rel_of_forall_rel_succ_of_le_of_lt (r : Ξ² β Ξ² β Prop) [IsTrans Ξ² r] {f : β β Ξ²} {a : β}
(h : β n, a β€ n β r (f n) (f (n + 1))) β¦b c : ββ¦ (hab : a β€ b) (hbc : b < c) :
r (f b) (f c) := by |
induction' hbc with k b_lt_k r_b_k
exacts [h _ hab, _root_.trans r_b_k (h _ (hab.trans_lt b_lt_k).le)]
| [
" r (f b) (f c)",
" r (f b) (f k.succ)"
] | [
" r (f b) (f c)"
] |
import Mathlib.LinearAlgebra.Dimension.Finite
import Mathlib.LinearAlgebra.Dimension.Constructions
open Cardinal Submodule Set FiniteDimensional
universe u v
namespace Subalgebra
variable {F E : Type*} [CommRing F] [StrongRankCondition F] [Ring E] [Algebra F E]
{S : Subalgebra F E}
theorem eq_bot_of_rank_le_one (h : Module.rank F S β€ 1) [Module.Free F S] : S = β₯ := by
nontriviality E
obtain β¨ΞΊ, bβ© := Module.Free.exists_basis (R := F) (M := S)
by_cases h1 : Module.rank F S = 1
Β· refine bot_unique fun x hx β¦ Algebra.mem_bot.2 ?_
rw [β b.mk_eq_rank'', eq_one_iff_unique, β unique_iff_subsingleton_and_nonempty] at h1
obtain β¨h1β© := h1
obtain β¨y, hyβ© := (bijective_algebraMap_of_linearEquiv (b.repr βͺβ«β
Finsupp.LinearEquiv.finsuppUnique _ _ _).symm).surjective β¨x, hxβ©
exact β¨y, congr(Subtype.val $(hy))β©
haveI := mk_eq_zero_iff.1 (b.mk_eq_rank''.symm βΈ lt_one_iff_zero.1 (h.lt_of_ne h1))
haveI := b.repr.toEquiv.subsingleton
exact False.elim <| one_ne_zero congr(S.val $(Subsingleton.elim 1 0))
#align subalgebra.eq_bot_of_rank_le_one Subalgebra.eq_bot_of_rank_le_one
| Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean | 277 | 280 | theorem eq_bot_of_finrank_one (h : finrank F S = 1) [Module.Free F S] : S = β₯ := by |
refine Subalgebra.eq_bot_of_rank_le_one ?_
rw [finrank, toNat_eq_one] at h
rw [h]
| [
" S = β₯",
" x β range β(algebraMap F E)",
" Module.rank F β₯S β€ 1"
] | [
" S = β₯",
" x β range β(algebraMap F E)"
] |
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks
import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks
#align_import category_theory.limits.constructions.epi_mono from "leanprover-community/mathlib"@"f7baecbb54bd0f24f228576f97b1752fc3c9b318"
universe vβ vβ uβ uβ
namespace CategoryTheory
open Category Limits
variable {C : Type uβ} {D : Type uβ} [Category.{vβ} C] [Category.{vβ} D]
variable (F : C β₯€ D)
theorem preserves_mono_of_preservesLimit {X Y : C} (f : X βΆ Y) [PreservesLimit (cospan f f) F]
[Mono f] : Mono (F.map f) := by
have := isLimitPullbackConeMapOfIsLimit F _ (PullbackCone.isLimitMkIdId f)
simp_rw [F.map_id] at this
apply PullbackCone.mono_of_isLimitMkIdId _ this
#align category_theory.preserves_mono_of_preserves_limit CategoryTheory.preserves_mono_of_preservesLimit
instance (priority := 100) preservesMonomorphisms_of_preservesLimitsOfShape
[PreservesLimitsOfShape WalkingCospan F] : F.PreservesMonomorphisms where
preserves f _ := preserves_mono_of_preservesLimit F f
#align category_theory.preserves_monomorphisms_of_preserves_limits_of_shape CategoryTheory.preservesMonomorphisms_of_preservesLimitsOfShape
theorem reflects_mono_of_reflectsLimit {X Y : C} (f : X βΆ Y) [ReflectsLimit (cospan f f) F]
[Mono (F.map f)] : Mono f := by
have := PullbackCone.isLimitMkIdId (F.map f)
simp_rw [β F.map_id] at this
apply PullbackCone.mono_of_isLimitMkIdId _ (isLimitOfIsLimitPullbackConeMap F _ this)
#align category_theory.reflects_mono_of_reflects_limit CategoryTheory.reflects_mono_of_reflectsLimit
instance (priority := 100) reflectsMonomorphisms_of_reflectsLimitsOfShape
[ReflectsLimitsOfShape WalkingCospan F] : F.ReflectsMonomorphisms where
reflects f _ := reflects_mono_of_reflectsLimit F f
#align category_theory.reflects_monomorphisms_of_reflects_limits_of_shape CategoryTheory.reflectsMonomorphisms_of_reflectsLimitsOfShape
| Mathlib/CategoryTheory/Limits/Constructions/EpiMono.lean | 58 | 62 | theorem preserves_epi_of_preservesColimit {X Y : C} (f : X βΆ Y) [PreservesColimit (span f f) F]
[Epi f] : Epi (F.map f) := by |
have := isColimitPushoutCoconeMapOfIsColimit F _ (PushoutCocone.isColimitMkIdId f)
simp_rw [F.map_id] at this
apply PushoutCocone.epi_of_isColimitMkIdId _ this
| [
" Mono (F.map f)",
" Mono f",
" Epi (F.map f)"
] | [
" Mono (F.map f)",
" Mono f",
" Epi (F.map f)"
] |
import Mathlib.Data.Int.Interval
import Mathlib.Data.Int.SuccPred
import Mathlib.Data.Int.ConditionallyCompleteOrder
import Mathlib.Topology.Instances.Discrete
import Mathlib.Topology.MetricSpace.Bounded
import Mathlib.Order.Filter.Archimedean
#align_import topology.instances.int from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
open Metric Set Filter
namespace Int
instance : Dist β€ :=
β¨fun x y => dist (x : β) yβ©
theorem dist_eq (x y : β€) : dist x y = |(x : β) - y| := rfl
#align int.dist_eq Int.dist_eq
theorem dist_eq' (m n : β€) : dist m n = |m - n| := by rw [dist_eq]; norm_cast
@[norm_cast, simp]
theorem dist_cast_real (x y : β€) : dist (x : β) y = dist x y :=
rfl
#align int.dist_cast_real Int.dist_cast_real
theorem pairwise_one_le_dist : Pairwise fun m n : β€ => 1 β€ dist m n := by
intro m n hne
rw [dist_eq]; norm_cast; rwa [β zero_add (1 : β€), Int.add_one_le_iff, abs_pos, sub_ne_zero]
#align int.pairwise_one_le_dist Int.pairwise_one_le_dist
theorem uniformEmbedding_coe_real : UniformEmbedding ((β) : β€ β β) :=
uniformEmbedding_bot_of_pairwise_le_dist zero_lt_one pairwise_one_le_dist
#align int.uniform_embedding_coe_real Int.uniformEmbedding_coe_real
theorem closedEmbedding_coe_real : ClosedEmbedding ((β) : β€ β β) :=
closedEmbedding_of_pairwise_le_dist zero_lt_one pairwise_one_le_dist
#align int.closed_embedding_coe_real Int.closedEmbedding_coe_real
instance : MetricSpace β€ := Int.uniformEmbedding_coe_real.comapMetricSpace _
theorem preimage_ball (x : β€) (r : β) : (β) β»ΒΉ' ball (x : β) r = ball x r := rfl
#align int.preimage_ball Int.preimage_ball
theorem preimage_closedBall (x : β€) (r : β) : (β) β»ΒΉ' closedBall (x : β) r = closedBall x r := rfl
#align int.preimage_closed_ball Int.preimage_closedBall
theorem ball_eq_Ioo (x : β€) (r : β) : ball x r = Ioo ββx - rβ ββx + rβ := by
rw [β preimage_ball, Real.ball_eq_Ioo, preimage_Ioo]
#align int.ball_eq_Ioo Int.ball_eq_Ioo
theorem closedBall_eq_Icc (x : β€) (r : β) : closedBall x r = Icc ββx - rβ ββx + rβ := by
rw [β preimage_closedBall, Real.closedBall_eq_Icc, preimage_Icc]
#align int.closed_ball_eq_Icc Int.closedBall_eq_Icc
instance : ProperSpace β€ :=
β¨fun x r => by
rw [closedBall_eq_Icc]
exact (Set.finite_Icc _ _).isCompactβ©
@[simp]
theorem cobounded_eq : Bornology.cobounded β€ = atBot β atTop := by
simp_rw [β comap_dist_right_atTop (0 : β€), dist_eq', sub_zero,
β comap_abs_atTop, β @Int.comap_cast_atTop β, comap_comap]; rfl
@[deprecated (since := "2024-02-07")] alias cocompact_eq := cocompact_eq_atBot_atTop
#align int.cocompact_eq Int.cocompact_eq
@[simp]
| Mathlib/Topology/Instances/Int.lean | 84 | 85 | theorem cofinite_eq : (cofinite : Filter β€) = atBot β atTop := by |
rw [β cocompact_eq_cofinite, cocompact_eq_atBot_atTop]
| [
" dist m n = β|m - n|",
" |βm - βn| = β|m - n|",
" Pairwise fun m n => 1 β€ dist m n",
" 1 β€ dist m n",
" 1 β€ |βm - βn|",
" 1 β€ |m - n|",
" ball x r = Ioo ββx - rβ ββx + rβ",
" closedBall x r = Icc ββx - rβ ββx + rβ",
" IsCompact (closedBall x r)",
" IsCompact (Icc ββx - rβ ββx + rβ)",
" Bornolog... | [
" dist m n = β|m - n|",
" |βm - βn| = β|m - n|",
" Pairwise fun m n => 1 β€ dist m n",
" 1 β€ dist m n",
" 1 β€ |βm - βn|",
" 1 β€ |m - n|",
" ball x r = Ioo ββx - rβ ββx + rβ",
" closedBall x r = Icc ββx - rβ ββx + rβ",
" IsCompact (closedBall x r)",
" IsCompact (Icc ββx - rβ ββx + rβ)",
" Bornolog... |
import Mathlib.AlgebraicTopology.DoldKan.PInfty
#align_import algebraic_topology.dold_kan.decomposition from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504"
open CategoryTheory CategoryTheory.Category CategoryTheory.Preadditive
Opposite Simplicial
noncomputable section
namespace AlgebraicTopology
namespace DoldKan
variable {C : Type*} [Category C] [Preadditive C] {X X' : SimplicialObject C}
theorem decomposition_Q (n q : β) :
((Q q).f (n + 1) : X _[n + 1] βΆ X _[n + 1]) =
β i β Finset.filter (fun i : Fin (n + 1) => (i : β) < q) Finset.univ,
(P i).f (n + 1) β« X.Ξ΄ i.rev.succ β« X.Ο (Fin.rev i) := by
induction' q with q hq
Β· simp only [Nat.zero_eq, Q_zero, HomologicalComplex.zero_f_apply, Nat.not_lt_zero,
Finset.filter_False, Finset.sum_empty]
Β· by_cases hqn : q + 1 β€ n + 1
swap
Β· rw [Q_is_eventually_constant (show n + 1 β€ q by omega), hq]
congr 1
ext β¨x, hxβ©
simp only [Nat.succ_eq_add_one, Finset.mem_filter, Finset.mem_univ, true_and]
omega
Β· cases' Nat.le.dest (Nat.succ_le_succ_iff.mp hqn) with a ha
rw [Q_succ, HomologicalComplex.sub_f_apply, HomologicalComplex.comp_f, hq]
symm
conv_rhs => rw [sub_eq_add_neg, add_comm]
let q' : Fin (n + 1) := β¨q, Nat.succ_le_iff.mp hqnβ©
rw [β @Finset.add_sum_erase _ _ _ _ _ _ q' (by simp)]
congr
Β· have hnaq' : n = a + q := by omega
simp only [Fin.val_mk, (HigherFacesVanish.of_P q n).comp_HΟ_eq hnaq',
q'.rev_eq hnaq', neg_neg]
rfl
Β· ext β¨i, hiβ©
simp only [q', Nat.succ_eq_add_one, Nat.lt_succ_iff_lt_or_eq, Finset.mem_univ,
forall_true_left, Finset.mem_filter, lt_self_iff_false, or_true, and_self, not_true,
Finset.mem_erase, ne_eq, Fin.mk.injEq, true_and]
aesop
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.decomposition_Q AlgebraicTopology.DoldKan.decomposition_Q
variable (X)
-- porting note (#5171): removed @[nolint has_nonempty_instance]
@[ext]
structure MorphComponents (n : β) (Z : C) where
a : X _[n + 1] βΆ Z
b : Fin (n + 1) β (X _[n] βΆ Z)
#align algebraic_topology.dold_kan.morph_components AlgebraicTopology.DoldKan.MorphComponents
namespace MorphComponents
variable {X} {n : β} {Z Z' : C} (f : MorphComponents X n Z) (g : X' βΆ X) (h : Z βΆ Z')
def Ο {Z : C} (f : MorphComponents X n Z) : X _[n + 1] βΆ Z :=
PInfty.f (n + 1) β« f.a + β i : Fin (n + 1), (P i).f (n + 1) β« X.Ξ΄ i.rev.succ β«
f.b (Fin.rev i)
#align algebraic_topology.dold_kan.morph_components.Ο AlgebraicTopology.DoldKan.MorphComponents.Ο
variable (X n)
@[simps]
def id : MorphComponents X n (X _[n + 1]) where
a := PInfty.f (n + 1)
b i := X.Ο i
#align algebraic_topology.dold_kan.morph_components.id AlgebraicTopology.DoldKan.MorphComponents.id
@[simp]
| Mathlib/AlgebraicTopology/DoldKan/Decomposition.lean | 120 | 124 | theorem id_Ο : (id X n).Ο = π _ := by |
simp only [β P_add_Q_f (n + 1) (n + 1), Ο]
congr 1
Β· simp only [id, PInfty_f, P_f_idem]
Β· exact Eq.trans (by congr; simp) (decomposition_Q n (n + 1)).symm
| [
" (Q q).f (n + 1) = β i β Finset.filter (fun i => βi < q) Finset.univ, (P βi).f (n + 1) β« X.Ξ΄ i.rev.succ β« X.Ο i.rev",
" (Q 0).f (n + 1) = β i β Finset.filter (fun i => βi < 0) Finset.univ, (P βi).f (n + 1) β« X.Ξ΄ i.rev.succ β« X.Ο i.rev",
" (Q (q + 1)).f (n + 1) =\n β i β Finset.filter (fun i => βi < q + 1) F... | [
" (Q q).f (n + 1) = β i β Finset.filter (fun i => βi < q) Finset.univ, (P βi).f (n + 1) β« X.Ξ΄ i.rev.succ β« X.Ο i.rev",
" (Q 0).f (n + 1) = β i β Finset.filter (fun i => βi < 0) Finset.univ, (P βi).f (n + 1) β« X.Ξ΄ i.rev.succ β« X.Ο i.rev",
" (Q (q + 1)).f (n + 1) =\n β i β Finset.filter (fun i => βi < q + 1) F... |
import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPreregular
import Mathlib.Topology.Category.CompHaus.EffectiveEpi
import Mathlib.Topology.Category.Stonean.Limits
import Mathlib.Topology.Category.CompHaus.EffectiveEpi
universe u
open CategoryTheory Limits
namespace Stonean
noncomputable
def struct {B X : Stonean.{u}} (Ο : X βΆ B) (hΟ : Function.Surjective Ο) : EffectiveEpiStruct Ο where
desc e h := (QuotientMap.of_surjective_continuous hΟ Ο.continuous).lift e fun a b hab β¦
DFunLike.congr_fun (h β¨fun _ β¦ a, continuous_constβ© β¨fun _ β¦ b, continuous_constβ©
(by ext; exact hab)) a
fac e h := ((QuotientMap.of_surjective_continuous hΟ Ο.continuous).lift_comp e
fun a b hab β¦ DFunLike.congr_fun (h β¨fun _ β¦ a, continuous_constβ© β¨fun _ β¦ b, continuous_constβ©
(by ext; exact hab)) a)
uniq e h g hm := by
suffices g = (QuotientMap.of_surjective_continuous hΟ Ο.continuous).liftEquiv β¨e,
fun a b hab β¦ DFunLike.congr_fun
(h β¨fun _ β¦ a, continuous_constβ© β¨fun _ β¦ b, continuous_constβ© (by ext; exact hab))
aβ© by assumption
rw [β Equiv.symm_apply_eq (QuotientMap.of_surjective_continuous hΟ Ο.continuous).liftEquiv]
ext
simp only [QuotientMap.liftEquiv_symm_apply_coe, ContinuousMap.comp_apply, β hm]
rfl
open List in
theorem effectiveEpi_tfae
{B X : Stonean.{u}} (Ο : X βΆ B) :
TFAE
[ EffectiveEpi Ο
, Epi Ο
, Function.Surjective Ο
] := by
tfae_have 1 β 2
Β· intro; infer_instance
tfae_have 2 β 3
Β· exact epi_iff_surjective Ο
tfae_have 3 β 1
Β· exact fun hΟ β¦ β¨β¨struct Ο hΟβ©β©
tfae_finish
instance : Stonean.toCompHaus.PreservesEffectiveEpis where
preserves f h :=
((CompHaus.effectiveEpi_tfae f).out 0 2).mpr (((Stonean.effectiveEpi_tfae f).out 0 2).mp h)
instance : Stonean.toCompHaus.ReflectsEffectiveEpis where
reflects f h :=
((Stonean.effectiveEpi_tfae f).out 0 2).mpr (((CompHaus.effectiveEpi_tfae f).out 0 2).mp h)
noncomputable def stoneanToCompHausEffectivePresentation (X : CompHaus) :
Stonean.toCompHaus.EffectivePresentation X where
p := X.presentation
f := CompHaus.presentation.Ο X
effectiveEpi := ((CompHaus.effectiveEpi_tfae _).out 0 1).mpr (inferInstance : Epi _)
instance : Stonean.toCompHaus.EffectivelyEnough where
presentation X := β¨stoneanToCompHausEffectivePresentation Xβ©
instance : Preregular Stonean := Stonean.toCompHaus.reflects_preregular
example : Precoherent Stonean.{u} := inferInstance
-- TODO: prove this for `Type*`
open List in
| Mathlib/Topology/Category/Stonean/EffectiveEpi.lean | 103 | 121 | theorem effectiveEpiFamily_tfae
{Ξ± : Type} [Finite Ξ±] {B : Stonean.{u}}
(X : Ξ± β Stonean.{u}) (Ο : (a : Ξ±) β (X a βΆ B)) :
TFAE
[ EffectiveEpiFamily X Ο
, Epi (Sigma.desc Ο)
, β b : B, β (a : Ξ±) (x : X a), Ο a x = b
] := by |
tfae_have 2 β 1
Β· intro
simpa [β effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc Ο)).out 0 1]
tfae_have 1 β 2
Β· intro; infer_instance
tfae_have 3 β 1
Β· erw [((CompHaus.effectiveEpiFamily_tfae
(fun a β¦ Stonean.toCompHaus.obj (X a)) (fun a β¦ Stonean.toCompHaus.map (Ο a))).out 2 0 : )]
exact β¨fun h β¦ Stonean.toCompHaus.finite_effectiveEpiFamily_of_map _ _ h,
fun _ β¦ inferInstanceβ©
tfae_finish
| [
" { toFun := fun x => a, continuous_toFun := β― } β« Ο = { toFun := fun x => b, continuous_toFun := β― } β« Ο",
" ({ toFun := fun x => a, continuous_toFun := β― } β« Ο) xβ = ({ toFun := fun x => b, continuous_toFun := β― } β« Ο) xβ",
" g = (fun {W} e h => β―.lift e β―) e β―",
" g = β―.liftEquiv β¨e, β―β©",
" β―.liftEquiv.s... | [
" { toFun := fun x => a, continuous_toFun := β― } β« Ο = { toFun := fun x => b, continuous_toFun := β― } β« Ο",
" ({ toFun := fun x => a, continuous_toFun := β― } β« Ο) xβ = ({ toFun := fun x => b, continuous_toFun := β― } β« Ο) xβ",
" g = (fun {W} e h => β―.lift e β―) e β―",
" g = β―.liftEquiv β¨e, β―β©",
" β―.liftEquiv.s... |
import Mathlib.Algebra.BigOperators.Intervals
import Mathlib.Algebra.BigOperators.Ring.List
import Mathlib.Data.Int.ModEq
import Mathlib.Data.Nat.Bits
import Mathlib.Data.Nat.Log
import Mathlib.Data.List.Indexes
import Mathlib.Data.List.Palindrome
import Mathlib.Tactic.IntervalCases
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Ring
#align_import data.nat.digits from "leanprover-community/mathlib"@"369525b73f229ccd76a6ec0e0e0bf2be57599768"
namespace Nat
variable {n : β}
def digitsAux0 : β β List β
| 0 => []
| n + 1 => [n + 1]
#align nat.digits_aux_0 Nat.digitsAux0
def digitsAux1 (n : β) : List β :=
List.replicate n 1
#align nat.digits_aux_1 Nat.digitsAux1
def digitsAux (b : β) (h : 2 β€ b) : β β List β
| 0 => []
| n + 1 =>
((n + 1) % b) :: digitsAux b h ((n + 1) / b)
decreasing_by exact Nat.div_lt_self (Nat.succ_pos _) h
#align nat.digits_aux Nat.digitsAux
@[simp]
theorem digitsAux_zero (b : β) (h : 2 β€ b) : digitsAux b h 0 = [] := by rw [digitsAux]
#align nat.digits_aux_zero Nat.digitsAux_zero
| Mathlib/Data/Nat/Digits.lean | 63 | 67 | theorem digitsAux_def (b : β) (h : 2 β€ b) (n : β) (w : 0 < n) :
digitsAux b h n = (n % b) :: digitsAux b h (n / b) := by |
cases n
Β· cases w
Β· rw [digitsAux]
| [
" (invImage (fun x => x) instWellFoundedRelationOfSizeOf).1 ((n + 1) / b) n.succ",
" b.digitsAux h 0 = []",
" b.digitsAux h n = n % b :: b.digitsAux h (n / b)",
" b.digitsAux h 0 = 0 % b :: b.digitsAux h (0 / b)",
" b.digitsAux h (nβ + 1) = (nβ + 1) % b :: b.digitsAux h ((nβ + 1) / b)"
] | [
" (invImage (fun x => x) instWellFoundedRelationOfSizeOf).1 ((n + 1) / b) n.succ",
" b.digitsAux h 0 = []",
" b.digitsAux h n = n % b :: b.digitsAux h (n / b)"
] |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section lcm
def lcm (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.lcm 1 f
#align finset.lcm Finset.lcm
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem lcm_def : s.lcm f = (s.1.map f).lcm :=
rfl
#align finset.lcm_def Finset.lcm_def
@[simp]
theorem lcm_empty : (β
: Finset Ξ²).lcm f = 1 :=
fold_empty
#align finset.lcm_empty Finset.lcm_empty
@[simp]
theorem lcm_dvd_iff {a : Ξ±} : s.lcm f β£ a β β b β s, f b β£ a := by
apply Iff.trans Multiset.lcm_dvd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.lcm_dvd_iff Finset.lcm_dvd_iff
theorem lcm_dvd {a : Ξ±} : (β b β s, f b β£ a) β s.lcm f β£ a :=
lcm_dvd_iff.2
#align finset.lcm_dvd Finset.lcm_dvd
theorem dvd_lcm {b : Ξ²} (hb : b β s) : f b β£ s.lcm f :=
lcm_dvd_iff.1 dvd_rfl _ hb
#align finset.dvd_lcm Finset.dvd_lcm
@[simp]
theorem lcm_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).lcm f = GCDMonoid.lcm (f b) (s.lcm f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(lcm_eq_right_iff (f b) (s.lcm f) (Multiset.normalize_lcm (s.1.map f))).2 (dvd_lcm h)]
apply fold_insert h
#align finset.lcm_insert Finset.lcm_insert
@[simp]
theorem lcm_singleton {b : Ξ²} : ({b} : Finset Ξ²).lcm f = normalize (f b) :=
Multiset.lcm_singleton
#align finset.lcm_singleton Finset.lcm_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
theorem normalize_lcm : normalize (s.lcm f) = s.lcm f := by simp [lcm_def]
#align finset.normalize_lcm Finset.normalize_lcm
theorem lcm_union [DecidableEq Ξ²] : (sβ βͺ sβ).lcm f = GCDMonoid.lcm (sβ.lcm f) (sβ.lcm f) :=
Finset.induction_on sβ (by rw [empty_union, lcm_empty, lcm_one_left, normalize_lcm])
fun a s _ ih β¦ by rw [insert_union, lcm_insert, lcm_insert, ih, lcm_assoc]
#align finset.lcm_union Finset.lcm_union
| Mathlib/Algebra/GCDMonoid/Finset.lean | 100 | 103 | theorem lcm_congr {f g : Ξ² β Ξ±} (hs : sβ = sβ) (hfg : β a β sβ, f a = g a) :
sβ.lcm f = sβ.lcm g := by |
subst hs
exact Finset.fold_congr hfg
| [
" s.lcm f β£ a β β b β s, f b β£ a",
" (β b β Multiset.map f s.val, b β£ a) β β b β s, f b β£ a",
" (β (b : Ξ±), β x β s.val, f x = b β b β£ a) β β b β s, f b β£ a",
" (insert b s).lcm f = GCDMonoid.lcm (f b) (s.lcm f)",
" normalize (s.lcm f) = s.lcm f",
" (β
βͺ sβ).lcm f = GCDMonoid.lcm (β
.lcm f) (sβ.lcm f)",
... | [
" s.lcm f β£ a β β b β s, f b β£ a",
" (β b β Multiset.map f s.val, b β£ a) β β b β s, f b β£ a",
" (β (b : Ξ±), β x β s.val, f x = b β b β£ a) β β b β s, f b β£ a",
" (insert b s).lcm f = GCDMonoid.lcm (f b) (s.lcm f)",
" normalize (s.lcm f) = s.lcm f",
" (β
βͺ sβ).lcm f = GCDMonoid.lcm (β
.lcm f) (sβ.lcm f)",
... |
import Mathlib.Order.MinMax
import Mathlib.Data.Set.Subsingleton
import Mathlib.Tactic.Says
#align_import data.set.intervals.basic from "leanprover-community/mathlib"@"3ba15165bd6927679be7c22d6091a87337e3cd0c"
open Function
open OrderDual (toDual ofDual)
variable {Ξ± Ξ² : Type*}
namespace Set
section Preorder
variable [Preorder Ξ±] {a aβ aβ b bβ bβ c x : Ξ±}
def Ioo (a b : Ξ±) :=
{ x | a < x β§ x < b }
#align set.Ioo Set.Ioo
def Ico (a b : Ξ±) :=
{ x | a β€ x β§ x < b }
#align set.Ico Set.Ico
def Iio (a : Ξ±) :=
{ x | x < a }
#align set.Iio Set.Iio
def Icc (a b : Ξ±) :=
{ x | a β€ x β§ x β€ b }
#align set.Icc Set.Icc
def Iic (b : Ξ±) :=
{ x | x β€ b }
#align set.Iic Set.Iic
def Ioc (a b : Ξ±) :=
{ x | a < x β§ x β€ b }
#align set.Ioc Set.Ioc
def Ici (a : Ξ±) :=
{ x | a β€ x }
#align set.Ici Set.Ici
def Ioi (a : Ξ±) :=
{ x | a < x }
#align set.Ioi Set.Ioi
theorem Ioo_def (a b : Ξ±) : { x | a < x β§ x < b } = Ioo a b :=
rfl
#align set.Ioo_def Set.Ioo_def
theorem Ico_def (a b : Ξ±) : { x | a β€ x β§ x < b } = Ico a b :=
rfl
#align set.Ico_def Set.Ico_def
theorem Iio_def (a : Ξ±) : { x | x < a } = Iio a :=
rfl
#align set.Iio_def Set.Iio_def
theorem Icc_def (a b : Ξ±) : { x | a β€ x β§ x β€ b } = Icc a b :=
rfl
#align set.Icc_def Set.Icc_def
theorem Iic_def (b : Ξ±) : { x | x β€ b } = Iic b :=
rfl
#align set.Iic_def Set.Iic_def
theorem Ioc_def (a b : Ξ±) : { x | a < x β§ x β€ b } = Ioc a b :=
rfl
#align set.Ioc_def Set.Ioc_def
theorem Ici_def (a : Ξ±) : { x | a β€ x } = Ici a :=
rfl
#align set.Ici_def Set.Ici_def
theorem Ioi_def (a : Ξ±) : { x | a < x } = Ioi a :=
rfl
#align set.Ioi_def Set.Ioi_def
@[simp]
theorem mem_Ioo : x β Ioo a b β a < x β§ x < b :=
Iff.rfl
#align set.mem_Ioo Set.mem_Ioo
@[simp]
theorem mem_Ico : x β Ico a b β a β€ x β§ x < b :=
Iff.rfl
#align set.mem_Ico Set.mem_Ico
@[simp]
theorem mem_Iio : x β Iio b β x < b :=
Iff.rfl
#align set.mem_Iio Set.mem_Iio
@[simp]
theorem mem_Icc : x β Icc a b β a β€ x β§ x β€ b :=
Iff.rfl
#align set.mem_Icc Set.mem_Icc
@[simp]
theorem mem_Iic : x β Iic b β x β€ b :=
Iff.rfl
#align set.mem_Iic Set.mem_Iic
@[simp]
theorem mem_Ioc : x β Ioc a b β a < x β§ x β€ b :=
Iff.rfl
#align set.mem_Ioc Set.mem_Ioc
@[simp]
theorem mem_Ici : x β Ici a β a β€ x :=
Iff.rfl
#align set.mem_Ici Set.mem_Ici
@[simp]
theorem mem_Ioi : x β Ioi a β a < x :=
Iff.rfl
#align set.mem_Ioi Set.mem_Ioi
instance decidableMemIoo [Decidable (a < x β§ x < b)] : Decidable (x β Ioo a b) := by assumption
#align set.decidable_mem_Ioo Set.decidableMemIoo
instance decidableMemIco [Decidable (a β€ x β§ x < b)] : Decidable (x β Ico a b) := by assumption
#align set.decidable_mem_Ico Set.decidableMemIco
instance decidableMemIio [Decidable (x < b)] : Decidable (x β Iio b) := by assumption
#align set.decidable_mem_Iio Set.decidableMemIio
instance decidableMemIcc [Decidable (a β€ x β§ x β€ b)] : Decidable (x β Icc a b) := by assumption
#align set.decidable_mem_Icc Set.decidableMemIcc
instance decidableMemIic [Decidable (x β€ b)] : Decidable (x β Iic b) := by assumption
#align set.decidable_mem_Iic Set.decidableMemIic
instance decidableMemIoc [Decidable (a < x β§ x β€ b)] : Decidable (x β Ioc a b) := by assumption
#align set.decidable_mem_Ioc Set.decidableMemIoc
instance decidableMemIci [Decidable (a β€ x)] : Decidable (x β Ici a) := by assumption
#align set.decidable_mem_Ici Set.decidableMemIci
instance decidableMemIoi [Decidable (a < x)] : Decidable (x β Ioi a) := by assumption
#align set.decidable_mem_Ioi Set.decidableMemIoi
-- Porting note (#10618): `simp` can prove this
-- @[simp]
| Mathlib/Order/Interval/Set/Basic.lean | 181 | 181 | theorem left_mem_Ioo : a β Ioo a b β False := by | simp [lt_irrefl]
| [
" Decidable (x β Ioo a b)",
" Decidable (x β Ico a b)",
" Decidable (x β Iio b)",
" Decidable (x β Icc a b)",
" Decidable (x β Iic b)",
" Decidable (x β Ioc a b)",
" Decidable (x β Ici a)",
" Decidable (x β Ioi a)",
" a β Ioo a b β False"
] | [
" Decidable (x β Ioo a b)",
" Decidable (x β Ico a b)",
" Decidable (x β Iio b)",
" Decidable (x β Icc a b)",
" Decidable (x β Iic b)",
" Decidable (x β Ioc a b)",
" Decidable (x β Ici a)",
" Decidable (x β Ioi a)",
" a β Ioo a b β False"
] |
import Mathlib.NumberTheory.ZetaValues
import Mathlib.NumberTheory.LSeries.RiemannZeta
open Complex Real Set
open scoped Nat
open HurwitzZeta
theorem riemannZeta_two_mul_nat {k : β} (hk : k β 0) :
riemannZeta (2 * k) = (-1) ^ (k + 1) * (2 : β) ^ (2 * k - 1)
* (Ο : β) ^ (2 * k) * bernoulli (2 * k) / (2 * k)! := by
convert congr_arg ((β) : β β β) (hasSum_zeta_nat hk).tsum_eq
Β· rw [β Nat.cast_two, β Nat.cast_mul, zeta_nat_eq_tsum_of_gt_one (by omega)]
simp only [push_cast]
Β· norm_cast
#align riemann_zeta_two_mul_nat riemannZeta_two_mul_nat
| Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean | 220 | 224 | theorem riemannZeta_two : riemannZeta 2 = (Ο : β) ^ 2 / 6 := by |
convert congr_arg ((β) : β β β) hasSum_zeta_two.tsum_eq
Β· rw [β Nat.cast_two, zeta_nat_eq_tsum_of_gt_one one_lt_two]
simp only [push_cast]
Β· norm_cast
| [
" riemannZeta (2 * βk) = (-1) ^ (k + 1) * 2 ^ (2 * k - 1) * βΟ ^ (2 * k) * β(bernoulli (2 * k)) / β(2 * k)!",
" riemannZeta (2 * βk) = β(β' (b : β), 1 / βb ^ (2 * k))",
" 1 < 2 * k",
" β' (n : β), 1 / βn ^ (2 * k) = β(β' (b : β), 1 / βb ^ (2 * k))",
" (-1) ^ (k + 1) * 2 ^ (2 * k - 1) * βΟ ^ (2 * k) * β(bern... | [
" riemannZeta (2 * βk) = (-1) ^ (k + 1) * 2 ^ (2 * k - 1) * βΟ ^ (2 * k) * β(bernoulli (2 * k)) / β(2 * k)!",
" riemannZeta (2 * βk) = β(β' (b : β), 1 / βb ^ (2 * k))",
" 1 < 2 * k",
" β' (n : β), 1 / βn ^ (2 * k) = β(β' (b : β), 1 / βb ^ (2 * k))",
" (-1) ^ (k + 1) * 2 ^ (2 * k - 1) * βΟ ^ (2 * k) * β(bern... |
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Ideal.Over
import Mathlib.RingTheory.JacobsonIdeal
#align_import ring_theory.jacobson from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
set_option autoImplicit true
universe u
namespace Ideal
open Polynomial
open Polynomial
section IsJacobson
variable {R S : Type*} [CommRing R] [CommRing S] {I : Ideal R}
class IsJacobson (R : Type*) [CommRing R] : Prop where
out' : β I : Ideal R, I.IsRadical β I.jacobson = I
#align ideal.is_jacobson Ideal.IsJacobson
theorem isJacobson_iff {R} [CommRing R] :
IsJacobson R β β I : Ideal R, I.IsRadical β I.jacobson = I :=
β¨fun h => h.1, fun h => β¨hβ©β©
#align ideal.is_jacobson_iff Ideal.isJacobson_iff
theorem IsJacobson.out {R} [CommRing R] :
IsJacobson R β β {I : Ideal R}, I.IsRadical β I.jacobson = I :=
isJacobson_iff.1
#align ideal.is_jacobson.out Ideal.IsJacobson.out
theorem isJacobson_iff_prime_eq : IsJacobson R β β P : Ideal R, IsPrime P β P.jacobson = P := by
refine isJacobson_iff.trans β¨fun h I hI => h I hI.isRadical, ?_β©
refine fun h I hI β¦ le_antisymm (fun x hx β¦ ?_) (fun x hx β¦ mem_sInf.mpr fun _ hJ β¦ hJ.left hx)
rw [β hI.radical, radical_eq_sInf I, mem_sInf]
intro P hP
rw [Set.mem_setOf_eq] at hP
erw [mem_sInf] at hx
erw [β h P hP.right, mem_sInf]
exact fun J hJ => hx β¨le_trans hP.left hJ.left, hJ.rightβ©
#align ideal.is_jacobson_iff_prime_eq Ideal.isJacobson_iff_prime_eq
theorem isJacobson_iff_sInf_maximal : IsJacobson R β β {I : Ideal R}, I.IsPrime β
β M : Set (Ideal R), (β J β M, IsMaximal J β¨ J = β€) β§ I = sInf M :=
β¨fun H _I h => eq_jacobson_iff_sInf_maximal.1 (H.out h.isRadical), fun H =>
isJacobson_iff_prime_eq.2 fun _P hP => eq_jacobson_iff_sInf_maximal.2 (H hP)β©
#align ideal.is_jacobson_iff_Inf_maximal Ideal.isJacobson_iff_sInf_maximal
theorem isJacobson_iff_sInf_maximal' : IsJacobson R β β {I : Ideal R}, I.IsPrime β
β M : Set (Ideal R), (β J β M, β (K : Ideal R), J < K β K = β€) β§ I = sInf M :=
β¨fun H _I h => eq_jacobson_iff_sInf_maximal'.1 (H.out h.isRadical), fun H =>
isJacobson_iff_prime_eq.2 fun _P hP => eq_jacobson_iff_sInf_maximal'.2 (H hP)β©
#align ideal.is_jacobson_iff_Inf_maximal' Ideal.isJacobson_iff_sInf_maximal'
theorem radical_eq_jacobson [H : IsJacobson R] (I : Ideal R) : I.radical = I.jacobson :=
le_antisymm (le_sInf fun _J β¨hJ, hJ_maxβ© => (IsPrime.radical_le_iff hJ_max.isPrime).mpr hJ)
(H.out (radical_isRadical I) βΈ jacobson_mono le_radical)
#align ideal.radical_eq_jacobson Ideal.radical_eq_jacobson
instance (priority := 100) isJacobson_field {K : Type*} [Field K] : IsJacobson K :=
β¨fun I _ => Or.recOn (eq_bot_or_top I)
(fun h => le_antisymm (sInf_le β¨le_rfl, h.symm βΈ bot_isMaximalβ©) (h.symm βΈ bot_le)) fun h =>
by rw [h, jacobson_eq_top_iff]β©
#align ideal.is_jacobson_field Ideal.isJacobson_field
| Mathlib/RingTheory/Jacobson.lean | 108 | 117 | theorem isJacobson_of_surjective [H : IsJacobson R] :
(β f : R β+* S, Function.Surjective βf) β IsJacobson S := by |
rintro β¨f, hfβ©
rw [isJacobson_iff_sInf_maximal]
intro p hp
use map f '' { J : Ideal R | comap f p β€ J β§ J.IsMaximal }
use fun j β¨J, hJ, hmapβ© => hmap βΈ (map_eq_top_or_isMaximal_of_surjective f hf hJ.right).symm
have : p = map f (comap f p).jacobson :=
(IsJacobson.out' _ <| hp.isRadical.comap f).symm βΈ (map_comap_of_surjective f hf p).symm
exact this.trans (map_sInf hf fun J β¨hJ, _β© => le_trans (Ideal.ker_le_comap f) hJ)
| [
" IsJacobson R β β (P : Ideal R), P.IsPrime β P.jacobson = P",
" (β (P : Ideal R), P.IsPrime β P.jacobson = P) β β (I : Ideal R), I.IsRadical β I.jacobson = I",
" x β I",
" β β¦I_1 : Ideal Rβ¦, I_1 β {J | I β€ J β§ J.IsPrime} β x β I_1",
" x β P",
" β β¦I : Ideal Rβ¦, I β {J | P β€ J β§ J.IsMaximal} β x β I",
"... | [
" IsJacobson R β β (P : Ideal R), P.IsPrime β P.jacobson = P",
" (β (P : Ideal R), P.IsPrime β P.jacobson = P) β β (I : Ideal R), I.IsRadical β I.jacobson = I",
" x β I",
" β β¦I_1 : Ideal Rβ¦, I_1 β {J | I β€ J β§ J.IsPrime} β x β I_1",
" x β P",
" β β¦I : Ideal Rβ¦, I β {J | P β€ J β§ J.IsMaximal} β x β I",
"... |
import Mathlib.GroupTheory.Subgroup.Center
import Mathlib.GroupTheory.Submonoid.Centralizer
#align_import group_theory.subgroup.basic from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef"
open Function
open Int
variable {G : Type*} [Group G]
namespace Subgroup
variable {H K : Subgroup G}
@[to_additive
"The `centralizer` of `H` is the additive subgroup of `g : G` commuting with every `h : H`."]
def centralizer (s : Set G) : Subgroup G :=
{ Submonoid.centralizer s with
carrier := Set.centralizer s
inv_mem' := Set.inv_mem_centralizer }
#align subgroup.centralizer Subgroup.centralizer
#align add_subgroup.centralizer AddSubgroup.centralizer
@[to_additive]
theorem mem_centralizer_iff {g : G} {s : Set G} : g β centralizer s β β h β s, h * g = g * h :=
Iff.rfl
#align subgroup.mem_centralizer_iff Subgroup.mem_centralizer_iff
#align add_subgroup.mem_centralizer_iff AddSubgroup.mem_centralizer_iff
@[to_additive]
| Mathlib/GroupTheory/Subgroup/Centralizer.lean | 42 | 44 | theorem mem_centralizer_iff_commutator_eq_one {g : G} {s : Set G} :
g β centralizer s β β h β s, h * g * hβ»ΒΉ * gβ»ΒΉ = 1 := by |
simp only [mem_centralizer_iff, mul_inv_eq_iff_eq_mul, one_mul]
| [
" g β centralizer s β β h β s, h * g * hβ»ΒΉ * gβ»ΒΉ = 1"
] | [
" g β centralizer s β β h β s, h * g * hβ»ΒΉ * gβ»ΒΉ = 1"
] |
import Mathlib.AlgebraicTopology.DoldKan.FunctorGamma
import Mathlib.AlgebraicTopology.DoldKan.SplitSimplicialObject
import Mathlib.CategoryTheory.Idempotents.HomologicalComplex
#align_import algebraic_topology.dold_kan.gamma_comp_n from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504"
noncomputable section
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits
CategoryTheory.Idempotents Opposite SimplicialObject Simplicial
namespace AlgebraicTopology
namespace DoldKan
variable {C : Type*} [Category C] [Preadditive C] [HasFiniteCoproducts C]
@[simps!]
def ΞβNondegComplexIso (K : ChainComplex C β) : (Ξβ.splitting K).nondegComplex β
K :=
HomologicalComplex.Hom.isoOfComponents (fun n => Iso.refl _)
(by
rintro _ n (rfl : n + 1 = _)
dsimp
simp only [id_comp, comp_id, AlternatingFaceMapComplex.obj_d_eq, Preadditive.sum_comp,
Preadditive.comp_sum]
rw [Fintype.sum_eq_single (0 : Fin (n + 2))]
Β· simp only [Fin.val_zero, pow_zero, one_zsmul]
erw [Ξβ.Obj.mapMono_on_summand_id_assoc, Ξβ.Obj.Termwise.mapMono_Ξ΄β,
Splitting.cofan_inj_ΟSummand_eq_id, comp_id]
Β· intro i hi
dsimp
simp only [Preadditive.zsmul_comp, Preadditive.comp_zsmul, assoc]
erw [Ξβ.Obj.mapMono_on_summand_id_assoc, Ξβ.Obj.Termwise.mapMono_eq_zero, zero_comp,
zsmul_zero]
Β· intro h
replace h := congr_arg SimplexCategory.len h
change n + 1 = n at h
omega
Β· simpa only [IsΞ΄β.iff] using hi)
#align algebraic_topology.dold_kan.Ξβ_nondeg_complex_iso AlgebraicTopology.DoldKan.ΞβNondegComplexIso
def Ξβ'CompNondegComplexFunctor : Ξβ' β Split.nondegComplexFunctor β
π (ChainComplex C β) :=
NatIso.ofComponents ΞβNondegComplexIso
#align algebraic_topology.dold_kan.Ξβ'_comp_nondeg_complex_functor AlgebraicTopology.DoldKan.Ξβ'CompNondegComplexFunctor
def NβΞβ : Ξβ β Nβ β
toKaroubi (ChainComplex C β) :=
calc
Ξβ β Nβ β
Ξβ' β Split.forget C β Nβ := Functor.associator _ _ _
_ β
Ξβ' β Split.nondegComplexFunctor β toKaroubi _ :=
(isoWhiskerLeft Ξβ' Split.toKaroubiNondegComplexFunctorIsoNβ.symm)
_ β
(Ξβ' β Split.nondegComplexFunctor) β toKaroubi _ := (Functor.associator _ _ _).symm
_ β
π _ β toKaroubi (ChainComplex C β) := isoWhiskerRight Ξβ'CompNondegComplexFunctor _
_ β
toKaroubi (ChainComplex C β) := Functor.leftUnitor _
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.NβΞβ AlgebraicTopology.DoldKan.NβΞβ
theorem NβΞβ_app (K : ChainComplex C β) :
NβΞβ.app K = (Ξβ.splitting K).toKaroubiNondegComplexIsoNβ.symm βͺβ«
(toKaroubi _).mapIso (ΞβNondegComplexIso K) := by
ext1
dsimp [NβΞβ]
erw [id_comp, comp_id, comp_id]
rfl
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.NβΞβ_app AlgebraicTopology.DoldKan.NβΞβ_app
theorem NβΞβ_hom_app (K : ChainComplex C β) :
NβΞβ.hom.app K = (Ξβ.splitting K).toKaroubiNondegComplexIsoNβ.inv β«
(toKaroubi _).map (ΞβNondegComplexIso K).hom := by
change (NβΞβ.app K).hom = _
simp only [NβΞβ_app]
rfl
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.NβΞβ_hom_app AlgebraicTopology.DoldKan.NβΞβ_hom_app
theorem NβΞβ_inv_app (K : ChainComplex C β) :
NβΞβ.inv.app K = (toKaroubi _).map (ΞβNondegComplexIso K).inv β«
(Ξβ.splitting K).toKaroubiNondegComplexIsoNβ.hom := by
change (NβΞβ.app K).inv = _
simp only [NβΞβ_app]
rfl
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.NβΞβ_inv_app AlgebraicTopology.DoldKan.NβΞβ_inv_app
@[simp]
| Mathlib/AlgebraicTopology/DoldKan/GammaCompN.lean | 105 | 108 | theorem NβΞβ_hom_app_f_f (K : ChainComplex C β) (n : β) :
(NβΞβ.hom.app K).f.f n = (Ξβ.splitting K).toKaroubiNondegComplexIsoNβ.inv.f.f n := by |
rw [NβΞβ_hom_app]
apply comp_id
| [
" β (i j : β),\n (ComplexShape.down β).Rel i j β\n ((fun n => Iso.refl ((Ξβ.splitting K).nondegComplex.X n)) i).hom β« K.d i j =\n (Ξβ.splitting K).nondegComplex.d i j β« ((fun n => Iso.refl ((Ξβ.splitting K).nondegComplex.X n)) j).hom",
" ((fun n => Iso.refl ((Ξβ.splitting K).nondegComplex.X n)) (n ... | [
" β (i j : β),\n (ComplexShape.down β).Rel i j β\n ((fun n => Iso.refl ((Ξβ.splitting K).nondegComplex.X n)) i).hom β« K.d i j =\n (Ξβ.splitting K).nondegComplex.d i j β« ((fun n => Iso.refl ((Ξβ.splitting K).nondegComplex.X n)) j).hom",
" ((fun n => Iso.refl ((Ξβ.splitting K).nondegComplex.X n)) (n ... |
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks
import Mathlib.CategoryTheory.Limits.Preserves.Basic
#align_import category_theory.limits.preserves.shapes.pullbacks from "leanprover-community/mathlib"@"f11e306adb9f2a393539d2bb4293bf1b42caa7ac"
noncomputable section
universe vβ vβ uβ uβ
-- Porting note: need Functor namespace for mapCone
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Functor
namespace CategoryTheory.Limits
section Pullback
variable {C : Type uβ} [Category.{vβ} C]
variable {D : Type uβ} [Category.{vβ} D]
variable (G : C β₯€ D)
variable {W X Y Z : C} {f : X βΆ Z} {g : Y βΆ Z} {h : W βΆ X} {k : W βΆ Y} (comm : h β« f = k β« g)
def isLimitMapConePullbackConeEquiv :
IsLimit (mapCone G (PullbackCone.mk h k comm)) β
IsLimit
(PullbackCone.mk (G.map h) (G.map k) (by simp only [β G.map_comp, comm]) :
PullbackCone (G.map f) (G.map g)) :=
(IsLimit.postcomposeHomEquiv (diagramIsoCospan.{vβ} _) _).symm.trans <|
IsLimit.equivIsoLimit <|
Cones.ext (Iso.refl _) <| by
rintro (_ | _ | _) <;> dsimp <;> simp only [comp_id, id_comp, G.map_comp]
#align category_theory.limits.is_limit_map_cone_pullback_cone_equiv CategoryTheory.Limits.isLimitMapConePullbackConeEquiv
def isLimitPullbackConeMapOfIsLimit [PreservesLimit (cospan f g) G]
(l : IsLimit (PullbackCone.mk h k comm)) :
have : G.map h β« G.map f = G.map k β« G.map g := by rw [β G.map_comp, β G.map_comp,comm]
IsLimit (PullbackCone.mk (G.map h) (G.map k) this) :=
isLimitMapConePullbackConeEquiv G comm (PreservesLimit.preserves l)
#align category_theory.limits.is_limit_pullback_cone_map_of_is_limit CategoryTheory.Limits.isLimitPullbackConeMapOfIsLimit
def isLimitOfIsLimitPullbackConeMap [ReflectsLimit (cospan f g) G]
(l : IsLimit (PullbackCone.mk (G.map h) (G.map k) (show G.map h β« G.map f = G.map k β« G.map g
from by simp only [β G.map_comp,comm]))) : IsLimit (PullbackCone.mk h k comm) :=
ReflectsLimit.reflects ((isLimitMapConePullbackConeEquiv G comm).symm l)
#align category_theory.limits.is_limit_of_is_limit_pullback_cone_map CategoryTheory.Limits.isLimitOfIsLimitPullbackConeMap
variable (f g) [PreservesLimit (cospan f g) G]
def isLimitOfHasPullbackOfPreservesLimit [i : HasPullback f g] :
have : G.map pullback.fst β« G.map f = G.map pullback.snd β« G.map g := by
simp only [β G.map_comp, pullback.condition];
IsLimit (PullbackCone.mk (G.map (@pullback.fst _ _ _ _ _ f g i)) (G.map pullback.snd) this) :=
isLimitPullbackConeMapOfIsLimit G _ (pullbackIsPullback f g)
#align category_theory.limits.is_limit_of_has_pullback_of_preserves_limit CategoryTheory.Limits.isLimitOfHasPullbackOfPreservesLimit
def preservesPullbackSymmetry : PreservesLimit (cospan g f) G where
preserves {c} hc := by
apply (IsLimit.postcomposeHomEquiv (diagramIsoCospan.{vβ} _) _).toFun
apply IsLimit.ofIsoLimit _ (PullbackCone.isoMk _).symm
apply PullbackCone.isLimitOfFlip
apply (isLimitMapConePullbackConeEquiv _ _).toFun
Β· refine @PreservesLimit.preserves _ _ _ _ _ _ _ _ ?_ _ ?_
Β· dsimp
infer_instance
apply PullbackCone.isLimitOfFlip
apply IsLimit.ofIsoLimit _ (PullbackCone.isoMk _)
exact (IsLimit.postcomposeHomEquiv (diagramIsoCospan.{vβ} _) _).invFun hc
Β· exact
(c.Ο.naturality WalkingCospan.Hom.inr).symm.trans
(c.Ο.naturality WalkingCospan.Hom.inl : _)
#align category_theory.limits.preserves_pullback_symmetry CategoryTheory.Limits.preservesPullbackSymmetry
theorem hasPullback_of_preservesPullback [HasPullback f g] : HasPullback (G.map f) (G.map g) :=
β¨β¨β¨_, isLimitPullbackConeMapOfIsLimit G _ (pullbackIsPullback _ _)β©β©β©
#align category_theory.limits.has_pullback_of_preserves_pullback CategoryTheory.Limits.hasPullback_of_preservesPullback
variable [HasPullback f g] [HasPullback (G.map f) (G.map g)]
def PreservesPullback.iso : G.obj (pullback f g) β
pullback (G.map f) (G.map g) :=
IsLimit.conePointUniqueUpToIso (isLimitOfHasPullbackOfPreservesLimit G f g) (limit.isLimit _)
#align category_theory.limits.preserves_pullback.iso CategoryTheory.Limits.PreservesPullback.iso
@[simp]
theorem PreservesPullback.iso_hom : (PreservesPullback.iso G f g).hom = pullbackComparison G f g :=
rfl
#align category_theory.limits.preserves_pullback.iso_hom CategoryTheory.Limits.PreservesPullback.iso_hom
@[reassoc]
theorem PreservesPullback.iso_hom_fst :
(PreservesPullback.iso G f g).hom β« pullback.fst = G.map pullback.fst := by
simp [PreservesPullback.iso]
#align category_theory.limits.preserves_pullback.iso_hom_fst CategoryTheory.Limits.PreservesPullback.iso_hom_fst
@[reassoc]
theorem PreservesPullback.iso_hom_snd :
(PreservesPullback.iso G f g).hom β« pullback.snd = G.map pullback.snd := by
simp [PreservesPullback.iso]
#align category_theory.limits.preserves_pullback.iso_hom_snd CategoryTheory.Limits.PreservesPullback.iso_hom_snd
@[reassoc (attr := simp)]
| Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean | 132 | 134 | theorem PreservesPullback.iso_inv_fst :
(PreservesPullback.iso G f g).inv β« G.map pullback.fst = pullback.fst := by |
simp [PreservesPullback.iso, Iso.inv_comp_eq]
| [
" G.map h β« G.map f = G.map k β« G.map g",
" β (j : WalkingCospan),\n ((Cones.postcompose (diagramIsoCospan (cospan f g β G)).hom).obj (G.mapCone (PullbackCone.mk h k comm))).Ο.app j =\n (Iso.refl\n ((Cones.postcompose (diagramIsoCospan (cospan f g β G)).hom).obj\n (G.mapCone (Pul... | [
" G.map h β« G.map f = G.map k β« G.map g",
" β (j : WalkingCospan),\n ((Cones.postcompose (diagramIsoCospan (cospan f g β G)).hom).obj (G.mapCone (PullbackCone.mk h k comm))).Ο.app j =\n (Iso.refl\n ((Cones.postcompose (diagramIsoCospan (cospan f g β G)).hom).obj\n (G.mapCone (Pul... |
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {Ξ± Ξ² : Type*} [TopologicalSpace Ξ±] [TopologicalSpace Ξ²] {f : Ξ± β Ξ²}
variable {s : Set Ξ²} {ΞΉ : Type*} {U : ΞΉ β Opens Ξ²} (hU : iSup U = β€)
theorem Set.restrictPreimage_inducing (s : Set Ξ²) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by
simp_rw [β inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, β @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h β’
intro a
rw [β h, β inducing_subtype_val.nhds_eq_comap]
#align set.restrict_preimage_inducing Set.restrictPreimage_inducing
alias Inducing.restrictPreimage := Set.restrictPreimage_inducing
#align inducing.restrict_preimage Inducing.restrictPreimage
theorem Set.restrictPreimage_embedding (s : Set Ξ²) (h : Embedding f) :
Embedding (s.restrictPreimage f) :=
β¨h.1.restrictPreimage s, h.2.restrictPreimage sβ©
#align set.restrict_preimage_embedding Set.restrictPreimage_embedding
alias Embedding.restrictPreimage := Set.restrictPreimage_embedding
#align embedding.restrict_preimage Embedding.restrictPreimage
theorem Set.restrictPreimage_openEmbedding (s : Set Ξ²) (h : OpenEmbedding f) :
OpenEmbedding (s.restrictPreimage f) :=
β¨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm βΈ continuous_subtype_val.isOpen_preimage _ h.isOpen_rangeβ©
#align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding
alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding
#align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage
theorem Set.restrictPreimage_closedEmbedding (s : Set Ξ²) (h : ClosedEmbedding f) :
ClosedEmbedding (s.restrictPreimage f) :=
β¨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm βΈ inducing_subtype_val.isClosed_preimage _ h.isClosed_rangeβ©
#align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding
alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding
#align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage
theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set Ξ²) :
IsClosedMap (s.restrictPreimage f) := by
intro t
suffices β u, IsClosed u β Subtype.val β»ΒΉ' u = t β
β v, IsClosed v β§ Subtype.val β»ΒΉ' v = s.restrictPreimage f '' t by
simpa [isClosed_induced_iff]
exact fun u hu e => β¨f '' u, H u hu, by simp [β e, image_restrictPreimage]β©
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set Ξ²) (H : IsClosedMap f) :
IsClosedMap (s.restrictPreimage f) := H.restrictPreimage s
| Mathlib/Topology/LocalAtTarget.lean | 78 | 84 | theorem IsOpenMap.restrictPreimage (H : IsOpenMap f) (s : Set Ξ²) :
IsOpenMap (s.restrictPreimage f) := by |
intro t
suffices β u, IsOpen u β Subtype.val β»ΒΉ' u = t β
β v, IsOpen v β§ Subtype.val β»ΒΉ' v = s.restrictPreimage f '' t by
simpa [isOpen_induced_iff]
exact fun u hu e => β¨f '' u, H u hu, by simp [β e, image_restrictPreimage]β©
| [
" Inducing (s.restrictPreimage f)",
" β (x : β(f β»ΒΉ' s)), π x = comap Subtype.val (comap f (π (f βx)))",
" π a = comap Subtype.val (comap f (π (f βa)))",
" IsClosedMap (s.restrictPreimage f)",
" IsClosed t β IsClosed (s.restrictPreimage f '' t)",
" β (u : Set Ξ±), IsClosed u β Subtype.val β»ΒΉ' u = t β β... | [
" Inducing (s.restrictPreimage f)",
" β (x : β(f β»ΒΉ' s)), π x = comap Subtype.val (comap f (π (f βx)))",
" π a = comap Subtype.val (comap f (π (f βa)))",
" IsClosedMap (s.restrictPreimage f)",
" IsClosed t β IsClosed (s.restrictPreimage f '' t)",
" β (u : Set Ξ±), IsClosed u β Subtype.val β»ΒΉ' u = t β β... |
import Mathlib.Data.Real.Irrational
import Mathlib.Data.Rat.Encodable
import Mathlib.Topology.GDelta
#align_import topology.instances.irrational from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Set Filter Metric
open Filter Topology
protected theorem IsGΞ΄.setOf_irrational : IsGΞ΄ { x | Irrational x } :=
(countable_range _).isGΞ΄_compl
set_option linter.uppercaseLean3 false in
#align is_GΞ΄_irrational IsGΞ΄.setOf_irrational
@[deprecated (since := "2024-02-15")] alias isGΞ΄_irrational := IsGΞ΄.setOf_irrational
theorem dense_irrational : Dense { x : β | Irrational x } := by
refine Real.isTopologicalBasis_Ioo_rat.dense_iff.2 ?_
simp only [gt_iff_lt, Rat.cast_lt, not_lt, ge_iff_le, Rat.cast_le, mem_iUnion, mem_singleton_iff,
exists_prop, forall_exists_index, and_imp]
rintro _ a b hlt rfl _
rw [inter_comm]
exact exists_irrational_btwn (Rat.cast_lt.2 hlt)
#align dense_irrational dense_irrational
theorem eventually_residual_irrational : βαΆ x in residual β, Irrational x :=
residual_of_dense_GΞ΄ .setOf_irrational dense_irrational
#align eventually_residual_irrational eventually_residual_irrational
namespace Irrational
variable {x : β}
instance : OrderTopology { x // Irrational x } :=
induced_orderTopology _ Iff.rfl <| @fun _ _ hlt =>
let β¨z, hz, hxz, hzyβ© := exists_irrational_btwn hlt
β¨β¨z, hzβ©, hxz, hzyβ©
instance : NoMaxOrder { x // Irrational x } :=
β¨fun β¨x, hxβ© => β¨β¨x + (1 : β), hx.add_nat 1β©, by simpβ©β©
instance : NoMinOrder { x // Irrational x } :=
β¨fun β¨x, hxβ© => β¨β¨x - (1 : β), hx.sub_nat 1β©, by simpβ©β©
instance : DenselyOrdered { x // Irrational x } :=
β¨fun _ _ hlt =>
let β¨z, hz, hxz, hzyβ© := exists_irrational_btwn hlt
β¨β¨z, hzβ©, hxz, hzyβ©β©
| Mathlib/Topology/Instances/Irrational.lean | 78 | 89 | theorem eventually_forall_le_dist_cast_div (hx : Irrational x) (n : β) :
βαΆ Ξ΅ : β in π 0, β m : β€, Ξ΅ β€ dist x (m / n) := by |
have A : IsClosed (range (fun m => (n : β)β»ΒΉ * m : β€ β β)) :=
((isClosedMap_smulβ (nβ»ΒΉ : β)).comp Int.closedEmbedding_coe_real.isClosedMap).isClosed_range
have B : x β range (fun m => (n : β)β»ΒΉ * m : β€ β β) := by
rintro β¨m, rflβ©
simp at hx
rcases Metric.mem_nhds_iff.1 (A.isOpen_compl.mem_nhds B) with β¨Ξ΅, Ξ΅0, hΞ΅β©
refine (ge_mem_nhds Ξ΅0).mono fun Ξ΄ hΞ΄ m => not_lt.1 fun hlt => ?_
rw [dist_comm] at hlt
refine hΞ΅ (ball_subset_ball hΞ΄ hlt) β¨m, ?_β©
simp [div_eq_inv_mul]
| [
" Dense {x | Irrational x}",
" β o β β a, β b, β (_ : a < b), {Ioo βa βb}, o.Nonempty β (o β© {x | Irrational x}).Nonempty",
" β (o : Set β) (x x_1 : β), x < x_1 β o = Ioo βx βx_1 β o.Nonempty β (o β© {x | Irrational x}).Nonempty",
" (Ioo βa βb β© {x | Irrational x}).Nonempty",
" ({x | Irrational x} β© Ioo βa β... | [
" Dense {x | Irrational x}",
" β o β β a, β b, β (_ : a < b), {Ioo βa βb}, o.Nonempty β (o β© {x | Irrational x}).Nonempty",
" β (o : Set β) (x x_1 : β), x < x_1 β o = Ioo βx βx_1 β o.Nonempty β (o β© {x | Irrational x}).Nonempty",
" (Ioo βa βb β© {x | Irrational x}).Nonempty",
" ({x | Irrational x} β© Ioo βa β... |
import Mathlib.Analysis.Analytic.Linear
import Mathlib.Analysis.Analytic.Composition
import Mathlib.Analysis.NormedSpace.Completion
#align_import analysis.analytic.uniqueness from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090"
variable {π : Type*} [NontriviallyNormedField π] {E : Type*} [NormedAddCommGroup E]
[NormedSpace π E] {F : Type*} [NormedAddCommGroup F] [NormedSpace π F]
open Set
open scoped Topology ENNReal
namespace AnalyticOn
| Mathlib/Analysis/Analytic/Uniqueness.lean | 32 | 70 | theorem eqOn_zero_of_preconnected_of_eventuallyEq_zero_aux [CompleteSpace F] {f : E β F} {U : Set E}
(hf : AnalyticOn π f U) (hU : IsPreconnected U) {zβ : E} (hβ : zβ β U) (hfzβ : f =αΆ [π zβ] 0) :
EqOn f 0 U := by |
/- Let `u` be the set of points around which `f` vanishes. It is clearly open. We have to show
that its limit points in `U` still belong to it, from which the inclusion `U β u` will follow
by connectedness. -/
let u := {x | f =αΆ [π x] 0}
suffices main : closure u β© U β u by
have Uu : U β u :=
hU.subset_of_closure_inter_subset isOpen_setOf_eventually_nhds β¨zβ, hβ, hfzββ© main
intro z hz
simpa using mem_of_mem_nhds (Uu hz)
/- Take a limit point `x`, then a ball `B (x, r)` on which it has a power series expansion, and
then `y β B (x, r/2) β© u`. Then `f` has a power series expansion on `B (y, r/2)` as it is
contained in `B (x, r)`. All the coefficients in this series expansion vanish, as `f` is zero
on a neighborhood of `y`. Therefore, `f` is zero on `B (y, r/2)`. As this ball contains `x`,
it follows that `f` vanishes on a neighborhood of `x`, proving the claim. -/
rintro x β¨xu, xUβ©
rcases hf x xU with β¨p, r, hpβ©
obtain β¨y, yu, hxyβ© : β y β u, edist x y < r / 2 :=
EMetric.mem_closure_iff.1 xu (r / 2) (ENNReal.half_pos hp.r_pos.ne')
let q := p.changeOrigin (y - x)
have has_series : HasFPowerSeriesOnBall f q y (r / 2) := by
have A : (βy - xββ : ββ₯0β) < r / 2 := by rwa [edist_comm, edist_eq_coe_nnnorm_sub] at hxy
have := hp.changeOrigin (A.trans_le ENNReal.half_le_self)
simp only [add_sub_cancel] at this
apply this.mono (ENNReal.half_pos hp.r_pos.ne')
apply ENNReal.le_sub_of_add_le_left ENNReal.coe_ne_top
apply (add_le_add A.le (le_refl (r / 2))).trans (le_of_eq _)
exact ENNReal.add_halves _
have M : EMetric.ball y (r / 2) β π x := EMetric.isOpen_ball.mem_nhds hxy
filter_upwards [M] with z hz
have A : HasSum (fun n : β => q n fun _ : Fin n => z - y) (f z) := has_series.hasSum_sub hz
have B : HasSum (fun n : β => q n fun _ : Fin n => z - y) 0 := by
have : HasFPowerSeriesAt 0 q y := has_series.hasFPowerSeriesAt.congr yu
convert hasSum_zero (Ξ± := F) using 2
ext n
exact this.apply_eq_zero n _
exact HasSum.unique A B
| [
" EqOn f 0 U",
" f z = 0 z",
" closure u β© U β u",
" x β u",
" HasFPowerSeriesOnBall f q y (r / 2)",
" ββy - xββ < r / 2",
" r / 2 β€ r - ββy - xββ",
" ββy - xββ + r / 2 β€ r",
" r / 2 + r / 2 = r",
" f z = OfNat.ofNat 0 z",
" HasSum (fun n => (q n) fun x => z - y) 0",
" (fun n => (q n) fun x =>... | [
" EqOn f 0 U"
] |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {Ξ± : Type*}
namespace Coheyting
variable [CoheytingAlgebra Ξ±] {a b : Ξ±}
def boundary (a : Ξ±) : Ξ± :=
a β οΏ’a
#align coheyting.boundary Coheyting.boundary
scoped[Heyting] prefix:120 "β " => Coheyting.boundary
-- Porting note: Should the notation be automatically included in the current scope?
open Heyting
-- Porting note: Should hnot be named hNot?
theorem inf_hnot_self (a : Ξ±) : a β οΏ’a = β a :=
rfl
#align coheyting.inf_hnot_self Coheyting.inf_hnot_self
theorem boundary_le : β a β€ a :=
inf_le_left
#align coheyting.boundary_le Coheyting.boundary_le
theorem boundary_le_hnot : β a β€ οΏ’a :=
inf_le_right
#align coheyting.boundary_le_hnot Coheyting.boundary_le_hnot
@[simp]
theorem boundary_bot : β (β₯ : Ξ±) = β₯ := bot_inf_eq _
#align coheyting.boundary_bot Coheyting.boundary_bot
@[simp]
theorem boundary_top : β (β€ : Ξ±) = β₯ := by rw [boundary, hnot_top, inf_bot_eq]
#align coheyting.boundary_top Coheyting.boundary_top
theorem boundary_hnot_le (a : Ξ±) : β (οΏ’a) β€ β a :=
(inf_comm _ _).trans_le <| inf_le_inf_right _ hnot_hnot_le
#align coheyting.boundary_hnot_le Coheyting.boundary_hnot_le
@[simp]
theorem boundary_hnot_hnot (a : Ξ±) : β (οΏ’οΏ’a) = β (οΏ’a) := by
simp_rw [boundary, hnot_hnot_hnot, inf_comm]
#align coheyting.boundary_hnot_hnot Coheyting.boundary_hnot_hnot
@[simp]
theorem hnot_boundary (a : Ξ±) : οΏ’β a = β€ := by rw [boundary, hnot_inf_distrib, sup_hnot_self]
#align coheyting.hnot_boundary Coheyting.hnot_boundary
theorem boundary_inf (a b : Ξ±) : β (a β b) = β a β b β a β β b := by
unfold boundary
rw [hnot_inf_distrib, inf_sup_left, inf_right_comm, β inf_assoc]
#align coheyting.boundary_inf Coheyting.boundary_inf
theorem boundary_inf_le : β (a β b) β€ β a β β b :=
(boundary_inf _ _).trans_le <| sup_le_sup inf_le_left inf_le_right
#align coheyting.boundary_inf_le Coheyting.boundary_inf_le
theorem boundary_sup_le : β (a β b) β€ β a β β b := by
rw [boundary, inf_sup_right]
exact
sup_le_sup (inf_le_inf_left _ <| hnot_anti le_sup_left)
(inf_le_inf_left _ <| hnot_anti le_sup_right)
#align coheyting.boundary_sup_le Coheyting.boundary_sup_le
example (a b : Prop) : (a β§ b β¨ Β¬(a β§ b)) β§ ((a β¨ b) β¨ Β¬(a β¨ b)) β a β¨ Β¬a := by
rintro β¨β¨ha, _β© | hnab, (ha | hb) | hnabβ© <;> try exact Or.inl ha
Β· exact Or.inr fun ha => hnab β¨ha, hbβ©
Β· exact Or.inr fun ha => hnab <| Or.inl ha
theorem boundary_le_boundary_sup_sup_boundary_inf_left : β a β€ β (a β b) β β (a β b) := by
-- Porting note: the following simp generates the same term as mathlib3 if you remove
-- sup_inf_right from both. With sup_inf_right included, mathlib4 and mathlib3 generate
-- different terms
simp only [boundary, sup_inf_left, sup_inf_right, sup_right_idem, le_inf_iff, sup_assoc,
sup_comm _ a]
refine β¨β¨β¨?_, ?_β©, β¨?_, ?_β©β©, ?_, ?_β© <;> try { exact le_sup_of_le_left inf_le_left } <;>
refine inf_le_of_right_le ?_
Β· rw [hnot_le_iff_codisjoint_right, codisjoint_left_comm]
exact codisjoint_hnot_left
Β· refine le_sup_of_le_right ?_
rw [hnot_le_iff_codisjoint_right]
exact codisjoint_hnot_right.mono_right (hnot_anti inf_le_left)
#align coheyting.boundary_le_boundary_sup_sup_boundary_inf_left Coheyting.boundary_le_boundary_sup_sup_boundary_inf_left
| Mathlib/Order/Heyting/Boundary.lean | 120 | 122 | theorem boundary_le_boundary_sup_sup_boundary_inf_right : β b β€ β (a β b) β β (a β b) := by |
rw [sup_comm a, inf_comm]
exact boundary_le_boundary_sup_sup_boundary_inf_left
| [
" β β€ = β₯",
" β (οΏ’οΏ’a) = β (οΏ’a)",
" οΏ’β a = β€",
" β (a β b) = β a β b β a β β b",
" a β b β οΏ’(a β b) = a β οΏ’a β b β a β (b β οΏ’b)",
" β (a β b) β€ β a β β b",
" a β οΏ’(a β b) β b β οΏ’(a β b) β€ β a β β b",
" (a β§ b β¨ Β¬(a β§ b)) β§ ((a β¨ b) β¨ Β¬(a β¨ b)) β a β¨ Β¬a",
" a β¨ Β¬a",
" β a β€ β (a β b) β β (a β b)",
... | [
" β β€ = β₯",
" β (οΏ’οΏ’a) = β (οΏ’a)",
" οΏ’β a = β€",
" β (a β b) = β a β b β a β β b",
" a β b β οΏ’(a β b) = a β οΏ’a β b β a β (b β οΏ’b)",
" β (a β b) β€ β a β β b",
" a β οΏ’(a β b) β b β οΏ’(a β b) β€ β a β β b",
" (a β§ b β¨ Β¬(a β§ b)) β§ ((a β¨ b) β¨ Β¬(a β¨ b)) β a β¨ Β¬a",
" a β¨ Β¬a",
" β a β€ β (a β b) β β (a β b)",
... |
import Mathlib.Analysis.SpecialFunctions.Integrals
import Mathlib.Analysis.SumIntegralComparisons
import Mathlib.NumberTheory.Harmonic.Defs
| Mathlib/NumberTheory/Harmonic/Bounds.lean | 17 | 24 | theorem log_add_one_le_harmonic (n : β) :
Real.log β(n+1) β€ harmonic n := by |
calc _ = β« x in (1:β)..β(n+1), xβ»ΒΉ := ?_
_ β€ β d β Finset.Icc 1 n, (d:β)β»ΒΉ := ?_
_ = harmonic n := ?_
Β· rw [Nat.cast_one, integral_inv (by simp [(show Β¬ (1 : β) β€ 0 by norm_num)]), div_one]
Β· exact (inv_antitoneOn_Icc_right <| by norm_num).integral_le_sum_Ico (Nat.le_add_left 1 n)
Β· simp only [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast]
| [
" (β(n + 1)).log β€ β(harmonic n)",
" (β(n + 1)).log = β« (x : β) in β1 ..β(n + 1), xβ»ΒΉ",
" 0 β Set.uIcc 1 β(n + 1)",
" Β¬1 β€ 0",
" β« (x : β) in β1 ..β(n + 1), xβ»ΒΉ β€ β d β Finset.Icc 1 n, (βd)β»ΒΉ",
" 0 < β1",
" β d β Finset.Icc 1 n, (βd)β»ΒΉ = β(harmonic n)"
] | [
" (β(n + 1)).log β€ β(harmonic n)"
] |
import Mathlib.Algebra.MvPolynomial.Derivation
import Mathlib.Algebra.MvPolynomial.Variables
#align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
noncomputable section
universe u v
namespace MvPolynomial
open Set Function Finsupp
variable {R : Type u} {Ο : Type v} {a a' aβ aβ : R} {s : Ο ββ β}
section PDeriv
variable [CommSemiring R]
def pderiv (i : Ο) : Derivation R (MvPolynomial Ο R) (MvPolynomial Ο R) :=
letI := Classical.decEq Ο
mkDerivation R <| Pi.single i 1
#align mv_polynomial.pderiv MvPolynomial.pderiv
theorem pderiv_def [DecidableEq Ο] (i : Ο) : pderiv i = mkDerivation R (Pi.single i 1) := by
unfold pderiv; congr!
#align mv_polynomial.pderiv_def MvPolynomial.pderiv_def
@[simp]
theorem pderiv_monomial {i : Ο} :
pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) := by
classical
simp only [pderiv_def, mkDerivation_monomial, Finsupp.smul_sum, smul_eq_mul, β smul_mul_assoc,
β (monomial _).map_smul]
refine (Finset.sum_eq_single i (fun j _ hne => ?_) fun hi => ?_).trans ?_
Β· simp [Pi.single_eq_of_ne hne]
Β· rw [Finsupp.not_mem_support_iff] at hi; simp [hi]
Β· simp
#align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
theorem pderiv_C {i : Ο} : pderiv i (C a) = 0 :=
derivation_C _ _
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_C MvPolynomial.pderiv_C
theorem pderiv_one {i : Ο} : pderiv i (1 : MvPolynomial Ο R) = 0 := pderiv_C
#align mv_polynomial.pderiv_one MvPolynomial.pderiv_one
@[simp]
theorem pderiv_X [DecidableEq Ο] (i j : Ο) :
pderiv i (X j : MvPolynomial Ο R) = Pi.single (f := fun j => _) i 1 j := by
rw [pderiv_def, mkDerivation_X]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X MvPolynomial.pderiv_X
@[simp]
theorem pderiv_X_self (i : Ο) : pderiv i (X i : MvPolynomial Ο R) = 1 := by classical simp
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_X_self
@[simp]
theorem pderiv_X_of_ne {i j : Ο} (h : j β i) : pderiv i (X j : MvPolynomial Ο R) = 0 := by
classical simp [h]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_X_of_ne
theorem pderiv_eq_zero_of_not_mem_vars {i : Ο} {f : MvPolynomial Ο R} (h : i β f.vars) :
pderiv i f = 0 :=
derivation_eq_zero_of_forall_mem_vars fun _ hj => pderiv_X_of_ne <| ne_of_mem_of_not_mem hj h
#align mv_polynomial.pderiv_eq_zero_of_not_mem_vars MvPolynomial.pderiv_eq_zero_of_not_mem_vars
theorem pderiv_monomial_single {i : Ο} {n : β} : pderiv i (monomial (single i n) a) =
monomial (single i (n - 1)) (a * n) := by simp
#align mv_polynomial.pderiv_monomial_single MvPolynomial.pderiv_monomial_single
theorem pderiv_mul {i : Ο} {f g : MvPolynomial Ο R} :
pderiv i (f * g) = pderiv i f * g + f * pderiv i g := by
simp only [(pderiv i).leibniz f g, smul_eq_mul, mul_comm, add_comm]
#align mv_polynomial.pderiv_mul MvPolynomial.pderiv_mul
theorem pderiv_pow {i : Ο} {f : MvPolynomial Ο R} {n : β} :
pderiv i (f ^ n) = n * f ^ (n - 1) * pderiv i f := by
rw [(pderiv i).leibniz_pow f n, nsmul_eq_mul, smul_eq_mul, mul_assoc]
-- @[simp] -- Porting note (#10618): simp can prove this
| Mathlib/Algebra/MvPolynomial/PDeriv.lean | 125 | 126 | theorem pderiv_C_mul {f : MvPolynomial Ο R} {i : Ο} : pderiv i (C a * f) = C a * pderiv i f := by |
rw [C_mul', Derivation.map_smul, C_mul']
| [
" pderiv i = mkDerivation R (Pi.single i 1)",
" mkDerivation R (Pi.single i 1) = mkDerivation R (Pi.single i 1)",
" (pderiv i) ((monomial s) a) = (monomial (s - single i 1)) (a * β(s i))",
" (s.sum fun a_1 b => (monomial (s - single a_1 1)) (a * βb) * Pi.single i 1 a_1) =\n (monomial (s - single i 1)) (a *... | [
" pderiv i = mkDerivation R (Pi.single i 1)",
" mkDerivation R (Pi.single i 1) = mkDerivation R (Pi.single i 1)",
" (pderiv i) ((monomial s) a) = (monomial (s - single i 1)) (a * β(s i))",
" (s.sum fun a_1 b => (monomial (s - single a_1 1)) (a * βb) * Pi.single i 1 a_1) =\n (monomial (s - single i 1)) (a *... |
import Mathlib.Algebra.Group.Defs
import Mathlib.Logic.Relation
#align_import algebra.homology.complex_shape from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23"
noncomputable section
open scoped Classical
@[ext]
structure ComplexShape (ΞΉ : Type*) where
Rel : ΞΉ β ΞΉ β Prop
next_eq : β {i j j'}, Rel i j β Rel i j' β j = j'
prev_eq : β {i i' j}, Rel i j β Rel i' j β i = i'
#align complex_shape ComplexShape
#align complex_shape.ext ComplexShape.ext
#align complex_shape.ext_iff ComplexShape.ext_iff
namespace ComplexShape
variable {ΞΉ : Type*}
@[simps]
def refl (ΞΉ : Type*) : ComplexShape ΞΉ where
Rel i j := i = j
next_eq w w' := w.symm.trans w'
prev_eq w w' := w.trans w'.symm
#align complex_shape.refl ComplexShape.refl
#align complex_shape.refl_rel ComplexShape.refl_Rel
@[simps]
def symm (c : ComplexShape ΞΉ) : ComplexShape ΞΉ where
Rel i j := c.Rel j i
next_eq w w' := c.prev_eq w w'
prev_eq w w' := c.next_eq w w'
#align complex_shape.symm ComplexShape.symm
#align complex_shape.symm_rel ComplexShape.symm_Rel
@[simp]
| Mathlib/Algebra/Homology/ComplexShape.lean | 100 | 102 | theorem symm_symm (c : ComplexShape ΞΉ) : c.symm.symm = c := by |
ext
simp
| [
" c.symm.symm = c",
" c.symm.symm.Rel xβΒΉ xβ β c.Rel xβΒΉ xβ"
] | [
" c.symm.symm = c"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.