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
import Mathlib.RingTheory.FiniteType import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.Localization.Submodule import Mathlib.RingTheory.Nilpotent.Lemmas import Mathlib.RingTheory.RingHomProperties import Mathlib.Data.Set.Subsingleton #align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0" open scoped Pointwise Classical universe u variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R) variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R →+* S) variable [Algebra R R'] [Algebra S S'] section Properties section Ideal open scoped nonZeroDivisors theorem Ideal.le_of_localization_maximal {I J : Ideal R} (h : ∀ (P : Ideal R) (hP : P.IsMaximal), Ideal.map (algebraMap R (Localization.AtPrime P)) I ≤ Ideal.map (algebraMap R (Localization.AtPrime P)) J) : I ≤ J := by intro x hx suffices J.colon (Ideal.span {x}) = ⊤ by simpa using Submodule.mem_colon.mp (show (1 : R) ∈ J.colon (Ideal.span {x}) from this.symm ▸ Submodule.mem_top) x (Ideal.mem_span_singleton_self x) refine Not.imp_symm (J.colon (Ideal.span {x})).exists_le_maximal ?_ push_neg intro P hP le obtain ⟨⟨⟨a, ha⟩, ⟨s, hs⟩⟩, eq⟩ := (IsLocalization.mem_map_algebraMap_iff P.primeCompl _).mp (h P hP (Ideal.mem_map_of_mem _ hx)) rw [← _root_.map_mul, ← sub_eq_zero, ← map_sub] at eq obtain ⟨⟨m, hm⟩, eq⟩ := (IsLocalization.map_eq_zero_iff P.primeCompl _ _).mp eq refine hs ((hP.isPrime.mem_or_mem (le (Ideal.mem_colon_singleton.mpr ?_))).resolve_right hm) simp only [Subtype.coe_mk, mul_sub, sub_eq_zero, mul_comm x s, mul_left_comm] at eq simpa only [mul_assoc, eq] using J.mul_mem_left m ha #align ideal.le_of_localization_maximal Ideal.le_of_localization_maximal theorem Ideal.eq_of_localization_maximal {I J : Ideal R} (h : ∀ (P : Ideal R) (_ : P.IsMaximal), Ideal.map (algebraMap R (Localization.AtPrime P)) I = Ideal.map (algebraMap R (Localization.AtPrime P)) J) : I = J := le_antisymm (Ideal.le_of_localization_maximal fun P hP => (h P hP).le) (Ideal.le_of_localization_maximal fun P hP => (h P hP).ge) #align ideal.eq_of_localization_maximal Ideal.eq_of_localization_maximal theorem ideal_eq_bot_of_localization' (I : Ideal R) (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), Ideal.map (algebraMap R (Localization.AtPrime J)) I = ⊥) : I = ⊥ := Ideal.eq_of_localization_maximal fun P hP => by simpa using h P hP #align ideal_eq_bot_of_localization' ideal_eq_bot_of_localization' -- TODO: This proof should work for all modules, once we have enough material on submodules of -- localized modules. theorem ideal_eq_bot_of_localization (I : Ideal R) (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), IsLocalization.coeSubmodule (Localization.AtPrime J) I = ⊥) : I = ⊥ := ideal_eq_bot_of_localization' _ fun P hP => (Ideal.map_eq_bot_iff_le_ker _).mpr fun x hx => by rw [RingHom.mem_ker, ← Submodule.mem_bot R, ← h P hP, IsLocalization.mem_coeSubmodule] exact ⟨x, hx, rfl⟩ #align ideal_eq_bot_of_localization ideal_eq_bot_of_localization
Mathlib/RingTheory/LocalProperties.lean
290
300
theorem eq_zero_of_localization (r : R) (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) : r = 0 := by
rw [← Ideal.span_singleton_eq_bot] apply ideal_eq_bot_of_localization intro J hJ delta IsLocalization.coeSubmodule erw [Submodule.map_span, Submodule.span_eq_bot] rintro _ ⟨_, h', rfl⟩ cases Set.mem_singleton_iff.mpr h' exact h J hJ
import Mathlib.Algebra.Module.Equiv import Mathlib.Algebra.Module.Submodule.Basic import Mathlib.Algebra.PUnitInstances import Mathlib.Data.Set.Subsingleton #align_import algebra.module.submodule.lattice from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" universe v variable {R S M : Type*} section AddCommMonoid variable [Semiring R] [Semiring S] [AddCommMonoid M] [Module R M] [Module S M] variable [SMul S R] [IsScalarTower S R M] variable {p q : Submodule R M} namespace Submodule instance : Bot (Submodule R M) := ⟨{ (⊥ : AddSubmonoid M) with carrier := {0} smul_mem' := by simp }⟩ instance inhabited' : Inhabited (Submodule R M) := ⟨⊥⟩ #align submodule.inhabited' Submodule.inhabited' @[simp] theorem bot_coe : ((⊥ : Submodule R M) : Set M) = {0} := rfl #align submodule.bot_coe Submodule.bot_coe @[simp] theorem bot_toAddSubmonoid : (⊥ : Submodule R M).toAddSubmonoid = ⊥ := rfl #align submodule.bot_to_add_submonoid Submodule.bot_toAddSubmonoid @[simp] lemma bot_toAddSubgroup {R M} [Ring R] [AddCommGroup M] [Module R M] : (⊥ : Submodule R M).toAddSubgroup = ⊥ := rfl variable (R) in @[simp] theorem mem_bot {x : M} : x ∈ (⊥ : Submodule R M) ↔ x = 0 := Set.mem_singleton_iff #align submodule.mem_bot Submodule.mem_bot instance uniqueBot : Unique (⊥ : Submodule R M) := ⟨inferInstance, fun x ↦ Subtype.ext <| (mem_bot R).1 x.mem⟩ #align submodule.unique_bot Submodule.uniqueBot instance : OrderBot (Submodule R M) where bot := ⊥ bot_le p x := by simp (config := { contextual := true }) [zero_mem] protected theorem eq_bot_iff (p : Submodule R M) : p = ⊥ ↔ ∀ x ∈ p, x = (0 : M) := ⟨fun h ↦ h.symm ▸ fun _ hx ↦ (mem_bot R).mp hx, fun h ↦ eq_bot_iff.mpr fun x hx ↦ (mem_bot R).mpr (h x hx)⟩ #align submodule.eq_bot_iff Submodule.eq_bot_iff @[ext high] protected theorem bot_ext (x y : (⊥ : Submodule R M)) : x = y := by rcases x with ⟨x, xm⟩; rcases y with ⟨y, ym⟩; congr rw [(Submodule.eq_bot_iff _).mp rfl x xm] rw [(Submodule.eq_bot_iff _).mp rfl y ym] #align submodule.bot_ext Submodule.bot_ext protected theorem ne_bot_iff (p : Submodule R M) : p ≠ ⊥ ↔ ∃ x ∈ p, x ≠ (0 : M) := by simp only [ne_eq, p.eq_bot_iff, not_forall, exists_prop] #align submodule.ne_bot_iff Submodule.ne_bot_iff theorem nonzero_mem_of_bot_lt {p : Submodule R M} (bot_lt : ⊥ < p) : ∃ a : p, a ≠ 0 := let ⟨b, hb₁, hb₂⟩ := p.ne_bot_iff.mp bot_lt.ne' ⟨⟨b, hb₁⟩, hb₂ ∘ congr_arg Subtype.val⟩ #align submodule.nonzero_mem_of_bot_lt Submodule.nonzero_mem_of_bot_lt theorem exists_mem_ne_zero_of_ne_bot {p : Submodule R M} (h : p ≠ ⊥) : ∃ b : M, b ∈ p ∧ b ≠ 0 := let ⟨b, hb₁, hb₂⟩ := p.ne_bot_iff.mp h ⟨b, hb₁, hb₂⟩ #align submodule.exists_mem_ne_zero_of_ne_bot Submodule.exists_mem_ne_zero_of_ne_bot -- FIXME: we default PUnit to PUnit.{1} here without the explicit universe annotation @[simps] def botEquivPUnit : (⊥ : Submodule R M) ≃ₗ[R] PUnit.{v+1} where toFun _ := PUnit.unit invFun _ := 0 map_add' _ _ := rfl map_smul' _ _ := rfl left_inv _ := Subsingleton.elim _ _ right_inv _ := rfl #align submodule.bot_equiv_punit Submodule.botEquivPUnit
Mathlib/Algebra/Module/Submodule/Lattice.lean
122
125
theorem subsingleton_iff_eq_bot : Subsingleton p ↔ p = ⊥ := by
rw [subsingleton_iff, Submodule.eq_bot_iff] refine ⟨fun h x hx ↦ by simpa using h ⟨x, hx⟩ ⟨0, p.zero_mem⟩, fun h ⟨x, hx⟩ ⟨y, hy⟩ ↦ by simp [h x hx, h y hy]⟩
import Mathlib.Data.Vector.Basic import Mathlib.Data.Vector.Snoc set_option autoImplicit true namespace Vector section Fold section Binary variable (xs : Vector α n) (ys : Vector β n) @[simp] theorem mapAccumr₂_mapAccumr_left (f₁ : γ → β → σ₁ → σ₁ × ζ) (f₂ : α → σ₂ → σ₂ × γ) : (mapAccumr₂ f₁ (mapAccumr f₂ xs s₂).snd ys s₁) = let m := (mapAccumr₂ (fun x y s => let r₂ := f₂ x s.snd let r₁ := f₁ r₂.snd y s.fst ((r₁.fst, r₂.fst), r₁.snd) ) xs ys (s₁, s₂)) (m.fst.fst, m.snd) := by induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> simp_all @[simp] theorem map₂_map_left (f₁ : γ → β → ζ) (f₂ : α → γ) : map₂ f₁ (map f₂ xs) ys = map₂ (fun x y => f₁ (f₂ x) y) xs ys := by induction xs, ys using Vector.revInductionOn₂ <;> simp_all @[simp] theorem mapAccumr₂_mapAccumr_right (f₁ : α → γ → σ₁ → σ₁ × ζ) (f₂ : β → σ₂ → σ₂ × γ) : (mapAccumr₂ f₁ xs (mapAccumr f₂ ys s₂).snd s₁) = let m := (mapAccumr₂ (fun x y s => let r₂ := f₂ y s.snd let r₁ := f₁ x r₂.snd s.fst ((r₁.fst, r₂.fst), r₁.snd) ) xs ys (s₁, s₂)) (m.fst.fst, m.snd) := by induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> simp_all @[simp] theorem map₂_map_right (f₁ : α → γ → ζ) (f₂ : β → γ) : map₂ f₁ xs (map f₂ ys) = map₂ (fun x y => f₁ x (f₂ y)) xs ys := by induction xs, ys using Vector.revInductionOn₂ <;> simp_all @[simp]
Mathlib/Data/Vector/MapLemmas.lean
92
100
theorem mapAccumr_mapAccumr₂ (f₁ : γ → σ₁ → σ₁ × ζ) (f₂ : α → β → σ₂ → σ₂ × γ) : (mapAccumr f₁ (mapAccumr₂ f₂ xs ys s₂).snd s₁) = let m := mapAccumr₂ (fun x y s => let r₂ := f₂ x y s.snd let r₁ := f₁ r₂.snd s.fst ((r₁.fst, r₂.fst), r₁.snd) ) xs ys (s₁, s₂) (m.fst.fst, m.snd) := by
induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> simp_all
import Mathlib.NumberTheory.ZetaValues import Mathlib.NumberTheory.LSeries.RiemannZeta open Complex Real Set open scoped Nat namespace HurwitzZeta variable {k : ℕ} {x : ℝ} theorem cosZeta_two_mul_nat (hk : k ≠ 0) (hx : x ∈ Icc 0 1) : cosZeta x (2 * k) = (-1) ^ (k + 1) * (2 * π) ^ (2 * k) / 2 / (2 * k)! * ((Polynomial.bernoulli (2 * k)).map (algebraMap ℚ ℂ)).eval (x : ℂ) := by rw [← (hasSum_nat_cosZeta x (?_ : 1 < re (2 * k))).tsum_eq] refine Eq.trans ?_ <| (congr_arg ofReal' (hasSum_one_div_nat_pow_mul_cos hk hx).tsum_eq).trans ?_ · rw [ofReal_tsum] refine tsum_congr fun n ↦ ?_ rw [mul_comm (1 / _), mul_one_div, ofReal_div, mul_assoc (2 * π), mul_comm x n, ← mul_assoc, ← Nat.cast_ofNat (R := ℂ), ← Nat.cast_mul, cpow_natCast, ofReal_pow, ofReal_natCast] · simp only [ofReal_mul, ofReal_div, ofReal_pow, ofReal_natCast, ofReal_ofNat, ofReal_neg, ofReal_one] congr 1 have : (Polynomial.bernoulli (2 * k)).map (algebraMap ℚ ℂ) = _ := (Polynomial.map_map (algebraMap ℚ ℝ) ofReal _).symm rw [this, ← ofReal_eq_coe, ← ofReal_eq_coe] apply Polynomial.map_aeval_eq_aeval_map simp only [Algebra.id.map_eq_id, RingHomCompTriple.comp_eq] · rw [← Nat.cast_ofNat, ← Nat.cast_one, ← Nat.cast_mul, natCast_re, Nat.cast_lt] omega theorem sinZeta_two_mul_nat_add_one (hk : k ≠ 0) (hx : x ∈ Icc 0 1) : sinZeta x (2 * k + 1) = (-1) ^ (k + 1) * (2 * π) ^ (2 * k + 1) / 2 / (2 * k + 1)! * ((Polynomial.bernoulli (2 * k + 1)).map (algebraMap ℚ ℂ)).eval (x : ℂ) := by rw [← (hasSum_nat_sinZeta x (?_ : 1 < re (2 * k + 1))).tsum_eq] refine Eq.trans ?_ <| (congr_arg ofReal' (hasSum_one_div_nat_pow_mul_sin hk hx).tsum_eq).trans ?_ · rw [ofReal_tsum] refine tsum_congr fun n ↦ ?_ rw [mul_comm (1 / _), mul_one_div, ofReal_div, mul_assoc (2 * π), mul_comm x n, ← mul_assoc] congr 1 rw [← Nat.cast_ofNat, ← Nat.cast_mul, ← Nat.cast_add_one, cpow_natCast, ofReal_pow, ofReal_natCast] · simp only [ofReal_mul, ofReal_div, ofReal_pow, ofReal_natCast, ofReal_ofNat, ofReal_neg, ofReal_one] congr 1 have : (Polynomial.bernoulli (2 * k + 1)).map (algebraMap ℚ ℂ) = _ := (Polynomial.map_map (algebraMap ℚ ℝ) ofReal _).symm rw [this, ← ofReal_eq_coe, ← ofReal_eq_coe] apply Polynomial.map_aeval_eq_aeval_map simp only [Algebra.id.map_eq_id, RingHomCompTriple.comp_eq] · rw [← Nat.cast_ofNat, ← Nat.cast_one, ← Nat.cast_mul, ← Nat.cast_add_one, natCast_re, Nat.cast_lt, lt_add_iff_pos_left] exact mul_pos two_pos (Nat.pos_of_ne_zero hk)
Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean
100
110
theorem cosZeta_two_mul_nat' (hk : k ≠ 0) (hx : x ∈ Icc (0 : ℝ) 1) : cosZeta x (2 * k) = (-1) ^ (k + 1) / (2 * k) / Gammaℂ (2 * k) * ((Polynomial.bernoulli (2 * k)).map (algebraMap ℚ ℂ)).eval (x : ℂ) := by
rw [cosZeta_two_mul_nat hk hx] congr 1 have : (2 * k)! = (2 * k) * Complex.Gamma (2 * k) := by rw [(by { norm_cast; omega } : 2 * (k : ℂ) = ↑(2 * k - 1) + 1), Complex.Gamma_nat_eq_factorial, ← Nat.cast_add_one, ← Nat.cast_mul, ← Nat.factorial_succ, Nat.sub_add_cancel (by omega)] simp_rw [this, Gammaℂ, cpow_neg, ← div_div, div_inv_eq_mul, div_mul_eq_mul_div, div_div, mul_right_comm (2 : ℂ) (k : ℂ)] norm_cast
import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.Adjugate import Mathlib.LinearAlgebra.Matrix.Transvection import Mathlib.RingTheory.RootsOfUnity.Basic #align_import linear_algebra.matrix.special_linear_group from "leanprover-community/mathlib"@"f06058e64b7e8397234455038f3f8aec83aaba5a" namespace Matrix universe u v open Matrix open LinearMap section variable (n : Type u) [DecidableEq n] [Fintype n] (R : Type v) [CommRing R] def SpecialLinearGroup := { A : Matrix n n R // A.det = 1 } #align matrix.special_linear_group Matrix.SpecialLinearGroup end @[inherit_doc] scoped[MatrixGroups] notation "SL(" n ", " R ")" => Matrix.SpecialLinearGroup (Fin n) R namespace SpecialLinearGroup variable {n : Type u} [DecidableEq n] [Fintype n] {R : Type v} [CommRing R] instance hasCoeToMatrix : Coe (SpecialLinearGroup n R) (Matrix n n R) := ⟨fun A => A.val⟩ #align matrix.special_linear_group.has_coe_to_matrix Matrix.SpecialLinearGroup.hasCoeToMatrix local notation:1024 "↑ₘ" A:1024 => ((A : SpecialLinearGroup n R) : Matrix n n R) -- Porting note: moved this section upwards because it used to be not simp-normal. -- Now it is, since coercion arrows are unfolded. theorem ext_iff (A B : SpecialLinearGroup n R) : A = B ↔ ∀ i j, ↑ₘA i j = ↑ₘB i j := Subtype.ext_iff.trans Matrix.ext_iff.symm #align matrix.special_linear_group.ext_iff Matrix.SpecialLinearGroup.ext_iff @[ext] theorem ext (A B : SpecialLinearGroup n R) : (∀ i j, ↑ₘA i j = ↑ₘB i j) → A = B := (SpecialLinearGroup.ext_iff A B).mpr #align matrix.special_linear_group.ext Matrix.SpecialLinearGroup.ext instance subsingleton_of_subsingleton [Subsingleton n] : Subsingleton (SpecialLinearGroup n R) := by refine ⟨fun ⟨A, hA⟩ ⟨B, hB⟩ ↦ ?_⟩ ext i j rcases isEmpty_or_nonempty n with hn | hn; · exfalso; exact IsEmpty.false i rw [det_eq_elem_of_subsingleton _ i] at hA hB simp only [Subsingleton.elim j i, hA, hB] instance hasInv : Inv (SpecialLinearGroup n R) := ⟨fun A => ⟨adjugate A, by rw [det_adjugate, A.prop, one_pow]⟩⟩ #align matrix.special_linear_group.has_inv Matrix.SpecialLinearGroup.hasInv instance hasMul : Mul (SpecialLinearGroup n R) := ⟨fun A B => ⟨↑ₘA * ↑ₘB, by rw [det_mul, A.prop, B.prop, one_mul]⟩⟩ #align matrix.special_linear_group.has_mul Matrix.SpecialLinearGroup.hasMul instance hasOne : One (SpecialLinearGroup n R) := ⟨⟨1, det_one⟩⟩ #align matrix.special_linear_group.has_one Matrix.SpecialLinearGroup.hasOne instance : Pow (SpecialLinearGroup n R) ℕ where pow x n := ⟨↑ₘx ^ n, (det_pow _ _).trans <| x.prop.symm ▸ one_pow _⟩ instance : Inhabited (SpecialLinearGroup n R) := ⟨1⟩ def transpose (A : SpecialLinearGroup n R) : SpecialLinearGroup n R := ⟨A.1.transpose, A.1.det_transpose ▸ A.2⟩ @[inherit_doc] scoped postfix:1024 "ᵀ" => SpecialLinearGroup.transpose section CoeLemmas variable (A B : SpecialLinearGroup n R) -- Porting note: shouldn't be `@[simp]` because cast+mk gets reduced anyway theorem coe_mk (A : Matrix n n R) (h : det A = 1) : ↑(⟨A, h⟩ : SpecialLinearGroup n R) = A := rfl #align matrix.special_linear_group.coe_mk Matrix.SpecialLinearGroup.coe_mk @[simp] theorem coe_inv : ↑ₘA⁻¹ = adjugate A := rfl #align matrix.special_linear_group.coe_inv Matrix.SpecialLinearGroup.coe_inv @[simp] theorem coe_mul : ↑ₘ(A * B) = ↑ₘA * ↑ₘB := rfl #align matrix.special_linear_group.coe_mul Matrix.SpecialLinearGroup.coe_mul @[simp] theorem coe_one : ↑ₘ(1 : SpecialLinearGroup n R) = (1 : Matrix n n R) := rfl #align matrix.special_linear_group.coe_one Matrix.SpecialLinearGroup.coe_one @[simp] theorem det_coe : det ↑ₘA = 1 := A.2 #align matrix.special_linear_group.det_coe Matrix.SpecialLinearGroup.det_coe @[simp] theorem coe_pow (m : ℕ) : ↑ₘ(A ^ m) = ↑ₘA ^ m := rfl #align matrix.special_linear_group.coe_pow Matrix.SpecialLinearGroup.coe_pow @[simp] lemma coe_transpose (A : SpecialLinearGroup n R) : ↑ₘAᵀ = (↑ₘA)ᵀ := rfl
Mathlib/LinearAlgebra/Matrix/SpecialLinearGroup.lean
181
183
theorem det_ne_zero [Nontrivial R] (g : SpecialLinearGroup n R) : det ↑ₘg ≠ 0 := by
rw [g.det_coe] norm_num
import Mathlib.Topology.Connected.Basic import Mathlib.Topology.Separation open scoped Topology variable {X Y A} [TopologicalSpace X] [TopologicalSpace A] theorem embedding_toPullbackDiag (f : X → Y) : Embedding (toPullbackDiag f) := Embedding.mk' _ (injective_toPullbackDiag f) fun x ↦ by rw [toPullbackDiag, nhds_induced, Filter.comap_comap, nhds_prod_eq, Filter.comap_prod] erw [Filter.comap_id, inf_idem] lemma Continuous.mapPullback {X₁ X₂ Y₁ Y₂ Z₁ Z₂} [TopologicalSpace X₁] [TopologicalSpace X₂] [TopologicalSpace Z₁] [TopologicalSpace Z₂] {f₁ : X₁ → Y₁} {g₁ : Z₁ → Y₁} {f₂ : X₂ → Y₂} {g₂ : Z₂ → Y₂} {mapX : X₁ → X₂} (contX : Continuous mapX) {mapY : Y₁ → Y₂} {mapZ : Z₁ → Z₂} (contZ : Continuous mapZ) {commX : f₂ ∘ mapX = mapY ∘ f₁} {commZ : g₂ ∘ mapZ = mapY ∘ g₁} : Continuous (Function.mapPullback mapX mapY mapZ commX commZ) := by refine continuous_induced_rng.mpr (continuous_prod_mk.mpr ⟨?_, ?_⟩) <;> apply_rules [continuous_fst, continuous_snd, continuous_subtype_val, Continuous.comp] def IsSeparatedMap (f : X → Y) : Prop := ∀ x₁ x₂, f x₁ = f x₂ → x₁ ≠ x₂ → ∃ s₁ s₂, IsOpen s₁ ∧ IsOpen s₂ ∧ x₁ ∈ s₁ ∧ x₂ ∈ s₂ ∧ Disjoint s₁ s₂ lemma t2space_iff_isSeparatedMap (y : Y) : T2Space X ↔ IsSeparatedMap fun _ : X ↦ y := ⟨fun ⟨t2⟩ _ _ _ hne ↦ t2 hne, fun sep ↦ ⟨fun x₁ x₂ hne ↦ sep x₁ x₂ rfl hne⟩⟩ lemma T2Space.isSeparatedMap [T2Space X] (f : X → Y) : IsSeparatedMap f := fun _ _ _ ↦ t2_separation lemma Function.Injective.isSeparatedMap {f : X → Y} (inj : f.Injective) : IsSeparatedMap f := fun _ _ he hne ↦ (hne (inj he)).elim lemma isSeparatedMap_iff_disjoint_nhds {f : X → Y} : IsSeparatedMap f ↔ ∀ x₁ x₂, f x₁ = f x₂ → x₁ ≠ x₂ → Disjoint (𝓝 x₁) (𝓝 x₂) := forall₃_congr fun x x' _ ↦ by simp only [(nhds_basis_opens x).disjoint_iff (nhds_basis_opens x'), exists_prop, ← exists_and_left, and_assoc, and_comm, and_left_comm] lemma isSeparatedMap_iff_nhds {f : X → Y} : IsSeparatedMap f ↔ ∀ x₁ x₂, f x₁ = f x₂ → x₁ ≠ x₂ → ∃ s₁ ∈ 𝓝 x₁, ∃ s₂ ∈ 𝓝 x₂, Disjoint s₁ s₂ := by simp_rw [isSeparatedMap_iff_disjoint_nhds, Filter.disjoint_iff] open Set Filter in
Mathlib/Topology/SeparatedMap.lean
79
87
theorem isSeparatedMap_iff_isClosed_diagonal {f : X → Y} : IsSeparatedMap f ↔ IsClosed f.pullbackDiagonal := by
simp_rw [isSeparatedMap_iff_nhds, ← isOpen_compl_iff, isOpen_iff_mem_nhds, Subtype.forall, Prod.forall, nhds_induced, nhds_prod_eq] refine forall₄_congr fun x₁ x₂ _ _ ↦ ⟨fun h ↦ ?_, fun ⟨t, ht, t_sub⟩ ↦ ?_⟩ · simp_rw [← Filter.disjoint_iff, ← compl_diagonal_mem_prod] at h exact ⟨_, h, subset_rfl⟩ · obtain ⟨s₁, h₁, s₂, h₂, s_sub⟩ := mem_prod_iff.mp ht exact ⟨s₁, h₁, s₂, h₂, disjoint_left.2 fun x h₁ h₂ ↦ @t_sub ⟨(x, x), rfl⟩ (s_sub ⟨h₁, h₂⟩) rfl⟩
import Mathlib.Data.Finset.Lattice import Mathlib.Data.Set.Sigma #align_import data.finset.sigma from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Function Multiset variable {ι : Type*} namespace Finset section SigmaLift variable {α β γ : ι → Type*} [DecidableEq ι] def sigmaLift (f : ∀ ⦃i⦄, α i → β i → Finset (γ i)) (a : Sigma α) (b : Sigma β) : Finset (Sigma γ) := dite (a.1 = b.1) (fun h => (f (h ▸ a.2) b.2).map <| Embedding.sigmaMk _) fun _ => ∅ #align finset.sigma_lift Finset.sigmaLift theorem mem_sigmaLift (f : ∀ ⦃i⦄, α i → β i → Finset (γ i)) (a : Sigma α) (b : Sigma β) (x : Sigma γ) : x ∈ sigmaLift f a b ↔ ∃ (ha : a.1 = x.1) (hb : b.1 = x.1), x.2 ∈ f (ha ▸ a.2) (hb ▸ b.2) := by obtain ⟨⟨i, a⟩, j, b⟩ := a, b obtain rfl | h := Decidable.eq_or_ne i j · constructor · simp_rw [sigmaLift] simp only [dite_eq_ite, ite_true, mem_map, Embedding.sigmaMk_apply, forall_exists_index, and_imp] rintro x hx rfl exact ⟨rfl, rfl, hx⟩ · rintro ⟨⟨⟩, ⟨⟩, hx⟩ rw [sigmaLift, dif_pos rfl, mem_map] exact ⟨_, hx, by simp [Sigma.ext_iff]⟩ · rw [sigmaLift, dif_neg h] refine iff_of_false (not_mem_empty _) ?_ rintro ⟨⟨⟩, ⟨⟩, _⟩ exact h rfl #align finset.mem_sigma_lift Finset.mem_sigmaLift theorem mk_mem_sigmaLift (f : ∀ ⦃i⦄, α i → β i → Finset (γ i)) (i : ι) (a : α i) (b : β i) (x : γ i) : (⟨i, x⟩ : Sigma γ) ∈ sigmaLift f ⟨i, a⟩ ⟨i, b⟩ ↔ x ∈ f a b := by rw [sigmaLift, dif_pos rfl, mem_map] refine ⟨?_, fun hx => ⟨_, hx, rfl⟩⟩ rintro ⟨x, hx, _, rfl⟩ exact hx #align finset.mk_mem_sigma_lift Finset.mk_mem_sigmaLift theorem not_mem_sigmaLift_of_ne_left (f : ∀ ⦃i⦄, α i → β i → Finset (γ i)) (a : Sigma α) (b : Sigma β) (x : Sigma γ) (h : a.1 ≠ x.1) : x ∉ sigmaLift f a b := by rw [mem_sigmaLift] exact fun H => h H.fst #align finset.not_mem_sigma_lift_of_ne_left Finset.not_mem_sigmaLift_of_ne_left theorem not_mem_sigmaLift_of_ne_right (f : ∀ ⦃i⦄, α i → β i → Finset (γ i)) {a : Sigma α} (b : Sigma β) {x : Sigma γ} (h : b.1 ≠ x.1) : x ∉ sigmaLift f a b := by rw [mem_sigmaLift] exact fun H => h H.snd.fst #align finset.not_mem_sigma_lift_of_ne_right Finset.not_mem_sigmaLift_of_ne_right variable {f g : ∀ ⦃i⦄, α i → β i → Finset (γ i)} {a : Σi, α i} {b : Σi, β i} theorem sigmaLift_nonempty : (sigmaLift f a b).Nonempty ↔ ∃ h : a.1 = b.1, (f (h ▸ a.2) b.2).Nonempty := by simp_rw [nonempty_iff_ne_empty, sigmaLift] split_ifs with h <;> simp [h] #align finset.sigma_lift_nonempty Finset.sigmaLift_nonempty
Mathlib/Data/Finset/Sigma.lean
204
208
theorem sigmaLift_eq_empty : sigmaLift f a b = ∅ ↔ ∀ h : a.1 = b.1, f (h ▸ a.2) b.2 = ∅ := by
simp_rw [sigmaLift] split_ifs with h · simp [h, forall_prop_of_true h] · simp [h, forall_prop_of_false h]
import Mathlib.Data.DFinsupp.Basic import Mathlib.Data.Finset.Pointwise import Mathlib.LinearAlgebra.Basis.VectorSpace #align_import algebra.group.unique_prods from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce" @[to_additive "Let `G` be a Type with addition, let `A B : Finset G` be finite subsets and let `a0 b0 : G` be two elements. `UniqueAdd A B a0 b0` asserts `a0 + b0` can be written in at most one way as a sum of an element from `A` and an element from `B`."] def UniqueMul {G} [Mul G] (A B : Finset G) (a0 b0 : G) : Prop := ∀ ⦃a b⦄, a ∈ A → b ∈ B → a * b = a0 * b0 → a = a0 ∧ b = b0 #align unique_mul UniqueMul #align unique_add UniqueAdd namespace UniqueMul variable {G H : Type*} [Mul G] [Mul H] {A B : Finset G} {a0 b0 : G} @[to_additive (attr := nontriviality, simp)] theorem of_subsingleton [Subsingleton G] : UniqueMul A B a0 b0 := by simp [UniqueMul, eq_iff_true_of_subsingleton] @[to_additive]
Mathlib/Algebra/Group/UniqueProds.lean
71
75
theorem of_card_le_one (hA : A.Nonempty) (hB : B.Nonempty) (hA1 : A.card ≤ 1) (hB1 : B.card ≤ 1) : ∃ a ∈ A, ∃ b ∈ B, UniqueMul A B a b := by
rw [Finset.card_le_one_iff] at hA1 hB1 obtain ⟨a, ha⟩ := hA; obtain ⟨b, hb⟩ := hB exact ⟨a, ha, b, hb, fun _ _ ha' hb' _ ↦ ⟨hA1 ha' ha, hB1 hb' hb⟩⟩
import Mathlib.Data.Vector.Basic import Mathlib.Data.Vector.Snoc set_option autoImplicit true namespace Vector section Fold section Binary variable (xs : Vector α n) (ys : Vector β n) @[simp] theorem mapAccumr₂_mapAccumr_left (f₁ : γ → β → σ₁ → σ₁ × ζ) (f₂ : α → σ₂ → σ₂ × γ) : (mapAccumr₂ f₁ (mapAccumr f₂ xs s₂).snd ys s₁) = let m := (mapAccumr₂ (fun x y s => let r₂ := f₂ x s.snd let r₁ := f₁ r₂.snd y s.fst ((r₁.fst, r₂.fst), r₁.snd) ) xs ys (s₁, s₂)) (m.fst.fst, m.snd) := by induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> simp_all @[simp] theorem map₂_map_left (f₁ : γ → β → ζ) (f₂ : α → γ) : map₂ f₁ (map f₂ xs) ys = map₂ (fun x y => f₁ (f₂ x) y) xs ys := by induction xs, ys using Vector.revInductionOn₂ <;> simp_all @[simp] theorem mapAccumr₂_mapAccumr_right (f₁ : α → γ → σ₁ → σ₁ × ζ) (f₂ : β → σ₂ → σ₂ × γ) : (mapAccumr₂ f₁ xs (mapAccumr f₂ ys s₂).snd s₁) = let m := (mapAccumr₂ (fun x y s => let r₂ := f₂ y s.snd let r₁ := f₁ x r₂.snd s.fst ((r₁.fst, r₂.fst), r₁.snd) ) xs ys (s₁, s₂)) (m.fst.fst, m.snd) := by induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> simp_all @[simp] theorem map₂_map_right (f₁ : α → γ → ζ) (f₂ : β → γ) : map₂ f₁ xs (map f₂ ys) = map₂ (fun x y => f₁ x (f₂ y)) xs ys := by induction xs, ys using Vector.revInductionOn₂ <;> simp_all @[simp] theorem mapAccumr_mapAccumr₂ (f₁ : γ → σ₁ → σ₁ × ζ) (f₂ : α → β → σ₂ → σ₂ × γ) : (mapAccumr f₁ (mapAccumr₂ f₂ xs ys s₂).snd s₁) = let m := mapAccumr₂ (fun x y s => let r₂ := f₂ x y s.snd let r₁ := f₁ r₂.snd s.fst ((r₁.fst, r₂.fst), r₁.snd) ) xs ys (s₁, s₂) (m.fst.fst, m.snd) := by induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> simp_all @[simp] theorem map_map₂ (f₁ : γ → ζ) (f₂ : α → β → γ) : map f₁ (map₂ f₂ xs ys) = map₂ (fun x y => f₁ <| f₂ x y) xs ys := by induction xs, ys using Vector.revInductionOn₂ <;> simp_all @[simp]
Mathlib/Data/Vector/MapLemmas.lean
108
117
theorem mapAccumr₂_mapAccumr₂_left_left (f₁ : γ → α → σ₁ → σ₁ × φ) (f₂ : α → β → σ₂ → σ₂ × γ) : (mapAccumr₂ f₁ (mapAccumr₂ f₂ xs ys s₂).snd xs s₁) = let m := mapAccumr₂ (fun x y (s₁, s₂) => let r₂ := f₂ x y s₂ let r₁ := f₁ r₂.snd x s₁ ((r₁.fst, r₂.fst), r₁.snd) ) xs ys (s₁, s₂) (m.fst.fst, m.snd) := by
induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> simp_all
import Mathlib.MeasureTheory.Integral.Lebesgue open Set hiding restrict restrict_apply open Filter ENNReal NNReal MeasureTheory.Measure namespace MeasureTheory variable {α : Type*} {m0 : MeasurableSpace α} {μ : Measure α} noncomputable def Measure.withDensity {m : MeasurableSpace α} (μ : Measure α) (f : α → ℝ≥0∞) : Measure α := Measure.ofMeasurable (fun s _ => ∫⁻ a in s, f a ∂μ) (by simp) fun s hs hd => lintegral_iUnion hs hd _ #align measure_theory.measure.with_density MeasureTheory.Measure.withDensity @[simp] theorem withDensity_apply (f : α → ℝ≥0∞) {s : Set α} (hs : MeasurableSet s) : μ.withDensity f s = ∫⁻ a in s, f a ∂μ := Measure.ofMeasurable_apply s hs #align measure_theory.with_density_apply MeasureTheory.withDensity_apply theorem withDensity_apply_le (f : α → ℝ≥0∞) (s : Set α) : ∫⁻ a in s, f a ∂μ ≤ μ.withDensity f s := by let t := toMeasurable (μ.withDensity f) s calc ∫⁻ a in s, f a ∂μ ≤ ∫⁻ a in t, f a ∂μ := lintegral_mono_set (subset_toMeasurable (withDensity μ f) s) _ = μ.withDensity f t := (withDensity_apply f (measurableSet_toMeasurable (withDensity μ f) s)).symm _ = μ.withDensity f s := measure_toMeasurable s theorem withDensity_apply' [SFinite μ] (f : α → ℝ≥0∞) (s : Set α) : μ.withDensity f s = ∫⁻ a in s, f a ∂μ := by apply le_antisymm ?_ (withDensity_apply_le f s) let t := toMeasurable μ s calc μ.withDensity f s ≤ μ.withDensity f t := measure_mono (subset_toMeasurable μ s) _ = ∫⁻ a in t, f a ∂μ := withDensity_apply f (measurableSet_toMeasurable μ s) _ = ∫⁻ a in s, f a ∂μ := by congr 1; exact restrict_toMeasurable_of_sFinite s @[simp] lemma withDensity_zero_left (f : α → ℝ≥0∞) : (0 : Measure α).withDensity f = 0 := by ext s hs rw [withDensity_apply _ hs] simp theorem withDensity_congr_ae {f g : α → ℝ≥0∞} (h : f =ᵐ[μ] g) : μ.withDensity f = μ.withDensity g := by refine Measure.ext fun s hs => ?_ rw [withDensity_apply _ hs, withDensity_apply _ hs] exact lintegral_congr_ae (ae_restrict_of_ae h) #align measure_theory.with_density_congr_ae MeasureTheory.withDensity_congr_ae lemma withDensity_mono {f g : α → ℝ≥0∞} (hfg : f ≤ᵐ[μ] g) : μ.withDensity f ≤ μ.withDensity g := by refine le_iff.2 fun s hs ↦ ?_ rw [withDensity_apply _ hs, withDensity_apply _ hs] refine set_lintegral_mono_ae' hs ?_ filter_upwards [hfg] with x h_le using fun _ ↦ h_le theorem withDensity_add_left {f : α → ℝ≥0∞} (hf : Measurable f) (g : α → ℝ≥0∞) : μ.withDensity (f + g) = μ.withDensity f + μ.withDensity g := by refine Measure.ext fun s hs => ?_ rw [withDensity_apply _ hs, Measure.add_apply, withDensity_apply _ hs, withDensity_apply _ hs, ← lintegral_add_left hf] simp only [Pi.add_apply] #align measure_theory.with_density_add_left MeasureTheory.withDensity_add_left
Mathlib/MeasureTheory/Measure/WithDensity.lean
105
107
theorem withDensity_add_right (f : α → ℝ≥0∞) {g : α → ℝ≥0∞} (hg : Measurable g) : μ.withDensity (f + g) = μ.withDensity f + μ.withDensity g := by
simpa only [add_comm] using withDensity_add_left hg f
import Mathlib.MeasureTheory.Constructions.Prod.Basic import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.MeasureTheory.Integral.SetIntegral #align_import measure_theory.constructions.prod.integral from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" noncomputable section open scoped Classical Topology ENNReal MeasureTheory open Set Function Real ENNReal open MeasureTheory MeasurableSpace MeasureTheory.Measure open TopologicalSpace open Filter hiding prod_eq map variable {α α' β β' γ E : Type*} variable [MeasurableSpace α] [MeasurableSpace α'] [MeasurableSpace β] [MeasurableSpace β'] variable [MeasurableSpace γ] variable {μ μ' : Measure α} {ν ν' : Measure β} {τ : Measure γ} variable [NormedAddCommGroup E] theorem measurableSet_integrable [SigmaFinite ν] ⦃f : α → β → E⦄ (hf : StronglyMeasurable (uncurry f)) : MeasurableSet {x | Integrable (f x) ν} := by simp_rw [Integrable, hf.of_uncurry_left.aestronglyMeasurable, true_and_iff] exact measurableSet_lt (Measurable.lintegral_prod_right hf.ennnorm) measurable_const #align measurable_set_integrable measurableSet_integrable section variable [NormedSpace ℝ E]
Mathlib/MeasureTheory/Constructions/Prod/Integral.lean
77
122
theorem MeasureTheory.StronglyMeasurable.integral_prod_right [SigmaFinite ν] ⦃f : α → β → E⦄ (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun x => ∫ y, f x y ∂ν := by
by_cases hE : CompleteSpace E; swap; · simp [integral, hE, stronglyMeasurable_const] borelize E haveI : SeparableSpace (range (uncurry f) ∪ {0} : Set E) := hf.separableSpace_range_union_singleton let s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn _ hf.measurable (range (uncurry f) ∪ {0}) 0 (by simp) let s' : ℕ → α → SimpleFunc β E := fun n x => (s n).comp (Prod.mk x) measurable_prod_mk_left let f' : ℕ → α → E := fun n => {x | Integrable (f x) ν}.indicator fun x => (s' n x).integral ν have hf' : ∀ n, StronglyMeasurable (f' n) := by intro n; refine StronglyMeasurable.indicator ?_ (measurableSet_integrable hf) have : ∀ x, ((s' n x).range.filter fun x => x ≠ 0) ⊆ (s n).range := by intro x; refine Finset.Subset.trans (Finset.filter_subset _ _) ?_; intro y simp_rw [SimpleFunc.mem_range]; rintro ⟨z, rfl⟩; exact ⟨(x, z), rfl⟩ simp only [SimpleFunc.integral_eq_sum_of_subset (this _)] refine Finset.stronglyMeasurable_sum _ fun x _ => ?_ refine (Measurable.ennreal_toReal ?_).stronglyMeasurable.smul_const _ simp only [s', SimpleFunc.coe_comp, preimage_comp] apply measurable_measure_prod_mk_left exact (s n).measurableSet_fiber x have h2f' : Tendsto f' atTop (𝓝 fun x : α => ∫ y : β, f x y ∂ν) := by rw [tendsto_pi_nhds]; intro x by_cases hfx : Integrable (f x) ν · have (n) : Integrable (s' n x) ν := by apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable filter_upwards with y simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n simp only [f', hfx, SimpleFunc.integral_eq_integral _ (this _), indicator_of_mem, mem_setOf_eq] refine tendsto_integral_of_dominated_convergence (fun y => ‖f x y‖ + ‖f x y‖) (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_ · refine fun n => eventually_of_forall fun y => SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n -- Porting note: Lean 3 solved the following two subgoals on its own · exact hf.measurable · simp · refine eventually_of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_ -- Porting note: Lean 3 solved the following two subgoals on its own · exact hf.measurable.of_uncurry_left · simp apply subset_closure simp [-uncurry_apply_pair] · simp [f', hfx, integral_undef] exact stronglyMeasurable_of_tendsto _ hf' h2f'
import Mathlib.Data.Set.Image import Mathlib.Data.List.GetD #align_import data.set.list from "leanprover-community/mathlib"@"2ec920d35348cb2d13ac0e1a2ad9df0fdf1a76b4" open List variable {α β : Type*} (l : List α) namespace Set theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f } := by refine antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _) fun l hl => ?_ induction' l with a l ihl; · exact ⟨[], rfl⟩ rcases ihl fun x hx => hl x <| subset_cons _ _ hx with ⟨l, rfl⟩ rcases hl a (mem_cons_self _ _) with ⟨a, rfl⟩ exact ⟨a :: l, map_cons _ _ _⟩ #align set.range_list_map Set.range_list_map theorem range_list_map_coe (s : Set α) : range (map ((↑) : s → α)) = { l | ∀ x ∈ l, x ∈ s } := by rw [range_list_map, Subtype.range_coe] #align set.range_list_map_coe Set.range_list_map_coe @[simp] theorem range_list_get : range l.get = { x | x ∈ l } := by ext x rw [mem_setOf_eq, mem_iff_get, mem_range] #align set.range_list_nth_le Set.range_list_get @[deprecated (since := "2024-04-22")] alias range_list_nthLe := range_list_get theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) := by rw [← range_list_get, ← range_comp] refine (range_subset_iff.2 fun n => ?_).antisymm (insert_subset_iff.2 ⟨?_, ?_⟩) exacts [(le_or_lt l.length n).imp get?_eq_none.2 (fun hlt => ⟨⟨_, hlt⟩, (get?_eq_get hlt).symm⟩), ⟨_, get?_eq_none.2 le_rfl⟩, range_subset_iff.2 fun k => ⟨_, get?_eq_get _⟩] #align set.range_list_nth Set.range_list_get? @[simp]
Mathlib/Data/Set/List.lean
52
57
theorem range_list_getD (d : α) : (range fun n => l.getD n d) = insert d { x | x ∈ l } := calc (range fun n => l.getD n d) = (fun o : Option α => o.getD d) '' range l.get? := by
simp only [← range_comp, (· ∘ ·), getD_eq_getD_get?] _ = insert d { x | x ∈ l } := by simp only [range_list_get?, image_insert_eq, Option.getD, image_image, image_id']
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)
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section CoheytingAlgebra variable [CoheytingAlgebra α] (a : α) @[simp] theorem symmDiff_top' : a ∆ ⊤ = ¬a := by simp [symmDiff] #align symm_diff_top' symmDiff_top' @[simp]
Mathlib/Order/SymmDiff.lean
347
347
theorem top_symmDiff' : ⊤ ∆ a = ¬a := by
simp [symmDiff]
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]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
256
259
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]
import Mathlib.Analysis.BoxIntegral.Partition.Basic #align_import analysis.box_integral.partition.split from "leanprover-community/mathlib"@"6ca1a09bc9aa75824bf97388c9e3b441fc4ccf3f" noncomputable section open scoped Classical open Filter open Function Set Filter namespace BoxIntegral variable {ι M : Type*} {n : ℕ} namespace Box variable {I : Box ι} {i : ι} {x : ℝ} {y : ι → ℝ} def splitLower (I : Box ι) (i : ι) (x : ℝ) : WithBot (Box ι) := mk' I.lower (update I.upper i (min x (I.upper i))) #align box_integral.box.split_lower BoxIntegral.Box.splitLower @[simp] theorem coe_splitLower : (splitLower I i x : Set (ι → ℝ)) = ↑I ∩ { y | y i ≤ x } := by rw [splitLower, coe_mk'] ext y simp only [mem_univ_pi, mem_Ioc, mem_inter_iff, mem_coe, mem_setOf_eq, forall_and, ← Pi.le_def, le_update_iff, le_min_iff, and_assoc, and_forall_ne (p := fun j => y j ≤ upper I j) i, mem_def] rw [and_comm (a := y i ≤ x)] #align box_integral.box.coe_split_lower BoxIntegral.Box.coe_splitLower theorem splitLower_le : I.splitLower i x ≤ I := withBotCoe_subset_iff.1 <| by simp #align box_integral.box.split_lower_le BoxIntegral.Box.splitLower_le @[simp] theorem splitLower_eq_bot {i x} : I.splitLower i x = ⊥ ↔ x ≤ I.lower i := by rw [splitLower, mk'_eq_bot, exists_update_iff I.upper fun j y => y ≤ I.lower j] simp [(I.lower_lt_upper _).not_le] #align box_integral.box.split_lower_eq_bot BoxIntegral.Box.splitLower_eq_bot @[simp] theorem splitLower_eq_self : I.splitLower i x = I ↔ I.upper i ≤ x := by simp [splitLower, update_eq_iff] #align box_integral.box.split_lower_eq_self BoxIntegral.Box.splitLower_eq_self
Mathlib/Analysis/BoxIntegral/Partition/Split.lean
88
94
theorem splitLower_def [DecidableEq ι] {i x} (h : x ∈ Ioo (I.lower i) (I.upper i)) (h' : ∀ j, I.lower j < update I.upper i x j := (forall_update_iff I.upper fun j y => I.lower j < y).2 ⟨h.1, fun j _ => I.lower_lt_upper _⟩) : I.splitLower i x = (⟨I.lower, update I.upper i x, h'⟩ : Box ι) := by
simp (config := { unfoldPartialApp := true }) only [splitLower, mk'_eq_coe, min_eq_left h.2.le, update, and_self]
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.BigOperators import Mathlib.Algebra.Polynomial.Degree.Lemmas import Mathlib.Algebra.Polynomial.Div #align_import data.polynomial.ring_division from "leanprover-community/mathlib"@"8efcf8022aac8e01df8d302dcebdbc25d6a886c8" noncomputable section open Polynomial open Finset namespace Polynomial universe u v w z variable {R : Type u} {S : Type v} {T : Type w} {a b : R} {n : ℕ} section CommRing variable [CommRing R] {p q : R[X]} section variable [Semiring S] theorem natDegree_pos_of_aeval_root [Algebra R S] {p : R[X]} (hp : p ≠ 0) {z : S} (hz : aeval z p = 0) (inj : ∀ x : R, algebraMap R S x = 0 → x = 0) : 0 < p.natDegree := natDegree_pos_of_eval₂_root hp (algebraMap R S) hz inj #align polynomial.nat_degree_pos_of_aeval_root Polynomial.natDegree_pos_of_aeval_root theorem degree_pos_of_aeval_root [Algebra R S] {p : R[X]} (hp : p ≠ 0) {z : S} (hz : aeval z p = 0) (inj : ∀ x : R, algebraMap R S x = 0 → x = 0) : 0 < p.degree := natDegree_pos_iff_degree_pos.mp (natDegree_pos_of_aeval_root hp hz inj) #align polynomial.degree_pos_of_aeval_root Polynomial.degree_pos_of_aeval_root theorem modByMonic_eq_of_dvd_sub (hq : q.Monic) {p₁ p₂ : R[X]} (h : q ∣ p₁ - p₂) : p₁ %ₘ q = p₂ %ₘ q := by nontriviality R obtain ⟨f, sub_eq⟩ := h refine (div_modByMonic_unique (p₂ /ₘ q + f) _ hq ⟨?_, degree_modByMonic_lt _ hq⟩).2 rw [sub_eq_iff_eq_add.mp sub_eq, mul_add, ← add_assoc, modByMonic_add_div _ hq, add_comm] #align polynomial.mod_by_monic_eq_of_dvd_sub Polynomial.modByMonic_eq_of_dvd_sub theorem add_modByMonic (p₁ p₂ : R[X]) : (p₁ + p₂) %ₘ q = p₁ %ₘ q + p₂ %ₘ q := by by_cases hq : q.Monic · cases' subsingleton_or_nontrivial R with hR hR · simp only [eq_iff_true_of_subsingleton] · exact (div_modByMonic_unique (p₁ /ₘ q + p₂ /ₘ q) _ hq ⟨by rw [mul_add, add_left_comm, add_assoc, modByMonic_add_div _ hq, ← add_assoc, add_comm (q * _), modByMonic_add_div _ hq], (degree_add_le _ _).trans_lt (max_lt (degree_modByMonic_lt _ hq) (degree_modByMonic_lt _ hq))⟩).2 · simp_rw [modByMonic_eq_of_not_monic _ hq] #align polynomial.add_mod_by_monic Polynomial.add_modByMonic theorem smul_modByMonic (c : R) (p : R[X]) : c • p %ₘ q = c • (p %ₘ q) := by by_cases hq : q.Monic · cases' subsingleton_or_nontrivial R with hR hR · simp only [eq_iff_true_of_subsingleton] · exact (div_modByMonic_unique (c • (p /ₘ q)) (c • (p %ₘ q)) hq ⟨by rw [mul_smul_comm, ← smul_add, modByMonic_add_div p hq], (degree_smul_le _ _).trans_lt (degree_modByMonic_lt _ hq)⟩).2 · simp_rw [modByMonic_eq_of_not_monic _ hq] #align polynomial.smul_mod_by_monic Polynomial.smul_modByMonic @[simps] def modByMonicHom (q : R[X]) : R[X] →ₗ[R] R[X] where toFun p := p %ₘ q map_add' := add_modByMonic map_smul' := smul_modByMonic #align polynomial.mod_by_monic_hom Polynomial.modByMonicHom theorem neg_modByMonic (p mod : R[X]) : (-p) %ₘ mod = - (p %ₘ mod) := (modByMonicHom mod).map_neg p theorem sub_modByMonic (a b mod : R[X]) : (a - b) %ₘ mod = a %ₘ mod - b %ₘ mod := (modByMonicHom mod).map_sub a b end section variable [Ring S]
Mathlib/Algebra/Polynomial/RingDivision.lean
103
107
theorem aeval_modByMonic_eq_self_of_root [Algebra R S] {p q : R[X]} (hq : q.Monic) {x : S} (hx : aeval x q = 0) : aeval x (p %ₘ q) = aeval x p := by
--`eval₂_modByMonic_eq_self_of_root` doesn't work here as it needs commutativity rw [modByMonic_eq_sub_mul_div p hq, _root_.map_sub, _root_.map_mul, hx, zero_mul, sub_zero]
import Mathlib.Algebra.Lie.BaseChange import Mathlib.Algebra.Lie.Solvable import Mathlib.Algebra.Lie.Quotient import Mathlib.Algebra.Lie.Normalizer import Mathlib.LinearAlgebra.Eigenspace.Basic import Mathlib.Order.Filter.AtTopBot import Mathlib.RingTheory.Artinian import Mathlib.RingTheory.Nilpotent.Lemmas import Mathlib.Tactic.Monotonicity #align_import algebra.lie.nilpotent from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1" universe u v w w₁ w₂ section NilpotentModules variable {R : Type u} {L : Type v} {M : Type w} variable [CommRing R] [LieRing L] [LieAlgebra R L] [AddCommGroup M] [Module R M] variable [LieRingModule L M] [LieModule R L M] variable (k : ℕ) (N : LieSubmodule R L M) namespace LieSubmodule variable {N₁ N₂ : LieSubmodule R L M} def ucs (k : ℕ) : LieSubmodule R L M → LieSubmodule R L M := normalizer^[k] #align lie_submodule.ucs LieSubmodule.ucs @[simp] theorem ucs_zero : N.ucs 0 = N := rfl #align lie_submodule.ucs_zero LieSubmodule.ucs_zero @[simp] theorem ucs_succ (k : ℕ) : N.ucs (k + 1) = (N.ucs k).normalizer := Function.iterate_succ_apply' normalizer k N #align lie_submodule.ucs_succ LieSubmodule.ucs_succ theorem ucs_add (k l : ℕ) : N.ucs (k + l) = (N.ucs l).ucs k := Function.iterate_add_apply normalizer k l N #align lie_submodule.ucs_add LieSubmodule.ucs_add @[mono] theorem ucs_mono (k : ℕ) (h : N₁ ≤ N₂) : N₁.ucs k ≤ N₂.ucs k := by induction' k with k ih · simpa simp only [ucs_succ] -- Porting note: `mono` makes no progress apply monotone_normalizer ih #align lie_submodule.ucs_mono LieSubmodule.ucs_mono theorem ucs_eq_self_of_normalizer_eq_self (h : N₁.normalizer = N₁) (k : ℕ) : N₁.ucs k = N₁ := by induction' k with k ih · simp · rwa [ucs_succ, ih] #align lie_submodule.ucs_eq_self_of_normalizer_eq_self LieSubmodule.ucs_eq_self_of_normalizer_eq_self
Mathlib/Algebra/Lie/Nilpotent.lean
504
508
theorem ucs_le_of_normalizer_eq_self (h : N₁.normalizer = N₁) (k : ℕ) : (⊥ : LieSubmodule R L M).ucs k ≤ N₁ := by
rw [← ucs_eq_self_of_normalizer_eq_self h k] mono simp
import Mathlib.Dynamics.Ergodic.MeasurePreserving import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal import Mathlib.LinearAlgebra.Matrix.Transvection import Mathlib.MeasureTheory.Group.LIntegral import Mathlib.MeasureTheory.Integral.Marginal import Mathlib.MeasureTheory.Measure.Stieltjes import Mathlib.MeasureTheory.Measure.Haar.OfBasis #align_import measure_theory.measure.lebesgue.basic from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" assert_not_exists MeasureTheory.integral noncomputable section open scoped Classical open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace open ENNReal (ofReal) open scoped ENNReal NNReal Topology namespace Real variable {ι : Type*} [Fintype ι] theorem volume_eq_stieltjes_id : (volume : Measure ℝ) = StieltjesFunction.id.measure := by haveI : IsAddLeftInvariant StieltjesFunction.id.measure := ⟨fun a => Eq.symm <| Real.measure_ext_Ioo_rat fun p q => by simp only [Measure.map_apply (measurable_const_add a) measurableSet_Ioo, sub_sub_sub_cancel_right, StieltjesFunction.measure_Ioo, StieltjesFunction.id_leftLim, StieltjesFunction.id_apply, id, preimage_const_add_Ioo]⟩ have A : StieltjesFunction.id.measure (stdOrthonormalBasis ℝ ℝ).toBasis.parallelepiped = 1 := by change StieltjesFunction.id.measure (parallelepiped (stdOrthonormalBasis ℝ ℝ)) = 1 rcases parallelepiped_orthonormalBasis_one_dim (stdOrthonormalBasis ℝ ℝ) with (H | H) <;> simp only [H, StieltjesFunction.measure_Icc, StieltjesFunction.id_apply, id, tsub_zero, StieltjesFunction.id_leftLim, sub_neg_eq_add, zero_add, ENNReal.ofReal_one] conv_rhs => rw [addHaarMeasure_unique StieltjesFunction.id.measure (stdOrthonormalBasis ℝ ℝ).toBasis.parallelepiped, A] simp only [volume, Basis.addHaar, one_smul] #align real.volume_eq_stieltjes_id Real.volume_eq_stieltjes_id theorem volume_val (s) : volume s = StieltjesFunction.id.measure s := by simp [volume_eq_stieltjes_id] #align real.volume_val Real.volume_val @[simp] theorem volume_Ico {a b : ℝ} : volume (Ico a b) = ofReal (b - a) := by simp [volume_val] #align real.volume_Ico Real.volume_Ico @[simp] theorem volume_Icc {a b : ℝ} : volume (Icc a b) = ofReal (b - a) := by simp [volume_val] #align real.volume_Icc Real.volume_Icc @[simp] theorem volume_Ioo {a b : ℝ} : volume (Ioo a b) = ofReal (b - a) := by simp [volume_val] #align real.volume_Ioo Real.volume_Ioo @[simp]
Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean
92
92
theorem volume_Ioc {a b : ℝ} : volume (Ioc a b) = ofReal (b - a) := by
simp [volume_val]
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Data.Finset.Sym import Mathlib.Data.Nat.Choose.Cast import Mathlib.Data.Nat.Choose.Multinomial #align_import analysis.calculus.cont_diff from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical NNReal Nat universe u uD uE uF uG open Set Fin Filter Function variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {D : Type uD} [NormedAddCommGroup D] [NormedSpace 𝕜 D] {E : Type uE} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace 𝕜 G] {s s₁ t u : Set E}
Mathlib/Analysis/Calculus/ContDiff/Bounds.lean
40
122
theorem ContinuousLinearMap.norm_iteratedFDerivWithin_le_of_bilinear_aux {Du Eu Fu Gu : Type u} [NormedAddCommGroup Du] [NormedSpace 𝕜 Du] [NormedAddCommGroup Eu] [NormedSpace 𝕜 Eu] [NormedAddCommGroup Fu] [NormedSpace 𝕜 Fu] [NormedAddCommGroup Gu] [NormedSpace 𝕜 Gu] (B : Eu →L[𝕜] Fu →L[𝕜] Gu) {f : Du → Eu} {g : Du → Fu} {n : ℕ} {s : Set Du} {x : Du} (hf : ContDiffOn 𝕜 n f s) (hg : ContDiffOn 𝕜 n g s) (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) : ‖iteratedFDerivWithin 𝕜 n (fun y => B (f y) (g y)) s x‖ ≤ ‖B‖ * ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * ‖iteratedFDerivWithin 𝕜 i f s x‖ * ‖iteratedFDerivWithin 𝕜 (n - i) g s x‖ := by
/- We argue by induction on `n`. The bound is trivial for `n = 0`. For `n + 1`, we write the `(n+1)`-th derivative as the `n`-th derivative of the derivative `B f g' + B f' g`, and apply the inductive assumption to each of those two terms. For this induction to make sense, the spaces of linear maps that appear in the induction should be in the same universe as the original spaces, which explains why we assume in the lemma that all spaces live in the same universe. -/ induction' n with n IH generalizing Eu Fu Gu · simp only [Nat.zero_eq, norm_iteratedFDerivWithin_zero, zero_add, Finset.range_one, Finset.sum_singleton, Nat.choose_self, Nat.cast_one, one_mul, Nat.sub_zero, ← mul_assoc] apply B.le_opNorm₂ · have In : (n : ℕ∞) + 1 ≤ n.succ := by simp only [Nat.cast_succ, le_refl] -- Porting note: the next line is a hack allowing Lean to find the operator norm instance. let norm := @ContinuousLinearMap.hasOpNorm _ _ Eu ((Du →L[𝕜] Fu) →L[𝕜] Du →L[𝕜] Gu) _ _ _ _ _ _ (RingHom.id 𝕜) have I1 : ‖iteratedFDerivWithin 𝕜 n (fun y : Du => B.precompR Du (f y) (fderivWithin 𝕜 g s y)) s x‖ ≤ ‖B‖ * ∑ i ∈ Finset.range (n + 1), n.choose i * ‖iteratedFDerivWithin 𝕜 i f s x‖ * ‖iteratedFDerivWithin 𝕜 (n + 1 - i) g s x‖ := by calc ‖iteratedFDerivWithin 𝕜 n (fun y : Du => B.precompR Du (f y) (fderivWithin 𝕜 g s y)) s x‖ ≤ ‖B.precompR Du‖ * ∑ i ∈ Finset.range (n + 1), n.choose i * ‖iteratedFDerivWithin 𝕜 i f s x‖ * ‖iteratedFDerivWithin 𝕜 (n - i) (fderivWithin 𝕜 g s) s x‖ := IH _ (hf.of_le (Nat.cast_le.2 (Nat.le_succ n))) (hg.fderivWithin hs In) _ ≤ ‖B‖ * ∑ i ∈ Finset.range (n + 1), n.choose i * ‖iteratedFDerivWithin 𝕜 i f s x‖ * ‖iteratedFDerivWithin 𝕜 (n - i) (fderivWithin 𝕜 g s) s x‖ := mul_le_mul_of_nonneg_right (B.norm_precompR_le Du) (by positivity) _ = _ := by congr 1 apply Finset.sum_congr rfl fun i hi => ?_ rw [Nat.succ_sub (Nat.lt_succ_iff.1 (Finset.mem_range.1 hi)), ← norm_iteratedFDerivWithin_fderivWithin hs hx] -- Porting note: the next line is a hack allowing Lean to find the operator norm instance. let norm := @ContinuousLinearMap.hasOpNorm _ _ (Du →L[𝕜] Eu) (Fu →L[𝕜] Du →L[𝕜] Gu) _ _ _ _ _ _ (RingHom.id 𝕜) have I2 : ‖iteratedFDerivWithin 𝕜 n (fun y : Du => B.precompL Du (fderivWithin 𝕜 f s y) (g y)) s x‖ ≤ ‖B‖ * ∑ i ∈ Finset.range (n + 1), n.choose i * ‖iteratedFDerivWithin 𝕜 (i + 1) f s x‖ * ‖iteratedFDerivWithin 𝕜 (n - i) g s x‖ := calc ‖iteratedFDerivWithin 𝕜 n (fun y : Du => B.precompL Du (fderivWithin 𝕜 f s y) (g y)) s x‖ ≤ ‖B.precompL Du‖ * ∑ i ∈ Finset.range (n + 1), n.choose i * ‖iteratedFDerivWithin 𝕜 i (fderivWithin 𝕜 f s) s x‖ * ‖iteratedFDerivWithin 𝕜 (n - i) g s x‖ := IH _ (hf.fderivWithin hs In) (hg.of_le (Nat.cast_le.2 (Nat.le_succ n))) _ ≤ ‖B‖ * ∑ i ∈ Finset.range (n + 1), n.choose i * ‖iteratedFDerivWithin 𝕜 i (fderivWithin 𝕜 f s) s x‖ * ‖iteratedFDerivWithin 𝕜 (n - i) g s x‖ := mul_le_mul_of_nonneg_right (B.norm_precompL_le Du) (by positivity) _ = _ := by congr 1 apply Finset.sum_congr rfl fun i _ => ?_ rw [← norm_iteratedFDerivWithin_fderivWithin hs hx] have J : iteratedFDerivWithin 𝕜 n (fun y : Du => fderivWithin 𝕜 (fun y : Du => B (f y) (g y)) s y) s x = iteratedFDerivWithin 𝕜 n (fun y => B.precompR Du (f y) (fderivWithin 𝕜 g s y) + B.precompL Du (fderivWithin 𝕜 f s y) (g y)) s x := by apply iteratedFDerivWithin_congr (fun y hy => ?_) hx have L : (1 : ℕ∞) ≤ n.succ := by simpa only [ENat.coe_one, Nat.one_le_cast] using Nat.succ_pos n exact B.fderivWithin_of_bilinear (hf.differentiableOn L y hy) (hg.differentiableOn L y hy) (hs y hy) rw [← norm_iteratedFDerivWithin_fderivWithin hs hx, J] have A : ContDiffOn 𝕜 n (fun y => B.precompR Du (f y) (fderivWithin 𝕜 g s y)) s := (B.precompR Du).isBoundedBilinearMap.contDiff.comp_contDiff_on₂ (hf.of_le (Nat.cast_le.2 (Nat.le_succ n))) (hg.fderivWithin hs In) have A' : ContDiffOn 𝕜 n (fun y => B.precompL Du (fderivWithin 𝕜 f s y) (g y)) s := (B.precompL Du).isBoundedBilinearMap.contDiff.comp_contDiff_on₂ (hf.fderivWithin hs In) (hg.of_le (Nat.cast_le.2 (Nat.le_succ n))) rw [iteratedFDerivWithin_add_apply' A A' hs hx] apply (norm_add_le _ _).trans ((add_le_add I1 I2).trans (le_of_eq ?_)) simp_rw [← mul_add, mul_assoc] congr 1 exact (Finset.sum_choose_succ_mul (fun i j => ‖iteratedFDerivWithin 𝕜 i f s x‖ * ‖iteratedFDerivWithin 𝕜 j g s x‖) n).symm
import Mathlib.Data.Finset.Sigma import Mathlib.Data.Finset.Pairwise import Mathlib.Data.Finset.Powerset import Mathlib.Data.Fintype.Basic import Mathlib.Order.CompleteLatticeIntervals #align_import order.sup_indep from "leanprover-community/mathlib"@"c4c2ed622f43768eff32608d4a0f8a6cec1c047d" variable {α β ι ι' : Type*} namespace Finset section Lattice variable [Lattice α] [OrderBot α] def SupIndep (s : Finset ι) (f : ι → α) : Prop := ∀ ⦃t⦄, t ⊆ s → ∀ ⦃i⦄, i ∈ s → i ∉ t → Disjoint (f i) (t.sup f) #align finset.sup_indep Finset.SupIndep variable {s t : Finset ι} {f : ι → α} {i : ι} instance [DecidableEq ι] [DecidableEq α] : Decidable (SupIndep s f) := by refine @Finset.decidableForallOfDecidableSubsets _ _ _ (?_) rintro t - refine @Finset.decidableDforallFinset _ _ _ (?_) rintro i - have : Decidable (Disjoint (f i) (sup t f)) := decidable_of_iff' (_ = ⊥) disjoint_iff infer_instance theorem SupIndep.subset (ht : t.SupIndep f) (h : s ⊆ t) : s.SupIndep f := fun _ hu _ hi => ht (hu.trans h) (h hi) #align finset.sup_indep.subset Finset.SupIndep.subset @[simp] theorem supIndep_empty (f : ι → α) : (∅ : Finset ι).SupIndep f := fun _ _ a ha => (not_mem_empty a ha).elim #align finset.sup_indep_empty Finset.supIndep_empty theorem supIndep_singleton (i : ι) (f : ι → α) : ({i} : Finset ι).SupIndep f := fun s hs j hji hj => by rw [eq_empty_of_ssubset_singleton ⟨hs, fun h => hj (h hji)⟩, sup_empty] exact disjoint_bot_right #align finset.sup_indep_singleton Finset.supIndep_singleton theorem SupIndep.pairwiseDisjoint (hs : s.SupIndep f) : (s : Set ι).PairwiseDisjoint f := fun _ ha _ hb hab => sup_singleton.subst <| hs (singleton_subset_iff.2 hb) ha <| not_mem_singleton.2 hab #align finset.sup_indep.pairwise_disjoint Finset.SupIndep.pairwiseDisjoint
Mathlib/Order/SupIndep.lean
92
96
theorem SupIndep.le_sup_iff (hs : s.SupIndep f) (hts : t ⊆ s) (hi : i ∈ s) (hf : ∀ i, f i ≠ ⊥) : f i ≤ t.sup f ↔ i ∈ t := by
refine ⟨fun h => ?_, le_sup⟩ by_contra hit exact hf i (disjoint_self.1 <| (hs hts hi hit).mono_right h)
import Mathlib.Algebra.Order.Monoid.OrderDual import Mathlib.Tactic.Lift import Mathlib.Tactic.Monotonicity.Attr open Function variable {β G M : Type*} section Monoid variable [Monoid M] section Preorder variable [Preorder M] section Left variable [CovariantClass M M (· * ·) (· ≤ ·)] {x : M} @[to_additive (attr := mono, gcongr) nsmul_le_nsmul_right] theorem pow_le_pow_left' [CovariantClass M M (swap (· * ·)) (· ≤ ·)] {a b : M} (hab : a ≤ b) : ∀ i : ℕ, a ^ i ≤ b ^ i | 0 => by simp | k + 1 => by rw [pow_succ, pow_succ] exact mul_le_mul' (pow_le_pow_left' hab k) hab #align pow_le_pow_of_le_left' pow_le_pow_left' #align nsmul_le_nsmul_of_le_right nsmul_le_nsmul_right @[to_additive nsmul_nonneg] theorem one_le_pow_of_one_le' {a : M} (H : 1 ≤ a) : ∀ n : ℕ, 1 ≤ a ^ n | 0 => by simp | k + 1 => by rw [pow_succ] exact one_le_mul (one_le_pow_of_one_le' H k) H #align one_le_pow_of_one_le' one_le_pow_of_one_le' #align nsmul_nonneg nsmul_nonneg @[to_additive nsmul_nonpos] theorem pow_le_one' {a : M} (H : a ≤ 1) (n : ℕ) : a ^ n ≤ 1 := @one_le_pow_of_one_le' Mᵒᵈ _ _ _ _ H n #align pow_le_one' pow_le_one' #align nsmul_nonpos nsmul_nonpos @[to_additive (attr := gcongr) nsmul_le_nsmul_left] theorem pow_le_pow_right' {a : M} {n m : ℕ} (ha : 1 ≤ a) (h : n ≤ m) : a ^ n ≤ a ^ m := let ⟨k, hk⟩ := Nat.le.dest h calc a ^ n ≤ a ^ n * a ^ k := le_mul_of_one_le_right' (one_le_pow_of_one_le' ha _) _ = a ^ m := by rw [← hk, pow_add] #align pow_le_pow' pow_le_pow_right' #align nsmul_le_nsmul nsmul_le_nsmul_left @[to_additive nsmul_le_nsmul_left_of_nonpos] theorem pow_le_pow_right_of_le_one' {a : M} {n m : ℕ} (ha : a ≤ 1) (h : n ≤ m) : a ^ m ≤ a ^ n := pow_le_pow_right' (M := Mᵒᵈ) ha h #align pow_le_pow_of_le_one' pow_le_pow_right_of_le_one' #align nsmul_le_nsmul_of_nonpos nsmul_le_nsmul_left_of_nonpos @[to_additive nsmul_pos]
Mathlib/Algebra/Order/Monoid/Unbundled/Pow.lean
71
77
theorem one_lt_pow' {a : M} (ha : 1 < a) {k : ℕ} (hk : k ≠ 0) : 1 < a ^ k := by
rcases Nat.exists_eq_succ_of_ne_zero hk with ⟨l, rfl⟩ clear hk induction' l with l IH · rw [pow_succ]; simpa using ha · rw [pow_succ] exact one_lt_mul'' IH ha
import Mathlib.Algebra.Polynomial.Basic #align_import data.polynomial.monomial from "leanprover-community/mathlib"@"220f71ba506c8958c9b41bd82226b3d06b0991e8" noncomputable section namespace Polynomial open Polynomial universe u variable {R : Type u} {a b : R} {m n : ℕ} variable [Semiring R] {p q r : R[X]} theorem monomial_one_eq_iff [Nontrivial R] {i j : ℕ} : (monomial i 1 : R[X]) = monomial j 1 ↔ i = j := by -- Porting note: `ofFinsupp.injEq` is required. simp_rw [← ofFinsupp_single, ofFinsupp.injEq] exact AddMonoidAlgebra.of_injective.eq_iff #align polynomial.monomial_one_eq_iff Polynomial.monomial_one_eq_iff instance infinite [Nontrivial R] : Infinite R[X] := Infinite.of_injective (fun i => monomial i 1) fun m n h => by simpa [monomial_one_eq_iff] using h #align polynomial.infinite Polynomial.infinite
Mathlib/Algebra/Polynomial/Monomial.lean
39
56
theorem card_support_le_one_iff_monomial {f : R[X]} : Finset.card f.support ≤ 1 ↔ ∃ n a, f = monomial n a := by
constructor · intro H rw [Finset.card_le_one_iff_subset_singleton] at H rcases H with ⟨n, hn⟩ refine ⟨n, f.coeff n, ?_⟩ ext i by_cases hi : i = n · simp [hi, coeff_monomial] · have : f.coeff i = 0 := by rw [← not_mem_support_iff] exact fun hi' => hi (Finset.mem_singleton.1 (hn hi')) simp [this, Ne.symm hi, coeff_monomial] · rintro ⟨n, a, rfl⟩ rw [← Finset.card_singleton n] apply Finset.card_le_card exact support_monomial' _ _
import Mathlib.Algebra.Group.Conj import Mathlib.Algebra.Group.Pi.Lemmas import Mathlib.Algebra.Group.Subsemigroup.Operations import Mathlib.Algebra.Group.Submonoid.Operations import Mathlib.Algebra.Order.Group.Abs import Mathlib.Data.Set.Image import Mathlib.Order.Atoms import Mathlib.Tactic.ApplyFun #align_import group_theory.subgroup.basic from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef" open Function open Int variable {G G' G'' : Type*} [Group G] [Group G'] [Group G''] variable {A : Type*} [AddGroup A] section SubgroupClass class InvMemClass (S G : Type*) [Inv G] [SetLike S G] : Prop where inv_mem : ∀ {s : S} {x}, x ∈ s → x⁻¹ ∈ s #align inv_mem_class InvMemClass export InvMemClass (inv_mem) class NegMemClass (S G : Type*) [Neg G] [SetLike S G] : Prop where neg_mem : ∀ {s : S} {x}, x ∈ s → -x ∈ s #align neg_mem_class NegMemClass export NegMemClass (neg_mem) class SubgroupClass (S G : Type*) [DivInvMonoid G] [SetLike S G] extends SubmonoidClass S G, InvMemClass S G : Prop #align subgroup_class SubgroupClass class AddSubgroupClass (S G : Type*) [SubNegMonoid G] [SetLike S G] extends AddSubmonoidClass S G, NegMemClass S G : Prop #align add_subgroup_class AddSubgroupClass attribute [to_additive] InvMemClass SubgroupClass attribute [aesop safe apply (rule_sets := [SetLike])] inv_mem neg_mem @[to_additive (attr := simp)] theorem inv_mem_iff {S G} [InvolutiveInv G] {_ : SetLike S G} [InvMemClass S G] {H : S} {x : G} : x⁻¹ ∈ H ↔ x ∈ H := ⟨fun h => inv_inv x ▸ inv_mem h, inv_mem⟩ #align inv_mem_iff inv_mem_iff #align neg_mem_iff neg_mem_iff @[simp] theorem abs_mem_iff {S G} [AddGroup G] [LinearOrder G] {_ : SetLike S G} [NegMemClass S G] {H : S} {x : G} : |x| ∈ H ↔ x ∈ H := by cases abs_choice x <;> simp [*] variable {M S : Type*} [DivInvMonoid M] [SetLike S M] [hSM : SubgroupClass S M] {H K : S} @[to_additive (attr := aesop safe apply (rule_sets := [SetLike])) "An additive subgroup is closed under subtraction."]
Mathlib/Algebra/Group/Subgroup/Basic.lean
144
145
theorem div_mem {x y : M} (hx : x ∈ H) (hy : y ∈ H) : x / y ∈ H := by
rw [div_eq_mul_inv]; exact mul_mem hx (inv_mem hy)
import Mathlib.SetTheory.Ordinal.Arithmetic import Mathlib.Tactic.Abel #align_import set_theory.ordinal.natural_ops from "leanprover-community/mathlib"@"31b269b60935483943542d547a6dd83a66b37dc7" set_option autoImplicit true universe u v open Function Order noncomputable section def NatOrdinal : Type _ := -- Porting note: used to derive LinearOrder & SuccOrder but need to manually define Ordinal deriving Zero, Inhabited, One, WellFoundedRelation #align nat_ordinal NatOrdinal instance NatOrdinal.linearOrder : LinearOrder NatOrdinal := {Ordinal.linearOrder with} instance NatOrdinal.succOrder : SuccOrder NatOrdinal := {Ordinal.succOrder with} @[match_pattern] def Ordinal.toNatOrdinal : Ordinal ≃o NatOrdinal := OrderIso.refl _ #align ordinal.to_nat_ordinal Ordinal.toNatOrdinal @[match_pattern] def NatOrdinal.toOrdinal : NatOrdinal ≃o Ordinal := OrderIso.refl _ #align nat_ordinal.to_ordinal NatOrdinal.toOrdinal namespace Ordinal variable {a b c : Ordinal.{u}} @[simp] theorem toNatOrdinal_symm_eq : toNatOrdinal.symm = NatOrdinal.toOrdinal := rfl #align ordinal.to_nat_ordinal_symm_eq Ordinal.toNatOrdinal_symm_eq @[simp] theorem toNatOrdinal_toOrdinal (a : Ordinal) : NatOrdinal.toOrdinal (toNatOrdinal a) = a := rfl #align ordinal.to_nat_ordinal_to_ordinal Ordinal.toNatOrdinal_toOrdinal @[simp] theorem toNatOrdinal_zero : toNatOrdinal 0 = 0 := rfl #align ordinal.to_nat_ordinal_zero Ordinal.toNatOrdinal_zero @[simp] theorem toNatOrdinal_one : toNatOrdinal 1 = 1 := rfl #align ordinal.to_nat_ordinal_one Ordinal.toNatOrdinal_one @[simp] theorem toNatOrdinal_eq_zero (a) : toNatOrdinal a = 0 ↔ a = 0 := Iff.rfl #align ordinal.to_nat_ordinal_eq_zero Ordinal.toNatOrdinal_eq_zero @[simp] theorem toNatOrdinal_eq_one (a) : toNatOrdinal a = 1 ↔ a = 1 := Iff.rfl #align ordinal.to_nat_ordinal_eq_one Ordinal.toNatOrdinal_eq_one @[simp] theorem toNatOrdinal_max (a b : Ordinal) : toNatOrdinal (max a b) = max (toNatOrdinal a) (toNatOrdinal b) := rfl #align ordinal.to_nat_ordinal_max Ordinal.toNatOrdinal_max @[simp] theorem toNatOrdinal_min (a b : Ordinal) : toNatOrdinal (linearOrder.min a b) = linearOrder.min (toNatOrdinal a) (toNatOrdinal b) := rfl #align ordinal.to_nat_ordinal_min Ordinal.toNatOrdinal_min noncomputable def nadd : Ordinal → Ordinal → Ordinal | a, b => max (blsub.{u, u} a fun a' _ => nadd a' b) (blsub.{u, u} b fun b' _ => nadd a b') termination_by o₁ o₂ => (o₁, o₂) #align ordinal.nadd Ordinal.nadd @[inherit_doc] scoped[NaturalOps] infixl:65 " ♯ " => Ordinal.nadd open NaturalOps noncomputable def nmul : Ordinal.{u} → Ordinal.{u} → Ordinal.{u} | a, b => sInf {c | ∀ a' < a, ∀ b' < b, nmul a' b ♯ nmul a b' < c ♯ nmul a' b'} termination_by a b => (a, b) #align ordinal.nmul Ordinal.nmul @[inherit_doc] scoped[NaturalOps] infixl:70 " ⨳ " => Ordinal.nmul theorem nadd_def (a b : Ordinal) : a ♯ b = max (blsub.{u, u} a fun a' _ => a' ♯ b) (blsub.{u, u} b fun b' _ => a ♯ b') := by rw [nadd] #align ordinal.nadd_def Ordinal.nadd_def theorem lt_nadd_iff : a < b ♯ c ↔ (∃ b' < b, a ≤ b' ♯ c) ∨ ∃ c' < c, a ≤ b ♯ c' := by rw [nadd_def] simp [lt_blsub_iff] #align ordinal.lt_nadd_iff Ordinal.lt_nadd_iff theorem nadd_le_iff : b ♯ c ≤ a ↔ (∀ b' < b, b' ♯ c < a) ∧ ∀ c' < c, b ♯ c' < a := by rw [nadd_def] simp [blsub_le_iff] #align ordinal.nadd_le_iff Ordinal.nadd_le_iff theorem nadd_lt_nadd_left (h : b < c) (a) : a ♯ b < a ♯ c := lt_nadd_iff.2 (Or.inr ⟨b, h, le_rfl⟩) #align ordinal.nadd_lt_nadd_left Ordinal.nadd_lt_nadd_left theorem nadd_lt_nadd_right (h : b < c) (a) : b ♯ a < c ♯ a := lt_nadd_iff.2 (Or.inl ⟨b, h, le_rfl⟩) #align ordinal.nadd_lt_nadd_right Ordinal.nadd_lt_nadd_right
Mathlib/SetTheory/Ordinal/NaturalOps.lean
255
258
theorem nadd_le_nadd_left (h : b ≤ c) (a) : a ♯ b ≤ a ♯ c := by
rcases lt_or_eq_of_le h with (h | rfl) · exact (nadd_lt_nadd_left h a).le · exact le_rfl
import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm import Mathlib.Analysis.NormedSpace.Span suppress_compilation open Bornology open Filter hiding map_smul open scoped Classical NNReal Topology Uniformity -- the `ₗ` subscript variables are for special cases about linear (as opposed to semilinear) maps variable {𝕜 𝕜₂ 𝕜₃ E Eₗ F Fₗ G Gₗ 𝓕 : Type*} section Normed variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G] [NormedAddCommGroup Fₗ] open Metric ContinuousLinearMap section variable [NontriviallyNormedField 𝕜] [NontriviallyNormedField 𝕜₂] [NontriviallyNormedField 𝕜₃] [NormedSpace 𝕜 E] [NormedSpace 𝕜₂ F] [NormedSpace 𝕜₃ G] [NormedSpace 𝕜 Fₗ] (c : 𝕜) {σ₁₂ : 𝕜 →+* 𝕜₂} {σ₂₃ : 𝕜₂ →+* 𝕜₃} (f g : E →SL[σ₁₂] F) (x y z : E) namespace ContinuousLinearMap section OpNorm open Set Real
Mathlib/Analysis/NormedSpace/OperatorNorm/NormedSpace.lean
99
107
theorem opNorm_zero_iff [RingHomIsometric σ₁₂] : ‖f‖ = 0 ↔ f = 0 := Iff.intro (fun hn => ContinuousLinearMap.ext fun x => norm_le_zero_iff.1 (calc _ ≤ ‖f‖ * ‖x‖ := le_opNorm _ _ _ = _ := by
rw [hn, zero_mul])) (by rintro rfl exact opNorm_zero)
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
Mathlib/Topology/Category/TopCat/Limits/Konig.lean
107
124
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
import Mathlib.Algebra.Polynomial.Mirror import Mathlib.Analysis.Complex.Polynomial #align_import data.polynomial.unit_trinomial from "leanprover-community/mathlib"@"302eab4f46abb63de520828de78c04cb0f9b5836" namespace Polynomial open scoped Polynomial open Finset section Semiring variable {R : Type*} [Semiring R] (k m n : ℕ) (u v w : R) noncomputable def trinomial := C u * X ^ k + C v * X ^ m + C w * X ^ n #align polynomial.trinomial Polynomial.trinomial theorem trinomial_def : trinomial k m n u v w = C u * X ^ k + C v * X ^ m + C w * X ^ n := rfl #align polynomial.trinomial_def Polynomial.trinomial_def variable {k m n u v w} theorem trinomial_leading_coeff' (hkm : k < m) (hmn : m < n) : (trinomial k m n u v w).coeff n = w := by rw [trinomial_def, coeff_add, coeff_add, coeff_C_mul_X_pow, coeff_C_mul_X_pow, coeff_C_mul_X_pow, if_neg (hkm.trans hmn).ne', if_neg hmn.ne', if_pos rfl, zero_add, zero_add] #align polynomial.trinomial_leading_coeff' Polynomial.trinomial_leading_coeff' theorem trinomial_middle_coeff (hkm : k < m) (hmn : m < n) : (trinomial k m n u v w).coeff m = v := by rw [trinomial_def, coeff_add, coeff_add, coeff_C_mul_X_pow, coeff_C_mul_X_pow, coeff_C_mul_X_pow, if_neg hkm.ne', if_pos rfl, if_neg hmn.ne, zero_add, add_zero] #align polynomial.trinomial_middle_coeff Polynomial.trinomial_middle_coeff theorem trinomial_trailing_coeff' (hkm : k < m) (hmn : m < n) : (trinomial k m n u v w).coeff k = u := by rw [trinomial_def, coeff_add, coeff_add, coeff_C_mul_X_pow, coeff_C_mul_X_pow, coeff_C_mul_X_pow, if_pos rfl, if_neg hkm.ne, if_neg (hkm.trans hmn).ne, add_zero, add_zero] #align polynomial.trinomial_trailing_coeff' Polynomial.trinomial_trailing_coeff' theorem trinomial_natDegree (hkm : k < m) (hmn : m < n) (hw : w ≠ 0) : (trinomial k m n u v w).natDegree = n := by refine natDegree_eq_of_degree_eq_some ((Finset.sup_le fun i h => ?_).antisymm <| le_degree_of_ne_zero <| by rwa [trinomial_leading_coeff' hkm hmn]) replace h := support_trinomial' k m n u v w h rw [mem_insert, mem_insert, mem_singleton] at h rcases h with (rfl | rfl | rfl) · exact WithBot.coe_le_coe.mpr (hkm.trans hmn).le · exact WithBot.coe_le_coe.mpr hmn.le · exact le_rfl #align polynomial.trinomial_nat_degree Polynomial.trinomial_natDegree theorem trinomial_natTrailingDegree (hkm : k < m) (hmn : m < n) (hu : u ≠ 0) : (trinomial k m n u v w).natTrailingDegree = k := by refine natTrailingDegree_eq_of_trailingDegree_eq_some ((Finset.le_inf fun i h => ?_).antisymm <| trailingDegree_le_of_ne_zero <| by rwa [trinomial_trailing_coeff' hkm hmn]).symm replace h := support_trinomial' k m n u v w h rw [mem_insert, mem_insert, mem_singleton] at h rcases h with (rfl | rfl | rfl) · exact le_rfl · exact WithTop.coe_le_coe.mpr hkm.le · exact WithTop.coe_le_coe.mpr (hkm.trans hmn).le #align polynomial.trinomial_nat_trailing_degree Polynomial.trinomial_natTrailingDegree theorem trinomial_leadingCoeff (hkm : k < m) (hmn : m < n) (hw : w ≠ 0) : (trinomial k m n u v w).leadingCoeff = w := by rw [leadingCoeff, trinomial_natDegree hkm hmn hw, trinomial_leading_coeff' hkm hmn] #align polynomial.trinomial_leading_coeff Polynomial.trinomial_leadingCoeff
Mathlib/Algebra/Polynomial/UnitTrinomial.lean
100
102
theorem trinomial_trailingCoeff (hkm : k < m) (hmn : m < n) (hu : u ≠ 0) : (trinomial k m n u v w).trailingCoeff = u := by
rw [trailingCoeff, trinomial_natTrailingDegree hkm hmn hu, trinomial_trailing_coeff' hkm hmn]
import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv #align_import linear_algebra.quadratic_form.prod from "leanprover-community/mathlib"@"9b2755b951bc323c962bd072cd447b375cf58101" universe u v w variable {ι : Type*} {R : Type*} {M₁ M₂ N₁ N₂ : Type*} {Mᵢ Nᵢ : ι → Type*} namespace QuadraticForm section Prod section Pi section Semiring variable [CommSemiring R] variable [∀ i, AddCommMonoid (Mᵢ i)] [∀ i, AddCommMonoid (Nᵢ i)] variable [∀ i, Module R (Mᵢ i)] [∀ i, Module R (Nᵢ i)] def pi [Fintype ι] (Q : ∀ i, QuadraticForm R (Mᵢ i)) : QuadraticForm R (∀ i, Mᵢ i) := ∑ i, (Q i).comp (LinearMap.proj i : _ →ₗ[R] Mᵢ i) #align quadratic_form.pi QuadraticForm.pi @[simp] theorem pi_apply [Fintype ι] (Q : ∀ i, QuadraticForm R (Mᵢ i)) (x : ∀ i, Mᵢ i) : pi Q x = ∑ i, Q i (x i) := sum_apply _ _ _ #align quadratic_form.pi_apply QuadraticForm.pi_apply theorem pi_apply_single [Fintype ι] [DecidableEq ι] (Q : ∀ i, QuadraticForm R (Mᵢ i)) (i : ι) (m : Mᵢ i) : pi Q (Pi.single i m) = Q i m := by rw [pi_apply, Fintype.sum_eq_single i fun j hj => ?_, Pi.single_eq_same] rw [Pi.single_eq_of_ne hj, map_zero] @[simps toLinearEquiv] def IsometryEquiv.pi [Fintype ι] {Q : ∀ i, QuadraticForm R (Mᵢ i)} {Q' : ∀ i, QuadraticForm R (Nᵢ i)} (e : ∀ i, (Q i).IsometryEquiv (Q' i)) : (pi Q).IsometryEquiv (pi Q') where map_app' x := by simp only [pi_apply, LinearEquiv.piCongrRight, LinearEquiv.toFun_eq_coe, IsometryEquiv.coe_toLinearEquiv, IsometryEquiv.map_app] toLinearEquiv := LinearEquiv.piCongrRight fun i => (e i : Mᵢ i ≃ₗ[R] Nᵢ i) #align quadratic_form.isometry.pi QuadraticForm.IsometryEquiv.pi @[simps!] def Isometry.single [Fintype ι] [DecidableEq ι] (Q : ∀ i, QuadraticForm R (Mᵢ i)) (i : ι) : Q i →qᵢ pi Q where toLinearMap := LinearMap.single i map_app' := pi_apply_single _ _ @[simps!] def Isometry.proj [Fintype ι] [DecidableEq ι] (i : ι) (Q : QuadraticForm R (Mᵢ i)) : pi (Pi.single i Q) →qᵢ Q where toLinearMap := LinearMap.proj i map_app' m := by dsimp rw [pi_apply, Fintype.sum_eq_single i (fun j hij => ?_), Pi.single_eq_same] rw [Pi.single_eq_of_ne hij, zero_apply] @[simp, nolint simpNF] -- ignore the bogus "Left-hand side does not simplify" lint error theorem Isometry.proj_comp_single_of_same [Fintype ι] [DecidableEq ι] (i : ι) (Q : QuadraticForm R (Mᵢ i)) : (proj i Q).comp (single _ i) = .ofEq (Pi.single_eq_same _ _) := ext fun _ => Pi.single_eq_same _ _ @[simp] theorem Isometry.proj_comp_single_of_ne [Fintype ι] [DecidableEq ι] {i j : ι} (h : i ≠ j) (Q : QuadraticForm R (Mᵢ i)) : (proj i Q).comp (single _ j) = (0 : 0 →qᵢ Q).comp (ofEq (Pi.single_eq_of_ne h.symm _)) := ext fun _ => Pi.single_eq_of_ne h _ theorem Equivalent.pi [Fintype ι] {Q : ∀ i, QuadraticForm R (Mᵢ i)} {Q' : ∀ i, QuadraticForm R (Nᵢ i)} (e : ∀ i, (Q i).Equivalent (Q' i)) : (pi Q).Equivalent (pi Q') := ⟨IsometryEquiv.pi fun i => Classical.choice (e i)⟩ #align quadratic_form.equivalent.pi QuadraticForm.Equivalent.pi theorem anisotropic_of_pi [Fintype ι] {R} [OrderedCommRing R] [∀ i, Module R (Mᵢ i)] {Q : ∀ i, QuadraticForm R (Mᵢ i)} (h : (pi Q).Anisotropic) : ∀ i, (Q i).Anisotropic := by simp_rw [Anisotropic, pi_apply, Function.funext_iff, Pi.zero_apply] at h intro i x hx classical have := h (Pi.single i x) ?_ i · rw [Pi.single_eq_same] at this exact this apply Finset.sum_eq_zero intro j _ by_cases hji : j = i · subst hji; rw [Pi.single_eq_same, hx] · rw [Pi.single_eq_of_ne hji, map_zero] #align quadratic_form.anisotropic_of_pi QuadraticForm.anisotropic_of_pi
Mathlib/LinearAlgebra/QuadraticForm/Prod.lean
328
339
theorem nonneg_pi_iff [Fintype ι] {R} [OrderedCommRing R] [∀ i, Module R (Mᵢ i)] {Q : ∀ i, QuadraticForm R (Mᵢ i)} : (∀ x, 0 ≤ pi Q x) ↔ ∀ i x, 0 ≤ Q i x := by
simp_rw [pi, sum_apply, comp_apply, LinearMap.proj_apply] constructor -- TODO: does this generalize to a useful lemma independent of `QuadraticForm`? · intro h i x classical convert h (Pi.single i x) using 1 rw [Finset.sum_eq_single_of_mem i (Finset.mem_univ _) fun j _ hji => ?_, Pi.single_eq_same] rw [Pi.single_eq_of_ne hji, map_zero] · rintro h x exact Finset.sum_nonneg fun i _ => h i (x i)
import Mathlib.Analysis.Calculus.FDeriv.Linear import Mathlib.Analysis.Calculus.FDeriv.Comp #align_import analysis.calculus.fderiv.add 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} section Sum variable {ι : Type*} {u : Finset ι} {A : ι → E → F} {A' : ι → E →L[𝕜] F} @[fun_prop] theorem HasStrictFDerivAt.sum (h : ∀ i ∈ u, HasStrictFDerivAt (A i) (A' i) x) : HasStrictFDerivAt (fun y => ∑ i ∈ u, A i y) (∑ i ∈ u, A' i) x := by dsimp [HasStrictFDerivAt] at * convert IsLittleO.sum h simp [Finset.sum_sub_distrib, ContinuousLinearMap.sum_apply] #align has_strict_fderiv_at.sum HasStrictFDerivAt.sum
Mathlib/Analysis/Calculus/FDeriv/Add.lean
353
357
theorem HasFDerivAtFilter.sum (h : ∀ i ∈ u, HasFDerivAtFilter (A i) (A' i) x L) : HasFDerivAtFilter (fun y => ∑ i ∈ u, A i y) (∑ i ∈ u, A' i) x L := by
simp only [hasFDerivAtFilter_iff_isLittleO] at * convert IsLittleO.sum h simp [ContinuousLinearMap.sum_apply]
import Mathlib.Geometry.Manifold.Sheaf.Smooth import Mathlib.Geometry.RingedSpace.LocallyRingedSpace noncomputable section universe u variable {𝕜 : Type u} [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] {EM : Type*} [NormedAddCommGroup EM] [NormedSpace 𝕜 EM] {HM : Type*} [TopologicalSpace HM] (IM : ModelWithCorners 𝕜 EM HM) {M : Type u} [TopologicalSpace M] [ChartedSpace HM M] open AlgebraicGeometry Manifold TopologicalSpace Topology
Mathlib/Geometry/Manifold/Sheaf/LocallyRingedSpace.lean
43
98
theorem smoothSheafCommRing.isUnit_stalk_iff {x : M} (f : (smoothSheafCommRing IM 𝓘(𝕜) M 𝕜).presheaf.stalk x) : IsUnit f ↔ f ∉ RingHom.ker (smoothSheafCommRing.eval IM 𝓘(𝕜) M 𝕜 x) := by
constructor · rintro ⟨⟨f, g, hf, hg⟩, rfl⟩ (h' : smoothSheafCommRing.eval IM 𝓘(𝕜) M 𝕜 x f = 0) simpa [h'] using congr_arg (smoothSheafCommRing.eval IM 𝓘(𝕜) M 𝕜 x) hf · let S := (smoothSheafCommRing IM 𝓘(𝕜) M 𝕜).presheaf -- Suppose that `f`, in the stalk at `x`, is nonzero at `x` rintro (hf : _ ≠ 0) -- Represent `f` as the germ of some function (also called `f`) on an open neighbourhood `U` of -- `x`, which is nonzero at `x` obtain ⟨U : Opens M, hxU, f : C^∞⟮IM, U; 𝓘(𝕜), 𝕜⟯, rfl⟩ := S.germ_exist x f have hf' : f ⟨x, hxU⟩ ≠ 0 := by convert hf exact (smoothSheafCommRing.eval_germ U ⟨x, hxU⟩ f).symm -- In fact, by continuity, `f` is nonzero on a neighbourhood `V` of `x` have H : ∀ᶠ (z : U) in 𝓝 ⟨x, hxU⟩, f z ≠ 0 := f.2.continuous.continuousAt.eventually_ne hf' rw [eventually_nhds_iff] at H obtain ⟨V₀, hV₀f, hV₀, hxV₀⟩ := H let V : Opens M := ⟨Subtype.val '' V₀, U.2.isOpenMap_subtype_val V₀ hV₀⟩ have hUV : V ≤ U := Subtype.coe_image_subset (U : Set M) V₀ have hV : V₀ = Set.range (Set.inclusion hUV) := by convert (Set.range_inclusion hUV).symm ext y show _ ↔ y ∈ Subtype.val ⁻¹' (Subtype.val '' V₀) rw [Set.preimage_image_eq _ Subtype.coe_injective] clear_value V subst hV have hxV : x ∈ (V : Set M) := by obtain ⟨x₀, hxx₀⟩ := hxV₀ convert x₀.2 exact congr_arg Subtype.val hxx₀.symm have hVf : ∀ y : V, f (Set.inclusion hUV y) ≠ 0 := fun y ↦ hV₀f (Set.inclusion hUV y) (Set.mem_range_self y) -- Let `g` be the pointwise inverse of `f` on `V`, which is smooth since `f` is nonzero there let g : C^∞⟮IM, V; 𝓘(𝕜), 𝕜⟯ := ⟨(f ∘ Set.inclusion hUV)⁻¹, ?_⟩ -- The germ of `g` is inverse to the germ of `f`, so `f` is a unit · refine ⟨⟨S.germ ⟨x, hxV⟩ (SmoothMap.restrictRingHom IM 𝓘(𝕜) 𝕜 hUV f), S.germ ⟨x, hxV⟩ g, ?_, ?_⟩, S.germ_res_apply hUV.hom ⟨x, hxV⟩ f⟩ · rw [← map_mul] -- Qualified the name to avoid Lean not finding a `OneHomClass` #8386 convert RingHom.map_one _ apply Subtype.ext ext y apply mul_inv_cancel exact hVf y · rw [← map_mul] -- Qualified the name to avoid Lean not finding a `OneHomClass` #8386 convert RingHom.map_one _ apply Subtype.ext ext y apply inv_mul_cancel exact hVf y · intro y exact ((contDiffAt_inv _ (hVf y)).contMDiffAt).comp y (f.smooth.comp (smooth_inclusion hUV)).smoothAt
import Mathlib.Algebra.Order.ToIntervalMod import Mathlib.Algebra.Ring.AddAut import Mathlib.Data.Nat.Totient import Mathlib.GroupTheory.Divisible import Mathlib.Topology.Connected.PathConnected import Mathlib.Topology.IsLocalHomeomorph #align_import topology.instances.add_circle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" noncomputable section open AddCommGroup Set Function AddSubgroup TopologicalSpace open Topology variable {𝕜 B : Type*} section Continuity variable [LinearOrderedAddCommGroup 𝕜] [Archimedean 𝕜] [TopologicalSpace 𝕜] [OrderTopology 𝕜] {p : 𝕜} (hp : 0 < p) (a x : 𝕜)
Mathlib/Topology/Instances/AddCircle.lean
64
79
theorem continuous_right_toIcoMod : ContinuousWithinAt (toIcoMod hp a) (Ici x) x := by
intro s h rw [Filter.mem_map, mem_nhdsWithin_iff_exists_mem_nhds_inter] haveI : Nontrivial 𝕜 := ⟨⟨0, p, hp.ne⟩⟩ simp_rw [mem_nhds_iff_exists_Ioo_subset] at h ⊢ obtain ⟨l, u, hxI, hIs⟩ := h let d := toIcoDiv hp a x • p have hd := toIcoMod_mem_Ico hp a x simp_rw [subset_def, mem_inter_iff] refine ⟨_, ⟨l + d, min (a + p) u + d, ?_, fun x => id⟩, fun y => ?_⟩ <;> simp_rw [← sub_mem_Ioo_iff_left, mem_Ioo, lt_min_iff] · exact ⟨hxI.1, hd.2, hxI.2⟩ · rintro ⟨h, h'⟩ apply hIs rw [← toIcoMod_sub_zsmul, (toIcoMod_eq_self _).2] exacts [⟨h.1, h.2.2⟩, ⟨hd.1.trans (sub_le_sub_right h' _), h.2.1⟩]
import Mathlib.Algebra.GroupWithZero.Units.Lemmas import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Data.Fintype.BigOperators #align_import data.sign from "leanprover-community/mathlib"@"2445c98ae4b87eabebdde552593519b9b6dc350c" -- Porting note (#11081): cannot automatically derive Fintype, added manually inductive SignType | zero | neg | pos deriving DecidableEq, Inhabited #align sign_type SignType -- Porting note: these lemmas are autogenerated by the inductive definition and are not -- in simple form due to the below `x_eq_x` lemmas attribute [nolint simpNF] SignType.zero.sizeOf_spec attribute [nolint simpNF] SignType.neg.sizeOf_spec attribute [nolint simpNF] SignType.pos.sizeOf_spec namespace SignType -- Porting note: Added Fintype SignType manually instance : Fintype SignType := Fintype.ofMultiset (zero :: neg :: pos :: List.nil) (fun x ↦ by cases x <;> simp) instance : Zero SignType := ⟨zero⟩ instance : One SignType := ⟨pos⟩ instance : Neg SignType := ⟨fun s => match s with | neg => pos | zero => zero | pos => neg⟩ @[simp] theorem zero_eq_zero : zero = 0 := rfl #align sign_type.zero_eq_zero SignType.zero_eq_zero @[simp] theorem neg_eq_neg_one : neg = -1 := rfl #align sign_type.neg_eq_neg_one SignType.neg_eq_neg_one @[simp] theorem pos_eq_one : pos = 1 := rfl #align sign_type.pos_eq_one SignType.pos_eq_one instance : Mul SignType := ⟨fun x y => match x with | neg => -y | zero => zero | pos => y⟩ protected inductive LE : SignType → SignType → Prop | of_neg (a) : SignType.LE neg a | zero : SignType.LE zero zero | of_pos (a) : SignType.LE a pos #align sign_type.le SignType.LE instance : LE SignType := ⟨SignType.LE⟩ instance LE.decidableRel : DecidableRel SignType.LE := fun a b => by cases a <;> cases b <;> first | exact isTrue (by constructor)| exact isFalse (by rintro ⟨_⟩) instance decidableEq : DecidableEq SignType := fun a b => by cases a <;> cases b <;> first | exact isTrue (by constructor)| exact isFalse (by rintro ⟨_⟩) private lemma mul_comm : ∀ (a b : SignType), a * b = b * a := by rintro ⟨⟩ ⟨⟩ <;> rfl private lemma mul_assoc : ∀ (a b c : SignType), (a * b) * c = a * (b * c) := by rintro ⟨⟩ ⟨⟩ ⟨⟩ <;> rfl instance : CommGroupWithZero SignType where zero := 0 one := 1 mul := (· * ·) inv := id mul_zero a := by cases a <;> rfl zero_mul a := by cases a <;> rfl mul_one a := by cases a <;> rfl one_mul a := by cases a <;> rfl mul_inv_cancel a ha := by cases a <;> trivial mul_comm := mul_comm mul_assoc := mul_assoc exists_pair_ne := ⟨0, 1, by rintro ⟨_⟩⟩ inv_zero := rfl private lemma le_antisymm (a b : SignType) (_ : a ≤ b) (_: b ≤ a) : a = b := by cases a <;> cases b <;> trivial private lemma le_trans (a b c : SignType) (_ : a ≤ b) (_: b ≤ c) : a ≤ c := by cases a <;> cases b <;> cases c <;> tauto instance : LinearOrder SignType where le := (· ≤ ·) le_refl a := by cases a <;> constructor le_total a b := by cases a <;> cases b <;> first | left; constructor | right; constructor le_antisymm := le_antisymm le_trans := le_trans decidableLE := LE.decidableRel decidableEq := SignType.decidableEq instance : BoundedOrder SignType where top := 1 le_top := LE.of_pos bot := -1 bot_le := LE.of_neg instance : HasDistribNeg SignType := { neg_neg := fun x => by cases x <;> rfl neg_mul := fun x y => by cases x <;> cases y <;> rfl mul_neg := fun x y => by cases x <;> cases y <;> rfl } def fin3Equiv : SignType ≃* Fin 3 where toFun a := match a with | 0 => ⟨0, by simp⟩ | 1 => ⟨1, by simp⟩ | -1 => ⟨2, by simp⟩ invFun a := match a with | ⟨0, _⟩ => 0 | ⟨1, _⟩ => 1 | ⟨2, _⟩ => -1 left_inv a := by cases a <;> rfl right_inv a := match a with | ⟨0, _⟩ => by simp | ⟨1, _⟩ => by simp | ⟨2, _⟩ => by simp map_mul' a b := by cases a <;> cases b <;> rfl #align sign_type.fin3_equiv SignType.fin3Equiv section CaseBashing -- Porting note: a lot of these thms used to use decide! which is not implemented yet theorem nonneg_iff {a : SignType} : 0 ≤ a ↔ a = 0 ∨ a = 1 := by cases a <;> decide #align sign_type.nonneg_iff SignType.nonneg_iff
Mathlib/Data/Sign.lean
165
165
theorem nonneg_iff_ne_neg_one {a : SignType} : 0 ≤ a ↔ a ≠ -1 := by
cases a <;> decide
import Mathlib.Algebra.Polynomial.Degree.Definitions #align_import ring_theory.polynomial.opposites from "leanprover-community/mathlib"@"63417e01fbc711beaf25fa73b6edb395c0cfddd0" open Polynomial open Polynomial MulOpposite variable {R : Type*} [Semiring R] noncomputable section namespace Polynomial def opRingEquiv (R : Type*) [Semiring R] : R[X]ᵐᵒᵖ ≃+* Rᵐᵒᵖ[X] := ((toFinsuppIso R).op.trans AddMonoidAlgebra.opRingEquiv).trans (toFinsuppIso _).symm #align polynomial.op_ring_equiv Polynomial.opRingEquiv @[simp] theorem opRingEquiv_op_monomial (n : ℕ) (r : R) : opRingEquiv R (op (monomial n r : R[X])) = monomial n (op r) := by simp only [opRingEquiv, RingEquiv.coe_trans, Function.comp_apply, AddMonoidAlgebra.opRingEquiv_apply, RingEquiv.op_apply_apply, toFinsuppIso_apply, unop_op, toFinsupp_monomial, Finsupp.mapRange_single, toFinsuppIso_symm_apply, ofFinsupp_single] #align polynomial.op_ring_equiv_op_monomial Polynomial.opRingEquiv_op_monomial @[simp] theorem opRingEquiv_op_C (a : R) : opRingEquiv R (op (C a)) = C (op a) := opRingEquiv_op_monomial 0 a set_option linter.uppercaseLean3 false in #align polynomial.op_ring_equiv_op_C Polynomial.opRingEquiv_op_C @[simp] theorem opRingEquiv_op_X : opRingEquiv R (op (X : R[X])) = X := opRingEquiv_op_monomial 1 1 set_option linter.uppercaseLean3 false in #align polynomial.op_ring_equiv_op_X Polynomial.opRingEquiv_op_X theorem opRingEquiv_op_C_mul_X_pow (r : R) (n : ℕ) : opRingEquiv R (op (C r * X ^ n : R[X])) = C (op r) * X ^ n := by simp only [X_pow_mul, op_mul, op_pow, map_mul, map_pow, opRingEquiv_op_X, opRingEquiv_op_C] set_option linter.uppercaseLean3 false in #align polynomial.op_ring_equiv_op_C_mul_X_pow Polynomial.opRingEquiv_op_C_mul_X_pow @[simp] theorem opRingEquiv_symm_monomial (n : ℕ) (r : Rᵐᵒᵖ) : (opRingEquiv R).symm (monomial n r) = op (monomial n (unop r)) := (opRingEquiv R).injective (by simp) #align polynomial.op_ring_equiv_symm_monomial Polynomial.opRingEquiv_symm_monomial @[simp] theorem opRingEquiv_symm_C (a : Rᵐᵒᵖ) : (opRingEquiv R).symm (C a) = op (C (unop a)) := opRingEquiv_symm_monomial 0 a set_option linter.uppercaseLean3 false in #align polynomial.op_ring_equiv_symm_C Polynomial.opRingEquiv_symm_C @[simp] theorem opRingEquiv_symm_X : (opRingEquiv R).symm (X : Rᵐᵒᵖ[X]) = op X := opRingEquiv_symm_monomial 1 1 set_option linter.uppercaseLean3 false in #align polynomial.op_ring_equiv_symm_X Polynomial.opRingEquiv_symm_X theorem opRingEquiv_symm_C_mul_X_pow (r : Rᵐᵒᵖ) (n : ℕ) : (opRingEquiv R).symm (C r * X ^ n : Rᵐᵒᵖ[X]) = op (C (unop r) * X ^ n) := by rw [C_mul_X_pow_eq_monomial, opRingEquiv_symm_monomial, C_mul_X_pow_eq_monomial] set_option linter.uppercaseLean3 false in #align polynomial.op_ring_equiv_symm_C_mul_X_pow Polynomial.opRingEquiv_symm_C_mul_X_pow @[simp] theorem coeff_opRingEquiv (p : R[X]ᵐᵒᵖ) (n : ℕ) : (opRingEquiv R p).coeff n = op ((unop p).coeff n) := by induction' p using MulOpposite.rec' with p cases p rfl #align polynomial.coeff_op_ring_equiv Polynomial.coeff_opRingEquiv @[simp] theorem support_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).support = (unop p).support := by induction' p using MulOpposite.rec' with p cases p exact Finsupp.support_mapRange_of_injective (map_zero _) _ op_injective #align polynomial.support_op_ring_equiv Polynomial.support_opRingEquiv @[simp]
Mathlib/RingTheory/Polynomial/Opposites.lean
110
114
theorem natDegree_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).natDegree = (unop p).natDegree := by
by_cases p0 : p = 0 · simp only [p0, _root_.map_zero, natDegree_zero, unop_zero] · simp only [p0, natDegree_eq_support_max', Ne, AddEquivClass.map_eq_zero_iff, not_false_iff, support_opRingEquiv, unop_eq_zero_iff]
import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension import Mathlib.Geometry.Manifold.ContMDiff.Atlas import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace #align_import geometry.manifold.bump_function from "leanprover-community/mathlib"@"b018406ad2f2a73223a3a9e198ccae61e6f05318" universe uE uF uH uM variable {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 Metric open scoped Topology Manifold Classical Filter noncomputable section structure SmoothBumpFunction (c : M) extends ContDiffBump (extChartAt I c c) where closedBall_subset : closedBall (extChartAt I c c) rOut ∩ range I ⊆ (extChartAt I c).target #align smooth_bump_function SmoothBumpFunction namespace SmoothBumpFunction variable {c : M} (f : SmoothBumpFunction I c) {x : M} {I} @[coe] def toFun : M → ℝ := indicator (chartAt H c).source (f.toContDiffBump ∘ extChartAt I c) #align smooth_bump_function.to_fun SmoothBumpFunction.toFun instance : CoeFun (SmoothBumpFunction I c) fun _ => M → ℝ := ⟨toFun⟩ theorem coe_def : ⇑f = indicator (chartAt H c).source (f.toContDiffBump ∘ extChartAt I c) := rfl #align smooth_bump_function.coe_def SmoothBumpFunction.coe_def theorem rOut_pos : 0 < f.rOut := f.toContDiffBump.rOut_pos set_option linter.uppercaseLean3 false in #align smooth_bump_function.R_pos SmoothBumpFunction.rOut_pos theorem ball_subset : ball (extChartAt I c c) f.rOut ∩ range I ⊆ (extChartAt I c).target := Subset.trans (inter_subset_inter_left _ ball_subset_closedBall) f.closedBall_subset #align smooth_bump_function.ball_subset SmoothBumpFunction.ball_subset theorem ball_inter_range_eq_ball_inter_target : ball (extChartAt I c c) f.rOut ∩ range I = ball (extChartAt I c c) f.rOut ∩ (extChartAt I c).target := (subset_inter inter_subset_left f.ball_subset).antisymm <| inter_subset_inter_right _ <| extChartAt_target_subset_range _ _ theorem eqOn_source : EqOn f (f.toContDiffBump ∘ extChartAt I c) (chartAt H c).source := eqOn_indicator #align smooth_bump_function.eq_on_source SmoothBumpFunction.eqOn_source theorem eventuallyEq_of_mem_source (hx : x ∈ (chartAt H c).source) : f =ᶠ[𝓝 x] f.toContDiffBump ∘ extChartAt I c := f.eqOn_source.eventuallyEq_of_mem <| (chartAt H c).open_source.mem_nhds hx #align smooth_bump_function.eventually_eq_of_mem_source SmoothBumpFunction.eventuallyEq_of_mem_source theorem one_of_dist_le (hs : x ∈ (chartAt H c).source) (hd : dist (extChartAt I c x) (extChartAt I c c) ≤ f.rIn) : f x = 1 := by simp only [f.eqOn_source hs, (· ∘ ·), f.one_of_mem_closedBall hd] #align smooth_bump_function.one_of_dist_le SmoothBumpFunction.one_of_dist_le theorem support_eq_inter_preimage : support f = (chartAt H c).source ∩ extChartAt I c ⁻¹' ball (extChartAt I c c) f.rOut := by rw [coe_def, support_indicator, support_comp_eq_preimage, ← extChartAt_source I, ← (extChartAt I c).symm_image_target_inter_eq', ← (extChartAt I c).symm_image_target_inter_eq', f.support_eq] #align smooth_bump_function.support_eq_inter_preimage SmoothBumpFunction.support_eq_inter_preimage theorem isOpen_support : IsOpen (support f) := by rw [support_eq_inter_preimage] exact isOpen_extChartAt_preimage I c isOpen_ball #align smooth_bump_function.is_open_support SmoothBumpFunction.isOpen_support
Mathlib/Geometry/Manifold/BumpFunction.lean
124
128
theorem support_eq_symm_image : support f = (extChartAt I c).symm '' (ball (extChartAt I c c) f.rOut ∩ range I) := by
rw [f.support_eq_inter_preimage, ← extChartAt_source I, ← (extChartAt I c).symm_image_target_inter_eq', inter_comm, ball_inter_range_eq_ball_inter_target]
import Mathlib.Algebra.CharP.Basic import Mathlib.Algebra.CharP.Algebra import Mathlib.Data.Nat.Prime #align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u variable (R : Type u) section Semiring variable [Semiring R] class inductive ExpChar (R : Type u) [Semiring R] : ℕ → Prop | zero [CharZero R] : ExpChar R 1 | prime {q : ℕ} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q #align exp_char ExpChar #align exp_char.prime ExpChar.prime instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R × S) p := by obtain hp | ⟨hp⟩ := ‹ExpChar R p› · have := Prod.charZero_of_left R S; exact .zero obtain _ | _ := ‹ExpChar S p› · exact (Nat.not_prime_one hp).elim · have := Prod.charP R S p; exact .prime hp variable {R} in theorem ExpChar.eq {p q : ℕ} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by cases' hp with hp _ hp' hp · cases' hq with hq _ hq' hq exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) ▸ hq'))] · cases' hq with hq _ hq' hq exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) ▸ hp')), CharP.eq R hp hq] theorem ExpChar.congr {p : ℕ} (q : ℕ) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h ▸ hq noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : ℕ := max (ringChar R) 1 theorem ringExpChar.eq (q : ℕ) [h : ExpChar R q] : ringExpChar R = q := by cases' h with _ _ h _ · haveI := CharP.ofCharZero R rw [ringExpChar, ringChar.eq R 0]; rfl rw [ringExpChar, ringChar.eq R q] exact Nat.max_eq_left h.one_lt.le @[simp] theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one] theorem expChar_one_of_char_zero (q : ℕ) [hp : CharP R 0] [hq : ExpChar R q] : q = 1 := by cases' hq with q hq_one hq_prime hq_hchar · rfl · exact False.elim <| hq_prime.ne_zero <| hq_hchar.eq R hp #align exp_char_one_of_char_zero expChar_one_of_char_zero theorem char_eq_expChar_iff (p q : ℕ) [hp : CharP R p] [hq : ExpChar R q] : p = q ↔ p.Prime := by cases' hq with q hq_one hq_prime hq_hchar · rw [(CharP.eq R hp inferInstance : p = 0)] decide · exact ⟨fun hpq => hpq.symm ▸ hq_prime, fun _ => CharP.eq R hp hq_hchar⟩ #align char_eq_exp_char_iff char_eq_expChar_iff section Nontrivial variable [Nontrivial R]
Mathlib/Algebra/CharP/ExpChar.lean
105
108
theorem char_zero_of_expChar_one (p : ℕ) [hp : CharP R p] [hq : ExpChar R 1] : p = 0 := by
cases hq · exact CharP.eq R hp inferInstance · exact False.elim (CharP.char_ne_one R 1 rfl)
import Mathlib.Analysis.SpecialFunctions.Log.Deriv import Mathlib.MeasureTheory.Integral.FundThmCalculus #align_import analysis.special_functions.non_integrable from "leanprover-community/mathlib"@"55ec6e9af7d3e0043f57e394cb06a72f6275273e" open scoped MeasureTheory Topology Interval NNReal ENNReal open MeasureTheory TopologicalSpace Set Filter Asymptotics intervalIntegral variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F]
Mathlib/Analysis/SpecialFunctions/NonIntegrable.lean
52
96
theorem not_integrableOn_of_tendsto_norm_atTop_of_deriv_isBigO_filter_aux [CompleteSpace E] {f : ℝ → E} {g : ℝ → F} {k : Set ℝ} (l : Filter ℝ) [NeBot l] [TendstoIxxClass Icc l l] (hl : k ∈ l) (hd : ∀ᶠ x in l, DifferentiableAt ℝ f x) (hf : Tendsto (fun x => ‖f x‖) l atTop) (hfg : deriv f =O[l] g) : ¬IntegrableOn g k := by
intro hgi obtain ⟨C, hC₀, s, hsl, hsub, hfd, hg⟩ : ∃ (C : ℝ) (_ : 0 ≤ C), ∃ s ∈ l, (∀ x ∈ s, ∀ y ∈ s, [[x, y]] ⊆ k) ∧ (∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ [[x, y]], DifferentiableAt ℝ f z) ∧ ∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ [[x, y]], ‖deriv f z‖ ≤ C * ‖g z‖ := by rcases hfg.exists_nonneg with ⟨C, C₀, hC⟩ have h : ∀ᶠ x : ℝ × ℝ in l.prod l, ∀ y ∈ [[x.1, x.2]], (DifferentiableAt ℝ f y ∧ ‖deriv f y‖ ≤ C * ‖g y‖) ∧ y ∈ k := (tendsto_fst.uIcc tendsto_snd).eventually ((hd.and hC.bound).and hl).smallSets rcases mem_prod_self_iff.1 h with ⟨s, hsl, hs⟩ simp only [prod_subset_iff, mem_setOf_eq] at hs exact ⟨C, C₀, s, hsl, fun x hx y hy z hz => (hs x hx y hy z hz).2, fun x hx y hy z hz => (hs x hx y hy z hz).1.1, fun x hx y hy z hz => (hs x hx y hy z hz).1.2⟩ replace hgi : IntegrableOn (fun x ↦ C * ‖g x‖) k := by exact hgi.norm.smul C obtain ⟨c, hc, d, hd, hlt⟩ : ∃ c ∈ s, ∃ d ∈ s, (‖f c‖ + ∫ y in k, C * ‖g y‖) < ‖f d‖ := by rcases Filter.nonempty_of_mem hsl with ⟨c, hc⟩ have : ∀ᶠ x in l, (‖f c‖ + ∫ y in k, C * ‖g y‖) < ‖f x‖ := hf.eventually (eventually_gt_atTop _) exact ⟨c, hc, (this.and hsl).exists.imp fun d hd => ⟨hd.2, hd.1⟩⟩ specialize hsub c hc d hd; specialize hfd c hc d hd replace hg : ∀ x ∈ Ι c d, ‖deriv f x‖ ≤ C * ‖g x‖ := fun z hz => hg c hc d hd z ⟨hz.1.le, hz.2⟩ have hg_ae : ∀ᵐ x ∂volume.restrict (Ι c d), ‖deriv f x‖ ≤ C * ‖g x‖ := (ae_restrict_mem measurableSet_uIoc).mono hg have hsub' : Ι c d ⊆ k := Subset.trans Ioc_subset_Icc_self hsub have hfi : IntervalIntegrable (deriv f) volume c d := by rw [intervalIntegrable_iff] have : IntegrableOn (fun x ↦ C * ‖g x‖) (Ι c d) := IntegrableOn.mono hgi hsub' le_rfl exact Integrable.mono' this (aestronglyMeasurable_deriv _ _) hg_ae refine hlt.not_le (sub_le_iff_le_add'.1 ?_) calc ‖f d‖ - ‖f c‖ ≤ ‖f d - f c‖ := norm_sub_norm_le _ _ _ = ‖∫ x in c..d, deriv f x‖ := congr_arg _ (integral_deriv_eq_sub hfd hfi).symm _ = ‖∫ x in Ι c d, deriv f x‖ := norm_integral_eq_norm_integral_Ioc _ _ ≤ ∫ x in Ι c d, ‖deriv f x‖ := norm_integral_le_integral_norm _ _ ≤ ∫ x in Ι c d, C * ‖g x‖ := setIntegral_mono_on hfi.norm.def' (hgi.mono_set hsub') measurableSet_uIoc hg _ ≤ ∫ x in k, C * ‖g x‖ := by apply setIntegral_mono_set hgi (ae_of_all _ fun x => mul_nonneg hC₀ (norm_nonneg _)) hsub'.eventuallyLE
import Mathlib.Algebra.Group.ConjFinite import Mathlib.Data.Fintype.BigOperators import Mathlib.Dynamics.PeriodicPts import Mathlib.GroupTheory.Commutator import Mathlib.GroupTheory.Coset import Mathlib.GroupTheory.GroupAction.ConjAct import Mathlib.GroupTheory.GroupAction.Hom #align_import group_theory.group_action.quotient from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef" universe u v w variable {α : Type u} {β : Type v} {γ : Type w} open Function namespace MulAction variable [Group α] section QuotientAction open Subgroup MulOpposite QuotientGroup variable (β) [Monoid β] [MulAction β α] (H : Subgroup α) class QuotientAction : Prop where inv_mul_mem : ∀ (b : β) {a a' : α}, a⁻¹ * a' ∈ H → (b • a)⁻¹ * b • a' ∈ H #align mul_action.quotient_action MulAction.QuotientAction class _root_.AddAction.QuotientAction {α : Type u} (β : Type v) [AddGroup α] [AddMonoid β] [AddAction β α] (H : AddSubgroup α) : Prop where inv_mul_mem : ∀ (b : β) {a a' : α}, -a + a' ∈ H → -(b +ᵥ a) + (b +ᵥ a') ∈ H #align add_action.quotient_action AddAction.QuotientAction attribute [to_additive] MulAction.QuotientAction @[to_additive] instance left_quotientAction : QuotientAction α H := ⟨fun _ _ _ _ => by rwa [smul_eq_mul, smul_eq_mul, mul_inv_rev, mul_assoc, inv_mul_cancel_left]⟩ #align mul_action.left_quotient_action MulAction.left_quotientAction #align add_action.left_quotient_action AddAction.left_quotientAction @[to_additive] instance right_quotientAction : QuotientAction (normalizer H).op H := ⟨fun b c _ _ => by rwa [smul_def, smul_def, smul_eq_mul_unop, smul_eq_mul_unop, mul_inv_rev, ← mul_assoc, mem_normalizer_iff'.mp b.prop, mul_assoc, mul_inv_cancel_left]⟩ #align mul_action.right_quotient_action MulAction.right_quotientAction #align add_action.right_quotient_action AddAction.right_quotientAction @[to_additive] instance right_quotientAction' [hH : H.Normal] : QuotientAction αᵐᵒᵖ H := ⟨fun _ _ _ _ => by rwa [smul_eq_mul_unop, smul_eq_mul_unop, mul_inv_rev, mul_assoc, hH.mem_comm_iff, mul_assoc, mul_inv_cancel_right]⟩ #align mul_action.right_quotient_action' MulAction.right_quotientAction' #align add_action.right_quotient_action' AddAction.right_quotientAction' @[to_additive] instance quotient [QuotientAction β H] : MulAction β (α ⧸ H) where smul b := Quotient.map' (b • ·) fun _ _ h => leftRel_apply.mpr <| QuotientAction.inv_mul_mem b <| leftRel_apply.mp h one_smul q := Quotient.inductionOn' q fun a => congr_arg Quotient.mk'' (one_smul β a) mul_smul b b' q := Quotient.inductionOn' q fun a => congr_arg Quotient.mk'' (mul_smul b b' a) #align mul_action.quotient MulAction.quotient #align add_action.quotient AddAction.quotient variable {β} @[to_additive (attr := simp)] theorem Quotient.smul_mk [QuotientAction β H] (b : β) (a : α) : (b • QuotientGroup.mk a : α ⧸ H) = QuotientGroup.mk (b • a) := rfl #align mul_action.quotient.smul_mk MulAction.Quotient.smul_mk #align add_action.quotient.vadd_mk AddAction.Quotient.vadd_mk @[to_additive (attr := simp)] theorem Quotient.smul_coe [QuotientAction β H] (b : β) (a : α) : b • (a : α ⧸ H) = (↑(b • a) : α ⧸ H) := rfl #align mul_action.quotient.smul_coe MulAction.Quotient.smul_coe #align add_action.quotient.vadd_coe AddAction.Quotient.vadd_coe @[to_additive (attr := simp)] theorem Quotient.mk_smul_out' [QuotientAction β H] (b : β) (q : α ⧸ H) : QuotientGroup.mk (b • q.out') = b • q := by rw [← Quotient.smul_mk, QuotientGroup.out_eq'] #align mul_action.quotient.mk_smul_out' MulAction.Quotient.mk_smul_out' #align add_action.quotient.mk_vadd_out' AddAction.Quotient.mk_vadd_out' -- Porting note: removed simp attribute, simp can prove this @[to_additive] theorem Quotient.coe_smul_out' [QuotientAction β H] (b : β) (q : α ⧸ H) : ↑(b • q.out') = b • q := Quotient.mk_smul_out' H b q #align mul_action.quotient.coe_smul_out' MulAction.Quotient.coe_smul_out' #align add_action.quotient.coe_vadd_out' AddAction.Quotient.coe_vadd_out'
Mathlib/GroupTheory/GroupAction/Quotient.lean
120
123
theorem _root_.QuotientGroup.out'_conj_pow_minimalPeriod_mem (a : α) (q : α ⧸ H) : q.out'⁻¹ * a ^ Function.minimalPeriod (a • ·) q * q.out' ∈ H := by
rw [mul_assoc, ← QuotientGroup.eq', QuotientGroup.out_eq', ← smul_eq_mul, Quotient.mk_smul_out', eq_comm, pow_smul_eq_iff_minimalPeriod_dvd]
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.calculus.bump_function_inner from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open Function Set Filter open scoped Topology Filter variable {E X : Type*} structure ContDiffBump (c : E) where (rIn rOut : ℝ) rIn_pos : 0 < rIn rIn_lt_rOut : rIn < rOut #align cont_diff_bump ContDiffBump #align cont_diff_bump.r ContDiffBump.rIn set_option linter.uppercaseLean3 false in #align cont_diff_bump.R ContDiffBump.rOut #align cont_diff_bump.r_pos ContDiffBump.rIn_pos set_option linter.uppercaseLean3 false in #align cont_diff_bump.r_lt_R ContDiffBump.rIn_lt_rOut -- Porting note(#5171): linter not yet ported; was @[nolint has_nonempty_instance] structure ContDiffBumpBase (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] where toFun : ℝ → E → ℝ mem_Icc : ∀ (R : ℝ) (x : E), toFun R x ∈ Icc (0 : ℝ) 1 symmetric : ∀ (R : ℝ) (x : E), toFun R (-x) = toFun R x smooth : ContDiffOn ℝ ⊤ (uncurry toFun) (Ioi (1 : ℝ) ×ˢ (univ : Set E)) eq_one : ∀ R : ℝ, 1 < R → ∀ x : E, ‖x‖ ≤ 1 → toFun R x = 1 support : ∀ R : ℝ, 1 < R → Function.support (toFun R) = Metric.ball (0 : E) R #align cont_diff_bump_base ContDiffBumpBase class HasContDiffBump (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] : Prop where out : Nonempty (ContDiffBumpBase E) #align has_cont_diff_bump HasContDiffBump def someContDiffBumpBase (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] [hb : HasContDiffBump E] : ContDiffBumpBase E := Nonempty.some hb.out #align some_cont_diff_bump_base someContDiffBumpBase namespace ContDiffBump theorem rOut_pos {c : E} (f : ContDiffBump c) : 0 < f.rOut := f.rIn_pos.trans f.rIn_lt_rOut set_option linter.uppercaseLean3 false in #align cont_diff_bump.R_pos ContDiffBump.rOut_pos theorem one_lt_rOut_div_rIn {c : E} (f : ContDiffBump c) : 1 < f.rOut / f.rIn := by rw [one_lt_div f.rIn_pos] exact f.rIn_lt_rOut set_option linter.uppercaseLean3 false in #align cont_diff_bump.one_lt_R_div_r ContDiffBump.one_lt_rOut_div_rIn instance (c : E) : Inhabited (ContDiffBump c) := ⟨⟨1, 2, zero_lt_one, one_lt_two⟩⟩ variable [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup X] [NormedSpace ℝ X] [HasContDiffBump E] {c : E} (f : ContDiffBump c) {x : E} {n : ℕ∞} @[coe] def toFun {c : E} (f : ContDiffBump c) : E → ℝ := (someContDiffBumpBase E).toFun (f.rOut / f.rIn) ∘ fun x ↦ (f.rIn⁻¹ • (x - c)) #align cont_diff_bump.to_fun ContDiffBump.toFun instance : CoeFun (ContDiffBump c) fun _ => E → ℝ := ⟨toFun⟩ protected theorem apply (x : E) : f x = (someContDiffBumpBase E).toFun (f.rOut / f.rIn) (f.rIn⁻¹ • (x - c)) := rfl #align cont_diff_bump.def ContDiffBump.apply protected theorem sub (x : E) : f (c - x) = f (c + x) := by simp [f.apply, ContDiffBumpBase.symmetric] #align cont_diff_bump.sub ContDiffBump.sub protected theorem neg (f : ContDiffBump (0 : E)) (x : E) : f (-x) = f x := by simp_rw [← zero_sub, f.sub, zero_add] #align cont_diff_bump.neg ContDiffBump.neg open Metric theorem one_of_mem_closedBall (hx : x ∈ closedBall c f.rIn) : f x = 1 := by apply ContDiffBumpBase.eq_one _ _ f.one_lt_rOut_div_rIn simpa only [norm_smul, Real.norm_eq_abs, abs_inv, abs_of_nonneg f.rIn_pos.le, ← div_eq_inv_mul, div_le_one f.rIn_pos] using mem_closedBall_iff_norm.1 hx #align cont_diff_bump.one_of_mem_closed_ball ContDiffBump.one_of_mem_closedBall theorem nonneg : 0 ≤ f x := (ContDiffBumpBase.mem_Icc (someContDiffBumpBase E) _ _).1 #align cont_diff_bump.nonneg ContDiffBump.nonneg theorem nonneg' (x : E) : 0 ≤ f x := f.nonneg #align cont_diff_bump.nonneg' ContDiffBump.nonneg' theorem le_one : f x ≤ 1 := (ContDiffBumpBase.mem_Icc (someContDiffBumpBase E) _ _).2 #align cont_diff_bump.le_one ContDiffBump.le_one
Mathlib/Analysis/Calculus/BumpFunction/Basic.lean
172
176
theorem support_eq : Function.support f = Metric.ball c f.rOut := by
simp only [toFun, support_comp_eq_preimage, ContDiffBumpBase.support _ _ f.one_lt_rOut_div_rIn] ext x simp only [mem_ball_iff_norm, sub_zero, norm_smul, mem_preimage, Real.norm_eq_abs, abs_inv, abs_of_pos f.rIn_pos, ← div_eq_inv_mul, div_lt_div_right f.rIn_pos]
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp import Mathlib.MeasureTheory.Integral.Bochner import Mathlib.Order.Filter.IndicatorFunction import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner import Mathlib.MeasureTheory.Function.LpSeminorm.Trim #align_import measure_theory.function.conditional_expectation.ae_measurable from "leanprover-community/mathlib"@"d8bbb04e2d2a44596798a9207ceefc0fb236e41e" set_option linter.uppercaseLean3 false open TopologicalSpace Filter open scoped ENNReal MeasureTheory namespace MeasureTheory def AEStronglyMeasurable' {α β} [TopologicalSpace β] (m : MeasurableSpace α) {_ : MeasurableSpace α} (f : α → β) (μ : Measure α) : Prop := ∃ g : α → β, StronglyMeasurable[m] g ∧ f =ᵐ[μ] g #align measure_theory.ae_strongly_measurable' MeasureTheory.AEStronglyMeasurable' namespace AEStronglyMeasurable' variable {α β 𝕜 : Type*} {m m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β] {f g : α → β} theorem congr (hf : AEStronglyMeasurable' m f μ) (hfg : f =ᵐ[μ] g) : AEStronglyMeasurable' m g μ := by obtain ⟨f', hf'_meas, hff'⟩ := hf; exact ⟨f', hf'_meas, hfg.symm.trans hff'⟩ #align measure_theory.ae_strongly_measurable'.congr MeasureTheory.AEStronglyMeasurable'.congr theorem mono {m'} (hf : AEStronglyMeasurable' m f μ) (hm : m ≤ m') : AEStronglyMeasurable' m' f μ := let ⟨f', hf'_meas, hff'⟩ := hf; ⟨f', hf'_meas.mono hm, hff'⟩ theorem add [Add β] [ContinuousAdd β] (hf : AEStronglyMeasurable' m f μ) (hg : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f + g) μ := by rcases hf with ⟨f', h_f'_meas, hff'⟩ rcases hg with ⟨g', h_g'_meas, hgg'⟩ exact ⟨f' + g', h_f'_meas.add h_g'_meas, hff'.add hgg'⟩ #align measure_theory.ae_strongly_measurable'.add MeasureTheory.AEStronglyMeasurable'.add theorem neg [AddGroup β] [TopologicalAddGroup β] {f : α → β} (hfm : AEStronglyMeasurable' m f μ) : AEStronglyMeasurable' m (-f) μ := by rcases hfm with ⟨f', hf'_meas, hf_ae⟩ refine ⟨-f', hf'_meas.neg, hf_ae.mono fun x hx => ?_⟩ simp_rw [Pi.neg_apply] rw [hx] #align measure_theory.ae_strongly_measurable'.neg MeasureTheory.AEStronglyMeasurable'.neg
Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean
86
92
theorem sub [AddGroup β] [TopologicalAddGroup β] {f g : α → β} (hfm : AEStronglyMeasurable' m f μ) (hgm : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f - g) μ := by
rcases hfm with ⟨f', hf'_meas, hf_ae⟩ rcases hgm with ⟨g', hg'_meas, hg_ae⟩ refine ⟨f' - g', hf'_meas.sub hg'_meas, hf_ae.mp (hg_ae.mono fun x hx1 hx2 => ?_)⟩ simp_rw [Pi.sub_apply] rw [hx1, hx2]
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {α β γ δ : Type*} {ι : Sort y} {s t u : Set α} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : ℚ) (b : ℚ) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : ℚ → ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Ioi (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : ℚ → ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp)
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
68
74
theorem borel_eq_generateFrom_Iic_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Iic (a : ℝ)}) := by
rw [borel_eq_generateFrom_Ioi_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Iic]; rw [← compl_Ioi]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q))
import Mathlib.Data.Finset.Lattice import Mathlib.Data.Fintype.Vector import Mathlib.Data.Multiset.Sym #align_import data.finset.sym from "leanprover-community/mathlib"@"02ba8949f486ebecf93fe7460f1ed0564b5e442c" namespace Finset variable {α : Type*} @[simps] protected def sym2 (s : Finset α) : Finset (Sym2 α) := ⟨s.1.sym2, s.2.sym2⟩ #align finset.sym2 Finset.sym2 section variable {s t : Finset α} {a b : α} theorem mk_mem_sym2_iff : s(a, b) ∈ s.sym2 ↔ a ∈ s ∧ b ∈ s := by rw [mem_mk, sym2_val, Multiset.mk_mem_sym2_iff, mem_mk, mem_mk] #align finset.mk_mem_sym2_iff Finset.mk_mem_sym2_iff @[simp] theorem mem_sym2_iff {m : Sym2 α} : m ∈ s.sym2 ↔ ∀ a ∈ m, a ∈ s := by rw [mem_mk, sym2_val, Multiset.mem_sym2_iff] simp only [mem_val] #align finset.mem_sym2_iff Finset.mem_sym2_iff instance _root_.Sym2.instFintype [Fintype α] : Fintype (Sym2 α) where elems := Finset.univ.sym2 complete := fun x ↦ by rw [mem_sym2_iff]; exact (fun a _ ↦ mem_univ a) -- Note(kmill): Using a default argument to make this simp lemma more general. @[simp] theorem sym2_univ [Fintype α] (inst : Fintype (Sym2 α) := Sym2.instFintype) : (univ : Finset α).sym2 = univ := by ext simp only [mem_sym2_iff, mem_univ, implies_true] #align finset.sym2_univ Finset.sym2_univ @[simp, mono] theorem sym2_mono (h : s ⊆ t) : s.sym2 ⊆ t.sym2 := by rw [← val_le_iff, sym2_val, sym2_val] apply Multiset.sym2_mono rwa [val_le_iff] #align finset.sym2_mono Finset.sym2_mono theorem monotone_sym2 : Monotone (Finset.sym2 : Finset α → _) := fun _ _ => sym2_mono theorem injective_sym2 : Function.Injective (Finset.sym2 : Finset α → _) := by intro s t h ext x simpa using congr(s(x, x) ∈ $h) theorem strictMono_sym2 : StrictMono (Finset.sym2 : Finset α → _) := monotone_sym2.strictMono_of_injective injective_sym2 theorem sym2_toFinset [DecidableEq α] (m : Multiset α) : m.toFinset.sym2 = m.sym2.toFinset := by ext z refine z.ind fun x y ↦ ?_ simp only [mk_mem_sym2_iff, Multiset.mem_toFinset, Multiset.mk_mem_sym2_iff] @[simp] theorem sym2_empty : (∅ : Finset α).sym2 = ∅ := rfl #align finset.sym2_empty Finset.sym2_empty @[simp] theorem sym2_eq_empty : s.sym2 = ∅ ↔ s = ∅ := by rw [← val_eq_zero, sym2_val, Multiset.sym2_eq_zero_iff, val_eq_zero] #align finset.sym2_eq_empty Finset.sym2_eq_empty @[simp, aesop safe apply (rule_sets := [finsetNonempty])] theorem sym2_nonempty : s.sym2.Nonempty ↔ s.Nonempty := by rw [← not_iff_not] simp_rw [not_nonempty_iff_eq_empty, sym2_eq_empty] #align finset.sym2_nonempty Finset.sym2_nonempty protected alias ⟨_, Nonempty.sym2⟩ := sym2_nonempty #align finset.nonempty.sym2 Finset.Nonempty.sym2 @[simp] theorem sym2_singleton (a : α) : ({a} : Finset α).sym2 = {Sym2.diag a} := rfl #align finset.sym2_singleton Finset.sym2_singleton theorem card_sym2 (s : Finset α) : s.sym2.card = Nat.choose (s.card + 1) 2 := by rw [card_def, sym2_val, Multiset.card_sym2, ← card_def] #align finset.card_sym2 Finset.card_sym2 end variable [DecidableEq α] {s t : Finset α} {a b : α} theorem sym2_eq_image : s.sym2 = (s ×ˢ s).image Sym2.mk := by ext z refine z.ind fun x y ↦ ?_ rw [mk_mem_sym2_iff, mem_image] constructor · intro h use (x, y) simp only [mem_product, h, and_self, true_and] · rintro ⟨⟨a, b⟩, h⟩ simp only [mem_product, Sym2.eq_iff] at h obtain ⟨h, (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)⟩ := h <;> simp [h] theorem isDiag_mk_of_mem_diag {a : α × α} (h : a ∈ s.diag) : (Sym2.mk a).IsDiag := (Sym2.isDiag_iff_proj_eq _).2 (mem_diag.1 h).2 #align finset.is_diag_mk_of_mem_diag Finset.isDiag_mk_of_mem_diag
Mathlib/Data/Finset/Sym.lean
139
142
theorem not_isDiag_mk_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) : ¬ (Sym2.mk a).IsDiag := by
rw [Sym2.isDiag_iff_proj_eq] exact (mem_offDiag.1 h).2.2
import Mathlib.Data.List.OfFn import Mathlib.Data.List.Range #align_import data.list.fin_range from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" universe u open List
Mathlib/Data/List/FinRange.lean
79
82
theorem Equiv.Perm.map_finRange_perm {n : ℕ} (σ : Equiv.Perm (Fin n)) : map σ (finRange n) ~ finRange n := by
rw [perm_ext_iff_of_nodup ((nodup_finRange n).map σ.injective) <| nodup_finRange n] simpa [mem_map, mem_finRange, true_and_iff, iff_true_iff] using σ.surjective
import Mathlib.Order.Filter.Cofinite import Mathlib.Order.ZornAtoms #align_import order.filter.ultrafilter from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1" universe u v variable {α : Type u} {β : Type v} {γ : Type*} open Set Filter Function open scoped Classical open Filter instance : IsAtomic (Filter α) := IsAtomic.of_isChain_bounded fun c hc hne hb => ⟨sInf c, (sInf_neBot_of_directed' hne (show IsChain (· ≥ ·) c from hc.symm).directedOn hb).ne, fun _ hx => sInf_le hx⟩ structure Ultrafilter (α : Type*) extends Filter α where protected neBot' : NeBot toFilter protected le_of_le : ∀ g, Filter.NeBot g → g ≤ toFilter → toFilter ≤ g #align ultrafilter Ultrafilter namespace Ultrafilter variable {f g : Ultrafilter α} {s t : Set α} {p q : α → Prop} attribute [coe] Ultrafilter.toFilter instance : CoeTC (Ultrafilter α) (Filter α) := ⟨Ultrafilter.toFilter⟩ instance : Membership (Set α) (Ultrafilter α) := ⟨fun s f => s ∈ (f : Filter α)⟩ theorem unique (f : Ultrafilter α) {g : Filter α} (h : g ≤ f) (hne : NeBot g := by infer_instance) : g = f := le_antisymm h <| f.le_of_le g hne h #align ultrafilter.unique Ultrafilter.unique instance neBot (f : Ultrafilter α) : NeBot (f : Filter α) := f.neBot' #align ultrafilter.ne_bot Ultrafilter.neBot protected theorem isAtom (f : Ultrafilter α) : IsAtom (f : Filter α) := ⟨f.neBot.ne, fun _ hgf => by_contra fun hg => hgf.ne <| f.unique hgf.le ⟨hg⟩⟩ #align ultrafilter.is_atom Ultrafilter.isAtom @[simp, norm_cast] theorem mem_coe : s ∈ (f : Filter α) ↔ s ∈ f := Iff.rfl #align ultrafilter.mem_coe Ultrafilter.mem_coe theorem coe_injective : Injective ((↑) : Ultrafilter α → Filter α) | ⟨f, h₁, h₂⟩, ⟨g, _, _⟩, _ => by congr #align ultrafilter.coe_injective Ultrafilter.coe_injective theorem eq_of_le {f g : Ultrafilter α} (h : (f : Filter α) ≤ g) : f = g := coe_injective (g.unique h) #align ultrafilter.eq_of_le Ultrafilter.eq_of_le @[simp, norm_cast] theorem coe_le_coe {f g : Ultrafilter α} : (f : Filter α) ≤ g ↔ f = g := ⟨fun h => eq_of_le h, fun h => h ▸ le_rfl⟩ #align ultrafilter.coe_le_coe Ultrafilter.coe_le_coe @[simp, norm_cast] theorem coe_inj : (f : Filter α) = g ↔ f = g := coe_injective.eq_iff #align ultrafilter.coe_inj Ultrafilter.coe_inj @[ext] theorem ext ⦃f g : Ultrafilter α⦄ (h : ∀ s, s ∈ f ↔ s ∈ g) : f = g := coe_injective <| Filter.ext h #align ultrafilter.ext Ultrafilter.ext theorem le_of_inf_neBot (f : Ultrafilter α) {g : Filter α} (hg : NeBot (↑f ⊓ g)) : ↑f ≤ g := le_of_inf_eq (f.unique inf_le_left hg) #align ultrafilter.le_of_inf_ne_bot Ultrafilter.le_of_inf_neBot theorem le_of_inf_neBot' (f : Ultrafilter α) {g : Filter α} (hg : NeBot (g ⊓ f)) : ↑f ≤ g := f.le_of_inf_neBot <| by rwa [inf_comm] #align ultrafilter.le_of_inf_ne_bot' Ultrafilter.le_of_inf_neBot' theorem inf_neBot_iff {f : Ultrafilter α} {g : Filter α} : NeBot (↑f ⊓ g) ↔ ↑f ≤ g := ⟨le_of_inf_neBot f, fun h => (inf_of_le_left h).symm ▸ f.neBot⟩ #align ultrafilter.inf_ne_bot_iff Ultrafilter.inf_neBot_iff theorem disjoint_iff_not_le {f : Ultrafilter α} {g : Filter α} : Disjoint (↑f) g ↔ ¬↑f ≤ g := by rw [← inf_neBot_iff, neBot_iff, Ne, not_not, disjoint_iff] #align ultrafilter.disjoint_iff_not_le Ultrafilter.disjoint_iff_not_le @[simp] theorem compl_not_mem_iff : sᶜ ∉ f ↔ s ∈ f := ⟨fun hsc => le_principal_iff.1 <| f.le_of_inf_neBot ⟨fun h => hsc <| mem_of_eq_bot <| by rwa [compl_compl]⟩, compl_not_mem⟩ #align ultrafilter.compl_not_mem_iff Ultrafilter.compl_not_mem_iff @[simp] theorem frequently_iff_eventually : (∃ᶠ x in f, p x) ↔ ∀ᶠ x in f, p x := compl_not_mem_iff #align ultrafilter.frequently_iff_eventually Ultrafilter.frequently_iff_eventually alias ⟨_root_.Filter.Frequently.eventually, _⟩ := frequently_iff_eventually #align filter.frequently.eventually Filter.Frequently.eventually
Mathlib/Order/Filter/Ultrafilter.lean
135
135
theorem compl_mem_iff_not_mem : sᶜ ∈ f ↔ s ∉ f := by
rw [← compl_not_mem_iff, compl_compl]
import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.LinearAlgebra.Matrix.Block #align_import analysis.inner_product_space.gram_schmidt_ortho from "leanprover-community/mathlib"@"1a4df69ca1a9a0e5e26bfe12e2b92814216016d0" open Finset Submodule FiniteDimensional variable (𝕜 : Type*) {E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] variable {ι : Type*} [LinearOrder ι] [LocallyFiniteOrderBot ι] [IsWellOrder ι (· < ·)] attribute [local instance] IsWellOrder.toHasWellFounded local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y noncomputable def gramSchmidt [IsWellOrder ι (· < ·)] (f : ι → E) (n : ι) : E := f n - ∑ i : Iio n, orthogonalProjection (𝕜 ∙ gramSchmidt f i) (f n) termination_by n decreasing_by exact mem_Iio.1 i.2 #align gram_schmidt gramSchmidt theorem gramSchmidt_def (f : ι → E) (n : ι) : gramSchmidt 𝕜 f n = f n - ∑ i ∈ Iio n, orthogonalProjection (𝕜 ∙ gramSchmidt 𝕜 f i) (f n) := by rw [← sum_attach, attach_eq_univ, gramSchmidt] #align gram_schmidt_def gramSchmidt_def theorem gramSchmidt_def' (f : ι → E) (n : ι) : f n = gramSchmidt 𝕜 f n + ∑ i ∈ Iio n, orthogonalProjection (𝕜 ∙ gramSchmidt 𝕜 f i) (f n) := by rw [gramSchmidt_def, sub_add_cancel] #align gram_schmidt_def' gramSchmidt_def' theorem gramSchmidt_def'' (f : ι → E) (n : ι) : f n = gramSchmidt 𝕜 f n + ∑ i ∈ Iio n, (⟪gramSchmidt 𝕜 f i, f n⟫ / (‖gramSchmidt 𝕜 f i‖ : 𝕜) ^ 2) • gramSchmidt 𝕜 f i := by convert gramSchmidt_def' 𝕜 f n rw [orthogonalProjection_singleton, RCLike.ofReal_pow] #align gram_schmidt_def'' gramSchmidt_def'' @[simp] theorem gramSchmidt_zero {ι : Type*} [LinearOrder ι] [LocallyFiniteOrder ι] [OrderBot ι] [IsWellOrder ι (· < ·)] (f : ι → E) : gramSchmidt 𝕜 f ⊥ = f ⊥ := by rw [gramSchmidt_def, Iio_eq_Ico, Finset.Ico_self, Finset.sum_empty, sub_zero] #align gram_schmidt_zero gramSchmidt_zero
Mathlib/Analysis/InnerProductSpace/GramSchmidtOrtho.lean
83
108
theorem gramSchmidt_orthogonal (f : ι → E) {a b : ι} (h₀ : a ≠ b) : ⟪gramSchmidt 𝕜 f a, gramSchmidt 𝕜 f b⟫ = 0 := by
suffices ∀ a b : ι, a < b → ⟪gramSchmidt 𝕜 f a, gramSchmidt 𝕜 f b⟫ = 0 by cases' h₀.lt_or_lt with ha hb · exact this _ _ ha · rw [inner_eq_zero_symm] exact this _ _ hb clear h₀ a b intro a b h₀ revert a apply wellFounded_lt.induction b intro b ih a h₀ simp only [gramSchmidt_def 𝕜 f b, inner_sub_right, inner_sum, orthogonalProjection_singleton, inner_smul_right] rw [Finset.sum_eq_single_of_mem a (Finset.mem_Iio.mpr h₀)] · by_cases h : gramSchmidt 𝕜 f a = 0 · simp only [h, inner_zero_left, zero_div, zero_mul, sub_zero] · rw [RCLike.ofReal_pow, ← inner_self_eq_norm_sq_to_K, div_mul_cancel₀, sub_self] rwa [inner_self_ne_zero] intro i hi hia simp only [mul_eq_zero, div_eq_zero_iff, inner_self_eq_zero] right cases' hia.lt_or_lt with hia₁ hia₂ · rw [inner_eq_zero_symm] exact ih a h₀ i hia₁ · exact ih i (mem_Iio.1 hi) a hia₂
import Mathlib.Data.List.Basic #align_import data.list.lattice from "leanprover-community/mathlib"@"dd71334db81d0bd444af1ee339a29298bef40734" open Nat namespace List variable {α : Type*} {l l₁ l₂ : List α} {p : α → Prop} {a : α} variable [DecidableEq α] section Inter @[simp] theorem inter_nil (l : List α) : [] ∩ l = [] := rfl #align list.inter_nil List.inter_nil @[simp] theorem inter_cons_of_mem (l₁ : List α) (h : a ∈ l₂) : (a :: l₁) ∩ l₂ = a :: l₁ ∩ l₂ := by simp [Inter.inter, List.inter, h] #align list.inter_cons_of_mem List.inter_cons_of_mem @[simp] theorem inter_cons_of_not_mem (l₁ : List α) (h : a ∉ l₂) : (a :: l₁) ∩ l₂ = l₁ ∩ l₂ := by simp [Inter.inter, List.inter, h] #align list.inter_cons_of_not_mem List.inter_cons_of_not_mem theorem mem_of_mem_inter_left : a ∈ l₁ ∩ l₂ → a ∈ l₁ := mem_of_mem_filter #align list.mem_of_mem_inter_left List.mem_of_mem_inter_left theorem mem_of_mem_inter_right (h : a ∈ l₁ ∩ l₂) : a ∈ l₂ := by simpa using of_mem_filter h #align list.mem_of_mem_inter_right List.mem_of_mem_inter_right theorem mem_inter_of_mem_of_mem (h₁ : a ∈ l₁) (h₂ : a ∈ l₂) : a ∈ l₁ ∩ l₂ := mem_filter_of_mem h₁ <| by simpa using h₂ #align list.mem_inter_of_mem_of_mem List.mem_inter_of_mem_of_mem #align list.mem_inter List.mem_inter_iff theorem inter_subset_left {l₁ l₂ : List α} : l₁ ∩ l₂ ⊆ l₁ := filter_subset _ #align list.inter_subset_left List.inter_subset_left theorem inter_subset_right {l₁ l₂ : List α} : l₁ ∩ l₂ ⊆ l₂ := fun _ => mem_of_mem_inter_right #align list.inter_subset_right List.inter_subset_right theorem subset_inter {l l₁ l₂ : List α} (h₁ : l ⊆ l₁) (h₂ : l ⊆ l₂) : l ⊆ l₁ ∩ l₂ := fun _ h => mem_inter_iff.2 ⟨h₁ h, h₂ h⟩ #align list.subset_inter List.subset_inter
Mathlib/Data/List/Lattice.lean
167
169
theorem inter_eq_nil_iff_disjoint : l₁ ∩ l₂ = [] ↔ Disjoint l₁ l₂ := by
simp only [eq_nil_iff_forall_not_mem, mem_inter_iff, not_and] rfl
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Topology.MetricSpace.IsometricSMul #align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" noncomputable section open NNReal ENNReal Topology Set Filter Pointwise Bornology universe u v w variable {ι : Sort*} {α : Type u} {β : Type v} namespace EMetric section InfEdist variable [PseudoEMetricSpace α] [PseudoEMetricSpace β] {x y : α} {s t : Set α} {Φ : α → β} def infEdist (x : α) (s : Set α) : ℝ≥0∞ := ⨅ y ∈ s, edist x y #align emetric.inf_edist EMetric.infEdist @[simp] theorem infEdist_empty : infEdist x ∅ = ∞ := iInf_emptyset #align emetric.inf_edist_empty EMetric.infEdist_empty
Mathlib/Topology/MetricSpace/HausdorffDistance.lean
80
81
theorem le_infEdist {d} : d ≤ infEdist x s ↔ ∀ y ∈ s, d ≤ edist x y := by
simp only [infEdist, le_iInf_iff]
import Mathlib.AlgebraicGeometry.GammaSpecAdjunction import Mathlib.AlgebraicGeometry.Restrict import Mathlib.CategoryTheory.Limits.Opposites import Mathlib.RingTheory.Localization.InvSubmonoid #align_import algebraic_geometry.AffineScheme from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c" -- Explicit universe annotations were used in this file to improve perfomance #12737 set_option linter.uppercaseLean3 false noncomputable section open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace universe u namespace AlgebraicGeometry open Spec (structureSheaf) -- Porting note(#5171): linter not ported yet -- @[nolint has_nonempty_instance] def AffineScheme := Scheme.Spec.EssImageSubcategory deriving Category #align algebraic_geometry.AffineScheme AlgebraicGeometry.AffineScheme class IsAffine (X : Scheme) : Prop where affine : IsIso (ΓSpec.adjunction.unit.app X) #align algebraic_geometry.is_affine AlgebraicGeometry.IsAffine attribute [instance] IsAffine.affine def Scheme.isoSpec (X : Scheme) [IsAffine X] : X ≅ Scheme.Spec.obj (op <| Scheme.Γ.obj <| op X) := asIso (ΓSpec.adjunction.unit.app X) #align algebraic_geometry.Scheme.iso_Spec AlgebraicGeometry.Scheme.isoSpec @[simps] def AffineScheme.mk (X : Scheme) (_ : IsAffine X) : AffineScheme := ⟨X, mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩ #align algebraic_geometry.AffineScheme.mk AlgebraicGeometry.AffineScheme.mk def AffineScheme.of (X : Scheme) [h : IsAffine X] : AffineScheme := AffineScheme.mk X h #align algebraic_geometry.AffineScheme.of AlgebraicGeometry.AffineScheme.of def AffineScheme.ofHom {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) : AffineScheme.of X ⟶ AffineScheme.of Y := f #align algebraic_geometry.AffineScheme.of_hom AlgebraicGeometry.AffineScheme.ofHom theorem mem_Spec_essImage (X : Scheme) : X ∈ Scheme.Spec.essImage ↔ IsAffine X := ⟨fun h => ⟨Functor.essImage.unit_isIso h⟩, fun _ => mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩ #align algebraic_geometry.mem_Spec_ess_image AlgebraicGeometry.mem_Spec_essImage instance isAffineAffineScheme (X : AffineScheme.{u}) : IsAffine X.obj := ⟨Functor.essImage.unit_isIso X.property⟩ #align algebraic_geometry.is_affine_AffineScheme AlgebraicGeometry.isAffineAffineScheme instance SpecIsAffine (R : CommRingCatᵒᵖ) : IsAffine (Scheme.Spec.obj R) := AlgebraicGeometry.isAffineAffineScheme ⟨_, Scheme.Spec.obj_mem_essImage R⟩ #align algebraic_geometry.Spec_is_affine AlgebraicGeometry.SpecIsAffine theorem isAffineOfIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] [h : IsAffine Y] : IsAffine X := by rw [← mem_Spec_essImage] at h ⊢; exact Functor.essImage.ofIso (asIso f).symm h #align algebraic_geometry.is_affine_of_iso AlgebraicGeometry.isAffineOfIso def IsAffineOpen {X : Scheme} (U : Opens X) : Prop := IsAffine (X ∣_ᵤ U) #align algebraic_geometry.is_affine_open AlgebraicGeometry.IsAffineOpen def Scheme.affineOpens (X : Scheme) : Set (Opens X) := {U : Opens X | IsAffineOpen U} #align algebraic_geometry.Scheme.affine_opens AlgebraicGeometry.Scheme.affineOpens instance {Y : Scheme.{u}} (U : Y.affineOpens) : IsAffine (Scheme.restrict Y <| Opens.openEmbedding U.val) := U.property theorem rangeIsAffineOpenOfOpenImmersion {X Y : Scheme} [IsAffine X] (f : X ⟶ Y) [H : IsOpenImmersion f] : IsAffineOpen (Scheme.Hom.opensRange f) := by refine isAffineOfIso (IsOpenImmersion.isoOfRangeEq f (Y.ofRestrict _) ?_).inv exact Subtype.range_val.symm #align algebraic_geometry.range_is_affine_open_of_open_immersion AlgebraicGeometry.rangeIsAffineOpenOfOpenImmersion theorem topIsAffineOpen (X : Scheme) [IsAffine X] : IsAffineOpen (⊤ : Opens X) := by convert rangeIsAffineOpenOfOpenImmersion (𝟙 X) ext1 exact Set.range_id.symm #align algebraic_geometry.top_is_affine_open AlgebraicGeometry.topIsAffineOpen instance Scheme.affineCoverIsAffine (X : Scheme) (i : X.affineCover.J) : IsAffine (X.affineCover.obj i) := AlgebraicGeometry.SpecIsAffine _ #align algebraic_geometry.Scheme.affine_cover_is_affine AlgebraicGeometry.Scheme.affineCoverIsAffine instance Scheme.affineBasisCoverIsAffine (X : Scheme) (i : X.affineBasisCover.J) : IsAffine (X.affineBasisCover.obj i) := AlgebraicGeometry.SpecIsAffine _ #align algebraic_geometry.Scheme.affine_basis_cover_is_affine AlgebraicGeometry.Scheme.affineBasisCoverIsAffine theorem isBasis_affine_open (X : Scheme) : Opens.IsBasis X.affineOpens := by rw [Opens.isBasis_iff_nbhd] rintro U x (hU : x ∈ (U : Set X)) obtain ⟨S, hS, hxS, hSU⟩ := X.affineBasisCover_is_basis.exists_subset_of_mem_open hU U.isOpen refine ⟨⟨S, X.affineBasisCover_is_basis.isOpen hS⟩, ?_, hxS, hSU⟩ rcases hS with ⟨i, rfl⟩ exact rangeIsAffineOpenOfOpenImmersion _ #align algebraic_geometry.is_basis_affine_open AlgebraicGeometry.isBasis_affine_open
Mathlib/AlgebraicGeometry/AffineScheme.lean
218
234
theorem Scheme.map_PrimeSpectrum_basicOpen_of_affine (X : Scheme) [IsAffine X] (f : Scheme.Γ.obj (op X)) : X.isoSpec.hom ⁻¹ᵁ PrimeSpectrum.basicOpen f = X.basicOpen f := by
rw [← basicOpen_eq_of_affine] trans X.isoSpec.hom ⁻¹ᵁ (Scheme.Spec.obj (op (Scheme.Γ.obj (op X)))).basicOpen ((inv (X.isoSpec.hom.1.c.app (op ((Opens.map (inv X.isoSpec.hom).val.base).obj ⊤)))) f) · congr rw [← IsIso.inv_eq_inv, IsIso.inv_inv, IsIso.Iso.inv_inv, NatIso.app_hom] -- Porting note: added this `change` to prevent timeout change SpecΓIdentity.hom.app (X.presheaf.obj <| op ⊤) = _ rw [← ΓSpec.adjunction_unit_app_app_top X] rfl · dsimp refine (Scheme.preimage_basicOpen _ _).trans ?_ congr 1 exact IsIso.inv_hom_id_apply _ _
import Mathlib.Probability.Variance import Mathlib.MeasureTheory.Function.UniformIntegrable #align_import probability.ident_distrib from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open MeasureTheory Filter Finset noncomputable section open scoped Topology MeasureTheory ENNReal NNReal variable {α β γ δ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] [MeasurableSpace δ] namespace ProbabilityTheory structure IdentDistrib (f : α → γ) (g : β → γ) (μ : Measure α := by volume_tac) (ν : Measure β := by volume_tac) : Prop where aemeasurable_fst : AEMeasurable f μ aemeasurable_snd : AEMeasurable g ν map_eq : Measure.map f μ = Measure.map g ν #align probability_theory.ident_distrib ProbabilityTheory.IdentDistrib namespace IdentDistrib open TopologicalSpace variable {μ : Measure α} {ν : Measure β} {f : α → γ} {g : β → γ} protected theorem refl (hf : AEMeasurable f μ) : IdentDistrib f f μ μ := { aemeasurable_fst := hf aemeasurable_snd := hf map_eq := rfl } #align probability_theory.ident_distrib.refl ProbabilityTheory.IdentDistrib.refl protected theorem symm (h : IdentDistrib f g μ ν) : IdentDistrib g f ν μ := { aemeasurable_fst := h.aemeasurable_snd aemeasurable_snd := h.aemeasurable_fst map_eq := h.map_eq.symm } #align probability_theory.ident_distrib.symm ProbabilityTheory.IdentDistrib.symm protected theorem trans {ρ : Measure δ} {h : δ → γ} (h₁ : IdentDistrib f g μ ν) (h₂ : IdentDistrib g h ν ρ) : IdentDistrib f h μ ρ := { aemeasurable_fst := h₁.aemeasurable_fst aemeasurable_snd := h₂.aemeasurable_snd map_eq := h₁.map_eq.trans h₂.map_eq } #align probability_theory.ident_distrib.trans ProbabilityTheory.IdentDistrib.trans protected theorem comp_of_aemeasurable {u : γ → δ} (h : IdentDistrib f g μ ν) (hu : AEMeasurable u (Measure.map f μ)) : IdentDistrib (u ∘ f) (u ∘ g) μ ν := { aemeasurable_fst := hu.comp_aemeasurable h.aemeasurable_fst aemeasurable_snd := by rw [h.map_eq] at hu; exact hu.comp_aemeasurable h.aemeasurable_snd map_eq := by rw [← AEMeasurable.map_map_of_aemeasurable hu h.aemeasurable_fst, ← AEMeasurable.map_map_of_aemeasurable _ h.aemeasurable_snd, h.map_eq] rwa [← h.map_eq] } #align probability_theory.ident_distrib.comp_of_ae_measurable ProbabilityTheory.IdentDistrib.comp_of_aemeasurable protected theorem comp {u : γ → δ} (h : IdentDistrib f g μ ν) (hu : Measurable u) : IdentDistrib (u ∘ f) (u ∘ g) μ ν := h.comp_of_aemeasurable hu.aemeasurable #align probability_theory.ident_distrib.comp ProbabilityTheory.IdentDistrib.comp protected theorem of_ae_eq {g : α → γ} (hf : AEMeasurable f μ) (heq : f =ᵐ[μ] g) : IdentDistrib f g μ μ := { aemeasurable_fst := hf aemeasurable_snd := hf.congr heq map_eq := Measure.map_congr heq } #align probability_theory.ident_distrib.of_ae_eq ProbabilityTheory.IdentDistrib.of_ae_eq lemma _root_.MeasureTheory.AEMeasurable.identDistrib_mk (hf : AEMeasurable f μ) : IdentDistrib f (hf.mk f) μ μ := IdentDistrib.of_ae_eq hf hf.ae_eq_mk lemma _root_.MeasureTheory.AEStronglyMeasurable.identDistrib_mk [TopologicalSpace γ] [PseudoMetrizableSpace γ] [BorelSpace γ] (hf : AEStronglyMeasurable f μ) : IdentDistrib f (hf.mk f) μ μ := IdentDistrib.of_ae_eq hf.aemeasurable hf.ae_eq_mk theorem measure_mem_eq (h : IdentDistrib f g μ ν) {s : Set γ} (hs : MeasurableSet s) : μ (f ⁻¹' s) = ν (g ⁻¹' s) := by rw [← Measure.map_apply_of_aemeasurable h.aemeasurable_fst hs, ← Measure.map_apply_of_aemeasurable h.aemeasurable_snd hs, h.map_eq] #align probability_theory.ident_distrib.measure_mem_eq ProbabilityTheory.IdentDistrib.measure_mem_eq alias measure_preimage_eq := measure_mem_eq #align probability_theory.ident_distrib.measure_preimage_eq ProbabilityTheory.IdentDistrib.measure_preimage_eq
Mathlib/Probability/IdentDistrib.lean
141
145
theorem ae_snd (h : IdentDistrib f g μ ν) {p : γ → Prop} (pmeas : MeasurableSet {x | p x}) (hp : ∀ᵐ x ∂μ, p (f x)) : ∀ᵐ x ∂ν, p (g x) := by
apply (ae_map_iff h.aemeasurable_snd pmeas).1 rw [← h.map_eq] exact (ae_map_iff h.aemeasurable_fst pmeas).2 hp
import Mathlib.FieldTheory.Finite.Basic #align_import field_theory.chevalley_warning from "leanprover-community/mathlib"@"e001509c11c4d0f549d91d89da95b4a0b43c714f" universe u v section FiniteField open MvPolynomial open Function hiding eval open Finset FiniteField variable {K σ ι : Type*} [Fintype K] [Field K] [Fintype σ] [DecidableEq σ] local notation "q" => Fintype.card K
Mathlib/FieldTheory/ChevalleyWarning.lean
53
97
theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K) (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0 := by
haveI : DecidableEq K := Classical.decEq K calc ∑ x, eval x f = ∑ x : σ → K, ∑ d ∈ f.support, f.coeff d * ∏ i, x i ^ d i := by simp only [eval_eq'] _ = ∑ d ∈ f.support, ∑ x : σ → K, f.coeff d * ∏ i, x i ^ d i := sum_comm _ = 0 := sum_eq_zero ?_ intro d hd obtain ⟨i, hi⟩ : ∃ i, d i < q - 1 := f.exists_degree_lt (q - 1) h hd calc (∑ x : σ → K, f.coeff d * ∏ i, x i ^ d i) = f.coeff d * ∑ x : σ → K, ∏ i, x i ^ d i := (mul_sum ..).symm _ = 0 := (mul_eq_zero.mpr ∘ Or.inr) ?_ calc (∑ x : σ → K, ∏ i, x i ^ d i) = ∑ x₀ : { j // j ≠ i } → K, ∑ x : { x : σ → K // x ∘ (↑) = x₀ }, ∏ j, (x : σ → K) j ^ d j := (Fintype.sum_fiberwise _ _).symm _ = 0 := Fintype.sum_eq_zero _ ?_ intro x₀ let e : K ≃ { x // x ∘ ((↑) : _ → σ) = x₀ } := (Equiv.subtypeEquivCodomain _).symm calc (∑ x : { x : σ → K // x ∘ (↑) = x₀ }, ∏ j, (x : σ → K) j ^ d j) = ∑ a : K, ∏ j : σ, (e a : σ → K) j ^ d j := (e.sum_comp _).symm _ = ∑ a : K, (∏ j, x₀ j ^ d j) * a ^ d i := Fintype.sum_congr _ _ ?_ _ = (∏ j, x₀ j ^ d j) * ∑ a : K, a ^ d i := by rw [mul_sum] _ = 0 := by rw [sum_pow_lt_card_sub_one K _ hi, mul_zero] intro a let e' : Sum { j // j = i } { j // j ≠ i } ≃ σ := Equiv.sumCompl _ letI : Unique { j // j = i } := { default := ⟨i, rfl⟩ uniq := fun ⟨j, h⟩ => Subtype.val_injective h } calc (∏ j : σ, (e a : σ → K) j ^ d j) = (e a : σ → K) i ^ d i * ∏ j : { j // j ≠ i }, (e a : σ → K) j ^ d j := by rw [← e'.prod_comp, Fintype.prod_sum_type, univ_unique, prod_singleton]; rfl _ = a ^ d i * ∏ j : { j // j ≠ i }, (e a : σ → K) j ^ d j := by rw [Equiv.subtypeEquivCodomain_symm_apply_eq] _ = a ^ d i * ∏ j, x₀ j ^ d j := congr_arg _ (Fintype.prod_congr _ _ ?_) -- see below _ = (∏ j, x₀ j ^ d j) * a ^ d i := mul_comm _ _ -- the remaining step of the calculation above rintro ⟨j, hj⟩ show (e a : σ → K) j ^ d j = x₀ ⟨j, hj⟩ ^ d j rw [Equiv.subtypeEquivCodomain_symm_apply_ne]
import Mathlib.AlgebraicTopology.SimplexCategory import Mathlib.CategoryTheory.Comma.Arrow import Mathlib.CategoryTheory.Limits.FunctorCategory import Mathlib.CategoryTheory.Opposites #align_import algebraic_topology.simplicial_object from "leanprover-community/mathlib"@"5ed51dc37c6b891b79314ee11a50adc2b1df6fd6" open Opposite open CategoryTheory open CategoryTheory.Limits universe v u v' u' namespace CategoryTheory variable (C : Type u) [Category.{v} C] -- porting note (#5171): removed @[nolint has_nonempty_instance] def SimplicialObject := SimplexCategoryᵒᵖ ⥤ C #align category_theory.simplicial_object CategoryTheory.SimplicialObject @[simps!] instance : Category (SimplicialObject C) := by dsimp only [SimplicialObject] infer_instance namespace SimplicialObject set_option quotPrecheck false in scoped[Simplicial] notation3:1000 X " _[" n "]" => (X : CategoryTheory.SimplicialObject _).obj (Opposite.op (SimplexCategory.mk n)) open Simplicial instance {J : Type v} [SmallCategory J] [HasLimitsOfShape J C] : HasLimitsOfShape J (SimplicialObject C) := by dsimp [SimplicialObject] infer_instance instance [HasLimits C] : HasLimits (SimplicialObject C) := ⟨inferInstance⟩ instance {J : Type v} [SmallCategory J] [HasColimitsOfShape J C] : HasColimitsOfShape J (SimplicialObject C) := by dsimp [SimplicialObject] infer_instance instance [HasColimits C] : HasColimits (SimplicialObject C) := ⟨inferInstance⟩ variable {C} -- Porting note (#10688): added to ease automation @[ext] lemma hom_ext {X Y : SimplicialObject C} (f g : X ⟶ Y) (h : ∀ (n : SimplexCategoryᵒᵖ), f.app n = g.app n) : f = g := NatTrans.ext _ _ (by ext; apply h) variable (X : SimplicialObject C) def δ {n} (i : Fin (n + 2)) : X _[n + 1] ⟶ X _[n] := X.map (SimplexCategory.δ i).op #align category_theory.simplicial_object.δ CategoryTheory.SimplicialObject.δ def σ {n} (i : Fin (n + 1)) : X _[n] ⟶ X _[n + 1] := X.map (SimplexCategory.σ i).op #align category_theory.simplicial_object.σ CategoryTheory.SimplicialObject.σ def eqToIso {n m : ℕ} (h : n = m) : X _[n] ≅ X _[m] := X.mapIso (CategoryTheory.eqToIso (by congr)) #align category_theory.simplicial_object.eq_to_iso CategoryTheory.SimplicialObject.eqToIso @[simp] theorem eqToIso_refl {n : ℕ} (h : n = n) : X.eqToIso h = Iso.refl _ := by ext simp [eqToIso] #align category_theory.simplicial_object.eq_to_iso_refl CategoryTheory.SimplicialObject.eqToIso_refl @[reassoc] theorem δ_comp_δ {n} {i j : Fin (n + 2)} (H : i ≤ j) : X.δ j.succ ≫ X.δ i = X.δ (Fin.castSucc i) ≫ X.δ j := by dsimp [δ] simp only [← X.map_comp, ← op_comp, SimplexCategory.δ_comp_δ H] #align category_theory.simplicial_object.δ_comp_δ CategoryTheory.SimplicialObject.δ_comp_δ @[reassoc] theorem δ_comp_δ' {n} {i : Fin (n + 2)} {j : Fin (n + 3)} (H : Fin.castSucc i < j) : X.δ j ≫ X.δ i = X.δ (Fin.castSucc i) ≫ X.δ (j.pred fun (hj : j = 0) => by simp [hj, Fin.not_lt_zero] at H) := by dsimp [δ] simp only [← X.map_comp, ← op_comp, SimplexCategory.δ_comp_δ' H] #align category_theory.simplicial_object.δ_comp_δ' CategoryTheory.SimplicialObject.δ_comp_δ' @[reassoc] theorem δ_comp_δ'' {n} {i : Fin (n + 3)} {j : Fin (n + 2)} (H : i ≤ Fin.castSucc j) : X.δ j.succ ≫ X.δ (i.castLT (Nat.lt_of_le_of_lt (Fin.le_iff_val_le_val.mp H) j.is_lt)) = X.δ i ≫ X.δ j := by dsimp [δ] simp only [← X.map_comp, ← op_comp, SimplexCategory.δ_comp_δ'' H] #align category_theory.simplicial_object.δ_comp_δ'' CategoryTheory.SimplicialObject.δ_comp_δ'' @[reassoc] theorem δ_comp_δ_self {n} {i : Fin (n + 2)} : X.δ (Fin.castSucc i) ≫ X.δ i = X.δ i.succ ≫ X.δ i := by dsimp [δ] simp only [← X.map_comp, ← op_comp, SimplexCategory.δ_comp_δ_self] #align category_theory.simplicial_object.δ_comp_δ_self CategoryTheory.SimplicialObject.δ_comp_δ_self @[reassoc] theorem δ_comp_δ_self' {n} {j : Fin (n + 3)} {i : Fin (n + 2)} (H : j = Fin.castSucc i) : X.δ j ≫ X.δ i = X.δ i.succ ≫ X.δ i := by subst H rw [δ_comp_δ_self] #align category_theory.simplicial_object.δ_comp_δ_self' CategoryTheory.SimplicialObject.δ_comp_δ_self' @[reassoc]
Mathlib/AlgebraicTopology/SimplicialObject.lean
146
149
theorem δ_comp_σ_of_le {n} {i : Fin (n + 2)} {j : Fin (n + 1)} (H : i ≤ Fin.castSucc j) : X.σ j.succ ≫ X.δ (Fin.castSucc i) = X.δ i ≫ X.σ j := by
dsimp [δ, σ] simp only [← X.map_comp, ← op_comp, SimplexCategory.δ_comp_σ_of_le H]
import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar import Mathlib.MeasureTheory.Integral.SetIntegral #align_import measure_theory.measure.haar.normed_space from "leanprover-community/mathlib"@"b84aee748341da06a6d78491367e2c0e9f15e8a5" noncomputable section open scoped NNReal ENNReal Pointwise Topology open Inv Set Function MeasureTheory.Measure Filter open FiniteDimensional namespace MeasureTheory namespace Measure example {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [Nontrivial E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] (μ : Measure E) [IsAddHaarMeasure μ] : NoAtoms μ := by infer_instance variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] (μ : Measure E) [IsAddHaarMeasure μ] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] variable {s : Set E}
Mathlib/MeasureTheory/Measure/Haar/NormedSpace.lean
64
83
theorem integral_comp_smul (f : E → F) (R : ℝ) : ∫ x, f (R • x) ∂μ = |(R ^ finrank ℝ E)⁻¹| • ∫ x, f x ∂μ := by
by_cases hF : CompleteSpace F; swap · simp [integral, hF] rcases eq_or_ne R 0 with (rfl | hR) · simp only [zero_smul, integral_const] rcases Nat.eq_zero_or_pos (finrank ℝ E) with (hE | hE) · have : Subsingleton E := finrank_zero_iff.1 hE have : f = fun _ => f 0 := by ext x; rw [Subsingleton.elim x 0] conv_rhs => rw [this] simp only [hE, pow_zero, inv_one, abs_one, one_smul, integral_const] · have : Nontrivial E := finrank_pos_iff.1 hE simp only [zero_pow hE.ne', measure_univ_of_isAddLeftInvariant, ENNReal.top_toReal, zero_smul, inv_zero, abs_zero] · calc (∫ x, f (R • x) ∂μ) = ∫ y, f y ∂Measure.map (fun x => R • x) μ := (integral_map_equiv (Homeomorph.smul (isUnit_iff_ne_zero.2 hR).unit).toMeasurableEquiv f).symm _ = |(R ^ finrank ℝ E)⁻¹| • ∫ x, f x ∂μ := by simp only [map_addHaar_smul μ hR, integral_smul_measure, ENNReal.toReal_ofReal, abs_nonneg]
import Mathlib.Analysis.NormedSpace.PiLp import Mathlib.Analysis.InnerProductSpace.PiL2 #align_import analysis.matrix from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section open scoped NNReal Matrix namespace Matrix variable {R l m n α β : Type*} [Fintype l] [Fintype m] [Fintype n] section LinfLinf section SeminormedAddCommGroup variable [SeminormedAddCommGroup α] [SeminormedAddCommGroup β] protected def seminormedAddCommGroup : SeminormedAddCommGroup (Matrix m n α) := Pi.seminormedAddCommGroup #align matrix.seminormed_add_comm_group Matrix.seminormedAddCommGroup attribute [local instance] Matrix.seminormedAddCommGroup -- Porting note (#10756): new theorem (along with all the uses of this lemma below) theorem norm_def (A : Matrix m n α) : ‖A‖ = ‖fun i j => A i j‖ := rfl lemma norm_eq_sup_sup_nnnorm (A : Matrix m n α) : ‖A‖ = Finset.sup Finset.univ fun i ↦ Finset.sup Finset.univ fun j ↦ ‖A i j‖₊ := by simp_rw [Matrix.norm_def, Pi.norm_def, Pi.nnnorm_def] -- Porting note (#10756): new theorem (along with all the uses of this lemma below) theorem nnnorm_def (A : Matrix m n α) : ‖A‖₊ = ‖fun i j => A i j‖₊ := rfl theorem norm_le_iff {r : ℝ} (hr : 0 ≤ r) {A : Matrix m n α} : ‖A‖ ≤ r ↔ ∀ i j, ‖A i j‖ ≤ r := by simp_rw [norm_def, pi_norm_le_iff_of_nonneg hr] #align matrix.norm_le_iff Matrix.norm_le_iff theorem nnnorm_le_iff {r : ℝ≥0} {A : Matrix m n α} : ‖A‖₊ ≤ r ↔ ∀ i j, ‖A i j‖₊ ≤ r := by simp_rw [nnnorm_def, pi_nnnorm_le_iff] #align matrix.nnnorm_le_iff Matrix.nnnorm_le_iff
Mathlib/Analysis/Matrix.lean
98
99
theorem norm_lt_iff {r : ℝ} (hr : 0 < r) {A : Matrix m n α} : ‖A‖ < r ↔ ∀ i j, ‖A i j‖ < r := by
simp_rw [norm_def, pi_norm_lt_iff hr]
import Mathlib.Analysis.Calculus.FDeriv.Equiv import Mathlib.Analysis.Calculus.FormalMultilinearSeries #align_import analysis.calculus.cont_diff_def from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14" noncomputable section open scoped Classical open NNReal Topology Filter local notation "∞" => (⊤ : ℕ∞) open Set Fin Filter Function universe u uE uF uG uX variable {𝕜 : Type u} [NontriviallyNormedField 𝕜] {E : Type uE} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace 𝕜 G] {X : Type uX} [NormedAddCommGroup X] [NormedSpace 𝕜 X] {s s₁ t u : Set E} {f f₁ : E → F} {g : F → G} {x x₀ : E} {c : F} {m n : ℕ∞} {p : E → FormalMultilinearSeries 𝕜 E F} structure HasFTaylorSeriesUpToOn (n : ℕ∞) (f : E → F) (p : E → FormalMultilinearSeries 𝕜 E F) (s : Set E) : Prop where zero_eq : ∀ x ∈ s, (p x 0).uncurry0 = f x protected fderivWithin : ∀ m : ℕ, (m : ℕ∞) < n → ∀ x ∈ s, HasFDerivWithinAt (p · m) (p x m.succ).curryLeft s x cont : ∀ m : ℕ, (m : ℕ∞) ≤ n → ContinuousOn (p · m) s #align has_ftaylor_series_up_to_on HasFTaylorSeriesUpToOn theorem HasFTaylorSeriesUpToOn.zero_eq' (h : HasFTaylorSeriesUpToOn n f p s) {x : E} (hx : x ∈ s) : p x 0 = (continuousMultilinearCurryFin0 𝕜 E F).symm (f x) := by rw [← h.zero_eq x hx] exact (p x 0).uncurry0_curry0.symm #align has_ftaylor_series_up_to_on.zero_eq' HasFTaylorSeriesUpToOn.zero_eq' theorem HasFTaylorSeriesUpToOn.congr (h : HasFTaylorSeriesUpToOn n f p s) (h₁ : ∀ x ∈ s, f₁ x = f x) : HasFTaylorSeriesUpToOn n f₁ p s := by refine ⟨fun x hx => ?_, h.fderivWithin, h.cont⟩ rw [h₁ x hx] exact h.zero_eq x hx #align has_ftaylor_series_up_to_on.congr HasFTaylorSeriesUpToOn.congr theorem HasFTaylorSeriesUpToOn.mono (h : HasFTaylorSeriesUpToOn n f p s) {t : Set E} (hst : t ⊆ s) : HasFTaylorSeriesUpToOn n f p t := ⟨fun x hx => h.zero_eq x (hst hx), fun m hm x hx => (h.fderivWithin m hm x (hst hx)).mono hst, fun m hm => (h.cont m hm).mono hst⟩ #align has_ftaylor_series_up_to_on.mono HasFTaylorSeriesUpToOn.mono theorem HasFTaylorSeriesUpToOn.of_le (h : HasFTaylorSeriesUpToOn n f p s) (hmn : m ≤ n) : HasFTaylorSeriesUpToOn m f p s := ⟨h.zero_eq, fun k hk x hx => h.fderivWithin k (lt_of_lt_of_le hk hmn) x hx, fun k hk => h.cont k (le_trans hk hmn)⟩ #align has_ftaylor_series_up_to_on.of_le HasFTaylorSeriesUpToOn.of_le theorem HasFTaylorSeriesUpToOn.continuousOn (h : HasFTaylorSeriesUpToOn n f p s) : ContinuousOn f s := by have := (h.cont 0 bot_le).congr fun x hx => (h.zero_eq' hx).symm rwa [← (continuousMultilinearCurryFin0 𝕜 E F).symm.comp_continuousOn_iff] #align has_ftaylor_series_up_to_on.continuous_on HasFTaylorSeriesUpToOn.continuousOn
Mathlib/Analysis/Calculus/ContDiff/Defs.lean
229
237
theorem hasFTaylorSeriesUpToOn_zero_iff : HasFTaylorSeriesUpToOn 0 f p s ↔ ContinuousOn f s ∧ ∀ x ∈ s, (p x 0).uncurry0 = f x := by
refine ⟨fun H => ⟨H.continuousOn, H.zero_eq⟩, fun H => ⟨H.2, fun m hm => False.elim (not_le.2 hm bot_le), fun m hm ↦ ?_⟩⟩ obtain rfl : m = 0 := mod_cast hm.antisymm (zero_le _) have : EqOn (p · 0) ((continuousMultilinearCurryFin0 𝕜 E F).symm ∘ f) s := fun x hx ↦ (continuousMultilinearCurryFin0 𝕜 E F).eq_symm_apply.2 (H.2 x hx) rw [continuousOn_congr this, LinearIsometryEquiv.comp_continuousOn_iff] exact H.1
import Mathlib.CategoryTheory.Limits.Shapes.Images import Mathlib.CategoryTheory.Limits.Constructions.EpiMono #align_import category_theory.limits.preserves.shapes.images from "leanprover-community/mathlib"@"fc78e3c190c72a109699385da6be2725e88df841" noncomputable section namespace CategoryTheory namespace PreservesImage open CategoryTheory open CategoryTheory.Limits universe u₁ u₂ v₁ v₂ variable {A : Type u₁} {B : Type u₂} [Category.{v₁} A] [Category.{v₂} B] variable [HasEqualizers A] [HasImages A] variable [StrongEpiCategory B] [HasImages B] variable (L : A ⥤ B) variable [∀ {X Y Z : A} (f : X ⟶ Z) (g : Y ⟶ Z), PreservesLimit (cospan f g) L] variable [∀ {X Y Z : A} (f : X ⟶ Y) (g : X ⟶ Z), PreservesColimit (span f g) L] @[simps!] def iso {X Y : A} (f : X ⟶ Y) : image (L.map f) ≅ L.obj (image f) := let aux1 : StrongEpiMonoFactorisation (L.map f) := { I := L.obj (Limits.image f) m := L.map <| Limits.image.ι _ m_mono := preserves_mono_of_preservesLimit _ _ e := L.map <| factorThruImage _ e_strong_epi := @strongEpi_of_epi B _ _ _ _ _ (preserves_epi_of_preservesColimit L _) fac := by rw [← L.map_comp, Limits.image.fac] } IsImage.isoExt (Image.isImage (L.map f)) aux1.toMonoIsImage #align category_theory.preserves_image.iso CategoryTheory.PreservesImage.iso @[reassoc] theorem factorThruImage_comp_hom {X Y : A} (f : X ⟶ Y) : factorThruImage (L.map f) ≫ (iso L f).hom = L.map (factorThruImage f) := by simp #align category_theory.preserves_image.factor_thru_image_comp_hom CategoryTheory.PreservesImage.factorThruImage_comp_hom @[reassoc]
Mathlib/CategoryTheory/Limits/Preserves/Shapes/Images.lean
57
58
theorem hom_comp_map_image_ι {X Y : A} (f : X ⟶ Y) : (iso L f).hom ≫ L.map (image.ι f) = image.ι (L.map f) := by
rw [iso_hom, image.lift_fac]
import Mathlib.Analysis.Complex.CauchyIntegral import Mathlib.Analysis.Calculus.FDeriv.Analytic import Mathlib.Analysis.NormedSpace.Completion #align_import analysis.complex.liouville from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open TopologicalSpace Metric Set Filter Asymptotics Function MeasureTheory Bornology open scoped Topology Filter NNReal Real universe u v variable {E : Type u} [NormedAddCommGroup E] [NormedSpace ℂ E] {F : Type v} [NormedAddCommGroup F] [NormedSpace ℂ F] local postfix:100 "̂" => UniformSpace.Completion namespace Complex theorem deriv_eq_smul_circleIntegral [CompleteSpace F] {R : ℝ} {c : ℂ} {f : ℂ → F} (hR : 0 < R) (hf : DiffContOnCl ℂ f (ball c R)) : deriv f c = (2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - c) ^ (-2 : ℤ) • f z := by lift R to ℝ≥0 using hR.le refine (hf.hasFPowerSeriesOnBall hR).hasFPowerSeriesAt.deriv.trans ?_ simp only [cauchyPowerSeries_apply, one_div, zpow_neg, pow_one, smul_smul, zpow_two, mul_inv] #align complex.deriv_eq_smul_circle_integral Complex.deriv_eq_smul_circleIntegral theorem norm_deriv_le_aux [CompleteSpace F] {c : ℂ} {R C : ℝ} {f : ℂ → F} (hR : 0 < R) (hf : DiffContOnCl ℂ f (ball c R)) (hC : ∀ z ∈ sphere c R, ‖f z‖ ≤ C) : ‖deriv f c‖ ≤ C / R := by have : ∀ z ∈ sphere c R, ‖(z - c) ^ (-2 : ℤ) • f z‖ ≤ C / (R * R) := fun z (hz : abs (z - c) = R) => by simpa [-mul_inv_rev, norm_smul, hz, zpow_two, ← div_eq_inv_mul] using (div_le_div_right (mul_pos hR hR)).2 (hC z hz) calc ‖deriv f c‖ = ‖(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - c) ^ (-2 : ℤ) • f z‖ := congr_arg norm (deriv_eq_smul_circleIntegral hR hf) _ ≤ R * (C / (R * R)) := (circleIntegral.norm_two_pi_i_inv_smul_integral_le_of_norm_le_const hR.le this) _ = C / R := by rw [mul_div_left_comm, div_self_mul_self', div_eq_mul_inv] #align complex.norm_deriv_le_aux Complex.norm_deriv_le_aux
Mathlib/Analysis/Complex/Liouville.lean
71
84
theorem norm_deriv_le_of_forall_mem_sphere_norm_le {c : ℂ} {R C : ℝ} {f : ℂ → F} (hR : 0 < R) (hd : DiffContOnCl ℂ f (ball c R)) (hC : ∀ z ∈ sphere c R, ‖f z‖ ≤ C) : ‖deriv f c‖ ≤ C / R := by
set e : F →L[ℂ] F̂ := UniformSpace.Completion.toComplL have : HasDerivAt (e ∘ f) (e (deriv f c)) c := e.hasFDerivAt.comp_hasDerivAt c (hd.differentiableAt isOpen_ball <| mem_ball_self hR).hasDerivAt calc ‖deriv f c‖ = ‖deriv (e ∘ f) c‖ := by rw [this.deriv] exact (UniformSpace.Completion.norm_coe _).symm _ ≤ C / R := norm_deriv_le_aux hR (e.differentiable.comp_diffContOnCl hd) fun z hz => (UniformSpace.Completion.norm_coe _).trans_le (hC z hz)
import Mathlib.Control.Bitraversable.Basic #align_import control.bitraversable.lemmas from "leanprover-community/mathlib"@"58581d0fe523063f5651df0619be2bf65012a94a" universe u variable {t : Type u → Type u → Type u} [Bitraversable t] variable {β : Type u} namespace Bitraversable open Functor LawfulApplicative variable {F G : Type u → Type u} [Applicative F] [Applicative G] abbrev tfst {α α'} (f : α → F α') : t α β → F (t α' β) := bitraverse f pure #align bitraversable.tfst Bitraversable.tfst abbrev tsnd {α α'} (f : α → F α') : t β α → F (t β α') := bitraverse pure f #align bitraversable.tsnd Bitraversable.tsnd variable [LawfulBitraversable t] [LawfulApplicative F] [LawfulApplicative G] @[higher_order tfst_id] theorem id_tfst : ∀ {α β} (x : t α β), tfst (F := Id) pure x = pure x := id_bitraverse #align bitraversable.id_tfst Bitraversable.id_tfst @[higher_order tsnd_id] theorem id_tsnd : ∀ {α β} (x : t α β), tsnd (F := Id) pure x = pure x := id_bitraverse #align bitraversable.id_tsnd Bitraversable.id_tsnd @[higher_order tfst_comp_tfst] theorem comp_tfst {α₀ α₁ α₂ β} (f : α₀ → F α₁) (f' : α₁ → G α₂) (x : t α₀ β) : Comp.mk (tfst f' <$> tfst f x) = tfst (Comp.mk ∘ map f' ∘ f) x := by rw [← comp_bitraverse] simp only [Function.comp, tfst, map_pure, Pure.pure] #align bitraversable.comp_tfst Bitraversable.comp_tfst @[higher_order tfst_comp_tsnd] theorem tfst_tsnd {α₀ α₁ β₀ β₁} (f : α₀ → F α₁) (f' : β₀ → G β₁) (x : t α₀ β₀) : Comp.mk (tfst f <$> tsnd f' x) = bitraverse (Comp.mk ∘ pure ∘ f) (Comp.mk ∘ map pure ∘ f') x := by rw [← comp_bitraverse] simp only [Function.comp, map_pure] #align bitraversable.tfst_tsnd Bitraversable.tfst_tsnd @[higher_order tsnd_comp_tfst] theorem tsnd_tfst {α₀ α₁ β₀ β₁} (f : α₀ → F α₁) (f' : β₀ → G β₁) (x : t α₀ β₀) : Comp.mk (tsnd f' <$> tfst f x) = bitraverse (Comp.mk ∘ map pure ∘ f) (Comp.mk ∘ pure ∘ f') x := by rw [← comp_bitraverse] simp only [Function.comp, map_pure] #align bitraversable.tsnd_tfst Bitraversable.tsnd_tfst @[higher_order tsnd_comp_tsnd]
Mathlib/Control/Bitraversable/Lemmas.lean
95
99
theorem comp_tsnd {α β₀ β₁ β₂} (g : β₀ → F β₁) (g' : β₁ → G β₂) (x : t α β₀) : Comp.mk (tsnd g' <$> tsnd g x) = tsnd (Comp.mk ∘ map g' ∘ g) x := by
rw [← comp_bitraverse] simp only [Function.comp, map_pure] rfl
import Mathlib.Analysis.Calculus.FDeriv.Bilinear #align_import analysis.calculus.fderiv.mul from "leanprover-community/mathlib"@"d608fc5d4e69d4cc21885913fb573a88b0deb521" open scoped Classical open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal 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} section Mul variable {𝔸 𝔸' : Type*} [NormedRing 𝔸] [NormedCommRing 𝔸'] [NormedAlgebra 𝕜 𝔸] [NormedAlgebra 𝕜 𝔸'] {a b : E → 𝔸} {a' b' : E →L[𝕜] 𝔸} {c d : E → 𝔸'} {c' d' : E →L[𝕜] 𝔸'} @[fun_prop] theorem HasStrictFDerivAt.mul' {x : E} (ha : HasStrictFDerivAt a a' x) (hb : HasStrictFDerivAt b b' x) : HasStrictFDerivAt (fun y => a y * b y) (a x • b' + a'.smulRight (b x)) x := ((ContinuousLinearMap.mul 𝕜 𝔸).isBoundedBilinearMap.hasStrictFDerivAt (a x, b x)).comp x (ha.prod hb) #align has_strict_fderiv_at.mul' HasStrictFDerivAt.mul' @[fun_prop] theorem HasStrictFDerivAt.mul (hc : HasStrictFDerivAt c c' x) (hd : HasStrictFDerivAt d d' x) : HasStrictFDerivAt (fun y => c y * d y) (c x • d' + d x • c') x := by convert hc.mul' hd ext z apply mul_comm #align has_strict_fderiv_at.mul HasStrictFDerivAt.mul @[fun_prop] theorem HasFDerivWithinAt.mul' (ha : HasFDerivWithinAt a a' s x) (hb : HasFDerivWithinAt b b' s x) : HasFDerivWithinAt (fun y => a y * b y) (a x • b' + a'.smulRight (b x)) s x := ((ContinuousLinearMap.mul 𝕜 𝔸).isBoundedBilinearMap.hasFDerivAt (a x, b x)).comp_hasFDerivWithinAt x (ha.prod hb) #align has_fderiv_within_at.mul' HasFDerivWithinAt.mul' @[fun_prop]
Mathlib/Analysis/Calculus/FDeriv/Mul.lean
391
395
theorem HasFDerivWithinAt.mul (hc : HasFDerivWithinAt c c' s x) (hd : HasFDerivWithinAt d d' s x) : HasFDerivWithinAt (fun y => c y * d y) (c x • d' + d x • c') s x := by
convert hc.mul' hd ext z apply mul_comm
import Mathlib.Algebra.EuclideanDomain.Defs import Mathlib.Algebra.Ring.Divisibility.Basic import Mathlib.Algebra.Ring.Regular import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Algebra.Ring.Basic #align_import algebra.euclidean_domain.basic from "leanprover-community/mathlib"@"bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6" universe u namespace EuclideanDomain variable {R : Type u} variable [EuclideanDomain R] local infixl:50 " ≺ " => EuclideanDomain.R -- See note [lower instance priority] instance (priority := 100) toMulDivCancelClass : MulDivCancelClass R where mul_div_cancel a b hb := by refine (eq_of_sub_eq_zero ?_).symm by_contra h have := mul_right_not_lt b h rw [sub_mul, mul_comm (_ / _), sub_eq_iff_eq_add'.2 (div_add_mod (a * b) b).symm] at this exact this (mod_lt _ hb) #align euclidean_domain.mul_div_cancel_left mul_div_cancel_left₀ #align euclidean_domain.mul_div_cancel mul_div_cancel_right₀ @[simp] theorem mod_eq_zero {a b : R} : a % b = 0 ↔ b ∣ a := ⟨fun h => by rw [← div_add_mod a b, h, add_zero] exact dvd_mul_right _ _, fun ⟨c, e⟩ => by rw [e, ← add_left_cancel_iff, div_add_mod, add_zero] haveI := Classical.dec by_cases b0 : b = 0 · simp only [b0, zero_mul] · rw [mul_div_cancel_left₀ _ b0]⟩ #align euclidean_domain.mod_eq_zero EuclideanDomain.mod_eq_zero @[simp] theorem mod_self (a : R) : a % a = 0 := mod_eq_zero.2 dvd_rfl #align euclidean_domain.mod_self EuclideanDomain.mod_self theorem dvd_mod_iff {a b c : R} (h : c ∣ b) : c ∣ a % b ↔ c ∣ a := by rw [← dvd_add_right (h.mul_right _), div_add_mod] #align euclidean_domain.dvd_mod_iff EuclideanDomain.dvd_mod_iff @[simp] theorem mod_one (a : R) : a % 1 = 0 := mod_eq_zero.2 (one_dvd _) #align euclidean_domain.mod_one EuclideanDomain.mod_one @[simp] theorem zero_mod (b : R) : 0 % b = 0 := mod_eq_zero.2 (dvd_zero _) #align euclidean_domain.zero_mod EuclideanDomain.zero_mod @[simp] theorem zero_div {a : R} : 0 / a = 0 := by_cases (fun a0 : a = 0 => a0.symm ▸ div_zero 0) fun a0 => by simpa only [zero_mul] using mul_div_cancel_right₀ 0 a0 #align euclidean_domain.zero_div EuclideanDomain.zero_div @[simp] theorem div_self {a : R} (a0 : a ≠ 0) : a / a = 1 := by simpa only [one_mul] using mul_div_cancel_right₀ 1 a0 #align euclidean_domain.div_self EuclideanDomain.div_self theorem eq_div_of_mul_eq_left {a b c : R} (hb : b ≠ 0) (h : a * b = c) : a = c / b := by rw [← h, mul_div_cancel_right₀ _ hb] #align euclidean_domain.eq_div_of_mul_eq_left EuclideanDomain.eq_div_of_mul_eq_left theorem eq_div_of_mul_eq_right {a b c : R} (ha : a ≠ 0) (h : a * b = c) : b = c / a := by rw [← h, mul_div_cancel_left₀ _ ha] #align euclidean_domain.eq_div_of_mul_eq_right EuclideanDomain.eq_div_of_mul_eq_right
Mathlib/Algebra/EuclideanDomain/Basic.lean
96
101
theorem mul_div_assoc (x : R) {y z : R} (h : z ∣ y) : x * y / z = x * (y / z) := by
by_cases hz : z = 0 · subst hz rw [div_zero, div_zero, mul_zero] rcases h with ⟨p, rfl⟩ rw [mul_div_cancel_left₀ _ hz, mul_left_comm, mul_div_cancel_left₀ _ hz]
import Mathlib.Analysis.Convex.Topology import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.Topology.Algebra.Module.Cardinality open Convex Set Metric section TopologicalVectorSpace variable {E : Type*} [AddCommGroup E] [Module ℝ E] [TopologicalSpace E] [ContinuousAdd E] [ContinuousSMul ℝ E]
Mathlib/Analysis/NormedSpace/Connected.lean
34
103
theorem Set.Countable.isPathConnected_compl_of_one_lt_rank (h : 1 < Module.rank ℝ E) {s : Set E} (hs : s.Countable) : IsPathConnected sᶜ := by
have : Nontrivial E := (rank_pos_iff_nontrivial (R := ℝ)).1 (zero_lt_one.trans h) -- the set `sᶜ` is dense, therefore nonempty. Pick `a ∈ sᶜ`. We have to show that any -- `b ∈ sᶜ` can be joined to `a`. obtain ⟨a, ha⟩ : sᶜ.Nonempty := (hs.dense_compl ℝ).nonempty refine ⟨a, ha, ?_⟩ intro b hb rcases eq_or_ne a b with rfl|hab · exact JoinedIn.refl ha /- Assume `b ≠ a`. Write `a = c - x` and `b = c + x` for some nonzero `x`. Choose `y` which is linearly independent from `x`. Then the segments joining `a = c - x` to `c + ty` are pairwise disjoint for varying `t` (except for the endpoint `a`) so only countably many of them can intersect `s`. In the same way, there are countably many `t`s for which the segment from `b = c + x` to `c + ty` intersects `s`. Choosing `t` outside of these countable exceptions, one gets a path in the complement of `s` from `a` to `z = c + ty` and then to `b`. -/ let c := (2 : ℝ)⁻¹ • (a + b) let x := (2 : ℝ)⁻¹ • (b - a) have Ia : c - x = a := by simp only [c, x, smul_add, smul_sub] abel_nf simp [zsmul_eq_smul_cast ℝ 2] have Ib : c + x = b := by simp only [c, x, smul_add, smul_sub] abel_nf simp [zsmul_eq_smul_cast ℝ 2] have x_ne_zero : x ≠ 0 := by simpa [x] using sub_ne_zero.2 hab.symm obtain ⟨y, hy⟩ : ∃ y, LinearIndependent ℝ ![x, y] := exists_linearIndependent_pair_of_one_lt_rank h x_ne_zero have A : Set.Countable {t : ℝ | ([c + x -[ℝ] c + t • y] ∩ s).Nonempty} := by apply countable_setOf_nonempty_of_disjoint _ (fun t ↦ inter_subset_right) hs intro t t' htt' apply disjoint_iff_inter_eq_empty.2 have N : {c + x} ∩ s = ∅ := by simpa only [singleton_inter_eq_empty, mem_compl_iff, Ib] using hb rw [inter_assoc, inter_comm s, inter_assoc, inter_self, ← inter_assoc, ← subset_empty_iff, ← N] apply inter_subset_inter_left apply Eq.subset apply segment_inter_eq_endpoint_of_linearIndependent_of_ne hy htt'.symm have B : Set.Countable {t : ℝ | ([c - x -[ℝ] c + t • y] ∩ s).Nonempty} := by apply countable_setOf_nonempty_of_disjoint _ (fun t ↦ inter_subset_right) hs intro t t' htt' apply disjoint_iff_inter_eq_empty.2 have N : {c - x} ∩ s = ∅ := by simpa only [singleton_inter_eq_empty, mem_compl_iff, Ia] using ha rw [inter_assoc, inter_comm s, inter_assoc, inter_self, ← inter_assoc, ← subset_empty_iff, ← N] apply inter_subset_inter_left rw [sub_eq_add_neg _ x] apply Eq.subset apply segment_inter_eq_endpoint_of_linearIndependent_of_ne _ htt'.symm convert hy.units_smul ![-1, 1] simp [← List.ofFn_inj] obtain ⟨t, ht⟩ : Set.Nonempty ({t : ℝ | ([c + x -[ℝ] c + t • y] ∩ s).Nonempty} ∪ {t : ℝ | ([c - x -[ℝ] c + t • y] ∩ s).Nonempty})ᶜ := ((A.union B).dense_compl ℝ).nonempty let z := c + t • y simp only [compl_union, mem_inter_iff, mem_compl_iff, mem_setOf_eq, not_nonempty_iff_eq_empty] at ht have JA : JoinedIn sᶜ a z := by apply JoinedIn.of_segment_subset rw [subset_compl_iff_disjoint_right, disjoint_iff_inter_eq_empty] convert ht.2 exact Ia.symm have JB : JoinedIn sᶜ b z := by apply JoinedIn.of_segment_subset rw [subset_compl_iff_disjoint_right, disjoint_iff_inter_eq_empty] convert ht.1 exact Ib.symm exact JA.trans JB.symm
import Mathlib.Order.PartialSups #align_import order.disjointed from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" variable {α β : Type*} section GeneralizedBooleanAlgebra variable [GeneralizedBooleanAlgebra α] def disjointed (f : ℕ → α) : ℕ → α | 0 => f 0 | n + 1 => f (n + 1) \ partialSups f n #align disjointed disjointed @[simp] theorem disjointed_zero (f : ℕ → α) : disjointed f 0 = f 0 := rfl #align disjointed_zero disjointed_zero theorem disjointed_succ (f : ℕ → α) (n : ℕ) : disjointed f (n + 1) = f (n + 1) \ partialSups f n := rfl #align disjointed_succ disjointed_succ theorem disjointed_le_id : disjointed ≤ (id : (ℕ → α) → ℕ → α) := by rintro f n cases n · rfl · exact sdiff_le #align disjointed_le_id disjointed_le_id theorem disjointed_le (f : ℕ → α) : disjointed f ≤ f := disjointed_le_id f #align disjointed_le disjointed_le theorem disjoint_disjointed (f : ℕ → α) : Pairwise (Disjoint on disjointed f) := by refine (Symmetric.pairwise_on Disjoint.symm _).2 fun m n h => ?_ cases n · exact (Nat.not_lt_zero _ h).elim exact disjoint_sdiff_self_right.mono_left ((disjointed_le f m).trans (le_partialSups_of_le f (Nat.lt_add_one_iff.1 h))) #align disjoint_disjointed disjoint_disjointed -- Porting note: `disjointedRec` had a change in universe level. def disjointedRec {f : ℕ → α} {p : α → Sort*} (hdiff : ∀ ⦃t i⦄, p t → p (t \ f i)) : ∀ ⦃n⦄, p (f n) → p (disjointed f n) | 0 => id | n + 1 => fun h => by suffices H : ∀ k, p (f (n + 1) \ partialSups f k) from H n rintro k induction' k with k ih · exact hdiff h rw [partialSups_succ, ← sdiff_sdiff_left] exact hdiff ih #align disjointed_rec disjointedRec @[simp] theorem disjointedRec_zero {f : ℕ → α} {p : α → Sort*} (hdiff : ∀ ⦃t i⦄, p t → p (t \ f i)) (h₀ : p (f 0)) : disjointedRec hdiff h₀ = h₀ := rfl #align disjointed_rec_zero disjointedRec_zero -- TODO: Find a useful statement of `disjointedRec_succ`. protected lemma Monotone.disjointed_succ {f : ℕ → α} (hf : Monotone f) (n : ℕ) : disjointed f (n + 1) = f (n + 1) \ f n := by rw [disjointed_succ, hf.partialSups_eq] #align monotone.disjointed_eq Monotone.disjointed_succ protected lemma Monotone.disjointed_succ_sup {f : ℕ → α} (hf : Monotone f) (n : ℕ) : disjointed f (n + 1) ⊔ f n = f (n + 1) := by rw [hf.disjointed_succ, sdiff_sup_cancel]; exact hf n.le_succ @[simp] theorem partialSups_disjointed (f : ℕ → α) : partialSups (disjointed f) = partialSups f := by ext n induction' n with k ih · rw [partialSups_zero, partialSups_zero, disjointed_zero] · rw [partialSups_succ, partialSups_succ, disjointed_succ, ih, sup_sdiff_self_right] #align partial_sups_disjointed partialSups_disjointed
Mathlib/Order/Disjointed.lean
123
136
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d)) (hsups : partialSups d = partialSups f) : d = disjointed f := by
ext n cases' n with n · rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero] suffices h : d n.succ = partialSups d n.succ \ partialSups d n by rw [h, hsups, partialSups_succ, disjointed_succ, sup_sdiff, sdiff_self, bot_sup_eq] rw [partialSups_succ, sup_sdiff, sdiff_self, bot_sup_eq, eq_comm, sdiff_eq_self_iff_disjoint] suffices h : ∀ m ≤ n, Disjoint (partialSups d m) (d n.succ) from h n le_rfl rintro m hm induction' m with m ih · exact hdisj (Nat.succ_ne_zero _).symm rw [partialSups_succ, disjoint_iff, inf_sup_right, sup_eq_bot_iff, ← disjoint_iff, ← disjoint_iff] exact ⟨ih (Nat.le_of_succ_le hm), hdisj (Nat.lt_succ_of_le hm).ne⟩
import Mathlib.MeasureTheory.Covering.Differentiation import Mathlib.MeasureTheory.Covering.VitaliFamily import Mathlib.MeasureTheory.Integral.Lebesgue import Mathlib.MeasureTheory.Measure.Regular import Mathlib.SetTheory.Ordinal.Arithmetic import Mathlib.Topology.MetricSpace.Basic import Mathlib.Data.Set.Pairwise.Lattice #align_import measure_theory.covering.besicovitch from "leanprover-community/mathlib"@"5f6e827d81dfbeb6151d7016586ceeb0099b9655" noncomputable section universe u open Metric Set Filter Fin MeasureTheory TopologicalSpace open scoped Topology Classical ENNReal MeasureTheory NNReal structure Besicovitch.SatelliteConfig (α : Type*) [MetricSpace α] (N : ℕ) (τ : ℝ) where c : Fin N.succ → α r : Fin N.succ → ℝ rpos : ∀ i, 0 < r i h : Pairwise fun i j => r i ≤ dist (c i) (c j) ∧ r j ≤ τ * r i ∨ r j ≤ dist (c j) (c i) ∧ r i ≤ τ * r j hlast : ∀ i < last N, r i ≤ dist (c i) (c (last N)) ∧ r (last N) ≤ τ * r i inter : ∀ i < last N, dist (c i) (c (last N)) ≤ r i + r (last N) #align besicovitch.satellite_config Besicovitch.SatelliteConfig #align besicovitch.satellite_config.c Besicovitch.SatelliteConfig.c #align besicovitch.satellite_config.r Besicovitch.SatelliteConfig.r #align besicovitch.satellite_config.rpos Besicovitch.SatelliteConfig.rpos #align besicovitch.satellite_config.h Besicovitch.SatelliteConfig.h #align besicovitch.satellite_config.hlast Besicovitch.SatelliteConfig.hlast #align besicovitch.satellite_config.inter Besicovitch.SatelliteConfig.inter class HasBesicovitchCovering (α : Type*) [MetricSpace α] : Prop where no_satelliteConfig : ∃ (N : ℕ) (τ : ℝ), 1 < τ ∧ IsEmpty (Besicovitch.SatelliteConfig α N τ) #align has_besicovitch_covering HasBesicovitchCovering #align has_besicovitch_covering.no_satellite_config HasBesicovitchCovering.no_satelliteConfig instance Besicovitch.SatelliteConfig.instInhabited {α : Type*} {τ : ℝ} [Inhabited α] [MetricSpace α] : Inhabited (Besicovitch.SatelliteConfig α 0 τ) := ⟨{ c := default r := fun _ => 1 rpos := fun _ => zero_lt_one h := fun i j hij => (hij (Subsingleton.elim (α := Fin 1) i j)).elim hlast := fun i hi => by rw [Subsingleton.elim (α := Fin 1) i (last 0)] at hi; exact (lt_irrefl _ hi).elim inter := fun i hi => by rw [Subsingleton.elim (α := Fin 1) i (last 0)] at hi; exact (lt_irrefl _ hi).elim }⟩ #align besicovitch.satellite_config.inhabited Besicovitch.SatelliteConfig.instInhabited namespace Besicovitch structure BallPackage (β : Type*) (α : Type*) where c : β → α r : β → ℝ rpos : ∀ b, 0 < r b r_bound : ℝ r_le : ∀ b, r b ≤ r_bound #align besicovitch.ball_package Besicovitch.BallPackage #align besicovitch.ball_package.c Besicovitch.BallPackage.c #align besicovitch.ball_package.r Besicovitch.BallPackage.r #align besicovitch.ball_package.rpos Besicovitch.BallPackage.rpos #align besicovitch.ball_package.r_bound Besicovitch.BallPackage.r_bound #align besicovitch.ball_package.r_le Besicovitch.BallPackage.r_le def unitBallPackage (α : Type*) : BallPackage α α where c := id r _ := 1 rpos _ := zero_lt_one r_bound := 1 r_le _ := le_rfl #align besicovitch.unit_ball_package Besicovitch.unitBallPackage instance BallPackage.instInhabited (α : Type*) : Inhabited (BallPackage α α) := ⟨unitBallPackage α⟩ #align besicovitch.ball_package.inhabited Besicovitch.BallPackage.instInhabited structure TauPackage (β : Type*) (α : Type*) extends BallPackage β α where τ : ℝ one_lt_tau : 1 < τ #align besicovitch.tau_package Besicovitch.TauPackage #align besicovitch.tau_package.τ Besicovitch.TauPackage.τ #align besicovitch.tau_package.one_lt_tau Besicovitch.TauPackage.one_lt_tau instance TauPackage.instInhabited (α : Type*) : Inhabited (TauPackage α α) := ⟨{ unitBallPackage α with τ := 2 one_lt_tau := one_lt_two }⟩ #align besicovitch.tau_package.inhabited Besicovitch.TauPackage.instInhabited variable {α : Type*} [MetricSpace α] {β : Type u} namespace TauPackage variable [Nonempty β] (p : TauPackage β α) noncomputable def index : Ordinal.{u} → β | i => -- `Z` is the set of points that are covered by already constructed balls let Z := ⋃ j : { j // j < i }, ball (p.c (index j)) (p.r (index j)) -- `R` is the supremum of the radii of balls with centers not in `Z` let R := iSup fun b : { b : β // p.c b ∉ Z } => p.r b -- return an index `b` for which the center `c b` is not in `Z`, and the radius is at -- least `R / τ`, if such an index exists (and garbage otherwise). Classical.epsilon fun b : β => p.c b ∉ Z ∧ R ≤ p.τ * p.r b termination_by i => i decreasing_by exact j.2 #align besicovitch.tau_package.index Besicovitch.TauPackage.index def iUnionUpTo (i : Ordinal.{u}) : Set α := ⋃ j : { j // j < i }, ball (p.c (p.index j)) (p.r (p.index j)) #align besicovitch.tau_package.Union_up_to Besicovitch.TauPackage.iUnionUpTo
Mathlib/MeasureTheory/Covering/Besicovitch.lean
278
281
theorem monotone_iUnionUpTo : Monotone p.iUnionUpTo := by
intro i j hij simp only [iUnionUpTo] exact iUnion_mono' fun r => ⟨⟨r, r.2.trans_le hij⟩, Subset.rfl⟩
import Mathlib.Order.Filter.Bases import Mathlib.Order.ConditionallyCompleteLattice.Basic #align_import order.filter.lift from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1" open Set Classical Filter Function namespace Filter variable {α β γ : Type*} {ι : Sort*} section lift protected def lift (f : Filter α) (g : Set α → Filter β) := ⨅ s ∈ f, g s #align filter.lift Filter.lift variable {f f₁ f₂ : Filter α} {g g₁ g₂ : Set α → Filter β} @[simp] theorem lift_top (g : Set α → Filter β) : (⊤ : Filter α).lift g = g univ := by simp [Filter.lift] #align filter.lift_top Filter.lift_top -- Porting note: use `∃ i, p i ∧ _` instead of `∃ i (hi : p i), _` theorem HasBasis.mem_lift_iff {ι} {p : ι → Prop} {s : ι → Set α} {f : Filter α} (hf : f.HasBasis p s) {β : ι → Type*} {pg : ∀ i, β i → Prop} {sg : ∀ i, β i → Set γ} {g : Set α → Filter γ} (hg : ∀ i, (g <| s i).HasBasis (pg i) (sg i)) (gm : Monotone g) {s : Set γ} : s ∈ f.lift g ↔ ∃ i, p i ∧ ∃ x, pg i x ∧ sg i x ⊆ s := by refine (mem_biInf_of_directed ?_ ⟨univ, univ_sets _⟩).trans ?_ · intro t₁ ht₁ t₂ ht₂ exact ⟨t₁ ∩ t₂, inter_mem ht₁ ht₂, gm inter_subset_left, gm inter_subset_right⟩ · simp only [← (hg _).mem_iff] exact hf.exists_iff fun t₁ t₂ ht H => gm ht H #align filter.has_basis.mem_lift_iff Filter.HasBasis.mem_lift_iffₓ theorem HasBasis.lift {ι} {p : ι → Prop} {s : ι → Set α} {f : Filter α} (hf : f.HasBasis p s) {β : ι → Type*} {pg : ∀ i, β i → Prop} {sg : ∀ i, β i → Set γ} {g : Set α → Filter γ} (hg : ∀ i, (g (s i)).HasBasis (pg i) (sg i)) (gm : Monotone g) : (f.lift g).HasBasis (fun i : Σi, β i => p i.1 ∧ pg i.1 i.2) fun i : Σi, β i => sg i.1 i.2 := by refine ⟨fun t => (hf.mem_lift_iff hg gm).trans ?_⟩ simp [Sigma.exists, and_assoc, exists_and_left] #align filter.has_basis.lift Filter.HasBasis.lift theorem mem_lift_sets (hg : Monotone g) {s : Set β} : s ∈ f.lift g ↔ ∃ t ∈ f, s ∈ g t := (f.basis_sets.mem_lift_iff (fun s => (g s).basis_sets) hg).trans <| by simp only [id, exists_mem_subset_iff] #align filter.mem_lift_sets Filter.mem_lift_sets theorem sInter_lift_sets (hg : Monotone g) : ⋂₀ { s | s ∈ f.lift g } = ⋂ s ∈ f, ⋂₀ { t | t ∈ g s } := by simp only [sInter_eq_biInter, mem_setOf_eq, Filter.mem_sets, mem_lift_sets hg, iInter_exists, iInter_and, @iInter_comm _ (Set β)] #align filter.sInter_lift_sets Filter.sInter_lift_sets theorem mem_lift {s : Set β} {t : Set α} (ht : t ∈ f) (hs : s ∈ g t) : s ∈ f.lift g := le_principal_iff.mp <| show f.lift g ≤ 𝓟 s from iInf_le_of_le t <| iInf_le_of_le ht <| le_principal_iff.mpr hs #align filter.mem_lift Filter.mem_lift theorem lift_le {f : Filter α} {g : Set α → Filter β} {h : Filter β} {s : Set α} (hs : s ∈ f) (hg : g s ≤ h) : f.lift g ≤ h := iInf₂_le_of_le s hs hg #align filter.lift_le Filter.lift_le theorem le_lift {f : Filter α} {g : Set α → Filter β} {h : Filter β} : h ≤ f.lift g ↔ ∀ s ∈ f, h ≤ g s := le_iInf₂_iff #align filter.le_lift Filter.le_lift theorem lift_mono (hf : f₁ ≤ f₂) (hg : g₁ ≤ g₂) : f₁.lift g₁ ≤ f₂.lift g₂ := iInf_mono fun s => iInf_mono' fun hs => ⟨hf hs, hg s⟩ #align filter.lift_mono Filter.lift_mono theorem lift_mono' (hg : ∀ s ∈ f, g₁ s ≤ g₂ s) : f.lift g₁ ≤ f.lift g₂ := iInf₂_mono hg #align filter.lift_mono' Filter.lift_mono' theorem tendsto_lift {m : γ → β} {l : Filter γ} : Tendsto m l (f.lift g) ↔ ∀ s ∈ f, Tendsto m l (g s) := by simp only [Filter.lift, tendsto_iInf] #align filter.tendsto_lift Filter.tendsto_lift theorem map_lift_eq {m : β → γ} (hg : Monotone g) : map m (f.lift g) = f.lift (map m ∘ g) := have : Monotone (map m ∘ g) := map_mono.comp hg Filter.ext fun s => by simp only [mem_lift_sets hg, mem_lift_sets this, exists_prop, mem_map, Function.comp_apply] #align filter.map_lift_eq Filter.map_lift_eq
Mathlib/Order/Filter/Lift.lean
117
118
theorem comap_lift_eq {m : γ → β} : comap m (f.lift g) = f.lift (comap m ∘ g) := by
simp only [Filter.lift, comap_iInf]; rfl
import Mathlib.ModelTheory.Satisfiability #align_import model_theory.types from "leanprover-community/mathlib"@"98bd247d933fb581ff37244a5998bd33d81dd46d" set_option linter.uppercaseLean3 false universe u v w w' open Cardinal Set open scoped Classical open Cardinal FirstOrder namespace FirstOrder namespace Language namespace Theory variable {L : Language.{u, v}} (T : L.Theory) (α : Type w) structure CompleteType where toTheory : L[[α]].Theory subset' : (L.lhomWithConstants α).onTheory T ⊆ toTheory isMaximal' : toTheory.IsMaximal #align first_order.language.Theory.complete_type FirstOrder.Language.Theory.CompleteType #align first_order.language.Theory.complete_type.to_Theory FirstOrder.Language.Theory.CompleteType.toTheory #align first_order.language.Theory.complete_type.subset' FirstOrder.Language.Theory.CompleteType.subset' #align first_order.language.Theory.complete_type.is_maximal' FirstOrder.Language.Theory.CompleteType.isMaximal' variable {T α} namespace CompleteType attribute [coe] CompleteType.toTheory instance Sentence.instSetLike : SetLike (T.CompleteType α) (L[[α]].Sentence) := ⟨fun p => p.toTheory, fun p q h => by cases p cases q congr ⟩ #align first_order.language.Theory.complete_type.sentence.set_like FirstOrder.Language.Theory.CompleteType.Sentence.instSetLike theorem isMaximal (p : T.CompleteType α) : IsMaximal (p : L[[α]].Theory) := p.isMaximal' #align first_order.language.Theory.complete_type.is_maximal FirstOrder.Language.Theory.CompleteType.isMaximal theorem subset (p : T.CompleteType α) : (L.lhomWithConstants α).onTheory T ⊆ (p : L[[α]].Theory) := p.subset' #align first_order.language.Theory.complete_type.subset FirstOrder.Language.Theory.CompleteType.subset theorem mem_or_not_mem (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ ∈ p ∨ φ.not ∈ p := p.isMaximal.mem_or_not_mem φ #align first_order.language.Theory.complete_type.mem_or_not_mem FirstOrder.Language.Theory.CompleteType.mem_or_not_mem theorem mem_of_models (p : T.CompleteType α) {φ : L[[α]].Sentence} (h : (L.lhomWithConstants α).onTheory T ⊨ᵇ φ) : φ ∈ p := (p.mem_or_not_mem φ).resolve_right fun con => ((models_iff_not_satisfiable _).1 h) (p.isMaximal.1.mono (union_subset p.subset (singleton_subset_iff.2 con))) #align first_order.language.Theory.complete_type.mem_of_models FirstOrder.Language.Theory.CompleteType.mem_of_models theorem not_mem_iff (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ.not ∈ p ↔ ¬φ ∈ p := ⟨fun hf ht => by have h : ¬IsSatisfiable ({φ, φ.not} : L[[α]].Theory) := by rintro ⟨@⟨_, _, h, _⟩⟩ simp only [model_iff, mem_insert_iff, mem_singleton_iff, forall_eq_or_imp, forall_eq] at h exact h.2 h.1 refine h (p.isMaximal.1.mono ?_) rw [insert_subset_iff, singleton_subset_iff] exact ⟨ht, hf⟩, (p.mem_or_not_mem φ).resolve_left⟩ #align first_order.language.Theory.complete_type.not_mem_iff FirstOrder.Language.Theory.CompleteType.not_mem_iff @[simp] theorem compl_setOf_mem {φ : L[[α]].Sentence} : { p : T.CompleteType α | φ ∈ p }ᶜ = { p : T.CompleteType α | φ.not ∈ p } := ext fun _ => (not_mem_iff _ _).symm #align first_order.language.Theory.complete_type.compl_set_of_mem FirstOrder.Language.Theory.CompleteType.compl_setOf_mem theorem setOf_subset_eq_empty_iff (S : L[[α]].Theory) : { p : T.CompleteType α | S ⊆ ↑p } = ∅ ↔ ¬((L.lhomWithConstants α).onTheory T ∪ S).IsSatisfiable := by rw [iff_not_comm, ← not_nonempty_iff_eq_empty, Classical.not_not, Set.Nonempty] refine ⟨fun h => ⟨⟨L[[α]].completeTheory h.some, (subset_union_left (t := S)).trans completeTheory.subset, completeTheory.isMaximal (L[[α]]) h.some⟩, (((L.lhomWithConstants α).onTheory T).subset_union_right).trans completeTheory.subset⟩, ?_⟩ rintro ⟨p, hp⟩ exact p.isMaximal.1.mono (union_subset p.subset hp) #align first_order.language.Theory.complete_type.set_of_subset_eq_empty_iff FirstOrder.Language.Theory.CompleteType.setOf_subset_eq_empty_iff theorem setOf_mem_eq_univ_iff (φ : L[[α]].Sentence) : { p : T.CompleteType α | φ ∈ p } = Set.univ ↔ (L.lhomWithConstants α).onTheory T ⊨ᵇ φ := by rw [models_iff_not_satisfiable, ← compl_empty_iff, compl_setOf_mem, ← setOf_subset_eq_empty_iff] simp #align first_order.language.Theory.complete_type.set_of_mem_eq_univ_iff FirstOrder.Language.Theory.CompleteType.setOf_mem_eq_univ_iff theorem setOf_subset_eq_univ_iff (S : L[[α]].Theory) : { p : T.CompleteType α | S ⊆ ↑p } = Set.univ ↔ ∀ φ, φ ∈ S → (L.lhomWithConstants α).onTheory T ⊨ᵇ φ := by have h : { p : T.CompleteType α | S ⊆ ↑p } = ⋂₀ ((fun φ => { p | φ ∈ p }) '' S) := by ext simp [subset_def] simp_rw [h, sInter_eq_univ, ← setOf_mem_eq_univ_iff] refine ⟨fun h φ φS => h _ ⟨_, φS, rfl⟩, ?_⟩ rintro h _ ⟨φ, h1, rfl⟩ exact h _ h1 #align first_order.language.Theory.complete_type.set_of_subset_eq_univ_iff FirstOrder.Language.Theory.CompleteType.setOf_subset_eq_univ_iff
Mathlib/ModelTheory/Types.lean
147
151
theorem nonempty_iff : Nonempty (T.CompleteType α) ↔ T.IsSatisfiable := by
rw [← isSatisfiable_onTheory_iff (lhomWithConstants_injective L α)] rw [nonempty_iff_univ_nonempty, nonempty_iff_ne_empty, Ne, not_iff_comm, ← union_empty ((L.lhomWithConstants α).onTheory T), ← setOf_subset_eq_empty_iff] simp
import Mathlib.Data.Finsupp.Encodable import Mathlib.LinearAlgebra.Pi import Mathlib.LinearAlgebra.Span import Mathlib.Data.Set.Countable #align_import linear_algebra.finsupp from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" noncomputable section open Set LinearMap Submodule namespace Finsupp variable {α : Type*} {M : Type*} {N : Type*} {P : Type*} {R : Type*} {S : Type*} variable [Semiring R] [Semiring S] [AddCommMonoid M] [Module R M] variable [AddCommMonoid N] [Module R N] variable [AddCommMonoid P] [Module R P] def lsingle (a : α) : M →ₗ[R] α →₀ M := { Finsupp.singleAddHom a with map_smul' := fun _ _ => (smul_single _ _ _).symm } #align finsupp.lsingle Finsupp.lsingle theorem lhom_ext ⦃φ ψ : (α →₀ M) →ₗ[R] N⦄ (h : ∀ a b, φ (single a b) = ψ (single a b)) : φ = ψ := LinearMap.toAddMonoidHom_injective <| addHom_ext h #align finsupp.lhom_ext Finsupp.lhom_ext -- Porting note: The priority should be higher than `LinearMap.ext`. @[ext high] theorem lhom_ext' ⦃φ ψ : (α →₀ M) →ₗ[R] N⦄ (h : ∀ a, φ.comp (lsingle a) = ψ.comp (lsingle a)) : φ = ψ := lhom_ext fun a => LinearMap.congr_fun (h a) #align finsupp.lhom_ext' Finsupp.lhom_ext' def lapply (a : α) : (α →₀ M) →ₗ[R] M := { Finsupp.applyAddHom a with map_smul' := fun _ _ => rfl } #align finsupp.lapply Finsupp.lapply @[simps] def lcoeFun : (α →₀ M) →ₗ[R] α → M where toFun := (⇑) map_add' x y := by ext simp map_smul' x y := by ext simp #align finsupp.lcoe_fun Finsupp.lcoeFun @[simp] theorem lsingle_apply (a : α) (b : M) : (lsingle a : M →ₗ[R] α →₀ M) b = single a b := rfl #align finsupp.lsingle_apply Finsupp.lsingle_apply @[simp] theorem lapply_apply (a : α) (f : α →₀ M) : (lapply a : (α →₀ M) →ₗ[R] M) f = f a := rfl #align finsupp.lapply_apply Finsupp.lapply_apply @[simp] theorem lapply_comp_lsingle_same (a : α) : lapply a ∘ₗ lsingle a = (.id : M →ₗ[R] M) := by ext; simp @[simp] theorem lapply_comp_lsingle_of_ne (a a' : α) (h : a ≠ a') : lapply a ∘ₗ lsingle a' = (0 : M →ₗ[R] M) := by ext; simp [h.symm] @[simp] theorem ker_lsingle (a : α) : ker (lsingle a : M →ₗ[R] α →₀ M) = ⊥ := ker_eq_bot_of_injective (single_injective a) #align finsupp.ker_lsingle Finsupp.ker_lsingle theorem lsingle_range_le_ker_lapply (s t : Set α) (h : Disjoint s t) : ⨆ a ∈ s, LinearMap.range (lsingle a : M →ₗ[R] α →₀ M) ≤ ⨅ a ∈ t, ker (lapply a : (α →₀ M) →ₗ[R] M) := by refine iSup_le fun a₁ => iSup_le fun h₁ => range_le_iff_comap.2 ?_ simp only [(ker_comp _ _).symm, eq_top_iff, SetLike.le_def, mem_ker, comap_iInf, mem_iInf] intro b _ a₂ h₂ have : a₁ ≠ a₂ := fun eq => h.le_bot ⟨h₁, eq.symm ▸ h₂⟩ exact single_eq_of_ne this #align finsupp.lsingle_range_le_ker_lapply Finsupp.lsingle_range_le_ker_lapply theorem iInf_ker_lapply_le_bot : ⨅ a, ker (lapply a : (α →₀ M) →ₗ[R] M) ≤ ⊥ := by simp only [SetLike.le_def, mem_iInf, mem_ker, mem_bot, lapply_apply] exact fun a h => Finsupp.ext h #align finsupp.infi_ker_lapply_le_bot Finsupp.iInf_ker_lapply_le_bot
Mathlib/LinearAlgebra/Finsupp.lean
260
263
theorem iSup_lsingle_range : ⨆ a, LinearMap.range (lsingle a : M →ₗ[R] α →₀ M) = ⊤ := by
refine eq_top_iff.2 <| SetLike.le_def.2 fun f _ => ?_ rw [← sum_single f] exact sum_mem fun a _ => Submodule.mem_iSup_of_mem a ⟨_, rfl⟩
import Mathlib.Dynamics.Ergodic.MeasurePreserving import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal import Mathlib.LinearAlgebra.Matrix.Transvection import Mathlib.MeasureTheory.Group.LIntegral import Mathlib.MeasureTheory.Integral.Marginal import Mathlib.MeasureTheory.Measure.Stieltjes import Mathlib.MeasureTheory.Measure.Haar.OfBasis #align_import measure_theory.measure.lebesgue.basic from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" assert_not_exists MeasureTheory.integral noncomputable section open scoped Classical open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace open ENNReal (ofReal) open scoped ENNReal NNReal Topology
Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean
624
653
theorem ae_restrict_of_ae_restrict_inter_Ioo {μ : Measure ℝ} [NoAtoms μ] {s : Set ℝ} {p : ℝ → Prop} (h : ∀ a b, a ∈ s → b ∈ s → a < b → ∀ᵐ x ∂μ.restrict (s ∩ Ioo a b), p x) : ∀ᵐ x ∂μ.restrict s, p x := by
/- By second-countability, we cover `s` by countably many intervals `(a, b)` (except maybe for two endpoints, which don't matter since `μ` does not have any atom). -/ let T : s × s → Set ℝ := fun p => Ioo p.1 p.2 let u := ⋃ i : ↥s × ↥s, T i have hfinite : (s \ u).Finite := s.finite_diff_iUnion_Ioo' obtain ⟨A, A_count, hA⟩ : ∃ A : Set (↥s × ↥s), A.Countable ∧ ⋃ i ∈ A, T i = ⋃ i : ↥s × ↥s, T i := isOpen_iUnion_countable _ fun p => isOpen_Ioo have : s ⊆ s \ u ∪ ⋃ p ∈ A, s ∩ T p := by intro x hx by_cases h'x : x ∈ ⋃ i : ↥s × ↥s, T i · rw [← hA] at h'x obtain ⟨p, pA, xp⟩ : ∃ p : ↥s × ↥s, p ∈ A ∧ x ∈ T p := by simpa only [mem_iUnion, exists_prop, SetCoe.exists, exists_and_right] using h'x right exact mem_biUnion pA ⟨hx, xp⟩ · exact Or.inl ⟨hx, h'x⟩ apply ae_restrict_of_ae_restrict_of_subset this rw [ae_restrict_union_iff, ae_restrict_biUnion_iff _ A_count] constructor · have : μ.restrict (s \ u) = 0 := by simp only [restrict_eq_zero, hfinite.measure_zero] simp only [this, ae_zero, eventually_bot] · rintro ⟨⟨a, as⟩, ⟨b, bs⟩⟩ - dsimp [T] rcases le_or_lt b a with (hba | hab) · simp only [Ioo_eq_empty_of_le hba, inter_empty, restrict_empty, ae_zero, eventually_bot] · exact h a b as bs hab
import Mathlib.Data.Fintype.Quotient import Mathlib.ModelTheory.Semantics #align_import model_theory.quotients from "leanprover-community/mathlib"@"d78597269638367c3863d40d45108f52207e03cf" namespace FirstOrder namespace Language variable (L : Language) {M : Type*} open FirstOrder open Structure class Prestructure (s : Setoid M) where toStructure : L.Structure M fun_equiv : ∀ {n} {f : L.Functions n} (x y : Fin n → M), x ≈ y → funMap f x ≈ funMap f y rel_equiv : ∀ {n} {r : L.Relations n} (x y : Fin n → M) (_ : x ≈ y), RelMap r x = RelMap r y #align first_order.language.prestructure FirstOrder.Language.Prestructure #align first_order.language.prestructure.to_structure FirstOrder.Language.Prestructure.toStructure #align first_order.language.prestructure.fun_equiv FirstOrder.Language.Prestructure.fun_equiv #align first_order.language.prestructure.rel_equiv FirstOrder.Language.Prestructure.rel_equiv variable {L} {s : Setoid M} variable [ps : L.Prestructure s] instance quotientStructure : L.Structure (Quotient s) where funMap {n} f x := Quotient.map (@funMap L M ps.toStructure n f) Prestructure.fun_equiv (Quotient.finChoice x) RelMap {n} r x := Quotient.lift (@RelMap L M ps.toStructure n r) Prestructure.rel_equiv (Quotient.finChoice x) #align first_order.language.quotient_structure FirstOrder.Language.quotientStructure variable (s)
Mathlib/ModelTheory/Quotients.lean
57
62
theorem funMap_quotient_mk' {n : ℕ} (f : L.Functions n) (x : Fin n → M) : (funMap f fun i => (⟦x i⟧ : Quotient s)) = ⟦@funMap _ _ ps.toStructure _ f x⟧ := by
change Quotient.map (@funMap L M ps.toStructure n f) Prestructure.fun_equiv (Quotient.finChoice _) = _ rw [Quotient.finChoice_eq, Quotient.map_mk]
import Mathlib.Order.SuccPred.LinearLocallyFinite import Mathlib.Probability.Martingale.Basic #align_import probability.martingale.optional_sampling from "leanprover-community/mathlib"@"ba074af83b6cf54c3104e59402b39410ddbd6dca" open scoped MeasureTheory ENNReal open TopologicalSpace namespace MeasureTheory namespace Martingale variable {Ω E : Type*} {m : MeasurableSpace Ω} {μ : Measure Ω} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] section SubsetOfNat variable {ι : Type*} [LinearOrder ι] [LocallyFiniteOrder ι] [OrderBot ι] [TopologicalSpace ι] [DiscreteTopology ι] [MeasurableSpace ι] [BorelSpace ι] [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] {ℱ : Filtration ι m} {τ σ : Ω → ι} {f : ι → Ω → E} {i n : ι}
Mathlib/Probability/Martingale/OptionalSampling.lean
157
183
theorem condexp_stoppedValue_stopping_time_ae_eq_restrict_le (h : Martingale f ℱ μ) (hτ : IsStoppingTime ℱ τ) (hσ : IsStoppingTime ℱ σ) [SigmaFinite (μ.trim hσ.measurableSpace_le)] (hτ_le : ∀ x, τ x ≤ n) : μ[stoppedValue f τ|hσ.measurableSpace] =ᵐ[μ.restrict {x : Ω | τ x ≤ σ x}] stoppedValue f τ := by
rw [ae_eq_restrict_iff_indicator_ae_eq (hτ.measurableSpace_le _ (hτ.measurableSet_le_stopping_time hσ))] refine (condexp_indicator (integrable_stoppedValue ι hτ h.integrable hτ_le) (hτ.measurableSet_stopping_time_le hσ)).symm.trans ?_ have h_int : Integrable ({ω : Ω | τ ω ≤ σ ω}.indicator (stoppedValue (fun n : ι => f n) τ)) μ := by refine (integrable_stoppedValue ι hτ h.integrable hτ_le).indicator ?_ exact hτ.measurableSpace_le _ (hτ.measurableSet_le_stopping_time hσ) have h_meas : AEStronglyMeasurable' hσ.measurableSpace ({ω : Ω | τ ω ≤ σ ω}.indicator (stoppedValue (fun n : ι => f n) τ)) μ := by refine StronglyMeasurable.aeStronglyMeasurable' ?_ refine StronglyMeasurable.stronglyMeasurable_of_measurableSpace_le_on (hτ.measurableSet_le_stopping_time hσ) ?_ ?_ ?_ · intro t ht rw [Set.inter_comm _ t] at ht ⊢ rw [hτ.measurableSet_inter_le_iff hσ, IsStoppingTime.measurableSet_min_iff hτ hσ] at ht exact ht.2 · refine StronglyMeasurable.indicator ?_ (hτ.measurableSet_le_stopping_time hσ) refine Measurable.stronglyMeasurable ?_ exact measurable_stoppedValue h.adapted.progMeasurable_of_discrete hτ · intro x hx simp only [hx, Set.indicator_of_not_mem, not_false_iff] exact condexp_of_aestronglyMeasurable' hσ.measurableSpace_le h_meas h_int
import Mathlib.Algebra.ContinuedFractions.Basic import Mathlib.Algebra.GroupWithZero.Basic #align_import algebra.continued_fractions.translations from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad" namespace GeneralizedContinuedFraction section General variable {α : Type*} {g : GeneralizedContinuedFraction α} {n : ℕ} theorem terminatedAt_iff_s_terminatedAt : g.TerminatedAt n ↔ g.s.TerminatedAt n := by rfl #align generalized_continued_fraction.terminated_at_iff_s_terminated_at GeneralizedContinuedFraction.terminatedAt_iff_s_terminatedAt theorem terminatedAt_iff_s_none : g.TerminatedAt n ↔ g.s.get? n = none := by rfl #align generalized_continued_fraction.terminated_at_iff_s_none GeneralizedContinuedFraction.terminatedAt_iff_s_none theorem part_num_none_iff_s_none : g.partialNumerators.get? n = none ↔ g.s.get? n = none := by cases s_nth_eq : g.s.get? n <;> simp [partialNumerators, s_nth_eq] #align generalized_continued_fraction.part_num_none_iff_s_none GeneralizedContinuedFraction.part_num_none_iff_s_none theorem terminatedAt_iff_part_num_none : g.TerminatedAt n ↔ g.partialNumerators.get? n = none := by rw [terminatedAt_iff_s_none, part_num_none_iff_s_none] #align generalized_continued_fraction.terminated_at_iff_part_num_none GeneralizedContinuedFraction.terminatedAt_iff_part_num_none theorem part_denom_none_iff_s_none : g.partialDenominators.get? n = none ↔ g.s.get? n = none := by cases s_nth_eq : g.s.get? n <;> simp [partialDenominators, s_nth_eq] #align generalized_continued_fraction.part_denom_none_iff_s_none GeneralizedContinuedFraction.part_denom_none_iff_s_none theorem terminatedAt_iff_part_denom_none : g.TerminatedAt n ↔ g.partialDenominators.get? n = none := by rw [terminatedAt_iff_s_none, part_denom_none_iff_s_none] #align generalized_continued_fraction.terminated_at_iff_part_denom_none GeneralizedContinuedFraction.terminatedAt_iff_part_denom_none theorem part_num_eq_s_a {gp : Pair α} (s_nth_eq : g.s.get? n = some gp) : g.partialNumerators.get? n = some gp.a := by simp [partialNumerators, s_nth_eq] #align generalized_continued_fraction.part_num_eq_s_a GeneralizedContinuedFraction.part_num_eq_s_a
Mathlib/Algebra/ContinuedFractions/Translations.lean
62
63
theorem part_denom_eq_s_b {gp : Pair α} (s_nth_eq : g.s.get? n = some gp) : g.partialDenominators.get? n = some gp.b := by
simp [partialDenominators, s_nth_eq]
import Mathlib.Algebra.CharP.Defs import Mathlib.Algebra.GroupPower.IterateHom import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Int.ModEq import Mathlib.Data.Set.Pointwise.Basic import Mathlib.Dynamics.PeriodicPts import Mathlib.GroupTheory.Index import Mathlib.Order.Interval.Finset.Nat import Mathlib.Order.Interval.Set.Infinite #align_import group_theory.order_of_element from "leanprover-community/mathlib"@"d07245fd37786daa997af4f1a73a49fa3b748408" open Function Fintype Nat Pointwise Subgroup Submonoid variable {G H A α β : Type*} section Monoid variable [Monoid G] {a b x y : G} {n m : ℕ} section IsOfFinOrder -- Porting note(#12129): additional beta reduction needed @[to_additive]
Mathlib/GroupTheory/OrderOfElement.lean
48
49
theorem isPeriodicPt_mul_iff_pow_eq_one (x : G) : IsPeriodicPt (x * ·) n 1 ↔ x ^ n = 1 := by
rw [IsPeriodicPt, IsFixedPt, mul_left_iterate]; beta_reduce; rw [mul_one]
import Mathlib.Mathport.Rename import Mathlib.Tactic.Lemma import Mathlib.Tactic.TypeStar #align_import data.option.defs from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23" namespace Option #align option.lift_or_get Option.liftOrGet protected def traverse.{u, v} {F : Type u → Type v} [Applicative F] {α : Type*} {β : Type u} (f : α → F β) : Option α → F (Option β) | none => pure none | some x => some <$> f x #align option.traverse Option.traverse #align option.maybe Option.sequence #align option.mmap Option.mapM #align option.melim Option.elimM #align option.mget_or_else Option.getDM variable {α : Type*} {β : Type*} -- Porting note: Would need to add the attribute directly in `Init.Prelude`. -- attribute [inline] Option.isSome Option.isNone protected def elim' (b : β) (f : α → β) : Option α → β | some a => f a | none => b #align option.elim Option.elim' @[simp] theorem elim'_none (b : β) (f : α → β) : Option.elim' b f none = b := rfl @[simp] theorem elim'_some {a : α} (b : β) (f : α → β) : Option.elim' b f (some a) = f a := rfl -- Porting note: this lemma was introduced because it is necessary -- in `CategoryTheory.Category.PartialFun` lemma elim'_eq_elim {α β : Type*} (b : β) (f : α → β) (a : Option α) : Option.elim' b f a = Option.elim a b f := by cases a <;> rfl
Mathlib/Data/Option/Defs.lean
61
61
theorem mem_some_iff {α : Type*} {a b : α} : a ∈ some b ↔ b = a := by
simp
import Mathlib.Algebra.MvPolynomial.Basic import Mathlib.Data.Finset.PiAntidiagonal import Mathlib.LinearAlgebra.StdBasis import Mathlib.Tactic.Linarith #align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60" noncomputable section open Finset (antidiagonal mem_antidiagonal) def MvPowerSeries (σ : Type*) (R : Type*) := (σ →₀ ℕ) → R #align mv_power_series MvPowerSeries namespace MvPowerSeries open Finsupp variable {σ R : Type*} instance [Inhabited R] : Inhabited (MvPowerSeries σ R) := ⟨fun _ => default⟩ instance [Zero R] : Zero (MvPowerSeries σ R) := Pi.instZero instance [AddMonoid R] : AddMonoid (MvPowerSeries σ R) := Pi.addMonoid instance [AddGroup R] : AddGroup (MvPowerSeries σ R) := Pi.addGroup instance [AddCommMonoid R] : AddCommMonoid (MvPowerSeries σ R) := Pi.addCommMonoid instance [AddCommGroup R] : AddCommGroup (MvPowerSeries σ R) := Pi.addCommGroup instance [Nontrivial R] : Nontrivial (MvPowerSeries σ R) := Function.nontrivial instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R (MvPowerSeries σ A) := Pi.module _ _ _ instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S] [IsScalarTower R S A] : IsScalarTower R S (MvPowerSeries σ A) := Pi.isScalarTower section Semiring variable (R) [Semiring R] def monomial (n : σ →₀ ℕ) : R →ₗ[R] MvPowerSeries σ R := letI := Classical.decEq σ LinearMap.stdBasis R (fun _ ↦ R) n #align mv_power_series.monomial MvPowerSeries.monomial def coeff (n : σ →₀ ℕ) : MvPowerSeries σ R →ₗ[R] R := LinearMap.proj n #align mv_power_series.coeff MvPowerSeries.coeff variable {R} @[ext] theorem ext {φ ψ} (h : ∀ n : σ →₀ ℕ, coeff R n φ = coeff R n ψ) : φ = ψ := funext h #align mv_power_series.ext MvPowerSeries.ext theorem ext_iff {φ ψ : MvPowerSeries σ R} : φ = ψ ↔ ∀ n : σ →₀ ℕ, coeff R n φ = coeff R n ψ := Function.funext_iff #align mv_power_series.ext_iff MvPowerSeries.ext_iff theorem monomial_def [DecidableEq σ] (n : σ →₀ ℕ) : (monomial R n) = LinearMap.stdBasis R (fun _ ↦ R) n := by rw [monomial] -- unify the `Decidable` arguments convert rfl #align mv_power_series.monomial_def MvPowerSeries.monomial_def
Mathlib/RingTheory/MvPowerSeries/Basic.lean
134
140
theorem coeff_monomial [DecidableEq σ] (m n : σ →₀ ℕ) (a : R) : coeff R m (monomial R n a) = if m = n then a else 0 := by
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [coeff, monomial_def, LinearMap.proj_apply (i := m)] dsimp only -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply]
import Mathlib.Probability.ProbabilityMassFunction.Constructions import Mathlib.Tactic.FinCases namespace PMF open ENNReal noncomputable def binomial (p : ℝ≥0∞) (h : p ≤ 1) (n : ℕ) : PMF (Fin (n + 1)) := .ofFintype (fun i => p^(i : ℕ) * (1-p)^((Fin.last n - i) : ℕ) * (n.choose i : ℕ)) (by convert (add_pow p (1-p) n).symm · rw [Finset.sum_fin_eq_sum_range] apply Finset.sum_congr rfl intro i hi rw [Finset.mem_range] at hi rw [dif_pos hi, Fin.last] · simp [h]) theorem binomial_apply (p : ℝ≥0∞) (h : p ≤ 1) (n : ℕ) (i : Fin (n + 1)) : binomial p h n i = p^(i : ℕ) * (1-p)^((Fin.last n - i) : ℕ) * (n.choose i : ℕ) := rfl @[simp] theorem binomial_apply_zero (p : ℝ≥0∞) (h : p ≤ 1) (n : ℕ) : binomial p h n 0 = (1-p)^n := by simp [binomial_apply] @[simp] theorem binomial_apply_last (p : ℝ≥0∞) (h : p ≤ 1) (n : ℕ) : binomial p h n (.last n) = p^n := by simp [binomial_apply] theorem binomial_apply_self (p : ℝ≥0∞) (h : p ≤ 1) (n : ℕ) : binomial p h n n = p^n := by simp
Mathlib/Probability/ProbabilityMassFunction/Binomial.lean
53
55
theorem binomial_one_eq_bernoulli (p : ℝ≥0∞) (h : p ≤ 1) : binomial p h 1 = (bernoulli p h).map (cond · 1 0) := by
ext i; fin_cases i <;> simp [tsum_bool, binomial_apply]
import Mathlib.Init.Order.Defs #align_import init.algebra.functions from "leanprover-community/lean"@"c2bcdbcbe741ed37c361a30d38e179182b989f76" universe u section open Decidable variable {α : Type u} [LinearOrder α] theorem min_def (a b : α) : min a b = if a ≤ b then a else b := by rw [LinearOrder.min_def a] #align min_def min_def theorem max_def (a b : α) : max a b = if a ≤ b then b else a := by rw [LinearOrder.max_def a] #align max_def max_def
Mathlib/Init/Order/LinearOrder.lean
33
37
theorem min_le_left (a b : α) : min a b ≤ a := by
-- Porting note: no `min_tac` tactic if h : a ≤ b then simp [min_def, if_pos h, le_refl] else simp [min_def, if_neg h]; exact le_of_not_le h
import Mathlib.SetTheory.Ordinal.Arithmetic import Mathlib.Tactic.TFAE import Mathlib.Topology.Order.Monotone #align_import set_theory.ordinal.topology from "leanprover-community/mathlib"@"740acc0e6f9adf4423f92a485d0456fc271482da" noncomputable section universe u v open Cardinal Order Topology namespace Ordinal variable {s : Set Ordinal.{u}} {a : Ordinal.{u}} instance : TopologicalSpace Ordinal.{u} := Preorder.topology Ordinal.{u} instance : OrderTopology Ordinal.{u} := ⟨rfl⟩ theorem isOpen_singleton_iff : IsOpen ({a} : Set Ordinal) ↔ ¬IsLimit a := by refine ⟨fun h ⟨h₀, hsucc⟩ => ?_, fun ha => ?_⟩ · obtain ⟨b, c, hbc, hbc'⟩ := (mem_nhds_iff_exists_Ioo_subset' ⟨0, Ordinal.pos_iff_ne_zero.2 h₀⟩ ⟨_, lt_succ a⟩).1 (h.mem_nhds rfl) have hba := hsucc b hbc.1 exact hba.ne (hbc' ⟨lt_succ b, hba.trans hbc.2⟩) · rcases zero_or_succ_or_limit a with (rfl | ⟨b, rfl⟩ | ha') · rw [← bot_eq_zero, ← Set.Iic_bot, ← Iio_succ] exact isOpen_Iio · rw [← Set.Icc_self, Icc_succ_left, ← Ioo_succ_right] exact isOpen_Ioo · exact (ha ha').elim #align ordinal.is_open_singleton_iff Ordinal.isOpen_singleton_iff -- Porting note (#11215): TODO: generalize to a `SuccOrder` theorem nhds_right' (a : Ordinal) : 𝓝[>] a = ⊥ := (covBy_succ a).nhdsWithin_Ioi -- todo: generalize to a `SuccOrder`
Mathlib/SetTheory/Ordinal/Topology.lean
60
61
theorem nhds_left'_eq_nhds_ne (a : Ordinal) : 𝓝[<] a = 𝓝[≠] a := by
rw [← nhds_left'_sup_nhds_right', nhds_right', sup_bot_eq]
import Mathlib.Algebra.Module.Zlattice.Basic import Mathlib.NumberTheory.NumberField.Embeddings import Mathlib.NumberTheory.NumberField.FractionalIdeal #align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30" variable (K : Type*) [Field K] namespace NumberField.canonicalEmbedding open NumberField def _root_.NumberField.canonicalEmbedding : K →+* ((K →+* ℂ) → ℂ) := Pi.ringHom fun φ => φ theorem _root_.NumberField.canonicalEmbedding_injective [NumberField K] : Function.Injective (NumberField.canonicalEmbedding K) := RingHom.injective _ variable {K} @[simp] theorem apply_at (φ : K →+* ℂ) (x : K) : (NumberField.canonicalEmbedding K x) φ = φ x := rfl open scoped ComplexConjugate theorem conj_apply {x : ((K →+* ℂ) → ℂ)} (φ : K →+* ℂ) (hx : x ∈ Submodule.span ℝ (Set.range (canonicalEmbedding K))) : conj (x φ) = x (ComplexEmbedding.conjugate φ) := by refine Submodule.span_induction hx ?_ ?_ (fun _ _ hx hy => ?_) (fun a _ hx => ?_) · rintro _ ⟨x, rfl⟩ rw [apply_at, apply_at, ComplexEmbedding.conjugate_coe_eq] · rw [Pi.zero_apply, Pi.zero_apply, map_zero] · rw [Pi.add_apply, Pi.add_apply, map_add, hx, hy] · rw [Pi.smul_apply, Complex.real_smul, map_mul, Complex.conj_ofReal] exact congrArg ((a : ℂ) * ·) hx theorem nnnorm_eq [NumberField K] (x : K) : ‖canonicalEmbedding K x‖₊ = Finset.univ.sup (fun φ : K →+* ℂ => ‖φ x‖₊) := by simp_rw [Pi.nnnorm_def, apply_at] theorem norm_le_iff [NumberField K] (x : K) (r : ℝ) : ‖canonicalEmbedding K x‖ ≤ r ↔ ∀ φ : K →+* ℂ, ‖φ x‖ ≤ r := by obtain hr | hr := lt_or_le r 0 · obtain ⟨φ⟩ := (inferInstance : Nonempty (K →+* ℂ)) refine iff_of_false ?_ ?_ · exact (hr.trans_le (norm_nonneg _)).not_le · exact fun h => hr.not_le (le_trans (norm_nonneg _) (h φ)) · lift r to NNReal using hr simp_rw [← coe_nnnorm, nnnorm_eq, NNReal.coe_le_coe, Finset.sup_le_iff, Finset.mem_univ, forall_true_left] variable (K) def integerLattice : Subring ((K →+* ℂ) → ℂ) := (RingHom.range (algebraMap (𝓞 K) K)).map (canonicalEmbedding K)
Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean
93
105
theorem integerLattice.inter_ball_finite [NumberField K] (r : ℝ) : ((integerLattice K : Set ((K →+* ℂ) → ℂ)) ∩ Metric.closedBall 0 r).Finite := by
obtain hr | _ := lt_or_le r 0 · simp [Metric.closedBall_eq_empty.2 hr] · have heq : ∀ x, canonicalEmbedding K x ∈ Metric.closedBall 0 r ↔ ∀ φ : K →+* ℂ, ‖φ x‖ ≤ r := by intro x; rw [← norm_le_iff, mem_closedBall_zero_iff] convert (Embeddings.finite_of_norm_le K ℂ r).image (canonicalEmbedding K) ext; constructor · rintro ⟨⟨_, ⟨x, rfl⟩, rfl⟩, hx⟩ exact ⟨x, ⟨SetLike.coe_mem x, fun φ => (heq _).mp hx φ⟩, rfl⟩ · rintro ⟨x, ⟨hx1, hx2⟩, rfl⟩ exact ⟨⟨x, ⟨⟨x, hx1⟩, rfl⟩, rfl⟩, (heq x).mpr hx2⟩
import Mathlib.Data.Vector.Basic #align_import data.vector.mem from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226" namespace Vector variable {α β : Type*} {n : ℕ} (a a' : α) @[simp] theorem get_mem (i : Fin n) (v : Vector α n) : v.get i ∈ v.toList := by rw [get_eq_get] exact List.get_mem _ _ _ #align vector.nth_mem Vector.get_mem theorem mem_iff_get (v : Vector α n) : a ∈ v.toList ↔ ∃ i, v.get i = a := by simp only [List.mem_iff_get, Fin.exists_iff, Vector.get_eq_get] exact ⟨fun ⟨i, hi, h⟩ => ⟨i, by rwa [toList_length] at hi, h⟩, fun ⟨i, hi, h⟩ => ⟨i, by rwa [toList_length], h⟩⟩ #align vector.mem_iff_nth Vector.mem_iff_get theorem not_mem_nil : a ∉ (Vector.nil : Vector α 0).toList := by unfold Vector.nil dsimp simp #align vector.not_mem_nil Vector.not_mem_nil theorem not_mem_zero (v : Vector α 0) : a ∉ v.toList := (Vector.eq_nil v).symm ▸ not_mem_nil a #align vector.not_mem_zero Vector.not_mem_zero theorem mem_cons_iff (v : Vector α n) : a' ∈ (a ::ᵥ v).toList ↔ a' = a ∨ a' ∈ v.toList := by rw [Vector.toList_cons, List.mem_cons] #align vector.mem_cons_iff Vector.mem_cons_iff theorem mem_succ_iff (v : Vector α (n + 1)) : a ∈ v.toList ↔ a = v.head ∨ a ∈ v.tail.toList := by obtain ⟨a', v', h⟩ := exists_eq_cons v simp_rw [h, Vector.mem_cons_iff, Vector.head_cons, Vector.tail_cons] #align vector.mem_succ_iff Vector.mem_succ_iff theorem mem_cons_self (v : Vector α n) : a ∈ (a ::ᵥ v).toList := (Vector.mem_iff_get a (a ::ᵥ v)).2 ⟨0, Vector.get_cons_zero a v⟩ #align vector.mem_cons_self Vector.mem_cons_self @[simp] theorem head_mem (v : Vector α (n + 1)) : v.head ∈ v.toList := (Vector.mem_iff_get v.head v).2 ⟨0, Vector.get_zero v⟩ #align vector.head_mem Vector.head_mem theorem mem_cons_of_mem (v : Vector α n) (ha' : a' ∈ v.toList) : a' ∈ (a ::ᵥ v).toList := (Vector.mem_cons_iff a a' v).2 (Or.inr ha') #align vector.mem_cons_of_mem Vector.mem_cons_of_mem
Mathlib/Data/Vector/Mem.lean
70
73
theorem mem_of_mem_tail (v : Vector α n) (ha : a ∈ v.tail.toList) : a ∈ v.toList := by
induction' n with n _ · exact False.elim (Vector.not_mem_zero a v.tail ha) · exact (mem_succ_iff a v).2 (Or.inr ha)
import Mathlib.Control.Bitraversable.Basic #align_import control.bitraversable.lemmas from "leanprover-community/mathlib"@"58581d0fe523063f5651df0619be2bf65012a94a" universe u variable {t : Type u → Type u → Type u} [Bitraversable t] variable {β : Type u} namespace Bitraversable open Functor LawfulApplicative variable {F G : Type u → Type u} [Applicative F] [Applicative G] abbrev tfst {α α'} (f : α → F α') : t α β → F (t α' β) := bitraverse f pure #align bitraversable.tfst Bitraversable.tfst abbrev tsnd {α α'} (f : α → F α') : t β α → F (t β α') := bitraverse pure f #align bitraversable.tsnd Bitraversable.tsnd variable [LawfulBitraversable t] [LawfulApplicative F] [LawfulApplicative G] @[higher_order tfst_id] theorem id_tfst : ∀ {α β} (x : t α β), tfst (F := Id) pure x = pure x := id_bitraverse #align bitraversable.id_tfst Bitraversable.id_tfst @[higher_order tsnd_id] theorem id_tsnd : ∀ {α β} (x : t α β), tsnd (F := Id) pure x = pure x := id_bitraverse #align bitraversable.id_tsnd Bitraversable.id_tsnd @[higher_order tfst_comp_tfst] theorem comp_tfst {α₀ α₁ α₂ β} (f : α₀ → F α₁) (f' : α₁ → G α₂) (x : t α₀ β) : Comp.mk (tfst f' <$> tfst f x) = tfst (Comp.mk ∘ map f' ∘ f) x := by rw [← comp_bitraverse] simp only [Function.comp, tfst, map_pure, Pure.pure] #align bitraversable.comp_tfst Bitraversable.comp_tfst @[higher_order tfst_comp_tsnd] theorem tfst_tsnd {α₀ α₁ β₀ β₁} (f : α₀ → F α₁) (f' : β₀ → G β₁) (x : t α₀ β₀) : Comp.mk (tfst f <$> tsnd f' x) = bitraverse (Comp.mk ∘ pure ∘ f) (Comp.mk ∘ map pure ∘ f') x := by rw [← comp_bitraverse] simp only [Function.comp, map_pure] #align bitraversable.tfst_tsnd Bitraversable.tfst_tsnd @[higher_order tsnd_comp_tfst]
Mathlib/Control/Bitraversable/Lemmas.lean
87
91
theorem tsnd_tfst {α₀ α₁ β₀ β₁} (f : α₀ → F α₁) (f' : β₀ → G β₁) (x : t α₀ β₀) : Comp.mk (tsnd f' <$> tfst f x) = bitraverse (Comp.mk ∘ map pure ∘ f) (Comp.mk ∘ pure ∘ f') x := by
rw [← comp_bitraverse] simp only [Function.comp, map_pure]
import Mathlib.Analysis.RCLike.Basic import Mathlib.Dynamics.BirkhoffSum.Average open Function Set Filter open scoped Topology ENNReal Uniformity section variable {α E : Type*} theorem Function.IsFixedPt.tendsto_birkhoffAverage (R : Type*) [DivisionSemiring R] [CharZero R] [AddCommMonoid E] [TopologicalSpace E] [Module R E] {f : α → α} {x : α} (h : f.IsFixedPt x) (g : α → E) : Tendsto (birkhoffAverage R f g · x) atTop (𝓝 (g x)) := tendsto_const_nhds.congr' <| (eventually_ne_atTop 0).mono fun _n hn ↦ (h.birkhoffAverage_eq R g hn).symm variable [NormedAddCommGroup E] theorem dist_birkhoffSum_apply_birkhoffSum (f : α → α) (g : α → E) (n : ℕ) (x : α) : dist (birkhoffSum f g n (f x)) (birkhoffSum f g n x) = dist (g (f^[n] x)) (g x) := by simp only [dist_eq_norm, birkhoffSum_apply_sub_birkhoffSum] theorem dist_birkhoffSum_birkhoffSum_le (f : α → α) (g : α → E) (n : ℕ) (x y : α) : dist (birkhoffSum f g n x) (birkhoffSum f g n y) ≤ ∑ k ∈ Finset.range n, dist (g (f^[k] x)) (g (f^[k] y)) := dist_sum_sum_le _ _ _ variable (𝕜 : Type*) [RCLike 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E] theorem dist_birkhoffAverage_birkhoffAverage (f : α → α) (g : α → E) (n : ℕ) (x y : α) : dist (birkhoffAverage 𝕜 f g n x) (birkhoffAverage 𝕜 f g n y) = dist (birkhoffSum f g n x) (birkhoffSum f g n y) / n := by simp [birkhoffAverage, dist_smul₀, div_eq_inv_mul] theorem dist_birkhoffAverage_birkhoffAverage_le (f : α → α) (g : α → E) (n : ℕ) (x y : α) : dist (birkhoffAverage 𝕜 f g n x) (birkhoffAverage 𝕜 f g n y) ≤ (∑ k ∈ Finset.range n, dist (g (f^[k] x)) (g (f^[k] y))) / n := (dist_birkhoffAverage_birkhoffAverage _ _ _ _ _ _).trans_le <| by gcongr; apply dist_birkhoffSum_birkhoffSum_le
Mathlib/Dynamics/BirkhoffSum/NormedSpace.lean
64
67
theorem dist_birkhoffAverage_apply_birkhoffAverage (f : α → α) (g : α → E) (n : ℕ) (x : α) : dist (birkhoffAverage 𝕜 f g n (f x)) (birkhoffAverage 𝕜 f g n x) = dist (g (f^[n] x)) (g x) / n := by
simp [dist_birkhoffAverage_birkhoffAverage, dist_birkhoffSum_apply_birkhoffSum]
import Mathlib.Algebra.Homology.Homotopy import Mathlib.Algebra.Homology.Linear import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy import Mathlib.CategoryTheory.Quotient.Linear import Mathlib.CategoryTheory.Quotient.Preadditive #align_import algebra.homology.homotopy_category from "leanprover-community/mathlib"@"13ff898b0eee75d3cc75d1c06a491720eaaf911d" universe v u open scoped Classical noncomputable section open CategoryTheory CategoryTheory.Limits HomologicalComplex variable {R : Type*} [Semiring R] {ι : Type*} (V : Type u) [Category.{v} V] [Preadditive V] (c : ComplexShape ι) def homotopic : HomRel (HomologicalComplex V c) := fun _ _ f g => Nonempty (Homotopy f g) #align homotopic homotopic instance homotopy_congruence : Congruence (homotopic V c) where equivalence := { refl := fun C => ⟨Homotopy.refl C⟩ symm := fun ⟨w⟩ => ⟨w.symm⟩ trans := fun ⟨w₁⟩ ⟨w₂⟩ => ⟨w₁.trans w₂⟩ } compLeft := fun _ _ _ ⟨i⟩ => ⟨i.compLeft _⟩ compRight := fun _ ⟨i⟩ => ⟨i.compRight _⟩ #align homotopy_congruence homotopy_congruence def HomotopyCategory := CategoryTheory.Quotient (homotopic V c) #align homotopy_category HomotopyCategory instance : Category (HomotopyCategory V c) := by dsimp only [HomotopyCategory] infer_instance -- TODO the homotopy_category is preadditive namespace HomotopyCategory instance : Preadditive (HomotopyCategory V c) := Quotient.preadditive _ (by rintro _ _ _ _ _ _ ⟨h⟩ ⟨h'⟩ exact ⟨Homotopy.add h h'⟩) def quotient : HomologicalComplex V c ⥤ HomotopyCategory V c := CategoryTheory.Quotient.functor _ #align homotopy_category.quotient HomotopyCategory.quotient instance : (quotient V c).Full := Quotient.full_functor _ instance : (quotient V c).EssSurj := Quotient.essSurj_functor _ instance : (quotient V c).Additive where instance : Preadditive (CategoryTheory.Quotient (homotopic V c)) := (inferInstance : Preadditive (HomotopyCategory V c)) instance : Functor.Additive (Quotient.functor (homotopic V c)) where instance [Linear R V] : Linear R (HomotopyCategory V c) := Quotient.linear R (homotopic V c) (fun _ _ _ _ _ h => ⟨h.some.smul _⟩) instance [Linear R V] : Functor.Linear R (HomotopyCategory.quotient V c) := Quotient.linear_functor _ _ _ open ZeroObject instance [HasZeroObject V] : Inhabited (HomotopyCategory V c) := ⟨(quotient V c).obj 0⟩ instance [HasZeroObject V] : HasZeroObject (HomotopyCategory V c) := ⟨(quotient V c).obj 0, by rw [IsZero.iff_id_eq_zero, ← (quotient V c).map_id, id_zero, Functor.map_zero]⟩ instance {D : Type*} [Category D] : ((whiskeringLeft _ _ D).obj (quotient V c)).Full := Quotient.full_whiskeringLeft_functor _ _ instance {D : Type*} [Category D] : ((whiskeringLeft _ _ D).obj (quotient V c)).Faithful := Quotient.faithful_whiskeringLeft_functor _ _ variable {V c} -- Porting note: removed @[simp] attribute because it hinders the automatic application of the -- more useful `quotient_map_out` theorem quotient_obj_as (C : HomologicalComplex V c) : ((quotient V c).obj C).as = C := rfl #align homotopy_category.quotient_obj_as HomotopyCategory.quotient_obj_as @[simp] theorem quotient_map_out {C D : HomotopyCategory V c} (f : C ⟶ D) : (quotient V c).map f.out = f := Quot.out_eq _ #align homotopy_category.quotient_map_out HomotopyCategory.quotient_map_out -- Porting note: added to ease the port theorem quot_mk_eq_quotient_map {C D : HomologicalComplex V c} (f : C ⟶ D) : Quot.mk _ f = (quotient V c).map f := rfl theorem eq_of_homotopy {C D : HomologicalComplex V c} (f g : C ⟶ D) (h : Homotopy f g) : (quotient V c).map f = (quotient V c).map g := CategoryTheory.Quotient.sound _ ⟨h⟩ #align homotopy_category.eq_of_homotopy HomotopyCategory.eq_of_homotopy def homotopyOfEq {C D : HomologicalComplex V c} (f g : C ⟶ D) (w : (quotient V c).map f = (quotient V c).map g) : Homotopy f g := ((Quotient.functor_map_eq_iff _ _ _).mp w).some #align homotopy_category.homotopy_of_eq HomotopyCategory.homotopyOfEq def homotopyOutMap {C D : HomologicalComplex V c} (f : C ⟶ D) : Homotopy ((quotient V c).map f).out f := by apply homotopyOfEq simp #align homotopy_category.homotopy_out_map HomotopyCategory.homotopyOutMap @[simp 1100]
Mathlib/Algebra/Homology/HomotopyCategory.lean
138
139
theorem quotient_map_out_comp_out {C D E : HomotopyCategory V c} (f : C ⟶ D) (g : D ⟶ E) : (quotient V c).map (Quot.out f ≫ Quot.out g) = f ≫ g := by
simp
import Mathlib.Data.Fin.Tuple.Basic import Mathlib.Data.List.Join #align_import data.list.of_fn from "leanprover-community/mathlib"@"bf27744463e9620ca4e4ebe951fe83530ae6949b" universe u variable {α : Type u} open Nat namespace List #noalign list.length_of_fn_aux @[simp] theorem length_ofFn_go {n} (f : Fin n → α) (i j h) : length (ofFn.go f i j h) = i := by induction i generalizing j <;> simp_all [ofFn.go] @[simp]
Mathlib/Data/List/OfFn.lean
44
45
theorem length_ofFn {n} (f : Fin n → α) : length (ofFn f) = n := by
simp [ofFn, length_ofFn_go]
import Mathlib.Order.Cover import Mathlib.Order.Interval.Finset.Defs #align_import data.finset.locally_finite from "leanprover-community/mathlib"@"442a83d738cb208d3600056c489be16900ba701d" assert_not_exists MonoidWithZero assert_not_exists Finset.sum open Function OrderDual open FinsetInterval variable {ι α : Type*} namespace Finset section Preorder variable [Preorder α] section LocallyFiniteOrder variable [LocallyFiniteOrder α] {a a₁ a₂ b b₁ b₂ c x : α} @[simp, aesop safe apply (rule_sets := [finsetNonempty])] theorem nonempty_Icc : (Icc a b).Nonempty ↔ a ≤ b := by rw [← coe_nonempty, coe_Icc, Set.nonempty_Icc] #align finset.nonempty_Icc Finset.nonempty_Icc @[simp, aesop safe apply (rule_sets := [finsetNonempty])] theorem nonempty_Ico : (Ico a b).Nonempty ↔ a < b := by rw [← coe_nonempty, coe_Ico, Set.nonempty_Ico] #align finset.nonempty_Ico Finset.nonempty_Ico @[simp, aesop safe apply (rule_sets := [finsetNonempty])] theorem nonempty_Ioc : (Ioc a b).Nonempty ↔ a < b := by rw [← coe_nonempty, coe_Ioc, Set.nonempty_Ioc] #align finset.nonempty_Ioc Finset.nonempty_Ioc -- TODO: This is nonsense. A locally finite order is never densely ordered @[simp] theorem nonempty_Ioo [DenselyOrdered α] : (Ioo a b).Nonempty ↔ a < b := by rw [← coe_nonempty, coe_Ioo, Set.nonempty_Ioo] #align finset.nonempty_Ioo Finset.nonempty_Ioo @[simp] theorem Icc_eq_empty_iff : Icc a b = ∅ ↔ ¬a ≤ b := by rw [← coe_eq_empty, coe_Icc, Set.Icc_eq_empty_iff] #align finset.Icc_eq_empty_iff Finset.Icc_eq_empty_iff @[simp] theorem Ico_eq_empty_iff : Ico a b = ∅ ↔ ¬a < b := by rw [← coe_eq_empty, coe_Ico, Set.Ico_eq_empty_iff] #align finset.Ico_eq_empty_iff Finset.Ico_eq_empty_iff @[simp] theorem Ioc_eq_empty_iff : Ioc a b = ∅ ↔ ¬a < b := by rw [← coe_eq_empty, coe_Ioc, Set.Ioc_eq_empty_iff] #align finset.Ioc_eq_empty_iff Finset.Ioc_eq_empty_iff -- TODO: This is nonsense. A locally finite order is never densely ordered @[simp]
Mathlib/Order/Interval/Finset/Basic.lean
94
95
theorem Ioo_eq_empty_iff [DenselyOrdered α] : Ioo a b = ∅ ↔ ¬a < b := by
rw [← coe_eq_empty, coe_Ioo, Set.Ioo_eq_empty_iff]
import Mathlib.Data.Vector.Basic import Mathlib.Data.Vector.Snoc set_option autoImplicit true namespace Vector section Fold section Comm variable (xs ys : Vector α n)
Mathlib/Data/Vector/MapLemmas.lean
369
371
theorem map₂_comm (f : α → α → β) (comm : ∀ a₁ a₂, f a₁ a₂ = f a₂ a₁) : map₂ f xs ys = map₂ f ys xs := by
induction xs, ys using Vector.inductionOn₂ <;> simp_all
import Mathlib.Data.Set.Lattice #align_import data.set.intervals.disjoint from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" universe u v w variable {ι : Sort u} {α : Type v} {β : Type w} open Set open OrderDual (toDual) namespace Set section Preorder variable [Preorder α] {a b c : α} @[simp] theorem Iic_disjoint_Ioi (h : a ≤ b) : Disjoint (Iic a) (Ioi b) := disjoint_left.mpr fun _ ha hb => (h.trans_lt hb).not_le ha #align set.Iic_disjoint_Ioi Set.Iic_disjoint_Ioi @[simp] theorem Iio_disjoint_Ici (h : a ≤ b) : Disjoint (Iio a) (Ici b) := disjoint_left.mpr fun _ ha hb => (h.trans_lt' ha).not_le hb @[simp] theorem Iic_disjoint_Ioc (h : a ≤ b) : Disjoint (Iic a) (Ioc b c) := (Iic_disjoint_Ioi h).mono le_rfl Ioc_subset_Ioi_self #align set.Iic_disjoint_Ioc Set.Iic_disjoint_Ioc @[simp] theorem Ioc_disjoint_Ioc_same : Disjoint (Ioc a b) (Ioc b c) := (Iic_disjoint_Ioc le_rfl).mono Ioc_subset_Iic_self le_rfl #align set.Ioc_disjoint_Ioc_same Set.Ioc_disjoint_Ioc_same @[simp] theorem Ico_disjoint_Ico_same : Disjoint (Ico a b) (Ico b c) := disjoint_left.mpr fun _ hab hbc => hab.2.not_le hbc.1 #align set.Ico_disjoint_Ico_same Set.Ico_disjoint_Ico_same @[simp] theorem Ici_disjoint_Iic : Disjoint (Ici a) (Iic b) ↔ ¬a ≤ b := by rw [Set.disjoint_iff_inter_eq_empty, Ici_inter_Iic, Icc_eq_empty_iff] #align set.Ici_disjoint_Iic Set.Ici_disjoint_Iic @[simp] theorem Iic_disjoint_Ici : Disjoint (Iic a) (Ici b) ↔ ¬b ≤ a := disjoint_comm.trans Ici_disjoint_Iic #align set.Iic_disjoint_Ici Set.Iic_disjoint_Ici @[simp] theorem Ioc_disjoint_Ioi (h : b ≤ c) : Disjoint (Ioc a b) (Ioi c) := disjoint_left.mpr (fun _ hx hy ↦ (hx.2.trans h).not_lt hy) theorem Ioc_disjoint_Ioi_same : Disjoint (Ioc a b) (Ioi b) := Ioc_disjoint_Ioi le_rfl @[simp] theorem iUnion_Iic : ⋃ a : α, Iic a = univ := iUnion_eq_univ_iff.2 fun x => ⟨x, right_mem_Iic⟩ #align set.Union_Iic Set.iUnion_Iic @[simp] theorem iUnion_Ici : ⋃ a : α, Ici a = univ := iUnion_eq_univ_iff.2 fun x => ⟨x, left_mem_Ici⟩ #align set.Union_Ici Set.iUnion_Ici @[simp] theorem iUnion_Icc_right (a : α) : ⋃ b, Icc a b = Ici a := by simp only [← Ici_inter_Iic, ← inter_iUnion, iUnion_Iic, inter_univ] #align set.Union_Icc_right Set.iUnion_Icc_right @[simp]
Mathlib/Order/Interval/Set/Disjoint.lean
92
93
theorem iUnion_Ioc_right (a : α) : ⋃ b, Ioc a b = Ioi a := by
simp only [← Ioi_inter_Iic, ← inter_iUnion, iUnion_Iic, inter_univ]
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ι : Type*} {f : X → Y} {g : Y → Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X → Y) : @Inducing X Y (TopologicalSpace.induced f ‹_›) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f ‹_›) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp
Mathlib/Topology/Maps.lean
69
72
theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by
refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced]
import Mathlib.Analysis.InnerProductSpace.Dual import Mathlib.Analysis.InnerProductSpace.Orientation import Mathlib.Data.Complex.Orientation import Mathlib.Tactic.LinearCombination #align_import analysis.inner_product_space.two_dim from "leanprover-community/mathlib"@"cd8fafa2fac98e1a67097e8a91ad9901cfde48af" noncomputable section open scoped RealInnerProductSpace ComplexConjugate open FiniteDimensional lemma FiniteDimensional.of_fact_finrank_eq_two {K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] [Fact (finrank K V = 2)] : FiniteDimensional K V := .of_fact_finrank_eq_succ 1 attribute [local instance] FiniteDimensional.of_fact_finrank_eq_two @[deprecated (since := "2024-02-02")] alias FiniteDimensional.finiteDimensional_of_fact_finrank_eq_two := FiniteDimensional.of_fact_finrank_eq_two variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [Fact (finrank ℝ E = 2)] (o : Orientation ℝ E (Fin 2)) namespace Orientation irreducible_def areaForm : E →ₗ[ℝ] E →ₗ[ℝ] ℝ := by let z : E [⋀^Fin 0]→ₗ[ℝ] ℝ ≃ₗ[ℝ] ℝ := AlternatingMap.constLinearEquivOfIsEmpty.symm let y : E [⋀^Fin 1]→ₗ[ℝ] ℝ →ₗ[ℝ] E →ₗ[ℝ] ℝ := LinearMap.llcomp ℝ E (E [⋀^Fin 0]→ₗ[ℝ] ℝ) ℝ z ∘ₗ AlternatingMap.curryLeftLinearMap exact y ∘ₗ AlternatingMap.curryLeftLinearMap (R' := ℝ) o.volumeForm #align orientation.area_form Orientation.areaForm local notation "ω" => o.areaForm theorem areaForm_to_volumeForm (x y : E) : ω x y = o.volumeForm ![x, y] := by simp [areaForm] #align orientation.area_form_to_volume_form Orientation.areaForm_to_volumeForm @[simp] theorem areaForm_apply_self (x : E) : ω x x = 0 := by rw [areaForm_to_volumeForm] refine o.volumeForm.map_eq_zero_of_eq ![x, x] ?_ (?_ : (0 : Fin 2) ≠ 1) · simp · norm_num #align orientation.area_form_apply_self Orientation.areaForm_apply_self
Mathlib/Analysis/InnerProductSpace/TwoDim.lean
116
121
theorem areaForm_swap (x y : E) : ω x y = -ω y x := by
simp only [areaForm_to_volumeForm] convert o.volumeForm.map_swap ![y, x] (_ : (0 : Fin 2) ≠ 1) · ext i fin_cases i <;> rfl · norm_num
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
Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean
62
73
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
import Mathlib.Analysis.NormedSpace.Star.Spectrum import Mathlib.Analysis.Normed.Group.Quotient import Mathlib.Analysis.NormedSpace.Algebra import Mathlib.Topology.ContinuousFunction.Units import Mathlib.Topology.ContinuousFunction.Compact import Mathlib.Topology.Algebra.Algebra import Mathlib.Topology.ContinuousFunction.Ideals import Mathlib.Topology.ContinuousFunction.StoneWeierstrass #align_import analysis.normed_space.star.gelfand_duality from "leanprover-community/mathlib"@"e65771194f9e923a70dfb49b6ca7be6e400d8b6f" open WeakDual open scoped NNReal section ComplexBanachAlgebra open Ideal variable {A : Type*} [NormedCommRing A] [NormedAlgebra ℂ A] [CompleteSpace A] (I : Ideal A) [Ideal.IsMaximal I] noncomputable def Ideal.toCharacterSpace : characterSpace ℂ A := CharacterSpace.equivAlgHom.symm <| ((NormedRing.algEquivComplexOfComplete (letI := Quotient.field I; isUnit_iff_ne_zero (G₀ := A ⧸ I))).symm : A ⧸ I →ₐ[ℂ] ℂ).comp <| Quotient.mkₐ ℂ I #align ideal.to_character_space Ideal.toCharacterSpace theorem Ideal.toCharacterSpace_apply_eq_zero_of_mem {a : A} (ha : a ∈ I) : I.toCharacterSpace a = 0 := by unfold Ideal.toCharacterSpace simp only [CharacterSpace.equivAlgHom_symm_coe, AlgHom.coe_comp, AlgHom.coe_coe, Quotient.mkₐ_eq_mk, Function.comp_apply, NormedRing.algEquivComplexOfComplete_symm_apply] simp_rw [Quotient.eq_zero_iff_mem.mpr ha, spectrum.zero_eq] exact Set.eq_of_mem_singleton (Set.singleton_nonempty (0 : ℂ)).some_mem #align ideal.to_character_space_apply_eq_zero_of_mem Ideal.toCharacterSpace_apply_eq_zero_of_mem
Mathlib/Analysis/NormedSpace/Star/GelfandDuality.lean
99
105
theorem WeakDual.CharacterSpace.exists_apply_eq_zero {a : A} (ha : ¬IsUnit a) : ∃ f : characterSpace ℂ A, f a = 0 := by
obtain ⟨M, hM, haM⟩ := (span {a}).exists_le_maximal (span_singleton_ne_top ha) exact ⟨M.toCharacterSpace, M.toCharacterSpace_apply_eq_zero_of_mem (haM (mem_span_singleton.mpr ⟨1, (mul_one a).symm⟩))⟩
import Mathlib.Data.Matroid.Restrict variable {α : Type*} {M : Matroid α} {E B I X R J : Set α} namespace Matroid open Set section EmptyOn def emptyOn (α : Type*) : Matroid α where E := ∅ Base := (· = ∅) Indep := (· = ∅) indep_iff' := by simp [subset_empty_iff] exists_base := ⟨∅, rfl⟩ base_exchange := by rintro _ _ rfl; simp maximality := by rintro _ _ _ rfl -; exact ⟨∅, by simp [mem_maximals_iff]⟩ subset_ground := by simp @[simp] theorem emptyOn_ground : (emptyOn α).E = ∅ := rfl @[simp] theorem emptyOn_base_iff : (emptyOn α).Base B ↔ B = ∅ := Iff.rfl @[simp] theorem emptyOn_indep_iff : (emptyOn α).Indep I ↔ I = ∅ := Iff.rfl theorem ground_eq_empty_iff : (M.E = ∅) ↔ M = emptyOn α := by simp only [emptyOn, eq_iff_indep_iff_indep_forall, iff_self_and] exact fun h ↦ by simp [h, subset_empty_iff] @[simp] theorem emptyOn_dual_eq : (emptyOn α)✶ = emptyOn α := by rw [← ground_eq_empty_iff]; rfl @[simp] theorem restrict_empty (M : Matroid α) : M ↾ (∅ : Set α) = emptyOn α := by simp [← ground_eq_empty_iff] theorem eq_emptyOn_or_nonempty (M : Matroid α) : M = emptyOn α ∨ Matroid.Nonempty M := by rw [← ground_eq_empty_iff] exact M.E.eq_empty_or_nonempty.elim Or.inl (fun h ↦ Or.inr ⟨h⟩)
Mathlib/Data/Matroid/Constructions.lean
71
73
theorem eq_emptyOn [IsEmpty α] (M : Matroid α) : M = emptyOn α := by
rw [← ground_eq_empty_iff] exact M.E.eq_empty_of_isEmpty
import Mathlib.CategoryTheory.Limits.Shapes.WideEqualizers import Mathlib.CategoryTheory.Limits.Shapes.Products import Mathlib.CategoryTheory.Limits.Shapes.Terminal #align_import category_theory.limits.constructions.weakly_initial from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v u namespace CategoryTheory open Limits variable {C : Type u} [Category.{v} C] theorem has_weakly_initial_of_weakly_initial_set_and_hasProducts [HasProducts.{v} C] {ι : Type v} {B : ι → C} (hB : ∀ A : C, ∃ i, Nonempty (B i ⟶ A)) : ∃ T : C, ∀ X, Nonempty (T ⟶ X) := ⟨∏ᶜ B, fun X => ⟨Pi.π _ _ ≫ (hB X).choose_spec.some⟩⟩ #align category_theory.has_weakly_initial_of_weakly_initial_set_and_has_products CategoryTheory.has_weakly_initial_of_weakly_initial_set_and_hasProducts
Mathlib/CategoryTheory/Limits/Constructions/WeaklyInitial.lean
46
64
theorem hasInitial_of_weakly_initial_and_hasWideEqualizers [HasWideEqualizers.{v} C] {T : C} (hT : ∀ X, Nonempty (T ⟶ X)) : HasInitial C := by
let endos := T ⟶ T let i := wideEqualizer.ι (id : endos → endos) haveI : Nonempty endos := ⟨𝟙 _⟩ have : ∀ X : C, Unique (wideEqualizer (id : endos → endos) ⟶ X) := by intro X refine ⟨⟨i ≫ Classical.choice (hT X)⟩, fun a => ?_⟩ let E := equalizer a (i ≫ Classical.choice (hT _)) let e : E ⟶ wideEqualizer id := equalizer.ι _ _ let h : T ⟶ E := Classical.choice (hT E) have : ((i ≫ h) ≫ e) ≫ i = i ≫ 𝟙 _ := by rw [Category.assoc, Category.assoc] apply wideEqualizer.condition (id : endos → endos) (h ≫ e ≫ i) rw [Category.comp_id, cancel_mono_id i] at this haveI : IsSplitEpi e := IsSplitEpi.mk' ⟨i ≫ h, this⟩ rw [← cancel_epi e] apply equalizer.condition exact hasInitial_of_unique (wideEqualizer (id : endos → endos))
import Mathlib.Data.Set.Defs import Mathlib.Order.Heyting.Basic import Mathlib.Order.RelClasses import Mathlib.Order.Hom.Basic import Mathlib.Lean.Thunk set_option autoImplicit true class EstimatorData (a : Thunk α) (ε : Type*) where bound : ε → α improve : ε → Option ε class Estimator [Preorder α] (a : Thunk α) (ε : Type*) extends EstimatorData a ε where bound_le e : bound e ≤ a.get improve_spec e : match improve e with | none => bound e = a.get | some e' => bound e < bound e' open EstimatorData Set section improveUntil variable [Preorder α] attribute [local instance] WellFoundedGT.toWellFoundedRelation in def Estimator.improveUntilAux (a : Thunk α) (p : α → Bool) [Estimator a ε] [WellFoundedGT (range (bound a : ε → α))] (e : ε) (r : Bool) : Except (Option ε) ε := if p (bound a e) then return e else match improve a e, improve_spec e with | none, _ => .error <| if r then none else e | some e', _ => improveUntilAux a p e' true termination_by (⟨_, mem_range_self e⟩ : range (bound a)) def Estimator.improveUntil (a : Thunk α) (p : α → Bool) [Estimator a ε] [WellFoundedGT (range (bound a : ε → α))] (e : ε) : Except (Option ε) ε := Estimator.improveUntilAux a p e false attribute [local instance] WellFoundedGT.toWellFoundedRelation in
Mathlib/Order/Estimator.lean
126
142
theorem Estimator.improveUntilAux_spec (a : Thunk α) (p : α → Bool) [Estimator a ε] [WellFoundedGT (range (bound a : ε → α))] (e : ε) (r : Bool) : match Estimator.improveUntilAux a p e r with | .error _ => ¬ p a.get | .ok e' => p (bound a e') := by
rw [Estimator.improveUntilAux] by_cases h : p (bound a e) · simp only [h]; exact h · simp only [h] match improve a e, improve_spec e with | none, eq => simp only [Bool.not_eq_true] rw [eq] at h exact Bool.bool_eq_false h | some e', _ => exact Estimator.improveUntilAux_spec a p e' true termination_by (⟨_, mem_range_self e⟩ : range (bound a))
import Mathlib.Data.Nat.Prime #align_import data.int.nat_prime from "leanprover-community/mathlib"@"422e70f7ce183d2900c586a8cda8381e788a0c62" open Nat namespace Int theorem not_prime_of_int_mul {a b : ℤ} {c : ℕ} (ha : a.natAbs ≠ 1) (hb : b.natAbs ≠ 1) (hc : a * b = (c : ℤ)) : ¬Nat.Prime c := not_prime_mul' (natAbs_mul_natAbs_eq hc) ha hb #align int.not_prime_of_int_mul Int.not_prime_of_int_mul
Mathlib/Data/Int/NatPrime.lean
24
33
theorem succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul {p : ℕ} (p_prime : Nat.Prime p) {m n : ℤ} {k l : ℕ} (hpm : ↑(p ^ k) ∣ m) (hpn : ↑(p ^ l) ∣ n) (hpmn : ↑(p ^ (k + l + 1)) ∣ m * n) : ↑(p ^ (k + 1)) ∣ m ∨ ↑(p ^ (l + 1)) ∣ n := have hpm' : p ^ k ∣ m.natAbs := Int.natCast_dvd_natCast.1 <| Int.dvd_natAbs.2 hpm have hpn' : p ^ l ∣ n.natAbs := Int.natCast_dvd_natCast.1 <| Int.dvd_natAbs.2 hpn have hpmn' : p ^ (k + l + 1) ∣ m.natAbs * n.natAbs := by
rw [← Int.natAbs_mul]; apply Int.natCast_dvd_natCast.1 <| Int.dvd_natAbs.2 hpmn let hsd := Nat.succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul p_prime hpm' hpn' hpmn' hsd.elim (fun hsd1 => Or.inl (by apply Int.dvd_natAbs.1; apply Int.natCast_dvd_natCast.2 hsd1)) fun hsd2 => Or.inr (by apply Int.dvd_natAbs.1; apply Int.natCast_dvd_natCast.2 hsd2)
import Mathlib.CategoryTheory.Bicategory.Functor.Oplax #align_import category_theory.bicategory.natural_transformation from "leanprover-community/mathlib"@"4ff75f5b8502275a4c2eb2d2f02bdf84d7fb8993" namespace CategoryTheory open Category Bicategory open scoped Bicategory universe w₁ w₂ v₁ v₂ u₁ u₂ variable {B : Type u₁} [Bicategory.{w₁, v₁} B] {C : Type u₂} [Bicategory.{w₂, v₂} C] structure OplaxNatTrans (F G : OplaxFunctor B C) where app (a : B) : F.obj a ⟶ G.obj a naturality {a b : B} (f : a ⟶ b) : F.map f ≫ app b ⟶ app a ≫ G.map f naturality_naturality : ∀ {a b : B} {f g : a ⟶ b} (η : f ⟶ g), F.map₂ η ▷ app b ≫ naturality g = naturality f ≫ app a ◁ G.map₂ η := by aesop_cat naturality_id : ∀ a : B, naturality (𝟙 a) ≫ app a ◁ G.mapId a = F.mapId a ▷ app a ≫ (λ_ (app a)).hom ≫ (ρ_ (app a)).inv := by aesop_cat naturality_comp : ∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c), naturality (f ≫ g) ≫ app a ◁ G.mapComp f g = F.mapComp f g ▷ app c ≫ (α_ _ _ _).hom ≫ F.map f ◁ naturality g ≫ (α_ _ _ _).inv ≫ naturality f ▷ G.map g ≫ (α_ _ _ _).hom := by aesop_cat #align category_theory.oplax_nat_trans CategoryTheory.OplaxNatTrans #align category_theory.oplax_nat_trans.app CategoryTheory.OplaxNatTrans.app #align category_theory.oplax_nat_trans.naturality CategoryTheory.OplaxNatTrans.naturality #align category_theory.oplax_nat_trans.naturality_naturality' CategoryTheory.OplaxNatTrans.naturality_naturality #align category_theory.oplax_nat_trans.naturality_naturality CategoryTheory.OplaxNatTrans.naturality_naturality #align category_theory.oplax_nat_trans.naturality_id' CategoryTheory.OplaxNatTrans.naturality_id #align category_theory.oplax_nat_trans.naturality_id CategoryTheory.OplaxNatTrans.naturality_id #align category_theory.oplax_nat_trans.naturality_comp' CategoryTheory.OplaxNatTrans.naturality_comp #align category_theory.oplax_nat_trans.naturality_comp CategoryTheory.OplaxNatTrans.naturality_comp attribute [nolint docBlame] CategoryTheory.OplaxNatTrans.app CategoryTheory.OplaxNatTrans.naturality CategoryTheory.OplaxNatTrans.naturality_naturality CategoryTheory.OplaxNatTrans.naturality_id CategoryTheory.OplaxNatTrans.naturality_comp attribute [reassoc (attr := simp)] OplaxNatTrans.naturality_naturality OplaxNatTrans.naturality_id OplaxNatTrans.naturality_comp namespace OplaxNatTrans section variable (F : OplaxFunctor B C) @[simps] def id : OplaxNatTrans F F where app a := 𝟙 (F.obj a) naturality {a b} f := (ρ_ (F.map f)).hom ≫ (λ_ (F.map f)).inv #align category_theory.oplax_nat_trans.id CategoryTheory.OplaxNatTrans.id instance : Inhabited (OplaxNatTrans F F) := ⟨id F⟩ variable {F} {G H : OplaxFunctor B C} (η : OplaxNatTrans F G) (θ : OplaxNatTrans G H) section variable {a b c : B} {a' : C} @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Bicategory/NaturalTransformation.lean
104
107
theorem whiskerLeft_naturality_naturality (f : a' ⟶ G.obj a) {g h : a ⟶ b} (β : g ⟶ h) : f ◁ G.map₂ β ▷ θ.app b ≫ f ◁ θ.naturality h = f ◁ θ.naturality g ≫ f ◁ θ.app a ◁ H.map₂ β := by
simp_rw [← whiskerLeft_comp, naturality_naturality]
import Mathlib.MeasureTheory.Integral.IntervalIntegral import Mathlib.Order.Filter.IndicatorFunction open MeasureTheory section DominatedConvergenceTheorem open Set Filter TopologicalSpace ENNReal open scoped Topology namespace MeasureTheory variable {α E G: Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : α → E} {m : MeasurableSpace α} {μ : Measure α} theorem tendsto_integral_of_dominated_convergence {F : ℕ → α → G} {f : α → G} (bound : α → ℝ) (F_measurable : ∀ n, AEStronglyMeasurable (F n) μ) (bound_integrable : Integrable bound μ) (h_bound : ∀ n, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound a) (h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) atTop (𝓝 (f a))) : Tendsto (fun n => ∫ a, F n a ∂μ) atTop (𝓝 <| ∫ a, f a ∂μ) := by by_cases hG : CompleteSpace G · simp only [integral, hG, L1.integral] exact tendsto_setToFun_of_dominated_convergence (dominatedFinMeasAdditive_weightedSMul μ) bound F_measurable bound_integrable h_bound h_lim · simp [integral, hG] #align measure_theory.tendsto_integral_of_dominated_convergence MeasureTheory.tendsto_integral_of_dominated_convergence
Mathlib/MeasureTheory/Integral/DominatedConvergence.lean
66
75
theorem tendsto_integral_filter_of_dominated_convergence {ι} {l : Filter ι} [l.IsCountablyGenerated] {F : ι → α → G} {f : α → G} (bound : α → ℝ) (hF_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) μ) (h_bound : ∀ᶠ n in l, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound a) (bound_integrable : Integrable bound μ) (h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) l (𝓝 (f a))) : Tendsto (fun n => ∫ a, F n a ∂μ) l (𝓝 <| ∫ a, f a ∂μ) := by
by_cases hG : CompleteSpace G · simp only [integral, hG, L1.integral] exact tendsto_setToFun_filter_of_dominated_convergence (dominatedFinMeasAdditive_weightedSMul μ) bound hF_meas h_bound bound_integrable h_lim · simp [integral, hG, tendsto_const_nhds]
import Mathlib.Algebra.EuclideanDomain.Basic import Mathlib.RingTheory.PrincipalIdealDomain import Mathlib.Algebra.GCDMonoid.Nat #align_import ring_theory.int.basic from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" namespace Int theorem gcd_eq_one_iff_coprime {a b : ℤ} : Int.gcd a b = 1 ↔ IsCoprime a b := by constructor · intro hg obtain ⟨ua, -, ha⟩ := exists_unit_of_abs a obtain ⟨ub, -, hb⟩ := exists_unit_of_abs b use Nat.gcdA (Int.natAbs a) (Int.natAbs b) * ua, Nat.gcdB (Int.natAbs a) (Int.natAbs b) * ub rw [mul_assoc, ← ha, mul_assoc, ← hb, mul_comm, mul_comm _ (Int.natAbs b : ℤ), ← Nat.gcd_eq_gcd_ab, ← gcd_eq_natAbs, hg, Int.ofNat_one] · rintro ⟨r, s, h⟩ by_contra hg obtain ⟨p, ⟨hp, ha, hb⟩⟩ := Nat.Prime.not_coprime_iff_dvd.mp hg apply Nat.Prime.not_dvd_one hp rw [← natCast_dvd_natCast, Int.ofNat_one, ← h] exact dvd_add ((natCast_dvd.mpr ha).mul_left _) ((natCast_dvd.mpr hb).mul_left _) #align int.gcd_eq_one_iff_coprime Int.gcd_eq_one_iff_coprime theorem coprime_iff_nat_coprime {a b : ℤ} : IsCoprime a b ↔ Nat.Coprime a.natAbs b.natAbs := by rw [← gcd_eq_one_iff_coprime, Nat.coprime_iff_gcd_eq_one, gcd_eq_natAbs] #align int.coprime_iff_nat_coprime Int.coprime_iff_nat_coprime
Mathlib/RingTheory/Int/Basic.lean
54
56
theorem gcd_ne_one_iff_gcd_mul_right_ne_one {a : ℤ} {m n : ℕ} : a.gcd (m * n) ≠ 1 ↔ a.gcd m ≠ 1 ∨ a.gcd n ≠ 1 := by
simp only [gcd_eq_one_iff_coprime, ← not_and_or, not_iff_not, IsCoprime.mul_right_iff]
import Mathlib.Order.Filter.Basic #align_import order.filter.prod from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce" open Set open Filter namespace Filter variable {α β γ δ : Type*} {ι : Sort*} section Prod variable {s : Set α} {t : Set β} {f : Filter α} {g : Filter β} protected def prod (f : Filter α) (g : Filter β) : Filter (α × β) := f.comap Prod.fst ⊓ g.comap Prod.snd #align filter.prod Filter.prod instance instSProd : SProd (Filter α) (Filter β) (Filter (α × β)) where sprod := Filter.prod theorem prod_mem_prod (hs : s ∈ f) (ht : t ∈ g) : s ×ˢ t ∈ f ×ˢ g := inter_mem_inf (preimage_mem_comap hs) (preimage_mem_comap ht) #align filter.prod_mem_prod Filter.prod_mem_prod theorem mem_prod_iff {s : Set (α × β)} {f : Filter α} {g : Filter β} : s ∈ f ×ˢ g ↔ ∃ t₁ ∈ f, ∃ t₂ ∈ g, t₁ ×ˢ t₂ ⊆ s := by simp only [SProd.sprod, Filter.prod] constructor · rintro ⟨t₁, ⟨s₁, hs₁, hts₁⟩, t₂, ⟨s₂, hs₂, hts₂⟩, rfl⟩ exact ⟨s₁, hs₁, s₂, hs₂, fun p ⟨h, h'⟩ => ⟨hts₁ h, hts₂ h'⟩⟩ · rintro ⟨t₁, ht₁, t₂, ht₂, h⟩ exact mem_inf_of_inter (preimage_mem_comap ht₁) (preimage_mem_comap ht₂) h #align filter.mem_prod_iff Filter.mem_prod_iff @[simp] theorem prod_mem_prod_iff [f.NeBot] [g.NeBot] : s ×ˢ t ∈ f ×ˢ g ↔ s ∈ f ∧ t ∈ g := ⟨fun h => let ⟨_s', hs', _t', ht', H⟩ := mem_prod_iff.1 h (prod_subset_prod_iff.1 H).elim (fun ⟨hs's, ht't⟩ => ⟨mem_of_superset hs' hs's, mem_of_superset ht' ht't⟩) fun h => h.elim (fun hs'e => absurd hs'e (nonempty_of_mem hs').ne_empty) fun ht'e => absurd ht'e (nonempty_of_mem ht').ne_empty, fun h => prod_mem_prod h.1 h.2⟩ #align filter.prod_mem_prod_iff Filter.prod_mem_prod_iff theorem mem_prod_principal {s : Set (α × β)} : s ∈ f ×ˢ 𝓟 t ↔ { a | ∀ b ∈ t, (a, b) ∈ s } ∈ f := by rw [← @exists_mem_subset_iff _ f, mem_prod_iff] refine exists_congr fun u => Iff.rfl.and ⟨?_, fun h => ⟨t, mem_principal_self t, ?_⟩⟩ · rintro ⟨v, v_in, hv⟩ a a_in b b_in exact hv (mk_mem_prod a_in <| v_in b_in) · rintro ⟨x, y⟩ ⟨hx, hy⟩ exact h hx y hy #align filter.mem_prod_principal Filter.mem_prod_principal theorem mem_prod_top {s : Set (α × β)} : s ∈ f ×ˢ (⊤ : Filter β) ↔ { a | ∀ b, (a, b) ∈ s } ∈ f := by rw [← principal_univ, mem_prod_principal] simp only [mem_univ, forall_true_left] #align filter.mem_prod_top Filter.mem_prod_top theorem eventually_prod_principal_iff {p : α × β → Prop} {s : Set β} : (∀ᶠ x : α × β in f ×ˢ 𝓟 s, p x) ↔ ∀ᶠ x : α in f, ∀ y : β, y ∈ s → p (x, y) := by rw [eventually_iff, eventually_iff, mem_prod_principal] simp only [mem_setOf_eq] #align filter.eventually_prod_principal_iff Filter.eventually_prod_principal_iff theorem comap_prod (f : α → β × γ) (b : Filter β) (c : Filter γ) : comap f (b ×ˢ c) = comap (Prod.fst ∘ f) b ⊓ comap (Prod.snd ∘ f) c := by erw [comap_inf, Filter.comap_comap, Filter.comap_comap] #align filter.comap_prod Filter.comap_prod theorem prod_top : f ×ˢ (⊤ : Filter β) = f.comap Prod.fst := by dsimp only [SProd.sprod] rw [Filter.prod, comap_top, inf_top_eq] #align filter.prod_top Filter.prod_top theorem top_prod : (⊤ : Filter α) ×ˢ g = g.comap Prod.snd := by dsimp only [SProd.sprod] rw [Filter.prod, comap_top, top_inf_eq] theorem sup_prod (f₁ f₂ : Filter α) (g : Filter β) : (f₁ ⊔ f₂) ×ˢ g = (f₁ ×ˢ g) ⊔ (f₂ ×ˢ g) := by dsimp only [SProd.sprod] rw [Filter.prod, comap_sup, inf_sup_right, ← Filter.prod, ← Filter.prod] #align filter.sup_prod Filter.sup_prod theorem prod_sup (f : Filter α) (g₁ g₂ : Filter β) : f ×ˢ (g₁ ⊔ g₂) = (f ×ˢ g₁) ⊔ (f ×ˢ g₂) := by dsimp only [SProd.sprod] rw [Filter.prod, comap_sup, inf_sup_left, ← Filter.prod, ← Filter.prod] #align filter.prod_sup Filter.prod_sup
Mathlib/Order/Filter/Prod.lean
131
135
theorem eventually_prod_iff {p : α × β → Prop} : (∀ᶠ x in f ×ˢ g, p x) ↔ ∃ pa : α → Prop, (∀ᶠ x in f, pa x) ∧ ∃ pb : β → Prop, (∀ᶠ y in g, pb y) ∧ ∀ {x}, pa x → ∀ {y}, pb y → p (x, y) := by
simpa only [Set.prod_subset_iff] using @mem_prod_iff α β p f g
import Mathlib.Algebra.Module.Zlattice.Basic import Mathlib.NumberTheory.NumberField.Embeddings import Mathlib.NumberTheory.NumberField.FractionalIdeal #align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30" variable (K : Type*) [Field K] namespace NumberField.mixedEmbedding open NumberField NumberField.InfinitePlace FiniteDimensional Finset local notation "E" K => ({w : InfinitePlace K // IsReal w} → ℝ) × ({w : InfinitePlace K // IsComplex w} → ℂ) noncomputable def _root_.NumberField.mixedEmbedding : K →+* (E K) := RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop) (Pi.ringHom fun w => w.val.embedding) instance [NumberField K] : Nontrivial (E K) := by obtain ⟨w⟩ := (inferInstance : Nonempty (InfinitePlace K)) obtain hw | hw := w.isReal_or_isComplex · have : Nonempty {w : InfinitePlace K // IsReal w} := ⟨⟨w, hw⟩⟩ exact nontrivial_prod_left · have : Nonempty {w : InfinitePlace K // IsComplex w} := ⟨⟨w, hw⟩⟩ exact nontrivial_prod_right protected theorem finrank [NumberField K] : finrank ℝ (E K) = finrank ℚ K := by classical rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const, card_univ, ← NrRealPlaces, ← NrComplexPlaces, ← card_real_embeddings, Algebra.id.smul_eq_mul, mul_comm, ← card_complex_embeddings, ← NumberField.Embeddings.card K ℂ, Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)] theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] : Function.Injective (NumberField.mixedEmbedding K) := by exact RingHom.injective _ noncomputable section norm open scoped Classical variable {K} def normAtPlace (w : InfinitePlace K) : (E K) →*₀ ℝ where toFun x := if hw : IsReal w then ‖x.1 ⟨w, hw⟩‖ else ‖x.2 ⟨w, not_isReal_iff_isComplex.mp hw⟩‖ map_zero' := by simp map_one' := by simp map_mul' x y := by split_ifs <;> simp
Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean
259
262
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) : 0 ≤ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk] split_ifs <;> exact norm_nonneg _
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" variable {ι : Type*} [Fintype ι] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) variable (b : ι → M) (hb : Submodule.span R (Set.range b) = ⊤) open Polynomial Matrix def PiToModule.fromMatrix [DecidableEq ι] : Matrix ι ι R →ₗ[R] (ι → R) →ₗ[R] M := (LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap #align pi_to_module.from_matrix PiToModule.fromMatrix theorem PiToModule.fromMatrix_apply [DecidableEq ι] (A : Matrix ι ι R) (w : ι → R) : PiToModule.fromMatrix R b A w = Fintype.total R R b (A *ᵥ w) := rfl #align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ι] (A : Matrix ι ι R) (j : ι) : PiToModule.fromMatrix R b A (Pi.single j 1) = ∑ i : ι, A i j • b i := by rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single] simp_rw [mul_one] #align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one def PiToModule.fromEnd : Module.End R M →ₗ[R] (ι → R) →ₗ[R] M := LinearMap.lcomp _ _ (Fintype.total R R b) #align pi_to_module.from_End PiToModule.fromEnd theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ι → R) : PiToModule.fromEnd R b f w = f (Fintype.total R R b w) := rfl #align pi_to_module.from_End_apply PiToModule.fromEnd_apply theorem PiToModule.fromEnd_apply_single_one [DecidableEq ι] (f : Module.End R M) (i : ι) : PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by rw [PiToModule.fromEnd_apply] congr convert Fintype.total_apply_single (S := R) R b i (1 : R) rw [one_smul] #align pi_to_module.from_End_apply_single_one PiToModule.fromEnd_apply_single_one theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊤) : Function.Injective (PiToModule.fromEnd R b) := by intro x y e ext m obtain ⟨m, rfl⟩ : m ∈ LinearMap.range (Fintype.total R R b) := by rw [(Fintype.range_total R b).trans hb] exact Submodule.mem_top exact (LinearMap.congr_fun e m : _) #align pi_to_module.from_End_injective PiToModule.fromEnd_injective section variable {R} [DecidableEq ι] def Matrix.Represents (A : Matrix ι ι R) (f : Module.End R M) : Prop := PiToModule.fromMatrix R b A = PiToModule.fromEnd R b f #align matrix.represents Matrix.Represents variable {b} theorem Matrix.Represents.congr_fun {A : Matrix ι ι R} {f : Module.End R M} (h : A.Represents b f) (x) : Fintype.total R R b (A *ᵥ x) = f (Fintype.total R R b x) := LinearMap.congr_fun h x #align matrix.represents.congr_fun Matrix.Represents.congr_fun theorem Matrix.represents_iff {A : Matrix ι ι R} {f : Module.End R M} : A.Represents b f ↔ ∀ x, Fintype.total R R b (A *ᵥ x) = f (Fintype.total R R b x) := ⟨fun e x => e.congr_fun x, fun H => LinearMap.ext fun x => H x⟩ #align matrix.represents_iff Matrix.represents_iff theorem Matrix.represents_iff' {A : Matrix ι ι R} {f : Module.End R M} : A.Represents b f ↔ ∀ j, ∑ i : ι, A i j • b i = f (b j) := by constructor · intro h i have := LinearMap.congr_fun h (Pi.single i 1) rwa [PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] at this · intro h -- Porting note: was `ext` refine LinearMap.pi_ext' (fun i => LinearMap.ext_ring ?_) simp_rw [LinearMap.comp_apply, LinearMap.coe_single, PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] apply h #align matrix.represents_iff' Matrix.represents_iff' theorem Matrix.Represents.mul {A A' : Matrix ι ι R} {f f' : Module.End R M} (h : A.Represents b f) (h' : Matrix.Represents b A' f') : (A * A').Represents b (f * f') := by delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_mul] ext dsimp [PiToModule.fromEnd] rw [← h'.congr_fun, ← h.congr_fun] rfl #align matrix.represents.mul Matrix.Represents.mul theorem Matrix.Represents.one : (1 : Matrix ι ι R).Represents b 1 := by delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_one] ext rfl #align matrix.represents.one Matrix.Represents.one theorem Matrix.Represents.add {A A' : Matrix ι ι R} {f f' : Module.End R M} (h : A.Represents b f) (h' : Matrix.Represents b A' f') : (A + A').Represents b (f + f') := by delta Matrix.Represents at h h' ⊢; rw [map_add, map_add, h, h'] #align matrix.represents.add Matrix.Represents.add theorem Matrix.Represents.zero : (0 : Matrix ι ι R).Represents b 0 := by delta Matrix.Represents rw [map_zero, map_zero] #align matrix.represents.zero Matrix.Represents.zero
Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean
141
144
theorem Matrix.Represents.smul {A : Matrix ι ι R} {f : Module.End R M} (h : A.Represents b f) (r : R) : (r • A).Represents b (r • f) := by
delta Matrix.Represents at h ⊢ rw [_root_.map_smul, _root_.map_smul, h]
import Mathlib.Topology.MetricSpace.Basic #align_import topology.metric_space.infsep from "leanprover-community/mathlib"@"5316314b553dcf8c6716541851517c1a9715e22b" variable {α β : Type*} namespace Set section Einfsep open ENNReal open Function noncomputable def einfsep [EDist α] (s : Set α) : ℝ≥0∞ := ⨅ (x ∈ s) (y ∈ s) (_ : x ≠ y), edist x y #align set.einfsep Set.einfsep section Infsep open ENNReal open Set Function noncomputable def infsep [EDist α] (s : Set α) : ℝ := ENNReal.toReal s.einfsep #align set.infsep Set.infsep section EDist variable [EDist α] {x y : α} {s : Set α} theorem infsep_zero : s.infsep = 0 ↔ s.einfsep = 0 ∨ s.einfsep = ∞ := by rw [infsep, ENNReal.toReal_eq_zero_iff] #align set.infsep_zero Set.infsep_zero theorem infsep_nonneg : 0 ≤ s.infsep := ENNReal.toReal_nonneg #align set.infsep_nonneg Set.infsep_nonneg
Mathlib/Topology/MetricSpace/Infsep.lean
340
341
theorem infsep_pos : 0 < s.infsep ↔ 0 < s.einfsep ∧ s.einfsep < ∞ := by
simp_rw [infsep, ENNReal.toReal_pos_iff]
import Mathlib.Algebra.Group.Semiconj.Defs import Mathlib.Init.Algebra.Classes #align_import algebra.group.commute from "leanprover-community/mathlib"@"05101c3df9d9cfe9430edc205860c79b6d660102" assert_not_exists MonoidWithZero assert_not_exists DenselyOrdered variable {G M S : Type*} @[to_additive "Two elements additively commute if `a + b = b + a`"] def Commute [Mul S] (a b : S) : Prop := SemiconjBy a b b #align commute Commute #align add_commute AddCommute @[to_additive] theorem commute_iff_eq [Mul S] (a b : S) : Commute a b ↔ a * b = b * a := Iff.rfl namespace Commute @[to_additive] protected theorem all [CommMagma S] (a b : S) : Commute a b := mul_comm a b #align commute.all Commute.allₓ #align add_commute.all AddCommute.allₓ -- not sure why this needs an `ₓ`, maybe instance names not aligned? section Group variable [Group G] {a b : G} @[to_additive] protected theorem mul_inv_cancel (h : Commute a b) : a * b * a⁻¹ = b := by rw [h.eq, mul_inv_cancel_right] #align commute.mul_inv_cancel Commute.mul_inv_cancel #align add_commute.add_neg_cancel AddCommute.add_neg_cancel @[to_additive]
Mathlib/Algebra/Group/Commute/Defs.lean
262
263
theorem mul_inv_cancel_assoc (h : Commute a b) : a * (b * a⁻¹) = b := by
rw [← mul_assoc, h.mul_inv_cancel]