Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k |
|---|---|---|---|---|---|
import Mathlib.Analysis.Analytic.Basic
import Mathlib.Analysis.Analytic.Composition
import Mathlib.Analysis.Analytic.Linear
import Mathlib.Analysis.Calculus.FDeriv.Analytic
import Mathlib.Geometry.Manifold.ChartedSpace
import Mathlib.Analysis.NormedSpace.FiniteDimension
import Mathlib.Analysis.Calculus.ContDiff.Basic
#align_import geometry.manifold.smooth_manifold_with_corners from "leanprover-community/mathlib"@"ddec54a71a0dd025c05445d467f1a2b7d586a3ba"
noncomputable section
universe u v w u' v' w'
open Set Filter Function
open scoped Manifold Filter Topology
scoped[Manifold] notation "∞" => (⊤ : ℕ∞)
@[ext] -- Porting note(#5171): was nolint has_nonempty_instance
structure ModelWithCorners (𝕜 : Type*) [NontriviallyNormedField 𝕜] (E : Type*)
[NormedAddCommGroup E] [NormedSpace 𝕜 E] (H : Type*) [TopologicalSpace H] extends
PartialEquiv H E where
source_eq : source = univ
unique_diff' : UniqueDiffOn 𝕜 toPartialEquiv.target
continuous_toFun : Continuous toFun := by continuity
continuous_invFun : Continuous invFun := by continuity
#align model_with_corners ModelWithCorners
attribute [simp, mfld_simps] ModelWithCorners.source_eq
def modelWithCornersSelf (𝕜 : Type*) [NontriviallyNormedField 𝕜] (E : Type*)
[NormedAddCommGroup E] [NormedSpace 𝕜 E] : ModelWithCorners 𝕜 E E where
toPartialEquiv := PartialEquiv.refl E
source_eq := rfl
unique_diff' := uniqueDiffOn_univ
continuous_toFun := continuous_id
continuous_invFun := continuous_id
#align model_with_corners_self modelWithCornersSelf
@[inherit_doc] scoped[Manifold] notation "𝓘(" 𝕜 ", " E ")" => modelWithCornersSelf 𝕜 E
scoped[Manifold] notation "𝓘(" 𝕜 ")" => modelWithCornersSelf 𝕜 𝕜
section
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E]
[NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H)
namespace ModelWithCorners
@[coe] def toFun' (e : ModelWithCorners 𝕜 E H) : H → E := e.toFun
instance : CoeFun (ModelWithCorners 𝕜 E H) fun _ => H → E := ⟨toFun'⟩
protected def symm : PartialEquiv E H :=
I.toPartialEquiv.symm
#align model_with_corners.symm ModelWithCorners.symm
def Simps.apply (𝕜 : Type*) [NontriviallyNormedField 𝕜] (E : Type*) [NormedAddCommGroup E]
[NormedSpace 𝕜 E] (H : Type*) [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) : H → E :=
I
#align model_with_corners.simps.apply ModelWithCorners.Simps.apply
def Simps.symm_apply (𝕜 : Type*) [NontriviallyNormedField 𝕜] (E : Type*) [NormedAddCommGroup E]
[NormedSpace 𝕜 E] (H : Type*) [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) : E → H :=
I.symm
#align model_with_corners.simps.symm_apply ModelWithCorners.Simps.symm_apply
initialize_simps_projections ModelWithCorners (toFun → apply, invFun → symm_apply)
-- Register a few lemmas to make sure that `simp` puts expressions in normal form
@[simp, mfld_simps]
theorem toPartialEquiv_coe : (I.toPartialEquiv : H → E) = I :=
rfl
#align model_with_corners.to_local_equiv_coe ModelWithCorners.toPartialEquiv_coe
@[simp, mfld_simps]
theorem mk_coe (e : PartialEquiv H E) (a b c d) :
((ModelWithCorners.mk e a b c d : ModelWithCorners 𝕜 E H) : H → E) = (e : H → E) :=
rfl
#align model_with_corners.mk_coe ModelWithCorners.mk_coe
@[simp, mfld_simps]
theorem toPartialEquiv_coe_symm : (I.toPartialEquiv.symm : E → H) = I.symm :=
rfl
#align model_with_corners.to_local_equiv_coe_symm ModelWithCorners.toPartialEquiv_coe_symm
@[simp, mfld_simps]
theorem mk_symm (e : PartialEquiv H E) (a b c d) :
(ModelWithCorners.mk e a b c d : ModelWithCorners 𝕜 E H).symm = e.symm :=
rfl
#align model_with_corners.mk_symm ModelWithCorners.mk_symm
@[continuity]
protected theorem continuous : Continuous I :=
I.continuous_toFun
#align model_with_corners.continuous ModelWithCorners.continuous
protected theorem continuousAt {x} : ContinuousAt I x :=
I.continuous.continuousAt
#align model_with_corners.continuous_at ModelWithCorners.continuousAt
protected theorem continuousWithinAt {s x} : ContinuousWithinAt I s x :=
I.continuousAt.continuousWithinAt
#align model_with_corners.continuous_within_at ModelWithCorners.continuousWithinAt
@[continuity]
theorem continuous_symm : Continuous I.symm :=
I.continuous_invFun
#align model_with_corners.continuous_symm ModelWithCorners.continuous_symm
theorem continuousAt_symm {x} : ContinuousAt I.symm x :=
I.continuous_symm.continuousAt
#align model_with_corners.continuous_at_symm ModelWithCorners.continuousAt_symm
theorem continuousWithinAt_symm {s x} : ContinuousWithinAt I.symm s x :=
I.continuous_symm.continuousWithinAt
#align model_with_corners.continuous_within_at_symm ModelWithCorners.continuousWithinAt_symm
theorem continuousOn_symm {s} : ContinuousOn I.symm s :=
I.continuous_symm.continuousOn
#align model_with_corners.continuous_on_symm ModelWithCorners.continuousOn_symm
@[simp, mfld_simps]
| Mathlib/Geometry/Manifold/SmoothManifoldWithCorners.lean | 256 | 258 | theorem target_eq : I.target = range (I : H → E) := by |
rw [← image_univ, ← I.source_eq]
exact I.image_source_eq_target.symm
|
import Mathlib.MeasureTheory.Group.GeometryOfNumbers
import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls
import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional
local notation "E" K =>
({w : InfinitePlace K // IsReal w} → ℝ) × ({w : InfinitePlace K // IsComplex w} → ℂ)
section convexBodyLT'
open Metric ENNReal NNReal
open scoped Classical
variable (f : InfinitePlace K → ℝ≥0) (w₀ : {w : InfinitePlace K // IsComplex w})
abbrev convexBodyLT' : Set (E K) :=
(Set.univ.pi (fun w : { w : InfinitePlace K // IsReal w } ↦ ball 0 (f w))) ×ˢ
(Set.univ.pi (fun w : { w : InfinitePlace K // IsComplex w } ↦
if w = w₀ then {x | |x.re| < 1 ∧ |x.im| < (f w : ℝ) ^ 2} else ball 0 (f w)))
theorem convexBodyLT'_mem {x : K} :
mixedEmbedding K x ∈ convexBodyLT' K f w₀ ↔
(∀ w : InfinitePlace K, w ≠ w₀ → w x < f w) ∧
|(w₀.val.embedding x).re| < 1 ∧ |(w₀.val.embedding x).im| < (f w₀: ℝ) ^ 2 := by
simp_rw [mixedEmbedding, RingHom.prod_apply, Set.mem_prod, Set.mem_pi, Set.mem_univ,
forall_true_left, Pi.ringHom_apply, apply_ite, mem_ball_zero_iff, ← Complex.norm_real,
embedding_of_isReal_apply, norm_embedding_eq, Subtype.forall, Set.mem_setOf_eq]
refine ⟨fun ⟨h₁, h₂⟩ ↦ ⟨fun w h_ne ↦ ?_, ?_⟩, fun ⟨h₁, h₂⟩ ↦ ⟨fun w hw ↦ ?_, fun w hw ↦ ?_⟩⟩
· by_cases hw : IsReal w
· exact norm_embedding_eq w _ ▸ h₁ w hw
· specialize h₂ w (not_isReal_iff_isComplex.mp hw)
rwa [if_neg (by exact Subtype.coe_ne_coe.1 h_ne)] at h₂
· simpa [if_true] using h₂ w₀.val w₀.prop
· exact h₁ w (ne_of_isReal_isComplex hw w₀.prop)
· by_cases h_ne : w = w₀
· simpa [h_ne]
· rw [if_neg (by exact Subtype.coe_ne_coe.1 h_ne)]
exact h₁ w h_ne
theorem convexBodyLT'_neg_mem (x : E K) (hx : x ∈ convexBodyLT' K f w₀) :
-x ∈ convexBodyLT' K f w₀ := by
simp [Set.mem_prod, Prod.fst_neg, Set.mem_pi, Set.mem_univ, Pi.neg_apply,
mem_ball_zero_iff, norm_neg, Real.norm_eq_abs, forall_true_left, Subtype.forall,
Prod.snd_neg, Complex.norm_eq_abs] at hx ⊢
convert hx using 3
split_ifs <;> simp
theorem convexBodyLT'_convex : Convex ℝ (convexBodyLT' K f w₀) := by
refine Convex.prod (convex_pi (fun _ _ => convex_ball _ _)) (convex_pi (fun _ _ => ?_))
split_ifs
· simp_rw [abs_lt]
refine Convex.inter ((convex_halfspace_re_gt _).inter (convex_halfspace_re_lt _))
((convex_halfspace_im_gt _).inter (convex_halfspace_im_lt _))
· exact convex_ball _ _
open MeasureTheory MeasureTheory.Measure
open scoped Classical
variable [NumberField K]
noncomputable abbrev convexBodyLT'Factor : ℝ≥0 :=
(2 : ℝ≥0) ^ (NrRealPlaces K + 2) * NNReal.pi ^ (NrComplexPlaces K - 1)
theorem convexBodyLT'Factor_ne_zero : convexBodyLT'Factor K ≠ 0 :=
mul_ne_zero (pow_ne_zero _ two_ne_zero) (pow_ne_zero _ pi_ne_zero)
theorem one_le_convexBodyLT'Factor : 1 ≤ convexBodyLT'Factor K :=
one_le_mul₀ (one_le_pow_of_one_le one_le_two _)
(one_le_pow_of_one_le (le_trans one_le_two Real.two_le_pi) _)
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/ConvexBody.lean | 221 | 266 | theorem convexBodyLT'_volume :
volume (convexBodyLT' K f w₀) = convexBodyLT'Factor K * ∏ w, (f w) ^ (mult w) := by |
have vol_box : ∀ B : ℝ≥0, volume {x : ℂ | |x.re| < 1 ∧ |x.im| < B^2} = 4*B^2 := by
intro B
rw [← (Complex.volume_preserving_equiv_real_prod.symm).measure_preimage]
· simp_rw [Set.preimage_setOf_eq, Complex.measurableEquivRealProd_symm_apply]
rw [show {a : ℝ × ℝ | |a.1| < 1 ∧ |a.2| < B ^ 2} =
Set.Ioo (-1:ℝ) (1:ℝ) ×ˢ Set.Ioo (- (B:ℝ) ^ 2) ((B:ℝ) ^ 2) by
ext; simp_rw [Set.mem_setOf_eq, Set.mem_prod, Set.mem_Ioo, abs_lt]]
simp_rw [volume_eq_prod, prod_prod, Real.volume_Ioo, sub_neg_eq_add, one_add_one_eq_two,
← two_mul, ofReal_mul zero_le_two, ofReal_pow (coe_nonneg B), ofReal_ofNat,
ofReal_coe_nnreal, ← mul_assoc, show (2:ℝ≥0∞) * 2 = 4 by norm_num]
· refine MeasurableSet.inter ?_ ?_
· exact measurableSet_lt (measurable_norm.comp Complex.measurable_re) measurable_const
· exact measurableSet_lt (measurable_norm.comp Complex.measurable_im) measurable_const
calc
_ = (∏ x : {w // InfinitePlace.IsReal w}, ENNReal.ofReal (2 * (f x.val))) *
((∏ x ∈ Finset.univ.erase w₀, ENNReal.ofReal (f x.val) ^ 2 * pi) *
(4 * (f w₀) ^ 2)) := by
simp_rw [volume_eq_prod, prod_prod, volume_pi, pi_pi, Real.volume_ball]
rw [← Finset.prod_erase_mul _ _ (Finset.mem_univ w₀)]
congr 2
· refine Finset.prod_congr rfl (fun w' hw' ↦ ?_)
rw [if_neg (Finset.ne_of_mem_erase hw'), Complex.volume_ball]
· simpa only [ite_true] using vol_box (f w₀)
_ = ((2 : ℝ≥0) ^ NrRealPlaces K *
(∏ x : {w // InfinitePlace.IsReal w}, ENNReal.ofReal (f x.val))) *
((∏ x ∈ Finset.univ.erase w₀, ENNReal.ofReal (f x.val) ^ 2) *
↑pi ^ (NrComplexPlaces K - 1) * (4 * (f w₀) ^ 2)) := by
simp_rw [ofReal_mul (by norm_num : 0 ≤ (2 : ℝ)), Finset.prod_mul_distrib, Finset.prod_const,
Finset.card_erase_of_mem (Finset.mem_univ _), Finset.card_univ, ofReal_ofNat,
ofReal_coe_nnreal, coe_ofNat]
_ = convexBodyLT'Factor K * (∏ x : {w // InfinitePlace.IsReal w}, ENNReal.ofReal (f x.val))
* (∏ x : {w // IsComplex w}, ENNReal.ofReal (f x.val) ^ 2) := by
rw [show (4 : ℝ≥0∞) = (2 : ℝ≥0) ^ 2 by norm_num, convexBodyLT'Factor, pow_add,
← Finset.prod_erase_mul _ _ (Finset.mem_univ w₀), ofReal_coe_nnreal]
simp_rw [coe_mul, ENNReal.coe_pow]
ring
_ = convexBodyLT'Factor K * ∏ w, (f w) ^ (mult w) := by
simp_rw [mult, pow_ite, pow_one, Finset.prod_ite, ofReal_coe_nnreal, not_isReal_iff_isComplex,
coe_mul, coe_finset_prod, ENNReal.coe_pow, mul_assoc]
congr 3
· refine (Finset.prod_subtype (Finset.univ.filter _) ?_ (fun w => (f w : ℝ≥0∞))).symm
exact fun _ => by simp only [Finset.mem_univ, forall_true_left, Finset.mem_filter, true_and]
· refine (Finset.prod_subtype (Finset.univ.filter _) ?_ (fun w => (f w : ℝ≥0∞) ^ 2)).symm
exact fun _ => by simp only [Finset.mem_univ, forall_true_left, Finset.mem_filter, true_and]
|
import Mathlib.Topology.MetricSpace.PseudoMetric
#align_import topology.metric_space.basic from "leanprover-community/mathlib"@"c8f305514e0d47dfaa710f5a52f0d21b588e6328"
open Set Filter Bornology
open scoped NNReal Uniformity
universe u v w
variable {α : Type u} {β : Type v} {X ι : Type*}
variable [PseudoMetricSpace α]
class MetricSpace (α : Type u) extends PseudoMetricSpace α : Type u where
eq_of_dist_eq_zero : ∀ {x y : α}, dist x y = 0 → x = y
#align metric_space MetricSpace
@[ext]
| Mathlib/Topology/MetricSpace/Basic.lean | 45 | 47 | theorem MetricSpace.ext {α : Type*} {m m' : MetricSpace α} (h : m.toDist = m'.toDist) :
m = m' := by |
cases m; cases m'; congr; ext1; assumption
|
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
|
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def χ₄ : MulChar (ZMod 4) ℤ where
toFun := (![0, 1, 0, -1] : ZMod 4 → ℤ)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.χ₄ ZMod.χ₄
theorem isQuadratic_χ₄ : χ₄.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_χ₄ ZMod.isQuadratic_χ₄
theorem χ₄_nat_mod_four (n : ℕ) : χ₄ n = χ₄ (n % 4 : ℕ) := by rw [← ZMod.natCast_mod n 4]
#align zmod.χ₄_nat_mod_four ZMod.χ₄_nat_mod_four
theorem χ₄_int_mod_four (n : ℤ) : χ₄ n = χ₄ (n % 4 : ℤ) := by
rw [← ZMod.intCast_mod n 4]
norm_cast
#align zmod.χ₄_int_mod_four ZMod.χ₄_int_mod_four
theorem χ₄_int_eq_if_mod_four (n : ℤ) :
χ₄ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by
have help : ∀ m : ℤ, 0 ≤ m → m < 4 → χ₄ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [← Int.emod_emod_of_dvd n (by decide : (2 : ℤ) ∣ 4), ← ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
#align zmod.χ₄_int_eq_if_mod_four ZMod.χ₄_int_eq_if_mod_four
theorem χ₄_nat_eq_if_mod_four (n : ℕ) :
χ₄ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 :=
mod_cast χ₄_int_eq_if_mod_four n
#align zmod.χ₄_nat_eq_if_mod_four ZMod.χ₄_nat_eq_if_mod_four
theorem χ₄_eq_neg_one_pow {n : ℕ} (hn : n % 2 = 1) : χ₄ n = (-1) ^ (n / 2) := by
rw [χ₄_nat_eq_if_mod_four]
simp only [hn, Nat.one_ne_zero, if_false]
conv_rhs => -- Porting note: was `nth_rw`
arg 2; rw [← Nat.div_add_mod n 4]
enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)]
rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
neg_one_sq, one_pow, mul_one]
have help : ∀ m : ℕ, m < 4 → m % 2 = 1 → ite (m = 1) (1 : ℤ) (-1) = (-1) ^ (m / 2) := by decide
exact
help (n % 4) (Nat.mod_lt n (by norm_num))
((Nat.mod_mod_of_dvd n (by decide : 2 ∣ 4)).trans hn)
#align zmod.χ₄_eq_neg_one_pow ZMod.χ₄_eq_neg_one_pow
theorem χ₄_nat_one_mod_four {n : ℕ} (hn : n % 4 = 1) : χ₄ n = 1 := by
rw [χ₄_nat_mod_four, hn]
rfl
#align zmod.χ₄_nat_one_mod_four ZMod.χ₄_nat_one_mod_four
theorem χ₄_nat_three_mod_four {n : ℕ} (hn : n % 4 = 3) : χ₄ n = -1 := by
rw [χ₄_nat_mod_four, hn]
rfl
#align zmod.χ₄_nat_three_mod_four ZMod.χ₄_nat_three_mod_four
theorem χ₄_int_one_mod_four {n : ℤ} (hn : n % 4 = 1) : χ₄ n = 1 := by
rw [χ₄_int_mod_four, hn]
rfl
#align zmod.χ₄_int_one_mod_four ZMod.χ₄_int_one_mod_four
theorem χ₄_int_three_mod_four {n : ℤ} (hn : n % 4 = 3) : χ₄ n = -1 := by
rw [χ₄_int_mod_four, hn]
rfl
#align zmod.χ₄_int_three_mod_four ZMod.χ₄_int_three_mod_four
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 119 | 121 | theorem neg_one_pow_div_two_of_one_mod_four {n : ℕ} (hn : n % 4 = 1) : (-1 : ℤ) ^ (n / 2) = 1 := by |
rw [← χ₄_eq_neg_one_pow (Nat.odd_of_mod_four_eq_one hn), ← natCast_mod, hn]
rfl
|
import Mathlib.Data.Multiset.FinsetOps
import Mathlib.Data.Multiset.Fold
#align_import data.multiset.lattice from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
namespace Multiset
variable {α : Type*}
section Inf
-- can be defined with just `[Top α]` where some lemmas hold without requiring `[OrderTop α]`
variable [SemilatticeInf α] [OrderTop α]
def inf (s : Multiset α) : α :=
s.fold (· ⊓ ·) ⊤
#align multiset.inf Multiset.inf
@[simp]
theorem inf_coe (l : List α) : inf (l : Multiset α) = l.foldr (· ⊓ ·) ⊤ :=
rfl
#align multiset.inf_coe Multiset.inf_coe
@[simp]
theorem inf_zero : (0 : Multiset α).inf = ⊤ :=
fold_zero _ _
#align multiset.inf_zero Multiset.inf_zero
@[simp]
theorem inf_cons (a : α) (s : Multiset α) : (a ::ₘ s).inf = a ⊓ s.inf :=
fold_cons_left _ _ _ _
#align multiset.inf_cons Multiset.inf_cons
@[simp]
theorem inf_singleton {a : α} : ({a} : Multiset α).inf = a := inf_top_eq _
#align multiset.inf_singleton Multiset.inf_singleton
@[simp]
theorem inf_add (s₁ s₂ : Multiset α) : (s₁ + s₂).inf = s₁.inf ⊓ s₂.inf :=
Eq.trans (by simp [inf]) (fold_add _ _ _ _ _)
#align multiset.inf_add Multiset.inf_add
@[simp]
theorem le_inf {s : Multiset α} {a : α} : a ≤ s.inf ↔ ∀ b ∈ s, a ≤ b :=
Multiset.induction_on s (by simp)
(by simp (config := { contextual := true }) [or_imp, forall_and])
#align multiset.le_inf Multiset.le_inf
theorem inf_le {s : Multiset α} {a : α} (h : a ∈ s) : s.inf ≤ a :=
le_inf.1 le_rfl _ h
#align multiset.inf_le Multiset.inf_le
theorem inf_mono {s₁ s₂ : Multiset α} (h : s₁ ⊆ s₂) : s₂.inf ≤ s₁.inf :=
le_inf.2 fun _ hb => inf_le (h hb)
#align multiset.inf_mono Multiset.inf_mono
variable [DecidableEq α]
@[simp]
theorem inf_dedup (s : Multiset α) : (dedup s).inf = s.inf :=
fold_dedup_idem _ _ _
#align multiset.inf_dedup Multiset.inf_dedup
@[simp]
| Mathlib/Data/Multiset/Lattice.lean | 163 | 164 | theorem inf_ndunion (s₁ s₂ : Multiset α) : (ndunion s₁ s₂).inf = s₁.inf ⊓ s₂.inf := by |
rw [← inf_dedup, dedup_ext.2, inf_dedup, inf_add]; simp
|
import Mathlib.Algebra.Lie.Abelian
import Mathlib.Algebra.Lie.IdealOperations
import Mathlib.Order.Hom.Basic
#align_import algebra.lie.solvable from "leanprover-community/mathlib"@"a50170a88a47570ed186b809ca754110590f9476"
universe u v w w₁ w₂
variable (R : Type u) (L : Type v) (M : Type w) {L' : Type w₁}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L'] [LieAlgebra R L']
variable (I J : LieIdeal R L) {f : L' →ₗ⁅R⁆ L}
namespace LieAlgebra
def derivedSeriesOfIdeal (k : ℕ) : LieIdeal R L → LieIdeal R L :=
(fun I => ⁅I, I⁆)^[k]
#align lie_algebra.derived_series_of_ideal LieAlgebra.derivedSeriesOfIdeal
@[simp]
theorem derivedSeriesOfIdeal_zero : derivedSeriesOfIdeal R L 0 I = I :=
rfl
#align lie_algebra.derived_series_of_ideal_zero LieAlgebra.derivedSeriesOfIdeal_zero
@[simp]
theorem derivedSeriesOfIdeal_succ (k : ℕ) :
derivedSeriesOfIdeal R L (k + 1) I =
⁅derivedSeriesOfIdeal R L k I, derivedSeriesOfIdeal R L k I⁆ :=
Function.iterate_succ_apply' (fun I => ⁅I, I⁆) k I
#align lie_algebra.derived_series_of_ideal_succ LieAlgebra.derivedSeriesOfIdeal_succ
abbrev derivedSeries (k : ℕ) : LieIdeal R L :=
derivedSeriesOfIdeal R L k ⊤
#align lie_algebra.derived_series LieAlgebra.derivedSeries
theorem derivedSeries_def (k : ℕ) : derivedSeries R L k = derivedSeriesOfIdeal R L k ⊤ :=
rfl
#align lie_algebra.derived_series_def LieAlgebra.derivedSeries_def
variable {R L}
local notation "D" => derivedSeriesOfIdeal R L
theorem derivedSeriesOfIdeal_add (k l : ℕ) : D (k + l) I = D k (D l I) := by
induction' k with k ih
· rw [Nat.zero_add, derivedSeriesOfIdeal_zero]
· rw [Nat.succ_add k l, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ, ih]
#align lie_algebra.derived_series_of_ideal_add LieAlgebra.derivedSeriesOfIdeal_add
@[mono]
theorem derivedSeriesOfIdeal_le {I J : LieIdeal R L} {k l : ℕ} (h₁ : I ≤ J) (h₂ : l ≤ k) :
D k I ≤ D l J := by
revert l; induction' k with k ih <;> intro l h₂
· rw [le_zero_iff] at h₂; rw [h₂, derivedSeriesOfIdeal_zero]; exact h₁
· have h : l = k.succ ∨ l ≤ k := by rwa [le_iff_eq_or_lt, Nat.lt_succ_iff] at h₂
cases' h with h h
· rw [h, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ]
exact LieSubmodule.mono_lie _ _ _ _ (ih (le_refl k)) (ih (le_refl k))
· rw [derivedSeriesOfIdeal_succ]; exact le_trans (LieSubmodule.lie_le_left _ _) (ih h)
#align lie_algebra.derived_series_of_ideal_le LieAlgebra.derivedSeriesOfIdeal_le
theorem derivedSeriesOfIdeal_succ_le (k : ℕ) : D (k + 1) I ≤ D k I :=
derivedSeriesOfIdeal_le (le_refl I) k.le_succ
#align lie_algebra.derived_series_of_ideal_succ_le LieAlgebra.derivedSeriesOfIdeal_succ_le
theorem derivedSeriesOfIdeal_le_self (k : ℕ) : D k I ≤ I :=
derivedSeriesOfIdeal_le (le_refl I) (zero_le k)
#align lie_algebra.derived_series_of_ideal_le_self LieAlgebra.derivedSeriesOfIdeal_le_self
theorem derivedSeriesOfIdeal_mono {I J : LieIdeal R L} (h : I ≤ J) (k : ℕ) : D k I ≤ D k J :=
derivedSeriesOfIdeal_le h (le_refl k)
#align lie_algebra.derived_series_of_ideal_mono LieAlgebra.derivedSeriesOfIdeal_mono
theorem derivedSeriesOfIdeal_antitone {k l : ℕ} (h : l ≤ k) : D k I ≤ D l I :=
derivedSeriesOfIdeal_le (le_refl I) h
#align lie_algebra.derived_series_of_ideal_antitone LieAlgebra.derivedSeriesOfIdeal_antitone
theorem derivedSeriesOfIdeal_add_le_add (J : LieIdeal R L) (k l : ℕ) :
D (k + l) (I + J) ≤ D k I + D l J := by
let D₁ : LieIdeal R L →o LieIdeal R L :=
{ toFun := fun I => ⁅I, I⁆
monotone' := fun I J h => LieSubmodule.mono_lie I J I J h h }
have h₁ : ∀ I J : LieIdeal R L, D₁ (I ⊔ J) ≤ D₁ I ⊔ J := by
simp [D₁, LieSubmodule.lie_le_right, LieSubmodule.lie_le_left, le_sup_of_le_right]
rw [← D₁.iterate_sup_le_sup_iff] at h₁
exact h₁ k l I J
#align lie_algebra.derived_series_of_ideal_add_le_add LieAlgebra.derivedSeriesOfIdeal_add_le_add
theorem derivedSeries_of_bot_eq_bot (k : ℕ) : derivedSeriesOfIdeal R L k ⊥ = ⊥ := by
rw [eq_bot_iff]; exact derivedSeriesOfIdeal_le_self ⊥ k
#align lie_algebra.derived_series_of_bot_eq_bot LieAlgebra.derivedSeries_of_bot_eq_bot
| Mathlib/Algebra/Lie/Solvable.lean | 131 | 133 | theorem abelian_iff_derived_one_eq_bot : IsLieAbelian I ↔ derivedSeriesOfIdeal R L 1 I = ⊥ := by |
rw [derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_zero,
LieSubmodule.lie_abelian_iff_lie_self_eq_bot]
|
import Mathlib.Algebra.Order.Monoid.Defs
import Mathlib.Algebra.Order.Sub.Defs
import Mathlib.Util.AssertExists
#align_import algebra.order.group.defs from "leanprover-community/mathlib"@"b599f4e4e5cf1fbcb4194503671d3d9e569c1fce"
open Function
universe u
variable {α : Type u}
class OrderedAddCommGroup (α : Type u) extends AddCommGroup α, PartialOrder α where
protected add_le_add_left : ∀ a b : α, a ≤ b → ∀ c : α, c + a ≤ c + b
#align ordered_add_comm_group OrderedAddCommGroup
class OrderedCommGroup (α : Type u) extends CommGroup α, PartialOrder α where
protected mul_le_mul_left : ∀ a b : α, a ≤ b → ∀ c : α, c * a ≤ c * b
#align ordered_comm_group OrderedCommGroup
attribute [to_additive] OrderedCommGroup
@[to_additive]
instance OrderedCommGroup.to_covariantClass_left_le (α : Type u) [OrderedCommGroup α] :
CovariantClass α α (· * ·) (· ≤ ·) where
elim a b c bc := OrderedCommGroup.mul_le_mul_left b c bc a
#align ordered_comm_group.to_covariant_class_left_le OrderedCommGroup.to_covariantClass_left_le
#align ordered_add_comm_group.to_covariant_class_left_le OrderedAddCommGroup.to_covariantClass_left_le
-- See note [lower instance priority]
@[to_additive OrderedAddCommGroup.toOrderedCancelAddCommMonoid]
instance (priority := 100) OrderedCommGroup.toOrderedCancelCommMonoid [OrderedCommGroup α] :
OrderedCancelCommMonoid α :=
{ ‹OrderedCommGroup α› with le_of_mul_le_mul_left := fun a b c ↦ le_of_mul_le_mul_left' }
#align ordered_comm_group.to_ordered_cancel_comm_monoid OrderedCommGroup.toOrderedCancelCommMonoid
#align ordered_add_comm_group.to_ordered_cancel_add_comm_monoid OrderedAddCommGroup.toOrderedCancelAddCommMonoid
example (α : Type u) [OrderedAddCommGroup α] : CovariantClass α α (swap (· + ·)) (· < ·) :=
IsRightCancelAdd.covariant_swap_add_lt_of_covariant_swap_add_le α
-- Porting note: this instance is not used,
-- and causes timeouts after lean4#2210.
-- It was introduced in https://github.com/leanprover-community/mathlib/pull/17564
-- but without the motivation clearly explained.
@[to_additive "A choice-free shortcut instance."]
theorem OrderedCommGroup.to_contravariantClass_left_le (α : Type u) [OrderedCommGroup α] :
ContravariantClass α α (· * ·) (· ≤ ·) where
elim a b c bc := by simpa using mul_le_mul_left' bc a⁻¹
#align ordered_comm_group.to_contravariant_class_left_le OrderedCommGroup.to_contravariantClass_left_le
#align ordered_add_comm_group.to_contravariant_class_left_le OrderedAddCommGroup.to_contravariantClass_left_le
-- Porting note: this instance is not used,
-- and causes timeouts after lean4#2210.
-- See further explanation on `OrderedCommGroup.to_contravariantClass_left_le`.
@[to_additive "A choice-free shortcut instance."]
theorem OrderedCommGroup.to_contravariantClass_right_le (α : Type u) [OrderedCommGroup α] :
ContravariantClass α α (swap (· * ·)) (· ≤ ·) where
elim a b c bc := by simpa using mul_le_mul_right' bc a⁻¹
#align ordered_comm_group.to_contravariant_class_right_le OrderedCommGroup.to_contravariantClass_right_le
#align ordered_add_comm_group.to_contravariant_class_right_le OrderedAddCommGroup.to_contravariantClass_right_le
section Group
variable [Group α]
section TypeclassesLeftRightLT
variable [LT α] [CovariantClass α α (· * ·) (· < ·)] [CovariantClass α α (swap (· * ·)) (· < ·)]
{a b c d : α}
@[to_additive (attr := simp)]
theorem inv_lt_inv_iff : a⁻¹ < b⁻¹ ↔ b < a := by
rw [← mul_lt_mul_iff_left a, ← mul_lt_mul_iff_right b]
simp
#align inv_lt_inv_iff inv_lt_inv_iff
#align neg_lt_neg_iff neg_lt_neg_iff
@[to_additive neg_lt]
theorem inv_lt' : a⁻¹ < b ↔ b⁻¹ < a := by rw [← inv_lt_inv_iff, inv_inv]
#align inv_lt' inv_lt'
#align neg_lt neg_lt
@[to_additive lt_neg]
theorem lt_inv' : a < b⁻¹ ↔ b < a⁻¹ := by rw [← inv_lt_inv_iff, inv_inv]
#align lt_inv' lt_inv'
#align lt_neg lt_neg
alias ⟨lt_inv_of_lt_inv, _⟩ := lt_inv'
#align lt_inv_of_lt_inv lt_inv_of_lt_inv
attribute [to_additive] lt_inv_of_lt_inv
#align lt_neg_of_lt_neg lt_neg_of_lt_neg
alias ⟨inv_lt_of_inv_lt', _⟩ := inv_lt'
#align inv_lt_of_inv_lt' inv_lt_of_inv_lt'
attribute [to_additive neg_lt_of_neg_lt] inv_lt_of_inv_lt'
#align neg_lt_of_neg_lt neg_lt_of_neg_lt
@[to_additive]
| Mathlib/Algebra/Order/Group/Defs.lean | 411 | 413 | theorem mul_inv_lt_inv_mul_iff : a * b⁻¹ < d⁻¹ * c ↔ d * a < c * b := by |
rw [← mul_lt_mul_iff_left d, ← mul_lt_mul_iff_right b, mul_inv_cancel_left, mul_assoc,
inv_mul_cancel_right]
|
import Mathlib.Topology.ExtendFrom
import Mathlib.Topology.Order.DenselyOrdered
#align_import topology.algebra.order.extend_from from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
set_option autoImplicit true
open Filter Set TopologicalSpace
open scoped Classical
open Topology
theorem continuousOn_Icc_extendFrom_Ioo [TopologicalSpace α] [LinearOrder α] [DenselyOrdered α]
[OrderTopology α] [TopologicalSpace β] [RegularSpace β] {f : α → β} {a b : α} {la lb : β}
(hab : a ≠ b) (hf : ContinuousOn f (Ioo a b)) (ha : Tendsto f (𝓝[>] a) (𝓝 la))
(hb : Tendsto f (𝓝[<] b) (𝓝 lb)) : ContinuousOn (extendFrom (Ioo a b) f) (Icc a b) := by
apply continuousOn_extendFrom
· rw [closure_Ioo hab]
· intro x x_in
rcases eq_endpoints_or_mem_Ioo_of_mem_Icc x_in with (rfl | rfl | h)
· exact ⟨la, ha.mono_left <| nhdsWithin_mono _ Ioo_subset_Ioi_self⟩
· exact ⟨lb, hb.mono_left <| nhdsWithin_mono _ Ioo_subset_Iio_self⟩
· exact ⟨f x, hf x h⟩
#align continuous_on_Icc_extend_from_Ioo continuousOn_Icc_extendFrom_Ioo
theorem eq_lim_at_left_extendFrom_Ioo [TopologicalSpace α] [LinearOrder α] [DenselyOrdered α]
[OrderTopology α] [TopologicalSpace β] [T2Space β] {f : α → β} {a b : α} {la : β} (hab : a < b)
(ha : Tendsto f (𝓝[>] a) (𝓝 la)) : extendFrom (Ioo a b) f a = la := by
apply extendFrom_eq
· rw [closure_Ioo hab.ne]
simp only [le_of_lt hab, left_mem_Icc, right_mem_Icc]
· simpa [hab]
#align eq_lim_at_left_extend_from_Ioo eq_lim_at_left_extendFrom_Ioo
| Mathlib/Topology/Order/ExtendFrom.lean | 45 | 51 | theorem eq_lim_at_right_extendFrom_Ioo [TopologicalSpace α] [LinearOrder α] [DenselyOrdered α]
[OrderTopology α] [TopologicalSpace β] [T2Space β] {f : α → β} {a b : α} {lb : β} (hab : a < b)
(hb : Tendsto f (𝓝[<] b) (𝓝 lb)) : extendFrom (Ioo a b) f b = lb := by |
apply extendFrom_eq
· rw [closure_Ioo hab.ne]
simp only [le_of_lt hab, left_mem_Icc, right_mem_Icc]
· simpa [hab]
|
import Mathlib.Analysis.Convex.Jensen
import Mathlib.Analysis.Convex.Mul
import Mathlib.Analysis.Convex.SpecificFunctions.Basic
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal
#align_import analysis.mean_inequalities_pow from "leanprover-community/mathlib"@"ccdbfb6e5614667af5aa3ab2d50885e0ef44a46f"
universe u v
open Finset
open scoped Classical
open NNReal ENNReal
noncomputable section
variable {ι : Type u} (s : Finset ι)
namespace Real
theorem pow_arith_mean_le_arith_mean_pow (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i)
(hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) (n : ℕ) :
(∑ i ∈ s, w i * z i) ^ n ≤ ∑ i ∈ s, w i * z i ^ n :=
(convexOn_pow n).map_sum_le hw hw' hz
#align real.pow_arith_mean_le_arith_mean_pow Real.pow_arith_mean_le_arith_mean_pow
theorem pow_arith_mean_le_arith_mean_pow_of_even (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i)
(hw' : ∑ i ∈ s, w i = 1) {n : ℕ} (hn : Even n) :
(∑ i ∈ s, w i * z i) ^ n ≤ ∑ i ∈ s, w i * z i ^ n :=
hn.convexOn_pow.map_sum_le hw hw' fun _ _ => Set.mem_univ _
#align real.pow_arith_mean_le_arith_mean_pow_of_even Real.pow_arith_mean_le_arith_mean_pow_of_even
| Mathlib/Analysis/MeanInequalitiesPow.lean | 72 | 86 | theorem pow_sum_div_card_le_sum_pow {f : ι → ℝ} (n : ℕ) (hf : ∀ a ∈ s, 0 ≤ f a) :
(∑ x ∈ s, f x) ^ (n + 1) / (s.card : ℝ) ^ n ≤ ∑ x ∈ s, f x ^ (n + 1) := by |
rcases s.eq_empty_or_nonempty with (rfl | hs)
· simp_rw [Finset.sum_empty, zero_pow n.succ_ne_zero, zero_div]; rfl
· have hs0 : 0 < (s.card : ℝ) := Nat.cast_pos.2 hs.card_pos
suffices (∑ x ∈ s, f x / s.card) ^ (n + 1) ≤ ∑ x ∈ s, f x ^ (n + 1) / s.card by
rwa [← Finset.sum_div, ← Finset.sum_div, div_pow, pow_succ (s.card : ℝ), ← div_div,
div_le_iff hs0, div_mul, div_self hs0.ne', div_one] at this
have :=
@ConvexOn.map_sum_le ℝ ℝ ℝ ι _ _ _ _ _ _ (Set.Ici 0) (fun x => x ^ (n + 1)) s
(fun _ => 1 / s.card) ((↑) ∘ f) (convexOn_pow (n + 1)) ?_ ?_ fun i hi =>
Set.mem_Ici.2 (hf i hi)
· simpa only [inv_mul_eq_div, one_div, Algebra.id.smul_eq_mul] using this
· simp only [one_div, inv_nonneg, Nat.cast_nonneg, imp_true_iff]
· simpa only [one_div, Finset.sum_const, nsmul_eq_mul] using mul_inv_cancel hs0.ne'
|
import Mathlib.Algebra.GCDMonoid.Basic
import Mathlib.Data.Multiset.FinsetOps
import Mathlib.Data.Multiset.Fold
#align_import algebra.gcd_monoid.multiset from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
namespace Multiset
variable {α : Type*} [CancelCommMonoidWithZero α] [NormalizedGCDMonoid α]
section gcd
def gcd (s : Multiset α) : α :=
s.fold GCDMonoid.gcd 0
#align multiset.gcd Multiset.gcd
@[simp]
theorem gcd_zero : (0 : Multiset α).gcd = 0 :=
fold_zero _ _
#align multiset.gcd_zero Multiset.gcd_zero
@[simp]
theorem gcd_cons (a : α) (s : Multiset α) : (a ::ₘ s).gcd = GCDMonoid.gcd a s.gcd :=
fold_cons_left _ _ _ _
#align multiset.gcd_cons Multiset.gcd_cons
@[simp]
theorem gcd_singleton {a : α} : ({a} : Multiset α).gcd = normalize a :=
(fold_singleton _ _ _).trans <| gcd_zero_right _
#align multiset.gcd_singleton Multiset.gcd_singleton
@[simp]
theorem gcd_add (s₁ s₂ : Multiset α) : (s₁ + s₂).gcd = GCDMonoid.gcd s₁.gcd s₂.gcd :=
Eq.trans (by simp [gcd]) (fold_add _ _ _ _ _)
#align multiset.gcd_add Multiset.gcd_add
theorem dvd_gcd {s : Multiset α} {a : α} : a ∣ s.gcd ↔ ∀ b ∈ s, a ∣ b :=
Multiset.induction_on s (by simp)
(by simp (config := { contextual := true }) [or_imp, forall_and, dvd_gcd_iff])
#align multiset.dvd_gcd Multiset.dvd_gcd
theorem gcd_dvd {s : Multiset α} {a : α} (h : a ∈ s) : s.gcd ∣ a :=
dvd_gcd.1 dvd_rfl _ h
#align multiset.gcd_dvd Multiset.gcd_dvd
theorem gcd_mono {s₁ s₂ : Multiset α} (h : s₁ ⊆ s₂) : s₂.gcd ∣ s₁.gcd :=
dvd_gcd.2 fun _ hb ↦ gcd_dvd (h hb)
#align multiset.gcd_mono Multiset.gcd_mono
@[simp 1100]
theorem normalize_gcd (s : Multiset α) : normalize s.gcd = s.gcd :=
Multiset.induction_on s (by simp) fun a s _ ↦ by simp
#align multiset.normalize_gcd Multiset.normalize_gcd
theorem gcd_eq_zero_iff (s : Multiset α) : s.gcd = 0 ↔ ∀ x : α, x ∈ s → x = 0 := by
constructor
· intro h x hx
apply eq_zero_of_zero_dvd
rw [← h]
apply gcd_dvd hx
· refine s.induction_on ?_ ?_
· simp
intro a s sgcd h
simp [h a (mem_cons_self a s), sgcd fun x hx ↦ h x (mem_cons_of_mem hx)]
#align multiset.gcd_eq_zero_iff Multiset.gcd_eq_zero_iff
theorem gcd_map_mul (a : α) (s : Multiset α) : (s.map (a * ·)).gcd = normalize a * s.gcd := by
refine s.induction_on ?_ fun b s ih ↦ ?_
· simp_rw [map_zero, gcd_zero, mul_zero]
· simp_rw [map_cons, gcd_cons, ← gcd_mul_left]
rw [ih]
apply ((normalize_associated a).mul_right _).gcd_eq_right
#align multiset.gcd_map_mul Multiset.gcd_map_mul
section
variable [DecidableEq α]
@[simp]
theorem gcd_dedup (s : Multiset α) : (dedup s).gcd = s.gcd :=
Multiset.induction_on s (by simp) fun a s IH ↦ by
by_cases h : a ∈ s <;> simp [IH, h]
unfold gcd
rw [← cons_erase h, fold_cons_left, ← gcd_assoc, gcd_same]
apply (associated_normalize _).gcd_eq_left
#align multiset.gcd_dedup Multiset.gcd_dedup
@[simp]
theorem gcd_ndunion (s₁ s₂ : Multiset α) : (ndunion s₁ s₂).gcd = GCDMonoid.gcd s₁.gcd s₂.gcd := by
rw [← gcd_dedup, dedup_ext.2, gcd_dedup, gcd_add]
simp
#align multiset.gcd_ndunion Multiset.gcd_ndunion
@[simp]
theorem gcd_union (s₁ s₂ : Multiset α) : (s₁ ∪ s₂).gcd = GCDMonoid.gcd s₁.gcd s₂.gcd := by
rw [← gcd_dedup, dedup_ext.2, gcd_dedup, gcd_add]
simp
#align multiset.gcd_union Multiset.gcd_union
@[simp]
theorem gcd_ndinsert (a : α) (s : Multiset α) : (ndinsert a s).gcd = GCDMonoid.gcd a s.gcd := by
rw [← gcd_dedup, dedup_ext.2, gcd_dedup, gcd_cons]
simp
#align multiset.gcd_ndinsert Multiset.gcd_ndinsert
end
theorem extract_gcd' (s t : Multiset α) (hs : ∃ x, x ∈ s ∧ x ≠ (0 : α))
(ht : s = t.map (s.gcd * ·)) : t.gcd = 1 :=
((@mul_right_eq_self₀ _ _ s.gcd _).1 <| by
conv_lhs => rw [← normalize_gcd, ← gcd_map_mul, ← ht]).resolve_right <| by
contrapose! hs
exact s.gcd_eq_zero_iff.1 hs
#align multiset.extract_gcd' Multiset.extract_gcd'
| Mathlib/Algebra/GCDMonoid/Multiset.lean | 240 | 254 | theorem extract_gcd (s : Multiset α) (hs : s ≠ 0) :
∃ t : Multiset α, s = t.map (s.gcd * ·) ∧ t.gcd = 1 := by |
classical
by_cases h : ∀ x ∈ s, x = (0 : α)
· use replicate (card s) 1
rw [map_replicate, eq_replicate, mul_one, s.gcd_eq_zero_iff.2 h, ← nsmul_singleton,
← gcd_dedup, dedup_nsmul (card_pos.2 hs).ne', dedup_singleton, gcd_singleton]
exact ⟨⟨rfl, h⟩, normalize_one⟩
· choose f hf using @gcd_dvd _ _ _ s
push_neg at h
refine ⟨s.pmap @f fun _ ↦ id, ?_, extract_gcd' s _ h ?_⟩ <;>
· rw [map_pmap]
conv_lhs => rw [← s.map_id, ← s.pmap_eq_map _ _ fun _ ↦ id]
congr with (x hx)
rw [id, ← hf hx]
|
import Mathlib.Order.Interval.Set.UnorderedInterval
import Mathlib.Algebra.Order.Interval.Set.Monoid
import Mathlib.Data.Set.Pointwise.Basic
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
#align_import data.set.pointwise.interval from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Interval Pointwise
variable {α : Type*}
namespace Set
section LinearOrderedField
variable [LinearOrderedField α] {a : α}
@[simp]
theorem preimage_mul_const_Iio (a : α) {c : α} (h : 0 < c) :
(fun x => x * c) ⁻¹' Iio a = Iio (a / c) :=
ext fun _x => (lt_div_iff h).symm
#align set.preimage_mul_const_Iio Set.preimage_mul_const_Iio
@[simp]
theorem preimage_mul_const_Ioi (a : α) {c : α} (h : 0 < c) :
(fun x => x * c) ⁻¹' Ioi a = Ioi (a / c) :=
ext fun _x => (div_lt_iff h).symm
#align set.preimage_mul_const_Ioi Set.preimage_mul_const_Ioi
@[simp]
theorem preimage_mul_const_Iic (a : α) {c : α} (h : 0 < c) :
(fun x => x * c) ⁻¹' Iic a = Iic (a / c) :=
ext fun _x => (le_div_iff h).symm
#align set.preimage_mul_const_Iic Set.preimage_mul_const_Iic
@[simp]
theorem preimage_mul_const_Ici (a : α) {c : α} (h : 0 < c) :
(fun x => x * c) ⁻¹' Ici a = Ici (a / c) :=
ext fun _x => (div_le_iff h).symm
#align set.preimage_mul_const_Ici Set.preimage_mul_const_Ici
@[simp]
| Mathlib/Data/Set/Pointwise/Interval.lean | 619 | 620 | theorem preimage_mul_const_Ioo (a b : α) {c : α} (h : 0 < c) :
(fun x => x * c) ⁻¹' Ioo a b = Ioo (a / c) (b / c) := by | simp [← Ioi_inter_Iio, h]
|
import Mathlib.Analysis.SpecialFunctions.Integrals
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
import Mathlib.MeasureTheory.Integral.Layercake
#align_import analysis.special_functions.japanese_bracket from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
noncomputable section
open scoped NNReal Filter Topology ENNReal
open Asymptotics Filter Set Real MeasureTheory FiniteDimensional
variable {E : Type*} [NormedAddCommGroup E]
theorem sqrt_one_add_norm_sq_le (x : E) : √((1 : ℝ) + ‖x‖ ^ 2) ≤ 1 + ‖x‖ := by
rw [sqrt_le_left (by positivity)]
simp [add_sq]
#align sqrt_one_add_norm_sq_le sqrt_one_add_norm_sq_le
theorem one_add_norm_le_sqrt_two_mul_sqrt (x : E) :
(1 : ℝ) + ‖x‖ ≤ √2 * √(1 + ‖x‖ ^ 2) := by
rw [← sqrt_mul zero_le_two]
have := sq_nonneg (‖x‖ - 1)
apply le_sqrt_of_sq_le
linarith
#align one_add_norm_le_sqrt_two_mul_sqrt one_add_norm_le_sqrt_two_mul_sqrt
theorem rpow_neg_one_add_norm_sq_le {r : ℝ} (x : E) (hr : 0 < r) :
((1 : ℝ) + ‖x‖ ^ 2) ^ (-r / 2) ≤ (2 : ℝ) ^ (r / 2) * (1 + ‖x‖) ^ (-r) :=
calc
((1 : ℝ) + ‖x‖ ^ 2) ^ (-r / 2)
= (2 : ℝ) ^ (r / 2) * ((√2 * √((1 : ℝ) + ‖x‖ ^ 2)) ^ r)⁻¹ := by
rw [rpow_div_two_eq_sqrt, rpow_div_two_eq_sqrt, mul_rpow, mul_inv, rpow_neg,
mul_inv_cancel_left₀] <;> positivity
_ ≤ (2 : ℝ) ^ (r / 2) * ((1 + ‖x‖) ^ r)⁻¹ := by
gcongr
apply one_add_norm_le_sqrt_two_mul_sqrt
_ = (2 : ℝ) ^ (r / 2) * (1 + ‖x‖) ^ (-r) := by rw [rpow_neg]; positivity
#align rpow_neg_one_add_norm_sq_le rpow_neg_one_add_norm_sq_le
theorem le_rpow_one_add_norm_iff_norm_le {r t : ℝ} (hr : 0 < r) (ht : 0 < t) (x : E) :
t ≤ (1 + ‖x‖) ^ (-r) ↔ ‖x‖ ≤ t ^ (-r⁻¹) - 1 := by
rw [le_sub_iff_add_le', neg_inv]
exact (Real.le_rpow_inv_iff_of_neg (by positivity) ht (neg_lt_zero.mpr hr)).symm
#align le_rpow_one_add_norm_iff_norm_le le_rpow_one_add_norm_iff_norm_le
variable (E)
theorem closedBall_rpow_sub_one_eq_empty_aux {r t : ℝ} (hr : 0 < r) (ht : 1 < t) :
Metric.closedBall (0 : E) (t ^ (-r⁻¹) - 1) = ∅ := by
rw [Metric.closedBall_eq_empty, sub_neg]
exact Real.rpow_lt_one_of_one_lt_of_neg ht (by simp only [hr, Right.neg_neg_iff, inv_pos])
#align closed_ball_rpow_sub_one_eq_empty_aux closedBall_rpow_sub_one_eq_empty_aux
variable [NormedSpace ℝ E] [FiniteDimensional ℝ E]
variable {E}
| Mathlib/Analysis/SpecialFunctions/JapaneseBracket.lean | 79 | 95 | theorem finite_integral_rpow_sub_one_pow_aux {r : ℝ} (n : ℕ) (hnr : (n : ℝ) < r) :
(∫⁻ x : ℝ in Ioc 0 1, ENNReal.ofReal ((x ^ (-r⁻¹) - 1) ^ n)) < ∞ := by |
have hr : 0 < r := lt_of_le_of_lt n.cast_nonneg hnr
have h_int : ∀ x : ℝ, x ∈ Ioc (0 : ℝ) 1 →
ENNReal.ofReal ((x ^ (-r⁻¹) - 1) ^ n) ≤ ENNReal.ofReal (x ^ (-(r⁻¹ * n))) := fun x hx ↦ by
apply ENNReal.ofReal_le_ofReal
rw [← neg_mul, rpow_mul hx.1.le, rpow_natCast]
refine pow_le_pow_left ?_ (by simp only [sub_le_self_iff, zero_le_one]) n
rw [le_sub_iff_add_le', add_zero]
refine Real.one_le_rpow_of_pos_of_le_one_of_nonpos hx.1 hx.2 ?_
rw [Right.neg_nonpos_iff, inv_nonneg]
exact hr.le
refine lt_of_le_of_lt (set_lintegral_mono' measurableSet_Ioc h_int) ?_
refine IntegrableOn.set_lintegral_lt_top ?_
rw [← intervalIntegrable_iff_integrableOn_Ioc_of_le zero_le_one]
apply intervalIntegral.intervalIntegrable_rpow'
rwa [neg_lt_neg_iff, inv_mul_lt_iff' hr, one_mul]
|
import Mathlib.Data.Finset.Image
import Mathlib.Data.Multiset.Pi
#align_import data.finset.pi from "leanprover-community/mathlib"@"b2c89893177f66a48daf993b7ba5ef7cddeff8c9"
namespace Finset
open Multiset
section Pi
variable {α : Type*}
def Pi.empty (β : α → Sort*) (a : α) (h : a ∈ (∅ : Finset α)) : β a :=
Multiset.Pi.empty β a h
#align finset.pi.empty Finset.Pi.empty
universe u v
variable {β : α → Type u} {δ : α → Sort v} [DecidableEq α] {s : Finset α} {t : ∀ a, Finset (β a)}
def pi (s : Finset α) (t : ∀ a, Finset (β a)) : Finset (∀ a ∈ s, β a) :=
⟨s.1.pi fun a => (t a).1, s.nodup.pi fun a _ => (t a).nodup⟩
#align finset.pi Finset.pi
@[simp]
theorem pi_val (s : Finset α) (t : ∀ a, Finset (β a)) : (s.pi t).1 = s.1.pi fun a => (t a).1 :=
rfl
#align finset.pi_val Finset.pi_val
@[simp]
theorem mem_pi {s : Finset α} {t : ∀ a, Finset (β a)} {f : ∀ a ∈ s, β a} :
f ∈ s.pi t ↔ ∀ (a) (h : a ∈ s), f a h ∈ t a :=
Multiset.mem_pi _ _ _
#align finset.mem_pi Finset.mem_pi
def Pi.cons (s : Finset α) (a : α) (b : δ a) (f : ∀ a, a ∈ s → δ a) (a' : α) (h : a' ∈ insert a s) :
δ a' :=
Multiset.Pi.cons s.1 a b f _ (Multiset.mem_cons.2 <| mem_insert.symm.2 h)
#align finset.pi.cons Finset.Pi.cons
@[simp]
theorem Pi.cons_same (s : Finset α) (a : α) (b : δ a) (f : ∀ a, a ∈ s → δ a) (h : a ∈ insert a s) :
Pi.cons s a b f a h = b :=
Multiset.Pi.cons_same _
#align finset.pi.cons_same Finset.Pi.cons_same
theorem Pi.cons_ne {s : Finset α} {a a' : α} {b : δ a} {f : ∀ a, a ∈ s → δ a} {h : a' ∈ insert a s}
(ha : a ≠ a') : Pi.cons s a b f a' h = f a' ((mem_insert.1 h).resolve_left ha.symm) :=
Multiset.Pi.cons_ne _ (Ne.symm ha)
#align finset.pi.cons_ne Finset.Pi.cons_ne
theorem Pi.cons_injective {a : α} {b : δ a} {s : Finset α} (hs : a ∉ s) :
Function.Injective (Pi.cons s a b) := fun e₁ e₂ eq =>
@Multiset.Pi.cons_injective α _ δ a b s.1 hs _ _ <|
funext fun e =>
funext fun h =>
have :
Pi.cons s a b e₁ e (by simpa only [Multiset.mem_cons, mem_insert] using h) =
Pi.cons s a b e₂ e (by simpa only [Multiset.mem_cons, mem_insert] using h) := by
rw [eq]
this
#align finset.pi.cons_injective Finset.Pi.cons_injective
@[simp]
theorem pi_empty {t : ∀ a : α, Finset (β a)} : pi (∅ : Finset α) t = singleton (Pi.empty β) :=
rfl
#align finset.pi_empty Finset.pi_empty
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
lemma pi_nonempty : (s.pi t).Nonempty ↔ ∀ a ∈ s, (t a).Nonempty := by
simp [Finset.Nonempty, Classical.skolem]
@[simp]
| Mathlib/Data/Finset/Pi.lean | 96 | 112 | theorem pi_insert [∀ a, DecidableEq (β a)] {s : Finset α} {t : ∀ a : α, Finset (β a)} {a : α}
(ha : a ∉ s) : pi (insert a s) t = (t a).biUnion fun b => (pi s t).image (Pi.cons s a b) := by |
apply eq_of_veq
rw [← (pi (insert a s) t).2.dedup]
refine
(fun s' (h : s' = a ::ₘ s.1) =>
(?_ :
dedup (Multiset.pi s' fun a => (t a).1) =
dedup
((t a).1.bind fun b =>
dedup <|
(Multiset.pi s.1 fun a : α => (t a).val).map fun f a' h' =>
Multiset.Pi.cons s.1 a b f a' (h ▸ h'))))
_ (insert_val_of_not_mem ha)
subst s'; rw [pi_cons]
congr; funext b
exact ((pi s t).nodup.map <| Multiset.Pi.cons_injective ha).dedup.symm
|
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.Derivative
import Mathlib.Data.Nat.Choose.Cast
import Mathlib.NumberTheory.Bernoulli
#align_import number_theory.bernoulli_polynomials from "leanprover-community/mathlib"@"ca3d21f7f4fd613c2a3c54ac7871163e1e5ecb3a"
noncomputable section
open Nat Polynomial
open Nat Finset
namespace Polynomial
def bernoulli (n : ℕ) : ℚ[X] :=
∑ i ∈ range (n + 1), Polynomial.monomial (n - i) (_root_.bernoulli i * choose n i)
#align polynomial.bernoulli Polynomial.bernoulli
theorem bernoulli_def (n : ℕ) : bernoulli n =
∑ i ∈ range (n + 1), Polynomial.monomial i (_root_.bernoulli (n - i) * choose n i) := by
rw [← sum_range_reflect, add_succ_sub_one, add_zero, bernoulli]
apply sum_congr rfl
rintro x hx
rw [mem_range_succ_iff] at hx
rw [choose_symm hx, tsub_tsub_cancel_of_le hx]
#align polynomial.bernoulli_def Polynomial.bernoulli_def
section Examples
@[simp]
theorem bernoulli_zero : bernoulli 0 = 1 := by simp [bernoulli]
#align polynomial.bernoulli_zero Polynomial.bernoulli_zero
@[simp]
theorem bernoulli_eval_zero (n : ℕ) : (bernoulli n).eval 0 = _root_.bernoulli n := by
rw [bernoulli, eval_finset_sum, sum_range_succ]
have : ∑ x ∈ range n, _root_.bernoulli x * n.choose x * 0 ^ (n - x) = 0 := by
apply sum_eq_zero fun x hx => _
intros x hx
simp [tsub_eq_zero_iff_le, mem_range.1 hx]
simp [this]
#align polynomial.bernoulli_eval_zero Polynomial.bernoulli_eval_zero
@[simp]
| Mathlib/NumberTheory/BernoulliPolynomials.lean | 86 | 92 | theorem bernoulli_eval_one (n : ℕ) : (bernoulli n).eval 1 = bernoulli' n := by |
simp only [bernoulli, eval_finset_sum]
simp only [← succ_eq_add_one, sum_range_succ, mul_one, cast_one, choose_self,
(_root_.bernoulli _).mul_comm, sum_bernoulli, one_pow, mul_one, eval_C, eval_monomial, one_mul]
by_cases h : n = 1
· norm_num [h]
· simp [h, bernoulli_eq_bernoulli'_of_ne_one h]
|
import Mathlib.Probability.Kernel.Composition
#align_import probability.kernel.invariance from "leanprover-community/mathlib"@"3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b"
open MeasureTheory
open scoped MeasureTheory ENNReal ProbabilityTheory
namespace ProbabilityTheory
variable {α β γ : Type*} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {mγ : MeasurableSpace γ}
namespace kernel
@[simp]
theorem bind_add (μ ν : Measure α) (κ : kernel α β) : (μ + ν).bind κ = μ.bind κ + ν.bind κ := by
ext1 s hs
rw [Measure.bind_apply hs (kernel.measurable _), lintegral_add_measure, Measure.coe_add,
Pi.add_apply, Measure.bind_apply hs (kernel.measurable _),
Measure.bind_apply hs (kernel.measurable _)]
#align probability_theory.kernel.bind_add ProbabilityTheory.kernel.bind_add
@[simp]
theorem bind_smul (κ : kernel α β) (μ : Measure α) (r : ℝ≥0∞) : (r • μ).bind κ = r • μ.bind κ := by
ext1 s hs
rw [Measure.bind_apply hs (kernel.measurable _), lintegral_smul_measure, Measure.coe_smul,
Pi.smul_apply, Measure.bind_apply hs (kernel.measurable _), smul_eq_mul]
#align probability_theory.kernel.bind_smul ProbabilityTheory.kernel.bind_smul
theorem const_bind_eq_comp_const (κ : kernel α β) (μ : Measure α) :
const α (μ.bind κ) = κ ∘ₖ const α μ := by
ext a s hs
simp_rw [comp_apply' _ _ _ hs, const_apply, Measure.bind_apply hs (kernel.measurable _)]
#align probability_theory.kernel.const_bind_eq_comp_const ProbabilityTheory.kernel.const_bind_eq_comp_const
| Mathlib/Probability/Kernel/Invariance.lean | 63 | 65 | theorem comp_const_apply_eq_bind (κ : kernel α β) (μ : Measure α) (a : α) :
(κ ∘ₖ const α μ) a = μ.bind κ := by |
rw [← const_apply (μ.bind κ) a, const_bind_eq_comp_const κ μ]
|
import Mathlib.Order.Filter.Basic
import Mathlib.Order.Filter.CountableInter
import Mathlib.SetTheory.Cardinal.Ordinal
import Mathlib.SetTheory.Cardinal.Cofinality
open Set Filter Cardinal
universe u
variable {ι : Type u} {α β : Type u} {c : Cardinal.{u}}
class CardinalInterFilter (l : Filter α) (c : Cardinal.{u}) : Prop where
cardinal_sInter_mem : ∀ S : Set (Set α), (#S < c) → (∀ s ∈ S, s ∈ l) → ⋂₀ S ∈ l
variable {l : Filter α}
theorem cardinal_sInter_mem {S : Set (Set α)} [CardinalInterFilter l c] (hSc : #S < c) :
⋂₀ S ∈ l ↔ ∀ s ∈ S, s ∈ l := ⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs),
CardinalInterFilter.cardinal_sInter_mem _ hSc⟩
theorem _root_.Filter.cardinalInterFilter_aleph0 (l : Filter α) : CardinalInterFilter l aleph0 where
cardinal_sInter_mem := by
simp_all only [aleph_zero, lt_aleph0_iff_subtype_finite, setOf_mem_eq, sInter_mem,
implies_true, forall_const]
theorem CardinalInterFilter.toCountableInterFilter (l : Filter α) [CardinalInterFilter l c]
(hc : aleph0 < c) : CountableInterFilter l where
countable_sInter_mem S hS a :=
CardinalInterFilter.cardinal_sInter_mem S (lt_of_le_of_lt (Set.Countable.le_aleph0 hS) hc) a
instance CountableInterFilter.toCardinalInterFilter (l : Filter α) [CountableInterFilter l] :
CardinalInterFilter l (aleph 1) where
cardinal_sInter_mem S hS a :=
CountableInterFilter.countable_sInter_mem S ((countable_iff_lt_aleph_one S).mpr hS) a
theorem cardinalInterFilter_aleph_one_iff :
CardinalInterFilter l (aleph 1) ↔ CountableInterFilter l :=
⟨fun _ ↦ ⟨fun S h a ↦
CardinalInterFilter.cardinal_sInter_mem S ((countable_iff_lt_aleph_one S).1 h) a⟩,
fun _ ↦ CountableInterFilter.toCardinalInterFilter l⟩
theorem CardinalInterFilter.of_cardinalInterFilter_of_le (l : Filter α) [CardinalInterFilter l c]
{a : Cardinal.{u}} (hac : a ≤ c) :
CardinalInterFilter l a where
cardinal_sInter_mem S hS a :=
CardinalInterFilter.cardinal_sInter_mem S (lt_of_lt_of_le hS hac) a
theorem CardinalInterFilter.of_cardinalInterFilter_of_lt (l : Filter α) [CardinalInterFilter l c]
{a : Cardinal.{u}} (hac : a < c) : CardinalInterFilter l a :=
CardinalInterFilter.of_cardinalInterFilter_of_le l (hac.le)
namespace Filter
variable [CardinalInterFilter l c]
theorem cardinal_iInter_mem {s : ι → Set α} (hic : #ι < c) :
(⋂ i, s i) ∈ l ↔ ∀ i, s i ∈ l := by
rw [← sInter_range _]
apply (cardinal_sInter_mem (lt_of_le_of_lt Cardinal.mk_range_le hic)).trans
exact forall_mem_range
| Mathlib/Order/Filter/CardinalInter.lean | 96 | 100 | theorem cardinal_bInter_mem {S : Set ι} (hS : #S < c)
{s : ∀ i ∈ S, Set α} :
(⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by |
rw [biInter_eq_iInter]
exact (cardinal_iInter_mem hS).trans Subtype.forall
|
import Mathlib.Analysis.Calculus.Deriv.Slope
import Mathlib.Analysis.Calculus.Deriv.Inv
#align_import analysis.calculus.dslope from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
open scoped Classical Topology Filter
open Function Set Filter
variable {𝕜 E : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E]
noncomputable def dslope (f : 𝕜 → E) (a : 𝕜) : 𝕜 → E :=
update (slope f a) a (deriv f a)
#align dslope dslope
@[simp]
theorem dslope_same (f : 𝕜 → E) (a : 𝕜) : dslope f a a = deriv f a :=
update_same _ _ _
#align dslope_same dslope_same
variable {f : 𝕜 → E} {a b : 𝕜} {s : Set 𝕜}
theorem dslope_of_ne (f : 𝕜 → E) (h : b ≠ a) : dslope f a b = slope f a b :=
update_noteq h _ _
#align dslope_of_ne dslope_of_ne
theorem ContinuousLinearMap.dslope_comp {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
(f : E →L[𝕜] F) (g : 𝕜 → E) (a b : 𝕜) (H : a = b → DifferentiableAt 𝕜 g a) :
dslope (f ∘ g) a b = f (dslope g a b) := by
rcases eq_or_ne b a with (rfl | hne)
· simp only [dslope_same]
exact (f.hasFDerivAt.comp_hasDerivAt b (H rfl).hasDerivAt).deriv
· simpa only [dslope_of_ne _ hne] using f.toLinearMap.slope_comp g a b
#align continuous_linear_map.dslope_comp ContinuousLinearMap.dslope_comp
theorem eqOn_dslope_slope (f : 𝕜 → E) (a : 𝕜) : EqOn (dslope f a) (slope f a) {a}ᶜ := fun _ =>
dslope_of_ne f
#align eq_on_dslope_slope eqOn_dslope_slope
theorem dslope_eventuallyEq_slope_of_ne (f : 𝕜 → E) (h : b ≠ a) : dslope f a =ᶠ[𝓝 b] slope f a :=
(eqOn_dslope_slope f a).eventuallyEq_of_mem (isOpen_ne.mem_nhds h)
#align dslope_eventually_eq_slope_of_ne dslope_eventuallyEq_slope_of_ne
theorem dslope_eventuallyEq_slope_punctured_nhds (f : 𝕜 → E) : dslope f a =ᶠ[𝓝[≠] a] slope f a :=
(eqOn_dslope_slope f a).eventuallyEq_of_mem self_mem_nhdsWithin
#align dslope_eventually_eq_slope_punctured_nhds dslope_eventuallyEq_slope_punctured_nhds
@[simp]
theorem sub_smul_dslope (f : 𝕜 → E) (a b : 𝕜) : (b - a) • dslope f a b = f b - f a := by
rcases eq_or_ne b a with (rfl | hne) <;> simp [dslope_of_ne, *]
#align sub_smul_dslope sub_smul_dslope
theorem dslope_sub_smul_of_ne (f : 𝕜 → E) (h : b ≠ a) :
dslope (fun x => (x - a) • f x) a b = f b := by
rw [dslope_of_ne _ h, slope_sub_smul _ h.symm]
#align dslope_sub_smul_of_ne dslope_sub_smul_of_ne
theorem eqOn_dslope_sub_smul (f : 𝕜 → E) (a : 𝕜) :
EqOn (dslope (fun x => (x - a) • f x) a) f {a}ᶜ := fun _ => dslope_sub_smul_of_ne f
#align eq_on_dslope_sub_smul eqOn_dslope_sub_smul
theorem dslope_sub_smul [DecidableEq 𝕜] (f : 𝕜 → E) (a : 𝕜) :
dslope (fun x => (x - a) • f x) a = update f a (deriv (fun x => (x - a) • f x) a) :=
eq_update_iff.2 ⟨dslope_same _ _, eqOn_dslope_sub_smul f a⟩
#align dslope_sub_smul dslope_sub_smul
@[simp]
| Mathlib/Analysis/Calculus/Dslope.lean | 87 | 88 | theorem continuousAt_dslope_same : ContinuousAt (dslope f a) a ↔ DifferentiableAt 𝕜 f a := by |
simp only [dslope, continuousAt_update_same, ← hasDerivAt_deriv_iff, hasDerivAt_iff_tendsto_slope]
|
import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine
import Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle
#align_import geometry.euclidean.angle.oriented.right_angle from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open scoped EuclideanGeometry
open scoped Real
open scoped RealInnerProductSpace
namespace EuclideanGeometry
open FiniteDimensional
variable {V : Type*} {P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
[NormedAddTorsor V P] [hd2 : Fact (finrank ℝ V = 2)] [Module.Oriented ℝ V (Fin 2)]
theorem oangle_right_eq_arccos_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
∡ p₂ p₃ p₁ = Real.arccos (dist p₃ p₂ / dist p₁ p₃) := by
have hs : (∡ p₂ p₃ p₁).sign = 1 := by rw [oangle_rotate_sign, h, Real.Angle.sign_coe_pi_div_two]
rw [oangle_eq_angle_of_sign_eq_one hs,
angle_eq_arccos_of_angle_eq_pi_div_two (angle_eq_pi_div_two_of_oangle_eq_pi_div_two h)]
#align euclidean_geometry.oangle_right_eq_arccos_of_oangle_eq_pi_div_two EuclideanGeometry.oangle_right_eq_arccos_of_oangle_eq_pi_div_two
theorem oangle_left_eq_arccos_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
∡ p₃ p₁ p₂ = Real.arccos (dist p₁ p₂ / dist p₁ p₃) := by
have hs : (∡ p₃ p₁ p₂).sign = 1 := by rw [← oangle_rotate_sign, h, Real.Angle.sign_coe_pi_div_two]
rw [oangle_eq_angle_of_sign_eq_one hs, angle_comm,
angle_eq_arccos_of_angle_eq_pi_div_two (angle_rev_eq_pi_div_two_of_oangle_eq_pi_div_two h),
dist_comm p₁ p₃]
#align euclidean_geometry.oangle_left_eq_arccos_of_oangle_eq_pi_div_two EuclideanGeometry.oangle_left_eq_arccos_of_oangle_eq_pi_div_two
theorem oangle_right_eq_arcsin_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
∡ p₂ p₃ p₁ = Real.arcsin (dist p₁ p₂ / dist p₁ p₃) := by
have hs : (∡ p₂ p₃ p₁).sign = 1 := by rw [oangle_rotate_sign, h, Real.Angle.sign_coe_pi_div_two]
rw [oangle_eq_angle_of_sign_eq_one hs,
angle_eq_arcsin_of_angle_eq_pi_div_two (angle_eq_pi_div_two_of_oangle_eq_pi_div_two h)
(Or.inl (left_ne_of_oangle_eq_pi_div_two h))]
#align euclidean_geometry.oangle_right_eq_arcsin_of_oangle_eq_pi_div_two EuclideanGeometry.oangle_right_eq_arcsin_of_oangle_eq_pi_div_two
| Mathlib/Geometry/Euclidean/Angle/Oriented/RightAngle.lean | 610 | 616 | theorem oangle_left_eq_arcsin_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
∡ p₃ p₁ p₂ = Real.arcsin (dist p₃ p₂ / dist p₁ p₃) := by |
have hs : (∡ p₃ p₁ p₂).sign = 1 := by rw [← oangle_rotate_sign, h, Real.Angle.sign_coe_pi_div_two]
rw [oangle_eq_angle_of_sign_eq_one hs, angle_comm,
angle_eq_arcsin_of_angle_eq_pi_div_two (angle_rev_eq_pi_div_two_of_oangle_eq_pi_div_two h)
(Or.inr (left_ne_of_oangle_eq_pi_div_two h)),
dist_comm p₁ p₃]
|
import Mathlib.CategoryTheory.CommSq
#align_import category_theory.lifting_properties.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514"
universe v
namespace CategoryTheory
open Category
variable {C : Type*} [Category C] {A B B' X Y Y' : C} (i : A ⟶ B) (i' : B ⟶ B') (p : X ⟶ Y)
(p' : Y ⟶ Y')
class HasLiftingProperty : Prop where
sq_hasLift : ∀ {f : A ⟶ X} {g : B ⟶ Y} (sq : CommSq f i p g), sq.HasLift
#align category_theory.has_lifting_property CategoryTheory.HasLiftingProperty
#align category_theory.has_lifting_property.sq_has_lift CategoryTheory.HasLiftingProperty.sq_hasLift
instance (priority := 100) sq_hasLift_of_hasLiftingProperty {f : A ⟶ X} {g : B ⟶ Y}
(sq : CommSq f i p g) [hip : HasLiftingProperty i p] : sq.HasLift := by apply hip.sq_hasLift
#align category_theory.sq_has_lift_of_has_lifting_property CategoryTheory.sq_hasLift_of_hasLiftingProperty
namespace HasLiftingProperty
variable {i p}
theorem op (h : HasLiftingProperty i p) : HasLiftingProperty p.op i.op :=
⟨fun {f} {g} sq => by
simp only [CommSq.HasLift.iff_unop, Quiver.Hom.unop_op]
infer_instance⟩
#align category_theory.has_lifting_property.op CategoryTheory.HasLiftingProperty.op
theorem unop {A B X Y : Cᵒᵖ} {i : A ⟶ B} {p : X ⟶ Y} (h : HasLiftingProperty i p) :
HasLiftingProperty p.unop i.unop :=
⟨fun {f} {g} sq => by
rw [CommSq.HasLift.iff_op]
simp only [Quiver.Hom.op_unop]
infer_instance⟩
#align category_theory.has_lifting_property.unop CategoryTheory.HasLiftingProperty.unop
theorem iff_op : HasLiftingProperty i p ↔ HasLiftingProperty p.op i.op :=
⟨op, unop⟩
#align category_theory.has_lifting_property.iff_op CategoryTheory.HasLiftingProperty.iff_op
theorem iff_unop {A B X Y : Cᵒᵖ} (i : A ⟶ B) (p : X ⟶ Y) :
HasLiftingProperty i p ↔ HasLiftingProperty p.unop i.unop :=
⟨unop, op⟩
#align category_theory.has_lifting_property.iff_unop CategoryTheory.HasLiftingProperty.iff_unop
variable (i p)
instance (priority := 100) of_left_iso [IsIso i] : HasLiftingProperty i p :=
⟨fun {f} {g} sq =>
CommSq.HasLift.mk'
{ l := inv i ≫ f
fac_left := by simp only [IsIso.hom_inv_id_assoc]
fac_right := by simp only [sq.w, assoc, IsIso.inv_hom_id_assoc] }⟩
#align category_theory.has_lifting_property.of_left_iso CategoryTheory.HasLiftingProperty.of_left_iso
instance (priority := 100) of_right_iso [IsIso p] : HasLiftingProperty i p :=
⟨fun {f} {g} sq =>
CommSq.HasLift.mk'
{ l := g ≫ inv p
fac_left := by simp only [← sq.w_assoc, IsIso.hom_inv_id, comp_id]
fac_right := by simp only [assoc, IsIso.inv_hom_id, comp_id] }⟩
#align category_theory.has_lifting_property.of_right_iso CategoryTheory.HasLiftingProperty.of_right_iso
instance of_comp_left [HasLiftingProperty i p] [HasLiftingProperty i' p] :
HasLiftingProperty (i ≫ i') p :=
⟨fun {f} {g} sq => by
have fac := sq.w
rw [assoc] at fac
exact
CommSq.HasLift.mk'
{ l := (CommSq.mk (CommSq.mk fac).fac_right).lift
fac_left := by simp only [assoc, CommSq.fac_left]
fac_right := by simp only [CommSq.fac_right] }⟩
#align category_theory.has_lifting_property.of_comp_left CategoryTheory.HasLiftingProperty.of_comp_left
instance of_comp_right [HasLiftingProperty i p] [HasLiftingProperty i p'] :
HasLiftingProperty i (p ≫ p') :=
⟨fun {f} {g} sq => by
have fac := sq.w
rw [← assoc] at fac
let _ := (CommSq.mk (CommSq.mk fac).fac_left.symm).lift
exact
CommSq.HasLift.mk'
{ l := (CommSq.mk (CommSq.mk fac).fac_left.symm).lift
fac_left := by simp only [CommSq.fac_left]
fac_right := by simp only [CommSq.fac_right_assoc, CommSq.fac_right] }⟩
#align category_theory.has_lifting_property.of_comp_right CategoryTheory.HasLiftingProperty.of_comp_right
theorem of_arrow_iso_left {A B A' B' X Y : C} {i : A ⟶ B} {i' : A' ⟶ B'}
(e : Arrow.mk i ≅ Arrow.mk i') (p : X ⟶ Y) [hip : HasLiftingProperty i p] :
HasLiftingProperty i' p := by
rw [Arrow.iso_w' e]
infer_instance
#align category_theory.has_lifting_property.of_arrow_iso_left CategoryTheory.HasLiftingProperty.of_arrow_iso_left
| Mathlib/CategoryTheory/LiftingProperties/Basic.lean | 128 | 131 | theorem of_arrow_iso_right {A B X Y X' Y' : C} (i : A ⟶ B) {p : X ⟶ Y} {p' : X' ⟶ Y'}
(e : Arrow.mk p ≅ Arrow.mk p') [hip : HasLiftingProperty i p] : HasLiftingProperty i p' := by |
rw [Arrow.iso_w' e]
infer_instance
|
import Mathlib.Algebra.BigOperators.Ring
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Fin
import Mathlib.GroupTheory.GroupAction.Pi
import Mathlib.Logic.Equiv.Fin
#align_import algebra.big_operators.fin from "leanprover-community/mathlib"@"cc5dd6244981976cc9da7afc4eee5682b037a013"
open Finset
variable {α : Type*} {β : Type*}
namespace Fin
@[to_additive]
theorem prod_ofFn [CommMonoid β] {n : ℕ} (f : Fin n → β) : (List.ofFn f).prod = ∏ i, f i := by
simp [prod_eq_multiset_prod]
#align fin.prod_of_fn Fin.prod_ofFn
#align fin.sum_of_fn Fin.sum_ofFn
@[to_additive]
| Mathlib/Algebra/BigOperators/Fin.lean | 52 | 54 | theorem prod_univ_def [CommMonoid β] {n : ℕ} (f : Fin n → β) :
∏ i, f i = ((List.finRange n).map f).prod := by |
rw [← List.ofFn_eq_map, prod_ofFn]
|
import Mathlib.Topology.Separation
import Mathlib.Topology.UniformSpace.Basic
import Mathlib.Topology.UniformSpace.Cauchy
#align_import topology.uniform_space.uniform_convergence from "leanprover-community/mathlib"@"2705404e701abc6b3127da906f40bae062a169c9"
noncomputable section
open Topology Uniformity Filter Set
universe u v w x
variable {α : Type u} {β : Type v} {γ : Type w} {ι : Type x} [UniformSpace β]
variable {F : ι → α → β} {f : α → β} {s s' : Set α} {x : α} {p : Filter ι} {p' : Filter α}
{g : ι → α}
def TendstoUniformlyOnFilter (F : ι → α → β) (f : α → β) (p : Filter ι) (p' : Filter α) :=
∀ u ∈ 𝓤 β, ∀ᶠ n : ι × α in p ×ˢ p', (f n.snd, F n.fst n.snd) ∈ u
#align tendsto_uniformly_on_filter TendstoUniformlyOnFilter
theorem tendstoUniformlyOnFilter_iff_tendsto :
TendstoUniformlyOnFilter F f p p' ↔
Tendsto (fun q : ι × α => (f q.2, F q.1 q.2)) (p ×ˢ p') (𝓤 β) :=
Iff.rfl
#align tendsto_uniformly_on_filter_iff_tendsto tendstoUniformlyOnFilter_iff_tendsto
def TendstoUniformlyOn (F : ι → α → β) (f : α → β) (p : Filter ι) (s : Set α) :=
∀ u ∈ 𝓤 β, ∀ᶠ n in p, ∀ x : α, x ∈ s → (f x, F n x) ∈ u
#align tendsto_uniformly_on TendstoUniformlyOn
theorem tendstoUniformlyOn_iff_tendstoUniformlyOnFilter :
TendstoUniformlyOn F f p s ↔ TendstoUniformlyOnFilter F f p (𝓟 s) := by
simp only [TendstoUniformlyOn, TendstoUniformlyOnFilter]
apply forall₂_congr
simp_rw [eventually_prod_principal_iff]
simp
#align tendsto_uniformly_on_iff_tendsto_uniformly_on_filter tendstoUniformlyOn_iff_tendstoUniformlyOnFilter
alias ⟨TendstoUniformlyOn.tendstoUniformlyOnFilter, TendstoUniformlyOnFilter.tendstoUniformlyOn⟩ :=
tendstoUniformlyOn_iff_tendstoUniformlyOnFilter
#align tendsto_uniformly_on.tendsto_uniformly_on_filter TendstoUniformlyOn.tendstoUniformlyOnFilter
#align tendsto_uniformly_on_filter.tendsto_uniformly_on TendstoUniformlyOnFilter.tendstoUniformlyOn
theorem tendstoUniformlyOn_iff_tendsto {F : ι → α → β} {f : α → β} {p : Filter ι} {s : Set α} :
TendstoUniformlyOn F f p s ↔
Tendsto (fun q : ι × α => (f q.2, F q.1 q.2)) (p ×ˢ 𝓟 s) (𝓤 β) := by
simp [tendstoUniformlyOn_iff_tendstoUniformlyOnFilter, tendstoUniformlyOnFilter_iff_tendsto]
#align tendsto_uniformly_on_iff_tendsto tendstoUniformlyOn_iff_tendsto
def TendstoUniformly (F : ι → α → β) (f : α → β) (p : Filter ι) :=
∀ u ∈ 𝓤 β, ∀ᶠ n in p, ∀ x : α, (f x, F n x) ∈ u
#align tendsto_uniformly TendstoUniformly
-- Porting note: moved from below
theorem tendstoUniformlyOn_univ : TendstoUniformlyOn F f p univ ↔ TendstoUniformly F f p := by
simp [TendstoUniformlyOn, TendstoUniformly]
#align tendsto_uniformly_on_univ tendstoUniformlyOn_univ
theorem tendstoUniformly_iff_tendstoUniformlyOnFilter :
TendstoUniformly F f p ↔ TendstoUniformlyOnFilter F f p ⊤ := by
rw [← tendstoUniformlyOn_univ, tendstoUniformlyOn_iff_tendstoUniformlyOnFilter, principal_univ]
#align tendsto_uniformly_iff_tendsto_uniformly_on_filter tendstoUniformly_iff_tendstoUniformlyOnFilter
| Mathlib/Topology/UniformSpace/UniformConvergence.lean | 147 | 148 | theorem TendstoUniformly.tendstoUniformlyOnFilter (h : TendstoUniformly F f p) :
TendstoUniformlyOnFilter F f p ⊤ := by | rwa [← tendstoUniformly_iff_tendstoUniformlyOnFilter]
|
import Mathlib.Order.Interval.Set.Basic
import Mathlib.Order.Hom.Set
#align_import data.set.intervals.order_iso from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
open Set
namespace OrderIso
section Preorder
variable {α β : Type*} [Preorder α] [Preorder β]
@[simp]
theorem preimage_Iic (e : α ≃o β) (b : β) : e ⁻¹' Iic b = Iic (e.symm b) := by
ext x
simp [← e.le_iff_le]
#align order_iso.preimage_Iic OrderIso.preimage_Iic
@[simp]
theorem preimage_Ici (e : α ≃o β) (b : β) : e ⁻¹' Ici b = Ici (e.symm b) := by
ext x
simp [← e.le_iff_le]
#align order_iso.preimage_Ici OrderIso.preimage_Ici
@[simp]
theorem preimage_Iio (e : α ≃o β) (b : β) : e ⁻¹' Iio b = Iio (e.symm b) := by
ext x
simp [← e.lt_iff_lt]
#align order_iso.preimage_Iio OrderIso.preimage_Iio
@[simp]
theorem preimage_Ioi (e : α ≃o β) (b : β) : e ⁻¹' Ioi b = Ioi (e.symm b) := by
ext x
simp [← e.lt_iff_lt]
#align order_iso.preimage_Ioi OrderIso.preimage_Ioi
@[simp]
theorem preimage_Icc (e : α ≃o β) (a b : β) : e ⁻¹' Icc a b = Icc (e.symm a) (e.symm b) := by
simp [← Ici_inter_Iic]
#align order_iso.preimage_Icc OrderIso.preimage_Icc
@[simp]
| Mathlib/Order/Interval/Set/OrderIso.lean | 53 | 54 | theorem preimage_Ico (e : α ≃o β) (a b : β) : e ⁻¹' Ico a b = Ico (e.symm a) (e.symm b) := by |
simp [← Ici_inter_Iio]
|
import Mathlib.Algebra.Group.Even
import Mathlib.Algebra.Order.Monoid.Canonical.Defs
import Mathlib.Algebra.Order.Sub.Defs
#align_import algebra.order.sub.canonical from "leanprover-community/mathlib"@"62a5626868683c104774de8d85b9855234ac807c"
variable {α : Type*}
section ExistsAddOfLE
variable [AddCommSemigroup α] [PartialOrder α] [ExistsAddOfLE α]
[CovariantClass α α (· + ·) (· ≤ ·)] [Sub α] [OrderedSub α] {a b c d : α}
@[simp]
| Mathlib/Algebra/Order/Sub/Canonical.lean | 25 | 28 | theorem add_tsub_cancel_of_le (h : a ≤ b) : a + (b - a) = b := by |
refine le_antisymm ?_ le_add_tsub
obtain ⟨c, rfl⟩ := exists_add_of_le h
exact add_le_add_left add_tsub_le_left a
|
import Mathlib.FieldTheory.SeparableDegree
import Mathlib.FieldTheory.IsSepClosed
open scoped Classical Polynomial
open FiniteDimensional Polynomial IntermediateField Field
noncomputable section
universe u v w
variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E]
variable (K : Type w) [Field K] [Algebra F K]
section separableClosure
def separableClosure : IntermediateField F E where
carrier := {x | (minpoly F x).Separable}
mul_mem' := separable_mul
add_mem' := separable_add
algebraMap_mem' := separable_algebraMap E
inv_mem' := separable_inv
variable {F E K}
theorem mem_separableClosure_iff {x : E} :
x ∈ separableClosure F E ↔ (minpoly F x).Separable := Iff.rfl
| Mathlib/FieldTheory/SeparableClosure.lean | 94 | 96 | theorem map_mem_separableClosure_iff (i : E →ₐ[F] K) {x : E} :
i x ∈ separableClosure F K ↔ x ∈ separableClosure F E := by |
simp_rw [mem_separableClosure_iff, minpoly.algHom_eq i i.injective]
|
import Mathlib.Algebra.BigOperators.NatAntidiagonal
import Mathlib.Topology.Algebra.InfiniteSum.Constructions
import Mathlib.Topology.Algebra.Ring.Basic
#align_import topology.algebra.infinite_sum.ring from "leanprover-community/mathlib"@"9a59dcb7a2d06bf55da57b9030169219980660cd"
open Filter Finset Function
open scoped Classical
variable {ι κ R α : Type*}
section NonUnitalNonAssocSemiring
variable [NonUnitalNonAssocSemiring α] [TopologicalSpace α] [TopologicalSemiring α] {f g : ι → α}
{a a₁ a₂ : α}
| Mathlib/Topology/Algebra/InfiniteSum/Ring.lean | 34 | 35 | theorem HasSum.mul_left (a₂) (h : HasSum f a₁) : HasSum (fun i ↦ a₂ * f i) (a₂ * a₁) := by |
simpa only using h.map (AddMonoidHom.mulLeft a₂) (continuous_const.mul continuous_id)
|
import Mathlib.Algebra.GroupWithZero.Defs
import Mathlib.Algebra.NeZero
#align_import algebra.group_with_zero.defs from "leanprover-community/mathlib"@"2f3994e1b117b1e1da49bcfb67334f33460c3ce4"
assert_not_exists DenselyOrdered
universe u
variable {M₀ M₀' : Type*} [MulZeroOneClass M₀] [Nontrivial M₀]
instance NeZero.one : NeZero (1 : M₀) := ⟨by
intro h
rcases exists_pair_ne M₀ with ⟨x, y, hx⟩
apply hx
calc
x = 1 * x := by rw [one_mul]
_ = 0 := by rw [h, zero_mul]
_ = 1 * y := by rw [h, zero_mul]
_ = y := by rw [one_mul]⟩
#align ne_zero.one NeZero.one
theorem pullback_nonzero [Zero M₀'] [One M₀'] (f : M₀' → M₀) (zero : f 0 = 0) (one : f 1 = 1) :
Nontrivial M₀' :=
⟨⟨0, 1, mt (congr_arg f) <| by
rw [zero, one]
exact zero_ne_one⟩⟩
#align pullback_nonzero pullback_nonzero
section GroupWithZero
variable {G₀ : Type*} [GroupWithZero G₀] {a : G₀}
-- Porting note: used `simpa` to prove `False` in lean3
theorem inv_ne_zero (h : a ≠ 0) : a⁻¹ ≠ 0 := fun a_eq_0 => by
have := mul_inv_cancel h
simp only [a_eq_0, mul_zero, zero_ne_one] at this
#align inv_ne_zero inv_ne_zero
@[simp]
| Mathlib/Algebra/GroupWithZero/NeZero.lean | 55 | 59 | theorem inv_mul_cancel (h : a ≠ 0) : a⁻¹ * a = 1 :=
calc
a⁻¹ * a = a⁻¹ * a * a⁻¹ * a⁻¹⁻¹ := by | simp [inv_ne_zero h]
_ = a⁻¹ * a⁻¹⁻¹ := by simp [h]
_ = 1 := by simp [inv_ne_zero h]
|
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.List.Sublists
import Mathlib.Data.List.InsertNth
#align_import group_theory.free_group from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6"
open Relation
universe u v w
variable {α : Type u}
attribute [local simp] List.append_eq_has_append
-- Porting note: to_additive.map_namespace is not supported yet
-- worked around it by putting a few extra manual mappings (but not too many all in all)
-- run_cmd to_additive.map_namespace `FreeGroup `FreeAddGroup
inductive FreeAddGroup.Red.Step : List (α × Bool) → List (α × Bool) → Prop
| not {L₁ L₂ x b} : FreeAddGroup.Red.Step (L₁ ++ (x, b) :: (x, not b) :: L₂) (L₁ ++ L₂)
#align free_add_group.red.step FreeAddGroup.Red.Step
attribute [simp] FreeAddGroup.Red.Step.not
@[to_additive FreeAddGroup.Red.Step]
inductive FreeGroup.Red.Step : List (α × Bool) → List (α × Bool) → Prop
| not {L₁ L₂ x b} : FreeGroup.Red.Step (L₁ ++ (x, b) :: (x, not b) :: L₂) (L₁ ++ L₂)
#align free_group.red.step FreeGroup.Red.Step
attribute [simp] FreeGroup.Red.Step.not
namespace FreeGroup
variable {L L₁ L₂ L₃ L₄ : List (α × Bool)}
@[to_additive FreeAddGroup.Red "Reflexive-transitive closure of `Red.Step`"]
def Red : List (α × Bool) → List (α × Bool) → Prop :=
ReflTransGen Red.Step
#align free_group.red FreeGroup.Red
#align free_add_group.red FreeAddGroup.Red
@[to_additive (attr := refl)]
theorem Red.refl : Red L L :=
ReflTransGen.refl
#align free_group.red.refl FreeGroup.Red.refl
#align free_add_group.red.refl FreeAddGroup.Red.refl
@[to_additive (attr := trans)]
theorem Red.trans : Red L₁ L₂ → Red L₂ L₃ → Red L₁ L₃ :=
ReflTransGen.trans
#align free_group.red.trans FreeGroup.Red.trans
#align free_add_group.red.trans FreeAddGroup.Red.trans
namespace Red
@[to_additive "Predicate asserting that the word `w₁` can be reduced to `w₂` in one step, i.e. there
are words `w₃ w₄` and letter `x` such that `w₁ = w₃ + x + (-x) + w₄` and `w₂ = w₃w₄`"]
theorem Step.length : ∀ {L₁ L₂ : List (α × Bool)}, Step L₁ L₂ → L₂.length + 2 = L₁.length
| _, _, @Red.Step.not _ L1 L2 x b => by rw [List.length_append, List.length_append]; rfl
#align free_group.red.step.length FreeGroup.Red.Step.length
#align free_add_group.red.step.length FreeAddGroup.Red.Step.length
@[to_additive (attr := simp)]
theorem Step.not_rev {x b} : Step (L₁ ++ (x, !b) :: (x, b) :: L₂) (L₁ ++ L₂) := by
cases b <;> exact Step.not
#align free_group.red.step.bnot_rev FreeGroup.Red.Step.not_rev
#align free_add_group.red.step.bnot_rev FreeAddGroup.Red.Step.not_rev
@[to_additive (attr := simp)]
theorem Step.cons_not {x b} : Red.Step ((x, b) :: (x, !b) :: L) L :=
@Step.not _ [] _ _ _
#align free_group.red.step.cons_bnot FreeGroup.Red.Step.cons_not
#align free_add_group.red.step.cons_bnot FreeAddGroup.Red.Step.cons_not
@[to_additive (attr := simp)]
theorem Step.cons_not_rev {x b} : Red.Step ((x, !b) :: (x, b) :: L) L :=
@Red.Step.not_rev _ [] _ _ _
#align free_group.red.step.cons_bnot_rev FreeGroup.Red.Step.cons_not_rev
#align free_add_group.red.step.cons_bnot_rev FreeAddGroup.Red.Step.cons_not_rev
@[to_additive]
theorem Step.append_left : ∀ {L₁ L₂ L₃ : List (α × Bool)}, Step L₂ L₃ → Step (L₁ ++ L₂) (L₁ ++ L₃)
| _, _, _, Red.Step.not => by rw [← List.append_assoc, ← List.append_assoc]; constructor
#align free_group.red.step.append_left FreeGroup.Red.Step.append_left
#align free_add_group.red.step.append_left FreeAddGroup.Red.Step.append_left
@[to_additive]
theorem Step.cons {x} (H : Red.Step L₁ L₂) : Red.Step (x :: L₁) (x :: L₂) :=
@Step.append_left _ [x] _ _ H
#align free_group.red.step.cons FreeGroup.Red.Step.cons
#align free_add_group.red.step.cons FreeAddGroup.Red.Step.cons
@[to_additive]
theorem Step.append_right : ∀ {L₁ L₂ L₃ : List (α × Bool)}, Step L₁ L₂ → Step (L₁ ++ L₃) (L₂ ++ L₃)
| _, _, _, Red.Step.not => by simp
#align free_group.red.step.append_right FreeGroup.Red.Step.append_right
#align free_add_group.red.step.append_right FreeAddGroup.Red.Step.append_right
@[to_additive]
| Mathlib/GroupTheory/FreeGroup/Basic.lean | 151 | 155 | theorem not_step_nil : ¬Step [] L := by |
generalize h' : [] = L'
intro h
cases' h with L₁ L₂
simp [List.nil_eq_append] at h'
|
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure
import Mathlib.RingTheory.IntegralDomain
#align_import field_theory.primitive_element from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87"
noncomputable section
open scoped Classical Polynomial
open FiniteDimensional Polynomial IntermediateField
namespace Field
variable (F E : Type*) [Field F] [Field E]
variable [Algebra F E]
section FiniteIntermediateField
-- TODO: show a more generalized result: [F⟮α⟯ : F⟮α ^ m⟯] = m if m > 0 and α transcendental.
| Mathlib/FieldTheory/PrimitiveElement.lean | 246 | 275 | theorem isAlgebraic_of_adjoin_eq_adjoin {α : E} {m n : ℕ} (hneq : m ≠ n)
(heq : F⟮α ^ m⟯ = F⟮α ^ n⟯) : IsAlgebraic F α := by |
wlog hmn : m < n
· exact this F E hneq.symm heq.symm (hneq.lt_or_lt.resolve_left hmn)
by_cases hm : m = 0
· rw [hm] at heq hmn
simp only [pow_zero, adjoin_one] at heq
obtain ⟨y, h⟩ := mem_bot.1 (heq.symm ▸ mem_adjoin_simple_self F (α ^ n))
refine ⟨X ^ n - C y, X_pow_sub_C_ne_zero hmn y, ?_⟩
simp only [map_sub, map_pow, aeval_X, aeval_C, h, sub_self]
obtain ⟨r, s, h⟩ := (mem_adjoin_simple_iff F _).1 (heq ▸ mem_adjoin_simple_self F (α ^ m))
by_cases hzero : aeval (α ^ n) s = 0
· simp only [hzero, div_zero, pow_eq_zero_iff hm] at h
exact h.symm ▸ isAlgebraic_zero
replace hm : 0 < m := Nat.pos_of_ne_zero hm
rw [eq_div_iff hzero, ← sub_eq_zero] at h
replace hzero : s ≠ 0 := by rintro rfl; simp only [map_zero, not_true_eq_false] at hzero
let f : F[X] := X ^ m * expand F n s - expand F n r
refine ⟨f, ?_, ?_⟩
· have : f.coeff (n * s.natDegree + m) ≠ 0 := by
have hn : 0 < n := by linarith only [hm, hmn]
have hndvd : ¬ n ∣ n * s.natDegree + m := by
rw [← Nat.dvd_add_iff_right (n.dvd_mul_right s.natDegree)]
exact Nat.not_dvd_of_pos_of_lt hm hmn
simp only [f, coeff_sub, coeff_X_pow_mul, s.coeff_expand_mul' hn, coeff_natDegree,
coeff_expand hn r, hndvd, ite_false, sub_zero]
exact leadingCoeff_ne_zero.2 hzero
intro h
simp only [h, coeff_zero, ne_eq, not_true_eq_false] at this
· simp only [f, map_sub, map_mul, map_pow, aeval_X, expand_aeval, h]
|
import Mathlib.SetTheory.Game.Basic
import Mathlib.SetTheory.Ordinal.NaturalOps
#align_import set_theory.game.ordinal from "leanprover-community/mathlib"@"b90e72c7eebbe8de7c8293a80208ea2ba135c834"
universe u
open SetTheory PGame
open scoped NaturalOps PGame
namespace Ordinal
noncomputable def toPGame : Ordinal.{u} → PGame.{u}
| o =>
have : IsWellOrder o.out.α (· < ·) := isWellOrder_out_lt o
⟨o.out.α, PEmpty, fun x =>
have := Ordinal.typein_lt_self x
(typein (· < ·) x).toPGame,
PEmpty.elim⟩
termination_by x => x
#align ordinal.to_pgame Ordinal.toPGame
@[nolint unusedHavesSuffices]
| Mathlib/SetTheory/Game/Ordinal.lean | 46 | 49 | theorem toPGame_def (o : Ordinal) :
have : IsWellOrder o.out.α (· < ·) := isWellOrder_out_lt o
o.toPGame = ⟨o.out.α, PEmpty, fun x => (typein (· < ·) x).toPGame, PEmpty.elim⟩ := by |
rw [toPGame]
|
import Mathlib.Data.Set.Image
import Mathlib.Data.SProd
#align_import data.set.prod from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4"
open Function
namespace Set
section Prod
variable {α β γ δ : Type*} {s s₁ s₂ : Set α} {t t₁ t₂ : Set β} {a : α} {b : β}
theorem Subsingleton.prod (hs : s.Subsingleton) (ht : t.Subsingleton) :
(s ×ˢ t).Subsingleton := fun _x hx _y hy ↦
Prod.ext (hs hx.1 hy.1) (ht hx.2 hy.2)
noncomputable instance decidableMemProd [DecidablePred (· ∈ s)] [DecidablePred (· ∈ t)] :
DecidablePred (· ∈ s ×ˢ t) := fun _ => And.decidable
#align set.decidable_mem_prod Set.decidableMemProd
@[gcongr]
theorem prod_mono (hs : s₁ ⊆ s₂) (ht : t₁ ⊆ t₂) : s₁ ×ˢ t₁ ⊆ s₂ ×ˢ t₂ :=
fun _ ⟨h₁, h₂⟩ => ⟨hs h₁, ht h₂⟩
#align set.prod_mono Set.prod_mono
@[gcongr]
theorem prod_mono_left (hs : s₁ ⊆ s₂) : s₁ ×ˢ t ⊆ s₂ ×ˢ t :=
prod_mono hs Subset.rfl
#align set.prod_mono_left Set.prod_mono_left
@[gcongr]
theorem prod_mono_right (ht : t₁ ⊆ t₂) : s ×ˢ t₁ ⊆ s ×ˢ t₂ :=
prod_mono Subset.rfl ht
#align set.prod_mono_right Set.prod_mono_right
@[simp]
theorem prod_self_subset_prod_self : s₁ ×ˢ s₁ ⊆ s₂ ×ˢ s₂ ↔ s₁ ⊆ s₂ :=
⟨fun h _ hx => (h (mk_mem_prod hx hx)).1, fun h _ hx => ⟨h hx.1, h hx.2⟩⟩
#align set.prod_self_subset_prod_self Set.prod_self_subset_prod_self
@[simp]
theorem prod_self_ssubset_prod_self : s₁ ×ˢ s₁ ⊂ s₂ ×ˢ s₂ ↔ s₁ ⊂ s₂ :=
and_congr prod_self_subset_prod_self <| not_congr prod_self_subset_prod_self
#align set.prod_self_ssubset_prod_self Set.prod_self_ssubset_prod_self
theorem prod_subset_iff {P : Set (α × β)} : s ×ˢ t ⊆ P ↔ ∀ x ∈ s, ∀ y ∈ t, (x, y) ∈ P :=
⟨fun h _ hx _ hy => h (mk_mem_prod hx hy), fun h ⟨_, _⟩ hp => h _ hp.1 _ hp.2⟩
#align set.prod_subset_iff Set.prod_subset_iff
theorem forall_prod_set {p : α × β → Prop} : (∀ x ∈ s ×ˢ t, p x) ↔ ∀ x ∈ s, ∀ y ∈ t, p (x, y) :=
prod_subset_iff
#align set.forall_prod_set Set.forall_prod_set
theorem exists_prod_set {p : α × β → Prop} : (∃ x ∈ s ×ˢ t, p x) ↔ ∃ x ∈ s, ∃ y ∈ t, p (x, y) := by
simp [and_assoc]
#align set.exists_prod_set Set.exists_prod_set
@[simp]
theorem prod_empty : s ×ˢ (∅ : Set β) = ∅ := by
ext
exact and_false_iff _
#align set.prod_empty Set.prod_empty
@[simp]
theorem empty_prod : (∅ : Set α) ×ˢ t = ∅ := by
ext
exact false_and_iff _
#align set.empty_prod Set.empty_prod
@[simp, mfld_simps]
theorem univ_prod_univ : @univ α ×ˢ @univ β = univ := by
ext
exact true_and_iff _
#align set.univ_prod_univ Set.univ_prod_univ
theorem univ_prod {t : Set β} : (univ : Set α) ×ˢ t = Prod.snd ⁻¹' t := by simp [prod_eq]
#align set.univ_prod Set.univ_prod
theorem prod_univ {s : Set α} : s ×ˢ (univ : Set β) = Prod.fst ⁻¹' s := by simp [prod_eq]
#align set.prod_univ Set.prod_univ
@[simp] lemma prod_eq_univ [Nonempty α] [Nonempty β] : s ×ˢ t = univ ↔ s = univ ∧ t = univ := by
simp [eq_univ_iff_forall, forall_and]
@[simp]
theorem singleton_prod : ({a} : Set α) ×ˢ t = Prod.mk a '' t := by
ext ⟨x, y⟩
simp [and_left_comm, eq_comm]
#align set.singleton_prod Set.singleton_prod
@[simp]
theorem prod_singleton : s ×ˢ ({b} : Set β) = (fun a => (a, b)) '' s := by
ext ⟨x, y⟩
simp [and_left_comm, eq_comm]
#align set.prod_singleton Set.prod_singleton
theorem singleton_prod_singleton : ({a} : Set α) ×ˢ ({b} : Set β) = {(a, b)} := by simp
#align set.singleton_prod_singleton Set.singleton_prod_singleton
@[simp]
| Mathlib/Data/Set/Prod.lean | 126 | 128 | theorem union_prod : (s₁ ∪ s₂) ×ˢ t = s₁ ×ˢ t ∪ s₂ ×ˢ t := by |
ext ⟨x, y⟩
simp [or_and_right]
|
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.set.ncard from "leanprover-community/mathlib"@"74c2af38a828107941029b03839882c5c6f87a04"
namespace Set
variable {α β : Type*} {s t : Set α}
noncomputable def encard (s : Set α) : ℕ∞ := PartENat.withTopEquiv (PartENat.card s)
@[simp] theorem encard_univ_coe (s : Set α) : encard (univ : Set s) = encard s := by
rw [encard, encard, PartENat.card_congr (Equiv.Set.univ ↑s)]
theorem encard_univ (α : Type*) :
encard (univ : Set α) = PartENat.withTopEquiv (PartENat.card α) := by
rw [encard, PartENat.card_congr (Equiv.Set.univ α)]
theorem Finite.encard_eq_coe_toFinset_card (h : s.Finite) : s.encard = h.toFinset.card := by
have := h.fintype
rw [encard, PartENat.card_eq_coe_fintype_card,
PartENat.withTopEquiv_natCast, toFinite_toFinset, toFinset_card]
theorem encard_eq_coe_toFinset_card (s : Set α) [Fintype s] : encard s = s.toFinset.card := by
have h := toFinite s
rw [h.encard_eq_coe_toFinset_card, toFinite_toFinset]
| Mathlib/Data/Set/Card.lean | 82 | 83 | theorem encard_coe_eq_coe_finsetCard (s : Finset α) : encard (s : Set α) = s.card := by |
rw [Finite.encard_eq_coe_toFinset_card (Finset.finite_toSet s)]; simp
|
import Mathlib.Topology.MetricSpace.HausdorffDistance
#align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
noncomputable section
open NNReal ENNReal Topology Set Filter Bornology
universe u v w
variable {ι : Sort*} {α : Type u} {β : Type v}
namespace Metric
section Thickening
variable [PseudoEMetricSpace α] {δ : ℝ} {s : Set α} {x : α}
open EMetric
def thickening (δ : ℝ) (E : Set α) : Set α :=
{ x : α | infEdist x E < ENNReal.ofReal δ }
#align metric.thickening Metric.thickening
theorem mem_thickening_iff_infEdist_lt : x ∈ thickening δ s ↔ infEdist x s < ENNReal.ofReal δ :=
Iff.rfl
#align metric.mem_thickening_iff_inf_edist_lt Metric.mem_thickening_iff_infEdist_lt
lemma eventually_not_mem_thickening_of_infEdist_pos {E : Set α} {x : α} (h : x ∉ closure E) :
∀ᶠ δ in 𝓝 (0 : ℝ), x ∉ Metric.thickening δ E := by
obtain ⟨ε, ⟨ε_pos, ε_lt⟩⟩ := exists_real_pos_lt_infEdist_of_not_mem_closure h
filter_upwards [eventually_lt_nhds ε_pos] with δ hδ
simp only [thickening, mem_setOf_eq, not_lt]
exact (ENNReal.ofReal_le_ofReal hδ.le).trans ε_lt.le
theorem thickening_eq_preimage_infEdist (δ : ℝ) (E : Set α) :
thickening δ E = (infEdist · E) ⁻¹' Iio (ENNReal.ofReal δ) :=
rfl
#align metric.thickening_eq_preimage_inf_edist Metric.thickening_eq_preimage_infEdist
theorem isOpen_thickening {δ : ℝ} {E : Set α} : IsOpen (thickening δ E) :=
Continuous.isOpen_preimage continuous_infEdist _ isOpen_Iio
#align metric.is_open_thickening Metric.isOpen_thickening
@[simp]
| Mathlib/Topology/MetricSpace/Thickening.lean | 81 | 82 | theorem thickening_empty (δ : ℝ) : thickening δ (∅ : Set α) = ∅ := by |
simp only [thickening, setOf_false, infEdist_empty, not_top_lt]
|
import Mathlib.Analysis.InnerProductSpace.Rayleigh
import Mathlib.Analysis.InnerProductSpace.PiL2
import Mathlib.Algebra.DirectSum.Decomposition
import Mathlib.LinearAlgebra.Eigenspace.Minpoly
#align_import analysis.inner_product_space.spectrum from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
variable {𝕜 : Type*} [RCLike 𝕜]
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace 𝕜 E]
local notation "⟪" x ", " y "⟫" => @inner 𝕜 E _ x y
open scoped ComplexConjugate
open Module.End
namespace LinearMap
namespace IsSymmetric
variable {T : E →ₗ[𝕜] E} (hT : T.IsSymmetric)
theorem invariant_orthogonalComplement_eigenspace (μ : 𝕜) (v : E) (hv : v ∈ (eigenspace T μ)ᗮ) :
T v ∈ (eigenspace T μ)ᗮ := by
intro w hw
have : T w = (μ : 𝕜) • w := by rwa [mem_eigenspace_iff] at hw
simp [← hT w, this, inner_smul_left, hv w hw]
#align linear_map.is_symmetric.invariant_orthogonal_eigenspace LinearMap.IsSymmetric.invariant_orthogonalComplement_eigenspace
theorem conj_eigenvalue_eq_self {μ : 𝕜} (hμ : HasEigenvalue T μ) : conj μ = μ := by
obtain ⟨v, hv₁, hv₂⟩ := hμ.exists_hasEigenvector
rw [mem_eigenspace_iff] at hv₁
simpa [hv₂, inner_smul_left, inner_smul_right, hv₁] using hT v v
#align linear_map.is_symmetric.conj_eigenvalue_eq_self LinearMap.IsSymmetric.conj_eigenvalue_eq_self
| Mathlib/Analysis/InnerProductSpace/Spectrum.lean | 83 | 91 | theorem orthogonalFamily_eigenspaces :
OrthogonalFamily 𝕜 (fun μ => eigenspace T μ) fun μ => (eigenspace T μ).subtypeₗᵢ := by |
rintro μ ν hμν ⟨v, hv⟩ ⟨w, hw⟩
by_cases hv' : v = 0
· simp [hv']
have H := hT.conj_eigenvalue_eq_self (hasEigenvalue_of_hasEigenvector ⟨hv, hv'⟩)
rw [mem_eigenspace_iff] at hv hw
refine Or.resolve_left ?_ hμν.symm
simpa [inner_smul_left, inner_smul_right, hv, hw, H] using (hT v w).symm
|
import Mathlib.Algebra.PUnitInstances
import Mathlib.Tactic.Abel
import Mathlib.Tactic.Ring
import Mathlib.Order.Hom.Lattice
#align_import algebra.ring.boolean_ring from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open scoped symmDiff
variable {α β γ : Type*}
class BooleanRing (α) extends Ring α where
mul_self : ∀ a : α, a * a = a
#align boolean_ring BooleanRing
section BooleanRing
variable [BooleanRing α] (a b : α)
instance : Std.IdempotentOp (α := α) (· * ·) :=
⟨BooleanRing.mul_self⟩
@[simp]
theorem mul_self : a * a = a :=
BooleanRing.mul_self _
#align mul_self mul_self
@[simp]
| Mathlib/Algebra/Ring/BooleanRing.lean | 66 | 72 | theorem add_self : a + a = 0 := by |
have : a + a = a + a + (a + a) :=
calc
a + a = (a + a) * (a + a) := by rw [mul_self]
_ = a * a + a * a + (a * a + a * a) := by rw [add_mul, mul_add]
_ = a + a + (a + a) := by rw [mul_self]
rwa [self_eq_add_left] at this
|
import Mathlib.Data.Set.Pointwise.SMul
import Mathlib.Topology.MetricSpace.Isometry
import Mathlib.Topology.MetricSpace.Lipschitz
#align_import topology.metric_space.isometric_smul from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
open Set
open ENNReal Pointwise
universe u v w
variable (M : Type u) (G : Type v) (X : Type w)
class IsometricVAdd [PseudoEMetricSpace X] [VAdd M X] : Prop where
protected isometry_vadd : ∀ c : M, Isometry ((c +ᵥ ·) : X → X)
#align has_isometric_vadd IsometricVAdd
@[to_additive]
class IsometricSMul [PseudoEMetricSpace X] [SMul M X] : Prop where
protected isometry_smul : ∀ c : M, Isometry ((c • ·) : X → X)
#align has_isometric_smul IsometricSMul
-- Porting note: Lean 4 doesn't support `[]` in classes, so make a lemma instead of `export`ing
@[to_additive]
theorem isometry_smul {M : Type u} (X : Type w) [PseudoEMetricSpace X] [SMul M X]
[IsometricSMul M X] (c : M) : Isometry (c • · : X → X) :=
IsometricSMul.isometry_smul c
@[to_additive]
instance (priority := 100) IsometricSMul.to_continuousConstSMul [PseudoEMetricSpace X] [SMul M X]
[IsometricSMul M X] : ContinuousConstSMul M X :=
⟨fun c => (isometry_smul X c).continuous⟩
#align has_isometric_smul.to_has_continuous_const_smul IsometricSMul.to_continuousConstSMul
#align has_isometric_vadd.to_has_continuous_const_vadd IsometricVAdd.to_continuousConstVAdd
@[to_additive]
instance (priority := 100) IsometricSMul.opposite_of_comm [PseudoEMetricSpace X] [SMul M X]
[SMul Mᵐᵒᵖ X] [IsCentralScalar M X] [IsometricSMul M X] : IsometricSMul Mᵐᵒᵖ X :=
⟨fun c x y => by simpa only [← op_smul_eq_smul] using isometry_smul X c.unop x y⟩
#align has_isometric_smul.opposite_of_comm IsometricSMul.opposite_of_comm
#align has_isometric_vadd.opposite_of_comm IsometricVAdd.opposite_of_comm
variable {M G X}
section EMetric
variable [PseudoEMetricSpace X] [Group G] [MulAction G X] [IsometricSMul G X]
@[to_additive (attr := simp)]
theorem edist_smul_left [SMul M X] [IsometricSMul M X] (c : M) (x y : X) :
edist (c • x) (c • y) = edist x y :=
isometry_smul X c x y
#align edist_smul_left edist_smul_left
#align edist_vadd_left edist_vadd_left
@[to_additive (attr := simp)]
theorem ediam_smul [SMul M X] [IsometricSMul M X] (c : M) (s : Set X) :
EMetric.diam (c • s) = EMetric.diam s :=
(isometry_smul _ _).ediam_image s
#align ediam_smul ediam_smul
#align ediam_vadd ediam_vadd
@[to_additive]
theorem isometry_mul_left [Mul M] [PseudoEMetricSpace M] [IsometricSMul M M] (a : M) :
Isometry (a * ·) :=
isometry_smul M a
#align isometry_mul_left isometry_mul_left
#align isometry_add_left isometry_add_left
@[to_additive (attr := simp)]
theorem edist_mul_left [Mul M] [PseudoEMetricSpace M] [IsometricSMul M M] (a b c : M) :
edist (a * b) (a * c) = edist b c :=
isometry_mul_left a b c
#align edist_mul_left edist_mul_left
#align edist_add_left edist_add_left
@[to_additive]
theorem isometry_mul_right [Mul M] [PseudoEMetricSpace M] [IsometricSMul Mᵐᵒᵖ M] (a : M) :
Isometry fun x => x * a :=
isometry_smul M (MulOpposite.op a)
#align isometry_mul_right isometry_mul_right
#align isometry_add_right isometry_add_right
@[to_additive (attr := simp)]
theorem edist_mul_right [Mul M] [PseudoEMetricSpace M] [IsometricSMul Mᵐᵒᵖ M] (a b c : M) :
edist (a * c) (b * c) = edist a b :=
isometry_mul_right c a b
#align edist_mul_right edist_mul_right
#align edist_add_right edist_add_right
@[to_additive (attr := simp)]
theorem edist_div_right [DivInvMonoid M] [PseudoEMetricSpace M] [IsometricSMul Mᵐᵒᵖ M]
(a b c : M) : edist (a / c) (b / c) = edist a b := by
simp only [div_eq_mul_inv, edist_mul_right]
#align edist_div_right edist_div_right
#align edist_sub_right edist_sub_right
@[to_additive (attr := simp)]
theorem edist_inv_inv [PseudoEMetricSpace G] [IsometricSMul G G] [IsometricSMul Gᵐᵒᵖ G]
(a b : G) : edist a⁻¹ b⁻¹ = edist a b := by
rw [← edist_mul_left a, ← edist_mul_right _ _ b, mul_right_inv, one_mul, inv_mul_cancel_right,
edist_comm]
#align edist_inv_inv edist_inv_inv
#align edist_neg_neg edist_neg_neg
@[to_additive]
theorem isometry_inv [PseudoEMetricSpace G] [IsometricSMul G G] [IsometricSMul Gᵐᵒᵖ G] :
Isometry (Inv.inv : G → G) :=
edist_inv_inv
#align isometry_inv isometry_inv
#align isometry_neg isometry_neg
@[to_additive]
| Mathlib/Topology/MetricSpace/IsometricSMul.lean | 143 | 144 | theorem edist_inv [PseudoEMetricSpace G] [IsometricSMul G G] [IsometricSMul Gᵐᵒᵖ G]
(x y : G) : edist x⁻¹ y = edist x y⁻¹ := by | rw [← edist_inv_inv, inv_inv]
|
import Mathlib.Data.List.Range
import Mathlib.Algebra.Order.Ring.Nat
variable {α : Type*}
namespace List
@[simp]
theorem length_iterate (f : α → α) (a : α) (n : ℕ) : length (iterate f a n) = n := by
induction n generalizing a <;> simp [*]
@[simp]
theorem iterate_eq_nil {f : α → α} {a : α} {n : ℕ} : iterate f a n = [] ↔ n = 0 := by
rw [← length_eq_zero, length_iterate]
theorem get?_iterate (f : α → α) (a : α) :
∀ (n i : ℕ), i < n → get? (iterate f a n) i = f^[i] a
| n + 1, 0 , _ => rfl
| n + 1, i + 1, h => by simp [get?_iterate f (f a) n i (by simpa using h)]
@[simp]
theorem get_iterate (f : α → α) (a : α) (n : ℕ) (i : Fin (iterate f a n).length) :
get (iterate f a n) i = f^[↑i] a :=
(get?_eq_some.1 <| get?_iterate f a n i.1 (by simpa using i.2)).2
@[simp]
| Mathlib/Data/List/Iterate.lean | 39 | 41 | theorem mem_iterate {f : α → α} {a : α} {n : ℕ} {b : α} :
b ∈ iterate f a n ↔ ∃ m < n, b = f^[m] a := by |
simp [List.mem_iff_get, Fin.exists_iff, eq_comm (b := b)]
|
import Mathlib.Analysis.Convex.Between
import Mathlib.Analysis.Convex.Jensen
import Mathlib.Analysis.Convex.Topology
import Mathlib.Analysis.Normed.Group.Pointwise
import Mathlib.Analysis.NormedSpace.AddTorsor
#align_import analysis.convex.normed from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
variable {ι : Type*} {E P : Type*}
open Metric Set
open scoped Convex
variable [SeminormedAddCommGroup E] [NormedSpace ℝ E] [PseudoMetricSpace P] [NormedAddTorsor E P]
variable {s t : Set E}
theorem convexOn_norm (hs : Convex ℝ s) : ConvexOn ℝ s norm :=
⟨hs, fun x _ y _ a b ha hb _ =>
calc
‖a • x + b • y‖ ≤ ‖a • x‖ + ‖b • y‖ := norm_add_le _ _
_ = a * ‖x‖ + b * ‖y‖ := by
rw [norm_smul, norm_smul, Real.norm_of_nonneg ha, Real.norm_of_nonneg hb]⟩
#align convex_on_norm convexOn_norm
theorem convexOn_univ_norm : ConvexOn ℝ univ (norm : E → ℝ) :=
convexOn_norm convex_univ
#align convex_on_univ_norm convexOn_univ_norm
theorem convexOn_dist (z : E) (hs : Convex ℝ s) : ConvexOn ℝ s fun z' => dist z' z := by
simpa [dist_eq_norm, preimage_preimage] using
(convexOn_norm (hs.translate (-z))).comp_affineMap (AffineMap.id ℝ E - AffineMap.const ℝ E z)
#align convex_on_dist convexOn_dist
theorem convexOn_univ_dist (z : E) : ConvexOn ℝ univ fun z' => dist z' z :=
convexOn_dist z convex_univ
#align convex_on_univ_dist convexOn_univ_dist
theorem convex_ball (a : E) (r : ℝ) : Convex ℝ (Metric.ball a r) := by
simpa only [Metric.ball, sep_univ] using (convexOn_univ_dist a).convex_lt r
#align convex_ball convex_ball
theorem convex_closedBall (a : E) (r : ℝ) : Convex ℝ (Metric.closedBall a r) := by
simpa only [Metric.closedBall, sep_univ] using (convexOn_univ_dist a).convex_le r
#align convex_closed_ball convex_closedBall
| Mathlib/Analysis/Convex/Normed.lean | 70 | 72 | theorem Convex.thickening (hs : Convex ℝ s) (δ : ℝ) : Convex ℝ (thickening δ s) := by |
rw [← add_ball_zero]
exact hs.add (convex_ball 0 _)
|
import Mathlib.AlgebraicGeometry.Morphisms.Basic
import Mathlib.Topology.Spectral.Hom
import Mathlib.AlgebraicGeometry.Limits
#align_import algebraic_geometry.morphisms.quasi_compact from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8"
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe u
open scoped AlgebraicGeometry
namespace AlgebraicGeometry
variable {X Y : Scheme.{u}} (f : X ⟶ Y)
@[mk_iff]
class QuasiCompact (f : X ⟶ Y) : Prop where
isCompact_preimage : ∀ U : Set Y.carrier, IsOpen U → IsCompact U → IsCompact (f.1.base ⁻¹' U)
#align algebraic_geometry.quasi_compact AlgebraicGeometry.QuasiCompact
theorem quasiCompact_iff_spectral : QuasiCompact f ↔ IsSpectralMap f.1.base :=
⟨fun ⟨h⟩ => ⟨by continuity, h⟩, fun h => ⟨h.2⟩⟩
#align algebraic_geometry.quasi_compact_iff_spectral AlgebraicGeometry.quasiCompact_iff_spectral
def QuasiCompact.affineProperty : AffineTargetMorphismProperty := fun X _ _ _ =>
CompactSpace X.carrier
#align algebraic_geometry.quasi_compact.affine_property AlgebraicGeometry.QuasiCompact.affineProperty
instance (priority := 900) quasiCompactOfIsIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] :
QuasiCompact f := by
constructor
intro U _ hU'
convert hU'.image (inv f.1.base).continuous_toFun using 1
rw [Set.image_eq_preimage_of_inverse]
· delta Function.LeftInverse
exact IsIso.inv_hom_id_apply f.1.base
· exact IsIso.hom_inv_id_apply f.1.base
#align algebraic_geometry.quasi_compact_of_is_iso AlgebraicGeometry.quasiCompactOfIsIso
instance quasiCompactComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [QuasiCompact f]
[QuasiCompact g] : QuasiCompact (f ≫ g) := by
constructor
intro U hU hU'
rw [Scheme.comp_val_base, TopCat.coe_comp, Set.preimage_comp]
apply QuasiCompact.isCompact_preimage
· exact Continuous.isOpen_preimage (by
-- Porting note: `continuity` failed
-- see https://github.com/leanprover-community/mathlib4/issues/5030
exact Scheme.Hom.continuous g) _ hU
apply QuasiCompact.isCompact_preimage <;> assumption
#align algebraic_geometry.quasi_compact_comp AlgebraicGeometry.quasiCompactComp
theorem isCompact_open_iff_eq_finset_affine_union {X : Scheme} (U : Set X.carrier) :
IsCompact U ∧ IsOpen U ↔
∃ s : Set X.affineOpens, s.Finite ∧ U = ⋃ (i : X.affineOpens) (_ : i ∈ s), i := by
apply Opens.IsBasis.isCompact_open_iff_eq_finite_iUnion
(fun (U : X.affineOpens) => (U : Opens X.carrier))
· rw [Subtype.range_coe]; exact isBasis_affine_open X
· exact fun i => i.2.isCompact
#align algebraic_geometry.is_compact_open_iff_eq_finset_affine_union AlgebraicGeometry.isCompact_open_iff_eq_finset_affine_union
theorem isCompact_open_iff_eq_basicOpen_union {X : Scheme} [IsAffine X] (U : Set X.carrier) :
IsCompact U ∧ IsOpen U ↔
∃ s : Set (X.presheaf.obj (op ⊤)),
s.Finite ∧ U = ⋃ (i : X.presheaf.obj (op ⊤)) (_ : i ∈ s), X.basicOpen i :=
(isBasis_basicOpen X).isCompact_open_iff_eq_finite_iUnion _
(fun _ => ((topIsAffineOpen _).basicOpenIsAffine _).isCompact) _
#align algebraic_geometry.is_compact_open_iff_eq_basic_open_union AlgebraicGeometry.isCompact_open_iff_eq_basicOpen_union
theorem quasiCompact_iff_forall_affine :
QuasiCompact f ↔
∀ U : Opens Y.carrier, IsAffineOpen U → IsCompact (f.1.base ⁻¹' (U : Set Y.carrier)) := by
rw [quasiCompact_iff]
refine ⟨fun H U hU => H U U.isOpen hU.isCompact, ?_⟩
intro H U hU hU'
obtain ⟨S, hS, rfl⟩ := (isCompact_open_iff_eq_finset_affine_union U).mp ⟨hU', hU⟩
simp only [Set.preimage_iUnion]
exact Set.Finite.isCompact_biUnion hS (fun i _ => H i i.prop)
#align algebraic_geometry.quasi_compact_iff_forall_affine AlgebraicGeometry.quasiCompact_iff_forall_affine
@[simp]
theorem QuasiCompact.affineProperty_toProperty {X Y : Scheme} (f : X ⟶ Y) :
(QuasiCompact.affineProperty : _).toProperty f ↔ IsAffine Y ∧ CompactSpace X.carrier := by
delta AffineTargetMorphismProperty.toProperty QuasiCompact.affineProperty; simp
#align algebraic_geometry.quasi_compact.affine_property_to_property AlgebraicGeometry.QuasiCompact.affineProperty_toProperty
| Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean | 114 | 120 | theorem quasiCompact_iff_affineProperty :
QuasiCompact f ↔ targetAffineLocally QuasiCompact.affineProperty f := by |
rw [quasiCompact_iff_forall_affine]
trans ∀ U : Y.affineOpens, IsCompact (f.1.base ⁻¹' (U : Set Y.carrier))
· exact ⟨fun h U => h U U.prop, fun h U hU => h ⟨U, hU⟩⟩
apply forall_congr'
exact fun _ => isCompact_iff_compactSpace
|
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.BigOperators
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.Algebra.Polynomial.Div
#align_import data.polynomial.ring_division from "leanprover-community/mathlib"@"8efcf8022aac8e01df8d302dcebdbc25d6a886c8"
noncomputable section
open Polynomial
open Finset
namespace Polynomial
universe u v w z
variable {R : Type u} {S : Type v} {T : Type w} {a b : R} {n : ℕ}
section NoZeroDivisors
variable [Semiring R] [NoZeroDivisors R] {p q : R[X]}
instance : NoZeroDivisors R[X] where
eq_zero_or_eq_zero_of_mul_eq_zero h := by
rw [← leadingCoeff_eq_zero, ← leadingCoeff_eq_zero]
refine eq_zero_or_eq_zero_of_mul_eq_zero ?_
rw [← leadingCoeff_zero, ← leadingCoeff_mul, h]
theorem natDegree_mul (hp : p ≠ 0) (hq : q ≠ 0) : (p*q).natDegree = p.natDegree + q.natDegree := by
rw [← Nat.cast_inj (R := WithBot ℕ), ← degree_eq_natDegree (mul_ne_zero hp hq),
Nat.cast_add, ← degree_eq_natDegree hp, ← degree_eq_natDegree hq, degree_mul]
#align polynomial.nat_degree_mul Polynomial.natDegree_mul
theorem trailingDegree_mul : (p * q).trailingDegree = p.trailingDegree + q.trailingDegree := by
by_cases hp : p = 0
· rw [hp, zero_mul, trailingDegree_zero, top_add]
by_cases hq : q = 0
· rw [hq, mul_zero, trailingDegree_zero, add_top]
· rw [trailingDegree_eq_natTrailingDegree hp, trailingDegree_eq_natTrailingDegree hq,
trailingDegree_eq_natTrailingDegree (mul_ne_zero hp hq), natTrailingDegree_mul hp hq]
apply WithTop.coe_add
#align polynomial.trailing_degree_mul Polynomial.trailingDegree_mul
@[simp]
theorem natDegree_pow (p : R[X]) (n : ℕ) : natDegree (p ^ n) = n * natDegree p := by
classical
obtain rfl | hp := eq_or_ne p 0
· obtain rfl | hn := eq_or_ne n 0 <;> simp [*]
exact natDegree_pow' $ by
rw [← leadingCoeff_pow, Ne, leadingCoeff_eq_zero]; exact pow_ne_zero _ hp
#align polynomial.nat_degree_pow Polynomial.natDegree_pow
theorem degree_le_mul_left (p : R[X]) (hq : q ≠ 0) : degree p ≤ degree (p * q) := by
classical
exact if hp : p = 0 then by simp only [hp, zero_mul, le_refl]
else by
rw [degree_mul, degree_eq_natDegree hp, degree_eq_natDegree hq];
exact WithBot.coe_le_coe.2 (Nat.le_add_right _ _)
#align polynomial.degree_le_mul_left Polynomial.degree_le_mul_left
theorem natDegree_le_of_dvd {p q : R[X]} (h1 : p ∣ q) (h2 : q ≠ 0) : p.natDegree ≤ q.natDegree := by
rcases h1 with ⟨q, rfl⟩; rw [mul_ne_zero_iff] at h2
rw [natDegree_mul h2.1 h2.2]; exact Nat.le_add_right _ _
#align polynomial.nat_degree_le_of_dvd Polynomial.natDegree_le_of_dvd
| Mathlib/Algebra/Polynomial/RingDivision.lean | 161 | 163 | theorem degree_le_of_dvd {p q : R[X]} (h1 : p ∣ q) (h2 : q ≠ 0) : degree p ≤ degree q := by |
rcases h1 with ⟨q, rfl⟩; rw [mul_ne_zero_iff] at h2
exact degree_le_mul_left p h2.2
|
import Mathlib.Data.List.Basic
#align_import data.list.lattice from "leanprover-community/mathlib"@"dd71334db81d0bd444af1ee339a29298bef40734"
open Nat
namespace List
variable {α : Type*} {l l₁ l₂ : List α} {p : α → Prop} {a : α}
variable [DecidableEq α]
section Inter
@[simp]
theorem inter_nil (l : List α) : [] ∩ l = [] :=
rfl
#align list.inter_nil List.inter_nil
@[simp]
theorem inter_cons_of_mem (l₁ : List α) (h : a ∈ l₂) : (a :: l₁) ∩ l₂ = a :: l₁ ∩ l₂ := by
simp [Inter.inter, List.inter, h]
#align list.inter_cons_of_mem List.inter_cons_of_mem
@[simp]
| Mathlib/Data/List/Lattice.lean | 139 | 140 | theorem inter_cons_of_not_mem (l₁ : List α) (h : a ∉ l₂) : (a :: l₁) ∩ l₂ = l₁ ∩ l₂ := by |
simp [Inter.inter, List.inter, h]
|
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics
#align_import analysis.special_functions.pow.continuity from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8"
noncomputable section
open scoped Classical
open Real Topology NNReal ENNReal Filter ComplexConjugate
open Filter Finset Set
section CpowLimits
open Complex
variable {α : Type*}
| Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean | 36 | 41 | theorem zero_cpow_eq_nhds {b : ℂ} (hb : b ≠ 0) : (fun x : ℂ => (0 : ℂ) ^ x) =ᶠ[𝓝 b] 0 := by |
suffices ∀ᶠ x : ℂ in 𝓝 b, x ≠ 0 from
this.mono fun x hx ↦ by
dsimp only
rw [zero_cpow hx, Pi.zero_apply]
exact IsOpen.eventually_mem isOpen_ne hb
|
import Mathlib.FieldTheory.RatFunc.AsPolynomial
import Mathlib.RingTheory.EuclideanDomain
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Polynomial.Content
noncomputable section
universe u
variable {K : Type u}
namespace RatFunc
section IntDegree
open Polynomial
variable [Field K]
def intDegree (x : RatFunc K) : ℤ :=
natDegree x.num - natDegree x.denom
#align ratfunc.int_degree RatFunc.intDegree
@[simp]
theorem intDegree_zero : intDegree (0 : RatFunc K) = 0 := by
rw [intDegree, num_zero, natDegree_zero, denom_zero, natDegree_one, sub_self]
#align ratfunc.int_degree_zero RatFunc.intDegree_zero
@[simp]
| Mathlib/FieldTheory/RatFunc/Degree.lean | 49 | 50 | theorem intDegree_one : intDegree (1 : RatFunc K) = 0 := by |
rw [intDegree, num_one, denom_one, sub_self]
|
import Mathlib.Topology.MetricSpace.HausdorffDistance
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order
#align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf"
open Set Filter ENNReal Topology NNReal TopologicalSpace
namespace MeasureTheory
namespace Measure
def InnerRegularWRT {α} {_ : MeasurableSpace α} (μ : Measure α) (p q : Set α → Prop) :=
∀ ⦃U⦄, q U → ∀ r < μ U, ∃ K, K ⊆ U ∧ p K ∧ r < μ K
#align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT
variable {α β : Type*} [MeasurableSpace α] [TopologicalSpace α] {μ : Measure α}
class OuterRegular (μ : Measure α) : Prop where
protected outerRegular :
∀ ⦃A : Set α⦄, MeasurableSet A → ∀ r > μ A, ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < r
#align measure_theory.measure.outer_regular MeasureTheory.Measure.OuterRegular
#align measure_theory.measure.outer_regular.outer_regular MeasureTheory.Measure.OuterRegular.outerRegular
class Regular (μ : Measure α) extends IsFiniteMeasureOnCompacts μ, OuterRegular μ : Prop where
innerRegular : InnerRegularWRT μ IsCompact IsOpen
#align measure_theory.measure.regular MeasureTheory.Measure.Regular
class WeaklyRegular (μ : Measure α) extends OuterRegular μ : Prop where
protected innerRegular : InnerRegularWRT μ IsClosed IsOpen
#align measure_theory.measure.weakly_regular MeasureTheory.Measure.WeaklyRegular
#align measure_theory.measure.weakly_regular.inner_regular MeasureTheory.Measure.WeaklyRegular.innerRegular
class InnerRegular (μ : Measure α) : Prop where
protected innerRegular : InnerRegularWRT μ IsCompact (fun s ↦ MeasurableSet s)
class InnerRegularCompactLTTop (μ : Measure α) : Prop where
protected innerRegular : InnerRegularWRT μ IsCompact (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞)
-- see Note [lower instance priority]
instance (priority := 100) Regular.weaklyRegular [R1Space α] [Regular μ] :
WeaklyRegular μ where
innerRegular := fun _U hU r hr ↦
let ⟨K, KU, K_comp, hK⟩ := Regular.innerRegular hU r hr
⟨closure K, K_comp.closure_subset_of_isOpen hU KU, isClosed_closure,
hK.trans_le (measure_mono subset_closure)⟩
#align measure_theory.measure.regular.weakly_regular MeasureTheory.Measure.Regular.weaklyRegular
namespace OuterRegular
instance zero : OuterRegular (0 : Measure α) :=
⟨fun A _ _r hr => ⟨univ, subset_univ A, isOpen_univ, hr⟩⟩
#align measure_theory.measure.outer_regular.zero MeasureTheory.Measure.OuterRegular.zero
theorem _root_.Set.exists_isOpen_lt_of_lt [OuterRegular μ] (A : Set α) (r : ℝ≥0∞) (hr : μ A < r) :
∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < r := by
rcases OuterRegular.outerRegular (measurableSet_toMeasurable μ A) r
(by rwa [measure_toMeasurable]) with
⟨U, hAU, hUo, hU⟩
exact ⟨U, (subset_toMeasurable _ _).trans hAU, hUo, hU⟩
#align set.exists_is_open_lt_of_lt Set.exists_isOpen_lt_of_lt
| Mathlib/MeasureTheory/Measure/Regular.lean | 349 | 353 | theorem _root_.Set.measure_eq_iInf_isOpen (A : Set α) (μ : Measure α) [OuterRegular μ] :
μ A = ⨅ (U : Set α) (_ : A ⊆ U) (_ : IsOpen U), μ U := by |
refine le_antisymm (le_iInf₂ fun s hs => le_iInf fun _ => μ.mono hs) ?_
refine le_of_forall_lt' fun r hr => ?_
simpa only [iInf_lt_iff, exists_prop] using A.exists_isOpen_lt_of_lt r hr
|
import Mathlib.CategoryTheory.Limits.Shapes.Equalizers
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.Topology.Sheaves.SheafCondition.PairwiseIntersections
#align_import topology.sheaves.sheaf_condition.equalizer_products from "leanprover-community/mathlib"@"85d6221d32c37e68f05b2e42cde6cee658dae5e9"
universe v' v u
noncomputable section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite TopologicalSpace.Opens
namespace TopCat
variable {C : Type u} [Category.{v} C] [HasProducts.{v'} C]
variable {X : TopCat.{v'}} (F : Presheaf C X) {ι : Type v'} (U : ι → Opens X)
namespace Presheaf
namespace SheafConditionEqualizerProducts
def piOpens : C :=
∏ᶜ fun i : ι => F.obj (op (U i))
set_option linter.uppercaseLean3 false in
#align Top.presheaf.sheaf_condition_equalizer_products.pi_opens TopCat.Presheaf.SheafConditionEqualizerProducts.piOpens
def piInters : C :=
∏ᶜ fun p : ι × ι => F.obj (op (U p.1 ⊓ U p.2))
set_option linter.uppercaseLean3 false in
#align Top.presheaf.sheaf_condition_equalizer_products.pi_inters TopCat.Presheaf.SheafConditionEqualizerProducts.piInters
def leftRes : piOpens F U ⟶ piInters.{v'} F U :=
Pi.lift fun p : ι × ι => Pi.π _ p.1 ≫ F.map (infLELeft (U p.1) (U p.2)).op
set_option linter.uppercaseLean3 false in
#align Top.presheaf.sheaf_condition_equalizer_products.left_res TopCat.Presheaf.SheafConditionEqualizerProducts.leftRes
def rightRes : piOpens F U ⟶ piInters.{v'} F U :=
Pi.lift fun p : ι × ι => Pi.π _ p.2 ≫ F.map (infLERight (U p.1) (U p.2)).op
set_option linter.uppercaseLean3 false in
#align Top.presheaf.sheaf_condition_equalizer_products.right_res TopCat.Presheaf.SheafConditionEqualizerProducts.rightRes
def res : F.obj (op (iSup U)) ⟶ piOpens.{v'} F U :=
Pi.lift fun i : ι => F.map (TopologicalSpace.Opens.leSupr U i).op
set_option linter.uppercaseLean3 false in
#align Top.presheaf.sheaf_condition_equalizer_products.res TopCat.Presheaf.SheafConditionEqualizerProducts.res
@[simp, elementwise]
| Mathlib/Topology/Sheaves/SheafCondition/EqualizerProducts.lean | 80 | 81 | theorem res_π (i : ι) : res F U ≫ limit.π _ ⟨i⟩ = F.map (Opens.leSupr U i).op := by |
rw [res, limit.lift_π, Fan.mk_π_app]
|
import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts
import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts
import Mathlib.CategoryTheory.Limits.Shapes.Kernels
#align_import category_theory.limits.shapes.biproducts from "leanprover-community/mathlib"@"ac3ae212f394f508df43e37aa093722fa9b65d31"
noncomputable section
universe w w' v u
open CategoryTheory
open CategoryTheory.Functor
open scoped Classical
namespace CategoryTheory
namespace Limits
variable {J : Type w}
universe uC' uC uD' uD
variable {C : Type uC} [Category.{uC'} C] [HasZeroMorphisms C]
variable {D : Type uD} [Category.{uD'} D] [HasZeroMorphisms D]
-- @[nolint has_nonempty_instance] Porting note (#5171): removed
structure Bicone (F : J → C) where
pt : C
π : ∀ j, pt ⟶ F j
ι : ∀ j, F j ⟶ pt
ι_π : ∀ j j', ι j ≫ π j' =
if h : j = j' then eqToHom (congrArg F h) else 0 := by aesop
#align category_theory.limits.bicone CategoryTheory.Limits.Bicone
set_option linter.uppercaseLean3 false in
#align category_theory.limits.bicone_X CategoryTheory.Limits.Bicone.pt
attribute [inherit_doc Bicone] Bicone.pt Bicone.π Bicone.ι Bicone.ι_π
@[reassoc (attr := simp)]
theorem bicone_ι_π_self {F : J → C} (B : Bicone F) (j : J) : B.ι j ≫ B.π j = 𝟙 (F j) := by
simpa using B.ι_π j j
#align category_theory.limits.bicone_ι_π_self CategoryTheory.Limits.bicone_ι_π_self
@[reassoc (attr := simp)]
| Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean | 92 | 93 | theorem bicone_ι_π_ne {F : J → C} (B : Bicone F) {j j' : J} (h : j ≠ j') : B.ι j ≫ B.π j' = 0 := by |
simpa [h] using B.ι_π j j'
|
import Mathlib.MeasureTheory.MeasurableSpace.Defs
import Mathlib.SetTheory.Cardinal.Cofinality
import Mathlib.SetTheory.Cardinal.Continuum
#align_import measure_theory.card_measurable_space from "leanprover-community/mathlib"@"f2b108e8e97ba393f22bf794989984ddcc1da89b"
universe u
variable {α : Type u}
open Cardinal Set
-- Porting note: fix universe below, not here
local notation "ω₁" => (WellOrder.α <| Quotient.out <| Cardinal.ord (aleph 1 : Cardinal))
namespace MeasurableSpace
def generateMeasurableRec (s : Set (Set α)) : (ω₁ : Type u) → Set (Set α)
| i =>
let S := ⋃ j : Iio i, generateMeasurableRec s (j.1)
s ∪ {∅} ∪ compl '' S ∪ Set.range fun f : ℕ → S => ⋃ n, (f n).1
termination_by i => i
decreasing_by exact j.2
#align measurable_space.generate_measurable_rec MeasurableSpace.generateMeasurableRec
theorem self_subset_generateMeasurableRec (s : Set (Set α)) (i : ω₁) :
s ⊆ generateMeasurableRec s i := by
unfold generateMeasurableRec
apply_rules [subset_union_of_subset_left]
exact subset_rfl
#align measurable_space.self_subset_generate_measurable_rec MeasurableSpace.self_subset_generateMeasurableRec
theorem empty_mem_generateMeasurableRec (s : Set (Set α)) (i : ω₁) :
∅ ∈ generateMeasurableRec s i := by
unfold generateMeasurableRec
exact mem_union_left _ (mem_union_left _ (mem_union_right _ (mem_singleton ∅)))
#align measurable_space.empty_mem_generate_measurable_rec MeasurableSpace.empty_mem_generateMeasurableRec
theorem compl_mem_generateMeasurableRec {s : Set (Set α)} {i j : ω₁} (h : j < i) {t : Set α}
(ht : t ∈ generateMeasurableRec s j) : tᶜ ∈ generateMeasurableRec s i := by
unfold generateMeasurableRec
exact mem_union_left _ (mem_union_right _ ⟨t, mem_iUnion.2 ⟨⟨j, h⟩, ht⟩, rfl⟩)
#align measurable_space.compl_mem_generate_measurable_rec MeasurableSpace.compl_mem_generateMeasurableRec
theorem iUnion_mem_generateMeasurableRec {s : Set (Set α)} {i : ω₁} {f : ℕ → Set α}
(hf : ∀ n, ∃ j < i, f n ∈ generateMeasurableRec s j) :
(⋃ n, f n) ∈ generateMeasurableRec s i := by
unfold generateMeasurableRec
exact mem_union_right _ ⟨fun n => ⟨f n, let ⟨j, hj, hf⟩ := hf n; mem_iUnion.2 ⟨⟨j, hj⟩, hf⟩⟩, rfl⟩
#align measurable_space.Union_mem_generate_measurable_rec MeasurableSpace.iUnion_mem_generateMeasurableRec
theorem generateMeasurableRec_subset (s : Set (Set α)) {i j : ω₁} (h : i ≤ j) :
generateMeasurableRec s i ⊆ generateMeasurableRec s j := fun x hx => by
rcases eq_or_lt_of_le h with (rfl | h)
· exact hx
· convert iUnion_mem_generateMeasurableRec fun _ => ⟨i, h, hx⟩
exact (iUnion_const x).symm
#align measurable_space.generate_measurable_rec_subset MeasurableSpace.generateMeasurableRec_subset
theorem cardinal_generateMeasurableRec_le (s : Set (Set α)) (i : ω₁) :
#(generateMeasurableRec s i) ≤ max #s 2 ^ aleph0.{u} := by
apply (aleph 1).ord.out.wo.wf.induction i
intro i IH
have A := aleph0_le_aleph 1
have B : aleph 1 ≤ max #s 2 ^ aleph0.{u} :=
aleph_one_le_continuum.trans (power_le_power_right (le_max_right _ _))
have C : ℵ₀ ≤ max #s 2 ^ aleph0.{u} := A.trans B
have J : #(⋃ j : Iio i, generateMeasurableRec s j.1) ≤ max #s 2 ^ aleph0.{u} := by
refine (mk_iUnion_le _).trans ?_
have D : ⨆ j : Iio i, #(generateMeasurableRec s j) ≤ _ := ciSup_le' fun ⟨j, hj⟩ => IH j hj
apply (mul_le_mul' ((mk_subtype_le _).trans (aleph 1).mk_ord_out.le) D).trans
rw [mul_eq_max A C]
exact max_le B le_rfl
rw [generateMeasurableRec]
apply_rules [(mk_union_le _ _).trans, add_le_of_le C, mk_image_le.trans]
· exact (le_max_left _ _).trans (self_le_power _ one_lt_aleph0.le)
· rw [mk_singleton]
exact one_lt_aleph0.le.trans C
· apply mk_range_le.trans
simp only [mk_pi, prod_const, lift_uzero, mk_denumerable, lift_aleph0]
have := @power_le_power_right _ _ ℵ₀ J
rwa [← power_mul, aleph0_mul_aleph0] at this
#align measurable_space.cardinal_generate_measurable_rec_le MeasurableSpace.cardinal_generateMeasurableRec_le
| Mathlib/MeasureTheory/MeasurableSpace/Card.lean | 117 | 151 | theorem generateMeasurable_eq_rec (s : Set (Set α)) :
{ t | GenerateMeasurable s t } =
⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by |
ext t; refine ⟨fun ht => ?_, fun ht => ?_⟩
· inhabit ω₁
induction' ht with u hu u _ IH f _ IH
· exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
· exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
· rcases mem_iUnion.1 IH with ⟨i, hi⟩
obtain ⟨j, hj⟩ := exists_gt i
exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
· have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
choose I hI using this
have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
refine mem_iUnion.2
⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) ?_,
iUnion_mem_generateMeasurableRec fun n => ⟨I n, ?_, hI n⟩⟩
· rw [Ordinal.type_lt]
refine Ordinal.lsub_lt_ord_lift ?_ fun i => Ordinal.typein_lt_self _
rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
exact aleph0_lt_aleph_one
· rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
apply Ordinal.lt_lsub fun n : ℕ => _
· rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
revert t
apply (aleph 1).ord.out.wo.wf.induction i
intro j H t ht
unfold generateMeasurableRec at ht
rcases ht with (((h | (rfl : t = ∅)) | ⟨u, ⟨-, ⟨⟨k, hk⟩, rfl⟩, hu⟩, rfl⟩) | ⟨f, rfl⟩)
· exact .basic t h
· exact .empty
· exact .compl u (H k hk u hu)
· refine .iUnion _ @fun n => ?_
obtain ⟨-, ⟨⟨k, hk⟩, rfl⟩, hf⟩ := (f n).prop
exact H k hk _ hf
|
import Mathlib.RingTheory.IntegrallyClosed
import Mathlib.RingTheory.Localization.NumDen
import Mathlib.RingTheory.Polynomial.ScaleRoots
#align_import ring_theory.polynomial.rational_root from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c"
open scoped Polynomial
section ScaleRoots
variable {A K R S : Type*} [CommRing A] [Field K] [CommRing R] [CommRing S]
variable {M : Submonoid A} [Algebra A S] [IsLocalization M S] [Algebra A K] [IsFractionRing A K]
open Finsupp IsFractionRing IsLocalization Polynomial
| Mathlib/RingTheory/Polynomial/RationalRoot.lean | 39 | 44 | theorem scaleRoots_aeval_eq_zero_of_aeval_mk'_eq_zero {p : A[X]} {r : A} {s : M}
(hr : aeval (mk' S r s) p = 0) : aeval (algebraMap A S r) (scaleRoots p s) = 0 := by |
convert scaleRoots_eval₂_eq_zero (algebraMap A S) hr
-- Porting note: added
funext
rw [aeval_def, mk'_spec' _ r s]
|
import Mathlib.NumberTheory.Zsqrtd.Basic
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Data.Complex.Basic
import Mathlib.Data.Real.Archimedean
#align_import number_theory.zsqrtd.gaussian_int from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9"
open Zsqrtd Complex
open scoped ComplexConjugate
abbrev GaussianInt : Type :=
Zsqrtd (-1)
#align gaussian_int GaussianInt
local notation "ℤ[i]" => GaussianInt
namespace GaussianInt
instance : Repr ℤ[i] :=
⟨fun x _ => "⟨" ++ repr x.re ++ ", " ++ repr x.im ++ "⟩"⟩
instance instCommRing : CommRing ℤ[i] :=
Zsqrtd.commRing
#align gaussian_int.comm_ring GaussianInt.instCommRing
section
attribute [-instance] Complex.instField -- Avoid making things noncomputable unnecessarily.
def toComplex : ℤ[i] →+* ℂ :=
Zsqrtd.lift ⟨I, by simp⟩
#align gaussian_int.to_complex GaussianInt.toComplex
end
instance : Coe ℤ[i] ℂ :=
⟨toComplex⟩
theorem toComplex_def (x : ℤ[i]) : (x : ℂ) = x.re + x.im * I :=
rfl
#align gaussian_int.to_complex_def GaussianInt.toComplex_def
theorem toComplex_def' (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ) = x + y * I := by simp [toComplex_def]
#align gaussian_int.to_complex_def' GaussianInt.toComplex_def'
theorem toComplex_def₂ (x : ℤ[i]) : (x : ℂ) = ⟨x.re, x.im⟩ := by
apply Complex.ext <;> simp [toComplex_def]
#align gaussian_int.to_complex_def₂ GaussianInt.toComplex_def₂
@[simp]
| Mathlib/NumberTheory/Zsqrtd/GaussianInt.lean | 89 | 89 | theorem to_real_re (x : ℤ[i]) : ((x.re : ℤ) : ℝ) = (x : ℂ).re := by | simp [toComplex_def]
|
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.Adjugate
import Mathlib.LinearAlgebra.FiniteDimensional
#align_import linear_algebra.matrix.nonsingular_inverse from "leanprover-community/mathlib"@"722b3b152ddd5e0cf21c0a29787c76596cb6b422"
namespace Matrix
universe u u' v
variable {l : Type*} {m : Type u} {n : Type u'} {α : Type v}
open Matrix Equiv Equiv.Perm Finset
section Invertible
variable [Fintype n] [DecidableEq n] [CommRing α]
variable (A : Matrix n n α) (B : Matrix n n α)
def invertibleOfDetInvertible [Invertible A.det] : Invertible A where
invOf := ⅟ A.det • A.adjugate
mul_invOf_self := by
rw [mul_smul_comm, mul_adjugate, smul_smul, invOf_mul_self, one_smul]
invOf_mul_self := by
rw [smul_mul_assoc, adjugate_mul, smul_smul, invOf_mul_self, one_smul]
#align matrix.invertible_of_det_invertible Matrix.invertibleOfDetInvertible
theorem invOf_eq [Invertible A.det] [Invertible A] : ⅟ A = ⅟ A.det • A.adjugate := by
letI := invertibleOfDetInvertible A
convert (rfl : ⅟ A = _)
#align matrix.inv_of_eq Matrix.invOf_eq
def detInvertibleOfLeftInverse (h : B * A = 1) : Invertible A.det where
invOf := B.det
mul_invOf_self := by rw [mul_comm, ← det_mul, h, det_one]
invOf_mul_self := by rw [← det_mul, h, det_one]
#align matrix.det_invertible_of_left_inverse Matrix.detInvertibleOfLeftInverse
def detInvertibleOfRightInverse (h : A * B = 1) : Invertible A.det where
invOf := B.det
mul_invOf_self := by rw [← det_mul, h, det_one]
invOf_mul_self := by rw [mul_comm, ← det_mul, h, det_one]
#align matrix.det_invertible_of_right_inverse Matrix.detInvertibleOfRightInverse
def detInvertibleOfInvertible [Invertible A] : Invertible A.det :=
detInvertibleOfLeftInverse A (⅟ A) (invOf_mul_self _)
#align matrix.det_invertible_of_invertible Matrix.detInvertibleOfInvertible
| Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean | 103 | 105 | theorem det_invOf [Invertible A] [Invertible A.det] : (⅟ A).det = ⅟ A.det := by |
letI := detInvertibleOfInvertible A
convert (rfl : _ = ⅟ A.det)
|
import Mathlib.LinearAlgebra.FiniteDimensional
import Mathlib.MeasureTheory.Group.Pointwise
import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
import Mathlib.MeasureTheory.Measure.Haar.Basic
import Mathlib.MeasureTheory.Measure.Doubling
import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric
#align_import measure_theory.measure.lebesgue.eq_haar from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
assert_not_exists MeasureTheory.integral
open TopologicalSpace Set Filter Metric Bornology
open scoped ENNReal Pointwise Topology NNReal
def TopologicalSpace.PositiveCompacts.Icc01 : PositiveCompacts ℝ where
carrier := Icc 0 1
isCompact' := isCompact_Icc
interior_nonempty' := by simp_rw [interior_Icc, nonempty_Ioo, zero_lt_one]
#align topological_space.positive_compacts.Icc01 TopologicalSpace.PositiveCompacts.Icc01
universe u
def TopologicalSpace.PositiveCompacts.piIcc01 (ι : Type*) [Finite ι] :
PositiveCompacts (ι → ℝ) where
carrier := pi univ fun _ => Icc 0 1
isCompact' := isCompact_univ_pi fun _ => isCompact_Icc
interior_nonempty' := by
simp only [interior_pi_set, Set.toFinite, interior_Icc, univ_pi_nonempty_iff, nonempty_Ioo,
imp_true_iff, zero_lt_one]
#align topological_space.positive_compacts.pi_Icc01 TopologicalSpace.PositiveCompacts.piIcc01
theorem Basis.parallelepiped_basisFun (ι : Type*) [Fintype ι] :
(Pi.basisFun ℝ ι).parallelepiped = TopologicalSpace.PositiveCompacts.piIcc01 ι :=
SetLike.coe_injective <| by
refine Eq.trans ?_ ((uIcc_of_le ?_).trans (Set.pi_univ_Icc _ _).symm)
· classical convert parallelepiped_single (ι := ι) 1
· exact zero_le_one
#align basis.parallelepiped_basis_fun Basis.parallelepiped_basisFun
theorem Basis.parallelepiped_eq_map {ι E : Type*} [Fintype ι] [NormedAddCommGroup E]
[NormedSpace ℝ E] (b : Basis ι ℝ E) :
b.parallelepiped = (PositiveCompacts.piIcc01 ι).map b.equivFun.symm
b.equivFunL.symm.continuous b.equivFunL.symm.isOpenMap := by
classical
rw [← Basis.parallelepiped_basisFun, ← Basis.parallelepiped_map]
congr with x
simp
open MeasureTheory MeasureTheory.Measure
theorem Basis.map_addHaar {ι E F : Type*} [Fintype ι] [NormedAddCommGroup E] [NormedAddCommGroup F]
[NormedSpace ℝ E] [NormedSpace ℝ F] [MeasurableSpace E] [MeasurableSpace F] [BorelSpace E]
[BorelSpace F] [SecondCountableTopology F] [SigmaCompactSpace F]
(b : Basis ι ℝ E) (f : E ≃L[ℝ] F) :
map f b.addHaar = (b.map f.toLinearEquiv).addHaar := by
have : IsAddHaarMeasure (map f b.addHaar) :=
AddEquiv.isAddHaarMeasure_map b.addHaar f.toAddEquiv f.continuous f.symm.continuous
rw [eq_comm, Basis.addHaar_eq_iff, Measure.map_apply f.continuous.measurable
(PositiveCompacts.isCompact _).measurableSet, Basis.coe_parallelepiped, Basis.coe_map]
erw [← image_parallelepiped, f.toEquiv.preimage_image, addHaar_self]
namespace MeasureTheory
open Measure TopologicalSpace.PositiveCompacts FiniteDimensional
| Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean | 115 | 116 | theorem addHaarMeasure_eq_volume : addHaarMeasure Icc01 = volume := by |
convert (addHaarMeasure_unique volume Icc01).symm; simp [Icc01]
|
import Mathlib.Algebra.BigOperators.Ring.List
import Mathlib.Data.Nat.Prime
import Mathlib.Data.List.Prime
import Mathlib.Data.List.Sort
import Mathlib.Data.List.Chain
#align_import data.nat.factors from "leanprover-community/mathlib"@"008205aa645b3f194c1da47025c5f110c8406eab"
open Bool Subtype
open Nat
namespace Nat
attribute [instance 0] instBEqNat
def factors : ℕ → List ℕ
| 0 => []
| 1 => []
| k + 2 =>
let m := minFac (k + 2)
m :: factors ((k + 2) / m)
decreasing_by show (k + 2) / m < (k + 2); exact factors_lemma
#align nat.factors Nat.factors
@[simp]
theorem factors_zero : factors 0 = [] := by rw [factors]
#align nat.factors_zero Nat.factors_zero
@[simp]
theorem factors_one : factors 1 = [] := by rw [factors]
#align nat.factors_one Nat.factors_one
@[simp]
theorem factors_two : factors 2 = [2] := by simp [factors]
| Mathlib/Data/Nat/Factors.lean | 55 | 65 | theorem prime_of_mem_factors {n : ℕ} : ∀ {p : ℕ}, (h : p ∈ factors n) → Prime p := by |
match n with
| 0 => simp
| 1 => simp
| k + 2 =>
intro p h
let m := minFac (k + 2)
have : (k + 2) / m < (k + 2) := factors_lemma
have h₁ : p = m ∨ p ∈ factors ((k + 2) / m) :=
List.mem_cons.1 (by rwa [factors] at h)
exact Or.casesOn h₁ (fun h₂ => h₂.symm ▸ minFac_prime (by simp)) prime_of_mem_factors
|
import Mathlib.GroupTheory.QuotientGroup
import Mathlib.RingTheory.DedekindDomain.Ideal
#align_import ring_theory.class_group from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950"
variable {R K L : Type*} [CommRing R]
variable [Field K] [Field L] [DecidableEq L]
variable [Algebra R K] [IsFractionRing R K]
variable [Algebra K L] [FiniteDimensional K L]
variable [Algebra R L] [IsScalarTower R K L]
open scoped nonZeroDivisors
open IsLocalization IsFractionRing FractionalIdeal Units
section
variable (R K)
irreducible_def toPrincipalIdeal : Kˣ →* (FractionalIdeal R⁰ K)ˣ :=
{ toFun := fun x =>
⟨spanSingleton _ x, spanSingleton _ x⁻¹, by
simp only [spanSingleton_one, Units.mul_inv', spanSingleton_mul_spanSingleton], by
simp only [spanSingleton_one, Units.inv_mul', spanSingleton_mul_spanSingleton]⟩
map_mul' := fun x y =>
ext (by simp only [Units.val_mk, Units.val_mul, spanSingleton_mul_spanSingleton])
map_one' := ext (by simp only [spanSingleton_one, Units.val_mk, Units.val_one]) }
#align to_principal_ideal toPrincipalIdeal
variable {R K}
@[simp]
theorem coe_toPrincipalIdeal (x : Kˣ) :
(toPrincipalIdeal R K x : FractionalIdeal R⁰ K) = spanSingleton _ (x : K) := by
simp only [toPrincipalIdeal]; rfl
#align coe_to_principal_ideal coe_toPrincipalIdeal
@[simp]
theorem toPrincipalIdeal_eq_iff {I : (FractionalIdeal R⁰ K)ˣ} {x : Kˣ} :
toPrincipalIdeal R K x = I ↔ spanSingleton R⁰ (x : K) = I := by
simp only [toPrincipalIdeal]; exact Units.ext_iff
#align to_principal_ideal_eq_iff toPrincipalIdeal_eq_iff
theorem mem_principal_ideals_iff {I : (FractionalIdeal R⁰ K)ˣ} :
I ∈ (toPrincipalIdeal R K).range ↔ ∃ x : K, spanSingleton R⁰ x = I := by
simp only [MonoidHom.mem_range, toPrincipalIdeal_eq_iff]
constructor <;> rintro ⟨x, hx⟩
· exact ⟨x, hx⟩
· refine ⟨Units.mk0 x ?_, hx⟩
rintro rfl
simp [I.ne_zero.symm] at hx
#align mem_principal_ideals_iff mem_principal_ideals_iff
instance PrincipalIdeals.normal : (toPrincipalIdeal R K).range.Normal :=
Subgroup.normal_of_comm _
#align principal_ideals.normal PrincipalIdeals.normal
end
variable (R)
variable [IsDomain R]
def ClassGroup :=
(FractionalIdeal R⁰ (FractionRing R))ˣ ⧸ (toPrincipalIdeal R (FractionRing R)).range
#align class_group ClassGroup
noncomputable instance : CommGroup (ClassGroup R) :=
QuotientGroup.Quotient.commGroup (toPrincipalIdeal R (FractionRing R)).range
noncomputable instance : Inhabited (ClassGroup R) := ⟨1⟩
variable {R}
noncomputable def ClassGroup.mk : (FractionalIdeal R⁰ K)ˣ →* ClassGroup R :=
(QuotientGroup.mk' (toPrincipalIdeal R (FractionRing R)).range).comp
(Units.map (FractionalIdeal.canonicalEquiv R⁰ K (FractionRing R)))
#align class_group.mk ClassGroup.mk
-- Can't be `@[simp]` because it can't figure out the quotient relation.
theorem ClassGroup.Quot_mk_eq_mk (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
Quot.mk _ I = ClassGroup.mk I := by
rw [ClassGroup.mk, canonicalEquiv_self, RingEquiv.coe_monoidHom_refl, Units.map_id]
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [MonoidHom.comp_apply]
rw [MonoidHom.id_apply, QuotientGroup.mk'_apply]
rfl
theorem ClassGroup.mk_eq_mk {I J : (FractionalIdeal R⁰ <| FractionRing R)ˣ} :
ClassGroup.mk I = ClassGroup.mk J ↔
∃ x : (FractionRing R)ˣ, I * toPrincipalIdeal R (FractionRing R) x = J := by
erw [QuotientGroup.mk'_eq_mk', canonicalEquiv_self, Units.map_id, Set.exists_range_iff]
rfl
#align class_group.mk_eq_mk ClassGroup.mk_eq_mk
| Mathlib/RingTheory/ClassGroup.lean | 126 | 144 | theorem ClassGroup.mk_eq_mk_of_coe_ideal {I J : (FractionalIdeal R⁰ <| FractionRing R)ˣ}
{I' J' : Ideal R} (hI : (I : FractionalIdeal R⁰ <| FractionRing R) = I')
(hJ : (J : FractionalIdeal R⁰ <| FractionRing R) = J') :
ClassGroup.mk I = ClassGroup.mk J ↔
∃ x y : R, x ≠ 0 ∧ y ≠ 0 ∧ Ideal.span {x} * I' = Ideal.span {y} * J' := by |
rw [ClassGroup.mk_eq_mk]
constructor
· rintro ⟨x, rfl⟩
rw [Units.val_mul, hI, coe_toPrincipalIdeal, mul_comm,
spanSingleton_mul_coeIdeal_eq_coeIdeal] at hJ
exact ⟨_, _, sec_fst_ne_zero (R := R) le_rfl x.ne_zero,
sec_snd_ne_zero (R := R) le_rfl (x : FractionRing R), hJ⟩
· rintro ⟨x, y, hx, hy, h⟩
have : IsUnit (mk' (FractionRing R) x ⟨y, mem_nonZeroDivisors_of_ne_zero hy⟩) := by
simpa only [isUnit_iff_ne_zero, ne_eq, mk'_eq_zero_iff_eq_zero] using hx
refine ⟨this.unit, ?_⟩
rw [mul_comm, ← Units.eq_iff, Units.val_mul, coe_toPrincipalIdeal]
convert
(mk'_mul_coeIdeal_eq_coeIdeal (FractionRing R) <| mem_nonZeroDivisors_of_ne_zero hy).2 h
|
import Mathlib.Algebra.Order.BigOperators.Ring.Finset
import Mathlib.Data.Nat.Totient
import Mathlib.GroupTheory.OrderOfElement
import Mathlib.GroupTheory.Subgroup.Simple
import Mathlib.Tactic.Group
import Mathlib.GroupTheory.Exponent
#align_import group_theory.specific_groups.cyclic from "leanprover-community/mathlib"@"0f6670b8af2dff699de1c0b4b49039b31bc13c46"
universe u
variable {α : Type u} {a : α}
section Cyclic
attribute [local instance] setFintype
open Subgroup
class IsAddCyclic (α : Type u) [AddGroup α] : Prop where
exists_generator : ∃ g : α, ∀ x, x ∈ AddSubgroup.zmultiples g
#align is_add_cyclic IsAddCyclic
@[to_additive]
class IsCyclic (α : Type u) [Group α] : Prop where
exists_generator : ∃ g : α, ∀ x, x ∈ zpowers g
#align is_cyclic IsCyclic
@[to_additive]
instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α] : IsCyclic α :=
⟨⟨1, fun x => by
rw [Subsingleton.elim x 1]
exact mem_zpowers 1⟩⟩
#align is_cyclic_of_subsingleton isCyclic_of_subsingleton
#align is_add_cyclic_of_subsingleton isAddCyclic_of_subsingleton
@[simp]
theorem isCyclic_multiplicative_iff [AddGroup α] : IsCyclic (Multiplicative α) ↔ IsAddCyclic α :=
⟨fun H ↦ ⟨H.1⟩, fun H ↦ ⟨H.1⟩⟩
instance isCyclic_multiplicative [AddGroup α] [IsAddCyclic α] : IsCyclic (Multiplicative α) :=
isCyclic_multiplicative_iff.mpr inferInstance
@[simp]
theorem isAddCyclic_additive_iff [Group α] : IsAddCyclic (Additive α) ↔ IsCyclic α :=
⟨fun H ↦ ⟨H.1⟩, fun H ↦ ⟨H.1⟩⟩
instance isAddCyclic_additive [Group α] [IsCyclic α] : IsAddCyclic (Additive α) :=
isAddCyclic_additive_iff.mpr inferInstance
@[to_additive
"A cyclic group is always commutative. This is not an `instance` because often we have
a better proof of `AddCommGroup`."]
def IsCyclic.commGroup [hg : Group α] [IsCyclic α] : CommGroup α :=
{ hg with
mul_comm := fun x y =>
let ⟨_, hg⟩ := IsCyclic.exists_generator (α := α)
let ⟨_, hn⟩ := hg x
let ⟨_, hm⟩ := hg y
hm ▸ hn ▸ zpow_mul_comm _ _ _ }
#align is_cyclic.comm_group IsCyclic.commGroup
#align is_add_cyclic.add_comm_group IsAddCyclic.addCommGroup
variable [Group α]
@[to_additive "A non-cyclic additive group is non-trivial."]
theorem Nontrivial.of_not_isCyclic (nc : ¬IsCyclic α) : Nontrivial α := by
contrapose! nc
exact @isCyclic_of_subsingleton _ _ (not_nontrivial_iff_subsingleton.mp nc)
@[to_additive]
theorem MonoidHom.map_cyclic {G : Type*} [Group G] [h : IsCyclic G] (σ : G →* G) :
∃ m : ℤ, ∀ g : G, σ g = g ^ m := by
obtain ⟨h, hG⟩ := IsCyclic.exists_generator (α := G)
obtain ⟨m, hm⟩ := hG (σ h)
refine ⟨m, fun g => ?_⟩
obtain ⟨n, rfl⟩ := hG g
rw [MonoidHom.map_zpow, ← hm, ← zpow_mul, ← zpow_mul']
#align monoid_hom.map_cyclic MonoidHom.map_cyclic
#align monoid_add_hom.map_add_cyclic AddMonoidHom.map_addCyclic
@[deprecated (since := "2024-02-21")] alias
MonoidAddHom.map_add_cyclic := AddMonoidHom.map_addCyclic
@[to_additive]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
IsCyclic α := by
classical
use x
simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
rw [← Fintype.card_congr (Equiv.Set.univ α), ← Fintype.card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_addOrderOf_eq_card
@[deprecated (since := "2024-02-21")]
alias isAddCyclic_of_orderOf_eq_card := isAddCyclic_of_addOrderOf_eq_card
@[to_additive]
| Mathlib/GroupTheory/SpecificGroups/Cyclic.lean | 136 | 141 | theorem Subgroup.eq_bot_or_eq_top_of_prime_card {G : Type*} [Group G] {_ : Fintype G}
(H : Subgroup G) [hp : Fact (Fintype.card G).Prime] : H = ⊥ ∨ H = ⊤ := by |
classical
have := card_subgroup_dvd_card H
rwa [Nat.card_eq_fintype_card (α := G), Nat.dvd_prime hp.1, ← Nat.card_eq_fintype_card,
← eq_bot_iff_card, card_eq_iff_eq_top] at this
|
import Mathlib.Algebra.Order.Ring.Abs
#align_import data.int.order.units from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
namespace Int
theorem isUnit_iff_abs_eq {x : ℤ} : IsUnit x ↔ abs x = 1 := by
rw [isUnit_iff_natAbs_eq, abs_eq_natAbs, ← Int.ofNat_one, natCast_inj]
#align int.is_unit_iff_abs_eq Int.isUnit_iff_abs_eq
theorem isUnit_sq {a : ℤ} (ha : IsUnit a) : a ^ 2 = 1 := by rw [sq, isUnit_mul_self ha]
#align int.is_unit_sq Int.isUnit_sq
@[simp]
theorem units_sq (u : ℤˣ) : u ^ 2 = 1 := by
rw [Units.ext_iff, Units.val_pow_eq_pow_val, Units.val_one, isUnit_sq u.isUnit]
#align int.units_sq Int.units_sq
alias units_pow_two := units_sq
#align int.units_pow_two Int.units_pow_two
@[simp]
theorem units_mul_self (u : ℤˣ) : u * u = 1 := by rw [← sq, units_sq]
#align int.units_mul_self Int.units_mul_self
@[simp]
theorem units_inv_eq_self (u : ℤˣ) : u⁻¹ = u := by rw [inv_eq_iff_mul_eq_one, units_mul_self]
#align int.units_inv_eq_self Int.units_inv_eq_self
theorem units_div_eq_mul (u₁ u₂ : ℤˣ) : u₁ / u₂ = u₁ * u₂ := by
rw [div_eq_mul_inv, units_inv_eq_self]
-- `Units.val_mul` is a "wrong turn" for the simplifier, this undoes it and simplifies further
@[simp]
| Mathlib/Data/Int/Order/Units.lean | 45 | 46 | theorem units_coe_mul_self (u : ℤˣ) : (u * u : ℤ) = 1 := by |
rw [← Units.val_mul, units_mul_self, Units.val_one]
|
import Mathlib.Combinatorics.SimpleGraph.DegreeSum
import Mathlib.Combinatorics.SimpleGraph.Subgraph
#align_import combinatorics.simple_graph.matching from "leanprover-community/mathlib"@"138448ae98f529ef34eeb61114191975ee2ca508"
universe u
namespace SimpleGraph
variable {V : Type u} {G : SimpleGraph V} (M : Subgraph G)
namespace Subgraph
def IsMatching : Prop := ∀ ⦃v⦄, v ∈ M.verts → ∃! w, M.Adj v w
#align simple_graph.subgraph.is_matching SimpleGraph.Subgraph.IsMatching
noncomputable def IsMatching.toEdge {M : Subgraph G} (h : M.IsMatching) (v : M.verts) : M.edgeSet :=
⟨s(v, (h v.property).choose), (h v.property).choose_spec.1⟩
#align simple_graph.subgraph.is_matching.to_edge SimpleGraph.Subgraph.IsMatching.toEdge
theorem IsMatching.toEdge_eq_of_adj {M : Subgraph G} (h : M.IsMatching) {v w : V} (hv : v ∈ M.verts)
(hvw : M.Adj v w) : h.toEdge ⟨v, hv⟩ = ⟨s(v, w), hvw⟩ := by
simp only [IsMatching.toEdge, Subtype.mk_eq_mk]
congr
exact ((h (M.edge_vert hvw)).choose_spec.2 w hvw).symm
#align simple_graph.subgraph.is_matching.to_edge_eq_of_adj SimpleGraph.Subgraph.IsMatching.toEdge_eq_of_adj
theorem IsMatching.toEdge.surjective {M : Subgraph G} (h : M.IsMatching) :
Function.Surjective h.toEdge := by
rintro ⟨e, he⟩
refine Sym2.ind (fun x y he => ?_) e he
exact ⟨⟨x, M.edge_vert he⟩, h.toEdge_eq_of_adj _ he⟩
#align simple_graph.subgraph.is_matching.to_edge.surjective SimpleGraph.Subgraph.IsMatching.toEdge.surjective
theorem IsMatching.toEdge_eq_toEdge_of_adj {M : Subgraph G} {v w : V} (h : M.IsMatching)
(hv : v ∈ M.verts) (hw : w ∈ M.verts) (ha : M.Adj v w) :
h.toEdge ⟨v, hv⟩ = h.toEdge ⟨w, hw⟩ := by
rw [h.toEdge_eq_of_adj hv ha, h.toEdge_eq_of_adj hw (M.symm ha), Subtype.mk_eq_mk, Sym2.eq_swap]
#align simple_graph.subgraph.is_matching.to_edge_eq_to_edge_of_adj SimpleGraph.Subgraph.IsMatching.toEdge_eq_toEdge_of_adj
def IsPerfectMatching : Prop := M.IsMatching ∧ M.IsSpanning
#align simple_graph.subgraph.is_perfect_matching SimpleGraph.Subgraph.IsPerfectMatching
theorem IsMatching.support_eq_verts {M : Subgraph G} (h : M.IsMatching) : M.support = M.verts := by
refine M.support_subset_verts.antisymm fun v hv => ?_
obtain ⟨w, hvw, -⟩ := h hv
exact ⟨_, hvw⟩
#align simple_graph.subgraph.is_matching.support_eq_verts SimpleGraph.Subgraph.IsMatching.support_eq_verts
theorem isMatching_iff_forall_degree {M : Subgraph G} [∀ v : V, Fintype (M.neighborSet v)] :
M.IsMatching ↔ ∀ v : V, v ∈ M.verts → M.degree v = 1 := by
simp only [degree_eq_one_iff_unique_adj, IsMatching]
#align simple_graph.subgraph.is_matching_iff_forall_degree SimpleGraph.Subgraph.isMatching_iff_forall_degree
theorem IsMatching.even_card {M : Subgraph G} [Fintype M.verts] (h : M.IsMatching) :
Even M.verts.toFinset.card := by
classical
rw [isMatching_iff_forall_degree] at h
use M.coe.edgeFinset.card
rw [← two_mul, ← M.coe.sum_degrees_eq_twice_card_edges]
-- Porting note: `SimpleGraph.Subgraph.coe_degree` does not trigger because it uses
-- instance arguments instead of implicit arguments for the first `Fintype` argument.
-- Using a `convert_to` to swap out the `Fintype` instance to the "right" one.
convert_to _ = Finset.sum Finset.univ fun v => SimpleGraph.degree (Subgraph.coe M) v using 3
simp [h, Finset.card_univ]
#align simple_graph.subgraph.is_matching.even_card SimpleGraph.Subgraph.IsMatching.even_card
| Mathlib/Combinatorics/SimpleGraph/Matching.lean | 114 | 119 | theorem isPerfectMatching_iff : M.IsPerfectMatching ↔ ∀ v, ∃! w, M.Adj v w := by |
refine ⟨?_, fun hm => ⟨fun v _ => hm v, fun v => ?_⟩⟩
· rintro ⟨hm, hs⟩ v
exact hm (hs v)
· obtain ⟨w, hw, -⟩ := hm v
exact M.edge_vert hw
|
import Mathlib.Order.Interval.Set.UnorderedInterval
import Mathlib.Algebra.Order.Interval.Set.Monoid
import Mathlib.Data.Set.Pointwise.Basic
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
#align_import data.set.pointwise.interval from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Interval Pointwise
variable {α : Type*}
namespace Set
section OrderedAddCommGroup
variable [OrderedAddCommGroup α] (a b c : α)
@[simp]
theorem preimage_const_add_Ici : (fun x => a + x) ⁻¹' Ici b = Ici (b - a) :=
ext fun _x => sub_le_iff_le_add'.symm
#align set.preimage_const_add_Ici Set.preimage_const_add_Ici
@[simp]
theorem preimage_const_add_Ioi : (fun x => a + x) ⁻¹' Ioi b = Ioi (b - a) :=
ext fun _x => sub_lt_iff_lt_add'.symm
#align set.preimage_const_add_Ioi Set.preimage_const_add_Ioi
@[simp]
theorem preimage_const_add_Iic : (fun x => a + x) ⁻¹' Iic b = Iic (b - a) :=
ext fun _x => le_sub_iff_add_le'.symm
#align set.preimage_const_add_Iic Set.preimage_const_add_Iic
@[simp]
theorem preimage_const_add_Iio : (fun x => a + x) ⁻¹' Iio b = Iio (b - a) :=
ext fun _x => lt_sub_iff_add_lt'.symm
#align set.preimage_const_add_Iio Set.preimage_const_add_Iio
@[simp]
| Mathlib/Data/Set/Pointwise/Interval.lean | 147 | 148 | theorem preimage_const_add_Icc : (fun x => a + x) ⁻¹' Icc b c = Icc (b - a) (c - a) := by |
simp [← Ici_inter_Iic]
|
import Mathlib.Tactic.NormNum
import Mathlib.Tactic.TryThis
import Mathlib.Util.AtomM
set_option autoImplicit true
namespace Mathlib.Tactic.Abel
open Lean Elab Meta Tactic Qq
initialize registerTraceClass `abel
initialize registerTraceClass `abel.detail
structure Context where
α : Expr
univ : Level
α0 : Expr
isGroup : Bool
inst : Expr
def mkContext (e : Expr) : MetaM Context := do
let α ← inferType e
let c ← synthInstance (← mkAppM ``AddCommMonoid #[α])
let cg ← synthInstance? (← mkAppM ``AddCommGroup #[α])
let u ← mkFreshLevelMVar
_ ← isDefEq (.sort (.succ u)) (← inferType α)
let α0 ← Expr.ofNat α 0
match cg with
| some cg => return ⟨α, u, α0, true, cg⟩
| _ => return ⟨α, u, α0, false, c⟩
abbrev M := ReaderT Context AtomM
def Context.app (c : Context) (n : Name) (inst : Expr) : Array Expr → Expr :=
mkAppN (((@Expr.const n [c.univ]).app c.α).app inst)
def Context.mkApp (c : Context) (n inst : Name) (l : Array Expr) : MetaM Expr := do
return c.app n (← synthInstance ((Expr.const inst [c.univ]).app c.α)) l
def addG : Name → Name
| .str p s => .str p (s ++ "g")
| n => n
def iapp (n : Name) (xs : Array Expr) : M Expr := do
let c ← read
return c.app (if c.isGroup then addG n else n) c.inst xs
def term {α} [AddCommMonoid α] (n : ℕ) (x a : α) : α := n • x + a
def termg {α} [AddCommGroup α] (n : ℤ) (x a : α) : α := n • x + a
def mkTerm (n x a : Expr) : M Expr := iapp ``term #[n, x, a]
def intToExpr (n : ℤ) : M Expr := do
Expr.ofInt (mkConst (if (← read).isGroup then ``Int else ``Nat) []) n
inductive NormalExpr : Type
| zero (e : Expr) : NormalExpr
| nterm (e : Expr) (n : Expr × ℤ) (x : ℕ × Expr) (a : NormalExpr) : NormalExpr
deriving Inhabited
def NormalExpr.e : NormalExpr → Expr
| .zero e => e
| .nterm e .. => e
instance : Coe NormalExpr Expr where coe := NormalExpr.e
def NormalExpr.term' (n : Expr × ℤ) (x : ℕ × Expr) (a : NormalExpr) : M NormalExpr :=
return .nterm (← mkTerm n.1 x.2 a) n x a
def NormalExpr.zero' : M NormalExpr := return NormalExpr.zero (← read).α0
open NormalExpr
| Mathlib/Tactic/Abel.lean | 128 | 130 | theorem const_add_term {α} [AddCommMonoid α] (k n x a a') (h : k + a = a') :
k + @term α _ n x a = term n x a' := by |
simp [h.symm, term, add_comm, add_assoc]
|
import Mathlib.Data.Finsupp.Basic
import Mathlib.Data.Finsupp.Order
#align_import data.finsupp.multiset from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf"
open Finset
variable {α β ι : Type*}
namespace Finsupp
def toMultiset : (α →₀ ℕ) →+ Multiset α where
toFun f := Finsupp.sum f fun a n => n • {a}
-- Porting note: times out if h is not specified
map_add' _f _g := sum_add_index' (h := fun a n => n • ({a} : Multiset α))
(fun _ ↦ zero_nsmul _) (fun _ ↦ add_nsmul _)
map_zero' := sum_zero_index
theorem toMultiset_zero : toMultiset (0 : α →₀ ℕ) = 0 :=
rfl
#align finsupp.to_multiset_zero Finsupp.toMultiset_zero
theorem toMultiset_add (m n : α →₀ ℕ) : toMultiset (m + n) = toMultiset m + toMultiset n :=
toMultiset.map_add m n
#align finsupp.to_multiset_add Finsupp.toMultiset_add
theorem toMultiset_apply (f : α →₀ ℕ) : toMultiset f = f.sum fun a n => n • {a} :=
rfl
#align finsupp.to_multiset_apply Finsupp.toMultiset_apply
@[simp]
theorem toMultiset_single (a : α) (n : ℕ) : toMultiset (single a n) = n • {a} := by
rw [toMultiset_apply, sum_single_index]; apply zero_nsmul
#align finsupp.to_multiset_single Finsupp.toMultiset_single
theorem toMultiset_sum {f : ι → α →₀ ℕ} (s : Finset ι) :
Finsupp.toMultiset (∑ i ∈ s, f i) = ∑ i ∈ s, Finsupp.toMultiset (f i) :=
map_sum Finsupp.toMultiset _ _
#align finsupp.to_multiset_sum Finsupp.toMultiset_sum
theorem toMultiset_sum_single (s : Finset ι) (n : ℕ) :
Finsupp.toMultiset (∑ i ∈ s, single i n) = n • s.val := by
simp_rw [toMultiset_sum, Finsupp.toMultiset_single, sum_nsmul, sum_multiset_singleton]
#align finsupp.to_multiset_sum_single Finsupp.toMultiset_sum_single
@[simp]
theorem card_toMultiset (f : α →₀ ℕ) : Multiset.card (toMultiset f) = f.sum fun _ => id := by
simp [toMultiset_apply, map_finsupp_sum, Function.id_def]
#align finsupp.card_to_multiset Finsupp.card_toMultiset
theorem toMultiset_map (f : α →₀ ℕ) (g : α → β) :
f.toMultiset.map g = toMultiset (f.mapDomain g) := by
refine f.induction ?_ ?_
· rw [toMultiset_zero, Multiset.map_zero, mapDomain_zero, toMultiset_zero]
· intro a n f _ _ ih
rw [toMultiset_add, Multiset.map_add, ih, mapDomain_add, mapDomain_single,
toMultiset_single, toMultiset_add, toMultiset_single, ← Multiset.coe_mapAddMonoidHom,
(Multiset.mapAddMonoidHom g).map_nsmul]
rfl
#align finsupp.to_multiset_map Finsupp.toMultiset_map
@[to_additive (attr := simp)]
theorem prod_toMultiset [CommMonoid α] (f : α →₀ ℕ) :
f.toMultiset.prod = f.prod fun a n => a ^ n := by
refine f.induction ?_ ?_
· rw [toMultiset_zero, Multiset.prod_zero, Finsupp.prod_zero_index]
· intro a n f _ _ ih
rw [toMultiset_add, Multiset.prod_add, ih, toMultiset_single, Multiset.prod_nsmul,
Finsupp.prod_add_index' pow_zero pow_add, Finsupp.prod_single_index, Multiset.prod_singleton]
exact pow_zero a
#align finsupp.prod_to_multiset Finsupp.prod_toMultiset
@[simp]
theorem toFinset_toMultiset [DecidableEq α] (f : α →₀ ℕ) : f.toMultiset.toFinset = f.support := by
refine f.induction ?_ ?_
· rw [toMultiset_zero, Multiset.toFinset_zero, support_zero]
· intro a n f ha hn ih
rw [toMultiset_add, Multiset.toFinset_add, ih, toMultiset_single, support_add_eq,
support_single_ne_zero _ hn, Multiset.toFinset_nsmul _ _ hn, Multiset.toFinset_singleton]
refine Disjoint.mono_left support_single_subset ?_
rwa [Finset.disjoint_singleton_left]
#align finsupp.to_finset_to_multiset Finsupp.toFinset_toMultiset
@[simp]
| Mathlib/Data/Finsupp/Multiset.lean | 105 | 114 | theorem count_toMultiset [DecidableEq α] (f : α →₀ ℕ) (a : α) : (toMultiset f).count a = f a :=
calc
(toMultiset f).count a = Finsupp.sum f (fun x n => (n • {x} : Multiset α).count a) := by |
rw [toMultiset_apply]; exact map_sum (Multiset.countAddMonoidHom a) _ f.support
_ = f.sum fun x n => n * ({x} : Multiset α).count a := by simp only [Multiset.count_nsmul]
_ = f a * ({a} : Multiset α).count a :=
sum_eq_single _
(fun a' _ H => by simp only [Multiset.count_singleton, if_false, H.symm, mul_zero])
(fun _ => zero_mul _)
_ = f a := by rw [Multiset.count_singleton_self, mul_one]
|
import Mathlib.Topology.MetricSpace.HausdorffDistance
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order
#align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf"
open Set Filter ENNReal Topology NNReal TopologicalSpace
namespace MeasureTheory
namespace Measure
def InnerRegularWRT {α} {_ : MeasurableSpace α} (μ : Measure α) (p q : Set α → Prop) :=
∀ ⦃U⦄, q U → ∀ r < μ U, ∃ K, K ⊆ U ∧ p K ∧ r < μ K
#align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT
namespace InnerRegularWRT
variable {α : Type*} {m : MeasurableSpace α} {μ : Measure α} {p q : Set α → Prop} {U : Set α}
{ε : ℝ≥0∞}
| Mathlib/MeasureTheory/Measure/Regular.lean | 215 | 219 | theorem measure_eq_iSup (H : InnerRegularWRT μ p q) (hU : q U) :
μ U = ⨆ (K) (_ : K ⊆ U) (_ : p K), μ K := by |
refine
le_antisymm (le_of_forall_lt fun r hr => ?_) (iSup₂_le fun K hK => iSup_le fun _ => μ.mono hK)
simpa only [lt_iSup_iff, exists_prop] using H hU r hr
|
import Mathlib.Topology.Connected.Basic
open Set Topology
universe u v
variable {α : Type u} {β : Type v} {ι : Type*} {π : ι → Type*} [TopologicalSpace α]
{s t u v : Set α}
section LocallyConnectedSpace
class LocallyConnectedSpace (α : Type*) [TopologicalSpace α] : Prop where
open_connected_basis : ∀ x, (𝓝 x).HasBasis (fun s : Set α => IsOpen s ∧ x ∈ s ∧ IsConnected s) id
#align locally_connected_space LocallyConnectedSpace
theorem locallyConnectedSpace_iff_open_connected_basis :
LocallyConnectedSpace α ↔
∀ x, (𝓝 x).HasBasis (fun s : Set α => IsOpen s ∧ x ∈ s ∧ IsConnected s) id :=
⟨@LocallyConnectedSpace.open_connected_basis _ _, LocallyConnectedSpace.mk⟩
#align locally_connected_space_iff_open_connected_basis locallyConnectedSpace_iff_open_connected_basis
theorem locallyConnectedSpace_iff_open_connected_subsets :
LocallyConnectedSpace α ↔
∀ x, ∀ U ∈ 𝓝 x, ∃ V : Set α, V ⊆ U ∧ IsOpen V ∧ x ∈ V ∧ IsConnected V := by
simp_rw [locallyConnectedSpace_iff_open_connected_basis]
refine forall_congr' fun _ => ?_
constructor
· intro h U hU
rcases h.mem_iff.mp hU with ⟨V, hV, hVU⟩
exact ⟨V, hVU, hV⟩
· exact fun h => ⟨fun U => ⟨fun hU =>
let ⟨V, hVU, hV⟩ := h U hU
⟨V, hV, hVU⟩, fun ⟨V, ⟨hV, hxV, _⟩, hVU⟩ => mem_nhds_iff.mpr ⟨V, hVU, hV, hxV⟩⟩⟩
#align locally_connected_space_iff_open_connected_subsets locallyConnectedSpace_iff_open_connected_subsets
instance (priority := 100) DiscreteTopology.toLocallyConnectedSpace (α) [TopologicalSpace α]
[DiscreteTopology α] : LocallyConnectedSpace α :=
locallyConnectedSpace_iff_open_connected_subsets.2 fun x _U hU =>
⟨{x}, singleton_subset_iff.2 <| mem_of_mem_nhds hU, isOpen_discrete _, rfl,
isConnected_singleton⟩
#align discrete_topology.to_locally_connected_space DiscreteTopology.toLocallyConnectedSpace
| Mathlib/Topology/Connected/LocallyConnected.lean | 63 | 67 | theorem connectedComponentIn_mem_nhds [LocallyConnectedSpace α] {F : Set α} {x : α} (h : F ∈ 𝓝 x) :
connectedComponentIn F x ∈ 𝓝 x := by |
rw [(LocallyConnectedSpace.open_connected_basis x).mem_iff] at h
rcases h with ⟨s, ⟨h1s, hxs, h2s⟩, hsF⟩
exact mem_nhds_iff.mpr ⟨s, h2s.isPreconnected.subset_connectedComponentIn hxs hsF, h1s, hxs⟩
|
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic
import Mathlib.MeasureTheory.Integral.MeanInequalities
#align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9"
open Filter
open scoped ENNReal Topology
namespace MeasureTheory
variable {α E : Type*} {m : MeasurableSpace α} [NormedAddCommGroup E]
{p : ℝ≥0∞} {q : ℝ} {μ : Measure α} {f g : α → E}
theorem snorm'_add_le {f g : α → E} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ)
(hq1 : 1 ≤ q) : snorm' (f + g) q μ ≤ snorm' f q μ + snorm' g q μ :=
calc
(∫⁻ a, (‖(f + g) a‖₊ : ℝ≥0∞) ^ q ∂μ) ^ (1 / q) ≤
(∫⁻ a, ((fun a => (‖f a‖₊ : ℝ≥0∞)) + fun a => (‖g a‖₊ : ℝ≥0∞)) a ^ q ∂μ) ^ (1 / q) := by
gcongr with a
simp only [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe, nnnorm_add_le]
_ ≤ snorm' f q μ + snorm' g q μ := ENNReal.lintegral_Lp_add_le hf.ennnorm hg.ennnorm hq1
#align measure_theory.snorm'_add_le MeasureTheory.snorm'_add_le
theorem snorm'_add_le_of_le_one {f g : α → E} (hf : AEStronglyMeasurable f μ) (hq0 : 0 ≤ q)
(hq1 : q ≤ 1) : snorm' (f + g) q μ ≤ (2 : ℝ≥0∞) ^ (1 / q - 1) * (snorm' f q μ + snorm' g q μ) :=
calc
(∫⁻ a, (‖(f + g) a‖₊ : ℝ≥0∞) ^ q ∂μ) ^ (1 / q) ≤
(∫⁻ a, ((fun a => (‖f a‖₊ : ℝ≥0∞)) + fun a => (‖g a‖₊ : ℝ≥0∞)) a ^ q ∂μ) ^ (1 / q) := by
gcongr with a
simp only [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe, nnnorm_add_le]
_ ≤ (2 : ℝ≥0∞) ^ (1 / q - 1) * (snorm' f q μ + snorm' g q μ) :=
ENNReal.lintegral_Lp_add_le_of_le_one hf.ennnorm hq0 hq1
#align measure_theory.snorm'_add_le_of_le_one MeasureTheory.snorm'_add_le_of_le_one
theorem snormEssSup_add_le {f g : α → E} :
snormEssSup (f + g) μ ≤ snormEssSup f μ + snormEssSup g μ := by
refine le_trans (essSup_mono_ae (eventually_of_forall fun x => ?_)) (ENNReal.essSup_add_le _ _)
simp_rw [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe]
exact nnnorm_add_le _ _
#align measure_theory.snorm_ess_sup_add_le MeasureTheory.snormEssSup_add_le
theorem snorm_add_le {f g : α → E} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ)
(hp1 : 1 ≤ p) : snorm (f + g) p μ ≤ snorm f p μ + snorm g p μ := by
by_cases hp0 : p = 0
· simp [hp0]
by_cases hp_top : p = ∞
· simp [hp_top, snormEssSup_add_le]
have hp1_real : 1 ≤ p.toReal := by
rwa [← ENNReal.one_toReal, ENNReal.toReal_le_toReal ENNReal.one_ne_top hp_top]
repeat rw [snorm_eq_snorm' hp0 hp_top]
exact snorm'_add_le hf hg hp1_real
#align measure_theory.snorm_add_le MeasureTheory.snorm_add_le
noncomputable def LpAddConst (p : ℝ≥0∞) : ℝ≥0∞ :=
if p ∈ Set.Ioo (0 : ℝ≥0∞) 1 then (2 : ℝ≥0∞) ^ (1 / p.toReal - 1) else 1
set_option linter.uppercaseLean3 false in
#align measure_theory.Lp_add_const MeasureTheory.LpAddConst
theorem LpAddConst_of_one_le {p : ℝ≥0∞} (hp : 1 ≤ p) : LpAddConst p = 1 := by
rw [LpAddConst, if_neg]
intro h
exact lt_irrefl _ (h.2.trans_le hp)
set_option linter.uppercaseLean3 false in
#align measure_theory.Lp_add_const_of_one_le MeasureTheory.LpAddConst_of_one_le
| Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean | 80 | 83 | theorem LpAddConst_zero : LpAddConst 0 = 1 := by |
rw [LpAddConst, if_neg]
intro h
exact lt_irrefl _ h.1
|
import Mathlib.Data.Finset.Lattice
import Mathlib.Data.Set.Sigma
#align_import data.finset.sigma from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Multiset
variable {ι : Type*}
namespace Finset
section Sigma
variable {α : ι → Type*} {β : Type*} (s s₁ s₂ : Finset ι) (t t₁ t₂ : ∀ i, Finset (α i))
protected def sigma : Finset (Σi, α i) :=
⟨_, s.nodup.sigma fun i => (t i).nodup⟩
#align finset.sigma Finset.sigma
variable {s s₁ s₂ t t₁ t₂}
@[simp]
theorem mem_sigma {a : Σi, α i} : a ∈ s.sigma t ↔ a.1 ∈ s ∧ a.2 ∈ t a.1 :=
Multiset.mem_sigma
#align finset.mem_sigma Finset.mem_sigma
@[simp, norm_cast]
theorem coe_sigma (s : Finset ι) (t : ∀ i, Finset (α i)) :
(s.sigma t : Set (Σ i, α i)) = (s : Set ι).sigma fun i ↦ (t i : Set (α i)) :=
Set.ext fun _ => mem_sigma
#align finset.coe_sigma Finset.coe_sigma
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem sigma_nonempty : (s.sigma t).Nonempty ↔ ∃ i ∈ s, (t i).Nonempty := by simp [Finset.Nonempty]
#align finset.sigma_nonempty Finset.sigma_nonempty
@[simp]
| Mathlib/Data/Finset/Sigma.lean | 64 | 65 | theorem sigma_eq_empty : s.sigma t = ∅ ↔ ∀ i ∈ s, t i = ∅ := by |
simp only [← not_nonempty_iff_eq_empty, sigma_nonempty, not_exists, not_and]
|
import Mathlib.Algebra.Order.Pointwise
import Mathlib.Analysis.NormedSpace.SphereNormEquiv
import Mathlib.Analysis.SpecialFunctions.Integrals
import Mathlib.MeasureTheory.Constructions.Prod.Integral
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
open Set Function Metric MeasurableSpace intervalIntegral
open scoped Pointwise ENNReal NNReal
local notation "dim" => FiniteDimensional.finrank ℝ
noncomputable section
namespace MeasureTheory
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
[MeasurableSpace E] [BorelSpace E]
namespace Measure
def toSphere (μ : Measure E) : Measure (sphere (0 : E) 1) :=
dim E • ((μ.comap (Subtype.val ∘ (homeomorphUnitSphereProd E).symm)).restrict
(univ ×ˢ Iio ⟨1, mem_Ioi.2 one_pos⟩)).fst
variable (μ : Measure E)
theorem toSphere_apply_aux (s : Set (sphere (0 : E) 1)) (r : Ioi (0 : ℝ)) :
μ ((↑) '' (homeomorphUnitSphereProd E ⁻¹' s ×ˢ Iio r)) = μ (Ioo (0 : ℝ) r • ((↑) '' s)) := by
rw [← image2_smul, image2_image_right, ← Homeomorph.image_symm, image_image,
← image_subtype_val_Ioi_Iio, image2_image_left, image2_swap, ← image_prod]
rfl
theorem toSphere_apply' {s : Set (sphere (0 : E) 1)} (hs : MeasurableSet s) :
μ.toSphere s = dim E * μ (Ioo (0 : ℝ) 1 • ((↑) '' s)) := by
rw [toSphere, smul_apply, fst_apply hs, restrict_apply (measurable_fst hs),
((MeasurableEmbedding.subtype_coe (measurableSet_singleton _).compl).comp
(Homeomorph.measurableEmbedding _)).comap_apply,
image_comp, Homeomorph.image_symm, univ_prod, ← Set.prod_eq, nsmul_eq_mul, toSphere_apply_aux]
theorem toSphere_apply_univ' : μ.toSphere univ = dim E * μ (ball 0 1 \ {0}) := by
rw [μ.toSphere_apply' .univ, image_univ, Subtype.range_coe, Ioo_smul_sphere_zero] <;> simp
variable [μ.IsAddHaarMeasure]
@[simp]
| Mathlib/MeasureTheory/Constructions/HaarToSphere.lean | 68 | 70 | theorem toSphere_apply_univ : μ.toSphere univ = dim E * μ (ball 0 1) := by |
nontriviality E
rw [toSphere_apply_univ', measure_diff_null (measure_singleton _)]
|
import Mathlib.Data.Complex.Module
import Mathlib.RingTheory.Norm
import Mathlib.RingTheory.Trace
#align_import ring_theory.complex from "leanprover-community/mathlib"@"9015c511549dc77a0f8d6eba021d8ac4bba20c82"
open Complex
theorem Algebra.leftMulMatrix_complex (z : ℂ) :
Algebra.leftMulMatrix Complex.basisOneI z = !![z.re, -z.im; z.im, z.re] := by
ext i j
rw [Algebra.leftMulMatrix_eq_repr_mul, Complex.coe_basisOneI_repr, Complex.coe_basisOneI, mul_re,
mul_im, Matrix.of_apply]
fin_cases j
· simp only [Fin.mk_zero, Matrix.cons_val_zero, one_re, mul_one, one_im, mul_zero, sub_zero,
zero_add]
fin_cases i <;> rfl
· simp only [Fin.mk_one, Matrix.cons_val_one, Matrix.head_cons, I_re, mul_zero, I_im, mul_one,
zero_sub, add_zero]
fin_cases i <;> rfl
#align algebra.left_mul_matrix_complex Algebra.leftMulMatrix_complex
| Mathlib/RingTheory/Complex.lean | 31 | 34 | theorem Algebra.trace_complex_apply (z : ℂ) : Algebra.trace ℝ ℂ z = 2 * z.re := by |
rw [Algebra.trace_eq_matrix_trace Complex.basisOneI, Algebra.leftMulMatrix_complex,
Matrix.trace_fin_two]
exact (two_mul _).symm
|
import Mathlib.Algebra.BigOperators.Ring
import Mathlib.Combinatorics.SimpleGraph.Dart
import Mathlib.Combinatorics.SimpleGraph.Finite
import Mathlib.Data.ZMod.Parity
#align_import combinatorics.simple_graph.degree_sum from "leanprover-community/mathlib"@"90659cbe25e59ec302e2fb92b00e9732160cc620"
open Finset
namespace SimpleGraph
universe u
variable {V : Type u} (G : SimpleGraph V)
section DegreeSum
variable [Fintype V] [DecidableRel G.Adj]
-- Porting note: Changed to `Fintype (Sym2 V)` to match Combinatorics.SimpleGraph.Basic
variable [Fintype (Sym2 V)]
theorem dart_fst_fiber [DecidableEq V] (v : V) :
(univ.filter fun d : G.Dart => d.fst = v) = univ.image (G.dartOfNeighborSet v) := by
ext d
simp only [mem_image, true_and_iff, mem_filter, SetCoe.exists, mem_univ, exists_prop_of_true]
constructor
· rintro rfl
exact ⟨_, d.adj, by ext <;> rfl⟩
· rintro ⟨e, he, rfl⟩
rfl
#align simple_graph.dart_fst_fiber SimpleGraph.dart_fst_fiber
theorem dart_fst_fiber_card_eq_degree [DecidableEq V] (v : V) :
(univ.filter fun d : G.Dart => d.fst = v).card = G.degree v := by
simpa only [dart_fst_fiber, Finset.card_univ, card_neighborSet_eq_degree] using
card_image_of_injective univ (G.dartOfNeighborSet_injective v)
#align simple_graph.dart_fst_fiber_card_eq_degree SimpleGraph.dart_fst_fiber_card_eq_degree
theorem dart_card_eq_sum_degrees : Fintype.card G.Dart = ∑ v, G.degree v := by
haveI := Classical.decEq V
simp only [← card_univ, ← dart_fst_fiber_card_eq_degree]
exact card_eq_sum_card_fiberwise (by simp)
#align simple_graph.dart_card_eq_sum_degrees SimpleGraph.dart_card_eq_sum_degrees
variable {G}
theorem Dart.edge_fiber [DecidableEq V] (d : G.Dart) :
(univ.filter fun d' : G.Dart => d'.edge = d.edge) = {d, d.symm} :=
Finset.ext fun d' => by simpa using dart_edge_eq_iff d' d
#align simple_graph.dart.edge_fiber SimpleGraph.Dart.edge_fiber
variable (G)
theorem dart_edge_fiber_card [DecidableEq V] (e : Sym2 V) (h : e ∈ G.edgeSet) :
(univ.filter fun d : G.Dart => d.edge = e).card = 2 := by
refine Sym2.ind (fun v w h => ?_) e h
let d : G.Dart := ⟨(v, w), h⟩
convert congr_arg card d.edge_fiber
rw [card_insert_of_not_mem, card_singleton]
rw [mem_singleton]
exact d.symm_ne.symm
#align simple_graph.dart_edge_fiber_card SimpleGraph.dart_edge_fiber_card
| Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean | 98 | 106 | theorem dart_card_eq_twice_card_edges : Fintype.card G.Dart = 2 * G.edgeFinset.card := by |
classical
rw [← card_univ]
rw [@card_eq_sum_card_fiberwise _ _ _ Dart.edge _ G.edgeFinset fun d _h =>
by rw [mem_edgeFinset]; apply Dart.edge_mem]
rw [← mul_comm, sum_const_nat]
intro e h
apply G.dart_edge_fiber_card e
rwa [← mem_edgeFinset]
|
import Mathlib.Algebra.CharP.Basic
import Mathlib.RingTheory.Ideal.LocalRing
import Mathlib.Algebra.IsPrimePow
import Mathlib.Data.Nat.Factorization.Basic
#align_import algebra.char_p.local_ring from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
| Mathlib/Algebra/CharP/LocalRing.lean | 25 | 67 | theorem charP_zero_or_prime_power (R : Type*) [CommRing R] [LocalRing R] (q : ℕ)
[char_R_q : CharP R q] : q = 0 ∨ IsPrimePow q := by |
-- Assume `q := char(R)` is not zero.
apply or_iff_not_imp_left.2
intro q_pos
let K := LocalRing.ResidueField R
haveI RM_char := ringChar.charP K
let r := ringChar K
let n := q.factorization r
-- `r := char(R/m)` is either prime or zero:
cases' CharP.char_is_prime_or_zero K r with r_prime r_zero
· let a := q / r ^ n
-- If `r` is prime, we can write it as `r = a * q^n` ...
have q_eq_a_mul_rn : q = r ^ n * a := by rw [Nat.mul_div_cancel' (Nat.ord_proj_dvd q r)]
have r_ne_dvd_a := Nat.not_dvd_ord_compl r_prime q_pos
have rn_dvd_q : r ^ n ∣ q := ⟨a, q_eq_a_mul_rn⟩
rw [mul_comm] at q_eq_a_mul_rn
-- ... where `a` is a unit.
have a_unit : IsUnit (a : R) := by
by_contra g
rw [← mem_nonunits_iff] at g
rw [← LocalRing.mem_maximalIdeal] at g
have a_cast_zero := Ideal.Quotient.eq_zero_iff_mem.2 g
rw [map_natCast] at a_cast_zero
have r_dvd_a := (ringChar.spec K a).1 a_cast_zero
exact absurd r_dvd_a r_ne_dvd_a
-- Let `b` be the inverse of `a`.
cases' a_unit.exists_left_inv with a_inv h_inv_mul_a
have rn_cast_zero : ↑(r ^ n) = (0 : R) := by
rw [← @mul_one R _ ↑(r ^ n), mul_comm, ← Classical.choose_spec a_unit.exists_left_inv,
mul_assoc, ← Nat.cast_mul, ← q_eq_a_mul_rn, CharP.cast_eq_zero R q]
simp
have q_eq_rn := Nat.dvd_antisymm ((CharP.cast_eq_zero_iff R q (r ^ n)).mp rn_cast_zero) rn_dvd_q
have n_pos : n ≠ 0 := fun n_zero =>
absurd (by simpa [n_zero] using q_eq_rn) (CharP.char_ne_one R q)
-- Definition of prime power: `∃ r n, Prime r ∧ 0 < n ∧ r ^ n = q`.
exact ⟨r, ⟨n, ⟨r_prime.prime, ⟨pos_iff_ne_zero.mpr n_pos, q_eq_rn.symm⟩⟩⟩⟩
· haveI K_char_p_0 := ringChar.of_eq r_zero
haveI K_char_zero : CharZero K := CharP.charP_to_charZero K
haveI R_char_zero := RingHom.charZero (LocalRing.residue R)
-- Finally, `r = 0` would lead to a contradiction:
have q_zero := CharP.eq R char_R_q (CharP.ofCharZero R)
exact absurd q_zero q_pos
|
import Mathlib.Init.Order.Defs
#align_import init.algebra.functions from "leanprover-community/lean"@"c2bcdbcbe741ed37c361a30d38e179182b989f76"
universe u
section
open Decidable
variable {α : Type u} [LinearOrder α]
theorem min_def (a b : α) : min a b = if a ≤ b then a else b := by
rw [LinearOrder.min_def a]
#align min_def min_def
theorem max_def (a b : α) : max a b = if a ≤ b then b else a := by
rw [LinearOrder.max_def a]
#align max_def max_def
theorem min_le_left (a b : α) : min a b ≤ a := by
-- Porting note: no `min_tac` tactic
if h : a ≤ b
then simp [min_def, if_pos h, le_refl]
else simp [min_def, if_neg h]; exact le_of_not_le h
#align min_le_left min_le_left
theorem min_le_right (a b : α) : min a b ≤ b := by
-- Porting note: no `min_tac` tactic
if h : a ≤ b
then simp [min_def, if_pos h]; exact h
else simp [min_def, if_neg h, le_refl]
#align min_le_right min_le_right
theorem le_min {a b c : α} (h₁ : c ≤ a) (h₂ : c ≤ b) : c ≤ min a b := by
-- Porting note: no `min_tac` tactic
if h : a ≤ b
then simp [min_def, if_pos h]; exact h₁
else simp [min_def, if_neg h]; exact h₂
#align le_min le_min
theorem le_max_left (a b : α) : a ≤ max a b := by
-- Porting note: no `min_tac` tactic
if h : a ≤ b
then simp [max_def, if_pos h]; exact h
else simp [max_def, if_neg h, le_refl]
#align le_max_left le_max_left
theorem le_max_right (a b : α) : b ≤ max a b := by
-- Porting note: no `min_tac` tactic
if h : a ≤ b
then simp [max_def, if_pos h, le_refl]
else simp [max_def, if_neg h]; exact le_of_not_le h
#align le_max_right le_max_right
theorem max_le {a b c : α} (h₁ : a ≤ c) (h₂ : b ≤ c) : max a b ≤ c := by
-- Porting note: no `min_tac` tactic
if h : a ≤ b
then simp [max_def, if_pos h]; exact h₂
else simp [max_def, if_neg h]; exact h₁
#align max_le max_le
theorem eq_min {a b c : α} (h₁ : c ≤ a) (h₂ : c ≤ b) (h₃ : ∀ {d}, d ≤ a → d ≤ b → d ≤ c) :
c = min a b :=
le_antisymm (le_min h₁ h₂) (h₃ (min_le_left a b) (min_le_right a b))
#align eq_min eq_min
theorem min_comm (a b : α) : min a b = min b a :=
eq_min (min_le_right a b) (min_le_left a b) fun h₁ h₂ => le_min h₂ h₁
#align min_comm min_comm
| Mathlib/Init/Order/LinearOrder.lean | 84 | 89 | theorem min_assoc (a b c : α) : min (min a b) c = min a (min b c) := by |
apply eq_min
· apply le_trans; apply min_le_left; apply min_le_left
· apply le_min; apply le_trans; apply min_le_left; apply min_le_right; apply min_le_right
· intro d h₁ h₂; apply le_min; apply le_min h₁; apply le_trans h₂; apply min_le_left
apply le_trans h₂; apply min_le_right
|
import Mathlib.Topology.VectorBundle.Basic
#align_import topology.vector_bundle.hom from "leanprover-community/mathlib"@"8905e5ed90859939681a725b00f6063e65096d95"
noncomputable section
open scoped Bundle
open Bundle Set ContinuousLinearMap
variable {𝕜₁ : Type*} [NontriviallyNormedField 𝕜₁] {𝕜₂ : Type*} [NontriviallyNormedField 𝕜₂]
(σ : 𝕜₁ →+* 𝕜₂) [iσ : RingHomIsometric σ]
variable {B : Type*}
variable {F₁ : Type*} [NormedAddCommGroup F₁] [NormedSpace 𝕜₁ F₁] (E₁ : B → Type*)
[∀ x, AddCommGroup (E₁ x)] [∀ x, Module 𝕜₁ (E₁ x)] [TopologicalSpace (TotalSpace F₁ E₁)]
variable {F₂ : Type*} [NormedAddCommGroup F₂] [NormedSpace 𝕜₂ F₂] (E₂ : B → Type*)
[∀ x, AddCommGroup (E₂ x)] [∀ x, Module 𝕜₂ (E₂ x)] [TopologicalSpace (TotalSpace F₂ E₂)]
protected abbrev Bundle.ContinuousLinearMap [∀ x, TopologicalSpace (E₁ x)]
[∀ x, TopologicalSpace (E₂ x)] : B → Type _ := fun x => E₁ x →SL[σ] E₂ x
#align bundle.continuous_linear_map Bundle.ContinuousLinearMap
-- Porting note: possibly remove after the port
instance Bundle.ContinuousLinearMap.module [∀ x, TopologicalSpace (E₁ x)]
[∀ x, TopologicalSpace (E₂ x)] [∀ x, TopologicalAddGroup (E₂ x)]
[∀ x, ContinuousConstSMul 𝕜₂ (E₂ x)] : ∀ x, Module 𝕜₂ (Bundle.ContinuousLinearMap σ E₁ E₂ x) :=
fun _ => inferInstance
#align bundle.continuous_linear_map.module Bundle.ContinuousLinearMap.module
variable {E₁ E₂}
variable [TopologicalSpace B] (e₁ e₁' : Trivialization F₁ (π F₁ E₁))
(e₂ e₂' : Trivialization F₂ (π F₂ E₂))
namespace Pretrivialization
def continuousLinearMapCoordChange [e₁.IsLinear 𝕜₁] [e₁'.IsLinear 𝕜₁] [e₂.IsLinear 𝕜₂]
[e₂'.IsLinear 𝕜₂] (b : B) : (F₁ →SL[σ] F₂) →L[𝕜₂] F₁ →SL[σ] F₂ :=
((e₁'.coordChangeL 𝕜₁ e₁ b).symm.arrowCongrSL (e₂.coordChangeL 𝕜₂ e₂' b) :
(F₁ →SL[σ] F₂) ≃L[𝕜₂] F₁ →SL[σ] F₂)
#align pretrivialization.continuous_linear_map_coord_change Pretrivialization.continuousLinearMapCoordChange
variable {σ e₁ e₁' e₂ e₂'}
variable [∀ x, TopologicalSpace (E₁ x)] [FiberBundle F₁ E₁]
variable [∀ x, TopologicalSpace (E₂ x)] [ita : ∀ x, TopologicalAddGroup (E₂ x)] [FiberBundle F₂ E₂]
| Mathlib/Topology/VectorBundle/Hom.lean | 92 | 112 | theorem continuousOn_continuousLinearMapCoordChange [VectorBundle 𝕜₁ F₁ E₁] [VectorBundle 𝕜₂ F₂ E₂]
[MemTrivializationAtlas e₁] [MemTrivializationAtlas e₁'] [MemTrivializationAtlas e₂]
[MemTrivializationAtlas e₂'] :
ContinuousOn (continuousLinearMapCoordChange σ e₁ e₁' e₂ e₂')
(e₁.baseSet ∩ e₂.baseSet ∩ (e₁'.baseSet ∩ e₂'.baseSet)) := by |
have h₁ := (compSL F₁ F₂ F₂ σ (RingHom.id 𝕜₂)).continuous
have h₂ := (ContinuousLinearMap.flip (compSL F₁ F₁ F₂ (RingHom.id 𝕜₁) σ)).continuous
have h₃ := continuousOn_coordChange 𝕜₁ e₁' e₁
have h₄ := continuousOn_coordChange 𝕜₂ e₂ e₂'
refine ((h₁.comp_continuousOn (h₄.mono ?_)).clm_comp (h₂.comp_continuousOn (h₃.mono ?_))).congr ?_
· mfld_set_tac
· mfld_set_tac
· intro b _; ext L v
-- Porting note: was
-- simp only [continuousLinearMapCoordChange, ContinuousLinearEquiv.coe_coe,
-- ContinuousLinearEquiv.arrowCongrₛₗ_apply, LinearEquiv.toFun_eq_coe, coe_comp',
-- ContinuousLinearEquiv.arrowCongrSL_apply, comp_apply, Function.comp, compSL_apply,
-- flip_apply, ContinuousLinearEquiv.symm_symm]
-- Now `simp` fails to use `ContinuousLinearMap.comp_apply` in this case
dsimp [continuousLinearMapCoordChange]
rw [ContinuousLinearEquiv.symm_symm]
|
import Mathlib.Algebra.Group.Defs
#align_import algebra.invertible from "leanprover-community/mathlib"@"722b3b152ddd5e0cf21c0a29787c76596cb6b422"
assert_not_exists MonoidWithZero
assert_not_exists DenselyOrdered
universe u
variable {α : Type u}
class Invertible [Mul α] [One α] (a : α) : Type u where
invOf : α
invOf_mul_self : invOf * a = 1
mul_invOf_self : a * invOf = 1
#align invertible Invertible
prefix:max
"⅟" =>-- This notation has the same precedence as `Inv.inv`.
Invertible.invOf
@[simp]
theorem invOf_mul_self' [Mul α] [One α] (a : α) {_ : Invertible a} : ⅟ a * a = 1 :=
Invertible.invOf_mul_self
theorem invOf_mul_self [Mul α] [One α] (a : α) [Invertible a] : ⅟ a * a = 1 :=
Invertible.invOf_mul_self
#align inv_of_mul_self invOf_mul_self
@[simp]
theorem mul_invOf_self' [Mul α] [One α] (a : α) {_ : Invertible a} : a * ⅟ a = 1 :=
Invertible.mul_invOf_self
theorem mul_invOf_self [Mul α] [One α] (a : α) [Invertible a] : a * ⅟ a = 1 :=
Invertible.mul_invOf_self
#align mul_inv_of_self mul_invOf_self
@[simp]
theorem invOf_mul_self_assoc' [Monoid α] (a b : α) {_ : Invertible a} : ⅟ a * (a * b) = b := by
rw [← mul_assoc, invOf_mul_self, one_mul]
| Mathlib/Algebra/Group/Invertible/Defs.lean | 120 | 121 | theorem invOf_mul_self_assoc [Monoid α] (a b : α) [Invertible a] : ⅟ a * (a * b) = b := by |
rw [← mul_assoc, invOf_mul_self, one_mul]
|
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ι α β γ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero α] [NormalizedGCDMonoid α]
section lcm
def lcm (s : Finset β) (f : β → α) : α :=
s.fold GCDMonoid.lcm 1 f
#align finset.lcm Finset.lcm
variable {s s₁ s₂ : Finset β} {f : β → α}
theorem lcm_def : s.lcm f = (s.1.map f).lcm :=
rfl
#align finset.lcm_def Finset.lcm_def
@[simp]
theorem lcm_empty : (∅ : Finset β).lcm f = 1 :=
fold_empty
#align finset.lcm_empty Finset.lcm_empty
@[simp]
| Mathlib/Algebra/GCDMonoid/Finset.lean | 62 | 65 | theorem lcm_dvd_iff {a : α} : s.lcm f ∣ a ↔ ∀ b ∈ s, f b ∣ a := by |
apply Iff.trans Multiset.lcm_dvd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact ⟨fun k b hb ↦ k _ _ hb rfl, fun k a' b hb h ↦ h ▸ k _ hb⟩
|
import Mathlib.FieldTheory.SeparableClosure
import Mathlib.Algebra.CharP.IntermediateField
open FiniteDimensional Polynomial IntermediateField Field
noncomputable section
universe u v w
variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E]
variable (K : Type w) [Field K] [Algebra F K]
section perfectClosure
def perfectClosure : IntermediateField F E where
carrier := {x : E | ∃ n : ℕ, x ^ (ringExpChar F) ^ n ∈ (algebraMap F E).range}
add_mem' := by
rintro x y ⟨n, hx⟩ ⟨m, hy⟩
use n + m
have := expChar_of_injective_algebraMap (algebraMap F E).injective (ringExpChar F)
rw [add_pow_expChar_pow, pow_add, pow_mul, mul_comm (_ ^ n), pow_mul]
exact add_mem (pow_mem hx _) (pow_mem hy _)
mul_mem' := by
rintro x y ⟨n, hx⟩ ⟨m, hy⟩
use n + m
rw [mul_pow, pow_add, pow_mul, mul_comm (_ ^ n), pow_mul]
exact mul_mem (pow_mem hx _) (pow_mem hy _)
inv_mem' := by
rintro x ⟨n, hx⟩
use n; rw [inv_pow]
apply inv_mem (id hx : _ ∈ (⊥ : IntermediateField F E))
algebraMap_mem' := fun x ↦ ⟨0, by rw [pow_zero, pow_one]; exact ⟨x, rfl⟩⟩
variable {F E}
theorem mem_perfectClosure_iff {x : E} :
x ∈ perfectClosure F E ↔ ∃ n : ℕ, x ^ (ringExpChar F) ^ n ∈ (algebraMap F E).range := Iff.rfl
| Mathlib/FieldTheory/PurelyInseparable.lean | 281 | 283 | theorem mem_perfectClosure_iff_pow_mem (q : ℕ) [ExpChar F q] {x : E} :
x ∈ perfectClosure F E ↔ ∃ n : ℕ, x ^ q ^ n ∈ (algebraMap F E).range := by |
rw [mem_perfectClosure_iff, ringExpChar.eq F q]
|
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Tactic.Nontriviality
#align_import algebra.group_with_zero.commute from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
#align_import algebra.group_with_zero.power from "leanprover-community/mathlib"@"46a64b5b4268c594af770c44d9e502afc6a515cb"
assert_not_exists DenselyOrdered
variable {α M₀ G₀ M₀' G₀' F F' : Type*}
variable [MonoidWithZero M₀]
namespace Ring
open scoped Classical
| Mathlib/Algebra/GroupWithZero/Commute.lean | 27 | 34 | theorem mul_inverse_rev' {a b : M₀} (h : Commute a b) :
inverse (a * b) = inverse b * inverse a := by |
by_cases hab : IsUnit (a * b)
· obtain ⟨⟨a, rfl⟩, b, rfl⟩ := h.isUnit_mul_iff.mp hab
rw [← Units.val_mul, inverse_unit, inverse_unit, inverse_unit, ← Units.val_mul, mul_inv_rev]
obtain ha | hb := not_and_or.mp (mt h.isUnit_mul_iff.mpr hab)
· rw [inverse_non_unit _ hab, inverse_non_unit _ ha, mul_zero]
· rw [inverse_non_unit _ hab, inverse_non_unit _ hb, zero_mul]
|
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.UniqueFactorizationDomain
#align_import ring_theory.localization.num_denom from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86"
variable {R : Type*} [CommRing R] (M : Submonoid R) {S : Type*} [CommRing S]
variable [Algebra R S] {P : Type*} [CommRing P]
namespace IsFractionRing
open IsLocalization
section NumDen
variable (A : Type*) [CommRing A] [IsDomain A] [UniqueFactorizationMonoid A]
variable {K : Type*} [Field K] [Algebra A K] [IsFractionRing A K]
theorem exists_reduced_fraction (x : K) :
∃ (a : A) (b : nonZeroDivisors A), IsRelPrime a b ∧ mk' K a b = x := by
obtain ⟨⟨b, b_nonzero⟩, a, hab⟩ := exists_integer_multiple (nonZeroDivisors A) x
obtain ⟨a', b', c', no_factor, rfl, rfl⟩ :=
UniqueFactorizationMonoid.exists_reduced_factors' a b
(mem_nonZeroDivisors_iff_ne_zero.mp b_nonzero)
obtain ⟨_, b'_nonzero⟩ := mul_mem_nonZeroDivisors.mp b_nonzero
refine ⟨a', ⟨b', b'_nonzero⟩, no_factor, ?_⟩
refine mul_left_cancel₀ (IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors b_nonzero) ?_
simp only [Subtype.coe_mk, RingHom.map_mul, Algebra.smul_def] at *
erw [← hab, mul_assoc, mk'_spec' _ a' ⟨b', b'_nonzero⟩]
#align is_fraction_ring.exists_reduced_fraction IsFractionRing.exists_reduced_fraction
noncomputable def num (x : K) : A :=
Classical.choose (exists_reduced_fraction A x)
#align is_fraction_ring.num IsFractionRing.num
noncomputable def den (x : K) : nonZeroDivisors A :=
Classical.choose (Classical.choose_spec (exists_reduced_fraction A x))
#align is_fraction_ring.denom IsFractionRing.den
theorem num_den_reduced (x : K) : IsRelPrime (num A x) (den A x) :=
(Classical.choose_spec (Classical.choose_spec (exists_reduced_fraction A x))).1
#align is_fraction_ring.num_denom_reduced IsFractionRing.num_den_reduced
-- @[simp] -- Porting note: LHS reduces to give the simp lemma below
theorem mk'_num_den (x : K) : mk' K (num A x) (den A x) = x :=
(Classical.choose_spec (Classical.choose_spec (exists_reduced_fraction A x))).2
#align is_fraction_ring.mk'_num_denom IsFractionRing.mk'_num_den
@[simp]
| Mathlib/RingTheory/Localization/NumDen.lean | 70 | 72 | theorem mk'_num_den' (x : K) : algebraMap A K (num A x) / algebraMap A K (den A x) = x := by |
rw [← mk'_eq_div]
apply mk'_num_den
|
import Mathlib.Algebra.Module.LinearMap.Basic
import Mathlib.LinearAlgebra.Basic
import Mathlib.LinearAlgebra.Basis
import Mathlib.LinearAlgebra.BilinearMap
#align_import linear_algebra.sesquilinear_form from "leanprover-community/mathlib"@"87c54600fe3cdc7d32ff5b50873ac724d86aef8d"
variable {R R₁ R₂ R₃ M M₁ M₂ M₃ Mₗ₁ Mₗ₁' Mₗ₂ Mₗ₂' K K₁ K₂ V V₁ V₂ n : Type*}
namespace LinearMap
section Reflexive
variable [CommSemiring R] [AddCommMonoid M] [Module R M] [CommSemiring R₁] [AddCommMonoid M₁]
[Module R₁ M₁] {I₁ : R₁ →+* R} {I₂ : R₁ →+* R} {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}
def IsRefl (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M) : Prop :=
∀ x y, B x y = 0 → B y x = 0
#align linear_map.is_refl LinearMap.IsRefl
section Symmetric
variable [CommSemiring R] [AddCommMonoid M] [Module R M] {I : R →+* R} {B : M →ₛₗ[I] M →ₗ[R] R}
def IsSymm (B : M →ₛₗ[I] M →ₗ[R] R) : Prop :=
∀ x y, I (B x y) = B y x
#align linear_map.is_symm LinearMap.IsSymm
@[simp]
theorem isSymm_zero : (0 : M →ₛₗ[I] M →ₗ[R] R).IsSymm := fun _ _ => map_zero _
| Mathlib/LinearAlgebra/SesquilinearForm.lean | 246 | 252 | theorem isSymm_iff_eq_flip {B : LinearMap.BilinForm R M} : B.IsSymm ↔ B = B.flip := by |
constructor <;> intro h
· ext
rw [← h, flip_apply, RingHom.id_apply]
intro x y
conv_lhs => rw [h]
rfl
|
import Mathlib.Data.List.Nodup
import Mathlib.Data.List.Zip
import Mathlib.Data.Nat.Defs
import Mathlib.Data.List.Infix
#align_import data.list.rotate from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u
variable {α : Type u}
open Nat Function
namespace List
theorem rotate_mod (l : List α) (n : ℕ) : l.rotate (n % l.length) = l.rotate n := by simp [rotate]
#align list.rotate_mod List.rotate_mod
@[simp]
theorem rotate_nil (n : ℕ) : ([] : List α).rotate n = [] := by simp [rotate]
#align list.rotate_nil List.rotate_nil
@[simp]
theorem rotate_zero (l : List α) : l.rotate 0 = l := by simp [rotate]
#align list.rotate_zero List.rotate_zero
-- Porting note: removing simp, simp can prove it
theorem rotate'_nil (n : ℕ) : ([] : List α).rotate' n = [] := by cases n <;> rfl
#align list.rotate'_nil List.rotate'_nil
@[simp]
theorem rotate'_zero (l : List α) : l.rotate' 0 = l := by cases l <;> rfl
#align list.rotate'_zero List.rotate'_zero
theorem rotate'_cons_succ (l : List α) (a : α) (n : ℕ) :
(a :: l : List α).rotate' n.succ = (l ++ [a]).rotate' n := by simp [rotate']
#align list.rotate'_cons_succ List.rotate'_cons_succ
@[simp]
theorem length_rotate' : ∀ (l : List α) (n : ℕ), (l.rotate' n).length = l.length
| [], _ => by simp
| a :: l, 0 => rfl
| a :: l, n + 1 => by rw [List.rotate', length_rotate' (l ++ [a]) n]; simp
#align list.length_rotate' List.length_rotate'
theorem rotate'_eq_drop_append_take :
∀ {l : List α} {n : ℕ}, n ≤ l.length → l.rotate' n = l.drop n ++ l.take n
| [], n, h => by simp [drop_append_of_le_length h]
| l, 0, h => by simp [take_append_of_le_length h]
| a :: l, n + 1, h => by
have hnl : n ≤ l.length := le_of_succ_le_succ h
have hnl' : n ≤ (l ++ [a]).length := by
rw [length_append, length_cons, List.length]; exact le_of_succ_le h
rw [rotate'_cons_succ, rotate'_eq_drop_append_take hnl', drop, take,
drop_append_of_le_length hnl, take_append_of_le_length hnl]; simp
#align list.rotate'_eq_drop_append_take List.rotate'_eq_drop_append_take
theorem rotate'_rotate' : ∀ (l : List α) (n m : ℕ), (l.rotate' n).rotate' m = l.rotate' (n + m)
| a :: l, 0, m => by simp
| [], n, m => by simp
| a :: l, n + 1, m => by
rw [rotate'_cons_succ, rotate'_rotate' _ n, Nat.add_right_comm, ← rotate'_cons_succ,
Nat.succ_eq_add_one]
#align list.rotate'_rotate' List.rotate'_rotate'
@[simp]
| Mathlib/Data/List/Rotate.lean | 88 | 89 | theorem rotate'_length (l : List α) : rotate' l l.length = l := by |
rw [rotate'_eq_drop_append_take le_rfl]; simp
|
import Mathlib.Data.Nat.Count
import Mathlib.Data.Nat.SuccPred
import Mathlib.Order.Interval.Set.Monotone
import Mathlib.Order.OrderIsoNat
#align_import data.nat.nth from "leanprover-community/mathlib"@"7fdd4f3746cb059edfdb5d52cba98f66fce418c0"
open Finset
namespace Nat
variable (p : ℕ → Prop)
noncomputable def nth (p : ℕ → Prop) (n : ℕ) : ℕ := by
classical exact
if h : Set.Finite (setOf p) then (h.toFinset.sort (· ≤ ·)).getD n 0
else @Nat.Subtype.orderIsoOfNat (setOf p) (Set.Infinite.to_subtype h) n
#align nat.nth Nat.nth
variable {p}
| Mathlib/Data/Nat/Nth.lean | 62 | 63 | theorem nth_of_card_le (hf : (setOf p).Finite) {n : ℕ} (hn : hf.toFinset.card ≤ n) :
nth p n = 0 := by | rw [nth, dif_pos hf, List.getD_eq_default]; rwa [Finset.length_sort]
|
import Mathlib.Algebra.Order.Group.Abs
import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax
#align_import algebra.order.group.min_max from "leanprover-community/mathlib"@"10b4e499f43088dd3bb7b5796184ad5216648ab1"
section
variable {α : Type*} [Group α] [LinearOrder α] [CovariantClass α α (· * ·) (· ≤ ·)]
-- TODO: This duplicates `oneLePart_div_leOnePart`
@[to_additive (attr := simp)]
theorem max_one_div_max_inv_one_eq_self (a : α) : max a 1 / max a⁻¹ 1 = a := by
rcases le_total a 1 with (h | h) <;> simp [h]
#align max_one_div_max_inv_one_eq_self max_one_div_max_inv_one_eq_self
#align max_zero_sub_max_neg_zero_eq_self max_zero_sub_max_neg_zero_eq_self
alias max_zero_sub_eq_self := max_zero_sub_max_neg_zero_eq_self
#align max_zero_sub_eq_self max_zero_sub_eq_self
@[to_additive]
lemma max_inv_one (a : α) : max a⁻¹ 1 = a⁻¹ * max a 1 := by
rw [eq_inv_mul_iff_mul_eq, ← eq_div_iff_mul_eq', max_one_div_max_inv_one_eq_self]
end
section LinearOrderedCommGroup
variable {α : Type*} [LinearOrderedCommGroup α] {a b c : α}
@[to_additive min_neg_neg]
theorem min_inv_inv' (a b : α) : min a⁻¹ b⁻¹ = (max a b)⁻¹ :=
Eq.symm <| (@Monotone.map_max α αᵒᵈ _ _ Inv.inv a b) fun _ _ =>
-- Porting note: Explicit `α` necessary to infer `CovariantClass` instance
(@inv_le_inv_iff α _ _ _).mpr
#align min_inv_inv' min_inv_inv'
#align min_neg_neg min_neg_neg
@[to_additive max_neg_neg]
theorem max_inv_inv' (a b : α) : max a⁻¹ b⁻¹ = (min a b)⁻¹ :=
Eq.symm <| (@Monotone.map_min α αᵒᵈ _ _ Inv.inv a b) fun _ _ =>
-- Porting note: Explicit `α` necessary to infer `CovariantClass` instance
(@inv_le_inv_iff α _ _ _).mpr
#align max_inv_inv' max_inv_inv'
#align max_neg_neg max_neg_neg
@[to_additive min_sub_sub_right]
theorem min_div_div_right' (a b c : α) : min (a / c) (b / c) = min a b / c := by
simpa only [div_eq_mul_inv] using min_mul_mul_right a b c⁻¹
#align min_div_div_right' min_div_div_right'
#align min_sub_sub_right min_sub_sub_right
@[to_additive max_sub_sub_right]
| Mathlib/Algebra/Order/Group/MinMax.lean | 63 | 64 | theorem max_div_div_right' (a b c : α) : max (a / c) (b / c) = max a b / c := by |
simpa only [div_eq_mul_inv] using max_mul_mul_right a b c⁻¹
|
import Mathlib.Algebra.Module.Submodule.Map
#align_import linear_algebra.basic from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
open Function
open Pointwise
variable {R : Type*} {R₁ : Type*} {R₂ : Type*} {R₃ : Type*}
variable {K : Type*}
variable {M : Type*} {M₁ : Type*} {M₂ : Type*} {M₃ : Type*}
variable {V : Type*} {V₂ : Type*}
namespace LinearMap
section AddCommMonoid
variable [Semiring R] [Semiring R₂] [Semiring R₃]
variable [AddCommMonoid M] [AddCommMonoid M₂] [AddCommMonoid M₃]
variable {σ₁₂ : R →+* R₂} {σ₂₃ : R₂ →+* R₃} {σ₁₃ : R →+* R₃}
variable [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
variable [Module R M] [Module R₂ M₂] [Module R₃ M₃]
open Submodule
variable {σ₂₁ : R₂ →+* R} {τ₁₂ : R →+* R₂} {τ₂₃ : R₂ →+* R₃} {τ₁₃ : R →+* R₃}
variable [RingHomCompTriple τ₁₂ τ₂₃ τ₁₃]
variable {F : Type*} [FunLike F M M₂] [SemilinearMapClass F τ₁₂ M M₂]
def ker (f : F) : Submodule R M :=
comap f ⊥
#align linear_map.ker LinearMap.ker
@[simp]
theorem mem_ker {f : F} {y} : y ∈ ker f ↔ f y = 0 :=
mem_bot R₂
#align linear_map.mem_ker LinearMap.mem_ker
@[simp]
theorem ker_id : ker (LinearMap.id : M →ₗ[R] M) = ⊥ :=
rfl
#align linear_map.ker_id LinearMap.ker_id
@[simp]
theorem map_coe_ker (f : F) (x : ker f) : f x = 0 :=
mem_ker.1 x.2
#align linear_map.map_coe_ker LinearMap.map_coe_ker
theorem ker_toAddSubmonoid (f : M →ₛₗ[τ₁₂] M₂) : f.ker.toAddSubmonoid = (AddMonoidHom.mker f) :=
rfl
#align linear_map.ker_to_add_submonoid LinearMap.ker_toAddSubmonoid
theorem comp_ker_subtype (f : M →ₛₗ[τ₁₂] M₂) : f.comp f.ker.subtype = 0 :=
LinearMap.ext fun x => mem_ker.1 x.2
#align linear_map.comp_ker_subtype LinearMap.comp_ker_subtype
theorem ker_comp (f : M →ₛₗ[τ₁₂] M₂) (g : M₂ →ₛₗ[τ₂₃] M₃) :
ker (g.comp f : M →ₛₗ[τ₁₃] M₃) = comap f (ker g) :=
rfl
#align linear_map.ker_comp LinearMap.ker_comp
theorem ker_le_ker_comp (f : M →ₛₗ[τ₁₂] M₂) (g : M₂ →ₛₗ[τ₂₃] M₃) :
ker f ≤ ker (g.comp f : M →ₛₗ[τ₁₃] M₃) := by rw [ker_comp]; exact comap_mono bot_le
#align linear_map.ker_le_ker_comp LinearMap.ker_le_ker_comp
| Mathlib/Algebra/Module/Submodule/Ker.lean | 96 | 100 | theorem ker_sup_ker_le_ker_comp_of_commute {f g : M →ₗ[R] M} (h : Commute f g) :
ker f ⊔ ker g ≤ ker (f ∘ₗ g) := by |
refine sup_le_iff.mpr ⟨?_, ker_le_ker_comp g f⟩
rw [← mul_eq_comp, h.eq, mul_eq_comp]
exact ker_le_ker_comp f g
|
import Mathlib.Analysis.NormedSpace.AddTorsorBases
#align_import analysis.convex.intrinsic from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
open AffineSubspace Set
open scoped Pointwise
variable {𝕜 V W Q P : Type*}
section AddTorsor
variable (𝕜) [Ring 𝕜] [AddCommGroup V] [Module 𝕜 V] [TopologicalSpace P] [AddTorsor V P]
{s t : Set P} {x : P}
def intrinsicInterior (s : Set P) : Set P :=
(↑) '' interior ((↑) ⁻¹' s : Set <| affineSpan 𝕜 s)
#align intrinsic_interior intrinsicInterior
def intrinsicFrontier (s : Set P) : Set P :=
(↑) '' frontier ((↑) ⁻¹' s : Set <| affineSpan 𝕜 s)
#align intrinsic_frontier intrinsicFrontier
def intrinsicClosure (s : Set P) : Set P :=
(↑) '' closure ((↑) ⁻¹' s : Set <| affineSpan 𝕜 s)
#align intrinsic_closure intrinsicClosure
variable {𝕜}
@[simp]
theorem mem_intrinsicInterior :
x ∈ intrinsicInterior 𝕜 s ↔ ∃ y, y ∈ interior ((↑) ⁻¹' s : Set <| affineSpan 𝕜 s) ∧ ↑y = x :=
mem_image _ _ _
#align mem_intrinsic_interior mem_intrinsicInterior
@[simp]
theorem mem_intrinsicFrontier :
x ∈ intrinsicFrontier 𝕜 s ↔ ∃ y, y ∈ frontier ((↑) ⁻¹' s : Set <| affineSpan 𝕜 s) ∧ ↑y = x :=
mem_image _ _ _
#align mem_intrinsic_frontier mem_intrinsicFrontier
@[simp]
theorem mem_intrinsicClosure :
x ∈ intrinsicClosure 𝕜 s ↔ ∃ y, y ∈ closure ((↑) ⁻¹' s : Set <| affineSpan 𝕜 s) ∧ ↑y = x :=
mem_image _ _ _
#align mem_intrinsic_closure mem_intrinsicClosure
theorem intrinsicInterior_subset : intrinsicInterior 𝕜 s ⊆ s :=
image_subset_iff.2 interior_subset
#align intrinsic_interior_subset intrinsicInterior_subset
theorem intrinsicFrontier_subset (hs : IsClosed s) : intrinsicFrontier 𝕜 s ⊆ s :=
image_subset_iff.2 (hs.preimage continuous_induced_dom).frontier_subset
#align intrinsic_frontier_subset intrinsicFrontier_subset
theorem intrinsicFrontier_subset_intrinsicClosure : intrinsicFrontier 𝕜 s ⊆ intrinsicClosure 𝕜 s :=
image_subset _ frontier_subset_closure
#align intrinsic_frontier_subset_intrinsic_closure intrinsicFrontier_subset_intrinsicClosure
theorem subset_intrinsicClosure : s ⊆ intrinsicClosure 𝕜 s :=
fun x hx => ⟨⟨x, subset_affineSpan _ _ hx⟩, subset_closure hx, rfl⟩
#align subset_intrinsic_closure subset_intrinsicClosure
@[simp]
theorem intrinsicInterior_empty : intrinsicInterior 𝕜 (∅ : Set P) = ∅ := by simp [intrinsicInterior]
#align intrinsic_interior_empty intrinsicInterior_empty
@[simp]
theorem intrinsicFrontier_empty : intrinsicFrontier 𝕜 (∅ : Set P) = ∅ := by simp [intrinsicFrontier]
#align intrinsic_frontier_empty intrinsicFrontier_empty
@[simp]
theorem intrinsicClosure_empty : intrinsicClosure 𝕜 (∅ : Set P) = ∅ := by simp [intrinsicClosure]
#align intrinsic_closure_empty intrinsicClosure_empty
@[simp]
theorem intrinsicClosure_nonempty : (intrinsicClosure 𝕜 s).Nonempty ↔ s.Nonempty :=
⟨by simp_rw [nonempty_iff_ne_empty]; rintro h rfl; exact h intrinsicClosure_empty,
Nonempty.mono subset_intrinsicClosure⟩
#align intrinsic_closure_nonempty intrinsicClosure_nonempty
alias ⟨Set.Nonempty.ofIntrinsicClosure, Set.Nonempty.intrinsicClosure⟩ := intrinsicClosure_nonempty
#align set.nonempty.of_intrinsic_closure Set.Nonempty.ofIntrinsicClosure
#align set.nonempty.intrinsic_closure Set.Nonempty.intrinsicClosure
--attribute [protected] Set.Nonempty.intrinsicClosure -- Porting note: removed
@[simp]
| Mathlib/Analysis/Convex/Intrinsic.lean | 136 | 138 | theorem intrinsicInterior_singleton (x : P) : intrinsicInterior 𝕜 ({x} : Set P) = {x} := by |
simpa only [intrinsicInterior, preimage_coe_affineSpan_singleton, interior_univ, image_univ,
Subtype.range_coe] using coe_affineSpan_singleton _ _ _
|
import Mathlib.Algebra.Algebra.Equiv
import Mathlib.LinearAlgebra.Span
#align_import algebra.algebra.tower from "leanprover-community/mathlib"@"71150516f28d9826c7341f8815b31f7d8770c212"
open Pointwise
universe u v w u₁ v₁
variable (R : Type u) (S : Type v) (A : Type w) (B : Type u₁) (M : Type v₁)
namespace IsScalarTower
section Semiring
variable [CommSemiring R] [CommSemiring S] [Semiring A] [Semiring B]
variable [Algebra R S] [Algebra S A] [Algebra S B]
variable {R S A}
theorem of_algebraMap_eq [Algebra R A]
(h : ∀ x, algebraMap R A x = algebraMap S A (algebraMap R S x)) : IsScalarTower R S A :=
⟨fun x y z => by simp_rw [Algebra.smul_def, RingHom.map_mul, mul_assoc, h]⟩
#align is_scalar_tower.of_algebra_map_eq IsScalarTower.of_algebraMap_eq
theorem of_algebraMap_eq' [Algebra R A]
(h : algebraMap R A = (algebraMap S A).comp (algebraMap R S)) : IsScalarTower R S A :=
of_algebraMap_eq <| RingHom.ext_iff.1 h
#align is_scalar_tower.of_algebra_map_eq' IsScalarTower.of_algebraMap_eq'
variable (R S A)
variable [Algebra R A] [Algebra R B]
variable [IsScalarTower R S A] [IsScalarTower R S B]
theorem algebraMap_eq : algebraMap R A = (algebraMap S A).comp (algebraMap R S) :=
RingHom.ext fun x => by
simp_rw [RingHom.comp_apply, Algebra.algebraMap_eq_smul_one, smul_assoc, one_smul]
#align is_scalar_tower.algebra_map_eq IsScalarTower.algebraMap_eq
| Mathlib/Algebra/Algebra/Tower.lean | 130 | 131 | theorem algebraMap_apply (x : R) : algebraMap R A x = algebraMap S A (algebraMap R S x) := by |
rw [algebraMap_eq R S A, RingHom.comp_apply]
|
import Mathlib.Algebra.ModEq
import Mathlib.Algebra.Module.Defs
import Mathlib.Algebra.Order.Archimedean
import Mathlib.Algebra.Periodic
import Mathlib.Data.Int.SuccPred
import Mathlib.GroupTheory.QuotientGroup
import Mathlib.Order.Circular
import Mathlib.Data.List.TFAE
import Mathlib.Data.Set.Lattice
#align_import algebra.order.to_interval_mod from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec"
noncomputable section
section LinearOrderedAddCommGroup
variable {α : Type*} [LinearOrderedAddCommGroup α] [hα : Archimedean α] {p : α} (hp : 0 < p)
{a b c : α} {n : ℤ}
def toIcoDiv (a b : α) : ℤ :=
(existsUnique_sub_zsmul_mem_Ico hp b a).choose
#align to_Ico_div toIcoDiv
theorem sub_toIcoDiv_zsmul_mem_Ico (a b : α) : b - toIcoDiv hp a b • p ∈ Set.Ico a (a + p) :=
(existsUnique_sub_zsmul_mem_Ico hp b a).choose_spec.1
#align sub_to_Ico_div_zsmul_mem_Ico sub_toIcoDiv_zsmul_mem_Ico
theorem toIcoDiv_eq_of_sub_zsmul_mem_Ico (h : b - n • p ∈ Set.Ico a (a + p)) :
toIcoDiv hp a b = n :=
((existsUnique_sub_zsmul_mem_Ico hp b a).choose_spec.2 _ h).symm
#align to_Ico_div_eq_of_sub_zsmul_mem_Ico toIcoDiv_eq_of_sub_zsmul_mem_Ico
def toIocDiv (a b : α) : ℤ :=
(existsUnique_sub_zsmul_mem_Ioc hp b a).choose
#align to_Ioc_div toIocDiv
theorem sub_toIocDiv_zsmul_mem_Ioc (a b : α) : b - toIocDiv hp a b • p ∈ Set.Ioc a (a + p) :=
(existsUnique_sub_zsmul_mem_Ioc hp b a).choose_spec.1
#align sub_to_Ioc_div_zsmul_mem_Ioc sub_toIocDiv_zsmul_mem_Ioc
theorem toIocDiv_eq_of_sub_zsmul_mem_Ioc (h : b - n • p ∈ Set.Ioc a (a + p)) :
toIocDiv hp a b = n :=
((existsUnique_sub_zsmul_mem_Ioc hp b a).choose_spec.2 _ h).symm
#align to_Ioc_div_eq_of_sub_zsmul_mem_Ioc toIocDiv_eq_of_sub_zsmul_mem_Ioc
def toIcoMod (a b : α) : α :=
b - toIcoDiv hp a b • p
#align to_Ico_mod toIcoMod
def toIocMod (a b : α) : α :=
b - toIocDiv hp a b • p
#align to_Ioc_mod toIocMod
theorem toIcoMod_mem_Ico (a b : α) : toIcoMod hp a b ∈ Set.Ico a (a + p) :=
sub_toIcoDiv_zsmul_mem_Ico hp a b
#align to_Ico_mod_mem_Ico toIcoMod_mem_Ico
theorem toIcoMod_mem_Ico' (b : α) : toIcoMod hp 0 b ∈ Set.Ico 0 p := by
convert toIcoMod_mem_Ico hp 0 b
exact (zero_add p).symm
#align to_Ico_mod_mem_Ico' toIcoMod_mem_Ico'
theorem toIocMod_mem_Ioc (a b : α) : toIocMod hp a b ∈ Set.Ioc a (a + p) :=
sub_toIocDiv_zsmul_mem_Ioc hp a b
#align to_Ioc_mod_mem_Ioc toIocMod_mem_Ioc
theorem left_le_toIcoMod (a b : α) : a ≤ toIcoMod hp a b :=
(Set.mem_Ico.1 (toIcoMod_mem_Ico hp a b)).1
#align left_le_to_Ico_mod left_le_toIcoMod
theorem left_lt_toIocMod (a b : α) : a < toIocMod hp a b :=
(Set.mem_Ioc.1 (toIocMod_mem_Ioc hp a b)).1
#align left_lt_to_Ioc_mod left_lt_toIocMod
theorem toIcoMod_lt_right (a b : α) : toIcoMod hp a b < a + p :=
(Set.mem_Ico.1 (toIcoMod_mem_Ico hp a b)).2
#align to_Ico_mod_lt_right toIcoMod_lt_right
theorem toIocMod_le_right (a b : α) : toIocMod hp a b ≤ a + p :=
(Set.mem_Ioc.1 (toIocMod_mem_Ioc hp a b)).2
#align to_Ioc_mod_le_right toIocMod_le_right
@[simp]
theorem self_sub_toIcoDiv_zsmul (a b : α) : b - toIcoDiv hp a b • p = toIcoMod hp a b :=
rfl
#align self_sub_to_Ico_div_zsmul self_sub_toIcoDiv_zsmul
@[simp]
theorem self_sub_toIocDiv_zsmul (a b : α) : b - toIocDiv hp a b • p = toIocMod hp a b :=
rfl
#align self_sub_to_Ioc_div_zsmul self_sub_toIocDiv_zsmul
@[simp]
theorem toIcoDiv_zsmul_sub_self (a b : α) : toIcoDiv hp a b • p - b = -toIcoMod hp a b := by
rw [toIcoMod, neg_sub]
#align to_Ico_div_zsmul_sub_self toIcoDiv_zsmul_sub_self
@[simp]
| Mathlib/Algebra/Order/ToIntervalMod.lean | 128 | 129 | theorem toIocDiv_zsmul_sub_self (a b : α) : toIocDiv hp a b • p - b = -toIocMod hp a b := by |
rw [toIocMod, neg_sub]
|
import Mathlib.Algebra.Homology.Homotopy
import Mathlib.AlgebraicTopology.DoldKan.Notations
#align_import algebraic_topology.dold_kan.homotopies from "leanprover-community/mathlib"@"b12099d3b7febf4209824444dd836ef5ad96db55"
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive
CategoryTheory.SimplicialObject Homotopy Opposite Simplicial DoldKan
noncomputable section
namespace AlgebraicTopology
namespace DoldKan
variable {C : Type*} [Category C] [Preadditive C]
variable {X : SimplicialObject C}
abbrev c :=
ComplexShape.down ℕ
#align algebraic_topology.dold_kan.c AlgebraicTopology.DoldKan.c
theorem c_mk (i j : ℕ) (h : j + 1 = i) : c.Rel i j :=
ComplexShape.down_mk i j h
#align algebraic_topology.dold_kan.c_mk AlgebraicTopology.DoldKan.c_mk
theorem cs_down_0_not_rel_left (j : ℕ) : ¬c.Rel 0 j := by
intro hj
dsimp at hj
apply Nat.not_succ_le_zero j
rw [Nat.succ_eq_add_one, hj]
#align algebraic_topology.dold_kan.cs_down_0_not_rel_left AlgebraicTopology.DoldKan.cs_down_0_not_rel_left
def hσ (q : ℕ) (n : ℕ) : X _[n] ⟶ X _[n + 1] :=
if n < q then 0 else (-1 : ℤ) ^ (n - q) • X.σ ⟨n - q, Nat.lt_succ_of_le (Nat.sub_le _ _)⟩
#align algebraic_topology.dold_kan.hσ AlgebraicTopology.DoldKan.hσ
def hσ' (q : ℕ) : ∀ n m, c.Rel m n → (K[X].X n ⟶ K[X].X m) := fun n m hnm =>
hσ q n ≫ eqToHom (by congr)
#align algebraic_topology.dold_kan.hσ' AlgebraicTopology.DoldKan.hσ'
theorem hσ'_eq_zero {q n m : ℕ} (hnq : n < q) (hnm : c.Rel m n) :
(hσ' q n m hnm : X _[n] ⟶ X _[m]) = 0 := by
simp only [hσ', hσ]
split_ifs
exact zero_comp
#align algebraic_topology.dold_kan.hσ'_eq_zero AlgebraicTopology.DoldKan.hσ'_eq_zero
| Mathlib/AlgebraicTopology/DoldKan/Homotopies.lean | 111 | 119 | theorem hσ'_eq {q n a m : ℕ} (ha : n = a + q) (hnm : c.Rel m n) :
(hσ' q n m hnm : X _[n] ⟶ X _[m]) =
((-1 : ℤ) ^ a • X.σ ⟨a, Nat.lt_succ_iff.mpr (Nat.le.intro (Eq.symm ha))⟩) ≫
eqToHom (by congr) := by |
simp only [hσ', hσ]
split_ifs
· omega
· have h' := tsub_eq_of_eq_add ha
congr
|
import Mathlib.Combinatorics.SimpleGraph.AdjMatrix
import Mathlib.LinearAlgebra.Matrix.PosDef
open Finset Matrix
namespace SimpleGraph
variable {V : Type*} (R : Type*)
variable [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj]
def degMatrix [AddMonoidWithOne R] : Matrix V V R := Matrix.diagonal (G.degree ·)
def lapMatrix [AddGroupWithOne R] : Matrix V V R := G.degMatrix R - G.adjMatrix R
variable {R}
theorem isSymm_degMatrix [AddMonoidWithOne R] : (G.degMatrix R).IsSymm :=
isSymm_diagonal _
theorem isSymm_lapMatrix [AddGroupWithOne R] : (G.lapMatrix R).IsSymm :=
(isSymm_degMatrix _).sub (isSymm_adjMatrix _)
| Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean | 48 | 50 | theorem degMatrix_mulVec_apply [NonAssocSemiring R] (v : V) (vec : V → R) :
(G.degMatrix R *ᵥ vec) v = G.degree v * vec v := by |
rw [degMatrix, mulVec_diagonal]
|
import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots
import Mathlib.FieldTheory.PolynomialGaloisGroup
#align_import number_theory.cyclotomic.gal from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a"
variable {n : ℕ+} (K : Type*) [Field K] {L : Type*} {μ : L}
open Polynomial IsCyclotomicExtension
open scoped Cyclotomic
namespace IsPrimitiveRoot
variable [CommRing L] [IsDomain L] (hμ : IsPrimitiveRoot μ n) [Algebra K L]
[IsCyclotomicExtension {n} K L]
| Mathlib/NumberTheory/Cyclotomic/Gal.lean | 55 | 76 | theorem autToPow_injective : Function.Injective <| hμ.autToPow K := by |
intro f g hfg
apply_fun Units.val at hfg
simp only [IsPrimitiveRoot.coe_autToPow_apply] at hfg
generalize_proofs hf' hg' at hfg
have hf := hf'.choose_spec
have hg := hg'.choose_spec
generalize_proofs hζ at hf hg
suffices f (hμ.toRootsOfUnity : Lˣ) = g (hμ.toRootsOfUnity : Lˣ) by
apply AlgEquiv.coe_algHom_injective
apply (hμ.powerBasis K).algHom_ext
exact this
rw [ZMod.eq_iff_modEq_nat] at hfg
refine (hf.trans ?_).trans hg.symm
rw [← rootsOfUnity.coe_pow _ hf'.choose, ← rootsOfUnity.coe_pow _ hg'.choose]
congr 2
rw [pow_eq_pow_iff_modEq]
convert hfg
rw [hμ.eq_orderOf]
-- Porting note: was `{occs := occurrences.pos [2]}`
conv_rhs => rw [← hμ.val_toRootsOfUnity_coe]
rw [orderOf_units, Subgroup.orderOf_coe]
|
import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.Part
import Mathlib.Tactic.NormNum
#align_import data.nat.part_enat from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
open Part hiding some
def PartENat : Type :=
Part ℕ
#align part_enat PartENat
namespace PartENat
@[coe]
def some : ℕ → PartENat :=
Part.some
#align part_enat.some PartENat.some
instance : Zero PartENat :=
⟨some 0⟩
instance : Inhabited PartENat :=
⟨0⟩
instance : One PartENat :=
⟨some 1⟩
instance : Add PartENat :=
⟨fun x y => ⟨x.Dom ∧ y.Dom, fun h => get x h.1 + get y h.2⟩⟩
instance (n : ℕ) : Decidable (some n).Dom :=
isTrue trivial
@[simp]
theorem dom_some (x : ℕ) : (some x).Dom :=
trivial
#align part_enat.dom_some PartENat.dom_some
instance addCommMonoid : AddCommMonoid PartENat where
add := (· + ·)
zero := 0
add_comm x y := Part.ext' and_comm fun _ _ => add_comm _ _
zero_add x := Part.ext' (true_and_iff _) fun _ _ => zero_add _
add_zero x := Part.ext' (and_true_iff _) fun _ _ => add_zero _
add_assoc x y z := Part.ext' and_assoc fun _ _ => add_assoc _ _ _
nsmul := nsmulRec
instance : AddCommMonoidWithOne PartENat :=
{ PartENat.addCommMonoid with
one := 1
natCast := some
natCast_zero := rfl
natCast_succ := fun _ => Part.ext' (true_and_iff _).symm fun _ _ => rfl }
theorem some_eq_natCast (n : ℕ) : some n = n :=
rfl
#align part_enat.some_eq_coe PartENat.some_eq_natCast
instance : CharZero PartENat where
cast_injective := Part.some_injective
theorem natCast_inj {x y : ℕ} : (x : PartENat) = y ↔ x = y :=
Nat.cast_inj
#align part_enat.coe_inj PartENat.natCast_inj
@[simp]
theorem dom_natCast (x : ℕ) : (x : PartENat).Dom :=
trivial
#align part_enat.dom_coe PartENat.dom_natCast
-- See note [no_index around OfNat.ofNat]
@[simp]
theorem dom_ofNat (x : ℕ) [x.AtLeastTwo] : (no_index (OfNat.ofNat x : PartENat)).Dom :=
trivial
@[simp]
theorem dom_zero : (0 : PartENat).Dom :=
trivial
@[simp]
theorem dom_one : (1 : PartENat).Dom :=
trivial
instance : CanLift PartENat ℕ (↑) Dom :=
⟨fun n hn => ⟨n.get hn, Part.some_get _⟩⟩
instance : LE PartENat :=
⟨fun x y => ∃ h : y.Dom → x.Dom, ∀ hy : y.Dom, x.get (h hy) ≤ y.get hy⟩
instance : Top PartENat :=
⟨none⟩
instance : Bot PartENat :=
⟨0⟩
instance : Sup PartENat :=
⟨fun x y => ⟨x.Dom ∧ y.Dom, fun h => x.get h.1 ⊔ y.get h.2⟩⟩
theorem le_def (x y : PartENat) :
x ≤ y ↔ ∃ h : y.Dom → x.Dom, ∀ hy : y.Dom, x.get (h hy) ≤ y.get hy :=
Iff.rfl
#align part_enat.le_def PartENat.le_def
@[elab_as_elim]
protected theorem casesOn' {P : PartENat → Prop} :
∀ a : PartENat, P ⊤ → (∀ n : ℕ, P (some n)) → P a :=
Part.induction_on
#align part_enat.cases_on' PartENat.casesOn'
@[elab_as_elim]
protected theorem casesOn {P : PartENat → Prop} : ∀ a : PartENat, P ⊤ → (∀ n : ℕ, P n) → P a := by
exact PartENat.casesOn'
#align part_enat.cases_on PartENat.casesOn
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem top_add (x : PartENat) : ⊤ + x = ⊤ :=
Part.ext' (false_and_iff _) fun h => h.left.elim
#align part_enat.top_add PartENat.top_add
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem add_top (x : PartENat) : x + ⊤ = ⊤ := by rw [add_comm, top_add]
#align part_enat.add_top PartENat.add_top
@[simp]
theorem natCast_get {x : PartENat} (h : x.Dom) : (x.get h : PartENat) = x := by
exact Part.ext' (iff_of_true trivial h) fun _ _ => rfl
#align part_enat.coe_get PartENat.natCast_get
@[simp, norm_cast]
| Mathlib/Data/Nat/PartENat.lean | 184 | 185 | theorem get_natCast' (x : ℕ) (h : (x : PartENat).Dom) : get (x : PartENat) h = x := by |
rw [← natCast_inj, natCast_get]
|
import Mathlib.Analysis.InnerProductSpace.Orientation
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
#align_import measure_theory.measure.haar.inner_product_space from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
open FiniteDimensional MeasureTheory MeasureTheory.Measure Set
variable {ι E F : Type*}
variable [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F]
[MeasurableSpace F] [BorelSpace F]
section
variable {m n : ℕ} [_i : Fact (finrank ℝ F = n)]
theorem Orientation.measure_orthonormalBasis (o : Orientation ℝ F (Fin n))
(b : OrthonormalBasis ι ℝ F) : o.volumeForm.measure (parallelepiped b) = 1 := by
have e : ι ≃ Fin n := by
refine Fintype.equivFinOfCardEq ?_
rw [← _i.out, finrank_eq_card_basis b.toBasis]
have A : ⇑b = b.reindex e ∘ e := by
ext x
simp only [OrthonormalBasis.coe_reindex, Function.comp_apply, Equiv.symm_apply_apply]
rw [A, parallelepiped_comp_equiv, AlternatingMap.measure_parallelepiped,
o.abs_volumeForm_apply_of_orthonormal, ENNReal.ofReal_one]
#align orientation.measure_orthonormal_basis Orientation.measure_orthonormalBasis
theorem Orientation.measure_eq_volume (o : Orientation ℝ F (Fin n)) :
o.volumeForm.measure = volume := by
have A : o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped = 1 :=
Orientation.measure_orthonormalBasis o (stdOrthonormalBasis ℝ F)
rw [addHaarMeasure_unique o.volumeForm.measure
(stdOrthonormalBasis ℝ F).toBasis.parallelepiped, A, one_smul]
simp only [volume, Basis.addHaar]
#align orientation.measure_eq_volume Orientation.measure_eq_volume
end
theorem OrthonormalBasis.volume_parallelepiped (b : OrthonormalBasis ι ℝ F) :
volume (parallelepiped b) = 1 := by
haveI : Fact (finrank ℝ F = finrank ℝ F) := ⟨rfl⟩
let o := (stdOrthonormalBasis ℝ F).toBasis.orientation
rw [← o.measure_eq_volume]
exact o.measure_orthonormalBasis b
#align orthonormal_basis.volume_parallelepiped OrthonormalBasis.volume_parallelepiped
theorem OrthonormalBasis.addHaar_eq_volume {ι F : Type*} [Fintype ι] [NormedAddCommGroup F]
[InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F]
(b : OrthonormalBasis ι ℝ F) :
b.toBasis.addHaar = volume := by
rw [Basis.addHaar_eq_iff]
exact b.volume_parallelepiped
noncomputable def OrthonormalBasis.measurableEquiv (b : OrthonormalBasis ι ℝ F) :
F ≃ᵐ EuclideanSpace ℝ ι := b.repr.toHomeomorph.toMeasurableEquiv
| Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean | 84 | 89 | theorem OrthonormalBasis.measurePreserving_measurableEquiv (b : OrthonormalBasis ι ℝ F) :
MeasurePreserving b.measurableEquiv volume volume := by |
convert (b.measurableEquiv.symm.measurable.measurePreserving _).symm
rw [← (EuclideanSpace.basisFun ι ℝ).addHaar_eq_volume]
erw [MeasurableEquiv.coe_toEquiv_symm, Basis.map_addHaar _ b.repr.symm.toContinuousLinearEquiv]
exact b.addHaar_eq_volume.symm
|
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
#align_import linear_algebra.symplectic_group from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Matrix
variable {l R : Type*}
namespace Matrix
variable (l) [DecidableEq l] (R) [CommRing R]
section JMatrixLemmas
def J : Matrix (Sum l l) (Sum l l) R :=
Matrix.fromBlocks 0 (-1) 1 0
set_option linter.uppercaseLean3 false in
#align matrix.J Matrix.J
@[simp]
| Mathlib/LinearAlgebra/SymplecticGroup.lean | 43 | 46 | theorem J_transpose : (J l R)ᵀ = -J l R := by |
rw [J, fromBlocks_transpose, ← neg_one_smul R (fromBlocks _ _ _ _ : Matrix (l ⊕ l) (l ⊕ l) R),
fromBlocks_smul, Matrix.transpose_zero, Matrix.transpose_one, transpose_neg]
simp [fromBlocks]
|
import Batteries.Data.Rat.Basic
import Batteries.Tactic.SeqFocus
namespace Rat
theorem ext : {p q : Rat} → p.num = q.num → p.den = q.den → p = q
| ⟨_,_,_,_⟩, ⟨_,_,_,_⟩, rfl, rfl => rfl
@[simp] theorem mk_den_one {r : Int} :
⟨r, 1, Nat.one_ne_zero, (Nat.coprime_one_right _)⟩ = (r : Rat) := rfl
@[simp] theorem zero_num : (0 : Rat).num = 0 := rfl
@[simp] theorem zero_den : (0 : Rat).den = 1 := rfl
@[simp] theorem one_num : (1 : Rat).num = 1 := rfl
@[simp] theorem one_den : (1 : Rat).den = 1 := rfl
@[simp] theorem maybeNormalize_eq {num den g} (den_nz reduced) :
maybeNormalize num den g den_nz reduced =
{ num := num.div g, den := den / g, den_nz, reduced } := by
unfold maybeNormalize; split
· subst g; simp
· rfl
theorem normalize.reduced' {num : Int} {den g : Nat} (den_nz : den ≠ 0)
(e : g = num.natAbs.gcd den) : (num / g).natAbs.Coprime (den / g) := by
rw [← Int.div_eq_ediv_of_dvd (e ▸ Int.ofNat_dvd_left.2 (Nat.gcd_dvd_left ..))]
exact normalize.reduced den_nz e
theorem normalize_eq {num den} (den_nz) : normalize num den den_nz =
{ num := num / num.natAbs.gcd den
den := den / num.natAbs.gcd den
den_nz := normalize.den_nz den_nz rfl
reduced := normalize.reduced' den_nz rfl } := by
simp only [normalize, maybeNormalize_eq,
Int.div_eq_ediv_of_dvd (Int.ofNat_dvd_left.2 (Nat.gcd_dvd_left ..))]
@[simp] theorem normalize_zero (nz) : normalize 0 d nz = 0 := by
simp [normalize, Int.zero_div, Int.natAbs_zero, Nat.div_self (Nat.pos_of_ne_zero nz)]; rfl
theorem mk_eq_normalize (num den nz c) : ⟨num, den, nz, c⟩ = normalize num den nz := by
simp [normalize_eq, c.gcd_eq_one]
theorem normalize_self (r : Rat) : normalize r.num r.den r.den_nz = r := (mk_eq_normalize ..).symm
theorem normalize_mul_left {a : Nat} (d0 : d ≠ 0) (a0 : a ≠ 0) :
normalize (↑a * n) (a * d) (Nat.mul_ne_zero a0 d0) = normalize n d d0 := by
simp [normalize_eq, mk'.injEq, Int.natAbs_mul, Nat.gcd_mul_left,
Nat.mul_div_mul_left _ _ (Nat.pos_of_ne_zero a0), Int.ofNat_mul,
Int.mul_ediv_mul_of_pos _ _ (Int.ofNat_pos.2 <| Nat.pos_of_ne_zero a0)]
theorem normalize_mul_right {a : Nat} (d0 : d ≠ 0) (a0 : a ≠ 0) :
normalize (n * a) (d * a) (Nat.mul_ne_zero d0 a0) = normalize n d d0 := by
rw [← normalize_mul_left (d0 := d0) a0]; congr 1 <;> [apply Int.mul_comm; apply Nat.mul_comm]
theorem normalize_eq_iff (z₁ : d₁ ≠ 0) (z₂ : d₂ ≠ 0) :
normalize n₁ d₁ z₁ = normalize n₂ d₂ z₂ ↔ n₁ * d₂ = n₂ * d₁ := by
constructor <;> intro h
· simp only [normalize_eq, mk'.injEq] at h
have' hn₁ := Int.ofNat_dvd_left.2 <| Nat.gcd_dvd_left n₁.natAbs d₁
have' hn₂ := Int.ofNat_dvd_left.2 <| Nat.gcd_dvd_left n₂.natAbs d₂
have' hd₁ := Int.ofNat_dvd.2 <| Nat.gcd_dvd_right n₁.natAbs d₁
have' hd₂ := Int.ofNat_dvd.2 <| Nat.gcd_dvd_right n₂.natAbs d₂
rw [← Int.ediv_mul_cancel (Int.dvd_trans hd₂ (Int.dvd_mul_left ..)),
Int.mul_ediv_assoc _ hd₂, ← Int.ofNat_ediv, ← h.2, Int.ofNat_ediv,
← Int.mul_ediv_assoc _ hd₁, Int.mul_ediv_assoc' _ hn₁,
Int.mul_right_comm, h.1, Int.ediv_mul_cancel hn₂]
· rw [← normalize_mul_right _ z₂, ← normalize_mul_left z₂ z₁, Int.mul_comm d₁, h]
theorem maybeNormalize_eq_normalize {num : Int} {den g : Nat} (den_nz reduced)
(hn : ↑g ∣ num) (hd : g ∣ den) :
maybeNormalize num den g den_nz reduced = normalize num den (mt (by simp [·]) den_nz) := by
simp only [maybeNormalize_eq, mk_eq_normalize, Int.div_eq_ediv_of_dvd hn]
have : g ≠ 0 := mt (by simp [·]) den_nz
rw [← normalize_mul_right _ this, Int.ediv_mul_cancel hn]
congr 1; exact Nat.div_mul_cancel hd
@[simp] theorem normalize_eq_zero (d0 : d ≠ 0) : normalize n d d0 = 0 ↔ n = 0 := by
have' := normalize_eq_iff d0 Nat.one_ne_zero
rw [normalize_zero (d := 1)] at this; rw [this]; simp
theorem normalize_num_den' (num den nz) : ∃ d : Nat, d ≠ 0 ∧
num = (normalize num den nz).num * d ∧ den = (normalize num den nz).den * d := by
refine ⟨num.natAbs.gcd den, Nat.gcd_ne_zero_right nz, ?_⟩
simp [normalize_eq, Int.ediv_mul_cancel (Int.ofNat_dvd_left.2 <| Nat.gcd_dvd_left ..),
Nat.div_mul_cancel (Nat.gcd_dvd_right ..)]
theorem normalize_num_den (h : normalize n d z = ⟨n', d', z', c⟩) :
∃ m : Nat, m ≠ 0 ∧ n = n' * m ∧ d = d' * m := by
have := normalize_num_den' n d z; rwa [h] at this
| .lake/packages/batteries/Batteries/Data/Rat/Lemmas.lean | 98 | 99 | theorem normalize_eq_mkRat {num den} (den_nz) : normalize num den den_nz = mkRat num den := by |
simp [mkRat, den_nz]
|
import Mathlib.Algebra.Group.Support
import Mathlib.Data.Set.Pointwise.SMul
#align_import data.set.pointwise.support from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
open Pointwise
open Function Set
section GroupWithZero
variable {α β γ : Type*} [GroupWithZero α] [MulAction α β]
theorem mulSupport_comp_inv_smul₀ [One γ] {c : α} (hc : c ≠ 0) (f : β → γ) :
(mulSupport fun x ↦ f (c⁻¹ • x)) = c • mulSupport f := by
ext x
simp only [mem_smul_set_iff_inv_smul_mem₀ hc, mem_mulSupport]
#align mul_support_comp_inv_smul₀ mulSupport_comp_inv_smul₀
| Mathlib/Data/Set/Pointwise/Support.lean | 56 | 59 | theorem support_comp_inv_smul₀ [Zero γ] {c : α} (hc : c ≠ 0) (f : β → γ) :
(support fun x ↦ f (c⁻¹ • x)) = c • support f := by |
ext x
simp only [mem_smul_set_iff_inv_smul_mem₀ hc, mem_support]
|
import Mathlib.Analysis.Fourier.AddCircle
import Mathlib.Analysis.Fourier.FourierTransform
import Mathlib.Analysis.PSeries
import Mathlib.Analysis.Distribution.SchwartzSpace
import Mathlib.MeasureTheory.Measure.Lebesgue.Integral
#align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
noncomputable section
open Function hiding comp_apply
open Set hiding restrict_apply
open Complex hiding abs_of_nonneg
open Real
open TopologicalSpace Filter MeasureTheory Asymptotics
open scoped Real Filter FourierTransform
open ContinuousMap
theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, ℂ)}
(hf : ∀ K : Compacts ℝ, Summable fun n : ℤ => ‖(f.comp (ContinuousMap.addRight n)).restrict K‖)
(m : ℤ) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by
-- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
-- block, but I think it's more legible this way. We start with preliminaries about the integrand.
let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
have (x : ℝ) : ‖e x‖ = 1 := abs_coe_circle (AddCircle.toCircle (-m • x))
intro K g
simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul]
have eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight n) = e := by
intro n; ext1 x
have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m))
simpa only [mul_one] using this.int_mul n x
-- Now the main argument. First unwind some definitions.
calc
fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m =
∫ x in (0 : ℝ)..1, e x * (∑' n : ℤ, f.comp (ContinuousMap.addRight n)) x := by
simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, e, comp_apply,
coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul]
-- Transform sum in C(ℝ, ℂ) evaluated at x into pointwise sum of values.
_ = ∫ x in (0:ℝ)..1, ∑' n : ℤ, (e * f.comp (ContinuousMap.addRight n)) x := by
simp_rw [coe_mul, Pi.mul_apply,
← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left]
-- Swap sum and integral.
_ = ∑' n : ℤ, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by
refine (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm ?_).symm
convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1
exact funext fun n => neK _ _
_ = ∑' n : ℤ, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by
simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊢
simp_rw [eadd]
-- Rearrange sum of interval integrals into an integral over `ℝ`.
_ = ∫ x, e x * f x := by
suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq
apply integrable_of_summable_norm_Icc
convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1
simp_rw [mul_comp] at eadd ⊢
simp_rw [eadd]
exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _
-- Minor tidying to finish
_ = 𝓕 f m := by
rw [fourierIntegral_real_eq_integral_exp_smul]
congr 1 with x : 1
rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply]
congr 2
push_cast
ring
#align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add
theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, ℂ)}
(h_norm :
∀ K : Compacts ℝ, Summable fun n : ℤ => ‖(f.comp <| ContinuousMap.addRight n).restrict K‖)
(h_sum : Summable fun n : ℤ => 𝓕 f n) (x : ℝ) :
∑' n : ℤ, f (x + n) = ∑' n : ℤ, 𝓕 f n * fourier n (x : UnitAddCircle) := by
let F : C(UnitAddCircle, ℂ) :=
⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩
have : Summable (fourierCoeff F) := by
convert h_sum
exact Real.fourierCoeff_tsum_comp_add h_norm _
convert (has_pointwise_sum_fourier_series_of_summable this x).tsum_eq.symm using 1
· simpa only [F, coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply,
coe_addRight, zero_add]
using (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum x).tsum_eq
· simp_rw [← Real.fourierCoeff_tsum_comp_add h_norm, smul_eq_mul, F, coe_mk]
#align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral
section RpowDecay
variable {E : Type*} [NormedAddCommGroup E]
| Mathlib/Analysis/Fourier/PoissonSummation.lean | 131 | 157 | theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
(hf : f =O[atTop] fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
(fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) =O[atTop] fun x : ℝ => |x| ^ (-b) := by |
-- First establish an explicit estimate on decay of inverse powers.
-- This is logically independent of the rest of the proof, but of no mathematical interest in
-- itself, so it is proved in-line rather than being formulated as a separate lemma.
have claim : ∀ x : ℝ, max 0 (-2 * R) < x → ∀ y : ℝ, x + R ≤ y →
y ^ (-b) ≤ (1 / 2) ^ (-b) * x ^ (-b) := fun x hx y hy ↦ by
rw [max_lt_iff] at hx
obtain ⟨hx1, hx2⟩ := hx
rw [← mul_rpow] <;> try positivity
apply rpow_le_rpow_of_nonpos <;> linarith
-- Now the main proof.
obtain ⟨c, hc, hc'⟩ := hf.exists_pos
simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊢
obtain ⟨d, hd⟩ := hc'
refine ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => ?_⟩⟩
rw [ge_iff_le, max_le_iff] at hx
have hx' : max 0 (-2 * R) < x := by linarith
rw [max_lt_iff] at hx'
rw [norm_norm, ContinuousMap.norm_le _ (by positivity)]
refine fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans ?_
have A : ∀ x : ℝ, 0 ≤ |x| ^ (-b) := fun x => by positivity
rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)]
convert claim x (by linarith only [hx.1]) y.1 y.2.1
· apply abs_of_nonneg; linarith [y.2.1]
· exact abs_of_pos hx'.1
|
import Mathlib.Data.ENNReal.Inv
#align_import data.real.ennreal from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520"
open Set NNReal ENNReal
namespace ENNReal
section Real
variable {a b c d : ℝ≥0∞} {r p q : ℝ≥0}
theorem toReal_add (ha : a ≠ ∞) (hb : b ≠ ∞) : (a + b).toReal = a.toReal + b.toReal := by
lift a to ℝ≥0 using ha
lift b to ℝ≥0 using hb
rfl
#align ennreal.to_real_add ENNReal.toReal_add
theorem toReal_sub_of_le {a b : ℝ≥0∞} (h : b ≤ a) (ha : a ≠ ∞) :
(a - b).toReal = a.toReal - b.toReal := by
lift b to ℝ≥0 using ne_top_of_le_ne_top ha h
lift a to ℝ≥0 using ha
simp only [← ENNReal.coe_sub, ENNReal.coe_toReal, NNReal.coe_sub (ENNReal.coe_le_coe.mp h)]
#align ennreal.to_real_sub_of_le ENNReal.toReal_sub_of_le
theorem le_toReal_sub {a b : ℝ≥0∞} (hb : b ≠ ∞) : a.toReal - b.toReal ≤ (a - b).toReal := by
lift b to ℝ≥0 using hb
induction a
· simp
· simp only [← coe_sub, NNReal.sub_def, Real.coe_toNNReal', coe_toReal]
exact le_max_left _ _
#align ennreal.le_to_real_sub ENNReal.le_toReal_sub
theorem toReal_add_le : (a + b).toReal ≤ a.toReal + b.toReal :=
if ha : a = ∞ then by simp only [ha, top_add, top_toReal, zero_add, toReal_nonneg]
else
if hb : b = ∞ then by simp only [hb, add_top, top_toReal, add_zero, toReal_nonneg]
else le_of_eq (toReal_add ha hb)
#align ennreal.to_real_add_le ENNReal.toReal_add_le
theorem ofReal_add {p q : ℝ} (hp : 0 ≤ p) (hq : 0 ≤ q) :
ENNReal.ofReal (p + q) = ENNReal.ofReal p + ENNReal.ofReal q := by
rw [ENNReal.ofReal, ENNReal.ofReal, ENNReal.ofReal, ← coe_add, coe_inj,
Real.toNNReal_add hp hq]
#align ennreal.of_real_add ENNReal.ofReal_add
theorem ofReal_add_le {p q : ℝ} : ENNReal.ofReal (p + q) ≤ ENNReal.ofReal p + ENNReal.ofReal q :=
coe_le_coe.2 Real.toNNReal_add_le
#align ennreal.of_real_add_le ENNReal.ofReal_add_le
@[simp]
theorem toReal_le_toReal (ha : a ≠ ∞) (hb : b ≠ ∞) : a.toReal ≤ b.toReal ↔ a ≤ b := by
lift a to ℝ≥0 using ha
lift b to ℝ≥0 using hb
norm_cast
#align ennreal.to_real_le_to_real ENNReal.toReal_le_toReal
@[gcongr]
theorem toReal_mono (hb : b ≠ ∞) (h : a ≤ b) : a.toReal ≤ b.toReal :=
(toReal_le_toReal (ne_top_of_le_ne_top hb h) hb).2 h
#align ennreal.to_real_mono ENNReal.toReal_mono
-- Porting note (#10756): new lemma
theorem toReal_mono' (h : a ≤ b) (ht : b = ∞ → a = ∞) : a.toReal ≤ b.toReal := by
rcases eq_or_ne a ∞ with rfl | ha
· exact toReal_nonneg
· exact toReal_mono (mt ht ha) h
@[simp]
| Mathlib/Data/ENNReal/Real.lean | 94 | 97 | theorem toReal_lt_toReal (ha : a ≠ ∞) (hb : b ≠ ∞) : a.toReal < b.toReal ↔ a < b := by |
lift a to ℝ≥0 using ha
lift b to ℝ≥0 using hb
norm_cast
|
import Mathlib.Data.ENNReal.Inv
#align_import data.real.ennreal from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520"
open Set NNReal ENNReal
namespace ENNReal
section iInf
variable {ι : Sort*} {f g : ι → ℝ≥0∞}
variable {a b c d : ℝ≥0∞} {r p q : ℝ≥0}
theorem toNNReal_iInf (hf : ∀ i, f i ≠ ∞) : (iInf f).toNNReal = ⨅ i, (f i).toNNReal := by
cases isEmpty_or_nonempty ι
· rw [iInf_of_empty, top_toNNReal, NNReal.iInf_empty]
· lift f to ι → ℝ≥0 using hf
simp_rw [← coe_iInf, toNNReal_coe]
#align ennreal.to_nnreal_infi ENNReal.toNNReal_iInf
theorem toNNReal_sInf (s : Set ℝ≥0∞) (hs : ∀ r ∈ s, r ≠ ∞) :
(sInf s).toNNReal = sInf (ENNReal.toNNReal '' s) := by
have hf : ∀ i, ((↑) : s → ℝ≥0∞) i ≠ ∞ := fun ⟨r, rs⟩ => hs r rs
-- Porting note: `← sInf_image'` had to be replaced by `← image_eq_range` as the lemmas are used
-- in a different order.
simpa only [← sInf_range, ← image_eq_range, Subtype.range_coe_subtype] using (toNNReal_iInf hf)
#align ennreal.to_nnreal_Inf ENNReal.toNNReal_sInf
theorem toNNReal_iSup (hf : ∀ i, f i ≠ ∞) : (iSup f).toNNReal = ⨆ i, (f i).toNNReal := by
lift f to ι → ℝ≥0 using hf
simp_rw [toNNReal_coe]
by_cases h : BddAbove (range f)
· rw [← coe_iSup h, toNNReal_coe]
· rw [NNReal.iSup_of_not_bddAbove h, iSup_coe_eq_top.2 h, top_toNNReal]
#align ennreal.to_nnreal_supr ENNReal.toNNReal_iSup
theorem toNNReal_sSup (s : Set ℝ≥0∞) (hs : ∀ r ∈ s, r ≠ ∞) :
(sSup s).toNNReal = sSup (ENNReal.toNNReal '' s) := by
have hf : ∀ i, ((↑) : s → ℝ≥0∞) i ≠ ∞ := fun ⟨r, rs⟩ => hs r rs
-- Porting note: `← sSup_image'` had to be replaced by `← image_eq_range` as the lemmas are used
-- in a different order.
simpa only [← sSup_range, ← image_eq_range, Subtype.range_coe_subtype] using (toNNReal_iSup hf)
#align ennreal.to_nnreal_Sup ENNReal.toNNReal_sSup
theorem toReal_iInf (hf : ∀ i, f i ≠ ∞) : (iInf f).toReal = ⨅ i, (f i).toReal := by
simp only [ENNReal.toReal, toNNReal_iInf hf, NNReal.coe_iInf]
#align ennreal.to_real_infi ENNReal.toReal_iInf
theorem toReal_sInf (s : Set ℝ≥0∞) (hf : ∀ r ∈ s, r ≠ ∞) :
(sInf s).toReal = sInf (ENNReal.toReal '' s) := by
simp only [ENNReal.toReal, toNNReal_sInf s hf, NNReal.coe_sInf, Set.image_image]
#align ennreal.to_real_Inf ENNReal.toReal_sInf
theorem toReal_iSup (hf : ∀ i, f i ≠ ∞) : (iSup f).toReal = ⨆ i, (f i).toReal := by
simp only [ENNReal.toReal, toNNReal_iSup hf, NNReal.coe_iSup]
#align ennreal.to_real_supr ENNReal.toReal_iSup
| Mathlib/Data/ENNReal/Real.lean | 585 | 587 | theorem toReal_sSup (s : Set ℝ≥0∞) (hf : ∀ r ∈ s, r ≠ ∞) :
(sSup s).toReal = sSup (ENNReal.toReal '' s) := by |
simp only [ENNReal.toReal, toNNReal_sSup s hf, NNReal.coe_sSup, Set.image_image]
|
import Mathlib.Dynamics.BirkhoffSum.Basic
import Mathlib.Algebra.Module.Basic
open Finset
section birkhoffAverage
variable (R : Type*) {α M : Type*} [DivisionSemiring R] [AddCommMonoid M] [Module R M]
def birkhoffAverage (f : α → α) (g : α → M) (n : ℕ) (x : α) : M := (n : R)⁻¹ • birkhoffSum f g n x
theorem birkhoffAverage_zero (f : α → α) (g : α → M) (x : α) :
birkhoffAverage R f g 0 x = 0 := by simp [birkhoffAverage]
@[simp] theorem birkhoffAverage_zero' (f : α → α) (g : α → M) : birkhoffAverage R f g 0 = 0 :=
funext <| birkhoffAverage_zero _ _ _
theorem birkhoffAverage_one (f : α → α) (g : α → M) (x : α) :
birkhoffAverage R f g 1 x = g x := by simp [birkhoffAverage]
@[simp]
theorem birkhoffAverage_one' (f : α → α) (g : α → M) : birkhoffAverage R f g 1 = g :=
funext <| birkhoffAverage_one R f g
| Mathlib/Dynamics/BirkhoffSum/Average.lean | 57 | 61 | theorem map_birkhoffAverage (S : Type*) {F N : Type*}
[DivisionSemiring S] [AddCommMonoid N] [Module S N] [FunLike F M N]
[AddMonoidHomClass F M N] (g' : F) (f : α → α) (g : α → M) (n : ℕ) (x : α) :
g' (birkhoffAverage R f g n x) = birkhoffAverage S f (g' ∘ g) n x := by |
simp only [birkhoffAverage, map_inv_natCast_smul g' R S, map_birkhoffSum]
|
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c"
variable {ι : Type*} [Fintype ι]
variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R)
variable (b : ι → M) (hb : Submodule.span R (Set.range b) = ⊤)
open Polynomial Matrix
def PiToModule.fromMatrix [DecidableEq ι] : Matrix ι ι R →ₗ[R] (ι → R) →ₗ[R] M :=
(LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap
#align pi_to_module.from_matrix PiToModule.fromMatrix
theorem PiToModule.fromMatrix_apply [DecidableEq ι] (A : Matrix ι ι R) (w : ι → R) :
PiToModule.fromMatrix R b A w = Fintype.total R R b (A *ᵥ w) :=
rfl
#align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply
theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ι] (A : Matrix ι ι R) (j : ι) :
PiToModule.fromMatrix R b A (Pi.single j 1) = ∑ i : ι, A i j • b i := by
rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single]
simp_rw [mul_one]
#align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one
def PiToModule.fromEnd : Module.End R M →ₗ[R] (ι → R) →ₗ[R] M :=
LinearMap.lcomp _ _ (Fintype.total R R b)
#align pi_to_module.from_End PiToModule.fromEnd
theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ι → R) :
PiToModule.fromEnd R b f w = f (Fintype.total R R b w) :=
rfl
#align pi_to_module.from_End_apply PiToModule.fromEnd_apply
theorem PiToModule.fromEnd_apply_single_one [DecidableEq ι] (f : Module.End R M) (i : ι) :
PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by
rw [PiToModule.fromEnd_apply]
congr
convert Fintype.total_apply_single (S := R) R b i (1 : R)
rw [one_smul]
#align pi_to_module.from_End_apply_single_one PiToModule.fromEnd_apply_single_one
| Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean | 68 | 75 | theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊤) :
Function.Injective (PiToModule.fromEnd R b) := by |
intro x y e
ext m
obtain ⟨m, rfl⟩ : m ∈ LinearMap.range (Fintype.total R R b) := by
rw [(Fintype.range_total R b).trans hb]
exact Submodule.mem_top
exact (LinearMap.congr_fun e m : _)
|
import Mathlib.Algebra.GroupWithZero.Units.Lemmas
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Fintype.BigOperators
#align_import data.sign from "leanprover-community/mathlib"@"2445c98ae4b87eabebdde552593519b9b6dc350c"
-- Porting note (#11081): cannot automatically derive Fintype, added manually
inductive SignType
| zero
| neg
| pos
deriving DecidableEq, Inhabited
#align sign_type SignType
-- Porting note: these lemmas are autogenerated by the inductive definition and are not
-- in simple form due to the below `x_eq_x` lemmas
attribute [nolint simpNF] SignType.zero.sizeOf_spec
attribute [nolint simpNF] SignType.neg.sizeOf_spec
attribute [nolint simpNF] SignType.pos.sizeOf_spec
namespace SignType
-- Porting note: Added Fintype SignType manually
instance : Fintype SignType :=
Fintype.ofMultiset (zero :: neg :: pos :: List.nil) (fun x ↦ by cases x <;> simp)
instance : Zero SignType :=
⟨zero⟩
instance : One SignType :=
⟨pos⟩
instance : Neg SignType :=
⟨fun s =>
match s with
| neg => pos
| zero => zero
| pos => neg⟩
@[simp]
theorem zero_eq_zero : zero = 0 :=
rfl
#align sign_type.zero_eq_zero SignType.zero_eq_zero
@[simp]
theorem neg_eq_neg_one : neg = -1 :=
rfl
#align sign_type.neg_eq_neg_one SignType.neg_eq_neg_one
@[simp]
theorem pos_eq_one : pos = 1 :=
rfl
#align sign_type.pos_eq_one SignType.pos_eq_one
instance : Mul SignType :=
⟨fun x y =>
match x with
| neg => -y
| zero => zero
| pos => y⟩
protected inductive LE : SignType → SignType → Prop
| of_neg (a) : SignType.LE neg a
| zero : SignType.LE zero zero
| of_pos (a) : SignType.LE a pos
#align sign_type.le SignType.LE
instance : LE SignType :=
⟨SignType.LE⟩
instance LE.decidableRel : DecidableRel SignType.LE := fun a b => by
cases a <;> cases b <;> first | exact isTrue (by constructor)| exact isFalse (by rintro ⟨_⟩)
instance decidableEq : DecidableEq SignType := fun a b => by
cases a <;> cases b <;> first | exact isTrue (by constructor)| exact isFalse (by rintro ⟨_⟩)
private lemma mul_comm : ∀ (a b : SignType), a * b = b * a := by rintro ⟨⟩ ⟨⟩ <;> rfl
private lemma mul_assoc : ∀ (a b c : SignType), (a * b) * c = a * (b * c) := by
rintro ⟨⟩ ⟨⟩ ⟨⟩ <;> rfl
instance : CommGroupWithZero SignType where
zero := 0
one := 1
mul := (· * ·)
inv := id
mul_zero a := by cases a <;> rfl
zero_mul a := by cases a <;> rfl
mul_one a := by cases a <;> rfl
one_mul a := by cases a <;> rfl
mul_inv_cancel a ha := by cases a <;> trivial
mul_comm := mul_comm
mul_assoc := mul_assoc
exists_pair_ne := ⟨0, 1, by rintro ⟨_⟩⟩
inv_zero := rfl
private lemma le_antisymm (a b : SignType) (_ : a ≤ b) (_: b ≤ a) : a = b := by
cases a <;> cases b <;> trivial
private lemma le_trans (a b c : SignType) (_ : a ≤ b) (_: b ≤ c) : a ≤ c := by
cases a <;> cases b <;> cases c <;> tauto
instance : LinearOrder SignType where
le := (· ≤ ·)
le_refl a := by cases a <;> constructor
le_total a b := by cases a <;> cases b <;> first | left; constructor | right; constructor
le_antisymm := le_antisymm
le_trans := le_trans
decidableLE := LE.decidableRel
decidableEq := SignType.decidableEq
instance : BoundedOrder SignType where
top := 1
le_top := LE.of_pos
bot := -1
bot_le := LE.of_neg
instance : HasDistribNeg SignType :=
{ neg_neg := fun x => by cases x <;> rfl
neg_mul := fun x y => by cases x <;> cases y <;> rfl
mul_neg := fun x y => by cases x <;> cases y <;> rfl }
def fin3Equiv : SignType ≃* Fin 3 where
toFun a :=
match a with
| 0 => ⟨0, by simp⟩
| 1 => ⟨1, by simp⟩
| -1 => ⟨2, by simp⟩
invFun a :=
match a with
| ⟨0, _⟩ => 0
| ⟨1, _⟩ => 1
| ⟨2, _⟩ => -1
left_inv a := by cases a <;> rfl
right_inv a :=
match a with
| ⟨0, _⟩ => by simp
| ⟨1, _⟩ => by simp
| ⟨2, _⟩ => by simp
map_mul' a b := by
cases a <;> cases b <;> rfl
#align sign_type.fin3_equiv SignType.fin3Equiv
section CaseBashing
-- Porting note: a lot of these thms used to use decide! which is not implemented yet
theorem nonneg_iff {a : SignType} : 0 ≤ a ↔ a = 0 ∨ a = 1 := by cases a <;> decide
#align sign_type.nonneg_iff SignType.nonneg_iff
theorem nonneg_iff_ne_neg_one {a : SignType} : 0 ≤ a ↔ a ≠ -1 := by cases a <;> decide
#align sign_type.nonneg_iff_ne_neg_one SignType.nonneg_iff_ne_neg_one
theorem neg_one_lt_iff {a : SignType} : -1 < a ↔ 0 ≤ a := by cases a <;> decide
#align sign_type.neg_one_lt_iff SignType.neg_one_lt_iff
| Mathlib/Data/Sign.lean | 171 | 171 | theorem nonpos_iff {a : SignType} : a ≤ 0 ↔ a = -1 ∨ a = 0 := by | cases a <;> decide
|
import Mathlib.Topology.ContinuousFunction.Basic
#align_import topology.continuous_function.cocompact_map from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
universe u v w
open Filter Set
structure CocompactMap (α : Type u) (β : Type v) [TopologicalSpace α] [TopologicalSpace β] extends
ContinuousMap α β : Type max u v where
cocompact_tendsto' : Tendsto toFun (cocompact α) (cocompact β)
#align cocompact_map CocompactMap
section
class CocompactMapClass (F : Type*) (α β : outParam Type*) [TopologicalSpace α]
[TopologicalSpace β] [FunLike F α β] extends ContinuousMapClass F α β : Prop where
cocompact_tendsto (f : F) : Tendsto f (cocompact α) (cocompact β)
#align cocompact_map_class CocompactMapClass
end
export CocompactMapClass (cocompact_tendsto)
namespace CocompactMap
section Basics
variable {α β γ δ : Type*} [TopologicalSpace α] [TopologicalSpace β] [TopologicalSpace γ]
[TopologicalSpace δ]
instance : FunLike (CocompactMap α β) α β where
coe f := f.toFun
coe_injective' f g h := by
obtain ⟨⟨_, _⟩, _⟩ := f
obtain ⟨⟨_, _⟩, _⟩ := g
congr
instance : CocompactMapClass (CocompactMap α β) α β where
map_continuous f := f.continuous_toFun
cocompact_tendsto f := f.cocompact_tendsto'
@[simp]
theorem coe_toContinuousMap {f : CocompactMap α β} : (f.toContinuousMap : α → β) = f :=
rfl
#align cocompact_map.coe_to_continuous_fun CocompactMap.coe_toContinuousMap
@[ext]
theorem ext {f g : CocompactMap α β} (h : ∀ x, f x = g x) : f = g :=
DFunLike.ext _ _ h
#align cocompact_map.ext CocompactMap.ext
protected def copy (f : CocompactMap α β) (f' : α → β) (h : f' = f) : CocompactMap α β where
toFun := f'
continuous_toFun := by
rw [h]
exact f.continuous_toFun
cocompact_tendsto' := by
simp_rw [h]
exact f.cocompact_tendsto'
#align cocompact_map.copy CocompactMap.copy
@[simp]
theorem coe_copy (f : CocompactMap α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f' :=
rfl
#align cocompact_map.coe_copy CocompactMap.coe_copy
theorem copy_eq (f : CocompactMap α β) (f' : α → β) (h : f' = f) : f.copy f' h = f :=
DFunLike.ext' h
#align cocompact_map.copy_eq CocompactMap.copy_eq
@[simp]
theorem coe_mk (f : C(α, β)) (h : Tendsto f (cocompact α) (cocompact β)) :
⇑(⟨f, h⟩ : CocompactMap α β) = f :=
rfl
#align cocompact_map.coe_mk CocompactMap.coe_mk
section
variable (α)
protected def id : CocompactMap α α :=
⟨ContinuousMap.id _, tendsto_id⟩
#align cocompact_map.id CocompactMap.id
@[simp]
theorem coe_id : ⇑(CocompactMap.id α) = id :=
rfl
#align cocompact_map.coe_id CocompactMap.coe_id
end
instance : Inhabited (CocompactMap α α) :=
⟨CocompactMap.id α⟩
def comp (f : CocompactMap β γ) (g : CocompactMap α β) : CocompactMap α γ :=
⟨f.toContinuousMap.comp g, (cocompact_tendsto f).comp (cocompact_tendsto g)⟩
#align cocompact_map.comp CocompactMap.comp
@[simp]
theorem coe_comp (f : CocompactMap β γ) (g : CocompactMap α β) : ⇑(comp f g) = f ∘ g :=
rfl
#align cocompact_map.coe_comp CocompactMap.coe_comp
@[simp]
theorem comp_apply (f : CocompactMap β γ) (g : CocompactMap α β) (a : α) : comp f g a = f (g a) :=
rfl
#align cocompact_map.comp_apply CocompactMap.comp_apply
@[simp]
theorem comp_assoc (f : CocompactMap γ δ) (g : CocompactMap β γ) (h : CocompactMap α β) :
(f.comp g).comp h = f.comp (g.comp h) :=
rfl
#align cocompact_map.comp_assoc CocompactMap.comp_assoc
@[simp]
theorem id_comp (f : CocompactMap α β) : (CocompactMap.id _).comp f = f :=
ext fun _ => rfl
#align cocompact_map.id_comp CocompactMap.id_comp
@[simp]
theorem comp_id (f : CocompactMap α β) : f.comp (CocompactMap.id _) = f :=
ext fun _ => rfl
#align cocompact_map.comp_id CocompactMap.comp_id
theorem tendsto_of_forall_preimage {f : α → β} (h : ∀ s, IsCompact s → IsCompact (f ⁻¹' s)) :
Tendsto f (cocompact α) (cocompact β) := fun s hs =>
match mem_cocompact.mp hs with
| ⟨t, ht, hts⟩ =>
mem_map.mpr (mem_cocompact.mpr ⟨f ⁻¹' t, h t ht, by simpa using preimage_mono hts⟩)
#align cocompact_map.tendsto_of_forall_preimage CocompactMap.tendsto_of_forall_preimage
| Mathlib/Topology/ContinuousFunction/CocompactMap.lean | 185 | 195 | theorem isCompact_preimage [T2Space β] (f : CocompactMap α β) ⦃s : Set β⦄ (hs : IsCompact s) :
IsCompact (f ⁻¹' s) := by |
obtain ⟨t, ht, hts⟩ :=
mem_cocompact'.mp
(by
simpa only [preimage_image_preimage, preimage_compl] using
mem_map.mp
(cocompact_tendsto f <|
mem_cocompact.mpr ⟨s, hs, compl_subset_compl.mpr (image_preimage_subset f _)⟩))
exact
ht.of_isClosed_subset (hs.isClosed.preimage <| map_continuous f) (by simpa using hts)
|
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.LinearAlgebra.Vandermonde
import Mathlib.RingTheory.Polynomial.Basic
#align_import linear_algebra.lagrange from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Polynomial
section PolynomialDetermination
namespace Polynomial
variable {R : Type*} [CommRing R] [IsDomain R] {f g : R[X]}
section Finset
open Function Fintype
variable (s : Finset R)
theorem eq_zero_of_degree_lt_of_eval_finset_eq_zero (degree_f_lt : f.degree < s.card)
(eval_f : ∀ x ∈ s, f.eval x = 0) : f = 0 := by
rw [← mem_degreeLT] at degree_f_lt
simp_rw [eval_eq_sum_degreeLTEquiv degree_f_lt] at eval_f
rw [← degreeLTEquiv_eq_zero_iff_eq_zero degree_f_lt]
exact
Matrix.eq_zero_of_forall_index_sum_mul_pow_eq_zero
(Injective.comp (Embedding.subtype _).inj' (equivFinOfCardEq (card_coe _)).symm.injective)
fun _ => eval_f _ (Finset.coe_mem _)
#align polynomial.eq_zero_of_degree_lt_of_eval_finset_eq_zero Polynomial.eq_zero_of_degree_lt_of_eval_finset_eq_zero
theorem eq_of_degree_sub_lt_of_eval_finset_eq (degree_fg_lt : (f - g).degree < s.card)
(eval_fg : ∀ x ∈ s, f.eval x = g.eval x) : f = g := by
rw [← sub_eq_zero]
refine eq_zero_of_degree_lt_of_eval_finset_eq_zero _ degree_fg_lt ?_
simp_rw [eval_sub, sub_eq_zero]
exact eval_fg
#align polynomial.eq_of_degree_sub_lt_of_eval_finset_eq Polynomial.eq_of_degree_sub_lt_of_eval_finset_eq
| Mathlib/LinearAlgebra/Lagrange.lean | 63 | 67 | theorem eq_of_degrees_lt_of_eval_finset_eq (degree_f_lt : f.degree < s.card)
(degree_g_lt : g.degree < s.card) (eval_fg : ∀ x ∈ s, f.eval x = g.eval x) : f = g := by |
rw [← mem_degreeLT] at degree_f_lt degree_g_lt
refine eq_of_degree_sub_lt_of_eval_finset_eq _ ?_ eval_fg
rw [← mem_degreeLT]; exact Submodule.sub_mem _ degree_f_lt degree_g_lt
|
import Mathlib.Data.ENNReal.Basic
import Mathlib.Topology.ContinuousFunction.Bounded
import Mathlib.Topology.MetricSpace.Thickening
#align_import topology.metric_space.thickened_indicator from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open scoped Classical
open NNReal ENNReal Topology BoundedContinuousFunction
open NNReal ENNReal Set Metric EMetric Filter
noncomputable section thickenedIndicator
variable {α : Type*} [PseudoEMetricSpace α]
def thickenedIndicatorAux (δ : ℝ) (E : Set α) : α → ℝ≥0∞ :=
fun x : α => (1 : ℝ≥0∞) - infEdist x E / ENNReal.ofReal δ
#align thickened_indicator_aux thickenedIndicatorAux
theorem continuous_thickenedIndicatorAux {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) :
Continuous (thickenedIndicatorAux δ E) := by
unfold thickenedIndicatorAux
let f := fun x : α => (⟨1, infEdist x E / ENNReal.ofReal δ⟩ : ℝ≥0 × ℝ≥0∞)
let sub := fun p : ℝ≥0 × ℝ≥0∞ => (p.1 : ℝ≥0∞) - p.2
rw [show (fun x : α => (1 : ℝ≥0∞) - infEdist x E / ENNReal.ofReal δ) = sub ∘ f by rfl]
apply (@ENNReal.continuous_nnreal_sub 1).comp
apply (ENNReal.continuous_div_const (ENNReal.ofReal δ) _).comp continuous_infEdist
set_option tactic.skipAssignedInstances false in norm_num [δ_pos]
#align continuous_thickened_indicator_aux continuous_thickenedIndicatorAux
theorem thickenedIndicatorAux_le_one (δ : ℝ) (E : Set α) (x : α) :
thickenedIndicatorAux δ E x ≤ 1 := by
apply @tsub_le_self _ _ _ _ (1 : ℝ≥0∞)
#align thickened_indicator_aux_le_one thickenedIndicatorAux_le_one
theorem thickenedIndicatorAux_lt_top {δ : ℝ} {E : Set α} {x : α} :
thickenedIndicatorAux δ E x < ∞ :=
lt_of_le_of_lt (thickenedIndicatorAux_le_one _ _ _) one_lt_top
#align thickened_indicator_aux_lt_top thickenedIndicatorAux_lt_top
theorem thickenedIndicatorAux_closure_eq (δ : ℝ) (E : Set α) :
thickenedIndicatorAux δ (closure E) = thickenedIndicatorAux δ E := by
simp (config := { unfoldPartialApp := true }) only [thickenedIndicatorAux, infEdist_closure]
#align thickened_indicator_aux_closure_eq thickenedIndicatorAux_closure_eq
theorem thickenedIndicatorAux_one (δ : ℝ) (E : Set α) {x : α} (x_in_E : x ∈ E) :
thickenedIndicatorAux δ E x = 1 := by
simp [thickenedIndicatorAux, infEdist_zero_of_mem x_in_E, tsub_zero]
#align thickened_indicator_aux_one thickenedIndicatorAux_one
theorem thickenedIndicatorAux_one_of_mem_closure (δ : ℝ) (E : Set α) {x : α}
(x_mem : x ∈ closure E) : thickenedIndicatorAux δ E x = 1 := by
rw [← thickenedIndicatorAux_closure_eq, thickenedIndicatorAux_one δ (closure E) x_mem]
#align thickened_indicator_aux_one_of_mem_closure thickenedIndicatorAux_one_of_mem_closure
theorem thickenedIndicatorAux_zero {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) {x : α}
(x_out : x ∉ thickening δ E) : thickenedIndicatorAux δ E x = 0 := by
rw [thickening, mem_setOf_eq, not_lt] at x_out
unfold thickenedIndicatorAux
apply le_antisymm _ bot_le
have key := tsub_le_tsub
(@rfl _ (1 : ℝ≥0∞)).le (ENNReal.div_le_div x_out (@rfl _ (ENNReal.ofReal δ : ℝ≥0∞)).le)
rw [ENNReal.div_self (ne_of_gt (ENNReal.ofReal_pos.mpr δ_pos)) ofReal_ne_top] at key
simpa using key
#align thickened_indicator_aux_zero thickenedIndicatorAux_zero
theorem thickenedIndicatorAux_mono {δ₁ δ₂ : ℝ} (hle : δ₁ ≤ δ₂) (E : Set α) :
thickenedIndicatorAux δ₁ E ≤ thickenedIndicatorAux δ₂ E :=
fun _ => tsub_le_tsub (@rfl ℝ≥0∞ 1).le (ENNReal.div_le_div rfl.le (ofReal_le_ofReal hle))
#align thickened_indicator_aux_mono thickenedIndicatorAux_mono
| Mathlib/Topology/MetricSpace/ThickenedIndicator.lean | 110 | 115 | theorem indicator_le_thickenedIndicatorAux (δ : ℝ) (E : Set α) :
(E.indicator fun _ => (1 : ℝ≥0∞)) ≤ thickenedIndicatorAux δ E := by |
intro a
by_cases h : a ∈ E
· simp only [h, indicator_of_mem, thickenedIndicatorAux_one δ E h, le_refl]
· simp only [h, indicator_of_not_mem, not_false_iff, zero_le]
|
import Mathlib.CategoryTheory.Sites.DenseSubsite
#align_import category_theory.sites.induced_topology from "leanprover-community/mathlib"@"ba43124c37cfe0009bbfc57505f9503ae0e8c1af"
namespace CategoryTheory
universe v u
open Limits Opposite Presieve
section
variable {C : Type*} [Category C] {D : Type*} [Category D] {G : C ⥤ D}
variable {J : GrothendieckTopology C} {K : GrothendieckTopology D}
variable (A : Type v) [Category.{u} A]
-- variables (A) [full G] [faithful G]
def LocallyCoverDense (K : GrothendieckTopology D) (G : C ⥤ D) : Prop :=
∀ ⦃X : C⦄ (T : K (G.obj X)), (T.val.functorPullback G).functorPushforward G ∈ K (G.obj X)
#align category_theory.locally_cover_dense CategoryTheory.LocallyCoverDense
namespace LocallyCoverDense
variable [G.Full] [G.Faithful] (Hld : LocallyCoverDense K G)
| Mathlib/CategoryTheory/Sites/InducedTopology.lean | 59 | 65 | theorem pushforward_cover_iff_cover_pullback {X : C} (S : Sieve X) :
K _ (S.functorPushforward G) ↔ ∃ T : K (G.obj X), T.val.functorPullback G = S := by |
constructor
· intro hS
exact ⟨⟨_, hS⟩, (Sieve.fullyFaithfulFunctorGaloisCoinsertion G X).u_l_eq S⟩
· rintro ⟨T, rfl⟩
exact Hld T
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.