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" ]