Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k | num_lines int64 1 150 | complexity_score float64 2.72 139,370,958,066,637,970,000,000,000,000,000,000,000,000,000,000,000,000,000B | diff_level int64 0 2 | file_diff_level float64 0 2 | theorem_same_file int64 1 32 | rank_file int64 0 2.51k |
|---|---|---|---|---|---|---|---|---|---|---|---|
import Mathlib.Analysis.Calculus.LineDeriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Measurable
open MeasureTheory
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [LocallyCompactSpace 𝕜]
{E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [MeasurableSpace E] [OpensMeasurableSpace E]
{F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] [CompleteSpace F]
{f : E → F} {v : E}
theorem measurableSet_lineDifferentiableAt (hf : Continuous f) :
MeasurableSet {x : E | LineDifferentiableAt 𝕜 f x v} := by
borelize 𝕜
let g : E → 𝕜 → F := fun x t ↦ f (x + t • v)
have hg : Continuous g.uncurry := by apply hf.comp; continuity
exact measurable_prod_mk_right (measurableSet_of_differentiableAt_with_param 𝕜 hg)
theorem measurable_lineDeriv [MeasurableSpace F] [BorelSpace F]
(hf : Continuous f) : Measurable (fun x ↦ lineDeriv 𝕜 f x v) := by
borelize 𝕜
let g : E → 𝕜 → F := fun x t ↦ f (x + t • v)
have hg : Continuous g.uncurry := by apply hf.comp; continuity
exact (measurable_deriv_with_param hg).comp measurable_prod_mk_right
theorem stronglyMeasurable_lineDeriv [SecondCountableTopologyEither E F] (hf : Continuous f) :
StronglyMeasurable (fun x ↦ lineDeriv 𝕜 f x v) := by
borelize 𝕜
let g : E → 𝕜 → F := fun x t ↦ f (x + t • v)
have hg : Continuous g.uncurry := by apply hf.comp; continuity
exact (stronglyMeasurable_deriv_with_param hg).comp_measurable measurable_prod_mk_right
theorem aemeasurable_lineDeriv [MeasurableSpace F] [BorelSpace F]
(hf : Continuous f) (μ : Measure E) :
AEMeasurable (fun x ↦ lineDeriv 𝕜 f x v) μ :=
(measurable_lineDeriv hf).aemeasurable
theorem aestronglyMeasurable_lineDeriv [SecondCountableTopologyEither E F]
(hf : Continuous f) (μ : Measure E) :
AEStronglyMeasurable (fun x ↦ lineDeriv 𝕜 f x v) μ :=
(stronglyMeasurable_lineDeriv hf).aestronglyMeasurable
variable [SecondCountableTopology E]
theorem measurableSet_lineDifferentiableAt_uncurry (hf : Continuous f) :
MeasurableSet {p : E × E | LineDifferentiableAt 𝕜 f p.1 p.2} := by
borelize 𝕜
let g : (E × E) → 𝕜 → F := fun p t ↦ f (p.1 + t • p.2)
have : Continuous g.uncurry :=
hf.comp <| (continuous_fst.comp continuous_fst).add
<| continuous_snd.smul (continuous_snd.comp continuous_fst)
have M_meas : MeasurableSet {q : (E × E) × 𝕜 | DifferentiableAt 𝕜 (g q.1) q.2} :=
measurableSet_of_differentiableAt_with_param 𝕜 this
exact measurable_prod_mk_right M_meas
theorem measurable_lineDeriv_uncurry [MeasurableSpace F] [BorelSpace F]
(hf : Continuous f) : Measurable (fun (p : E × E) ↦ lineDeriv 𝕜 f p.1 p.2) := by
borelize 𝕜
let g : (E × E) → 𝕜 → F := fun p t ↦ f (p.1 + t • p.2)
have : Continuous g.uncurry :=
hf.comp <| (continuous_fst.comp continuous_fst).add
<| continuous_snd.smul (continuous_snd.comp continuous_fst)
exact (measurable_deriv_with_param this).comp measurable_prod_mk_right
| Mathlib/Analysis/Calculus/LineDeriv/Measurable.lean | 92 | 99 | theorem stronglyMeasurable_lineDeriv_uncurry (hf : Continuous f) :
StronglyMeasurable (fun (p : E × E) ↦ lineDeriv 𝕜 f p.1 p.2) := by |
borelize 𝕜
let g : (E × E) → 𝕜 → F := fun p t ↦ f (p.1 + t • p.2)
have : Continuous g.uncurry :=
hf.comp <| (continuous_fst.comp continuous_fst).add
<| continuous_snd.smul (continuous_snd.comp continuous_fst)
exact (stronglyMeasurable_deriv_with_param this).comp_measurable measurable_prod_mk_right
| 6 | 403.428793 | 2 | 2 | 6 | 2,214 |
import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots
import Mathlib.Data.ZMod.Algebra
#align_import ring_theory.polynomial.cyclotomic.expand from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472"
namespace Polynomial
@[simp]
| Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean | 36 | 72 | theorem cyclotomic_expand_eq_cyclotomic_mul {p n : ℕ} (hp : Nat.Prime p) (hdiv : ¬p ∣ n)
(R : Type*) [CommRing R] :
expand R p (cyclotomic n R) = cyclotomic (n * p) R * cyclotomic n R := by |
rcases Nat.eq_zero_or_pos n with (rfl | hnpos)
· simp
haveI := NeZero.of_pos hnpos
suffices expand ℤ p (cyclotomic n ℤ) = cyclotomic (n * p) ℤ * cyclotomic n ℤ by
rw [← map_cyclotomic_int, ← map_expand, this, Polynomial.map_mul, map_cyclotomic_int,
map_cyclotomic]
refine eq_of_monic_of_dvd_of_natDegree_le ((cyclotomic.monic _ ℤ).mul (cyclotomic.monic _ ℤ))
((cyclotomic.monic n ℤ).expand hp.pos) ?_ ?_
· refine (IsPrimitive.Int.dvd_iff_map_cast_dvd_map_cast _ _
(IsPrimitive.mul (cyclotomic.isPrimitive (n * p) ℤ) (cyclotomic.isPrimitive n ℤ))
((cyclotomic.monic n ℤ).expand hp.pos).isPrimitive).2 ?_
rw [Polynomial.map_mul, map_cyclotomic_int, map_cyclotomic_int, map_expand, map_cyclotomic_int]
refine IsCoprime.mul_dvd (cyclotomic.isCoprime_rat fun h => ?_) ?_ ?_
· replace h : n * p = n * 1 := by simp [h]
exact Nat.Prime.ne_one hp (mul_left_cancel₀ hnpos.ne' h)
· have hpos : 0 < n * p := mul_pos hnpos hp.pos
have hprim := Complex.isPrimitiveRoot_exp _ hpos.ne'
rw [cyclotomic_eq_minpoly_rat hprim hpos]
refine minpoly.dvd ℚ _ ?_
rw [aeval_def, ← eval_map, map_expand, map_cyclotomic, expand_eval, ← IsRoot.def,
@isRoot_cyclotomic_iff]
convert IsPrimitiveRoot.pow_of_dvd hprim hp.ne_zero (dvd_mul_left p n)
rw [Nat.mul_div_cancel _ (Nat.Prime.pos hp)]
· have hprim := Complex.isPrimitiveRoot_exp _ hnpos.ne.symm
rw [cyclotomic_eq_minpoly_rat hprim hnpos]
refine minpoly.dvd ℚ _ ?_
rw [aeval_def, ← eval_map, map_expand, expand_eval, ← IsRoot.def, ←
cyclotomic_eq_minpoly_rat hprim hnpos, map_cyclotomic, @isRoot_cyclotomic_iff]
exact IsPrimitiveRoot.pow_of_prime hprim hp hdiv
· rw [natDegree_expand, natDegree_cyclotomic,
natDegree_mul (cyclotomic_ne_zero _ ℤ) (cyclotomic_ne_zero _ ℤ), natDegree_cyclotomic,
natDegree_cyclotomic, mul_comm n,
Nat.totient_mul ((Nat.Prime.coprime_iff_not_dvd hp).2 hdiv), Nat.totient_prime hp,
mul_comm (p - 1), ← Nat.mul_succ, Nat.sub_one, Nat.succ_pred_eq_of_pos hp.pos]
| 34 | 583,461,742,527,454.9 | 2 | 2 | 3 | 2,215 |
import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots
import Mathlib.Data.ZMod.Algebra
#align_import ring_theory.polynomial.cyclotomic.expand from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472"
namespace Polynomial
@[simp]
theorem cyclotomic_expand_eq_cyclotomic_mul {p n : ℕ} (hp : Nat.Prime p) (hdiv : ¬p ∣ n)
(R : Type*) [CommRing R] :
expand R p (cyclotomic n R) = cyclotomic (n * p) R * cyclotomic n R := by
rcases Nat.eq_zero_or_pos n with (rfl | hnpos)
· simp
haveI := NeZero.of_pos hnpos
suffices expand ℤ p (cyclotomic n ℤ) = cyclotomic (n * p) ℤ * cyclotomic n ℤ by
rw [← map_cyclotomic_int, ← map_expand, this, Polynomial.map_mul, map_cyclotomic_int,
map_cyclotomic]
refine eq_of_monic_of_dvd_of_natDegree_le ((cyclotomic.monic _ ℤ).mul (cyclotomic.monic _ ℤ))
((cyclotomic.monic n ℤ).expand hp.pos) ?_ ?_
· refine (IsPrimitive.Int.dvd_iff_map_cast_dvd_map_cast _ _
(IsPrimitive.mul (cyclotomic.isPrimitive (n * p) ℤ) (cyclotomic.isPrimitive n ℤ))
((cyclotomic.monic n ℤ).expand hp.pos).isPrimitive).2 ?_
rw [Polynomial.map_mul, map_cyclotomic_int, map_cyclotomic_int, map_expand, map_cyclotomic_int]
refine IsCoprime.mul_dvd (cyclotomic.isCoprime_rat fun h => ?_) ?_ ?_
· replace h : n * p = n * 1 := by simp [h]
exact Nat.Prime.ne_one hp (mul_left_cancel₀ hnpos.ne' h)
· have hpos : 0 < n * p := mul_pos hnpos hp.pos
have hprim := Complex.isPrimitiveRoot_exp _ hpos.ne'
rw [cyclotomic_eq_minpoly_rat hprim hpos]
refine minpoly.dvd ℚ _ ?_
rw [aeval_def, ← eval_map, map_expand, map_cyclotomic, expand_eval, ← IsRoot.def,
@isRoot_cyclotomic_iff]
convert IsPrimitiveRoot.pow_of_dvd hprim hp.ne_zero (dvd_mul_left p n)
rw [Nat.mul_div_cancel _ (Nat.Prime.pos hp)]
· have hprim := Complex.isPrimitiveRoot_exp _ hnpos.ne.symm
rw [cyclotomic_eq_minpoly_rat hprim hnpos]
refine minpoly.dvd ℚ _ ?_
rw [aeval_def, ← eval_map, map_expand, expand_eval, ← IsRoot.def, ←
cyclotomic_eq_minpoly_rat hprim hnpos, map_cyclotomic, @isRoot_cyclotomic_iff]
exact IsPrimitiveRoot.pow_of_prime hprim hp hdiv
· rw [natDegree_expand, natDegree_cyclotomic,
natDegree_mul (cyclotomic_ne_zero _ ℤ) (cyclotomic_ne_zero _ ℤ), natDegree_cyclotomic,
natDegree_cyclotomic, mul_comm n,
Nat.totient_mul ((Nat.Prime.coprime_iff_not_dvd hp).2 hdiv), Nat.totient_prime hp,
mul_comm (p - 1), ← Nat.mul_succ, Nat.sub_one, Nat.succ_pred_eq_of_pos hp.pos]
#align polynomial.cyclotomic_expand_eq_cyclotomic_mul Polynomial.cyclotomic_expand_eq_cyclotomic_mul
@[simp]
| Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean | 78 | 96 | theorem cyclotomic_expand_eq_cyclotomic {p n : ℕ} (hp : Nat.Prime p) (hdiv : p ∣ n) (R : Type*)
[CommRing R] : expand R p (cyclotomic n R) = cyclotomic (n * p) R := by |
rcases n.eq_zero_or_pos with (rfl | hzero)
· simp
haveI := NeZero.of_pos hzero
suffices expand ℤ p (cyclotomic n ℤ) = cyclotomic (n * p) ℤ by
rw [← map_cyclotomic_int, ← map_expand, this, map_cyclotomic_int]
refine eq_of_monic_of_dvd_of_natDegree_le (cyclotomic.monic _ ℤ)
((cyclotomic.monic n ℤ).expand hp.pos) ?_ ?_
· have hpos := Nat.mul_pos hzero hp.pos
have hprim := Complex.isPrimitiveRoot_exp _ hpos.ne.symm
rw [cyclotomic_eq_minpoly hprim hpos]
refine minpoly.isIntegrallyClosed_dvd (hprim.isIntegral hpos) ?_
rw [aeval_def, ← eval_map, map_expand, map_cyclotomic, expand_eval, ← IsRoot.def,
@isRoot_cyclotomic_iff]
convert IsPrimitiveRoot.pow_of_dvd hprim hp.ne_zero (dvd_mul_left p n)
rw [Nat.mul_div_cancel _ hp.pos]
· rw [natDegree_expand, natDegree_cyclotomic, natDegree_cyclotomic, mul_comm n,
Nat.totient_mul_of_prime_of_dvd hp hdiv, mul_comm]
| 17 | 24,154,952.753575 | 2 | 2 | 3 | 2,215 |
import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots
import Mathlib.Data.ZMod.Algebra
#align_import ring_theory.polynomial.cyclotomic.expand from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472"
namespace Polynomial
@[simp]
theorem cyclotomic_expand_eq_cyclotomic_mul {p n : ℕ} (hp : Nat.Prime p) (hdiv : ¬p ∣ n)
(R : Type*) [CommRing R] :
expand R p (cyclotomic n R) = cyclotomic (n * p) R * cyclotomic n R := by
rcases Nat.eq_zero_or_pos n with (rfl | hnpos)
· simp
haveI := NeZero.of_pos hnpos
suffices expand ℤ p (cyclotomic n ℤ) = cyclotomic (n * p) ℤ * cyclotomic n ℤ by
rw [← map_cyclotomic_int, ← map_expand, this, Polynomial.map_mul, map_cyclotomic_int,
map_cyclotomic]
refine eq_of_monic_of_dvd_of_natDegree_le ((cyclotomic.monic _ ℤ).mul (cyclotomic.monic _ ℤ))
((cyclotomic.monic n ℤ).expand hp.pos) ?_ ?_
· refine (IsPrimitive.Int.dvd_iff_map_cast_dvd_map_cast _ _
(IsPrimitive.mul (cyclotomic.isPrimitive (n * p) ℤ) (cyclotomic.isPrimitive n ℤ))
((cyclotomic.monic n ℤ).expand hp.pos).isPrimitive).2 ?_
rw [Polynomial.map_mul, map_cyclotomic_int, map_cyclotomic_int, map_expand, map_cyclotomic_int]
refine IsCoprime.mul_dvd (cyclotomic.isCoprime_rat fun h => ?_) ?_ ?_
· replace h : n * p = n * 1 := by simp [h]
exact Nat.Prime.ne_one hp (mul_left_cancel₀ hnpos.ne' h)
· have hpos : 0 < n * p := mul_pos hnpos hp.pos
have hprim := Complex.isPrimitiveRoot_exp _ hpos.ne'
rw [cyclotomic_eq_minpoly_rat hprim hpos]
refine minpoly.dvd ℚ _ ?_
rw [aeval_def, ← eval_map, map_expand, map_cyclotomic, expand_eval, ← IsRoot.def,
@isRoot_cyclotomic_iff]
convert IsPrimitiveRoot.pow_of_dvd hprim hp.ne_zero (dvd_mul_left p n)
rw [Nat.mul_div_cancel _ (Nat.Prime.pos hp)]
· have hprim := Complex.isPrimitiveRoot_exp _ hnpos.ne.symm
rw [cyclotomic_eq_minpoly_rat hprim hnpos]
refine minpoly.dvd ℚ _ ?_
rw [aeval_def, ← eval_map, map_expand, expand_eval, ← IsRoot.def, ←
cyclotomic_eq_minpoly_rat hprim hnpos, map_cyclotomic, @isRoot_cyclotomic_iff]
exact IsPrimitiveRoot.pow_of_prime hprim hp hdiv
· rw [natDegree_expand, natDegree_cyclotomic,
natDegree_mul (cyclotomic_ne_zero _ ℤ) (cyclotomic_ne_zero _ ℤ), natDegree_cyclotomic,
natDegree_cyclotomic, mul_comm n,
Nat.totient_mul ((Nat.Prime.coprime_iff_not_dvd hp).2 hdiv), Nat.totient_prime hp,
mul_comm (p - 1), ← Nat.mul_succ, Nat.sub_one, Nat.succ_pred_eq_of_pos hp.pos]
#align polynomial.cyclotomic_expand_eq_cyclotomic_mul Polynomial.cyclotomic_expand_eq_cyclotomic_mul
@[simp]
theorem cyclotomic_expand_eq_cyclotomic {p n : ℕ} (hp : Nat.Prime p) (hdiv : p ∣ n) (R : Type*)
[CommRing R] : expand R p (cyclotomic n R) = cyclotomic (n * p) R := by
rcases n.eq_zero_or_pos with (rfl | hzero)
· simp
haveI := NeZero.of_pos hzero
suffices expand ℤ p (cyclotomic n ℤ) = cyclotomic (n * p) ℤ by
rw [← map_cyclotomic_int, ← map_expand, this, map_cyclotomic_int]
refine eq_of_monic_of_dvd_of_natDegree_le (cyclotomic.monic _ ℤ)
((cyclotomic.monic n ℤ).expand hp.pos) ?_ ?_
· have hpos := Nat.mul_pos hzero hp.pos
have hprim := Complex.isPrimitiveRoot_exp _ hpos.ne.symm
rw [cyclotomic_eq_minpoly hprim hpos]
refine minpoly.isIntegrallyClosed_dvd (hprim.isIntegral hpos) ?_
rw [aeval_def, ← eval_map, map_expand, map_cyclotomic, expand_eval, ← IsRoot.def,
@isRoot_cyclotomic_iff]
convert IsPrimitiveRoot.pow_of_dvd hprim hp.ne_zero (dvd_mul_left p n)
rw [Nat.mul_div_cancel _ hp.pos]
· rw [natDegree_expand, natDegree_cyclotomic, natDegree_cyclotomic, mul_comm n,
Nat.totient_mul_of_prime_of_dvd hp hdiv, mul_comm]
#align polynomial.cyclotomic_expand_eq_cyclotomic Polynomial.cyclotomic_expand_eq_cyclotomic
| Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean | 100 | 110 | theorem cyclotomic_irreducible_pow_of_irreducible_pow {p : ℕ} (hp : Nat.Prime p) {R} [CommRing R]
[IsDomain R] {n m : ℕ} (hmn : m ≤ n) (h : Irreducible (cyclotomic (p ^ n) R)) :
Irreducible (cyclotomic (p ^ m) R) := by |
rcases m.eq_zero_or_pos with (rfl | hm)
· simpa using irreducible_X_sub_C (1 : R)
obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le hmn
induction' k with k hk
· simpa using h
have : m + k ≠ 0 := (add_pos_of_pos_of_nonneg hm k.zero_le).ne'
rw [Nat.add_succ, pow_succ, ← cyclotomic_expand_eq_cyclotomic hp <| dvd_pow_self p this] at h
exact hk (by omega) (of_irreducible_expand hp.ne_zero h)
| 8 | 2,980.957987 | 2 | 2 | 3 | 2,215 |
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))
| 12 | 162,754.791419 | 2 | 2 | 1 | 2,216 |
import Mathlib.Algebra.Polynomial.BigOperators
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic
import Mathlib.Tactic.ComputeDegree
#align_import linear_algebra.matrix.polynomial from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
set_option linter.uppercaseLean3 false
open Matrix Polynomial
variable {n α : Type*} [DecidableEq n] [Fintype n] [CommRing α]
open Polynomial Matrix Equiv.Perm
namespace Polynomial
| Mathlib/LinearAlgebra/Matrix/Polynomial.lean | 39 | 59 | theorem natDegree_det_X_add_C_le (A B : Matrix n n α) :
natDegree (det ((X : α[X]) • A.map C + B.map C : Matrix n n α[X])) ≤ Fintype.card n := by |
rw [det_apply]
refine (natDegree_sum_le _ _).trans ?_
refine Multiset.max_le_of_forall_le _ _ ?_
simp only [forall_apply_eq_imp_iff, true_and_iff, Function.comp_apply, Multiset.map_map,
Multiset.mem_map, exists_imp, Finset.mem_univ_val]
intro g
calc
natDegree (sign g • ∏ i : n, (X • A.map C + B.map C : Matrix n n α[X]) (g i) i) ≤
natDegree (∏ i : n, (X • A.map C + B.map C : Matrix n n α[X]) (g i) i) := by
cases' Int.units_eq_one_or (sign g) with sg sg
· rw [sg, one_smul]
· rw [sg, Units.neg_smul, one_smul, natDegree_neg]
_ ≤ ∑ i : n, natDegree (((X : α[X]) • A.map C + B.map C : Matrix n n α[X]) (g i) i) :=
(natDegree_prod_le (Finset.univ : Finset n) fun i : n =>
(X • A.map C + B.map C : Matrix n n α[X]) (g i) i)
_ ≤ Finset.univ.card • 1 := (Finset.sum_le_card_nsmul _ _ 1 fun (i : n) _ => ?_)
_ ≤ Fintype.card n := by simp [mul_one, Algebra.id.smul_eq_mul, Finset.card_univ]
dsimp only [add_apply, smul_apply, map_apply, smul_eq_mul]
compute_degree
| 19 | 178,482,300.963187 | 2 | 2 | 4 | 2,217 |
import Mathlib.Algebra.Polynomial.BigOperators
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic
import Mathlib.Tactic.ComputeDegree
#align_import linear_algebra.matrix.polynomial from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
set_option linter.uppercaseLean3 false
open Matrix Polynomial
variable {n α : Type*} [DecidableEq n] [Fintype n] [CommRing α]
open Polynomial Matrix Equiv.Perm
namespace Polynomial
theorem natDegree_det_X_add_C_le (A B : Matrix n n α) :
natDegree (det ((X : α[X]) • A.map C + B.map C : Matrix n n α[X])) ≤ Fintype.card n := by
rw [det_apply]
refine (natDegree_sum_le _ _).trans ?_
refine Multiset.max_le_of_forall_le _ _ ?_
simp only [forall_apply_eq_imp_iff, true_and_iff, Function.comp_apply, Multiset.map_map,
Multiset.mem_map, exists_imp, Finset.mem_univ_val]
intro g
calc
natDegree (sign g • ∏ i : n, (X • A.map C + B.map C : Matrix n n α[X]) (g i) i) ≤
natDegree (∏ i : n, (X • A.map C + B.map C : Matrix n n α[X]) (g i) i) := by
cases' Int.units_eq_one_or (sign g) with sg sg
· rw [sg, one_smul]
· rw [sg, Units.neg_smul, one_smul, natDegree_neg]
_ ≤ ∑ i : n, natDegree (((X : α[X]) • A.map C + B.map C : Matrix n n α[X]) (g i) i) :=
(natDegree_prod_le (Finset.univ : Finset n) fun i : n =>
(X • A.map C + B.map C : Matrix n n α[X]) (g i) i)
_ ≤ Finset.univ.card • 1 := (Finset.sum_le_card_nsmul _ _ 1 fun (i : n) _ => ?_)
_ ≤ Fintype.card n := by simp [mul_one, Algebra.id.smul_eq_mul, Finset.card_univ]
dsimp only [add_apply, smul_apply, map_apply, smul_eq_mul]
compute_degree
#align polynomial.nat_degree_det_X_add_C_le Polynomial.natDegree_det_X_add_C_le
| Mathlib/LinearAlgebra/Matrix/Polynomial.lean | 62 | 70 | theorem coeff_det_X_add_C_zero (A B : Matrix n n α) :
coeff (det ((X : α[X]) • A.map C + B.map C)) 0 = det B := by |
rw [det_apply, finset_sum_coeff, det_apply]
refine Finset.sum_congr rfl ?_
rintro g -
convert coeff_smul (R := α) (sign g) _ 0
rw [coeff_zero_prod]
refine Finset.prod_congr rfl ?_
simp
| 7 | 1,096.633158 | 2 | 2 | 4 | 2,217 |
import Mathlib.Algebra.Polynomial.BigOperators
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic
import Mathlib.Tactic.ComputeDegree
#align_import linear_algebra.matrix.polynomial from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
set_option linter.uppercaseLean3 false
open Matrix Polynomial
variable {n α : Type*} [DecidableEq n] [Fintype n] [CommRing α]
open Polynomial Matrix Equiv.Perm
namespace Polynomial
theorem natDegree_det_X_add_C_le (A B : Matrix n n α) :
natDegree (det ((X : α[X]) • A.map C + B.map C : Matrix n n α[X])) ≤ Fintype.card n := by
rw [det_apply]
refine (natDegree_sum_le _ _).trans ?_
refine Multiset.max_le_of_forall_le _ _ ?_
simp only [forall_apply_eq_imp_iff, true_and_iff, Function.comp_apply, Multiset.map_map,
Multiset.mem_map, exists_imp, Finset.mem_univ_val]
intro g
calc
natDegree (sign g • ∏ i : n, (X • A.map C + B.map C : Matrix n n α[X]) (g i) i) ≤
natDegree (∏ i : n, (X • A.map C + B.map C : Matrix n n α[X]) (g i) i) := by
cases' Int.units_eq_one_or (sign g) with sg sg
· rw [sg, one_smul]
· rw [sg, Units.neg_smul, one_smul, natDegree_neg]
_ ≤ ∑ i : n, natDegree (((X : α[X]) • A.map C + B.map C : Matrix n n α[X]) (g i) i) :=
(natDegree_prod_le (Finset.univ : Finset n) fun i : n =>
(X • A.map C + B.map C : Matrix n n α[X]) (g i) i)
_ ≤ Finset.univ.card • 1 := (Finset.sum_le_card_nsmul _ _ 1 fun (i : n) _ => ?_)
_ ≤ Fintype.card n := by simp [mul_one, Algebra.id.smul_eq_mul, Finset.card_univ]
dsimp only [add_apply, smul_apply, map_apply, smul_eq_mul]
compute_degree
#align polynomial.nat_degree_det_X_add_C_le Polynomial.natDegree_det_X_add_C_le
theorem coeff_det_X_add_C_zero (A B : Matrix n n α) :
coeff (det ((X : α[X]) • A.map C + B.map C)) 0 = det B := by
rw [det_apply, finset_sum_coeff, det_apply]
refine Finset.sum_congr rfl ?_
rintro g -
convert coeff_smul (R := α) (sign g) _ 0
rw [coeff_zero_prod]
refine Finset.prod_congr rfl ?_
simp
#align polynomial.coeff_det_X_add_C_zero Polynomial.coeff_det_X_add_C_zero
| Mathlib/LinearAlgebra/Matrix/Polynomial.lean | 73 | 86 | theorem coeff_det_X_add_C_card (A B : Matrix n n α) :
coeff (det ((X : α[X]) • A.map C + B.map C)) (Fintype.card n) = det A := by |
rw [det_apply, det_apply, finset_sum_coeff]
refine Finset.sum_congr rfl ?_
simp only [Algebra.id.smul_eq_mul, Finset.mem_univ, RingHom.mapMatrix_apply, forall_true_left,
map_apply, Pi.smul_apply]
intro g
convert coeff_smul (R := α) (sign g) _ _
rw [← mul_one (Fintype.card n)]
convert (coeff_prod_of_natDegree_le (R := α) _ _ _ _).symm
· simp [coeff_C]
· rintro p -
dsimp only [add_apply, smul_apply, map_apply, smul_eq_mul]
compute_degree
| 12 | 162,754.791419 | 2 | 2 | 4 | 2,217 |
import Mathlib.Algebra.Polynomial.BigOperators
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic
import Mathlib.Tactic.ComputeDegree
#align_import linear_algebra.matrix.polynomial from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
set_option linter.uppercaseLean3 false
open Matrix Polynomial
variable {n α : Type*} [DecidableEq n] [Fintype n] [CommRing α]
open Polynomial Matrix Equiv.Perm
namespace Polynomial
theorem natDegree_det_X_add_C_le (A B : Matrix n n α) :
natDegree (det ((X : α[X]) • A.map C + B.map C : Matrix n n α[X])) ≤ Fintype.card n := by
rw [det_apply]
refine (natDegree_sum_le _ _).trans ?_
refine Multiset.max_le_of_forall_le _ _ ?_
simp only [forall_apply_eq_imp_iff, true_and_iff, Function.comp_apply, Multiset.map_map,
Multiset.mem_map, exists_imp, Finset.mem_univ_val]
intro g
calc
natDegree (sign g • ∏ i : n, (X • A.map C + B.map C : Matrix n n α[X]) (g i) i) ≤
natDegree (∏ i : n, (X • A.map C + B.map C : Matrix n n α[X]) (g i) i) := by
cases' Int.units_eq_one_or (sign g) with sg sg
· rw [sg, one_smul]
· rw [sg, Units.neg_smul, one_smul, natDegree_neg]
_ ≤ ∑ i : n, natDegree (((X : α[X]) • A.map C + B.map C : Matrix n n α[X]) (g i) i) :=
(natDegree_prod_le (Finset.univ : Finset n) fun i : n =>
(X • A.map C + B.map C : Matrix n n α[X]) (g i) i)
_ ≤ Finset.univ.card • 1 := (Finset.sum_le_card_nsmul _ _ 1 fun (i : n) _ => ?_)
_ ≤ Fintype.card n := by simp [mul_one, Algebra.id.smul_eq_mul, Finset.card_univ]
dsimp only [add_apply, smul_apply, map_apply, smul_eq_mul]
compute_degree
#align polynomial.nat_degree_det_X_add_C_le Polynomial.natDegree_det_X_add_C_le
theorem coeff_det_X_add_C_zero (A B : Matrix n n α) :
coeff (det ((X : α[X]) • A.map C + B.map C)) 0 = det B := by
rw [det_apply, finset_sum_coeff, det_apply]
refine Finset.sum_congr rfl ?_
rintro g -
convert coeff_smul (R := α) (sign g) _ 0
rw [coeff_zero_prod]
refine Finset.prod_congr rfl ?_
simp
#align polynomial.coeff_det_X_add_C_zero Polynomial.coeff_det_X_add_C_zero
theorem coeff_det_X_add_C_card (A B : Matrix n n α) :
coeff (det ((X : α[X]) • A.map C + B.map C)) (Fintype.card n) = det A := by
rw [det_apply, det_apply, finset_sum_coeff]
refine Finset.sum_congr rfl ?_
simp only [Algebra.id.smul_eq_mul, Finset.mem_univ, RingHom.mapMatrix_apply, forall_true_left,
map_apply, Pi.smul_apply]
intro g
convert coeff_smul (R := α) (sign g) _ _
rw [← mul_one (Fintype.card n)]
convert (coeff_prod_of_natDegree_le (R := α) _ _ _ _).symm
· simp [coeff_C]
· rintro p -
dsimp only [add_apply, smul_apply, map_apply, smul_eq_mul]
compute_degree
#align polynomial.coeff_det_X_add_C_card Polynomial.coeff_det_X_add_C_card
| Mathlib/LinearAlgebra/Matrix/Polynomial.lean | 89 | 102 | theorem leadingCoeff_det_X_one_add_C (A : Matrix n n α) :
leadingCoeff (det ((X : α[X]) • (1 : Matrix n n α[X]) + A.map C)) = 1 := by |
cases subsingleton_or_nontrivial α
· simp [eq_iff_true_of_subsingleton]
rw [← @det_one n, ← coeff_det_X_add_C_card _ A, leadingCoeff]
simp only [Matrix.map_one, C_eq_zero, RingHom.map_one]
rcases (natDegree_det_X_add_C_le 1 A).eq_or_lt with h | h
· simp only [RingHom.map_one, Matrix.map_one, C_eq_zero] at h
rw [h]
· -- contradiction. we have a hypothesis that the degree is less than |n|
-- but we know that coeff _ n = 1
have H := coeff_eq_zero_of_natDegree_lt h
rw [coeff_det_X_add_C_card] at H
simp at H
| 12 | 162,754.791419 | 2 | 2 | 4 | 2,217 |
import Mathlib.Algebra.Polynomial.Div
import Mathlib.Logic.Function.Basic
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.LinearCombination
#align_import data.polynomial.partial_fractions from "leanprover-community/mathlib"@"6e70e0d419bf686784937d64ed4bfde866ff229e"
variable (R : Type) [CommRing R] [IsDomain R]
open Polynomial
variable (K : Type) [Field K] [Algebra R[X] K] [IsFractionRing R[X] K]
section TwoDenominators
-- Porting note: added for scoped `Algebra.cast` instance
open algebraMap
| Mathlib/Algebra/Polynomial/PartialFractions.lean | 60 | 79 | theorem div_eq_quo_add_rem_div_add_rem_div (f : R[X]) {g₁ g₂ : R[X]} (hg₁ : g₁.Monic)
(hg₂ : g₂.Monic) (hcoprime : IsCoprime g₁ g₂) :
∃ q r₁ r₂ : R[X],
r₁.degree < g₁.degree ∧
r₂.degree < g₂.degree ∧ (f : K) / (↑g₁ * ↑g₂) = ↑q + ↑r₁ / ↑g₁ + ↑r₂ / ↑g₂ := by |
rcases hcoprime with ⟨c, d, hcd⟩
refine
⟨f * d /ₘ g₁ + f * c /ₘ g₂, f * d %ₘ g₁, f * c %ₘ g₂, degree_modByMonic_lt _ hg₁,
degree_modByMonic_lt _ hg₂, ?_⟩
have hg₁' : (↑g₁ : K) ≠ 0 := by
norm_cast
exact hg₁.ne_zero
have hg₂' : (↑g₂ : K) ≠ 0 := by
norm_cast
exact hg₂.ne_zero
have hfc := modByMonic_add_div (f * c) hg₂
have hfd := modByMonic_add_div (f * d) hg₁
field_simp
norm_cast
linear_combination -1 * f * hcd + -1 * g₁ * hfc + -1 * g₂ * hfd
| 15 | 3,269,017.372472 | 2 | 2 | 1 | 2,218 |
import Mathlib.LinearAlgebra.AffineSpace.AffineMap
import Mathlib.LinearAlgebra.Basic
import Mathlib.LinearAlgebra.GeneralLinearGroup
#align_import linear_algebra.affine_space.affine_equiv from "leanprover-community/mathlib"@"bd1fc183335ea95a9519a1630bcf901fe9326d83"
open Function Set
open Affine
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure AffineEquiv (k P₁ P₂ : Type*) {V₁ V₂ : Type*} [Ring k] [AddCommGroup V₁] [Module k V₁]
[AddTorsor V₁ P₁] [AddCommGroup V₂] [Module k V₂] [AddTorsor V₂ P₂] extends P₁ ≃ P₂ where
linear : V₁ ≃ₗ[k] V₂
map_vadd' : ∀ (p : P₁) (v : V₁), toEquiv (v +ᵥ p) = linear v +ᵥ toEquiv p
#align affine_equiv AffineEquiv
@[inherit_doc]
notation:25 P₁ " ≃ᵃ[" k:25 "] " P₂:0 => AffineEquiv k P₁ P₂
variable {k P₁ P₂ P₃ P₄ V₁ V₂ V₃ V₄ : Type*} [Ring k] [AddCommGroup V₁] [Module k V₁]
[AddTorsor V₁ P₁] [AddCommGroup V₂] [Module k V₂] [AddTorsor V₂ P₂] [AddCommGroup V₃]
[Module k V₃] [AddTorsor V₃ P₃] [AddCommGroup V₄] [Module k V₄] [AddTorsor V₄ P₄]
namespace AffineEquiv
@[coe]
def toAffineMap (e : P₁ ≃ᵃ[k] P₂) : P₁ →ᵃ[k] P₂ :=
{ e with }
#align affine_equiv.to_affine_map AffineEquiv.toAffineMap
@[simp]
theorem toAffineMap_mk (f : P₁ ≃ P₂) (f' : V₁ ≃ₗ[k] V₂) (h) :
toAffineMap (mk f f' h) = ⟨f, f', h⟩ :=
rfl
#align affine_equiv.to_affine_map_mk AffineEquiv.toAffineMap_mk
@[simp]
theorem linear_toAffineMap (e : P₁ ≃ᵃ[k] P₂) : e.toAffineMap.linear = e.linear :=
rfl
#align affine_equiv.linear_to_affine_map AffineEquiv.linear_toAffineMap
| Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean | 80 | 86 | theorem toAffineMap_injective : Injective (toAffineMap : (P₁ ≃ᵃ[k] P₂) → P₁ →ᵃ[k] P₂) := by |
rintro ⟨e, el, h⟩ ⟨e', el', h'⟩ H
-- Porting note: added `AffineMap.mk.injEq`
simp only [toAffineMap_mk, AffineMap.mk.injEq, Equiv.coe_inj,
LinearEquiv.toLinearMap_inj] at H
congr
exacts [H.1, H.2]
| 6 | 403.428793 | 2 | 2 | 1 | 2,219 |
import Mathlib.Analysis.Normed.Field.Basic
#align_import topology.metric_space.cau_seq_filter from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
universe u v
open Set Filter
open scoped Classical
open Topology
variable {β : Type v}
theorem CauSeq.tendsto_limit [NormedRing β] [hn : IsAbsoluteValue (norm : β → ℝ)]
(f : CauSeq β norm) [CauSeq.IsComplete β norm] : Tendsto f atTop (𝓝 f.lim) :=
tendsto_nhds.mpr
(by
intro s os lfs
suffices ∃ a : ℕ, ∀ b : ℕ, b ≥ a → f b ∈ s by simpa using this
rcases Metric.isOpen_iff.1 os _ lfs with ⟨ε, ⟨hε, hεs⟩⟩
cases' Setoid.symm (CauSeq.equiv_lim f) _ hε with N hN
exists N
intro b hb
apply hεs
dsimp [Metric.ball]
rw [dist_comm, dist_eq_norm]
solve_by_elim)
#align cau_seq.tendsto_limit CauSeq.tendsto_limit
variable [NormedField β]
open Metric
| Mathlib/Topology/MetricSpace/CauSeqFilter.lean | 55 | 64 | theorem CauchySeq.isCauSeq {f : ℕ → β} (hf : CauchySeq f) : IsCauSeq norm f := by |
cases' cauchy_iff.1 hf with hf1 hf2
intro ε hε
rcases hf2 { x | dist x.1 x.2 < ε } (dist_mem_uniformity hε) with ⟨t, ⟨ht, htsub⟩⟩
simp only [mem_map, mem_atTop_sets, ge_iff_le, mem_preimage] at ht; cases' ht with N hN
exists N
intro j hj
rw [← dist_eq_norm]
apply @htsub (f j, f N)
apply Set.mk_mem_prod <;> solve_by_elim [le_refl]
| 9 | 8,103.083928 | 2 | 2 | 2 | 2,220 |
import Mathlib.Analysis.Normed.Field.Basic
#align_import topology.metric_space.cau_seq_filter from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
universe u v
open Set Filter
open scoped Classical
open Topology
variable {β : Type v}
theorem CauSeq.tendsto_limit [NormedRing β] [hn : IsAbsoluteValue (norm : β → ℝ)]
(f : CauSeq β norm) [CauSeq.IsComplete β norm] : Tendsto f atTop (𝓝 f.lim) :=
tendsto_nhds.mpr
(by
intro s os lfs
suffices ∃ a : ℕ, ∀ b : ℕ, b ≥ a → f b ∈ s by simpa using this
rcases Metric.isOpen_iff.1 os _ lfs with ⟨ε, ⟨hε, hεs⟩⟩
cases' Setoid.symm (CauSeq.equiv_lim f) _ hε with N hN
exists N
intro b hb
apply hεs
dsimp [Metric.ball]
rw [dist_comm, dist_eq_norm]
solve_by_elim)
#align cau_seq.tendsto_limit CauSeq.tendsto_limit
variable [NormedField β]
open Metric
theorem CauchySeq.isCauSeq {f : ℕ → β} (hf : CauchySeq f) : IsCauSeq norm f := by
cases' cauchy_iff.1 hf with hf1 hf2
intro ε hε
rcases hf2 { x | dist x.1 x.2 < ε } (dist_mem_uniformity hε) with ⟨t, ⟨ht, htsub⟩⟩
simp only [mem_map, mem_atTop_sets, ge_iff_le, mem_preimage] at ht; cases' ht with N hN
exists N
intro j hj
rw [← dist_eq_norm]
apply @htsub (f j, f N)
apply Set.mk_mem_prod <;> solve_by_elim [le_refl]
#align cauchy_seq.is_cau_seq CauchySeq.isCauSeq
| Mathlib/Topology/MetricSpace/CauSeqFilter.lean | 67 | 82 | theorem CauSeq.cauchySeq (f : CauSeq β norm) : CauchySeq f := by |
refine cauchy_iff.2 ⟨by infer_instance, fun s hs => ?_⟩
rcases mem_uniformity_dist.1 hs with ⟨ε, ⟨hε, hεs⟩⟩
cases' CauSeq.cauchy₂ f hε with N hN
exists { n | n ≥ N }.image f
simp only [exists_prop, mem_atTop_sets, mem_map, mem_image, ge_iff_le, mem_setOf_eq]
constructor
· exists N
intro b hb
exists b
· rintro ⟨a, b⟩ ⟨⟨a', ⟨ha'1, ha'2⟩⟩, ⟨b', ⟨hb'1, hb'2⟩⟩⟩
dsimp at ha'1 ha'2 hb'1 hb'2
rw [← ha'2, ← hb'2]
apply hεs
rw [dist_eq_norm]
apply hN <;> assumption
| 15 | 3,269,017.372472 | 2 | 2 | 2 | 2,220 |
import Mathlib.RingTheory.PrincipalIdealDomain
#align_import ring_theory.bezout from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
universe u v
variable {R : Type u} [CommRing R]
namespace IsBezout
| Mathlib/RingTheory/Bezout.lean | 30 | 39 | theorem iff_span_pair_isPrincipal :
IsBezout R ↔ ∀ x y : R, (Ideal.span {x, y} : Ideal R).IsPrincipal := by |
classical
constructor
· intro H x y; infer_instance
· intro H
constructor
apply Submodule.fg_induction
· exact fun _ => ⟨⟨_, rfl⟩⟩
· rintro _ _ ⟨⟨x, rfl⟩⟩ ⟨⟨y, rfl⟩⟩; rw [← Submodule.span_insert]; exact H _ _
| 8 | 2,980.957987 | 2 | 2 | 3 | 2,221 |
import Mathlib.RingTheory.PrincipalIdealDomain
#align_import ring_theory.bezout from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
universe u v
variable {R : Type u} [CommRing R]
namespace IsBezout
theorem iff_span_pair_isPrincipal :
IsBezout R ↔ ∀ x y : R, (Ideal.span {x, y} : Ideal R).IsPrincipal := by
classical
constructor
· intro H x y; infer_instance
· intro H
constructor
apply Submodule.fg_induction
· exact fun _ => ⟨⟨_, rfl⟩⟩
· rintro _ _ ⟨⟨x, rfl⟩⟩ ⟨⟨y, rfl⟩⟩; rw [← Submodule.span_insert]; exact H _ _
#align is_bezout.iff_span_pair_is_principal IsBezout.iff_span_pair_isPrincipal
| Mathlib/RingTheory/Bezout.lean | 42 | 50 | theorem _root_.Function.Surjective.isBezout {S : Type v} [CommRing S] (f : R →+* S)
(hf : Function.Surjective f) [IsBezout R] : IsBezout S := by |
rw [iff_span_pair_isPrincipal]
intro x y
obtain ⟨⟨x, rfl⟩, ⟨y, rfl⟩⟩ := hf x, hf y
use f (gcd x y)
trans Ideal.map f (Ideal.span {gcd x y})
· rw [span_gcd, Ideal.map_span, Set.image_insert_eq, Set.image_singleton]
· rw [Ideal.map_span, Set.image_singleton]; rfl
| 7 | 1,096.633158 | 2 | 2 | 3 | 2,221 |
import Mathlib.RingTheory.PrincipalIdealDomain
#align_import ring_theory.bezout from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
universe u v
variable {R : Type u} [CommRing R]
namespace IsBezout
theorem iff_span_pair_isPrincipal :
IsBezout R ↔ ∀ x y : R, (Ideal.span {x, y} : Ideal R).IsPrincipal := by
classical
constructor
· intro H x y; infer_instance
· intro H
constructor
apply Submodule.fg_induction
· exact fun _ => ⟨⟨_, rfl⟩⟩
· rintro _ _ ⟨⟨x, rfl⟩⟩ ⟨⟨y, rfl⟩⟩; rw [← Submodule.span_insert]; exact H _ _
#align is_bezout.iff_span_pair_is_principal IsBezout.iff_span_pair_isPrincipal
theorem _root_.Function.Surjective.isBezout {S : Type v} [CommRing S] (f : R →+* S)
(hf : Function.Surjective f) [IsBezout R] : IsBezout S := by
rw [iff_span_pair_isPrincipal]
intro x y
obtain ⟨⟨x, rfl⟩, ⟨y, rfl⟩⟩ := hf x, hf y
use f (gcd x y)
trans Ideal.map f (Ideal.span {gcd x y})
· rw [span_gcd, Ideal.map_span, Set.image_insert_eq, Set.image_singleton]
· rw [Ideal.map_span, Set.image_singleton]; rfl
#align function.surjective.is_bezout Function.Surjective.isBezout
| Mathlib/RingTheory/Bezout.lean | 53 | 78 | theorem TFAE [IsBezout R] [IsDomain R] :
List.TFAE
[IsNoetherianRing R, IsPrincipalIdealRing R, UniqueFactorizationMonoid R, WfDvdMonoid R] := by |
classical
tfae_have 1 → 2
· intro H; exact ⟨fun I => isPrincipal_of_FG _ (IsNoetherian.noetherian _)⟩
tfae_have 2 → 3
· intro; infer_instance
tfae_have 3 → 4
· intro; infer_instance
tfae_have 4 → 1
· rintro ⟨h⟩
rw [isNoetherianRing_iff, isNoetherian_iff_fg_wellFounded]
apply RelEmbedding.wellFounded _ h
have : ∀ I : { J : Ideal R // J.FG }, ∃ x : R, (I : Ideal R) = Ideal.span {x} :=
fun ⟨I, hI⟩ => (IsBezout.isPrincipal_of_FG I hI).1
choose f hf using this
exact
{ toFun := f
inj' := fun x y e => by ext1; rw [hf, hf, e]
map_rel_iff' := by
dsimp
intro a b
rw [← Ideal.span_singleton_lt_span_singleton, ← hf, ← hf]
rfl }
tfae_finish
| 23 | 9,744,803,446.248903 | 2 | 2 | 3 | 2,221 |
import Mathlib.Combinatorics.SetFamily.HarrisKleitman
import Mathlib.Combinatorics.SetFamily.Intersecting
#align_import combinatorics.set_family.kleitman from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514"
open Finset
open Fintype (card)
variable {ι α : Type*} [Fintype α] [DecidableEq α] [Nonempty α]
| Mathlib/Combinatorics/SetFamily/Kleitman.lean | 37 | 85 | theorem Finset.card_biUnion_le_of_intersecting (s : Finset ι) (f : ι → Finset (Finset α))
(hf : ∀ i ∈ s, (f i : Set (Finset α)).Intersecting) :
(s.biUnion f).card ≤ 2 ^ Fintype.card α - 2 ^ (Fintype.card α - s.card) := by |
have : DecidableEq ι := by
classical
infer_instance
obtain hs | hs := le_total (Fintype.card α) s.card
· rw [tsub_eq_zero_of_le hs, pow_zero]
refine (card_le_card <| biUnion_subset.2 fun i hi a ha ↦
mem_compl.2 <| not_mem_singleton.2 <| (hf _ hi).ne_bot ha).trans_eq ?_
rw [card_compl, Fintype.card_finset, card_singleton]
induction' s using Finset.cons_induction with i s hi ih generalizing f
· simp
set f' : ι → Finset (Finset α) :=
fun j ↦ if hj : j ∈ cons i s hi then (hf j hj).exists_card_eq.choose else ∅
have hf₁ : ∀ j, j ∈ cons i s hi → f j ⊆ f' j ∧ 2 * (f' j).card =
2 ^ Fintype.card α ∧ (f' j : Set (Finset α)).Intersecting := by
rintro j hj
simp_rw [f', dif_pos hj, ← Fintype.card_finset]
exact Classical.choose_spec (hf j hj).exists_card_eq
have hf₂ : ∀ j, j ∈ cons i s hi → IsUpperSet (f' j : Set (Finset α)) := by
refine fun j hj ↦ (hf₁ _ hj).2.2.isUpperSet' ((hf₁ _ hj).2.2.is_max_iff_card_eq.2 ?_)
rw [Fintype.card_finset]
exact (hf₁ _ hj).2.1
refine (card_le_card <| biUnion_mono fun j hj ↦ (hf₁ _ hj).1).trans ?_
nth_rw 1 [cons_eq_insert i]
rw [biUnion_insert]
refine (card_mono <| @le_sup_sdiff _ _ _ <| f' i).trans ((card_union_le _ _).trans ?_)
rw [union_sdiff_left, sdiff_eq_inter_compl]
refine le_of_mul_le_mul_left ?_ (pow_pos (zero_lt_two' ℕ) <| Fintype.card α + 1)
rw [pow_succ, mul_add, mul_assoc, mul_comm _ 2, mul_assoc]
refine (add_le_add
((mul_le_mul_left <| pow_pos (zero_lt_two' ℕ) _).2
(hf₁ _ <| mem_cons_self _ _).2.2.card_le) <|
(mul_le_mul_left <| zero_lt_two' ℕ).2 <| IsUpperSet.card_inter_le_finset ?_ ?_).trans ?_
· rw [coe_biUnion]
exact isUpperSet_iUnion₂ fun i hi ↦ hf₂ _ <| subset_cons _ hi
· rw [coe_compl]
exact (hf₂ _ <| mem_cons_self _ _).compl
rw [mul_tsub, card_compl, Fintype.card_finset, mul_left_comm, mul_tsub,
(hf₁ _ <| mem_cons_self _ _).2.1, two_mul, add_tsub_cancel_left, ← mul_tsub, ← mul_two,
mul_assoc, ← add_mul, mul_comm]
refine mul_le_mul_left' ?_ _
refine (add_le_add_left
(ih _ (fun i hi ↦ (hf₁ _ <| subset_cons _ hi).2.2)
((card_le_card <| subset_cons _).trans hs)) _).trans ?_
rw [mul_tsub, two_mul, ← pow_succ',
← add_tsub_assoc_of_le (pow_le_pow_right' (one_le_two : (1 : ℕ) ≤ 2) tsub_le_self),
tsub_add_eq_add_tsub hs, card_cons, add_tsub_add_eq_tsub_right]
| 46 | 94,961,194,206,024,480,000 | 2 | 2 | 1 | 2,222 |
import Mathlib.MeasureTheory.Integral.SetIntegral
import Mathlib.Probability.Independence.Basic
#align_import probability.integration from "leanprover-community/mathlib"@"2f8347015b12b0864dfaf366ec4909eb70c78740"
noncomputable section
open Set MeasureTheory
open scoped ENNReal MeasureTheory
variable {Ω : Type*} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {f g : Ω → ℝ≥0∞} {X Y : Ω → ℝ}
namespace ProbabilityTheory
| Mathlib/Probability/Integration.lean | 45 | 73 | theorem lintegral_mul_indicator_eq_lintegral_mul_lintegral_indicator {Mf mΩ : MeasurableSpace Ω}
{μ : Measure Ω} (hMf : Mf ≤ mΩ) (c : ℝ≥0∞) {T : Set Ω} (h_meas_T : MeasurableSet T)
(h_ind : IndepSets {s | MeasurableSet[Mf] s} {T} μ) (h_meas_f : Measurable[Mf] f) :
(∫⁻ ω, f ω * T.indicator (fun _ => c) ω ∂μ) =
(∫⁻ ω, f ω ∂μ) * ∫⁻ ω, T.indicator (fun _ => c) ω ∂μ := by |
revert f
have h_mul_indicator : ∀ g, Measurable g → Measurable fun a => g a * T.indicator (fun _ => c) a :=
fun g h_mg => h_mg.mul (measurable_const.indicator h_meas_T)
apply @Measurable.ennreal_induction _ Mf
· intro c' s' h_meas_s'
simp_rw [← inter_indicator_mul]
rw [lintegral_indicator _ (MeasurableSet.inter (hMf _ h_meas_s') h_meas_T),
lintegral_indicator _ (hMf _ h_meas_s'), lintegral_indicator _ h_meas_T]
simp only [measurable_const, lintegral_const, univ_inter, lintegral_const_mul,
MeasurableSet.univ, Measure.restrict_apply]
rw [IndepSets_iff] at h_ind
rw [mul_mul_mul_comm, h_ind s' T h_meas_s' (Set.mem_singleton _)]
· intro f' g _ h_meas_f' _ h_ind_f' h_ind_g
have h_measM_f' : Measurable f' := h_meas_f'.mono hMf le_rfl
simp_rw [Pi.add_apply, right_distrib]
rw [lintegral_add_left (h_mul_indicator _ h_measM_f'), lintegral_add_left h_measM_f',
right_distrib, h_ind_f', h_ind_g]
· intro f h_meas_f h_mono_f h_ind_f
have h_measM_f : ∀ n, Measurable (f n) := fun n => (h_meas_f n).mono hMf le_rfl
simp_rw [ENNReal.iSup_mul]
rw [lintegral_iSup h_measM_f h_mono_f, lintegral_iSup, ENNReal.iSup_mul]
· simp_rw [← h_ind_f]
· exact fun n => h_mul_indicator _ (h_measM_f n)
· exact fun m n h_le a => mul_le_mul_right' (h_mono_f h_le a) _
| 24 | 26,489,122,129.84347 | 2 | 2 | 2 | 2,223 |
import Mathlib.MeasureTheory.Integral.SetIntegral
import Mathlib.Probability.Independence.Basic
#align_import probability.integration from "leanprover-community/mathlib"@"2f8347015b12b0864dfaf366ec4909eb70c78740"
noncomputable section
open Set MeasureTheory
open scoped ENNReal MeasureTheory
variable {Ω : Type*} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {f g : Ω → ℝ≥0∞} {X Y : Ω → ℝ}
namespace ProbabilityTheory
theorem lintegral_mul_indicator_eq_lintegral_mul_lintegral_indicator {Mf mΩ : MeasurableSpace Ω}
{μ : Measure Ω} (hMf : Mf ≤ mΩ) (c : ℝ≥0∞) {T : Set Ω} (h_meas_T : MeasurableSet T)
(h_ind : IndepSets {s | MeasurableSet[Mf] s} {T} μ) (h_meas_f : Measurable[Mf] f) :
(∫⁻ ω, f ω * T.indicator (fun _ => c) ω ∂μ) =
(∫⁻ ω, f ω ∂μ) * ∫⁻ ω, T.indicator (fun _ => c) ω ∂μ := by
revert f
have h_mul_indicator : ∀ g, Measurable g → Measurable fun a => g a * T.indicator (fun _ => c) a :=
fun g h_mg => h_mg.mul (measurable_const.indicator h_meas_T)
apply @Measurable.ennreal_induction _ Mf
· intro c' s' h_meas_s'
simp_rw [← inter_indicator_mul]
rw [lintegral_indicator _ (MeasurableSet.inter (hMf _ h_meas_s') h_meas_T),
lintegral_indicator _ (hMf _ h_meas_s'), lintegral_indicator _ h_meas_T]
simp only [measurable_const, lintegral_const, univ_inter, lintegral_const_mul,
MeasurableSet.univ, Measure.restrict_apply]
rw [IndepSets_iff] at h_ind
rw [mul_mul_mul_comm, h_ind s' T h_meas_s' (Set.mem_singleton _)]
· intro f' g _ h_meas_f' _ h_ind_f' h_ind_g
have h_measM_f' : Measurable f' := h_meas_f'.mono hMf le_rfl
simp_rw [Pi.add_apply, right_distrib]
rw [lintegral_add_left (h_mul_indicator _ h_measM_f'), lintegral_add_left h_measM_f',
right_distrib, h_ind_f', h_ind_g]
· intro f h_meas_f h_mono_f h_ind_f
have h_measM_f : ∀ n, Measurable (f n) := fun n => (h_meas_f n).mono hMf le_rfl
simp_rw [ENNReal.iSup_mul]
rw [lintegral_iSup h_measM_f h_mono_f, lintegral_iSup, ENNReal.iSup_mul]
· simp_rw [← h_ind_f]
· exact fun n => h_mul_indicator _ (h_measM_f n)
· exact fun m n h_le a => mul_le_mul_right' (h_mono_f h_le a) _
#align probability_theory.lintegral_mul_indicator_eq_lintegral_mul_lintegral_indicator ProbabilityTheory.lintegral_mul_indicator_eq_lintegral_mul_lintegral_indicator
| Mathlib/Probability/Integration.lean | 82 | 104 | theorem lintegral_mul_eq_lintegral_mul_lintegral_of_independent_measurableSpace
{Mf Mg mΩ : MeasurableSpace Ω} {μ : Measure Ω} (hMf : Mf ≤ mΩ) (hMg : Mg ≤ mΩ)
(h_ind : Indep Mf Mg μ) (h_meas_f : Measurable[Mf] f) (h_meas_g : Measurable[Mg] g) :
∫⁻ ω, f ω * g ω ∂μ = (∫⁻ ω, f ω ∂μ) * ∫⁻ ω, g ω ∂μ := by |
revert g
have h_measM_f : Measurable f := h_meas_f.mono hMf le_rfl
apply @Measurable.ennreal_induction _ Mg
· intro c s h_s
apply lintegral_mul_indicator_eq_lintegral_mul_lintegral_indicator hMf _ (hMg _ h_s) _ h_meas_f
apply indepSets_of_indepSets_of_le_right h_ind
rwa [singleton_subset_iff]
· intro f' g _ h_measMg_f' _ h_ind_f' h_ind_g'
have h_measM_f' : Measurable f' := h_measMg_f'.mono hMg le_rfl
simp_rw [Pi.add_apply, left_distrib]
rw [lintegral_add_left h_measM_f', lintegral_add_left (h_measM_f.mul h_measM_f'), left_distrib,
h_ind_f', h_ind_g']
· intro f' h_meas_f' h_mono_f' h_ind_f'
have h_measM_f' : ∀ n, Measurable (f' n) := fun n => (h_meas_f' n).mono hMg le_rfl
simp_rw [ENNReal.mul_iSup]
rw [lintegral_iSup, lintegral_iSup h_measM_f' h_mono_f', ENNReal.mul_iSup]
· simp_rw [← h_ind_f']
· exact fun n => h_measM_f.mul (h_measM_f' n)
· exact fun n m (h_le : n ≤ m) a => mul_le_mul_left' (h_mono_f' h_le a) _
| 19 | 178,482,300.963187 | 2 | 2 | 2 | 2,223 |
import Mathlib.Topology.Instances.RealVectorSpace
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.normed_space.mazur_ulam from "leanprover-community/mathlib"@"78261225eb5cedc61c5c74ecb44e5b385d13b733"
variable {E PE F PF : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [MetricSpace PE]
[NormedAddTorsor E PE] [NormedAddCommGroup F] [NormedSpace ℝ F] [MetricSpace PF]
[NormedAddTorsor F PF]
open Set AffineMap AffineIsometryEquiv
noncomputable section
namespace IsometryEquiv
| Mathlib/Analysis/NormedSpace/MazurUlam.lean | 45 | 83 | theorem midpoint_fixed {x y : PE} :
∀ e : PE ≃ᵢ PE, e x = x → e y = y → e (midpoint ℝ x y) = midpoint ℝ x y := by |
set z := midpoint ℝ x y
-- Consider the set of `e : E ≃ᵢ E` such that `e x = x` and `e y = y`
set s := { e : PE ≃ᵢ PE | e x = x ∧ e y = y }
haveI : Nonempty s := ⟨⟨IsometryEquiv.refl PE, rfl, rfl⟩⟩
-- On the one hand, `e` cannot send the midpoint `z` of `[x, y]` too far
have h_bdd : BddAbove (range fun e : s => dist ((e : PE ≃ᵢ PE) z) z) := by
refine ⟨dist x z + dist x z, forall_mem_range.2 <| Subtype.forall.2 ?_⟩
rintro e ⟨hx, _⟩
calc
dist (e z) z ≤ dist (e z) x + dist x z := dist_triangle (e z) x z
_ = dist (e x) (e z) + dist x z := by rw [hx, dist_comm]
_ = dist x z + dist x z := by erw [e.dist_eq x z]
-- On the other hand, consider the map `f : (E ≃ᵢ E) → (E ≃ᵢ E)`
-- sending each `e` to `R ∘ e⁻¹ ∘ R ∘ e`, where `R` is the point reflection in the
-- midpoint `z` of `[x, y]`.
set R : PE ≃ᵢ PE := (pointReflection ℝ z).toIsometryEquiv
set f : PE ≃ᵢ PE → PE ≃ᵢ PE := fun e => ((e.trans R).trans e.symm).trans R
-- Note that `f` doubles the value of `dist (e z) z`
have hf_dist : ∀ e, dist (f e z) z = 2 * dist (e z) z := by
intro e
dsimp [f, R]
rw [dist_pointReflection_fixed, ← e.dist_eq, e.apply_symm_apply,
dist_pointReflection_self_real, dist_comm]
-- Also note that `f` maps `s` to itself
have hf_maps_to : MapsTo f s s := by
rintro e ⟨hx, hy⟩
constructor <;> simp [f, R, z, hx, hy, e.symm_apply_eq.2 hx.symm, e.symm_apply_eq.2 hy.symm]
-- Therefore, `dist (e z) z = 0` for all `e ∈ s`.
set c := ⨆ e : s, dist ((e : PE ≃ᵢ PE) z) z
have : c ≤ c / 2 := by
apply ciSup_le
rintro ⟨e, he⟩
simp only [Subtype.coe_mk, le_div_iff' (zero_lt_two' ℝ), ← hf_dist]
exact le_ciSup h_bdd ⟨f e, hf_maps_to he⟩
replace : c ≤ 0 := by linarith
refine fun e hx hy => dist_le_zero.1 (le_trans ?_ this)
exact le_ciSup h_bdd ⟨e, hx, hy⟩
| 37 | 11,719,142,372,802,612 | 2 | 2 | 2 | 2,224 |
import Mathlib.Topology.Instances.RealVectorSpace
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.normed_space.mazur_ulam from "leanprover-community/mathlib"@"78261225eb5cedc61c5c74ecb44e5b385d13b733"
variable {E PE F PF : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [MetricSpace PE]
[NormedAddTorsor E PE] [NormedAddCommGroup F] [NormedSpace ℝ F] [MetricSpace PF]
[NormedAddTorsor F PF]
open Set AffineMap AffineIsometryEquiv
noncomputable section
namespace IsometryEquiv
theorem midpoint_fixed {x y : PE} :
∀ e : PE ≃ᵢ PE, e x = x → e y = y → e (midpoint ℝ x y) = midpoint ℝ x y := by
set z := midpoint ℝ x y
-- Consider the set of `e : E ≃ᵢ E` such that `e x = x` and `e y = y`
set s := { e : PE ≃ᵢ PE | e x = x ∧ e y = y }
haveI : Nonempty s := ⟨⟨IsometryEquiv.refl PE, rfl, rfl⟩⟩
-- On the one hand, `e` cannot send the midpoint `z` of `[x, y]` too far
have h_bdd : BddAbove (range fun e : s => dist ((e : PE ≃ᵢ PE) z) z) := by
refine ⟨dist x z + dist x z, forall_mem_range.2 <| Subtype.forall.2 ?_⟩
rintro e ⟨hx, _⟩
calc
dist (e z) z ≤ dist (e z) x + dist x z := dist_triangle (e z) x z
_ = dist (e x) (e z) + dist x z := by rw [hx, dist_comm]
_ = dist x z + dist x z := by erw [e.dist_eq x z]
-- On the other hand, consider the map `f : (E ≃ᵢ E) → (E ≃ᵢ E)`
-- sending each `e` to `R ∘ e⁻¹ ∘ R ∘ e`, where `R` is the point reflection in the
-- midpoint `z` of `[x, y]`.
set R : PE ≃ᵢ PE := (pointReflection ℝ z).toIsometryEquiv
set f : PE ≃ᵢ PE → PE ≃ᵢ PE := fun e => ((e.trans R).trans e.symm).trans R
-- Note that `f` doubles the value of `dist (e z) z`
have hf_dist : ∀ e, dist (f e z) z = 2 * dist (e z) z := by
intro e
dsimp [f, R]
rw [dist_pointReflection_fixed, ← e.dist_eq, e.apply_symm_apply,
dist_pointReflection_self_real, dist_comm]
-- Also note that `f` maps `s` to itself
have hf_maps_to : MapsTo f s s := by
rintro e ⟨hx, hy⟩
constructor <;> simp [f, R, z, hx, hy, e.symm_apply_eq.2 hx.symm, e.symm_apply_eq.2 hy.symm]
-- Therefore, `dist (e z) z = 0` for all `e ∈ s`.
set c := ⨆ e : s, dist ((e : PE ≃ᵢ PE) z) z
have : c ≤ c / 2 := by
apply ciSup_le
rintro ⟨e, he⟩
simp only [Subtype.coe_mk, le_div_iff' (zero_lt_two' ℝ), ← hf_dist]
exact le_ciSup h_bdd ⟨f e, hf_maps_to he⟩
replace : c ≤ 0 := by linarith
refine fun e hx hy => dist_le_zero.1 (le_trans ?_ this)
exact le_ciSup h_bdd ⟨e, hx, hy⟩
#align isometry_equiv.midpoint_fixed IsometryEquiv.midpoint_fixed
| Mathlib/Analysis/NormedSpace/MazurUlam.lean | 87 | 96 | theorem map_midpoint (f : PE ≃ᵢ PF) (x y : PE) : f (midpoint ℝ x y) = midpoint ℝ (f x) (f y) := by |
set e : PE ≃ᵢ PE :=
((f.trans <| (pointReflection ℝ <| midpoint ℝ (f x) (f y)).toIsometryEquiv).trans f.symm).trans
(pointReflection ℝ <| midpoint ℝ x y).toIsometryEquiv
have hx : e x = x := by simp [e]
have hy : e y = y := by simp [e]
have hm := e.midpoint_fixed hx hy
simp only [e, trans_apply] at hm
rwa [← eq_symm_apply, toIsometryEquiv_symm, pointReflection_symm, coe_toIsometryEquiv,
coe_toIsometryEquiv, pointReflection_self, symm_apply_eq, @pointReflection_fixed_iff] at hm
| 9 | 8,103.083928 | 2 | 2 | 2 | 2,224 |
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_countable
[hd : DiscreteTopology α] [Countable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_countable
@[deprecated DiscreteTopology.secondCountableTopology_of_countable (since := "2024-03-11")]
theorem DiscreteTopology.secondCountableTopology_of_encodable {α : Type*}
[TopologicalSpace α] [DiscreteTopology α] [Countable α] : SecondCountableTopology α :=
DiscreteTopology.secondCountableTopology_of_countable
#align discrete_topology.second_countable_topology_of_countable DiscreteTopology.secondCountableTopology_of_countable
| Mathlib/Topology/Instances/Discrete.lean | 51 | 63 | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by |
refine (eq_bot_of_singletons_open fun a => ?_).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a by
rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
letI := Preorder.topology α
apply IsOpen.inter
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
| 10 | 22,026.465795 | 2 | 2 | 4 | 2,225 |
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_countable
[hd : DiscreteTopology α] [Countable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_countable
@[deprecated DiscreteTopology.secondCountableTopology_of_countable (since := "2024-03-11")]
theorem DiscreteTopology.secondCountableTopology_of_encodable {α : Type*}
[TopologicalSpace α] [DiscreteTopology α] [Countable α] : SecondCountableTopology α :=
DiscreteTopology.secondCountableTopology_of_countable
#align discrete_topology.second_countable_topology_of_countable DiscreteTopology.secondCountableTopology_of_countable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine (eq_bot_of_singletons_open fun a => ?_).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a by
rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
letI := Preorder.topology α
apply IsOpen.inter
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
| Mathlib/Topology/Instances/Discrete.lean | 66 | 72 | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by |
refine ⟨fun h => ⟨?_⟩, fun h => ⟨?_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
| 5 | 148.413159 | 2 | 2 | 4 | 2,225 |
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_countable
[hd : DiscreteTopology α] [Countable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_countable
@[deprecated DiscreteTopology.secondCountableTopology_of_countable (since := "2024-03-11")]
theorem DiscreteTopology.secondCountableTopology_of_encodable {α : Type*}
[TopologicalSpace α] [DiscreteTopology α] [Countable α] : SecondCountableTopology α :=
DiscreteTopology.secondCountableTopology_of_countable
#align discrete_topology.second_countable_topology_of_countable DiscreteTopology.secondCountableTopology_of_countable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine (eq_bot_of_singletons_open fun a => ?_).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a by
rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
letI := Preorder.topology α
apply IsOpen.inter
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine ⟨fun h => ⟨?_⟩, fun h => ⟨?_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
| Mathlib/Topology/Instances/Discrete.lean | 80 | 108 | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by |
refine (eq_bot_of_singletons_open fun a => ?_).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
letI := Preorder.topology α
apply IsOpen.inter
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
| 27 | 532,048,240,601.79865 | 2 | 2 | 4 | 2,225 |
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_countable
[hd : DiscreteTopology α] [Countable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_countable
@[deprecated DiscreteTopology.secondCountableTopology_of_countable (since := "2024-03-11")]
theorem DiscreteTopology.secondCountableTopology_of_encodable {α : Type*}
[TopologicalSpace α] [DiscreteTopology α] [Countable α] : SecondCountableTopology α :=
DiscreteTopology.secondCountableTopology_of_countable
#align discrete_topology.second_countable_topology_of_countable DiscreteTopology.secondCountableTopology_of_countable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine (eq_bot_of_singletons_open fun a => ?_).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a by
rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
letI := Preorder.topology α
apply IsOpen.inter
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine ⟨fun h => ⟨?_⟩, fun h => ⟨?_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine (eq_bot_of_singletons_open fun a => ?_).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
letI := Preorder.topology α
apply IsOpen.inter
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align linear_order.bot_topological_space_eq_generate_from LinearOrder.bot_topologicalSpace_eq_generateFrom
| Mathlib/Topology/Instances/Discrete.lean | 111 | 117 | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by |
refine ⟨fun h => ⟨?_⟩, fun h => ⟨?_⟩⟩
· rw [h.eq_bot]
exact LinearOrder.bot_topologicalSpace_eq_generateFrom
· rw [h.topology_eq_generate_intervals]
exact LinearOrder.bot_topologicalSpace_eq_generateFrom.symm
| 5 | 148.413159 | 2 | 2 | 4 | 2,225 |
import Mathlib.Algebra.Polynomial.Cardinal
import Mathlib.RingTheory.Algebraic
#align_import algebra.algebraic_card from "leanprover-community/mathlib"@"40494fe75ecbd6d2ec61711baa630cf0a7b7d064"
universe u v
open Cardinal Polynomial Set
open Cardinal Polynomial
namespace Algebraic
theorem infinite_of_charZero (R A : Type*) [CommRing R] [IsDomain R] [Ring A] [Algebra R A]
[CharZero A] : { x : A | IsAlgebraic R x }.Infinite :=
infinite_of_injective_forall_mem Nat.cast_injective isAlgebraic_nat
#align algebraic.infinite_of_char_zero Algebraic.infinite_of_charZero
theorem aleph0_le_cardinal_mk_of_charZero (R A : Type*) [CommRing R] [IsDomain R] [Ring A]
[Algebra R A] [CharZero A] : ℵ₀ ≤ #{ x : A // IsAlgebraic R x } :=
infinite_iff.1 (Set.infinite_coe_iff.2 <| infinite_of_charZero R A)
#align algebraic.aleph_0_le_cardinal_mk_of_char_zero Algebraic.aleph0_le_cardinal_mk_of_charZero
section lift
variable (R : Type u) (A : Type v) [CommRing R] [CommRing A] [IsDomain A] [Algebra R A]
[NoZeroSMulDivisors R A]
| Mathlib/Algebra/AlgebraicCard.lean | 45 | 54 | theorem cardinal_mk_lift_le_mul :
Cardinal.lift.{u} #{ x : A // IsAlgebraic R x } ≤ Cardinal.lift.{v} #R[X] * ℵ₀ := by |
rw [← mk_uLift, ← mk_uLift]
choose g hg₁ hg₂ using fun x : { x : A | IsAlgebraic R x } => x.coe_prop
refine lift_mk_le_lift_mk_mul_of_lift_mk_preimage_le g fun f => ?_
rw [lift_le_aleph0, le_aleph0_iff_set_countable]
suffices MapsTo (↑) (g ⁻¹' {f}) (f.rootSet A) from
this.countable_of_injOn Subtype.coe_injective.injOn (f.rootSet_finite A).countable
rintro x (rfl : g x = f)
exact mem_rootSet.2 ⟨hg₁ x, hg₂ x⟩
| 8 | 2,980.957987 | 2 | 2 | 1 | 2,226 |
import Mathlib.Data.DFinsupp.WellFounded
import Mathlib.Data.Finsupp.Lex
#align_import data.finsupp.well_founded from "leanprover-community/mathlib"@"5fd3186f1ec30a75d5f65732e3ce5e623382556f"
variable {α N : Type*}
namespace Finsupp
variable [Zero N] {r : α → α → Prop} {s : N → N → Prop} (hbot : ∀ ⦃n⦄, ¬s n 0)
(hs : WellFounded s)
| Mathlib/Data/Finsupp/WellFounded.lean | 37 | 42 | theorem Lex.acc (x : α →₀ N) (h : ∀ a ∈ x.support, Acc (rᶜ ⊓ (· ≠ ·)) a) :
Acc (Finsupp.Lex r s) x := by |
rw [lex_eq_invImage_dfinsupp_lex]
classical
refine InvImage.accessible toDFinsupp (DFinsupp.Lex.acc (fun _ => hbot) (fun _ => hs) _ ?_)
simpa only [toDFinsupp_support] using h
| 4 | 54.59815 | 2 | 2 | 1 | 2,227 |
import Mathlib.Data.List.Count
import Mathlib.Data.List.Dedup
import Mathlib.Data.List.InsertNth
import Mathlib.Data.List.Lattice
import Mathlib.Data.List.Permutation
import Mathlib.Data.Nat.Factorial.Basic
#align_import data.list.perm from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
-- Make sure we don't import algebra
assert_not_exists Monoid
open Nat
namespace List
variable {α β : Type*} {l l₁ l₂ : List α} {a : α}
#align list.perm List.Perm
instance : Trans (@List.Perm α) (@List.Perm α) List.Perm where
trans := @List.Perm.trans α
open Perm (swap)
attribute [refl] Perm.refl
#align list.perm.refl List.Perm.refl
lemma perm_rfl : l ~ l := Perm.refl _
-- Porting note: used rec_on in mathlib3; lean4 eqn compiler still doesn't like it
attribute [symm] Perm.symm
#align list.perm.symm List.Perm.symm
#align list.perm_comm List.perm_comm
#align list.perm.swap' List.Perm.swap'
attribute [trans] Perm.trans
#align list.perm.eqv List.Perm.eqv
#align list.is_setoid List.isSetoid
#align list.perm.mem_iff List.Perm.mem_iff
#align list.perm.subset List.Perm.subset
theorem Perm.subset_congr_left {l₁ l₂ l₃ : List α} (h : l₁ ~ l₂) : l₁ ⊆ l₃ ↔ l₂ ⊆ l₃ :=
⟨h.symm.subset.trans, h.subset.trans⟩
#align list.perm.subset_congr_left List.Perm.subset_congr_left
theorem Perm.subset_congr_right {l₁ l₂ l₃ : List α} (h : l₁ ~ l₂) : l₃ ⊆ l₁ ↔ l₃ ⊆ l₂ :=
⟨fun h' => h'.trans h.subset, fun h' => h'.trans h.symm.subset⟩
#align list.perm.subset_congr_right List.Perm.subset_congr_right
#align list.perm.append_right List.Perm.append_right
#align list.perm.append_left List.Perm.append_left
#align list.perm.append List.Perm.append
#align list.perm.append_cons List.Perm.append_cons
#align list.perm_middle List.perm_middle
#align list.perm_append_singleton List.perm_append_singleton
#align list.perm_append_comm List.perm_append_comm
#align list.concat_perm List.concat_perm
#align list.perm.length_eq List.Perm.length_eq
#align list.perm.eq_nil List.Perm.eq_nil
#align list.perm.nil_eq List.Perm.nil_eq
#align list.perm_nil List.perm_nil
#align list.nil_perm List.nil_perm
#align list.not_perm_nil_cons List.not_perm_nil_cons
#align list.reverse_perm List.reverse_perm
#align list.perm_cons_append_cons List.perm_cons_append_cons
#align list.perm_replicate List.perm_replicate
#align list.replicate_perm List.replicate_perm
#align list.perm_singleton List.perm_singleton
#align list.singleton_perm List.singleton_perm
#align list.singleton_perm_singleton List.singleton_perm_singleton
#align list.perm_cons_erase List.perm_cons_erase
#align list.perm_induction_on List.Perm.recOnSwap'
-- Porting note: used to be @[congr]
#align list.perm.filter_map List.Perm.filterMap
-- Porting note: used to be @[congr]
#align list.perm.map List.Perm.map
#align list.perm.pmap List.Perm.pmap
#align list.perm.filter List.Perm.filter
#align list.filter_append_perm List.filter_append_perm
#align list.exists_perm_sublist List.exists_perm_sublist
#align list.perm.sizeof_eq_sizeof List.Perm.sizeOf_eq_sizeOf
section Rel
open Relator
variable {γ : Type*} {δ : Type*} {r : α → β → Prop} {p : γ → δ → Prop}
local infixr:80 " ∘r " => Relation.Comp
| Mathlib/Data/List/Perm.lean | 142 | 146 | theorem perm_comp_perm : (Perm ∘r Perm : List α → List α → Prop) = Perm := by |
funext a c; apply propext
constructor
· exact fun ⟨b, hab, hba⟩ => Perm.trans hab hba
· exact fun h => ⟨a, Perm.refl a, h⟩
| 4 | 54.59815 | 2 | 2 | 3 | 2,228 |
import Mathlib.Data.List.Count
import Mathlib.Data.List.Dedup
import Mathlib.Data.List.InsertNth
import Mathlib.Data.List.Lattice
import Mathlib.Data.List.Permutation
import Mathlib.Data.Nat.Factorial.Basic
#align_import data.list.perm from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
-- Make sure we don't import algebra
assert_not_exists Monoid
open Nat
namespace List
variable {α β : Type*} {l l₁ l₂ : List α} {a : α}
#align list.perm List.Perm
instance : Trans (@List.Perm α) (@List.Perm α) List.Perm where
trans := @List.Perm.trans α
open Perm (swap)
attribute [refl] Perm.refl
#align list.perm.refl List.Perm.refl
lemma perm_rfl : l ~ l := Perm.refl _
-- Porting note: used rec_on in mathlib3; lean4 eqn compiler still doesn't like it
attribute [symm] Perm.symm
#align list.perm.symm List.Perm.symm
#align list.perm_comm List.perm_comm
#align list.perm.swap' List.Perm.swap'
attribute [trans] Perm.trans
#align list.perm.eqv List.Perm.eqv
#align list.is_setoid List.isSetoid
#align list.perm.mem_iff List.Perm.mem_iff
#align list.perm.subset List.Perm.subset
theorem Perm.subset_congr_left {l₁ l₂ l₃ : List α} (h : l₁ ~ l₂) : l₁ ⊆ l₃ ↔ l₂ ⊆ l₃ :=
⟨h.symm.subset.trans, h.subset.trans⟩
#align list.perm.subset_congr_left List.Perm.subset_congr_left
theorem Perm.subset_congr_right {l₁ l₂ l₃ : List α} (h : l₁ ~ l₂) : l₃ ⊆ l₁ ↔ l₃ ⊆ l₂ :=
⟨fun h' => h'.trans h.subset, fun h' => h'.trans h.symm.subset⟩
#align list.perm.subset_congr_right List.Perm.subset_congr_right
#align list.perm.append_right List.Perm.append_right
#align list.perm.append_left List.Perm.append_left
#align list.perm.append List.Perm.append
#align list.perm.append_cons List.Perm.append_cons
#align list.perm_middle List.perm_middle
#align list.perm_append_singleton List.perm_append_singleton
#align list.perm_append_comm List.perm_append_comm
#align list.concat_perm List.concat_perm
#align list.perm.length_eq List.Perm.length_eq
#align list.perm.eq_nil List.Perm.eq_nil
#align list.perm.nil_eq List.Perm.nil_eq
#align list.perm_nil List.perm_nil
#align list.nil_perm List.nil_perm
#align list.not_perm_nil_cons List.not_perm_nil_cons
#align list.reverse_perm List.reverse_perm
#align list.perm_cons_append_cons List.perm_cons_append_cons
#align list.perm_replicate List.perm_replicate
#align list.replicate_perm List.replicate_perm
#align list.perm_singleton List.perm_singleton
#align list.singleton_perm List.singleton_perm
#align list.singleton_perm_singleton List.singleton_perm_singleton
#align list.perm_cons_erase List.perm_cons_erase
#align list.perm_induction_on List.Perm.recOnSwap'
-- Porting note: used to be @[congr]
#align list.perm.filter_map List.Perm.filterMap
-- Porting note: used to be @[congr]
#align list.perm.map List.Perm.map
#align list.perm.pmap List.Perm.pmap
#align list.perm.filter List.Perm.filter
#align list.filter_append_perm List.filter_append_perm
#align list.exists_perm_sublist List.exists_perm_sublist
#align list.perm.sizeof_eq_sizeof List.Perm.sizeOf_eq_sizeOf
section Rel
open Relator
variable {γ : Type*} {δ : Type*} {r : α → β → Prop} {p : γ → δ → Prop}
local infixr:80 " ∘r " => Relation.Comp
theorem perm_comp_perm : (Perm ∘r Perm : List α → List α → Prop) = Perm := by
funext a c; apply propext
constructor
· exact fun ⟨b, hab, hba⟩ => Perm.trans hab hba
· exact fun h => ⟨a, Perm.refl a, h⟩
#align list.perm_comp_perm List.perm_comp_perm
| Mathlib/Data/List/Perm.lean | 149 | 164 | theorem perm_comp_forall₂ {l u v} (hlu : Perm l u) (huv : Forall₂ r u v) :
(Forall₂ r ∘r Perm) l v := by |
induction hlu generalizing v with
| nil => cases huv; exact ⟨[], Forall₂.nil, Perm.nil⟩
| cons u _hlu ih =>
cases' huv with _ b _ v hab huv'
rcases ih huv' with ⟨l₂, h₁₂, h₂₃⟩
exact ⟨b :: l₂, Forall₂.cons hab h₁₂, h₂₃.cons _⟩
| swap a₁ a₂ h₂₃ =>
cases' huv with _ b₁ _ l₂ h₁ hr₂₃
cases' hr₂₃ with _ b₂ _ l₂ h₂ h₁₂
exact ⟨b₂ :: b₁ :: l₂, Forall₂.cons h₂ (Forall₂.cons h₁ h₁₂), Perm.swap _ _ _⟩
| trans _ _ ih₁ ih₂ =>
rcases ih₂ huv with ⟨lb₂, hab₂, h₂₃⟩
rcases ih₁ hab₂ with ⟨lb₁, hab₁, h₁₂⟩
exact ⟨lb₁, hab₁, Perm.trans h₁₂ h₂₃⟩
| 14 | 1,202,604.284165 | 2 | 2 | 3 | 2,228 |
import Mathlib.Data.List.Count
import Mathlib.Data.List.Dedup
import Mathlib.Data.List.InsertNth
import Mathlib.Data.List.Lattice
import Mathlib.Data.List.Permutation
import Mathlib.Data.Nat.Factorial.Basic
#align_import data.list.perm from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
-- Make sure we don't import algebra
assert_not_exists Monoid
open Nat
namespace List
variable {α β : Type*} {l l₁ l₂ : List α} {a : α}
#align list.perm List.Perm
instance : Trans (@List.Perm α) (@List.Perm α) List.Perm where
trans := @List.Perm.trans α
open Perm (swap)
attribute [refl] Perm.refl
#align list.perm.refl List.Perm.refl
lemma perm_rfl : l ~ l := Perm.refl _
-- Porting note: used rec_on in mathlib3; lean4 eqn compiler still doesn't like it
attribute [symm] Perm.symm
#align list.perm.symm List.Perm.symm
#align list.perm_comm List.perm_comm
#align list.perm.swap' List.Perm.swap'
attribute [trans] Perm.trans
#align list.perm.eqv List.Perm.eqv
#align list.is_setoid List.isSetoid
#align list.perm.mem_iff List.Perm.mem_iff
#align list.perm.subset List.Perm.subset
theorem Perm.subset_congr_left {l₁ l₂ l₃ : List α} (h : l₁ ~ l₂) : l₁ ⊆ l₃ ↔ l₂ ⊆ l₃ :=
⟨h.symm.subset.trans, h.subset.trans⟩
#align list.perm.subset_congr_left List.Perm.subset_congr_left
theorem Perm.subset_congr_right {l₁ l₂ l₃ : List α} (h : l₁ ~ l₂) : l₃ ⊆ l₁ ↔ l₃ ⊆ l₂ :=
⟨fun h' => h'.trans h.subset, fun h' => h'.trans h.symm.subset⟩
#align list.perm.subset_congr_right List.Perm.subset_congr_right
#align list.perm.append_right List.Perm.append_right
#align list.perm.append_left List.Perm.append_left
#align list.perm.append List.Perm.append
#align list.perm.append_cons List.Perm.append_cons
#align list.perm_middle List.perm_middle
#align list.perm_append_singleton List.perm_append_singleton
#align list.perm_append_comm List.perm_append_comm
#align list.concat_perm List.concat_perm
#align list.perm.length_eq List.Perm.length_eq
#align list.perm.eq_nil List.Perm.eq_nil
#align list.perm.nil_eq List.Perm.nil_eq
#align list.perm_nil List.perm_nil
#align list.nil_perm List.nil_perm
#align list.not_perm_nil_cons List.not_perm_nil_cons
#align list.reverse_perm List.reverse_perm
#align list.perm_cons_append_cons List.perm_cons_append_cons
#align list.perm_replicate List.perm_replicate
#align list.replicate_perm List.replicate_perm
#align list.perm_singleton List.perm_singleton
#align list.singleton_perm List.singleton_perm
#align list.singleton_perm_singleton List.singleton_perm_singleton
#align list.perm_cons_erase List.perm_cons_erase
#align list.perm_induction_on List.Perm.recOnSwap'
-- Porting note: used to be @[congr]
#align list.perm.filter_map List.Perm.filterMap
-- Porting note: used to be @[congr]
#align list.perm.map List.Perm.map
#align list.perm.pmap List.Perm.pmap
#align list.perm.filter List.Perm.filter
#align list.filter_append_perm List.filter_append_perm
#align list.exists_perm_sublist List.exists_perm_sublist
#align list.perm.sizeof_eq_sizeof List.Perm.sizeOf_eq_sizeOf
section Rel
open Relator
variable {γ : Type*} {δ : Type*} {r : α → β → Prop} {p : γ → δ → Prop}
local infixr:80 " ∘r " => Relation.Comp
theorem perm_comp_perm : (Perm ∘r Perm : List α → List α → Prop) = Perm := by
funext a c; apply propext
constructor
· exact fun ⟨b, hab, hba⟩ => Perm.trans hab hba
· exact fun h => ⟨a, Perm.refl a, h⟩
#align list.perm_comp_perm List.perm_comp_perm
theorem perm_comp_forall₂ {l u v} (hlu : Perm l u) (huv : Forall₂ r u v) :
(Forall₂ r ∘r Perm) l v := by
induction hlu generalizing v with
| nil => cases huv; exact ⟨[], Forall₂.nil, Perm.nil⟩
| cons u _hlu ih =>
cases' huv with _ b _ v hab huv'
rcases ih huv' with ⟨l₂, h₁₂, h₂₃⟩
exact ⟨b :: l₂, Forall₂.cons hab h₁₂, h₂₃.cons _⟩
| swap a₁ a₂ h₂₃ =>
cases' huv with _ b₁ _ l₂ h₁ hr₂₃
cases' hr₂₃ with _ b₂ _ l₂ h₂ h₁₂
exact ⟨b₂ :: b₁ :: l₂, Forall₂.cons h₂ (Forall₂.cons h₁ h₁₂), Perm.swap _ _ _⟩
| trans _ _ ih₁ ih₂ =>
rcases ih₂ huv with ⟨lb₂, hab₂, h₂₃⟩
rcases ih₁ hab₂ with ⟨lb₁, hab₁, h₁₂⟩
exact ⟨lb₁, hab₁, Perm.trans h₁₂ h₂₃⟩
#align list.perm_comp_forall₂ List.perm_comp_forall₂
| Mathlib/Data/List/Perm.lean | 167 | 175 | theorem forall₂_comp_perm_eq_perm_comp_forall₂ : Forall₂ r ∘r Perm = Perm ∘r Forall₂ r := by |
funext l₁ l₃; apply propext
constructor
· intro h
rcases h with ⟨l₂, h₁₂, h₂₃⟩
have : Forall₂ (flip r) l₂ l₁ := h₁₂.flip
rcases perm_comp_forall₂ h₂₃.symm this with ⟨l', h₁, h₂⟩
exact ⟨l', h₂.symm, h₁.flip⟩
· exact fun ⟨l₂, h₁₂, h₂₃⟩ => perm_comp_forall₂ h₁₂ h₂₃
| 8 | 2,980.957987 | 2 | 2 | 3 | 2,228 |
import Mathlib.RingTheory.Adjoin.FG
#align_import ring_theory.adjoin.tower from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Pointwise
universe u v w u₁
variable (R : Type u) (S : Type v) (A : Type w) (B : Type u₁)
namespace Algebra
| Mathlib/RingTheory/Adjoin/Tower.lean | 30 | 46 | theorem adjoin_restrictScalars (C D E : Type*) [CommSemiring C] [CommSemiring D] [CommSemiring E]
[Algebra C D] [Algebra C E] [Algebra D E] [IsScalarTower C D E] (S : Set E) :
(Algebra.adjoin D S).restrictScalars C =
(Algebra.adjoin ((⊤ : Subalgebra C D).map (IsScalarTower.toAlgHom C D E)) S).restrictScalars
C := by |
suffices
Set.range (algebraMap D E) =
Set.range (algebraMap ((⊤ : Subalgebra C D).map (IsScalarTower.toAlgHom C D E)) E) by
ext x
change x ∈ Subsemiring.closure (_ ∪ S) ↔ x ∈ Subsemiring.closure (_ ∪ S)
rw [this]
ext x
constructor
· rintro ⟨y, hy⟩
exact ⟨⟨algebraMap D E y, ⟨y, ⟨Algebra.mem_top, rfl⟩⟩⟩, hy⟩
· rintro ⟨⟨y, ⟨z, ⟨h0, h1⟩⟩⟩, h2⟩
exact ⟨z, Eq.trans h1 h2⟩
| 12 | 162,754.791419 | 2 | 2 | 3 | 2,229 |
import Mathlib.RingTheory.Adjoin.FG
#align_import ring_theory.adjoin.tower from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Pointwise
universe u v w u₁
variable (R : Type u) (S : Type v) (A : Type w) (B : Type u₁)
namespace Algebra
theorem adjoin_restrictScalars (C D E : Type*) [CommSemiring C] [CommSemiring D] [CommSemiring E]
[Algebra C D] [Algebra C E] [Algebra D E] [IsScalarTower C D E] (S : Set E) :
(Algebra.adjoin D S).restrictScalars C =
(Algebra.adjoin ((⊤ : Subalgebra C D).map (IsScalarTower.toAlgHom C D E)) S).restrictScalars
C := by
suffices
Set.range (algebraMap D E) =
Set.range (algebraMap ((⊤ : Subalgebra C D).map (IsScalarTower.toAlgHom C D E)) E) by
ext x
change x ∈ Subsemiring.closure (_ ∪ S) ↔ x ∈ Subsemiring.closure (_ ∪ S)
rw [this]
ext x
constructor
· rintro ⟨y, hy⟩
exact ⟨⟨algebraMap D E y, ⟨y, ⟨Algebra.mem_top, rfl⟩⟩⟩, hy⟩
· rintro ⟨⟨y, ⟨z, ⟨h0, h1⟩⟩⟩, h2⟩
exact ⟨z, Eq.trans h1 h2⟩
#align algebra.adjoin_restrict_scalars Algebra.adjoin_restrictScalars
| Mathlib/RingTheory/Adjoin/Tower.lean | 49 | 58 | theorem adjoin_res_eq_adjoin_res (C D E F : Type*) [CommSemiring C] [CommSemiring D]
[CommSemiring E] [CommSemiring F] [Algebra C D] [Algebra C E] [Algebra C F] [Algebra D F]
[Algebra E F] [IsScalarTower C D F] [IsScalarTower C E F] {S : Set D} {T : Set E}
(hS : Algebra.adjoin C S = ⊤) (hT : Algebra.adjoin C T = ⊤) :
(Algebra.adjoin E (algebraMap D F '' S)).restrictScalars C =
(Algebra.adjoin D (algebraMap E F '' T)).restrictScalars C := by |
rw [adjoin_restrictScalars C E, adjoin_restrictScalars C D, ← hS, ← hT, ← Algebra.adjoin_image,
← Algebra.adjoin_image, ← AlgHom.coe_toRingHom, ← AlgHom.coe_toRingHom,
IsScalarTower.coe_toAlgHom, IsScalarTower.coe_toAlgHom, ← adjoin_union_eq_adjoin_adjoin, ←
adjoin_union_eq_adjoin_adjoin, Set.union_comm]
| 4 | 54.59815 | 2 | 2 | 3 | 2,229 |
import Mathlib.RingTheory.Adjoin.FG
#align_import ring_theory.adjoin.tower from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Pointwise
universe u v w u₁
variable (R : Type u) (S : Type v) (A : Type w) (B : Type u₁)
section
open scoped Classical
theorem Algebra.fg_trans' {R S A : Type*} [CommSemiring R] [CommSemiring S] [Semiring A]
[Algebra R S] [Algebra S A] [Algebra R A] [IsScalarTower R S A] (hRS : (⊤ : Subalgebra R S).FG)
(hSA : (⊤ : Subalgebra S A).FG) : (⊤ : Subalgebra R A).FG :=
let ⟨s, hs⟩ := hRS
let ⟨t, ht⟩ := hSA
⟨s.image (algebraMap S A) ∪ t, by
rw [Finset.coe_union, Finset.coe_image, Algebra.adjoin_algebraMap_image_union_eq_adjoin_adjoin,
hs, Algebra.adjoin_top, ht, Subalgebra.restrictScalars_top, Subalgebra.restrictScalars_top]⟩
#align algebra.fg_trans' Algebra.fg_trans'
end
section ArtinTate
variable (C : Type*)
section Semiring
variable [CommSemiring A] [CommSemiring B] [Semiring C]
variable [Algebra A B] [Algebra B C] [Algebra A C] [IsScalarTower A B C]
open Finset Submodule
open scoped Classical
| Mathlib/RingTheory/Adjoin/Tower.lean | 92 | 135 | theorem exists_subalgebra_of_fg (hAC : (⊤ : Subalgebra A C).FG) (hBC : (⊤ : Submodule B C).FG) :
∃ B₀ : Subalgebra A B, B₀.FG ∧ (⊤ : Submodule B₀ C).FG := by |
cases' hAC with x hx
cases' hBC with y hy
have := hy
simp_rw [eq_top_iff', mem_span_finset] at this
choose f hf using this
let s : Finset B := Finset.image₂ f (x ∪ y * y) y
have hxy :
∀ xi ∈ x, xi ∈ span (Algebra.adjoin A (↑s : Set B)) (↑(insert 1 y : Finset C) : Set C) :=
fun xi hxi =>
hf xi ▸
sum_mem fun yj hyj =>
smul_mem (span (Algebra.adjoin A (↑s : Set B)) (↑(insert 1 y : Finset C) : Set C))
⟨f xi yj, Algebra.subset_adjoin <| mem_image₂_of_mem (mem_union_left _ hxi) hyj⟩
(subset_span <| mem_insert_of_mem hyj)
have hyy :
span (Algebra.adjoin A (↑s : Set B)) (↑(insert 1 y : Finset C) : Set C) *
span (Algebra.adjoin A (↑s : Set B)) (↑(insert 1 y : Finset C) : Set C) ≤
span (Algebra.adjoin A (↑s : Set B)) (↑(insert 1 y : Finset C) : Set C) := by
rw [span_mul_span, span_le, coe_insert]
rintro _ ⟨yi, rfl | hyi, yj, rfl | hyj, rfl⟩ <;> dsimp
· rw [mul_one]
exact subset_span (Set.mem_insert _ _)
· rw [one_mul]
exact subset_span (Set.mem_insert_of_mem _ hyj)
· rw [mul_one]
exact subset_span (Set.mem_insert_of_mem _ hyi)
· rw [← hf (yi * yj)]
exact
SetLike.mem_coe.2
(sum_mem fun yk hyk =>
smul_mem (span (Algebra.adjoin A (↑s : Set B)) (insert 1 ↑y : Set C))
⟨f (yi * yj) yk,
Algebra.subset_adjoin <|
mem_image₂_of_mem (mem_union_right _ <| mul_mem_mul hyi hyj) hyk⟩
(subset_span <| Set.mem_insert_of_mem _ hyk : yk ∈ _))
refine ⟨Algebra.adjoin A (↑s : Set B), Subalgebra.fg_adjoin_finset _, insert 1 y, ?_⟩
convert restrictScalars_injective A (Algebra.adjoin A (s : Set B)) C _
rw [restrictScalars_top, eq_top_iff, ← Algebra.top_toSubmodule, ← hx, Algebra.adjoin_eq_span,
span_le]
refine fun r hr =>
Submonoid.closure_induction hr (fun c hc => hxy c hc) (subset_span <| mem_insert_self _ _)
fun p q hp hq => hyy <| Submodule.mul_mem_mul hp hq
| 42 | 1,739,274,941,520,501,200 | 2 | 2 | 3 | 2,229 |
import Mathlib.Analysis.Calculus.Deriv.Basic
#align_import analysis.calculus.deriv.support from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v
variable {𝕜 : Type u} [NontriviallyNormedField 𝕜]
variable {E : Type v} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
variable {f : 𝕜 → E}
section Support
open Function
| Mathlib/Analysis/Calculus/Deriv/Support.lean | 36 | 41 | theorem support_deriv_subset : support (deriv f) ⊆ tsupport f := by |
intro x
rw [← not_imp_not]
intro h2x
rw [not_mem_tsupport_iff_eventuallyEq] at h2x
exact nmem_support.mpr (h2x.deriv_eq.trans (deriv_const x 0))
| 5 | 148.413159 | 2 | 2 | 1 | 2,230 |
import Mathlib.Algebra.Module.LinearMap.Basic
import Mathlib.RingTheory.HahnSeries.Basic
#align_import ring_theory.hahn_series from "leanprover-community/mathlib"@"a484a7d0eade4e1268f4fb402859b6686037f965"
set_option linter.uppercaseLean3 false
open Finset Function
open scoped Classical
noncomputable section
variable {Γ R : Type*}
namespace HahnSeries
section Addition
variable [PartialOrder Γ]
section AddMonoid
variable [AddMonoid R]
instance : Add (HahnSeries Γ R) where
add x y :=
{ coeff := x.coeff + y.coeff
isPWO_support' := (x.isPWO_support.union y.isPWO_support).mono (Function.support_add _ _) }
instance : AddMonoid (HahnSeries Γ R) where
zero := 0
add := (· + ·)
nsmul := nsmulRec
add_assoc x y z := by
ext
apply add_assoc
zero_add x := by
ext
apply zero_add
add_zero x := by
ext
apply add_zero
@[simp]
theorem add_coeff' {x y : HahnSeries Γ R} : (x + y).coeff = x.coeff + y.coeff :=
rfl
#align hahn_series.add_coeff' HahnSeries.add_coeff'
theorem add_coeff {x y : HahnSeries Γ R} {a : Γ} : (x + y).coeff a = x.coeff a + y.coeff a :=
rfl
#align hahn_series.add_coeff HahnSeries.add_coeff
theorem support_add_subset {x y : HahnSeries Γ R} : support (x + y) ⊆ support x ∪ support y :=
fun a ha => by
rw [mem_support, add_coeff] at ha
rw [Set.mem_union, mem_support, mem_support]
contrapose! ha
rw [ha.1, ha.2, add_zero]
#align hahn_series.support_add_subset HahnSeries.support_add_subset
| Mathlib/RingTheory/HahnSeries/Addition.lean | 81 | 89 | theorem min_order_le_order_add {Γ} [Zero Γ] [LinearOrder Γ] {x y : HahnSeries Γ R}
(hxy : x + y ≠ 0) : min x.order y.order ≤ (x + y).order := by |
by_cases hx : x = 0; · simp [hx]
by_cases hy : y = 0; · simp [hy]
rw [order_of_ne hx, order_of_ne hy, order_of_ne hxy]
apply le_of_eq_of_le _ (Set.IsWF.min_le_min_of_subset (support_add_subset (x := x) (y := y)))
· simp
· simp [hy]
· exact (Set.IsWF.min_union _ _ _ _).symm
| 7 | 1,096.633158 | 2 | 2 | 2 | 2,231 |
import Mathlib.Algebra.Module.LinearMap.Basic
import Mathlib.RingTheory.HahnSeries.Basic
#align_import ring_theory.hahn_series from "leanprover-community/mathlib"@"a484a7d0eade4e1268f4fb402859b6686037f965"
set_option linter.uppercaseLean3 false
open Finset Function
open scoped Classical
noncomputable section
variable {Γ R : Type*}
namespace HahnSeries
section Addition
variable [PartialOrder Γ]
section AddMonoid
variable [AddMonoid R]
instance : Add (HahnSeries Γ R) where
add x y :=
{ coeff := x.coeff + y.coeff
isPWO_support' := (x.isPWO_support.union y.isPWO_support).mono (Function.support_add _ _) }
instance : AddMonoid (HahnSeries Γ R) where
zero := 0
add := (· + ·)
nsmul := nsmulRec
add_assoc x y z := by
ext
apply add_assoc
zero_add x := by
ext
apply zero_add
add_zero x := by
ext
apply add_zero
@[simp]
theorem add_coeff' {x y : HahnSeries Γ R} : (x + y).coeff = x.coeff + y.coeff :=
rfl
#align hahn_series.add_coeff' HahnSeries.add_coeff'
theorem add_coeff {x y : HahnSeries Γ R} {a : Γ} : (x + y).coeff a = x.coeff a + y.coeff a :=
rfl
#align hahn_series.add_coeff HahnSeries.add_coeff
theorem support_add_subset {x y : HahnSeries Γ R} : support (x + y) ⊆ support x ∪ support y :=
fun a ha => by
rw [mem_support, add_coeff] at ha
rw [Set.mem_union, mem_support, mem_support]
contrapose! ha
rw [ha.1, ha.2, add_zero]
#align hahn_series.support_add_subset HahnSeries.support_add_subset
theorem min_order_le_order_add {Γ} [Zero Γ] [LinearOrder Γ] {x y : HahnSeries Γ R}
(hxy : x + y ≠ 0) : min x.order y.order ≤ (x + y).order := by
by_cases hx : x = 0; · simp [hx]
by_cases hy : y = 0; · simp [hy]
rw [order_of_ne hx, order_of_ne hy, order_of_ne hxy]
apply le_of_eq_of_le _ (Set.IsWF.min_le_min_of_subset (support_add_subset (x := x) (y := y)))
· simp
· simp [hy]
· exact (Set.IsWF.min_union _ _ _ _).symm
#align hahn_series.min_order_le_order_add HahnSeries.min_order_le_order_add
@[simps!]
def single.addMonoidHom (a : Γ) : R →+ HahnSeries Γ R :=
{ single a with
map_add' := fun x y => by
ext b
by_cases h : b = a <;> simp [h] }
#align hahn_series.single.add_monoid_hom HahnSeries.single.addMonoidHom
@[simps]
def coeff.addMonoidHom (g : Γ) : HahnSeries Γ R →+ R where
toFun f := f.coeff g
map_zero' := zero_coeff
map_add' _ _ := add_coeff
#align hahn_series.coeff.add_monoid_hom HahnSeries.coeff.addMonoidHom
section Domain
variable {Γ' : Type*} [PartialOrder Γ']
| Mathlib/RingTheory/HahnSeries/Addition.lean | 113 | 119 | theorem embDomain_add (f : Γ ↪o Γ') (x y : HahnSeries Γ R) :
embDomain f (x + y) = embDomain f x + embDomain f y := by |
ext g
by_cases hg : g ∈ Set.range f
· obtain ⟨a, rfl⟩ := hg
simp
· simp [embDomain_notin_range hg]
| 5 | 148.413159 | 2 | 2 | 2 | 2,231 |
import Mathlib.Topology.Algebra.InfiniteSum.Group
import Mathlib.Topology.Algebra.Nonarchimedean.Basic
open Filter Topology
namespace NonarchimedeanGroup
variable {α G : Type*}
variable [CommGroup G] [UniformSpace G] [UniformGroup G] [NonarchimedeanGroup G]
@[to_additive "Let `G` be a nonarchimedean additive abelian group, and let `f : α → G` be a function
that tends to zero on the filter of cofinite sets. For each finite subset of `α`, consider the
partial sum of `f` on that subset. These partial sums form a Cauchy filter."]
| Mathlib/Topology/Algebra/InfiniteSum/Nonarchimedean.lean | 31 | 48 | theorem cauchySeq_prod_of_tendsto_cofinite_one {f : α → G} (hf : Tendsto f cofinite (𝓝 1)) :
CauchySeq (fun s ↦ ∏ i ∈ s, f i) := by |
/- Let `U` be a neighborhood of `1`. It suffices to show that there exists `s : Finset α` such
that for any `t : Finset α` disjoint from `s`, we have `∏ i ∈ t, f i ∈ U`. -/
apply cauchySeq_finset_iff_prod_vanishing.mpr
intro U hU
-- Since `G` is nonarchimedean, `U` contains an open subgroup `V`.
rcases is_nonarchimedean U hU with ⟨V, hV⟩
/- Let `s` be the set of all indices `i : α` such that `f i ∉ V`. By our assumption `hf`, this is
finite. -/
use (tendsto_def.mp hf V V.mem_nhds_one).toFinset
/- For any `t : Finset α` disjoint from `s`, the product `∏ i ∈ t, f i` is a product of elements
of `V`, so it is an element of `V` too. Thus, `∏ i ∈ t, f i ∈ U`, as desired. -/
intro t ht
apply hV
apply Subgroup.prod_mem
intro i hi
simpa using Finset.disjoint_left.mp ht hi
| 16 | 8,886,110.520508 | 2 | 2 | 1 | 2,232 |
import Mathlib.Geometry.Manifold.SmoothManifoldWithCorners
import Mathlib.Topology.Compactness.Paracompact
import Mathlib.Topology.Metrizable.Urysohn
#align_import geometry.manifold.metrizable from "leanprover-community/mathlib"@"d1bd9c5df2867c1cb463bc6364446d57bdd9f7f1"
open TopologicalSpace
| Mathlib/Geometry/Manifold/Metrizable.lean | 24 | 31 | theorem ManifoldWithCorners.metrizableSpace {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[FiniteDimensional ℝ E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners ℝ E H)
(M : Type*) [TopologicalSpace M] [ChartedSpace H M] [SigmaCompactSpace M] [T2Space M] :
MetrizableSpace M := by |
haveI := I.locallyCompactSpace; haveI := ChartedSpace.locallyCompactSpace H M
haveI := I.secondCountableTopology
haveI := ChartedSpace.secondCountable_of_sigma_compact H M
exact metrizableSpace_of_t3_second_countable M
| 4 | 54.59815 | 2 | 2 | 1 | 2,233 |
import Mathlib.Order.CompleteLattice
import Mathlib.Data.Finset.Lattice
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks
import Mathlib.CategoryTheory.Category.Preorder
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits
#align_import category_theory.limits.lattice from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
universe w u
open CategoryTheory
open CategoryTheory.Limits
namespace CategoryTheory.Limits.CompleteLattice
section Semilattice
variable {α : Type u}
variable {J : Type w} [SmallCategory J] [FinCategory J]
def finiteLimitCone [SemilatticeInf α] [OrderTop α] (F : J ⥤ α) : LimitCone F where
cone :=
{ pt := Finset.univ.inf F.obj
π := { app := fun j => homOfLE (Finset.inf_le (Fintype.complete _)) } }
isLimit := { lift := fun s => homOfLE (Finset.le_inf fun j _ => (s.π.app j).down.down) }
#align category_theory.limits.complete_lattice.finite_limit_cone CategoryTheory.Limits.CompleteLattice.finiteLimitCone
def finiteColimitCocone [SemilatticeSup α] [OrderBot α] (F : J ⥤ α) : ColimitCocone F where
cocone :=
{ pt := Finset.univ.sup F.obj
ι := { app := fun i => homOfLE (Finset.le_sup (Fintype.complete _)) } }
isColimit := { desc := fun s => homOfLE (Finset.sup_le fun j _ => (s.ι.app j).down.down) }
#align category_theory.limits.complete_lattice.finite_colimit_cocone CategoryTheory.Limits.CompleteLattice.finiteColimitCocone
-- see Note [lower instance priority]
instance (priority := 100) hasFiniteLimits_of_semilatticeInf_orderTop [SemilatticeInf α]
[OrderTop α] : HasFiniteLimits α := ⟨by
intro J 𝒥₁ 𝒥₂
exact { has_limit := fun F => HasLimit.mk (finiteLimitCone F) }⟩
#align category_theory.limits.complete_lattice.has_finite_limits_of_semilattice_inf_order_top CategoryTheory.Limits.CompleteLattice.hasFiniteLimits_of_semilatticeInf_orderTop
-- see Note [lower instance priority]
instance (priority := 100) hasFiniteColimits_of_semilatticeSup_orderBot [SemilatticeSup α]
[OrderBot α] : HasFiniteColimits α := ⟨by
intro J 𝒥₁ 𝒥₂
exact { has_colimit := fun F => HasColimit.mk (finiteColimitCocone F) }⟩
#align category_theory.limits.complete_lattice.has_finite_colimits_of_semilattice_sup_order_bot CategoryTheory.Limits.CompleteLattice.hasFiniteColimits_of_semilatticeSup_orderBot
theorem finite_limit_eq_finset_univ_inf [SemilatticeInf α] [OrderTop α] (F : J ⥤ α) :
limit F = Finset.univ.inf F.obj :=
(IsLimit.conePointUniqueUpToIso (limit.isLimit F) (finiteLimitCone F).isLimit).to_eq
#align category_theory.limits.complete_lattice.finite_limit_eq_finset_univ_inf CategoryTheory.Limits.CompleteLattice.finite_limit_eq_finset_univ_inf
theorem finite_colimit_eq_finset_univ_sup [SemilatticeSup α] [OrderBot α] (F : J ⥤ α) :
colimit F = Finset.univ.sup F.obj :=
(IsColimit.coconePointUniqueUpToIso (colimit.isColimit F) (finiteColimitCocone F).isColimit).to_eq
#align category_theory.limits.complete_lattice.finite_colimit_eq_finset_univ_sup CategoryTheory.Limits.CompleteLattice.finite_colimit_eq_finset_univ_sup
| Mathlib/CategoryTheory/Limits/Lattice.lean | 85 | 93 | theorem finite_product_eq_finset_inf [SemilatticeInf α] [OrderTop α] {ι : Type u} [Fintype ι]
(f : ι → α) : ∏ᶜ f = Fintype.elems.inf f := by |
trans
· exact
(IsLimit.conePointUniqueUpToIso (limit.isLimit _)
(finiteLimitCone (Discrete.functor f)).isLimit).to_eq
change Finset.univ.inf (f ∘ discreteEquiv.toEmbedding) = Fintype.elems.inf f
simp only [← Finset.inf_map, Finset.univ_map_equiv_to_embedding]
rfl
| 7 | 1,096.633158 | 2 | 2 | 3 | 2,234 |
import Mathlib.Order.CompleteLattice
import Mathlib.Data.Finset.Lattice
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks
import Mathlib.CategoryTheory.Category.Preorder
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits
#align_import category_theory.limits.lattice from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
universe w u
open CategoryTheory
open CategoryTheory.Limits
namespace CategoryTheory.Limits.CompleteLattice
section Semilattice
variable {α : Type u}
variable {J : Type w} [SmallCategory J] [FinCategory J]
def finiteLimitCone [SemilatticeInf α] [OrderTop α] (F : J ⥤ α) : LimitCone F where
cone :=
{ pt := Finset.univ.inf F.obj
π := { app := fun j => homOfLE (Finset.inf_le (Fintype.complete _)) } }
isLimit := { lift := fun s => homOfLE (Finset.le_inf fun j _ => (s.π.app j).down.down) }
#align category_theory.limits.complete_lattice.finite_limit_cone CategoryTheory.Limits.CompleteLattice.finiteLimitCone
def finiteColimitCocone [SemilatticeSup α] [OrderBot α] (F : J ⥤ α) : ColimitCocone F where
cocone :=
{ pt := Finset.univ.sup F.obj
ι := { app := fun i => homOfLE (Finset.le_sup (Fintype.complete _)) } }
isColimit := { desc := fun s => homOfLE (Finset.sup_le fun j _ => (s.ι.app j).down.down) }
#align category_theory.limits.complete_lattice.finite_colimit_cocone CategoryTheory.Limits.CompleteLattice.finiteColimitCocone
-- see Note [lower instance priority]
instance (priority := 100) hasFiniteLimits_of_semilatticeInf_orderTop [SemilatticeInf α]
[OrderTop α] : HasFiniteLimits α := ⟨by
intro J 𝒥₁ 𝒥₂
exact { has_limit := fun F => HasLimit.mk (finiteLimitCone F) }⟩
#align category_theory.limits.complete_lattice.has_finite_limits_of_semilattice_inf_order_top CategoryTheory.Limits.CompleteLattice.hasFiniteLimits_of_semilatticeInf_orderTop
-- see Note [lower instance priority]
instance (priority := 100) hasFiniteColimits_of_semilatticeSup_orderBot [SemilatticeSup α]
[OrderBot α] : HasFiniteColimits α := ⟨by
intro J 𝒥₁ 𝒥₂
exact { has_colimit := fun F => HasColimit.mk (finiteColimitCocone F) }⟩
#align category_theory.limits.complete_lattice.has_finite_colimits_of_semilattice_sup_order_bot CategoryTheory.Limits.CompleteLattice.hasFiniteColimits_of_semilatticeSup_orderBot
theorem finite_limit_eq_finset_univ_inf [SemilatticeInf α] [OrderTop α] (F : J ⥤ α) :
limit F = Finset.univ.inf F.obj :=
(IsLimit.conePointUniqueUpToIso (limit.isLimit F) (finiteLimitCone F).isLimit).to_eq
#align category_theory.limits.complete_lattice.finite_limit_eq_finset_univ_inf CategoryTheory.Limits.CompleteLattice.finite_limit_eq_finset_univ_inf
theorem finite_colimit_eq_finset_univ_sup [SemilatticeSup α] [OrderBot α] (F : J ⥤ α) :
colimit F = Finset.univ.sup F.obj :=
(IsColimit.coconePointUniqueUpToIso (colimit.isColimit F) (finiteColimitCocone F).isColimit).to_eq
#align category_theory.limits.complete_lattice.finite_colimit_eq_finset_univ_sup CategoryTheory.Limits.CompleteLattice.finite_colimit_eq_finset_univ_sup
theorem finite_product_eq_finset_inf [SemilatticeInf α] [OrderTop α] {ι : Type u} [Fintype ι]
(f : ι → α) : ∏ᶜ f = Fintype.elems.inf f := by
trans
· exact
(IsLimit.conePointUniqueUpToIso (limit.isLimit _)
(finiteLimitCone (Discrete.functor f)).isLimit).to_eq
change Finset.univ.inf (f ∘ discreteEquiv.toEmbedding) = Fintype.elems.inf f
simp only [← Finset.inf_map, Finset.univ_map_equiv_to_embedding]
rfl
#align category_theory.limits.complete_lattice.finite_product_eq_finset_inf CategoryTheory.Limits.CompleteLattice.finite_product_eq_finset_inf
| Mathlib/CategoryTheory/Limits/Lattice.lean | 99 | 107 | theorem finite_coproduct_eq_finset_sup [SemilatticeSup α] [OrderBot α] {ι : Type u} [Fintype ι]
(f : ι → α) : ∐ f = Fintype.elems.sup f := by |
trans
· exact
(IsColimit.coconePointUniqueUpToIso (colimit.isColimit _)
(finiteColimitCocone (Discrete.functor f)).isColimit).to_eq
change Finset.univ.sup (f ∘ discreteEquiv.toEmbedding) = Fintype.elems.sup f
simp only [← Finset.sup_map, Finset.univ_map_equiv_to_embedding]
rfl
| 7 | 1,096.633158 | 2 | 2 | 3 | 2,234 |
import Mathlib.Order.CompleteLattice
import Mathlib.Data.Finset.Lattice
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks
import Mathlib.CategoryTheory.Category.Preorder
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits
#align_import category_theory.limits.lattice from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
universe w u
open CategoryTheory
open CategoryTheory.Limits
namespace CategoryTheory.Limits.CompleteLattice
section Semilattice
variable {α : Type u}
variable {J : Type w} [SmallCategory J] [FinCategory J]
def finiteLimitCone [SemilatticeInf α] [OrderTop α] (F : J ⥤ α) : LimitCone F where
cone :=
{ pt := Finset.univ.inf F.obj
π := { app := fun j => homOfLE (Finset.inf_le (Fintype.complete _)) } }
isLimit := { lift := fun s => homOfLE (Finset.le_inf fun j _ => (s.π.app j).down.down) }
#align category_theory.limits.complete_lattice.finite_limit_cone CategoryTheory.Limits.CompleteLattice.finiteLimitCone
def finiteColimitCocone [SemilatticeSup α] [OrderBot α] (F : J ⥤ α) : ColimitCocone F where
cocone :=
{ pt := Finset.univ.sup F.obj
ι := { app := fun i => homOfLE (Finset.le_sup (Fintype.complete _)) } }
isColimit := { desc := fun s => homOfLE (Finset.sup_le fun j _ => (s.ι.app j).down.down) }
#align category_theory.limits.complete_lattice.finite_colimit_cocone CategoryTheory.Limits.CompleteLattice.finiteColimitCocone
-- see Note [lower instance priority]
instance (priority := 100) hasFiniteLimits_of_semilatticeInf_orderTop [SemilatticeInf α]
[OrderTop α] : HasFiniteLimits α := ⟨by
intro J 𝒥₁ 𝒥₂
exact { has_limit := fun F => HasLimit.mk (finiteLimitCone F) }⟩
#align category_theory.limits.complete_lattice.has_finite_limits_of_semilattice_inf_order_top CategoryTheory.Limits.CompleteLattice.hasFiniteLimits_of_semilatticeInf_orderTop
-- see Note [lower instance priority]
instance (priority := 100) hasFiniteColimits_of_semilatticeSup_orderBot [SemilatticeSup α]
[OrderBot α] : HasFiniteColimits α := ⟨by
intro J 𝒥₁ 𝒥₂
exact { has_colimit := fun F => HasColimit.mk (finiteColimitCocone F) }⟩
#align category_theory.limits.complete_lattice.has_finite_colimits_of_semilattice_sup_order_bot CategoryTheory.Limits.CompleteLattice.hasFiniteColimits_of_semilatticeSup_orderBot
theorem finite_limit_eq_finset_univ_inf [SemilatticeInf α] [OrderTop α] (F : J ⥤ α) :
limit F = Finset.univ.inf F.obj :=
(IsLimit.conePointUniqueUpToIso (limit.isLimit F) (finiteLimitCone F).isLimit).to_eq
#align category_theory.limits.complete_lattice.finite_limit_eq_finset_univ_inf CategoryTheory.Limits.CompleteLattice.finite_limit_eq_finset_univ_inf
theorem finite_colimit_eq_finset_univ_sup [SemilatticeSup α] [OrderBot α] (F : J ⥤ α) :
colimit F = Finset.univ.sup F.obj :=
(IsColimit.coconePointUniqueUpToIso (colimit.isColimit F) (finiteColimitCocone F).isColimit).to_eq
#align category_theory.limits.complete_lattice.finite_colimit_eq_finset_univ_sup CategoryTheory.Limits.CompleteLattice.finite_colimit_eq_finset_univ_sup
theorem finite_product_eq_finset_inf [SemilatticeInf α] [OrderTop α] {ι : Type u} [Fintype ι]
(f : ι → α) : ∏ᶜ f = Fintype.elems.inf f := by
trans
· exact
(IsLimit.conePointUniqueUpToIso (limit.isLimit _)
(finiteLimitCone (Discrete.functor f)).isLimit).to_eq
change Finset.univ.inf (f ∘ discreteEquiv.toEmbedding) = Fintype.elems.inf f
simp only [← Finset.inf_map, Finset.univ_map_equiv_to_embedding]
rfl
#align category_theory.limits.complete_lattice.finite_product_eq_finset_inf CategoryTheory.Limits.CompleteLattice.finite_product_eq_finset_inf
theorem finite_coproduct_eq_finset_sup [SemilatticeSup α] [OrderBot α] {ι : Type u} [Fintype ι]
(f : ι → α) : ∐ f = Fintype.elems.sup f := by
trans
· exact
(IsColimit.coconePointUniqueUpToIso (colimit.isColimit _)
(finiteColimitCocone (Discrete.functor f)).isColimit).to_eq
change Finset.univ.sup (f ∘ discreteEquiv.toEmbedding) = Fintype.elems.sup f
simp only [← Finset.sup_map, Finset.univ_map_equiv_to_embedding]
rfl
#align category_theory.limits.complete_lattice.finite_coproduct_eq_finset_sup CategoryTheory.Limits.CompleteLattice.finite_coproduct_eq_finset_sup
set_option backward.synthInstance.canonInstances false in -- See https://github.com/leanprover-community/mathlib4/issues/12532
-- see Note [lower instance priority]
instance (priority := 100) [SemilatticeInf α] [OrderTop α] : HasBinaryProducts α := by
have : ∀ x y : α, HasLimit (pair x y) := by
letI := hasFiniteLimits_of_hasFiniteLimits_of_size.{u} α
infer_instance
apply hasBinaryProducts_of_hasLimit_pair
@[simp]
| Mathlib/CategoryTheory/Limits/Lattice.lean | 122 | 128 | theorem prod_eq_inf [SemilatticeInf α] [OrderTop α] (x y : α) : Limits.prod x y = x ⊓ y :=
calc
Limits.prod x y = limit (pair x y) := rfl
_ = Finset.univ.inf (pair x y).obj := by | rw [finite_limit_eq_finset_univ_inf (pair.{u} x y)]
_ = x ⊓ (y ⊓ ⊤) := rfl
-- Note: finset.inf is realized as a fold, hence the definitional equality
_ = x ⊓ y := by rw [inf_top_eq]
| 4 | 54.59815 | 2 | 2 | 3 | 2,234 |
import Mathlib.Topology.PartitionOfUnity
import Mathlib.Analysis.Convex.Combination
#align_import analysis.convex.partition_of_unity from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Set Function
open Topology
variable {ι X E : Type*} [TopologicalSpace X] [AddCommGroup E] [Module ℝ E]
theorem PartitionOfUnity.finsum_smul_mem_convex {s : Set X} (f : PartitionOfUnity ι X s)
{g : ι → X → E} {t : Set E} {x : X} (hx : x ∈ s) (hg : ∀ i, f i x ≠ 0 → g i x ∈ t)
(ht : Convex ℝ t) : (∑ᶠ i, f i x • g i x) ∈ t :=
ht.finsum_mem (fun _ => f.nonneg _ _) (f.sum_eq_one hx) hg
#align partition_of_unity.finsum_smul_mem_convex PartitionOfUnity.finsum_smul_mem_convex
variable [NormalSpace X] [ParacompactSpace X] [TopologicalSpace E] [ContinuousAdd E]
[ContinuousSMul ℝ E] {t : X → Set E}
| Mathlib/Analysis/Convex/PartitionOfUnity.lean | 51 | 60 | theorem exists_continuous_forall_mem_convex_of_local (ht : ∀ x, Convex ℝ (t x))
(H : ∀ x : X, ∃ U ∈ 𝓝 x, ∃ g : X → E, ContinuousOn g U ∧ ∀ y ∈ U, g y ∈ t y) :
∃ g : C(X, E), ∀ x, g x ∈ t x := by |
choose U hU g hgc hgt using H
obtain ⟨f, hf⟩ := PartitionOfUnity.exists_isSubordinate isClosed_univ (fun x => interior (U x))
(fun x => isOpen_interior) fun x _ => mem_iUnion.2 ⟨x, mem_interior_iff_mem_nhds.2 (hU x)⟩
refine ⟨⟨fun x => ∑ᶠ i, f i x • g i x,
hf.continuous_finsum_smul (fun i => isOpen_interior) fun i => (hgc i).mono interior_subset⟩,
fun x => f.finsum_smul_mem_convex (mem_univ x) (fun i hi => hgt _ _ ?_) (ht _)⟩
exact interior_subset (hf _ <| subset_closure hi)
| 7 | 1,096.633158 | 2 | 2 | 1 | 2,235 |
import Mathlib.Analysis.Analytic.Basic
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal
#align_import analysis.analytic.radius_liminf from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8"
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E]
[NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
open scoped Topology Classical NNReal ENNReal
open Filter Asymptotics
namespace FormalMultilinearSeries
variable (p : FormalMultilinearSeries 𝕜 E F)
| Mathlib/Analysis/Analytic/RadiusLiminf.lean | 35 | 61 | theorem radius_eq_liminf :
p.radius = liminf (fun n => (1 / (‖p n‖₊ ^ (1 / (n : ℝ)) : ℝ≥0) : ℝ≥0∞)) atTop := by |
-- Porting note: added type ascription to make elaborated statement match Lean 3 version
have :
∀ (r : ℝ≥0) {n : ℕ},
0 < n → ((r : ℝ≥0∞) ≤ 1 / ↑(‖p n‖₊ ^ (1 / (n : ℝ))) ↔ ‖p n‖₊ * r ^ n ≤ 1) := by
intro r n hn
have : 0 < (n : ℝ) := Nat.cast_pos.2 hn
conv_lhs =>
rw [one_div, ENNReal.le_inv_iff_mul_le, ← ENNReal.coe_mul, ENNReal.coe_le_one_iff, one_div, ←
NNReal.rpow_one r, ← mul_inv_cancel this.ne', NNReal.rpow_mul, ← NNReal.mul_rpow, ←
NNReal.one_rpow n⁻¹, NNReal.rpow_le_rpow_iff (inv_pos.2 this), mul_comm,
NNReal.rpow_natCast]
apply le_antisymm <;> refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
· have := ((TFAE_exists_lt_isLittleO_pow (fun n => ‖p n‖ * r ^ n) 1).out 1 7).1
(p.isLittleO_of_lt_radius hr)
obtain ⟨a, ha, H⟩ := this
apply le_liminf_of_le
· infer_param
· rw [← eventually_map]
refine
H.mp ((eventually_gt_atTop 0).mono fun n hn₀ hn => (this _ hn₀).2 (NNReal.coe_le_coe.1 ?_))
push_cast
exact (le_abs_self _).trans (hn.trans (pow_le_one _ ha.1.le ha.2.le))
· refine p.le_radius_of_isBigO (IsBigO.of_bound 1 ?_)
refine (eventually_lt_of_lt_liminf hr).mp ((eventually_gt_atTop 0).mono fun n hn₀ hn => ?_)
simpa using NNReal.coe_le_coe.2 ((this _ hn₀).1 hn.le)
| 25 | 72,004,899,337.38586 | 2 | 2 | 1 | 2,236 |
import Mathlib.Algebra.Polynomial.Coeff
import Mathlib.Data.Nat.Choose.Basic
#align_import data.nat.choose.vandermonde from "leanprover-community/mathlib"@"d6814c584384ddf2825ff038e868451a7c956f31"
open Polynomial Finset Finset.Nat
| Mathlib/Data/Nat/Choose/Vandermonde.lean | 27 | 34 | theorem Nat.add_choose_eq (m n k : ℕ) :
(m + n).choose k = ∑ ij ∈ antidiagonal k, m.choose ij.1 * n.choose ij.2 := by |
calc
(m + n).choose k = ((X + 1) ^ (m + n)).coeff k := by rw [coeff_X_add_one_pow, Nat.cast_id]
_ = ((X + 1) ^ m * (X + 1) ^ n).coeff k := by rw [pow_add]
_ = ∑ ij ∈ antidiagonal k, m.choose ij.1 * n.choose ij.2 := by
rw [coeff_mul, Finset.sum_congr rfl]
simp only [coeff_X_add_one_pow, Nat.cast_id, eq_self_iff_true, imp_true_iff]
| 6 | 403.428793 | 2 | 2 | 1 | 2,237 |
import Mathlib.CategoryTheory.ConcreteCategory.BundledHom
import Mathlib.Topology.ContinuousFunction.Basic
#align_import topology.category.Top.basic from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
open CategoryTheory
open TopologicalSpace
universe u
@[to_additive existing TopCat]
def TopCat : Type (u + 1) :=
Bundled TopologicalSpace
set_option linter.uppercaseLean3 false in
#align Top TopCat
namespace TopCat
instance bundledHom : BundledHom @ContinuousMap where
toFun := @ContinuousMap.toFun
id := @ContinuousMap.id
comp := @ContinuousMap.comp
set_option linter.uppercaseLean3 false in
#align Top.bundled_hom TopCat.bundledHom
deriving instance LargeCategory for TopCat
-- Porting note: currently no derive handler for ConcreteCategory
-- see https://github.com/leanprover-community/mathlib4/issues/5020
instance concreteCategory : ConcreteCategory TopCat :=
inferInstanceAs <| ConcreteCategory (Bundled TopologicalSpace)
instance : CoeSort TopCat Type* where
coe X := X.α
instance topologicalSpaceUnbundled (X : TopCat) : TopologicalSpace X :=
X.str
set_option linter.uppercaseLean3 false in
#align Top.topological_space_unbundled TopCat.topologicalSpaceUnbundled
-- We leave this temporarily as a reminder of the downstream instances #13170
-- -- Porting note: cannot find a coercion to function otherwise
-- -- attribute [instance] ConcreteCategory.instFunLike in
-- instance (X Y : TopCat.{u}) : CoeFun (X ⟶ Y) fun _ => X → Y where
-- coe (f : C(X, Y)) := f
instance instFunLike (X Y : TopCat) : FunLike (X ⟶ Y) X Y :=
inferInstanceAs <| FunLike C(X, Y) X Y
instance instMonoidHomClass (X Y : TopCat) : ContinuousMapClass (X ⟶ Y) X Y :=
inferInstanceAs <| ContinuousMapClass C(X, Y) X Y
-- Porting note (#10618): simp can prove this; removed simp
theorem id_app (X : TopCat.{u}) (x : ↑X) : (𝟙 X : X ⟶ X) x = x := rfl
set_option linter.uppercaseLean3 false in
#align Top.id_app TopCat.id_app
-- Porting note (#10618): simp can prove this; removed simp
theorem comp_app {X Y Z : TopCat.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) :
(f ≫ g : X → Z) x = g (f x) := rfl
set_option linter.uppercaseLean3 false in
#align Top.comp_app TopCat.comp_app
@[simp] theorem coe_id (X : TopCat.{u}) : (𝟙 X : X → X) = id := rfl
@[simp] theorem coe_comp {X Y Z : TopCat.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) :
(f ≫ g : X → Z) = g ∘ f := rfl
@[simp]
lemma hom_inv_id_apply {X Y : TopCat} (f : X ≅ Y) (x : X) : f.inv (f.hom x) = x :=
DFunLike.congr_fun f.hom_inv_id x
@[simp]
lemma inv_hom_id_apply {X Y : TopCat} (f : X ≅ Y) (y : Y) : f.hom (f.inv y) = y :=
DFunLike.congr_fun f.inv_hom_id y
def of (X : Type u) [TopologicalSpace X] : TopCat :=
-- Porting note: needed to call inferInstance
⟨X, inferInstance⟩
set_option linter.uppercaseLean3 false in
#align Top.of TopCat.of
instance topologicalSpace_coe (X : TopCat) : TopologicalSpace X :=
X.str
-- Porting note: cannot see through forget; made reducible to get closer to Lean 3 behavior
@[instance] abbrev topologicalSpace_forget
(X : TopCat) : TopologicalSpace <| (forget TopCat).obj X :=
X.str
@[simp]
theorem coe_of (X : Type u) [TopologicalSpace X] : (of X : Type u) = X := rfl
set_option linter.uppercaseLean3 false in
#align Top.coe_of TopCat.coe_of
@[simp] theorem coe_of_of {X Y : Type u} [TopologicalSpace X] [TopologicalSpace Y]
{f : C(X, Y)} {x} :
@DFunLike.coe (TopCat.of X ⟶ TopCat.of Y) ((CategoryTheory.forget TopCat).obj (TopCat.of X))
(fun _ ↦ (CategoryTheory.forget TopCat).obj (TopCat.of Y)) ConcreteCategory.instFunLike
f x =
@DFunLike.coe C(X, Y) X
(fun _ ↦ Y) _
f x :=
rfl
instance inhabited : Inhabited TopCat :=
⟨TopCat.of Empty⟩
-- Porting note: added to ease the port of `AlgebraicTopology.TopologicalSimplex`
lemma hom_apply {X Y : TopCat} (f : X ⟶ Y) (x : X) : f x = ContinuousMap.toFun f x := rfl
def discrete : Type u ⥤ TopCat.{u} where
obj X := ⟨X , ⊥⟩
map f := @ContinuousMap.mk _ _ ⊥ ⊥ f continuous_bot
set_option linter.uppercaseLean3 false in
#align Top.discrete TopCat.discrete
instance {X : Type u} : DiscreteTopology (discrete.obj X) :=
⟨rfl⟩
def trivial : Type u ⥤ TopCat.{u} where
obj X := ⟨X, ⊤⟩
map f := @ContinuousMap.mk _ _ ⊤ ⊤ f continuous_top
set_option linter.uppercaseLean3 false in
#align Top.trivial TopCat.trivial
@[simps]
def isoOfHomeo {X Y : TopCat.{u}} (f : X ≃ₜ Y) : X ≅ Y where
-- Porting note: previously ⟨f⟩ for hom (inv) and tidy closed proofs
hom := f.toContinuousMap
inv := f.symm.toContinuousMap
hom_inv_id := by ext; exact f.symm_apply_apply _
inv_hom_id := by ext; exact f.apply_symm_apply _
set_option linter.uppercaseLean3 false in
#align Top.iso_of_homeo TopCat.isoOfHomeo
@[simps]
def homeoOfIso {X Y : TopCat.{u}} (f : X ≅ Y) : X ≃ₜ Y where
toFun := f.hom
invFun := f.inv
left_inv x := by simp
right_inv x := by simp
continuous_toFun := f.hom.continuous
continuous_invFun := f.inv.continuous
set_option linter.uppercaseLean3 false in
#align Top.homeo_of_iso TopCat.homeoOfIso
@[simp]
| Mathlib/Topology/Category/TopCat/Basic.lean | 175 | 179 | theorem of_isoOfHomeo {X Y : TopCat.{u}} (f : X ≃ₜ Y) : homeoOfIso (isoOfHomeo f) = f := by |
-- Porting note: unfold some defs now
dsimp [homeoOfIso, isoOfHomeo]
ext
rfl
| 4 | 54.59815 | 2 | 2 | 1 | 2,238 |
import Mathlib.Topology.Constructions
import Mathlib.Topology.Algebra.Monoid
import Mathlib.Order.Filter.ListTraverse
import Mathlib.Tactic.AdaptationNote
#align_import topology.list from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded"
open TopologicalSpace Set Filter
open Topology Filter
variable {α : Type*} {β : Type*} [TopologicalSpace α] [TopologicalSpace β]
instance : TopologicalSpace (List α) :=
TopologicalSpace.mkOfNhds (traverse nhds)
| Mathlib/Topology/List.lean | 28 | 66 | theorem nhds_list (as : List α) : 𝓝 as = traverse 𝓝 as := by |
refine nhds_mkOfNhds _ _ ?_ ?_
· intro l
induction l with
| nil => exact le_rfl
| cons a l ih =>
suffices List.cons <$> pure a <*> pure l ≤ List.cons <$> 𝓝 a <*> traverse 𝓝 l by
simpa only [functor_norm] using this
exact Filter.seq_mono (Filter.map_mono <| pure_le_nhds a) ih
· intro l s hs
rcases (mem_traverse_iff _ _).1 hs with ⟨u, hu, hus⟩
clear as hs
have : ∃ v : List (Set α), l.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) v ∧ sequence v ⊆ s := by
induction hu generalizing s with
| nil =>
exists []
simp only [List.forall₂_nil_left_iff, exists_eq_left]
exact ⟨trivial, hus⟩
-- porting note -- renamed reordered variables based on previous types
| cons ht _ ih =>
rcases mem_nhds_iff.1 ht with ⟨u, hut, hu⟩
rcases ih _ Subset.rfl with ⟨v, hv, hvss⟩
exact
⟨u::v, List.Forall₂.cons hu hv,
Subset.trans (Set.seq_mono (Set.image_subset _ hut) hvss) hus⟩
rcases this with ⟨v, hv, hvs⟩
have : sequence v ∈ traverse 𝓝 l :=
mem_traverse _ _ <| hv.imp fun a s ⟨hs, ha⟩ => IsOpen.mem_nhds hs ha
refine mem_of_superset this fun u hu ↦ ?_
have hu := (List.mem_traverse _ _).1 hu
have : List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) u v := by
refine List.Forall₂.flip ?_
replace hv := hv.flip
#adaptation_note /-- nightly-2024-03-16: simp was
simp only [List.forall₂_and_left, flip] at hv ⊢ -/
simp only [List.forall₂_and_left, Function.flip_def] at hv ⊢
exact ⟨hv.1, hu.flip⟩
refine mem_of_superset ?_ hvs
exact mem_traverse _ _ (this.imp fun a s ⟨hs, ha⟩ => IsOpen.mem_nhds hs ha)
| 38 | 31,855,931,757,113,756 | 2 | 2 | 1 | 2,239 |
import Mathlib.RingTheory.RootsOfUnity.Basic
import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed
import Mathlib.Algebra.GCDMonoid.IntegrallyClosed
import Mathlib.FieldTheory.Finite.Basic
#align_import ring_theory.roots_of_unity.minpoly from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f"
open minpoly Polynomial
open scoped Polynomial
namespace IsPrimitiveRoot
section CommRing
variable {n : ℕ} {K : Type*} [CommRing K] {μ : K} (h : IsPrimitiveRoot μ n)
-- Porting note: `hpos` was in the `variable` line, with an `omit` in mathlib3 just after this
-- declaration. For some reason, in Lean4, `hpos` gets included also in the declarations below,
-- even if it is not used in the proof.
| Mathlib/RingTheory/RootsOfUnity/Minpoly.lean | 40 | 45 | theorem isIntegral (hpos : 0 < n) : IsIntegral ℤ μ := by |
use X ^ n - 1
constructor
· exact monic_X_pow_sub_C 1 (ne_of_lt hpos).symm
· simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, eval₂_one, eval₂_X_pow, eval₂_sub,
sub_self]
| 5 | 148.413159 | 2 | 2 | 6 | 2,240 |
import Mathlib.RingTheory.RootsOfUnity.Basic
import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed
import Mathlib.Algebra.GCDMonoid.IntegrallyClosed
import Mathlib.FieldTheory.Finite.Basic
#align_import ring_theory.roots_of_unity.minpoly from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f"
open minpoly Polynomial
open scoped Polynomial
namespace IsPrimitiveRoot
section CommRing
variable {n : ℕ} {K : Type*} [CommRing K] {μ : K} (h : IsPrimitiveRoot μ n)
-- Porting note: `hpos` was in the `variable` line, with an `omit` in mathlib3 just after this
-- declaration. For some reason, in Lean4, `hpos` gets included also in the declarations below,
-- even if it is not used in the proof.
theorem isIntegral (hpos : 0 < n) : IsIntegral ℤ μ := by
use X ^ n - 1
constructor
· exact monic_X_pow_sub_C 1 (ne_of_lt hpos).symm
· simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, eval₂_one, eval₂_X_pow, eval₂_sub,
sub_self]
#align is_primitive_root.is_integral IsPrimitiveRoot.isIntegral
section IsDomain
variable [IsDomain K] [CharZero K]
| Mathlib/RingTheory/RootsOfUnity/Minpoly.lean | 53 | 58 | theorem minpoly_dvd_x_pow_sub_one : minpoly ℤ μ ∣ X ^ n - 1 := by |
rcases n.eq_zero_or_pos with (rfl | h0)
· simp
apply minpoly.isIntegrallyClosed_dvd (isIntegral h h0)
simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, aeval_X_pow, eq_intCast, Int.cast_one,
aeval_one, AlgHom.map_sub, sub_self]
| 5 | 148.413159 | 2 | 2 | 6 | 2,240 |
import Mathlib.RingTheory.RootsOfUnity.Basic
import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed
import Mathlib.Algebra.GCDMonoid.IntegrallyClosed
import Mathlib.FieldTheory.Finite.Basic
#align_import ring_theory.roots_of_unity.minpoly from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f"
open minpoly Polynomial
open scoped Polynomial
namespace IsPrimitiveRoot
section CommRing
variable {n : ℕ} {K : Type*} [CommRing K] {μ : K} (h : IsPrimitiveRoot μ n)
-- Porting note: `hpos` was in the `variable` line, with an `omit` in mathlib3 just after this
-- declaration. For some reason, in Lean4, `hpos` gets included also in the declarations below,
-- even if it is not used in the proof.
theorem isIntegral (hpos : 0 < n) : IsIntegral ℤ μ := by
use X ^ n - 1
constructor
· exact monic_X_pow_sub_C 1 (ne_of_lt hpos).symm
· simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, eval₂_one, eval₂_X_pow, eval₂_sub,
sub_self]
#align is_primitive_root.is_integral IsPrimitiveRoot.isIntegral
section IsDomain
variable [IsDomain K] [CharZero K]
theorem minpoly_dvd_x_pow_sub_one : minpoly ℤ μ ∣ X ^ n - 1 := by
rcases n.eq_zero_or_pos with (rfl | h0)
· simp
apply minpoly.isIntegrallyClosed_dvd (isIntegral h h0)
simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, aeval_X_pow, eq_intCast, Int.cast_one,
aeval_one, AlgHom.map_sub, sub_self]
set_option linter.uppercaseLean3 false in
#align is_primitive_root.minpoly_dvd_X_pow_sub_one IsPrimitiveRoot.minpoly_dvd_x_pow_sub_one
| Mathlib/RingTheory/RootsOfUnity/Minpoly.lean | 63 | 71 | theorem separable_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) :
Separable (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) := by |
have hdvd : map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣ X ^ n - 1 := by
convert RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p)))
(minpoly_dvd_x_pow_sub_one h)
simp only [map_sub, map_pow, coe_mapRingHom, map_X, map_one]
refine Separable.of_dvd (separable_X_pow_sub_C 1 ?_ one_ne_zero) hdvd
by_contra hzero
exact hdiv ((ZMod.natCast_zmod_eq_zero_iff_dvd n p).1 hzero)
| 7 | 1,096.633158 | 2 | 2 | 6 | 2,240 |
import Mathlib.RingTheory.RootsOfUnity.Basic
import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed
import Mathlib.Algebra.GCDMonoid.IntegrallyClosed
import Mathlib.FieldTheory.Finite.Basic
#align_import ring_theory.roots_of_unity.minpoly from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f"
open minpoly Polynomial
open scoped Polynomial
namespace IsPrimitiveRoot
section CommRing
variable {n : ℕ} {K : Type*} [CommRing K] {μ : K} (h : IsPrimitiveRoot μ n)
-- Porting note: `hpos` was in the `variable` line, with an `omit` in mathlib3 just after this
-- declaration. For some reason, in Lean4, `hpos` gets included also in the declarations below,
-- even if it is not used in the proof.
theorem isIntegral (hpos : 0 < n) : IsIntegral ℤ μ := by
use X ^ n - 1
constructor
· exact monic_X_pow_sub_C 1 (ne_of_lt hpos).symm
· simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, eval₂_one, eval₂_X_pow, eval₂_sub,
sub_self]
#align is_primitive_root.is_integral IsPrimitiveRoot.isIntegral
section IsDomain
variable [IsDomain K] [CharZero K]
theorem minpoly_dvd_x_pow_sub_one : minpoly ℤ μ ∣ X ^ n - 1 := by
rcases n.eq_zero_or_pos with (rfl | h0)
· simp
apply minpoly.isIntegrallyClosed_dvd (isIntegral h h0)
simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, aeval_X_pow, eq_intCast, Int.cast_one,
aeval_one, AlgHom.map_sub, sub_self]
set_option linter.uppercaseLean3 false in
#align is_primitive_root.minpoly_dvd_X_pow_sub_one IsPrimitiveRoot.minpoly_dvd_x_pow_sub_one
theorem separable_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) :
Separable (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) := by
have hdvd : map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣ X ^ n - 1 := by
convert RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p)))
(minpoly_dvd_x_pow_sub_one h)
simp only [map_sub, map_pow, coe_mapRingHom, map_X, map_one]
refine Separable.of_dvd (separable_X_pow_sub_C 1 ?_ one_ne_zero) hdvd
by_contra hzero
exact hdiv ((ZMod.natCast_zmod_eq_zero_iff_dvd n p).1 hzero)
#align is_primitive_root.separable_minpoly_mod IsPrimitiveRoot.separable_minpoly_mod
theorem squarefree_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) :
Squarefree (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) :=
(separable_minpoly_mod h hdiv).squarefree
#align is_primitive_root.squarefree_minpoly_mod IsPrimitiveRoot.squarefree_minpoly_mod
| Mathlib/RingTheory/RootsOfUnity/Minpoly.lean | 82 | 90 | theorem minpoly_dvd_expand {p : ℕ} (hdiv : ¬p ∣ n) :
minpoly ℤ μ ∣ expand ℤ p (minpoly ℤ (μ ^ p)) := by |
rcases n.eq_zero_or_pos with (rfl | hpos)
· simp_all
letI : IsIntegrallyClosed ℤ := GCDMonoid.toIsIntegrallyClosed
refine minpoly.isIntegrallyClosed_dvd (h.isIntegral hpos) ?_
rw [aeval_def, coe_expand, ← comp, eval₂_eq_eval_map, map_comp, Polynomial.map_pow, map_X,
eval_comp, eval_pow, eval_X, ← eval₂_eq_eval_map, ← aeval_def]
exact minpoly.aeval _ _
| 7 | 1,096.633158 | 2 | 2 | 6 | 2,240 |
import Mathlib.RingTheory.RootsOfUnity.Basic
import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed
import Mathlib.Algebra.GCDMonoid.IntegrallyClosed
import Mathlib.FieldTheory.Finite.Basic
#align_import ring_theory.roots_of_unity.minpoly from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f"
open minpoly Polynomial
open scoped Polynomial
namespace IsPrimitiveRoot
section CommRing
variable {n : ℕ} {K : Type*} [CommRing K] {μ : K} (h : IsPrimitiveRoot μ n)
-- Porting note: `hpos` was in the `variable` line, with an `omit` in mathlib3 just after this
-- declaration. For some reason, in Lean4, `hpos` gets included also in the declarations below,
-- even if it is not used in the proof.
theorem isIntegral (hpos : 0 < n) : IsIntegral ℤ μ := by
use X ^ n - 1
constructor
· exact monic_X_pow_sub_C 1 (ne_of_lt hpos).symm
· simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, eval₂_one, eval₂_X_pow, eval₂_sub,
sub_self]
#align is_primitive_root.is_integral IsPrimitiveRoot.isIntegral
section IsDomain
variable [IsDomain K] [CharZero K]
theorem minpoly_dvd_x_pow_sub_one : minpoly ℤ μ ∣ X ^ n - 1 := by
rcases n.eq_zero_or_pos with (rfl | h0)
· simp
apply minpoly.isIntegrallyClosed_dvd (isIntegral h h0)
simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, aeval_X_pow, eq_intCast, Int.cast_one,
aeval_one, AlgHom.map_sub, sub_self]
set_option linter.uppercaseLean3 false in
#align is_primitive_root.minpoly_dvd_X_pow_sub_one IsPrimitiveRoot.minpoly_dvd_x_pow_sub_one
theorem separable_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) :
Separable (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) := by
have hdvd : map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣ X ^ n - 1 := by
convert RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p)))
(minpoly_dvd_x_pow_sub_one h)
simp only [map_sub, map_pow, coe_mapRingHom, map_X, map_one]
refine Separable.of_dvd (separable_X_pow_sub_C 1 ?_ one_ne_zero) hdvd
by_contra hzero
exact hdiv ((ZMod.natCast_zmod_eq_zero_iff_dvd n p).1 hzero)
#align is_primitive_root.separable_minpoly_mod IsPrimitiveRoot.separable_minpoly_mod
theorem squarefree_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) :
Squarefree (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) :=
(separable_minpoly_mod h hdiv).squarefree
#align is_primitive_root.squarefree_minpoly_mod IsPrimitiveRoot.squarefree_minpoly_mod
theorem minpoly_dvd_expand {p : ℕ} (hdiv : ¬p ∣ n) :
minpoly ℤ μ ∣ expand ℤ p (minpoly ℤ (μ ^ p)) := by
rcases n.eq_zero_or_pos with (rfl | hpos)
· simp_all
letI : IsIntegrallyClosed ℤ := GCDMonoid.toIsIntegrallyClosed
refine minpoly.isIntegrallyClosed_dvd (h.isIntegral hpos) ?_
rw [aeval_def, coe_expand, ← comp, eval₂_eq_eval_map, map_comp, Polynomial.map_pow, map_X,
eval_comp, eval_pow, eval_X, ← eval₂_eq_eval_map, ← aeval_def]
exact minpoly.aeval _ _
#align is_primitive_root.minpoly_dvd_expand IsPrimitiveRoot.minpoly_dvd_expand
| Mathlib/RingTheory/RootsOfUnity/Minpoly.lean | 95 | 104 | theorem minpoly_dvd_pow_mod {p : ℕ} [hprime : Fact p.Prime] (hdiv : ¬p ∣ n) :
map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣
map (Int.castRingHom (ZMod p)) (minpoly ℤ (μ ^ p)) ^ p := by |
set Q := minpoly ℤ (μ ^ p)
have hfrob :
map (Int.castRingHom (ZMod p)) Q ^ p = map (Int.castRingHom (ZMod p)) (expand ℤ p Q) := by
rw [← ZMod.expand_card, map_expand]
rw [hfrob]
apply RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p)))
exact minpoly_dvd_expand h hdiv
| 7 | 1,096.633158 | 2 | 2 | 6 | 2,240 |
import Mathlib.RingTheory.RootsOfUnity.Basic
import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed
import Mathlib.Algebra.GCDMonoid.IntegrallyClosed
import Mathlib.FieldTheory.Finite.Basic
#align_import ring_theory.roots_of_unity.minpoly from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f"
open minpoly Polynomial
open scoped Polynomial
namespace IsPrimitiveRoot
section CommRing
variable {n : ℕ} {K : Type*} [CommRing K] {μ : K} (h : IsPrimitiveRoot μ n)
-- Porting note: `hpos` was in the `variable` line, with an `omit` in mathlib3 just after this
-- declaration. For some reason, in Lean4, `hpos` gets included also in the declarations below,
-- even if it is not used in the proof.
theorem isIntegral (hpos : 0 < n) : IsIntegral ℤ μ := by
use X ^ n - 1
constructor
· exact monic_X_pow_sub_C 1 (ne_of_lt hpos).symm
· simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, eval₂_one, eval₂_X_pow, eval₂_sub,
sub_self]
#align is_primitive_root.is_integral IsPrimitiveRoot.isIntegral
section IsDomain
variable [IsDomain K] [CharZero K]
theorem minpoly_dvd_x_pow_sub_one : minpoly ℤ μ ∣ X ^ n - 1 := by
rcases n.eq_zero_or_pos with (rfl | h0)
· simp
apply minpoly.isIntegrallyClosed_dvd (isIntegral h h0)
simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, aeval_X_pow, eq_intCast, Int.cast_one,
aeval_one, AlgHom.map_sub, sub_self]
set_option linter.uppercaseLean3 false in
#align is_primitive_root.minpoly_dvd_X_pow_sub_one IsPrimitiveRoot.minpoly_dvd_x_pow_sub_one
theorem separable_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) :
Separable (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) := by
have hdvd : map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣ X ^ n - 1 := by
convert RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p)))
(minpoly_dvd_x_pow_sub_one h)
simp only [map_sub, map_pow, coe_mapRingHom, map_X, map_one]
refine Separable.of_dvd (separable_X_pow_sub_C 1 ?_ one_ne_zero) hdvd
by_contra hzero
exact hdiv ((ZMod.natCast_zmod_eq_zero_iff_dvd n p).1 hzero)
#align is_primitive_root.separable_minpoly_mod IsPrimitiveRoot.separable_minpoly_mod
theorem squarefree_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) :
Squarefree (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) :=
(separable_minpoly_mod h hdiv).squarefree
#align is_primitive_root.squarefree_minpoly_mod IsPrimitiveRoot.squarefree_minpoly_mod
theorem minpoly_dvd_expand {p : ℕ} (hdiv : ¬p ∣ n) :
minpoly ℤ μ ∣ expand ℤ p (minpoly ℤ (μ ^ p)) := by
rcases n.eq_zero_or_pos with (rfl | hpos)
· simp_all
letI : IsIntegrallyClosed ℤ := GCDMonoid.toIsIntegrallyClosed
refine minpoly.isIntegrallyClosed_dvd (h.isIntegral hpos) ?_
rw [aeval_def, coe_expand, ← comp, eval₂_eq_eval_map, map_comp, Polynomial.map_pow, map_X,
eval_comp, eval_pow, eval_X, ← eval₂_eq_eval_map, ← aeval_def]
exact minpoly.aeval _ _
#align is_primitive_root.minpoly_dvd_expand IsPrimitiveRoot.minpoly_dvd_expand
theorem minpoly_dvd_pow_mod {p : ℕ} [hprime : Fact p.Prime] (hdiv : ¬p ∣ n) :
map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣
map (Int.castRingHom (ZMod p)) (minpoly ℤ (μ ^ p)) ^ p := by
set Q := minpoly ℤ (μ ^ p)
have hfrob :
map (Int.castRingHom (ZMod p)) Q ^ p = map (Int.castRingHom (ZMod p)) (expand ℤ p Q) := by
rw [← ZMod.expand_card, map_expand]
rw [hfrob]
apply RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p)))
exact minpoly_dvd_expand h hdiv
#align is_primitive_root.minpoly_dvd_pow_mod IsPrimitiveRoot.minpoly_dvd_pow_mod
theorem minpoly_dvd_mod_p {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) :
map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣
map (Int.castRingHom (ZMod p)) (minpoly ℤ (μ ^ p)) :=
(squarefree_minpoly_mod h hdiv).isRadical _ _ (minpoly_dvd_pow_mod h hdiv)
#align is_primitive_root.minpoly_dvd_mod_p IsPrimitiveRoot.minpoly_dvd_mod_p
| Mathlib/RingTheory/RootsOfUnity/Minpoly.lean | 118 | 169 | theorem minpoly_eq_pow {p : ℕ} [hprime : Fact p.Prime] (hdiv : ¬p ∣ n) :
minpoly ℤ μ = minpoly ℤ (μ ^ p) := by |
classical
by_cases hn : n = 0
· simp_all
have hpos := Nat.pos_of_ne_zero hn
by_contra hdiff
set P := minpoly ℤ μ
set Q := minpoly ℤ (μ ^ p)
have Pmonic : P.Monic := minpoly.monic (h.isIntegral hpos)
have Qmonic : Q.Monic := minpoly.monic ((h.pow_of_prime hprime.1 hdiv).isIntegral hpos)
have Pirr : Irreducible P := minpoly.irreducible (h.isIntegral hpos)
have Qirr : Irreducible Q := minpoly.irreducible ((h.pow_of_prime hprime.1 hdiv).isIntegral hpos)
have PQprim : IsPrimitive (P * Q) := Pmonic.isPrimitive.mul Qmonic.isPrimitive
have prod : P * Q ∣ X ^ n - 1 := by
rw [IsPrimitive.Int.dvd_iff_map_cast_dvd_map_cast (P * Q) (X ^ n - 1) PQprim
(monic_X_pow_sub_C (1 : ℤ) (ne_of_gt hpos)).isPrimitive,
Polynomial.map_mul]
refine IsCoprime.mul_dvd ?_ ?_ ?_
· have aux := IsPrimitive.Int.irreducible_iff_irreducible_map_cast Pmonic.isPrimitive
refine (dvd_or_coprime _ _ (aux.1 Pirr)).resolve_left ?_
rw [map_dvd_map (Int.castRingHom ℚ) Int.cast_injective Pmonic]
intro hdiv
refine hdiff (eq_of_monic_of_associated Pmonic Qmonic ?_)
exact associated_of_dvd_dvd hdiv (Pirr.dvd_symm Qirr hdiv)
· apply (map_dvd_map (Int.castRingHom ℚ) Int.cast_injective Pmonic).2
exact minpoly_dvd_x_pow_sub_one h
· apply (map_dvd_map (Int.castRingHom ℚ) Int.cast_injective Qmonic).2
exact minpoly_dvd_x_pow_sub_one (pow_of_prime h hprime.1 hdiv)
replace prod := RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p))) prod
rw [coe_mapRingHom, Polynomial.map_mul, Polynomial.map_sub, Polynomial.map_one,
Polynomial.map_pow, map_X] at prod
obtain ⟨R, hR⟩ := minpoly_dvd_mod_p h hdiv
rw [hR, ← mul_assoc, ← Polynomial.map_mul, ← sq, Polynomial.map_pow] at prod
have habs : map (Int.castRingHom (ZMod p)) P ^ 2 ∣ map (Int.castRingHom (ZMod p)) P ^ 2 * R := by
use R
replace habs :=
lt_of_lt_of_le (PartENat.coe_lt_coe.2 one_lt_two)
(multiplicity.le_multiplicity_of_pow_dvd (dvd_trans habs prod))
have hfree : Squarefree (X ^ n - 1 : (ZMod p)[X]) :=
(separable_X_pow_sub_C 1 (fun h => hdiv <| (ZMod.natCast_zmod_eq_zero_iff_dvd n p).1 h)
one_ne_zero).squarefree
cases'
(multiplicity.squarefree_iff_multiplicity_le_one (X ^ n - 1)).1 hfree
(map (Int.castRingHom (ZMod p)) P) with
hle hunit
· rw [Nat.cast_one] at habs; exact hle.not_lt habs
· replace hunit := degree_eq_zero_of_isUnit hunit
rw [degree_map_eq_of_leadingCoeff_ne_zero (Int.castRingHom (ZMod p)) _] at hunit
· exact (minpoly.degree_pos (isIntegral h hpos)).ne' hunit
simp only [Pmonic, eq_intCast, Monic.leadingCoeff, Int.cast_one, Ne, not_false_iff,
one_ne_zero]
| 50 | 5,184,705,528,587,073,000,000 | 2 | 2 | 6 | 2,240 |
import Mathlib.AlgebraicTopology.FundamentalGroupoid.InducedMaps
import Mathlib.Topology.Homotopy.Contractible
import Mathlib.CategoryTheory.PUnit
import Mathlib.AlgebraicTopology.FundamentalGroupoid.PUnit
#align_import algebraic_topology.fundamental_groupoid.simply_connected from "leanprover-community/mathlib"@"38341f11ded9e2bc1371eb42caad69ecacf8f541"
universe u
noncomputable section
open CategoryTheory
open ContinuousMap
open scoped ContinuousMap
@[mk_iff simply_connected_def]
class SimplyConnectedSpace (X : Type*) [TopologicalSpace X] : Prop where
equiv_unit : Nonempty (FundamentalGroupoid X ≌ Discrete Unit)
#align simply_connected_space SimplyConnectedSpace
#align simply_connected_def simply_connected_def
| Mathlib/AlgebraicTopology/FundamentalGroupoid/SimplyConnected.lean | 42 | 48 | theorem simply_connected_iff_unique_homotopic (X : Type*) [TopologicalSpace X] :
SimplyConnectedSpace X ↔
Nonempty X ∧ ∀ x y : X, Nonempty (Unique (Path.Homotopic.Quotient x y)) := by |
simp only [simply_connected_def, equiv_punit_iff_unique,
FundamentalGroupoid.nonempty_iff X, and_congr_right_iff, Nonempty.forall]
intros
exact ⟨fun h _ _ => h _ _, fun h _ _ => h _ _⟩
| 4 | 54.59815 | 2 | 2 | 1 | 2,241 |
import Mathlib.Topology.Sheaves.Presheaf
import Mathlib.Topology.Sheaves.Stalks
import Mathlib.CategoryTheory.Limits.Preserves.Filtered
import Mathlib.CategoryTheory.Sites.LocallySurjective
#align_import topology.sheaves.locally_surjective from "leanprover-community/mathlib"@"fb7698eb37544cbb66292b68b40e54d001f8d1a9"
universe v u
attribute [local instance] CategoryTheory.ConcreteCategory.instFunLike
noncomputable section
open CategoryTheory
open TopologicalSpace
open Opposite
namespace TopCat.Presheaf
section LocallySurjective
open scoped AlgebraicGeometry
variable {C : Type u} [Category.{v} C] [ConcreteCategory.{v} C] {X : TopCat.{v}}
variable {ℱ 𝒢 : X.Presheaf C}
def IsLocallySurjective (T : ℱ ⟶ 𝒢) :=
CategoryTheory.Presheaf.IsLocallySurjective (Opens.grothendieckTopology X) T
set_option linter.uppercaseLean3 false in
#align Top.presheaf.is_locally_surjective TopCat.Presheaf.IsLocallySurjective
theorem isLocallySurjective_iff (T : ℱ ⟶ 𝒢) :
IsLocallySurjective T ↔
∀ (U t), ∀ x ∈ U, ∃ (V : _) (ι : V ⟶ U), (∃ s, T.app _ s = t |_ₕ ι) ∧ x ∈ V :=
⟨fun h _ => h.imageSieve_mem, fun h => ⟨h _⟩⟩
set_option linter.uppercaseLean3 false in
#align Top.presheaf.is_locally_surjective_iff TopCat.Presheaf.isLocallySurjective_iff
section SurjectiveOnStalks
variable [Limits.HasColimits C] [Limits.PreservesFilteredColimits (forget C)]
| Mathlib/Topology/Sheaves/LocallySurjective.lean | 78 | 118 | theorem locally_surjective_iff_surjective_on_stalks (T : ℱ ⟶ 𝒢) :
IsLocallySurjective T ↔ ∀ x : X, Function.Surjective ((stalkFunctor C x).map T) := by |
constructor <;> intro hT
· /- human proof:
Let g ∈ Γₛₜ 𝒢 x be a germ. Represent it on an open set U ⊆ X
as ⟨t, U⟩. By local surjectivity, pass to a smaller open set V
on which there exists s ∈ Γ_ ℱ V mapping to t |_ V.
Then the germ of s maps to g -/
-- Let g ∈ Γₛₜ 𝒢 x be a germ.
intro x g
-- Represent it on an open set U ⊆ X as ⟨t, U⟩.
obtain ⟨U, hxU, t, rfl⟩ := 𝒢.germ_exist x g
-- By local surjectivity, pass to a smaller open set V
-- on which there exists s ∈ Γ_ ℱ V mapping to t |_ V.
rcases hT.imageSieve_mem t x hxU with ⟨V, ι, ⟨s, h_eq⟩, hxV⟩
-- Then the germ of s maps to g.
use ℱ.germ ⟨x, hxV⟩ s
-- Porting note: `convert` went too deep and swapped LHS and RHS of the remaining goal relative
-- to lean 3.
convert stalkFunctor_map_germ_apply V ⟨x, hxV⟩ T s using 1
simpa [h_eq] using (germ_res_apply 𝒢 ι ⟨x, hxV⟩ t).symm
· /- human proof:
Let U be an open set, t ∈ Γ ℱ U a section, x ∈ U a point.
By surjectivity on stalks, the germ of t is the image of
some germ f ∈ Γₛₜ ℱ x. Represent f on some open set V ⊆ X as ⟨s, V⟩.
Then there is some possibly smaller open set x ∈ W ⊆ V ∩ U on which
we have T(s) |_ W = t |_ W. -/
constructor
intro U t x hxU
set t_x := 𝒢.germ ⟨x, hxU⟩ t with ht_x
obtain ⟨s_x, hs_x : ((stalkFunctor C x).map T) s_x = t_x⟩ := hT x t_x
obtain ⟨V, hxV, s, rfl⟩ := ℱ.germ_exist x s_x
-- rfl : ℱ.germ x s = s_x
have key_W := 𝒢.germ_eq x hxV hxU (T.app _ s) t <| by
convert hs_x using 1
symm
convert stalkFunctor_map_germ_apply _ _ _ s
obtain ⟨W, hxW, hWV, hWU, h_eq⟩ := key_W
refine ⟨W, hWU, ⟨ℱ.map hWV.op s, ?_⟩, hxW⟩
convert h_eq using 1
simp only [← comp_apply, T.naturality]
| 39 | 86,593,400,423,993,740 | 2 | 2 | 1 | 2,242 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Archimedean
import Mathlib.Data.Real.Basic
import Mathlib.Order.Interval.Set.Disjoint
#align_import data.real.basic from "leanprover-community/mathlib"@"cb42593171ba005beaaf4549fcfe0dece9ada4c9"
open scoped Classical
open Pointwise CauSeq
namespace Real
instance instArchimedean : Archimedean ℝ :=
archimedean_iff_rat_le.2 fun x =>
Real.ind_mk x fun f =>
let ⟨M, _, H⟩ := f.bounded' 0
⟨M, mk_le_of_forall_le ⟨0, fun i _ => Rat.cast_le.2 <| le_of_lt (abs_lt.1 (H i)).2⟩⟩
#align real.archimedean Real.instArchimedean
noncomputable instance : FloorRing ℝ :=
Archimedean.floorRing _
theorem isCauSeq_iff_lift {f : ℕ → ℚ} : IsCauSeq abs f ↔ IsCauSeq abs fun i => (f i : ℝ) where
mp H ε ε0 :=
let ⟨δ, δ0, δε⟩ := exists_pos_rat_lt ε0
(H _ δ0).imp fun i hi j ij => by dsimp; exact lt_trans (mod_cast hi _ ij) δε
mpr H ε ε0 :=
(H _ (Rat.cast_pos.2 ε0)).imp fun i hi j ij => by dsimp at hi; exact mod_cast hi _ ij
#align real.is_cau_seq_iff_lift Real.isCauSeq_iff_lift
theorem of_near (f : ℕ → ℚ) (x : ℝ) (h : ∀ ε > 0, ∃ i, ∀ j ≥ i, |(f j : ℝ) - x| < ε) :
∃ h', Real.mk ⟨f, h'⟩ = x :=
⟨isCauSeq_iff_lift.2 (CauSeq.of_near _ (const abs x) h),
sub_eq_zero.1 <|
abs_eq_zero.1 <|
(eq_of_le_of_forall_le_of_dense (abs_nonneg _)) fun _ε ε0 =>
mk_near_of_forall_near <| (h _ ε0).imp fun _i h j ij => le_of_lt (h j ij)⟩
#align real.of_near Real.of_near
theorem exists_floor (x : ℝ) : ∃ ub : ℤ, (ub : ℝ) ≤ x ∧ ∀ z : ℤ, (z : ℝ) ≤ x → z ≤ ub :=
Int.exists_greatest_of_bdd
(let ⟨n, hn⟩ := exists_int_gt x
⟨n, fun _ h' => Int.cast_le.1 <| le_trans h' <| le_of_lt hn⟩)
(let ⟨n, hn⟩ := exists_int_lt x
⟨n, le_of_lt hn⟩)
#align real.exists_floor Real.exists_floor
| Mathlib/Data/Real/Archimedean.lean | 58 | 106 | theorem exists_isLUB {S : Set ℝ} (hne : S.Nonempty) (hbdd : BddAbove S) : ∃ x, IsLUB S x := by |
rcases hne, hbdd with ⟨⟨L, hL⟩, ⟨U, hU⟩⟩
have : ∀ d : ℕ, BddAbove { m : ℤ | ∃ y ∈ S, (m : ℝ) ≤ y * d } := by
cases' exists_int_gt U with k hk
refine fun d => ⟨k * d, fun z h => ?_⟩
rcases h with ⟨y, yS, hy⟩
refine Int.cast_le.1 (hy.trans ?_)
push_cast
exact mul_le_mul_of_nonneg_right ((hU yS).trans hk.le) d.cast_nonneg
choose f hf using fun d : ℕ =>
Int.exists_greatest_of_bdd (this d) ⟨⌊L * d⌋, L, hL, Int.floor_le _⟩
have hf₁ : ∀ n > 0, ∃ y ∈ S, ((f n / n : ℚ) : ℝ) ≤ y := fun n n0 =>
let ⟨y, yS, hy⟩ := (hf n).1
⟨y, yS, by simpa using (div_le_iff (Nat.cast_pos.2 n0 : (_ : ℝ) < _)).2 hy⟩
have hf₂ : ∀ n > 0, ∀ y ∈ S, (y - ((n : ℕ) : ℝ)⁻¹) < (f n / n : ℚ) := by
intro n n0 y yS
have := (Int.sub_one_lt_floor _).trans_le (Int.cast_le.2 <| (hf n).2 _ ⟨y, yS, Int.floor_le _⟩)
simp only [Rat.cast_div, Rat.cast_intCast, Rat.cast_natCast, gt_iff_lt]
rwa [lt_div_iff (Nat.cast_pos.2 n0 : (_ : ℝ) < _), sub_mul, _root_.inv_mul_cancel]
exact ne_of_gt (Nat.cast_pos.2 n0)
have hg : IsCauSeq abs (fun n => f n / n : ℕ → ℚ) := by
intro ε ε0
suffices ∀ j ≥ ⌈ε⁻¹⌉₊, ∀ k ≥ ⌈ε⁻¹⌉₊, (f j / j - f k / k : ℚ) < ε by
refine ⟨_, fun j ij => abs_lt.2 ⟨?_, this _ ij _ le_rfl⟩⟩
rw [neg_lt, neg_sub]
exact this _ le_rfl _ ij
intro j ij k ik
replace ij := le_trans (Nat.le_ceil _) (Nat.cast_le.2 ij)
replace ik := le_trans (Nat.le_ceil _) (Nat.cast_le.2 ik)
have j0 := Nat.cast_pos.1 ((inv_pos.2 ε0).trans_le ij)
have k0 := Nat.cast_pos.1 ((inv_pos.2 ε0).trans_le ik)
rcases hf₁ _ j0 with ⟨y, yS, hy⟩
refine lt_of_lt_of_le ((Rat.cast_lt (K := ℝ)).1 ?_) ((inv_le ε0 (Nat.cast_pos.2 k0)).1 ik)
simpa using sub_lt_iff_lt_add'.2 (lt_of_le_of_lt hy <| sub_lt_iff_lt_add.1 <| hf₂ _ k0 _ yS)
let g : CauSeq ℚ abs := ⟨fun n => f n / n, hg⟩
refine ⟨mk g, ⟨fun x xS => ?_, fun y h => ?_⟩⟩
· refine le_of_forall_ge_of_dense fun z xz => ?_
cases' exists_nat_gt (x - z)⁻¹ with K hK
refine le_mk_of_forall_le ⟨K, fun n nK => ?_⟩
replace xz := sub_pos.2 xz
replace hK := hK.le.trans (Nat.cast_le.2 nK)
have n0 : 0 < n := Nat.cast_pos.1 ((inv_pos.2 xz).trans_le hK)
refine le_trans ?_ (hf₂ _ n0 _ xS).le
rwa [le_sub_comm, inv_le (Nat.cast_pos.2 n0 : (_ : ℝ) < _) xz]
· exact
mk_le_of_forall_le
⟨1, fun n n1 =>
let ⟨x, xS, hx⟩ := hf₁ _ n1
le_trans hx (h xS)⟩
| 48 | 701,673,591,209,763,100,000 | 2 | 2 | 1 | 2,243 |
import Mathlib.Algebra.Divisibility.Basic
import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Algebra.Ring.Defs
#align_import algebra.ring.divisibility from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
variable {α β : Type*}
section Semigroup
variable [Semigroup α] [Semigroup β] {F : Type*} [EquivLike F α β] [MulEquivClass F α β] (f : F)
theorem map_dvd_iff {a b} : f a ∣ f b ↔ a ∣ b :=
let f := MulEquivClass.toMulEquiv f
⟨fun h ↦ by rw [← f.left_inv a, ← f.left_inv b]; exact map_dvd f.symm h, map_dvd f⟩
| Mathlib/Algebra/Ring/Divisibility/Basic.lean | 31 | 38 | theorem MulEquiv.decompositionMonoid [DecompositionMonoid β] : DecompositionMonoid α where
primal a b c h := by |
rw [← map_dvd_iff f, map_mul] at h
obtain ⟨a₁, a₂, h⟩ := DecompositionMonoid.primal _ h
refine ⟨symm f a₁, symm f a₂, ?_⟩
simp_rw [← map_dvd_iff f, ← map_mul, eq_symm_apply]
iterate 2 erw [(f : α ≃* β).apply_symm_apply]
exact h
| 6 | 403.428793 | 2 | 2 | 1 | 2,244 |
import Mathlib.Topology.Algebra.Order.Compact
import Mathlib.Topology.MetricSpace.PseudoMetric
open Set Filter
universe u v w
variable {α : Type u} {β : Type v} {X ι : Type*}
section ProperSpace
open Metric
class ProperSpace (α : Type u) [PseudoMetricSpace α] : Prop where
isCompact_closedBall : ∀ x : α, ∀ r, IsCompact (closedBall x r)
#align proper_space ProperSpace
export ProperSpace (isCompact_closedBall)
theorem isCompact_sphere {α : Type*} [PseudoMetricSpace α] [ProperSpace α] (x : α) (r : ℝ) :
IsCompact (sphere x r) :=
(isCompact_closedBall x r).of_isClosed_subset isClosed_sphere sphere_subset_closedBall
#align is_compact_sphere isCompact_sphere
instance Metric.sphere.compactSpace {α : Type*} [PseudoMetricSpace α] [ProperSpace α]
(x : α) (r : ℝ) : CompactSpace (sphere x r) :=
isCompact_iff_compactSpace.mp (isCompact_sphere _ _)
variable [PseudoMetricSpace α]
-- see Note [lower instance priority]
instance (priority := 100) secondCountable_of_proper [ProperSpace α] :
SecondCountableTopology α := by
-- We already have `sigmaCompactSpace_of_locallyCompact_secondCountable`, so we don't
-- add an instance for `SigmaCompactSpace`.
suffices SigmaCompactSpace α from EMetric.secondCountable_of_sigmaCompact α
rcases em (Nonempty α) with (⟨⟨x⟩⟩ | hn)
· exact ⟨⟨fun n => closedBall x n, fun n => isCompact_closedBall _ _, iUnion_closedBall_nat _⟩⟩
· exact ⟨⟨fun _ => ∅, fun _ => isCompact_empty, iUnion_eq_univ_iff.2 fun x => (hn ⟨x⟩).elim⟩⟩
#align second_countable_of_proper secondCountable_of_proper
theorem ProperSpace.of_isCompact_closedBall_of_le (R : ℝ)
(h : ∀ x : α, ∀ r, R ≤ r → IsCompact (closedBall x r)) : ProperSpace α :=
⟨fun x r => IsCompact.of_isClosed_subset (h x (max r R) (le_max_right _ _)) isClosed_ball
(closedBall_subset_closedBall <| le_max_left _ _)⟩
#align proper_space_of_compact_closed_ball_of_le ProperSpace.of_isCompact_closedBall_of_le
@[deprecated (since := "2024-01-31")]
alias properSpace_of_compact_closedBall_of_le := ProperSpace.of_isCompact_closedBall_of_le
theorem ProperSpace.of_seq_closedBall {β : Type*} {l : Filter β} [NeBot l] {x : α} {r : β → ℝ}
(hr : Tendsto r l atTop) (hc : ∀ᶠ i in l, IsCompact (closedBall x (r i))) :
ProperSpace α where
isCompact_closedBall a r :=
let ⟨_i, hci, hir⟩ := (hc.and <| hr.eventually_ge_atTop <| r + dist a x).exists
hci.of_isClosed_subset isClosed_ball <| closedBall_subset_closedBall' hir
-- A compact pseudometric space is proper
-- see Note [lower instance priority]
instance (priority := 100) proper_of_compact [CompactSpace α] : ProperSpace α :=
⟨fun _ _ => isClosed_ball.isCompact⟩
#align proper_of_compact proper_of_compact
-- see Note [lower instance priority]
instance (priority := 100) locally_compact_of_proper [ProperSpace α] : LocallyCompactSpace α :=
.of_hasBasis (fun _ => nhds_basis_closedBall) fun _ _ _ =>
isCompact_closedBall _ _
#align locally_compact_of_proper locally_compact_of_proper
-- see Note [lower instance priority]
instance (priority := 100) complete_of_proper [ProperSpace α] : CompleteSpace α :=
⟨fun {f} hf => by
obtain ⟨t, t_fset, ht⟩ : ∃ t ∈ f, ∀ x ∈ t, ∀ y ∈ t, dist x y < 1 :=
(Metric.cauchy_iff.1 hf).2 1 zero_lt_one
rcases hf.1.nonempty_of_mem t_fset with ⟨x, xt⟩
have : closedBall x 1 ∈ f := mem_of_superset t_fset fun y yt => (ht y yt x xt).le
rcases (isCompact_iff_totallyBounded_isComplete.1 (isCompact_closedBall x 1)).2 f hf
(le_principal_iff.2 this) with
⟨y, -, hy⟩
exact ⟨y, hy⟩⟩
#align complete_of_proper complete_of_proper
instance prod_properSpace {α : Type*} {β : Type*} [PseudoMetricSpace α] [PseudoMetricSpace β]
[ProperSpace α] [ProperSpace β] : ProperSpace (α × β) where
isCompact_closedBall := by
rintro ⟨x, y⟩ r
rw [← closedBall_prod_same x y]
exact (isCompact_closedBall x r).prod (isCompact_closedBall y r)
#align prod_proper_space prod_properSpace
instance pi_properSpace {π : β → Type*} [Fintype β] [∀ b, PseudoMetricSpace (π b)]
[h : ∀ b, ProperSpace (π b)] : ProperSpace (∀ b, π b) := by
refine .of_isCompact_closedBall_of_le 0 fun x r hr => ?_
rw [closedBall_pi _ hr]
exact isCompact_univ_pi fun _ => isCompact_closedBall _ _
#align pi_proper_space pi_properSpace
variable [ProperSpace α] {x : α} {r : ℝ} {s : Set α}
| Mathlib/Topology/MetricSpace/ProperSpace.lean | 134 | 144 | theorem exists_pos_lt_subset_ball (hr : 0 < r) (hs : IsClosed s) (h : s ⊆ ball x r) :
∃ r' ∈ Ioo 0 r, s ⊆ ball x r' := by |
rcases eq_empty_or_nonempty s with (rfl | hne)
· exact ⟨r / 2, ⟨half_pos hr, half_lt_self hr⟩, empty_subset _⟩
have : IsCompact s :=
(isCompact_closedBall x r).of_isClosed_subset hs (h.trans ball_subset_closedBall)
obtain ⟨y, hys, hy⟩ : ∃ y ∈ s, s ⊆ closedBall x (dist y x) :=
this.exists_isMaxOn hne (continuous_id.dist continuous_const).continuousOn
have hyr : dist y x < r := h hys
rcases exists_between hyr with ⟨r', hyr', hrr'⟩
exact ⟨r', ⟨dist_nonneg.trans_lt hyr', hrr'⟩, hy.trans <| closedBall_subset_ball hyr'⟩
| 9 | 8,103.083928 | 2 | 2 | 2 | 2,245 |
import Mathlib.Topology.Algebra.Order.Compact
import Mathlib.Topology.MetricSpace.PseudoMetric
open Set Filter
universe u v w
variable {α : Type u} {β : Type v} {X ι : Type*}
section ProperSpace
open Metric
class ProperSpace (α : Type u) [PseudoMetricSpace α] : Prop where
isCompact_closedBall : ∀ x : α, ∀ r, IsCompact (closedBall x r)
#align proper_space ProperSpace
export ProperSpace (isCompact_closedBall)
theorem isCompact_sphere {α : Type*} [PseudoMetricSpace α] [ProperSpace α] (x : α) (r : ℝ) :
IsCompact (sphere x r) :=
(isCompact_closedBall x r).of_isClosed_subset isClosed_sphere sphere_subset_closedBall
#align is_compact_sphere isCompact_sphere
instance Metric.sphere.compactSpace {α : Type*} [PseudoMetricSpace α] [ProperSpace α]
(x : α) (r : ℝ) : CompactSpace (sphere x r) :=
isCompact_iff_compactSpace.mp (isCompact_sphere _ _)
variable [PseudoMetricSpace α]
-- see Note [lower instance priority]
instance (priority := 100) secondCountable_of_proper [ProperSpace α] :
SecondCountableTopology α := by
-- We already have `sigmaCompactSpace_of_locallyCompact_secondCountable`, so we don't
-- add an instance for `SigmaCompactSpace`.
suffices SigmaCompactSpace α from EMetric.secondCountable_of_sigmaCompact α
rcases em (Nonempty α) with (⟨⟨x⟩⟩ | hn)
· exact ⟨⟨fun n => closedBall x n, fun n => isCompact_closedBall _ _, iUnion_closedBall_nat _⟩⟩
· exact ⟨⟨fun _ => ∅, fun _ => isCompact_empty, iUnion_eq_univ_iff.2 fun x => (hn ⟨x⟩).elim⟩⟩
#align second_countable_of_proper secondCountable_of_proper
theorem ProperSpace.of_isCompact_closedBall_of_le (R : ℝ)
(h : ∀ x : α, ∀ r, R ≤ r → IsCompact (closedBall x r)) : ProperSpace α :=
⟨fun x r => IsCompact.of_isClosed_subset (h x (max r R) (le_max_right _ _)) isClosed_ball
(closedBall_subset_closedBall <| le_max_left _ _)⟩
#align proper_space_of_compact_closed_ball_of_le ProperSpace.of_isCompact_closedBall_of_le
@[deprecated (since := "2024-01-31")]
alias properSpace_of_compact_closedBall_of_le := ProperSpace.of_isCompact_closedBall_of_le
theorem ProperSpace.of_seq_closedBall {β : Type*} {l : Filter β} [NeBot l] {x : α} {r : β → ℝ}
(hr : Tendsto r l atTop) (hc : ∀ᶠ i in l, IsCompact (closedBall x (r i))) :
ProperSpace α where
isCompact_closedBall a r :=
let ⟨_i, hci, hir⟩ := (hc.and <| hr.eventually_ge_atTop <| r + dist a x).exists
hci.of_isClosed_subset isClosed_ball <| closedBall_subset_closedBall' hir
-- A compact pseudometric space is proper
-- see Note [lower instance priority]
instance (priority := 100) proper_of_compact [CompactSpace α] : ProperSpace α :=
⟨fun _ _ => isClosed_ball.isCompact⟩
#align proper_of_compact proper_of_compact
-- see Note [lower instance priority]
instance (priority := 100) locally_compact_of_proper [ProperSpace α] : LocallyCompactSpace α :=
.of_hasBasis (fun _ => nhds_basis_closedBall) fun _ _ _ =>
isCompact_closedBall _ _
#align locally_compact_of_proper locally_compact_of_proper
-- see Note [lower instance priority]
instance (priority := 100) complete_of_proper [ProperSpace α] : CompleteSpace α :=
⟨fun {f} hf => by
obtain ⟨t, t_fset, ht⟩ : ∃ t ∈ f, ∀ x ∈ t, ∀ y ∈ t, dist x y < 1 :=
(Metric.cauchy_iff.1 hf).2 1 zero_lt_one
rcases hf.1.nonempty_of_mem t_fset with ⟨x, xt⟩
have : closedBall x 1 ∈ f := mem_of_superset t_fset fun y yt => (ht y yt x xt).le
rcases (isCompact_iff_totallyBounded_isComplete.1 (isCompact_closedBall x 1)).2 f hf
(le_principal_iff.2 this) with
⟨y, -, hy⟩
exact ⟨y, hy⟩⟩
#align complete_of_proper complete_of_proper
instance prod_properSpace {α : Type*} {β : Type*} [PseudoMetricSpace α] [PseudoMetricSpace β]
[ProperSpace α] [ProperSpace β] : ProperSpace (α × β) where
isCompact_closedBall := by
rintro ⟨x, y⟩ r
rw [← closedBall_prod_same x y]
exact (isCompact_closedBall x r).prod (isCompact_closedBall y r)
#align prod_proper_space prod_properSpace
instance pi_properSpace {π : β → Type*} [Fintype β] [∀ b, PseudoMetricSpace (π b)]
[h : ∀ b, ProperSpace (π b)] : ProperSpace (∀ b, π b) := by
refine .of_isCompact_closedBall_of_le 0 fun x r hr => ?_
rw [closedBall_pi _ hr]
exact isCompact_univ_pi fun _ => isCompact_closedBall _ _
#align pi_proper_space pi_properSpace
variable [ProperSpace α] {x : α} {r : ℝ} {s : Set α}
theorem exists_pos_lt_subset_ball (hr : 0 < r) (hs : IsClosed s) (h : s ⊆ ball x r) :
∃ r' ∈ Ioo 0 r, s ⊆ ball x r' := by
rcases eq_empty_or_nonempty s with (rfl | hne)
· exact ⟨r / 2, ⟨half_pos hr, half_lt_self hr⟩, empty_subset _⟩
have : IsCompact s :=
(isCompact_closedBall x r).of_isClosed_subset hs (h.trans ball_subset_closedBall)
obtain ⟨y, hys, hy⟩ : ∃ y ∈ s, s ⊆ closedBall x (dist y x) :=
this.exists_isMaxOn hne (continuous_id.dist continuous_const).continuousOn
have hyr : dist y x < r := h hys
rcases exists_between hyr with ⟨r', hyr', hrr'⟩
exact ⟨r', ⟨dist_nonneg.trans_lt hyr', hrr'⟩, hy.trans <| closedBall_subset_ball hyr'⟩
#align exists_pos_lt_subset_ball exists_pos_lt_subset_ball
| Mathlib/Topology/MetricSpace/ProperSpace.lean | 149 | 154 | theorem exists_lt_subset_ball (hs : IsClosed s) (h : s ⊆ ball x r) : ∃ r' < r, s ⊆ ball x r' := by |
rcases le_or_lt r 0 with hr | hr
· rw [ball_eq_empty.2 hr, subset_empty_iff] at h
subst s
exact (exists_lt r).imp fun r' hr' => ⟨hr', empty_subset _⟩
· exact (exists_pos_lt_subset_ball hr hs h).imp fun r' hr' => ⟨hr'.1.2, hr'.2⟩
| 5 | 148.413159 | 2 | 2 | 2 | 2,245 |
import Mathlib.Topology.Algebra.Group.Basic
import Mathlib.Topology.Order.LeftRightNhds
#align_import topology.algebra.order.group from "leanprover-community/mathlib"@"84dc0bd6619acaea625086d6f53cb35cdd554219"
open Set Filter
open Topology Filter
variable {α G : Type*} [TopologicalSpace G] [LinearOrderedAddCommGroup G] [OrderTopology G]
variable {l : Filter α} {f g : α → G}
-- see Note [lower instance priority]
instance (priority := 100) LinearOrderedAddCommGroup.topologicalAddGroup :
TopologicalAddGroup G where
continuous_add := by
refine continuous_iff_continuousAt.2 ?_
rintro ⟨a, b⟩
refine LinearOrderedAddCommGroup.tendsto_nhds.2 fun ε ε0 => ?_
rcases dense_or_discrete 0 ε with (⟨δ, δ0, δε⟩ | ⟨_h₁, h₂⟩)
· -- If there exists `δ ∈ (0, ε)`, then we choose `δ`-nhd of `a` and `(ε-δ)`-nhd of `b`
filter_upwards [(eventually_abs_sub_lt a δ0).prod_nhds
(eventually_abs_sub_lt b (sub_pos.2 δε))]
rintro ⟨x, y⟩ ⟨hx : |x - a| < δ, hy : |y - b| < ε - δ⟩
rw [add_sub_add_comm]
calc
|x - a + (y - b)| ≤ |x - a| + |y - b| := abs_add _ _
_ < δ + (ε - δ) := add_lt_add hx hy
_ = ε := add_sub_cancel _ _
· -- Otherwise `ε`-nhd of each point `a` is `{a}`
have hε : ∀ {x y}, |x - y| < ε → x = y := by
intro x y h
simpa [sub_eq_zero] using h₂ _ h
filter_upwards [(eventually_abs_sub_lt a ε0).prod_nhds (eventually_abs_sub_lt b ε0)]
rintro ⟨x, y⟩ ⟨hx : |x - a| < ε, hy : |y - b| < ε⟩
simpa [hε hx, hε hy]
continuous_neg :=
continuous_iff_continuousAt.2 fun a =>
LinearOrderedAddCommGroup.tendsto_nhds.2 fun ε ε0 =>
(eventually_abs_sub_lt a ε0).mono fun x hx => by rwa [neg_sub_neg, abs_sub_comm]
#align linear_ordered_add_comm_group.topological_add_group LinearOrderedAddCommGroup.topologicalAddGroup
@[continuity]
theorem continuous_abs : Continuous (abs : G → G) :=
continuous_id.max continuous_neg
#align continuous_abs continuous_abs
protected theorem Filter.Tendsto.abs {a : G} (h : Tendsto f l (𝓝 a)) :
Tendsto (fun x => |f x|) l (𝓝 |a|) :=
(continuous_abs.tendsto _).comp h
#align filter.tendsto.abs Filter.Tendsto.abs
| Mathlib/Topology/Algebra/Order/Group.lean | 67 | 73 | theorem tendsto_zero_iff_abs_tendsto_zero (f : α → G) :
Tendsto f l (𝓝 0) ↔ Tendsto (abs ∘ f) l (𝓝 0) := by |
refine ⟨fun h => (abs_zero : |(0 : G)| = 0) ▸ h.abs, fun h => ?_⟩
have : Tendsto (fun a => -|f a|) l (𝓝 0) := (neg_zero : -(0 : G) = 0) ▸ h.neg
exact
tendsto_of_tendsto_of_tendsto_of_le_of_le this h (fun x => neg_abs_le <| f x) fun x =>
le_abs_self <| f x
| 5 | 148.413159 | 2 | 2 | 1 | 2,246 |
import Mathlib.Topology.ContinuousFunction.ZeroAtInfty
open Topology Filter
variable {E F 𝓕 : Type*}
variable [SeminormedAddGroup E] [SeminormedAddCommGroup F]
variable [FunLike 𝓕 E F] [ZeroAtInftyContinuousMapClass 𝓕 E F]
| Mathlib/Analysis/Normed/Group/ZeroAtInfty.lean | 24 | 34 | theorem ZeroAtInftyContinuousMapClass.norm_le (f : 𝓕) (ε : ℝ) (hε : 0 < ε) :
∃ (r : ℝ), ∀ (x : E) (_hx : r < ‖x‖), ‖f x‖ < ε := by |
have h := zero_at_infty f
rw [tendsto_zero_iff_norm_tendsto_zero, tendsto_def] at h
specialize h (Metric.ball 0 ε) (Metric.ball_mem_nhds 0 hε)
rcases Metric.closedBall_compl_subset_of_mem_cocompact h 0 with ⟨r, hr⟩
use r
intro x hr'
suffices x ∈ (fun x ↦ ‖f x‖) ⁻¹' Metric.ball 0 ε by aesop
apply hr
aesop
| 9 | 8,103.083928 | 2 | 2 | 2 | 2,247 |
import Mathlib.Topology.ContinuousFunction.ZeroAtInfty
open Topology Filter
variable {E F 𝓕 : Type*}
variable [SeminormedAddGroup E] [SeminormedAddCommGroup F]
variable [FunLike 𝓕 E F] [ZeroAtInftyContinuousMapClass 𝓕 E F]
theorem ZeroAtInftyContinuousMapClass.norm_le (f : 𝓕) (ε : ℝ) (hε : 0 < ε) :
∃ (r : ℝ), ∀ (x : E) (_hx : r < ‖x‖), ‖f x‖ < ε := by
have h := zero_at_infty f
rw [tendsto_zero_iff_norm_tendsto_zero, tendsto_def] at h
specialize h (Metric.ball 0 ε) (Metric.ball_mem_nhds 0 hε)
rcases Metric.closedBall_compl_subset_of_mem_cocompact h 0 with ⟨r, hr⟩
use r
intro x hr'
suffices x ∈ (fun x ↦ ‖f x‖) ⁻¹' Metric.ball 0 ε by aesop
apply hr
aesop
variable [ProperSpace E]
| Mathlib/Analysis/Normed/Group/ZeroAtInfty.lean | 38 | 49 | theorem zero_at_infty_of_norm_le (f : E → F)
(h : ∀ (ε : ℝ) (_hε : 0 < ε), ∃ (r : ℝ), ∀ (x : E) (_hx : r < ‖x‖), ‖f x‖ < ε) :
Tendsto f (cocompact E) (𝓝 0) := by |
rw [tendsto_zero_iff_norm_tendsto_zero]
intro s hs
rw [mem_map, Metric.mem_cocompact_iff_closedBall_compl_subset 0]
rw [Metric.mem_nhds_iff] at hs
rcases hs with ⟨ε, hε, hs⟩
rcases h ε hε with ⟨r, hr⟩
use r
intro
aesop
| 9 | 8,103.083928 | 2 | 2 | 2 | 2,247 |
import Mathlib.Analysis.NormedSpace.Spectrum
import Mathlib.Topology.ContinuousFunction.NonUnitalFunctionalCalculus
import Mathlib.Topology.ContinuousFunction.StoneWeierstrass
section UniqueUnital
section NNReal
open NNReal
variable {X : Type*} [TopologicalSpace X]
variable {A : Type*} [TopologicalSpace A] [Ring A] [StarRing A] [Algebra ℝ A] [TopologicalRing A]
section UniqueNonUnital
section RCLike
variable {𝕜 A : Type*} [RCLike 𝕜]
open NonUnitalStarAlgebra in
| Mathlib/Topology/ContinuousFunction/UniqueCFC.lean | 207 | 218 | theorem RCLike.uniqueNonUnitalContinuousFunctionalCalculus_of_compactSpace_quasispectrum
[TopologicalSpace A] [T2Space A] [NonUnitalRing A] [StarRing A] [Module 𝕜 A]
[IsScalarTower 𝕜 A A] [SMulCommClass 𝕜 A A] [h : ∀ a : A, CompactSpace (quasispectrum 𝕜 a)] :
UniqueNonUnitalContinuousFunctionalCalculus 𝕜 A where
eq_of_continuous_of_map_id s hs _inst h0 φ ψ hφ hψ h := by |
rw [DFunLike.ext'_iff, ← Set.eqOn_univ, ← (ContinuousMapZero.adjoin_id_dense h0).closure_eq]
refine Set.EqOn.closure (fun f hf ↦ ?_) hφ hψ
rw [← NonUnitalStarAlgHom.mem_equalizer]
apply adjoin_le ?_ hf
rw [Set.singleton_subset_iff]
exact h
compactSpace_quasispectrum := h
| 7 | 1,096.633158 | 2 | 2 | 1 | 2,248 |
import Mathlib.Algebra.Order.AbsoluteValue
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
import Mathlib.Algebra.Ring.Pi
import Mathlib.GroupTheory.GroupAction.Pi
import Mathlib.GroupTheory.GroupAction.Ring
import Mathlib.Init.Align
import Mathlib.Tactic.GCongr
import Mathlib.Tactic.Ring
#align_import data.real.cau_seq from "leanprover-community/mathlib"@"9116dd6709f303dcf781632e15fdef382b0fc579"
assert_not_exists Finset
assert_not_exists Module
assert_not_exists Submonoid
assert_not_exists FloorRing
variable {α β : Type*}
open IsAbsoluteValue
section
variable [LinearOrderedField α] [Ring β] (abv : β → α) [IsAbsoluteValue abv]
theorem rat_add_continuous_lemma {ε : α} (ε0 : 0 < ε) :
∃ δ > 0, ∀ {a₁ a₂ b₁ b₂ : β}, abv (a₁ - b₁) < δ → abv (a₂ - b₂) < δ →
abv (a₁ + a₂ - (b₁ + b₂)) < ε :=
⟨ε / 2, half_pos ε0, fun {a₁ a₂ b₁ b₂} h₁ h₂ => by
simpa [add_halves, sub_eq_add_neg, add_comm, add_left_comm, add_assoc] using
lt_of_le_of_lt (abv_add abv _ _) (add_lt_add h₁ h₂)⟩
#align rat_add_continuous_lemma rat_add_continuous_lemma
| Mathlib/Algebra/Order/CauSeq/Basic.lean | 58 | 71 | theorem rat_mul_continuous_lemma {ε K₁ K₂ : α} (ε0 : 0 < ε) :
∃ δ > 0, ∀ {a₁ a₂ b₁ b₂ : β}, abv a₁ < K₁ → abv b₂ < K₂ → abv (a₁ - b₁) < δ →
abv (a₂ - b₂) < δ → abv (a₁ * a₂ - b₁ * b₂) < ε := by |
have K0 : (0 : α) < max 1 (max K₁ K₂) := lt_of_lt_of_le zero_lt_one (le_max_left _ _)
have εK := div_pos (half_pos ε0) K0
refine ⟨_, εK, fun {a₁ a₂ b₁ b₂} ha₁ hb₂ h₁ h₂ => ?_⟩
replace ha₁ := lt_of_lt_of_le ha₁ (le_trans (le_max_left _ K₂) (le_max_right 1 _))
replace hb₂ := lt_of_lt_of_le hb₂ (le_trans (le_max_right K₁ _) (le_max_right 1 _))
set M := max 1 (max K₁ K₂)
have : abv (a₁ - b₁) * abv b₂ + abv (a₂ - b₂) * abv a₁ < ε / 2 / M * M + ε / 2 / M * M := by
gcongr
rw [← abv_mul abv, mul_comm, div_mul_cancel₀ _ (ne_of_gt K0), ← abv_mul abv, add_halves] at this
simpa [sub_eq_add_neg, mul_add, add_mul, add_left_comm] using
lt_of_le_of_lt (abv_add abv _ _) this
| 11 | 59,874.141715 | 2 | 2 | 3 | 2,249 |
import Mathlib.Algebra.Order.AbsoluteValue
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
import Mathlib.Algebra.Ring.Pi
import Mathlib.GroupTheory.GroupAction.Pi
import Mathlib.GroupTheory.GroupAction.Ring
import Mathlib.Init.Align
import Mathlib.Tactic.GCongr
import Mathlib.Tactic.Ring
#align_import data.real.cau_seq from "leanprover-community/mathlib"@"9116dd6709f303dcf781632e15fdef382b0fc579"
assert_not_exists Finset
assert_not_exists Module
assert_not_exists Submonoid
assert_not_exists FloorRing
variable {α β : Type*}
open IsAbsoluteValue
section
variable [LinearOrderedField α] [Ring β] (abv : β → α) [IsAbsoluteValue abv]
theorem rat_add_continuous_lemma {ε : α} (ε0 : 0 < ε) :
∃ δ > 0, ∀ {a₁ a₂ b₁ b₂ : β}, abv (a₁ - b₁) < δ → abv (a₂ - b₂) < δ →
abv (a₁ + a₂ - (b₁ + b₂)) < ε :=
⟨ε / 2, half_pos ε0, fun {a₁ a₂ b₁ b₂} h₁ h₂ => by
simpa [add_halves, sub_eq_add_neg, add_comm, add_left_comm, add_assoc] using
lt_of_le_of_lt (abv_add abv _ _) (add_lt_add h₁ h₂)⟩
#align rat_add_continuous_lemma rat_add_continuous_lemma
theorem rat_mul_continuous_lemma {ε K₁ K₂ : α} (ε0 : 0 < ε) :
∃ δ > 0, ∀ {a₁ a₂ b₁ b₂ : β}, abv a₁ < K₁ → abv b₂ < K₂ → abv (a₁ - b₁) < δ →
abv (a₂ - b₂) < δ → abv (a₁ * a₂ - b₁ * b₂) < ε := by
have K0 : (0 : α) < max 1 (max K₁ K₂) := lt_of_lt_of_le zero_lt_one (le_max_left _ _)
have εK := div_pos (half_pos ε0) K0
refine ⟨_, εK, fun {a₁ a₂ b₁ b₂} ha₁ hb₂ h₁ h₂ => ?_⟩
replace ha₁ := lt_of_lt_of_le ha₁ (le_trans (le_max_left _ K₂) (le_max_right 1 _))
replace hb₂ := lt_of_lt_of_le hb₂ (le_trans (le_max_right K₁ _) (le_max_right 1 _))
set M := max 1 (max K₁ K₂)
have : abv (a₁ - b₁) * abv b₂ + abv (a₂ - b₂) * abv a₁ < ε / 2 / M * M + ε / 2 / M * M := by
gcongr
rw [← abv_mul abv, mul_comm, div_mul_cancel₀ _ (ne_of_gt K0), ← abv_mul abv, add_halves] at this
simpa [sub_eq_add_neg, mul_add, add_mul, add_left_comm] using
lt_of_le_of_lt (abv_add abv _ _) this
#align rat_mul_continuous_lemma rat_mul_continuous_lemma
| Mathlib/Algebra/Order/CauSeq/Basic.lean | 74 | 85 | theorem rat_inv_continuous_lemma {β : Type*} [DivisionRing β] (abv : β → α) [IsAbsoluteValue abv]
{ε K : α} (ε0 : 0 < ε) (K0 : 0 < K) :
∃ δ > 0, ∀ {a b : β}, K ≤ abv a → K ≤ abv b → abv (a - b) < δ → abv (a⁻¹ - b⁻¹) < ε := by |
refine ⟨K * ε * K, mul_pos (mul_pos K0 ε0) K0, fun {a b} ha hb h => ?_⟩
have a0 := K0.trans_le ha
have b0 := K0.trans_le hb
rw [inv_sub_inv' ((abv_pos abv).1 a0) ((abv_pos abv).1 b0), abv_mul abv, abv_mul abv, abv_inv abv,
abv_inv abv, abv_sub abv]
refine lt_of_mul_lt_mul_left (lt_of_mul_lt_mul_right ?_ b0.le) a0.le
rw [mul_assoc, inv_mul_cancel_right₀ b0.ne', ← mul_assoc, mul_inv_cancel a0.ne', one_mul]
refine h.trans_le ?_
gcongr
| 9 | 8,103.083928 | 2 | 2 | 3 | 2,249 |
import Mathlib.Algebra.Order.AbsoluteValue
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
import Mathlib.Algebra.Ring.Pi
import Mathlib.GroupTheory.GroupAction.Pi
import Mathlib.GroupTheory.GroupAction.Ring
import Mathlib.Init.Align
import Mathlib.Tactic.GCongr
import Mathlib.Tactic.Ring
#align_import data.real.cau_seq from "leanprover-community/mathlib"@"9116dd6709f303dcf781632e15fdef382b0fc579"
assert_not_exists Finset
assert_not_exists Module
assert_not_exists Submonoid
assert_not_exists FloorRing
variable {α β : Type*}
open IsAbsoluteValue
section
variable [LinearOrderedField α] [Ring β] (abv : β → α) [IsAbsoluteValue abv]
theorem rat_add_continuous_lemma {ε : α} (ε0 : 0 < ε) :
∃ δ > 0, ∀ {a₁ a₂ b₁ b₂ : β}, abv (a₁ - b₁) < δ → abv (a₂ - b₂) < δ →
abv (a₁ + a₂ - (b₁ + b₂)) < ε :=
⟨ε / 2, half_pos ε0, fun {a₁ a₂ b₁ b₂} h₁ h₂ => by
simpa [add_halves, sub_eq_add_neg, add_comm, add_left_comm, add_assoc] using
lt_of_le_of_lt (abv_add abv _ _) (add_lt_add h₁ h₂)⟩
#align rat_add_continuous_lemma rat_add_continuous_lemma
theorem rat_mul_continuous_lemma {ε K₁ K₂ : α} (ε0 : 0 < ε) :
∃ δ > 0, ∀ {a₁ a₂ b₁ b₂ : β}, abv a₁ < K₁ → abv b₂ < K₂ → abv (a₁ - b₁) < δ →
abv (a₂ - b₂) < δ → abv (a₁ * a₂ - b₁ * b₂) < ε := by
have K0 : (0 : α) < max 1 (max K₁ K₂) := lt_of_lt_of_le zero_lt_one (le_max_left _ _)
have εK := div_pos (half_pos ε0) K0
refine ⟨_, εK, fun {a₁ a₂ b₁ b₂} ha₁ hb₂ h₁ h₂ => ?_⟩
replace ha₁ := lt_of_lt_of_le ha₁ (le_trans (le_max_left _ K₂) (le_max_right 1 _))
replace hb₂ := lt_of_lt_of_le hb₂ (le_trans (le_max_right K₁ _) (le_max_right 1 _))
set M := max 1 (max K₁ K₂)
have : abv (a₁ - b₁) * abv b₂ + abv (a₂ - b₂) * abv a₁ < ε / 2 / M * M + ε / 2 / M * M := by
gcongr
rw [← abv_mul abv, mul_comm, div_mul_cancel₀ _ (ne_of_gt K0), ← abv_mul abv, add_halves] at this
simpa [sub_eq_add_neg, mul_add, add_mul, add_left_comm] using
lt_of_le_of_lt (abv_add abv _ _) this
#align rat_mul_continuous_lemma rat_mul_continuous_lemma
theorem rat_inv_continuous_lemma {β : Type*} [DivisionRing β] (abv : β → α) [IsAbsoluteValue abv]
{ε K : α} (ε0 : 0 < ε) (K0 : 0 < K) :
∃ δ > 0, ∀ {a b : β}, K ≤ abv a → K ≤ abv b → abv (a - b) < δ → abv (a⁻¹ - b⁻¹) < ε := by
refine ⟨K * ε * K, mul_pos (mul_pos K0 ε0) K0, fun {a b} ha hb h => ?_⟩
have a0 := K0.trans_le ha
have b0 := K0.trans_le hb
rw [inv_sub_inv' ((abv_pos abv).1 a0) ((abv_pos abv).1 b0), abv_mul abv, abv_mul abv, abv_inv abv,
abv_inv abv, abv_sub abv]
refine lt_of_mul_lt_mul_left (lt_of_mul_lt_mul_right ?_ b0.le) a0.le
rw [mul_assoc, inv_mul_cancel_right₀ b0.ne', ← mul_assoc, mul_inv_cancel a0.ne', one_mul]
refine h.trans_le ?_
gcongr
#align rat_inv_continuous_lemma rat_inv_continuous_lemma
end
def IsCauSeq {α : Type*} [LinearOrderedField α] {β : Type*} [Ring β] (abv : β → α) (f : ℕ → β) :
Prop :=
∀ ε > 0, ∃ i, ∀ j ≥ i, abv (f j - f i) < ε
#align is_cau_seq IsCauSeq
namespace IsCauSeq
variable [LinearOrderedField α] [Ring β] {abv : β → α} [IsAbsoluteValue abv] {f g : ℕ → β}
-- see Note [nolint_ge]
--@[nolint ge_or_gt] -- Porting note: restore attribute
| Mathlib/Algebra/Order/CauSeq/Basic.lean | 102 | 107 | theorem cauchy₂ (hf : IsCauSeq abv f) {ε : α} (ε0 : 0 < ε) :
∃ i, ∀ j ≥ i, ∀ k ≥ i, abv (f j - f k) < ε := by |
refine (hf _ (half_pos ε0)).imp fun i hi j ij k ik => ?_
rw [← add_halves ε]
refine lt_of_le_of_lt (abv_sub_le abv _ _ _) (add_lt_add (hi _ ij) ?_)
rw [abv_sub abv]; exact hi _ ik
| 4 | 54.59815 | 2 | 2 | 3 | 2,249 |
import Mathlib.RingTheory.WittVector.Basic
import Mathlib.RingTheory.WittVector.IsPoly
#align_import ring_theory.witt_vector.init_tail from "leanprover-community/mathlib"@"0798037604b2d91748f9b43925fb7570a5f3256c"
variable {p : ℕ} [hp : Fact p.Prime] (n : ℕ) {R : Type*} [CommRing R]
-- type as `\bbW`
local notation "𝕎" => WittVector p
namespace WittVector
open MvPolynomial
open scoped Classical
noncomputable section
section
def select (P : ℕ → Prop) (x : 𝕎 R) : 𝕎 R :=
mk p fun n => if P n then x.coeff n else 0
#align witt_vector.select WittVector.select
section Select
variable (P : ℕ → Prop)
def selectPoly (n : ℕ) : MvPolynomial ℕ ℤ :=
if P n then X n else 0
#align witt_vector.select_poly WittVector.selectPoly
| Mathlib/RingTheory/WittVector/InitTail.lean | 72 | 77 | theorem coeff_select (x : 𝕎 R) (n : ℕ) :
(select P x).coeff n = aeval x.coeff (selectPoly P n) := by |
dsimp [select, selectPoly]
split_ifs with hi
· rw [aeval_X, mk]; simp only [hi]; rfl
· rw [AlgHom.map_zero, mk]; simp only [hi]; rfl
| 4 | 54.59815 | 2 | 2 | 3 | 2,250 |
import Mathlib.RingTheory.WittVector.Basic
import Mathlib.RingTheory.WittVector.IsPoly
#align_import ring_theory.witt_vector.init_tail from "leanprover-community/mathlib"@"0798037604b2d91748f9b43925fb7570a5f3256c"
variable {p : ℕ} [hp : Fact p.Prime] (n : ℕ) {R : Type*} [CommRing R]
-- type as `\bbW`
local notation "𝕎" => WittVector p
namespace WittVector
open MvPolynomial
open scoped Classical
noncomputable section
section
def select (P : ℕ → Prop) (x : 𝕎 R) : 𝕎 R :=
mk p fun n => if P n then x.coeff n else 0
#align witt_vector.select WittVector.select
section Select
variable (P : ℕ → Prop)
def selectPoly (n : ℕ) : MvPolynomial ℕ ℤ :=
if P n then X n else 0
#align witt_vector.select_poly WittVector.selectPoly
theorem coeff_select (x : 𝕎 R) (n : ℕ) :
(select P x).coeff n = aeval x.coeff (selectPoly P n) := by
dsimp [select, selectPoly]
split_ifs with hi
· rw [aeval_X, mk]; simp only [hi]; rfl
· rw [AlgHom.map_zero, mk]; simp only [hi]; rfl
#align witt_vector.coeff_select WittVector.coeff_select
-- Porting note: replaced `@[is_poly]` with `instance`. Made the argument `P` implicit in doing so.
instance select_isPoly {P : ℕ → Prop} : IsPoly p fun _ _ x => select P x := by
use selectPoly P
rintro R _Rcr x
funext i
apply coeff_select
#align witt_vector.select_is_poly WittVector.select_isPoly
| Mathlib/RingTheory/WittVector/InitTail.lean | 88 | 109 | theorem select_add_select_not : ∀ x : 𝕎 R, select P x + select (fun i => ¬P i) x = x := by |
-- Porting note: TC search was insufficient to find this instance, even though all required
-- instances exist. See zulip: [https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/WittVector.20saga/near/370073526]
have : IsPoly p fun {R} [CommRing R] x ↦ select P x + select (fun i ↦ ¬P i) x :=
IsPoly₂.diag (hf := IsPoly₂.comp)
ghost_calc x
intro n
simp only [RingHom.map_add]
suffices
(bind₁ (selectPoly P)) (wittPolynomial p ℤ n) +
(bind₁ (selectPoly fun i => ¬P i)) (wittPolynomial p ℤ n) =
wittPolynomial p ℤ n by
apply_fun aeval x.coeff at this
simpa only [AlgHom.map_add, aeval_bind₁, ← coeff_select]
simp only [wittPolynomial_eq_sum_C_mul_X_pow, selectPoly, AlgHom.map_sum, AlgHom.map_pow,
AlgHom.map_mul, bind₁_X_right, bind₁_C_right, ← Finset.sum_add_distrib, ← mul_add]
apply Finset.sum_congr rfl
refine fun m _ => mul_eq_mul_left_iff.mpr (Or.inl ?_)
rw [ite_pow, zero_pow (pow_ne_zero _ hp.out.ne_zero)]
by_cases Pm : P m
· rw [if_pos Pm, if_neg $ not_not_intro Pm, zero_pow Fin.size_pos'.ne', add_zero]
· rwa [if_neg Pm, if_pos, zero_add]
| 21 | 1,318,815,734.483215 | 2 | 2 | 3 | 2,250 |
import Mathlib.RingTheory.WittVector.Basic
import Mathlib.RingTheory.WittVector.IsPoly
#align_import ring_theory.witt_vector.init_tail from "leanprover-community/mathlib"@"0798037604b2d91748f9b43925fb7570a5f3256c"
variable {p : ℕ} [hp : Fact p.Prime] (n : ℕ) {R : Type*} [CommRing R]
-- type as `\bbW`
local notation "𝕎" => WittVector p
namespace WittVector
open MvPolynomial
open scoped Classical
noncomputable section
section
def select (P : ℕ → Prop) (x : 𝕎 R) : 𝕎 R :=
mk p fun n => if P n then x.coeff n else 0
#align witt_vector.select WittVector.select
section Select
variable (P : ℕ → Prop)
def selectPoly (n : ℕ) : MvPolynomial ℕ ℤ :=
if P n then X n else 0
#align witt_vector.select_poly WittVector.selectPoly
theorem coeff_select (x : 𝕎 R) (n : ℕ) :
(select P x).coeff n = aeval x.coeff (selectPoly P n) := by
dsimp [select, selectPoly]
split_ifs with hi
· rw [aeval_X, mk]; simp only [hi]; rfl
· rw [AlgHom.map_zero, mk]; simp only [hi]; rfl
#align witt_vector.coeff_select WittVector.coeff_select
-- Porting note: replaced `@[is_poly]` with `instance`. Made the argument `P` implicit in doing so.
instance select_isPoly {P : ℕ → Prop} : IsPoly p fun _ _ x => select P x := by
use selectPoly P
rintro R _Rcr x
funext i
apply coeff_select
#align witt_vector.select_is_poly WittVector.select_isPoly
theorem select_add_select_not : ∀ x : 𝕎 R, select P x + select (fun i => ¬P i) x = x := by
-- Porting note: TC search was insufficient to find this instance, even though all required
-- instances exist. See zulip: [https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/WittVector.20saga/near/370073526]
have : IsPoly p fun {R} [CommRing R] x ↦ select P x + select (fun i ↦ ¬P i) x :=
IsPoly₂.diag (hf := IsPoly₂.comp)
ghost_calc x
intro n
simp only [RingHom.map_add]
suffices
(bind₁ (selectPoly P)) (wittPolynomial p ℤ n) +
(bind₁ (selectPoly fun i => ¬P i)) (wittPolynomial p ℤ n) =
wittPolynomial p ℤ n by
apply_fun aeval x.coeff at this
simpa only [AlgHom.map_add, aeval_bind₁, ← coeff_select]
simp only [wittPolynomial_eq_sum_C_mul_X_pow, selectPoly, AlgHom.map_sum, AlgHom.map_pow,
AlgHom.map_mul, bind₁_X_right, bind₁_C_right, ← Finset.sum_add_distrib, ← mul_add]
apply Finset.sum_congr rfl
refine fun m _ => mul_eq_mul_left_iff.mpr (Or.inl ?_)
rw [ite_pow, zero_pow (pow_ne_zero _ hp.out.ne_zero)]
by_cases Pm : P m
· rw [if_pos Pm, if_neg $ not_not_intro Pm, zero_pow Fin.size_pos'.ne', add_zero]
· rwa [if_neg Pm, if_pos, zero_add]
#align witt_vector.select_add_select_not WittVector.select_add_select_not
| Mathlib/RingTheory/WittVector/InitTail.lean | 112 | 133 | theorem coeff_add_of_disjoint (x y : 𝕎 R) (h : ∀ n, x.coeff n = 0 ∨ y.coeff n = 0) :
(x + y).coeff n = x.coeff n + y.coeff n := by |
let P : ℕ → Prop := fun n => y.coeff n = 0
haveI : DecidablePred P := Classical.decPred P
set z := mk p fun n => if P n then x.coeff n else y.coeff n
have hx : select P z = x := by
ext1 n; rw [select, coeff_mk, coeff_mk]
split_ifs with hn
· rfl
· rw [(h n).resolve_right hn]
have hy : select (fun i => ¬P i) z = y := by
ext1 n; rw [select, coeff_mk, coeff_mk]
split_ifs with hn
· exact hn.symm
· rfl
calc
(x + y).coeff n = z.coeff n := by rw [← hx, ← hy, select_add_select_not P z]
_ = x.coeff n + y.coeff n := by
simp only [z, mk.eq_1]
split_ifs with y0
· rw [y0, add_zero]
· rw [h n |>.resolve_right y0, zero_add]
| 20 | 485,165,195.40979 | 2 | 2 | 3 | 2,250 |
import Mathlib.LinearAlgebra.TensorProduct.RightExactness
import Mathlib.LinearAlgebra.TensorProduct.Finiteness
universe u
variable (R : Type u) [CommRing R]
variable {M : Type u} [AddCommGroup M] [Module R M]
variable {N : Type u} [AddCommGroup N] [Module R N]
open Classical DirectSum LinearMap Function Submodule
namespace TensorProduct
variable {ι : Type u} [Fintype ι] {m : ι → M} {n : ι → N}
variable (m n) in
abbrev VanishesTrivially : Prop :=
∃ (κ : Type u) (_ : Fintype κ) (a : ι → κ → R) (y : κ → N),
(∀ i, n i = ∑ j, a i j • y j) ∧ ∀ j, ∑ i, a i j • m i = 0
| Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean | 89 | 94 | theorem sum_tmul_eq_zero_of_vanishesTrivially (hmn : VanishesTrivially R m n) :
∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N) := by |
obtain ⟨κ, _, a, y, h₁, h₂⟩ := hmn
simp_rw [h₁, tmul_sum, tmul_smul]
rw [Finset.sum_comm]
simp_rw [← tmul_smul, ← smul_tmul, ← sum_tmul, h₂, zero_tmul, Finset.sum_const_zero]
| 4 | 54.59815 | 2 | 2 | 3 | 2,251 |
import Mathlib.LinearAlgebra.TensorProduct.RightExactness
import Mathlib.LinearAlgebra.TensorProduct.Finiteness
universe u
variable (R : Type u) [CommRing R]
variable {M : Type u} [AddCommGroup M] [Module R M]
variable {N : Type u} [AddCommGroup N] [Module R N]
open Classical DirectSum LinearMap Function Submodule
namespace TensorProduct
variable {ι : Type u} [Fintype ι] {m : ι → M} {n : ι → N}
variable (m n) in
abbrev VanishesTrivially : Prop :=
∃ (κ : Type u) (_ : Fintype κ) (a : ι → κ → R) (y : κ → N),
(∀ i, n i = ∑ j, a i j • y j) ∧ ∀ j, ∑ i, a i j • m i = 0
theorem sum_tmul_eq_zero_of_vanishesTrivially (hmn : VanishesTrivially R m n) :
∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N) := by
obtain ⟨κ, _, a, y, h₁, h₂⟩ := hmn
simp_rw [h₁, tmul_sum, tmul_smul]
rw [Finset.sum_comm]
simp_rw [← tmul_smul, ← smul_tmul, ← sum_tmul, h₂, zero_tmul, Finset.sum_const_zero]
| Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean | 102 | 157 | theorem vanishesTrivially_of_sum_tmul_eq_zero (hm : Submodule.span R (Set.range m) = ⊤)
(hmn : ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N)) : VanishesTrivially R m n := by |
-- Define a map $G \colon R^\iota \to M$ whose matrix entries are the $m_i$. It is surjective.
set G : (ι →₀ R) →ₗ[R] M := Finsupp.total ι M R m with hG
have G_basis_eq (i : ι) : G (Finsupp.single i 1) = m i := by simp [hG, toModule_lof]
have G_surjective : Surjective G := by
apply LinearMap.range_eq_top.mp
apply top_le_iff.mp
rw [← hm]
apply Submodule.span_le.mpr
rintro _ ⟨i, rfl⟩
use Finsupp.single i 1, G_basis_eq i
/- Consider the element $\sum_i e_i \otimes n_i$ of $R^\iota \otimes N$. It is in the kernel of
$R^\iota \otimes N \to M \otimes N$. -/
set en : (ι →₀ R) ⊗[R] N := ∑ i, Finsupp.single i 1 ⊗ₜ n i with hen
have en_mem_ker : en ∈ ker (rTensor N G) := by simp [hen, G_basis_eq, hmn]
-- We have an exact sequence $\ker G \to R^\iota \to M \to 0$.
have exact_ker_subtype : Exact (ker G).subtype G := G.exact_subtype_ker_map
-- Tensor the exact sequence with $N$.
have exact_rTensor_ker_subtype : Exact (rTensor N (ker G).subtype) (rTensor N G) :=
rTensor_exact (M := ↥(ker G)) N exact_ker_subtype G_surjective
/- We conclude that $\sum_i e_i \otimes n_i$ is in the range of
$\ker G \otimes N \to R^\iota \otimes N$. -/
have en_mem_range : en ∈ range (rTensor N (ker G).subtype) :=
exact_rTensor_ker_subtype.linearMap_ker_eq ▸ en_mem_ker
/- There is an element of in $\ker G \otimes N$ that maps to $\sum_i e_i \otimes n_i$.
Write it as a finite sum of pure tensors. -/
obtain ⟨kn, hkn⟩ := en_mem_range
obtain ⟨ma, rfl : kn = ∑ kj ∈ ma, kj.1 ⊗ₜ[R] kj.2⟩ := exists_finset kn
use ↑↑ma, FinsetCoe.fintype ma
/- Let $\sum_j k_j \otimes y_j$ be the sum obtained in the previous step.
In order to show that $\sum_i m_i \otimes n_i$ vanishes trivially, it suffices to prove that there
exist $(a_{ij})_{i, j}$ such that for all $i$,
$$n_i = \sum_j a_{ij} y_j$$
and for all $j$,
$$\sum_{i} a_{ij} m_i = 0.$$
For this, take $a_{ij}$ to be the coefficient of $e_i$ in $k_j$. -/
use fun i ⟨⟨kj, _⟩, _⟩ ↦ (kj : ι →₀ R) i
use fun ⟨⟨_, yj⟩, _⟩ ↦ yj
constructor
· intro i
apply_fun finsuppScalarLeft R N ι at hkn
apply_fun (· i) at hkn
symm at hkn
simp only [map_sum, finsuppScalarLeft_apply_tmul, zero_smul, Finsupp.single_zero,
Finsupp.sum_single_index, one_smul, Finsupp.finset_sum_apply, Finsupp.single_apply,
Finset.sum_ite_eq', Finset.mem_univ, ↓reduceIte, rTensor_tmul, coeSubtype, Finsupp.sum_apply,
Finsupp.sum_ite_eq', Finsupp.mem_support_iff, ne_eq, ite_not, en] at hkn
simp only [Finset.univ_eq_attach, Finset.sum_attach ma (fun x ↦ (x.1 : ι →₀ R) i • x.2)]
convert hkn using 2 with x _
split
· next h'x => rw [h'x, zero_smul]
· rfl
· rintro ⟨⟨⟨k, hk⟩, _⟩, _⟩
simpa only [hG, Finsupp.total_apply, zero_smul, implies_true, Finsupp.sum_fintype] using
mem_ker.mp hk
| 54 | 283,075,330,327,469,400,000,000 | 2 | 2 | 3 | 2,251 |
import Mathlib.LinearAlgebra.TensorProduct.RightExactness
import Mathlib.LinearAlgebra.TensorProduct.Finiteness
universe u
variable (R : Type u) [CommRing R]
variable {M : Type u} [AddCommGroup M] [Module R M]
variable {N : Type u} [AddCommGroup N] [Module R N]
open Classical DirectSum LinearMap Function Submodule
namespace TensorProduct
variable {ι : Type u} [Fintype ι] {m : ι → M} {n : ι → N}
variable (m n) in
abbrev VanishesTrivially : Prop :=
∃ (κ : Type u) (_ : Fintype κ) (a : ι → κ → R) (y : κ → N),
(∀ i, n i = ∑ j, a i j • y j) ∧ ∀ j, ∑ i, a i j • m i = 0
theorem sum_tmul_eq_zero_of_vanishesTrivially (hmn : VanishesTrivially R m n) :
∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N) := by
obtain ⟨κ, _, a, y, h₁, h₂⟩ := hmn
simp_rw [h₁, tmul_sum, tmul_smul]
rw [Finset.sum_comm]
simp_rw [← tmul_smul, ← smul_tmul, ← sum_tmul, h₂, zero_tmul, Finset.sum_const_zero]
theorem vanishesTrivially_of_sum_tmul_eq_zero (hm : Submodule.span R (Set.range m) = ⊤)
(hmn : ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N)) : VanishesTrivially R m n := by
-- Define a map $G \colon R^\iota \to M$ whose matrix entries are the $m_i$. It is surjective.
set G : (ι →₀ R) →ₗ[R] M := Finsupp.total ι M R m with hG
have G_basis_eq (i : ι) : G (Finsupp.single i 1) = m i := by simp [hG, toModule_lof]
have G_surjective : Surjective G := by
apply LinearMap.range_eq_top.mp
apply top_le_iff.mp
rw [← hm]
apply Submodule.span_le.mpr
rintro _ ⟨i, rfl⟩
use Finsupp.single i 1, G_basis_eq i
set en : (ι →₀ R) ⊗[R] N := ∑ i, Finsupp.single i 1 ⊗ₜ n i with hen
have en_mem_ker : en ∈ ker (rTensor N G) := by simp [hen, G_basis_eq, hmn]
-- We have an exact sequence $\ker G \to R^\iota \to M \to 0$.
have exact_ker_subtype : Exact (ker G).subtype G := G.exact_subtype_ker_map
-- Tensor the exact sequence with $N$.
have exact_rTensor_ker_subtype : Exact (rTensor N (ker G).subtype) (rTensor N G) :=
rTensor_exact (M := ↥(ker G)) N exact_ker_subtype G_surjective
have en_mem_range : en ∈ range (rTensor N (ker G).subtype) :=
exact_rTensor_ker_subtype.linearMap_ker_eq ▸ en_mem_ker
obtain ⟨kn, hkn⟩ := en_mem_range
obtain ⟨ma, rfl : kn = ∑ kj ∈ ma, kj.1 ⊗ₜ[R] kj.2⟩ := exists_finset kn
use ↑↑ma, FinsetCoe.fintype ma
use fun i ⟨⟨kj, _⟩, _⟩ ↦ (kj : ι →₀ R) i
use fun ⟨⟨_, yj⟩, _⟩ ↦ yj
constructor
· intro i
apply_fun finsuppScalarLeft R N ι at hkn
apply_fun (· i) at hkn
symm at hkn
simp only [map_sum, finsuppScalarLeft_apply_tmul, zero_smul, Finsupp.single_zero,
Finsupp.sum_single_index, one_smul, Finsupp.finset_sum_apply, Finsupp.single_apply,
Finset.sum_ite_eq', Finset.mem_univ, ↓reduceIte, rTensor_tmul, coeSubtype, Finsupp.sum_apply,
Finsupp.sum_ite_eq', Finsupp.mem_support_iff, ne_eq, ite_not, en] at hkn
simp only [Finset.univ_eq_attach, Finset.sum_attach ma (fun x ↦ (x.1 : ι →₀ R) i • x.2)]
convert hkn using 2 with x _
split
· next h'x => rw [h'x, zero_smul]
· rfl
· rintro ⟨⟨⟨k, hk⟩, _⟩, _⟩
simpa only [hG, Finsupp.total_apply, zero_smul, implies_true, Finsupp.sum_fintype] using
mem_ker.mp hk
theorem vanishesTrivially_iff_sum_tmul_eq_zero (hm : Submodule.span R (Set.range m) = ⊤) :
VanishesTrivially R m n ↔ ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N) :=
⟨sum_tmul_eq_zero_of_vanishesTrivially R, vanishesTrivially_of_sum_tmul_eq_zero R hm⟩
| Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean | 175 | 192 | theorem vanishesTrivially_of_sum_tmul_eq_zero_of_rTensor_injective
(hm : Injective (rTensor N (span R (Set.range m)).subtype))
(hmn : ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N)) : VanishesTrivially R m n := by |
-- Restrict `m` on the codomain to $M'$, then apply `vanishesTrivially_of_sum_tmul_eq_zero`.
have mem_M' i : m i ∈ span R (Set.range m) := subset_span ⟨i, rfl⟩
set m' : ι → span R (Set.range m) := Subtype.coind m mem_M' with m'_eq
have hm' : span R (Set.range m') = ⊤ := by
apply map_injective_of_injective (injective_subtype (span R (Set.range m)))
rw [Submodule.map_span, Submodule.map_top, range_subtype, coeSubtype, ← Set.range_comp]
rfl
have hm'n : ∑ i, m' i ⊗ₜ n i = (0 : span R (Set.range m) ⊗[R] N) := by
apply hm
simp only [m'_eq, map_sum, rTensor_tmul, coeSubtype, Subtype.coind_coe, _root_.map_zero, hmn]
have : VanishesTrivially R m' n := vanishesTrivially_of_sum_tmul_eq_zero R hm' hm'n
unfold VanishesTrivially at this ⊢
convert this with κ _ a y j
convert (injective_iff_map_eq_zero' _).mp (injective_subtype (span R (Set.range m))) _
simp [m'_eq]
| 15 | 3,269,017.372472 | 2 | 2 | 3 | 2,251 |
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp
import Mathlib.Topology.UrysohnsLemma
import Mathlib.MeasureTheory.Integral.Bochner
#align_import measure_theory.function.continuous_map_dense from "leanprover-community/mathlib"@"e0736bb5b48bdadbca19dbd857e12bee38ccfbb8"
open scoped ENNReal NNReal Topology BoundedContinuousFunction
open MeasureTheory TopologicalSpace ContinuousMap Set Bornology
variable {α : Type*} [MeasurableSpace α] [TopologicalSpace α] [T4Space α] [BorelSpace α]
variable {E : Type*} [NormedAddCommGroup E] {μ : Measure α} {p : ℝ≥0∞}
namespace MeasureTheory
variable [NormedSpace ℝ E]
| Mathlib/MeasureTheory/Function/ContinuousMapDense.lean | 78 | 134 | theorem exists_continuous_snorm_sub_le_of_closed [μ.OuterRegular] (hp : p ≠ ∞) {s u : Set α}
(s_closed : IsClosed s) (u_open : IsOpen u) (hsu : s ⊆ u) (hs : μ s ≠ ∞) (c : E) {ε : ℝ≥0∞}
(hε : ε ≠ 0) :
∃ f : α → E,
Continuous f ∧
snorm (fun x => f x - s.indicator (fun _y => c) x) p μ ≤ ε ∧
(∀ x, ‖f x‖ ≤ ‖c‖) ∧ Function.support f ⊆ u ∧ Memℒp f p μ := by |
obtain ⟨η, η_pos, hη⟩ :
∃ η : ℝ≥0, 0 < η ∧ ∀ s : Set α, μ s ≤ η → snorm (s.indicator fun _x => c) p μ ≤ ε :=
exists_snorm_indicator_le hp c hε
have ηpos : (0 : ℝ≥0∞) < η := ENNReal.coe_lt_coe.2 η_pos
obtain ⟨V, sV, V_open, h'V, hV⟩ : ∃ (V : Set α), V ⊇ s ∧ IsOpen V ∧ μ V < ∞ ∧ μ (V \ s) < η :=
s_closed.measurableSet.exists_isOpen_diff_lt hs ηpos.ne'
let v := u ∩ V
have hsv : s ⊆ v := subset_inter hsu sV
have hμv : μ v < ∞ := (measure_mono inter_subset_right).trans_lt h'V
obtain ⟨g, hgv, hgs, hg_range⟩ :=
exists_continuous_zero_one_of_isClosed (u_open.inter V_open).isClosed_compl s_closed
(disjoint_compl_left_iff.2 hsv)
-- Multiply this by `c` to get a continuous approximation to the function `f`; the key point is
-- that this is pointwise bounded by the indicator of the set `v \ s`, which has small measure.
have g_norm : ∀ x, ‖g x‖ = g x := fun x => by rw [Real.norm_eq_abs, abs_of_nonneg (hg_range x).1]
have gc_bd0 : ∀ x, ‖g x • c‖ ≤ ‖c‖ := by
intro x
simp only [norm_smul, g_norm x]
apply mul_le_of_le_one_left (norm_nonneg _)
exact (hg_range x).2
have gc_bd :
∀ x, ‖g x • c - s.indicator (fun _x => c) x‖ ≤ ‖(v \ s).indicator (fun _x => c) x‖ := by
intro x
by_cases hv : x ∈ v
· rw [← Set.diff_union_of_subset hsv] at hv
cases' hv with hsv hs
· simpa only [hsv.2, Set.indicator_of_not_mem, not_false_iff, sub_zero, hsv,
Set.indicator_of_mem] using gc_bd0 x
· simp [hgs hs, hs]
· simp [hgv hv, show x ∉ s from fun h => hv (hsv h)]
have gc_support : (Function.support fun x : α => g x • c) ⊆ v := by
refine Function.support_subset_iff'.2 fun x hx => ?_
simp only [hgv hx, Pi.zero_apply, zero_smul]
have gc_mem : Memℒp (fun x => g x • c) p μ := by
refine Memℒp.smul_of_top_left (memℒp_top_const _) ?_
refine ⟨g.continuous.aestronglyMeasurable, ?_⟩
have : snorm (v.indicator fun _x => (1 : ℝ)) p μ < ⊤ := by
refine (snorm_indicator_const_le _ _).trans_lt ?_
simp only [lt_top_iff_ne_top, hμv.ne, nnnorm_one, ENNReal.coe_one, one_div, one_mul, Ne,
ENNReal.rpow_eq_top_iff, inv_lt_zero, false_and_iff, or_false_iff, not_and, not_lt,
ENNReal.toReal_nonneg, imp_true_iff]
refine (snorm_mono fun x => ?_).trans_lt this
by_cases hx : x ∈ v
· simp only [hx, abs_of_nonneg (hg_range x).1, (hg_range x).2, Real.norm_eq_abs,
indicator_of_mem, CstarRing.norm_one]
· simp only [hgv hx, Pi.zero_apply, Real.norm_eq_abs, abs_zero, abs_nonneg]
refine
⟨fun x => g x • c, g.continuous.smul continuous_const, (snorm_mono gc_bd).trans ?_, gc_bd0,
gc_support.trans inter_subset_left, gc_mem⟩
exact hη _ ((measure_mono (diff_subset_diff inter_subset_right Subset.rfl)).trans hV.le)
| 50 | 5,184,705,528,587,073,000,000 | 2 | 2 | 2 | 2,252 |
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp
import Mathlib.Topology.UrysohnsLemma
import Mathlib.MeasureTheory.Integral.Bochner
#align_import measure_theory.function.continuous_map_dense from "leanprover-community/mathlib"@"e0736bb5b48bdadbca19dbd857e12bee38ccfbb8"
open scoped ENNReal NNReal Topology BoundedContinuousFunction
open MeasureTheory TopologicalSpace ContinuousMap Set Bornology
variable {α : Type*} [MeasurableSpace α] [TopologicalSpace α] [T4Space α] [BorelSpace α]
variable {E : Type*} [NormedAddCommGroup E] {μ : Measure α} {p : ℝ≥0∞}
namespace MeasureTheory
variable [NormedSpace ℝ E]
theorem exists_continuous_snorm_sub_le_of_closed [μ.OuterRegular] (hp : p ≠ ∞) {s u : Set α}
(s_closed : IsClosed s) (u_open : IsOpen u) (hsu : s ⊆ u) (hs : μ s ≠ ∞) (c : E) {ε : ℝ≥0∞}
(hε : ε ≠ 0) :
∃ f : α → E,
Continuous f ∧
snorm (fun x => f x - s.indicator (fun _y => c) x) p μ ≤ ε ∧
(∀ x, ‖f x‖ ≤ ‖c‖) ∧ Function.support f ⊆ u ∧ Memℒp f p μ := by
obtain ⟨η, η_pos, hη⟩ :
∃ η : ℝ≥0, 0 < η ∧ ∀ s : Set α, μ s ≤ η → snorm (s.indicator fun _x => c) p μ ≤ ε :=
exists_snorm_indicator_le hp c hε
have ηpos : (0 : ℝ≥0∞) < η := ENNReal.coe_lt_coe.2 η_pos
obtain ⟨V, sV, V_open, h'V, hV⟩ : ∃ (V : Set α), V ⊇ s ∧ IsOpen V ∧ μ V < ∞ ∧ μ (V \ s) < η :=
s_closed.measurableSet.exists_isOpen_diff_lt hs ηpos.ne'
let v := u ∩ V
have hsv : s ⊆ v := subset_inter hsu sV
have hμv : μ v < ∞ := (measure_mono inter_subset_right).trans_lt h'V
obtain ⟨g, hgv, hgs, hg_range⟩ :=
exists_continuous_zero_one_of_isClosed (u_open.inter V_open).isClosed_compl s_closed
(disjoint_compl_left_iff.2 hsv)
-- Multiply this by `c` to get a continuous approximation to the function `f`; the key point is
-- that this is pointwise bounded by the indicator of the set `v \ s`, which has small measure.
have g_norm : ∀ x, ‖g x‖ = g x := fun x => by rw [Real.norm_eq_abs, abs_of_nonneg (hg_range x).1]
have gc_bd0 : ∀ x, ‖g x • c‖ ≤ ‖c‖ := by
intro x
simp only [norm_smul, g_norm x]
apply mul_le_of_le_one_left (norm_nonneg _)
exact (hg_range x).2
have gc_bd :
∀ x, ‖g x • c - s.indicator (fun _x => c) x‖ ≤ ‖(v \ s).indicator (fun _x => c) x‖ := by
intro x
by_cases hv : x ∈ v
· rw [← Set.diff_union_of_subset hsv] at hv
cases' hv with hsv hs
· simpa only [hsv.2, Set.indicator_of_not_mem, not_false_iff, sub_zero, hsv,
Set.indicator_of_mem] using gc_bd0 x
· simp [hgs hs, hs]
· simp [hgv hv, show x ∉ s from fun h => hv (hsv h)]
have gc_support : (Function.support fun x : α => g x • c) ⊆ v := by
refine Function.support_subset_iff'.2 fun x hx => ?_
simp only [hgv hx, Pi.zero_apply, zero_smul]
have gc_mem : Memℒp (fun x => g x • c) p μ := by
refine Memℒp.smul_of_top_left (memℒp_top_const _) ?_
refine ⟨g.continuous.aestronglyMeasurable, ?_⟩
have : snorm (v.indicator fun _x => (1 : ℝ)) p μ < ⊤ := by
refine (snorm_indicator_const_le _ _).trans_lt ?_
simp only [lt_top_iff_ne_top, hμv.ne, nnnorm_one, ENNReal.coe_one, one_div, one_mul, Ne,
ENNReal.rpow_eq_top_iff, inv_lt_zero, false_and_iff, or_false_iff, not_and, not_lt,
ENNReal.toReal_nonneg, imp_true_iff]
refine (snorm_mono fun x => ?_).trans_lt this
by_cases hx : x ∈ v
· simp only [hx, abs_of_nonneg (hg_range x).1, (hg_range x).2, Real.norm_eq_abs,
indicator_of_mem, CstarRing.norm_one]
· simp only [hgv hx, Pi.zero_apply, Real.norm_eq_abs, abs_zero, abs_nonneg]
refine
⟨fun x => g x • c, g.continuous.smul continuous_const, (snorm_mono gc_bd).trans ?_, gc_bd0,
gc_support.trans inter_subset_left, gc_mem⟩
exact hη _ ((measure_mono (diff_subset_diff inter_subset_right Subset.rfl)).trans hV.le)
#align measure_theory.exists_continuous_snorm_sub_le_of_closed MeasureTheory.exists_continuous_snorm_sub_le_of_closed
| Mathlib/MeasureTheory/Function/ContinuousMapDense.lean | 139 | 188 | theorem Memℒp.exists_hasCompactSupport_snorm_sub_le [WeaklyLocallyCompactSpace α] [μ.Regular]
(hp : p ≠ ∞) {f : α → E} (hf : Memℒp f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
∃ g : α → E, HasCompactSupport g ∧ snorm (f - g) p μ ≤ ε ∧ Continuous g ∧ Memℒp g p μ := by |
suffices H :
∃ g : α → E, snorm (f - g) p μ ≤ ε ∧ Continuous g ∧ Memℒp g p μ ∧ HasCompactSupport g by
rcases H with ⟨g, hg, g_cont, g_mem, g_support⟩
exact ⟨g, g_support, hg, g_cont, g_mem⟩
-- It suffices to check that the set of functions we consider approximates characteristic
-- functions, is stable under addition and consists of ae strongly measurable functions.
-- First check the latter easy facts.
apply hf.induction_dense hp _ _ _ _ hε
rotate_left
-- stability under addition
· rintro f g ⟨f_cont, f_mem, hf⟩ ⟨g_cont, g_mem, hg⟩
exact ⟨f_cont.add g_cont, f_mem.add g_mem, hf.add hg⟩
-- ae strong measurability
· rintro f ⟨_f_cont, f_mem, _hf⟩
exact f_mem.aestronglyMeasurable
-- We are left with approximating characteristic functions.
-- This follows from `exists_continuous_snorm_sub_le_of_closed`.
intro c t ht htμ ε hε
rcases exists_Lp_half E μ p hε with ⟨δ, δpos, hδ⟩
obtain ⟨η, ηpos, hη⟩ :
∃ η : ℝ≥0, 0 < η ∧ ∀ s : Set α, μ s ≤ η → snorm (s.indicator fun _x => c) p μ ≤ δ :=
exists_snorm_indicator_le hp c δpos.ne'
have hη_pos' : (0 : ℝ≥0∞) < η := ENNReal.coe_pos.2 ηpos
obtain ⟨s, st, s_compact, μs⟩ : ∃ s, s ⊆ t ∧ IsCompact s ∧ μ (t \ s) < η :=
ht.exists_isCompact_diff_lt htμ.ne hη_pos'.ne'
have hsμ : μ s < ∞ := (measure_mono st).trans_lt htμ
have I1 : snorm ((s.indicator fun _y => c) - t.indicator fun _y => c) p μ ≤ δ := by
rw [← snorm_neg, neg_sub, ← indicator_diff st]
exact hη _ μs.le
obtain ⟨k, k_compact, sk⟩ : ∃ k : Set α, IsCompact k ∧ s ⊆ interior k :=
exists_compact_superset s_compact
rcases exists_continuous_snorm_sub_le_of_closed hp s_compact.isClosed isOpen_interior sk hsμ.ne c
δpos.ne' with
⟨f, f_cont, I2, _f_bound, f_support, f_mem⟩
have I3 : snorm (f - t.indicator fun _y => c) p μ ≤ ε := by
convert
(hδ _ _
(f_mem.aestronglyMeasurable.sub
(aestronglyMeasurable_const.indicator s_compact.measurableSet))
((aestronglyMeasurable_const.indicator s_compact.measurableSet).sub
(aestronglyMeasurable_const.indicator ht))
I2 I1).le using 2
simp only [sub_add_sub_cancel]
refine ⟨f, I3, f_cont, f_mem, HasCompactSupport.intro k_compact fun x hx => ?_⟩
rw [← Function.nmem_support]
contrapose! hx
exact interior_subset (f_support hx)
| 47 | 258,131,288,619,006,750,000 | 2 | 2 | 2 | 2,252 |
import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison
import Mathlib.CategoryTheory.Sites.Equivalence
namespace CategoryTheory
variable {C : Type*} [Category C]
open GrothendieckTopology
namespace Equivalence
variable {D : Type*} [Category D]
variable (e : C ≌ D)
section Coherent
variable [Precoherent C]
theorem precoherent : Precoherent D := e.inverse.reflects_precoherent
instance [EssentiallySmall C] :
Precoherent (SmallModel C) := (equivSmallModel C).precoherent
instance : haveI := precoherent e
e.TransportsGrothendieckTopology (coherentTopology C) (coherentTopology D) where
eq_inducedTopology := coherentTopology.eq_induced e.inverse
variable (A : Type*) [Category A]
@[simps!]
def sheafCongrPrecoherent : haveI := e.precoherent
Sheaf (coherentTopology C) A ≌ Sheaf (coherentTopology D) A := e.sheafCongr _ _ _
open Presheaf
| Mathlib/CategoryTheory/Sites/Coherent/Equivalence.lean | 55 | 60 | theorem precoherent_isSheaf_iff (F : Cᵒᵖ ⥤ A) : haveI := e.precoherent
IsSheaf (coherentTopology C) F ↔ IsSheaf (coherentTopology D) (e.inverse.op ⋙ F) := by |
refine ⟨fun hF ↦ ((e.sheafCongrPrecoherent A).functor.obj ⟨F, hF⟩).cond, fun hF ↦ ?_⟩
rw [isSheaf_of_iso_iff (P' := e.functor.op ⋙ e.inverse.op ⋙ F)]
· exact (e.sheafCongrPrecoherent A).inverse.obj ⟨e.inverse.op ⋙ F, hF⟩ |>.cond
· exact isoWhiskerRight e.op.unitIso F
| 4 | 54.59815 | 2 | 2 | 2 | 2,253 |
import Mathlib.CategoryTheory.Sites.Coherent.SheafComparison
import Mathlib.CategoryTheory.Sites.Equivalence
namespace CategoryTheory
variable {C : Type*} [Category C]
open GrothendieckTopology
namespace Equivalence
variable {D : Type*} [Category D]
variable (e : C ≌ D)
section Regular
variable [Preregular C]
theorem preregular : Preregular D := e.inverse.reflects_preregular
instance [EssentiallySmall C] :
Preregular (SmallModel C) := (equivSmallModel C).preregular
instance : haveI := preregular e
e.TransportsGrothendieckTopology (regularTopology C) (regularTopology D) where
eq_inducedTopology := regularTopology.eq_induced e.inverse
variable (A : Type*) [Category A]
@[simps!]
def sheafCongrPreregular : haveI := e.preregular
Sheaf (regularTopology C) A ≌ Sheaf (regularTopology D) A := e.sheafCongr _ _ _
open Presheaf
| Mathlib/CategoryTheory/Sites/Coherent/Equivalence.lean | 101 | 106 | theorem preregular_isSheaf_iff (F : Cᵒᵖ ⥤ A) : haveI := e.preregular
IsSheaf (regularTopology C) F ↔ IsSheaf (regularTopology D) (e.inverse.op ⋙ F) := by |
refine ⟨fun hF ↦ ((e.sheafCongrPreregular A).functor.obj ⟨F, hF⟩).cond, fun hF ↦ ?_⟩
rw [isSheaf_of_iso_iff (P' := e.functor.op ⋙ e.inverse.op ⋙ F)]
· exact (e.sheafCongrPreregular A).inverse.obj ⟨e.inverse.op ⋙ F, hF⟩ |>.cond
· exact isoWhiskerRight e.op.unitIso F
| 4 | 54.59815 | 2 | 2 | 2 | 2,253 |
import Mathlib.Algebra.MvPolynomial.Equiv
import Mathlib.Algebra.Polynomial.Eval
#align_import data.mv_polynomial.polynomial from "leanprover-community/mathlib"@"0b89934139d3be96f9dab477f10c20f9f93da580"
namespace MvPolynomial
variable {R S σ : Type*}
| Mathlib/Algebra/MvPolynomial/Polynomial.lean | 19 | 28 | theorem polynomial_eval_eval₂ [CommSemiring R] [CommSemiring S]
{x : S} (f : R →+* Polynomial S) (g : σ → Polynomial S) (p : MvPolynomial σ R) :
Polynomial.eval x (eval₂ f g p) =
eval₂ ((Polynomial.evalRingHom x).comp f) (fun s => Polynomial.eval x (g s)) p := by |
apply induction_on p
· simp
· intro p q hp hq
simp [hp, hq]
· intro p n hp
simp [hp]
| 6 | 403.428793 | 2 | 2 | 2 | 2,254 |
import Mathlib.Algebra.MvPolynomial.Equiv
import Mathlib.Algebra.Polynomial.Eval
#align_import data.mv_polynomial.polynomial from "leanprover-community/mathlib"@"0b89934139d3be96f9dab477f10c20f9f93da580"
namespace MvPolynomial
variable {R S σ : Type*}
theorem polynomial_eval_eval₂ [CommSemiring R] [CommSemiring S]
{x : S} (f : R →+* Polynomial S) (g : σ → Polynomial S) (p : MvPolynomial σ R) :
Polynomial.eval x (eval₂ f g p) =
eval₂ ((Polynomial.evalRingHom x).comp f) (fun s => Polynomial.eval x (g s)) p := by
apply induction_on p
· simp
· intro p q hp hq
simp [hp, hq]
· intro p n hp
simp [hp]
| Mathlib/Algebra/MvPolynomial/Polynomial.lean | 30 | 40 | theorem eval_polynomial_eval_finSuccEquiv {n : ℕ} {x : Fin n → R}
[CommSemiring R] (f : MvPolynomial (Fin (n + 1)) R) (q : MvPolynomial (Fin n) R) :
(eval x) (Polynomial.eval q (finSuccEquiv R n f)) = eval (Fin.cases (eval x q) x) f := by |
simp only [finSuccEquiv_apply, coe_eval₂Hom, polynomial_eval_eval₂, eval_eval₂]
conv in RingHom.comp _ _ =>
refine @RingHom.ext _ _ _ _ _ (RingHom.id _) fun r => ?_
simp
simp only [eval₂_id]
congr
funext i
refine Fin.cases (by simp) (by simp) i
| 8 | 2,980.957987 | 2 | 2 | 2 | 2,254 |
import Mathlib.Algebra.Lie.Nilpotent
import Mathlib.Algebra.Lie.Normalizer
#align_import algebra.lie.engel from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
universe u₁ u₂ u₃ u₄
variable {R : Type u₁} {L : Type u₂} {L₂ : Type u₃} {M : Type u₄}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L₂] [LieAlgebra R L₂]
variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
namespace LieSubmodule
open LieModule
variable {I : LieIdeal R L} {x : L} (hxI : (R ∙ x) ⊔ I = ⊤)
| Mathlib/Algebra/Lie/Engel.lean | 82 | 86 | theorem exists_smul_add_of_span_sup_eq_top (y : L) : ∃ t : R, ∃ z ∈ I, y = t • x + z := by |
have hy : y ∈ (⊤ : Submodule R L) := Submodule.mem_top
simp only [← hxI, Submodule.mem_sup, Submodule.mem_span_singleton] at hy
obtain ⟨-, ⟨t, rfl⟩, z, hz, rfl⟩ := hy
exact ⟨t, z, hz, rfl⟩
| 4 | 54.59815 | 2 | 2 | 6 | 2,255 |
import Mathlib.Algebra.Lie.Nilpotent
import Mathlib.Algebra.Lie.Normalizer
#align_import algebra.lie.engel from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
universe u₁ u₂ u₃ u₄
variable {R : Type u₁} {L : Type u₂} {L₂ : Type u₃} {M : Type u₄}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L₂] [LieAlgebra R L₂]
variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
namespace LieSubmodule
open LieModule
variable {I : LieIdeal R L} {x : L} (hxI : (R ∙ x) ⊔ I = ⊤)
theorem exists_smul_add_of_span_sup_eq_top (y : L) : ∃ t : R, ∃ z ∈ I, y = t • x + z := by
have hy : y ∈ (⊤ : Submodule R L) := Submodule.mem_top
simp only [← hxI, Submodule.mem_sup, Submodule.mem_span_singleton] at hy
obtain ⟨-, ⟨t, rfl⟩, z, hz, rfl⟩ := hy
exact ⟨t, z, hz, rfl⟩
#align lie_submodule.exists_smul_add_of_span_sup_eq_top LieSubmodule.exists_smul_add_of_span_sup_eq_top
| Mathlib/Algebra/Lie/Engel.lean | 89 | 102 | theorem lie_top_eq_of_span_sup_eq_top (N : LieSubmodule R L M) :
(↑⁅(⊤ : LieIdeal R L), N⁆ : Submodule R M) =
(N : Submodule R M).map (toEnd R L M x) ⊔ (↑⁅I, N⁆ : Submodule R M) := by |
simp only [lieIdeal_oper_eq_linear_span', Submodule.sup_span, mem_top, exists_prop,
true_and, Submodule.map_coe, toEnd_apply_apply]
refine le_antisymm (Submodule.span_le.mpr ?_) (Submodule.span_mono fun z hz => ?_)
· rintro z ⟨y, n, hn : n ∈ N, rfl⟩
obtain ⟨t, z, hz, rfl⟩ := exists_smul_add_of_span_sup_eq_top hxI y
simp only [SetLike.mem_coe, Submodule.span_union, Submodule.mem_sup]
exact
⟨t • ⁅x, n⁆, Submodule.subset_span ⟨t • n, N.smul_mem' t hn, lie_smul t x n⟩, ⁅z, n⁆,
Submodule.subset_span ⟨z, hz, n, hn, rfl⟩, by simp⟩
· rcases hz with (⟨m, hm, rfl⟩ | ⟨y, -, m, hm, rfl⟩)
exacts [⟨x, m, hm, rfl⟩, ⟨y, m, hm, rfl⟩]
| 11 | 59,874.141715 | 2 | 2 | 6 | 2,255 |
import Mathlib.Algebra.Lie.Nilpotent
import Mathlib.Algebra.Lie.Normalizer
#align_import algebra.lie.engel from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
universe u₁ u₂ u₃ u₄
variable {R : Type u₁} {L : Type u₂} {L₂ : Type u₃} {M : Type u₄}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L₂] [LieAlgebra R L₂]
variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
namespace LieSubmodule
open LieModule
variable {I : LieIdeal R L} {x : L} (hxI : (R ∙ x) ⊔ I = ⊤)
theorem exists_smul_add_of_span_sup_eq_top (y : L) : ∃ t : R, ∃ z ∈ I, y = t • x + z := by
have hy : y ∈ (⊤ : Submodule R L) := Submodule.mem_top
simp only [← hxI, Submodule.mem_sup, Submodule.mem_span_singleton] at hy
obtain ⟨-, ⟨t, rfl⟩, z, hz, rfl⟩ := hy
exact ⟨t, z, hz, rfl⟩
#align lie_submodule.exists_smul_add_of_span_sup_eq_top LieSubmodule.exists_smul_add_of_span_sup_eq_top
theorem lie_top_eq_of_span_sup_eq_top (N : LieSubmodule R L M) :
(↑⁅(⊤ : LieIdeal R L), N⁆ : Submodule R M) =
(N : Submodule R M).map (toEnd R L M x) ⊔ (↑⁅I, N⁆ : Submodule R M) := by
simp only [lieIdeal_oper_eq_linear_span', Submodule.sup_span, mem_top, exists_prop,
true_and, Submodule.map_coe, toEnd_apply_apply]
refine le_antisymm (Submodule.span_le.mpr ?_) (Submodule.span_mono fun z hz => ?_)
· rintro z ⟨y, n, hn : n ∈ N, rfl⟩
obtain ⟨t, z, hz, rfl⟩ := exists_smul_add_of_span_sup_eq_top hxI y
simp only [SetLike.mem_coe, Submodule.span_union, Submodule.mem_sup]
exact
⟨t • ⁅x, n⁆, Submodule.subset_span ⟨t • n, N.smul_mem' t hn, lie_smul t x n⟩, ⁅z, n⁆,
Submodule.subset_span ⟨z, hz, n, hn, rfl⟩, by simp⟩
· rcases hz with (⟨m, hm, rfl⟩ | ⟨y, -, m, hm, rfl⟩)
exacts [⟨x, m, hm, rfl⟩, ⟨y, m, hm, rfl⟩]
#align lie_submodule.lie_top_eq_of_span_sup_eq_top LieSubmodule.lie_top_eq_of_span_sup_eq_top
| Mathlib/Algebra/Lie/Engel.lean | 105 | 125 | theorem lcs_le_lcs_of_is_nilpotent_span_sup_eq_top {n i j : ℕ}
(hxn : toEnd R L M x ^ n = 0) (hIM : lowerCentralSeries R L M i ≤ I.lcs M j) :
lowerCentralSeries R L M (i + n) ≤ I.lcs M (j + 1) := by |
suffices
∀ l,
((⊤ : LieIdeal R L).lcs M (i + l) : Submodule R M) ≤
(I.lcs M j : Submodule R M).map (toEnd R L M x ^ l) ⊔
(I.lcs M (j + 1) : Submodule R M)
by simpa only [bot_sup_eq, LieIdeal.incl_coe, Submodule.map_zero, hxn] using this n
intro l
induction' l with l ih
· simp only [Nat.zero_eq, add_zero, LieIdeal.lcs_succ, pow_zero, LinearMap.one_eq_id,
Submodule.map_id]
exact le_sup_of_le_left hIM
· simp only [LieIdeal.lcs_succ, i.add_succ l, lie_top_eq_of_span_sup_eq_top hxI, sup_le_iff]
refine ⟨(Submodule.map_mono ih).trans ?_, le_sup_of_le_right ?_⟩
· rw [Submodule.map_sup, ← Submodule.map_comp, ← LinearMap.mul_eq_comp, ← pow_succ', ←
I.lcs_succ]
exact sup_le_sup_left coe_map_toEnd_le _
· refine le_trans (mono_lie_right _ _ I ?_) (mono_lie_right _ _ I hIM)
exact antitone_lowerCentralSeries R L M le_self_add
| 18 | 65,659,969.137331 | 2 | 2 | 6 | 2,255 |
import Mathlib.Algebra.Lie.Nilpotent
import Mathlib.Algebra.Lie.Normalizer
#align_import algebra.lie.engel from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
universe u₁ u₂ u₃ u₄
variable {R : Type u₁} {L : Type u₂} {L₂ : Type u₃} {M : Type u₄}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L₂] [LieAlgebra R L₂]
variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
namespace LieSubmodule
open LieModule
variable {I : LieIdeal R L} {x : L} (hxI : (R ∙ x) ⊔ I = ⊤)
theorem exists_smul_add_of_span_sup_eq_top (y : L) : ∃ t : R, ∃ z ∈ I, y = t • x + z := by
have hy : y ∈ (⊤ : Submodule R L) := Submodule.mem_top
simp only [← hxI, Submodule.mem_sup, Submodule.mem_span_singleton] at hy
obtain ⟨-, ⟨t, rfl⟩, z, hz, rfl⟩ := hy
exact ⟨t, z, hz, rfl⟩
#align lie_submodule.exists_smul_add_of_span_sup_eq_top LieSubmodule.exists_smul_add_of_span_sup_eq_top
theorem lie_top_eq_of_span_sup_eq_top (N : LieSubmodule R L M) :
(↑⁅(⊤ : LieIdeal R L), N⁆ : Submodule R M) =
(N : Submodule R M).map (toEnd R L M x) ⊔ (↑⁅I, N⁆ : Submodule R M) := by
simp only [lieIdeal_oper_eq_linear_span', Submodule.sup_span, mem_top, exists_prop,
true_and, Submodule.map_coe, toEnd_apply_apply]
refine le_antisymm (Submodule.span_le.mpr ?_) (Submodule.span_mono fun z hz => ?_)
· rintro z ⟨y, n, hn : n ∈ N, rfl⟩
obtain ⟨t, z, hz, rfl⟩ := exists_smul_add_of_span_sup_eq_top hxI y
simp only [SetLike.mem_coe, Submodule.span_union, Submodule.mem_sup]
exact
⟨t • ⁅x, n⁆, Submodule.subset_span ⟨t • n, N.smul_mem' t hn, lie_smul t x n⟩, ⁅z, n⁆,
Submodule.subset_span ⟨z, hz, n, hn, rfl⟩, by simp⟩
· rcases hz with (⟨m, hm, rfl⟩ | ⟨y, -, m, hm, rfl⟩)
exacts [⟨x, m, hm, rfl⟩, ⟨y, m, hm, rfl⟩]
#align lie_submodule.lie_top_eq_of_span_sup_eq_top LieSubmodule.lie_top_eq_of_span_sup_eq_top
theorem lcs_le_lcs_of_is_nilpotent_span_sup_eq_top {n i j : ℕ}
(hxn : toEnd R L M x ^ n = 0) (hIM : lowerCentralSeries R L M i ≤ I.lcs M j) :
lowerCentralSeries R L M (i + n) ≤ I.lcs M (j + 1) := by
suffices
∀ l,
((⊤ : LieIdeal R L).lcs M (i + l) : Submodule R M) ≤
(I.lcs M j : Submodule R M).map (toEnd R L M x ^ l) ⊔
(I.lcs M (j + 1) : Submodule R M)
by simpa only [bot_sup_eq, LieIdeal.incl_coe, Submodule.map_zero, hxn] using this n
intro l
induction' l with l ih
· simp only [Nat.zero_eq, add_zero, LieIdeal.lcs_succ, pow_zero, LinearMap.one_eq_id,
Submodule.map_id]
exact le_sup_of_le_left hIM
· simp only [LieIdeal.lcs_succ, i.add_succ l, lie_top_eq_of_span_sup_eq_top hxI, sup_le_iff]
refine ⟨(Submodule.map_mono ih).trans ?_, le_sup_of_le_right ?_⟩
· rw [Submodule.map_sup, ← Submodule.map_comp, ← LinearMap.mul_eq_comp, ← pow_succ', ←
I.lcs_succ]
exact sup_le_sup_left coe_map_toEnd_le _
· refine le_trans (mono_lie_right _ _ I ?_) (mono_lie_right _ _ I hIM)
exact antitone_lowerCentralSeries R L M le_self_add
#align lie_submodule.lcs_le_lcs_of_is_nilpotent_span_sup_eq_top LieSubmodule.lcs_le_lcs_of_is_nilpotent_span_sup_eq_top
| Mathlib/Algebra/Lie/Engel.lean | 128 | 140 | theorem isNilpotentOfIsNilpotentSpanSupEqTop (hnp : IsNilpotent <| toEnd R L M x)
(hIM : IsNilpotent R I M) : IsNilpotent R L M := by |
obtain ⟨n, hn⟩ := hnp
obtain ⟨k, hk⟩ := hIM
have hk' : I.lcs M k = ⊥ := by
simp only [← coe_toSubmodule_eq_iff, I.coe_lcs_eq, hk, bot_coeSubmodule]
suffices ∀ l, lowerCentralSeries R L M (l * n) ≤ I.lcs M l by
use k * n
simpa [hk'] using this k
intro l
induction' l with l ih
· simp
· exact (l.succ_mul n).symm ▸ lcs_le_lcs_of_is_nilpotent_span_sup_eq_top hxI hn ih
| 11 | 59,874.141715 | 2 | 2 | 6 | 2,255 |
import Mathlib.Algebra.Lie.Nilpotent
import Mathlib.Algebra.Lie.Normalizer
#align_import algebra.lie.engel from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
universe u₁ u₂ u₃ u₄
variable {R : Type u₁} {L : Type u₂} {L₂ : Type u₃} {M : Type u₄}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L₂] [LieAlgebra R L₂]
variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
section LieAlgebra
-- Porting note: somehow this doesn't hide `LieModule.IsNilpotent`, so `_root_.IsNilpotent` is used
-- a number of times below.
open LieModule hiding IsNilpotent
variable (R L)
def LieAlgebra.IsEngelian : Prop :=
∀ (M : Type u₄) [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M],
(∀ x : L, _root_.IsNilpotent (toEnd R L M x)) → LieModule.IsNilpotent R L M
#align lie_algebra.is_engelian LieAlgebra.IsEngelian
variable {R L}
| Mathlib/Algebra/Lie/Engel.lean | 165 | 170 | theorem LieAlgebra.isEngelian_of_subsingleton [Subsingleton L] : LieAlgebra.IsEngelian R L := by |
intro M _i1 _i2 _i3 _i4 _h
use 1
suffices (⊤ : LieIdeal R L) = ⊥ by simp [this]
haveI := (LieSubmodule.subsingleton_iff R L L).mpr inferInstance
apply Subsingleton.elim
| 5 | 148.413159 | 2 | 2 | 6 | 2,255 |
import Mathlib.Algebra.Lie.Nilpotent
import Mathlib.Algebra.Lie.Normalizer
#align_import algebra.lie.engel from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
universe u₁ u₂ u₃ u₄
variable {R : Type u₁} {L : Type u₂} {L₂ : Type u₃} {M : Type u₄}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L₂] [LieAlgebra R L₂]
variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
section LieAlgebra
-- Porting note: somehow this doesn't hide `LieModule.IsNilpotent`, so `_root_.IsNilpotent` is used
-- a number of times below.
open LieModule hiding IsNilpotent
variable (R L)
def LieAlgebra.IsEngelian : Prop :=
∀ (M : Type u₄) [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M],
(∀ x : L, _root_.IsNilpotent (toEnd R L M x)) → LieModule.IsNilpotent R L M
#align lie_algebra.is_engelian LieAlgebra.IsEngelian
variable {R L}
theorem LieAlgebra.isEngelian_of_subsingleton [Subsingleton L] : LieAlgebra.IsEngelian R L := by
intro M _i1 _i2 _i3 _i4 _h
use 1
suffices (⊤ : LieIdeal R L) = ⊥ by simp [this]
haveI := (LieSubmodule.subsingleton_iff R L L).mpr inferInstance
apply Subsingleton.elim
#align lie_algebra.is_engelian_of_subsingleton LieAlgebra.isEngelian_of_subsingleton
| Mathlib/Algebra/Lie/Engel.lean | 173 | 183 | theorem Function.Surjective.isEngelian {f : L →ₗ⁅R⁆ L₂} (hf : Function.Surjective f)
(h : LieAlgebra.IsEngelian.{u₁, u₂, u₄} R L) : LieAlgebra.IsEngelian.{u₁, u₃, u₄} R L₂ := by |
intro M _i1 _i2 _i3 _i4 h'
letI : LieRingModule L M := LieRingModule.compLieHom M f
letI : LieModule R L M := compLieHom M f
have hnp : ∀ x, IsNilpotent (toEnd R L M x) := fun x => h' (f x)
have surj_id : Function.Surjective (LinearMap.id : M →ₗ[R] M) := Function.surjective_id
haveI : LieModule.IsNilpotent R L M := h M hnp
apply hf.lieModuleIsNilpotent surj_id
-- porting note (#10745): was `simp`
intros; simp only [LinearMap.id_coe, id_eq]; rfl
| 9 | 8,103.083928 | 2 | 2 | 6 | 2,255 |
import Mathlib.Probability.Kernel.Basic
import Mathlib.MeasureTheory.Constructions.Prod.Basic
import Mathlib.MeasureTheory.Integral.DominatedConvergence
#align_import probability.kernel.measurable_integral from "leanprover-community/mathlib"@"28b2a92f2996d28e580450863c130955de0ed398"
open MeasureTheory ProbabilityTheory Function Set Filter
open scoped MeasureTheory ENNReal Topology
variable {α β γ : Type*} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {mγ : MeasurableSpace γ}
{κ : kernel α β} {η : kernel (α × β) γ} {a : α}
namespace ProbabilityTheory
namespace kernel
| Mathlib/Probability/Kernel/MeasurableIntegral.lean | 42 | 99 | theorem measurable_kernel_prod_mk_left_of_finite {t : Set (α × β)} (ht : MeasurableSet t)
(hκs : ∀ a, IsFiniteMeasure (κ a)) : Measurable fun a => κ a (Prod.mk a ⁻¹' t) := by |
-- `t` is a measurable set in the product `α × β`: we use that the product σ-algebra is generated
-- by boxes to prove the result by induction.
-- Porting note: added motive
refine MeasurableSpace.induction_on_inter
(C := fun t => Measurable fun a => κ a (Prod.mk a ⁻¹' t))
generateFrom_prod.symm isPiSystem_prod ?_ ?_ ?_ ?_ ht
·-- case `t = ∅`
simp only [preimage_empty, measure_empty, measurable_const]
· -- case of a box: `t = t₁ ×ˢ t₂` for measurable sets `t₁` and `t₂`
intro t' ht'
simp only [Set.mem_image2, Set.mem_setOf_eq, exists_and_left] at ht'
obtain ⟨t₁, ht₁, t₂, ht₂, rfl⟩ := ht'
classical
simp_rw [mk_preimage_prod_right_eq_if]
have h_eq_ite : (fun a => κ a (ite (a ∈ t₁) t₂ ∅)) = fun a => ite (a ∈ t₁) (κ a t₂) 0 := by
ext1 a
split_ifs
exacts [rfl, measure_empty]
rw [h_eq_ite]
exact Measurable.ite ht₁ (kernel.measurable_coe κ ht₂) measurable_const
· -- we assume that the result is true for `t` and we prove it for `tᶜ`
intro t' ht' h_meas
have h_eq_sdiff : ∀ a, Prod.mk a ⁻¹' t'ᶜ = Set.univ \ Prod.mk a ⁻¹' t' := by
intro a
ext1 b
simp only [mem_compl_iff, mem_preimage, mem_diff, mem_univ, true_and_iff]
simp_rw [h_eq_sdiff]
have :
(fun a => κ a (Set.univ \ Prod.mk a ⁻¹' t')) = fun a =>
κ a Set.univ - κ a (Prod.mk a ⁻¹' t') := by
ext1 a
rw [← Set.diff_inter_self_eq_diff, Set.inter_univ, measure_diff (Set.subset_univ _)]
· exact (@measurable_prod_mk_left α β _ _ a) ht'
· exact measure_ne_top _ _
rw [this]
exact Measurable.sub (kernel.measurable_coe κ MeasurableSet.univ) h_meas
· -- we assume that the result is true for a family of disjoint sets and prove it for their union
intro f h_disj hf_meas hf
have h_Union :
(fun a => κ a (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => κ a (⋃ i, Prod.mk a ⁻¹' f i) := by
ext1 a
congr with b
simp only [mem_iUnion, mem_preimage]
rw [h_Union]
have h_tsum :
(fun a => κ a (⋃ i, Prod.mk a ⁻¹' f i)) = fun a => ∑' i, κ a (Prod.mk a ⁻¹' f i) := by
ext1 a
rw [measure_iUnion]
· intro i j hij s hsi hsj b hbs
have habi : {(a, b)} ⊆ f i := by rw [Set.singleton_subset_iff]; exact hsi hbs
have habj : {(a, b)} ⊆ f j := by rw [Set.singleton_subset_iff]; exact hsj hbs
simpa only [Set.bot_eq_empty, Set.le_eq_subset, Set.singleton_subset_iff,
Set.mem_empty_iff_false] using h_disj hij habi habj
· exact fun i => (@measurable_prod_mk_left α β _ _ a) (hf_meas i)
rw [h_tsum]
exact Measurable.ennreal_tsum hf
| 56 | 2,091,659,496,012,996,000,000,000 | 2 | 2 | 3 | 2,256 |
import Mathlib.Probability.Kernel.Basic
import Mathlib.MeasureTheory.Constructions.Prod.Basic
import Mathlib.MeasureTheory.Integral.DominatedConvergence
#align_import probability.kernel.measurable_integral from "leanprover-community/mathlib"@"28b2a92f2996d28e580450863c130955de0ed398"
open MeasureTheory ProbabilityTheory Function Set Filter
open scoped MeasureTheory ENNReal Topology
variable {α β γ : Type*} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {mγ : MeasurableSpace γ}
{κ : kernel α β} {η : kernel (α × β) γ} {a : α}
namespace ProbabilityTheory
namespace kernel
theorem measurable_kernel_prod_mk_left_of_finite {t : Set (α × β)} (ht : MeasurableSet t)
(hκs : ∀ a, IsFiniteMeasure (κ a)) : Measurable fun a => κ a (Prod.mk a ⁻¹' t) := by
-- `t` is a measurable set in the product `α × β`: we use that the product σ-algebra is generated
-- by boxes to prove the result by induction.
-- Porting note: added motive
refine MeasurableSpace.induction_on_inter
(C := fun t => Measurable fun a => κ a (Prod.mk a ⁻¹' t))
generateFrom_prod.symm isPiSystem_prod ?_ ?_ ?_ ?_ ht
·-- case `t = ∅`
simp only [preimage_empty, measure_empty, measurable_const]
· -- case of a box: `t = t₁ ×ˢ t₂` for measurable sets `t₁` and `t₂`
intro t' ht'
simp only [Set.mem_image2, Set.mem_setOf_eq, exists_and_left] at ht'
obtain ⟨t₁, ht₁, t₂, ht₂, rfl⟩ := ht'
classical
simp_rw [mk_preimage_prod_right_eq_if]
have h_eq_ite : (fun a => κ a (ite (a ∈ t₁) t₂ ∅)) = fun a => ite (a ∈ t₁) (κ a t₂) 0 := by
ext1 a
split_ifs
exacts [rfl, measure_empty]
rw [h_eq_ite]
exact Measurable.ite ht₁ (kernel.measurable_coe κ ht₂) measurable_const
· -- we assume that the result is true for `t` and we prove it for `tᶜ`
intro t' ht' h_meas
have h_eq_sdiff : ∀ a, Prod.mk a ⁻¹' t'ᶜ = Set.univ \ Prod.mk a ⁻¹' t' := by
intro a
ext1 b
simp only [mem_compl_iff, mem_preimage, mem_diff, mem_univ, true_and_iff]
simp_rw [h_eq_sdiff]
have :
(fun a => κ a (Set.univ \ Prod.mk a ⁻¹' t')) = fun a =>
κ a Set.univ - κ a (Prod.mk a ⁻¹' t') := by
ext1 a
rw [← Set.diff_inter_self_eq_diff, Set.inter_univ, measure_diff (Set.subset_univ _)]
· exact (@measurable_prod_mk_left α β _ _ a) ht'
· exact measure_ne_top _ _
rw [this]
exact Measurable.sub (kernel.measurable_coe κ MeasurableSet.univ) h_meas
· -- we assume that the result is true for a family of disjoint sets and prove it for their union
intro f h_disj hf_meas hf
have h_Union :
(fun a => κ a (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => κ a (⋃ i, Prod.mk a ⁻¹' f i) := by
ext1 a
congr with b
simp only [mem_iUnion, mem_preimage]
rw [h_Union]
have h_tsum :
(fun a => κ a (⋃ i, Prod.mk a ⁻¹' f i)) = fun a => ∑' i, κ a (Prod.mk a ⁻¹' f i) := by
ext1 a
rw [measure_iUnion]
· intro i j hij s hsi hsj b hbs
have habi : {(a, b)} ⊆ f i := by rw [Set.singleton_subset_iff]; exact hsi hbs
have habj : {(a, b)} ⊆ f j := by rw [Set.singleton_subset_iff]; exact hsj hbs
simpa only [Set.bot_eq_empty, Set.le_eq_subset, Set.singleton_subset_iff,
Set.mem_empty_iff_false] using h_disj hij habi habj
· exact fun i => (@measurable_prod_mk_left α β _ _ a) (hf_meas i)
rw [h_tsum]
exact Measurable.ennreal_tsum hf
#align probability_theory.kernel.measurable_kernel_prod_mk_left_of_finite ProbabilityTheory.kernel.measurable_kernel_prod_mk_left_of_finite
| Mathlib/Probability/Kernel/MeasurableIntegral.lean | 102 | 110 | theorem measurable_kernel_prod_mk_left [IsSFiniteKernel κ] {t : Set (α × β)}
(ht : MeasurableSet t) : Measurable fun a => κ a (Prod.mk a ⁻¹' t) := by |
rw [← kernel.kernel_sum_seq κ]
have : ∀ a, kernel.sum (kernel.seq κ) a (Prod.mk a ⁻¹' t) =
∑' n, kernel.seq κ n a (Prod.mk a ⁻¹' t) := fun a =>
kernel.sum_apply' _ _ (measurable_prod_mk_left ht)
simp_rw [this]
refine Measurable.ennreal_tsum fun n => ?_
exact measurable_kernel_prod_mk_left_of_finite ht inferInstance
| 7 | 1,096.633158 | 2 | 2 | 3 | 2,256 |
import Mathlib.Probability.Kernel.Basic
import Mathlib.MeasureTheory.Constructions.Prod.Basic
import Mathlib.MeasureTheory.Integral.DominatedConvergence
#align_import probability.kernel.measurable_integral from "leanprover-community/mathlib"@"28b2a92f2996d28e580450863c130955de0ed398"
open MeasureTheory ProbabilityTheory Function Set Filter
open scoped MeasureTheory ENNReal Topology
variable {α β γ : Type*} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {mγ : MeasurableSpace γ}
{κ : kernel α β} {η : kernel (α × β) γ} {a : α}
namespace ProbabilityTheory
namespace kernel
theorem measurable_kernel_prod_mk_left_of_finite {t : Set (α × β)} (ht : MeasurableSet t)
(hκs : ∀ a, IsFiniteMeasure (κ a)) : Measurable fun a => κ a (Prod.mk a ⁻¹' t) := by
-- `t` is a measurable set in the product `α × β`: we use that the product σ-algebra is generated
-- by boxes to prove the result by induction.
-- Porting note: added motive
refine MeasurableSpace.induction_on_inter
(C := fun t => Measurable fun a => κ a (Prod.mk a ⁻¹' t))
generateFrom_prod.symm isPiSystem_prod ?_ ?_ ?_ ?_ ht
·-- case `t = ∅`
simp only [preimage_empty, measure_empty, measurable_const]
· -- case of a box: `t = t₁ ×ˢ t₂` for measurable sets `t₁` and `t₂`
intro t' ht'
simp only [Set.mem_image2, Set.mem_setOf_eq, exists_and_left] at ht'
obtain ⟨t₁, ht₁, t₂, ht₂, rfl⟩ := ht'
classical
simp_rw [mk_preimage_prod_right_eq_if]
have h_eq_ite : (fun a => κ a (ite (a ∈ t₁) t₂ ∅)) = fun a => ite (a ∈ t₁) (κ a t₂) 0 := by
ext1 a
split_ifs
exacts [rfl, measure_empty]
rw [h_eq_ite]
exact Measurable.ite ht₁ (kernel.measurable_coe κ ht₂) measurable_const
· -- we assume that the result is true for `t` and we prove it for `tᶜ`
intro t' ht' h_meas
have h_eq_sdiff : ∀ a, Prod.mk a ⁻¹' t'ᶜ = Set.univ \ Prod.mk a ⁻¹' t' := by
intro a
ext1 b
simp only [mem_compl_iff, mem_preimage, mem_diff, mem_univ, true_and_iff]
simp_rw [h_eq_sdiff]
have :
(fun a => κ a (Set.univ \ Prod.mk a ⁻¹' t')) = fun a =>
κ a Set.univ - κ a (Prod.mk a ⁻¹' t') := by
ext1 a
rw [← Set.diff_inter_self_eq_diff, Set.inter_univ, measure_diff (Set.subset_univ _)]
· exact (@measurable_prod_mk_left α β _ _ a) ht'
· exact measure_ne_top _ _
rw [this]
exact Measurable.sub (kernel.measurable_coe κ MeasurableSet.univ) h_meas
· -- we assume that the result is true for a family of disjoint sets and prove it for their union
intro f h_disj hf_meas hf
have h_Union :
(fun a => κ a (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => κ a (⋃ i, Prod.mk a ⁻¹' f i) := by
ext1 a
congr with b
simp only [mem_iUnion, mem_preimage]
rw [h_Union]
have h_tsum :
(fun a => κ a (⋃ i, Prod.mk a ⁻¹' f i)) = fun a => ∑' i, κ a (Prod.mk a ⁻¹' f i) := by
ext1 a
rw [measure_iUnion]
· intro i j hij s hsi hsj b hbs
have habi : {(a, b)} ⊆ f i := by rw [Set.singleton_subset_iff]; exact hsi hbs
have habj : {(a, b)} ⊆ f j := by rw [Set.singleton_subset_iff]; exact hsj hbs
simpa only [Set.bot_eq_empty, Set.le_eq_subset, Set.singleton_subset_iff,
Set.mem_empty_iff_false] using h_disj hij habi habj
· exact fun i => (@measurable_prod_mk_left α β _ _ a) (hf_meas i)
rw [h_tsum]
exact Measurable.ennreal_tsum hf
#align probability_theory.kernel.measurable_kernel_prod_mk_left_of_finite ProbabilityTheory.kernel.measurable_kernel_prod_mk_left_of_finite
theorem measurable_kernel_prod_mk_left [IsSFiniteKernel κ] {t : Set (α × β)}
(ht : MeasurableSet t) : Measurable fun a => κ a (Prod.mk a ⁻¹' t) := by
rw [← kernel.kernel_sum_seq κ]
have : ∀ a, kernel.sum (kernel.seq κ) a (Prod.mk a ⁻¹' t) =
∑' n, kernel.seq κ n a (Prod.mk a ⁻¹' t) := fun a =>
kernel.sum_apply' _ _ (measurable_prod_mk_left ht)
simp_rw [this]
refine Measurable.ennreal_tsum fun n => ?_
exact measurable_kernel_prod_mk_left_of_finite ht inferInstance
#align probability_theory.kernel.measurable_kernel_prod_mk_left ProbabilityTheory.kernel.measurable_kernel_prod_mk_left
| Mathlib/Probability/Kernel/MeasurableIntegral.lean | 113 | 119 | theorem measurable_kernel_prod_mk_left' [IsSFiniteKernel η] {s : Set (β × γ)} (hs : MeasurableSet s)
(a : α) : Measurable fun b => η (a, b) (Prod.mk b ⁻¹' s) := by |
have : ∀ b, Prod.mk b ⁻¹' s = {c | ((a, b), c) ∈ {p : (α × β) × γ | (p.1.2, p.2) ∈ s}} := by
intro b; rfl
simp_rw [this]
refine (measurable_kernel_prod_mk_left ?_).comp measurable_prod_mk_left
exact (measurable_fst.snd.prod_mk measurable_snd) hs
| 5 | 148.413159 | 2 | 2 | 3 | 2,256 |
import Mathlib.Analysis.SpecialFunctions.Integrals
import Mathlib.MeasureTheory.Integral.PeakFunction
#align_import analysis.special_functions.trigonometric.euler_sine_prod from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
open scoped Real Topology
open Real Set Filter intervalIntegral MeasureTheory.MeasureSpace
namespace EulerSine
section IntegralRecursion
variable {z : ℂ} {n : ℕ}
| Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean | 39 | 46 | theorem antideriv_cos_comp_const_mul (hz : z ≠ 0) (x : ℝ) :
HasDerivAt (fun y : ℝ => Complex.sin (2 * z * y) / (2 * z)) (Complex.cos (2 * z * x)) x := by |
have a : HasDerivAt (fun y : ℂ => y * (2 * z)) _ x := hasDerivAt_mul_const _
have b : HasDerivAt (fun y : ℂ => Complex.sin (y * (2 * z))) _ x :=
HasDerivAt.comp (x : ℂ) (Complex.hasDerivAt_sin (x * (2 * z))) a
have c := b.comp_ofReal.div_const (2 * z)
field_simp at c; simp only [fun y => mul_comm y (2 * z)] at c
exact c
| 6 | 403.428793 | 2 | 2 | 5 | 2,257 |
import Mathlib.Analysis.SpecialFunctions.Integrals
import Mathlib.MeasureTheory.Integral.PeakFunction
#align_import analysis.special_functions.trigonometric.euler_sine_prod from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
open scoped Real Topology
open Real Set Filter intervalIntegral MeasureTheory.MeasureSpace
namespace EulerSine
section IntegralRecursion
variable {z : ℂ} {n : ℕ}
theorem antideriv_cos_comp_const_mul (hz : z ≠ 0) (x : ℝ) :
HasDerivAt (fun y : ℝ => Complex.sin (2 * z * y) / (2 * z)) (Complex.cos (2 * z * x)) x := by
have a : HasDerivAt (fun y : ℂ => y * (2 * z)) _ x := hasDerivAt_mul_const _
have b : HasDerivAt (fun y : ℂ => Complex.sin (y * (2 * z))) _ x :=
HasDerivAt.comp (x : ℂ) (Complex.hasDerivAt_sin (x * (2 * z))) a
have c := b.comp_ofReal.div_const (2 * z)
field_simp at c; simp only [fun y => mul_comm y (2 * z)] at c
exact c
#align euler_sine.antideriv_cos_comp_const_mul EulerSine.antideriv_cos_comp_const_mul
| Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean | 49 | 56 | theorem antideriv_sin_comp_const_mul (hz : z ≠ 0) (x : ℝ) :
HasDerivAt (fun y : ℝ => -Complex.cos (2 * z * y) / (2 * z)) (Complex.sin (2 * z * x)) x := by |
have a : HasDerivAt (fun y : ℂ => y * (2 * z)) _ x := hasDerivAt_mul_const _
have b : HasDerivAt (fun y : ℂ => Complex.cos (y * (2 * z))) _ x :=
HasDerivAt.comp (x : ℂ) (Complex.hasDerivAt_cos (x * (2 * z))) a
have c := (b.comp_ofReal.div_const (2 * z)).neg
field_simp at c; simp only [fun y => mul_comm y (2 * z)] at c
exact c
| 6 | 403.428793 | 2 | 2 | 5 | 2,257 |
import Mathlib.Analysis.SpecialFunctions.Integrals
import Mathlib.MeasureTheory.Integral.PeakFunction
#align_import analysis.special_functions.trigonometric.euler_sine_prod from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
open scoped Real Topology
open Real Set Filter intervalIntegral MeasureTheory.MeasureSpace
namespace EulerSine
section IntegralRecursion
variable {z : ℂ} {n : ℕ}
theorem antideriv_cos_comp_const_mul (hz : z ≠ 0) (x : ℝ) :
HasDerivAt (fun y : ℝ => Complex.sin (2 * z * y) / (2 * z)) (Complex.cos (2 * z * x)) x := by
have a : HasDerivAt (fun y : ℂ => y * (2 * z)) _ x := hasDerivAt_mul_const _
have b : HasDerivAt (fun y : ℂ => Complex.sin (y * (2 * z))) _ x :=
HasDerivAt.comp (x : ℂ) (Complex.hasDerivAt_sin (x * (2 * z))) a
have c := b.comp_ofReal.div_const (2 * z)
field_simp at c; simp only [fun y => mul_comm y (2 * z)] at c
exact c
#align euler_sine.antideriv_cos_comp_const_mul EulerSine.antideriv_cos_comp_const_mul
theorem antideriv_sin_comp_const_mul (hz : z ≠ 0) (x : ℝ) :
HasDerivAt (fun y : ℝ => -Complex.cos (2 * z * y) / (2 * z)) (Complex.sin (2 * z * x)) x := by
have a : HasDerivAt (fun y : ℂ => y * (2 * z)) _ x := hasDerivAt_mul_const _
have b : HasDerivAt (fun y : ℂ => Complex.cos (y * (2 * z))) _ x :=
HasDerivAt.comp (x : ℂ) (Complex.hasDerivAt_cos (x * (2 * z))) a
have c := (b.comp_ofReal.div_const (2 * z)).neg
field_simp at c; simp only [fun y => mul_comm y (2 * z)] at c
exact c
#align euler_sine.antideriv_sin_comp_const_mul EulerSine.antideriv_sin_comp_const_mul
| Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean | 59 | 85 | theorem integral_cos_mul_cos_pow_aux (hn : 2 ≤ n) (hz : z ≠ 0) :
(∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ n) =
n / (2 * z) *
∫ x in (0 : ℝ)..π / 2, Complex.sin (2 * z * x) * sin x * (cos x : ℂ) ^ (n - 1) := by |
have der1 :
∀ x : ℝ,
x ∈ uIcc 0 (π / 2) →
HasDerivAt (fun y : ℝ => (cos y : ℂ) ^ n) (-n * sin x * (cos x : ℂ) ^ (n - 1)) x := by
intro x _
have b : HasDerivAt (fun y : ℝ => (cos y : ℂ)) (-sin x) x := by
simpa using (hasDerivAt_cos x).ofReal_comp
convert HasDerivAt.comp x (hasDerivAt_pow _ _) b using 1
ring
convert (config := { sameFun := true })
integral_mul_deriv_eq_deriv_mul der1 (fun x _ => antideriv_cos_comp_const_mul hz x) _ _ using 2
· ext1 x; rw [mul_comm]
· rw [Complex.ofReal_zero, mul_zero, Complex.sin_zero, zero_div, mul_zero, sub_zero,
cos_pi_div_two, Complex.ofReal_zero, zero_pow (by positivity : n ≠ 0), zero_mul, zero_sub,
← integral_neg, ← integral_const_mul]
refine integral_congr fun x _ => ?_
field_simp; ring
· apply Continuous.intervalIntegrable
exact
(continuous_const.mul (Complex.continuous_ofReal.comp continuous_sin)).mul
((Complex.continuous_ofReal.comp continuous_cos).pow (n - 1))
· apply Continuous.intervalIntegrable
exact Complex.continuous_cos.comp (continuous_const.mul Complex.continuous_ofReal)
| 23 | 9,744,803,446.248903 | 2 | 2 | 5 | 2,257 |
import Mathlib.Analysis.SpecialFunctions.Integrals
import Mathlib.MeasureTheory.Integral.PeakFunction
#align_import analysis.special_functions.trigonometric.euler_sine_prod from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
open scoped Real Topology
open Real Set Filter intervalIntegral MeasureTheory.MeasureSpace
namespace EulerSine
section IntegralRecursion
variable {z : ℂ} {n : ℕ}
theorem antideriv_cos_comp_const_mul (hz : z ≠ 0) (x : ℝ) :
HasDerivAt (fun y : ℝ => Complex.sin (2 * z * y) / (2 * z)) (Complex.cos (2 * z * x)) x := by
have a : HasDerivAt (fun y : ℂ => y * (2 * z)) _ x := hasDerivAt_mul_const _
have b : HasDerivAt (fun y : ℂ => Complex.sin (y * (2 * z))) _ x :=
HasDerivAt.comp (x : ℂ) (Complex.hasDerivAt_sin (x * (2 * z))) a
have c := b.comp_ofReal.div_const (2 * z)
field_simp at c; simp only [fun y => mul_comm y (2 * z)] at c
exact c
#align euler_sine.antideriv_cos_comp_const_mul EulerSine.antideriv_cos_comp_const_mul
theorem antideriv_sin_comp_const_mul (hz : z ≠ 0) (x : ℝ) :
HasDerivAt (fun y : ℝ => -Complex.cos (2 * z * y) / (2 * z)) (Complex.sin (2 * z * x)) x := by
have a : HasDerivAt (fun y : ℂ => y * (2 * z)) _ x := hasDerivAt_mul_const _
have b : HasDerivAt (fun y : ℂ => Complex.cos (y * (2 * z))) _ x :=
HasDerivAt.comp (x : ℂ) (Complex.hasDerivAt_cos (x * (2 * z))) a
have c := (b.comp_ofReal.div_const (2 * z)).neg
field_simp at c; simp only [fun y => mul_comm y (2 * z)] at c
exact c
#align euler_sine.antideriv_sin_comp_const_mul EulerSine.antideriv_sin_comp_const_mul
theorem integral_cos_mul_cos_pow_aux (hn : 2 ≤ n) (hz : z ≠ 0) :
(∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ n) =
n / (2 * z) *
∫ x in (0 : ℝ)..π / 2, Complex.sin (2 * z * x) * sin x * (cos x : ℂ) ^ (n - 1) := by
have der1 :
∀ x : ℝ,
x ∈ uIcc 0 (π / 2) →
HasDerivAt (fun y : ℝ => (cos y : ℂ) ^ n) (-n * sin x * (cos x : ℂ) ^ (n - 1)) x := by
intro x _
have b : HasDerivAt (fun y : ℝ => (cos y : ℂ)) (-sin x) x := by
simpa using (hasDerivAt_cos x).ofReal_comp
convert HasDerivAt.comp x (hasDerivAt_pow _ _) b using 1
ring
convert (config := { sameFun := true })
integral_mul_deriv_eq_deriv_mul der1 (fun x _ => antideriv_cos_comp_const_mul hz x) _ _ using 2
· ext1 x; rw [mul_comm]
· rw [Complex.ofReal_zero, mul_zero, Complex.sin_zero, zero_div, mul_zero, sub_zero,
cos_pi_div_two, Complex.ofReal_zero, zero_pow (by positivity : n ≠ 0), zero_mul, zero_sub,
← integral_neg, ← integral_const_mul]
refine integral_congr fun x _ => ?_
field_simp; ring
· apply Continuous.intervalIntegrable
exact
(continuous_const.mul (Complex.continuous_ofReal.comp continuous_sin)).mul
((Complex.continuous_ofReal.comp continuous_cos).pow (n - 1))
· apply Continuous.intervalIntegrable
exact Complex.continuous_cos.comp (continuous_const.mul Complex.continuous_ofReal)
#align euler_sine.integral_cos_mul_cos_pow_aux EulerSine.integral_cos_mul_cos_pow_aux
| Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean | 88 | 147 | theorem integral_sin_mul_sin_mul_cos_pow_eq (hn : 2 ≤ n) (hz : z ≠ 0) :
(∫ x in (0 : ℝ)..π / 2, Complex.sin (2 * z * x) * sin x * (cos x : ℂ) ^ (n - 1)) =
(n / (2 * z) * ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ n) -
(n - 1) / (2 * z) *
∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (n - 2) := by |
have der1 :
∀ x : ℝ,
x ∈ uIcc 0 (π / 2) →
HasDerivAt (fun y : ℝ => sin y * (cos y : ℂ) ^ (n - 1))
((cos x : ℂ) ^ n - (n - 1) * (sin x : ℂ) ^ 2 * (cos x : ℂ) ^ (n - 2)) x := by
intro x _
have c := HasDerivAt.comp (x : ℂ) (hasDerivAt_pow (n - 1) _) (Complex.hasDerivAt_cos x)
convert ((Complex.hasDerivAt_sin x).mul c).comp_ofReal using 1
· ext1 y; simp only [Complex.ofReal_sin, Complex.ofReal_cos, Function.comp]
· simp only [Complex.ofReal_cos, Complex.ofReal_sin]
rw [mul_neg, mul_neg, ← sub_eq_add_neg, Function.comp_apply]
congr 1
· rw [← pow_succ', Nat.sub_add_cancel (by omega : 1 ≤ n)]
· have : ((n - 1 : ℕ) : ℂ) = (n : ℂ) - 1 := by
rw [Nat.cast_sub (one_le_two.trans hn), Nat.cast_one]
rw [Nat.sub_sub, this]
ring
convert
integral_mul_deriv_eq_deriv_mul der1 (fun x _ => antideriv_sin_comp_const_mul hz x) _ _ using 1
· refine integral_congr fun x _ => ?_
ring_nf
· -- now a tedious rearrangement of terms
-- gather into a single integral, and deal with continuity subgoals:
rw [sin_zero, cos_pi_div_two, Complex.ofReal_zero, zero_pow, zero_mul,
mul_zero, zero_mul, zero_mul, sub_zero, zero_sub, ←
integral_neg, ← integral_const_mul, ← integral_const_mul, ← integral_sub]
rotate_left
· apply Continuous.intervalIntegrable
exact
continuous_const.mul
((Complex.continuous_cos.comp (continuous_const.mul Complex.continuous_ofReal)).mul
((Complex.continuous_ofReal.comp continuous_cos).pow n))
· apply Continuous.intervalIntegrable
exact
continuous_const.mul
((Complex.continuous_cos.comp (continuous_const.mul Complex.continuous_ofReal)).mul
((Complex.continuous_ofReal.comp continuous_cos).pow (n - 2)))
· exact Nat.sub_ne_zero_of_lt hn
refine integral_congr fun x _ => ?_
dsimp only
-- get rid of real trig functions and divisions by 2 * z:
rw [Complex.ofReal_cos, Complex.ofReal_sin, Complex.sin_sq, ← mul_div_right_comm, ←
mul_div_right_comm, ← sub_div, mul_div, ← neg_div]
congr 1
have : Complex.cos x ^ n = Complex.cos x ^ (n - 2) * Complex.cos x ^ 2 := by
conv_lhs => rw [← Nat.sub_add_cancel hn, pow_add]
rw [this]
ring
· apply Continuous.intervalIntegrable
exact
((Complex.continuous_ofReal.comp continuous_cos).pow n).sub
((continuous_const.mul ((Complex.continuous_ofReal.comp continuous_sin).pow 2)).mul
((Complex.continuous_ofReal.comp continuous_cos).pow (n - 2)))
· apply Continuous.intervalIntegrable
exact Complex.continuous_sin.comp (continuous_const.mul Complex.continuous_ofReal)
| 55 | 769,478,526,514,201,800,000,000 | 2 | 2 | 5 | 2,257 |
import Mathlib.Analysis.SpecialFunctions.Integrals
import Mathlib.MeasureTheory.Integral.PeakFunction
#align_import analysis.special_functions.trigonometric.euler_sine_prod from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
open scoped Real Topology
open Real Set Filter intervalIntegral MeasureTheory.MeasureSpace
namespace EulerSine
| Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean | 278 | 295 | theorem tendsto_integral_cos_pow_mul_div {f : ℝ → ℂ} (hf : ContinuousOn f (Icc 0 (π / 2))) :
Tendsto
(fun n : ℕ => (∫ x in (0 : ℝ)..π / 2, (cos x : ℂ) ^ n * f x) /
(∫ x in (0 : ℝ)..π / 2, cos x ^ n : ℝ))
atTop (𝓝 <| f 0) := by |
simp_rw [div_eq_inv_mul (α := ℂ), ← Complex.ofReal_inv, integral_of_le pi_div_two_pos.le,
← MeasureTheory.integral_Icc_eq_integral_Ioc, ← Complex.ofReal_pow, ← Complex.real_smul]
have c_lt : ∀ y : ℝ, y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0 := fun y hy hy' =>
cos_lt_cos_of_nonneg_of_le_pi_div_two (le_refl 0) hy.2 (lt_of_le_of_ne hy.1 hy'.symm)
have c_nonneg : ∀ x : ℝ, x ∈ Icc 0 (π / 2) → 0 ≤ cos x := fun x hx =>
cos_nonneg_of_mem_Icc ((Icc_subset_Icc_left (neg_nonpos_of_nonneg pi_div_two_pos.le)) hx)
have c_zero_pos : 0 < cos 0 := by rw [cos_zero]; exact zero_lt_one
have zero_mem : (0 : ℝ) ∈ closure (interior (Icc 0 (π / 2))) := by
rw [interior_Icc, closure_Ioo pi_div_two_pos.ne, left_mem_Icc]
exact pi_div_two_pos.le
exact
tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn isCompact_Icc
continuousOn_cos c_lt c_nonneg c_zero_pos zero_mem hf
| 13 | 442,413.392009 | 2 | 2 | 5 | 2,257 |
import Mathlib.MeasureTheory.Integral.FundThmCalculus
import Mathlib.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv
import Mathlib.Analysis.SpecialFunctions.NonIntegrable
import Mathlib.Analysis.SpecialFunctions.Pow.Deriv
#align_import analysis.special_functions.integrals from "leanprover-community/mathlib"@"011cafb4a5bc695875d186e245d6b3df03bf6c40"
open Real Nat Set Finset
open scoped Real Interval
variable {a b : ℝ} (n : ℕ)
namespace intervalIntegral
open MeasureTheory
variable {f : ℝ → ℝ} {μ ν : Measure ℝ} [IsLocallyFiniteMeasure μ] (c d : ℝ)
@[simp]
theorem intervalIntegrable_pow : IntervalIntegrable (fun x => x ^ n) μ a b :=
(continuous_pow n).intervalIntegrable a b
#align interval_integral.interval_integrable_pow intervalIntegral.intervalIntegrable_pow
theorem intervalIntegrable_zpow {n : ℤ} (h : 0 ≤ n ∨ (0 : ℝ) ∉ [[a, b]]) :
IntervalIntegrable (fun x => x ^ n) μ a b :=
(continuousOn_id.zpow₀ n fun _ hx => h.symm.imp (ne_of_mem_of_not_mem hx) id).intervalIntegrable
#align interval_integral.interval_integrable_zpow intervalIntegral.intervalIntegrable_zpow
theorem intervalIntegrable_rpow {r : ℝ} (h : 0 ≤ r ∨ (0 : ℝ) ∉ [[a, b]]) :
IntervalIntegrable (fun x => x ^ r) μ a b :=
(continuousOn_id.rpow_const fun _ hx =>
h.symm.imp (ne_of_mem_of_not_mem hx) id).intervalIntegrable
#align interval_integral.interval_integrable_rpow intervalIntegral.intervalIntegrable_rpow
| Mathlib/Analysis/SpecialFunctions/Integrals.lean | 73 | 95 | theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
IntervalIntegrable (fun x => x ^ r) volume a b := by |
suffices ∀ c : ℝ, IntervalIntegrable (fun x => x ^ r) volume 0 c by
exact IntervalIntegrable.trans (this a).symm (this b)
have : ∀ c : ℝ, 0 ≤ c → IntervalIntegrable (fun x => x ^ r) volume 0 c := by
intro c hc
rw [intervalIntegrable_iff, uIoc_of_le hc]
have hderiv : ∀ x ∈ Ioo 0 c, HasDerivAt (fun x : ℝ => x ^ (r + 1) / (r + 1)) (x ^ r) x := by
intro x hx
convert (Real.hasDerivAt_rpow_const (p := r + 1) (Or.inl hx.1.ne')).div_const (r + 1) using 1
field_simp [(by linarith : r + 1 ≠ 0)]
apply integrableOn_deriv_of_nonneg _ hderiv
· intro x hx; apply rpow_nonneg hx.1.le
· refine (continuousOn_id.rpow_const ?_).div_const _; intro x _; right; linarith
intro c; rcases le_total 0 c with (hc | hc)
· exact this c hc
· rw [IntervalIntegrable.iff_comp_neg, neg_zero]
have m := (this (-c) (by linarith)).smul (cos (r * π))
rw [intervalIntegrable_iff] at m ⊢
refine m.congr_fun ?_ measurableSet_Ioc; intro x hx
rw [uIoc_of_le (by linarith : 0 ≤ -c)] at hx
simp only [Pi.smul_apply, Algebra.id.smul_eq_mul, log_neg_eq_log, mul_comm,
rpow_def_of_pos hx.1, rpow_def_of_neg (by linarith [hx.1] : -x < 0)]
| 21 | 1,318,815,734.483215 | 2 | 2 | 2 | 2,258 |
import Mathlib.MeasureTheory.Integral.FundThmCalculus
import Mathlib.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv
import Mathlib.Analysis.SpecialFunctions.NonIntegrable
import Mathlib.Analysis.SpecialFunctions.Pow.Deriv
#align_import analysis.special_functions.integrals from "leanprover-community/mathlib"@"011cafb4a5bc695875d186e245d6b3df03bf6c40"
open Real Nat Set Finset
open scoped Real Interval
variable {a b : ℝ} (n : ℕ)
namespace intervalIntegral
open MeasureTheory
variable {f : ℝ → ℝ} {μ ν : Measure ℝ} [IsLocallyFiniteMeasure μ] (c d : ℝ)
@[simp]
theorem intervalIntegrable_pow : IntervalIntegrable (fun x => x ^ n) μ a b :=
(continuous_pow n).intervalIntegrable a b
#align interval_integral.interval_integrable_pow intervalIntegral.intervalIntegrable_pow
theorem intervalIntegrable_zpow {n : ℤ} (h : 0 ≤ n ∨ (0 : ℝ) ∉ [[a, b]]) :
IntervalIntegrable (fun x => x ^ n) μ a b :=
(continuousOn_id.zpow₀ n fun _ hx => h.symm.imp (ne_of_mem_of_not_mem hx) id).intervalIntegrable
#align interval_integral.interval_integrable_zpow intervalIntegral.intervalIntegrable_zpow
theorem intervalIntegrable_rpow {r : ℝ} (h : 0 ≤ r ∨ (0 : ℝ) ∉ [[a, b]]) :
IntervalIntegrable (fun x => x ^ r) μ a b :=
(continuousOn_id.rpow_const fun _ hx =>
h.symm.imp (ne_of_mem_of_not_mem hx) id).intervalIntegrable
#align interval_integral.interval_integrable_rpow intervalIntegral.intervalIntegrable_rpow
theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
IntervalIntegrable (fun x => x ^ r) volume a b := by
suffices ∀ c : ℝ, IntervalIntegrable (fun x => x ^ r) volume 0 c by
exact IntervalIntegrable.trans (this a).symm (this b)
have : ∀ c : ℝ, 0 ≤ c → IntervalIntegrable (fun x => x ^ r) volume 0 c := by
intro c hc
rw [intervalIntegrable_iff, uIoc_of_le hc]
have hderiv : ∀ x ∈ Ioo 0 c, HasDerivAt (fun x : ℝ => x ^ (r + 1) / (r + 1)) (x ^ r) x := by
intro x hx
convert (Real.hasDerivAt_rpow_const (p := r + 1) (Or.inl hx.1.ne')).div_const (r + 1) using 1
field_simp [(by linarith : r + 1 ≠ 0)]
apply integrableOn_deriv_of_nonneg _ hderiv
· intro x hx; apply rpow_nonneg hx.1.le
· refine (continuousOn_id.rpow_const ?_).div_const _; intro x _; right; linarith
intro c; rcases le_total 0 c with (hc | hc)
· exact this c hc
· rw [IntervalIntegrable.iff_comp_neg, neg_zero]
have m := (this (-c) (by linarith)).smul (cos (r * π))
rw [intervalIntegrable_iff] at m ⊢
refine m.congr_fun ?_ measurableSet_Ioc; intro x hx
rw [uIoc_of_le (by linarith : 0 ≤ -c)] at hx
simp only [Pi.smul_apply, Algebra.id.smul_eq_mul, log_neg_eq_log, mul_comm,
rpow_def_of_pos hx.1, rpow_def_of_neg (by linarith [hx.1] : -x < 0)]
#align interval_integral.interval_integrable_rpow' intervalIntegral.intervalIntegrable_rpow'
lemma integrableOn_Ioo_rpow_iff {s t : ℝ} (ht : 0 < t) :
IntegrableOn (fun x ↦ x ^ s) (Ioo (0 : ℝ) t) ↔ -1 < s := by
refine ⟨fun h ↦ ?_, fun h ↦ by simpa [intervalIntegrable_iff_integrableOn_Ioo_of_le ht.le]
using intervalIntegrable_rpow' h (a := 0) (b := t)⟩
contrapose! h
intro H
have I : 0 < min 1 t := lt_min zero_lt_one ht
have H' : IntegrableOn (fun x ↦ x ^ s) (Ioo 0 (min 1 t)) :=
H.mono (Set.Ioo_subset_Ioo le_rfl (min_le_right _ _)) le_rfl
have : IntegrableOn (fun x ↦ x⁻¹) (Ioo 0 (min 1 t)) := by
apply H'.mono' measurable_inv.aestronglyMeasurable
filter_upwards [ae_restrict_mem measurableSet_Ioo] with x hx
simp only [norm_inv, Real.norm_eq_abs, abs_of_nonneg (le_of_lt hx.1)]
rwa [← Real.rpow_neg_one x, Real.rpow_le_rpow_left_iff_of_base_lt_one hx.1]
exact lt_of_lt_of_le hx.2 (min_le_left _ _)
have : IntervalIntegrable (fun x ↦ x⁻¹) volume 0 (min 1 t) := by
rwa [intervalIntegrable_iff_integrableOn_Ioo_of_le I.le]
simp [intervalIntegrable_inv_iff, I.ne] at this
| Mathlib/Analysis/SpecialFunctions/Integrals.lean | 120 | 164 | theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [[a, b]]) :
IntervalIntegrable (fun x : ℝ => (x : ℂ) ^ r) μ a b := by |
by_cases h2 : (0 : ℝ) ∉ [[a, b]]
· -- Easy case #1: 0 ∉ [a, b] -- use continuity.
refine (ContinuousAt.continuousOn fun x hx => ?_).intervalIntegrable
exact Complex.continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_mem_of_not_mem hx h2)
rw [eq_false h2, or_false_iff] at h
rcases lt_or_eq_of_le h with (h' | h')
· -- Easy case #2: 0 < re r -- again use continuity
exact (Complex.continuous_ofReal_cpow_const h').intervalIntegrable _ _
-- Now the hard case: re r = 0 and 0 is in the interval.
refine (IntervalIntegrable.intervalIntegrable_norm_iff ?_).mp ?_
· refine (measurable_of_continuousOn_compl_singleton (0 : ℝ) ?_).aestronglyMeasurable
exact ContinuousAt.continuousOn fun x hx =>
Complex.continuousAt_ofReal_cpow_const x r (Or.inr hx)
-- reduce to case of integral over `[0, c]`
suffices ∀ c : ℝ, IntervalIntegrable (fun x : ℝ => ‖(x:ℂ) ^ r‖) μ 0 c from
(this a).symm.trans (this b)
intro c
rcases le_or_lt 0 c with (hc | hc)
· -- case `0 ≤ c`: integrand is identically 1
have : IntervalIntegrable (fun _ => 1 : ℝ → ℝ) μ 0 c := intervalIntegrable_const
rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hc] at this ⊢
refine IntegrableOn.congr_fun this (fun x hx => ?_) measurableSet_Ioc
dsimp only
rw [Complex.norm_eq_abs, Complex.abs_cpow_eq_rpow_re_of_pos hx.1, ← h', rpow_zero]
· -- case `c < 0`: integrand is identically constant, *except* at `x = 0` if `r ≠ 0`.
apply IntervalIntegrable.symm
rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hc.le]
have : Ioc c 0 = Ioo c 0 ∪ {(0 : ℝ)} := by
rw [← Ioo_union_Icc_eq_Ioc hc (le_refl 0), ← Icc_def]
simp_rw [← le_antisymm_iff, setOf_eq_eq_singleton']
rw [this, integrableOn_union, and_comm]; constructor
· refine integrableOn_singleton_iff.mpr (Or.inr ?_)
exact isFiniteMeasureOnCompacts_of_isLocallyFiniteMeasure.lt_top_of_isCompact
isCompact_singleton
· have : ∀ x : ℝ, x ∈ Ioo c 0 → ‖Complex.exp (↑π * Complex.I * r)‖ = ‖(x : ℂ) ^ r‖ := by
intro x hx
rw [Complex.ofReal_cpow_of_nonpos hx.2.le, norm_mul, ← Complex.ofReal_neg,
Complex.norm_eq_abs (_ ^ _), Complex.abs_cpow_eq_rpow_re_of_pos (neg_pos.mpr hx.2), ← h',
rpow_zero, one_mul]
refine IntegrableOn.congr_fun ?_ this measurableSet_Ioo
rw [integrableOn_const]
refine Or.inr ((measure_mono Set.Ioo_subset_Icc_self).trans_lt ?_)
exact isFiniteMeasureOnCompacts_of_isLocallyFiniteMeasure.lt_top_of_isCompact isCompact_Icc
| 43 | 4,727,839,468,229,346,000 | 2 | 2 | 2 | 2,258 |
import Mathlib.Analysis.InnerProductSpace.Adjoint
import Mathlib.Analysis.Matrix
import Mathlib.Analysis.RCLike.Basic
import Mathlib.LinearAlgebra.UnitaryGroup
import Mathlib.Topology.UniformSpace.Matrix
#align_import analysis.normed_space.star.matrix from "leanprover-community/mathlib"@"468b141b14016d54b479eb7a0fff1e360b7e3cf6"
open scoped Matrix
variable {𝕜 m n l E : Type*}
section EntrywiseSupNorm
variable [RCLike 𝕜] [Fintype n] [DecidableEq n]
| Mathlib/Analysis/NormedSpace/Star/Matrix.lean | 49 | 77 | theorem entry_norm_bound_of_unitary {U : Matrix n n 𝕜} (hU : U ∈ Matrix.unitaryGroup n 𝕜)
(i j : n) : ‖U i j‖ ≤ 1 := by |
-- The norm squared of an entry is at most the L2 norm of its row.
have norm_sum : ‖U i j‖ ^ 2 ≤ ∑ x, ‖U i x‖ ^ 2 := by
apply Multiset.single_le_sum
· intro x h_x
rw [Multiset.mem_map] at h_x
cases' h_x with a h_a
rw [← h_a.2]
apply sq_nonneg
· rw [Multiset.mem_map]
use j
simp only [eq_self_iff_true, Finset.mem_univ_val, and_self_iff, sq_eq_sq]
-- The L2 norm of a row is a diagonal entry of U * Uᴴ
have diag_eq_norm_sum : (U * Uᴴ) i i = (∑ x : n, ‖U i x‖ ^ 2 : ℝ) := by
simp only [Matrix.mul_apply, Matrix.conjTranspose_apply, ← starRingEnd_apply, RCLike.mul_conj,
RCLike.normSq_eq_def', RCLike.ofReal_pow]; norm_cast
-- The L2 norm of a row is a diagonal entry of U * Uᴴ, real part
have re_diag_eq_norm_sum : RCLike.re ((U * Uᴴ) i i) = ∑ x : n, ‖U i x‖ ^ 2 := by
rw [RCLike.ext_iff] at diag_eq_norm_sum
rw [diag_eq_norm_sum.1]
norm_cast
-- Since U is unitary, the diagonal entries of U * Uᴴ are all 1
have mul_eq_one : U * Uᴴ = 1 := unitary.mul_star_self_of_mem hU
have diag_eq_one : RCLike.re ((U * Uᴴ) i i) = 1 := by
simp only [mul_eq_one, eq_self_iff_true, Matrix.one_apply_eq, RCLike.one_re]
-- Putting it all together
rw [← sq_le_one_iff (norm_nonneg (U i j)), ← diag_eq_one, re_diag_eq_norm_sum]
exact norm_sum
| 27 | 532,048,240,601.79865 | 2 | 2 | 2 | 2,259 |
import Mathlib.Analysis.InnerProductSpace.Adjoint
import Mathlib.Analysis.Matrix
import Mathlib.Analysis.RCLike.Basic
import Mathlib.LinearAlgebra.UnitaryGroup
import Mathlib.Topology.UniformSpace.Matrix
#align_import analysis.normed_space.star.matrix from "leanprover-community/mathlib"@"468b141b14016d54b479eb7a0fff1e360b7e3cf6"
open scoped Matrix
variable {𝕜 m n l E : Type*}
section EntrywiseSupNorm
variable [RCLike 𝕜] [Fintype n] [DecidableEq n]
theorem entry_norm_bound_of_unitary {U : Matrix n n 𝕜} (hU : U ∈ Matrix.unitaryGroup n 𝕜)
(i j : n) : ‖U i j‖ ≤ 1 := by
-- The norm squared of an entry is at most the L2 norm of its row.
have norm_sum : ‖U i j‖ ^ 2 ≤ ∑ x, ‖U i x‖ ^ 2 := by
apply Multiset.single_le_sum
· intro x h_x
rw [Multiset.mem_map] at h_x
cases' h_x with a h_a
rw [← h_a.2]
apply sq_nonneg
· rw [Multiset.mem_map]
use j
simp only [eq_self_iff_true, Finset.mem_univ_val, and_self_iff, sq_eq_sq]
-- The L2 norm of a row is a diagonal entry of U * Uᴴ
have diag_eq_norm_sum : (U * Uᴴ) i i = (∑ x : n, ‖U i x‖ ^ 2 : ℝ) := by
simp only [Matrix.mul_apply, Matrix.conjTranspose_apply, ← starRingEnd_apply, RCLike.mul_conj,
RCLike.normSq_eq_def', RCLike.ofReal_pow]; norm_cast
-- The L2 norm of a row is a diagonal entry of U * Uᴴ, real part
have re_diag_eq_norm_sum : RCLike.re ((U * Uᴴ) i i) = ∑ x : n, ‖U i x‖ ^ 2 := by
rw [RCLike.ext_iff] at diag_eq_norm_sum
rw [diag_eq_norm_sum.1]
norm_cast
-- Since U is unitary, the diagonal entries of U * Uᴴ are all 1
have mul_eq_one : U * Uᴴ = 1 := unitary.mul_star_self_of_mem hU
have diag_eq_one : RCLike.re ((U * Uᴴ) i i) = 1 := by
simp only [mul_eq_one, eq_self_iff_true, Matrix.one_apply_eq, RCLike.one_re]
-- Putting it all together
rw [← sq_le_one_iff (norm_nonneg (U i j)), ← diag_eq_one, re_diag_eq_norm_sum]
exact norm_sum
#align entry_norm_bound_of_unitary entry_norm_bound_of_unitary
attribute [local instance] Matrix.normedAddCommGroup
| Mathlib/Analysis/NormedSpace/Star/Matrix.lean | 83 | 90 | theorem entrywise_sup_norm_bound_of_unitary {U : Matrix n n 𝕜} (hU : U ∈ Matrix.unitaryGroup n 𝕜) :
‖U‖ ≤ 1 := by |
conv => -- Porting note: was `simp_rw [pi_norm_le_iff_of_nonneg zero_le_one]`
rw [pi_norm_le_iff_of_nonneg zero_le_one]
intro
rw [pi_norm_le_iff_of_nonneg zero_le_one]
intros
exact entry_norm_bound_of_unitary hU _ _
| 6 | 403.428793 | 2 | 2 | 2 | 2,259 |
import Mathlib.MeasureTheory.Decomposition.RadonNikodym
import Mathlib.Probability.ConditionalProbability
open scoped ENNReal
namespace MeasureTheory
variable {α : Type*} {mα : MeasurableSpace α} {μ : Measure α}
noncomputable def Measure.toFiniteAux (μ : Measure α) [SFinite μ] : Measure α :=
Measure.sum (fun n ↦ (2 ^ (n + 1) * sFiniteSeq μ n Set.univ)⁻¹ • sFiniteSeq μ n)
noncomputable def Measure.toFinite (μ : Measure α) [SFinite μ] : Measure α :=
ProbabilityTheory.cond μ.toFiniteAux Set.univ
lemma toFiniteAux_apply (μ : Measure α) [SFinite μ] (s : Set α) :
μ.toFiniteAux s = ∑' n, (2 ^ (n + 1) * sFiniteSeq μ n Set.univ)⁻¹ * sFiniteSeq μ n s := by
rw [Measure.toFiniteAux, Measure.sum_apply_of_countable]; rfl
lemma toFinite_apply (μ : Measure α) [SFinite μ] (s : Set α) :
μ.toFinite s = (μ.toFiniteAux Set.univ)⁻¹ * μ.toFiniteAux s := by
rw [Measure.toFinite, ProbabilityTheory.cond_apply _ MeasurableSet.univ, Set.univ_inter]
lemma toFiniteAux_zero : Measure.toFiniteAux (0 : Measure α) = 0 := by
ext s
simp [toFiniteAux_apply]
@[simp]
lemma toFinite_zero : Measure.toFinite (0 : Measure α) = 0 := by
simp [Measure.toFinite, toFiniteAux_zero]
lemma toFiniteAux_eq_zero_iff [SFinite μ] : μ.toFiniteAux = 0 ↔ μ = 0 := by
refine ⟨fun h ↦ ?_, fun h ↦ by simp [h, toFiniteAux_zero]⟩
ext s hs
rw [Measure.ext_iff] at h
specialize h s hs
simp only [toFiniteAux_apply, Measure.coe_zero, Pi.zero_apply,
ENNReal.tsum_eq_zero, mul_eq_zero, ENNReal.inv_eq_zero] at h
rw [← sum_sFiniteSeq μ, Measure.sum_apply _ hs]
simp only [Measure.coe_zero, Pi.zero_apply, ENNReal.tsum_eq_zero]
intro n
specialize h n
simpa [ENNReal.mul_eq_top, measure_ne_top] using h
lemma toFiniteAux_univ_le_one (μ : Measure α) [SFinite μ] : μ.toFiniteAux Set.univ ≤ 1 := by
rw [toFiniteAux_apply]
have h_le_pow : ∀ n, (2 ^ (n + 1) * sFiniteSeq μ n Set.univ)⁻¹ * sFiniteSeq μ n Set.univ
≤ (2 ^ (n + 1))⁻¹ := by
intro n
by_cases h_zero : sFiniteSeq μ n = 0
· simp [h_zero]
· rw [ENNReal.le_inv_iff_mul_le, mul_assoc, mul_comm (sFiniteSeq μ n Set.univ),
ENNReal.inv_mul_cancel]
· simp [h_zero]
· exact ENNReal.mul_ne_top (by simp) (measure_ne_top _ _)
refine (tsum_le_tsum h_le_pow ENNReal.summable ENNReal.summable).trans ?_
simp [ENNReal.inv_pow, ENNReal.tsum_geometric_add_one, ENNReal.inv_mul_cancel]
instance [SFinite μ] : IsFiniteMeasure μ.toFiniteAux :=
⟨(toFiniteAux_univ_le_one μ).trans_lt ENNReal.one_lt_top⟩
@[simp]
lemma toFinite_eq_zero_iff [SFinite μ] : μ.toFinite = 0 ↔ μ = 0 := by
simp [Measure.toFinite, measure_ne_top μ.toFiniteAux Set.univ, toFiniteAux_eq_zero_iff]
instance [SFinite μ] : IsFiniteMeasure μ.toFinite := by
rw [Measure.toFinite]
infer_instance
instance [SFinite μ] [h_zero : NeZero μ] : IsProbabilityMeasure μ.toFinite := by
refine ProbabilityTheory.cond_isProbabilityMeasure μ.toFiniteAux ?_
simp [toFiniteAux_eq_zero_iff, h_zero.out]
lemma sFiniteSeq_absolutelyContinuous_toFiniteAux (μ : Measure α) [SFinite μ] (n : ℕ) :
sFiniteSeq μ n ≪ μ.toFiniteAux := by
refine Measure.absolutelyContinuous_sum_right n (Measure.absolutelyContinuous_smul ?_)
simp only [ne_eq, ENNReal.inv_eq_zero]
exact ENNReal.mul_ne_top (by simp) (measure_ne_top _ _)
lemma toFiniteAux_absolutelyContinuous_toFinite (μ : Measure α) [SFinite μ] :
μ.toFiniteAux ≪ μ.toFinite := ProbabilityTheory.absolutelyContinuous_cond_univ
lemma sFiniteSeq_absolutelyContinuous_toFinite (μ : Measure α) [SFinite μ] (n : ℕ) :
sFiniteSeq μ n ≪ μ.toFinite :=
(sFiniteSeq_absolutelyContinuous_toFiniteAux μ n).trans
(toFiniteAux_absolutelyContinuous_toFinite μ)
lemma absolutelyContinuous_toFinite (μ : Measure α) [SFinite μ] : μ ≪ μ.toFinite := by
conv_lhs => rw [← sum_sFiniteSeq μ]
exact Measure.absolutelyContinuous_sum_left (sFiniteSeq_absolutelyContinuous_toFinite μ)
lemma toFinite_absolutelyContinuous (μ : Measure α) [SFinite μ] : μ.toFinite ≪ μ := by
conv_rhs => rw [← sum_sFiniteSeq μ]
refine Measure.AbsolutelyContinuous.mk (fun s hs hs0 ↦ ?_)
simp only [Measure.sum_apply _ hs, ENNReal.tsum_eq_zero] at hs0
simp [toFinite_apply, toFiniteAux_apply, hs0]
noncomputable
def Measure.densityToFinite (μ : Measure α) [SFinite μ] (a : α) : ℝ≥0∞ :=
∑' n, (sFiniteSeq μ n).rnDeriv μ.toFinite a
lemma densityToFinite_def (μ : Measure α) [SFinite μ] :
μ.densityToFinite = fun a ↦ ∑' n, (sFiniteSeq μ n).rnDeriv μ.toFinite a := rfl
lemma measurable_densityToFinite (μ : Measure α) [SFinite μ] : Measurable μ.densityToFinite :=
Measurable.ennreal_tsum fun _ ↦ Measure.measurable_rnDeriv _ _
| Mathlib/MeasureTheory/Measure/WithDensityFinite.lean | 158 | 168 | theorem withDensity_densitytoFinite (μ : Measure α) [SFinite μ] :
μ.toFinite.withDensity μ.densityToFinite = μ := by |
have : (μ.toFinite.withDensity fun a ↦ ∑' n, (sFiniteSeq μ n).rnDeriv μ.toFinite a)
= μ.toFinite.withDensity (∑' n, (sFiniteSeq μ n).rnDeriv μ.toFinite) := by
congr with a
rw [ENNReal.tsum_apply]
rw [densityToFinite_def, this, withDensity_tsum (fun i ↦ Measure.measurable_rnDeriv _ _)]
conv_rhs => rw [← sum_sFiniteSeq μ]
congr with n
rw [Measure.withDensity_rnDeriv_eq]
exact sFiniteSeq_absolutelyContinuous_toFinite μ n
| 9 | 8,103.083928 | 2 | 2 | 1 | 2,260 |
import Mathlib.Data.Nat.Cast.WithTop
import Mathlib.FieldTheory.IsAlgClosed.Basic
import Mathlib.RingTheory.WittVector.DiscreteValuationRing
#align_import ring_theory.witt_vector.frobenius_fraction_field from "leanprover-community/mathlib"@"cead93130da7100f8a9fe22ee210f7636a91168f"
noncomputable section
namespace WittVector
variable (p : ℕ) [hp : Fact p.Prime]
local notation "𝕎" => WittVector p
namespace RecursionMain
section CommRing
variable {k : Type*} [CommRing k] [CharP k p]
open Polynomial
def succNthDefiningPoly (n : ℕ) (a₁ a₂ : 𝕎 k) (bs : Fin (n + 1) → k) : Polynomial k :=
X ^ p * C (a₁.coeff 0 ^ p ^ (n + 1)) - X * C (a₂.coeff 0 ^ p ^ (n + 1)) +
C
(a₁.coeff (n + 1) * (bs 0 ^ p) ^ p ^ (n + 1) +
nthRemainder p n (fun v => bs v ^ p) (truncateFun (n + 1) a₁) -
a₂.coeff (n + 1) * bs 0 ^ p ^ (n + 1) -
nthRemainder p n bs (truncateFun (n + 1) a₂))
#align witt_vector.recursion_main.succ_nth_defining_poly WittVector.RecursionMain.succNthDefiningPoly
| Mathlib/RingTheory/WittVector/FrobeniusFractionField.lean | 79 | 95 | theorem succNthDefiningPoly_degree [IsDomain k] (n : ℕ) (a₁ a₂ : 𝕎 k) (bs : Fin (n + 1) → k)
(ha₁ : a₁.coeff 0 ≠ 0) (ha₂ : a₂.coeff 0 ≠ 0) :
(succNthDefiningPoly p n a₁ a₂ bs).degree = p := by |
have : (X ^ p * C (a₁.coeff 0 ^ p ^ (n + 1))).degree = (p : WithBot ℕ) := by
rw [degree_mul, degree_C]
· simp only [Nat.cast_withBot, add_zero, degree_X, degree_pow, Nat.smul_one_eq_cast]
· exact pow_ne_zero _ ha₁
have : (X ^ p * C (a₁.coeff 0 ^ p ^ (n + 1)) - X * C (a₂.coeff 0 ^ p ^ (n + 1))).degree =
(p : WithBot ℕ) := by
rw [degree_sub_eq_left_of_degree_lt, this]
rw [this, degree_mul, degree_C, degree_X, add_zero]
· exact mod_cast hp.out.one_lt
· exact pow_ne_zero _ ha₂
rw [succNthDefiningPoly, degree_add_eq_left_of_degree_lt, this]
apply lt_of_le_of_lt degree_C_le
rw [this]
exact mod_cast hp.out.pos
| 14 | 1,202,604.284165 | 2 | 2 | 1 | 2,261 |
import Mathlib.Topology.EMetricSpace.Basic
import Mathlib.Topology.Bornology.Constructions
import Mathlib.Data.Set.Pointwise.Interval
import Mathlib.Topology.Order.DenselyOrdered
open Set Filter TopologicalSpace Bornology
open scoped ENNReal NNReal Uniformity Topology
universe u v w
variable {α : Type u} {β : Type v} {X ι : Type*}
theorem UniformSpace.ofDist_aux (ε : ℝ) (hε : 0 < ε) : ∃ δ > (0 : ℝ), ∀ x < δ, ∀ y < δ, x + y < ε :=
⟨ε / 2, half_pos hε, fun _x hx _y hy => add_halves ε ▸ add_lt_add hx hy⟩
def UniformSpace.ofDist (dist : α → α → ℝ) (dist_self : ∀ x : α, dist x x = 0)
(dist_comm : ∀ x y : α, dist x y = dist y x)
(dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) : UniformSpace α :=
.ofFun dist dist_self dist_comm dist_triangle ofDist_aux
#align uniform_space_of_dist UniformSpace.ofDist
-- Porting note: dropped the `dist_self` argument
abbrev Bornology.ofDist {α : Type*} (dist : α → α → ℝ) (dist_comm : ∀ x y, dist x y = dist y x)
(dist_triangle : ∀ x y z, dist x z ≤ dist x y + dist y z) : Bornology α :=
Bornology.ofBounded { s : Set α | ∃ C, ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → dist x y ≤ C }
⟨0, fun x hx y => hx.elim⟩ (fun s ⟨c, hc⟩ t h => ⟨c, fun x hx y hy => hc (h hx) (h hy)⟩)
(fun s hs t ht => by
rcases s.eq_empty_or_nonempty with rfl | ⟨x, hx⟩
· rwa [empty_union]
rcases t.eq_empty_or_nonempty with rfl | ⟨y, hy⟩
· rwa [union_empty]
rsuffices ⟨C, hC⟩ : ∃ C, ∀ z ∈ s ∪ t, dist x z ≤ C
· refine ⟨C + C, fun a ha b hb => (dist_triangle a x b).trans ?_⟩
simpa only [dist_comm] using add_le_add (hC _ ha) (hC _ hb)
rcases hs with ⟨Cs, hs⟩; rcases ht with ⟨Ct, ht⟩
refine ⟨max Cs (dist x y + Ct), fun z hz => hz.elim
(fun hz => (hs hx hz).trans (le_max_left _ _))
(fun hz => (dist_triangle x y z).trans <|
(add_le_add le_rfl (ht hy hz)).trans (le_max_right _ _))⟩)
fun z => ⟨dist z z, forall_eq.2 <| forall_eq.2 le_rfl⟩
#align bornology.of_dist Bornology.ofDistₓ
@[ext]
class Dist (α : Type*) where
dist : α → α → ℝ
#align has_dist Dist
export Dist (dist)
-- the uniform structure and the emetric space structure are embedded in the metric space structure
-- to avoid instance diamond issues. See Note [forgetful inheritance].
private theorem dist_nonneg' {α} {x y : α} (dist : α → α → ℝ)
(dist_self : ∀ x : α, dist x x = 0) (dist_comm : ∀ x y : α, dist x y = dist y x)
(dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) : 0 ≤ dist x y :=
have : 0 ≤ 2 * dist x y :=
calc 0 = dist x x := (dist_self _).symm
_ ≤ dist x y + dist y x := dist_triangle _ _ _
_ = 2 * dist x y := by rw [two_mul, dist_comm]
nonneg_of_mul_nonneg_right this two_pos
#noalign pseudo_metric_space.edist_dist_tac -- Porting note (#11215): TODO: restore
class PseudoMetricSpace (α : Type u) extends Dist α : Type u where
dist_self : ∀ x : α, dist x x = 0
dist_comm : ∀ x y : α, dist x y = dist y x
dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z
edist : α → α → ℝ≥0∞ := fun x y => ENNReal.ofNNReal ⟨dist x y, dist_nonneg' _ ‹_› ‹_› ‹_›⟩
edist_dist : ∀ x y : α, edist x y = ENNReal.ofReal (dist x y)
-- Porting note (#11215): TODO: add := by _
toUniformSpace : UniformSpace α := .ofDist dist dist_self dist_comm dist_triangle
uniformity_dist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | dist p.1 p.2 < ε } := by intros; rfl
toBornology : Bornology α := Bornology.ofDist dist dist_comm dist_triangle
cobounded_sets : (Bornology.cobounded α).sets =
{ s | ∃ C : ℝ, ∀ x ∈ sᶜ, ∀ y ∈ sᶜ, dist x y ≤ C } := by intros; rfl
#align pseudo_metric_space PseudoMetricSpace
@[ext]
| Mathlib/Topology/MetricSpace/PseudoMetric.lean | 130 | 140 | theorem PseudoMetricSpace.ext {α : Type*} {m m' : PseudoMetricSpace α}
(h : m.toDist = m'.toDist) : m = m' := by |
cases' m with d _ _ _ ed hed U hU B hB
cases' m' with d' _ _ _ ed' hed' U' hU' B' hB'
obtain rfl : d = d' := h
congr
· ext x y : 2
rw [hed, hed']
· exact UniformSpace.ext (hU.trans hU'.symm)
· ext : 2
rw [← Filter.mem_sets, ← Filter.mem_sets, hB, hB']
| 9 | 8,103.083928 | 2 | 2 | 1 | 2,262 |
import Mathlib.RingTheory.Ideal.IsPrimary
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.Order.Minimal
#align_import ring_theory.ideal.minimal_prime from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
section
variable {R S : Type*} [CommSemiring R] [CommSemiring S] (I J : Ideal R)
protected def Ideal.minimalPrimes : Set (Ideal R) :=
minimals (· ≤ ·) { p | p.IsPrime ∧ I ≤ p }
#align ideal.minimal_primes Ideal.minimalPrimes
variable (R) in
def minimalPrimes : Set (Ideal R) :=
Ideal.minimalPrimes ⊥
#align minimal_primes minimalPrimes
lemma minimalPrimes_eq_minimals : minimalPrimes R = minimals (· ≤ ·) (setOf Ideal.IsPrime) :=
congr_arg (minimals (· ≤ ·)) (by simp)
variable {I J}
| Mathlib/RingTheory/Ideal/MinimalPrime.lean | 56 | 74 | theorem Ideal.exists_minimalPrimes_le [J.IsPrime] (e : I ≤ J) : ∃ p ∈ I.minimalPrimes, p ≤ J := by |
suffices
∃ m ∈ { p : (Ideal R)ᵒᵈ | Ideal.IsPrime p ∧ I ≤ OrderDual.ofDual p },
OrderDual.toDual J ≤ m ∧ ∀ z ∈ { p : (Ideal R)ᵒᵈ | Ideal.IsPrime p ∧ I ≤ p }, m ≤ z → z = m by
obtain ⟨p, h₁, h₂, h₃⟩ := this
simp_rw [← @eq_comm _ p] at h₃
exact ⟨p, ⟨h₁, fun a b c => le_of_eq (h₃ a b c)⟩, h₂⟩
apply zorn_nonempty_partialOrder₀
swap
· refine ⟨show J.IsPrime by infer_instance, e⟩
rintro (c : Set (Ideal R)) hc hc' J' hJ'
refine
⟨OrderDual.toDual (sInf c),
⟨Ideal.sInf_isPrime_of_isChain ⟨J', hJ'⟩ hc'.symm fun x hx => (hc hx).1, ?_⟩, ?_⟩
· rw [OrderDual.ofDual_toDual, le_sInf_iff]
exact fun _ hx => (hc hx).2
· rintro z hz
rw [OrderDual.le_toDual]
exact sInf_le hz
| 18 | 65,659,969.137331 | 2 | 2 | 5 | 2,263 |
import Mathlib.RingTheory.Ideal.IsPrimary
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.Order.Minimal
#align_import ring_theory.ideal.minimal_prime from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
section
variable {R S : Type*} [CommSemiring R] [CommSemiring S] (I J : Ideal R)
protected def Ideal.minimalPrimes : Set (Ideal R) :=
minimals (· ≤ ·) { p | p.IsPrime ∧ I ≤ p }
#align ideal.minimal_primes Ideal.minimalPrimes
variable (R) in
def minimalPrimes : Set (Ideal R) :=
Ideal.minimalPrimes ⊥
#align minimal_primes minimalPrimes
lemma minimalPrimes_eq_minimals : minimalPrimes R = minimals (· ≤ ·) (setOf Ideal.IsPrime) :=
congr_arg (minimals (· ≤ ·)) (by simp)
variable {I J}
theorem Ideal.exists_minimalPrimes_le [J.IsPrime] (e : I ≤ J) : ∃ p ∈ I.minimalPrimes, p ≤ J := by
suffices
∃ m ∈ { p : (Ideal R)ᵒᵈ | Ideal.IsPrime p ∧ I ≤ OrderDual.ofDual p },
OrderDual.toDual J ≤ m ∧ ∀ z ∈ { p : (Ideal R)ᵒᵈ | Ideal.IsPrime p ∧ I ≤ p }, m ≤ z → z = m by
obtain ⟨p, h₁, h₂, h₃⟩ := this
simp_rw [← @eq_comm _ p] at h₃
exact ⟨p, ⟨h₁, fun a b c => le_of_eq (h₃ a b c)⟩, h₂⟩
apply zorn_nonempty_partialOrder₀
swap
· refine ⟨show J.IsPrime by infer_instance, e⟩
rintro (c : Set (Ideal R)) hc hc' J' hJ'
refine
⟨OrderDual.toDual (sInf c),
⟨Ideal.sInf_isPrime_of_isChain ⟨J', hJ'⟩ hc'.symm fun x hx => (hc hx).1, ?_⟩, ?_⟩
· rw [OrderDual.ofDual_toDual, le_sInf_iff]
exact fun _ hx => (hc hx).2
· rintro z hz
rw [OrderDual.le_toDual]
exact sInf_le hz
#align ideal.exists_minimal_primes_le Ideal.exists_minimalPrimes_le
@[simp]
| Mathlib/RingTheory/Ideal/MinimalPrime.lean | 78 | 87 | theorem Ideal.radical_minimalPrimes : I.radical.minimalPrimes = I.minimalPrimes := by |
rw [Ideal.minimalPrimes, Ideal.minimalPrimes]
ext p
refine ⟨?_, ?_⟩ <;> rintro ⟨⟨a, ha⟩, b⟩
· refine ⟨⟨a, a.radical_le_iff.1 ha⟩, ?_⟩
simp only [Set.mem_setOf_eq, and_imp] at *
exact fun _ h2 h3 h4 => b h2 (h2.radical_le_iff.2 h3) h4
· refine ⟨⟨a, a.radical_le_iff.2 ha⟩, ?_⟩
simp only [Set.mem_setOf_eq, and_imp] at *
exact fun _ h2 h3 h4 => b h2 (h2.radical_le_iff.1 h3) h4
| 9 | 8,103.083928 | 2 | 2 | 5 | 2,263 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.