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
num_lines
int64
1
150
import Mathlib.Geometry.Manifold.ChartedSpace #align_import geometry.manifold.local_invariant_properties from "leanprover-community/mathlib"@"431589bce478b2229eba14b14a283250428217db" noncomputable section open scoped Classical open Manifold Topology open Set Filter TopologicalSpace variable {H M H' M' X : Type*} variable [TopologicalSpace H] [TopologicalSpace M] [ChartedSpace H M] variable [TopologicalSpace H'] [TopologicalSpace M'] [ChartedSpace H' M'] variable [TopologicalSpace X] namespace StructureGroupoid variable (G : StructureGroupoid H) (G' : StructureGroupoid H') structure LocalInvariantProp (P : (H → H') → Set H → H → Prop) : Prop where is_local : ∀ {s x u} {f : H → H'}, IsOpen u → x ∈ u → (P f s x ↔ P f (s ∩ u) x) right_invariance' : ∀ {s x f} {e : PartialHomeomorph H H}, e ∈ G → x ∈ e.source → P f s x → P (f ∘ e.symm) (e.symm ⁻¹' s) (e x) congr_of_forall : ∀ {s x} {f g : H → H'}, (∀ y ∈ s, f y = g y) → f x = g x → P f s x → P g s x left_invariance' : ∀ {s x f} {e' : PartialHomeomorph H' H'}, e' ∈ G' → s ⊆ f ⁻¹' e'.source → f x ∈ e'.source → P f s x → P (e' ∘ f) s x #align structure_groupoid.local_invariant_prop StructureGroupoid.LocalInvariantProp variable {G G'} {P : (H → H') → Set H → H → Prop} {s t u : Set H} {x : H} variable (hG : G.LocalInvariantProp G' P) section LocalStructomorph variable (G) open PartialHomeomorph def IsLocalStructomorphWithinAt (f : H → H) (s : Set H) (x : H) : Prop := x ∈ s → ∃ e : PartialHomeomorph H H, e ∈ G ∧ EqOn f e.toFun (s ∩ e.source) ∧ x ∈ e.source #align structure_groupoid.is_local_structomorph_within_at StructureGroupoid.IsLocalStructomorphWithinAt theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] : LocalInvariantProp G G (IsLocalStructomorphWithinAt G) := { is_local := by intro s x u f hu hux constructor · rintro h hx rcases h hx.1 with ⟨e, heG, hef, hex⟩ have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac exact ⟨e, heG, hef.mono this, hex⟩ · rintro h hx rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩ refine ⟨e.restr (interior u), ?_, ?_, ?_⟩ · exact closedUnderRestriction' heG isOpen_interior · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef · simp only [*, interior_interior, hu.interior_eq, mfld_simps] right_invariance' := by intro s x f e' he'G he'x h hx have hxs : x ∈ s := by simpa only [e'.left_inv he'x, mfld_simps] using hx rcases h hxs with ⟨e, heG, hef, hex⟩ refine ⟨e'.symm.trans e, G.trans (G.symm he'G) heG, ?_, ?_⟩ · intro y hy simp only [mfld_simps] at hy simp only [hef ⟨hy.1, hy.2.2⟩, mfld_simps] · simp only [hex, he'x, mfld_simps] congr_of_forall := by intro s x f g hfgs _ h hx rcases h hx with ⟨e, heG, hef, hex⟩ refine ⟨e, heG, ?_, hex⟩ intro y hy rw [← hef hy, hfgs y hy.1] left_invariance' := by intro s x f e' he'G _ hfx h hx rcases h hx with ⟨e, heG, hef, hex⟩ refine ⟨e.trans e', G.trans heG he'G, ?_, ?_⟩ · intro y hy simp only [mfld_simps] at hy simp only [hef ⟨hy.1, hy.2.1⟩, mfld_simps] · simpa only [hex, hef ⟨hx, hex⟩, mfld_simps] using hfx } #align structure_groupoid.is_local_structomorph_within_at_local_invariant_prop StructureGroupoid.isLocalStructomorphWithinAt_localInvariantProp
Mathlib/Geometry/Manifold/LocalInvariantProperties.lean
648
666
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff {G : StructureGroupoid H} [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H} (hx : x ∈ f.source ∪ sᶜ) : G.IsLocalStructomorphWithinAt (⇑f) s x ↔ x ∈ s → ∃ e : PartialHomeomorph H H, e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) (s ∩ e.source) ∧ x ∈ e.source := by
constructor · intro hf h2x obtain ⟨e, he, hfe, hxe⟩ := hf h2x refine ⟨e.restr f.source, closedUnderRestriction' he f.open_source, ?_, ?_, hxe, ?_⟩ · simp_rw [PartialHomeomorph.restr_source] exact inter_subset_right.trans interior_subset · intro x' hx' exact hfe ⟨hx'.1, hx'.2.1⟩ · rw [f.open_source.interior_eq] exact Or.resolve_right hx (not_not.mpr h2x) · intro hf hx obtain ⟨e, he, _, hfe, hxe⟩ := hf hx exact ⟨e, he, hfe, hxe⟩
13
import Mathlib.LinearAlgebra.Span import Mathlib.LinearAlgebra.BilinearMap #align_import algebra.module.submodule.bilinear from "leanprover-community/mathlib"@"6010cf523816335f7bae7f8584cb2edaace73940" universe uι u v open Set open Pointwise namespace Submodule variable {ι : Sort uι} {R M N P : Type*} variable [CommSemiring R] [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] variable [Module R M] [Module R N] [Module R P] def map₂ (f : M →ₗ[R] N →ₗ[R] P) (p : Submodule R M) (q : Submodule R N) : Submodule R P := ⨆ s : p, q.map (f s) #align submodule.map₂ Submodule.map₂ theorem apply_mem_map₂ (f : M →ₗ[R] N →ₗ[R] P) {m : M} {n : N} {p : Submodule R M} {q : Submodule R N} (hm : m ∈ p) (hn : n ∈ q) : f m n ∈ map₂ f p q := (le_iSup _ ⟨m, hm⟩ : _ ≤ map₂ f p q) ⟨n, hn, by rfl⟩ #align submodule.apply_mem_map₂ Submodule.apply_mem_map₂ theorem map₂_le {f : M →ₗ[R] N →ₗ[R] P} {p : Submodule R M} {q : Submodule R N} {r : Submodule R P} : map₂ f p q ≤ r ↔ ∀ m ∈ p, ∀ n ∈ q, f m n ∈ r := ⟨fun H _m hm _n hn => H <| apply_mem_map₂ _ hm hn, fun H => iSup_le fun ⟨m, hm⟩ => map_le_iff_le_comap.2 fun n hn => H m hm n hn⟩ #align submodule.map₂_le Submodule.map₂_le variable (R)
Mathlib/Algebra/Module/Submodule/Bilinear.lean
59
73
theorem map₂_span_span (f : M →ₗ[R] N →ₗ[R] P) (s : Set M) (t : Set N) : map₂ f (span R s) (span R t) = span R (Set.image2 (fun m n => f m n) s t) := by
apply le_antisymm · rw [map₂_le] apply @span_induction' R M _ _ _ s intro a ha apply @span_induction' R N _ _ _ t intro b hb exact subset_span ⟨_, ‹_›, _, ‹_›, rfl⟩ all_goals intros; simp only [*, add_mem, smul_mem, zero_mem, _root_.map_zero, map_add, LinearMap.zero_apply, LinearMap.add_apply, LinearMap.smul_apply, map_smul] · rw [span_le, image2_subset_iff] intro a ha b hb exact apply_mem_map₂ _ (subset_span ha) (subset_span hb)
13
import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.LinearAlgebra.FreeModule.PID import Mathlib.LinearAlgebra.Matrix.AbsoluteValue import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue import Mathlib.RingTheory.ClassGroup import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.Norm #align_import number_theory.class_number.finite from "leanprover-community/mathlib"@"ea0bcd84221246c801a6f8fbe8a4372f6d04b176" open scoped nonZeroDivisors namespace ClassGroup open Ring section EuclideanDomain variable {R S : Type*} (K L : Type*) [EuclideanDomain R] [CommRing S] [IsDomain S] variable [Field K] [Field L] variable [Algebra R K] [IsFractionRing R K] variable [Algebra K L] [FiniteDimensional K L] [IsSeparable K L] variable [algRL : Algebra R L] [IsScalarTower R K L] variable [Algebra R S] [Algebra S L] variable [ist : IsScalarTower R S L] [iic : IsIntegralClosure S R L] variable (abv : AbsoluteValue R ℤ) variable {ι : Type*} [DecidableEq ι] [Fintype ι] (bS : Basis ι R S) noncomputable def normBound : ℤ := let n := Fintype.card ι let i : ι := Nonempty.some bS.index_nonempty let m : ℤ := Finset.max' (Finset.univ.image fun ijk : ι × ι × ι => abv (Algebra.leftMulMatrix bS (bS ijk.1) ijk.2.1 ijk.2.2)) ⟨_, Finset.mem_image.mpr ⟨⟨i, i, i⟩, Finset.mem_univ _, rfl⟩⟩ Nat.factorial n • (n • m) ^ n #align class_group.norm_bound ClassGroup.normBound
Mathlib/NumberTheory/ClassNumber/Finite.lean
58
71
theorem normBound_pos : 0 < normBound abv bS := by
obtain ⟨i, j, k, hijk⟩ : ∃ i j k, Algebra.leftMulMatrix bS (bS i) j k ≠ 0 := by by_contra! h obtain ⟨i⟩ := bS.index_nonempty apply bS.ne_zero i apply (injective_iff_map_eq_zero (Algebra.leftMulMatrix bS)).mp (Algebra.leftMulMatrix_injective bS) ext j k simp [h, DMatrix.zero_apply] simp only [normBound, Algebra.smul_def, eq_natCast] apply mul_pos (Int.natCast_pos.mpr (Nat.factorial_pos _)) refine pow_pos (mul_pos (Int.natCast_pos.mpr (Fintype.card_pos_iff.mpr ⟨i⟩)) ?_) _ refine lt_of_lt_of_le (abv.pos hijk) (Finset.le_max' _ _ ?_) exact Finset.mem_image.mpr ⟨⟨i, j, k⟩, Finset.mem_univ _, rfl⟩
13
import Mathlib.Control.Traversable.Instances import Mathlib.Order.Filter.Basic #align_import order.filter.basic from "leanprover-community/mathlib"@"d4f691b9e5f94cfc64639973f3544c95f8d5d494" open Set List namespace Filter universe u variable {α β γ : Type u} {f : β → Filter α} {s : γ → Set α} theorem sequence_mono : ∀ as bs : List (Filter α), Forall₂ (· ≤ ·) as bs → sequence as ≤ sequence bs | [], [], Forall₂.nil => le_rfl | _::as, _::bs, Forall₂.cons h hs => seq_mono (map_mono h) (sequence_mono as bs hs) #align filter.sequence_mono Filter.sequence_mono theorem mem_traverse : ∀ (fs : List β) (us : List γ), Forall₂ (fun b c => s c ∈ f b) fs us → traverse s us ∈ traverse f fs | [], [], Forall₂.nil => mem_pure.2 <| mem_singleton _ | _::fs, _::us, Forall₂.cons h hs => seq_mem_seq (image_mem_map h) (mem_traverse fs us hs) #align filter.mem_traverse Filter.mem_traverse -- TODO: add a `Filter.HasBasis` statement
Mathlib/Order/Filter/ListTraverse.lean
38
53
theorem mem_traverse_iff (fs : List β) (t : Set (List α)) : t ∈ traverse f fs ↔ ∃ us : List (Set α), Forall₂ (fun b (s : Set α) => s ∈ f b) fs us ∧ sequence us ⊆ t := by
constructor · induction fs generalizing t with | nil => simp only [sequence, mem_pure, imp_self, forall₂_nil_left_iff, exists_eq_left, Set.pure_def, singleton_subset_iff, traverse_nil] | cons b fs ih => intro ht rcases mem_seq_iff.1 ht with ⟨u, hu, v, hv, ht⟩ rcases mem_map_iff_exists_image.1 hu with ⟨w, hw, hwu⟩ rcases ih v hv with ⟨us, hus, hu⟩ exact ⟨w::us, Forall₂.cons hw hus, (Set.seq_mono hwu hu).trans ht⟩ · rintro ⟨us, hus, hs⟩ exact mem_of_superset (mem_traverse _ _ hus) hs
13
import Mathlib.Algebra.BigOperators.Intervals import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Topology.Instances.NNReal #align_import analysis.normed.group.infinite_sum from "leanprover-community/mathlib"@"9a59dcb7a2d06bf55da57b9030169219980660cd" open Topology NNReal open Finset Filter Metric variable {ι α E F : Type*} [SeminormedAddCommGroup E] [SeminormedAddCommGroup F] theorem cauchySeq_finset_iff_vanishing_norm {f : ι → E} : (CauchySeq fun s : Finset ι => ∑ i ∈ s, f i) ↔ ∀ ε > (0 : ℝ), ∃ s : Finset ι, ∀ t, Disjoint t s → ‖∑ i ∈ t, f i‖ < ε := by rw [cauchySeq_finset_iff_sum_vanishing, nhds_basis_ball.forall_iff] · simp only [ball_zero_eq, Set.mem_setOf_eq] · rintro s t hst ⟨s', hs'⟩ exact ⟨s', fun t' ht' => hst <| hs' _ ht'⟩ #align cauchy_seq_finset_iff_vanishing_norm cauchySeq_finset_iff_vanishing_norm theorem summable_iff_vanishing_norm [CompleteSpace E] {f : ι → E} : Summable f ↔ ∀ ε > (0 : ℝ), ∃ s : Finset ι, ∀ t, Disjoint t s → ‖∑ i ∈ t, f i‖ < ε := by rw [summable_iff_cauchySeq_finset, cauchySeq_finset_iff_vanishing_norm] #align summable_iff_vanishing_norm summable_iff_vanishing_norm
Mathlib/Analysis/Normed/Group/InfiniteSum.lean
54
68
theorem cauchySeq_finset_of_norm_bounded_eventually {f : ι → E} {g : ι → ℝ} (hg : Summable g) (h : ∀ᶠ i in cofinite, ‖f i‖ ≤ g i) : CauchySeq fun s => ∑ i ∈ s, f i := by
refine cauchySeq_finset_iff_vanishing_norm.2 fun ε hε => ?_ rcases summable_iff_vanishing_norm.1 hg ε hε with ⟨s, hs⟩ classical refine ⟨s ∪ h.toFinset, fun t ht => ?_⟩ have : ∀ i ∈ t, ‖f i‖ ≤ g i := by intro i hi simp only [disjoint_left, mem_union, not_or, h.mem_toFinset, Set.mem_compl_iff, Classical.not_not] at ht exact (ht hi).2 calc ‖∑ i ∈ t, f i‖ ≤ ∑ i ∈ t, g i := norm_sum_le_of_le _ this _ ≤ ‖∑ i ∈ t, g i‖ := le_abs_self _ _ < ε := hs _ (ht.mono_right le_sup_left)
13
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 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 #align first_order.language.Theory.is_satisfiable_directed_union_iff FirstOrder.Language.Theory.isSatisfiable_directed_union_iff
Mathlib/ModelTheory/Satisfiability.lean
138
154
theorem isSatisfiable_union_distinctConstantsTheory_of_card_le (T : L.Theory) (s : Set α) (M : Type w') [Nonempty M] [L.Structure M] [M ⊨ T] (h : Cardinal.lift.{w'} #s ≤ Cardinal.lift.{w} #M) : ((L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s).IsSatisfiable := by
haveI : Inhabited M := Classical.inhabited_of_nonempty inferInstance rw [Cardinal.lift_mk_le'] at h letI : (constantsOn α).Structure M := constantsOn.structure (Function.extend (↑) h.some default) have : M ⊨ (L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s := by refine ((LHom.onTheory_model _ _).2 inferInstance).union ?_ rw [model_distinctConstantsTheory] refine fun a as b bs ab => ?_ rw [← Subtype.coe_mk a as, ← Subtype.coe_mk b bs, ← Subtype.ext_iff] exact h.some.injective ((Subtype.coe_injective.extend_apply h.some default ⟨a, as⟩).symm.trans (ab.trans (Subtype.coe_injective.extend_apply h.some default ⟨b, bs⟩))) exact Model.isSatisfiable M
13
import Mathlib.CategoryTheory.Filtered.Connected import Mathlib.CategoryTheory.Limits.TypesFiltered import Mathlib.CategoryTheory.Limits.Final universe v₁ v₂ u₁ u₂ namespace CategoryTheory open CategoryTheory.Limits CategoryTheory.Functor Opposite section ArbitraryUniverses variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (F : C ⥤ D) theorem Functor.final_of_isFiltered_structuredArrow [∀ d, IsFiltered (StructuredArrow d F)] : Final F where out _ := IsFiltered.isConnected _ theorem Functor.initial_of_isCofiltered_costructuredArrow [∀ d, IsCofiltered (CostructuredArrow F d)] : Initial F where out _ := IsCofiltered.isConnected _
Mathlib/CategoryTheory/Filtered/Final.lean
56
72
theorem isFiltered_structuredArrow_of_isFiltered_of_exists [IsFilteredOrEmpty C] (h₁ : ∀ d, ∃ c, Nonempty (d ⟶ F.obj c)) (h₂ : ∀ {d : D} {c : C} (s s' : d ⟶ F.obj c), ∃ (c' : C) (t : c ⟶ c'), s ≫ F.map t = s' ≫ F.map t) (d : D) : IsFiltered (StructuredArrow d F) := by
have : Nonempty (StructuredArrow d F) := by obtain ⟨c, ⟨f⟩⟩ := h₁ d exact ⟨.mk f⟩ suffices IsFilteredOrEmpty (StructuredArrow d F) from IsFiltered.mk refine ⟨fun f g => ?_, fun f g η μ => ?_⟩ · obtain ⟨c, ⟨t, ht⟩⟩ := h₂ (f.hom ≫ F.map (IsFiltered.leftToMax f.right g.right)) (g.hom ≫ F.map (IsFiltered.rightToMax f.right g.right)) refine ⟨.mk (f.hom ≫ F.map (IsFiltered.leftToMax f.right g.right ≫ t)), ?_, ?_, trivial⟩ · exact StructuredArrow.homMk (IsFiltered.leftToMax _ _ ≫ t) rfl · exact StructuredArrow.homMk (IsFiltered.rightToMax _ _ ≫ t) (by simpa using ht.symm) · refine ⟨.mk (f.hom ≫ F.map (η.right ≫ IsFiltered.coeqHom η.right μ.right)), StructuredArrow.homMk (IsFiltered.coeqHom η.right μ.right) (by simp), ?_⟩ simpa using IsFiltered.coeq_condition _ _
13
import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.LinearAlgebra.Dimension.Constructions open Cardinal Submodule Set FiniteDimensional universe u v section Module variable {K : Type u} {V : Type v} [Ring K] [StrongRankCondition K] [AddCommGroup V] [Module K V] noncomputable def Basis.ofRankEqZero [Module.Free K V] {ι : Type*} [IsEmpty ι] (hV : Module.rank K V = 0) : Basis ι K V := haveI : Subsingleton V := by obtain ⟨_, b⟩ := Module.Free.exists_basis (R := K) (M := V) haveI := mk_eq_zero_iff.1 (hV ▸ b.mk_eq_rank'') exact b.repr.toEquiv.subsingleton Basis.empty _ #align basis.of_rank_eq_zero Basis.ofRankEqZero @[simp] theorem Basis.ofRankEqZero_apply [Module.Free K V] {ι : Type*} [IsEmpty ι] (hV : Module.rank K V = 0) (i : ι) : Basis.ofRankEqZero hV i = 0 := rfl #align basis.of_rank_eq_zero_apply Basis.ofRankEqZero_apply
Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean
46
60
theorem le_rank_iff_exists_linearIndependent [Module.Free K V] {c : Cardinal} : c ≤ Module.rank K V ↔ ∃ s : Set V, #s = c ∧ LinearIndependent K ((↑) : s → V) := by
haveI := nontrivial_of_invariantBasisNumber K constructor · intro h obtain ⟨κ, t'⟩ := Module.Free.exists_basis (R := K) (M := V) let t := t'.reindexRange have : LinearIndependent K ((↑) : Set.range t' → V) := by convert t.linearIndependent ext; exact (Basis.reindexRange_apply _ _).symm rw [← t.mk_eq_rank'', le_mk_iff_exists_subset] at h rcases h with ⟨s, hst, hsc⟩ exact ⟨s, hsc, this.mono hst⟩ · rintro ⟨s, rfl, si⟩ exact si.cardinal_le_rank
13
import Mathlib.Analysis.Convex.Jensen import Mathlib.Analysis.Convex.Mul import Mathlib.Analysis.Convex.SpecificFunctions.Basic import Mathlib.Analysis.SpecialFunctions.Pow.NNReal #align_import analysis.mean_inequalities_pow from "leanprover-community/mathlib"@"ccdbfb6e5614667af5aa3ab2d50885e0ef44a46f" universe u v open Finset open scoped Classical open NNReal ENNReal noncomputable section variable {ι : Type u} (s : Finset ι) namespace Real theorem pow_arith_mean_le_arith_mean_pow (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) (n : ℕ) : (∑ i ∈ s, w i * z i) ^ n ≤ ∑ i ∈ s, w i * z i ^ n := (convexOn_pow n).map_sum_le hw hw' hz #align real.pow_arith_mean_le_arith_mean_pow Real.pow_arith_mean_le_arith_mean_pow theorem pow_arith_mean_le_arith_mean_pow_of_even (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (hw' : ∑ i ∈ s, w i = 1) {n : ℕ} (hn : Even n) : (∑ i ∈ s, w i * z i) ^ n ≤ ∑ i ∈ s, w i * z i ^ n := hn.convexOn_pow.map_sum_le hw hw' fun _ _ => Set.mem_univ _ #align real.pow_arith_mean_le_arith_mean_pow_of_even Real.pow_arith_mean_le_arith_mean_pow_of_even
Mathlib/Analysis/MeanInequalitiesPow.lean
72
86
theorem pow_sum_div_card_le_sum_pow {f : ι → ℝ} (n : ℕ) (hf : ∀ a ∈ s, 0 ≤ f a) : (∑ x ∈ s, f x) ^ (n + 1) / (s.card : ℝ) ^ n ≤ ∑ x ∈ s, f x ^ (n + 1) := by
rcases s.eq_empty_or_nonempty with (rfl | hs) · simp_rw [Finset.sum_empty, zero_pow n.succ_ne_zero, zero_div]; rfl · have hs0 : 0 < (s.card : ℝ) := Nat.cast_pos.2 hs.card_pos suffices (∑ x ∈ s, f x / s.card) ^ (n + 1) ≤ ∑ x ∈ s, f x ^ (n + 1) / s.card by rwa [← Finset.sum_div, ← Finset.sum_div, div_pow, pow_succ (s.card : ℝ), ← div_div, div_le_iff hs0, div_mul, div_self hs0.ne', div_one] at this have := @ConvexOn.map_sum_le ℝ ℝ ℝ ι _ _ _ _ _ _ (Set.Ici 0) (fun x => x ^ (n + 1)) s (fun _ => 1 / s.card) ((↑) ∘ f) (convexOn_pow (n + 1)) ?_ ?_ fun i hi => Set.mem_Ici.2 (hf i hi) · simpa only [inv_mul_eq_div, one_div, Algebra.id.smul_eq_mul] using this · simp only [one_div, inv_nonneg, Nat.cast_nonneg, imp_true_iff] · simpa only [one_div, Finset.sum_const, nsmul_eq_mul] using mul_inv_cancel hs0.ne'
13
import Mathlib.Algebra.GCDMonoid.Basic import Mathlib.Data.Multiset.FinsetOps import Mathlib.Data.Multiset.Fold #align_import algebra.gcd_monoid.multiset from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" namespace Multiset variable {α : Type*} [CancelCommMonoidWithZero α] [NormalizedGCDMonoid α] section gcd def gcd (s : Multiset α) : α := s.fold GCDMonoid.gcd 0 #align multiset.gcd Multiset.gcd @[simp] theorem gcd_zero : (0 : Multiset α).gcd = 0 := fold_zero _ _ #align multiset.gcd_zero Multiset.gcd_zero @[simp] theorem gcd_cons (a : α) (s : Multiset α) : (a ::ₘ s).gcd = GCDMonoid.gcd a s.gcd := fold_cons_left _ _ _ _ #align multiset.gcd_cons Multiset.gcd_cons @[simp] theorem gcd_singleton {a : α} : ({a} : Multiset α).gcd = normalize a := (fold_singleton _ _ _).trans <| gcd_zero_right _ #align multiset.gcd_singleton Multiset.gcd_singleton @[simp] theorem gcd_add (s₁ s₂ : Multiset α) : (s₁ + s₂).gcd = GCDMonoid.gcd s₁.gcd s₂.gcd := Eq.trans (by simp [gcd]) (fold_add _ _ _ _ _) #align multiset.gcd_add Multiset.gcd_add theorem dvd_gcd {s : Multiset α} {a : α} : a ∣ s.gcd ↔ ∀ b ∈ s, a ∣ b := Multiset.induction_on s (by simp) (by simp (config := { contextual := true }) [or_imp, forall_and, dvd_gcd_iff]) #align multiset.dvd_gcd Multiset.dvd_gcd theorem gcd_dvd {s : Multiset α} {a : α} (h : a ∈ s) : s.gcd ∣ a := dvd_gcd.1 dvd_rfl _ h #align multiset.gcd_dvd Multiset.gcd_dvd theorem gcd_mono {s₁ s₂ : Multiset α} (h : s₁ ⊆ s₂) : s₂.gcd ∣ s₁.gcd := dvd_gcd.2 fun _ hb ↦ gcd_dvd (h hb) #align multiset.gcd_mono Multiset.gcd_mono @[simp 1100] theorem normalize_gcd (s : Multiset α) : normalize s.gcd = s.gcd := Multiset.induction_on s (by simp) fun a s _ ↦ by simp #align multiset.normalize_gcd Multiset.normalize_gcd theorem gcd_eq_zero_iff (s : Multiset α) : s.gcd = 0 ↔ ∀ x : α, x ∈ s → x = 0 := by constructor · intro h x hx apply eq_zero_of_zero_dvd rw [← h] apply gcd_dvd hx · refine s.induction_on ?_ ?_ · simp intro a s sgcd h simp [h a (mem_cons_self a s), sgcd fun x hx ↦ h x (mem_cons_of_mem hx)] #align multiset.gcd_eq_zero_iff Multiset.gcd_eq_zero_iff theorem gcd_map_mul (a : α) (s : Multiset α) : (s.map (a * ·)).gcd = normalize a * s.gcd := by refine s.induction_on ?_ fun b s ih ↦ ?_ · simp_rw [map_zero, gcd_zero, mul_zero] · simp_rw [map_cons, gcd_cons, ← gcd_mul_left] rw [ih] apply ((normalize_associated a).mul_right _).gcd_eq_right #align multiset.gcd_map_mul Multiset.gcd_map_mul section variable [DecidableEq α] @[simp] theorem gcd_dedup (s : Multiset α) : (dedup s).gcd = s.gcd := Multiset.induction_on s (by simp) fun a s IH ↦ by by_cases h : a ∈ s <;> simp [IH, h] unfold gcd rw [← cons_erase h, fold_cons_left, ← gcd_assoc, gcd_same] apply (associated_normalize _).gcd_eq_left #align multiset.gcd_dedup Multiset.gcd_dedup @[simp] theorem gcd_ndunion (s₁ s₂ : Multiset α) : (ndunion s₁ s₂).gcd = GCDMonoid.gcd s₁.gcd s₂.gcd := by rw [← gcd_dedup, dedup_ext.2, gcd_dedup, gcd_add] simp #align multiset.gcd_ndunion Multiset.gcd_ndunion @[simp] theorem gcd_union (s₁ s₂ : Multiset α) : (s₁ ∪ s₂).gcd = GCDMonoid.gcd s₁.gcd s₂.gcd := by rw [← gcd_dedup, dedup_ext.2, gcd_dedup, gcd_add] simp #align multiset.gcd_union Multiset.gcd_union @[simp] theorem gcd_ndinsert (a : α) (s : Multiset α) : (ndinsert a s).gcd = GCDMonoid.gcd a s.gcd := by rw [← gcd_dedup, dedup_ext.2, gcd_dedup, gcd_cons] simp #align multiset.gcd_ndinsert Multiset.gcd_ndinsert end theorem extract_gcd' (s t : Multiset α) (hs : ∃ x, x ∈ s ∧ x ≠ (0 : α)) (ht : s = t.map (s.gcd * ·)) : t.gcd = 1 := ((@mul_right_eq_self₀ _ _ s.gcd _).1 <| by conv_lhs => rw [← normalize_gcd, ← gcd_map_mul, ← ht]).resolve_right <| by contrapose! hs exact s.gcd_eq_zero_iff.1 hs #align multiset.extract_gcd' Multiset.extract_gcd'
Mathlib/Algebra/GCDMonoid/Multiset.lean
240
254
theorem extract_gcd (s : Multiset α) (hs : s ≠ 0) : ∃ t : Multiset α, s = t.map (s.gcd * ·) ∧ t.gcd = 1 := by
classical by_cases h : ∀ x ∈ s, x = (0 : α) · use replicate (card s) 1 rw [map_replicate, eq_replicate, mul_one, s.gcd_eq_zero_iff.2 h, ← nsmul_singleton, ← gcd_dedup, dedup_nsmul (card_pos.2 hs).ne', dedup_singleton, gcd_singleton] exact ⟨⟨rfl, h⟩, normalize_one⟩ · choose f hf using @gcd_dvd _ _ _ s push_neg at h refine ⟨s.pmap @f fun _ ↦ id, ?_, extract_gcd' s _ h ?_⟩ <;> · rw [map_pmap] conv_lhs => rw [← s.map_id, ← s.pmap_eq_map _ _ fun _ ↦ id] congr with (x hx) rw [id, ← hf hx]
13
import Mathlib.Algebra.Algebra.Operations import Mathlib.Data.Fintype.Lattice import Mathlib.RingTheory.Coprime.Lemmas #align_import ring_theory.ideal.operations from "leanprover-community/mathlib"@"e7f0ddbf65bd7181a85edb74b64bdc35ba4bdc74" assert_not_exists Basis -- See `RingTheory.Ideal.Basis` assert_not_exists Submodule.hasQuotient -- See `RingTheory.Ideal.QuotientOperations` universe u v w x open Pointwise namespace Submodule variable {R : Type u} {M : Type v} {M' F G : Type*} section CommSemiring variable [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] open Pointwise instance hasSMul' : SMul (Ideal R) (Submodule R M) := ⟨Submodule.map₂ (LinearMap.lsmul R M)⟩ #align submodule.has_smul' Submodule.hasSMul' protected theorem _root_.Ideal.smul_eq_mul (I J : Ideal R) : I • J = I * J := rfl #align ideal.smul_eq_mul Ideal.smul_eq_mul variable (R M) in def _root_.Module.annihilator : Ideal R := LinearMap.ker (LinearMap.lsmul R M) theorem _root_.Module.mem_annihilator {r} : r ∈ Module.annihilator R M ↔ ∀ m : M, r • m = 0 := ⟨fun h ↦ (congr($h ·)), (LinearMap.ext ·)⟩ theorem _root_.LinearMap.annihilator_le_of_injective (f : M →ₗ[R] M') (hf : Function.Injective f) : Module.annihilator R M' ≤ Module.annihilator R M := fun x h ↦ by rw [Module.mem_annihilator] at h ⊢; exact fun m ↦ hf (by rw [map_smul, h, f.map_zero]) theorem _root_.LinearMap.annihilator_le_of_surjective (f : M →ₗ[R] M') (hf : Function.Surjective f) : Module.annihilator R M ≤ Module.annihilator R M' := fun x h ↦ by rw [Module.mem_annihilator] at h ⊢ intro m; obtain ⟨m, rfl⟩ := hf m rw [← map_smul, h, f.map_zero] theorem _root_.LinearEquiv.annihilator_eq (e : M ≃ₗ[R] M') : Module.annihilator R M = Module.annihilator R M' := (e.annihilator_le_of_surjective e.surjective).antisymm (e.annihilator_le_of_injective e.injective) abbrev annihilator (N : Submodule R M) : Ideal R := Module.annihilator R N #align submodule.annihilator Submodule.annihilator theorem annihilator_top : (⊤ : Submodule R M).annihilator = Module.annihilator R M := topEquiv.annihilator_eq variable {I J : Ideal R} {N P : Submodule R M} theorem mem_annihilator {r} : r ∈ N.annihilator ↔ ∀ n ∈ N, r • n = (0 : M) := by simp_rw [annihilator, Module.mem_annihilator, Subtype.forall, Subtype.ext_iff]; rfl #align submodule.mem_annihilator Submodule.mem_annihilator theorem mem_annihilator' {r} : r ∈ N.annihilator ↔ N ≤ comap (r • (LinearMap.id : M →ₗ[R] M)) ⊥ := mem_annihilator.trans ⟨fun H n hn => (mem_bot R).2 <| H n hn, fun H _ hn => (mem_bot R).1 <| H hn⟩ #align submodule.mem_annihilator' Submodule.mem_annihilator'
Mathlib/RingTheory/Ideal/Operations.lean
82
96
theorem mem_annihilator_span (s : Set M) (r : R) : r ∈ (Submodule.span R s).annihilator ↔ ∀ n : s, r • (n : M) = 0 := by
rw [Submodule.mem_annihilator] constructor · intro h n exact h _ (Submodule.subset_span n.prop) · intro h n hn refine Submodule.span_induction hn ?_ ?_ ?_ ?_ · intro x hx exact h ⟨x, hx⟩ · exact smul_zero _ · intro x y hx hy rw [smul_add, hx, hy, zero_add] · intro a x hx rw [smul_comm, hx, smul_zero]
13
import Mathlib.AlgebraicTopology.SimplicialObject import Mathlib.CategoryTheory.Limits.Shapes.Products #align_import algebraic_topology.split_simplicial_object from "leanprover-community/mathlib"@"dd1f8496baa505636a82748e6b652165ea888733" noncomputable section open CategoryTheory CategoryTheory.Category CategoryTheory.Limits Opposite SimplexCategory open Simplicial universe u variable {C : Type*} [Category C] namespace SimplicialObject namespace Splitting def IndexSet (Δ : SimplexCategoryᵒᵖ) := ΣΔ' : SimplexCategoryᵒᵖ, { α : Δ.unop ⟶ Δ'.unop // Epi α } #align simplicial_object.splitting.index_set SimplicialObject.Splitting.IndexSet namespace IndexSet @[simps] def mk {Δ Δ' : SimplexCategory} (f : Δ ⟶ Δ') [Epi f] : IndexSet (op Δ) := ⟨op Δ', f, inferInstance⟩ #align simplicial_object.splitting.index_set.mk SimplicialObject.Splitting.IndexSet.mk variable {Δ : SimplexCategoryᵒᵖ} (A : IndexSet Δ) def e := A.2.1 #align simplicial_object.splitting.index_set.e SimplicialObject.Splitting.IndexSet.e instance : Epi A.e := A.2.2 theorem ext' : A = ⟨A.1, ⟨A.e, A.2.2⟩⟩ := rfl #align simplicial_object.splitting.index_set.ext' SimplicialObject.Splitting.IndexSet.ext' theorem ext (A₁ A₂ : IndexSet Δ) (h₁ : A₁.1 = A₂.1) (h₂ : A₁.e ≫ eqToHom (by rw [h₁]) = A₂.e) : A₁ = A₂ := by rcases A₁ with ⟨Δ₁, ⟨α₁, hα₁⟩⟩ rcases A₂ with ⟨Δ₂, ⟨α₂, hα₂⟩⟩ simp only at h₁ subst h₁ simp only [eqToHom_refl, comp_id, IndexSet.e] at h₂ simp only [h₂] #align simplicial_object.splitting.index_set.ext SimplicialObject.Splitting.IndexSet.ext instance : Fintype (IndexSet Δ) := Fintype.ofInjective (fun A => ⟨⟨A.1.unop.len, Nat.lt_succ_iff.mpr (len_le_of_epi (inferInstance : Epi A.e))⟩, A.e.toOrderHom⟩ : IndexSet Δ → Sigma fun k : Fin (Δ.unop.len + 1) => Fin (Δ.unop.len + 1) → Fin (k + 1)) (by rintro ⟨Δ₁, α₁⟩ ⟨Δ₂, α₂⟩ h₁ induction' Δ₁ using Opposite.rec with Δ₁ induction' Δ₂ using Opposite.rec with Δ₂ simp only [unop_op, Sigma.mk.inj_iff, Fin.mk.injEq] at h₁ have h₂ : Δ₁ = Δ₂ := by ext1 simpa only [Fin.mk_eq_mk] using h₁.1 subst h₂ refine ext _ _ rfl ?_ ext : 2 exact eq_of_heq h₁.2) variable (Δ) @[simps] def id : IndexSet Δ := ⟨Δ, ⟨𝟙 _, by infer_instance⟩⟩ #align simplicial_object.splitting.index_set.id SimplicialObject.Splitting.IndexSet.id instance : Inhabited (IndexSet Δ) := ⟨id Δ⟩ variable {Δ} @[simp] def EqId : Prop := A = id _ #align simplicial_object.splitting.index_set.eq_id SimplicialObject.Splitting.IndexSet.EqId
Mathlib/AlgebraicTopology/SplitSimplicialObject.lean
127
140
theorem eqId_iff_eq : A.EqId ↔ A.1 = Δ := by
constructor · intro h dsimp at h rw [h] rfl · intro h rcases A with ⟨_, ⟨f, hf⟩⟩ simp only at h subst h refine ext _ _ rfl ?_ haveI := hf simp only [eqToHom_refl, comp_id] exact eq_id_of_epi f
13
import Mathlib.Data.Fintype.BigOperators import Mathlib.Logic.Equiv.Embedding #align_import data.fintype.card_embedding from "leanprover-community/mathlib"@"98e83c3d541c77cdb7da20d79611a780ff8e7d90" local notation "|" x "|" => Finset.card x local notation "‖" x "‖" => Fintype.card x open Function open Nat namespace Fintype theorem card_embedding_eq_of_unique {α β : Type*} [Unique α] [Fintype β] [Fintype (α ↪ β)] : ‖α ↪ β‖ = ‖β‖ := card_congr Equiv.uniqueEmbeddingEquivResult #align fintype.card_embedding_eq_of_unique Fintype.card_embedding_eq_of_unique -- Establishes the cardinality of the type of all injections between two finite types. -- Porting note: `induction'` is broken so instead we make an ugly refine and `dsimp` a lot. @[simp]
Mathlib/Data/Fintype/CardEmbedding.lean
36
50
theorem card_embedding_eq {α β : Type*} [Fintype α] [Fintype β] [emb : Fintype (α ↪ β)] : ‖α ↪ β‖ = ‖β‖.descFactorial ‖α‖ := by
rw [Subsingleton.elim emb Embedding.fintype] refine Fintype.induction_empty_option (P := fun t ↦ ‖t ↪ β‖ = ‖β‖.descFactorial ‖t‖) (fun α₁ α₂ h₂ e ih ↦ ?_) (?_) (fun γ h ih ↦ ?_) α <;> dsimp only <;> clear! α · letI := Fintype.ofEquiv _ e.symm rw [← card_congr (Equiv.embeddingCongr e (Equiv.refl β)), ih, card_congr e] · rw [card_pempty, Nat.descFactorial_zero, card_eq_one_iff] exact ⟨Embedding.ofIsEmpty, fun x ↦ DFunLike.ext _ _ isEmptyElim⟩ · classical dsimp only at ih rw [card_option, Nat.descFactorial_succ, card_congr (Embedding.optionEmbeddingEquiv γ β), card_sigma, ← ih] simp only [Fintype.card_compl_set, Fintype.card_range, Finset.sum_const, Finset.card_univ, Nat.nsmul_eq_mul, mul_comm]
13
import Mathlib.Analysis.Complex.Circle import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup #align_import analysis.complex.isometry from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" noncomputable section open Complex open ComplexConjugate local notation "|" x "|" => Complex.abs x def rotation : circle →* ℂ ≃ₗᵢ[ℝ] ℂ where toFun a := { DistribMulAction.toLinearEquiv ℝ ℂ a with norm_map' := fun x => show |a * x| = |x| by rw [map_mul, abs_coe_circle, one_mul] } map_one' := LinearIsometryEquiv.ext <| one_smul circle map_mul' a b := LinearIsometryEquiv.ext <| mul_smul a b #align rotation rotation @[simp] theorem rotation_apply (a : circle) (z : ℂ) : rotation a z = a * z := rfl #align rotation_apply rotation_apply @[simp] theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹ := LinearIsometryEquiv.ext fun _ => rfl #align rotation_symm rotation_symm @[simp] theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by ext1 simp #align rotation_trans rotation_trans theorem rotation_ne_conjLIE (a : circle) : rotation a ≠ conjLIE := by intro h have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1 have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I rw [rotation_apply, RingHom.map_one, mul_one] at h1 rw [rotation_apply, conj_I, ← neg_one_mul, mul_left_inj' I_ne_zero, h1, eq_neg_self_iff] at hI exact one_ne_zero hI #align rotation_ne_conj_lie rotation_ne_conjLIE @[simps] def rotationOf (e : ℂ ≃ₗᵢ[ℝ] ℂ) : circle := ⟨e 1 / Complex.abs (e 1), by simp⟩ #align rotation_of rotationOf @[simp] theorem rotationOf_rotation (a : circle) : rotationOf (rotation a) = a := Subtype.ext <| by simp #align rotation_of_rotation rotationOf_rotation theorem rotation_injective : Function.Injective rotation := Function.LeftInverse.injective rotationOf_rotation #align rotation_injective rotation_injective theorem LinearIsometry.re_apply_eq_re_of_add_conj_eq (f : ℂ →ₗᵢ[ℝ] ℂ) (h₃ : ∀ z, z + conj z = f z + conj (f z)) (z : ℂ) : (f z).re = z.re := by simpa [ext_iff, add_re, add_im, conj_re, conj_im, ← two_mul, show (2 : ℝ) ≠ 0 by simp [two_ne_zero]] using (h₃ z).symm #align linear_isometry.re_apply_eq_re_of_add_conj_eq LinearIsometry.re_apply_eq_re_of_add_conj_eq theorem LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re {f : ℂ →ₗᵢ[ℝ] ℂ} (h₂ : ∀ z, (f z).re = z.re) (z : ℂ) : (f z).im = z.im ∨ (f z).im = -z.im := by have h₁ := f.norm_map z simp only [Complex.abs_def, norm_eq_abs] at h₁ rwa [Real.sqrt_inj (normSq_nonneg _) (normSq_nonneg _), normSq_apply (f z), normSq_apply z, h₂, add_left_cancel_iff, mul_self_eq_mul_self_iff] at h₁ #align linear_isometry.im_apply_eq_im_or_neg_of_re_apply_eq_re LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re theorem LinearIsometry.im_apply_eq_im {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) : z + conj z = f z + conj (f z) := by have : ‖f z - 1‖ = ‖z - 1‖ := by rw [← f.norm_map (z - 1), f.map_sub, h] apply_fun fun x => x ^ 2 at this simp only [norm_eq_abs, ← normSq_eq_abs] at this rw [← ofReal_inj, ← mul_conj, ← mul_conj] at this rw [RingHom.map_sub, RingHom.map_sub] at this simp only [sub_mul, mul_sub, one_mul, mul_one] at this rw [mul_conj, normSq_eq_abs, ← norm_eq_abs, LinearIsometry.norm_map] at this rw [mul_conj, normSq_eq_abs, ← norm_eq_abs] at this simp only [sub_sub, sub_right_inj, mul_one, ofReal_pow, RingHom.map_one, norm_eq_abs] at this simp only [add_sub, sub_left_inj] at this rw [add_comm, ← this, add_comm] #align linear_isometry.im_apply_eq_im LinearIsometry.im_apply_eq_im theorem LinearIsometry.re_apply_eq_re {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) : (f z).re = z.re := by apply LinearIsometry.re_apply_eq_re_of_add_conj_eq intro z apply LinearIsometry.im_apply_eq_im h #align linear_isometry.re_apply_eq_re LinearIsometry.re_apply_eq_re
Mathlib/Analysis/Complex/Isometry.lean
125
139
theorem linear_isometry_complex_aux {f : ℂ ≃ₗᵢ[ℝ] ℂ} (h : f 1 = 1) : f = LinearIsometryEquiv.refl ℝ ℂ ∨ f = conjLIE := by
have h0 : f I = I ∨ f I = -I := by simp only [ext_iff, ← and_or_left, neg_re, I_re, neg_im, neg_zero] constructor · rw [← I_re] exact @LinearIsometry.re_apply_eq_re f.toLinearIsometry h I · apply @LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re f.toLinearIsometry intro z rw [@LinearIsometry.re_apply_eq_re f.toLinearIsometry h] refine h0.imp (fun h' : f I = I => ?_) fun h' : f I = -I => ?_ <;> · apply LinearIsometryEquiv.toLinearEquiv_injective apply Complex.basisOneI.ext' intro i fin_cases i <;> simp [h, h']
13
import Mathlib.Algebra.IsPrimePow import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.Tactic.WLOG #align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ea050b44c0f9aba9d16a948c7cc7d2e7c8493567" namespace Cardinal open Cardinal universe u variable {a b : Cardinal.{u}} {n m : ℕ} @[simp] theorem isUnit_iff : IsUnit a ↔ a = 1 := by refine ⟨fun h => ?_, by rintro rfl exact isUnit_one⟩ rcases eq_or_ne a 0 with (rfl | ha) · exact (not_isUnit_zero h).elim rw [isUnit_iff_forall_dvd] at h cases' h 1 with t ht rw [eq_comm, mul_eq_one_iff'] at ht · exact ht.1 · exact one_le_iff_ne_zero.mpr ha · apply one_le_iff_ne_zero.mpr intro h rw [h, mul_zero] at ht exact zero_ne_one ht #align cardinal.is_unit_iff Cardinal.isUnit_iff instance : Unique Cardinal.{u}ˣ where default := 1 uniq a := Units.val_eq_one.mp <| isUnit_iff.mp a.isUnit theorem le_of_dvd : ∀ {a b : Cardinal}, b ≠ 0 → a ∣ b → a ≤ b | a, x, b0, ⟨b, hab⟩ => by simpa only [hab, mul_one] using mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => b0 (by rwa [h, mul_zero] at hab)) a #align cardinal.le_of_dvd Cardinal.le_of_dvd theorem dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b) : a ∣ b := ⟨b, (mul_eq_right hb h ha).symm⟩ #align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le @[simp]
Mathlib/SetTheory/Cardinal/Divisibility.lean
76
89
theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a := by
refine ⟨(aleph0_pos.trans_le ha).ne', ?_, fun b c hbc => ?_⟩ · rw [isUnit_iff] exact (one_lt_aleph0.trans_le ha).ne' rcases eq_or_ne (b * c) 0 with hz | hz · rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp wlog h : c ≤ b · cases le_total c b <;> [solve_by_elim; rw [or_comm]] apply_assumption assumption' all_goals rwa [mul_comm] left have habc := le_of_dvd hz hbc rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc
13
import Mathlib.Topology.PartialHomeomorph import Mathlib.Topology.SeparatedMap #align_import topology.is_locally_homeomorph from "leanprover-community/mathlib"@"e97cf15cd1aec9bd5c193b2ffac5a6dc9118912b" open Topology variable {X Y Z : Type*} [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] (g : Y → Z) (f : X → Y) (s : Set X) (t : Set Y) def IsLocalHomeomorphOn := ∀ x ∈ s, ∃ e : PartialHomeomorph X Y, x ∈ e.source ∧ f = e #align is_locally_homeomorph_on IsLocalHomeomorphOn
Mathlib/Topology/IsLocalHomeomorph.lean
45
59
theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} : IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f) := by
refine ⟨fun h x hx ↦ ?_, fun h x hx ↦ ?_⟩ · obtain ⟨e, hxe, rfl⟩ := h x hx exact ⟨e.source, e.open_source.mem_nhds hxe, e.openEmbedding_restrict⟩ · obtain ⟨U, hU, emb⟩ := h x hx have : OpenEmbedding ((interior U).restrict f) := by refine emb.comp ⟨embedding_inclusion interior_subset, ?_⟩ rw [Set.range_inclusion]; exact isOpen_induced isOpen_interior obtain ⟨cont, inj, openMap⟩ := openEmbedding_iff_continuous_injective_open.mp this haveI : Nonempty X := ⟨x⟩ exact ⟨PartialHomeomorph.ofContinuousOpenRestrict (Set.injOn_iff_injective.mpr inj).toPartialEquiv (continuousOn_iff_continuous_restrict.mpr cont) openMap isOpen_interior, mem_interior_iff_mem_nhds.mpr hU, rfl⟩
13
import Mathlib.MeasureTheory.PiSystem import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Constructions import Mathlib.MeasureTheory.MeasurableSpace.Basic open Set namespace MeasureTheory variable {ι : Type _} {α : ι → Type _} section squareCylinders def squareCylinders (C : ∀ i, Set (Set (α i))) : Set (Set (∀ i, α i)) := {S | ∃ s : Finset ι, ∃ t ∈ univ.pi C, S = (s : Set ι).pi t} theorem squareCylinders_eq_iUnion_image (C : ∀ i, Set (Set (α i))) : squareCylinders C = ⋃ s : Finset ι, (fun t ↦ (s : Set ι).pi t) '' univ.pi C := by ext1 f simp only [squareCylinders, mem_iUnion, mem_image, mem_univ_pi, exists_prop, mem_setOf_eq, eq_comm (a := f)] theorem isPiSystem_squareCylinders {C : ∀ i, Set (Set (α i))} (hC : ∀ i, IsPiSystem (C i)) (hC_univ : ∀ i, univ ∈ C i) : IsPiSystem (squareCylinders C) := by rintro S₁ ⟨s₁, t₁, h₁, rfl⟩ S₂ ⟨s₂, t₂, h₂, rfl⟩ hst_nonempty classical let t₁' := s₁.piecewise t₁ (fun i ↦ univ) let t₂' := s₂.piecewise t₂ (fun i ↦ univ) have h1 : ∀ i ∈ (s₁ : Set ι), t₁ i = t₁' i := fun i hi ↦ (Finset.piecewise_eq_of_mem _ _ _ hi).symm have h1' : ∀ i ∉ (s₁ : Set ι), t₁' i = univ := fun i hi ↦ Finset.piecewise_eq_of_not_mem _ _ _ hi have h2 : ∀ i ∈ (s₂ : Set ι), t₂ i = t₂' i := fun i hi ↦ (Finset.piecewise_eq_of_mem _ _ _ hi).symm have h2' : ∀ i ∉ (s₂ : Set ι), t₂' i = univ := fun i hi ↦ Finset.piecewise_eq_of_not_mem _ _ _ hi rw [Set.pi_congr rfl h1, Set.pi_congr rfl h2, ← union_pi_inter h1' h2'] refine ⟨s₁ ∪ s₂, fun i ↦ t₁' i ∩ t₂' i, ?_, ?_⟩ · rw [mem_univ_pi] intro i have : (t₁' i ∩ t₂' i).Nonempty := by obtain ⟨f, hf⟩ := hst_nonempty rw [Set.pi_congr rfl h1, Set.pi_congr rfl h2, mem_inter_iff, mem_pi, mem_pi] at hf refine ⟨f i, ⟨?_, ?_⟩⟩ · by_cases hi₁ : i ∈ s₁ · exact hf.1 i hi₁ · rw [h1' i hi₁] exact mem_univ _ · by_cases hi₂ : i ∈ s₂ · exact hf.2 i hi₂ · rw [h2' i hi₂] exact mem_univ _ refine hC i _ ?_ _ ?_ this · by_cases hi₁ : i ∈ s₁ · rw [← h1 i hi₁] exact h₁ i (mem_univ _) · rw [h1' i hi₁] exact hC_univ i · by_cases hi₂ : i ∈ s₂ · rw [← h2 i hi₂] exact h₂ i (mem_univ _) · rw [h2' i hi₂] exact hC_univ i · rw [Finset.coe_union] theorem comap_eval_le_generateFrom_squareCylinders_singleton (α : ι → Type*) [m : ∀ i, MeasurableSpace (α i)] (i : ι) : MeasurableSpace.comap (Function.eval i) (m i) ≤ MeasurableSpace.generateFrom ((fun t ↦ ({i} : Set ι).pi t) '' univ.pi fun i ↦ {s : Set (α i) | MeasurableSet s}) := by simp only [Function.eval, singleton_pi, ge_iff_le] rw [MeasurableSpace.comap_eq_generateFrom] refine MeasurableSpace.generateFrom_mono fun S ↦ ?_ simp only [mem_setOf_eq, mem_image, mem_univ_pi, forall_exists_index, and_imp] intro t ht h classical refine ⟨fun j ↦ if hji : j = i then by convert t else univ, fun j ↦ ?_, ?_⟩ · by_cases hji : j = i · simp only [hji, eq_self_iff_true, eq_mpr_eq_cast, dif_pos] convert ht simp only [id_eq, cast_heq] · simp only [hji, not_false_iff, dif_neg, MeasurableSet.univ] · simp only [id_eq, eq_mpr_eq_cast, ← h] ext1 x simp only [singleton_pi, Function.eval, cast_eq, dite_eq_ite, ite_true, mem_preimage]
Mathlib/MeasureTheory/Constructions/Cylinders.lean
129
144
theorem generateFrom_squareCylinders [∀ i, MeasurableSpace (α i)] : MeasurableSpace.generateFrom (squareCylinders fun i ↦ {s : Set (α i) | MeasurableSet s}) = MeasurableSpace.pi := by
apply le_antisymm · rw [MeasurableSpace.generateFrom_le_iff] rintro S ⟨s, t, h, rfl⟩ simp only [mem_univ_pi, mem_setOf_eq] at h exact MeasurableSet.pi (Finset.countable_toSet _) (fun i _ ↦ h i) · refine iSup_le fun i ↦ ?_ refine (comap_eval_le_generateFrom_squareCylinders_singleton α i).trans ?_ refine MeasurableSpace.generateFrom_mono ?_ rw [← Finset.coe_singleton, squareCylinders_eq_iUnion_image] exact subset_iUnion (fun (s : Finset ι) ↦ (fun t : ∀ i, Set (α i) ↦ (s : Set ι).pi t) '' univ.pi (fun i ↦ setOf MeasurableSet)) ({i} : Finset ι)
13
import Mathlib.GroupTheory.CoprodI import Mathlib.GroupTheory.Coprod.Basic import Mathlib.GroupTheory.QuotientGroup import Mathlib.GroupTheory.Complement namespace Monoid open CoprodI Subgroup Coprod Function List variable {ι : Type*} {G : ι → Type*} {H : Type*} {K : Type*} [Monoid K] def PushoutI.con [∀ i, Monoid (G i)] [Monoid H] (φ : ∀ i, H →* G i) : Con (Coprod (CoprodI G) H) := conGen (fun x y : Coprod (CoprodI G) H => ∃ i x', x = inl (of (φ i x')) ∧ y = inr x') def PushoutI [∀ i, Monoid (G i)] [Monoid H] (φ : ∀ i, H →* G i) : Type _ := (PushoutI.con φ).Quotient namespace PushoutI section Monoid variable [∀ i, Monoid (G i)] [Monoid H] {φ : ∀ i, H →* G i} protected instance mul : Mul (PushoutI φ) := by delta PushoutI; infer_instance protected instance one : One (PushoutI φ) := by delta PushoutI; infer_instance instance monoid : Monoid (PushoutI φ) := { Con.monoid _ with toMul := PushoutI.mul toOne := PushoutI.one } def of (i : ι) : G i →* PushoutI φ := (Con.mk' _).comp <| inl.comp CoprodI.of variable (φ) in def base : H →* PushoutI φ := (Con.mk' _).comp inr theorem of_comp_eq_base (i : ι) : (of i).comp (φ i) = (base φ) := by ext x apply (Con.eq _).2 refine ConGen.Rel.of _ _ ?_ simp only [MonoidHom.comp_apply, Set.mem_iUnion, Set.mem_range] exact ⟨_, _, rfl, rfl⟩ variable (φ) in theorem of_apply_eq_base (i : ι) (x : H) : of i (φ i x) = base φ x := by rw [← MonoidHom.comp_apply, of_comp_eq_base] def lift (f : ∀ i, G i →* K) (k : H →* K) (hf : ∀ i, (f i).comp (φ i) = k) : PushoutI φ →* K := Con.lift _ (Coprod.lift (CoprodI.lift f) k) <| by apply Con.conGen_le fun x y => ?_ rintro ⟨i, x', rfl, rfl⟩ simp only [DFunLike.ext_iff, MonoidHom.coe_comp, comp_apply] at hf simp [hf] @[simp] theorem lift_of (f : ∀ i, G i →* K) (k : H →* K) (hf : ∀ i, (f i).comp (φ i) = k) {i : ι} (g : G i) : (lift f k hf) (of i g : PushoutI φ) = f i g := by delta PushoutI lift of simp only [MonoidHom.coe_comp, Con.coe_mk', comp_apply, Con.lift_coe, lift_apply_inl, CoprodI.lift_of] @[simp] theorem lift_base (f : ∀ i, G i →* K) (k : H →* K) (hf : ∀ i, (f i).comp (φ i) = k) (g : H) : (lift f k hf) (base φ g : PushoutI φ) = k g := by delta PushoutI lift base simp only [MonoidHom.coe_comp, Con.coe_mk', comp_apply, Con.lift_coe, lift_apply_inr] -- `ext` attribute should be lower priority then `hom_ext_nonempty` @[ext 1199] theorem hom_ext {f g : PushoutI φ →* K} (h : ∀ i, f.comp (of i : G i →* _) = g.comp (of i : G i →* _)) (hbase : f.comp (base φ) = g.comp (base φ)) : f = g := (MonoidHom.cancel_right Con.mk'_surjective).mp <| Coprod.hom_ext (CoprodI.ext_hom _ _ h) hbase @[ext high] theorem hom_ext_nonempty [hn : Nonempty ι] {f g : PushoutI φ →* K} (h : ∀ i, f.comp (of i : G i →* _) = g.comp (of i : G i →* _)) : f = g := hom_ext h <| by cases hn with | intro i => ext rw [← of_comp_eq_base i, ← MonoidHom.comp_assoc, h, MonoidHom.comp_assoc] @[simps] def homEquiv : (PushoutI φ →* K) ≃ { f : (Π i, G i →* K) × (H →* K) // ∀ i, (f.1 i).comp (φ i) = f.2 } := { toFun := fun f => ⟨(fun i => f.comp (of i), f.comp (base φ)), fun i => by rw [MonoidHom.comp_assoc, of_comp_eq_base]⟩ invFun := fun f => lift f.1.1 f.1.2 f.2, left_inv := fun _ => hom_ext (by simp [DFunLike.ext_iff]) (by simp [DFunLike.ext_iff]) right_inv := fun ⟨⟨_, _⟩, _⟩ => by simp [DFunLike.ext_iff, Function.funext_iff] } def ofCoprodI : CoprodI G →* PushoutI φ := CoprodI.lift of @[simp] theorem ofCoprodI_of (i : ι) (g : G i) : (ofCoprodI (CoprodI.of g) : PushoutI φ) = of i g := by simp [ofCoprodI]
Mathlib/GroupTheory/PushoutI.lean
167
184
theorem induction_on {motive : PushoutI φ → Prop} (x : PushoutI φ) (of : ∀ (i : ι) (g : G i), motive (of i g)) (base : ∀ h, motive (base φ h)) (mul : ∀ x y, motive x → motive y → motive (x * y)) : motive x := by
delta PushoutI PushoutI.of PushoutI.base at * induction x using Con.induction_on with | H x => induction x using Coprod.induction_on with | inl g => induction g using CoprodI.induction_on with | h_of i g => exact of i g | h_mul x y ihx ihy => rw [map_mul] exact mul _ _ ihx ihy | h_one => simpa using base 1 | inr h => exact base h | mul x y ihx ihy => exact mul _ _ ihx ihy
13
import Mathlib.Data.Set.Finite import Mathlib.GroupTheory.GroupAction.FixedPoints import Mathlib.GroupTheory.Perm.Support open Equiv List MulAction Pointwise Set Subgroup variable {G α : Type*} [Group G] [MulAction G α] [DecidableEq α] theorem finite_compl_fixedBy_closure_iff {S : Set G} : (∀ g ∈ closure S, (fixedBy α g)ᶜ.Finite) ↔ ∀ g ∈ S, (fixedBy α g)ᶜ.Finite := ⟨fun h g hg ↦ h g (subset_closure hg), fun h g hg ↦ by refine closure_induction hg h (by simp) (fun g g' hg hg' ↦ (hg.union hg').subset ?_) (by simp) simp_rw [← compl_inter, compl_subset_compl, fixedBy_mul]⟩ theorem finite_compl_fixedBy_swap {x y : α} : (fixedBy α (swap x y))ᶜ.Finite := Set.Finite.subset (s := {x, y}) (by simp) (compl_subset_comm.mp fun z h ↦ by apply swap_apply_of_ne_of_ne <;> rintro rfl <;> simp at h) theorem Equiv.Perm.IsSwap.finite_compl_fixedBy {σ : Perm α} (h : σ.IsSwap) : (fixedBy α σ)ᶜ.Finite := by obtain ⟨x, y, -, rfl⟩ := h exact finite_compl_fixedBy_swap -- this result cannot be moved to Perm/Basic since Perm/Basic is not allowed to import Submonoid theorem SubmonoidClass.swap_mem_trans {a b c : α} {C} [SetLike C (Perm α)] [SubmonoidClass C (Perm α)] (M : C) (hab : swap a b ∈ M) (hbc : swap b c ∈ M) : swap a c ∈ M := by obtain rfl | hab' := eq_or_ne a b · exact hbc obtain rfl | hac := eq_or_ne a c · exact swap_self a ▸ one_mem M rw [swap_comm, ← swap_mul_swap_mul_swap hab' hac] exact mul_mem (mul_mem hbc hab) hbc theorem exists_smul_not_mem_of_subset_orbit_closure (S : Set G) (T : Set α) {a : α} (hS : ∀ g ∈ S, g⁻¹ ∈ S) (subset : T ⊆ orbit (closure S) a) (not_mem : a ∉ T) (nonempty : T.Nonempty) : ∃ σ ∈ S, ∃ a ∈ T, σ • a ∉ T := by have key0 : ¬ closure S ≤ stabilizer G T := by have ⟨b, hb⟩ := nonempty obtain ⟨σ, rfl⟩ := subset hb contrapose! not_mem with h exact smul_mem_smul_set_iff.mp ((h σ.2).symm ▸ hb) contrapose! key0 refine (closure_le _).mpr fun σ hσ ↦ ?_ simp_rw [SetLike.mem_coe, mem_stabilizer_iff, Set.ext_iff, mem_smul_set_iff_inv_smul_mem] exact fun a ↦ ⟨fun h ↦ smul_inv_smul σ a ▸ key0 σ hσ (σ⁻¹ • a) h, key0 σ⁻¹ (hS σ hσ) a⟩
Mathlib/GroupTheory/Perm/ClosureSwap.lean
74
88
theorem swap_mem_closure_isSwap {S : Set (Perm α)} (hS : ∀ f ∈ S, f.IsSwap) {x y : α} : swap x y ∈ closure S ↔ x ∈ orbit (closure S) y := by
refine ⟨fun h ↦ ⟨⟨swap x y, h⟩, swap_apply_right x y⟩, fun hf ↦ ?_⟩ by_contra h have := exists_smul_not_mem_of_subset_orbit_closure S {x | swap x y ∈ closure S} (fun f hf ↦ ?_) (fun z hz ↦ ?_) h ⟨y, ?_⟩ · obtain ⟨σ, hσ, a, ha, hσa⟩ := this obtain ⟨z, w, hzw, rfl⟩ := hS σ hσ have := ne_of_mem_of_not_mem ha hσa rw [Perm.smul_def, ne_comm, swap_apply_ne_self_iff, and_iff_right hzw] at this refine hσa (SubmonoidClass.swap_mem_trans (closure S) ?_ ha) obtain rfl | rfl := this <;> simpa [swap_comm] using subset_closure hσ · obtain ⟨x, y, -, rfl⟩ := hS f hf; rwa [swap_inv] · exact orbit_eq_iff.mpr hf ▸ ⟨⟨swap z y, hz⟩, swap_apply_right z y⟩ · rw [mem_setOf, swap_self]; apply one_mem
13
import Mathlib.Analysis.NormedSpace.Star.Basic import Mathlib.Analysis.NormedSpace.Spectrum import Mathlib.Analysis.SpecialFunctions.Exponential import Mathlib.Algebra.Star.StarAlgHom #align_import analysis.normed_space.star.spectrum from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" local postfix:max "⋆" => star section open scoped Topology ENNReal open Filter ENNReal spectrum CstarRing NormedSpace section ComplexScalars open Complex variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] [CompleteSpace A] [StarRing A] [CstarRing A] local notation "↑ₐ" => algebraMap ℂ A theorem IsSelfAdjoint.spectralRadius_eq_nnnorm {a : A} (ha : IsSelfAdjoint a) : spectralRadius ℂ a = ‖a‖₊ := by have hconst : Tendsto (fun _n : ℕ => (‖a‖₊ : ℝ≥0∞)) atTop _ := tendsto_const_nhds refine tendsto_nhds_unique ?_ hconst convert (spectrum.pow_nnnorm_pow_one_div_tendsto_nhds_spectralRadius (a : A)).comp (Nat.tendsto_pow_atTop_atTop_of_one_lt one_lt_two) using 1 refine funext fun n => ?_ rw [Function.comp_apply, ha.nnnorm_pow_two_pow, ENNReal.coe_pow, ← rpow_natCast, ← rpow_mul] simp #align is_self_adjoint.spectral_radius_eq_nnnorm IsSelfAdjoint.spectralRadius_eq_nnnorm
Mathlib/Analysis/NormedSpace/Star/Spectrum.lean
72
86
theorem IsStarNormal.spectralRadius_eq_nnnorm (a : A) [IsStarNormal a] : spectralRadius ℂ a = ‖a‖₊ := by
refine (ENNReal.pow_strictMono two_ne_zero).injective ?_ have heq : (fun n : ℕ => (‖(a⋆ * a) ^ n‖₊ : ℝ≥0∞) ^ (1 / n : ℝ)) = (fun x => x ^ 2) ∘ fun n : ℕ => (‖a ^ n‖₊ : ℝ≥0∞) ^ (1 / n : ℝ) := by funext n rw [Function.comp_apply, ← rpow_natCast, ← rpow_mul, mul_comm, rpow_mul, rpow_natCast, ← coe_pow, sq, ← nnnorm_star_mul_self, Commute.mul_pow (star_comm_self' a), star_pow] have h₂ := ((ENNReal.continuous_pow 2).tendsto (spectralRadius ℂ a)).comp (spectrum.pow_nnnorm_pow_one_div_tendsto_nhds_spectralRadius a) rw [← heq] at h₂ convert tendsto_nhds_unique h₂ (pow_nnnorm_pow_one_div_tendsto_nhds_spectralRadius (a⋆ * a)) rw [(IsSelfAdjoint.star_mul_self a).spectralRadius_eq_nnnorm, sq, nnnorm_star_mul_self, coe_mul]
13
import Mathlib.Data.List.Join #align_import data.list.permutation from "leanprover-community/mathlib"@"dd71334db81d0bd444af1ee339a29298bef40734" -- Make sure we don't import algebra assert_not_exists Monoid open Nat variable {α β : Type*} namespace List theorem permutationsAux2_fst (t : α) (ts : List α) (r : List β) : ∀ (ys : List α) (f : List α → β), (permutationsAux2 t ts r ys f).1 = ys ++ ts | [], f => rfl | y :: ys, f => by simp [permutationsAux2, permutationsAux2_fst t _ _ ys] #align list.permutations_aux2_fst List.permutationsAux2_fst @[simp] theorem permutationsAux2_snd_nil (t : α) (ts : List α) (r : List β) (f : List α → β) : (permutationsAux2 t ts r [] f).2 = r := rfl #align list.permutations_aux2_snd_nil List.permutationsAux2_snd_nil @[simp] theorem permutationsAux2_snd_cons (t : α) (ts : List α) (r : List β) (y : α) (ys : List α) (f : List α → β) : (permutationsAux2 t ts r (y :: ys) f).2 = f (t :: y :: ys ++ ts) :: (permutationsAux2 t ts r ys fun x : List α => f (y :: x)).2 := by simp [permutationsAux2, permutationsAux2_fst t _ _ ys] #align list.permutations_aux2_snd_cons List.permutationsAux2_snd_cons theorem permutationsAux2_append (t : α) (ts : List α) (r : List β) (ys : List α) (f : List α → β) : (permutationsAux2 t ts nil ys f).2 ++ r = (permutationsAux2 t ts r ys f).2 := by induction ys generalizing f <;> simp [*] #align list.permutations_aux2_append List.permutationsAux2_append theorem permutationsAux2_comp_append {t : α} {ts ys : List α} {r : List β} (f : List α → β) : ((permutationsAux2 t [] r ys) fun x => f (x ++ ts)).2 = (permutationsAux2 t ts r ys f).2 := by induction' ys with ys_hd _ ys_ih generalizing f · simp · simp [ys_ih fun xs => f (ys_hd :: xs)] #align list.permutations_aux2_comp_append List.permutationsAux2_comp_append theorem map_permutationsAux2' {α' β'} (g : α → α') (g' : β → β') (t : α) (ts ys : List α) (r : List β) (f : List α → β) (f' : List α' → β') (H : ∀ a, g' (f a) = f' (map g a)) : map g' (permutationsAux2 t ts r ys f).2 = (permutationsAux2 (g t) (map g ts) (map g' r) (map g ys) f').2 := by induction' ys with ys_hd _ ys_ih generalizing f f' · simp · simp only [map, permutationsAux2_snd_cons, cons_append, cons.injEq] rw [ys_ih, permutationsAux2_fst] · refine ⟨?_, rfl⟩ simp only [← map_cons, ← map_append]; apply H · intro a; apply H #align list.map_permutations_aux2' List.map_permutationsAux2' theorem map_permutationsAux2 (t : α) (ts : List α) (ys : List α) (f : List α → β) : (permutationsAux2 t ts [] ys id).2.map f = (permutationsAux2 t ts [] ys f).2 := by rw [map_permutationsAux2' id, map_id, map_id] · rfl simp #align list.map_permutations_aux2 List.map_permutationsAux2 theorem permutationsAux2_snd_eq (t : α) (ts : List α) (r : List β) (ys : List α) (f : List α → β) : (permutationsAux2 t ts r ys f).2 = ((permutationsAux2 t [] [] ys id).2.map fun x => f (x ++ ts)) ++ r := by rw [← permutationsAux2_append, map_permutationsAux2, permutationsAux2_comp_append] #align list.permutations_aux2_snd_eq List.permutationsAux2_snd_eq theorem map_map_permutationsAux2 {α'} (g : α → α') (t : α) (ts ys : List α) : map (map g) (permutationsAux2 t ts [] ys id).2 = (permutationsAux2 (g t) (map g ts) [] (map g ys) id).2 := map_permutationsAux2' _ _ _ _ _ _ _ _ fun _ => rfl #align list.map_map_permutations_aux2 List.map_map_permutationsAux2 theorem map_map_permutations'Aux (f : α → β) (t : α) (ts : List α) : map (map f) (permutations'Aux t ts) = permutations'Aux (f t) (map f ts) := by induction' ts with a ts ih · rfl · simp only [permutations'Aux, map_cons, map_map, ← ih, cons.injEq, true_and, Function.comp_def] #align list.map_map_permutations'_aux List.map_map_permutations'Aux theorem permutations'Aux_eq_permutationsAux2 (t : α) (ts : List α) : permutations'Aux t ts = (permutationsAux2 t [] [ts ++ [t]] ts id).2 := by induction' ts with a ts ih; · rfl simp only [permutations'Aux, ih, cons_append, permutationsAux2_snd_cons, append_nil, id_eq, cons.injEq, true_and] simp (config := { singlePass := true }) only [← permutationsAux2_append] simp [map_permutationsAux2] #align list.permutations'_aux_eq_permutations_aux2 List.permutations'Aux_eq_permutationsAux2
Mathlib/Data/List/Permutation.lean
149
164
theorem mem_permutationsAux2 {t : α} {ts : List α} {ys : List α} {l l' : List α} : l' ∈ (permutationsAux2 t ts [] ys (l ++ ·)).2 ↔ ∃ l₁ l₂, l₂ ≠ [] ∧ ys = l₁ ++ l₂ ∧ l' = l ++ l₁ ++ t :: l₂ ++ ts := by
induction' ys with y ys ih generalizing l · simp (config := { contextual := true }) rw [permutationsAux2_snd_cons, show (fun x : List α => l ++ y :: x) = (l ++ [y] ++ ·) by funext _; simp, mem_cons, ih] constructor · rintro (rfl | ⟨l₁, l₂, l0, rfl, rfl⟩) · exact ⟨[], y :: ys, by simp⟩ · exact ⟨y :: l₁, l₂, l0, by simp⟩ · rintro ⟨_ | ⟨y', l₁⟩, l₂, l0, ye, rfl⟩ · simp [ye] · simp only [cons_append] at ye rcases ye with ⟨rfl, rfl⟩ exact Or.inr ⟨l₁, l₂, l0, by simp⟩
13
import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] def slope (f : k → PE) (a b : k) : E := (b - a)⁻¹ • (f b -ᵥ f a) #align slope slope theorem slope_fun_def (f : k → PE) : slope f = fun a b => (b - a)⁻¹ • (f b -ᵥ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k → k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k → k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k → PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k → E) (a b : k) : slope f a b = (b - a)⁻¹ • (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k → PE) (a b : k) : (b - a) • slope f a b = f b -ᵥ f a := by rcases eq_or_ne a b with (rfl | hne) · rw [sub_self, zero_smul, vsub_self] · rw [slope, smul_inv_smul₀ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k → PE) (a b : k) : (b - a) • slope f a b +ᵥ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k → E) (c : PE) : (slope fun x => f x +ᵥ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k → E) {a b : k} (h : a ≠ b) : slope (fun x => (x - a) • f x) a b = f b := by simp [slope, inv_smul_smul₀ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k → PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᵃ[k] PF) (g : k → PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (· ∘ ·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E →ₗ[k] F) (g : k → E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k → PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm @[simp] lemma slope_neg (f : k → E) (x y : k) : slope (fun t ↦ -f t) x y = -slope f x y := by simp only [slope_def_module, neg_sub_neg, ← smul_neg, neg_sub]
Mathlib/LinearAlgebra/AffineSpace/Slope.lean
102
116
theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k → PE) (a b c : k) : ((b - a) / (c - a)) • slope f a b + ((c - b) / (c - a)) • slope f b c = slope f a c := by
by_cases hab : a = b · subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c · simp [hac] · rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; · subst hbc simp [sub_ne_zero.2 (Ne.symm hab)] rw [add_comm] simp_rw [slope, div_eq_inv_mul, mul_smul, ← smul_add, smul_inv_smul₀ (sub_ne_zero.2 <| Ne.symm hab), smul_inv_smul₀ (sub_ne_zero.2 <| Ne.symm hbc), vsub_add_vsub_cancel]
13
import Mathlib.Analysis.Seminorm import Mathlib.Topology.Algebra.Equicontinuity import Mathlib.Topology.MetricSpace.Equicontinuity import Mathlib.Topology.Algebra.FilterBasis import Mathlib.Topology.Algebra.Module.LocallyConvex #align_import analysis.locally_convex.with_seminorms from "leanprover-community/mathlib"@"b31173ee05c911d61ad6a05bd2196835c932e0ec" open NormedField Set Seminorm TopologicalSpace Filter List open NNReal Pointwise Topology Uniformity variable {𝕜 𝕜₂ 𝕝 𝕝₂ E F G ι ι' : Type*} section FilterBasis variable [NormedField 𝕜] [AddCommGroup E] [Module 𝕜 E] variable (𝕜 E ι) abbrev SeminormFamily := ι → Seminorm 𝕜 E #align seminorm_family SeminormFamily variable {𝕜 E ι} section Bounded namespace Seminorm variable [NormedField 𝕜] [AddCommGroup E] [Module 𝕜 E] variable [NormedField 𝕜₂] [AddCommGroup F] [Module 𝕜₂ F] variable {σ₁₂ : 𝕜 →+* 𝕜₂} [RingHomIsometric σ₁₂] -- Todo: This should be phrased entirely in terms of the von Neumann bornology. def IsBounded (p : ι → Seminorm 𝕜 E) (q : ι' → Seminorm 𝕜₂ F) (f : E →ₛₗ[σ₁₂] F) : Prop := ∀ i, ∃ s : Finset ι, ∃ C : ℝ≥0, (q i).comp f ≤ C • s.sup p #align seminorm.is_bounded Seminorm.IsBounded theorem isBounded_const (ι' : Type*) [Nonempty ι'] {p : ι → Seminorm 𝕜 E} {q : Seminorm 𝕜₂ F} (f : E →ₛₗ[σ₁₂] F) : IsBounded p (fun _ : ι' => q) f ↔ ∃ (s : Finset ι) (C : ℝ≥0), q.comp f ≤ C • s.sup p := by simp only [IsBounded, forall_const] #align seminorm.is_bounded_const Seminorm.isBounded_const theorem const_isBounded (ι : Type*) [Nonempty ι] {p : Seminorm 𝕜 E} {q : ι' → Seminorm 𝕜₂ F} (f : E →ₛₗ[σ₁₂] F) : IsBounded (fun _ : ι => p) q f ↔ ∀ i, ∃ C : ℝ≥0, (q i).comp f ≤ C • p := by constructor <;> intro h i · rcases h i with ⟨s, C, h⟩ exact ⟨C, le_trans h (smul_le_smul (Finset.sup_le fun _ _ => le_rfl) le_rfl)⟩ use {Classical.arbitrary ι} simp only [h, Finset.sup_singleton] #align seminorm.const_is_bounded Seminorm.const_isBounded
Mathlib/Analysis/LocallyConvex/WithSeminorms.lean
241
256
theorem isBounded_sup {p : ι → Seminorm 𝕜 E} {q : ι' → Seminorm 𝕜₂ F} {f : E →ₛₗ[σ₁₂] F} (hf : IsBounded p q f) (s' : Finset ι') : ∃ (C : ℝ≥0) (s : Finset ι), (s'.sup q).comp f ≤ C • s.sup p := by
classical obtain rfl | _ := s'.eq_empty_or_nonempty · exact ⟨1, ∅, by simp [Seminorm.bot_eq_zero]⟩ choose fₛ fC hf using hf use s'.card • s'.sup fC, Finset.biUnion s' fₛ have hs : ∀ i : ι', i ∈ s' → (q i).comp f ≤ s'.sup fC • (Finset.biUnion s' fₛ).sup p := by intro i hi refine (hf i).trans (smul_le_smul ?_ (Finset.le_sup hi)) exact Finset.sup_mono (Finset.subset_biUnion_of_mem fₛ hi) refine (comp_mono f (finset_sup_le_sum q s')).trans ?_ simp_rw [← pullback_apply, map_sum, pullback_apply] refine (Finset.sum_le_sum hs).trans ?_ rw [Finset.sum_const, smul_assoc]
13
import Mathlib.Data.Stream.Init import Mathlib.Tactic.ApplyFun import Mathlib.Control.Fix import Mathlib.Order.OmegaCompletePartialOrder #align_import control.lawful_fix from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v open scoped Classical variable {α : Type*} {β : α → Type*} open OmegaCompletePartialOrder class LawfulFix (α : Type*) [OmegaCompletePartialOrder α] extends Fix α where fix_eq : ∀ {f : α →o α}, Continuous f → Fix.fix f = f (Fix.fix f) #align lawful_fix LawfulFix theorem LawfulFix.fix_eq' {α} [OmegaCompletePartialOrder α] [LawfulFix α] {f : α → α} (hf : Continuous' f) : Fix.fix f = f (Fix.fix f) := LawfulFix.fix_eq (hf.to_bundled _) #align lawful_fix.fix_eq' LawfulFix.fix_eq' namespace Part open Part Nat Nat.Upto namespace Fix variable (f : ((a : _) → Part <| β a) →o (a : _) → Part <| β a) theorem approx_mono' {i : ℕ} : Fix.approx f i ≤ Fix.approx f (succ i) := by induction i with | zero => dsimp [approx]; apply @bot_le _ _ _ (f ⊥) | succ _ i_ih => intro; apply f.monotone; apply i_ih #align part.fix.approx_mono' Part.Fix.approx_mono' theorem approx_mono ⦃i j : ℕ⦄ (hij : i ≤ j) : approx f i ≤ approx f j := by induction' j with j ih · cases hij exact le_rfl cases hij; · exact le_rfl exact le_trans (ih ‹_›) (approx_mono' f) #align part.fix.approx_mono Part.Fix.approx_mono theorem mem_iff (a : α) (b : β a) : b ∈ Part.fix f a ↔ ∃ i, b ∈ approx f i a := by by_cases h₀ : ∃ i : ℕ, (approx f i a).Dom · simp only [Part.fix_def f h₀] constructor <;> intro hh · exact ⟨_, hh⟩ have h₁ := Nat.find_spec h₀ rw [dom_iff_mem] at h₁ cases' h₁ with y h₁ replace h₁ := approx_mono' f _ _ h₁ suffices y = b by subst this exact h₁ cases' hh with i hh revert h₁; generalize succ (Nat.find h₀) = j; intro h₁ wlog case : i ≤ j · rcases le_total i j with H | H <;> [skip; symm] <;> apply_assumption <;> assumption replace hh := approx_mono f case _ _ hh apply Part.mem_unique h₁ hh · simp only [fix_def' (⇑f) h₀, not_exists, false_iff_iff, not_mem_none] simp only [dom_iff_mem, not_exists] at h₀ intro; apply h₀ #align part.fix.mem_iff Part.Fix.mem_iff theorem approx_le_fix (i : ℕ) : approx f i ≤ Part.fix f := fun a b hh ↦ by rw [mem_iff f] exact ⟨_, hh⟩ #align part.fix.approx_le_fix Part.Fix.approx_le_fix
Mathlib/Control/LawfulFix.lean
99
112
theorem exists_fix_le_approx (x : α) : ∃ i, Part.fix f x ≤ approx f i x := by
by_cases hh : ∃ i b, b ∈ approx f i x · rcases hh with ⟨i, b, hb⟩ exists i intro b' h' have hb' := approx_le_fix f i _ _ hb obtain rfl := Part.mem_unique h' hb' exact hb · simp only [not_exists] at hh exists 0 intro b' h' simp only [mem_iff f] at h' cases' h' with i h' cases hh _ _ h'
13
import Mathlib.MeasureTheory.Function.Jacobian import Mathlib.MeasureTheory.Measure.Lebesgue.Complex import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv #align_import analysis.special_functions.polar_coord from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92" noncomputable section Real open Real Set MeasureTheory open scoped Real Topology @[simps] def polarCoord : PartialHomeomorph (ℝ × ℝ) (ℝ × ℝ) where toFun q := (√(q.1 ^ 2 + q.2 ^ 2), Complex.arg (Complex.equivRealProd.symm q)) invFun p := (p.1 * cos p.2, p.1 * sin p.2) source := {q | 0 < q.1} ∪ {q | q.2 ≠ 0} target := Ioi (0 : ℝ) ×ˢ Ioo (-π) π map_target' := by rintro ⟨r, θ⟩ ⟨hr, hθ⟩ dsimp at hr hθ rcases eq_or_ne θ 0 with (rfl | h'θ) · simpa using hr · right simp at hr simpa only [ne_of_gt hr, Ne, mem_setOf_eq, mul_eq_zero, false_or_iff, sin_eq_zero_iff_of_lt_of_lt hθ.1 hθ.2] using h'θ map_source' := by rintro ⟨x, y⟩ hxy simp only [prod_mk_mem_set_prod_eq, mem_Ioi, sqrt_pos, mem_Ioo, Complex.neg_pi_lt_arg, true_and_iff, Complex.arg_lt_pi_iff] constructor · cases' hxy with hxy hxy · dsimp at hxy; linarith [sq_pos_of_ne_zero hxy.ne', sq_nonneg y] · linarith [sq_nonneg x, sq_pos_of_ne_zero hxy] · cases' hxy with hxy hxy · exact Or.inl (le_of_lt hxy) · exact Or.inr hxy right_inv' := by rintro ⟨r, θ⟩ ⟨hr, hθ⟩ dsimp at hr hθ simp only [Prod.mk.inj_iff] constructor · conv_rhs => rw [← sqrt_sq (le_of_lt hr), ← one_mul (r ^ 2), ← sin_sq_add_cos_sq θ] congr 1 ring · convert Complex.arg_mul_cos_add_sin_mul_I hr ⟨hθ.1, hθ.2.le⟩ simp only [Complex.equivRealProd_symm_apply, Complex.ofReal_mul, Complex.ofReal_cos, Complex.ofReal_sin] ring left_inv' := by rintro ⟨x, y⟩ _ have A : √(x ^ 2 + y ^ 2) = Complex.abs (x + y * Complex.I) := by rw [Complex.abs_apply, Complex.normSq_add_mul_I] have Z := Complex.abs_mul_cos_add_sin_mul_I (x + y * Complex.I) simp only [← Complex.ofReal_cos, ← Complex.ofReal_sin, mul_add, ← Complex.ofReal_mul, ← mul_assoc] at Z simp [A] open_target := isOpen_Ioi.prod isOpen_Ioo open_source := (isOpen_lt continuous_const continuous_fst).union (isOpen_ne_fun continuous_snd continuous_const) continuousOn_invFun := ((continuous_fst.mul (continuous_cos.comp continuous_snd)).prod_mk (continuous_fst.mul (continuous_sin.comp continuous_snd))).continuousOn continuousOn_toFun := by apply ((continuous_fst.pow 2).add (continuous_snd.pow 2)).sqrt.continuousOn.prod have A : MapsTo Complex.equivRealProd.symm ({q : ℝ × ℝ | 0 < q.1} ∪ {q : ℝ × ℝ | q.2 ≠ 0}) Complex.slitPlane := by rintro ⟨x, y⟩ hxy; simpa only using hxy refine ContinuousOn.comp (f := Complex.equivRealProd.symm) (g := Complex.arg) (fun z hz => ?_) ?_ A · exact (Complex.continuousAt_arg hz).continuousWithinAt · exact Complex.equivRealProdCLM.symm.continuous.continuousOn #align polar_coord polarCoord theorem hasFDerivAt_polarCoord_symm (p : ℝ × ℝ) : HasFDerivAt polarCoord.symm (LinearMap.toContinuousLinearMap (Matrix.toLin (Basis.finTwoProd ℝ) (Basis.finTwoProd ℝ) !![cos p.2, -p.1 * sin p.2; sin p.2, p.1 * cos p.2])) p := by rw [Matrix.toLin_finTwoProd_toContinuousLinearMap] convert HasFDerivAt.prod (𝕜 := ℝ) (hasFDerivAt_fst.mul ((hasDerivAt_cos p.2).comp_hasFDerivAt p hasFDerivAt_snd)) (hasFDerivAt_fst.mul ((hasDerivAt_sin p.2).comp_hasFDerivAt p hasFDerivAt_snd)) using 2 <;> simp [smul_smul, add_comm, neg_mul, smul_neg, neg_smul _ (ContinuousLinearMap.snd ℝ ℝ ℝ)] #align has_fderiv_at_polar_coord_symm hasFDerivAt_polarCoord_symm -- Porting note: this instance is needed but not automatically synthesised instance : Measure.IsAddHaarMeasure volume (G := ℝ × ℝ) := Measure.prod.instIsAddHaarMeasure _ _
Mathlib/Analysis/SpecialFunctions/PolarCoord.lean
110
123
theorem polarCoord_source_ae_eq_univ : polarCoord.source =ᵐ[volume] univ := by
have A : polarCoord.sourceᶜ ⊆ LinearMap.ker (LinearMap.snd ℝ ℝ ℝ) := by intro x hx simp only [polarCoord_source, compl_union, mem_inter_iff, mem_compl_iff, mem_setOf_eq, not_lt, Classical.not_not] at hx exact hx.2 have B : volume (LinearMap.ker (LinearMap.snd ℝ ℝ ℝ) : Set (ℝ × ℝ)) = 0 := by apply Measure.addHaar_submodule rw [Ne, LinearMap.ker_eq_top] intro h have : (LinearMap.snd ℝ ℝ ℝ) (0, 1) = (0 : ℝ × ℝ →ₗ[ℝ] ℝ) (0, 1) := by rw [h] simp at this simp only [ae_eq_univ] exact le_antisymm ((measure_mono A).trans (le_of_eq B)) bot_le
13
import Mathlib.Data.List.Lex import Mathlib.Data.Char import Mathlib.Tactic.AdaptationNote import Mathlib.Algebra.Order.Group.Nat #align_import data.string.basic from "leanprover-community/mathlib"@"d13b3a4a392ea7273dfa4727dbd1892e26cfd518" namespace String def ltb (s₁ s₂ : Iterator) : Bool := if s₂.hasNext then if s₁.hasNext then if s₁.curr = s₂.curr then ltb s₁.next s₂.next else s₁.curr < s₂.curr else true else false #align string.ltb String.ltb instance LT' : LT String := ⟨fun s₁ s₂ ↦ ltb s₁.iter s₂.iter⟩ #align string.has_lt' String.LT' instance decidableLT : @DecidableRel String (· < ·) := by simp only [LT'] infer_instance -- short-circuit type class inference #align string.decidable_lt String.decidableLT def ltb.inductionOn.{u} {motive : Iterator → Iterator → Sort u} (it₁ it₂ : Iterator) (ind : ∀ s₁ s₂ i₁ i₂, Iterator.hasNext ⟨s₂, i₂⟩ → Iterator.hasNext ⟨s₁, i₁⟩ → get s₁ i₁ = get s₂ i₂ → motive (Iterator.next ⟨s₁, i₁⟩) (Iterator.next ⟨s₂, i₂⟩) → motive ⟨s₁, i₁⟩ ⟨s₂, i₂⟩) (eq : ∀ s₁ s₂ i₁ i₂, Iterator.hasNext ⟨s₂, i₂⟩ → Iterator.hasNext ⟨s₁, i₁⟩ → ¬ get s₁ i₁ = get s₂ i₂ → motive ⟨s₁, i₁⟩ ⟨s₂, i₂⟩) (base₁ : ∀ s₁ s₂ i₁ i₂, Iterator.hasNext ⟨s₂, i₂⟩ → ¬ Iterator.hasNext ⟨s₁, i₁⟩ → motive ⟨s₁, i₁⟩ ⟨s₂, i₂⟩) (base₂ : ∀ s₁ s₂ i₁ i₂, ¬ Iterator.hasNext ⟨s₂, i₂⟩ → motive ⟨s₁, i₁⟩ ⟨s₂, i₂⟩) : motive it₁ it₂ := if h₂ : it₂.hasNext then if h₁ : it₁.hasNext then if heq : it₁.curr = it₂.curr then ind it₁.s it₂.s it₁.i it₂.i h₂ h₁ heq (inductionOn it₁.next it₂.next ind eq base₁ base₂) else eq it₁.s it₂.s it₁.i it₂.i h₂ h₁ heq else base₁ it₁.s it₂.s it₁.i it₂.i h₂ h₁ else base₂ it₁.s it₂.s it₁.i it₂.i h₂
Mathlib/Data/String/Basic.lean
60
74
theorem ltb_cons_addChar (c : Char) (cs₁ cs₂ : List Char) (i₁ i₂ : Pos) : ltb ⟨⟨c :: cs₁⟩, i₁ + c⟩ ⟨⟨c :: cs₂⟩, i₂ + c⟩ = ltb ⟨⟨cs₁⟩, i₁⟩ ⟨⟨cs₂⟩, i₂⟩ := by
apply ltb.inductionOn ⟨⟨cs₁⟩, i₁⟩ ⟨⟨cs₂⟩, i₂⟩ (motive := fun ⟨⟨cs₁⟩, i₁⟩ ⟨⟨cs₂⟩, i₂⟩ ↦ ltb ⟨⟨c :: cs₁⟩, i₁ + c⟩ ⟨⟨c :: cs₂⟩, i₂ + c⟩ = ltb ⟨⟨cs₁⟩, i₁⟩ ⟨⟨cs₂⟩, i₂⟩) <;> simp only <;> intro ⟨cs₁⟩ ⟨cs₂⟩ i₁ i₂ <;> intros <;> (conv => lhs; unfold ltb) <;> (conv => rhs; unfold ltb) <;> simp only [Iterator.hasNext_cons_addChar, ite_false, ite_true, *] · rename_i h₂ h₁ heq ih simp only [Iterator.next, next, heq, Iterator.curr, get_cons_addChar, ite_true] at ih ⊢ repeat rw [Pos.addChar_right_comm _ c] exact ih · rename_i h₂ h₁ hne simp [Iterator.curr, get_cons_addChar, hne]
13
import Mathlib.Probability.Martingale.Convergence import Mathlib.Probability.Martingale.OptionalStopping import Mathlib.Probability.Martingale.Centering #align_import probability.martingale.borel_cantelli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" open Filter open scoped NNReal ENNReal MeasureTheory ProbabilityTheory BigOperators Topology namespace MeasureTheory variable {Ω : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} {ℱ : Filtration ℕ m0} {f : ℕ → Ω → ℝ} {ω : Ω} -- TODO: `leastGE` should be defined taking values in `WithTop ℕ` once the `stoppedProcess` -- refactor is complete noncomputable def leastGE (f : ℕ → Ω → ℝ) (r : ℝ) (n : ℕ) := hitting f (Set.Ici r) 0 n #align measure_theory.least_ge MeasureTheory.leastGE theorem Adapted.isStoppingTime_leastGE (r : ℝ) (n : ℕ) (hf : Adapted ℱ f) : IsStoppingTime ℱ (leastGE f r n) := hitting_isStoppingTime hf measurableSet_Ici #align measure_theory.adapted.is_stopping_time_least_ge MeasureTheory.Adapted.isStoppingTime_leastGE theorem leastGE_le {i : ℕ} {r : ℝ} (ω : Ω) : leastGE f r i ω ≤ i := hitting_le ω #align measure_theory.least_ge_le MeasureTheory.leastGE_le -- The following four lemmas shows `leastGE` behaves like a stopped process. Ideally we should -- define `leastGE` as a stopping time and take its stopped process. However, we can't do that -- with our current definition since a stopping time takes only finite indicies. An upcomming -- refactor should hopefully make it possible to have stopping times taking infinity as a value theorem leastGE_mono {n m : ℕ} (hnm : n ≤ m) (r : ℝ) (ω : Ω) : leastGE f r n ω ≤ leastGE f r m ω := hitting_mono hnm #align measure_theory.least_ge_mono MeasureTheory.leastGE_mono theorem leastGE_eq_min (π : Ω → ℕ) (r : ℝ) (ω : Ω) {n : ℕ} (hπn : ∀ ω, π ω ≤ n) : leastGE f r (π ω) ω = min (π ω) (leastGE f r n ω) := by classical refine le_antisymm (le_min (leastGE_le _) (leastGE_mono (hπn ω) r ω)) ?_ by_cases hle : π ω ≤ leastGE f r n ω · rw [min_eq_left hle, leastGE] by_cases h : ∃ j ∈ Set.Icc 0 (π ω), f j ω ∈ Set.Ici r · refine hle.trans (Eq.le ?_) rw [leastGE, ← hitting_eq_hitting_of_exists (hπn ω) h] · simp only [hitting, if_neg h, le_rfl] · rw [min_eq_right (not_le.1 hle).le, leastGE, leastGE, ← hitting_eq_hitting_of_exists (hπn ω) _] rw [not_le, leastGE, hitting_lt_iff _ (hπn ω)] at hle exact let ⟨j, hj₁, hj₂⟩ := hle ⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩ #align measure_theory.least_ge_eq_min MeasureTheory.leastGE_eq_min theorem stoppedValue_stoppedValue_leastGE (f : ℕ → Ω → ℝ) (π : Ω → ℕ) (r : ℝ) {n : ℕ} (hπn : ∀ ω, π ω ≤ n) : stoppedValue (fun i => stoppedValue f (leastGE f r i)) π = stoppedValue (stoppedProcess f (leastGE f r n)) π := by ext1 ω simp (config := { unfoldPartialApp := true }) only [stoppedProcess, stoppedValue] rw [leastGE_eq_min _ _ _ hπn] #align measure_theory.stopped_value_stopped_value_least_ge MeasureTheory.stoppedValue_stoppedValue_leastGE
Mathlib/Probability/Martingale/BorelCantelli.lean
101
115
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) : Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
rw [submartingale_iff_expected_stoppedValue_mono] · intro σ π hσ hπ hσ_le_π hπ_bdd obtain ⟨n, hπ_le_n⟩ := hπ_bdd simp_rw [stoppedValue_stoppedValue_leastGE f σ r fun i => (hσ_le_π i).trans (hπ_le_n i)] simp_rw [stoppedValue_stoppedValue_leastGE f π r hπ_le_n] refine hf.expected_stoppedValue_mono ?_ ?_ ?_ fun ω => (min_le_left _ _).trans (hπ_le_n ω) · exact hσ.min (hf.adapted.isStoppingTime_leastGE _ _) · exact hπ.min (hf.adapted.isStoppingTime_leastGE _ _) · exact fun ω => min_le_min (hσ_le_π ω) le_rfl · exact fun i => stronglyMeasurable_stoppedValue_of_le hf.adapted.progMeasurable_of_discrete (hf.adapted.isStoppingTime_leastGE _ _) leastGE_le · exact fun i => integrable_stoppedValue _ (hf.adapted.isStoppingTime_leastGE _ _) hf.integrable leastGE_le
13
import Mathlib.GroupTheory.Coprod.Basic import Mathlib.GroupTheory.Complement open Monoid Coprod Multiplicative Subgroup Function def HNNExtension.con (G : Type*) [Group G] (A B : Subgroup G) (φ : A ≃* B) : Con (G ∗ Multiplicative ℤ) := conGen (fun x y => ∃ (a : A), x = inr (ofAdd 1) * inl (a : G) ∧ y = inl (φ a : G) * inr (ofAdd 1)) def HNNExtension (G : Type*) [Group G] (A B : Subgroup G) (φ : A ≃* B) : Type _ := (HNNExtension.con G A B φ).Quotient variable {G : Type*} [Group G] {A B : Subgroup G} {φ : A ≃* B} {H : Type*} [Group H] {M : Type*} [Monoid M] instance : Group (HNNExtension G A B φ) := by delta HNNExtension; infer_instance namespace HNNExtension def of : G →* HNNExtension G A B φ := (HNNExtension.con G A B φ).mk'.comp inl def t : HNNExtension G A B φ := (HNNExtension.con G A B φ).mk'.comp inr (ofAdd 1) theorem t_mul_of (a : A) : t * (of (a : G) : HNNExtension G A B φ) = of (φ a : G) * t := (Con.eq _).2 <| ConGen.Rel.of _ _ <| ⟨a, by simp⟩ theorem of_mul_t (b : B) : (of (b : G) : HNNExtension G A B φ) * t = t * of (φ.symm b : G) := by rw [t_mul_of]; simp theorem equiv_eq_conj (a : A) : (of (φ a : G) : HNNExtension G A B φ) = t * of (a : G) * t⁻¹ := by rw [t_mul_of]; simp theorem equiv_symm_eq_conj (b : B) : (of (φ.symm b : G) : HNNExtension G A B φ) = t⁻¹ * of (b : G) * t := by rw [mul_assoc, of_mul_t]; simp theorem inv_t_mul_of (b : B) : t⁻¹ * (of (b : G) : HNNExtension G A B φ) = of (φ.symm b : G) * t⁻¹ := by rw [equiv_symm_eq_conj]; simp theorem of_mul_inv_t (a : A) : (of (a : G) : HNNExtension G A B φ) * t⁻¹ = t⁻¹ * of (φ a : G) := by rw [equiv_eq_conj]; simp [mul_assoc] def lift (f : G →* H) (x : H) (hx : ∀ a : A, x * f ↑a = f (φ a : G) * x) : HNNExtension G A B φ →* H := Con.lift _ (Coprod.lift f (zpowersHom H x)) (Con.conGen_le <| by rintro _ _ ⟨a, rfl, rfl⟩ simp [hx]) @[simp] theorem lift_t (f : G →* H) (x : H) (hx : ∀ a : A, x * f ↑a = f (φ a : G) * x) : lift f x hx t = x := by delta HNNExtension; simp [lift, t] @[simp] theorem lift_of (f : G →* H) (x : H) (hx : ∀ a : A, x * f ↑a = f (φ a : G) * x) (g : G) : lift f x hx (of g) = f g := by delta HNNExtension; simp [lift, of] @[ext high] theorem hom_ext {f g : HNNExtension G A B φ →* M} (hg : f.comp of = g.comp of) (ht : f t = g t) : f = g := (MonoidHom.cancel_right Con.mk'_surjective).mp <| Coprod.hom_ext hg (MonoidHom.ext_mint ht) @[elab_as_elim]
Mathlib/GroupTheory/HNNExtension.lean
113
129
theorem induction_on {motive : HNNExtension G A B φ → Prop} (x : HNNExtension G A B φ) (of : ∀ g, motive (of g)) (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y)) (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
let S : Subgroup (HNNExtension G A B φ) := { carrier := setOf motive one_mem' := by simpa using of 1 mul_mem' := mul _ _ inv_mem' := inv _ } let f : HNNExtension G A B φ →* S := lift (HNNExtension.of.codRestrict S of) ⟨HNNExtension.t, t⟩ (by intro a; ext; simp [equiv_eq_conj, mul_assoc]) have hf : S.subtype.comp f = MonoidHom.id _ := hom_ext (by ext; simp [f]) (by simp [f]) show motive (MonoidHom.id _ x) rw [← hf] exact (f x).2
13
import Mathlib.Data.List.Cycle import Mathlib.GroupTheory.Perm.Cycle.Type import Mathlib.GroupTheory.Perm.List #align_import group_theory.perm.cycle.concrete from "leanprover-community/mathlib"@"00638177efd1b2534fc5269363ebf42a7871df9a" open Equiv Equiv.Perm List variable {α : Type*} namespace List variable [DecidableEq α] {l l' : List α} theorem formPerm_disjoint_iff (hl : Nodup l) (hl' : Nodup l') (hn : 2 ≤ l.length) (hn' : 2 ≤ l'.length) : Perm.Disjoint (formPerm l) (formPerm l') ↔ l.Disjoint l' := by rw [disjoint_iff_eq_or_eq, List.Disjoint] constructor · rintro h x hx hx' specialize h x rw [formPerm_apply_mem_eq_self_iff _ hl _ hx, formPerm_apply_mem_eq_self_iff _ hl' _ hx'] at h omega · intro h x by_cases hx : x ∈ l on_goal 1 => by_cases hx' : x ∈ l' · exact (h hx hx').elim all_goals have := formPerm_eq_self_of_not_mem _ _ ‹_›; tauto #align list.form_perm_disjoint_iff List.formPerm_disjoint_iff
Mathlib/GroupTheory/Perm/Cycle/Concrete.lean
73
86
theorem isCycle_formPerm (hl : Nodup l) (hn : 2 ≤ l.length) : IsCycle (formPerm l) := by
cases' l with x l · set_option tactic.skipAssignedInstances false in norm_num at hn induction' l with y l generalizing x · set_option tactic.skipAssignedInstances false in norm_num at hn · use x constructor · rwa [formPerm_apply_mem_ne_self_iff _ hl _ (mem_cons_self _ _)] · intro w hw have : w ∈ x::y::l := mem_of_formPerm_ne_self _ _ hw obtain ⟨k, hk⟩ := get_of_mem this use k rw [← hk] simp only [zpow_natCast, formPerm_pow_apply_head _ _ hl k, Nat.mod_eq_of_lt k.isLt]
13
import Mathlib.Analysis.SpecialFunctions.JapaneseBracket import Mathlib.Analysis.SpecialFunctions.Integrals import Mathlib.MeasureTheory.Group.Integral import Mathlib.MeasureTheory.Integral.IntegralEqImproper import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.special_functions.improper_integrals from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open Real Set Filter MeasureTheory intervalIntegral open scoped Topology theorem integrableOn_exp_Iic (c : ℝ) : IntegrableOn exp (Iic c) := by refine integrableOn_Iic_of_intervalIntegral_norm_bounded (exp c) c (fun y => intervalIntegrable_exp.1) tendsto_id (eventually_of_mem (Iic_mem_atBot 0) fun y _ => ?_) simp_rw [norm_of_nonneg (exp_pos _).le, integral_exp, sub_le_self_iff] exact (exp_pos _).le #align integrable_on_exp_Iic integrableOn_exp_Iic theorem integral_exp_Iic (c : ℝ) : ∫ x : ℝ in Iic c, exp x = exp c := by refine tendsto_nhds_unique (intervalIntegral_tendsto_integral_Iic _ (integrableOn_exp_Iic _) tendsto_id) ?_ simp_rw [integral_exp, show 𝓝 (exp c) = 𝓝 (exp c - 0) by rw [sub_zero]] exact tendsto_exp_atBot.const_sub _ #align integral_exp_Iic integral_exp_Iic theorem integral_exp_Iic_zero : ∫ x : ℝ in Iic 0, exp x = 1 := exp_zero ▸ integral_exp_Iic 0 #align integral_exp_Iic_zero integral_exp_Iic_zero theorem integral_exp_neg_Ioi (c : ℝ) : (∫ x : ℝ in Ioi c, exp (-x)) = exp (-c) := by simpa only [integral_comp_neg_Ioi] using integral_exp_Iic (-c) #align integral_exp_neg_Ioi integral_exp_neg_Ioi theorem integral_exp_neg_Ioi_zero : (∫ x : ℝ in Ioi 0, exp (-x)) = 1 := by simpa only [neg_zero, exp_zero] using integral_exp_neg_Ioi 0 #align integral_exp_neg_Ioi_zero integral_exp_neg_Ioi_zero theorem integrableOn_Ioi_rpow_of_lt {a : ℝ} (ha : a < -1) {c : ℝ} (hc : 0 < c) : IntegrableOn (fun t : ℝ => t ^ a) (Ioi c) := by have hd : ∀ x ∈ Ici c, HasDerivAt (fun t => t ^ (a + 1) / (a + 1)) (x ^ a) x := by intro x hx -- Porting note: helped `convert` with explicit arguments convert (hasDerivAt_rpow_const (p := a + 1) (Or.inl (hc.trans_le hx).ne')).div_const _ using 1 field_simp [show a + 1 ≠ 0 from ne_of_lt (by linarith), mul_comm] have ht : Tendsto (fun t => t ^ (a + 1) / (a + 1)) atTop (𝓝 (0 / (a + 1))) := by apply Tendsto.div_const simpa only [neg_neg] using tendsto_rpow_neg_atTop (by linarith : 0 < -(a + 1)) exact integrableOn_Ioi_deriv_of_nonneg' hd (fun t ht => rpow_nonneg (hc.trans ht).le a) ht #align integrable_on_Ioi_rpow_of_lt integrableOn_Ioi_rpow_of_lt
Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean
76
90
theorem integrableOn_Ioi_rpow_iff {s t : ℝ} (ht : 0 < t) : IntegrableOn (fun x ↦ x ^ s) (Ioi t) ↔ s < -1 := by
refine ⟨fun h ↦ ?_, fun h ↦ integrableOn_Ioi_rpow_of_lt h ht⟩ contrapose! h intro H have H' : IntegrableOn (fun x ↦ x ^ s) (Ioi (max 1 t)) := H.mono (Set.Ioi_subset_Ioi (le_max_right _ _)) le_rfl have : IntegrableOn (fun x ↦ x⁻¹) (Ioi (max 1 t)) := by apply H'.mono' measurable_inv.aestronglyMeasurable filter_upwards [ae_restrict_mem measurableSet_Ioi] with x hx have x_one : 1 ≤ x := ((le_max_left _ _).trans_lt (mem_Ioi.1 hx)).le simp only [norm_inv, Real.norm_eq_abs, abs_of_nonneg (zero_le_one.trans x_one)] rw [← Real.rpow_neg_one x] exact Real.rpow_le_rpow_of_exponent_le x_one h exact not_IntegrableOn_Ioi_inv this
13
import Mathlib.Algebra.Group.Center import Mathlib.Data.Int.Cast.Lemmas #align_import group_theory.subsemigroup.center from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" variable {M : Type*} namespace Set variable (M) @[simp]
Mathlib/Algebra/Ring/Center.lean
24
37
theorem natCast_mem_center [NonAssocSemiring M] (n : ℕ) : (n : M) ∈ Set.center M where comm _:= by
rw [Nat.commute_cast] left_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, zero_mul, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, one_mul, ihn, add_mul, add_mul, one_mul] mid_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, mul_zero, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, mul_add, add_mul, ihn, mul_add, one_mul, mul_one] right_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, mul_zero, mul_zero, mul_zero] | succ n ihn => rw [Nat.cast_succ, mul_add, ihn, mul_add, mul_add, mul_one, mul_one]
13
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Equalizers import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products import Mathlib.CategoryTheory.Limits.Yoneda import Mathlib.CategoryTheory.Preadditive.FunctorCategory import Mathlib.CategoryTheory.Sites.SheafOfTypes import Mathlib.CategoryTheory.Sites.EqualizerSheafCondition #align_import category_theory.sites.sheaf from "leanprover-community/mathlib"@"2efd2423f8d25fa57cf7a179f5d8652ab4d0df44" universe w v₁ v₂ v₃ u₁ u₂ u₃ noncomputable section namespace CategoryTheory open Opposite CategoryTheory Category Limits Sieve namespace Presheaf variable {C : Type u₁} [Category.{v₁} C] variable {A : Type u₂} [Category.{v₂} A] variable (J : GrothendieckTopology C) -- We follow https://stacks.math.columbia.edu/tag/00VL definition 00VR def IsSheaf (P : Cᵒᵖ ⥤ A) : Prop := ∀ E : A, Presieve.IsSheaf J (P ⋙ coyoneda.obj (op E)) #align category_theory.presheaf.is_sheaf CategoryTheory.Presheaf.IsSheaf attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instFunLike in def IsSeparated (P : Cᵒᵖ ⥤ A) [ConcreteCategory A] : Prop := ∀ (X : C) (S : Sieve X) (_ : S ∈ J X) (x y : P.obj (op X)), (∀ (Y : C) (f : Y ⟶ X) (_ : S f), P.map f.op x = P.map f.op y) → x = y section LimitSheafCondition open Presieve Presieve.FamilyOfElements Limits variable (P : Cᵒᵖ ⥤ A) {X : C} (S : Sieve X) (R : Presieve X) (E : Aᵒᵖ) @[simps] def conesEquivSieveCompatibleFamily : (S.arrows.diagram.op ⋙ P).cones.obj E ≃ { x : FamilyOfElements (P ⋙ coyoneda.obj E) (S : Presieve X) // x.SieveCompatible } where toFun π := ⟨fun Y f h => π.app (op ⟨Over.mk f, h⟩), fun X Y f g hf => by apply (id_comp _).symm.trans dsimp exact π.naturality (Quiver.Hom.op (Over.homMk _ (by rfl)))⟩ invFun x := { app := fun f => x.1 f.unop.1.hom f.unop.2 naturality := fun f f' g => by refine Eq.trans ?_ (x.2 f.unop.1.hom g.unop.left f.unop.2) dsimp rw [id_comp] convert rfl rw [Over.w] } left_inv π := rfl right_inv x := rfl #align category_theory.presheaf.cones_equiv_sieve_compatible_family CategoryTheory.Presheaf.conesEquivSieveCompatibleFamily -- These lemmas have always been bad (#7657), but leanprover/lean4#2644 made `simp` start noticing attribute [nolint simpNF] CategoryTheory.Presheaf.conesEquivSieveCompatibleFamily_apply_coe CategoryTheory.Presheaf.conesEquivSieveCompatibleFamily_symm_apply_app variable {P S E} {x : FamilyOfElements (P ⋙ coyoneda.obj E) S.arrows} (hx : SieveCompatible x) @[simp] def _root_.CategoryTheory.Presieve.FamilyOfElements.SieveCompatible.cone : Cone (S.arrows.diagram.op ⋙ P) where pt := E.unop π := (conesEquivSieveCompatibleFamily P S E).invFun ⟨x, hx⟩ #align category_theory.presieve.family_of_elements.sieve_compatible.cone CategoryTheory.Presieve.FamilyOfElements.SieveCompatible.cone def homEquivAmalgamation : (hx.cone ⟶ P.mapCone S.arrows.cocone.op) ≃ { t // x.IsAmalgamation t } where toFun l := ⟨l.hom, fun _ f hf => l.w (op ⟨Over.mk f, hf⟩)⟩ invFun t := ⟨t.1, fun f => t.2 f.unop.1.hom f.unop.2⟩ left_inv _ := rfl right_inv _ := rfl #align category_theory.presheaf.hom_equiv_amalgamation CategoryTheory.Presheaf.homEquivAmalgamation variable (P S)
Mathlib/CategoryTheory/Sites/Sheaf.lean
147
162
theorem isLimit_iff_isSheafFor : Nonempty (IsLimit (P.mapCone S.arrows.cocone.op)) ↔ ∀ E : Aᵒᵖ, IsSheafFor (P ⋙ coyoneda.obj E) S.arrows := by
dsimp [IsSheafFor]; simp_rw [compatible_iff_sieveCompatible] rw [((Cone.isLimitEquivIsTerminal _).trans (isTerminalEquivUnique _ _)).nonempty_congr] rw [Classical.nonempty_pi]; constructor · intro hu E x hx specialize hu hx.cone erw [(homEquivAmalgamation hx).uniqueCongr.nonempty_congr] at hu exact (unique_subtype_iff_exists_unique _).1 hu · rintro h ⟨E, π⟩ let eqv := conesEquivSieveCompatibleFamily P S (op E) rw [← eqv.left_inv π] erw [(homEquivAmalgamation (eqv π).2).uniqueCongr.nonempty_congr] rw [unique_subtype_iff_exists_unique] exact h _ _ (eqv π).2
13
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Normed.Group.Lemmas import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace import Mathlib.Analysis.NormedSpace.RieszLemma import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Topology.Algebra.Module.FiniteDimension import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.Matrix #align_import analysis.normed_space.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057" universe u v w x noncomputable section open Set FiniteDimensional TopologicalSpace Filter Asymptotics Classical Topology NNReal Metric section CompleteField variable {𝕜 : Type u} [NontriviallyNormedField 𝕜] {E : Type v} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type w} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {F' : Type x} [AddCommGroup F'] [Module 𝕜 F'] [TopologicalSpace F'] [TopologicalAddGroup F'] [ContinuousSMul 𝕜 F'] [CompleteSpace 𝕜]
Mathlib/Analysis/NormedSpace/FiniteDimension.lean
163
176
theorem ContinuousLinearMap.continuous_det : Continuous fun f : E →L[𝕜] E => f.det := by
change Continuous fun f : E →L[𝕜] E => LinearMap.det (f : E →ₗ[𝕜] E) -- Porting note: this could be easier with `det_cases` by_cases h : ∃ s : Finset E, Nonempty (Basis (↥s) 𝕜 E) · rcases h with ⟨s, ⟨b⟩⟩ haveI : FiniteDimensional 𝕜 E := FiniteDimensional.of_fintype_basis b simp_rw [LinearMap.det_eq_det_toMatrix_of_finset b] refine Continuous.matrix_det ?_ exact ((LinearMap.toMatrix b b).toLinearMap.comp (ContinuousLinearMap.coeLM 𝕜)).continuous_of_finiteDimensional · -- Porting note: was `unfold LinearMap.det` rw [LinearMap.det_def] simpa only [h, MonoidHom.one_apply, dif_neg, not_false_iff] using continuous_const
13
import Mathlib.NumberTheory.Liouville.Basic import Mathlib.Topology.Baire.Lemmas import Mathlib.Topology.Baire.LocallyCompactRegular import Mathlib.Topology.Instances.Irrational #align_import number_theory.liouville.residual from "leanprover-community/mathlib"@"32b08ef840dd25ca2e47e035c5da03ce16d2dc3c" open scoped Filter open Filter Set Metric theorem setOf_liouville_eq_iInter_iUnion : { x | Liouville x } = ⋂ n : ℕ, ⋃ (a : ℤ) (b : ℤ) (_ : 1 < b), ball ((a : ℝ) / b) (1 / (b : ℝ) ^ n) \ {(a : ℝ) / b} := by ext x simp only [mem_iInter, mem_iUnion, Liouville, mem_setOf_eq, exists_prop, mem_diff, mem_singleton_iff, mem_ball, Real.dist_eq, and_comm] #align set_of_liouville_eq_Inter_Union setOf_liouville_eq_iInter_iUnion theorem IsGδ.setOf_liouville : IsGδ { x | Liouville x } := by rw [setOf_liouville_eq_iInter_iUnion] refine .iInter fun n => IsOpen.isGδ ?_ refine isOpen_iUnion fun a => isOpen_iUnion fun b => isOpen_iUnion fun _hb => ?_ exact isOpen_ball.inter isClosed_singleton.isOpen_compl set_option linter.uppercaseLean3 false in #align is_Gδ_set_of_liouville IsGδ.setOf_liouville @[deprecated (since := "2024-02-15")] alias isGδ_setOf_liouville := IsGδ.setOf_liouville theorem setOf_liouville_eq_irrational_inter_iInter_iUnion : { x | Liouville x } = { x | Irrational x } ∩ ⋂ n : ℕ, ⋃ (a : ℤ) (b : ℤ) (hb : 1 < b), ball (a / b) (1 / (b : ℝ) ^ n) := by refine Subset.antisymm ?_ ?_ · refine subset_inter (fun x hx => hx.irrational) ?_ rw [setOf_liouville_eq_iInter_iUnion] exact iInter_mono fun n => iUnion₂_mono fun a b => iUnion_mono fun _hb => diff_subset · simp only [inter_iInter, inter_iUnion, setOf_liouville_eq_iInter_iUnion] refine iInter_mono fun n => iUnion₂_mono fun a b => iUnion_mono fun hb => ?_ rw [inter_comm] exact diff_subset_diff Subset.rfl (singleton_subset_iff.2 ⟨a / b, by norm_cast⟩) #align set_of_liouville_eq_irrational_inter_Inter_Union setOf_liouville_eq_irrational_inter_iInter_iUnion
Mathlib/NumberTheory/Liouville/Residual.lean
59
72
theorem eventually_residual_liouville : ∀ᶠ x in residual ℝ, Liouville x := by
rw [Filter.Eventually, setOf_liouville_eq_irrational_inter_iInter_iUnion] refine eventually_residual_irrational.and ?_ refine residual_of_dense_Gδ ?_ (Rat.denseEmbedding_coe_real.dense.mono ?_) · exact .iInter fun n => IsOpen.isGδ <| isOpen_iUnion fun a => isOpen_iUnion fun b => isOpen_iUnion fun _hb => isOpen_ball · rintro _ ⟨r, rfl⟩ simp only [mem_iInter, mem_iUnion] refine fun n => ⟨r.num * 2, r.den * 2, ?_, ?_⟩ · have := Int.ofNat_le.2 r.pos; rw [Int.ofNat_one] at this; omega · convert @mem_ball_self ℝ _ (r : ℝ) _ _ · push_cast; norm_cast; simp [Rat.divInt_mul_right (two_ne_zero), Rat.mkRat_self] · refine one_div_pos.2 (pow_pos (Int.cast_pos.2 ?_) _) exact mul_pos (Int.natCast_pos.2 r.pos) zero_lt_two
13
import Mathlib.Data.Matrix.Basic import Mathlib.LinearAlgebra.Matrix.Trace #align_import data.matrix.basis from "leanprover-community/mathlib"@"320df450e9abeb5fc6417971e75acb6ae8bc3794" variable {l m n : Type*} variable {R α : Type*} namespace Matrix open Matrix variable [DecidableEq l] [DecidableEq m] [DecidableEq n] variable [Semiring α] def stdBasisMatrix (i : m) (j : n) (a : α) : Matrix m n α := fun i' j' => if i = i' ∧ j = j' then a else 0 #align matrix.std_basis_matrix Matrix.stdBasisMatrix @[simp] theorem smul_stdBasisMatrix [SMulZeroClass R α] (r : R) (i : m) (j : n) (a : α) : r • stdBasisMatrix i j a = stdBasisMatrix i j (r • a) := by unfold stdBasisMatrix ext simp [smul_ite] #align matrix.smul_std_basis_matrix Matrix.smul_stdBasisMatrix @[simp] theorem stdBasisMatrix_zero (i : m) (j : n) : stdBasisMatrix i j (0 : α) = 0 := by unfold stdBasisMatrix ext simp #align matrix.std_basis_matrix_zero Matrix.stdBasisMatrix_zero theorem stdBasisMatrix_add (i : m) (j : n) (a b : α) : stdBasisMatrix i j (a + b) = stdBasisMatrix i j a + stdBasisMatrix i j b := by unfold stdBasisMatrix; ext split_ifs with h <;> simp [h] #align matrix.std_basis_matrix_add Matrix.stdBasisMatrix_add theorem mulVec_stdBasisMatrix [Fintype m] (i : n) (j : m) (c : α) (x : m → α) : mulVec (stdBasisMatrix i j c) x = Function.update (0 : n → α) i (c * x j) := by ext i' simp [stdBasisMatrix, mulVec, dotProduct] rcases eq_or_ne i i' with rfl|h · simp simp [h, h.symm]
Mathlib/Data/Matrix/Basis.lean
65
79
theorem matrix_eq_sum_std_basis [Fintype m] [Fintype n] (x : Matrix m n α) : x = ∑ i : m, ∑ j : n, stdBasisMatrix i j (x i j) := by
ext i j; symm iterate 2 rw [Finset.sum_apply] -- Porting note: was `convert` refine (Fintype.sum_eq_single i ?_).trans ?_; swap · -- Porting note: `simp` seems unwilling to apply `Fintype.sum_apply` simp (config := { unfoldPartialApp := true }) only [stdBasisMatrix] rw [Fintype.sum_apply, Fintype.sum_apply] simp · intro j' hj' -- Porting note: `simp` seems unwilling to apply `Fintype.sum_apply` simp (config := { unfoldPartialApp := true }) only [stdBasisMatrix] rw [Fintype.sum_apply, Fintype.sum_apply] simp [hj']
13
import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Fintype.Basic import Mathlib.Data.Int.GCD import Mathlib.RingTheory.Coprime.Basic #align_import ring_theory.coprime.lemmas from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226" universe u v section IsCoprime variable {R : Type u} {I : Type v} [CommSemiring R] {x y z : R} {s : I → R} {t : Finset I} section theorem Int.isCoprime_iff_gcd_eq_one {m n : ℤ} : IsCoprime m n ↔ Int.gcd m n = 1 := by constructor · rintro ⟨a, b, h⟩ have : 1 = m * a + n * b := by rwa [mul_comm m, mul_comm n, eq_comm] exact Nat.dvd_one.mp (Int.gcd_dvd_iff.mpr ⟨a, b, this⟩) · rw [← Int.ofNat_inj, IsCoprime, Int.gcd_eq_gcd_ab, mul_comm m, mul_comm n, Nat.cast_one] intro h exact ⟨_, _, h⟩ theorem Nat.isCoprime_iff_coprime {m n : ℕ} : IsCoprime (m : ℤ) n ↔ Nat.Coprime m n := by rw [Int.isCoprime_iff_gcd_eq_one, Int.gcd_natCast_natCast] #align nat.is_coprime_iff_coprime Nat.isCoprime_iff_coprime alias ⟨IsCoprime.nat_coprime, Nat.Coprime.isCoprime⟩ := Nat.isCoprime_iff_coprime #align is_coprime.nat_coprime IsCoprime.nat_coprime #align nat.coprime.is_coprime Nat.Coprime.isCoprime theorem Nat.Coprime.cast {R : Type*} [CommRing R] {a b : ℕ} (h : Nat.Coprime a b) : IsCoprime (a : R) (b : R) := by rw [← isCoprime_iff_coprime] at h rw [← Int.cast_natCast a, ← Int.cast_natCast b] exact IsCoprime.intCast h theorem ne_zero_or_ne_zero_of_nat_coprime {A : Type u} [CommRing A] [Nontrivial A] {a b : ℕ} (h : Nat.Coprime a b) : (a : A) ≠ 0 ∨ (b : A) ≠ 0 := IsCoprime.ne_zero_or_ne_zero (R := A) <| by simpa only [map_natCast] using IsCoprime.map (Nat.Coprime.isCoprime h) (Int.castRingHom A) theorem IsCoprime.prod_left : (∀ i ∈ t, IsCoprime (s i) x) → IsCoprime (∏ i ∈ t, s i) x := by classical refine Finset.induction_on t (fun _ ↦ isCoprime_one_left) fun b t hbt ih H ↦ ?_ rw [Finset.prod_insert hbt] rw [Finset.forall_mem_insert] at H exact H.1.mul_left (ih H.2) #align is_coprime.prod_left IsCoprime.prod_left theorem IsCoprime.prod_right : (∀ i ∈ t, IsCoprime x (s i)) → IsCoprime x (∏ i ∈ t, s i) := by simpa only [isCoprime_comm] using IsCoprime.prod_left (R := R) #align is_coprime.prod_right IsCoprime.prod_right theorem IsCoprime.prod_left_iff : IsCoprime (∏ i ∈ t, s i) x ↔ ∀ i ∈ t, IsCoprime (s i) x := by classical refine Finset.induction_on t (iff_of_true isCoprime_one_left fun _ ↦ by simp) fun b t hbt ih ↦ ?_ rw [Finset.prod_insert hbt, IsCoprime.mul_left_iff, ih, Finset.forall_mem_insert] #align is_coprime.prod_left_iff IsCoprime.prod_left_iff theorem IsCoprime.prod_right_iff : IsCoprime x (∏ i ∈ t, s i) ↔ ∀ i ∈ t, IsCoprime x (s i) := by simpa only [isCoprime_comm] using IsCoprime.prod_left_iff (R := R) #align is_coprime.prod_right_iff IsCoprime.prod_right_iff theorem IsCoprime.of_prod_left (H1 : IsCoprime (∏ i ∈ t, s i) x) (i : I) (hit : i ∈ t) : IsCoprime (s i) x := IsCoprime.prod_left_iff.1 H1 i hit #align is_coprime.of_prod_left IsCoprime.of_prod_left theorem IsCoprime.of_prod_right (H1 : IsCoprime x (∏ i ∈ t, s i)) (i : I) (hit : i ∈ t) : IsCoprime x (s i) := IsCoprime.prod_right_iff.1 H1 i hit #align is_coprime.of_prod_right IsCoprime.of_prod_right -- Porting note: removed names of things due to linter, but they seem helpful
Mathlib/RingTheory/Coprime/Lemmas.lean
94
108
theorem Finset.prod_dvd_of_coprime : (t : Set I).Pairwise (IsCoprime on s) → (∀ i ∈ t, s i ∣ z) → (∏ x ∈ t, s x) ∣ z := by
classical exact Finset.induction_on t (fun _ _ ↦ one_dvd z) (by intro a r har ih Hs Hs1 rw [Finset.prod_insert har] have aux1 : a ∈ (↑(insert a r) : Set I) := Finset.mem_insert_self a r refine (IsCoprime.prod_right fun i hir ↦ Hs aux1 (Finset.mem_insert_of_mem hir) <| by rintro rfl exact har hir).mul_dvd (Hs1 a aux1) (ih (Hs.mono ?_) fun i hi ↦ Hs1 i <| Finset.mem_insert_of_mem hi) simp only [Finset.coe_insert, Set.subset_insert])
13
import Mathlib.Data.Int.Bitwise import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.LinearAlgebra.Matrix.Symmetric #align_import linear_algebra.matrix.zpow from "leanprover-community/mathlib"@"03fda9112aa6708947da13944a19310684bfdfcb" open Matrix namespace Matrix variable {n' : Type*} [DecidableEq n'] [Fintype n'] {R : Type*} [CommRing R] local notation "M" => Matrix n' n' R noncomputable instance : DivInvMonoid M := { show Monoid M by infer_instance, show Inv M by infer_instance with } section NatPow @[simp] theorem inv_pow' (A : M) (n : ℕ) : A⁻¹ ^ n = (A ^ n)⁻¹ := by induction' n with n ih · simp · rw [pow_succ A, mul_inv_rev, ← ih, ← pow_succ'] #align matrix.inv_pow' Matrix.inv_pow' theorem pow_sub' (A : M) {m n : ℕ} (ha : IsUnit A.det) (h : n ≤ m) : A ^ (m - n) = A ^ m * (A ^ n)⁻¹ := by rw [← tsub_add_cancel_of_le h, pow_add, Matrix.mul_assoc, mul_nonsing_inv, tsub_add_cancel_of_le h, Matrix.mul_one] simpa using ha.pow n #align matrix.pow_sub' Matrix.pow_sub'
Mathlib/LinearAlgebra/Matrix/ZPow.lean
57
70
theorem pow_inv_comm' (A : M) (m n : ℕ) : A⁻¹ ^ m * A ^ n = A ^ n * A⁻¹ ^ m := by
induction' n with n IH generalizing m · simp cases' m with m m · simp rcases nonsing_inv_cancel_or_zero A with (⟨h, h'⟩ | h) · calc A⁻¹ ^ (m + 1) * A ^ (n + 1) = A⁻¹ ^ m * (A⁻¹ * A) * A ^ n := by simp only [pow_succ A⁻¹, pow_succ' A, Matrix.mul_assoc] _ = A ^ n * A⁻¹ ^ m := by simp only [h, Matrix.mul_one, Matrix.one_mul, IH m] _ = A ^ n * (A * A⁻¹) * A⁻¹ ^ m := by simp only [h', Matrix.mul_one, Matrix.one_mul] _ = A ^ (n + 1) * A⁻¹ ^ (m + 1) := by simp only [pow_succ A, pow_succ' A⁻¹, Matrix.mul_assoc] · simp [h]
13
import Mathlib.Topology.Instances.ENNReal #align_import order.filter.ennreal from "leanprover-community/mathlib"@"52932b3a083d4142e78a15dc928084a22fea9ba0" open Filter ENNReal namespace ENNReal variable {α : Type*} {f : Filter α} theorem eventually_le_limsup [CountableInterFilter f] (u : α → ℝ≥0∞) : ∀ᶠ y in f, u y ≤ f.limsup u := _root_.eventually_le_limsup #align ennreal.eventually_le_limsup ENNReal.eventually_le_limsup theorem limsup_eq_zero_iff [CountableInterFilter f] {u : α → ℝ≥0∞} : f.limsup u = 0 ↔ u =ᶠ[f] 0 := limsup_eq_bot #align ennreal.limsup_eq_zero_iff ENNReal.limsup_eq_zero_iff
Mathlib/Order/Filter/ENNReal.lean
33
47
theorem limsup_const_mul_of_ne_top {u : α → ℝ≥0∞} {a : ℝ≥0∞} (ha_top : a ≠ ⊤) : (f.limsup fun x : α => a * u x) = a * f.limsup u := by
by_cases ha_zero : a = 0 · simp_rw [ha_zero, zero_mul, ← ENNReal.bot_eq_zero] exact limsup_const_bot let g := fun x : ℝ≥0∞ => a * x have hg_bij : Function.Bijective g := Function.bijective_iff_has_inverse.mpr ⟨fun x => a⁻¹ * x, ⟨fun x => by simp [g, ← mul_assoc, ENNReal.inv_mul_cancel ha_zero ha_top], fun x => by simp [g, ← mul_assoc, ENNReal.mul_inv_cancel ha_zero ha_top]⟩⟩ have hg_mono : StrictMono g := Monotone.strictMono_of_injective (fun _ _ _ => by rwa [mul_le_mul_left ha_zero ha_top]) hg_bij.1 let g_iso := StrictMono.orderIsoOfSurjective g hg_mono hg_bij.2 exact (OrderIso.limsup_apply g_iso).symm
13
import Mathlib.Init.Core import Mathlib.LinearAlgebra.AffineSpace.Basis import Mathlib.LinearAlgebra.FiniteDimensional #align_import linear_algebra.affine_space.finite_dimensional from "leanprover-community/mathlib"@"67e606eaea14c7854bdc556bd53d98aefdf76ec0" noncomputable section open Affine section AffineSpace' variable (k : Type*) {V : Type*} {P : Type*} variable {ι : Type*} open AffineSubspace FiniteDimensional Module variable [DivisionRing k] [AddCommGroup V] [Module k V] [AffineSpace V P] theorem finiteDimensional_vectorSpan_of_finite {s : Set P} (h : Set.Finite s) : FiniteDimensional k (vectorSpan k s) := span_of_finite k <| h.vsub h #align finite_dimensional_vector_span_of_finite finiteDimensional_vectorSpan_of_finite instance finiteDimensional_vectorSpan_range [Finite ι] (p : ι → P) : FiniteDimensional k (vectorSpan k (Set.range p)) := finiteDimensional_vectorSpan_of_finite k (Set.finite_range _) #align finite_dimensional_vector_span_range finiteDimensional_vectorSpan_range instance finiteDimensional_vectorSpan_image_of_finite [Finite ι] (p : ι → P) (s : Set ι) : FiniteDimensional k (vectorSpan k (p '' s)) := finiteDimensional_vectorSpan_of_finite k (Set.toFinite _) #align finite_dimensional_vector_span_image_of_finite finiteDimensional_vectorSpan_image_of_finite theorem finiteDimensional_direction_affineSpan_of_finite {s : Set P} (h : Set.Finite s) : FiniteDimensional k (affineSpan k s).direction := (direction_affineSpan k s).symm ▸ finiteDimensional_vectorSpan_of_finite k h #align finite_dimensional_direction_affine_span_of_finite finiteDimensional_direction_affineSpan_of_finite instance finiteDimensional_direction_affineSpan_range [Finite ι] (p : ι → P) : FiniteDimensional k (affineSpan k (Set.range p)).direction := finiteDimensional_direction_affineSpan_of_finite k (Set.finite_range _) #align finite_dimensional_direction_affine_span_range finiteDimensional_direction_affineSpan_range instance finiteDimensional_direction_affineSpan_image_of_finite [Finite ι] (p : ι → P) (s : Set ι) : FiniteDimensional k (affineSpan k (p '' s)).direction := finiteDimensional_direction_affineSpan_of_finite k (Set.toFinite _) #align finite_dimensional_direction_affine_span_image_of_finite finiteDimensional_direction_affineSpan_image_of_finite theorem finite_of_fin_dim_affineIndependent [FiniteDimensional k V] {p : ι → P} (hi : AffineIndependent k p) : Finite ι := by nontriviality ι; inhabit ι rw [affineIndependent_iff_linearIndependent_vsub k p default] at hi letI : IsNoetherian k V := IsNoetherian.iff_fg.2 inferInstance exact (Set.finite_singleton default).finite_of_compl (Set.finite_coe_iff.1 hi.finite_of_isNoetherian) #align finite_of_fin_dim_affine_independent finite_of_fin_dim_affineIndependent theorem finite_set_of_fin_dim_affineIndependent [FiniteDimensional k V] {s : Set ι} {f : s → P} (hi : AffineIndependent k f) : s.Finite := @Set.toFinite _ s (finite_of_fin_dim_affineIndependent k hi) #align finite_set_of_fin_dim_affine_independent finite_set_of_fin_dim_affineIndependent variable {k}
Mathlib/LinearAlgebra/AffineSpace/FiniteDimensional.lean
100
115
theorem AffineIndependent.finrank_vectorSpan_image_finset [DecidableEq P] {p : ι → P} (hi : AffineIndependent k p) {s : Finset ι} {n : ℕ} (hc : Finset.card s = n + 1) : finrank k (vectorSpan k (s.image p : Set P)) = n := by
classical have hi' := hi.range.mono (Set.image_subset_range p ↑s) have hc' : (s.image p).card = n + 1 := by rwa [s.card_image_of_injective hi.injective] have hn : (s.image p).Nonempty := by simp [hc', ← Finset.card_pos] rcases hn with ⟨p₁, hp₁⟩ have hp₁' : p₁ ∈ p '' s := by simpa using hp₁ rw [affineIndependent_set_iff_linearIndependent_vsub k hp₁', ← Finset.coe_singleton, ← Finset.coe_image, ← Finset.coe_sdiff, Finset.sdiff_singleton_eq_erase, ← Finset.coe_image] at hi' have hc : (Finset.image (fun p : P => p -ᵥ p₁) ((Finset.image p s).erase p₁)).card = n := by rw [Finset.card_image_of_injective _ (vsub_left_injective _), Finset.card_erase_of_mem hp₁] exact Nat.pred_eq_of_eq_succ hc' rwa [vectorSpan_eq_span_vsub_finset_right_ne k hp₁, finrank_span_finset_eq_card, hc]
13
import Mathlib.Analysis.SpecialFunctions.Integrals import Mathlib.MeasureTheory.Integral.PeakFunction #align_import analysis.special_functions.trigonometric.euler_sine_prod from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" open scoped Real Topology open Real Set Filter intervalIntegral MeasureTheory.MeasureSpace namespace EulerSine
Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean
278
295
theorem tendsto_integral_cos_pow_mul_div {f : ℝ → ℂ} (hf : ContinuousOn f (Icc 0 (π / 2))) : Tendsto (fun n : ℕ => (∫ x in (0 : ℝ)..π / 2, (cos x : ℂ) ^ n * f x) / (∫ x in (0 : ℝ)..π / 2, cos x ^ n : ℝ)) atTop (𝓝 <| f 0) := by
simp_rw [div_eq_inv_mul (α := ℂ), ← Complex.ofReal_inv, integral_of_le pi_div_two_pos.le, ← MeasureTheory.integral_Icc_eq_integral_Ioc, ← Complex.ofReal_pow, ← Complex.real_smul] have c_lt : ∀ y : ℝ, y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0 := fun y hy hy' => cos_lt_cos_of_nonneg_of_le_pi_div_two (le_refl 0) hy.2 (lt_of_le_of_ne hy.1 hy'.symm) have c_nonneg : ∀ x : ℝ, x ∈ Icc 0 (π / 2) → 0 ≤ cos x := fun x hx => cos_nonneg_of_mem_Icc ((Icc_subset_Icc_left (neg_nonpos_of_nonneg pi_div_two_pos.le)) hx) have c_zero_pos : 0 < cos 0 := by rw [cos_zero]; exact zero_lt_one have zero_mem : (0 : ℝ) ∈ closure (interior (Icc 0 (π / 2))) := by rw [interior_Icc, closure_Ioo pi_div_two_pos.ne, left_mem_Icc] exact pi_div_two_pos.le exact tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn isCompact_Icc continuousOn_cos c_lt c_nonneg c_zero_pos zero_mem hf
13
import Mathlib.Analysis.Convex.Basic import Mathlib.Order.Closure #align_import analysis.convex.hull from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" open Set open Pointwise variable {𝕜 E F : Type*} section convexHull section OrderedSemiring variable [OrderedSemiring 𝕜] section AddCommMonoid variable (𝕜) variable [AddCommMonoid E] [AddCommMonoid F] [Module 𝕜 E] [Module 𝕜 F] @[simps! isClosed] def convexHull : ClosureOperator (Set E) := .ofCompletePred (Convex 𝕜) fun _ ↦ convex_sInter #align convex_hull convexHull variable (s : Set E) theorem subset_convexHull : s ⊆ convexHull 𝕜 s := (convexHull 𝕜).le_closure s #align subset_convex_hull subset_convexHull theorem convex_convexHull : Convex 𝕜 (convexHull 𝕜 s) := (convexHull 𝕜).isClosed_closure s #align convex_convex_hull convex_convexHull theorem convexHull_eq_iInter : convexHull 𝕜 s = ⋂ (t : Set E) (_ : s ⊆ t) (_ : Convex 𝕜 t), t := by simp [convexHull, iInter_subtype, iInter_and] #align convex_hull_eq_Inter convexHull_eq_iInter variable {𝕜 s} {t : Set E} {x y : E} theorem mem_convexHull_iff : x ∈ convexHull 𝕜 s ↔ ∀ t, s ⊆ t → Convex 𝕜 t → x ∈ t := by simp_rw [convexHull_eq_iInter, mem_iInter] #align mem_convex_hull_iff mem_convexHull_iff theorem convexHull_min : s ⊆ t → Convex 𝕜 t → convexHull 𝕜 s ⊆ t := (convexHull 𝕜).closure_min #align convex_hull_min convexHull_min theorem Convex.convexHull_subset_iff (ht : Convex 𝕜 t) : convexHull 𝕜 s ⊆ t ↔ s ⊆ t := (show (convexHull 𝕜).IsClosed t from ht).closure_le_iff #align convex.convex_hull_subset_iff Convex.convexHull_subset_iff @[mono] theorem convexHull_mono (hst : s ⊆ t) : convexHull 𝕜 s ⊆ convexHull 𝕜 t := (convexHull 𝕜).monotone hst #align convex_hull_mono convexHull_mono lemma convexHull_eq_self : convexHull 𝕜 s = s ↔ Convex 𝕜 s := (convexHull 𝕜).isClosed_iff.symm alias ⟨_, Convex.convexHull_eq⟩ := convexHull_eq_self #align convex.convex_hull_eq Convex.convexHull_eq @[simp] theorem convexHull_univ : convexHull 𝕜 (univ : Set E) = univ := ClosureOperator.closure_top (convexHull 𝕜) #align convex_hull_univ convexHull_univ @[simp] theorem convexHull_empty : convexHull 𝕜 (∅ : Set E) = ∅ := convex_empty.convexHull_eq #align convex_hull_empty convexHull_empty @[simp] theorem convexHull_empty_iff : convexHull 𝕜 s = ∅ ↔ s = ∅ := by constructor · intro h rw [← Set.subset_empty_iff, ← h] exact subset_convexHull 𝕜 _ · rintro rfl exact convexHull_empty #align convex_hull_empty_iff convexHull_empty_iff @[simp] theorem convexHull_nonempty_iff : (convexHull 𝕜 s).Nonempty ↔ s.Nonempty := by rw [nonempty_iff_ne_empty, nonempty_iff_ne_empty, Ne, Ne] exact not_congr convexHull_empty_iff #align convex_hull_nonempty_iff convexHull_nonempty_iff protected alias ⟨_, Set.Nonempty.convexHull⟩ := convexHull_nonempty_iff #align set.nonempty.convex_hull Set.Nonempty.convexHull theorem segment_subset_convexHull (hx : x ∈ s) (hy : y ∈ s) : segment 𝕜 x y ⊆ convexHull 𝕜 s := (convex_convexHull _ _).segment_subset (subset_convexHull _ _ hx) (subset_convexHull _ _ hy) #align segment_subset_convex_hull segment_subset_convexHull @[simp] theorem convexHull_singleton (x : E) : convexHull 𝕜 ({x} : Set E) = {x} := (convex_singleton x).convexHull_eq #align convex_hull_singleton convexHull_singleton @[simp] theorem convexHull_zero : convexHull 𝕜 (0 : Set E) = 0 := convexHull_singleton 0 #align convex_hull_zero convexHull_zero @[simp] theorem convexHull_pair (x y : E) : convexHull 𝕜 {x, y} = segment 𝕜 x y := by refine (convexHull_min ?_ <| convex_segment _ _).antisymm (segment_subset_convexHull (mem_insert _ _) <| subset_insert _ _ <| mem_singleton _) rw [insert_subset_iff, singleton_subset_iff] exact ⟨left_mem_segment _ _ _, right_mem_segment _ _ _⟩ #align convex_hull_pair convexHull_pair theorem convexHull_convexHull_union_left (s t : Set E) : convexHull 𝕜 (convexHull 𝕜 s ∪ t) = convexHull 𝕜 (s ∪ t) := ClosureOperator.closure_sup_closure_left _ _ _ #align convex_hull_convex_hull_union_left convexHull_convexHull_union_left theorem convexHull_convexHull_union_right (s t : Set E) : convexHull 𝕜 (s ∪ convexHull 𝕜 t) = convexHull 𝕜 (s ∪ t) := ClosureOperator.closure_sup_closure_right _ _ _ #align convex_hull_convex_hull_union_right convexHull_convexHull_union_right
Mathlib/Analysis/Convex/Hull.lean
144
158
theorem Convex.convex_remove_iff_not_mem_convexHull_remove {s : Set E} (hs : Convex 𝕜 s) (x : E) : Convex 𝕜 (s \ {x}) ↔ x ∉ convexHull 𝕜 (s \ {x}) := by
constructor · rintro hsx hx rw [hsx.convexHull_eq] at hx exact hx.2 (mem_singleton _) rintro hx suffices h : s \ {x} = convexHull 𝕜 (s \ {x}) by rw [h] exact convex_convexHull 𝕜 _ exact Subset.antisymm (subset_convexHull 𝕜 _) fun y hy => ⟨convexHull_min diff_subset hs hy, by rintro (rfl : y = x) exact hx hy⟩
13
import Mathlib.CategoryTheory.Filtered.Basic import Mathlib.Topology.Category.TopCat.Limits.Basic #align_import topology.category.Top.limits.konig from "leanprover-community/mathlib"@"dbdf71cee7bb20367cb7e37279c08b0c218cf967" -- Porting note: every ML3 decl has an uppercase letter set_option linter.uppercaseLean3 false open CategoryTheory open CategoryTheory.Limits -- Porting note: changed universe order as `v` is usually passed explicitly universe v u w noncomputable section namespace TopCat section TopologicalKonig variable {J : Type u} [SmallCategory J] -- Porting note: generalized `F` to land in `v` not `u` variable (F : J ⥤ TopCat.{v}) private abbrev FiniteDiagramArrow {J : Type u} [SmallCategory J] (G : Finset J) := Σ' (X Y : J) (_ : X ∈ G) (_ : Y ∈ G), X ⟶ Y private abbrev FiniteDiagram (J : Type u) [SmallCategory J] := Σ G : Finset J, Finset (FiniteDiagramArrow G) -- Porting note: generalized `F` to land in `v` not `u` def partialSections {J : Type u} [SmallCategory J] (F : J ⥤ TopCat.{v}) {G : Finset J} (H : Finset (FiniteDiagramArrow G)) : Set (∀ j, F.obj j) := {u | ∀ {f : FiniteDiagramArrow G} (_ : f ∈ H), F.map f.2.2.2.2 (u f.1) = u f.2.1} #align Top.partial_sections TopCat.partialSections theorem partialSections.nonempty [IsCofilteredOrEmpty J] [h : ∀ j : J, Nonempty (F.obj j)] {G : Finset J} (H : Finset (FiniteDiagramArrow G)) : (partialSections F H).Nonempty := by classical cases isEmpty_or_nonempty J · exact ⟨isEmptyElim, fun {j} => IsEmpty.elim' inferInstance j.1⟩ haveI : IsCofiltered J := ⟨⟩ use fun j : J => if hj : j ∈ G then F.map (IsCofiltered.infTo G H hj) (h (IsCofiltered.inf G H)).some else (h _).some rintro ⟨X, Y, hX, hY, f⟩ hf dsimp only rwa [dif_pos hX, dif_pos hY, ← comp_app, ← F.map_comp, @IsCofiltered.infTo_commutes _ _ _ G H] #align Top.partial_sections.nonempty TopCat.partialSections.nonempty theorem partialSections.directed : Directed Superset fun G : FiniteDiagram J => partialSections F G.2 := by classical intro A B let ιA : FiniteDiagramArrow A.1 → FiniteDiagramArrow (A.1 ⊔ B.1) := fun f => ⟨f.1, f.2.1, Finset.mem_union_left _ f.2.2.1, Finset.mem_union_left _ f.2.2.2.1, f.2.2.2.2⟩ let ιB : FiniteDiagramArrow B.1 → FiniteDiagramArrow (A.1 ⊔ B.1) := fun f => ⟨f.1, f.2.1, Finset.mem_union_right _ f.2.2.1, Finset.mem_union_right _ f.2.2.2.1, f.2.2.2.2⟩ refine ⟨⟨A.1 ⊔ B.1, A.2.image ιA ⊔ B.2.image ιB⟩, ?_, ?_⟩ · rintro u hu f hf have : ιA f ∈ A.2.image ιA ⊔ B.2.image ιB := by apply Finset.mem_union_left rw [Finset.mem_image] exact ⟨f, hf, rfl⟩ exact hu this · rintro u hu f hf have : ιB f ∈ A.2.image ιA ⊔ B.2.image ιB := by apply Finset.mem_union_right rw [Finset.mem_image] exact ⟨f, hf, rfl⟩ exact hu this #align Top.partial_sections.directed TopCat.partialSections.directed theorem partialSections.closed [∀ j : J, T2Space (F.obj j)] {G : Finset J} (H : Finset (FiniteDiagramArrow G)) : IsClosed (partialSections F H) := by have : partialSections F H = ⋂ (f : FiniteDiagramArrow G) (_ : f ∈ H), {u | F.map f.2.2.2.2 (u f.1) = u f.2.1} := by ext1 simp only [Set.mem_iInter, Set.mem_setOf_eq] rfl rw [this] apply isClosed_biInter intro f _ -- Porting note: can't see through forget have : T2Space ((forget TopCat).obj (F.obj f.snd.fst)) := inferInstanceAs (T2Space (F.obj f.snd.fst)) apply isClosed_eq -- Porting note: used to be a single `continuity` that closed both goals · exact (F.map f.snd.snd.snd.snd).continuous.comp (continuous_apply f.fst) · continuity #align Top.partial_sections.closed TopCat.partialSections.closed -- Porting note: generalized from `TopCat.{u}` to `TopCat.{max v u}`
Mathlib/Topology/Category/TopCat/Limits/Konig.lean
130
146
theorem nonempty_limitCone_of_compact_t2_cofiltered_system (F : J ⥤ TopCat.{max v u}) [IsCofilteredOrEmpty J] [∀ j : J, Nonempty (F.obj j)] [∀ j : J, CompactSpace (F.obj j)] [∀ j : J, T2Space (F.obj j)] : Nonempty (TopCat.limitCone F).pt := by
classical obtain ⟨u, hu⟩ := IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed (fun G => partialSections F _) (partialSections.directed F) (fun G => partialSections.nonempty F _) (fun G => IsClosed.isCompact (partialSections.closed F _)) fun G => partialSections.closed F _ use u intro X Y f let G : FiniteDiagram J := ⟨{X, Y}, {⟨X, Y, by simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert], by simp only [eq_self_iff_true, or_true_iff, Finset.mem_insert, Finset.mem_singleton], f⟩}⟩ exact hu _ ⟨G, rfl⟩ (Finset.mem_singleton_self _)
13
import Mathlib.Algebra.Star.Subalgebra import Mathlib.Topology.Algebra.Algebra import Mathlib.Topology.Algebra.Star #align_import topology.algebra.star_subalgebra from "leanprover-community/mathlib"@"b7f5a77fa29ad9a3ccc484109b0d7534178e7ecd" open scoped Classical open Set TopologicalSpace open scoped Classical namespace StarSubalgebra section TopologicalStarAlgebra variable {R A B : Type*} [CommSemiring R] [StarRing R] variable [TopologicalSpace A] [Semiring A] [Algebra R A] [StarRing A] [StarModule R A] instance [TopologicalSemiring A] (s : StarSubalgebra R A) : TopologicalSemiring s := s.toSubalgebra.topologicalSemiring theorem embedding_inclusion {S₁ S₂ : StarSubalgebra R A} (h : S₁ ≤ S₂) : Embedding (inclusion h) := { induced := Eq.symm induced_compose inj := Subtype.map_injective h Function.injective_id } #align star_subalgebra.embedding_inclusion StarSubalgebra.embedding_inclusion theorem closedEmbedding_inclusion {S₁ S₂ : StarSubalgebra R A} (h : S₁ ≤ S₂) (hS₁ : IsClosed (S₁ : Set A)) : ClosedEmbedding (inclusion h) := { embedding_inclusion h with isClosed_range := isClosed_induced_iff.2 ⟨S₁, hS₁, by convert (Set.range_subtype_map id _).symm · rw [Set.image_id]; rfl · intro _ h' apply h h' ⟩ } #align star_subalgebra.closed_embedding_inclusion StarSubalgebra.closedEmbedding_inclusion variable [TopologicalSemiring A] [ContinuousStar A] variable [TopologicalSpace B] [Semiring B] [Algebra R B] [StarRing B] def topologicalClosure (s : StarSubalgebra R A) : StarSubalgebra R A := { s.toSubalgebra.topologicalClosure with carrier := closure (s : Set A) star_mem' := fun ha => map_mem_closure continuous_star ha fun x => (star_mem : x ∈ s → star x ∈ s) } #align star_subalgebra.topological_closure StarSubalgebra.topologicalClosure theorem topologicalClosure_toSubalgebra_comm (s : StarSubalgebra R A) : s.topologicalClosure.toSubalgebra = s.toSubalgebra.topologicalClosure := SetLike.coe_injective rfl @[simp] theorem topologicalClosure_coe (s : StarSubalgebra R A) : (s.topologicalClosure : Set A) = closure (s : Set A) := rfl #align star_subalgebra.topological_closure_coe StarSubalgebra.topologicalClosure_coe theorem le_topologicalClosure (s : StarSubalgebra R A) : s ≤ s.topologicalClosure := subset_closure #align star_subalgebra.le_topological_closure StarSubalgebra.le_topologicalClosure theorem isClosed_topologicalClosure (s : StarSubalgebra R A) : IsClosed (s.topologicalClosure : Set A) := isClosed_closure #align star_subalgebra.is_closed_topological_closure StarSubalgebra.isClosed_topologicalClosure instance {A : Type*} [UniformSpace A] [CompleteSpace A] [Semiring A] [StarRing A] [TopologicalSemiring A] [ContinuousStar A] [Algebra R A] [StarModule R A] {S : StarSubalgebra R A} : CompleteSpace S.topologicalClosure := isClosed_closure.completeSpace_coe theorem topologicalClosure_minimal {s t : StarSubalgebra R A} (h : s ≤ t) (ht : IsClosed (t : Set A)) : s.topologicalClosure ≤ t := closure_minimal h ht #align star_subalgebra.topological_closure_minimal StarSubalgebra.topologicalClosure_minimal theorem topologicalClosure_mono : Monotone (topologicalClosure : _ → StarSubalgebra R A) := fun _ S₂ h => topologicalClosure_minimal (h.trans <| le_topologicalClosure S₂) (isClosed_topologicalClosure S₂) #align star_subalgebra.topological_closure_mono StarSubalgebra.topologicalClosure_mono theorem topologicalClosure_map_le [StarModule R B] [TopologicalSemiring B] [ContinuousStar B] (s : StarSubalgebra R A) (φ : A →⋆ₐ[R] B) (hφ : IsClosedMap φ) : (map φ s).topologicalClosure ≤ map φ s.topologicalClosure := hφ.closure_image_subset _ theorem map_topologicalClosure_le [StarModule R B] [TopologicalSemiring B] [ContinuousStar B] (s : StarSubalgebra R A) (φ : A →⋆ₐ[R] B) (hφ : Continuous φ) : map φ s.topologicalClosure ≤ (map φ s).topologicalClosure := image_closure_subset_closure_image hφ theorem topologicalClosure_map [StarModule R B] [TopologicalSemiring B] [ContinuousStar B] (s : StarSubalgebra R A) (φ : A →⋆ₐ[R] B) (hφ : ClosedEmbedding φ) : (map φ s).topologicalClosure = map φ s.topologicalClosure := SetLike.coe_injective <| hφ.closure_image_eq _ theorem _root_.Subalgebra.topologicalClosure_star_comm (s : Subalgebra R A) : (star s).topologicalClosure = star s.topologicalClosure := by suffices ∀ t : Subalgebra R A, (star t).topologicalClosure ≤ star t.topologicalClosure from le_antisymm (this s) (by simpa only [star_star] using Subalgebra.star_mono (this (star s))) exact fun t => (star t).topologicalClosure_minimal (Subalgebra.star_mono subset_closure) (isClosed_closure.preimage continuous_star) abbrev commSemiringTopologicalClosure [T2Space A] (s : StarSubalgebra R A) (hs : ∀ x y : s, x * y = y * x) : CommSemiring s.topologicalClosure := s.toSubalgebra.commSemiringTopologicalClosure hs #align star_subalgebra.comm_semiring_topological_closure StarSubalgebra.commSemiringTopologicalClosure abbrev commRingTopologicalClosure {R A} [CommRing R] [StarRing R] [TopologicalSpace A] [Ring A] [Algebra R A] [StarRing A] [StarModule R A] [TopologicalRing A] [ContinuousStar A] [T2Space A] (s : StarSubalgebra R A) (hs : ∀ x y : s, x * y = y * x) : CommRing s.topologicalClosure := s.toSubalgebra.commRingTopologicalClosure hs #align star_subalgebra.comm_ring_topological_closure StarSubalgebra.commRingTopologicalClosure
Mathlib/Topology/Algebra/StarSubalgebra.lean
146
163
theorem _root_.StarAlgHom.ext_topologicalClosure [T2Space B] {S : StarSubalgebra R A} {φ ψ : S.topologicalClosure →⋆ₐ[R] B} (hφ : Continuous φ) (hψ : Continuous ψ) (h : φ.comp (inclusion (le_topologicalClosure S)) = ψ.comp (inclusion (le_topologicalClosure S))) : φ = ψ := by
rw [DFunLike.ext'_iff] have : Dense (Set.range <| inclusion (le_topologicalClosure S)) := by refine embedding_subtype_val.toInducing.dense_iff.2 fun x => ?_ convert show ↑x ∈ closure (S : Set A) from x.prop rw [← Set.range_comp] exact Set.ext fun y => ⟨by rintro ⟨y, rfl⟩ exact y.prop, fun hy => ⟨⟨y, hy⟩, rfl⟩⟩ refine Continuous.ext_on this hφ hψ ?_ rintro _ ⟨x, rfl⟩ simpa only using DFunLike.congr_fun h x
13
import Mathlib.Analysis.SpecialFunctions.Integrals #align_import data.real.pi.wallis from "leanprover-community/mathlib"@"980755c33b9168bc82f774f665eaa27878140fac" open scoped Real Topology Nat open Filter Finset intervalIntegral namespace Real namespace Wallis set_option linter.uppercaseLean3 false noncomputable def W (k : ℕ) : ℝ := ∏ i ∈ range k, (2 * i + 2) / (2 * i + 1) * ((2 * i + 2) / (2 * i + 3)) #align real.wallis.W Real.Wallis.W theorem W_succ (k : ℕ) : W (k + 1) = W k * ((2 * k + 2) / (2 * k + 1) * ((2 * k + 2) / (2 * k + 3))) := prod_range_succ _ _ #align real.wallis.W_succ Real.Wallis.W_succ theorem W_pos (k : ℕ) : 0 < W k := by induction' k with k hk · unfold W; simp · rw [W_succ] refine mul_pos hk (mul_pos (div_pos ?_ ?_) (div_pos ?_ ?_)) <;> positivity #align real.wallis.W_pos Real.Wallis.W_pos theorem W_eq_factorial_ratio (n : ℕ) : W n = 2 ^ (4 * n) * n ! ^ 4 / ((2 * n)! ^ 2 * (2 * n + 1)) := by induction' n with n IH · simp only [W, prod_range_zero, Nat.factorial_zero, mul_zero, pow_zero, algebraMap.coe_one, one_pow, mul_one, algebraMap.coe_zero, zero_add, div_self, Ne, one_ne_zero, not_false_iff] norm_num · unfold W at IH ⊢ rw [prod_range_succ, IH, _root_.div_mul_div_comm, _root_.div_mul_div_comm] refine (div_eq_div_iff ?_ ?_).mpr ?_ any_goals exact ne_of_gt (by positivity) simp_rw [Nat.mul_succ, Nat.factorial_succ, pow_succ] push_cast ring_nf #align real.wallis.W_eq_factorial_ratio Real.Wallis.W_eq_factorial_ratio theorem W_eq_integral_sin_pow_div_integral_sin_pow (k : ℕ) : (π / 2)⁻¹ * W k = (∫ x : ℝ in (0)..π, sin x ^ (2 * k + 1)) / ∫ x : ℝ in (0)..π, sin x ^ (2 * k) := by rw [integral_sin_pow_even, integral_sin_pow_odd, mul_div_mul_comm, ← prod_div_distrib, inv_div] simp_rw [div_div_div_comm, div_div_eq_mul_div, mul_div_assoc] rfl #align real.wallis.W_eq_integral_sin_pow_div_integral_sin_pow Real.Wallis.W_eq_integral_sin_pow_div_integral_sin_pow theorem W_le (k : ℕ) : W k ≤ π / 2 := by rw [← div_le_one pi_div_two_pos, div_eq_inv_mul] rw [W_eq_integral_sin_pow_div_integral_sin_pow, div_le_one (integral_sin_pow_pos _)] apply integral_sin_pow_succ_le #align real.wallis.W_le Real.Wallis.W_le theorem le_W (k : ℕ) : ((2 : ℝ) * k + 1) / (2 * k + 2) * (π / 2) ≤ W k := by rw [← le_div_iff pi_div_two_pos, div_eq_inv_mul (W k) _] rw [W_eq_integral_sin_pow_div_integral_sin_pow, le_div_iff (integral_sin_pow_pos _)] convert integral_sin_pow_succ_le (2 * k + 1) rw [integral_sin_pow (2 * k)] simp only [sin_zero, ne_eq, add_eq_zero, and_false, not_false_eq_true, zero_pow, cos_zero, mul_one, sin_pi, cos_pi, mul_neg, neg_zero, sub_self, zero_div, zero_add] norm_cast #align real.wallis.le_W Real.Wallis.le_W
Mathlib/Data/Real/Pi/Wallis.lean
101
114
theorem tendsto_W_nhds_pi_div_two : Tendsto W atTop (𝓝 <| π / 2) := by
refine tendsto_of_tendsto_of_tendsto_of_le_of_le ?_ tendsto_const_nhds le_W W_le have : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2)) := by rw [sub_zero, one_mul] rw [this] refine Tendsto.mul ?_ tendsto_const_nhds have h : ∀ n : ℕ, ((2 : ℝ) * n + 1) / (2 * n + 2) = 1 - 1 / (2 * n + 2) := by intro n rw [sub_div' _ _ _ (ne_of_gt (add_pos_of_nonneg_of_pos (mul_nonneg (two_pos : 0 < (2 : ℝ)).le (Nat.cast_nonneg _)) two_pos)), one_mul] congr 1; ring simp_rw [h] refine (tendsto_const_nhds.div_atTop ?_).const_sub _ refine Tendsto.atTop_add ?_ tendsto_const_nhds exact tendsto_natCast_atTop_atTop.const_mul_atTop two_pos
13
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset import Mathlib.Data.Finite.Card import Mathlib.GroupTheory.Finiteness import Mathlib.GroupTheory.GroupAction.Quotient #align_import group_theory.index from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" namespace Subgroup open Cardinal variable {G : Type*} [Group G] (H K L : Subgroup G) @[to_additive "The index of a subgroup as a natural number, and returns 0 if the index is infinite."] noncomputable def index : ℕ := Nat.card (G ⧸ H) #align subgroup.index Subgroup.index #align add_subgroup.index AddSubgroup.index @[to_additive "The relative index of a subgroup as a natural number, and returns 0 if the relative index is infinite."] noncomputable def relindex : ℕ := (H.subgroupOf K).index #align subgroup.relindex Subgroup.relindex #align add_subgroup.relindex AddSubgroup.relindex @[to_additive]
Mathlib/GroupTheory/Index.lean
62
76
theorem index_comap_of_surjective {G' : Type*} [Group G'] {f : G' →* G} (hf : Function.Surjective f) : (H.comap f).index = H.index := by
letI := QuotientGroup.leftRel H letI := QuotientGroup.leftRel (H.comap f) have key : ∀ x y : G', Setoid.r x y ↔ Setoid.r (f x) (f y) := by simp only [QuotientGroup.leftRel_apply] exact fun x y => iff_of_eq (congr_arg (· ∈ H) (by rw [f.map_mul, f.map_inv])) refine Cardinal.toNat_congr (Equiv.ofBijective (Quotient.map' f fun x y => (key x y).mp) ⟨?_, ?_⟩) · simp_rw [← Quotient.eq''] at key refine Quotient.ind' fun x => ?_ refine Quotient.ind' fun y => ?_ exact (key x y).mpr · refine Quotient.ind' fun x => ?_ obtain ⟨y, hy⟩ := hf x exact ⟨y, (Quotient.map'_mk'' f _ y).trans (congr_arg Quotient.mk'' hy)⟩
13
import Mathlib.Analysis.Complex.CauchyIntegral import Mathlib.Analysis.NormedSpace.Completion import Mathlib.Analysis.NormedSpace.Extr import Mathlib.Topology.Order.ExtrClosure #align_import analysis.complex.abs_max from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open TopologicalSpace Metric Set Filter Asymptotics Function MeasureTheory AffineMap Bornology open scoped Topology Filter NNReal Real universe u v w variable {E : Type u} [NormedAddCommGroup E] [NormedSpace ℂ E] {F : Type v} [NormedAddCommGroup F] [NormedSpace ℂ F] local postfix:100 "̂" => UniformSpace.Completion namespace Complex theorem norm_max_aux₁ [CompleteSpace F] {f : ℂ → F} {z w : ℂ} (hd : DiffContOnCl ℂ f (ball z (dist w z))) (hz : IsMaxOn (norm ∘ f) (closedBall z (dist w z)) z) : ‖f w‖ = ‖f z‖ := by -- Consider a circle of radius `r = dist w z`. set r : ℝ := dist w z have hw : w ∈ closedBall z r := mem_closedBall.2 le_rfl -- Assume the converse. Since `‖f w‖ ≤ ‖f z‖`, we have `‖f w‖ < ‖f z‖`. refine (isMaxOn_iff.1 hz _ hw).antisymm (not_lt.1 ?_) rintro hw_lt : ‖f w‖ < ‖f z‖ have hr : 0 < r := dist_pos.2 (ne_of_apply_ne (norm ∘ f) hw_lt.ne) -- Due to Cauchy integral formula, it suffices to prove the following inequality. suffices ‖∮ ζ in C(z, r), (ζ - z)⁻¹ • f ζ‖ < 2 * π * ‖f z‖ by refine this.ne ?_ have A : (∮ ζ in C(z, r), (ζ - z)⁻¹ • f ζ) = (2 * π * I : ℂ) • f z := hd.circleIntegral_sub_inv_smul (mem_ball_self hr) simp [A, norm_smul, Real.pi_pos.le] suffices ‖∮ ζ in C(z, r), (ζ - z)⁻¹ • f ζ‖ < 2 * π * r * (‖f z‖ / r) by rwa [mul_assoc, mul_div_cancel₀ _ hr.ne'] at this have hsub : sphere z r ⊆ closedBall z r := sphere_subset_closedBall refine circleIntegral.norm_integral_lt_of_norm_le_const_of_lt hr ?_ ?_ ⟨w, rfl, ?_⟩ · show ContinuousOn (fun ζ : ℂ => (ζ - z)⁻¹ • f ζ) (sphere z r) refine ((continuousOn_id.sub continuousOn_const).inv₀ ?_).smul (hd.continuousOn_ball.mono hsub) exact fun ζ hζ => sub_ne_zero.2 (ne_of_mem_sphere hζ hr.ne') · show ∀ ζ ∈ sphere z r, ‖(ζ - z)⁻¹ • f ζ‖ ≤ ‖f z‖ / r rintro ζ (hζ : abs (ζ - z) = r) rw [le_div_iff hr, norm_smul, norm_inv, norm_eq_abs, hζ, mul_comm, mul_inv_cancel_left₀ hr.ne'] exact hz (hsub hζ) show ‖(w - z)⁻¹ • f w‖ < ‖f z‖ / r rw [norm_smul, norm_inv, norm_eq_abs, ← div_eq_inv_mul] exact (div_lt_div_right hr).2 hw_lt #align complex.norm_max_aux₁ Complex.norm_max_aux₁ theorem norm_max_aux₂ {f : ℂ → F} {z w : ℂ} (hd : DiffContOnCl ℂ f (ball z (dist w z))) (hz : IsMaxOn (norm ∘ f) (closedBall z (dist w z)) z) : ‖f w‖ = ‖f z‖ := by set e : F →L[ℂ] F̂ := UniformSpace.Completion.toComplL have he : ∀ x, ‖e x‖ = ‖x‖ := UniformSpace.Completion.norm_coe replace hz : IsMaxOn (norm ∘ e ∘ f) (closedBall z (dist w z)) z := by simpa only [IsMaxOn, (· ∘ ·), he] using hz simpa only [he, (· ∘ ·)] using norm_max_aux₁ (e.differentiable.comp_diffContOnCl hd) hz #align complex.norm_max_aux₂ Complex.norm_max_aux₂ theorem norm_max_aux₃ {f : ℂ → F} {z w : ℂ} {r : ℝ} (hr : dist w z = r) (hd : DiffContOnCl ℂ f (ball z r)) (hz : IsMaxOn (norm ∘ f) (ball z r) z) : ‖f w‖ = ‖f z‖ := by subst r rcases eq_or_ne w z with (rfl | hne); · rfl rw [← dist_ne_zero] at hne exact norm_max_aux₂ hd (closure_ball z hne ▸ hz.closure hd.continuousOn.norm) #align complex.norm_max_aux₃ Complex.norm_max_aux₃
Mathlib/Analysis/Complex/AbsMax.lean
181
196
theorem norm_eqOn_closedBall_of_isMaxOn {f : E → F} {z : E} {r : ℝ} (hd : DiffContOnCl ℂ f (ball z r)) (hz : IsMaxOn (norm ∘ f) (ball z r) z) : EqOn (norm ∘ f) (const E ‖f z‖) (closedBall z r) := by
intro w hw rw [mem_closedBall, dist_comm] at hw rcases eq_or_ne z w with (rfl | hne); · rfl set e := (lineMap z w : ℂ → E) have hde : Differentiable ℂ e := (differentiable_id.smul_const (w - z)).add_const z suffices ‖(f ∘ e) (1 : ℂ)‖ = ‖(f ∘ e) (0 : ℂ)‖ by simpa [e] have hr : dist (1 : ℂ) 0 = 1 := by simp have hball : MapsTo e (ball 0 1) (ball z r) := by refine ((lipschitzWith_lineMap z w).mapsTo_ball (mt nndist_eq_zero.1 hne) 0 1).mono Subset.rfl ?_ simpa only [lineMap_apply_zero, mul_one, coe_nndist] using ball_subset_ball hw exact norm_max_aux₃ hr (hd.comp hde.diffContOnCl hball) (hz.comp_mapsTo hball (lineMap_apply_zero z w))
13
import Mathlib.Geometry.Manifold.ChartedSpace #align_import geometry.manifold.local_invariant_properties from "leanprover-community/mathlib"@"431589bce478b2229eba14b14a283250428217db" noncomputable section open scoped Classical open Manifold Topology open Set Filter TopologicalSpace variable {H M H' M' X : Type*} variable [TopologicalSpace H] [TopologicalSpace M] [ChartedSpace H M] variable [TopologicalSpace H'] [TopologicalSpace M'] [ChartedSpace H' M'] variable [TopologicalSpace X] namespace StructureGroupoid variable (G : StructureGroupoid H) (G' : StructureGroupoid H') structure LocalInvariantProp (P : (H → H') → Set H → H → Prop) : Prop where is_local : ∀ {s x u} {f : H → H'}, IsOpen u → x ∈ u → (P f s x ↔ P f (s ∩ u) x) right_invariance' : ∀ {s x f} {e : PartialHomeomorph H H}, e ∈ G → x ∈ e.source → P f s x → P (f ∘ e.symm) (e.symm ⁻¹' s) (e x) congr_of_forall : ∀ {s x} {f g : H → H'}, (∀ y ∈ s, f y = g y) → f x = g x → P f s x → P g s x left_invariance' : ∀ {s x f} {e' : PartialHomeomorph H' H'}, e' ∈ G' → s ⊆ f ⁻¹' e'.source → f x ∈ e'.source → P f s x → P (e' ∘ f) s x #align structure_groupoid.local_invariant_prop StructureGroupoid.LocalInvariantProp variable {G G'} {P : (H → H') → Set H → H → Prop} {s t u : Set H} {x : H} variable (hG : G.LocalInvariantProp G' P) namespace LocalInvariantProp theorem congr_set {s t : Set H} {x : H} {f : H → H'} (hu : s =ᶠ[𝓝 x] t) : P f s x ↔ P f t x := by obtain ⟨o, host, ho, hxo⟩ := mem_nhds_iff.mp hu.mem_iff simp_rw [subset_def, mem_setOf, ← and_congr_left_iff, ← mem_inter_iff, ← Set.ext_iff] at host rw [hG.is_local ho hxo, host, ← hG.is_local ho hxo] #align structure_groupoid.local_invariant_prop.congr_set StructureGroupoid.LocalInvariantProp.congr_set theorem is_local_nhds {s u : Set H} {x : H} {f : H → H'} (hu : u ∈ 𝓝[s] x) : P f s x ↔ P f (s ∩ u) x := hG.congr_set <| mem_nhdsWithin_iff_eventuallyEq.mp hu #align structure_groupoid.local_invariant_prop.is_local_nhds StructureGroupoid.LocalInvariantProp.is_local_nhds theorem congr_iff_nhdsWithin {s : Set H} {x : H} {f g : H → H'} (h1 : f =ᶠ[𝓝[s] x] g) (h2 : f x = g x) : P f s x ↔ P g s x := by simp_rw [hG.is_local_nhds h1] exact ⟨hG.congr_of_forall (fun y hy ↦ hy.2) h2, hG.congr_of_forall (fun y hy ↦ hy.2.symm) h2.symm⟩ #align structure_groupoid.local_invariant_prop.congr_iff_nhds_within StructureGroupoid.LocalInvariantProp.congr_iff_nhdsWithin theorem congr_nhdsWithin {s : Set H} {x : H} {f g : H → H'} (h1 : f =ᶠ[𝓝[s] x] g) (h2 : f x = g x) (hP : P f s x) : P g s x := (hG.congr_iff_nhdsWithin h1 h2).mp hP #align structure_groupoid.local_invariant_prop.congr_nhds_within StructureGroupoid.LocalInvariantProp.congr_nhdsWithin theorem congr_nhdsWithin' {s : Set H} {x : H} {f g : H → H'} (h1 : f =ᶠ[𝓝[s] x] g) (h2 : f x = g x) (hP : P g s x) : P f s x := (hG.congr_iff_nhdsWithin h1 h2).mpr hP #align structure_groupoid.local_invariant_prop.congr_nhds_within' StructureGroupoid.LocalInvariantProp.congr_nhdsWithin' theorem congr_iff {s : Set H} {x : H} {f g : H → H'} (h : f =ᶠ[𝓝 x] g) : P f s x ↔ P g s x := hG.congr_iff_nhdsWithin (mem_nhdsWithin_of_mem_nhds h) (mem_of_mem_nhds h : _) #align structure_groupoid.local_invariant_prop.congr_iff StructureGroupoid.LocalInvariantProp.congr_iff theorem congr {s : Set H} {x : H} {f g : H → H'} (h : f =ᶠ[𝓝 x] g) (hP : P f s x) : P g s x := (hG.congr_iff h).mp hP #align structure_groupoid.local_invariant_prop.congr StructureGroupoid.LocalInvariantProp.congr theorem congr' {s : Set H} {x : H} {f g : H → H'} (h : f =ᶠ[𝓝 x] g) (hP : P g s x) : P f s x := hG.congr h.symm hP #align structure_groupoid.local_invariant_prop.congr' StructureGroupoid.LocalInvariantProp.congr'
Mathlib/Geometry/Manifold/LocalInvariantProperties.lean
121
136
theorem left_invariance {s : Set H} {x : H} {f : H → H'} {e' : PartialHomeomorph H' H'} (he' : e' ∈ G') (hfs : ContinuousWithinAt f s x) (hxe' : f x ∈ e'.source) : P (e' ∘ f) s x ↔ P f s x := by
have h2f := hfs.preimage_mem_nhdsWithin (e'.open_source.mem_nhds hxe') have h3f := ((e'.continuousAt hxe').comp_continuousWithinAt hfs).preimage_mem_nhdsWithin <| e'.symm.open_source.mem_nhds <| e'.mapsTo hxe' constructor · intro h rw [hG.is_local_nhds h3f] at h have h2 := hG.left_invariance' (G'.symm he') inter_subset_right (e'.mapsTo hxe') h rw [← hG.is_local_nhds h3f] at h2 refine hG.congr_nhdsWithin ?_ (e'.left_inv hxe') h2 exact eventually_of_mem h2f fun x' ↦ e'.left_inv · simp_rw [hG.is_local_nhds h2f] exact hG.left_invariance' he' inter_subset_right hxe'
13
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Calculus.FDeriv.Linear import Mathlib.Analysis.Calculus.FDeriv.Comp #align_import analysis.calculus.fderiv.equiv from "leanprover-community/mathlib"@"e3fb84046afd187b710170887195d50bada934ee" open Filter Asymptotics ContinuousLinearMap Set Metric open scoped Classical open Topology NNReal Filter Asymptotics ENNReal noncomputable section section variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace 𝕜 G'] variable {f f₀ f₁ g : E → F} variable {f' f₀' f₁' g' : E →L[𝕜] F} variable (e : E →L[𝕜] F) variable {x : E} variable {s t : Set E} variable {L L₁ L₂ : Filter E} theorem HasStrictFDerivAt.of_local_left_inverse {f : E → F} {f' : E ≃L[𝕜] F} {g : F → E} {a : F} (hg : ContinuousAt g a) (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) (g a)) (hfg : ∀ᶠ y in 𝓝 a, f (g y) = y) : HasStrictFDerivAt g (f'.symm : F →L[𝕜] E) a := by replace hg := hg.prod_map' hg replace hfg := hfg.prod_mk_nhds hfg have : (fun p : F × F => g p.1 - g p.2 - f'.symm (p.1 - p.2)) =O[𝓝 (a, a)] fun p : F × F => f' (g p.1 - g p.2) - (p.1 - p.2) := by refine ((f'.symm : F →L[𝕜] E).isBigO_comp _ _).congr (fun x => ?_) fun _ => rfl simp refine this.trans_isLittleO ?_ clear this refine ((hf.comp_tendsto hg).symm.congr' (hfg.mono ?_) (eventually_of_forall fun _ => rfl)).trans_isBigO ?_ · rintro p ⟨hp1, hp2⟩ simp [hp1, hp2] · refine (hf.isBigO_sub_rev.comp_tendsto hg).congr' (eventually_of_forall fun _ => rfl) (hfg.mono ?_) rintro p ⟨hp1, hp2⟩ simp only [(· ∘ ·), hp1, hp2] #align has_strict_fderiv_at.of_local_left_inverse HasStrictFDerivAt.of_local_left_inverse
Mathlib/Analysis/Calculus/FDeriv/Equiv.lean
418
433
theorem HasFDerivAt.of_local_left_inverse {f : E → F} {f' : E ≃L[𝕜] F} {g : F → E} {a : F} (hg : ContinuousAt g a) (hf : HasFDerivAt f (f' : E →L[𝕜] F) (g a)) (hfg : ∀ᶠ y in 𝓝 a, f (g y) = y) : HasFDerivAt g (f'.symm : F →L[𝕜] E) a := by
have : (fun x : F => g x - g a - f'.symm (x - a)) =O[𝓝 a] fun x : F => f' (g x - g a) - (x - a) := by refine ((f'.symm : F →L[𝕜] E).isBigO_comp _ _).congr (fun x => ?_) fun _ => rfl simp refine HasFDerivAtFilter.of_isLittleO <| this.trans_isLittleO ?_ clear this refine ((hf.isLittleO.comp_tendsto hg).symm.congr' (hfg.mono ?_) .rfl).trans_isBigO ?_ · intro p hp simp [hp, hfg.self_of_nhds] · refine ((hf.isBigO_sub_rev f'.antilipschitz).comp_tendsto hg).congr' (eventually_of_forall fun _ => rfl) (hfg.mono ?_) rintro p hp simp only [(· ∘ ·), hp, hfg.self_of_nhds]
13
import Mathlib.Analysis.Analytic.Constructions import Mathlib.Analysis.Calculus.Dslope import Mathlib.Analysis.Calculus.FDeriv.Analytic import Mathlib.Analysis.Analytic.Uniqueness #align_import analysis.analytic.isolated_zeros from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090" open scoped Classical open Filter Function Nat FormalMultilinearSeries EMetric Set open scoped Topology variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {s : E} {p q : FormalMultilinearSeries 𝕜 𝕜 E} {f g : 𝕜 → E} {n : ℕ} {z z₀ : 𝕜} namespace HasSum variable {a : ℕ → E} theorem hasSum_at_zero (a : ℕ → E) : HasSum (fun n => (0 : 𝕜) ^ n • a n) (a 0) := by convert hasSum_single (α := E) 0 fun b h ↦ _ <;> simp [*] #align has_sum.has_sum_at_zero HasSum.hasSum_at_zero
Mathlib/Analysis/Analytic/IsolatedZeros.lean
48
62
theorem exists_hasSum_smul_of_apply_eq_zero (hs : HasSum (fun m => z ^ m • a m) s) (ha : ∀ k < n, a k = 0) : ∃ t : E, z ^ n • t = s ∧ HasSum (fun m => z ^ m • a (m + n)) t := by
obtain rfl | hn := n.eq_zero_or_pos · simpa by_cases h : z = 0 · have : s = 0 := hs.unique (by simpa [ha 0 hn, h] using hasSum_at_zero a) exact ⟨a n, by simp [h, hn.ne', this], by simpa [h] using hasSum_at_zero fun m => a (m + n)⟩ · refine ⟨(z ^ n)⁻¹ • s, by field_simp [smul_smul], ?_⟩ have h1 : ∑ i ∈ Finset.range n, z ^ i • a i = 0 := Finset.sum_eq_zero fun k hk => by simp [ha k (Finset.mem_range.mp hk)] have h2 : HasSum (fun m => z ^ (m + n) • a (m + n)) s := by simpa [h1] using (hasSum_nat_add_iff' n).mpr hs convert h2.const_smul (z⁻¹ ^ n) using 1 · field_simp [pow_add, smul_smul] · simp only [inv_pow]
13
import Mathlib.Analysis.SpecialFunctions.Exponential #align_import analysis.special_functions.trigonometric.series from "leanprover-community/mathlib"@"ccf84e0d918668460a34aa19d02fe2e0e2286da0" open NormedSpace open scoped Nat section SinCos
Mathlib/Analysis/SpecialFunctions/Trigonometric/Series.lean
32
46
theorem Complex.hasSum_cos' (z : ℂ) : HasSum (fun n : ℕ => (z * Complex.I) ^ (2 * n) / ↑(2 * n)!) (Complex.cos z) := by
rw [Complex.cos, Complex.exp_eq_exp_ℂ] have := ((expSeries_div_hasSum_exp ℂ (z * Complex.I)).add (expSeries_div_hasSum_exp ℂ (-z * Complex.I))).div_const 2 replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this dsimp [Function.comp_def] at this simp_rw [← mul_comm 2 _] at this refine this.prod_fiberwise fun k => ?_ dsimp only convert hasSum_fintype (_ : Fin 2 → ℂ) using 1 rw [Fin.sum_univ_two] simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ, pow_mul, mul_pow, neg_sq, ← two_mul, neg_mul, mul_neg, neg_div, add_right_neg, zero_div, add_zero, mul_div_cancel_left₀ _ (two_ne_zero : (2 : ℂ) ≠ 0)]
13
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section variable {E : Type*} [NormedAddCommGroup E] section MellinDiff theorem isBigO_rpow_top_log_smul [NormedSpace ℝ E] {a b : ℝ} {f : ℝ → E} (hab : b < a) (hf : f =O[atTop] (· ^ (-a))) : (fun t : ℝ => log t • f t) =O[atTop] (· ^ (-b)) := by refine ((isLittleO_log_rpow_atTop (sub_pos.mpr hab)).isBigO.smul hf).congr' (eventually_of_forall fun t => by rfl) ((eventually_gt_atTop 0).mp (eventually_of_forall fun t ht => ?_)) simp only rw [smul_eq_mul, ← rpow_add ht, ← sub_eq_add_neg, sub_eq_add_neg a, add_sub_cancel_left] set_option linter.uppercaseLean3 false in #align is_O_rpow_top_log_smul isBigO_rpow_top_log_smul
Mathlib/Analysis/MellinTransform.lean
317
332
theorem isBigO_rpow_zero_log_smul [NormedSpace ℝ E] {a b : ℝ} {f : ℝ → E} (hab : a < b) (hf : f =O[𝓝[>] 0] (· ^ (-a))) : (fun t : ℝ => log t • f t) =O[𝓝[>] 0] (· ^ (-b)) := by
have : log =o[𝓝[>] 0] fun t : ℝ => t ^ (a - b) := by refine ((isLittleO_log_rpow_atTop (sub_pos.mpr hab)).neg_left.comp_tendsto tendsto_inv_zero_atTop).congr' (eventually_nhdsWithin_iff.mpr <| eventually_of_forall fun t ht => ?_) (eventually_nhdsWithin_iff.mpr <| eventually_of_forall fun t ht => ?_) · simp_rw [Function.comp_apply, ← one_div, log_div one_ne_zero (ne_of_gt ht), Real.log_one, zero_sub, neg_neg] · simp_rw [Function.comp_apply, inv_rpow (le_of_lt ht), ← rpow_neg (le_of_lt ht), neg_sub] refine (this.isBigO.smul hf).congr' (eventually_of_forall fun t => by rfl) (eventually_nhdsWithin_iff.mpr (eventually_of_forall fun t ht => ?_)) simp_rw [smul_eq_mul, ← rpow_add ht] congr 1 abel
13
import Mathlib.Data.Finset.Lattice import Mathlib.Data.Multiset.Powerset #align_import data.finset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" namespace Finset open Function Multiset variable {α : Type*} {s t : Finset α} section Powerset def powerset (s : Finset α) : Finset (Finset α) := ⟨(s.1.powerset.pmap Finset.mk) fun _t h => nodup_of_le (mem_powerset.1 h) s.nodup, s.nodup.powerset.pmap fun _a _ha _b _hb => congr_arg Finset.val⟩ #align finset.powerset Finset.powerset @[simp] theorem mem_powerset {s t : Finset α} : s ∈ powerset t ↔ s ⊆ t := by cases s simp [powerset, mem_mk, mem_pmap, mk.injEq, mem_powerset, exists_prop, exists_eq_right, ← val_le_iff] #align finset.mem_powerset Finset.mem_powerset @[simp, norm_cast] theorem coe_powerset (s : Finset α) : (s.powerset : Set (Finset α)) = ((↑) : Finset α → Set α) ⁻¹' (s : Set α).powerset := by ext simp #align finset.coe_powerset Finset.coe_powerset -- Porting note: remove @[simp], simp can prove it theorem empty_mem_powerset (s : Finset α) : ∅ ∈ powerset s := mem_powerset.2 (empty_subset _) #align finset.empty_mem_powerset Finset.empty_mem_powerset -- Porting note: remove @[simp], simp can prove it theorem mem_powerset_self (s : Finset α) : s ∈ powerset s := mem_powerset.2 Subset.rfl #align finset.mem_powerset_self Finset.mem_powerset_self @[aesop safe apply (rule_sets := [finsetNonempty])] theorem powerset_nonempty (s : Finset α) : s.powerset.Nonempty := ⟨∅, empty_mem_powerset _⟩ #align finset.powerset_nonempty Finset.powerset_nonempty @[simp] theorem powerset_mono {s t : Finset α} : powerset s ⊆ powerset t ↔ s ⊆ t := ⟨fun h => mem_powerset.1 <| h <| mem_powerset_self _, fun st _u h => mem_powerset.2 <| Subset.trans (mem_powerset.1 h) st⟩ #align finset.powerset_mono Finset.powerset_mono theorem powerset_injective : Injective (powerset : Finset α → Finset (Finset α)) := (injective_of_le_imp_le _) powerset_mono.1 #align finset.powerset_injective Finset.powerset_injective @[simp] theorem powerset_inj : powerset s = powerset t ↔ s = t := powerset_injective.eq_iff #align finset.powerset_inj Finset.powerset_inj @[simp] theorem powerset_empty : (∅ : Finset α).powerset = {∅} := rfl #align finset.powerset_empty Finset.powerset_empty @[simp] theorem powerset_eq_singleton_empty : s.powerset = {∅} ↔ s = ∅ := by rw [← powerset_empty, powerset_inj] #align finset.powerset_eq_singleton_empty Finset.powerset_eq_singleton_empty @[simp] theorem card_powerset (s : Finset α) : card (powerset s) = 2 ^ card s := (card_pmap _ _ _).trans (Multiset.card_powerset s.1) #align finset.card_powerset Finset.card_powerset theorem not_mem_of_mem_powerset_of_not_mem {s t : Finset α} {a : α} (ht : t ∈ s.powerset) (h : a ∉ s) : a ∉ t := by apply mt _ h apply mem_powerset.1 ht #align finset.not_mem_of_mem_powerset_of_not_mem Finset.not_mem_of_mem_powerset_of_not_mem
Mathlib/Data/Finset/Powerset.lean
99
113
theorem powerset_insert [DecidableEq α] (s : Finset α) (a : α) : powerset (insert a s) = s.powerset ∪ s.powerset.image (insert a) := by
ext t simp only [exists_prop, mem_powerset, mem_image, mem_union, subset_insert_iff] by_cases h : a ∈ t · constructor · exact fun H => Or.inr ⟨_, H, insert_erase h⟩ · intro H cases' H with H H · exact Subset.trans (erase_subset a t) H · rcases H with ⟨u, hu⟩ rw [← hu.2] exact Subset.trans (erase_insert_subset a u) hu.1 · have : ¬∃ u : Finset α, u ⊆ s ∧ insert a u = t := by simp [Ne.symm (ne_insert_of_not_mem _ _ h)] simp [Finset.erase_eq_of_not_mem h, this]
13
import Mathlib.Algebra.BigOperators.Group.Finset import Mathlib.Data.Finsupp.Defs import Mathlib.Data.Finset.Pairwise #align_import data.finsupp.big_operators from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf" variable {ι M : Type*} [DecidableEq ι] theorem List.support_sum_subset [AddMonoid M] (l : List (ι →₀ M)) : l.sum.support ⊆ l.foldr (Finsupp.support · ⊔ ·) ∅ := by induction' l with hd tl IH · simp · simp only [List.sum_cons, Finset.union_comm] refine Finsupp.support_add.trans (Finset.union_subset_union ?_ IH) rfl #align list.support_sum_subset List.support_sum_subset theorem Multiset.support_sum_subset [AddCommMonoid M] (s : Multiset (ι →₀ M)) : s.sum.support ⊆ (s.map Finsupp.support).sup := by induction s using Quot.inductionOn simpa only [Multiset.quot_mk_to_coe'', Multiset.sum_coe, Multiset.map_coe, Multiset.sup_coe, List.foldr_map] using List.support_sum_subset _ #align multiset.support_sum_subset Multiset.support_sum_subset theorem Finset.support_sum_subset [AddCommMonoid M] (s : Finset (ι →₀ M)) : (s.sum id).support ⊆ Finset.sup s Finsupp.support := by classical convert Multiset.support_sum_subset s.1; simp #align finset.support_sum_subset Finset.support_sum_subset theorem List.mem_foldr_sup_support_iff [Zero M] {l : List (ι →₀ M)} {x : ι} : x ∈ l.foldr (Finsupp.support · ⊔ ·) ∅ ↔ ∃ f ∈ l, x ∈ f.support := by simp only [Finset.sup_eq_union, List.foldr_map, Finsupp.mem_support_iff, exists_prop] induction' l with hd tl IH · simp · simp only [foldr, Function.comp_apply, Finset.mem_union, Finsupp.mem_support_iff, ne_eq, IH, find?, mem_cons, exists_eq_or_imp] #align list.mem_foldr_sup_support_iff List.mem_foldr_sup_support_iff theorem Multiset.mem_sup_map_support_iff [Zero M] {s : Multiset (ι →₀ M)} {x : ι} : x ∈ (s.map Finsupp.support).sup ↔ ∃ f ∈ s, x ∈ f.support := Quot.inductionOn s fun _ ↦ by simpa only [Multiset.quot_mk_to_coe'', Multiset.map_coe, Multiset.sup_coe, List.foldr_map] using List.mem_foldr_sup_support_iff #align multiset.mem_sup_map_support_iff Multiset.mem_sup_map_support_iff theorem Finset.mem_sup_support_iff [Zero M] {s : Finset (ι →₀ M)} {x : ι} : x ∈ s.sup Finsupp.support ↔ ∃ f ∈ s, x ∈ f.support := Multiset.mem_sup_map_support_iff #align finset.mem_sup_support_iff Finset.mem_sup_support_iff
Mathlib/Data/Finsupp/BigOperators.lean
81
96
theorem List.support_sum_eq [AddMonoid M] (l : List (ι →₀ M)) (hl : l.Pairwise (_root_.Disjoint on Finsupp.support)) : l.sum.support = l.foldr (Finsupp.support · ⊔ ·) ∅ := by
induction' l with hd tl IH · simp · simp only [List.pairwise_cons] at hl simp only [List.sum_cons, List.foldr_cons, Function.comp_apply] rw [Finsupp.support_add_eq, IH hl.right, Finset.sup_eq_union] suffices _root_.Disjoint hd.support (tl.foldr (fun x y ↦ (Finsupp.support x ⊔ y)) ∅) by exact Finset.disjoint_of_subset_right (List.support_sum_subset _) this rw [← List.foldr_map, ← Finset.bot_eq_empty, List.foldr_sup_eq_sup_toFinset, Finset.disjoint_sup_right] intro f hf simp only [List.mem_toFinset, List.mem_map] at hf obtain ⟨f, hf, rfl⟩ := hf exact hl.left _ hf
13
import Mathlib.Init.Core import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" open Polynomial Algebra FiniteDimensional Set universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section @[mk_iff] class IsCyclotomicExtension : Prop where exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section variable {A B}
Mathlib/NumberTheory/Cyclotomic/Basic.lean
368
384
theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by
simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine le_antisymm (adjoin_mono fun x hx => ?_) (adjoin_le fun x hx => ?_) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine ⟨n, Nat.mem_divisors_self n n.ne_zero, ?_⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin ?_) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] exact ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩
13
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal #align_import analysis.special_functions.pow.asymptotics from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" set_option linter.uppercaseLean3 false noncomputable section open scoped Classical open Real Topology NNReal ENNReal Filter ComplexConjugate Finset Set section Limits open Real Filter theorem tendsto_rpow_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^ y) atTop atTop := by rw [tendsto_atTop_atTop] intro b use max b 0 ^ (1 / y) intro x hx exact le_of_max_le_left (by convert rpow_le_rpow (rpow_nonneg (le_max_right b 0) (1 / y)) hx (le_of_lt hy) using 1 rw [← rpow_mul (le_max_right b 0), (eq_div_iff (ne_of_gt hy)).mp rfl, Real.rpow_one]) #align tendsto_rpow_at_top tendsto_rpow_atTop theorem tendsto_rpow_neg_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^ (-y)) atTop (𝓝 0) := Tendsto.congr' (eventuallyEq_of_mem (Ioi_mem_atTop 0) fun _ hx => (rpow_neg (le_of_lt hx) y).symm) (tendsto_rpow_atTop hy).inv_tendsto_atTop #align tendsto_rpow_neg_at_top tendsto_rpow_neg_atTop open Asymptotics in lemma tendsto_rpow_atTop_of_base_lt_one (b : ℝ) (hb₀ : -1 < b) (hb₁ : b < 1) : Tendsto (b ^ · : ℝ → ℝ) atTop (𝓝 (0:ℝ)) := by rcases lt_trichotomy b 0 with hb|rfl|hb case inl => -- b < 0 simp_rw [Real.rpow_def_of_nonpos hb.le, hb.ne, ite_false] rw [← isLittleO_const_iff (c := (1:ℝ)) one_ne_zero, (one_mul (1 : ℝ)).symm] refine IsLittleO.mul_isBigO ?exp ?cos case exp => rw [isLittleO_const_iff one_ne_zero] refine tendsto_exp_atBot.comp <| (tendsto_const_mul_atBot_of_neg ?_).mpr tendsto_id rw [← log_neg_eq_log, log_neg_iff (by linarith)] linarith case cos => rw [isBigO_iff] exact ⟨1, eventually_of_forall fun x => by simp [Real.abs_cos_le_one]⟩ case inr.inl => -- b = 0 refine Tendsto.mono_right ?_ (Iff.mpr pure_le_nhds_iff rfl) rw [tendsto_pure] filter_upwards [eventually_ne_atTop 0] with _ hx simp [hx] case inr.inr => -- b > 0 simp_rw [Real.rpow_def_of_pos hb] refine tendsto_exp_atBot.comp <| (tendsto_const_mul_atBot_of_neg ?_).mpr tendsto_id exact (log_neg_iff hb).mpr hb₁ lemma tendsto_rpow_atTop_of_base_gt_one (b : ℝ) (hb : 1 < b) : Tendsto (b ^ · : ℝ → ℝ) atBot (𝓝 (0:ℝ)) := by simp_rw [Real.rpow_def_of_pos (by positivity : 0 < b)] refine tendsto_exp_atBot.comp <| (tendsto_const_mul_atBot_of_pos ?_).mpr tendsto_id exact (log_pos_iff (by positivity)).mpr <| by aesop lemma tendsto_rpow_atBot_of_base_lt_one (b : ℝ) (hb₀ : 0 < b) (hb₁ : b < 1) : Tendsto (b ^ · : ℝ → ℝ) atBot atTop := by simp_rw [Real.rpow_def_of_pos (by positivity : 0 < b)] refine tendsto_exp_atTop.comp <| (tendsto_const_mul_atTop_iff_neg <| tendsto_id (α := ℝ)).mpr ?_ exact (log_neg_iff hb₀).mpr hb₁ lemma tendsto_rpow_atBot_of_base_gt_one (b : ℝ) (hb : 1 < b) : Tendsto (b ^ · : ℝ → ℝ) atBot (𝓝 0) := by simp_rw [Real.rpow_def_of_pos (by positivity : 0 < b)] refine tendsto_exp_atBot.comp <| (tendsto_const_mul_atBot_iff_pos <| tendsto_id (α := ℝ)).mpr ?_ exact (log_pos_iff (by positivity)).mpr <| by aesop
Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean
102
116
theorem tendsto_rpow_div_mul_add (a b c : ℝ) (hb : 0 ≠ b) : Tendsto (fun x => x ^ (a / (b * x + c))) atTop (𝓝 1) := by
refine Tendsto.congr' ?_ ((tendsto_exp_nhds_zero_nhds_one.comp (by simpa only [mul_zero, pow_one] using (tendsto_const_nhds (x := a)).mul (tendsto_div_pow_mul_exp_add_atTop b c 1 hb))).comp tendsto_log_atTop) apply eventuallyEq_of_mem (Ioi_mem_atTop (0 : ℝ)) intro x hx simp only [Set.mem_Ioi, Function.comp_apply] at hx ⊢ rw [exp_log hx, ← exp_log (rpow_pos_of_pos hx (a / (b * x + c))), log_rpow hx (a / (b * x + c))] field_simp
13
import Mathlib.Analysis.Seminorm import Mathlib.Topology.Algebra.Equicontinuity import Mathlib.Topology.MetricSpace.Equicontinuity import Mathlib.Topology.Algebra.FilterBasis import Mathlib.Topology.Algebra.Module.LocallyConvex #align_import analysis.locally_convex.with_seminorms from "leanprover-community/mathlib"@"b31173ee05c911d61ad6a05bd2196835c932e0ec" open NormedField Set Seminorm TopologicalSpace Filter List open NNReal Pointwise Topology Uniformity variable {𝕜 𝕜₂ 𝕝 𝕝₂ E F G ι ι' : Type*} section FilterBasis variable [NormedField 𝕜] [AddCommGroup E] [Module 𝕜 E] variable (𝕜 E ι) abbrev SeminormFamily := ι → Seminorm 𝕜 E #align seminorm_family SeminormFamily variable {𝕜 E ι} namespace SeminormFamily def basisSets (p : SeminormFamily 𝕜 E ι) : Set (Set E) := ⋃ (s : Finset ι) (r) (_ : 0 < r), singleton (ball (s.sup p) (0 : E) r) #align seminorm_family.basis_sets SeminormFamily.basisSets variable (p : SeminormFamily 𝕜 E ι) theorem basisSets_iff {U : Set E} : U ∈ p.basisSets ↔ ∃ (i : Finset ι) (r : ℝ), 0 < r ∧ U = ball (i.sup p) 0 r := by simp only [basisSets, mem_iUnion, exists_prop, mem_singleton_iff] #align seminorm_family.basis_sets_iff SeminormFamily.basisSets_iff theorem basisSets_mem (i : Finset ι) {r : ℝ} (hr : 0 < r) : (i.sup p).ball 0 r ∈ p.basisSets := (basisSets_iff _).mpr ⟨i, _, hr, rfl⟩ #align seminorm_family.basis_sets_mem SeminormFamily.basisSets_mem theorem basisSets_singleton_mem (i : ι) {r : ℝ} (hr : 0 < r) : (p i).ball 0 r ∈ p.basisSets := (basisSets_iff _).mpr ⟨{i}, _, hr, by rw [Finset.sup_singleton]⟩ #align seminorm_family.basis_sets_singleton_mem SeminormFamily.basisSets_singleton_mem theorem basisSets_nonempty [Nonempty ι] : p.basisSets.Nonempty := by let i := Classical.arbitrary ι refine nonempty_def.mpr ⟨(p i).ball 0 1, ?_⟩ exact p.basisSets_singleton_mem i zero_lt_one #align seminorm_family.basis_sets_nonempty SeminormFamily.basisSets_nonempty
Mathlib/Analysis/LocallyConvex/WithSeminorms.lean
98
112
theorem basisSets_intersect (U V : Set E) (hU : U ∈ p.basisSets) (hV : V ∈ p.basisSets) : ∃ z ∈ p.basisSets, z ⊆ U ∩ V := by
classical rcases p.basisSets_iff.mp hU with ⟨s, r₁, hr₁, hU⟩ rcases p.basisSets_iff.mp hV with ⟨t, r₂, hr₂, hV⟩ use ((s ∪ t).sup p).ball 0 (min r₁ r₂) refine ⟨p.basisSets_mem (s ∪ t) (lt_min_iff.mpr ⟨hr₁, hr₂⟩), ?_⟩ rw [hU, hV, ball_finset_sup_eq_iInter _ _ _ (lt_min_iff.mpr ⟨hr₁, hr₂⟩), ball_finset_sup_eq_iInter _ _ _ hr₁, ball_finset_sup_eq_iInter _ _ _ hr₂] exact Set.subset_inter (Set.iInter₂_mono' fun i hi => ⟨i, Finset.subset_union_left hi, ball_mono <| min_le_left _ _⟩) (Set.iInter₂_mono' fun i hi => ⟨i, Finset.subset_union_right hi, ball_mono <| min_le_right _ _⟩)
13
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine #align_import geometry.euclidean.angle.unoriented.right_angle from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section open scoped EuclideanGeometry open scoped Real open scoped RealInnerProductSpace namespace InnerProductGeometry variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] theorem norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two (x y : V) : ‖x + y‖ * ‖x + y‖ = ‖x‖ * ‖x‖ + ‖y‖ * ‖y‖ ↔ angle x y = π / 2 := by rw [norm_add_sq_eq_norm_sq_add_norm_sq_iff_real_inner_eq_zero] exact inner_eq_zero_iff_angle_eq_pi_div_two x y #align inner_product_geometry.norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two InnerProductGeometry.norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two theorem norm_add_sq_eq_norm_sq_add_norm_sq' (x y : V) (h : angle x y = π / 2) : ‖x + y‖ * ‖x + y‖ = ‖x‖ * ‖x‖ + ‖y‖ * ‖y‖ := (norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two x y).2 h #align inner_product_geometry.norm_add_sq_eq_norm_sq_add_norm_sq' InnerProductGeometry.norm_add_sq_eq_norm_sq_add_norm_sq' theorem norm_sub_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two (x y : V) : ‖x - y‖ * ‖x - y‖ = ‖x‖ * ‖x‖ + ‖y‖ * ‖y‖ ↔ angle x y = π / 2 := by rw [norm_sub_sq_eq_norm_sq_add_norm_sq_iff_real_inner_eq_zero] exact inner_eq_zero_iff_angle_eq_pi_div_two x y #align inner_product_geometry.norm_sub_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two InnerProductGeometry.norm_sub_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two theorem norm_sub_sq_eq_norm_sq_add_norm_sq' (x y : V) (h : angle x y = π / 2) : ‖x - y‖ * ‖x - y‖ = ‖x‖ * ‖x‖ + ‖y‖ * ‖y‖ := (norm_sub_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two x y).2 h #align inner_product_geometry.norm_sub_sq_eq_norm_sq_add_norm_sq' InnerProductGeometry.norm_sub_sq_eq_norm_sq_add_norm_sq' theorem angle_add_eq_arccos_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) : angle x (x + y) = Real.arccos (‖x‖ / ‖x + y‖) := by rw [angle, inner_add_right, h, add_zero, real_inner_self_eq_norm_mul_norm] by_cases hx : ‖x‖ = 0; · simp [hx] rw [div_mul_eq_div_div, mul_self_div_self] #align inner_product_geometry.angle_add_eq_arccos_of_inner_eq_zero InnerProductGeometry.angle_add_eq_arccos_of_inner_eq_zero
Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean
77
91
theorem angle_add_eq_arcsin_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x ≠ 0 ∨ y ≠ 0) : angle x (x + y) = Real.arcsin (‖y‖ / ‖x + y‖) := by
have hxy : ‖x + y‖ ^ 2 ≠ 0 := by rw [pow_two, norm_add_sq_eq_norm_sq_add_norm_sq_real h, ne_comm] refine ne_of_lt ?_ rcases h0 with (h0 | h0) · exact Left.add_pos_of_pos_of_nonneg (mul_self_pos.2 (norm_ne_zero_iff.2 h0)) (mul_self_nonneg _) · exact Left.add_pos_of_nonneg_of_pos (mul_self_nonneg _) (mul_self_pos.2 (norm_ne_zero_iff.2 h0)) rw [angle_add_eq_arccos_of_inner_eq_zero h, Real.arccos_eq_arcsin (div_nonneg (norm_nonneg _) (norm_nonneg _)), div_pow, one_sub_div hxy] nth_rw 1 [pow_two] rw [norm_add_sq_eq_norm_sq_add_norm_sq_real h, pow_two, add_sub_cancel_left, ← pow_two, ← div_pow, Real.sqrt_sq (div_nonneg (norm_nonneg _) (norm_nonneg _))]
13
import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.Analysis.NormedSpace.Banach import Mathlib.LinearAlgebra.SesquilinearForm #align_import analysis.inner_product_space.symmetric from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open RCLike open ComplexConjugate variable {𝕜 E E' F G : Type*} [RCLike 𝕜] variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] variable [NormedAddCommGroup F] [InnerProductSpace 𝕜 F] variable [NormedAddCommGroup G] [InnerProductSpace 𝕜 G] variable [NormedAddCommGroup E'] [InnerProductSpace ℝ E'] local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y namespace LinearMap def IsSymmetric (T : E →ₗ[𝕜] E) : Prop := ∀ x y, ⟪T x, y⟫ = ⟪x, T y⟫ #align linear_map.is_symmetric LinearMap.IsSymmetric theorem IsSymmetric.conj_inner_sym {T : E →ₗ[𝕜] E} (hT : IsSymmetric T) (x y : E) : conj ⟪T x, y⟫ = ⟪T y, x⟫ := by rw [hT x y, inner_conj_symm] #align linear_map.is_symmetric.conj_inner_sym LinearMap.IsSymmetric.conj_inner_sym @[simp] theorem IsSymmetric.apply_clm {T : E →L[𝕜] E} (hT : IsSymmetric (T : E →ₗ[𝕜] E)) (x y : E) : ⟪T x, y⟫ = ⟪x, T y⟫ := hT x y #align linear_map.is_symmetric.apply_clm LinearMap.IsSymmetric.apply_clm theorem isSymmetric_zero : (0 : E →ₗ[𝕜] E).IsSymmetric := fun x y => (inner_zero_right x : ⟪x, 0⟫ = 0).symm ▸ (inner_zero_left y : ⟪0, y⟫ = 0) #align linear_map.is_symmetric_zero LinearMap.isSymmetric_zero theorem isSymmetric_id : (LinearMap.id : E →ₗ[𝕜] E).IsSymmetric := fun _ _ => rfl #align linear_map.is_symmetric_id LinearMap.isSymmetric_id theorem IsSymmetric.add {T S : E →ₗ[𝕜] E} (hT : T.IsSymmetric) (hS : S.IsSymmetric) : (T + S).IsSymmetric := by intro x y rw [LinearMap.add_apply, inner_add_left, hT x y, hS x y, ← inner_add_right] rfl #align linear_map.is_symmetric.add LinearMap.IsSymmetric.add theorem IsSymmetric.continuous [CompleteSpace E] {T : E →ₗ[𝕜] E} (hT : IsSymmetric T) : Continuous T := by -- We prove it by using the closed graph theorem refine T.continuous_of_seq_closed_graph fun u x y hu hTu => ?_ rw [← sub_eq_zero, ← @inner_self_eq_zero 𝕜] have hlhs : ∀ k : ℕ, ⟪T (u k) - T x, y - T x⟫ = ⟪u k - x, T (y - T x)⟫ := by intro k rw [← T.map_sub, hT] refine tendsto_nhds_unique ((hTu.sub_const _).inner tendsto_const_nhds) ?_ simp_rw [Function.comp_apply, hlhs] rw [← inner_zero_left (T (y - T x))] refine Filter.Tendsto.inner ?_ tendsto_const_nhds rw [← sub_self x] exact hu.sub_const _ #align linear_map.is_symmetric.continuous LinearMap.IsSymmetric.continuous @[simp] theorem IsSymmetric.coe_reApplyInnerSelf_apply {T : E →L[𝕜] E} (hT : IsSymmetric (T : E →ₗ[𝕜] E)) (x : E) : (T.reApplyInnerSelf x : 𝕜) = ⟪T x, x⟫ := by rsuffices ⟨r, hr⟩ : ∃ r : ℝ, ⟪T x, x⟫ = r · simp [hr, T.reApplyInnerSelf_apply] rw [← conj_eq_iff_real] exact hT.conj_inner_sym x x #align linear_map.is_symmetric.coe_re_apply_inner_self_apply LinearMap.IsSymmetric.coe_reApplyInnerSelf_apply theorem IsSymmetric.restrict_invariant {T : E →ₗ[𝕜] E} (hT : IsSymmetric T) {V : Submodule 𝕜 E} (hV : ∀ v ∈ V, T v ∈ V) : IsSymmetric (T.restrict hV) := fun v w => hT v w #align linear_map.is_symmetric.restrict_invariant LinearMap.IsSymmetric.restrict_invariant theorem IsSymmetric.restrictScalars {T : E →ₗ[𝕜] E} (hT : T.IsSymmetric) : @LinearMap.IsSymmetric ℝ E _ _ (InnerProductSpace.rclikeToReal 𝕜 E) (@LinearMap.restrictScalars ℝ 𝕜 _ _ _ _ _ _ (InnerProductSpace.rclikeToReal 𝕜 E).toModule (InnerProductSpace.rclikeToReal 𝕜 E).toModule _ _ _ T) := fun x y => by simp [hT x y, real_inner_eq_re_inner, LinearMap.coe_restrictScalars ℝ] #align linear_map.is_symmetric.restrict_scalars LinearMap.IsSymmetric.restrictScalars
Mathlib/Analysis/InnerProductSpace/Symmetric.lean
163
180
theorem IsSymmetric.inner_map_polarization {T : E →ₗ[𝕜] E} (hT : T.IsSymmetric) (x y : E) : ⟪T x, y⟫ = (⟪T (x + y), x + y⟫ - ⟪T (x - y), x - y⟫ - I * ⟪T (x + (I : 𝕜) • y), x + (I : 𝕜) • y⟫ + I * ⟪T (x - (I : 𝕜) • y), x - (I : 𝕜) • y⟫) / 4 := by
rcases@I_mul_I_ax 𝕜 _ with (h | h) · simp_rw [h, zero_mul, sub_zero, add_zero, map_add, map_sub, inner_add_left, inner_add_right, inner_sub_left, inner_sub_right, hT x, ← inner_conj_symm x (T y)] suffices (re ⟪T y, x⟫ : 𝕜) = ⟪T y, x⟫ by rw [conj_eq_iff_re.mpr this] ring rw [← re_add_im ⟪T y, x⟫] simp_rw [h, mul_zero, add_zero] norm_cast · simp_rw [map_add, map_sub, inner_add_left, inner_add_right, inner_sub_left, inner_sub_right, LinearMap.map_smul, inner_smul_left, inner_smul_right, RCLike.conj_I, mul_add, mul_sub, sub_sub, ← mul_assoc, mul_neg, h, neg_neg, one_mul, neg_one_mul] ring
13
import Mathlib.ModelTheory.FinitelyGenerated import Mathlib.ModelTheory.DirectLimit import Mathlib.ModelTheory.Bundled #align_import model_theory.fraisse from "leanprover-community/mathlib"@"0602c59878ff3d5f71dea69c2d32ccf2e93e5398" universe u v w w' open scoped FirstOrder open Set CategoryTheory namespace FirstOrder namespace Language open Structure Substructure variable (L : Language.{u, v}) def age (M : Type w) [L.Structure M] : Set (Bundled.{w} L.Structure) := {N | Structure.FG L N ∧ Nonempty (N ↪[L] M)} #align first_order.language.age FirstOrder.Language.age variable {L} (K : Set (Bundled.{w} L.Structure)) def Hereditary : Prop := ∀ M : Bundled.{w} L.Structure, M ∈ K → L.age M ⊆ K #align first_order.language.hereditary FirstOrder.Language.Hereditary def JointEmbedding : Prop := DirectedOn (fun M N : Bundled.{w} L.Structure => Nonempty (M ↪[L] N)) K #align first_order.language.joint_embedding FirstOrder.Language.JointEmbedding def Amalgamation : Prop := ∀ (M N P : Bundled.{w} L.Structure) (MN : M ↪[L] N) (MP : M ↪[L] P), M ∈ K → N ∈ K → P ∈ K → ∃ (Q : Bundled.{w} L.Structure) (NQ : N ↪[L] Q) (PQ : P ↪[L] Q), Q ∈ K ∧ NQ.comp MN = PQ.comp MP #align first_order.language.amalgamation FirstOrder.Language.Amalgamation class IsFraisse : Prop where is_nonempty : K.Nonempty FG : ∀ M : Bundled.{w} L.Structure, M ∈ K → Structure.FG L M is_equiv_invariant : ∀ M N : Bundled.{w} L.Structure, Nonempty (M ≃[L] N) → (M ∈ K ↔ N ∈ K) is_essentially_countable : (Quotient.mk' '' K).Countable hereditary : Hereditary K jointEmbedding : JointEmbedding K amalgamation : Amalgamation K #align first_order.language.is_fraisse FirstOrder.Language.IsFraisse variable {K} (L) (M : Type w) [Structure L M] theorem age.is_equiv_invariant (N P : Bundled.{w} L.Structure) (h : Nonempty (N ≃[L] P)) : N ∈ L.age M ↔ P ∈ L.age M := and_congr h.some.fg_iff ⟨Nonempty.map fun x => Embedding.comp x h.some.symm.toEmbedding, Nonempty.map fun x => Embedding.comp x h.some.toEmbedding⟩ #align first_order.language.age.is_equiv_invariant FirstOrder.Language.age.is_equiv_invariant variable {L} {M} {N : Type w} [Structure L N] theorem Embedding.age_subset_age (MN : M ↪[L] N) : L.age M ⊆ L.age N := fun _ => And.imp_right (Nonempty.map MN.comp) #align first_order.language.embedding.age_subset_age FirstOrder.Language.Embedding.age_subset_age theorem Equiv.age_eq_age (MN : M ≃[L] N) : L.age M = L.age N := le_antisymm MN.toEmbedding.age_subset_age MN.symm.toEmbedding.age_subset_age #align first_order.language.equiv.age_eq_age FirstOrder.Language.Equiv.age_eq_age theorem Structure.FG.mem_age_of_equiv {M N : Bundled L.Structure} (h : Structure.FG L M) (MN : Nonempty (M ≃[L] N)) : N ∈ L.age M := ⟨MN.some.fg_iff.1 h, ⟨MN.some.symm.toEmbedding⟩⟩ set_option linter.uppercaseLean3 false in #align first_order.language.Structure.fg.mem_age_of_equiv FirstOrder.Language.Structure.FG.mem_age_of_equiv theorem Hereditary.is_equiv_invariant_of_fg (h : Hereditary K) (fg : ∀ M : Bundled.{w} L.Structure, M ∈ K → Structure.FG L M) (M N : Bundled.{w} L.Structure) (hn : Nonempty (M ≃[L] N)) : M ∈ K ↔ N ∈ K := ⟨fun MK => h M MK ((fg M MK).mem_age_of_equiv hn), fun NK => h N NK ((fg N NK).mem_age_of_equiv ⟨hn.some.symm⟩)⟩ #align first_order.language.hereditary.is_equiv_invariant_of_fg FirstOrder.Language.Hereditary.is_equiv_invariant_of_fg variable (M) theorem age.nonempty : (L.age M).Nonempty := ⟨Bundled.of (Substructure.closure L (∅ : Set M)), (fg_iff_structure_fg _).1 (fg_closure Set.finite_empty), ⟨Substructure.subtype _⟩⟩ #align first_order.language.age.nonempty FirstOrder.Language.age.nonempty theorem age.hereditary : Hereditary (L.age M) := fun _ hN _ hP => hN.2.some.age_subset_age hP #align first_order.language.age.hereditary FirstOrder.Language.age.hereditary theorem age.jointEmbedding : JointEmbedding (L.age M) := fun _ hN _ hP => ⟨Bundled.of (↥(hN.2.some.toHom.range ⊔ hP.2.some.toHom.range)), ⟨(fg_iff_structure_fg _).1 ((hN.1.range hN.2.some.toHom).sup (hP.1.range hP.2.some.toHom)), ⟨Substructure.subtype _⟩⟩, ⟨Embedding.comp (inclusion le_sup_left) hN.2.some.equivRange.toEmbedding⟩, ⟨Embedding.comp (inclusion le_sup_right) hP.2.some.equivRange.toEmbedding⟩⟩ #align first_order.language.age.joint_embedding FirstOrder.Language.age.jointEmbedding
Mathlib/ModelTheory/Fraisse.lean
169
182
theorem age.countable_quotient [h : Countable M] : (Quotient.mk' '' L.age M).Countable := by
classical refine (congr_arg _ (Set.ext <| Quotient.forall.2 fun N => ?_)).mp (countable_range fun s : Finset M => ⟦⟨closure L (s : Set M), inferInstance⟩⟧) constructor · rintro ⟨s, hs⟩ use Bundled.of (closure L (s : Set M)) exact ⟨⟨(fg_iff_structure_fg _).1 (fg_closure s.finite_toSet), ⟨Substructure.subtype _⟩⟩, hs⟩ · simp only [mem_range, Quotient.eq] rintro ⟨P, ⟨⟨s, hs⟩, ⟨PM⟩⟩, hP2⟩ have : P ≈ N := by apply Quotient.eq'.mp; rw [hP2]; rfl -- Porting note: added refine ⟨s.image PM, Setoid.trans (b := P) ?_ this⟩ rw [← Embedding.coe_toHom, Finset.coe_image, closure_image PM.toHom, hs, ← Hom.range_eq_map] exact ⟨PM.equivRange.symm⟩
13
import Mathlib.Algebra.BigOperators.NatAntidiagonal import Mathlib.Algebra.GeomSum import Mathlib.Data.Fintype.BigOperators import Mathlib.RingTheory.PowerSeries.Inverse import Mathlib.RingTheory.PowerSeries.WellKnown import Mathlib.Tactic.FieldSimp #align_import number_theory.bernoulli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" open Nat Finset Finset.Nat PowerSeries variable (A : Type*) [CommRing A] [Algebra ℚ A] def bernoulli' : ℕ → ℚ := WellFounded.fix Nat.lt_wfRel.wf fun n bernoulli' => 1 - ∑ k : Fin n, n.choose k / (n - k + 1) * bernoulli' k k.2 #align bernoulli' bernoulli' theorem bernoulli'_def' (n : ℕ) : bernoulli' n = 1 - ∑ k : Fin n, n.choose k / (n - k + 1) * bernoulli' k := WellFounded.fix_eq _ _ _ #align bernoulli'_def' bernoulli'_def' theorem bernoulli'_def (n : ℕ) : bernoulli' n = 1 - ∑ k ∈ range n, n.choose k / (n - k + 1) * bernoulli' k := by rw [bernoulli'_def', ← Fin.sum_univ_eq_sum_range] #align bernoulli'_def bernoulli'_def theorem bernoulli'_spec (n : ℕ) : (∑ k ∈ range n.succ, (n.choose (n - k) : ℚ) / (n - k + 1) * bernoulli' k) = 1 := by rw [sum_range_succ_comm, bernoulli'_def n, tsub_self, choose_zero_right, sub_self, zero_add, div_one, cast_one, one_mul, sub_add, ← sum_sub_distrib, ← sub_eq_zero, sub_sub_cancel_left, neg_eq_zero] exact Finset.sum_eq_zero (fun x hx => by rw [choose_symm (le_of_lt (mem_range.1 hx)), sub_self]) #align bernoulli'_spec bernoulli'_spec theorem bernoulli'_spec' (n : ℕ) : (∑ k ∈ antidiagonal n, ((k.1 + k.2).choose k.2 : ℚ) / (k.2 + 1) * bernoulli' k.1) = 1 := by refine ((sum_antidiagonal_eq_sum_range_succ_mk _ n).trans ?_).trans (bernoulli'_spec n) refine sum_congr rfl fun x hx => ?_ simp only [add_tsub_cancel_of_le, mem_range_succ_iff.mp hx, cast_sub] #align bernoulli'_spec' bernoulli'_spec' @[simp]
Mathlib/NumberTheory/Bernoulli.lean
137
150
theorem sum_bernoulli' (n : ℕ) : (∑ k ∈ range n, (n.choose k : ℚ) * bernoulli' k) = n := by
cases' n with n · simp suffices ((n + 1 : ℚ) * ∑ k ∈ range n, ↑(n.choose k) / (n - k + 1) * bernoulli' k) = ∑ x ∈ range n, ↑(n.succ.choose x) * bernoulli' x by rw_mod_cast [sum_range_succ, bernoulli'_def, ← this, choose_succ_self_right] ring simp_rw [mul_sum, ← mul_assoc] refine sum_congr rfl fun k hk => ?_ congr have : ((n - k : ℕ) : ℚ) + 1 ≠ 0 := by norm_cast field_simp [← cast_sub (mem_range.1 hk).le, mul_comm] rw_mod_cast [tsub_add_eq_add_tsub (mem_range.1 hk).le, choose_mul_succ_eq]
13
import Mathlib.Algebra.Group.Subgroup.Basic import Mathlib.Algebra.Module.Defs #align_import group_theory.subgroup.saturated from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" namespace Subgroup variable {G : Type*} [Group G] @[to_additive "An additive subgroup `H` of `G` is *saturated* if for all `n : ℕ` and `g : G` with `n•g ∈ H` we have `n = 0` or `g ∈ H`."] def Saturated (H : Subgroup G) : Prop := ∀ ⦃n g⦄, g ^ n ∈ H → n = 0 ∨ g ∈ H #align subgroup.saturated Subgroup.Saturated #align add_subgroup.saturated AddSubgroup.Saturated @[to_additive] theorem saturated_iff_npow {H : Subgroup G} : Saturated H ↔ ∀ (n : ℕ) (g : G), g ^ n ∈ H → n = 0 ∨ g ∈ H := Iff.rfl #align subgroup.saturated_iff_npow Subgroup.saturated_iff_npow #align add_subgroup.saturated_iff_nsmul AddSubgroup.saturated_iff_nsmul @[to_additive]
Mathlib/GroupTheory/Subgroup/Saturated.lean
42
56
theorem saturated_iff_zpow {H : Subgroup G} : Saturated H ↔ ∀ (n : ℤ) (g : G), g ^ n ∈ H → n = 0 ∨ g ∈ H := by
constructor · intros hH n g hgn induction' n with n n · simp only [Int.natCast_eq_zero, Int.ofNat_eq_coe, zpow_natCast] at hgn ⊢ exact hH hgn · suffices g ^ (n + 1) ∈ H by refine (hH this).imp ?_ id simp only [IsEmpty.forall_iff, Nat.succ_ne_zero] simpa only [inv_mem_iff, zpow_negSucc] using hgn · intro h n g hgn specialize h n g simp only [Int.natCast_eq_zero, zpow_natCast] at h apply h hgn
13
import Mathlib.Data.PFunctor.Univariate.M #align_import data.qpf.univariate.basic from "leanprover-community/mathlib"@"14b69e9f3c16630440a2cbd46f1ddad0d561dee7" universe u class QPF (F : Type u → Type u) [Functor F] where P : PFunctor.{u} abs : ∀ {α}, P α → F α repr : ∀ {α}, F α → P α abs_repr : ∀ {α} (x : F α), abs (repr x) = x abs_map : ∀ {α β} (f : α → β) (p : P α), abs (P.map f p) = f <$> abs p #align qpf QPF namespace QPF variable {F : Type u → Type u} [Functor F] [q : QPF F] open Functor (Liftp Liftr) theorem id_map {α : Type _} (x : F α) : id <$> x = x := by rw [← abs_repr x] cases' repr x with a f rw [← abs_map] rfl #align qpf.id_map QPF.id_map theorem comp_map {α β γ : Type _} (f : α → β) (g : β → γ) (x : F α) : (g ∘ f) <$> x = g <$> f <$> x := by rw [← abs_repr x] cases' repr x with a f rw [← abs_map, ← abs_map, ← abs_map] rfl #align qpf.comp_map QPF.comp_map theorem lawfulFunctor (h : ∀ α β : Type u, @Functor.mapConst F _ α _ = Functor.map ∘ Function.const β) : LawfulFunctor F := { map_const := @h id_map := @id_map F _ _ comp_map := @comp_map F _ _ } #align qpf.is_lawful_functor QPF.lawfulFunctor section open Functor theorem liftp_iff {α : Type u} (p : α → Prop) (x : F α) : Liftp p x ↔ ∃ a f, x = abs ⟨a, f⟩ ∧ ∀ i, p (f i) := by constructor · rintro ⟨y, hy⟩ cases' h : repr y with a f use a, fun i => (f i).val constructor · rw [← hy, ← abs_repr y, h, ← abs_map] rfl intro i apply (f i).property rintro ⟨a, f, h₀, h₁⟩ use abs ⟨a, fun i => ⟨f i, h₁ i⟩⟩ rw [← abs_map, h₀]; rfl #align qpf.liftp_iff QPF.liftp_iff
Mathlib/Data/QPF/Univariate/Basic.lean
117
131
theorem liftp_iff' {α : Type u} (p : α → Prop) (x : F α) : Liftp p x ↔ ∃ u : q.P α, abs u = x ∧ ∀ i, p (u.snd i) := by
constructor · rintro ⟨y, hy⟩ cases' h : repr y with a f use ⟨a, fun i => (f i).val⟩ dsimp constructor · rw [← hy, ← abs_repr y, h, ← abs_map] rfl intro i apply (f i).property rintro ⟨⟨a, f⟩, h₀, h₁⟩; dsimp at * use abs ⟨a, fun i => ⟨f i, h₁ i⟩⟩ rw [← abs_map, ← h₀]; rfl
13
import Mathlib.Probability.Kernel.Composition import Mathlib.MeasureTheory.Integral.SetIntegral #align_import probability.kernel.integral_comp_prod from "leanprover-community/mathlib"@"c0d694db494dd4f9aa57f2714b6e4c82b4ebc113" noncomputable section open scoped Topology ENNReal MeasureTheory ProbabilityTheory open Set Function Real ENNReal MeasureTheory Filter ProbabilityTheory ProbabilityTheory.kernel variable {α β γ E : Type*} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {mγ : MeasurableSpace γ} [NormedAddCommGroup E] {κ : kernel α β} [IsSFiniteKernel κ] {η : kernel (α × β) γ} [IsSFiniteKernel η] {a : α} namespace ProbabilityTheory theorem hasFiniteIntegral_prod_mk_left (a : α) {s : Set (β × γ)} (h2s : (κ ⊗ₖ η) a s ≠ ∞) : HasFiniteIntegral (fun b => (η (a, b) (Prod.mk b ⁻¹' s)).toReal) (κ a) := by let t := toMeasurable ((κ ⊗ₖ η) a) s simp_rw [HasFiniteIntegral, ennnorm_eq_ofReal toReal_nonneg] calc ∫⁻ b, ENNReal.ofReal (η (a, b) (Prod.mk b ⁻¹' s)).toReal ∂κ a _ ≤ ∫⁻ b, η (a, b) (Prod.mk b ⁻¹' t) ∂κ a := by refine lintegral_mono_ae ?_ filter_upwards [ae_kernel_lt_top a h2s] with b hb rw [ofReal_toReal hb.ne] exact measure_mono (preimage_mono (subset_toMeasurable _ _)) _ ≤ (κ ⊗ₖ η) a t := le_compProd_apply _ _ _ _ _ = (κ ⊗ₖ η) a s := measure_toMeasurable s _ < ⊤ := h2s.lt_top #align probability_theory.has_finite_integral_prod_mk_left ProbabilityTheory.hasFiniteIntegral_prod_mk_left theorem integrable_kernel_prod_mk_left (a : α) {s : Set (β × γ)} (hs : MeasurableSet s) (h2s : (κ ⊗ₖ η) a s ≠ ∞) : Integrable (fun b => (η (a, b) (Prod.mk b ⁻¹' s)).toReal) (κ a) := by constructor · exact (measurable_kernel_prod_mk_left' hs a).ennreal_toReal.aestronglyMeasurable · exact hasFiniteIntegral_prod_mk_left a h2s #align probability_theory.integrable_kernel_prod_mk_left ProbabilityTheory.integrable_kernel_prod_mk_left theorem _root_.MeasureTheory.AEStronglyMeasurable.integral_kernel_compProd [NormedSpace ℝ E] ⦃f : β × γ → E⦄ (hf : AEStronglyMeasurable f ((κ ⊗ₖ η) a)) : AEStronglyMeasurable (fun x => ∫ y, f (x, y) ∂η (a, x)) (κ a) := ⟨fun x => ∫ y, hf.mk f (x, y) ∂η (a, x), hf.stronglyMeasurable_mk.integral_kernel_prod_right'', by filter_upwards [ae_ae_of_ae_compProd hf.ae_eq_mk] with _ hx using integral_congr_ae hx⟩ #align measure_theory.ae_strongly_measurable.integral_kernel_comp_prod MeasureTheory.AEStronglyMeasurable.integral_kernel_compProd theorem _root_.MeasureTheory.AEStronglyMeasurable.compProd_mk_left {δ : Type*} [TopologicalSpace δ] {f : β × γ → δ} (hf : AEStronglyMeasurable f ((κ ⊗ₖ η) a)) : ∀ᵐ x ∂κ a, AEStronglyMeasurable (fun y => f (x, y)) (η (a, x)) := by filter_upwards [ae_ae_of_ae_compProd hf.ae_eq_mk] with x hx using ⟨fun y => hf.mk f (x, y), hf.stronglyMeasurable_mk.comp_measurable measurable_prod_mk_left, hx⟩ #align measure_theory.ae_strongly_measurable.comp_prod_mk_left MeasureTheory.AEStronglyMeasurable.compProd_mk_left
Mathlib/Probability/Kernel/IntegralCompProd.lean
88
104
theorem hasFiniteIntegral_compProd_iff ⦃f : β × γ → E⦄ (h1f : StronglyMeasurable f) : HasFiniteIntegral f ((κ ⊗ₖ η) a) ↔ (∀ᵐ x ∂κ a, HasFiniteIntegral (fun y => f (x, y)) (η (a, x))) ∧ HasFiniteIntegral (fun x => ∫ y, ‖f (x, y)‖ ∂η (a, x)) (κ a) := by
simp only [HasFiniteIntegral] rw [kernel.lintegral_compProd _ _ _ h1f.ennnorm] have : ∀ x, ∀ᵐ y ∂η (a, x), 0 ≤ ‖f (x, y)‖ := fun x => eventually_of_forall fun y => norm_nonneg _ simp_rw [integral_eq_lintegral_of_nonneg_ae (this _) (h1f.norm.comp_measurable measurable_prod_mk_left).aestronglyMeasurable, ennnorm_eq_ofReal toReal_nonneg, ofReal_norm_eq_coe_nnnorm] have : ∀ {p q r : Prop} (_ : r → p), (r ↔ p ∧ q) ↔ p → (r ↔ q) := fun {p q r} h1 => by rw [← and_congr_right_iff, and_iff_right_of_imp h1] rw [this] · intro h2f; rw [lintegral_congr_ae] filter_upwards [h2f] with x hx rw [ofReal_toReal]; rw [← lt_top_iff_ne_top]; exact hx · intro h2f; refine ae_lt_top ?_ h2f.ne; exact h1f.ennnorm.lintegral_kernel_prod_right''
13
import Mathlib.Geometry.Manifold.Diffeomorph import Mathlib.Geometry.Manifold.Instances.Real import Mathlib.Geometry.Manifold.PartitionOfUnity #align_import geometry.manifold.whitney_embedding from "leanprover-community/mathlib"@"86c29aefdba50b3f33e86e52e3b2f51a0d8f0282" universe uι uE uH uM variable {ι : Type uι} {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {H : Type uH} [TopologicalSpace H] {I : ModelWithCorners ℝ E H} {M : Type uM} [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M] open Function Filter FiniteDimensional Set open scoped Topology Manifold Classical Filter noncomputable section namespace SmoothBumpCovering variable [T2Space M] [hi : Fintype ι] {s : Set M} (f : SmoothBumpCovering ι I M s) def embeddingPiTangent : C^∞⟮I, M; 𝓘(ℝ, ι → E × ℝ), ι → E × ℝ⟯ where val x i := (f i x • extChartAt I (f.c i) x, f i x) property := contMDiff_pi_space.2 fun i => ((f i).smooth_smul contMDiffOn_extChartAt).prod_mk_space (f i).smooth #align smooth_bump_covering.embedding_pi_tangent SmoothBumpCovering.embeddingPiTangent @[local simp] theorem embeddingPiTangent_coe : ⇑f.embeddingPiTangent = fun x i => (f i x • extChartAt I (f.c i) x, f i x) := rfl #align smooth_bump_covering.embedding_pi_tangent_coe SmoothBumpCovering.embeddingPiTangent_coe theorem embeddingPiTangent_injOn : InjOn f.embeddingPiTangent s := by intro x hx y _ h simp only [embeddingPiTangent_coe, funext_iff] at h obtain ⟨h₁, h₂⟩ := Prod.mk.inj_iff.1 (h (f.ind x hx)) rw [f.apply_ind x hx] at h₂ rw [← h₂, f.apply_ind x hx, one_smul, one_smul] at h₁ have := f.mem_extChartAt_source_of_eq_one h₂.symm exact (extChartAt I (f.c _)).injOn (f.mem_extChartAt_ind_source x hx) this h₁ #align smooth_bump_covering.embedding_pi_tangent_inj_on SmoothBumpCovering.embeddingPiTangent_injOn theorem embeddingPiTangent_injective (f : SmoothBumpCovering ι I M) : Injective f.embeddingPiTangent := injective_iff_injOn_univ.2 f.embeddingPiTangent_injOn #align smooth_bump_covering.embedding_pi_tangent_injective SmoothBumpCovering.embeddingPiTangent_injective theorem comp_embeddingPiTangent_mfderiv (x : M) (hx : x ∈ s) : ((ContinuousLinearMap.fst ℝ E ℝ).comp (@ContinuousLinearMap.proj ℝ _ ι (fun _ => E × ℝ) _ _ (fun _ => inferInstance) (f.ind x hx))).comp (mfderiv I 𝓘(ℝ, ι → E × ℝ) f.embeddingPiTangent x) = mfderiv I I (chartAt H (f.c (f.ind x hx))) x := by set L := (ContinuousLinearMap.fst ℝ E ℝ).comp (@ContinuousLinearMap.proj ℝ _ ι (fun _ => E × ℝ) _ _ (fun _ => inferInstance) (f.ind x hx)) have := L.hasMFDerivAt.comp x f.embeddingPiTangent.smooth.mdifferentiableAt.hasMFDerivAt convert hasMFDerivAt_unique this _ refine (hasMFDerivAt_extChartAt I (f.mem_chartAt_ind_source x hx)).congr_of_eventuallyEq ?_ refine (f.eventuallyEq_one x hx).mono fun y hy => ?_ simp only [L, embeddingPiTangent_coe, ContinuousLinearMap.coe_comp', (· ∘ ·), ContinuousLinearMap.coe_fst', ContinuousLinearMap.proj_apply] rw [hy, Pi.one_apply, one_smul] #align smooth_bump_covering.comp_embedding_pi_tangent_mfderiv SmoothBumpCovering.comp_embeddingPiTangent_mfderiv theorem embeddingPiTangent_ker_mfderiv (x : M) (hx : x ∈ s) : LinearMap.ker (mfderiv I 𝓘(ℝ, ι → E × ℝ) f.embeddingPiTangent x) = ⊥ := by apply bot_unique rw [← (mdifferentiable_chart I (f.c (f.ind x hx))).ker_mfderiv_eq_bot (f.mem_chartAt_ind_source x hx), ← comp_embeddingPiTangent_mfderiv] exact LinearMap.ker_le_ker_comp _ _ #align smooth_bump_covering.embedding_pi_tangent_ker_mfderiv SmoothBumpCovering.embeddingPiTangent_ker_mfderiv theorem embeddingPiTangent_injective_mfderiv (x : M) (hx : x ∈ s) : Injective (mfderiv I 𝓘(ℝ, ι → E × ℝ) f.embeddingPiTangent x) := LinearMap.ker_eq_bot.1 (f.embeddingPiTangent_ker_mfderiv x hx) #align smooth_bump_covering.embedding_pi_tangent_injective_mfderiv SmoothBumpCovering.embeddingPiTangent_injective_mfderiv
Mathlib/Geometry/Manifold/WhitneyEmbedding.lean
118
133
theorem exists_immersion_euclidean [Finite ι] (f : SmoothBumpCovering ι I M) : ∃ (n : ℕ) (e : M → EuclideanSpace ℝ (Fin n)), Smooth I (𝓡 n) e ∧ Injective e ∧ ∀ x : M, Injective (mfderiv I (𝓡 n) e x) := by
cases nonempty_fintype ι set F := EuclideanSpace ℝ (Fin <| finrank ℝ (ι → E × ℝ)) letI : IsNoetherian ℝ (E × ℝ) := IsNoetherian.iff_fg.2 inferInstance letI : FiniteDimensional ℝ (ι → E × ℝ) := IsNoetherian.iff_fg.1 inferInstance set eEF : (ι → E × ℝ) ≃L[ℝ] F := ContinuousLinearEquiv.ofFinrankEq finrank_euclideanSpace_fin.symm refine ⟨_, eEF ∘ f.embeddingPiTangent, eEF.toDiffeomorph.smooth.comp f.embeddingPiTangent.smooth, eEF.injective.comp f.embeddingPiTangent_injective, fun x => ?_⟩ rw [mfderiv_comp _ eEF.differentiableAt.mdifferentiableAt f.embeddingPiTangent.smooth.mdifferentiableAt, eEF.mfderiv_eq] exact eEF.injective.comp (f.embeddingPiTangent_injective_mfderiv _ trivial)
13
import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Fintype.Basic import Mathlib.Data.Int.GCD import Mathlib.RingTheory.Coprime.Basic #align_import ring_theory.coprime.lemmas from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226" universe u v section RelPrime variable {α I} [CommMonoid α] [DecompositionMonoid α] {x y z : α} {s : I → α} {t : Finset I} theorem IsRelPrime.prod_left : (∀ i ∈ t, IsRelPrime (s i) x) → IsRelPrime (∏ i ∈ t, s i) x := by classical refine Finset.induction_on t (fun _ ↦ isRelPrime_one_left) fun b t hbt ih H ↦ ?_ rw [Finset.prod_insert hbt] rw [Finset.forall_mem_insert] at H exact H.1.mul_left (ih H.2) theorem IsRelPrime.prod_right : (∀ i ∈ t, IsRelPrime x (s i)) → IsRelPrime x (∏ i ∈ t, s i) := by simpa only [isRelPrime_comm] using IsRelPrime.prod_left (α := α) theorem IsRelPrime.prod_left_iff : IsRelPrime (∏ i ∈ t, s i) x ↔ ∀ i ∈ t, IsRelPrime (s i) x := by classical refine Finset.induction_on t (iff_of_true isRelPrime_one_left fun _ ↦ by simp) fun b t hbt ih ↦ ?_ rw [Finset.prod_insert hbt, IsRelPrime.mul_left_iff, ih, Finset.forall_mem_insert] theorem IsRelPrime.prod_right_iff : IsRelPrime x (∏ i ∈ t, s i) ↔ ∀ i ∈ t, IsRelPrime x (s i) := by simpa only [isRelPrime_comm] using IsRelPrime.prod_left_iff (α := α) theorem IsRelPrime.of_prod_left (H1 : IsRelPrime (∏ i ∈ t, s i) x) (i : I) (hit : i ∈ t) : IsRelPrime (s i) x := IsRelPrime.prod_left_iff.1 H1 i hit theorem IsRelPrime.of_prod_right (H1 : IsRelPrime x (∏ i ∈ t, s i)) (i : I) (hit : i ∈ t) : IsRelPrime x (s i) := IsRelPrime.prod_right_iff.1 H1 i hit
Mathlib/RingTheory/Coprime/Lemmas.lean
261
275
theorem Finset.prod_dvd_of_isRelPrime : (t : Set I).Pairwise (IsRelPrime on s) → (∀ i ∈ t, s i ∣ z) → (∏ x ∈ t, s x) ∣ z := by
classical exact Finset.induction_on t (fun _ _ ↦ one_dvd z) (by intro a r har ih Hs Hs1 rw [Finset.prod_insert har] have aux1 : a ∈ (↑(insert a r) : Set I) := Finset.mem_insert_self a r refine (IsRelPrime.prod_right fun i hir ↦ Hs aux1 (Finset.mem_insert_of_mem hir) <| by rintro rfl exact har hir).mul_dvd (Hs1 a aux1) (ih (Hs.mono ?_) fun i hi ↦ Hs1 i <| Finset.mem_insert_of_mem hi) simp only [Finset.coe_insert, Set.subset_insert])
13
import Mathlib.Analysis.Complex.RemovableSingularity import Mathlib.Analysis.Calculus.UniformLimitsDeriv import Mathlib.Analysis.NormedSpace.FunctionSeries #align_import analysis.complex.locally_uniform_limit from "leanprover-community/mathlib"@"fe44cd36149e675eb5dec87acc7e8f1d6568e081" open Set Metric MeasureTheory Filter Complex intervalIntegral open scoped Real Topology variable {E ι : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] {U K : Set ℂ} {z : ℂ} {M r δ : ℝ} {φ : Filter ι} {F : ι → ℂ → E} {f g : ℂ → E} namespace Complex section Cderiv noncomputable def cderiv (r : ℝ) (f : ℂ → E) (z : ℂ) : E := (2 * π * I : ℂ)⁻¹ • ∮ w in C(z, r), ((w - z) ^ 2)⁻¹ • f w #align complex.cderiv Complex.cderiv theorem cderiv_eq_deriv (hU : IsOpen U) (hf : DifferentiableOn ℂ f U) (hr : 0 < r) (hzr : closedBall z r ⊆ U) : cderiv r f z = deriv f z := two_pi_I_inv_smul_circleIntegral_sub_sq_inv_smul_of_differentiable hU hzr hf (mem_ball_self hr) #align complex.cderiv_eq_deriv Complex.cderiv_eq_deriv theorem norm_cderiv_le (hr : 0 < r) (hf : ∀ w ∈ sphere z r, ‖f w‖ ≤ M) : ‖cderiv r f z‖ ≤ M / r := by have hM : 0 ≤ M := by obtain ⟨w, hw⟩ : (sphere z r).Nonempty := NormedSpace.sphere_nonempty.mpr hr.le exact (norm_nonneg _).trans (hf w hw) have h1 : ∀ w ∈ sphere z r, ‖((w - z) ^ 2)⁻¹ • f w‖ ≤ M / r ^ 2 := by intro w hw simp only [mem_sphere_iff_norm, norm_eq_abs] at hw simp only [norm_smul, inv_mul_eq_div, hw, norm_eq_abs, map_inv₀, Complex.abs_pow] exact div_le_div hM (hf w hw) (sq_pos_of_pos hr) le_rfl have h2 := circleIntegral.norm_integral_le_of_norm_le_const hr.le h1 simp only [cderiv, norm_smul] refine (mul_le_mul le_rfl h2 (norm_nonneg _) (norm_nonneg _)).trans (le_of_eq ?_) field_simp [_root_.abs_of_nonneg Real.pi_pos.le] ring #align complex.norm_cderiv_le Complex.norm_cderiv_le theorem cderiv_sub (hr : 0 < r) (hf : ContinuousOn f (sphere z r)) (hg : ContinuousOn g (sphere z r)) : cderiv r (f - g) z = cderiv r f z - cderiv r g z := by have h1 : ContinuousOn (fun w : ℂ => ((w - z) ^ 2)⁻¹) (sphere z r) := by refine ((continuous_id'.sub continuous_const).pow 2).continuousOn.inv₀ fun w hw h => hr.ne ?_ rwa [mem_sphere_iff_norm, sq_eq_zero_iff.mp h, norm_zero] at hw simp_rw [cderiv, ← smul_sub] congr 1 simpa only [Pi.sub_apply, smul_sub] using circleIntegral.integral_sub ((h1.smul hf).circleIntegrable hr.le) ((h1.smul hg).circleIntegrable hr.le) #align complex.cderiv_sub Complex.cderiv_sub theorem norm_cderiv_lt (hr : 0 < r) (hfM : ∀ w ∈ sphere z r, ‖f w‖ < M) (hf : ContinuousOn f (sphere z r)) : ‖cderiv r f z‖ < M / r := by obtain ⟨L, hL1, hL2⟩ : ∃ L < M, ∀ w ∈ sphere z r, ‖f w‖ ≤ L := by have e1 : (sphere z r).Nonempty := NormedSpace.sphere_nonempty.mpr hr.le have e2 : ContinuousOn (fun w => ‖f w‖) (sphere z r) := continuous_norm.comp_continuousOn hf obtain ⟨x, hx, hx'⟩ := (isCompact_sphere z r).exists_isMaxOn e1 e2 exact ⟨‖f x‖, hfM x hx, hx'⟩ exact (norm_cderiv_le hr hL2).trans_lt ((div_lt_div_right hr).mpr hL1) #align complex.norm_cderiv_lt Complex.norm_cderiv_lt theorem norm_cderiv_sub_lt (hr : 0 < r) (hfg : ∀ w ∈ sphere z r, ‖f w - g w‖ < M) (hf : ContinuousOn f (sphere z r)) (hg : ContinuousOn g (sphere z r)) : ‖cderiv r f z - cderiv r g z‖ < M / r := cderiv_sub hr hf hg ▸ norm_cderiv_lt hr hfg (hf.sub hg) #align complex.norm_cderiv_sub_lt Complex.norm_cderiv_sub_lt
Mathlib/Analysis/Complex/LocallyUniformLimit.lean
95
110
theorem _root_.TendstoUniformlyOn.cderiv (hF : TendstoUniformlyOn F f φ (cthickening δ K)) (hδ : 0 < δ) (hFn : ∀ᶠ n in φ, ContinuousOn (F n) (cthickening δ K)) : TendstoUniformlyOn (cderiv δ ∘ F) (cderiv δ f) φ K := by
rcases φ.eq_or_neBot with rfl | hne · simp only [TendstoUniformlyOn, eventually_bot, imp_true_iff] have e1 : ContinuousOn f (cthickening δ K) := TendstoUniformlyOn.continuousOn hF hFn rw [tendstoUniformlyOn_iff] at hF ⊢ rintro ε hε filter_upwards [hF (ε * δ) (mul_pos hε hδ), hFn] with n h h' z hz simp_rw [dist_eq_norm] at h ⊢ have e2 : ∀ w ∈ sphere z δ, ‖f w - F n w‖ < ε * δ := fun w hw1 => h w (closedBall_subset_cthickening hz δ (sphere_subset_closedBall hw1)) have e3 := sphere_subset_closedBall.trans (closedBall_subset_cthickening hz δ) have hf : ContinuousOn f (sphere z δ) := e1.mono (sphere_subset_closedBall.trans (closedBall_subset_cthickening hz δ)) simpa only [mul_div_cancel_right₀ _ hδ.ne.symm] using norm_cderiv_sub_lt hδ e2 hf (h'.mono e3)
13
import Mathlib.Algebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.DirectSum.TensorProduct #align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" noncomputable section open DirectSum TensorProduct open Set LinearMap Submodule variable (R S M N ι κ : Type*) [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [Semiring S] [Algebra R S] [Module S M] [IsScalarTower R S M] open scoped Classical in def finsuppTensorFinsupp : (ι →₀ M) ⊗[R] (κ →₀ N) ≃ₗ[S] ι × κ →₀ M ⊗[R] N := TensorProduct.AlgebraTensorModule.congr (finsuppLEquivDirectSum S M ι) (finsuppLEquivDirectSum R N κ) ≪≫ₗ ((TensorProduct.directSum R S (fun _ : ι => M) fun _ : κ => N) ≪≫ₗ (finsuppLEquivDirectSum S (M ⊗[R] N) (ι × κ)).symm) #align finsupp_tensor_finsupp finsuppTensorFinsupp @[simp] theorem finsuppTensorFinsupp_single (i : ι) (m : M) (k : κ) (n : N) : finsuppTensorFinsupp R S M N ι κ (Finsupp.single i m ⊗ₜ Finsupp.single k n) = Finsupp.single (i, k) (m ⊗ₜ n) := by simp [finsuppTensorFinsupp] #align finsupp_tensor_finsupp_single finsuppTensorFinsupp_single @[simp]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
263
277
theorem finsuppTensorFinsupp_apply (f : ι →₀ M) (g : κ →₀ N) (i : ι) (k : κ) : finsuppTensorFinsupp R S M N ι κ (f ⊗ₜ g) (i, k) = f i ⊗ₜ g k := by
apply Finsupp.induction_linear f · simp · intro f₁ f₂ hf₁ hf₂ simp [add_tmul, hf₁, hf₂] intro i' m apply Finsupp.induction_linear g · simp · intro g₁ g₂ hg₁ hg₂ simp [tmul_add, hg₁, hg₂] intro k' n classical simp_rw [finsuppTensorFinsupp_single, Finsupp.single_apply, Prod.mk.inj_iff, ite_and] split_ifs <;> simp
13
import Mathlib.LinearAlgebra.Dimension.Finrank import Mathlib.LinearAlgebra.InvariantBasisNumber #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u v w w' variable {R : Type u} {M : Type v} [Ring R] [AddCommGroup M] [Module R M] variable {ι : Type w} {ι' : Type w'} open Cardinal Basis Submodule Function Set attribute [local instance] nontrivial_of_invariantBasisNumber section StrongRankCondition variable [StrongRankCondition R] open Submodule -- An auxiliary lemma for `linearIndependent_le_span'`, -- with the additional assumption that the linearly independent family is finite. theorem linearIndependent_le_span_aux' {ι : Type*} [Fintype ι] (v : ι → M) (i : LinearIndependent R v) (w : Set M) [Fintype w] (s : range v ≤ span R w) : Fintype.card ι ≤ Fintype.card w := by -- We construct an injective linear map `(ι → R) →ₗ[R] (w → R)`, -- by thinking of `f : ι → R` as a linear combination of the finite family `v`, -- and expressing that (using the axiom of choice) as a linear combination over `w`. -- We can do this linearly by constructing the map on a basis. fapply card_le_of_injective' R · apply Finsupp.total exact fun i => Span.repr R w ⟨v i, s (mem_range_self i)⟩ · intro f g h apply_fun Finsupp.total w M R (↑) at h simp only [Finsupp.total_total, Submodule.coe_mk, Span.finsupp_total_repr] at h rw [← sub_eq_zero, ← LinearMap.map_sub] at h exact sub_eq_zero.mp (linearIndependent_iff.mp i _ h) #align linear_independent_le_span_aux' linearIndependent_le_span_aux' lemma LinearIndependent.finite_of_le_span_finite {ι : Type*} (v : ι → M) (i : LinearIndependent R v) (w : Set M) [Finite w] (s : range v ≤ span R w) : Finite ι := letI := Fintype.ofFinite w Fintype.finite <| fintypeOfFinsetCardLe (Fintype.card w) fun t => by let v' := fun x : (t : Set ι) => v x have i' : LinearIndependent R v' := i.comp _ Subtype.val_injective have s' : range v' ≤ span R w := (range_comp_subset_range _ _).trans s simpa using linearIndependent_le_span_aux' v' i' w s' #align linear_independent_fintype_of_le_span_fintype LinearIndependent.finite_of_le_span_finite theorem linearIndependent_le_span' {ι : Type*} (v : ι → M) (i : LinearIndependent R v) (w : Set M) [Fintype w] (s : range v ≤ span R w) : #ι ≤ Fintype.card w := by haveI : Finite ι := i.finite_of_le_span_finite v w s letI := Fintype.ofFinite ι rw [Cardinal.mk_fintype] simp only [Cardinal.natCast_le] exact linearIndependent_le_span_aux' v i w s #align linear_independent_le_span' linearIndependent_le_span' theorem linearIndependent_le_span {ι : Type*} (v : ι → M) (i : LinearIndependent R v) (w : Set M) [Fintype w] (s : span R w = ⊤) : #ι ≤ Fintype.card w := by apply linearIndependent_le_span' v i w rw [s] exact le_top #align linear_independent_le_span linearIndependent_le_span theorem linearIndependent_le_span_finset {ι : Type*} (v : ι → M) (i : LinearIndependent R v) (w : Finset M) (s : span R (w : Set M) = ⊤) : #ι ≤ w.card := by simpa only [Finset.coe_sort_coe, Fintype.card_coe] using linearIndependent_le_span v i w s #align linear_independent_le_span_finset linearIndependent_le_span_finset
Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean
244
258
theorem linearIndependent_le_infinite_basis {ι : Type w} (b : Basis ι R M) [Infinite ι] {κ : Type w} (v : κ → M) (i : LinearIndependent R v) : #κ ≤ #ι := by
classical by_contra h rw [not_le, ← Cardinal.mk_finset_of_infinite ι] at h let Φ := fun k : κ => (b.repr (v k)).support obtain ⟨s, w : Infinite ↑(Φ ⁻¹' {s})⟩ := Cardinal.exists_infinite_fiber Φ h (by infer_instance) let v' := fun k : Φ ⁻¹' {s} => v k have i' : LinearIndependent R v' := i.comp _ Subtype.val_injective have w' : Finite (Φ ⁻¹' {s}) := by apply i'.finite_of_le_span_finite v' (s.image b) rintro m ⟨⟨p, ⟨rfl⟩⟩, rfl⟩ simp only [SetLike.mem_coe, Subtype.coe_mk, Finset.coe_image] apply Basis.mem_span_repr_support exact w.false
13
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Data.Set.Pointwise.Iterate import Mathlib.Dynamics.Ergodic.Ergodic import Mathlib.MeasureTheory.Covering.DensityTheorem import Mathlib.MeasureTheory.Group.AddCircle import Mathlib.MeasureTheory.Measure.Haar.Unique #align_import dynamics.ergodic.add_circle from "leanprover-community/mathlib"@"5f6e827d81dfbeb6151d7016586ceeb0099b9655" open Set Function MeasureTheory MeasureTheory.Measure Filter Metric open scoped MeasureTheory NNReal ENNReal Topology Pointwise namespace AddCircle variable {T : ℝ} [hT : Fact (0 < T)] theorem ae_empty_or_univ_of_forall_vadd_ae_eq_self {s : Set <| AddCircle T} (hs : NullMeasurableSet s volume) {ι : Type*} {l : Filter ι} [l.NeBot] {u : ι → AddCircle T} (hu₁ : ∀ i, (u i +ᵥ s : Set _) =ᵐ[volume] s) (hu₂ : Tendsto (addOrderOf ∘ u) l atTop) : s =ᵐ[volume] (∅ : Set <| AddCircle T) ∨ s =ᵐ[volume] univ := by set μ := (volume : Measure <| AddCircle T) set n : ι → ℕ := addOrderOf ∘ u have hT₀ : 0 < T := hT.out have hT₁ : ENNReal.ofReal T ≠ 0 := by simpa rw [ae_eq_empty, ae_eq_univ_iff_measure_eq hs, AddCircle.measure_univ] rcases eq_or_ne (μ s) 0 with h | h; · exact Or.inl h right obtain ⟨d, -, hd⟩ : ∃ d, d ∈ s ∧ ∀ {ι'} {l : Filter ι'} (w : ι' → AddCircle T) (δ : ι' → ℝ), Tendsto δ l (𝓝[>] 0) → (∀ᶠ j in l, d ∈ closedBall (w j) (1 * δ j)) → Tendsto (fun j => μ (s ∩ closedBall (w j) (δ j)) / μ (closedBall (w j) (δ j))) l (𝓝 1) := exists_mem_of_measure_ne_zero_of_ae h (IsUnifLocDoublingMeasure.ae_tendsto_measure_inter_div μ s 1) let I : ι → Set (AddCircle T) := fun j => closedBall d (T / (2 * ↑(n j))) replace hd : Tendsto (fun j => μ (s ∩ I j) / μ (I j)) l (𝓝 1) := by let δ : ι → ℝ := fun j => T / (2 * ↑(n j)) have hδ₀ : ∀ᶠ j in l, 0 < δ j := (hu₂.eventually_gt_atTop 0).mono fun j hj => div_pos hT₀ <| by positivity have hδ₁ : Tendsto δ l (𝓝[>] 0) := by refine tendsto_nhdsWithin_iff.mpr ⟨?_, hδ₀⟩ replace hu₂ : Tendsto (fun j => T⁻¹ * 2 * n j) l atTop := (tendsto_natCast_atTop_iff.mpr hu₂).const_mul_atTop (by positivity : 0 < T⁻¹ * 2) convert hu₂.inv_tendsto_atTop ext j simp only [δ, Pi.inv_apply, mul_inv_rev, inv_inv, div_eq_inv_mul, ← mul_assoc] have hw : ∀ᶠ j in l, d ∈ closedBall d (1 * δ j) := hδ₀.mono fun j hj => by simp only [comp_apply, one_mul, mem_closedBall, dist_self] apply hj.le exact hd _ δ hδ₁ hw suffices ∀ᶠ j in l, μ (s ∩ I j) / μ (I j) = μ s / ENNReal.ofReal T by replace hd := hd.congr' this rwa [tendsto_const_nhds_iff, ENNReal.div_eq_one_iff hT₁ ENNReal.ofReal_ne_top] at hd refine (hu₂.eventually_gt_atTop 0).mono fun j hj => ?_ have : addOrderOf (u j) = n j := rfl have huj : IsOfFinAddOrder (u j) := addOrderOf_pos_iff.mp hj have huj' : 1 ≤ (↑(n j) : ℝ) := by norm_cast have hI₀ : μ (I j) ≠ 0 := (measure_closedBall_pos _ d <| by positivity).ne.symm have hI₁ : μ (I j) ≠ ⊤ := measure_ne_top _ _ have hI₂ : μ (I j) * ↑(n j) = ENNReal.ofReal T := by rw [volume_closedBall, mul_div, mul_div_mul_left T _ two_ne_zero, min_eq_right (div_le_self hT₀.le huj'), mul_comm, ← nsmul_eq_mul, ← ENNReal.ofReal_nsmul, nsmul_eq_mul, mul_div_cancel₀] exact Nat.cast_ne_zero.mpr hj.ne' rw [ENNReal.div_eq_div_iff hT₁ ENNReal.ofReal_ne_top hI₀ hI₁, volume_of_add_preimage_eq s _ (u j) d huj (hu₁ j) closedBall_ae_eq_ball, nsmul_eq_mul, ← mul_assoc, this, hI₂] #align add_circle.ae_empty_or_univ_of_forall_vadd_ae_eq_self AddCircle.ae_empty_or_univ_of_forall_vadd_ae_eq_self
Mathlib/Dynamics/Ergodic/AddCircle.lean
104
120
theorem ergodic_zsmul {n : ℤ} (hn : 1 < |n|) : Ergodic fun y : AddCircle T => n • y := { measurePreserving_zsmul volume (abs_pos.mp <| lt_trans zero_lt_one hn) with ae_empty_or_univ := fun s hs hs' => by let u : ℕ → AddCircle T := fun j => ↑((↑1 : ℝ) / ↑(n.natAbs ^ j) * T) replace hn : 1 < n.natAbs := by
rwa [Int.abs_eq_natAbs, Nat.one_lt_cast] at hn have hu₀ : ∀ j, addOrderOf (u j) = n.natAbs ^ j := fun j => by convert addOrderOf_div_of_gcd_eq_one (p := T) (m := 1) (pow_pos (pos_of_gt hn) j) (gcd_one_left _) norm_cast have hnu : ∀ j, n ^ j • u j = 0 := fun j => by rw [← addOrderOf_dvd_iff_zsmul_eq_zero, hu₀, Int.natCast_pow, Int.natCast_natAbs, ← abs_pow, abs_dvd] have hu₁ : ∀ j, (u j +ᵥ s : Set _) =ᵐ[volume] s := fun j => by rw [vadd_eq_self_of_preimage_zsmul_eq_self hs' (hnu j)] have hu₂ : Tendsto (fun j => addOrderOf <| u j) atTop atTop := by simp_rw [hu₀]; exact Nat.tendsto_pow_atTop_atTop_of_one_lt hn exact ae_empty_or_univ_of_forall_vadd_ae_eq_self hs.nullMeasurableSet hu₁ hu₂ }
13
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 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 #align ideal.map_mk_eq_bot_of_le Ideal.map_mk_eq_bot_of_le
Mathlib/RingTheory/Ideal/QuotientOperations.lean
141
156
theorem ker_quotient_lift {I : Ideal R} (f : R →+* S) (H : I ≤ ker f) : ker (Ideal.Quotient.lift I f H) = f.ker.map (Quotient.mk I) := by
apply Ideal.ext intro x constructor · intro hx obtain ⟨y, hy⟩ := Quotient.mk_surjective x rw [mem_ker, ← hy, Ideal.Quotient.lift_mk, ← mem_ker] at hx rw [← hy, mem_map_iff_of_surjective (Quotient.mk I) Quotient.mk_surjective] exact ⟨y, hx, rfl⟩ · intro hx rw [mem_map_iff_of_surjective (Quotient.mk I) Quotient.mk_surjective] at hx obtain ⟨y, hy⟩ := hx rw [mem_ker, ← hy.right, Ideal.Quotient.lift_mk] exact hy.left
13
import Mathlib.Analysis.Calculus.Deriv.Add import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.LocalExtr.Basic #align_import analysis.calculus.darboux from "leanprover-community/mathlib"@"61b5e2755ccb464b68d05a9acf891ae04992d09d" open Filter Set open scoped Topology Classical variable {a b : ℝ} {f f' : ℝ → ℝ} theorem exists_hasDerivWithinAt_eq_of_gt_of_lt (hab : a ≤ b) (hf : ∀ x ∈ Icc a b, HasDerivWithinAt f (f' x) (Icc a b) x) {m : ℝ} (hma : f' a < m) (hmb : m < f' b) : m ∈ f' '' Ioo a b := by rcases hab.eq_or_lt with (rfl | hab') · exact (lt_asymm hma hmb).elim set g : ℝ → ℝ := fun x => f x - m * x have hg : ∀ x ∈ Icc a b, HasDerivWithinAt g (f' x - m) (Icc a b) x := by intro x hx simpa using (hf x hx).sub ((hasDerivWithinAt_id x _).const_mul m) obtain ⟨c, cmem, hc⟩ : ∃ c ∈ Icc a b, IsMinOn g (Icc a b) c := isCompact_Icc.exists_isMinOn (nonempty_Icc.2 <| hab) fun x hx => (hg x hx).continuousWithinAt have cmem' : c ∈ Ioo a b := by rcases cmem.1.eq_or_lt with (rfl | hac) -- Show that `c` can't be equal to `a` · refine absurd (sub_nonneg.1 <| nonneg_of_mul_nonneg_right ?_ (sub_pos.2 hab')) (not_le_of_lt hma) have : b - a ∈ posTangentConeAt (Icc a b) a := mem_posTangentConeAt_of_segment_subset (segment_eq_Icc hab ▸ Subset.refl _) simpa only [ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply] using hc.localize.hasFDerivWithinAt_nonneg (hg a (left_mem_Icc.2 hab)) this rcases cmem.2.eq_or_gt with (rfl | hcb) -- Show that `c` can't be equal to `b` · refine absurd (sub_nonpos.1 <| nonpos_of_mul_nonneg_right ?_ (sub_lt_zero.2 hab')) (not_le_of_lt hmb) have : a - b ∈ posTangentConeAt (Icc a b) b := mem_posTangentConeAt_of_segment_subset (by rw [segment_symm, segment_eq_Icc hab]) simpa only [ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply] using hc.localize.hasFDerivWithinAt_nonneg (hg b (right_mem_Icc.2 hab)) this exact ⟨hac, hcb⟩ use c, cmem' rw [← sub_eq_zero] have : Icc a b ∈ 𝓝 c := by rwa [← mem_interior_iff_mem_nhds, interior_Icc] exact (hc.isLocalMin this).hasDerivAt_eq_zero ((hg c cmem).hasDerivAt this) #align exists_has_deriv_within_at_eq_of_gt_of_lt exists_hasDerivWithinAt_eq_of_gt_of_lt theorem exists_hasDerivWithinAt_eq_of_lt_of_gt (hab : a ≤ b) (hf : ∀ x ∈ Icc a b, HasDerivWithinAt f (f' x) (Icc a b) x) {m : ℝ} (hma : m < f' a) (hmb : f' b < m) : m ∈ f' '' Ioo a b := let ⟨c, cmem, hc⟩ := exists_hasDerivWithinAt_eq_of_gt_of_lt hab (fun x hx => (hf x hx).neg) (neg_lt_neg hma) (neg_lt_neg hmb) ⟨c, cmem, neg_injective hc⟩ #align exists_has_deriv_within_at_eq_of_lt_of_gt exists_hasDerivWithinAt_eq_of_lt_of_gt
Mathlib/Analysis/Calculus/Darboux.lean
76
90
theorem Set.OrdConnected.image_hasDerivWithinAt {s : Set ℝ} (hs : OrdConnected s) (hf : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x) : OrdConnected (f' '' s) := by
apply ordConnected_of_Ioo rintro _ ⟨a, ha, rfl⟩ _ ⟨b, hb, rfl⟩ - m ⟨hma, hmb⟩ rcases le_total a b with hab | hab · have : Icc a b ⊆ s := hs.out ha hb rcases exists_hasDerivWithinAt_eq_of_gt_of_lt hab (fun x hx => (hf x <| this hx).mono this) hma hmb with ⟨c, cmem, hc⟩ exact ⟨c, this <| Ioo_subset_Icc_self cmem, hc⟩ · have : Icc b a ⊆ s := hs.out hb ha rcases exists_hasDerivWithinAt_eq_of_lt_of_gt hab (fun x hx => (hf x <| this hx).mono this) hmb hma with ⟨c, cmem, hc⟩ exact ⟨c, this <| Ioo_subset_Icc_self cmem, hc⟩
13
import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral import Mathlib.Analysis.Complex.CauchyIntegral import Mathlib.MeasureTheory.Integral.Pi import Mathlib.Analysis.Fourier.FourierTransform open Real Set MeasureTheory Filter Asymptotics intervalIntegral open scoped Real Topology FourierTransform RealInnerProductSpace open Complex hiding exp continuous_exp abs_of_nonneg sq_abs noncomputable section namespace GaussianFourier variable {b : ℂ} def verticalIntegral (b : ℂ) (c T : ℝ) : ℂ := ∫ y : ℝ in (0 : ℝ)..c, I * (cexp (-b * (T + y * I) ^ 2) - cexp (-b * (T - y * I) ^ 2)) #align gaussian_fourier.vertical_integral GaussianFourier.verticalIntegral theorem norm_cexp_neg_mul_sq_add_mul_I (b : ℂ) (c T : ℝ) : ‖cexp (-b * (T + c * I) ^ 2)‖ = exp (-(b.re * T ^ 2 - 2 * b.im * c * T - b.re * c ^ 2)) := by rw [Complex.norm_eq_abs, Complex.abs_exp, neg_mul, neg_re, ← re_add_im b] simp only [sq, re_add_im, mul_re, mul_im, add_re, add_im, ofReal_re, ofReal_im, I_re, I_im] ring_nf set_option linter.uppercaseLean3 false in #align gaussian_fourier.norm_cexp_neg_mul_sq_add_mul_I GaussianFourier.norm_cexp_neg_mul_sq_add_mul_I theorem norm_cexp_neg_mul_sq_add_mul_I' (hb : b.re ≠ 0) (c T : ℝ) : ‖cexp (-b * (T + c * I) ^ 2)‖ = exp (-(b.re * (T - b.im * c / b.re) ^ 2 - c ^ 2 * (b.im ^ 2 / b.re + b.re))) := by have : b.re * T ^ 2 - 2 * b.im * c * T - b.re * c ^ 2 = b.re * (T - b.im * c / b.re) ^ 2 - c ^ 2 * (b.im ^ 2 / b.re + b.re) := by field_simp; ring rw [norm_cexp_neg_mul_sq_add_mul_I, this] set_option linter.uppercaseLean3 false in #align gaussian_fourier.norm_cexp_neg_mul_sq_add_mul_I' GaussianFourier.norm_cexp_neg_mul_sq_add_mul_I' theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤ T) : ‖verticalIntegral b c T‖ ≤ (2 : ℝ) * |c| * exp (-(b.re * T ^ 2 - (2 : ℝ) * |b.im| * |c| * T - b.re * c ^ 2)) := by -- first get uniform bound for integrand have vert_norm_bound : ∀ {T : ℝ}, 0 ≤ T → ∀ {c y : ℝ}, |y| ≤ |c| → ‖cexp (-b * (T + y * I) ^ 2)‖ ≤ exp (-(b.re * T ^ 2 - (2 : ℝ) * |b.im| * |c| * T - b.re * c ^ 2)) := by intro T hT c y hy rw [norm_cexp_neg_mul_sq_add_mul_I b] gcongr exp (- (_ - ?_ * _ - _ * ?_)) · (conv_lhs => rw [mul_assoc]); (conv_rhs => rw [mul_assoc]) gcongr _ * ?_ refine (le_abs_self _).trans ?_ rw [abs_mul] gcongr · rwa [sq_le_sq] -- now main proof apply (intervalIntegral.norm_integral_le_of_norm_le_const _).trans pick_goal 1 · rw [sub_zero] conv_lhs => simp only [mul_comm _ |c|] conv_rhs => conv => congr rw [mul_comm] rw [mul_assoc] · intro y hy have absy : |y| ≤ |c| := by rcases le_or_lt 0 c with (h | h) · rw [uIoc_of_le h] at hy rw [abs_of_nonneg h, abs_of_pos hy.1] exact hy.2 · rw [uIoc_of_lt h] at hy rw [abs_of_neg h, abs_of_nonpos hy.2, neg_le_neg_iff] exact hy.1.le rw [norm_mul, Complex.norm_eq_abs, abs_I, one_mul, two_mul] refine (norm_sub_le _ _).trans (add_le_add (vert_norm_bound hT absy) ?_) rw [← abs_neg y] at absy simpa only [neg_mul, ofReal_neg] using vert_norm_bound hT absy #align gaussian_fourier.vertical_integral_norm_le GaussianFourier.verticalIntegral_norm_le
Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean
115
129
theorem tendsto_verticalIntegral (hb : 0 < b.re) (c : ℝ) : Tendsto (verticalIntegral b c) atTop (𝓝 0) := by
-- complete proof using squeeze theorem: rw [tendsto_zero_iff_norm_tendsto_zero] refine tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds ?_ (eventually_of_forall fun _ => norm_nonneg _) ((eventually_ge_atTop (0 : ℝ)).mp (eventually_of_forall fun T hT => verticalIntegral_norm_le hb c hT)) rw [(by ring : 0 = 2 * |c| * 0)] refine (tendsto_exp_atBot.comp (tendsto_neg_atTop_atBot.comp ?_)).const_mul _ apply tendsto_atTop_add_const_right simp_rw [sq, ← mul_assoc, ← sub_mul] refine Tendsto.atTop_mul_atTop (tendsto_atTop_add_const_right _ _ ?_) tendsto_id exact (tendsto_const_mul_atTop_of_pos hb).mpr tendsto_id
13
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] class IsSepClosed : Prop where splits_of_separable : ∀ p : k[X], p.Separable → (p.Splits <| RingHom.id k) instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp variable (k) in instance (priority := 100) isAlgClosed_of_perfectField [IsSepClosed k] [PerfectField k] : IsAlgClosed k := IsAlgClosed.of_exists_root k fun p _ h ↦ exists_root p ((degree_pos_of_irreducible h).ne') (PerfectField.separable_of_irreducible h) theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] : ∃ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 · exact ⟨0, by rw [hx, pow_eq_zero_iff hn'.ne']⟩ · obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : ∃ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine ⟨fun h => ?_, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd · exact eq_C_of_degree_le_zero hd · obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_eval₂_eq_zero [IsSepClosed K] (f : k →+* K) (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x, p.eval₂ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [eval₂_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x : K, aeval x p = 0 := exists_eval₂_eq_zero (algebraMap k K) p hp hsep variable (k) {K}
Mathlib/FieldTheory/IsSepClosed.lean
146
160
theorem of_exists_root (H : ∀ p : k[X], p.Monic → Irreducible p → Separable p → ∃ x, p.eval x = 0) : IsSepClosed k := by
refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero ▸ degree_eq_one_of_irreducible_of_root hirr' hx
13
import Mathlib.Analysis.Complex.RemovableSingularity import Mathlib.Analysis.Calculus.UniformLimitsDeriv import Mathlib.Analysis.NormedSpace.FunctionSeries #align_import analysis.complex.locally_uniform_limit from "leanprover-community/mathlib"@"fe44cd36149e675eb5dec87acc7e8f1d6568e081" open Set Metric MeasureTheory Filter Complex intervalIntegral open scoped Real Topology variable {E ι : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] {U K : Set ℂ} {z : ℂ} {M r δ : ℝ} {φ : Filter ι} {F : ι → ℂ → E} {f g : ℂ → E} namespace Complex section Cderiv noncomputable def cderiv (r : ℝ) (f : ℂ → E) (z : ℂ) : E := (2 * π * I : ℂ)⁻¹ • ∮ w in C(z, r), ((w - z) ^ 2)⁻¹ • f w #align complex.cderiv Complex.cderiv theorem cderiv_eq_deriv (hU : IsOpen U) (hf : DifferentiableOn ℂ f U) (hr : 0 < r) (hzr : closedBall z r ⊆ U) : cderiv r f z = deriv f z := two_pi_I_inv_smul_circleIntegral_sub_sq_inv_smul_of_differentiable hU hzr hf (mem_ball_self hr) #align complex.cderiv_eq_deriv Complex.cderiv_eq_deriv
Mathlib/Analysis/Complex/LocallyUniformLimit.lean
50
64
theorem norm_cderiv_le (hr : 0 < r) (hf : ∀ w ∈ sphere z r, ‖f w‖ ≤ M) : ‖cderiv r f z‖ ≤ M / r := by
have hM : 0 ≤ M := by obtain ⟨w, hw⟩ : (sphere z r).Nonempty := NormedSpace.sphere_nonempty.mpr hr.le exact (norm_nonneg _).trans (hf w hw) have h1 : ∀ w ∈ sphere z r, ‖((w - z) ^ 2)⁻¹ • f w‖ ≤ M / r ^ 2 := by intro w hw simp only [mem_sphere_iff_norm, norm_eq_abs] at hw simp only [norm_smul, inv_mul_eq_div, hw, norm_eq_abs, map_inv₀, Complex.abs_pow] exact div_le_div hM (hf w hw) (sq_pos_of_pos hr) le_rfl have h2 := circleIntegral.norm_integral_le_of_norm_le_const hr.le h1 simp only [cderiv, norm_smul] refine (mul_le_mul le_rfl h2 (norm_nonneg _) (norm_nonneg _)).trans (le_of_eq ?_) field_simp [_root_.abs_of_nonneg Real.pi_pos.le] ring
13
import Mathlib.Analysis.Normed.Group.InfiniteSum import Mathlib.Analysis.Normed.MulAction import Mathlib.Topology.Algebra.Order.LiminfLimsup import Mathlib.Topology.PartialHomeomorph #align_import analysis.asymptotics.asymptotics from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Filter Set open scoped Classical open Topology Filter NNReal namespace Asymptotics set_option linter.uppercaseLean3 false variable {α : Type*} {β : Type*} {E : Type*} {F : Type*} {G : Type*} {E' : Type*} {F' : Type*} {G' : Type*} {E'' : Type*} {F'' : Type*} {G'' : Type*} {E''' : Type*} {R : Type*} {R' : Type*} {𝕜 : Type*} {𝕜' : Type*} variable [Norm E] [Norm F] [Norm G] variable [SeminormedAddCommGroup E'] [SeminormedAddCommGroup F'] [SeminormedAddCommGroup G'] [NormedAddCommGroup E''] [NormedAddCommGroup F''] [NormedAddCommGroup G''] [SeminormedRing R] [SeminormedAddGroup E'''] [SeminormedRing R'] variable [NormedDivisionRing 𝕜] [NormedDivisionRing 𝕜'] variable {c c' c₁ c₂ : ℝ} {f : α → E} {g : α → F} {k : α → G} variable {f' : α → E'} {g' : α → F'} {k' : α → G'} variable {f'' : α → E''} {g'' : α → F''} {k'' : α → G''} variable {l l' : Filter α} section Defs irreducible_def IsBigOWith (c : ℝ) (l : Filter α) (f : α → E) (g : α → F) : Prop := ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖ #align asymptotics.is_O_with Asymptotics.IsBigOWith theorem isBigOWith_iff : IsBigOWith c l f g ↔ ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖ := by rw [IsBigOWith_def] #align asymptotics.is_O_with_iff Asymptotics.isBigOWith_iff alias ⟨IsBigOWith.bound, IsBigOWith.of_bound⟩ := isBigOWith_iff #align asymptotics.is_O_with.bound Asymptotics.IsBigOWith.bound #align asymptotics.is_O_with.of_bound Asymptotics.IsBigOWith.of_bound irreducible_def IsBigO (l : Filter α) (f : α → E) (g : α → F) : Prop := ∃ c : ℝ, IsBigOWith c l f g #align asymptotics.is_O Asymptotics.IsBigO @[inherit_doc] notation:100 f " =O[" l "] " g:100 => IsBigO l f g theorem isBigO_iff_isBigOWith : f =O[l] g ↔ ∃ c : ℝ, IsBigOWith c l f g := by rw [IsBigO_def] #align asymptotics.is_O_iff_is_O_with Asymptotics.isBigO_iff_isBigOWith theorem isBigO_iff : f =O[l] g ↔ ∃ c : ℝ, ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖ := by simp only [IsBigO_def, IsBigOWith_def] #align asymptotics.is_O_iff Asymptotics.isBigO_iff
Mathlib/Analysis/Asymptotics/Asymptotics.lean
118
132
theorem isBigO_iff' {g : α → E'''} : f =O[l] g ↔ ∃ c > 0, ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖ := by
refine ⟨fun h => ?mp, fun h => ?mpr⟩ case mp => rw [isBigO_iff] at h obtain ⟨c, hc⟩ := h refine ⟨max c 1, zero_lt_one.trans_le (le_max_right _ _), ?_⟩ filter_upwards [hc] with x hx apply hx.trans gcongr exact le_max_left _ _ case mpr => rw [isBigO_iff] obtain ⟨c, ⟨_, hc⟩⟩ := h exact ⟨c, hc⟩
13
import Mathlib.NumberTheory.FLT.Basic import Mathlib.NumberTheory.PythagoreanTriples import Mathlib.RingTheory.Coprime.Lemmas import Mathlib.Tactic.LinearCombination #align_import number_theory.fermat4 from "leanprover-community/mathlib"@"10b4e499f43088dd3bb7b5796184ad5216648ab1" noncomputable section open scoped Classical def Fermat42 (a b c : ℤ) : Prop := a ≠ 0 ∧ b ≠ 0 ∧ a ^ 4 + b ^ 4 = c ^ 2 #align fermat_42 Fermat42 namespace Fermat42 theorem comm {a b c : ℤ} : Fermat42 a b c ↔ Fermat42 b a c := by delta Fermat42 rw [add_comm] tauto #align fermat_42.comm Fermat42.comm theorem mul {a b c k : ℤ} (hk0 : k ≠ 0) : Fermat42 a b c ↔ Fermat42 (k * a) (k * b) (k ^ 2 * c) := by delta Fermat42 constructor · intro f42 constructor · exact mul_ne_zero hk0 f42.1 constructor · exact mul_ne_zero hk0 f42.2.1 · have H : a ^ 4 + b ^ 4 = c ^ 2 := f42.2.2 linear_combination k ^ 4 * H · intro f42 constructor · exact right_ne_zero_of_mul f42.1 constructor · exact right_ne_zero_of_mul f42.2.1 apply (mul_right_inj' (pow_ne_zero 4 hk0)).mp linear_combination f42.2.2 #align fermat_42.mul Fermat42.mul theorem ne_zero {a b c : ℤ} (h : Fermat42 a b c) : c ≠ 0 := by apply ne_zero_pow two_ne_zero _; apply ne_of_gt rw [← h.2.2, (by ring : a ^ 4 + b ^ 4 = (a ^ 2) ^ 2 + (b ^ 2) ^ 2)] exact add_pos (sq_pos_of_ne_zero (pow_ne_zero 2 h.1)) (sq_pos_of_ne_zero (pow_ne_zero 2 h.2.1)) #align fermat_42.ne_zero Fermat42.ne_zero def Minimal (a b c : ℤ) : Prop := Fermat42 a b c ∧ ∀ a1 b1 c1 : ℤ, Fermat42 a1 b1 c1 → Int.natAbs c ≤ Int.natAbs c1 #align fermat_42.minimal Fermat42.Minimal
Mathlib/NumberTheory/FLT/Four.lean
72
85
theorem exists_minimal {a b c : ℤ} (h : Fermat42 a b c) : ∃ a0 b0 c0, Minimal a0 b0 c0 := by
let S : Set ℕ := { n | ∃ s : ℤ × ℤ × ℤ, Fermat42 s.1 s.2.1 s.2.2 ∧ n = Int.natAbs s.2.2 } have S_nonempty : S.Nonempty := by use Int.natAbs c rw [Set.mem_setOf_eq] use ⟨a, ⟨b, c⟩⟩ let m : ℕ := Nat.find S_nonempty have m_mem : m ∈ S := Nat.find_spec S_nonempty rcases m_mem with ⟨s0, hs0, hs1⟩ use s0.1, s0.2.1, s0.2.2, hs0 intro a1 b1 c1 h1 rw [← hs1] apply Nat.find_min' use ⟨a1, ⟨b1, c1⟩⟩
13
import Mathlib.NumberTheory.NumberField.Basic import Mathlib.RingTheory.Localization.NormTrace #align_import number_theory.number_field.norm from "leanprover-community/mathlib"@"00f91228655eecdcd3ac97a7fd8dbcb139fe990a" open scoped NumberField open Finset NumberField Algebra FiniteDimensional namespace RingOfIntegers variable {L : Type*} (K : Type*) [Field K] [Field L] [Algebra K L] [FiniteDimensional K L] noncomputable def norm [IsSeparable K L] : 𝓞 L →* 𝓞 K := RingOfIntegers.restrict_monoidHom ((Algebra.norm K).comp (algebraMap (𝓞 L) L : (𝓞 L) →* L)) fun x => isIntegral_norm K x.2 #align ring_of_integers.norm RingOfIntegers.norm @[simp] lemma coe_norm [IsSeparable K L] (x : 𝓞 L) : norm K x = Algebra.norm K (x : L) := rfl theorem coe_algebraMap_norm [IsSeparable K L] (x : 𝓞 L) : (algebraMap (𝓞 K) (𝓞 L) (norm K x) : L) = algebraMap K L (Algebra.norm K (x : L)) := rfl #align ring_of_integers.coe_algebra_map_norm RingOfIntegers.coe_algebraMap_norm theorem algebraMap_norm_algebraMap [IsSeparable K L] (x : 𝓞 K) : algebraMap _ K (norm K (algebraMap (𝓞 K) (𝓞 L) x)) = Algebra.norm K (algebraMap K L (algebraMap _ _ x)) := rfl #align ring_of_integers.coe_norm_algebra_map RingOfIntegers.algebraMap_norm_algebraMap theorem norm_algebraMap [IsSeparable K L] (x : 𝓞 K) : norm K (algebraMap (𝓞 K) (𝓞 L) x) = x ^ finrank K L := by rw [RingOfIntegers.ext_iff, RingOfIntegers.coe_eq_algebraMap, RingOfIntegers.algebraMap_norm_algebraMap, Algebra.norm_algebraMap, RingOfIntegers.coe_eq_algebraMap, map_pow] #align ring_of_integers.norm_algebra_map RingOfIntegers.norm_algebraMap
Mathlib/NumberTheory/NumberField/Norm.lean
72
85
theorem isUnit_norm_of_isGalois [IsGalois K L] {x : 𝓞 L} : IsUnit (norm K x) ↔ IsUnit x := by
classical refine ⟨fun hx => ?_, IsUnit.map _⟩ replace hx : IsUnit (algebraMap (𝓞 K) (𝓞 L) <| norm K x) := hx.map (algebraMap (𝓞 K) <| 𝓞 L) refine @isUnit_of_mul_isUnit_right (𝓞 L) _ ⟨(univ \ {AlgEquiv.refl}).prod fun σ : L ≃ₐ[K] L => σ x, prod_mem fun σ _ => x.2.map (σ : L →+* L).toIntAlgHom⟩ _ ?_ convert hx using 1 ext convert_to ((univ \ {AlgEquiv.refl}).prod fun σ : L ≃ₐ[K] L => σ x) * ∏ σ ∈ {(AlgEquiv.refl : L ≃ₐ[K] L)}, σ x = _ · rw [prod_singleton, AlgEquiv.coe_refl, _root_.id, RingOfIntegers.coe_eq_algebraMap, map_mul, RingOfIntegers.map_mk] · rw [prod_sdiff <| subset_univ _, ← norm_eq_prod_automorphisms, coe_algebraMap_norm]
13
import Mathlib.RingTheory.Polynomial.Hermite.Basic import Mathlib.Analysis.Calculus.Deriv.Add import Mathlib.Analysis.Calculus.Deriv.Polynomial import Mathlib.Analysis.SpecialFunctions.Exp import Mathlib.Analysis.SpecialFunctions.ExpDeriv #align_import ring_theory.polynomial.hermite.gaussian from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open Polynomial namespace Polynomial
Mathlib/RingTheory/Polynomial/Hermite/Gaussian.lean
40
55
theorem deriv_gaussian_eq_hermite_mul_gaussian (n : ℕ) (x : ℝ) : deriv^[n] (fun y => Real.exp (-(y ^ 2 / 2))) x = (-1 : ℝ) ^ n * aeval x (hermite n) * Real.exp (-(x ^ 2 / 2)) := by
rw [mul_assoc] induction' n with n ih generalizing x · rw [Function.iterate_zero_apply, pow_zero, one_mul, hermite_zero, C_1, map_one, one_mul] · replace ih : deriv^[n] _ = _ := _root_.funext ih have deriv_gaussian : deriv (fun y => Real.exp (-(y ^ 2 / 2))) x = -x * Real.exp (-(x ^ 2 / 2)) := by -- porting note (#10745): was `simp [mul_comm, ← neg_mul]` rw [deriv_exp (by simp)]; simp; ring rw [Function.iterate_succ_apply', ih, deriv_const_mul_field, deriv_mul, pow_succ (-1 : ℝ), deriv_gaussian, hermite_succ, map_sub, map_mul, aeval_X, Polynomial.deriv_aeval] · ring · apply Polynomial.differentiable_aeval · apply DifferentiableAt.exp; simp -- Porting note: was just `simp`
13
import Batteries.Data.List.Lemmas import Batteries.Data.Array.Basic import Batteries.Tactic.SeqFocus import Batteries.Util.ProofWanted namespace Array
.lake/packages/batteries/Batteries/Data/Array/Lemmas.lean
14
29
theorem forIn_eq_data_forIn [Monad m] (as : Array α) (b : β) (f : α → β → m (ForInStep β)) : forIn as b f = forIn as.data b f := by
let rec loop : ∀ {i h b j}, j + i = as.size → Array.forIn.loop as f i h b = forIn (as.data.drop j) b f | 0, _, _, _, rfl => by rw [List.drop_length]; rfl | i+1, _, _, j, ij => by simp only [forIn.loop, Nat.add] have j_eq : j = size as - 1 - i := by simp [← ij, ← Nat.add_assoc] have : as.size - 1 - i < as.size := j_eq ▸ ij ▸ Nat.lt_succ_of_le (Nat.le_add_right ..) have : as[size as - 1 - i] :: as.data.drop (j + 1) = as.data.drop j := by rw [j_eq]; exact List.get_cons_drop _ ⟨_, this⟩ simp only [← this, List.forIn_cons]; congr; funext x; congr; funext b rw [loop (i := i)]; rw [← ij, Nat.succ_add]; rfl conv => lhs; simp only [forIn, Array.forIn] rw [loop (Nat.zero_add _)]; rfl
13
import Mathlib.Data.Set.Card import Mathlib.Order.Minimal import Mathlib.Data.Matroid.Init set_option autoImplicit true open Set def Matroid.ExchangeProperty {α : Type _} (P : Set α → Prop) : Prop := ∀ X Y, P X → P Y → ∀ a ∈ X \ Y, ∃ b ∈ Y \ X, P (insert b (X \ {a})) def Matroid.ExistsMaximalSubsetProperty {α : Type _} (P : Set α → Prop) (X : Set α) : Prop := ∀ I, P I → I ⊆ X → (maximals (· ⊆ ·) {Y | P Y ∧ I ⊆ Y ∧ Y ⊆ X}).Nonempty @[ext] structure Matroid (α : Type _) where (E : Set α) (Base : Set α → Prop) (Indep : Set α → Prop) (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B) (exists_base : ∃ B, Base B) (base_exchange : Matroid.ExchangeProperty Base) (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X) (subset_ground : ∀ B, Base B → B ⊆ E) namespace Matroid variable {α : Type*} {M : Matroid α} protected class Finite (M : Matroid α) : Prop where (ground_finite : M.E.Finite) protected class Nonempty (M : Matroid α) : Prop where (ground_nonempty : M.E.Nonempty) theorem ground_nonempty (M : Matroid α) [M.Nonempty] : M.E.Nonempty := Nonempty.ground_nonempty theorem ground_nonempty_iff (M : Matroid α) : M.E.Nonempty ↔ M.Nonempty := ⟨fun h ↦ ⟨h⟩, fun ⟨h⟩ ↦ h⟩ theorem ground_finite (M : Matroid α) [M.Finite] : M.E.Finite := Finite.ground_finite theorem set_finite (M : Matroid α) [M.Finite] (X : Set α) (hX : X ⊆ M.E := by aesop) : X.Finite := M.ground_finite.subset hX instance finite_of_finite [Finite α] {M : Matroid α} : M.Finite := ⟨Set.toFinite _⟩ class FiniteRk (M : Matroid α) : Prop where exists_finite_base : ∃ B, M.Base B ∧ B.Finite instance finiteRk_of_finite (M : Matroid α) [M.Finite] : FiniteRk M := ⟨M.exists_base.imp (fun B hB ↦ ⟨hB, M.set_finite B (M.subset_ground _ hB)⟩)⟩ class InfiniteRk (M : Matroid α) : Prop where exists_infinite_base : ∃ B, M.Base B ∧ B.Infinite class RkPos (M : Matroid α) : Prop where empty_not_base : ¬M.Base ∅ theorem rkPos_iff_empty_not_base : M.RkPos ↔ ¬M.Base ∅ := ⟨fun ⟨h⟩ ↦ h, fun h ↦ ⟨h⟩⟩ section exchange namespace ExchangeProperty variable {Base : Set α → Prop} (exch : ExchangeProperty Base) theorem antichain (hB : Base B) (hB' : Base B') (h : B ⊆ B') : B = B' := h.antisymm (fun x hx ↦ by_contra (fun hxB ↦ let ⟨_, hy, _⟩ := exch B' B hB' hB x ⟨hx, hxB⟩; hy.2 <| h hy.1))
Mathlib/Data/Matroid/Basic.lean
268
286
theorem encard_diff_le_aux (exch : ExchangeProperty Base) (hB₁ : Base B₁) (hB₂ : Base B₂) : (B₁ \ B₂).encard ≤ (B₂ \ B₁).encard := by
obtain (he | hinf | ⟨e, he, hcard⟩) := (B₂ \ B₁).eq_empty_or_encard_eq_top_or_encard_diff_singleton_lt · rw [exch.antichain hB₂ hB₁ (diff_eq_empty.mp he)] · exact le_top.trans_eq hinf.symm obtain ⟨f, hf, hB'⟩ := exch B₂ B₁ hB₂ hB₁ e he have : encard (insert f (B₂ \ {e}) \ B₁) < encard (B₂ \ B₁) := by rw [insert_diff_of_mem _ hf.1, diff_diff_comm]; exact hcard have hencard := encard_diff_le_aux exch hB₁ hB' rw [insert_diff_of_mem _ hf.1, diff_diff_comm, ← union_singleton, ← diff_diff, diff_diff_right, inter_singleton_eq_empty.mpr he.2, union_empty] at hencard rw [← encard_diff_singleton_add_one he, ← encard_diff_singleton_add_one hf] exact add_le_add_right hencard 1 termination_by (B₂ \ B₁).encard
13
import Mathlib.Analysis.Complex.Circle import Mathlib.MeasureTheory.Group.Integral import Mathlib.MeasureTheory.Integral.SetIntegral import Mathlib.MeasureTheory.Measure.Haar.OfBasis import Mathlib.MeasureTheory.Constructions.Prod.Integral import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace import Mathlib.Algebra.Group.AddChar #align_import analysis.fourier.fourier_transform from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" noncomputable section local notation "𝕊" => circle open MeasureTheory Filter open scoped Topology namespace VectorFourier variable {𝕜 : Type*} [CommRing 𝕜] {V : Type*} [AddCommGroup V] [Module 𝕜 V] [MeasurableSpace V] {W : Type*} [AddCommGroup W] [Module 𝕜 W] {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [NormedAddCommGroup F] [NormedSpace ℂ F] [NormedAddCommGroup G] [NormedSpace ℂ G] section Continuous variable [TopologicalSpace 𝕜] [TopologicalRing 𝕜] [TopologicalSpace V] [BorelSpace V] [TopologicalSpace W] {e : AddChar 𝕜 𝕊} {μ : Measure V} {L : V →ₗ[𝕜] W →ₗ[𝕜] 𝕜}
Mathlib/Analysis/Fourier/FourierTransform.lean
132
147
theorem fourierIntegral_convergent_iff (he : Continuous e) (hL : Continuous fun p : V × W ↦ L p.1 p.2) {f : V → E} (w : W) : Integrable (fun v : V ↦ e (-L v w) • f v) μ ↔ Integrable f μ := by
-- first prove one-way implication have aux {g : V → E} (hg : Integrable g μ) (x : W) : Integrable (fun v : V ↦ e (-L v x) • g v) μ := by have c : Continuous fun v ↦ e (-L v x) := he.comp (hL.comp (continuous_prod_mk.mpr ⟨continuous_id, continuous_const⟩)).neg simp_rw [← integrable_norm_iff (c.aestronglyMeasurable.smul hg.1), norm_circle_smul] exact hg.norm -- then use it for both directions refine ⟨fun hf ↦ ?_, fun hf ↦ aux hf w⟩ have := aux hf (-w) simp_rw [← mul_smul (e _) (e _) (f _), ← e.map_add_eq_mul, LinearMap.map_neg, neg_add_self, e.map_zero_eq_one, one_smul] at this -- the `(e _)` speeds up elaboration considerably exact this
13
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" universe u v w variable {R S T : Type*} [CommRing R] [Ring S] variable [Algebra R S] variable {K L F : Type*} [Field K] [Field L] [Field F] variable [Algebra K L] [Algebra K F] variable {ι : Type w} open FiniteDimensional open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #align algebra.norm_apply Algebra.norm_apply theorem norm_eq_one_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) (x : S) : norm R x = 1 := by rw [norm_apply, LinearMap.det]; split_ifs <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_basis variable {R} theorem norm_eq_one_of_not_module_finite (h : ¬Module.Finite R S) (x : S) : norm R x = 1 := by refine norm_eq_one_of_not_exists_basis _ (mt ?_ h) _ rintro ⟨s, ⟨b⟩⟩ exact Module.Finite.of_basis b #align algebra.norm_eq_one_of_not_module_finite Algebra.norm_eq_one_of_not_module_finite -- Can't be a `simp` lemma because it depends on a choice of basis theorem norm_eq_matrix_det [Fintype ι] [DecidableEq ι] (b : Basis ι R S) (s : S) : norm R s = Matrix.det (Algebra.leftMulMatrix b s) := by rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) : norm R (algebraMap R S x) = x ^ Fintype.card ι := by haveI := Classical.decEq ι rw [norm_apply, ← det_toMatrix b, lmul_algebraMap] convert @det_diagonal _ _ _ _ _ fun _ : ι => x · ext (i j); rw [toMatrix_lsmul] · rw [Finset.prod_const, Finset.card_univ] #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis @[simp] protected theorem norm_algebraMap {L : Type*} [Ring L] [Algebra K L] (x : K) : norm K (algebraMap K L x) = x ^ finrank K L := by by_cases H : ∃ s : Finset L, Nonempty (Basis s K L) · rw [norm_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some] · rw [norm_eq_one_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis, pow_zero] rintro ⟨s, ⟨b⟩⟩ exact H ⟨s, ⟨b⟩⟩ #align algebra.norm_algebra_map Algebra.norm_algebraMap section EqZeroIff variable [Finite ι] @[simp] theorem norm_zero [Nontrivial S] [Module.Free R S] [Module.Finite R S] : norm R (0 : S) = 0 := by nontriviality rw [norm_apply, coe_lmul_eq_mul, map_zero, LinearMap.det_zero' (Module.Free.chooseBasis R S)] #align algebra.norm_zero Algebra.norm_zero @[simp]
Mathlib/RingTheory/Norm.lean
151
166
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} : norm R x = 0 ↔ x = 0 := by
constructor on_goal 1 => let b := Module.Free.chooseBasis R S swap · rintro rfl; exact norm_zero · letI := Classical.decEq (Module.Free.ChooseBasisIndex R S) rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff] rintro ⟨v, v_ne, hv⟩ rw [← b.equivFun.apply_symm_apply v, b.equivFun_symm_apply, b.equivFun_apply, leftMulMatrix_mulVec_repr] at hv refine (mul_eq_zero.mp (b.ext_elem fun i => ?_)).resolve_right (show ∑ i, v i • b i ≠ 0 from ?_) · simpa only [LinearEquiv.map_zero, Pi.zero_apply] using congr_fun hv i · contrapose! v_ne with sum_eq apply b.equivFun.symm.injective rw [b.equivFun_symm_apply, sum_eq, LinearEquiv.map_zero]
14
import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Data.Nat.Factors import Mathlib.Order.Interval.Finset.Nat #align_import number_theory.divisors from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" open scoped Classical open Finset namespace Nat variable (n : ℕ) def divisors : Finset ℕ := Finset.filter (fun x : ℕ => x ∣ n) (Finset.Ico 1 (n + 1)) #align nat.divisors Nat.divisors def properDivisors : Finset ℕ := Finset.filter (fun x : ℕ => x ∣ n) (Finset.Ico 1 n) #align nat.proper_divisors Nat.properDivisors def divisorsAntidiagonal : Finset (ℕ × ℕ) := Finset.filter (fun x => x.fst * x.snd = n) (Ico 1 (n + 1) ×ˢ Ico 1 (n + 1)) #align nat.divisors_antidiagonal Nat.divisorsAntidiagonal variable {n} @[simp] theorem filter_dvd_eq_divisors (h : n ≠ 0) : (Finset.range n.succ).filter (· ∣ n) = n.divisors := by ext simp only [divisors, mem_filter, mem_range, mem_Ico, and_congr_left_iff, iff_and_self] exact fun ha _ => succ_le_iff.mpr (pos_of_dvd_of_pos ha h.bot_lt) #align nat.filter_dvd_eq_divisors Nat.filter_dvd_eq_divisors @[simp] theorem filter_dvd_eq_properDivisors (h : n ≠ 0) : (Finset.range n).filter (· ∣ n) = n.properDivisors := by ext simp only [properDivisors, mem_filter, mem_range, mem_Ico, and_congr_left_iff, iff_and_self] exact fun ha _ => succ_le_iff.mpr (pos_of_dvd_of_pos ha h.bot_lt) #align nat.filter_dvd_eq_proper_divisors Nat.filter_dvd_eq_properDivisors theorem properDivisors.not_self_mem : ¬n ∈ properDivisors n := by simp [properDivisors] #align nat.proper_divisors.not_self_mem Nat.properDivisors.not_self_mem @[simp] theorem mem_properDivisors {m : ℕ} : n ∈ properDivisors m ↔ n ∣ m ∧ n < m := by rcases eq_or_ne m 0 with (rfl | hm); · simp [properDivisors] simp only [and_comm, ← filter_dvd_eq_properDivisors hm, mem_filter, mem_range] #align nat.mem_proper_divisors Nat.mem_properDivisors theorem insert_self_properDivisors (h : n ≠ 0) : insert n (properDivisors n) = divisors n := by rw [divisors, properDivisors, Ico_succ_right_eq_insert_Ico (one_le_iff_ne_zero.2 h), Finset.filter_insert, if_pos (dvd_refl n)] #align nat.insert_self_proper_divisors Nat.insert_self_properDivisors theorem cons_self_properDivisors (h : n ≠ 0) : cons n (properDivisors n) properDivisors.not_self_mem = divisors n := by rw [cons_eq_insert, insert_self_properDivisors h] #align nat.cons_self_proper_divisors Nat.cons_self_properDivisors @[simp] theorem mem_divisors {m : ℕ} : n ∈ divisors m ↔ n ∣ m ∧ m ≠ 0 := by rcases eq_or_ne m 0 with (rfl | hm); · simp [divisors] simp only [hm, Ne, not_false_iff, and_true_iff, ← filter_dvd_eq_divisors hm, mem_filter, mem_range, and_iff_right_iff_imp, Nat.lt_succ_iff] exact le_of_dvd hm.bot_lt #align nat.mem_divisors Nat.mem_divisors theorem one_mem_divisors : 1 ∈ divisors n ↔ n ≠ 0 := by simp #align nat.one_mem_divisors Nat.one_mem_divisors theorem mem_divisors_self (n : ℕ) (h : n ≠ 0) : n ∈ n.divisors := mem_divisors.2 ⟨dvd_rfl, h⟩ #align nat.mem_divisors_self Nat.mem_divisors_self theorem dvd_of_mem_divisors {m : ℕ} (h : n ∈ divisors m) : n ∣ m := by cases m · apply dvd_zero · simp [mem_divisors.1 h] #align nat.dvd_of_mem_divisors Nat.dvd_of_mem_divisors @[simp]
Mathlib/NumberTheory/Divisors.lean
116
131
theorem mem_divisorsAntidiagonal {x : ℕ × ℕ} : x ∈ divisorsAntidiagonal n ↔ x.fst * x.snd = n ∧ n ≠ 0 := by
simp only [divisorsAntidiagonal, Finset.mem_Ico, Ne, Finset.mem_filter, Finset.mem_product] rw [and_comm] apply and_congr_right rintro rfl constructor <;> intro h · contrapose! h simp [h] · rw [Nat.lt_add_one_iff, Nat.lt_add_one_iff] rw [mul_eq_zero, not_or] at h simp only [succ_le_of_lt (Nat.pos_of_ne_zero h.1), succ_le_of_lt (Nat.pos_of_ne_zero h.2), true_and_iff] exact ⟨Nat.le_mul_of_pos_right _ (Nat.pos_of_ne_zero h.2), Nat.le_mul_of_pos_left _ (Nat.pos_of_ne_zero h.1)⟩
14
import Mathlib.Analysis.PSeries import Mathlib.Data.Real.Pi.Wallis import Mathlib.Tactic.AdaptationNote #align_import analysis.special_functions.stirling from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" open scoped Topology Real Nat Asymptotics open Finset Filter Nat Real namespace Stirling noncomputable def stirlingSeq (n : ℕ) : ℝ := n ! / (√(2 * n : ℝ) * (n / exp 1) ^ n) #align stirling.stirling_seq Stirling.stirlingSeq @[simp] theorem stirlingSeq_zero : stirlingSeq 0 = 0 := by rw [stirlingSeq, cast_zero, mul_zero, Real.sqrt_zero, zero_mul, div_zero] #align stirling.stirling_seq_zero Stirling.stirlingSeq_zero @[simp] theorem stirlingSeq_one : stirlingSeq 1 = exp 1 / √2 := by rw [stirlingSeq, pow_one, factorial_one, cast_one, mul_one, mul_one_div, one_div_div] #align stirling.stirling_seq_one Stirling.stirlingSeq_one theorem log_stirlingSeq_formula (n : ℕ) : log (stirlingSeq n) = Real.log n ! - 1 / 2 * Real.log (2 * n) - n * log (n / exp 1) := by cases n · simp · rw [stirlingSeq, log_div, log_mul, sqrt_eq_rpow, log_rpow, Real.log_pow, tsub_tsub] <;> positivity -- Porting note: generalized from `n.succ` to `n` #align stirling.log_stirling_seq_formula Stirling.log_stirlingSeq_formulaₓ
Mathlib/Analysis/SpecialFunctions/Stirling.lean
77
93
theorem log_stirlingSeq_diff_hasSum (m : ℕ) : HasSum (fun k : ℕ => (1 : ℝ) / (2 * ↑(k + 1) + 1) * ((1 / (2 * ↑(m + 1) + 1)) ^ 2) ^ ↑(k + 1)) (log (stirlingSeq (m + 1)) - log (stirlingSeq (m + 2))) := by
let f (k : ℕ) := (1 : ℝ) / (2 * k + 1) * ((1 / (2 * ↑(m + 1) + 1)) ^ 2) ^ k change HasSum (fun k => f (k + 1)) _ rw [hasSum_nat_add_iff] convert (hasSum_log_one_add_inv m.cast_add_one_pos).mul_left ((↑(m + 1) : ℝ) + 1 / 2) using 1 · ext k dsimp only [f] rw [← pow_mul, pow_add] push_cast field_simp ring · have h : ∀ x ≠ (0 : ℝ), 1 + x⁻¹ = (x + 1) / x := fun x hx ↦ by field_simp [hx] simp (disch := positivity) only [log_stirlingSeq_formula, log_div, log_mul, log_exp, factorial_succ, cast_mul, cast_succ, cast_zero, range_one, sum_singleton, h] ring
14
import Mathlib.Algebra.BigOperators.NatAntidiagonal import Mathlib.Algebra.Polynomial.RingDivision #align_import data.polynomial.mirror from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" namespace Polynomial open Polynomial section Semiring variable {R : Type*} [Semiring R] (p q : R[X]) noncomputable def mirror := p.reverse * X ^ p.natTrailingDegree #align polynomial.mirror Polynomial.mirror @[simp] theorem mirror_zero : (0 : R[X]).mirror = 0 := by simp [mirror] #align polynomial.mirror_zero Polynomial.mirror_zero theorem mirror_monomial (n : ℕ) (a : R) : (monomial n a).mirror = monomial n a := by classical by_cases ha : a = 0 · rw [ha, monomial_zero_right, mirror_zero] · rw [mirror, reverse, natDegree_monomial n a, if_neg ha, natTrailingDegree_monomial ha, ← C_mul_X_pow_eq_monomial, reflect_C_mul_X_pow, revAt_le (le_refl n), tsub_self, pow_zero, mul_one] #align polynomial.mirror_monomial Polynomial.mirror_monomial theorem mirror_C (a : R) : (C a).mirror = C a := mirror_monomial 0 a set_option linter.uppercaseLean3 false in #align polynomial.mirror_C Polynomial.mirror_C theorem mirror_X : X.mirror = (X : R[X]) := mirror_monomial 1 (1 : R) set_option linter.uppercaseLean3 false in #align polynomial.mirror_X Polynomial.mirror_X theorem mirror_natDegree : p.mirror.natDegree = p.natDegree := by by_cases hp : p = 0 · rw [hp, mirror_zero] nontriviality R rw [mirror, natDegree_mul', reverse_natDegree, natDegree_X_pow, tsub_add_cancel_of_le p.natTrailingDegree_le_natDegree] rwa [leadingCoeff_X_pow, mul_one, reverse_leadingCoeff, Ne, trailingCoeff_eq_zero] #align polynomial.mirror_nat_degree Polynomial.mirror_natDegree theorem mirror_natTrailingDegree : p.mirror.natTrailingDegree = p.natTrailingDegree := by by_cases hp : p = 0 · rw [hp, mirror_zero] · rw [mirror, natTrailingDegree_mul_X_pow ((mt reverse_eq_zero.mp) hp), natTrailingDegree_reverse, zero_add] #align polynomial.mirror_nat_trailing_degree Polynomial.mirror_natTrailingDegree
Mathlib/Algebra/Polynomial/Mirror.lean
82
97
theorem coeff_mirror (n : ℕ) : p.mirror.coeff n = p.coeff (revAt (p.natDegree + p.natTrailingDegree) n) := by
by_cases h2 : p.natDegree < n · rw [coeff_eq_zero_of_natDegree_lt (by rwa [mirror_natDegree])] by_cases h1 : n ≤ p.natDegree + p.natTrailingDegree · rw [revAt_le h1, coeff_eq_zero_of_lt_natTrailingDegree] exact (tsub_lt_iff_left h1).mpr (Nat.add_lt_add_right h2 _) · rw [← revAtFun_eq, revAtFun, if_neg h1, coeff_eq_zero_of_natDegree_lt h2] rw [not_lt] at h2 rw [revAt_le (h2.trans (Nat.le_add_right _ _))] by_cases h3 : p.natTrailingDegree ≤ n · rw [← tsub_add_eq_add_tsub h2, ← tsub_tsub_assoc h2 h3, mirror, coeff_mul_X_pow', if_pos h3, coeff_reverse, revAt_le (tsub_le_self.trans h2)] rw [not_le] at h3 rw [coeff_eq_zero_of_natDegree_lt (lt_tsub_iff_right.mpr (Nat.add_lt_add_left h3 _))] exact coeff_eq_zero_of_lt_natTrailingDegree (by rwa [mirror_natTrailingDegree])
14
import Mathlib.Analysis.PSeries import Mathlib.Data.Real.Pi.Wallis import Mathlib.Tactic.AdaptationNote #align_import analysis.special_functions.stirling from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" open scoped Topology Real Nat Asymptotics open Finset Filter Nat Real namespace Stirling noncomputable def stirlingSeq (n : ℕ) : ℝ := n ! / (√(2 * n : ℝ) * (n / exp 1) ^ n) #align stirling.stirling_seq Stirling.stirlingSeq @[simp] theorem stirlingSeq_zero : stirlingSeq 0 = 0 := by rw [stirlingSeq, cast_zero, mul_zero, Real.sqrt_zero, zero_mul, div_zero] #align stirling.stirling_seq_zero Stirling.stirlingSeq_zero @[simp] theorem stirlingSeq_one : stirlingSeq 1 = exp 1 / √2 := by rw [stirlingSeq, pow_one, factorial_one, cast_one, mul_one, mul_one_div, one_div_div] #align stirling.stirling_seq_one Stirling.stirlingSeq_one theorem log_stirlingSeq_formula (n : ℕ) : log (stirlingSeq n) = Real.log n ! - 1 / 2 * Real.log (2 * n) - n * log (n / exp 1) := by cases n · simp · rw [stirlingSeq, log_div, log_mul, sqrt_eq_rpow, log_rpow, Real.log_pow, tsub_tsub] <;> positivity -- Porting note: generalized from `n.succ` to `n` #align stirling.log_stirling_seq_formula Stirling.log_stirlingSeq_formulaₓ theorem log_stirlingSeq_diff_hasSum (m : ℕ) : HasSum (fun k : ℕ => (1 : ℝ) / (2 * ↑(k + 1) + 1) * ((1 / (2 * ↑(m + 1) + 1)) ^ 2) ^ ↑(k + 1)) (log (stirlingSeq (m + 1)) - log (stirlingSeq (m + 2))) := by let f (k : ℕ) := (1 : ℝ) / (2 * k + 1) * ((1 / (2 * ↑(m + 1) + 1)) ^ 2) ^ k change HasSum (fun k => f (k + 1)) _ rw [hasSum_nat_add_iff] convert (hasSum_log_one_add_inv m.cast_add_one_pos).mul_left ((↑(m + 1) : ℝ) + 1 / 2) using 1 · ext k dsimp only [f] rw [← pow_mul, pow_add] push_cast field_simp ring · have h : ∀ x ≠ (0 : ℝ), 1 + x⁻¹ = (x + 1) / x := fun x hx ↦ by field_simp [hx] simp (disch := positivity) only [log_stirlingSeq_formula, log_div, log_mul, log_exp, factorial_succ, cast_mul, cast_succ, cast_zero, range_one, sum_singleton, h] ring #align stirling.log_stirling_seq_diff_has_sum Stirling.log_stirlingSeq_diff_hasSum theorem log_stirlingSeq'_antitone : Antitone (Real.log ∘ stirlingSeq ∘ succ) := antitone_nat_of_succ_le fun n => sub_nonneg.mp <| (log_stirlingSeq_diff_hasSum n).nonneg fun m => by positivity #align stirling.log_stirling_seq'_antitone Stirling.log_stirlingSeq'_antitone
Mathlib/Analysis/SpecialFunctions/Stirling.lean
104
120
theorem log_stirlingSeq_diff_le_geo_sum (n : ℕ) : log (stirlingSeq (n + 1)) - log (stirlingSeq (n + 2)) ≤ ((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2 / (1 - ((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) := by
have h_nonneg : (0 : ℝ) ≤ ((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2 := sq_nonneg _ have g : HasSum (fun k : ℕ => (((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) ^ ↑(k + 1)) (((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2 / (1 - ((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2)) := by have := (hasSum_geometric_of_lt_one h_nonneg ?_).mul_left (((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) · simp_rw [← _root_.pow_succ'] at this exact this rw [one_div, inv_pow] exact inv_lt_one (one_lt_pow ((lt_add_iff_pos_left 1).mpr <| by positivity) two_ne_zero) have hab (k : ℕ) : (1 : ℝ) / (2 * ↑(k + 1) + 1) * ((1 / (2 * ↑(n + 1) + 1)) ^ 2) ^ ↑(k + 1) ≤ (((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) ^ ↑(k + 1) := by refine mul_le_of_le_one_left (pow_nonneg h_nonneg ↑(k + 1)) ?_ rw [one_div] exact inv_le_one (le_add_of_nonneg_left <| by positivity) exact hasSum_le hab (log_stirlingSeq_diff_hasSum n) g
14
import Mathlib.Algebra.GeomSum import Mathlib.Algebra.Order.Ring.Basic import Mathlib.Algebra.Ring.Int import Mathlib.NumberTheory.Padics.PadicVal import Mathlib.RingTheory.Ideal.Quotient #align_import number_theory.multiplicity from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" open Ideal Ideal.Quotient Finset variable {R : Type*} {n : ℕ} section CommRing variable [CommRing R] {a b x y : R} theorem dvd_geom_sum₂_iff_of_dvd_sub {x y p : R} (h : p ∣ x - y) : (p ∣ ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i)) ↔ p ∣ n * y ^ (n - 1) := by rw [← mem_span_singleton, ← Ideal.Quotient.eq] at h simp only [← mem_span_singleton, ← eq_zero_iff_mem, RingHom.map_geom_sum₂, h, geom_sum₂_self, _root_.map_mul, map_pow, map_natCast] #align dvd_geom_sum₂_iff_of_dvd_sub dvd_geom_sum₂_iff_of_dvd_sub theorem dvd_geom_sum₂_iff_of_dvd_sub' {x y p : R} (h : p ∣ x - y) : (p ∣ ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i)) ↔ p ∣ n * x ^ (n - 1) := by rw [geom_sum₂_comm, dvd_geom_sum₂_iff_of_dvd_sub]; simpa using h.neg_right #align dvd_geom_sum₂_iff_of_dvd_sub' dvd_geom_sum₂_iff_of_dvd_sub' theorem dvd_geom_sum₂_self {x y : R} (h : ↑n ∣ x - y) : ↑n ∣ ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i) := (dvd_geom_sum₂_iff_of_dvd_sub h).mpr (dvd_mul_right _ _) #align dvd_geom_sum₂_self dvd_geom_sum₂_self
Mathlib/NumberTheory/Multiplicity.lean
56
71
theorem sq_dvd_add_pow_sub_sub (p x : R) (n : ℕ) : p ^ 2 ∣ (x + p) ^ n - x ^ (n - 1) * p * n - x ^ n := by
cases' n with n n · simp only [pow_zero, Nat.cast_zero, sub_zero, sub_self, dvd_zero, Nat.zero_eq, mul_zero] · simp only [Nat.succ_sub_succ_eq_sub, tsub_zero, Nat.cast_succ, add_pow, Finset.sum_range_succ, Nat.choose_self, Nat.succ_sub _, tsub_self, pow_one, Nat.choose_succ_self_right, pow_zero, mul_one, Nat.cast_zero, zero_add, Nat.succ_eq_add_one, add_tsub_cancel_left] suffices p ^ 2 ∣ ∑ i ∈ range n, x ^ i * p ^ (n + 1 - i) * ↑((n + 1).choose i) by convert this; abel apply Finset.dvd_sum intro y hy calc p ^ 2 ∣ p ^ (n + 1 - y) := pow_dvd_pow p (le_tsub_of_add_le_left (by linarith [Finset.mem_range.mp hy])) _ ∣ x ^ y * p ^ (n + 1 - y) * ↑((n + 1).choose y) := dvd_mul_of_dvd_left (dvd_mul_left _ _) _
14
import Mathlib.Analysis.Convex.Cone.Extension import Mathlib.Analysis.NormedSpace.RCLike import Mathlib.Analysis.NormedSpace.Extend import Mathlib.Analysis.RCLike.Lemmas #align_import analysis.normed_space.hahn_banach.extension from "leanprover-community/mathlib"@"915591b2bb3ea303648db07284a161a7f2a9e3d4" universe u v namespace Real variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E]
Mathlib/Analysis/NormedSpace/HahnBanach/Extension.lean
44
59
theorem exists_extension_norm_eq (p : Subspace ℝ E) (f : p →L[ℝ] ℝ) : ∃ g : E →L[ℝ] ℝ, (∀ x : p, g x = f x) ∧ ‖g‖ = ‖f‖ := by
rcases exists_extension_of_le_sublinear ⟨p, f⟩ (fun x => ‖f‖ * ‖x‖) (fun c hc x => by simp only [norm_smul c x, Real.norm_eq_abs, abs_of_pos hc, mul_left_comm]) (fun x y => by -- Porting note: placeholder filled here rw [← left_distrib] exact mul_le_mul_of_nonneg_left (norm_add_le x y) (@norm_nonneg _ _ f)) fun x => le_trans (le_abs_self _) (f.le_opNorm _) with ⟨g, g_eq, g_le⟩ set g' := g.mkContinuous ‖f‖ fun x => abs_le.2 ⟨neg_le.1 <| g.map_neg x ▸ norm_neg x ▸ g_le (-x), g_le x⟩ refine ⟨g', g_eq, ?_⟩ apply le_antisymm (g.mkContinuous_norm_le (norm_nonneg f) _) refine f.opNorm_le_bound (norm_nonneg _) fun x => ?_ dsimp at g_eq rw [← g_eq] apply g'.le_opNorm
14
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {σ τ : Type*} {r : R} {e : ℕ} {n m : σ} {s : σ →₀ ℕ} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial σ R} section Vars def vars (p : MvPolynomial σ R) : Finset σ := letI := Classical.decEq σ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq σ] (p : MvPolynomial σ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial σ R).vars = ∅ := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r ≠ 0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial σ R).vars = ∅ := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial σ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' ℕ)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : σ) : i ∈ p.vars ↔ ∃ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial σ R} {x : σ →₀ ℕ} (H : x ∈ f.support) {v : σ} (h : v ∉ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq σ] (p q : MvPolynomial σ R) : (p + q).vars ⊆ p.vars ∪ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊢ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq σ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars ∪ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊢ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq σ] (φ ψ : MvPolynomial σ R) : (φ * ψ).vars ⊆ φ.vars ∪ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul φ ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial σ R).vars = ∅ := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (φ : MvPolynomial σ R) (n : ℕ) : (φ ^ n).vars ⊆ φ.vars := by classical induction' n with n ih · simp · rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow theorem vars_prod {ι : Type*} [DecidableEq σ] {s : Finset ι} (f : ι → MvPolynomial σ R) : (∏ i ∈ s, f i).vars ⊆ s.biUnion fun i => (f i).vars := by classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub #align mv_polynomial.vars_prod MvPolynomial.vars_prod section Sum variable {ι : Type*} (t : Finset ι) (φ : ι → MvPolynomial σ R) theorem vars_sum_subset [DecidableEq σ] : (∑ i ∈ t, φ i).vars ⊆ Finset.biUnion t fun i => (φ i).vars := by classical induction t using Finset.induction_on with | empty => simp | insert has hsum => rw [Finset.biUnion_insert, Finset.sum_insert has] refine Finset.Subset.trans (vars_add_subset _ _) (Finset.union_subset_union (Finset.Subset.refl _) ?_) assumption #align mv_polynomial.vars_sum_subset MvPolynomial.vars_sum_subset
Mathlib/Algebra/MvPolynomial/Variables.lean
192
207
theorem vars_sum_of_disjoint [DecidableEq σ] (h : Pairwise <| (Disjoint on fun i => (φ i).vars)) : (∑ i ∈ t, φ i).vars = Finset.biUnion t fun i => (φ i).vars := by
classical induction t using Finset.induction_on with | empty => simp | insert has hsum => rw [Finset.biUnion_insert, Finset.sum_insert has, vars_add_of_disjoint, hsum] unfold Pairwise onFun at h rw [hsum] simp only [Finset.disjoint_iff_ne] at h ⊢ intro v hv v2 hv2 rw [Finset.mem_biUnion] at hv2 rcases hv2 with ⟨i, his, hi⟩ refine h ?_ _ hv _ hi rintro rfl contradiction
14
import Mathlib.Analysis.SpecialFunctions.Complex.Log #align_import analysis.special_functions.pow.complex from "leanprover-community/mathlib"@"4fa54b337f7d52805480306db1b1439c741848c8" open scoped Classical open Real Topology Filter ComplexConjugate Finset Set namespace Complex noncomputable def cpow (x y : ℂ) : ℂ := if x = 0 then if y = 0 then 1 else 0 else exp (log x * y) #align complex.cpow Complex.cpow noncomputable instance : Pow ℂ ℂ := ⟨cpow⟩ @[simp] theorem cpow_eq_pow (x y : ℂ) : cpow x y = x ^ y := rfl #align complex.cpow_eq_pow Complex.cpow_eq_pow theorem cpow_def (x y : ℂ) : x ^ y = if x = 0 then if y = 0 then 1 else 0 else exp (log x * y) := rfl #align complex.cpow_def Complex.cpow_def theorem cpow_def_of_ne_zero {x : ℂ} (hx : x ≠ 0) (y : ℂ) : x ^ y = exp (log x * y) := if_neg hx #align complex.cpow_def_of_ne_zero Complex.cpow_def_of_ne_zero @[simp] theorem cpow_zero (x : ℂ) : x ^ (0 : ℂ) = 1 := by simp [cpow_def] #align complex.cpow_zero Complex.cpow_zero @[simp] theorem cpow_eq_zero_iff (x y : ℂ) : x ^ y = 0 ↔ x = 0 ∧ y ≠ 0 := by simp only [cpow_def] split_ifs <;> simp [*, exp_ne_zero] #align complex.cpow_eq_zero_iff Complex.cpow_eq_zero_iff @[simp] theorem zero_cpow {x : ℂ} (h : x ≠ 0) : (0 : ℂ) ^ x = 0 := by simp [cpow_def, *] #align complex.zero_cpow Complex.zero_cpow
Mathlib/Analysis/SpecialFunctions/Pow/Complex.lean
58
72
theorem zero_cpow_eq_iff {x : ℂ} {a : ℂ} : (0 : ℂ) ^ x = a ↔ x ≠ 0 ∧ a = 0 ∨ x = 0 ∧ a = 1 := by
constructor · intro hyp simp only [cpow_def, eq_self_iff_true, if_true] at hyp by_cases h : x = 0 · subst h simp only [if_true, eq_self_iff_true] at hyp right exact ⟨rfl, hyp.symm⟩ · rw [if_neg h] at hyp left exact ⟨h, hyp.symm⟩ · rintro (⟨h, rfl⟩ | ⟨rfl, rfl⟩) · exact zero_cpow h · exact cpow_zero _
14
import Mathlib.Algebra.GeomSum import Mathlib.Order.Filter.Archimedean import Mathlib.Order.Iterate import Mathlib.Topology.Algebra.Algebra import Mathlib.Topology.Algebra.InfiniteSum.Real #align_import analysis.specific_limits.basic from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2" noncomputable section open scoped Classical open Set Function Filter Finset Metric open scoped Classical open Topology Nat uniformity NNReal ENNReal variable {α : Type*} {β : Type*} {ι : Type*} theorem tendsto_inverse_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ (n : ℝ)⁻¹) atTop (𝓝 0) := tendsto_inv_atTop_zero.comp tendsto_natCast_atTop_atTop #align tendsto_inverse_at_top_nhds_0_nat tendsto_inverse_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias tendsto_inverse_atTop_nhds_0_nat := tendsto_inverse_atTop_nhds_zero_nat theorem tendsto_const_div_atTop_nhds_zero_nat (C : ℝ) : Tendsto (fun n : ℕ ↦ C / n) atTop (𝓝 0) := by simpa only [mul_zero] using tendsto_const_nhds.mul tendsto_inverse_atTop_nhds_zero_nat #align tendsto_const_div_at_top_nhds_0_nat tendsto_const_div_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias tendsto_const_div_atTop_nhds_0_nat := tendsto_const_div_atTop_nhds_zero_nat theorem tendsto_one_div_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ 1/(n : ℝ)) atTop (𝓝 0) := tendsto_const_div_atTop_nhds_zero_nat 1 @[deprecated (since := "2024-01-31")] alias tendsto_one_div_atTop_nhds_0_nat := tendsto_one_div_atTop_nhds_zero_nat theorem NNReal.tendsto_inverse_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ (n : ℝ≥0)⁻¹) atTop (𝓝 0) := by rw [← NNReal.tendsto_coe] exact _root_.tendsto_inverse_atTop_nhds_zero_nat #align nnreal.tendsto_inverse_at_top_nhds_0_nat NNReal.tendsto_inverse_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias NNReal.tendsto_inverse_atTop_nhds_0_nat := NNReal.tendsto_inverse_atTop_nhds_zero_nat theorem NNReal.tendsto_const_div_atTop_nhds_zero_nat (C : ℝ≥0) : Tendsto (fun n : ℕ ↦ C / n) atTop (𝓝 0) := by simpa using tendsto_const_nhds.mul NNReal.tendsto_inverse_atTop_nhds_zero_nat #align nnreal.tendsto_const_div_at_top_nhds_0_nat NNReal.tendsto_const_div_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias NNReal.tendsto_const_div_atTop_nhds_0_nat := NNReal.tendsto_const_div_atTop_nhds_zero_nat theorem tendsto_one_div_add_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ 1 / ((n : ℝ) + 1)) atTop (𝓝 0) := suffices Tendsto (fun n : ℕ ↦ 1 / (↑(n + 1) : ℝ)) atTop (𝓝 0) by simpa (tendsto_add_atTop_iff_nat 1).2 (_root_.tendsto_const_div_atTop_nhds_zero_nat 1) #align tendsto_one_div_add_at_top_nhds_0_nat tendsto_one_div_add_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias tendsto_one_div_add_atTop_nhds_0_nat := tendsto_one_div_add_atTop_nhds_zero_nat theorem NNReal.tendsto_algebraMap_inverse_atTop_nhds_zero_nat (𝕜 : Type*) [Semiring 𝕜] [Algebra ℝ≥0 𝕜] [TopologicalSpace 𝕜] [ContinuousSMul ℝ≥0 𝕜] : Tendsto (algebraMap ℝ≥0 𝕜 ∘ fun n : ℕ ↦ (n : ℝ≥0)⁻¹) atTop (𝓝 0) := by convert (continuous_algebraMap ℝ≥0 𝕜).continuousAt.tendsto.comp tendsto_inverse_atTop_nhds_zero_nat rw [map_zero] @[deprecated (since := "2024-01-31")] alias NNReal.tendsto_algebraMap_inverse_atTop_nhds_0_nat := NNReal.tendsto_algebraMap_inverse_atTop_nhds_zero_nat theorem tendsto_algebraMap_inverse_atTop_nhds_zero_nat (𝕜 : Type*) [Semiring 𝕜] [Algebra ℝ 𝕜] [TopologicalSpace 𝕜] [ContinuousSMul ℝ 𝕜] : Tendsto (algebraMap ℝ 𝕜 ∘ fun n : ℕ ↦ (n : ℝ)⁻¹) atTop (𝓝 0) := NNReal.tendsto_algebraMap_inverse_atTop_nhds_zero_nat 𝕜 @[deprecated (since := "2024-01-31")] alias tendsto_algebraMap_inverse_atTop_nhds_0_nat := _root_.tendsto_algebraMap_inverse_atTop_nhds_zero_nat
Mathlib/Analysis/SpecificLimits/Basic.lean
97
113
theorem tendsto_natCast_div_add_atTop {𝕜 : Type*} [DivisionRing 𝕜] [TopologicalSpace 𝕜] [CharZero 𝕜] [Algebra ℝ 𝕜] [ContinuousSMul ℝ 𝕜] [TopologicalDivisionRing 𝕜] (x : 𝕜) : Tendsto (fun n : ℕ ↦ (n : 𝕜) / (n + x)) atTop (𝓝 1) := by
convert Tendsto.congr' ((eventually_ne_atTop 0).mp (eventually_of_forall fun n hn ↦ _)) _ · exact fun n : ℕ ↦ 1 / (1 + x / n) · field_simp [Nat.cast_ne_zero.mpr hn] · have : 𝓝 (1 : 𝕜) = 𝓝 (1 / (1 + x * (0 : 𝕜))) := by rw [mul_zero, add_zero, div_one] rw [this] refine tendsto_const_nhds.div (tendsto_const_nhds.add ?_) (by simp) simp_rw [div_eq_mul_inv] refine tendsto_const_nhds.mul ?_ have := ((continuous_algebraMap ℝ 𝕜).tendsto _).comp tendsto_inverse_atTop_nhds_zero_nat rw [map_zero, Filter.tendsto_atTop'] at this refine Iff.mpr tendsto_atTop' ?_ intros simp_all only [comp_apply, map_inv₀, map_natCast]
14
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
14
import Mathlib.RingTheory.Valuation.Basic import Mathlib.NumberTheory.Padics.PadicNorm import Mathlib.Analysis.Normed.Field.Basic #align_import number_theory.padics.padic_numbers from "leanprover-community/mathlib"@"b9b2114f7711fec1c1e055d507f082f8ceb2c3b7" noncomputable section open scoped Classical open Nat multiplicity padicNorm CauSeq CauSeq.Completion Metric abbrev PadicSeq (p : ℕ) := CauSeq _ (padicNorm p) #align padic_seq PadicSeq namespace PadicSeq section variable {p : ℕ} [Fact p.Prime] theorem stationary {f : CauSeq ℚ (padicNorm p)} (hf : ¬f ≈ 0) : ∃ N, ∀ m n, N ≤ m → N ≤ n → padicNorm p (f n) = padicNorm p (f m) := have : ∃ ε > 0, ∃ N1, ∀ j ≥ N1, ε ≤ padicNorm p (f j) := CauSeq.abv_pos_of_not_limZero <| not_limZero_of_not_congr_zero hf let ⟨ε, hε, N1, hN1⟩ := this let ⟨N2, hN2⟩ := CauSeq.cauchy₂ f hε ⟨max N1 N2, fun n m hn hm ↦ by have : padicNorm p (f n - f m) < ε := hN2 _ (max_le_iff.1 hn).2 _ (max_le_iff.1 hm).2 have : padicNorm p (f n - f m) < padicNorm p (f n) := lt_of_lt_of_le this <| hN1 _ (max_le_iff.1 hn).1 have : padicNorm p (f n - f m) < max (padicNorm p (f n)) (padicNorm p (f m)) := lt_max_iff.2 (Or.inl this) by_contra hne rw [← padicNorm.neg (f m)] at hne have hnam := add_eq_max_of_ne hne rw [padicNorm.neg, max_comm] at hnam rw [← hnam, sub_eq_add_neg, add_comm] at this apply _root_.lt_irrefl _ this⟩ #align padic_seq.stationary PadicSeq.stationary def stationaryPoint {f : PadicSeq p} (hf : ¬f ≈ 0) : ℕ := Classical.choose <| stationary hf #align padic_seq.stationary_point PadicSeq.stationaryPoint theorem stationaryPoint_spec {f : PadicSeq p} (hf : ¬f ≈ 0) : ∀ {m n}, stationaryPoint hf ≤ m → stationaryPoint hf ≤ n → padicNorm p (f n) = padicNorm p (f m) := @(Classical.choose_spec <| stationary hf) #align padic_seq.stationary_point_spec PadicSeq.stationaryPoint_spec def norm (f : PadicSeq p) : ℚ := if hf : f ≈ 0 then 0 else padicNorm p (f (stationaryPoint hf)) #align padic_seq.norm PadicSeq.norm
Mathlib/NumberTheory/Padics/PadicNumbers.lean
121
135
theorem norm_zero_iff (f : PadicSeq p) : f.norm = 0 ↔ f ≈ 0 := by
constructor · intro h by_contra hf unfold norm at h split_ifs at h · contradiction apply hf intro ε hε exists stationaryPoint hf intro j hj have heq := stationaryPoint_spec hf le_rfl hj simpa [h, heq] · intro h simp [norm, h]
14
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} variable {p : ℕ} [Fact p.Prime]
Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean
260
276
theorem matPolyEquiv_eq_X_pow_sub_C {K : Type*} (k : ℕ) [Field K] (M : Matrix n n K) : matPolyEquiv ((expand K k : K[X] →+* K[X]).mapMatrix (charmatrix (M ^ k))) = X ^ k - C (M ^ k) := by
-- Porting note: `i` and `j` are used later on, but were not mentioned in mathlib3 ext m i j rw [coeff_sub, coeff_C, matPolyEquiv_coeff_apply, RingHom.mapMatrix_apply, Matrix.map_apply, AlgHom.coe_toRingHom, DMatrix.sub_apply, coeff_X_pow] by_cases hij : i = j · rw [hij, charmatrix_apply_eq, AlgHom.map_sub, expand_C, expand_X, coeff_sub, coeff_X_pow, coeff_C] -- Porting note: the second `Matrix.` was `DMatrix.` split_ifs with mp m0 <;> simp only [Matrix.one_apply_eq, Matrix.zero_apply] · rw [charmatrix_apply_ne _ _ _ hij, AlgHom.map_neg, expand_C, coeff_neg, coeff_C] split_ifs with m0 mp <;> -- Porting note: again, the first `Matrix.` that was `DMatrix.` simp only [hij, zero_sub, Matrix.zero_apply, sub_zero, neg_zero, Matrix.one_apply_ne, Ne, not_false_iff]
14
import Mathlib.Algebra.IsPrimePow import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.Tactic.WLOG #align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ea050b44c0f9aba9d16a948c7cc7d2e7c8493567" namespace Cardinal open Cardinal universe u variable {a b : Cardinal.{u}} {n m : ℕ} @[simp] theorem isUnit_iff : IsUnit a ↔ a = 1 := by refine ⟨fun h => ?_, by rintro rfl exact isUnit_one⟩ rcases eq_or_ne a 0 with (rfl | ha) · exact (not_isUnit_zero h).elim rw [isUnit_iff_forall_dvd] at h cases' h 1 with t ht rw [eq_comm, mul_eq_one_iff'] at ht · exact ht.1 · exact one_le_iff_ne_zero.mpr ha · apply one_le_iff_ne_zero.mpr intro h rw [h, mul_zero] at ht exact zero_ne_one ht #align cardinal.is_unit_iff Cardinal.isUnit_iff instance : Unique Cardinal.{u}ˣ where default := 1 uniq a := Units.val_eq_one.mp <| isUnit_iff.mp a.isUnit theorem le_of_dvd : ∀ {a b : Cardinal}, b ≠ 0 → a ∣ b → a ≤ b | a, x, b0, ⟨b, hab⟩ => by simpa only [hab, mul_one] using mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => b0 (by rwa [h, mul_zero] at hab)) a #align cardinal.le_of_dvd Cardinal.le_of_dvd theorem dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b) : a ∣ b := ⟨b, (mul_eq_right hb h ha).symm⟩ #align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le @[simp] theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a := by refine ⟨(aleph0_pos.trans_le ha).ne', ?_, fun b c hbc => ?_⟩ · rw [isUnit_iff] exact (one_lt_aleph0.trans_le ha).ne' rcases eq_or_ne (b * c) 0 with hz | hz · rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp wlog h : c ≤ b · cases le_total c b <;> [solve_by_elim; rw [or_comm]] apply_assumption assumption' all_goals rwa [mul_comm] left have habc := le_of_dvd hz hbc rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc #align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le theorem not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a := by rw [irreducible_iff, not_and_or] refine Or.inr fun h => ?_ simpa [mul_aleph0_eq ha, isUnit_iff, (one_lt_aleph0.trans_le ha).ne', one_lt_aleph0.ne'] using h a ℵ₀ #align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_le @[simp, norm_cast] theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m := by refine ⟨?_, fun ⟨h, ht⟩ => ⟨h, mod_cast ht⟩⟩ rintro ⟨k, hk⟩ have : ↑m < ℵ₀ := nat_lt_aleph0 m rw [hk, mul_lt_aleph0_iff] at this rcases this with (h | h | ⟨-, hk'⟩) iterate 2 simp only [h, mul_zero, zero_mul, Nat.cast_eq_zero] at hk; simp [hk] lift k to ℕ using hk' exact ⟨k, mod_cast hk⟩ #align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iff @[simp] theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime := by simp only [Prime, Nat.prime_iff] refine and_congr (by simp) (and_congr ?_ ⟨fun h b c hbc => ?_, fun h b c hbc => ?_⟩) · simp only [isUnit_iff, Nat.isUnit_iff] exact mod_cast Iff.rfl · exact mod_cast h b c (mod_cast hbc) cases' lt_or_le (b * c) ℵ₀ with h' h' · rcases mul_lt_aleph0_iff.mp h' with (rfl | rfl | ⟨hb, hc⟩) · simp · simp lift b to ℕ using hb lift c to ℕ using hc exact mod_cast h b c (mod_cast hbc) rcases aleph0_le_mul_iff.mp h' with ⟨hb, hc, hℵ₀⟩ have hn : (n : Cardinal) ≠ 0 := by intro h rw [h, zero_dvd_iff, mul_eq_zero] at hbc cases hbc <;> contradiction wlog hℵ₀b : ℵ₀ ≤ b apply (this h c b _ _ hc hb hℵ₀.symm hn (hℵ₀.resolve_left hℵ₀b)).symm <;> try assumption · rwa [mul_comm] at hbc · rwa [mul_comm] at h' · exact Or.inl (dvd_of_le_of_aleph0_le hn ((nat_lt_aleph0 n).le.trans hℵ₀b) hℵ₀b) #align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iff theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ, a = p ∧ p.Prime := by rcases le_or_lt ℵ₀ a with h | h · simp [h] lift a to ℕ using id h simp [not_le.mpr h] #align cardinal.is_prime_iff Cardinal.is_prime_iff
Mathlib/SetTheory/Cardinal/Divisibility.lean
144
158
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n := by
by_cases h : ℵ₀ ≤ a · simp [h, (prime_of_aleph0_le h).isPrimePow] simp only [h, Nat.cast_inj, exists_eq_left', false_or_iff, isPrimePow_nat_iff] lift a to ℕ using not_le.mp h rw [isPrimePow_def] refine ⟨?_, fun ⟨n, han, p, k, hp, hk, h⟩ => ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩ rintro ⟨p, k, hp, hk, hpk⟩ have key : p ^ (1 : Cardinal) ≤ ↑a := by rw [← hpk]; apply power_le_power_left hp.ne_zero; exact mod_cast hk rw [power_one] at key lift p to ℕ using key.trans_lt (nat_lt_aleph0 a) exact ⟨a, rfl, p, k, nat_is_prime_iff.mp hp, hk, mod_cast hpk⟩
14
import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Basic import Mathlib.RingTheory.Localization.FractionRing #align_import ring_theory.localization.localization_localization from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" open Function namespace IsLocalization section LocalizationLocalization variable {R : Type*} [CommSemiring R] (M : Submonoid R) {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] variable (N : Submonoid S) (T : Type*) [CommSemiring T] [Algebra R T] section variable [Algebra S T] [IsScalarTower R S T] -- This should only be defined when `S` is the localization `M⁻¹R`, hence the nolint. @[nolint unusedArguments] def localizationLocalizationSubmodule : Submonoid R := (N ⊔ M.map (algebraMap R S)).comap (algebraMap R S) #align is_localization.localization_localization_submodule IsLocalization.localizationLocalizationSubmodule variable {M N} @[simp] theorem mem_localizationLocalizationSubmodule {x : R} : x ∈ localizationLocalizationSubmodule M N ↔ ∃ (y : N) (z : M), algebraMap R S x = y * algebraMap R S z := by rw [localizationLocalizationSubmodule, Submonoid.mem_comap, Submonoid.mem_sup] constructor · rintro ⟨y, hy, _, ⟨z, hz, rfl⟩, e⟩ exact ⟨⟨y, hy⟩, ⟨z, hz⟩, e.symm⟩ · rintro ⟨y, z, e⟩ exact ⟨y, y.prop, _, ⟨z, z.prop, rfl⟩, e.symm⟩ #align is_localization.mem_localization_localization_submodule IsLocalization.mem_localizationLocalizationSubmodule variable (M N) [IsLocalization M S] theorem localization_localization_map_units [IsLocalization N T] (y : localizationLocalizationSubmodule M N) : IsUnit (algebraMap R T y) := by obtain ⟨y', z, eq⟩ := mem_localizationLocalizationSubmodule.mp y.prop rw [IsScalarTower.algebraMap_apply R S T, eq, RingHom.map_mul, IsUnit.mul_iff] exact ⟨IsLocalization.map_units T y', (IsLocalization.map_units _ z).map (algebraMap S T)⟩ #align is_localization.localization_localization_map_units IsLocalization.localization_localization_map_units
Mathlib/RingTheory/Localization/LocalizationLocalization.lean
73
89
theorem localization_localization_surj [IsLocalization N T] (x : T) : ∃ y : R × localizationLocalizationSubmodule M N, x * algebraMap R T y.2 = algebraMap R T y.1 := by
rcases IsLocalization.surj N x with ⟨⟨y, s⟩, eq₁⟩ -- x = y / s rcases IsLocalization.surj M y with ⟨⟨z, t⟩, eq₂⟩ -- y = z / t rcases IsLocalization.surj M (s : S) with ⟨⟨z', t'⟩, eq₃⟩ -- s = z' / t' dsimp only at eq₁ eq₂ eq₃ refine ⟨⟨z * t', z' * t, ?_⟩, ?_⟩ -- x = y / s = (z * t') / (z' * t) · rw [mem_localizationLocalizationSubmodule] refine ⟨s, t * t', ?_⟩ rw [RingHom.map_mul, ← eq₃, mul_assoc, ← RingHom.map_mul, mul_comm t, Submonoid.coe_mul] · simp only [Subtype.coe_mk, RingHom.map_mul, IsScalarTower.algebraMap_apply R S T, ← eq₃, ← eq₂, ← eq₁] ring
14
import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Algebra.Order.Group.Int import Mathlib.Algebra.Order.Ring.Nat import Mathlib.Algebra.Ring.Rat import Mathlib.Data.PNat.Defs #align_import data.rat.lemmas from "leanprover-community/mathlib"@"550b58538991c8977703fdeb7c9d51a5aa27df11" namespace Rat open Rat theorem num_dvd (a) {b : ℤ} (b0 : b ≠ 0) : (a /. b).num ∣ a := by cases' e : a /. b with n d h c rw [Rat.mk'_eq_divInt, divInt_eq_iff b0 (mod_cast h)] at e refine Int.natAbs_dvd.1 <| Int.dvd_natAbs.1 <| Int.natCast_dvd_natCast.2 <| c.dvd_of_dvd_mul_right ?_ have := congr_arg Int.natAbs e simp only [Int.natAbs_mul, Int.natAbs_ofNat] at this; simp [this] #align rat.num_dvd Rat.num_dvd theorem den_dvd (a b : ℤ) : ((a /. b).den : ℤ) ∣ b := by by_cases b0 : b = 0; · simp [b0] cases' e : a /. b with n d h c rw [mk'_eq_divInt, divInt_eq_iff b0 (ne_of_gt (Int.natCast_pos.2 (Nat.pos_of_ne_zero h)))] at e refine Int.dvd_natAbs.1 <| Int.natCast_dvd_natCast.2 <| c.symm.dvd_of_dvd_mul_left ?_ rw [← Int.natAbs_mul, ← Int.natCast_dvd_natCast, Int.dvd_natAbs, ← e]; simp #align rat.denom_dvd Rat.den_dvd
Mathlib/Data/Rat/Lemmas.lean
41
56
theorem num_den_mk {q : ℚ} {n d : ℤ} (hd : d ≠ 0) (qdf : q = n /. d) : ∃ c : ℤ, n = c * q.num ∧ d = c * q.den := by
obtain rfl | hn := eq_or_ne n 0 · simp [qdf] have : q.num * d = n * ↑q.den := by refine (divInt_eq_iff ?_ hd).mp ?_ · exact Int.natCast_ne_zero.mpr (Rat.den_nz _) · rwa [num_divInt_den] have hqdn : q.num ∣ n := by rw [qdf] exact Rat.num_dvd _ hd refine ⟨n / q.num, ?_, ?_⟩ · rw [Int.ediv_mul_cancel hqdn] · refine Int.eq_mul_div_of_mul_eq_mul_of_dvd_left ?_ hqdn this rw [qdf] exact Rat.num_ne_zero.2 ((divInt_ne_zero hd).mpr hn)
14
import Mathlib.Data.Int.Interval import Mathlib.RingTheory.Binomial import Mathlib.RingTheory.HahnSeries.PowerSeries import Mathlib.RingTheory.HahnSeries.Summable import Mathlib.FieldTheory.RatFunc.AsPolynomial import Mathlib.RingTheory.Localization.FractionRing #align_import ring_theory.laurent_series from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" universe u open scoped Classical open HahnSeries Polynomial noncomputable section abbrev LaurentSeries (R : Type u) [Zero R] := HahnSeries ℤ R #align laurent_series LaurentSeries variable {R : Type*} namespace LaurentSeries section Semiring variable [Semiring R] instance : Coe (PowerSeries R) (LaurentSeries R) := ⟨HahnSeries.ofPowerSeries ℤ R⟩ #noalign laurent_series.coe_power_series @[simp] theorem coeff_coe_powerSeries (x : PowerSeries R) (n : ℕ) : HahnSeries.coeff (x : LaurentSeries R) n = PowerSeries.coeff R n x := by rw [ofPowerSeries_apply_coeff] #align laurent_series.coeff_coe_power_series LaurentSeries.coeff_coe_powerSeries def powerSeriesPart (x : LaurentSeries R) : PowerSeries R := PowerSeries.mk fun n => x.coeff (x.order + n) #align laurent_series.power_series_part LaurentSeries.powerSeriesPart @[simp] theorem powerSeriesPart_coeff (x : LaurentSeries R) (n : ℕ) : PowerSeries.coeff R n x.powerSeriesPart = x.coeff (x.order + n) := PowerSeries.coeff_mk _ _ #align laurent_series.power_series_part_coeff LaurentSeries.powerSeriesPart_coeff @[simp] theorem powerSeriesPart_zero : powerSeriesPart (0 : LaurentSeries R) = 0 := by ext simp [(PowerSeries.coeff _ _).map_zero] -- Note: this doesn't get picked up any more #align laurent_series.power_series_part_zero LaurentSeries.powerSeriesPart_zero @[simp] theorem powerSeriesPart_eq_zero (x : LaurentSeries R) : x.powerSeriesPart = 0 ↔ x = 0 := by constructor · contrapose! simp only [ne_eq] intro h rw [PowerSeries.ext_iff, not_forall] refine ⟨0, ?_⟩ simp [coeff_order_ne_zero h] · rintro rfl simp #align laurent_series.power_series_part_eq_zero LaurentSeries.powerSeriesPart_eq_zero @[simp]
Mathlib/RingTheory/LaurentSeries.lean
125
140
theorem single_order_mul_powerSeriesPart (x : LaurentSeries R) : (single x.order 1 : LaurentSeries R) * x.powerSeriesPart = x := by
ext n rw [← sub_add_cancel n x.order, single_mul_coeff_add, sub_add_cancel, one_mul] by_cases h : x.order ≤ n · rw [Int.eq_natAbs_of_zero_le (sub_nonneg_of_le h), coeff_coe_powerSeries, powerSeriesPart_coeff, ← Int.eq_natAbs_of_zero_le (sub_nonneg_of_le h), add_sub_cancel] · rw [ofPowerSeries_apply, embDomain_notin_range] · contrapose! h exact order_le_of_coeff_ne_zero h.symm · contrapose! h simp only [Set.mem_range, RelEmbedding.coe_mk, Function.Embedding.coeFn_mk] at h obtain ⟨m, hm⟩ := h rw [← sub_nonneg, ← hm] simp only [Nat.cast_nonneg]
14
import Mathlib.Algebra.Group.Defs import Mathlib.Control.Functor #align_import control.applicative from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025" universe u v w section Lemmas open Function variable {F : Type u → Type v} variable [Applicative F] [LawfulApplicative F] variable {α β γ σ : Type u} theorem Applicative.map_seq_map (f : α → β → γ) (g : σ → β) (x : F α) (y : F σ) : f <$> x <*> g <$> y = ((· ∘ g) ∘ f) <$> x <*> y := by simp [flip, functor_norm] #align applicative.map_seq_map Applicative.map_seq_map theorem Applicative.pure_seq_eq_map' (f : α → β) : ((pure f : F (α → β)) <*> ·) = (f <$> ·) := by ext; simp [functor_norm] #align applicative.pure_seq_eq_map' Applicative.pure_seq_eq_map'
Mathlib/Control/Applicative.lean
40
63
theorem Applicative.ext {F} : ∀ {A1 : Applicative F} {A2 : Applicative F} [@LawfulApplicative F A1] [@LawfulApplicative F A2], (∀ {α : Type u} (x : α), @Pure.pure _ A1.toPure _ x = @Pure.pure _ A2.toPure _ x) → (∀ {α β : Type u} (f : F (α → β)) (x : F α), @Seq.seq _ A1.toSeq _ _ f (fun _ => x) = @Seq.seq _ A2.toSeq _ _ f (fun _ => x)) → A1 = A2 | { toFunctor := F1, seq := s1, pure := p1, seqLeft := sl1, seqRight := sr1 }, { toFunctor := F2, seq := s2, pure := p2, seqLeft := sl2, seqRight := sr2 }, L1, L2, H1, H2 => by obtain rfl : @p1 = @p2 := by
funext α x apply H1 obtain rfl : @s1 = @s2 := by funext α β f x exact H2 f (x Unit.unit) obtain ⟨seqLeft_eq1, seqRight_eq1, pure_seq1, -⟩ := L1 obtain ⟨seqLeft_eq2, seqRight_eq2, pure_seq2, -⟩ := L2 obtain rfl : F1 = F2 := by apply Functor.ext intros exact (pure_seq1 _ _).symm.trans (pure_seq2 _ _) congr <;> funext α β x y · exact (seqLeft_eq1 _ (y Unit.unit)).trans (seqLeft_eq2 _ _).symm · exact (seqRight_eq1 _ (y Unit.unit)).trans (seqRight_eq2 _ (y Unit.unit)).symm
14
import Mathlib.Probability.Martingale.Convergence import Mathlib.Probability.Martingale.OptionalStopping import Mathlib.Probability.Martingale.Centering #align_import probability.martingale.borel_cantelli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" open Filter open scoped NNReal ENNReal MeasureTheory ProbabilityTheory BigOperators Topology namespace MeasureTheory variable {Ω : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} {ℱ : Filtration ℕ m0} {f : ℕ → Ω → ℝ} {ω : Ω} -- TODO: `leastGE` should be defined taking values in `WithTop ℕ` once the `stoppedProcess` -- refactor is complete noncomputable def leastGE (f : ℕ → Ω → ℝ) (r : ℝ) (n : ℕ) := hitting f (Set.Ici r) 0 n #align measure_theory.least_ge MeasureTheory.leastGE theorem Adapted.isStoppingTime_leastGE (r : ℝ) (n : ℕ) (hf : Adapted ℱ f) : IsStoppingTime ℱ (leastGE f r n) := hitting_isStoppingTime hf measurableSet_Ici #align measure_theory.adapted.is_stopping_time_least_ge MeasureTheory.Adapted.isStoppingTime_leastGE theorem leastGE_le {i : ℕ} {r : ℝ} (ω : Ω) : leastGE f r i ω ≤ i := hitting_le ω #align measure_theory.least_ge_le MeasureTheory.leastGE_le -- The following four lemmas shows `leastGE` behaves like a stopped process. Ideally we should -- define `leastGE` as a stopping time and take its stopped process. However, we can't do that -- with our current definition since a stopping time takes only finite indicies. An upcomming -- refactor should hopefully make it possible to have stopping times taking infinity as a value theorem leastGE_mono {n m : ℕ} (hnm : n ≤ m) (r : ℝ) (ω : Ω) : leastGE f r n ω ≤ leastGE f r m ω := hitting_mono hnm #align measure_theory.least_ge_mono MeasureTheory.leastGE_mono
Mathlib/Probability/Martingale/BorelCantelli.lean
75
90
theorem leastGE_eq_min (π : Ω → ℕ) (r : ℝ) (ω : Ω) {n : ℕ} (hπn : ∀ ω, π ω ≤ n) : leastGE f r (π ω) ω = min (π ω) (leastGE f r n ω) := by
classical refine le_antisymm (le_min (leastGE_le _) (leastGE_mono (hπn ω) r ω)) ?_ by_cases hle : π ω ≤ leastGE f r n ω · rw [min_eq_left hle, leastGE] by_cases h : ∃ j ∈ Set.Icc 0 (π ω), f j ω ∈ Set.Ici r · refine hle.trans (Eq.le ?_) rw [leastGE, ← hitting_eq_hitting_of_exists (hπn ω) h] · simp only [hitting, if_neg h, le_rfl] · rw [min_eq_right (not_le.1 hle).le, leastGE, leastGE, ← hitting_eq_hitting_of_exists (hπn ω) _] rw [not_le, leastGE, hitting_lt_iff _ (hπn ω)] at hle exact let ⟨j, hj₁, hj₂⟩ := hle ⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩
14