Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
goals
listlengths
0
224
goals_before
listlengths
0
220
import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Combinatorics.SimpleGraph.Connectivity import Mathlib.LinearAlgebra.Matrix.Trace import Mathlib.LinearAlgebra.Matrix.Symmetric #align_import combinatorics.simple_graph.adj_matrix from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" open Matrix open Finset Matrix SimpleGraph variable {V α β : Type*} namespace Matrix structure IsAdjMatrix [Zero α] [One α] (A : Matrix V V α) : Prop where zero_or_one : ∀ i j, A i j = 0 ∨ A i j = 1 := by aesop symm : A.IsSymm := by aesop apply_diag : ∀ i, A i i = 0 := by aesop #align matrix.is_adj_matrix Matrix.IsAdjMatrix def compl [Zero α] [One α] [DecidableEq α] [DecidableEq V] (A : Matrix V V α) : Matrix V V α := fun i j => ite (i = j) 0 (ite (A i j = 0) 1 0) #align matrix.compl Matrix.compl section Compl variable [DecidableEq α] [DecidableEq V] (A : Matrix V V α) @[simp] theorem compl_apply_diag [Zero α] [One α] (i : V) : A.compl i i = 0 := by simp [compl] #align matrix.compl_apply_diag Matrix.compl_apply_diag @[simp] theorem compl_apply [Zero α] [One α] (i j : V) : A.compl i j = 0 ∨ A.compl i j = 1 := by unfold compl split_ifs <;> simp #align matrix.compl_apply Matrix.compl_apply @[simp] theorem isSymm_compl [Zero α] [One α] (h : A.IsSymm) : A.compl.IsSymm := by ext simp [compl, h.apply, eq_comm] #align matrix.is_symm_compl Matrix.isSymm_compl @[simp]
Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean
121
122
theorem isAdjMatrix_compl [Zero α] [One α] (h : A.IsSymm) : IsAdjMatrix A.compl := { symm := by
simp [h] }
[ " A.compl i i = 0", " A.compl i j = 0 ∨ A.compl i j = 1", " (if i = j then 0 else if A i j = 0 then 1 else 0) = 0 ∨ (if i = j then 0 else if A i j = 0 then 1 else 0) = 1", " 0 = 0 ∨ 0 = 1", " 1 = 0 ∨ 1 = 1", " A.compl.IsSymm", " A.complᵀ i✝ j✝ = A.compl i✝ j✝" ]
[ " A.compl i i = 0", " A.compl i j = 0 ∨ A.compl i j = 1", " (if i = j then 0 else if A i j = 0 then 1 else 0) = 0 ∨ (if i = j then 0 else if A i j = 0 then 1 else 0) = 1", " 0 = 0 ∨ 0 = 1", " 1 = 0 ∨ 1 = 1", " A.compl.IsSymm", " A.complᵀ i✝ j✝ = A.compl i✝ j✝" ]
import Mathlib.Algebra.Group.Hom.Defs #align_import algebra.group.ext from "leanprover-community/mathlib"@"e574b1a4e891376b0ef974b926da39e05da12a06" assert_not_exists MonoidWithZero assert_not_exists DenselyOrdered open Function universe u @[to_additive (attr := ext)] theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) : m₁ = m₂ := by have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul have h₁ : m₁.one = m₂.one := congr_arg (·.one) this let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass := @MonoidHom.mk _ _ (_) _ (@OneHom.mk _ _ (_) _ id h₁) (fun x y => congr_fun (congr_fun h_mul x) y) have : m₁.npow = m₂.npow := by ext n x exact @MonoidHom.map_pow M M m₁ m₂ f x n rcases m₁ with @⟨@⟨⟨_⟩⟩, ⟨_⟩⟩ rcases m₂ with @⟨@⟨⟨_⟩⟩, ⟨_⟩⟩ congr #align monoid.ext Monoid.ext #align add_monoid.ext AddMonoid.ext @[to_additive] theorem CommMonoid.toMonoid_injective {M : Type u} : Function.Injective (@CommMonoid.toMonoid M) := by rintro ⟨⟩ ⟨⟩ h congr #align comm_monoid.to_monoid_injective CommMonoid.toMonoid_injective #align add_comm_monoid.to_add_monoid_injective AddCommMonoid.toAddMonoid_injective @[to_additive (attr := ext)] theorem CommMonoid.ext {M : Type*} ⦃m₁ m₂ : CommMonoid M⦄ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) : m₁ = m₂ := CommMonoid.toMonoid_injective <| Monoid.ext h_mul #align comm_monoid.ext CommMonoid.ext #align add_comm_monoid.ext AddCommMonoid.ext @[to_additive] theorem LeftCancelMonoid.toMonoid_injective {M : Type u} : Function.Injective (@LeftCancelMonoid.toMonoid M) := by rintro @⟨@⟨⟩⟩ @⟨@⟨⟩⟩ h congr <;> injection h #align left_cancel_monoid.to_monoid_injective LeftCancelMonoid.toMonoid_injective #align add_left_cancel_monoid.to_add_monoid_injective AddLeftCancelMonoid.toAddMonoid_injective @[to_additive (attr := ext)] theorem LeftCancelMonoid.ext {M : Type u} ⦃m₁ m₂ : LeftCancelMonoid M⦄ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) : m₁ = m₂ := LeftCancelMonoid.toMonoid_injective <| Monoid.ext h_mul #align left_cancel_monoid.ext LeftCancelMonoid.ext #align add_left_cancel_monoid.ext AddLeftCancelMonoid.ext @[to_additive]
Mathlib/Algebra/Group/Ext.lean
87
90
theorem RightCancelMonoid.toMonoid_injective {M : Type u} : Function.Injective (@RightCancelMonoid.toMonoid M) := by
rintro @⟨@⟨⟩⟩ @⟨@⟨⟩⟩ h congr <;> injection h
[ " m₁ = m₂", " Monoid.npow = Monoid.npow", " Monoid.npow n x = Monoid.npow n x", " mk one_mul✝ mul_one✝ npow✝ npow_zero✝ npow_succ✝ = m₂", " mk one_mul✝¹ mul_one✝¹ npow✝¹ npow_zero✝¹ npow_succ✝¹ = mk one_mul✝ mul_one✝ npow✝ npow_zero✝ npow_succ✝", " Injective (@toMonoid M)", " mk mul_comm✝¹ = mk mul_comm...
[ " m₁ = m₂", " Monoid.npow = Monoid.npow", " Monoid.npow n x = Monoid.npow n x", " mk one_mul✝ mul_one✝ npow✝ npow_zero✝ npow_succ✝ = m₂", " mk one_mul✝¹ mul_one✝¹ npow✝¹ npow_zero✝¹ npow_succ✝¹ = mk one_mul✝ mul_one✝ npow✝ npow_zero✝ npow_succ✝", " Injective (@toMonoid M)", " mk mul_comm✝¹ = mk mul_comm...
import Mathlib.Algebra.GCDMonoid.Multiset import Mathlib.Combinatorics.Enumerative.Partition import Mathlib.Data.List.Rotate import Mathlib.GroupTheory.Perm.Cycle.Factors import Mathlib.GroupTheory.Perm.Closure import Mathlib.Algebra.GCDMonoid.Nat import Mathlib.Tactic.NormNum.GCD #align_import group_theory.perm.cycle.type from "leanprover-community/mathlib"@"47adfab39a11a072db552f47594bf8ed2cf8a722" namespace Equiv.Perm open Equiv List Multiset variable {α : Type*} [Fintype α] section CycleType variable [DecidableEq α] def cycleType (σ : Perm α) : Multiset ℕ := σ.cycleFactorsFinset.1.map (Finset.card ∘ support) #align equiv.perm.cycle_type Equiv.Perm.cycleType theorem cycleType_def (σ : Perm α) : σ.cycleType = σ.cycleFactorsFinset.1.map (Finset.card ∘ support) := rfl #align equiv.perm.cycle_type_def Equiv.Perm.cycleType_def theorem cycleType_eq' {σ : Perm α} (s : Finset (Perm α)) (h1 : ∀ f : Perm α, f ∈ s → f.IsCycle) (h2 : (s : Set (Perm α)).Pairwise Disjoint) (h0 : s.noncommProd id (h2.imp fun _ _ => Disjoint.commute) = σ) : σ.cycleType = s.1.map (Finset.card ∘ support) := by rw [cycleType_def] congr rw [cycleFactorsFinset_eq_finset] exact ⟨h1, h2, h0⟩ #align equiv.perm.cycle_type_eq' Equiv.Perm.cycleType_eq' theorem cycleType_eq {σ : Perm α} (l : List (Perm α)) (h0 : l.prod = σ) (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) : σ.cycleType = l.map (Finset.card ∘ support) := by have hl : l.Nodup := nodup_of_pairwise_disjoint_cycles h1 h2 rw [cycleType_eq' l.toFinset] · simp [List.dedup_eq_self.mpr hl, (· ∘ ·)] · simpa using h1 · simpa [hl] using h2 · simp [hl, h0] #align equiv.perm.cycle_type_eq Equiv.Perm.cycleType_eq @[simp] -- Porting note: new attr theorem cycleType_eq_zero {σ : Perm α} : σ.cycleType = 0 ↔ σ = 1 := by simp [cycleType_def, cycleFactorsFinset_eq_empty_iff] #align equiv.perm.cycle_type_eq_zero Equiv.Perm.cycleType_eq_zero @[simp] -- Porting note: new attr theorem cycleType_one : (1 : Perm α).cycleType = 0 := cycleType_eq_zero.2 rfl #align equiv.perm.cycle_type_one Equiv.Perm.cycleType_one
Mathlib/GroupTheory/Perm/Cycle/Type.lean
87
88
theorem card_cycleType_eq_zero {σ : Perm α} : Multiset.card σ.cycleType = 0 ↔ σ = 1 := by
rw [card_eq_zero, cycleType_eq_zero]
[ " σ.cycleType = Multiset.map (Finset.card ∘ support) s.val", " Multiset.map (Finset.card ∘ support) σ.cycleFactorsFinset.val = Multiset.map (Finset.card ∘ support) s.val", " σ.cycleFactorsFinset = s", " (∀ f ∈ s, f.IsCycle) ∧ ∃ (h : (↑s).Pairwise Disjoint), s.noncommProd id ⋯ = σ", " σ.cycleType = ↑(List.ma...
[ " σ.cycleType = Multiset.map (Finset.card ∘ support) s.val", " Multiset.map (Finset.card ∘ support) σ.cycleFactorsFinset.val = Multiset.map (Finset.card ∘ support) s.val", " σ.cycleFactorsFinset = s", " (∀ f ∈ s, f.IsCycle) ∧ ∃ (h : (↑s).Pairwise Disjoint), s.noncommProd id ⋯ = σ", " σ.cycleType = ↑(List.ma...
import Mathlib.MeasureTheory.MeasurableSpace.Basic import Mathlib.MeasureTheory.Measure.MeasureSpaceDef #align_import measure_theory.function.ae_measurable_sequence from "leanprover-community/mathlib"@"d003c55042c3cd08aefd1ae9a42ef89441cdaaf3" open MeasureTheory open scoped Classical variable {ι : Sort*} {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] {f : ι → α → β} {μ : Measure α} {p : α → (ι → β) → Prop} def aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) (p : α → (ι → β) → Prop) : Set α := (toMeasurable μ { x | (∀ i, f i x = (hf i).mk (f i) x) ∧ p x fun n => f n x }ᶜ)ᶜ #align ae_seq_set aeSeqSet noncomputable def aeSeq (hf : ∀ i, AEMeasurable (f i) μ) (p : α → (ι → β) → Prop) : ι → α → β := fun i x => ite (x ∈ aeSeqSet hf p) ((hf i).mk (f i) x) (⟨f i x⟩ : Nonempty β).some #align ae_seq aeSeq namespace aeSeq section MemAESeqSet theorem mk_eq_fun_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p) (i : ι) : (hf i).mk (f i) x = f i x := haveI h_ss : aeSeqSet hf p ⊆ { x | ∀ i, f i x = (hf i).mk (f i) x } := by rw [aeSeqSet, ← compl_compl { x | ∀ i, f i x = (hf i).mk (f i) x }, Set.compl_subset_compl] refine Set.Subset.trans (Set.compl_subset_compl.mpr fun x h => ?_) (subset_toMeasurable _ _) exact h.1 (h_ss hx i).symm #align ae_seq.mk_eq_fun_of_mem_ae_seq_set aeSeq.mk_eq_fun_of_mem_aeSeqSet theorem aeSeq_eq_mk_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p) (i : ι) : aeSeq hf p i x = (hf i).mk (f i) x := by simp only [aeSeq, hx, if_true] #align ae_seq.ae_seq_eq_mk_of_mem_ae_seq_set aeSeq.aeSeq_eq_mk_of_mem_aeSeqSet
Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean
64
66
theorem aeSeq_eq_fun_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p) (i : ι) : aeSeq hf p i x = f i x := by
simp only [aeSeq_eq_mk_of_mem_aeSeqSet hf hx i, mk_eq_fun_of_mem_aeSeqSet hf hx i]
[ " aeSeqSet hf p ⊆ {x | ∀ (i : ι), f i x = AEMeasurable.mk (f i) ⋯ x}", " {x | ∀ (i : ι), f i x = AEMeasurable.mk (f i) ⋯ x}ᶜ ⊆\n toMeasurable μ {x | (∀ (i : ι), f i x = AEMeasurable.mk (f i) ⋯ x) ∧ p x fun n => f n x}ᶜ", " x ∈ {x | ∀ (i : ι), f i x = AEMeasurable.mk (f i) ⋯ x}", " aeSeq hf p i x = AEMeasur...
[ " aeSeqSet hf p ⊆ {x | ∀ (i : ι), f i x = AEMeasurable.mk (f i) ⋯ x}", " {x | ∀ (i : ι), f i x = AEMeasurable.mk (f i) ⋯ x}ᶜ ⊆\n toMeasurable μ {x | (∀ (i : ι), f i x = AEMeasurable.mk (f i) ⋯ x) ∧ p x fun n => f n x}ᶜ", " x ∈ {x | ∀ (i : ι), f i x = AEMeasurable.mk (f i) ⋯ x}", " aeSeq hf p i x = AEMeasur...
import Mathlib.Topology.Order.Basic open Set Filter OrderDual open scoped Topology section OrderClosedTopology variable {α : Type*} [LinearOrder α] [TopologicalSpace α] [OrderClosedTopology α] {a b c d : α} @[simp] theorem nhdsSet_Ioi : 𝓝ˢ (Ioi a) = 𝓟 (Ioi a) := isOpen_Ioi.nhdsSet_eq @[simp] theorem nhdsSet_Iio : 𝓝ˢ (Iio a) = 𝓟 (Iio a) := isOpen_Iio.nhdsSet_eq @[simp] theorem nhdsSet_Ioo : 𝓝ˢ (Ioo a b) = 𝓟 (Ioo a b) := isOpen_Ioo.nhdsSet_eq theorem nhdsSet_Ici : 𝓝ˢ (Ici a) = 𝓝 a ⊔ 𝓟 (Ioi a) := by rw [← Ioi_insert, nhdsSet_insert, nhdsSet_Ioi] theorem nhdsSet_Iic : 𝓝ˢ (Iic a) = 𝓝 a ⊔ 𝓟 (Iio a) := nhdsSet_Ici (α := αᵒᵈ) theorem nhdsSet_Ico (h : a < b) : 𝓝ˢ (Ico a b) = 𝓝 a ⊔ 𝓟 (Ioo a b) := by rw [← Ioo_insert_left h, nhdsSet_insert, nhdsSet_Ioo] theorem nhdsSet_Ioc (h : a < b) : 𝓝ˢ (Ioc a b) = 𝓝 b ⊔ 𝓟 (Ioo a b) := by rw [← Ioo_insert_right h, nhdsSet_insert, nhdsSet_Ioo] theorem nhdsSet_Icc (h : a ≤ b) : 𝓝ˢ (Icc a b) = 𝓝 a ⊔ 𝓝 b ⊔ 𝓟 (Ioo a b) := by rcases h.eq_or_lt with rfl | hlt · simp · rw [← Ioc_insert_left h, nhdsSet_insert, nhdsSet_Ioc hlt, sup_assoc] @[simp]
Mathlib/Topology/Order/NhdsSet.lean
57
58
theorem Ioi_mem_nhdsSet_Ici_iff : Ioi a ∈ 𝓝ˢ (Ici b) ↔ a < b := by
rw [isOpen_Ioi.mem_nhdsSet, Ici_subset_Ioi]
[ " 𝓝ˢ (Ici a) = 𝓝 a ⊔ 𝓟 (Ioi a)", " 𝓝ˢ (Ico a b) = 𝓝 a ⊔ 𝓟 (Ioo a b)", " 𝓝ˢ (Ioc a b) = 𝓝 b ⊔ 𝓟 (Ioo a b)", " 𝓝ˢ (Icc a b) = 𝓝 a ⊔ 𝓝 b ⊔ 𝓟 (Ioo a b)", " 𝓝ˢ (Icc a a) = 𝓝 a ⊔ 𝓝 a ⊔ 𝓟 (Ioo a a)", " Ioi a ∈ 𝓝ˢ (Ici b) ↔ a < b" ]
[ " 𝓝ˢ (Ici a) = 𝓝 a ⊔ 𝓟 (Ioi a)", " 𝓝ˢ (Ico a b) = 𝓝 a ⊔ 𝓟 (Ioo a b)", " 𝓝ˢ (Ioc a b) = 𝓝 b ⊔ 𝓟 (Ioo a b)", " 𝓝ˢ (Icc a b) = 𝓝 a ⊔ 𝓝 b ⊔ 𝓟 (Ioo a b)", " 𝓝ˢ (Icc a a) = 𝓝 a ⊔ 𝓝 a ⊔ 𝓟 (Ioo a a)" ]
import Mathlib.Algebra.Field.Basic import Mathlib.Algebra.Order.Field.Defs import Mathlib.Data.Tree.Basic import Mathlib.Logic.Basic import Mathlib.Tactic.NormNum.Core import Mathlib.Util.SynthesizeUsing import Mathlib.Util.Qq open Lean Parser Tactic Mathlib Meta NormNum Qq initialize registerTraceClass `CancelDenoms namespace CancelDenoms theorem mul_subst {α} [CommRing α] {n1 n2 k e1 e2 t1 t2 : α} (h1 : n1 * e1 = t1) (h2 : n2 * e2 = t2) (h3 : n1 * n2 = k) : k * (e1 * e2) = t1 * t2 := by rw [← h3, mul_comm n1, mul_assoc n2, ← mul_assoc n1, h1, ← mul_assoc n2, mul_comm n2, mul_assoc, h2] #align cancel_factors.mul_subst CancelDenoms.mul_subst theorem div_subst {α} [Field α] {n1 n2 k e1 e2 t1 : α} (h1 : n1 * e1 = t1) (h2 : n2 / e2 = 1) (h3 : n1 * n2 = k) : k * (e1 / e2) = t1 := by rw [← h3, mul_assoc, mul_div_left_comm, h2, ← mul_assoc, h1, mul_comm, one_mul] #align cancel_factors.div_subst CancelDenoms.div_subst theorem cancel_factors_eq_div {α} [Field α] {n e e' : α} (h : n * e = e') (h2 : n ≠ 0) : e = e' / n := eq_div_of_mul_eq h2 <| by rwa [mul_comm] at h #align cancel_factors.cancel_factors_eq_div CancelDenoms.cancel_factors_eq_div theorem add_subst {α} [Ring α] {n e1 e2 t1 t2 : α} (h1 : n * e1 = t1) (h2 : n * e2 = t2) : n * (e1 + e2) = t1 + t2 := by simp [left_distrib, *] #align cancel_factors.add_subst CancelDenoms.add_subst theorem sub_subst {α} [Ring α] {n e1 e2 t1 t2 : α} (h1 : n * e1 = t1) (h2 : n * e2 = t2) : n * (e1 - e2) = t1 - t2 := by simp [left_distrib, *, sub_eq_add_neg] #align cancel_factors.sub_subst CancelDenoms.sub_subst theorem neg_subst {α} [Ring α] {n e t : α} (h1 : n * e = t) : n * -e = -t := by simp [*] #align cancel_factors.neg_subst CancelDenoms.neg_subst
Mathlib/Tactic/CancelDenoms/Core.lean
66
68
theorem pow_subst {α} [CommRing α] {n e1 t1 k l : α} {e2 : ℕ} (h1 : n * e1 = t1) (h2 : l * n ^ e2 = k) : k * (e1 ^ e2) = l * t1 ^ e2 := by
rw [← h2, ← h1, mul_pow, mul_assoc]
[ " k * (e1 * e2) = t1 * t2", " k * (e1 / e2) = t1", " e * n = e'", " n * (e1 + e2) = t1 + t2", " n * (e1 - e2) = t1 - t2", " n * -e = -t", " k * e1 ^ e2 = l * t1 ^ e2" ]
[ " k * (e1 * e2) = t1 * t2", " k * (e1 / e2) = t1", " e * n = e'", " n * (e1 + e2) = t1 + t2", " n * (e1 - e2) = t1 - t2", " n * -e = -t" ]
import Mathlib.Analysis.Complex.Circle import Mathlib.MeasureTheory.Group.Integral import Mathlib.MeasureTheory.Integral.SetIntegral import Mathlib.MeasureTheory.Measure.Haar.OfBasis import Mathlib.MeasureTheory.Constructions.Prod.Integral import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace import Mathlib.Algebra.Group.AddChar #align_import analysis.fourier.fourier_transform from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" noncomputable section local notation "𝕊" => circle open MeasureTheory Filter open scoped Topology namespace VectorFourier variable {𝕜 : Type*} [CommRing 𝕜] {V : Type*} [AddCommGroup V] [Module 𝕜 V] [MeasurableSpace V] {W : Type*} [AddCommGroup W] [Module 𝕜 W] {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [NormedAddCommGroup F] [NormedSpace ℂ F] [NormedAddCommGroup G] [NormedSpace ℂ G] section Continuous variable [TopologicalSpace 𝕜] [TopologicalRing 𝕜] [TopologicalSpace V] [BorelSpace V] [TopologicalSpace W] {e : AddChar 𝕜 𝕊} {μ : Measure V} {L : V →ₗ[𝕜] W →ₗ[𝕜] 𝕜}
Mathlib/Analysis/Fourier/FourierTransform.lean
132
147
theorem fourierIntegral_convergent_iff (he : Continuous e) (hL : Continuous fun p : V × W ↦ L p.1 p.2) {f : V → E} (w : W) : Integrable (fun v : V ↦ e (-L v w) • f v) μ ↔ Integrable f μ := by
-- first prove one-way implication have aux {g : V → E} (hg : Integrable g μ) (x : W) : Integrable (fun v : V ↦ e (-L v x) • g v) μ := by have c : Continuous fun v ↦ e (-L v x) := he.comp (hL.comp (continuous_prod_mk.mpr ⟨continuous_id, continuous_const⟩)).neg simp_rw [← integrable_norm_iff (c.aestronglyMeasurable.smul hg.1), norm_circle_smul] exact hg.norm -- then use it for both directions refine ⟨fun hf ↦ ?_, fun hf ↦ aux hf w⟩ have := aux hf (-w) simp_rw [← mul_smul (e _) (e _) (f _), ← e.map_add_eq_mul, LinearMap.map_neg, neg_add_self, e.map_zero_eq_one, one_smul] at this -- the `(e _)` speeds up elaboration considerably exact this
[ " Integrable (fun v => e (-(L v) w) • f v) μ ↔ Integrable f μ", " Integrable (fun v => e (-(L v) x) • g v) μ", " Integrable (fun a => ‖g a‖) μ", " Integrable f μ" ]
[]
import Mathlib.Topology.MetricSpace.Isometry #align_import topology.metric_space.gluing from "leanprover-community/mathlib"@"e1a7bdeb4fd826b7e71d130d34988f0a2d26a177" noncomputable section universe u v w open Function Set Uniformity Topology namespace Metric section ApproxGluing variable {X : Type u} {Y : Type v} {Z : Type w} variable [MetricSpace X] [MetricSpace Y] {Φ : Z → X} {Ψ : Z → Y} {ε : ℝ} def glueDist (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : Sum X Y → Sum X Y → ℝ | .inl x, .inl y => dist x y | .inr x, .inr y => dist x y | .inl x, .inr y => (⨅ p, dist x (Φ p) + dist y (Ψ p)) + ε | .inr x, .inl y => (⨅ p, dist y (Φ p) + dist x (Ψ p)) + ε #align metric.glue_dist Metric.glueDist private theorem glueDist_self (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : ∀ x, glueDist Φ Ψ ε x x = 0 | .inl _ => dist_self _ | .inr _ => dist_self _
Mathlib/Topology/MetricSpace/Gluing.lean
76
85
theorem glueDist_glued_points [Nonempty Z] (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (p : Z) : glueDist Φ Ψ ε (.inl (Φ p)) (.inr (Ψ p)) = ε := by
have : ⨅ q, dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q) = 0 := by have A : ∀ q, 0 ≤ dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q) := fun _ => add_nonneg dist_nonneg dist_nonneg refine le_antisymm ?_ (le_ciInf A) have : 0 = dist (Φ p) (Φ p) + dist (Ψ p) (Ψ p) := by simp rw [this] exact ciInf_le ⟨0, forall_mem_range.2 A⟩ p simp only [glueDist, this, zero_add]
[ " glueDist Φ Ψ ε (Sum.inl (Φ p)) (Sum.inr (Ψ p)) = ε", " ⨅ q, dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q) = 0", " ⨅ q, dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q) ≤ 0", " 0 = dist (Φ p) (Φ p) + dist (Ψ p) (Ψ p)", " ⨅ q, dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q) ≤ dist (Φ p) (Φ p) + dist (Ψ p) (Ψ p)" ]
[]
import Mathlib.LinearAlgebra.Dimension.Free import Mathlib.Algebra.Homology.ShortComplex.ModuleCat open CategoryTheory namespace ModuleCat variable {ι ι' R : Type*} [Ring R] {S : ShortComplex (ModuleCat R)} (hS : S.Exact) (hS' : S.ShortExact) {v : ι → S.X₁} open CategoryTheory Submodule Set section Span
Mathlib/Algebra/Category/ModuleCat/Free.lean
94
125
theorem span_exact {β : Type*} {u : ι ⊕ β → S.X₂} (huv : u ∘ Sum.inl = S.f ∘ v) (hv : ⊤ ≤ span R (range v)) (hw : ⊤ ≤ span R (range (S.g ∘ u ∘ Sum.inr))) : ⊤ ≤ span R (range u) := by
intro m _ have hgm : S.g m ∈ span R (range (S.g ∘ u ∘ Sum.inr)) := hw mem_top rw [Finsupp.mem_span_range_iff_exists_finsupp] at hgm obtain ⟨cm, hm⟩ := hgm let m' : S.X₂ := Finsupp.sum cm fun j a ↦ a • (u (Sum.inr j)) have hsub : m - m' ∈ LinearMap.range S.f := by rw [hS.moduleCat_range_eq_ker] simp only [LinearMap.mem_ker, map_sub, sub_eq_zero] rw [← hm, map_finsupp_sum] simp only [Function.comp_apply, map_smul] obtain ⟨n, hnm⟩ := hsub have hn : n ∈ span R (range v) := hv mem_top rw [Finsupp.mem_span_range_iff_exists_finsupp] at hn obtain ⟨cn, hn⟩ := hn rw [← hn, map_finsupp_sum] at hnm rw [← sub_add_cancel m m', ← hnm,] simp only [map_smul] have hn' : (Finsupp.sum cn fun a b ↦ b • S.f (v a)) = (Finsupp.sum cn fun a b ↦ b • u (Sum.inl a)) := by congr; ext a b; rw [← Function.comp_apply (f := S.f), ← huv, Function.comp_apply] rw [hn'] apply add_mem · rw [Finsupp.mem_span_range_iff_exists_finsupp] use cn.mapDomain (Sum.inl) rw [Finsupp.sum_mapDomain_index_inj Sum.inl_injective] · rw [Finsupp.mem_span_range_iff_exists_finsupp] use cm.mapDomain (Sum.inr) rw [Finsupp.sum_mapDomain_index_inj Sum.inr_injective]
[ " ⊤ ≤ span R (range u)", " m ∈ span R (range u)", " m - m' ∈ LinearMap.range S.f", " m - m' ∈ LinearMap.ker S.g", " S.g m = S.g m'", " (cm.sum fun i a => a • (⇑S.g ∘ u ∘ Sum.inr) i) = cm.sum fun a b => S.g (b • u (Sum.inr a))", " (cn.sum fun a b => S.f (b • v a)) + m' ∈ span R (range u)", " (cn.sum fu...
[]
import Mathlib.Topology.Connected.Basic open Set Function universe u v variable {α : Type u} {β : Type v} {ι : Type*} {π : ι → Type*} [TopologicalSpace α] {s t u v : Set α} section TotallyDisconnected def IsTotallyDisconnected (s : Set α) : Prop := ∀ t, t ⊆ s → IsPreconnected t → t.Subsingleton #align is_totally_disconnected IsTotallyDisconnected theorem isTotallyDisconnected_empty : IsTotallyDisconnected (∅ : Set α) := fun _ ht _ _ x_in _ _ => (ht x_in).elim #align is_totally_disconnected_empty isTotallyDisconnected_empty theorem isTotallyDisconnected_singleton {x} : IsTotallyDisconnected ({x} : Set α) := fun _ ht _ => subsingleton_singleton.anti ht #align is_totally_disconnected_singleton isTotallyDisconnected_singleton @[mk_iff] class TotallyDisconnectedSpace (α : Type u) [TopologicalSpace α] : Prop where isTotallyDisconnected_univ : IsTotallyDisconnected (univ : Set α) #align totally_disconnected_space TotallyDisconnectedSpace theorem IsPreconnected.subsingleton [TotallyDisconnectedSpace α] {s : Set α} (h : IsPreconnected s) : s.Subsingleton := TotallyDisconnectedSpace.isTotallyDisconnected_univ s (subset_univ s) h #align is_preconnected.subsingleton IsPreconnected.subsingleton instance Pi.totallyDisconnectedSpace {α : Type*} {β : α → Type*} [∀ a, TopologicalSpace (β a)] [∀ a, TotallyDisconnectedSpace (β a)] : TotallyDisconnectedSpace (∀ a : α, β a) := ⟨fun t _ h2 => have this : ∀ a, IsPreconnected ((fun x : ∀ a, β a => x a) '' t) := fun a => h2.image (fun x => x a) (continuous_apply a).continuousOn fun x x_in y y_in => funext fun a => (this a).subsingleton ⟨x, x_in, rfl⟩ ⟨y, y_in, rfl⟩⟩ #align pi.totally_disconnected_space Pi.totallyDisconnectedSpace instance Prod.totallyDisconnectedSpace [TopologicalSpace β] [TotallyDisconnectedSpace α] [TotallyDisconnectedSpace β] : TotallyDisconnectedSpace (α × β) := ⟨fun t _ h2 => have H1 : IsPreconnected (Prod.fst '' t) := h2.image Prod.fst continuous_fst.continuousOn have H2 : IsPreconnected (Prod.snd '' t) := h2.image Prod.snd continuous_snd.continuousOn fun x hx y hy => Prod.ext (H1.subsingleton ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩) (H2.subsingleton ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩)⟩ #align prod.totally_disconnected_space Prod.totallyDisconnectedSpace instance [TopologicalSpace β] [TotallyDisconnectedSpace α] [TotallyDisconnectedSpace β] : TotallyDisconnectedSpace (Sum α β) := by refine ⟨fun s _ hs => ?_⟩ obtain ⟨t, ht, rfl⟩ | ⟨t, ht, rfl⟩ := Sum.isPreconnected_iff.1 hs · exact ht.subsingleton.image _ · exact ht.subsingleton.image _ instance [∀ i, TopologicalSpace (π i)] [∀ i, TotallyDisconnectedSpace (π i)] : TotallyDisconnectedSpace (Σi, π i) := by refine ⟨fun s _ hs => ?_⟩ obtain rfl | h := s.eq_empty_or_nonempty · exact subsingleton_empty · obtain ⟨a, t, ht, rfl⟩ := Sigma.isConnected_iff.1 ⟨h, hs⟩ exact ht.isPreconnected.subsingleton.image _ -- Porting note: reformulated using `Pairwise` theorem isTotallyDisconnected_of_isClopen_set {X : Type*} [TopologicalSpace X] (hX : Pairwise fun x y => ∃ (U : Set X), IsClopen U ∧ x ∈ U ∧ y ∉ U) : IsTotallyDisconnected (Set.univ : Set X) := by rintro S - hS unfold Set.Subsingleton by_contra! h_contra rcases h_contra with ⟨x, hx, y, hy, hxy⟩ obtain ⟨U, hU, hxU, hyU⟩ := hX hxy specialize hS U Uᶜ hU.2 hU.compl.2 (fun a _ => em (a ∈ U)) ⟨x, hx, hxU⟩ ⟨y, hy, hyU⟩ rw [inter_compl_self, Set.inter_empty] at hS exact Set.not_nonempty_empty hS #align is_totally_disconnected_of_clopen_set isTotallyDisconnected_of_isClopen_set
Mathlib/Topology/Connected/TotallyDisconnected.lean
108
119
theorem totallyDisconnectedSpace_iff_connectedComponent_subsingleton : TotallyDisconnectedSpace α ↔ ∀ x : α, (connectedComponent x).Subsingleton := by
constructor · intro h x apply h.1 · exact subset_univ _ exact isPreconnected_connectedComponent intro h; constructor intro s s_sub hs rcases eq_empty_or_nonempty s with (rfl | ⟨x, x_in⟩) · exact subsingleton_empty · exact (h x).anti (hs.subset_connectedComponent x_in)
[ " TotallyDisconnectedSpace (α ⊕ β)", " s.Subsingleton", " (Sum.inl '' t).Subsingleton", " (Sum.inr '' t).Subsingleton", " TotallyDisconnectedSpace ((i : ι) × π i)", " ∅.Subsingleton", " (Sigma.mk a '' t).Subsingleton", " IsTotallyDisconnected univ", " S.Subsingleton", " ∀ ⦃x : X⦄, x ∈ S → ∀ ⦃y : X...
[ " TotallyDisconnectedSpace (α ⊕ β)", " s.Subsingleton", " (Sum.inl '' t).Subsingleton", " (Sum.inr '' t).Subsingleton", " TotallyDisconnectedSpace ((i : ι) × π i)", " ∅.Subsingleton", " (Sigma.mk a '' t).Subsingleton", " IsTotallyDisconnected univ", " S.Subsingleton", " ∀ ⦃x : X⦄, x ∈ S → ∀ ⦃y : X...
import Mathlib.Probability.Kernel.Composition import Mathlib.MeasureTheory.Integral.SetIntegral #align_import probability.kernel.integral_comp_prod from "leanprover-community/mathlib"@"c0d694db494dd4f9aa57f2714b6e4c82b4ebc113" noncomputable section open scoped Topology ENNReal MeasureTheory ProbabilityTheory open Set Function Real ENNReal MeasureTheory Filter ProbabilityTheory ProbabilityTheory.kernel variable {α β γ E : Type*} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {mγ : MeasurableSpace γ} [NormedAddCommGroup E] {κ : kernel α β} [IsSFiniteKernel κ] {η : kernel (α × β) γ} [IsSFiniteKernel η] {a : α} namespace ProbabilityTheory
Mathlib/Probability/Kernel/IntegralCompProd.lean
48
61
theorem hasFiniteIntegral_prod_mk_left (a : α) {s : Set (β × γ)} (h2s : (κ ⊗ₖ η) a s ≠ ∞) : HasFiniteIntegral (fun b => (η (a, b) (Prod.mk b ⁻¹' s)).toReal) (κ a) := by
let t := toMeasurable ((κ ⊗ₖ η) a) s simp_rw [HasFiniteIntegral, ennnorm_eq_ofReal toReal_nonneg] calc ∫⁻ b, ENNReal.ofReal (η (a, b) (Prod.mk b ⁻¹' s)).toReal ∂κ a _ ≤ ∫⁻ b, η (a, b) (Prod.mk b ⁻¹' t) ∂κ a := by refine lintegral_mono_ae ?_ filter_upwards [ae_kernel_lt_top a h2s] with b hb rw [ofReal_toReal hb.ne] exact measure_mono (preimage_mono (subset_toMeasurable _ _)) _ ≤ (κ ⊗ₖ η) a t := le_compProd_apply _ _ _ _ _ = (κ ⊗ₖ η) a s := measure_toMeasurable s _ < ⊤ := h2s.lt_top
[ " HasFiniteIntegral (fun b => ((η (a, b)) (Prod.mk b ⁻¹' s)).toReal) (κ a)", " ∫⁻ (a_1 : β), ENNReal.ofReal ((η (a, a_1)) (Prod.mk a_1 ⁻¹' s)).toReal ∂κ a < ⊤", " ∫⁻ (b : β), ENNReal.ofReal ((η (a, b)) (Prod.mk b ⁻¹' s)).toReal ∂κ a ≤ ∫⁻ (b : β), (η (a, b)) (Prod.mk b ⁻¹' t) ∂κ a", " ∀ᵐ (a_1 : β) ∂κ a, ENNRea...
[]
import Mathlib.Analysis.SpecialFunctions.Complex.Arg import Mathlib.Analysis.SpecialFunctions.Log.Basic #align_import analysis.special_functions.complex.log from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section namespace Complex open Set Filter Bornology open scoped Real Topology ComplexConjugate -- Porting note: @[pp_nodot] does not exist in mathlib4 noncomputable def log (x : ℂ) : ℂ := x.abs.log + arg x * I #align complex.log Complex.log theorem log_re (x : ℂ) : x.log.re = x.abs.log := by simp [log] #align complex.log_re Complex.log_re theorem log_im (x : ℂ) : x.log.im = x.arg := by simp [log] #align complex.log_im Complex.log_im theorem neg_pi_lt_log_im (x : ℂ) : -π < (log x).im := by simp only [log_im, neg_pi_lt_arg] #align complex.neg_pi_lt_log_im Complex.neg_pi_lt_log_im theorem log_im_le_pi (x : ℂ) : (log x).im ≤ π := by simp only [log_im, arg_le_pi] #align complex.log_im_le_pi Complex.log_im_le_pi theorem exp_log {x : ℂ} (hx : x ≠ 0) : exp (log x) = x := by rw [log, exp_add_mul_I, ← ofReal_sin, sin_arg, ← ofReal_cos, cos_arg hx, ← ofReal_exp, Real.exp_log (abs.pos hx), mul_add, ofReal_div, ofReal_div, mul_div_cancel₀ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), ← mul_assoc, mul_div_cancel₀ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), re_add_im] #align complex.exp_log Complex.exp_log @[simp] theorem range_exp : Set.range exp = {0}ᶜ := Set.ext fun x => ⟨by rintro ⟨x, rfl⟩ exact exp_ne_zero x, fun hx => ⟨log x, exp_log hx⟩⟩ #align complex.range_exp Complex.range_exp theorem log_exp {x : ℂ} (hx₁ : -π < x.im) (hx₂ : x.im ≤ π) : log (exp x) = x := by rw [log, abs_exp, Real.log_exp, exp_eq_exp_re_mul_sin_add_cos, ← ofReal_exp, arg_mul_cos_add_sin_mul_I (Real.exp_pos _) ⟨hx₁, hx₂⟩, re_add_im] #align complex.log_exp Complex.log_exp theorem exp_inj_of_neg_pi_lt_of_le_pi {x y : ℂ} (hx₁ : -π < x.im) (hx₂ : x.im ≤ π) (hy₁ : -π < y.im) (hy₂ : y.im ≤ π) (hxy : exp x = exp y) : x = y := by rw [← log_exp hx₁ hx₂, ← log_exp hy₁ hy₂, hxy] #align complex.exp_inj_of_neg_pi_lt_of_le_pi Complex.exp_inj_of_neg_pi_lt_of_le_pi theorem ofReal_log {x : ℝ} (hx : 0 ≤ x) : (x.log : ℂ) = log x := Complex.ext (by rw [log_re, ofReal_re, abs_of_nonneg hx]) (by rw [ofReal_im, log_im, arg_ofReal_of_nonneg hx]) #align complex.of_real_log Complex.ofReal_log @[simp, norm_cast] lemma natCast_log {n : ℕ} : Real.log n = log n := ofReal_natCast n ▸ ofReal_log n.cast_nonneg @[simp] lemma ofNat_log {n : ℕ} [n.AtLeastTwo] : Real.log (no_index (OfNat.ofNat n)) = log (OfNat.ofNat n) := natCast_log
Mathlib/Analysis/SpecialFunctions/Complex/Log.lean
83
83
theorem log_ofReal_re (x : ℝ) : (log (x : ℂ)).re = Real.log x := by
simp [log_re]
[ " x.log.re = (abs x).log", " x.log.im = x.arg", " -π < x.log.im", " x.log.im ≤ π", " cexp x.log = x", " x ∈ Set.range cexp → x ∈ {0}ᶜ", " cexp x ∈ {0}ᶜ", " (cexp x).log = x", " x = y", " (↑x.log).re = (↑x).log.re", " (↑x.log).im = (↑x).log.im", " (↑x).log.re = x.log" ]
[ " x.log.re = (abs x).log", " x.log.im = x.arg", " -π < x.log.im", " x.log.im ≤ π", " cexp x.log = x", " x ∈ Set.range cexp → x ∈ {0}ᶜ", " cexp x ∈ {0}ᶜ", " (cexp x).log = x", " x = y", " (↑x.log).re = (↑x).log.re", " (↑x.log).im = (↑x).log.im" ]
import Mathlib.Analysis.Normed.Group.SemiNormedGroupCat import Mathlib.Analysis.Normed.Group.Quotient import Mathlib.CategoryTheory.Limits.Shapes.Kernels #align_import analysis.normed.group.SemiNormedGroup.kernels from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" open CategoryTheory CategoryTheory.Limits universe u namespace SemiNormedGroupCat section Cokernel -- PROJECT: can we reuse the work to construct cokernels in `SemiNormedGroupCat₁` here? -- I don't see a way to do this that is less work than just repeating the relevant parts. noncomputable def cokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : Cofork f 0 := @Cofork.ofπ _ _ _ _ _ _ (SemiNormedGroupCat.of (Y ⧸ NormedAddGroupHom.range f)) f.range.normedMk (by ext a simp only [comp_apply, Limits.zero_comp] -- Porting note: `simp` not firing on the below -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [comp_apply, NormedAddGroupHom.zero_apply] -- Porting note: Lean 3 didn't need this instance letI : SeminormedAddCommGroup ((forget SemiNormedGroupCat).obj Y) := (inferInstance : SeminormedAddCommGroup Y) -- Porting note: again simp doesn't seem to be firing in the below line -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← NormedAddGroupHom.mem_ker, f.range.ker_normedMk, f.mem_range] -- This used to be `simp only [exists_apply_eq_apply]` before leanprover/lean4#2644 convert exists_apply_eq_apply f a) set_option linter.uppercaseLean3 false in #align SemiNormedGroup.cokernel_cocone SemiNormedGroupCat.cokernelCocone noncomputable def cokernelLift {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) (s : CokernelCofork f) : (cokernelCocone f).pt ⟶ s.pt := NormedAddGroupHom.lift _ s.π (by rintro _ ⟨b, rfl⟩ change (f ≫ s.π) b = 0 simp -- This used to be the end of the proof before leanprover/lean4#2644 erw [zero_apply]) set_option linter.uppercaseLean3 false in #align SemiNormedGroup.cokernel_lift SemiNormedGroupCat.cokernelLift noncomputable def isColimitCokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : IsColimit (cokernelCocone f) := isColimitAux _ (cokernelLift f) (fun s => by ext apply NormedAddGroupHom.lift_mk f.range rintro _ ⟨b, rfl⟩ change (f ≫ s.π) b = 0 simp -- This used to be the end of the proof before leanprover/lean4#2644 erw [zero_apply]) fun s m w => NormedAddGroupHom.lift_unique f.range _ _ _ w set_option linter.uppercaseLean3 false in #align SemiNormedGroup.is_colimit_cokernel_cocone SemiNormedGroupCat.isColimitCokernelCocone instance : HasCokernels SemiNormedGroupCat.{u} where has_colimit f := HasColimit.mk { cocone := cokernelCocone f isColimit := isColimitCokernelCocone f } -- Sanity check example : HasCokernels SemiNormedGroupCat := by infer_instance section ExplicitCokernel noncomputable def explicitCokernel {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : SemiNormedGroupCat.{u} := (cokernelCocone f).pt set_option linter.uppercaseLean3 false in #align SemiNormedGroup.explicit_cokernel SemiNormedGroupCat.explicitCokernel noncomputable def explicitCokernelDesc {X Y Z : SemiNormedGroupCat.{u}} {f : X ⟶ Y} {g : Y ⟶ Z} (w : f ≫ g = 0) : explicitCokernel f ⟶ Z := (isColimitCokernelCocone f).desc (Cofork.ofπ g (by simp [w])) set_option linter.uppercaseLean3 false in #align SemiNormedGroup.explicit_cokernel_desc SemiNormedGroupCat.explicitCokernelDesc noncomputable def explicitCokernelπ {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : Y ⟶ explicitCokernel f := (cokernelCocone f).ι.app WalkingParallelPair.one set_option linter.uppercaseLean3 false in #align SemiNormedGroup.explicit_cokernel_π SemiNormedGroupCat.explicitCokernelπ theorem explicitCokernelπ_surjective {X Y : SemiNormedGroupCat.{u}} {f : X ⟶ Y} : Function.Surjective (explicitCokernelπ f) := surjective_quot_mk _ set_option linter.uppercaseLean3 false in #align SemiNormedGroup.explicit_cokernel_π_surjective SemiNormedGroupCat.explicitCokernelπ_surjective @[simp, reassoc]
Mathlib/Analysis/Normed/Group/SemiNormedGroupCat/Kernels.lean
242
245
theorem comp_explicitCokernelπ {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : f ≫ explicitCokernelπ f = 0 := by
convert (cokernelCocone f).w WalkingParallelPairHom.left simp
[ " f ≫ (NormedAddGroupHom.range f).normedMk = 0 ≫ (NormedAddGroupHom.range f).normedMk", " (f ≫ (NormedAddGroupHom.range f).normedMk) a = (0 ≫ (NormedAddGroupHom.range f).normedMk) a", " (f ≫ (NormedAddGroupHom.range f).normedMk) a = 0 a", " (NormedAddGroupHom.range f).normedMk (f a) = 0", " ∃ w, f w = f a",...
[ " f ≫ (NormedAddGroupHom.range f).normedMk = 0 ≫ (NormedAddGroupHom.range f).normedMk", " (f ≫ (NormedAddGroupHom.range f).normedMk) a = (0 ≫ (NormedAddGroupHom.range f).normedMk) a", " (f ≫ (NormedAddGroupHom.range f).normedMk) a = 0 a", " (NormedAddGroupHom.range f).normedMk (f a) = 0", " ∃ w, f w = f a",...
import Mathlib.Order.CompleteLattice import Mathlib.Order.GaloisConnection import Mathlib.Data.Set.Lattice import Mathlib.Tactic.AdaptationNote #align_import data.rel from "leanprover-community/mathlib"@"706d88f2b8fdfeb0b22796433d7a6c1a010af9f2" variable {α β γ : Type*} def Rel (α β : Type*) := α → β → Prop -- deriving CompleteLattice, Inhabited #align rel Rel -- Porting note: `deriving` above doesn't work. instance : CompleteLattice (Rel α β) := show CompleteLattice (α → β → Prop) from inferInstance instance : Inhabited (Rel α β) := show Inhabited (α → β → Prop) from inferInstance namespace Rel variable (r : Rel α β) -- Porting note: required for later theorems. @[ext] theorem ext {r s : Rel α β} : (∀ a, r a = s a) → r = s := funext def inv : Rel β α := flip r #align rel.inv Rel.inv theorem inv_def (x : α) (y : β) : r.inv y x ↔ r x y := Iff.rfl #align rel.inv_def Rel.inv_def theorem inv_inv : inv (inv r) = r := by ext x y rfl #align rel.inv_inv Rel.inv_inv def dom := { x | ∃ y, r x y } #align rel.dom Rel.dom theorem dom_mono {r s : Rel α β} (h : r ≤ s) : dom r ⊆ dom s := fun a ⟨b, hx⟩ => ⟨b, h a b hx⟩ #align rel.dom_mono Rel.dom_mono def codom := { y | ∃ x, r x y } #align rel.codom Rel.codom theorem codom_inv : r.inv.codom = r.dom := by ext x rfl #align rel.codom_inv Rel.codom_inv theorem dom_inv : r.inv.dom = r.codom := by ext x rfl #align rel.dom_inv Rel.dom_inv def comp (r : Rel α β) (s : Rel β γ) : Rel α γ := fun x z => ∃ y, r x y ∧ s y z #align rel.comp Rel.comp -- Porting note: the original `∘` syntax can't be overloaded here, lean considers it ambiguous. local infixr:90 " • " => Rel.comp theorem comp_assoc {δ : Type*} (r : Rel α β) (s : Rel β γ) (t : Rel γ δ) : (r • s) • t = r • (s • t) := by unfold comp; ext (x w); constructor · rintro ⟨z, ⟨y, rxy, syz⟩, tzw⟩; exact ⟨y, rxy, z, syz, tzw⟩ · rintro ⟨y, rxy, z, syz, tzw⟩; exact ⟨z, ⟨y, rxy, syz⟩, tzw⟩ #align rel.comp_assoc Rel.comp_assoc @[simp] theorem comp_right_id (r : Rel α β) : r • @Eq β = r := by unfold comp ext y simp #align rel.comp_right_id Rel.comp_right_id @[simp] theorem comp_left_id (r : Rel α β) : @Eq α • r = r := by unfold comp ext x simp #align rel.comp_left_id Rel.comp_left_id @[simp] theorem comp_right_bot (r : Rel α β) : r • (⊥ : Rel β γ) = ⊥ := by ext x y simp [comp, Bot.bot] @[simp]
Mathlib/Data/Rel.lean
131
133
theorem comp_left_bot (r : Rel α β) : (⊥ : Rel γ α) • r = ⊥ := by
ext x y simp [comp, Bot.bot]
[ " r.inv.inv = r", " r.inv.inv x y ↔ r x y", " r.inv.codom = r.dom", " x ∈ r.inv.codom ↔ x ∈ r.dom", " r.inv.dom = r.codom", " x ∈ r.inv.dom ↔ x ∈ r.codom", " (r • s) • t = r • s • t", " (fun x z => ∃ y, (∃ y_1, r x y_1 ∧ s y_1 y) ∧ t y z) = fun x z => ∃ y, r x y ∧ ∃ y_1, s y y_1 ∧ t y_1 z", " (∃ y, ...
[ " r.inv.inv = r", " r.inv.inv x y ↔ r x y", " r.inv.codom = r.dom", " x ∈ r.inv.codom ↔ x ∈ r.dom", " r.inv.dom = r.codom", " x ∈ r.inv.dom ↔ x ∈ r.codom", " (r • s) • t = r • s • t", " (fun x z => ∃ y, (∃ y_1, r x y_1 ∧ s y_1 y) ∧ t y z) = fun x z => ∃ y, r x y ∧ ∃ y_1, s y y_1 ∧ t y_1 z", " (∃ y, ...
import Mathlib.Algebra.BigOperators.Fin import Mathlib.Algebra.GeomSum import Mathlib.LinearAlgebra.Matrix.Block import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.Nondegenerate #align_import linear_algebra.vandermonde from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" variable {R : Type*} [CommRing R] open Equiv Finset open Matrix namespace Matrix def vandermonde {n : ℕ} (v : Fin n → R) : Matrix (Fin n) (Fin n) R := fun i j => v i ^ (j : ℕ) #align matrix.vandermonde Matrix.vandermonde @[simp] theorem vandermonde_apply {n : ℕ} (v : Fin n → R) (i j) : vandermonde v i j = v i ^ (j : ℕ) := rfl #align matrix.vandermonde_apply Matrix.vandermonde_apply @[simp] theorem vandermonde_cons {n : ℕ} (v0 : R) (v : Fin n → R) : vandermonde (Fin.cons v0 v : Fin n.succ → R) = Fin.cons (fun (j : Fin n.succ) => v0 ^ (j : ℕ)) fun i => Fin.cons 1 fun j => v i * vandermonde v i j := by ext i j refine Fin.cases (by simp) (fun i => ?_) i refine Fin.cases (by simp) (fun j => ?_) j simp [pow_succ'] #align matrix.vandermonde_cons Matrix.vandermonde_cons theorem vandermonde_succ {n : ℕ} (v : Fin n.succ → R) : vandermonde v = Fin.cons (fun (j : Fin n.succ) => v 0 ^ (j : ℕ)) fun i => Fin.cons 1 fun j => v i.succ * vandermonde (Fin.tail v) i j := by conv_lhs => rw [← Fin.cons_self_tail v, vandermonde_cons] rfl #align matrix.vandermonde_succ Matrix.vandermonde_succ
Mathlib/LinearAlgebra/Vandermonde.lean
67
69
theorem vandermonde_mul_vandermonde_transpose {n : ℕ} (v w : Fin n → R) (i j) : (vandermonde v * (vandermonde w)ᵀ) i j = ∑ k : Fin n, (v i * w j) ^ (k : ℕ) := by
simp only [vandermonde_apply, Matrix.mul_apply, Matrix.transpose_apply, mul_pow]
[ " vandermonde (Fin.cons v0 v) = Fin.cons (fun j => v0 ^ ↑j) fun i => Fin.cons 1 fun j => v i * vandermonde v i j", " vandermonde (Fin.cons v0 v) i j =\n Fin.cons (fun j => v0 ^ ↑j) (fun i => Fin.cons 1 fun j => v i * vandermonde v i j) i j", " vandermonde (Fin.cons v0 v) 0 j =\n Fin.cons (fun j => v0 ^ ↑j...
[ " vandermonde (Fin.cons v0 v) = Fin.cons (fun j => v0 ^ ↑j) fun i => Fin.cons 1 fun j => v i * vandermonde v i j", " vandermonde (Fin.cons v0 v) i j =\n Fin.cons (fun j => v0 ^ ↑j) (fun i => Fin.cons 1 fun j => v i * vandermonde v i j) i j", " vandermonde (Fin.cons v0 v) 0 j =\n Fin.cons (fun j => v0 ^ ↑j...
import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Algebra.Order.Group.Int import Mathlib.Algebra.Order.Ring.Nat import Mathlib.Algebra.Ring.Rat import Mathlib.Data.PNat.Defs #align_import data.rat.lemmas from "leanprover-community/mathlib"@"550b58538991c8977703fdeb7c9d51a5aa27df11" namespace Rat open Rat theorem num_dvd (a) {b : ℤ} (b0 : b ≠ 0) : (a /. b).num ∣ a := by cases' e : a /. b with n d h c rw [Rat.mk'_eq_divInt, divInt_eq_iff b0 (mod_cast h)] at e refine Int.natAbs_dvd.1 <| Int.dvd_natAbs.1 <| Int.natCast_dvd_natCast.2 <| c.dvd_of_dvd_mul_right ?_ have := congr_arg Int.natAbs e simp only [Int.natAbs_mul, Int.natAbs_ofNat] at this; simp [this] #align rat.num_dvd Rat.num_dvd theorem den_dvd (a b : ℤ) : ((a /. b).den : ℤ) ∣ b := by by_cases b0 : b = 0; · simp [b0] cases' e : a /. b with n d h c rw [mk'_eq_divInt, divInt_eq_iff b0 (ne_of_gt (Int.natCast_pos.2 (Nat.pos_of_ne_zero h)))] at e refine Int.dvd_natAbs.1 <| Int.natCast_dvd_natCast.2 <| c.symm.dvd_of_dvd_mul_left ?_ rw [← Int.natAbs_mul, ← Int.natCast_dvd_natCast, Int.dvd_natAbs, ← e]; simp #align rat.denom_dvd Rat.den_dvd theorem num_den_mk {q : ℚ} {n d : ℤ} (hd : d ≠ 0) (qdf : q = n /. d) : ∃ c : ℤ, n = c * q.num ∧ d = c * q.den := by obtain rfl | hn := eq_or_ne n 0 · simp [qdf] have : q.num * d = n * ↑q.den := by refine (divInt_eq_iff ?_ hd).mp ?_ · exact Int.natCast_ne_zero.mpr (Rat.den_nz _) · rwa [num_divInt_den] have hqdn : q.num ∣ n := by rw [qdf] exact Rat.num_dvd _ hd refine ⟨n / q.num, ?_, ?_⟩ · rw [Int.ediv_mul_cancel hqdn] · refine Int.eq_mul_div_of_mul_eq_mul_of_dvd_left ?_ hqdn this rw [qdf] exact Rat.num_ne_zero.2 ((divInt_ne_zero hd).mpr hn) #align rat.num_denom_mk Rat.num_den_mk #noalign rat.mk_pnat_num #noalign rat.mk_pnat_denom
Mathlib/Data/Rat/Lemmas.lean
62
68
theorem num_mk (n d : ℤ) : (n /. d).num = d.sign * n / n.gcd d := by
have (m : ℕ) : Int.natAbs (m + 1) = m + 1 := by rw [← Nat.cast_one, ← Nat.cast_add, Int.natAbs_cast] rcases d with ((_ | _) | _) <;> rw [← Int.div_eq_ediv_of_dvd] <;> simp [divInt, mkRat, Rat.normalize, Nat.succPNat, Int.sign, Int.gcd, Int.zero_ediv, Int.ofNat_dvd_left, Nat.gcd_dvd_left, this]
[ " (a /. b).num ∣ a", " { num := n, den := d, den_nz := h, reduced := c }.num ∣ a", " n.natAbs ∣ a.natAbs * d", " ↑(a /. b).den ∣ b", " ↑{ num := n, den := d, den_nz := h, reduced := c }.den ∣ b", " d ∣ n.natAbs * b.natAbs", " ↑d ∣ a * ↑d", " ∃ c, n = c * q.num ∧ d = c * ↑q.den", " ∃ c, 0 = c * q.num...
[ " (a /. b).num ∣ a", " { num := n, den := d, den_nz := h, reduced := c }.num ∣ a", " n.natAbs ∣ a.natAbs * d", " ↑(a /. b).den ∣ b", " ↑{ num := n, den := d, den_nz := h, reduced := c }.den ∣ b", " d ∣ n.natAbs * b.natAbs", " ↑d ∣ a * ↑d", " ∃ c, n = c * q.num ∧ d = c * ↑q.den", " ∃ c, 0 = c * q.num...
import Mathlib.LinearAlgebra.Contraction import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff #align_import linear_algebra.trace from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" noncomputable section universe u v w namespace LinearMap open Matrix open FiniteDimensional open TensorProduct section variable (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] variable {ι : Type w} [DecidableEq ι] [Fintype ι] variable {κ : Type*} [DecidableEq κ] [Fintype κ] variable (b : Basis ι R M) (c : Basis κ R M) def traceAux : (M →ₗ[R] M) →ₗ[R] R := Matrix.traceLinearMap ι R R ∘ₗ ↑(LinearMap.toMatrix b b) #align linear_map.trace_aux LinearMap.traceAux -- Can't be `simp` because it would cause a loop. theorem traceAux_def (b : Basis ι R M) (f : M →ₗ[R] M) : traceAux R b f = Matrix.trace (LinearMap.toMatrix b b f) := rfl #align linear_map.trace_aux_def LinearMap.traceAux_def theorem traceAux_eq : traceAux R b = traceAux R c := LinearMap.ext fun f => calc Matrix.trace (LinearMap.toMatrix b b f) = Matrix.trace (LinearMap.toMatrix b b ((LinearMap.id.comp f).comp LinearMap.id)) := by rw [LinearMap.id_comp, LinearMap.comp_id] _ = Matrix.trace (LinearMap.toMatrix c b LinearMap.id * LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id) := by rw [LinearMap.toMatrix_comp _ c, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id * LinearMap.toMatrix c b LinearMap.id) := by rw [Matrix.mul_assoc, Matrix.trace_mul_comm] _ = Matrix.trace (LinearMap.toMatrix c c ((f.comp LinearMap.id).comp LinearMap.id)) := by rw [LinearMap.toMatrix_comp _ b, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f) := by rw [LinearMap.comp_id, LinearMap.comp_id] #align linear_map.trace_aux_eq LinearMap.traceAux_eq open scoped Classical variable (M) def trace : (M →ₗ[R] M) →ₗ[R] R := if H : ∃ s : Finset M, Nonempty (Basis s R M) then traceAux R H.choose_spec.some else 0 #align linear_map.trace LinearMap.trace variable {M}
Mathlib/LinearAlgebra/Trace.lean
84
89
theorem trace_eq_matrix_trace_of_finset {s : Finset M} (b : Basis s R M) (f : M →ₗ[R] M) : trace R M f = Matrix.trace (LinearMap.toMatrix b b f) := by
have : ∃ s : Finset M, Nonempty (Basis s R M) := ⟨s, ⟨b⟩⟩ rw [trace, dif_pos this, ← traceAux_def] congr 1 apply traceAux_eq
[ " ((toMatrix b b) f).trace = ((toMatrix b b) ((id ∘ₗ f) ∘ₗ id)).trace", " ((toMatrix b b) ((id ∘ₗ f) ∘ₗ id)).trace = ((toMatrix c b) id * (toMatrix c c) f * (toMatrix b c) id).trace", " ((toMatrix c b) id * (toMatrix c c) f * (toMatrix b c) id).trace =\n ((toMatrix c c) f * (toMatrix b c) id * (toMatrix c b)...
[ " ((toMatrix b b) f).trace = ((toMatrix b b) ((id ∘ₗ f) ∘ₗ id)).trace", " ((toMatrix b b) ((id ∘ₗ f) ∘ₗ id)).trace = ((toMatrix c b) id * (toMatrix c c) f * (toMatrix b c) id).trace", " ((toMatrix c b) id * (toMatrix c c) f * (toMatrix b c) id).trace =\n ((toMatrix c c) f * (toMatrix b c) id * (toMatrix c b)...
import Mathlib.Algebra.Group.Center import Mathlib.Data.Int.Cast.Lemmas #align_import group_theory.subsemigroup.center from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" variable {M : Type*} namespace Set variable (M) @[simp] theorem natCast_mem_center [NonAssocSemiring M] (n : ℕ) : (n : M) ∈ Set.center M where comm _:= by rw [Nat.commute_cast] left_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, zero_mul, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, one_mul, ihn, add_mul, add_mul, one_mul] mid_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, mul_zero, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, mul_add, add_mul, ihn, mul_add, one_mul, mul_one] right_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, mul_zero, mul_zero, mul_zero] | succ n ihn => rw [Nat.cast_succ, mul_add, ihn, mul_add, mul_add, mul_one, mul_one] -- See note [no_index around OfNat.ofNat] @[simp] theorem ofNat_mem_center [NonAssocSemiring M] (n : ℕ) [n.AtLeastTwo] : (no_index (OfNat.ofNat n)) ∈ Set.center M := natCast_mem_center M n @[simp] theorem intCast_mem_center [NonAssocRing M] (n : ℤ) : (n : M) ∈ Set.center M where comm _ := by rw [Int.commute_cast] left_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).left_assoc _ _] | Int.negSucc n => by rw [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev, add_mul, add_mul, add_mul, neg_mul, one_mul, neg_mul 1, one_mul, ← neg_mul, add_right_inj, neg_mul, (natCast_mem_center _ n).left_assoc _ _, neg_mul, neg_mul] mid_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).mid_assoc _ _] | Int.negSucc n => by simp only [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev] rw [add_mul, mul_add, add_mul, mul_add, neg_mul, one_mul] rw [neg_mul, mul_neg, mul_one, mul_neg, neg_mul, neg_mul] rw [(natCast_mem_center _ n).mid_assoc _ _] simp only [mul_neg] right_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).right_assoc _ _] | Int.negSucc n => by simp only [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev] rw [mul_add, mul_add, mul_add, mul_neg, mul_one, mul_neg, mul_neg, mul_one, mul_neg, add_right_inj, (natCast_mem_center _ n).right_assoc _ _, mul_neg, mul_neg] variable {M} @[simp]
Mathlib/Algebra/Ring/Center.lean
72
77
theorem add_mem_center [Distrib M] {a b : M} (ha : a ∈ Set.center M) (hb : b ∈ Set.center M) : a + b ∈ Set.center M where comm _ := by
rw [add_mul, mul_add, ha.comm, hb.comm] left_assoc _ _ := by rw [add_mul, ha.left_assoc, hb.left_assoc, ← add_mul, ← add_mul] mid_assoc _ _ := by rw [mul_add, add_mul, ha.mid_assoc, hb.mid_assoc, ← mul_add, ← add_mul] right_assoc _ _ := by rw [mul_add, ha.right_assoc, hb.right_assoc, ← mul_add, ← mul_add]
[ " ↑n * x✝ = x✝ * ↑n", " ↑n * (x✝¹ * x✝) = ↑n * x✝¹ * x✝", " ↑0 * (x✝¹ * x✝) = ↑0 * x✝¹ * x✝", " ↑(n + 1) * (x✝¹ * x✝) = ↑(n + 1) * x✝¹ * x✝", " x✝¹ * ↑n * x✝ = x✝¹ * (↑n * x✝)", " x✝¹ * ↑0 * x✝ = x✝¹ * (↑0 * x✝)", " x✝¹ * ↑(n + 1) * x✝ = x✝¹ * (↑(n + 1) * x✝)", " x✝¹ * x✝ * ↑n = x✝¹ * (x✝ * ↑n)", " ...
[ " ↑n * x✝ = x✝ * ↑n", " ↑n * (x✝¹ * x✝) = ↑n * x✝¹ * x✝", " ↑0 * (x✝¹ * x✝) = ↑0 * x✝¹ * x✝", " ↑(n + 1) * (x✝¹ * x✝) = ↑(n + 1) * x✝¹ * x✝", " x✝¹ * ↑n * x✝ = x✝¹ * (↑n * x✝)", " x✝¹ * ↑0 * x✝ = x✝¹ * (↑0 * x✝)", " x✝¹ * ↑(n + 1) * x✝ = x✝¹ * (↑(n + 1) * x✝)", " x✝¹ * x✝ * ↑n = x✝¹ * (x✝ * ↑n)", " ...
import Mathlib.Data.Nat.Factorial.Basic import Mathlib.Order.Monotone.Basic #align_import data.nat.choose.basic from "leanprover-community/mathlib"@"2f3994e1b117b1e1da49bcfb67334f33460c3ce4" open Nat namespace Nat def choose : ℕ → ℕ → ℕ | _, 0 => 1 | 0, _ + 1 => 0 | n + 1, k + 1 => choose n k + choose n (k + 1) #align nat.choose Nat.choose @[simp]
Mathlib/Data/Nat/Choose/Basic.lean
54
54
theorem choose_zero_right (n : ℕ) : choose n 0 = 1 := by
cases n <;> rfl
[ " n.choose 0 = 1", " choose 0 0 = 1", " (n✝ + 1).choose 0 = 1" ]
[]
import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Topology.Order.OrderClosed #align_import topology.algebra.with_zero_topology from "leanprover-community/mathlib"@"3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064" open Topology Filter TopologicalSpace Filter Set Function namespace WithZeroTopology variable {α Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀] {γ γ₁ γ₂ : Γ₀} {l : Filter α} {f : α → Γ₀} scoped instance (priority := 100) topologicalSpace : TopologicalSpace Γ₀ := nhdsAdjoint 0 <| ⨅ γ ≠ 0, 𝓟 (Iio γ) #align with_zero_topology.topological_space WithZeroTopology.topologicalSpace theorem nhds_eq_update : (𝓝 : Γ₀ → Filter Γ₀) = update pure 0 (⨅ γ ≠ 0, 𝓟 (Iio γ)) := by rw [nhds_nhdsAdjoint, sup_of_le_right] exact le_iInf₂ fun γ hγ ↦ le_principal_iff.2 <| zero_lt_iff.2 hγ #align with_zero_topology.nhds_eq_update WithZeroTopology.nhds_eq_update
Mathlib/Topology/Algebra/WithZeroTopology.lean
56
57
theorem nhds_zero : 𝓝 (0 : Γ₀) = ⨅ γ ≠ 0, 𝓟 (Iio γ) := by
rw [nhds_eq_update, update_same]
[ " 𝓝 = update pure 0 (⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ))", " pure 0 ≤ ⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ)", " 𝓝 0 = ⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ)" ]
[ " 𝓝 = update pure 0 (⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ))", " pure 0 ≤ ⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ)" ]
import Mathlib.Algebra.BigOperators.Fin import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Data.Finset.Sort import Mathlib.Data.Set.Subsingleton #align_import combinatorics.composition from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" open List variable {n : ℕ} @[ext] structure Composition (n : ℕ) where blocks : List ℕ blocks_pos : ∀ {i}, i ∈ blocks → 0 < i blocks_sum : blocks.sum = n #align composition Composition @[ext] structure CompositionAsSet (n : ℕ) where boundaries : Finset (Fin n.succ) zero_mem : (0 : Fin n.succ) ∈ boundaries getLast_mem : Fin.last n ∈ boundaries #align composition_as_set CompositionAsSet instance {n : ℕ} : Inhabited (CompositionAsSet n) := ⟨⟨Finset.univ, Finset.mem_univ _, Finset.mem_univ _⟩⟩ namespace Composition variable (c : Composition n) instance (n : ℕ) : ToString (Composition n) := ⟨fun c => toString c.blocks⟩ abbrev length : ℕ := c.blocks.length #align composition.length Composition.length theorem blocks_length : c.blocks.length = c.length := rfl #align composition.blocks_length Composition.blocks_length def blocksFun : Fin c.length → ℕ := c.blocks.get #align composition.blocks_fun Composition.blocksFun theorem ofFn_blocksFun : ofFn c.blocksFun = c.blocks := ofFn_get _ #align composition.of_fn_blocks_fun Composition.ofFn_blocksFun theorem sum_blocksFun : ∑ i, c.blocksFun i = n := by conv_rhs => rw [← c.blocks_sum, ← ofFn_blocksFun, sum_ofFn] #align composition.sum_blocks_fun Composition.sum_blocksFun theorem blocksFun_mem_blocks (i : Fin c.length) : c.blocksFun i ∈ c.blocks := get_mem _ _ _ #align composition.blocks_fun_mem_blocks Composition.blocksFun_mem_blocks @[simp] theorem one_le_blocks {i : ℕ} (h : i ∈ c.blocks) : 1 ≤ i := c.blocks_pos h #align composition.one_le_blocks Composition.one_le_blocks @[simp] theorem one_le_blocks' {i : ℕ} (h : i < c.length) : 1 ≤ c.blocks.get ⟨i, h⟩ := c.one_le_blocks (get_mem (blocks c) i h) #align composition.one_le_blocks' Composition.one_le_blocks' @[simp] theorem blocks_pos' (i : ℕ) (h : i < c.length) : 0 < c.blocks.get ⟨i, h⟩ := c.one_le_blocks' h #align composition.blocks_pos' Composition.blocks_pos' theorem one_le_blocksFun (i : Fin c.length) : 1 ≤ c.blocksFun i := c.one_le_blocks (c.blocksFun_mem_blocks i) #align composition.one_le_blocks_fun Composition.one_le_blocksFun
Mathlib/Combinatorics/Enumerative/Composition.lean
187
189
theorem length_le : c.length ≤ n := by
conv_rhs => rw [← c.blocks_sum] exact length_le_sum_of_one_le _ fun i hi => c.one_le_blocks hi
[ " ∑ i : Fin c.length, c.blocksFun i = n", "n : ℕ c : Composition n | n", " c.length ≤ n", " c.length ≤ c.blocks.sum" ]
[ " ∑ i : Fin c.length, c.blocksFun i = n", "n : ℕ c : Composition n | n" ]
import Mathlib.Analysis.SpecialFunctions.Bernstein import Mathlib.Topology.Algebra.Algebra #align_import topology.continuous_function.weierstrass from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" open ContinuousMap Filter open scoped unitInterval theorem polynomialFunctions_closure_eq_top' : (polynomialFunctions I).topologicalClosure = ⊤ := by rw [eq_top_iff] rintro f - refine Filter.Frequently.mem_closure ?_ refine Filter.Tendsto.frequently (bernsteinApproximation_uniform f) ?_ apply frequently_of_forall intro n simp only [SetLike.mem_coe] apply Subalgebra.sum_mem rintro n - apply Subalgebra.smul_mem dsimp [bernstein, polynomialFunctions] simp #align polynomial_functions_closure_eq_top' polynomialFunctions_closure_eq_top' theorem polynomialFunctions_closure_eq_top (a b : ℝ) : (polynomialFunctions (Set.Icc a b)).topologicalClosure = ⊤ := by cases' lt_or_le a b with h h -- (Otherwise it's easy; we'll deal with that later.) · -- We can pullback continuous functions on `[a,b]` to continuous functions on `[0,1]`, -- by precomposing with an affine map. let W : C(Set.Icc a b, ℝ) →ₐ[ℝ] C(I, ℝ) := compRightAlgHom ℝ ℝ (iccHomeoI a b h).symm.toContinuousMap -- This operation is itself a homeomorphism -- (with respect to the norm topologies on continuous functions). let W' : C(Set.Icc a b, ℝ) ≃ₜ C(I, ℝ) := compRightHomeomorph ℝ (iccHomeoI a b h).symm have w : (W : C(Set.Icc a b, ℝ) → C(I, ℝ)) = W' := rfl -- Thus we take the statement of the Weierstrass approximation theorem for `[0,1]`, have p := polynomialFunctions_closure_eq_top' -- and pullback both sides, obtaining an equation between subalgebras of `C([a,b], ℝ)`. apply_fun fun s => s.comap W at p simp only [Algebra.comap_top] at p -- Since the pullback operation is continuous, it commutes with taking `topologicalClosure`, rw [Subalgebra.topologicalClosure_comap_homeomorph _ W W' w] at p -- and precomposing with an affine map takes polynomial functions to polynomial functions. rw [polynomialFunctions.comap_compRightAlgHom_iccHomeoI] at p -- 🎉 exact p · -- Otherwise, `b ≤ a`, and the interval is a subsingleton, have : Subsingleton (Set.Icc a b) := (Set.subsingleton_Icc_of_ge h).coe_sort apply Subsingleton.elim #align polynomial_functions_closure_eq_top polynomialFunctions_closure_eq_top theorem continuousMap_mem_polynomialFunctions_closure (a b : ℝ) (f : C(Set.Icc a b, ℝ)) : f ∈ (polynomialFunctions (Set.Icc a b)).topologicalClosure := by rw [polynomialFunctions_closure_eq_top _ _] simp #align continuous_map_mem_polynomial_functions_closure continuousMap_mem_polynomialFunctions_closure open scoped Polynomial theorem exists_polynomial_near_continuousMap (a b : ℝ) (f : C(Set.Icc a b, ℝ)) (ε : ℝ) (pos : 0 < ε) : ∃ p : ℝ[X], ‖p.toContinuousMapOn _ - f‖ < ε := by have w := mem_closure_iff_frequently.mp (continuousMap_mem_polynomialFunctions_closure _ _ f) rw [Metric.nhds_basis_ball.frequently_iff] at w obtain ⟨-, H, ⟨m, ⟨-, rfl⟩⟩⟩ := w ε pos rw [Metric.mem_ball, dist_eq_norm] at H exact ⟨m, H⟩ #align exists_polynomial_near_continuous_map exists_polynomial_near_continuousMap
Mathlib/Topology/ContinuousFunction/Weierstrass.lean
114
122
theorem exists_polynomial_near_of_continuousOn (a b : ℝ) (f : ℝ → ℝ) (c : ContinuousOn f (Set.Icc a b)) (ε : ℝ) (pos : 0 < ε) : ∃ p : ℝ[X], ∀ x ∈ Set.Icc a b, |p.eval x - f x| < ε := by
let f' : C(Set.Icc a b, ℝ) := ⟨fun x => f x, continuousOn_iff_continuous_restrict.mp c⟩ obtain ⟨p, b⟩ := exists_polynomial_near_continuousMap a b f' ε pos use p rw [norm_lt_iff _ pos] at b intro x m exact b ⟨x, m⟩
[ " (polynomialFunctions I).topologicalClosure = ⊤", " ⊤ ≤ (polynomialFunctions I).topologicalClosure", " f ∈ (polynomialFunctions I).topologicalClosure", " ∃ᶠ (x : C(↑I, ℝ)) in nhds f, x ∈ ↑(polynomialFunctions I)", " ∃ᶠ (x : ℕ) in atTop, bernsteinApproximation x f ∈ ↑(polynomialFunctions I)", " ∀ (x : ℕ),...
[ " (polynomialFunctions I).topologicalClosure = ⊤", " ⊤ ≤ (polynomialFunctions I).topologicalClosure", " f ∈ (polynomialFunctions I).topologicalClosure", " ∃ᶠ (x : C(↑I, ℝ)) in nhds f, x ∈ ↑(polynomialFunctions I)", " ∃ᶠ (x : ℕ) in atTop, bernsteinApproximation x f ∈ ↑(polynomialFunctions I)", " ∀ (x : ℕ),...
import Mathlib.Geometry.Manifold.ContMDiff.Atlas import Mathlib.Geometry.Manifold.VectorBundle.FiberwiseLinear import Mathlib.Topology.VectorBundle.Constructions #align_import geometry.manifold.vector_bundle.basic from "leanprover-community/mathlib"@"e473c3198bb41f68560cab68a0529c854b618833" assert_not_exists mfderiv open Bundle Set PartialHomeomorph open Function (id_def) open Filter open scoped Manifold Bundle Topology variable {𝕜 B B' F M : Type*} {E : B → Type*} section variable [TopologicalSpace F] [TopologicalSpace (TotalSpace F E)] [∀ x, TopologicalSpace (E x)] {HB : Type*} [TopologicalSpace HB] [TopologicalSpace B] [ChartedSpace HB B] [FiberBundle F E] instance FiberBundle.chartedSpace' : ChartedSpace (B × F) (TotalSpace F E) where atlas := (fun e : Trivialization F (π F E) => e.toPartialHomeomorph) '' trivializationAtlas F E chartAt x := (trivializationAt F E x.proj).toPartialHomeomorph mem_chart_source x := (trivializationAt F E x.proj).mem_source.mpr (mem_baseSet_trivializationAt F E x.proj) chart_mem_atlas _ := mem_image_of_mem _ (trivialization_mem_atlas F E _) #align fiber_bundle.charted_space FiberBundle.chartedSpace' theorem FiberBundle.chartedSpace'_chartAt (x : TotalSpace F E) : chartAt (B × F) x = (trivializationAt F E x.proj).toPartialHomeomorph := rfl --attribute [local reducible] ModelProd instance FiberBundle.chartedSpace : ChartedSpace (ModelProd HB F) (TotalSpace F E) := ChartedSpace.comp _ (B × F) _ #align fiber_bundle.charted_space' FiberBundle.chartedSpace theorem FiberBundle.chartedSpace_chartAt (x : TotalSpace F E) : chartAt (ModelProd HB F) x = (trivializationAt F E x.proj).toPartialHomeomorph ≫ₕ (chartAt HB x.proj).prod (PartialHomeomorph.refl F) := by dsimp only [chartAt_comp, prodChartedSpace_chartAt, FiberBundle.chartedSpace'_chartAt, chartAt_self_eq] rw [Trivialization.coe_coe, Trivialization.coe_fst' _ (mem_baseSet_trivializationAt F E x.proj)] #align fiber_bundle.charted_space_chart_at FiberBundle.chartedSpace_chartAt theorem FiberBundle.chartedSpace_chartAt_symm_fst (x : TotalSpace F E) (y : ModelProd HB F) (hy : y ∈ (chartAt (ModelProd HB F) x).target) : ((chartAt (ModelProd HB F) x).symm y).proj = (chartAt HB x.proj).symm y.1 := by simp only [FiberBundle.chartedSpace_chartAt, mfld_simps] at hy ⊢ exact (trivializationAt F E x.proj).proj_symm_apply hy.2 #align fiber_bundle.charted_space_chart_at_symm_fst FiberBundle.chartedSpace_chartAt_symm_fst end section variable [NontriviallyNormedField 𝕜] [NormedAddCommGroup F] [NormedSpace 𝕜 F] [TopologicalSpace (TotalSpace F E)] [∀ x, TopologicalSpace (E x)] {EB : Type*} [NormedAddCommGroup EB] [NormedSpace 𝕜 EB] {HB : Type*} [TopologicalSpace HB] (IB : ModelWithCorners 𝕜 EB HB) (E' : B → Type*) [∀ x, Zero (E' x)] {EM : Type*} [NormedAddCommGroup EM] [NormedSpace 𝕜 EM] {HM : Type*} [TopologicalSpace HM] {IM : ModelWithCorners 𝕜 EM HM} [TopologicalSpace M] [ChartedSpace HM M] [Is : SmoothManifoldWithCorners IM M] {n : ℕ∞} variable [TopologicalSpace B] [ChartedSpace HB B] [FiberBundle F E] protected theorem FiberBundle.extChartAt (x : TotalSpace F E) : extChartAt (IB.prod 𝓘(𝕜, F)) x = (trivializationAt F E x.proj).toPartialEquiv ≫ (extChartAt IB x.proj).prod (PartialEquiv.refl F) := by simp_rw [extChartAt, FiberBundle.chartedSpace_chartAt, extend] simp only [PartialEquiv.trans_assoc, mfld_simps] -- Porting note: should not be needed rw [PartialEquiv.prod_trans, PartialEquiv.refl_trans] #align fiber_bundle.ext_chart_at FiberBundle.extChartAt protected theorem FiberBundle.extChartAt_target (x : TotalSpace F E) : (extChartAt (IB.prod 𝓘(𝕜, F)) x).target = ((extChartAt IB x.proj).target ∩ (extChartAt IB x.proj).symm ⁻¹' (trivializationAt F E x.proj).baseSet) ×ˢ univ := by rw [FiberBundle.extChartAt, PartialEquiv.trans_target, Trivialization.target_eq, inter_prod] rfl theorem FiberBundle.writtenInExtChartAt_trivializationAt {x : TotalSpace F E} {y} (hy : y ∈ (extChartAt (IB.prod 𝓘(𝕜, F)) x).target) : writtenInExtChartAt (IB.prod 𝓘(𝕜, F)) (IB.prod 𝓘(𝕜, F)) x (trivializationAt F E x.proj) y = y := writtenInExtChartAt_chartAt_comp _ _ hy theorem FiberBundle.writtenInExtChartAt_trivializationAt_symm {x : TotalSpace F E} {y} (hy : y ∈ (extChartAt (IB.prod 𝓘(𝕜, F)) x).target) : writtenInExtChartAt (IB.prod 𝓘(𝕜, F)) (IB.prod 𝓘(𝕜, F)) (trivializationAt F E x.proj x) (trivializationAt F E x.proj).toPartialHomeomorph.symm y = y := writtenInExtChartAt_chartAt_symm_comp _ _ hy namespace Bundle variable {IB}
Mathlib/Geometry/Manifold/VectorBundle/Basic.lean
178
196
theorem contMDiffWithinAt_totalSpace (f : M → TotalSpace F E) {s : Set M} {x₀ : M} : ContMDiffWithinAt IM (IB.prod 𝓘(𝕜, F)) n f s x₀ ↔ ContMDiffWithinAt IM IB n (fun x => (f x).proj) s x₀ ∧ ContMDiffWithinAt IM 𝓘(𝕜, F) n (fun x ↦ (trivializationAt F E (f x₀).proj (f x)).2) s x₀ := by
simp (config := { singlePass := true }) only [contMDiffWithinAt_iff_target] rw [and_and_and_comm, ← FiberBundle.continuousWithinAt_totalSpace, and_congr_right_iff] intro hf simp_rw [modelWithCornersSelf_prod, FiberBundle.extChartAt, Function.comp, PartialEquiv.trans_apply, PartialEquiv.prod_coe, PartialEquiv.refl_coe, extChartAt_self_apply, modelWithCornersSelf_coe, Function.id_def, ← chartedSpaceSelf_prod] refine (contMDiffWithinAt_prod_iff _).trans (and_congr ?_ Iff.rfl) have h1 : (fun x => (f x).proj) ⁻¹' (trivializationAt F E (f x₀).proj).baseSet ∈ 𝓝[s] x₀ := ((FiberBundle.continuous_proj F E).continuousWithinAt.comp hf (mapsTo_image f s)) ((Trivialization.open_baseSet _).mem_nhds (mem_baseSet_trivializationAt F E _)) refine EventuallyEq.contMDiffWithinAt_iff (eventually_of_mem h1 fun x hx => ?_) ?_ · simp_rw [Function.comp, PartialHomeomorph.coe_coe, Trivialization.coe_coe] rw [Trivialization.coe_fst'] exact hx · simp only [mfld_simps]
[ " chartAt (ModelProd HB F) x =\n (trivializationAt F E x.proj).toPartialHomeomorph ≫ₕ (chartAt HB x.proj).prod (PartialHomeomorph.refl F)", " (trivializationAt F E x.proj).toPartialHomeomorph ≫ₕ\n (chartAt HB (↑(trivializationAt F E x.proj).toPartialHomeomorph x).1).prod (PartialHomeomorph.refl F) =\n ...
[ " chartAt (ModelProd HB F) x =\n (trivializationAt F E x.proj).toPartialHomeomorph ≫ₕ (chartAt HB x.proj).prod (PartialHomeomorph.refl F)", " (trivializationAt F E x.proj).toPartialHomeomorph ≫ₕ\n (chartAt HB (↑(trivializationAt F E x.proj).toPartialHomeomorph x).1).prod (PartialHomeomorph.refl F) =\n ...
import Mathlib.MeasureTheory.Group.Action import Mathlib.MeasureTheory.Integral.SetIntegral import Mathlib.MeasureTheory.Group.Pointwise #align_import measure_theory.group.fundamental_domain from "leanprover-community/mathlib"@"3b52265189f3fb43aa631edffce5d060fafaf82f" open scoped ENNReal Pointwise Topology NNReal ENNReal MeasureTheory open MeasureTheory MeasureTheory.Measure Set Function TopologicalSpace Filter namespace MeasureTheory structure IsAddFundamentalDomain (G : Type*) {α : Type*} [Zero G] [VAdd G α] [MeasurableSpace α] (s : Set α) (μ : Measure α := by volume_tac) : Prop where protected nullMeasurableSet : NullMeasurableSet s μ protected ae_covers : ∀ᵐ x ∂μ, ∃ g : G, g +ᵥ x ∈ s protected aedisjoint : Pairwise <| (AEDisjoint μ on fun g : G => g +ᵥ s) #align measure_theory.is_add_fundamental_domain MeasureTheory.IsAddFundamentalDomain @[to_additive IsAddFundamentalDomain] structure IsFundamentalDomain (G : Type*) {α : Type*} [One G] [SMul G α] [MeasurableSpace α] (s : Set α) (μ : Measure α := by volume_tac) : Prop where protected nullMeasurableSet : NullMeasurableSet s μ protected ae_covers : ∀ᵐ x ∂μ, ∃ g : G, g • x ∈ s protected aedisjoint : Pairwise <| (AEDisjoint μ on fun g : G => g • s) #align measure_theory.is_fundamental_domain MeasureTheory.IsFundamentalDomain variable {G H α β E : Type*} section MeasurableSpace variable (G) [Group G] [MulAction G α] (s : Set α) {x : α} @[to_additive MeasureTheory.addFundamentalFrontier "The boundary of a fundamental domain, those points of the domain that also lie in a nontrivial translate."] def fundamentalFrontier : Set α := s ∩ ⋃ (g : G) (_ : g ≠ 1), g • s #align measure_theory.fundamental_frontier MeasureTheory.fundamentalFrontier #align measure_theory.add_fundamental_frontier MeasureTheory.addFundamentalFrontier @[to_additive MeasureTheory.addFundamentalInterior "The interior of a fundamental domain, those points of the domain not lying in any translate."] def fundamentalInterior : Set α := s \ ⋃ (g : G) (_ : g ≠ 1), g • s #align measure_theory.fundamental_interior MeasureTheory.fundamentalInterior #align measure_theory.add_fundamental_interior MeasureTheory.addFundamentalInterior variable {G s} @[to_additive (attr := simp) MeasureTheory.mem_addFundamentalFrontier] theorem mem_fundamentalFrontier : x ∈ fundamentalFrontier G s ↔ x ∈ s ∧ ∃ g : G, g ≠ 1 ∧ x ∈ g • s := by simp [fundamentalFrontier] #align measure_theory.mem_fundamental_frontier MeasureTheory.mem_fundamentalFrontier #align measure_theory.mem_add_fundamental_frontier MeasureTheory.mem_addFundamentalFrontier @[to_additive (attr := simp) MeasureTheory.mem_addFundamentalInterior]
Mathlib/MeasureTheory/Group/FundamentalDomain.lean
595
597
theorem mem_fundamentalInterior : x ∈ fundamentalInterior G s ↔ x ∈ s ∧ ∀ g : G, g ≠ 1 → x ∉ g • s := by
simp [fundamentalInterior]
[ " x ∈ fundamentalFrontier G s ↔ x ∈ s ∧ ∃ g, g ≠ 1 ∧ x ∈ g • s", " x ∈ fundamentalInterior G s ↔ x ∈ s ∧ ∀ (g : G), g ≠ 1 → x ∉ g • s" ]
[ " x ∈ fundamentalFrontier G s ↔ x ∈ s ∧ ∃ g, g ≠ 1 ∧ x ∈ g • s" ]
import Mathlib.Algebra.CharP.Invertible import Mathlib.Algebra.Order.Interval.Set.Group import Mathlib.Analysis.Convex.Segment import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional import Mathlib.Tactic.FieldSimp #align_import analysis.convex.between from "leanprover-community/mathlib"@"571e13cacbed7bf042fd3058ce27157101433842" variable (R : Type*) {V V' P P' : Type*} open AffineEquiv AffineMap section OrderedRing variable [OrderedRing R] [AddCommGroup V] [Module R V] [AddTorsor V P] variable [AddCommGroup V'] [Module R V'] [AddTorsor V' P'] def affineSegment (x y : P) := lineMap x y '' Set.Icc (0 : R) 1 #align affine_segment affineSegment theorem affineSegment_eq_segment (x y : V) : affineSegment R x y = segment R x y := by rw [segment_eq_image_lineMap, affineSegment] #align affine_segment_eq_segment affineSegment_eq_segment
Mathlib/Analysis/Convex/Between.lean
49
55
theorem affineSegment_comm (x y : P) : affineSegment R x y = affineSegment R y x := by
refine Set.ext fun z => ?_ constructor <;> · rintro ⟨t, ht, hxy⟩ refine ⟨1 - t, ?_, ?_⟩ · rwa [Set.sub_mem_Icc_iff_right, sub_self, sub_zero] · rwa [lineMap_apply_one_sub]
[ " affineSegment R x y = segment R x y", " affineSegment R x y = affineSegment R y x", " z ∈ affineSegment R x y ↔ z ∈ affineSegment R y x", " z ∈ affineSegment R x y → z ∈ affineSegment R y x", " z ∈ affineSegment R y x", " 1 - t ∈ Set.Icc 0 1", " (lineMap y x) (1 - t) = z", " z ∈ affineSegment R y x ...
[ " affineSegment R x y = segment R x y" ]
import Mathlib.MeasureTheory.Constructions.Pi import Mathlib.MeasureTheory.Constructions.Prod.Integral open Fintype MeasureTheory MeasureTheory.Measure variable {𝕜 : Type*} [RCLike 𝕜] namespace MeasureTheory theorem Integrable.fin_nat_prod {n : ℕ} {E : Fin n → Type*} [∀ i, MeasureSpace (E i)] [∀ i, SigmaFinite (volume : Measure (E i))] {f : (i : Fin n) → E i → 𝕜} (hf : ∀ i, Integrable (f i)) : Integrable (fun (x : (i : Fin n) → E i) ↦ ∏ i, f i (x i)) := by induction n with | zero => simp only [Nat.zero_eq, Finset.univ_eq_empty, Finset.prod_empty, volume_pi, integrable_const_iff, one_ne_zero, pi_empty_univ, ENNReal.one_lt_top, or_true] | succ n n_ih => have := ((measurePreserving_piFinSuccAbove (fun i => (volume : Measure (E i))) 0).symm) rw [volume_pi, ← this.integrable_comp_emb (MeasurableEquiv.measurableEmbedding _)] simp_rw [MeasurableEquiv.piFinSuccAbove_symm_apply, Fin.prod_univ_succ, Fin.insertNth_zero] simp only [Fin.zero_succAbove, cast_eq, Function.comp_def, Fin.cons_zero, Fin.cons_succ] have : Integrable (fun (x : (j : Fin n) → E (Fin.succ j)) ↦ ∏ j, f (Fin.succ j) (x j)) := n_ih (fun i ↦ hf _) exact Integrable.prod_mul (hf 0) this theorem Integrable.fintype_prod_dep {ι : Type*} [Fintype ι] {E : ι → Type*} {f : (i : ι) → E i → 𝕜} [∀ i, MeasureSpace (E i)] [∀ i, SigmaFinite (volume : Measure (E i))] (hf : ∀ i, Integrable (f i)) : Integrable (fun (x : (i : ι) → E i) ↦ ∏ i, f i (x i)) := by let e := (equivFin ι).symm simp_rw [← (volume_measurePreserving_piCongrLeft _ e).integrable_comp_emb (MeasurableEquiv.measurableEmbedding _), ← e.prod_comp, MeasurableEquiv.coe_piCongrLeft, Function.comp_def, Equiv.piCongrLeft_apply_apply] exact .fin_nat_prod (fun i ↦ hf _) theorem Integrable.fintype_prod {ι : Type*} [Fintype ι] {E : Type*} {f : ι → E → 𝕜} [MeasureSpace E] [SigmaFinite (volume : Measure E)] (hf : ∀ i, Integrable (f i)) : Integrable (fun (x : ι → E) ↦ ∏ i, f i (x i)) := Integrable.fintype_prod_dep hf
Mathlib/MeasureTheory/Integral/Pi.lean
65
84
theorem integral_fin_nat_prod_eq_prod {n : ℕ} {E : Fin n → Type*} [∀ i, MeasureSpace (E i)] [∀ i, SigmaFinite (volume : Measure (E i))] (f : (i : Fin n) → E i → 𝕜) : ∫ x : (i : Fin n) → E i, ∏ i, f i (x i) = ∏ i, ∫ x, f i x := by
induction n with | zero => simp only [Nat.zero_eq, volume_pi, Finset.univ_eq_empty, Finset.prod_empty, integral_const, pi_empty_univ, ENNReal.one_toReal, smul_eq_mul, mul_one, pow_zero, one_smul] | succ n n_ih => calc _ = ∫ x : E 0 × ((i : Fin n) → E (Fin.succ i)), f 0 x.1 * ∏ i : Fin n, f (Fin.succ i) (x.2 i) := by rw [volume_pi, ← ((measurePreserving_piFinSuccAbove (fun i => (volume : Measure (E i))) 0).symm).integral_comp'] simp_rw [MeasurableEquiv.piFinSuccAbove_symm_apply, Fin.prod_univ_succ, Fin.insertNth_zero, Fin.cons_succ, volume_eq_prod, volume_pi, Fin.zero_succAbove, cast_eq, Fin.cons_zero] _ = (∫ x, f 0 x) * ∏ i : Fin n, ∫ (x : E (Fin.succ i)), f (Fin.succ i) x := by rw [← n_ih, ← integral_prod_mul, volume_eq_prod] _ = ∏ i, ∫ x, f i x := by rw [Fin.prod_univ_succ]
[ " Integrable (fun x => ∏ i : Fin n, f i (x i)) volume", " Integrable (fun x => ∏ i : Fin 0, f i (x i)) volume", " Integrable (fun x => ∏ i : Fin (n + 1), f i (x i)) volume", " Integrable ((fun x => ∏ i : Fin (n + 1), f i (x i)) ∘ ⇑(MeasurableEquiv.piFinSuccAbove (fun i => E i) 0).symm)\n (volume.prod (Meas...
[ " Integrable (fun x => ∏ i : Fin n, f i (x i)) volume", " Integrable (fun x => ∏ i : Fin 0, f i (x i)) volume", " Integrable (fun x => ∏ i : Fin (n + 1), f i (x i)) volume", " Integrable ((fun x => ∏ i : Fin (n + 1), f i (x i)) ∘ ⇑(MeasurableEquiv.piFinSuccAbove (fun i => E i) 0).symm)\n (volume.prod (Meas...
import Mathlib.MeasureTheory.Function.LpOrder #align_import measure_theory.function.l1_space from "leanprover-community/mathlib"@"ccdbfb6e5614667af5aa3ab2d50885e0ef44a46f" noncomputable section open scoped Classical open Topology ENNReal MeasureTheory NNReal open Set Filter TopologicalSpace ENNReal EMetric MeasureTheory variable {α β γ δ : Type*} {m : MeasurableSpace α} {μ ν : Measure α} [MeasurableSpace δ] variable [NormedAddCommGroup β] variable [NormedAddCommGroup γ] namespace MeasureTheory theorem lintegral_nnnorm_eq_lintegral_edist (f : α → β) : ∫⁻ a, ‖f a‖₊ ∂μ = ∫⁻ a, edist (f a) 0 ∂μ := by simp only [edist_eq_coe_nnnorm] #align measure_theory.lintegral_nnnorm_eq_lintegral_edist MeasureTheory.lintegral_nnnorm_eq_lintegral_edist theorem lintegral_norm_eq_lintegral_edist (f : α → β) : ∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ = ∫⁻ a, edist (f a) 0 ∂μ := by simp only [ofReal_norm_eq_coe_nnnorm, edist_eq_coe_nnnorm] #align measure_theory.lintegral_norm_eq_lintegral_edist MeasureTheory.lintegral_norm_eq_lintegral_edist
Mathlib/MeasureTheory/Function/L1Space.lean
75
80
theorem lintegral_edist_triangle {f g h : α → β} (hf : AEStronglyMeasurable f μ) (hh : AEStronglyMeasurable h μ) : (∫⁻ a, edist (f a) (g a) ∂μ) ≤ (∫⁻ a, edist (f a) (h a) ∂μ) + ∫⁻ a, edist (g a) (h a) ∂μ := by
rw [← lintegral_add_left' (hf.edist hh)] refine lintegral_mono fun a => ?_ apply edist_triangle_right
[ " ∫⁻ (a : α), ↑‖f a‖₊ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ", " ∫⁻ (a : α), ENNReal.ofReal ‖f a‖ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ", " ∫⁻ (a : α), edist (f a) (g a) ∂μ ≤ ∫⁻ (a : α), edist (f a) (h a) ∂μ + ∫⁻ (a : α), edist (g a) (h a) ∂μ", " ∫⁻ (a : α), edist (f a) (g a) ∂μ ≤ ∫⁻ (a : α), edist (f a) (h a) + edist...
[ " ∫⁻ (a : α), ↑‖f a‖₊ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ", " ∫⁻ (a : α), ENNReal.ofReal ‖f a‖ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ" ]
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Factorial.DoubleFactorial #align_import ring_theory.polynomial.hermite.basic from "leanprover-community/mathlib"@"938d3db9c278f8a52c0f964a405806f0f2b09b74" noncomputable section open Polynomial namespace Polynomial noncomputable def hermite : ℕ → Polynomial ℤ | 0 => 1 | n + 1 => X * hermite n - derivative (hermite n) #align polynomial.hermite Polynomial.hermite @[simp] theorem hermite_succ (n : ℕ) : hermite (n + 1) = X * hermite n - derivative (hermite n) := by rw [hermite] #align polynomial.hermite_succ Polynomial.hermite_succ theorem hermite_eq_iterate (n : ℕ) : hermite n = (fun p => X * p - derivative p)^[n] 1 := by induction' n with n ih · rfl · rw [Function.iterate_succ_apply', ← ih, hermite_succ] #align polynomial.hermite_eq_iterate Polynomial.hermite_eq_iterate @[simp] theorem hermite_zero : hermite 0 = C 1 := rfl #align polynomial.hermite_zero Polynomial.hermite_zero -- Porting note (#10618): There was initially @[simp] on this line but it was removed -- because simp can prove this theorem theorem hermite_one : hermite 1 = X := by rw [hermite_succ, hermite_zero] simp only [map_one, mul_one, derivative_one, sub_zero] #align polynomial.hermite_one Polynomial.hermite_one section coeff theorem coeff_hermite_succ_zero (n : ℕ) : coeff (hermite (n + 1)) 0 = -coeff (hermite n) 1 := by simp [coeff_derivative] #align polynomial.coeff_hermite_succ_zero Polynomial.coeff_hermite_succ_zero
Mathlib/RingTheory/Polynomial/Hermite/Basic.lean
86
89
theorem coeff_hermite_succ_succ (n k : ℕ) : coeff (hermite (n + 1)) (k + 1) = coeff (hermite n) k - (k + 2) * coeff (hermite n) (k + 2) := by
rw [hermite_succ, coeff_sub, coeff_X_mul, coeff_derivative, mul_comm] norm_cast
[ " hermite (n + 1) = X * hermite n - derivative (hermite n)", " hermite n = (fun p => X * p - derivative p)^[n] 1", " hermite 0 = (fun p => X * p - derivative p)^[0] 1", " hermite (n + 1) = (fun p => X * p - derivative p)^[n + 1] 1", " hermite 1 = X", " X * C 1 - derivative (C 1) = X", " (hermite (n + 1)...
[ " hermite (n + 1) = X * hermite n - derivative (hermite n)", " hermite n = (fun p => X * p - derivative p)^[n] 1", " hermite 0 = (fun p => X * p - derivative p)^[0] 1", " hermite (n + 1) = (fun p => X * p - derivative p)^[n + 1] 1", " hermite 1 = X", " X * C 1 - derivative (C 1) = X", " (hermite (n + 1)...
import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Tactic.LinearCombination #align_import ring_theory.polynomial.chebyshev from "leanprover-community/mathlib"@"d774451114d6045faeb6751c396bea1eb9058946" namespace Polynomial.Chebyshev set_option linter.uppercaseLean3 false -- `T` `U` `X` open Polynomial variable (R S : Type*) [CommRing R] [CommRing S] -- Well-founded definitions are now irreducible by default; -- as this was implemented before this change, -- we just set it back to semireducible to avoid needing to change any proofs. @[semireducible] noncomputable def T : ℤ → R[X] | 0 => 1 | 1 => X | (n : ℕ) + 2 => 2 * X * T (n + 1) - T n | -((n : ℕ) + 1) => 2 * X * T (-n) - T (-n + 1) termination_by n => Int.natAbs n + Int.natAbs (n - 1) #align polynomial.chebyshev.T Polynomial.Chebyshev.T @[elab_as_elim] protected theorem induct (motive : ℤ → Prop) (zero : motive 0) (one : motive 1) (add_two : ∀ (n : ℕ), motive (↑n + 1) → motive ↑n → motive (↑n + 2)) (neg_add_one : ∀ (n : ℕ), motive (-↑n) → motive (-↑n + 1) → motive (-↑n - 1)) : ∀ (a : ℤ), motive a := T.induct Unit motive zero one add_two fun n hn hnm => by simpa only [Int.negSucc_eq, neg_add] using neg_add_one n hn hnm @[simp] theorem T_add_two : ∀ n, T R (n + 2) = 2 * X * T R (n + 1) - T R n | (k : ℕ) => T.eq_3 R k | -(k + 1 : ℕ) => by linear_combination (norm := (simp [Int.negSucc_eq]; ring_nf)) T.eq_4 R k #align polynomial.chebyshev.T_add_two Polynomial.Chebyshev.T_add_two theorem T_add_one (n : ℤ) : T R (n + 1) = 2 * X * T R n - T R (n - 1) := by linear_combination (norm := ring_nf) T_add_two R (n - 1)
Mathlib/RingTheory/Polynomial/Chebyshev.lean
93
94
theorem T_sub_two (n : ℤ) : T R (n - 2) = 2 * X * T R (n - 1) - T R n := by
linear_combination (norm := ring_nf) T_add_two R (n - 2)
[ " motive (Int.negSucc n)", " T R (-↑(k + 1) + 2) = 2 * X * T R (-↑(k + 1) + 1) - T R (-↑(k + 1))", " T R (-↑(k + 1) + 2) - (2 * X * T R (-↑(k + 1) + 1) - T R (-↑(k + 1))) -\n (T R (Int.negSucc k) - (2 * X * T R (-↑k) - T R (-↑k + 1))) =\n 0", " T R (-1 + -↑k + 2) - (2 * X * T R (-↑k) - T R (-1 + -↑k))...
[ " motive (Int.negSucc n)", " T R (-↑(k + 1) + 2) = 2 * X * T R (-↑(k + 1) + 1) - T R (-↑(k + 1))", " T R (-↑(k + 1) + 2) - (2 * X * T R (-↑(k + 1) + 1) - T R (-↑(k + 1))) -\n (T R (Int.negSucc k) - (2 * X * T R (-↑k) - T R (-↑k + 1))) =\n 0", " T R (-1 + -↑k + 2) - (2 * X * T R (-↑k) - T R (-1 + -↑k))...
import Mathlib.Analysis.Calculus.FDeriv.Measurable import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.Deriv.Add import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.NormedSpace.Dual import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.MeasureTheory.Integral.VitaliCaratheodory #align_import measure_theory.integral.fund_thm_calculus from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" set_option autoImplicit true noncomputable section open scoped Classical open MeasureTheory Set Filter Function open scoped Classical Topology Filter ENNReal Interval NNReal variable {ι 𝕜 E F A : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] namespace intervalIntegral section FTC1 class FTCFilter (a : outParam ℝ) (outer : Filter ℝ) (inner : outParam <| Filter ℝ) extends TendstoIxxClass Ioc outer inner : Prop where pure_le : pure a ≤ outer le_nhds : inner ≤ 𝓝 a [meas_gen : IsMeasurablyGenerated inner] set_option linter.uppercaseLean3 false in #align interval_integral.FTC_filter intervalIntegral.FTCFilter variable {f : ℝ → E} {g' g φ : ℝ → ℝ}
Mathlib/MeasureTheory/Integral/FundThmCalculus.lean
1,024
1,114
theorem sub_le_integral_of_hasDeriv_right_of_le_Ico (hab : a ≤ b) (hcont : ContinuousOn g (Icc a b)) (hderiv : ∀ x ∈ Ico a b, HasDerivWithinAt g (g' x) (Ioi x) x) (φint : IntegrableOn φ (Icc a b)) (hφg : ∀ x ∈ Ico a b, g' x ≤ φ x) : g b - g a ≤ ∫ y in a..b, φ y := by
refine le_of_forall_pos_le_add fun ε εpos => ?_ -- Bound from above `g'` by a lower-semicontinuous function `G'`. rcases exists_lt_lowerSemicontinuous_integral_lt φ φint εpos with ⟨G', f_lt_G', G'cont, G'int, G'lt_top, hG'⟩ -- we will show by "induction" that `g t - g a ≤ ∫ u in a..t, G' u` for all `t ∈ [a, b]`. set s := {t | g t - g a ≤ ∫ u in a..t, (G' u).toReal} ∩ Icc a b -- the set `s` of points where this property holds is closed. have s_closed : IsClosed s := by have : ContinuousOn (fun t => (g t - g a, ∫ u in a..t, (G' u).toReal)) (Icc a b) := by rw [← uIcc_of_le hab] at G'int hcont ⊢ exact (hcont.sub continuousOn_const).prod (continuousOn_primitive_interval G'int) simp only [s, inter_comm] exact this.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' have main : Icc a b ⊆ {t | g t - g a ≤ ∫ u in a..t, (G' u).toReal} := by -- to show that the set `s` is all `[a, b]`, it suffices to show that any point `t` in `s` -- with `t < b` admits another point in `s` slightly to its right -- (this is a sort of real induction). refine s_closed.Icc_subset_of_forall_exists_gt (by simp only [integral_same, mem_setOf_eq, sub_self, le_rfl]) fun t ht v t_lt_v => ?_ obtain ⟨y, g'_lt_y', y_lt_G'⟩ : ∃ y : ℝ, (g' t : EReal) < y ∧ (y : EReal) < G' t := EReal.lt_iff_exists_real_btwn.1 ((EReal.coe_le_coe_iff.2 (hφg t ht.2)).trans_lt (f_lt_G' t)) -- bound from below the increase of `∫ x in a..u, G' x` on the right of `t`, using the lower -- semicontinuity of `G'`. have I1 : ∀ᶠ u in 𝓝[>] t, (u - t) * y ≤ ∫ w in t..u, (G' w).toReal := by have B : ∀ᶠ u in 𝓝 t, (y : EReal) < G' u := G'cont.lowerSemicontinuousAt _ _ y_lt_G' rcases mem_nhds_iff_exists_Ioo_subset.1 B with ⟨m, M, ⟨hm, hM⟩, H⟩ have : Ioo t (min M b) ∈ 𝓝[>] t := Ioo_mem_nhdsWithin_Ioi' (lt_min hM ht.right.right) filter_upwards [this] with u hu have I : Icc t u ⊆ Icc a b := Icc_subset_Icc ht.2.1 (hu.2.le.trans (min_le_right _ _)) calc (u - t) * y = ∫ _ in Icc t u, y := by simp only [hu.left.le, MeasureTheory.integral_const, Algebra.id.smul_eq_mul, sub_nonneg, MeasurableSet.univ, Real.volume_Icc, Measure.restrict_apply, univ_inter, ENNReal.toReal_ofReal] _ ≤ ∫ w in t..u, (G' w).toReal := by rw [intervalIntegral.integral_of_le hu.1.le, ← integral_Icc_eq_integral_Ioc] apply setIntegral_mono_ae_restrict · simp only [integrableOn_const, Real.volume_Icc, ENNReal.ofReal_lt_top, or_true_iff] · exact IntegrableOn.mono_set G'int I · have C1 : ∀ᵐ x : ℝ ∂volume.restrict (Icc t u), G' x < ∞ := ae_mono (Measure.restrict_mono I le_rfl) G'lt_top have C2 : ∀ᵐ x : ℝ ∂volume.restrict (Icc t u), x ∈ Icc t u := ae_restrict_mem measurableSet_Icc filter_upwards [C1, C2] with x G'x hx apply EReal.coe_le_coe_iff.1 have : x ∈ Ioo m M := by simp only [hm.trans_le hx.left, (hx.right.trans_lt hu.right).trans_le (min_le_left M b), mem_Ioo, and_self_iff] refine (H this).out.le.trans_eq ?_ exact (EReal.coe_toReal G'x.ne (f_lt_G' x).ne_bot).symm -- bound from above the increase of `g u - g a` on the right of `t`, using the derivative at `t` have I2 : ∀ᶠ u in 𝓝[>] t, g u - g t ≤ (u - t) * y := by have g'_lt_y : g' t < y := EReal.coe_lt_coe_iff.1 g'_lt_y' filter_upwards [(hderiv t ⟨ht.2.1, ht.2.2⟩).limsup_slope_le' (not_mem_Ioi.2 le_rfl) g'_lt_y, self_mem_nhdsWithin] with u hu t_lt_u have := mul_le_mul_of_nonneg_left hu.le (sub_pos.2 t_lt_u.out).le rwa [← smul_eq_mul, sub_smul_slope] at this -- combine the previous two bounds to show that `g u - g a` increases less quickly than -- `∫ x in a..u, G' x`. have I3 : ∀ᶠ u in 𝓝[>] t, g u - g t ≤ ∫ w in t..u, (G' w).toReal := by filter_upwards [I1, I2] with u hu1 hu2 using hu2.trans hu1 have I4 : ∀ᶠ u in 𝓝[>] t, u ∈ Ioc t (min v b) := by refine mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.2 ⟨min v b, ?_, Subset.rfl⟩ simp only [lt_min_iff, mem_Ioi] exact ⟨t_lt_v, ht.2.2⟩ -- choose a point `x` slightly to the right of `t` which satisfies the above bound rcases (I3.and I4).exists with ⟨x, hx, h'x⟩ -- we check that it belongs to `s`, essentially by construction refine ⟨x, ?_, Ioc_subset_Ioc le_rfl (min_le_left _ _) h'x⟩ calc g x - g a = g t - g a + (g x - g t) := by abel _ ≤ (∫ w in a..t, (G' w).toReal) + ∫ w in t..x, (G' w).toReal := add_le_add ht.1 hx _ = ∫ w in a..x, (G' w).toReal := by apply integral_add_adjacent_intervals · rw [intervalIntegrable_iff_integrableOn_Ioc_of_le ht.2.1] exact IntegrableOn.mono_set G'int (Ioc_subset_Icc_self.trans (Icc_subset_Icc le_rfl ht.2.2.le)) · rw [intervalIntegrable_iff_integrableOn_Ioc_of_le h'x.1.le] apply IntegrableOn.mono_set G'int exact Ioc_subset_Icc_self.trans (Icc_subset_Icc ht.2.1 (h'x.2.trans (min_le_right _ _))) -- now that we know that `s` contains `[a, b]`, we get the desired result by applying this to `b`. calc g b - g a ≤ ∫ y in a..b, (G' y).toReal := main (right_mem_Icc.2 hab) _ ≤ (∫ y in a..b, φ y) + ε := by convert hG'.le <;> · rw [intervalIntegral.integral_of_le hab] simp only [integral_Icc_eq_integral_Ioc', Real.volume_singleton]
[ " g b - g a ≤ ∫ (y : ℝ) in a..b, φ y", " g b - g a ≤ (∫ (y : ℝ) in a..b, φ y) + ε", " IsClosed s", " ContinuousOn (fun t => (g t - g a, ∫ (u : ℝ) in a..t, (G' u).toReal)) (Icc a b)", " ContinuousOn (fun t => (g t - g a, ∫ (u : ℝ) in a..t, (G' u).toReal)) [[a, b]]", " IsClosed (Icc a b ∩ {t | g t - g a ≤ ∫...
[]
import Mathlib.Analysis.MeanInequalities import Mathlib.Analysis.MeanInequalitiesPow import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Data.Set.Image import Mathlib.Topology.Algebra.Order.LiminfLimsup #align_import analysis.normed_space.lp_space from "leanprover-community/mathlib"@"de83b43717abe353f425855fcf0cedf9ea0fe8a4" noncomputable section open scoped NNReal ENNReal Function variable {α : Type*} {E : α → Type*} {p q : ℝ≥0∞} [∀ i, NormedAddCommGroup (E i)] def Memℓp (f : ∀ i, E i) (p : ℝ≥0∞) : Prop := if p = 0 then Set.Finite { i | f i ≠ 0 } else if p = ∞ then BddAbove (Set.range fun i => ‖f i‖) else Summable fun i => ‖f i‖ ^ p.toReal #align mem_ℓp Memℓp theorem memℓp_zero_iff {f : ∀ i, E i} : Memℓp f 0 ↔ Set.Finite { i | f i ≠ 0 } := by dsimp [Memℓp] rw [if_pos rfl] #align mem_ℓp_zero_iff memℓp_zero_iff theorem memℓp_zero {f : ∀ i, E i} (hf : Set.Finite { i | f i ≠ 0 }) : Memℓp f 0 := memℓp_zero_iff.2 hf #align mem_ℓp_zero memℓp_zero theorem memℓp_infty_iff {f : ∀ i, E i} : Memℓp f ∞ ↔ BddAbove (Set.range fun i => ‖f i‖) := by dsimp [Memℓp] rw [if_neg ENNReal.top_ne_zero, if_pos rfl] #align mem_ℓp_infty_iff memℓp_infty_iff theorem memℓp_infty {f : ∀ i, E i} (hf : BddAbove (Set.range fun i => ‖f i‖)) : Memℓp f ∞ := memℓp_infty_iff.2 hf #align mem_ℓp_infty memℓp_infty theorem memℓp_gen_iff (hp : 0 < p.toReal) {f : ∀ i, E i} : Memℓp f p ↔ Summable fun i => ‖f i‖ ^ p.toReal := by rw [ENNReal.toReal_pos_iff] at hp dsimp [Memℓp] rw [if_neg hp.1.ne', if_neg hp.2.ne] #align mem_ℓp_gen_iff memℓp_gen_iff theorem memℓp_gen {f : ∀ i, E i} (hf : Summable fun i => ‖f i‖ ^ p.toReal) : Memℓp f p := by rcases p.trichotomy with (rfl | rfl | hp) · apply memℓp_zero have H : Summable fun _ : α => (1 : ℝ) := by simpa using hf exact (Set.Finite.of_summable_const (by norm_num) H).subset (Set.subset_univ _) · apply memℓp_infty have H : Summable fun _ : α => (1 : ℝ) := by simpa using hf simpa using ((Set.Finite.of_summable_const (by norm_num) H).image fun i => ‖f i‖).bddAbove exact (memℓp_gen_iff hp).2 hf #align mem_ℓp_gen memℓp_gen theorem memℓp_gen' {C : ℝ} {f : ∀ i, E i} (hf : ∀ s : Finset α, ∑ i ∈ s, ‖f i‖ ^ p.toReal ≤ C) : Memℓp f p := by apply memℓp_gen use ⨆ s : Finset α, ∑ i ∈ s, ‖f i‖ ^ p.toReal apply hasSum_of_isLUB_of_nonneg · intro b exact Real.rpow_nonneg (norm_nonneg _) _ apply isLUB_ciSup use C rintro - ⟨s, rfl⟩ exact hf s #align mem_ℓp_gen' memℓp_gen'
Mathlib/Analysis/NormedSpace/lpSpace.lean
130
138
theorem zero_memℓp : Memℓp (0 : ∀ i, E i) p := by
rcases p.trichotomy with (rfl | rfl | hp) · apply memℓp_zero simp · apply memℓp_infty simp only [norm_zero, Pi.zero_apply] exact bddAbove_singleton.mono Set.range_const_subset · apply memℓp_gen simp [Real.zero_rpow hp.ne', summable_zero]
[ " Memℓp f 0 ↔ {i | f i ≠ 0}.Finite", " (if 0 = 0 then {i | ¬f i = 0}.Finite\n else if 0 = ⊤ then BddAbove (Set.range fun i => ‖f i‖) else Summable fun i => ‖f i‖ ^ 0) ↔\n {i | ¬f i = 0}.Finite", " Memℓp f ⊤ ↔ BddAbove (Set.range fun i => ‖f i‖)", " (if ⊤ = 0 then {i | ¬f i = 0}.Finite\n else if ⊤ = ⊤...
[ " Memℓp f 0 ↔ {i | f i ≠ 0}.Finite", " (if 0 = 0 then {i | ¬f i = 0}.Finite\n else if 0 = ⊤ then BddAbove (Set.range fun i => ‖f i‖) else Summable fun i => ‖f i‖ ^ 0) ↔\n {i | ¬f i = 0}.Finite", " Memℓp f ⊤ ↔ BddAbove (Set.range fun i => ‖f i‖)", " (if ⊤ = 0 then {i | ¬f i = 0}.Finite\n else if ⊤ = ⊤...
import Mathlib.Algebra.Group.Equiv.TypeTags import Mathlib.Algebra.Module.Defs import Mathlib.Algebra.Module.LinearMap.Basic import Mathlib.Algebra.MonoidAlgebra.Basic import Mathlib.LinearAlgebra.Dual import Mathlib.LinearAlgebra.Contraction import Mathlib.RingTheory.TensorProduct.Basic #align_import representation_theory.basic from "leanprover-community/mathlib"@"c04bc6e93e23aa0182aba53661a2211e80b6feac" open MonoidAlgebra (lift of) open LinearMap section variable (k G V : Type*) [CommSemiring k] [Monoid G] [AddCommMonoid V] [Module k V] abbrev Representation := G →* V →ₗ[k] V #align representation Representation end namespace Representation section MonoidAlgebra variable {k G V : Type*} [CommSemiring k] [Monoid G] [AddCommMonoid V] [Module k V] variable (ρ : Representation k G V) noncomputable def asAlgebraHom : MonoidAlgebra k G →ₐ[k] Module.End k V := (lift k G _) ρ #align representation.as_algebra_hom Representation.asAlgebraHom theorem asAlgebraHom_def : asAlgebraHom ρ = (lift k G _) ρ := rfl #align representation.as_algebra_hom_def Representation.asAlgebraHom_def @[simp]
Mathlib/RepresentationTheory/Basic.lean
106
107
theorem asAlgebraHom_single (g : G) (r : k) : asAlgebraHom ρ (Finsupp.single g r) = r • ρ g := by
simp only [asAlgebraHom_def, MonoidAlgebra.lift_single]
[ " ρ.asAlgebraHom (Finsupp.single g r) = r • ρ g" ]
[]
import Mathlib.NumberTheory.NumberField.Basic import Mathlib.RingTheory.Localization.NormTrace #align_import number_theory.number_field.norm from "leanprover-community/mathlib"@"00f91228655eecdcd3ac97a7fd8dbcb139fe990a" open scoped NumberField open Finset NumberField Algebra FiniteDimensional namespace RingOfIntegers variable {L : Type*} (K : Type*) [Field K] [Field L] [Algebra K L] [FiniteDimensional K L] noncomputable def norm [IsSeparable K L] : 𝓞 L →* 𝓞 K := RingOfIntegers.restrict_monoidHom ((Algebra.norm K).comp (algebraMap (𝓞 L) L : (𝓞 L) →* L)) fun x => isIntegral_norm K x.2 #align ring_of_integers.norm RingOfIntegers.norm @[simp] lemma coe_norm [IsSeparable K L] (x : 𝓞 L) : norm K x = Algebra.norm K (x : L) := rfl theorem coe_algebraMap_norm [IsSeparable K L] (x : 𝓞 L) : (algebraMap (𝓞 K) (𝓞 L) (norm K x) : L) = algebraMap K L (Algebra.norm K (x : L)) := rfl #align ring_of_integers.coe_algebra_map_norm RingOfIntegers.coe_algebraMap_norm theorem algebraMap_norm_algebraMap [IsSeparable K L] (x : 𝓞 K) : algebraMap _ K (norm K (algebraMap (𝓞 K) (𝓞 L) x)) = Algebra.norm K (algebraMap K L (algebraMap _ _ x)) := rfl #align ring_of_integers.coe_norm_algebra_map RingOfIntegers.algebraMap_norm_algebraMap
Mathlib/NumberTheory/NumberField/Norm.lean
65
69
theorem norm_algebraMap [IsSeparable K L] (x : 𝓞 K) : norm K (algebraMap (𝓞 K) (𝓞 L) x) = x ^ finrank K L := by
rw [RingOfIntegers.ext_iff, RingOfIntegers.coe_eq_algebraMap, RingOfIntegers.algebraMap_norm_algebraMap, Algebra.norm_algebraMap, RingOfIntegers.coe_eq_algebraMap, map_pow]
[ " (norm K) ((algebraMap (𝓞 K) (𝓞 L)) x) = x ^ finrank K L" ]
[]
import Mathlib.Topology.Bases import Mathlib.Order.Filter.CountableInter import Mathlib.Topology.Compactness.SigmaCompact open Set Filter Topology TopologicalSpace universe u v variable {X : Type u} {Y : Type v} {ι : Type*} variable [TopologicalSpace X] [TopologicalSpace Y] {s t : Set X} section Lindelof def IsLindelof (s : Set X) := ∀ ⦃f⦄ [NeBot f] [CountableInterFilter f], f ≤ 𝓟 s → ∃ x ∈ s, ClusterPt x f theorem IsLindelof.compl_mem_sets (hs : IsLindelof s) {f : Filter X} [CountableInterFilter f] (hf : ∀ x ∈ s, sᶜ ∈ 𝓝 x ⊓ f) : sᶜ ∈ f := by contrapose! hf simp only [not_mem_iff_inf_principal_compl, compl_compl, inf_assoc] at hf ⊢ exact hs inf_le_right theorem IsLindelof.compl_mem_sets_of_nhdsWithin (hs : IsLindelof s) {f : Filter X} [CountableInterFilter f] (hf : ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, tᶜ ∈ f) : sᶜ ∈ f := by refine hs.compl_mem_sets fun x hx ↦ ?_ rw [← disjoint_principal_right, disjoint_right_comm, (basis_sets _).disjoint_iff_left] exact hf x hx @[elab_as_elim] theorem IsLindelof.induction_on (hs : IsLindelof s) {p : Set X → Prop} (hmono : ∀ ⦃s t⦄, s ⊆ t → p t → p s) (hcountable_union : ∀ (S : Set (Set X)), S.Countable → (∀ s ∈ S, p s) → p (⋃₀ S)) (hnhds : ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, p t) : p s := by let f : Filter X := ofCountableUnion p hcountable_union (fun t ht _ hsub ↦ hmono hsub ht) have : sᶜ ∈ f := hs.compl_mem_sets_of_nhdsWithin (by simpa [f] using hnhds) rwa [← compl_compl s]
Mathlib/Topology/Compactness/Lindelof.lean
78
83
theorem IsLindelof.inter_right (hs : IsLindelof s) (ht : IsClosed t) : IsLindelof (s ∩ t) := by
intro f hnf _ hstf rw [← inf_principal, le_inf_iff] at hstf obtain ⟨x, hsx, hx⟩ : ∃ x ∈ s, ClusterPt x f := hs hstf.1 have hxt : x ∈ t := ht.mem_of_nhdsWithin_neBot <| hx.mono hstf.2 exact ⟨x, ⟨hsx, hxt⟩, hx⟩
[ " sᶜ ∈ f", " ∃ x ∈ s, sᶜ ∉ 𝓝 x ⊓ f", " ∃ x ∈ s, (𝓝 x ⊓ (f ⊓ 𝓟 s)).NeBot", " sᶜ ∈ 𝓝 x ⊓ f", " ∃ i ∈ 𝓝 x ⊓ 𝓟 s, (id i)ᶜ ∈ f", " p s", " ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, tᶜ ∈ f", " IsLindelof (s ∩ t)", " ∃ x ∈ s ∩ t, ClusterPt x f" ]
[ " sᶜ ∈ f", " ∃ x ∈ s, sᶜ ∉ 𝓝 x ⊓ f", " ∃ x ∈ s, (𝓝 x ⊓ (f ⊓ 𝓟 s)).NeBot", " sᶜ ∈ 𝓝 x ⊓ f", " ∃ i ∈ 𝓝 x ⊓ 𝓟 s, (id i)ᶜ ∈ f", " p s", " ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, tᶜ ∈ f" ]
import Mathlib.Analysis.InnerProductSpace.Dual import Mathlib.Analysis.Calculus.FDeriv.Basic import Mathlib.Analysis.Calculus.Deriv.Basic open Topology InnerProductSpace Set noncomputable section variable {𝕜 F : Type*} [RCLike 𝕜] variable [NormedAddCommGroup F] [InnerProductSpace 𝕜 F] [CompleteSpace F] variable {f : F → 𝕜} {f' x : F} def HasGradientAtFilter (f : F → 𝕜) (f' x : F) (L : Filter F) := HasFDerivAtFilter f (toDual 𝕜 F f') x L def HasGradientWithinAt (f : F → 𝕜) (f' : F) (s : Set F) (x : F) := HasGradientAtFilter f f' x (𝓝[s] x) def HasGradientAt (f : F → 𝕜) (f' x : F) := HasGradientAtFilter f f' x (𝓝 x) def gradientWithin (f : F → 𝕜) (s : Set F) (x : F) : F := (toDual 𝕜 F).symm (fderivWithin 𝕜 f s x) def gradient (f : F → 𝕜) (x : F) : F := (toDual 𝕜 F).symm (fderiv 𝕜 f x) @[inherit_doc] scoped[Gradient] notation "∇" => gradient local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y open scoped Gradient variable {s : Set F} {L : Filter F} theorem hasGradientWithinAt_iff_hasFDerivWithinAt {s : Set F} : HasGradientWithinAt f f' s x ↔ HasFDerivWithinAt f (toDual 𝕜 F f') s x := Iff.rfl theorem hasFDerivWithinAt_iff_hasGradientWithinAt {frechet : F →L[𝕜] 𝕜} {s : Set F} : HasFDerivWithinAt f frechet s x ↔ HasGradientWithinAt f ((toDual 𝕜 F).symm frechet) s x := by rw [hasGradientWithinAt_iff_hasFDerivWithinAt, (toDual 𝕜 F).apply_symm_apply frechet] theorem hasGradientAt_iff_hasFDerivAt : HasGradientAt f f' x ↔ HasFDerivAt f (toDual 𝕜 F f') x := Iff.rfl theorem hasFDerivAt_iff_hasGradientAt {frechet : F →L[𝕜] 𝕜} : HasFDerivAt f frechet x ↔ HasGradientAt f ((toDual 𝕜 F).symm frechet) x := by rw [hasGradientAt_iff_hasFDerivAt, (toDual 𝕜 F).apply_symm_apply frechet] alias ⟨HasGradientWithinAt.hasFDerivWithinAt, _⟩ := hasGradientWithinAt_iff_hasFDerivWithinAt alias ⟨HasFDerivWithinAt.hasGradientWithinAt, _⟩ := hasFDerivWithinAt_iff_hasGradientWithinAt alias ⟨HasGradientAt.hasFDerivAt, _⟩ := hasGradientAt_iff_hasFDerivAt alias ⟨HasFDerivAt.hasGradientAt, _⟩ := hasFDerivAt_iff_hasGradientAt theorem gradient_eq_zero_of_not_differentiableAt (h : ¬DifferentiableAt 𝕜 f x) : ∇ f x = 0 := by rw [gradient, fderiv_zero_of_not_differentiableAt h, map_zero] theorem HasGradientAt.unique {gradf gradg : F} (hf : HasGradientAt f gradf x) (hg : HasGradientAt f gradg x) : gradf = gradg := (toDual 𝕜 F).injective (hf.hasFDerivAt.unique hg.hasFDerivAt)
Mathlib/Analysis/Calculus/Gradient/Basic.lean
118
121
theorem DifferentiableAt.hasGradientAt (h : DifferentiableAt 𝕜 f x) : HasGradientAt f (∇ f x) x := by
rw [hasGradientAt_iff_hasFDerivAt, gradient, (toDual 𝕜 F).apply_symm_apply (fderiv 𝕜 f x)] exact h.hasFDerivAt
[ " HasFDerivWithinAt f frechet s x ↔ HasGradientWithinAt f ((toDual 𝕜 F).symm frechet) s x", " HasFDerivAt f frechet x ↔ HasGradientAt f ((toDual 𝕜 F).symm frechet) x", " ∇ f x = 0", " HasGradientAt f (∇ f x) x", " HasFDerivAt f (fderiv 𝕜 f x) x" ]
[ " HasFDerivWithinAt f frechet s x ↔ HasGradientWithinAt f ((toDual 𝕜 F).symm frechet) s x", " HasFDerivAt f frechet x ↔ HasGradientAt f ((toDual 𝕜 F).symm frechet) x", " ∇ f x = 0" ]
import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Fintype.Basic import Mathlib.Data.Int.GCD import Mathlib.RingTheory.Coprime.Basic #align_import ring_theory.coprime.lemmas from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226" universe u v section RelPrime variable {α I} [CommMonoid α] [DecompositionMonoid α] {x y z : α} {s : I → α} {t : Finset I} theorem IsRelPrime.prod_left : (∀ i ∈ t, IsRelPrime (s i) x) → IsRelPrime (∏ i ∈ t, s i) x := by classical refine Finset.induction_on t (fun _ ↦ isRelPrime_one_left) fun b t hbt ih H ↦ ?_ rw [Finset.prod_insert hbt] rw [Finset.forall_mem_insert] at H exact H.1.mul_left (ih H.2) theorem IsRelPrime.prod_right : (∀ i ∈ t, IsRelPrime x (s i)) → IsRelPrime x (∏ i ∈ t, s i) := by simpa only [isRelPrime_comm] using IsRelPrime.prod_left (α := α) theorem IsRelPrime.prod_left_iff : IsRelPrime (∏ i ∈ t, s i) x ↔ ∀ i ∈ t, IsRelPrime (s i) x := by classical refine Finset.induction_on t (iff_of_true isRelPrime_one_left fun _ ↦ by simp) fun b t hbt ih ↦ ?_ rw [Finset.prod_insert hbt, IsRelPrime.mul_left_iff, ih, Finset.forall_mem_insert] theorem IsRelPrime.prod_right_iff : IsRelPrime x (∏ i ∈ t, s i) ↔ ∀ i ∈ t, IsRelPrime x (s i) := by simpa only [isRelPrime_comm] using IsRelPrime.prod_left_iff (α := α) theorem IsRelPrime.of_prod_left (H1 : IsRelPrime (∏ i ∈ t, s i) x) (i : I) (hit : i ∈ t) : IsRelPrime (s i) x := IsRelPrime.prod_left_iff.1 H1 i hit theorem IsRelPrime.of_prod_right (H1 : IsRelPrime x (∏ i ∈ t, s i)) (i : I) (hit : i ∈ t) : IsRelPrime x (s i) := IsRelPrime.prod_right_iff.1 H1 i hit theorem Finset.prod_dvd_of_isRelPrime : (t : Set I).Pairwise (IsRelPrime on s) → (∀ i ∈ t, s i ∣ z) → (∏ x ∈ t, s x) ∣ z := by classical exact Finset.induction_on t (fun _ _ ↦ one_dvd z) (by intro a r har ih Hs Hs1 rw [Finset.prod_insert har] have aux1 : a ∈ (↑(insert a r) : Set I) := Finset.mem_insert_self a r refine (IsRelPrime.prod_right fun i hir ↦ Hs aux1 (Finset.mem_insert_of_mem hir) <| by rintro rfl exact har hir).mul_dvd (Hs1 a aux1) (ih (Hs.mono ?_) fun i hi ↦ Hs1 i <| Finset.mem_insert_of_mem hi) simp only [Finset.coe_insert, Set.subset_insert]) theorem Fintype.prod_dvd_of_isRelPrime [Fintype I] (Hs : Pairwise (IsRelPrime on s)) (Hs1 : ∀ i, s i ∣ z) : (∏ x, s x) ∣ z := Finset.prod_dvd_of_isRelPrime (Hs.set_pairwise _) fun i _ ↦ Hs1 i
Mathlib/RingTheory/Coprime/Lemmas.lean
281
289
theorem pairwise_isRelPrime_iff_isRelPrime_prod [DecidableEq I] : Pairwise (IsRelPrime on fun i : t ↦ s i) ↔ ∀ i ∈ t, IsRelPrime (s i) (∏ j ∈ t \ {i}, s j) := by
refine ⟨fun hp i hi ↦ IsRelPrime.prod_right_iff.mpr fun j hj ↦ ?_, fun hp ↦ ?_⟩ · rw [Finset.mem_sdiff, Finset.mem_singleton] at hj obtain ⟨hj, ji⟩ := hj exact @hp ⟨i, hi⟩ ⟨j, hj⟩ fun h ↦ ji (congrArg Subtype.val h).symm · rintro ⟨i, hi⟩ ⟨j, hj⟩ h apply IsRelPrime.prod_right_iff.mp (hp i hi) exact Finset.mem_sdiff.mpr ⟨hj, fun f ↦ h <| Subtype.ext (Finset.mem_singleton.mp f).symm⟩
[ " (∀ i ∈ t, IsRelPrime (s i) x) → IsRelPrime (∏ i ∈ t, s i) x", " IsRelPrime (∏ i ∈ insert b t, s i) x", " IsRelPrime (s b * ∏ x ∈ t, s x) x", " (∀ i ∈ t, IsRelPrime x (s i)) → IsRelPrime x (∏ i ∈ t, s i)", " IsRelPrime (∏ i ∈ t, s i) x ↔ ∀ i ∈ t, IsRelPrime (s i) x", " x✝ ∈ ∅ → IsRelPrime (s x✝) x", " ...
[ " (∀ i ∈ t, IsRelPrime (s i) x) → IsRelPrime (∏ i ∈ t, s i) x", " IsRelPrime (∏ i ∈ insert b t, s i) x", " IsRelPrime (s b * ∏ x ∈ t, s x) x", " (∀ i ∈ t, IsRelPrime x (s i)) → IsRelPrime x (∏ i ∈ t, s i)", " IsRelPrime (∏ i ∈ t, s i) x ↔ ∀ i ∈ t, IsRelPrime (s i) x", " x✝ ∈ ∅ → IsRelPrime (s x✝) x", " ...
import Mathlib.Algebra.BigOperators.NatAntidiagonal import Mathlib.Algebra.Polynomial.RingDivision #align_import data.polynomial.mirror from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" namespace Polynomial open Polynomial section Semiring variable {R : Type*} [Semiring R] (p q : R[X]) noncomputable def mirror := p.reverse * X ^ p.natTrailingDegree #align polynomial.mirror Polynomial.mirror @[simp] theorem mirror_zero : (0 : R[X]).mirror = 0 := by simp [mirror] #align polynomial.mirror_zero Polynomial.mirror_zero theorem mirror_monomial (n : ℕ) (a : R) : (monomial n a).mirror = monomial n a := by classical by_cases ha : a = 0 · rw [ha, monomial_zero_right, mirror_zero] · rw [mirror, reverse, natDegree_monomial n a, if_neg ha, natTrailingDegree_monomial ha, ← C_mul_X_pow_eq_monomial, reflect_C_mul_X_pow, revAt_le (le_refl n), tsub_self, pow_zero, mul_one] #align polynomial.mirror_monomial Polynomial.mirror_monomial theorem mirror_C (a : R) : (C a).mirror = C a := mirror_monomial 0 a set_option linter.uppercaseLean3 false in #align polynomial.mirror_C Polynomial.mirror_C theorem mirror_X : X.mirror = (X : R[X]) := mirror_monomial 1 (1 : R) set_option linter.uppercaseLean3 false in #align polynomial.mirror_X Polynomial.mirror_X
Mathlib/Algebra/Polynomial/Mirror.lean
66
72
theorem mirror_natDegree : p.mirror.natDegree = p.natDegree := by
by_cases hp : p = 0 · rw [hp, mirror_zero] nontriviality R rw [mirror, natDegree_mul', reverse_natDegree, natDegree_X_pow, tsub_add_cancel_of_le p.natTrailingDegree_le_natDegree] rwa [leadingCoeff_X_pow, mul_one, reverse_leadingCoeff, Ne, trailingCoeff_eq_zero]
[ " mirror 0 = 0", " ((monomial n) a).mirror = (monomial n) a", " p.mirror.natDegree = p.natDegree", " p.reverse.leadingCoeff * (X ^ p.natTrailingDegree).leadingCoeff ≠ 0" ]
[ " mirror 0 = 0", " ((monomial n) a).mirror = (monomial n) a" ]
import Mathlib.Data.Stream.Init import Mathlib.Tactic.ApplyFun import Mathlib.Control.Fix import Mathlib.Order.OmegaCompletePartialOrder #align_import control.lawful_fix from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v open scoped Classical variable {α : Type*} {β : α → Type*} open OmegaCompletePartialOrder class LawfulFix (α : Type*) [OmegaCompletePartialOrder α] extends Fix α where fix_eq : ∀ {f : α →o α}, Continuous f → Fix.fix f = f (Fix.fix f) #align lawful_fix LawfulFix theorem LawfulFix.fix_eq' {α} [OmegaCompletePartialOrder α] [LawfulFix α] {f : α → α} (hf : Continuous' f) : Fix.fix f = f (Fix.fix f) := LawfulFix.fix_eq (hf.to_bundled _) #align lawful_fix.fix_eq' LawfulFix.fix_eq' namespace Part open Part Nat Nat.Upto namespace Fix variable (f : ((a : _) → Part <| β a) →o (a : _) → Part <| β a) theorem approx_mono' {i : ℕ} : Fix.approx f i ≤ Fix.approx f (succ i) := by induction i with | zero => dsimp [approx]; apply @bot_le _ _ _ (f ⊥) | succ _ i_ih => intro; apply f.monotone; apply i_ih #align part.fix.approx_mono' Part.Fix.approx_mono' theorem approx_mono ⦃i j : ℕ⦄ (hij : i ≤ j) : approx f i ≤ approx f j := by induction' j with j ih · cases hij exact le_rfl cases hij; · exact le_rfl exact le_trans (ih ‹_›) (approx_mono' f) #align part.fix.approx_mono Part.Fix.approx_mono
Mathlib/Control/LawfulFix.lean
71
91
theorem mem_iff (a : α) (b : β a) : b ∈ Part.fix f a ↔ ∃ i, b ∈ approx f i a := by
by_cases h₀ : ∃ i : ℕ, (approx f i a).Dom · simp only [Part.fix_def f h₀] constructor <;> intro hh · exact ⟨_, hh⟩ have h₁ := Nat.find_spec h₀ rw [dom_iff_mem] at h₁ cases' h₁ with y h₁ replace h₁ := approx_mono' f _ _ h₁ suffices y = b by subst this exact h₁ cases' hh with i hh revert h₁; generalize succ (Nat.find h₀) = j; intro h₁ wlog case : i ≤ j · rcases le_total i j with H | H <;> [skip; symm] <;> apply_assumption <;> assumption replace hh := approx_mono f case _ _ hh apply Part.mem_unique h₁ hh · simp only [fix_def' (⇑f) h₀, not_exists, false_iff_iff, not_mem_none] simp only [dom_iff_mem, not_exists] at h₀ intro; apply h₀
[ " approx (⇑f) i ≤ approx (⇑f) i.succ", " approx (⇑f) 0 ≤ approx (⇑f) (Nat.succ 0)", " ⊥ ≤ f ⊥", " approx (⇑f) (n✝ + 1) ≤ approx (⇑f) (n✝ + 1).succ", " approx (⇑f) (n✝ + 1) i✝ ≤ approx (⇑f) (n✝ + 1).succ i✝", " approx (⇑f) n✝ ≤ approx (⇑f) (n✝ + 1)", " approx (⇑f) i ≤ approx (⇑f) j", " approx (⇑f) i ≤ ...
[ " approx (⇑f) i ≤ approx (⇑f) i.succ", " approx (⇑f) 0 ≤ approx (⇑f) (Nat.succ 0)", " ⊥ ≤ f ⊥", " approx (⇑f) (n✝ + 1) ≤ approx (⇑f) (n✝ + 1).succ", " approx (⇑f) (n✝ + 1) i✝ ≤ approx (⇑f) (n✝ + 1).succ i✝", " approx (⇑f) n✝ ≤ approx (⇑f) (n✝ + 1)", " approx (⇑f) i ≤ approx (⇑f) j", " approx (⇑f) i ≤ ...
import Mathlib.Algebra.GeomSum import Mathlib.Algebra.Polynomial.Roots import Mathlib.GroupTheory.SpecificGroups.Cyclic #align_import ring_theory.integral_domain from "leanprover-community/mathlib"@"6e70e0d419bf686784937d64ed4bfde866ff229e" section open Finset Polynomial Function Nat section CancelMonoidWithZero -- There doesn't seem to be a better home for these right now variable {M : Type*} [CancelMonoidWithZero M] [Finite M] theorem mul_right_bijective_of_finite₀ {a : M} (ha : a ≠ 0) : Bijective fun b => a * b := Finite.injective_iff_bijective.1 <| mul_right_injective₀ ha #align mul_right_bijective_of_finite₀ mul_right_bijective_of_finite₀ theorem mul_left_bijective_of_finite₀ {a : M} (ha : a ≠ 0) : Bijective fun b => b * a := Finite.injective_iff_bijective.1 <| mul_left_injective₀ ha #align mul_left_bijective_of_finite₀ mul_left_bijective_of_finite₀ def Fintype.groupWithZeroOfCancel (M : Type*) [CancelMonoidWithZero M] [DecidableEq M] [Fintype M] [Nontrivial M] : GroupWithZero M := { ‹Nontrivial M›, ‹CancelMonoidWithZero M› with inv := fun a => if h : a = 0 then 0 else Fintype.bijInv (mul_right_bijective_of_finite₀ h) 1 mul_inv_cancel := fun a ha => by simp only [Inv.inv, dif_neg ha] exact Fintype.rightInverse_bijInv _ _ inv_zero := by simp [Inv.inv, dif_pos rfl] } #align fintype.group_with_zero_of_cancel Fintype.groupWithZeroOfCancel theorem exists_eq_pow_of_mul_eq_pow_of_coprime {R : Type*} [CommSemiring R] [IsDomain R] [GCDMonoid R] [Unique Rˣ] {a b c : R} {n : ℕ} (cp : IsCoprime a b) (h : a * b = c ^ n) : ∃ d : R, a = d ^ n := by refine exists_eq_pow_of_mul_eq_pow (isUnit_of_dvd_one ?_) h obtain ⟨x, y, hxy⟩ := cp rw [← hxy] exact -- Porting note: added `GCDMonoid.` twice dvd_add (dvd_mul_of_dvd_right (GCDMonoid.gcd_dvd_left _ _) _) (dvd_mul_of_dvd_right (GCDMonoid.gcd_dvd_right _ _) _) #align exists_eq_pow_of_mul_eq_pow_of_coprime exists_eq_pow_of_mul_eq_pow_of_coprime nonrec
Mathlib/RingTheory/IntegralDomain.lean
73
84
theorem Finset.exists_eq_pow_of_mul_eq_pow_of_coprime {ι R : Type*} [CommSemiring R] [IsDomain R] [GCDMonoid R] [Unique Rˣ] {n : ℕ} {c : R} {s : Finset ι} {f : ι → R} (h : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → IsCoprime (f i) (f j)) (hprod : ∏ i ∈ s, f i = c ^ n) : ∀ i ∈ s, ∃ d : R, f i = d ^ n := by
classical intro i hi rw [← insert_erase hi, prod_insert (not_mem_erase i s)] at hprod refine exists_eq_pow_of_mul_eq_pow_of_coprime (IsCoprime.prod_right fun j hj => h i hi j (erase_subset i s hj) fun hij => ?_) hprod rw [hij] at hj exact (s.not_mem_erase _) hj
[ " 0⁻¹ = 0", " a * a⁻¹ = 1", " a * bijInv ⋯ 1 = 1", " ∃ d, a = d ^ n", " GCDMonoid.gcd a b ∣ 1", " GCDMonoid.gcd a b ∣ x * a + y * b", " ∀ i ∈ s, ∃ d, f i = d ^ n", " ∃ d, f i = d ^ n", " False" ]
[ " 0⁻¹ = 0", " a * a⁻¹ = 1", " a * bijInv ⋯ 1 = 1", " ∃ d, a = d ^ n", " GCDMonoid.gcd a b ∣ 1", " GCDMonoid.gcd a b ∣ x * a + y * b" ]
import Mathlib.MeasureTheory.Integral.Lebesgue open Set hiding restrict restrict_apply open Filter ENNReal NNReal MeasureTheory.Measure namespace MeasureTheory variable {α : Type*} {m0 : MeasurableSpace α} {μ : Measure α} noncomputable def Measure.withDensity {m : MeasurableSpace α} (μ : Measure α) (f : α → ℝ≥0∞) : Measure α := Measure.ofMeasurable (fun s _ => ∫⁻ a in s, f a ∂μ) (by simp) fun s hs hd => lintegral_iUnion hs hd _ #align measure_theory.measure.with_density MeasureTheory.Measure.withDensity @[simp] theorem withDensity_apply (f : α → ℝ≥0∞) {s : Set α} (hs : MeasurableSet s) : μ.withDensity f s = ∫⁻ a in s, f a ∂μ := Measure.ofMeasurable_apply s hs #align measure_theory.with_density_apply MeasureTheory.withDensity_apply theorem withDensity_apply_le (f : α → ℝ≥0∞) (s : Set α) : ∫⁻ a in s, f a ∂μ ≤ μ.withDensity f s := by let t := toMeasurable (μ.withDensity f) s calc ∫⁻ a in s, f a ∂μ ≤ ∫⁻ a in t, f a ∂μ := lintegral_mono_set (subset_toMeasurable (withDensity μ f) s) _ = μ.withDensity f t := (withDensity_apply f (measurableSet_toMeasurable (withDensity μ f) s)).symm _ = μ.withDensity f s := measure_toMeasurable s theorem withDensity_apply' [SFinite μ] (f : α → ℝ≥0∞) (s : Set α) : μ.withDensity f s = ∫⁻ a in s, f a ∂μ := by apply le_antisymm ?_ (withDensity_apply_le f s) let t := toMeasurable μ s calc μ.withDensity f s ≤ μ.withDensity f t := measure_mono (subset_toMeasurable μ s) _ = ∫⁻ a in t, f a ∂μ := withDensity_apply f (measurableSet_toMeasurable μ s) _ = ∫⁻ a in s, f a ∂μ := by congr 1; exact restrict_toMeasurable_of_sFinite s @[simp] lemma withDensity_zero_left (f : α → ℝ≥0∞) : (0 : Measure α).withDensity f = 0 := by ext s hs rw [withDensity_apply _ hs] simp
Mathlib/MeasureTheory/Measure/WithDensity.lean
83
87
theorem withDensity_congr_ae {f g : α → ℝ≥0∞} (h : f =ᵐ[μ] g) : μ.withDensity f = μ.withDensity g := by
refine Measure.ext fun s hs => ?_ rw [withDensity_apply _ hs, withDensity_apply _ hs] exact lintegral_congr_ae (ae_restrict_of_ae h)
[ " (fun s x => ∫⁻ (a : α) in s, f a ∂μ) ∅ ⋯ = 0", " ∫⁻ (a : α) in s, f a ∂μ ≤ (μ.withDensity f) s", " (μ.withDensity f) s = ∫⁻ (a : α) in s, f a ∂μ", " (μ.withDensity f) s ≤ ∫⁻ (a : α) in s, f a ∂μ", " ∫⁻ (a : α) in t, f a ∂μ = ∫⁻ (a : α) in s, f a ∂μ", " μ.restrict t = μ.restrict s", " withDensity 0 f =...
[ " (fun s x => ∫⁻ (a : α) in s, f a ∂μ) ∅ ⋯ = 0", " ∫⁻ (a : α) in s, f a ∂μ ≤ (μ.withDensity f) s", " (μ.withDensity f) s = ∫⁻ (a : α) in s, f a ∂μ", " (μ.withDensity f) s ≤ ∫⁻ (a : α) in s, f a ∂μ", " ∫⁻ (a : α) in t, f a ∂μ = ∫⁻ (a : α) in s, f a ∂μ", " μ.restrict t = μ.restrict s", " withDensity 0 f =...
import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Tactic.LinearCombination #align_import ring_theory.polynomial.chebyshev from "leanprover-community/mathlib"@"d774451114d6045faeb6751c396bea1eb9058946" namespace Polynomial.Chebyshev set_option linter.uppercaseLean3 false -- `T` `U` `X` open Polynomial variable (R S : Type*) [CommRing R] [CommRing S] -- Well-founded definitions are now irreducible by default; -- as this was implemented before this change, -- we just set it back to semireducible to avoid needing to change any proofs. @[semireducible] noncomputable def T : ℤ → R[X] | 0 => 1 | 1 => X | (n : ℕ) + 2 => 2 * X * T (n + 1) - T n | -((n : ℕ) + 1) => 2 * X * T (-n) - T (-n + 1) termination_by n => Int.natAbs n + Int.natAbs (n - 1) #align polynomial.chebyshev.T Polynomial.Chebyshev.T @[elab_as_elim] protected theorem induct (motive : ℤ → Prop) (zero : motive 0) (one : motive 1) (add_two : ∀ (n : ℕ), motive (↑n + 1) → motive ↑n → motive (↑n + 2)) (neg_add_one : ∀ (n : ℕ), motive (-↑n) → motive (-↑n + 1) → motive (-↑n - 1)) : ∀ (a : ℤ), motive a := T.induct Unit motive zero one add_two fun n hn hnm => by simpa only [Int.negSucc_eq, neg_add] using neg_add_one n hn hnm @[simp] theorem T_add_two : ∀ n, T R (n + 2) = 2 * X * T R (n + 1) - T R n | (k : ℕ) => T.eq_3 R k | -(k + 1 : ℕ) => by linear_combination (norm := (simp [Int.negSucc_eq]; ring_nf)) T.eq_4 R k #align polynomial.chebyshev.T_add_two Polynomial.Chebyshev.T_add_two theorem T_add_one (n : ℤ) : T R (n + 1) = 2 * X * T R n - T R (n - 1) := by linear_combination (norm := ring_nf) T_add_two R (n - 1) theorem T_sub_two (n : ℤ) : T R (n - 2) = 2 * X * T R (n - 1) - T R n := by linear_combination (norm := ring_nf) T_add_two R (n - 2) theorem T_sub_one (n : ℤ) : T R (n - 1) = 2 * X * T R n - T R (n + 1) := by linear_combination (norm := ring_nf) T_add_two R (n - 1) theorem T_eq (n : ℤ) : T R n = 2 * X * T R (n - 1) - T R (n - 2) := by linear_combination (norm := ring_nf) T_add_two R (n - 2) #align polynomial.chebyshev.T_of_two_le Polynomial.Chebyshev.T_eq @[simp] theorem T_zero : T R 0 = 1 := rfl #align polynomial.chebyshev.T_zero Polynomial.Chebyshev.T_zero @[simp] theorem T_one : T R 1 = X := rfl #align polynomial.chebyshev.T_one Polynomial.Chebyshev.T_one theorem T_neg_one : T R (-1) = X := (by ring : 2 * X * 1 - X = X) theorem T_two : T R 2 = 2 * X ^ 2 - 1 := by simpa [pow_two, mul_assoc] using T_add_two R 0 #align polynomial.chebyshev.T_two Polynomial.Chebyshev.T_two @[simp] theorem T_neg (n : ℤ) : T R (-n) = T R n := by induction n using Polynomial.Chebyshev.induct with | zero => rfl | one => show 2 * X * 1 - X = X; ring | add_two n ih1 ih2 => have h₁ := T_add_two R n have h₂ := T_sub_two R (-n) linear_combination (norm := ring_nf) (2 * (X:R[X])) * ih1 - ih2 - h₁ + h₂ | neg_add_one n ih1 ih2 => have h₁ := T_add_one R n have h₂ := T_sub_one R (-n) linear_combination (norm := ring_nf) (2 * (X:R[X])) * ih1 - ih2 + h₁ - h₂ theorem T_natAbs (n : ℤ) : T R n.natAbs = T R n := by obtain h | h := Int.natAbs_eq n <;> nth_rw 2 [h]; simp
Mathlib/RingTheory/Polynomial/Chebyshev.lean
134
134
theorem T_neg_two : T R (-2) = 2 * X ^ 2 - 1 := by
simp [T_two]
[ " motive (Int.negSucc n)", " T R (-↑(k + 1) + 2) = 2 * X * T R (-↑(k + 1) + 1) - T R (-↑(k + 1))", " T R (-↑(k + 1) + 2) - (2 * X * T R (-↑(k + 1) + 1) - T R (-↑(k + 1))) -\n (T R (Int.negSucc k) - (2 * X * T R (-↑k) - T R (-↑k + 1))) =\n 0", " T R (-1 + -↑k + 2) - (2 * X * T R (-↑k) - T R (-1 + -↑k))...
[ " motive (Int.negSucc n)", " T R (-↑(k + 1) + 2) = 2 * X * T R (-↑(k + 1) + 1) - T R (-↑(k + 1))", " T R (-↑(k + 1) + 2) - (2 * X * T R (-↑(k + 1) + 1) - T R (-↑(k + 1))) -\n (T R (Int.negSucc k) - (2 * X * T R (-↑k) - T R (-↑k + 1))) =\n 0", " T R (-1 + -↑k + 2) - (2 * X * T R (-↑k) - T R (-1 + -↑k))...
import Mathlib.LinearAlgebra.CliffordAlgebra.Grading import Mathlib.Algebra.Module.Opposites #align_import linear_algebra.clifford_algebra.conjugation from "leanprover-community/mathlib"@"34020e531ebc4e8aac6d449d9eecbcd1508ea8d0" variable {R : Type*} [CommRing R] variable {M : Type*} [AddCommGroup M] [Module R M] variable {Q : QuadraticForm R M} namespace CliffordAlgebra section Reverse open MulOpposite def reverseOp : CliffordAlgebra Q →ₐ[R] (CliffordAlgebra Q)ᵐᵒᵖ := CliffordAlgebra.lift Q ⟨(MulOpposite.opLinearEquiv R).toLinearMap ∘ₗ ι Q, fun m => unop_injective <| by simp⟩ @[simp] theorem reverseOp_ι (m : M) : reverseOp (ι Q m) = op (ι Q m) := lift_ι_apply _ _ _ @[simps! apply] def reverseOpEquiv : CliffordAlgebra Q ≃ₐ[R] (CliffordAlgebra Q)ᵐᵒᵖ := AlgEquiv.ofAlgHom reverseOp (AlgHom.opComm reverseOp) (AlgHom.unop.injective <| hom_ext <| LinearMap.ext fun _ => by simp) (hom_ext <| LinearMap.ext fun _ => by simp) @[simp] theorem reverseOpEquiv_opComm : AlgEquiv.opComm (reverseOpEquiv (Q := Q)) = reverseOpEquiv.symm := rfl def reverse : CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q := (opLinearEquiv R).symm.toLinearMap.comp reverseOp.toLinearMap #align clifford_algebra.reverse CliffordAlgebra.reverse @[simp] theorem unop_reverseOp (x : CliffordAlgebra Q) : (reverseOp x).unop = reverse x := rfl @[simp] theorem op_reverse (x : CliffordAlgebra Q) : op (reverse x) = reverseOp x := rfl @[simp]
Mathlib/LinearAlgebra/CliffordAlgebra/Conjugation.lean
111
111
theorem reverse_ι (m : M) : reverse (ι Q m) = ι Q m := by
simp [reverse]
[ " ((↑(opLinearEquiv R) ∘ₗ ι Q) m * (↑(opLinearEquiv R) ∘ₗ ι Q) m).unop =\n ((algebraMap R (CliffordAlgebra Q)ᵐᵒᵖ) (Q m)).unop", " ((AlgHom.unop (reverseOp.comp (AlgHom.opComm reverseOp))).toLinearMap ∘ₗ ι Q) x✝ =\n ((AlgHom.unop (AlgHom.id R (CliffordAlgebra Q)ᵐᵒᵖ)).toLinearMap ∘ₗ ι Q) x✝", " (((AlgHom.op...
[ " ((↑(opLinearEquiv R) ∘ₗ ι Q) m * (↑(opLinearEquiv R) ∘ₗ ι Q) m).unop =\n ((algebraMap R (CliffordAlgebra Q)ᵐᵒᵖ) (Q m)).unop", " ((AlgHom.unop (reverseOp.comp (AlgHom.opComm reverseOp))).toLinearMap ∘ₗ ι Q) x✝ =\n ((AlgHom.unop (AlgHom.id R (CliffordAlgebra Q)ᵐᵒᵖ)).toLinearMap ∘ₗ ι Q) x✝", " (((AlgHom.op...
import Mathlib.RingTheory.Ideal.IsPrimary import Mathlib.RingTheory.Localization.AtPrime import Mathlib.Order.Minimal #align_import ring_theory.ideal.minimal_prime from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" section variable {R S : Type*} [CommSemiring R] [CommSemiring S] (I J : Ideal R) protected def Ideal.minimalPrimes : Set (Ideal R) := minimals (· ≤ ·) { p | p.IsPrime ∧ I ≤ p } #align ideal.minimal_primes Ideal.minimalPrimes variable (R) in def minimalPrimes : Set (Ideal R) := Ideal.minimalPrimes ⊥ #align minimal_primes minimalPrimes lemma minimalPrimes_eq_minimals : minimalPrimes R = minimals (· ≤ ·) (setOf Ideal.IsPrime) := congr_arg (minimals (· ≤ ·)) (by simp) variable {I J}
Mathlib/RingTheory/Ideal/MinimalPrime.lean
56
74
theorem Ideal.exists_minimalPrimes_le [J.IsPrime] (e : I ≤ J) : ∃ p ∈ I.minimalPrimes, p ≤ J := by
suffices ∃ m ∈ { p : (Ideal R)ᵒᵈ | Ideal.IsPrime p ∧ I ≤ OrderDual.ofDual p }, OrderDual.toDual J ≤ m ∧ ∀ z ∈ { p : (Ideal R)ᵒᵈ | Ideal.IsPrime p ∧ I ≤ p }, m ≤ z → z = m by obtain ⟨p, h₁, h₂, h₃⟩ := this simp_rw [← @eq_comm _ p] at h₃ exact ⟨p, ⟨h₁, fun a b c => le_of_eq (h₃ a b c)⟩, h₂⟩ apply zorn_nonempty_partialOrder₀ swap · refine ⟨show J.IsPrime by infer_instance, e⟩ rintro (c : Set (Ideal R)) hc hc' J' hJ' refine ⟨OrderDual.toDual (sInf c), ⟨Ideal.sInf_isPrime_of_isChain ⟨J', hJ'⟩ hc'.symm fun x hx => (hc hx).1, ?_⟩, ?_⟩ · rw [OrderDual.ofDual_toDual, le_sInf_iff] exact fun _ hx => (hc hx).2 · rintro z hz rw [OrderDual.le_toDual] exact sInf_le hz
[ " {p | p.IsPrime ∧ ⊥ ≤ p} = setOf Ideal.IsPrime", " ∃ p ∈ I.minimalPrimes, p ≤ J", " ∃ m ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}, OrderDual.toDual J ≤ m ∧ ∀ z ∈ {p | IsPrime p ∧ I ≤ p}, m ≤ z → z = m", " OrderDual.toDual J ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}", " J.IsPrime", " ∀ c ⊆ {p | IsPrime ...
[ " {p | p.IsPrime ∧ ⊥ ≤ p} = setOf Ideal.IsPrime" ]
import Mathlib.Algebra.BigOperators.Group.Multiset import Mathlib.Data.Multiset.Dedup #align_import data.multiset.bind from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" assert_not_exists MonoidWithZero assert_not_exists MulAction universe v variable {α : Type*} {β : Type v} {γ δ : Type*} namespace Multiset def join : Multiset (Multiset α) → Multiset α := sum #align multiset.join Multiset.join theorem coe_join : ∀ L : List (List α), join (L.map ((↑) : List α → Multiset α) : Multiset (Multiset α)) = L.join | [] => rfl | l :: L => by exact congr_arg (fun s : Multiset α => ↑l + s) (coe_join L) #align multiset.coe_join Multiset.coe_join @[simp] theorem join_zero : @join α 0 = 0 := rfl #align multiset.join_zero Multiset.join_zero @[simp] theorem join_cons (s S) : @join α (s ::ₘ S) = s + join S := sum_cons _ _ #align multiset.join_cons Multiset.join_cons @[simp] theorem join_add (S T) : @join α (S + T) = join S + join T := sum_add _ _ #align multiset.join_add Multiset.join_add @[simp] theorem singleton_join (a) : join ({a} : Multiset (Multiset α)) = a := sum_singleton _ #align multiset.singleton_join Multiset.singleton_join @[simp] theorem mem_join {a S} : a ∈ @join α S ↔ ∃ s ∈ S, a ∈ s := Multiset.induction_on S (by simp) <| by simp (config := { contextual := true }) [or_and_right, exists_or] #align multiset.mem_join Multiset.mem_join @[simp] theorem card_join (S) : card (@join α S) = sum (map card S) := Multiset.induction_on S (by simp) (by simp) #align multiset.card_join Multiset.card_join @[simp] theorem map_join (f : α → β) (S : Multiset (Multiset α)) : map f (join S) = join (map (map f) S) := by induction S using Multiset.induction with | empty => simp | cons _ _ ih => simp [ih] @[to_additive (attr := simp)] theorem prod_join [CommMonoid α] {S : Multiset (Multiset α)} : prod (join S) = prod (map prod S) := by induction S using Multiset.induction with | empty => simp | cons _ _ ih => simp [ih] theorem rel_join {r : α → β → Prop} {s t} (h : Rel (Rel r) s t) : Rel r s.join t.join := by induction h with | zero => simp | cons hab hst ih => simpa using hab.add ih #align multiset.rel_join Multiset.rel_join section Bind variable (a : α) (s t : Multiset α) (f g : α → Multiset β) def bind (s : Multiset α) (f : α → Multiset β) : Multiset β := (s.map f).join #align multiset.bind Multiset.bind @[simp] theorem coe_bind (l : List α) (f : α → List β) : (@bind α β l fun a => f a) = l.bind f := by rw [List.bind, ← coe_join, List.map_map] rfl #align multiset.coe_bind Multiset.coe_bind @[simp] theorem zero_bind : bind 0 f = 0 := rfl #align multiset.zero_bind Multiset.zero_bind @[simp] theorem cons_bind : (a ::ₘ s).bind f = f a + s.bind f := by simp [bind] #align multiset.cons_bind Multiset.cons_bind @[simp] theorem singleton_bind : bind {a} f = f a := by simp [bind] #align multiset.singleton_bind Multiset.singleton_bind @[simp] theorem add_bind : (s + t).bind f = s.bind f + t.bind f := by simp [bind] #align multiset.add_bind Multiset.add_bind @[simp] theorem bind_zero : s.bind (fun _ => 0 : α → Multiset β) = 0 := by simp [bind, join, nsmul_zero] #align multiset.bind_zero Multiset.bind_zero @[simp] theorem bind_add : (s.bind fun a => f a + g a) = s.bind f + s.bind g := by simp [bind, join] #align multiset.bind_add Multiset.bind_add @[simp] theorem bind_cons (f : α → β) (g : α → Multiset β) : (s.bind fun a => f a ::ₘ g a) = map f s + s.bind g := Multiset.induction_on s (by simp) (by simp (config := { contextual := true }) [add_comm, add_left_comm, add_assoc]) #align multiset.bind_cons Multiset.bind_cons @[simp] theorem bind_singleton (f : α → β) : (s.bind fun x => ({f x} : Multiset β)) = map f s := Multiset.induction_on s (by rw [zero_bind, map_zero]) (by simp [singleton_add]) #align multiset.bind_singleton Multiset.bind_singleton @[simp] theorem mem_bind {b s} {f : α → Multiset β} : b ∈ bind s f ↔ ∃ a ∈ s, b ∈ f a := by simp [bind] #align multiset.mem_bind Multiset.mem_bind @[simp]
Mathlib/Data/Multiset/Bind.lean
163
163
theorem card_bind : card (s.bind f) = (s.map (card ∘ f)).sum := by
simp [bind]
[ " (↑(List.map ofList (l :: L))).join = ↑(l :: L).join", " a ∈ join 0 ↔ ∃ s ∈ 0, a ∈ s", " ∀ (a_1 : Multiset α) (s : Multiset (Multiset α)),\n (a ∈ s.join ↔ ∃ s_1 ∈ s, a ∈ s_1) → (a ∈ (a_1 ::ₘ s).join ↔ ∃ s_1 ∈ a_1 ::ₘ s, a ∈ s_1)", " card (join 0) = (map (⇑card) 0).sum", " ∀ (a : Multiset α) (s : Multise...
[ " (↑(List.map ofList (l :: L))).join = ↑(l :: L).join", " a ∈ join 0 ↔ ∃ s ∈ 0, a ∈ s", " ∀ (a_1 : Multiset α) (s : Multiset (Multiset α)),\n (a ∈ s.join ↔ ∃ s_1 ∈ s, a ∈ s_1) → (a ∈ (a_1 ::ₘ s).join ↔ ∃ s_1 ∈ a_1 ::ₘ s, a ∈ s_1)", " card (join 0) = (map (⇑card) 0).sum", " ∀ (a : Multiset α) (s : Multise...
import Mathlib.Analysis.Complex.RealDeriv import Mathlib.Analysis.Calculus.ContDiff.RCLike import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas #align_import analysis.special_functions.exp_deriv from "leanprover-community/mathlib"@"6a5c85000ab93fe5dcfdf620676f614ba8e18c26" noncomputable section open Filter Asymptotics Set Function open scoped Classical Topology namespace Complex variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedAlgebra 𝕜 ℂ]
Mathlib/Analysis/SpecialFunctions/ExpDeriv.lean
36
42
theorem hasDerivAt_exp (x : ℂ) : HasDerivAt exp (exp x) x := by
rw [hasDerivAt_iff_isLittleO_nhds_zero] have : (1 : ℕ) < 2 := by norm_num refine (IsBigO.of_bound ‖exp x‖ ?_).trans_isLittleO (isLittleO_pow_id this) filter_upwards [Metric.ball_mem_nhds (0 : ℂ) zero_lt_one] simp only [Metric.mem_ball, dist_zero_right, norm_pow] exact fun z hz => exp_bound_sq x z hz.le
[ " HasDerivAt cexp (cexp x) x", " (fun h => cexp (x + h) - cexp x - h • cexp x) =o[𝓝 0] fun h => h", " 1 < 2", " ∀ᶠ (x_1 : ℂ) in 𝓝 0, ‖cexp (x + x_1) - cexp x - x_1 • cexp x‖ ≤ ‖cexp x‖ * ‖x_1 ^ 2‖", " ∀ a ∈ Metric.ball 0 1, ‖cexp (x + a) - cexp x - a • cexp x‖ ≤ ‖cexp x‖ * ‖a ^ 2‖", " ∀ (a : ℂ), ‖a‖ < 1...
[]
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset import Mathlib.Data.Finite.Card import Mathlib.GroupTheory.Finiteness import Mathlib.GroupTheory.GroupAction.Quotient #align_import group_theory.index from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" namespace Subgroup open Cardinal variable {G : Type*} [Group G] (H K L : Subgroup G) @[to_additive "The index of a subgroup as a natural number, and returns 0 if the index is infinite."] noncomputable def index : ℕ := Nat.card (G ⧸ H) #align subgroup.index Subgroup.index #align add_subgroup.index AddSubgroup.index @[to_additive "The relative index of a subgroup as a natural number, and returns 0 if the relative index is infinite."] noncomputable def relindex : ℕ := (H.subgroupOf K).index #align subgroup.relindex Subgroup.relindex #align add_subgroup.relindex AddSubgroup.relindex @[to_additive] theorem index_comap_of_surjective {G' : Type*} [Group G'] {f : G' →* G} (hf : Function.Surjective f) : (H.comap f).index = H.index := by letI := QuotientGroup.leftRel H letI := QuotientGroup.leftRel (H.comap f) have key : ∀ x y : G', Setoid.r x y ↔ Setoid.r (f x) (f y) := by simp only [QuotientGroup.leftRel_apply] exact fun x y => iff_of_eq (congr_arg (· ∈ H) (by rw [f.map_mul, f.map_inv])) refine Cardinal.toNat_congr (Equiv.ofBijective (Quotient.map' f fun x y => (key x y).mp) ⟨?_, ?_⟩) · simp_rw [← Quotient.eq''] at key refine Quotient.ind' fun x => ?_ refine Quotient.ind' fun y => ?_ exact (key x y).mpr · refine Quotient.ind' fun x => ?_ obtain ⟨y, hy⟩ := hf x exact ⟨y, (Quotient.map'_mk'' f _ y).trans (congr_arg Quotient.mk'' hy)⟩ #align subgroup.index_comap_of_surjective Subgroup.index_comap_of_surjective #align add_subgroup.index_comap_of_surjective AddSubgroup.index_comap_of_surjective @[to_additive] theorem index_comap {G' : Type*} [Group G'] (f : G' →* G) : (H.comap f).index = H.relindex f.range := Eq.trans (congr_arg index (by rfl)) ((H.subgroupOf f.range).index_comap_of_surjective f.rangeRestrict_surjective) #align subgroup.index_comap Subgroup.index_comap #align add_subgroup.index_comap AddSubgroup.index_comap @[to_additive] theorem relindex_comap {G' : Type*} [Group G'] (f : G' →* G) (K : Subgroup G') : relindex (comap f H) K = relindex H (map f K) := by rw [relindex, subgroupOf, comap_comap, index_comap, ← f.map_range, K.subtype_range] #align subgroup.relindex_comap Subgroup.relindex_comap #align add_subgroup.relindex_comap AddSubgroup.relindex_comap variable {H K L} @[to_additive relindex_mul_index] theorem relindex_mul_index (h : H ≤ K) : H.relindex K * K.index = H.index := ((mul_comm _ _).trans (Cardinal.toNat_mul _ _).symm).trans (congr_arg Cardinal.toNat (Equiv.cardinal_eq (quotientEquivProdOfLE h))).symm #align subgroup.relindex_mul_index Subgroup.relindex_mul_index #align add_subgroup.relindex_mul_index AddSubgroup.relindex_mul_index @[to_additive] theorem index_dvd_of_le (h : H ≤ K) : K.index ∣ H.index := dvd_of_mul_left_eq (H.relindex K) (relindex_mul_index h) #align subgroup.index_dvd_of_le Subgroup.index_dvd_of_le #align add_subgroup.index_dvd_of_le AddSubgroup.index_dvd_of_le @[to_additive] theorem relindex_dvd_index_of_le (h : H ≤ K) : H.relindex K ∣ H.index := dvd_of_mul_right_eq K.index (relindex_mul_index h) #align subgroup.relindex_dvd_index_of_le Subgroup.relindex_dvd_index_of_le #align add_subgroup.relindex_dvd_index_of_le AddSubgroup.relindex_dvd_index_of_le @[to_additive] theorem relindex_subgroupOf (hKL : K ≤ L) : (H.subgroupOf L).relindex (K.subgroupOf L) = H.relindex K := ((index_comap (H.subgroupOf L) (inclusion hKL)).trans (congr_arg _ (inclusion_range hKL))).symm #align subgroup.relindex_subgroup_of Subgroup.relindex_subgroupOf #align add_subgroup.relindex_add_subgroup_of AddSubgroup.relindex_addSubgroupOf variable (H K L) @[to_additive relindex_mul_relindex] theorem relindex_mul_relindex (hHK : H ≤ K) (hKL : K ≤ L) : H.relindex K * K.relindex L = H.relindex L := by rw [← relindex_subgroupOf hKL] exact relindex_mul_index fun x hx => hHK hx #align subgroup.relindex_mul_relindex Subgroup.relindex_mul_relindex #align add_subgroup.relindex_mul_relindex AddSubgroup.relindex_mul_relindex @[to_additive] theorem inf_relindex_right : (H ⊓ K).relindex K = H.relindex K := by rw [relindex, relindex, inf_subgroupOf_right] #align subgroup.inf_relindex_right Subgroup.inf_relindex_right #align add_subgroup.inf_relindex_right AddSubgroup.inf_relindex_right @[to_additive] theorem inf_relindex_left : (H ⊓ K).relindex H = K.relindex H := by rw [inf_comm, inf_relindex_right] #align subgroup.inf_relindex_left Subgroup.inf_relindex_left #align add_subgroup.inf_relindex_left AddSubgroup.inf_relindex_left @[to_additive relindex_inf_mul_relindex]
Mathlib/GroupTheory/Index.lean
146
148
theorem relindex_inf_mul_relindex : H.relindex (K ⊓ L) * K.relindex L = (H ⊓ K).relindex L := by
rw [← inf_relindex_right H (K ⊓ L), ← inf_relindex_right K L, ← inf_relindex_right (H ⊓ K) L, inf_assoc, relindex_mul_relindex (H ⊓ (K ⊓ L)) (K ⊓ L) L inf_le_right inf_le_right]
[ " (comap f H).index = H.index", " ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)", " ∀ (x y : G'), x⁻¹ * y ∈ comap f H ↔ (f x)⁻¹ * f y ∈ H", " f (x⁻¹ * y) = (f x)⁻¹ * f y", " Function.Injective (Quotient.map' ⇑f ⋯)", " ∀ ⦃a₂ : G' ⧸ comap f H⦄, Quotient.map' ⇑f ⋯ (Quotient.mk'' x) = Quotient.map' ⇑f ⋯ a...
[ " (comap f H).index = H.index", " ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)", " ∀ (x y : G'), x⁻¹ * y ∈ comap f H ↔ (f x)⁻¹ * f y ∈ H", " f (x⁻¹ * y) = (f x)⁻¹ * f y", " Function.Injective (Quotient.map' ⇑f ⋯)", " ∀ ⦃a₂ : G' ⧸ comap f H⦄, Quotient.map' ⇑f ⋯ (Quotient.mk'' x) = Quotient.map' ⇑f ⋯ a...
import Mathlib.Algebra.Group.Commute.Units import Mathlib.Algebra.Group.Int import Mathlib.Algebra.GroupWithZero.Semiconj import Mathlib.Data.Nat.GCD.Basic import Mathlib.Order.Bounds.Basic #align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47" namespace Nat def xgcdAux : ℕ → ℤ → ℤ → ℕ → ℤ → ℤ → ℕ × ℤ × ℤ | 0, _, _, r', s', t' => (r', s', t') | succ k, s, t, r', s', t' => let q := r' / succ k xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t termination_by k => k decreasing_by exact mod_lt _ <| (succ_pos _).gt #align nat.xgcd_aux Nat.xgcdAux @[simp] theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux] #align nat.xgcd_zero_left Nat.xgcd_zero_left theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) : xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by obtain ⟨r, rfl⟩ := Nat.exists_eq_succ_of_ne_zero h.ne' simp [xgcdAux] #align nat.xgcd_aux_rec Nat.xgcdAux_rec def xgcd (x y : ℕ) : ℤ × ℤ := (xgcdAux x 1 0 y 0 1).2 #align nat.xgcd Nat.xgcd def gcdA (x y : ℕ) : ℤ := (xgcd x y).1 #align nat.gcd_a Nat.gcdA def gcdB (x y : ℕ) : ℤ := (xgcd x y).2 #align nat.gcd_b Nat.gcdB @[simp]
Mathlib/Data/Int/GCD.lean
74
76
theorem gcdA_zero_left {s : ℕ} : gcdA 0 s = 0 := by
unfold gcdA rw [xgcd, xgcd_zero_left]
[ " (invImage\n (fun x =>\n PSigma.casesOn x fun a a_1 =>\n PSigma.casesOn a_1 fun a_2 a_3 =>\n PSigma.casesOn a_3 fun a_4 a_5 => PSigma.casesOn a_5 fun a_6 a_7 => PSigma.casesOn a_7 fun a_8 a_9 => a)\n instWellFoundedRelationOfSizeOf).1\n ⟨r' % k.succ, ⟨s' - ↑q * s, ...
[ " (invImage\n (fun x =>\n PSigma.casesOn x fun a a_1 =>\n PSigma.casesOn a_1 fun a_2 a_3 =>\n PSigma.casesOn a_3 fun a_4 a_5 => PSigma.casesOn a_5 fun a_6 a_7 => PSigma.casesOn a_7 fun a_8 a_9 => a)\n instWellFoundedRelationOfSizeOf).1\n ⟨r' % k.succ, ⟨s' - ↑q * s, ...
import Mathlib.RingTheory.JacobsonIdeal #align_import ring_theory.nakayama from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] open Ideal namespace Submodule theorem eq_smul_of_le_smul_of_le_jacobson {I J : Ideal R} {N : Submodule R M} (hN : N.FG) (hIN : N ≤ I • N) (hIjac : I ≤ jacobson J) : N = J • N := by refine le_antisymm ?_ (Submodule.smul_le.2 fun _ _ _ => Submodule.smul_mem _ _) intro n hn cases' Submodule.exists_sub_one_mem_and_smul_eq_zero_of_fg_of_le_smul I N hN hIN with r hr cases' exists_mul_sub_mem_of_sub_one_mem_jacobson r (hIjac hr.1) with s hs have : n = -(s * r - 1) • n := by rw [neg_sub, sub_smul, mul_smul, hr.2 n hn, one_smul, smul_zero, sub_zero] rw [this] exact Submodule.smul_mem_smul (Submodule.neg_mem _ hs) hn #align submodule.eq_smul_of_le_smul_of_le_jacobson Submodule.eq_smul_of_le_smul_of_le_jacobson lemma eq_bot_of_eq_ideal_smul_of_le_jacobson_annihilator {I : Ideal R} {N : Submodule R M} (hN : FG N) (hIN : N = I • N) (hIjac : I ≤ N.annihilator.jacobson) : N = ⊥ := (eq_smul_of_le_smul_of_le_jacobson hN hIN.le hIjac).trans N.annihilator_smul open Pointwise in lemma eq_bot_of_eq_pointwise_smul_of_mem_jacobson_annihilator {r : R} {N : Submodule R M} (hN : FG N) (hrN : N = r • N) (hrJac : r ∈ N.annihilator.jacobson) : N = ⊥ := eq_bot_of_eq_ideal_smul_of_le_jacobson_annihilator hN (Eq.trans hrN (ideal_span_singleton_smul r N).symm) ((span_singleton_le_iff_mem r _).mpr hrJac) open Pointwise in lemma eq_bot_of_set_smul_eq_of_subset_jacobson_annihilator {s : Set R} {N : Submodule R M} (hN : FG N) (hsN : N = s • N) (hsJac : s ⊆ N.annihilator.jacobson) : N = ⊥ := eq_bot_of_eq_ideal_smul_of_le_jacobson_annihilator hN (Eq.trans hsN (span_smul_eq s N).symm) (span_le.mpr hsJac) lemma top_ne_ideal_smul_of_le_jacobson_annihilator [Nontrivial M] [Module.Finite R M] {I} (h : I ≤ (Module.annihilator R M).jacobson) : (⊤ : Submodule R M) ≠ I • ⊤ := fun H => top_ne_bot <| eq_bot_of_eq_ideal_smul_of_le_jacobson_annihilator Module.Finite.out H <| (congrArg (I ≤ Ideal.jacobson ·) annihilator_top).mpr h open Pointwise in lemma top_ne_set_smul_of_subset_jacobson_annihilator [Nontrivial M] [Module.Finite R M] {s : Set R} (h : s ⊆ (Module.annihilator R M).jacobson) : (⊤ : Submodule R M) ≠ s • ⊤ := ne_of_ne_of_eq (top_ne_ideal_smul_of_le_jacobson_annihilator (span_le.mpr h)) (span_smul_eq _ _) open Pointwise in lemma top_ne_pointwise_smul_of_mem_jacobson_annihilator [Nontrivial M] [Module.Finite R M] {r} (h : r ∈ (Module.annihilator R M).jacobson) : (⊤ : Submodule R M) ≠ r • ⊤ := ne_of_ne_of_eq (top_ne_set_smul_of_subset_jacobson_annihilator <| Set.singleton_subset_iff.mpr h) (singleton_set_smul ⊤ r)
Mathlib/RingTheory/Nakayama.lean
109
111
theorem eq_bot_of_le_smul_of_le_jacobson_bot (I : Ideal R) (N : Submodule R M) (hN : N.FG) (hIN : N ≤ I • N) (hIjac : I ≤ jacobson ⊥) : N = ⊥ := by
rw [eq_smul_of_le_smul_of_le_jacobson hN hIN hIjac, Submodule.bot_smul]
[ " N = J • N", " N ≤ J • N", " n ∈ J • N", " n = -(s * r - 1) • n", " -(s * r - 1) • n ∈ J • N", " N = ⊥" ]
[ " N = J • N", " N ≤ J • N", " n ∈ J • N", " n = -(s * r - 1) • n", " -(s * r - 1) • n ∈ J • N" ]
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 section SameSpace variable {α E : Type*} {m : MeasurableSpace α} [NormedAddCommGroup E] {μ : Measure α} {f : α → E} theorem snorm'_le_snorm'_mul_rpow_measure_univ {p q : ℝ} (hp0_lt : 0 < p) (hpq : p ≤ q) (hf : AEStronglyMeasurable f μ) : snorm' f p μ ≤ snorm' f q μ * μ Set.univ ^ (1 / p - 1 / q) := by have hq0_lt : 0 < q := lt_of_lt_of_le hp0_lt hpq by_cases hpq_eq : p = q · rw [hpq_eq, sub_self, ENNReal.rpow_zero, mul_one] have hpq : p < q := lt_of_le_of_ne hpq hpq_eq let g := fun _ : α => (1 : ℝ≥0∞) have h_rw : (∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ p ∂μ) = ∫⁻ a, ((‖f a‖₊ : ℝ≥0∞) * g a) ^ p ∂μ := lintegral_congr fun a => by simp [g] repeat' rw [snorm'] rw [h_rw] let r := p * q / (q - p) have hpqr : 1 / p = 1 / q + 1 / r := by field_simp [r, hp0_lt.ne', hq0_lt.ne'] calc (∫⁻ a : α, (↑‖f a‖₊ * g a) ^ p ∂μ) ^ (1 / p) ≤ (∫⁻ a : α, ↑‖f a‖₊ ^ q ∂μ) ^ (1 / q) * (∫⁻ a : α, g a ^ r ∂μ) ^ (1 / r) := ENNReal.lintegral_Lp_mul_le_Lq_mul_Lr hp0_lt hpq hpqr μ hf.ennnorm aemeasurable_const _ = (∫⁻ a : α, ↑‖f a‖₊ ^ q ∂μ) ^ (1 / q) * μ Set.univ ^ (1 / p - 1 / q) := by rw [hpqr]; simp [r, g] #align measure_theory.snorm'_le_snorm'_mul_rpow_measure_univ MeasureTheory.snorm'_le_snorm'_mul_rpow_measure_univ
Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean
48
58
theorem snorm'_le_snormEssSup_mul_rpow_measure_univ {q : ℝ} (hq_pos : 0 < q) : snorm' f q μ ≤ snormEssSup f μ * μ Set.univ ^ (1 / q) := by
have h_le : (∫⁻ a : α, (‖f a‖₊ : ℝ≥0∞) ^ q ∂μ) ≤ ∫⁻ _ : α, snormEssSup f μ ^ q ∂μ := by refine lintegral_mono_ae ?_ have h_nnnorm_le_snorm_ess_sup := coe_nnnorm_ae_le_snormEssSup f μ exact h_nnnorm_le_snorm_ess_sup.mono fun x hx => by gcongr rw [snorm', ← ENNReal.rpow_one (snormEssSup f μ)] nth_rw 2 [← mul_inv_cancel (ne_of_lt hq_pos).symm] rw [ENNReal.rpow_mul, one_div, ← ENNReal.mul_rpow_of_nonneg _ _ (by simp [hq_pos.le] : 0 ≤ q⁻¹)] gcongr rwa [lintegral_const] at h_le
[ " snorm' f p μ ≤ snorm' f q μ * μ Set.univ ^ (1 / p - 1 / q)", " ↑‖f a‖₊ ^ p = (↑‖f a‖₊ * g a) ^ p", " (∫⁻ (a : α), ↑‖f a‖₊ ^ p ∂μ) ^ (1 / p) ≤ snorm' f q μ * μ Set.univ ^ (1 / p - 1 / q)", " (∫⁻ (a : α), ↑‖f a‖₊ ^ p ∂μ) ^ (1 / p) ≤ (∫⁻ (a : α), ↑‖f a‖₊ ^ q ∂μ) ^ (1 / q) * μ Set.univ ^ (1 / p - 1 / q)", " (...
[ " snorm' f p μ ≤ snorm' f q μ * μ Set.univ ^ (1 / p - 1 / q)", " ↑‖f a‖₊ ^ p = (↑‖f a‖₊ * g a) ^ p", " (∫⁻ (a : α), ↑‖f a‖₊ ^ p ∂μ) ^ (1 / p) ≤ snorm' f q μ * μ Set.univ ^ (1 / p - 1 / q)", " (∫⁻ (a : α), ↑‖f a‖₊ ^ p ∂μ) ^ (1 / p) ≤ (∫⁻ (a : α), ↑‖f a‖₊ ^ q ∂μ) ^ (1 / q) * μ Set.univ ^ (1 / p - 1 / q)", " (...
import Mathlib.Analysis.Calculus.MeanValue import Mathlib.Analysis.Calculus.Deriv.Inv #align_import analysis.calculus.lhopital from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" open Filter Set open scoped Filter Topology Pointwise variable {a b : ℝ} (hab : a < b) {l : Filter ℝ} {f f' g g' : ℝ → ℝ} namespace HasDerivAt theorem lhopital_zero_right_on_Ioo (hff' : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x) (hgg' : ∀ x ∈ Ioo a b, HasDerivAt g (g' x) x) (hg' : ∀ x ∈ Ioo a b, g' x ≠ 0) (hfa : Tendsto f (𝓝[>] a) (𝓝 0)) (hga : Tendsto g (𝓝[>] a) (𝓝 0)) (hdiv : Tendsto (fun x => f' x / g' x) (𝓝[>] a) l) : Tendsto (fun x => f x / g x) (𝓝[>] a) l := by have sub : ∀ x ∈ Ioo a b, Ioo a x ⊆ Ioo a b := fun x hx => Ioo_subset_Ioo (le_refl a) (le_of_lt hx.2) have hg : ∀ x ∈ Ioo a b, g x ≠ 0 := by intro x hx h have : Tendsto g (𝓝[<] x) (𝓝 0) := by rw [← h, ← nhdsWithin_Ioo_eq_nhdsWithin_Iio hx.1] exact ((hgg' x hx).continuousAt.continuousWithinAt.mono <| sub x hx).tendsto obtain ⟨y, hyx, hy⟩ : ∃ c ∈ Ioo a x, g' c = 0 := exists_hasDerivAt_eq_zero' hx.1 hga this fun y hy => hgg' y <| sub x hx hy exact hg' y (sub x hx hyx) hy have : ∀ x ∈ Ioo a b, ∃ c ∈ Ioo a x, f x * g' c = g x * f' c := by intro x hx rw [← sub_zero (f x), ← sub_zero (g x)] exact exists_ratio_hasDerivAt_eq_ratio_slope' g g' hx.1 f f' (fun y hy => hgg' y <| sub x hx hy) (fun y hy => hff' y <| sub x hx hy) hga hfa (tendsto_nhdsWithin_of_tendsto_nhds (hgg' x hx).continuousAt.tendsto) (tendsto_nhdsWithin_of_tendsto_nhds (hff' x hx).continuousAt.tendsto) choose! c hc using this have : ∀ x ∈ Ioo a b, ((fun x' => f' x' / g' x') ∘ c) x = f x / g x := by intro x hx rcases hc x hx with ⟨h₁, h₂⟩ field_simp [hg x hx, hg' (c x) ((sub x hx) h₁)] simp only [h₂] rw [mul_comm] have cmp : ∀ x ∈ Ioo a b, a < c x ∧ c x < x := fun x hx => (hc x hx).1 rw [← nhdsWithin_Ioo_eq_nhdsWithin_Ioi hab] apply tendsto_nhdsWithin_congr this apply hdiv.comp refine tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ (tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds (tendsto_nhdsWithin_of_tendsto_nhds tendsto_id) ?_ ?_) ?_ all_goals apply eventually_nhdsWithin_of_forall intro x hx have := cmp x hx try simp linarith [this] #align has_deriv_at.lhopital_zero_right_on_Ioo HasDerivAt.lhopital_zero_right_on_Ioo theorem lhopital_zero_right_on_Ico (hff' : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x) (hgg' : ∀ x ∈ Ioo a b, HasDerivAt g (g' x) x) (hcf : ContinuousOn f (Ico a b)) (hcg : ContinuousOn g (Ico a b)) (hg' : ∀ x ∈ Ioo a b, g' x ≠ 0) (hfa : f a = 0) (hga : g a = 0) (hdiv : Tendsto (fun x => f' x / g' x) (𝓝[>] a) l) : Tendsto (fun x => f x / g x) (𝓝[>] a) l := by refine lhopital_zero_right_on_Ioo hab hff' hgg' hg' ?_ ?_ hdiv · rw [← hfa, ← nhdsWithin_Ioo_eq_nhdsWithin_Ioi hab] exact ((hcf a <| left_mem_Ico.mpr hab).mono Ioo_subset_Ico_self).tendsto · rw [← hga, ← nhdsWithin_Ioo_eq_nhdsWithin_Ioi hab] exact ((hcg a <| left_mem_Ico.mpr hab).mono Ioo_subset_Ico_self).tendsto #align has_deriv_at.lhopital_zero_right_on_Ico HasDerivAt.lhopital_zero_right_on_Ico
Mathlib/Analysis/Calculus/LHopital.lean
107
129
theorem lhopital_zero_left_on_Ioo (hff' : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x) (hgg' : ∀ x ∈ Ioo a b, HasDerivAt g (g' x) x) (hg' : ∀ x ∈ Ioo a b, g' x ≠ 0) (hfb : Tendsto f (𝓝[<] b) (𝓝 0)) (hgb : Tendsto g (𝓝[<] b) (𝓝 0)) (hdiv : Tendsto (fun x => f' x / g' x) (𝓝[<] b) l) : Tendsto (fun x => f x / g x) (𝓝[<] b) l := by
-- Here, we essentially compose by `Neg.neg`. The following is mostly technical details. have hdnf : ∀ x ∈ -Ioo a b, HasDerivAt (f ∘ Neg.neg) (f' (-x) * -1) x := fun x hx => comp x (hff' (-x) hx) (hasDerivAt_neg x) have hdng : ∀ x ∈ -Ioo a b, HasDerivAt (g ∘ Neg.neg) (g' (-x) * -1) x := fun x hx => comp x (hgg' (-x) hx) (hasDerivAt_neg x) rw [preimage_neg_Ioo] at hdnf rw [preimage_neg_Ioo] at hdng have := lhopital_zero_right_on_Ioo (neg_lt_neg hab) hdnf hdng (by intro x hx h apply hg' _ (by rw [← preimage_neg_Ioo] at hx; exact hx) rwa [mul_comm, ← neg_eq_neg_one_mul, neg_eq_zero] at h) (hfb.comp tendsto_neg_nhdsWithin_Ioi_neg) (hgb.comp tendsto_neg_nhdsWithin_Ioi_neg) (by simp only [neg_div_neg_eq, mul_one, mul_neg] exact (tendsto_congr fun x => rfl).mp (hdiv.comp tendsto_neg_nhdsWithin_Ioi_neg)) have := this.comp tendsto_neg_nhdsWithin_Iio unfold Function.comp at this simpa only [neg_neg]
[ " Tendsto (fun x => f x / g x) (𝓝[>] a) l", " ∀ x ∈ Ioo a b, g x ≠ 0", " False", " Tendsto g (𝓝[<] x) (𝓝 0)", " Tendsto g (𝓝[Ioo a x] x) (𝓝 (g x))", " ∀ x ∈ Ioo a b, ∃ c ∈ Ioo a x, f x * g' c = g x * f' c", " ∃ c ∈ Ioo a x, f x * g' c = g x * f' c", " ∃ c ∈ Ioo a x, (f x - 0) * g' c = (g x - 0) *...
[ " Tendsto (fun x => f x / g x) (𝓝[>] a) l", " ∀ x ∈ Ioo a b, g x ≠ 0", " False", " Tendsto g (𝓝[<] x) (𝓝 0)", " Tendsto g (𝓝[Ioo a x] x) (𝓝 (g x))", " ∀ x ∈ Ioo a b, ∃ c ∈ Ioo a x, f x * g' c = g x * f' c", " ∃ c ∈ Ioo a x, f x * g' c = g x * f' c", " ∃ c ∈ Ioo a x, (f x - 0) * g' c = (g x - 0) *...
import Mathlib.CategoryTheory.PathCategory import Mathlib.CategoryTheory.Functor.FullyFaithful import Mathlib.CategoryTheory.Bicategory.Free import Mathlib.CategoryTheory.Bicategory.LocallyDiscrete #align_import category_theory.bicategory.coherence from "leanprover-community/mathlib"@"f187f1074fa1857c94589cc653c786cadc4c35ff" open Quiver (Path) open Quiver.Path namespace CategoryTheory open Bicategory Category universe v u namespace FreeBicategory variable {B : Type u} [Quiver.{v + 1} B] @[simp] def inclusionPathAux {a : B} : ∀ {b : B}, Path a b → Hom a b | _, nil => Hom.id a | _, cons p f => (inclusionPathAux p).comp (Hom.of f) #align category_theory.free_bicategory.inclusion_path_aux CategoryTheory.FreeBicategory.inclusionPathAux local instance homCategory' (a b : B) : Category (Hom a b) := homCategory a b def inclusionPath (a b : B) : Discrete (Path.{v + 1} a b) ⥤ Hom a b := Discrete.functor inclusionPathAux #align category_theory.free_bicategory.inclusion_path CategoryTheory.FreeBicategory.inclusionPath def preinclusion (B : Type u) [Quiver.{v + 1} B] : PrelaxFunctor (LocallyDiscrete (Paths B)) (FreeBicategory B) where obj a := a.as map := @fun a b f => (@inclusionPath B _ a.as b.as).obj f map₂ η := (inclusionPath _ _).map η #align category_theory.free_bicategory.preinclusion CategoryTheory.FreeBicategory.preinclusion @[simp] theorem preinclusion_obj (a : B) : (preinclusion B).obj ⟨a⟩ = a := rfl #align category_theory.free_bicategory.preinclusion_obj CategoryTheory.FreeBicategory.preinclusion_obj @[simp] theorem preinclusion_map₂ {a b : B} (f g : Discrete (Path.{v + 1} a b)) (η : f ⟶ g) : (preinclusion B).map₂ η = eqToHom (congr_arg _ (Discrete.ext _ _ (Discrete.eq_of_hom η))) := by rcases η with ⟨⟨⟩⟩ cases Discrete.ext _ _ (by assumption) convert (inclusionPath a b).map_id _ #align category_theory.free_bicategory.preinclusion_map₂ CategoryTheory.FreeBicategory.preinclusion_map₂ @[simp] def normalizeAux {a : B} : ∀ {b c : B}, Path a b → Hom b c → Path a c | _, _, p, Hom.of f => p.cons f | _, _, p, Hom.id _ => p | _, _, p, Hom.comp f g => normalizeAux (normalizeAux p f) g #align category_theory.free_bicategory.normalize_aux CategoryTheory.FreeBicategory.normalizeAux @[simp] def normalizeIso {a : B} : ∀ {b c : B} (p : Path a b) (f : Hom b c), (preinclusion B).map ⟨p⟩ ≫ f ≅ (preinclusion B).map ⟨normalizeAux p f⟩ | _, _, _, Hom.of _ => Iso.refl _ | _, _, _, Hom.id b => ρ_ _ | _, _, p, Hom.comp f g => (α_ _ _ _).symm ≪≫ whiskerRightIso (normalizeIso p f) g ≪≫ normalizeIso (normalizeAux p f) g #align category_theory.free_bicategory.normalize_iso CategoryTheory.FreeBicategory.normalizeIso theorem normalizeAux_congr {a b c : B} (p : Path a b) {f g : Hom b c} (η : f ⟶ g) : normalizeAux p f = normalizeAux p g := by rcases η with ⟨η'⟩ apply @congr_fun _ _ fun p => normalizeAux p f clear p η induction η' with | vcomp _ _ _ _ => apply Eq.trans <;> assumption | whisker_left _ _ ih => funext; apply congr_fun ih | whisker_right _ _ ih => funext; apply congr_arg₂ _ (congr_fun ih _) rfl | _ => funext; rfl #align category_theory.free_bicategory.normalize_aux_congr CategoryTheory.FreeBicategory.normalizeAux_congr theorem normalize_naturality {a b c : B} (p : Path a b) {f g : Hom b c} (η : f ⟶ g) : (preinclusion B).map ⟨p⟩ ◁ η ≫ (normalizeIso p g).hom = (normalizeIso p f).hom ≫ (preinclusion B).map₂ (eqToHom (Discrete.ext _ _ (normalizeAux_congr p η))) := by rcases η with ⟨η'⟩; clear η; induction η' with | id => simp | vcomp η θ ihf ihg => simp only [mk_vcomp, Bicategory.whiskerLeft_comp] slice_lhs 2 3 => rw [ihg] slice_lhs 1 2 => rw [ihf] simp -- p ≠ nil required! See the docstring of `normalizeAux`. | whisker_left _ _ ih => dsimp rw [associator_inv_naturality_right_assoc, whisker_exchange_assoc, ih] simp | whisker_right h η' ih => dsimp rw [associator_inv_naturality_middle_assoc, ← comp_whiskerRight_assoc, ih, comp_whiskerRight] have := dcongr_arg (fun x => (normalizeIso x h).hom) (normalizeAux_congr p (Quot.mk _ η')) dsimp at this; simp [this] | _ => simp #align category_theory.free_bicategory.normalize_naturality CategoryTheory.FreeBicategory.normalize_naturality -- Porting note: the left-hand side is not in simp-normal form. -- @[simp]
Mathlib/CategoryTheory/Bicategory/Coherence.lean
188
193
theorem normalizeAux_nil_comp {a b c : B} (f : Hom a b) (g : Hom b c) : normalizeAux nil (f.comp g) = (normalizeAux nil f).comp (normalizeAux nil g) := by
induction g generalizing a with | id => rfl | of => rfl | comp g _ ihf ihg => erw [ihg (f.comp g), ihf f, ihg g, comp_assoc]
[ " (preinclusion B).map₂ η = eqToHom ⋯", " (preinclusion B).map₂ { down := { down := down✝ } } = eqToHom ⋯", " ?m.3791.as = ?m.3792.as", " normalizeAux p f = normalizeAux p g", " (fun p => normalizeAux p f) = fun p => normalizeAux p g", " (fun p => normalizeAux p f✝) = fun p => normalizeAux p h✝", " (fun...
[ " (preinclusion B).map₂ η = eqToHom ⋯", " (preinclusion B).map₂ { down := { down := down✝ } } = eqToHom ⋯", " ?m.3791.as = ?m.3792.as", " normalizeAux p f = normalizeAux p g", " (fun p => normalizeAux p f) = fun p => normalizeAux p g", " (fun p => normalizeAux p f✝) = fun p => normalizeAux p h✝", " (fun...
import Mathlib.Algebra.MvPolynomial.Supported import Mathlib.RingTheory.WittVector.Truncated #align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section namespace WittVector variable (p : ℕ) [hp : Fact p.Prime] variable {k : Type*} [CommRing k] local notation "𝕎" => WittVector p -- Porting note: new notation local notation "𝕄" => MvPolynomial (Fin 2 × ℕ) ℤ open Finset MvPolynomial def wittPolyProd (n : ℕ) : 𝕄 := rename (Prod.mk (0 : Fin 2)) (wittPolynomial p ℤ n) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p ℤ n) #align witt_vector.witt_poly_prod WittVector.wittPolyProd theorem wittPolyProd_vars (n : ℕ) : (wittPolyProd p n).vars ⊆ univ ×ˢ range (n + 1) := by rw [wittPolyProd] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> · refine Subset.trans (vars_rename _ _) ?_ simp [wittPolynomial_vars, image_subset_iff] #align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars def wittPolyProdRemainder (n : ℕ) : 𝕄 := ∑ i ∈ range n, (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) #align witt_vector.witt_poly_prod_remainder WittVector.wittPolyProdRemainder theorem wittPolyProdRemainder_vars (n : ℕ) : (wittPolyProdRemainder p n).vars ⊆ univ ×ˢ range n := by rw [wittPolyProdRemainder] refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ · apply Subset.trans (vars_pow _ _) have : (p : 𝕄) = C (p : ℤ) := by simp only [Int.cast_natCast, eq_intCast] rw [this, vars_C] apply empty_subset · apply Subset.trans (vars_pow _ _) apply Subset.trans (wittMul_vars _ _) apply product_subset_product (Subset.refl _) simp only [mem_range, range_subset] at hx ⊢ exact hx #align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars def remainder (n : ℕ) : 𝕄 := (∑ x ∈ range (n + 1), (rename (Prod.mk 0)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : ℤ) ^ x))) * ∑ x ∈ range (n + 1), (rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : ℤ) ^ x)) #align witt_vector.remainder WittVector.remainder
Mathlib/RingTheory/WittVector/MulCoeff.lean
99
110
theorem remainder_vars (n : ℕ) : (remainder p n).vars ⊆ univ ×ˢ range (n + 1) := by
rw [remainder] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> · refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx rw [rename_monomial, vars_monomial, Finsupp.mapDomain_single] · apply Subset.trans Finsupp.support_single_subset simpa using mem_range.mp hx · apply pow_ne_zero exact mod_cast hp.out.ne_zero
[ " (wittPolyProd p n).vars ⊆ univ ×ˢ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p ℤ n) * (rename (Prod.mk 1)) (wittPolynomial p ℤ n)).vars ⊆\n univ ×ˢ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p ℤ n)).vars ∪ ((rename (Prod.mk 1)) (wittPolynomial p ℤ n)).vars ⊆\n univ ×ˢ range (n ...
[ " (wittPolyProd p n).vars ⊆ univ ×ˢ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p ℤ n) * (rename (Prod.mk 1)) (wittPolynomial p ℤ n)).vars ⊆\n univ ×ˢ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p ℤ n)).vars ∪ ((rename (Prod.mk 1)) (wittPolynomial p ℤ n)).vars ⊆\n univ ×ˢ range (n ...
import Mathlib.Analysis.Complex.AbsMax import Mathlib.Analysis.Complex.RemovableSingularity #align_import analysis.complex.schwarz from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open Metric Set Function Filter TopologicalSpace open scoped Topology namespace Complex section Space variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] {R R₁ R₂ : ℝ} {f : ℂ → E} {c z z₀ : ℂ} theorem schwarz_aux {f : ℂ → ℂ} (hd : DifferentiableOn ℂ f (ball c R₁)) (h_maps : MapsTo f (ball c R₁) (ball (f c) R₂)) (hz : z ∈ ball c R₁) : ‖dslope f c z‖ ≤ R₂ / R₁ := by have hR₁ : 0 < R₁ := nonempty_ball.1 ⟨z, hz⟩ suffices ∀ᶠ r in 𝓝[<] R₁, ‖dslope f c z‖ ≤ R₂ / r by refine ge_of_tendsto ?_ this exact (tendsto_const_nhds.div tendsto_id hR₁.ne').mono_left nhdsWithin_le_nhds rw [mem_ball] at hz filter_upwards [Ioo_mem_nhdsWithin_Iio ⟨hz, le_rfl⟩] with r hr have hr₀ : 0 < r := dist_nonneg.trans_lt hr.1 replace hd : DiffContOnCl ℂ (dslope f c) (ball c r) := by refine DifferentiableOn.diffContOnCl ?_ rw [closure_ball c hr₀.ne'] exact ((differentiableOn_dslope <| ball_mem_nhds _ hR₁).mpr hd).mono (closedBall_subset_ball hr.2) refine norm_le_of_forall_mem_frontier_norm_le isBounded_ball hd ?_ ?_ · rw [frontier_ball c hr₀.ne'] intro z hz have hz' : z ≠ c := ne_of_mem_sphere hz hr₀.ne' rw [dslope_of_ne _ hz', slope_def_module, norm_smul, norm_inv, mem_sphere_iff_norm.1 hz, ← div_eq_inv_mul, div_le_div_right hr₀, ← dist_eq_norm] exact le_of_lt (h_maps (mem_ball.2 (by rw [mem_sphere.1 hz]; exact hr.2))) · rw [closure_ball c hr₀.ne', mem_closedBall] exact hr.1.le #align complex.schwarz_aux Complex.schwarz_aux theorem norm_dslope_le_div_of_mapsTo_ball (hd : DifferentiableOn ℂ f (ball c R₁)) (h_maps : MapsTo f (ball c R₁) (ball (f c) R₂)) (hz : z ∈ ball c R₁) : ‖dslope f c z‖ ≤ R₂ / R₁ := by have hR₁ : 0 < R₁ := nonempty_ball.1 ⟨z, hz⟩ have hR₂ : 0 < R₂ := nonempty_ball.1 ⟨f z, h_maps hz⟩ rcases eq_or_ne (dslope f c z) 0 with hc | hc · rw [hc, norm_zero]; exact div_nonneg hR₂.le hR₁.le rcases exists_dual_vector ℂ _ hc with ⟨g, hg, hgf⟩ have hg' : ‖g‖₊ = 1 := NNReal.eq hg have hg₀ : ‖g‖₊ ≠ 0 := by simpa only [hg'] using one_ne_zero calc ‖dslope f c z‖ = ‖dslope (g ∘ f) c z‖ := by rw [g.dslope_comp, hgf, RCLike.norm_ofReal, abs_norm] exact fun _ => hd.differentiableAt (ball_mem_nhds _ hR₁) _ ≤ R₂ / R₁ := by refine schwarz_aux (g.differentiable.comp_differentiableOn hd) (MapsTo.comp ?_ h_maps) hz simpa only [hg', NNReal.coe_one, one_mul] using g.lipschitz.mapsTo_ball hg₀ (f c) R₂ #align complex.norm_dslope_le_div_of_maps_to_ball Complex.norm_dslope_le_div_of_mapsTo_ball
Mathlib/Analysis/Complex/Schwarz.lean
113
130
theorem affine_of_mapsTo_ball_of_exists_norm_dslope_eq_div [CompleteSpace E] [StrictConvexSpace ℝ E] (hd : DifferentiableOn ℂ f (ball c R₁)) (h_maps : Set.MapsTo f (ball c R₁) (ball (f c) R₂)) (h_z₀ : z₀ ∈ ball c R₁) (h_eq : ‖dslope f c z₀‖ = R₂ / R₁) : Set.EqOn f (fun z => f c + (z - c) • dslope f c z₀) (ball c R₁) := by
set g := dslope f c rintro z hz by_cases h : z = c; · simp [h] have h_R₁ : 0 < R₁ := nonempty_ball.mp ⟨_, h_z₀⟩ have g_le_div : ∀ z ∈ ball c R₁, ‖g z‖ ≤ R₂ / R₁ := fun z hz => norm_dslope_le_div_of_mapsTo_ball hd h_maps hz have g_max : IsMaxOn (norm ∘ g) (ball c R₁) z₀ := isMaxOn_iff.mpr fun z hz => by simpa [h_eq] using g_le_div z hz have g_diff : DifferentiableOn ℂ g (ball c R₁) := (differentiableOn_dslope (isOpen_ball.mem_nhds (mem_ball_self h_R₁))).mpr hd have : g z = g z₀ := eqOn_of_isPreconnected_of_isMaxOn_norm (convex_ball c R₁).isPreconnected isOpen_ball g_diff h_z₀ g_max hz simp [g] at this simp [g, ← this]
[ " ‖dslope f c z‖ ≤ R₂ / R₁", " Tendsto (fun c => R₂ / c) (𝓝[<] R₁) (𝓝 (R₂ / R₁))", " ∀ᶠ (r : ℝ) in 𝓝[<] R₁, ‖dslope f c z‖ ≤ R₂ / r", " ‖dslope f c z‖ ≤ R₂ / r", " DiffContOnCl ℂ (dslope f c) (ball c r)", " DifferentiableOn ℂ (dslope f c) (closure (ball c r))", " DifferentiableOn ℂ (dslope f c) (clos...
[ " ‖dslope f c z‖ ≤ R₂ / R₁", " Tendsto (fun c => R₂ / c) (𝓝[<] R₁) (𝓝 (R₂ / R₁))", " ∀ᶠ (r : ℝ) in 𝓝[<] R₁, ‖dslope f c z‖ ≤ R₂ / r", " ‖dslope f c z‖ ≤ R₂ / r", " DiffContOnCl ℂ (dslope f c) (ball c r)", " DifferentiableOn ℂ (dslope f c) (closure (ball c r))", " DifferentiableOn ℂ (dslope f c) (clos...
import Mathlib.Algebra.BigOperators.Group.Finset import Mathlib.Order.SupIndep import Mathlib.Order.Atoms #align_import order.partition.finpartition from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce" open Finset Function variable {α : Type*} @[ext] structure Finpartition [Lattice α] [OrderBot α] (a : α) where -- Porting note: Docstrings added parts : Finset α supIndep : parts.SupIndep id sup_parts : parts.sup id = a not_bot_mem : ⊥ ∉ parts deriving DecidableEq #align finpartition Finpartition #align finpartition.parts Finpartition.parts #align finpartition.sup_indep Finpartition.supIndep #align finpartition.sup_parts Finpartition.sup_parts #align finpartition.not_bot_mem Finpartition.not_bot_mem -- Porting note: attribute [protected] doesn't work -- attribute [protected] Finpartition.supIndep namespace Finpartition section Lattice variable [Lattice α] [OrderBot α] @[simps] def ofErase [DecidableEq α] {a : α} (parts : Finset α) (sup_indep : parts.SupIndep id) (sup_parts : parts.sup id = a) : Finpartition a where parts := parts.erase ⊥ supIndep := sup_indep.subset (erase_subset _ _) sup_parts := (sup_erase_bot _).trans sup_parts not_bot_mem := not_mem_erase _ _ #align finpartition.of_erase Finpartition.ofErase @[simps] def ofSubset {a b : α} (P : Finpartition a) {parts : Finset α} (subset : parts ⊆ P.parts) (sup_parts : parts.sup id = b) : Finpartition b := { parts := parts supIndep := P.supIndep.subset subset sup_parts := sup_parts not_bot_mem := fun h ↦ P.not_bot_mem (subset h) } #align finpartition.of_subset Finpartition.ofSubset @[simps] def copy {a b : α} (P : Finpartition a) (h : a = b) : Finpartition b where parts := P.parts supIndep := P.supIndep sup_parts := h ▸ P.sup_parts not_bot_mem := P.not_bot_mem #align finpartition.copy Finpartition.copy def map {β : Type*} [Lattice β] [OrderBot β] {a : α} (e : α ≃o β) (P : Finpartition a) : Finpartition (e a) where parts := P.parts.map e supIndep u hu _ hb hbu _ hx hxu := by rw [← map_symm_subset] at hu simp only [mem_map_equiv] at hb have := P.supIndep hu hb (by simp [hbu]) (map_rel e.symm hx) ?_ · rw [← e.symm.map_bot] at this exact e.symm.map_rel_iff.mp this · convert e.symm.map_rel_iff.mpr hxu rw [map_finset_sup, sup_map] rfl sup_parts := by simp [← P.sup_parts] not_bot_mem := by rw [mem_map_equiv] convert P.not_bot_mem exact e.symm.map_bot @[simp] theorem parts_map {β : Type*} [Lattice β] [OrderBot β] {a : α} {e : α ≃o β} {P : Finpartition a} : (P.map e).parts = P.parts.map e := rfl variable (α) @[simps] protected def empty : Finpartition (⊥ : α) where parts := ∅ supIndep := supIndep_empty _ sup_parts := Finset.sup_empty not_bot_mem := not_mem_empty ⊥ #align finpartition.empty Finpartition.empty instance : Inhabited (Finpartition (⊥ : α)) := ⟨Finpartition.empty α⟩ @[simp] theorem default_eq_empty : (default : Finpartition (⊥ : α)) = Finpartition.empty α := rfl #align finpartition.default_eq_empty Finpartition.default_eq_empty variable {α} {a : α} @[simps] def indiscrete (ha : a ≠ ⊥) : Finpartition a where parts := {a} supIndep := supIndep_singleton _ _ sup_parts := Finset.sup_singleton not_bot_mem h := ha (mem_singleton.1 h).symm #align finpartition.indiscrete Finpartition.indiscrete variable (P : Finpartition a) protected theorem le {b : α} (hb : b ∈ P.parts) : b ≤ a := (le_sup hb).trans P.sup_parts.le #align finpartition.le Finpartition.le theorem ne_bot {b : α} (hb : b ∈ P.parts) : b ≠ ⊥ := by intro h refine P.not_bot_mem (?_) rw [h] at hb exact hb #align finpartition.ne_bot Finpartition.ne_bot protected theorem disjoint : (P.parts : Set α).PairwiseDisjoint id := P.supIndep.pairwiseDisjoint #align finpartition.disjoint Finpartition.disjoint variable {P}
Mathlib/Order/Partition/Finpartition.lean
191
196
theorem parts_eq_empty_iff : P.parts = ∅ ↔ a = ⊥ := by
simp_rw [← P.sup_parts] refine ⟨fun h ↦ ?_, fun h ↦ eq_empty_iff_forall_not_mem.2 fun b hb ↦ P.not_bot_mem ?_⟩ · rw [h] exact Finset.sup_empty · rwa [← le_bot_iff.1 ((le_sup hb).trans h.le)]
[ " x✝ ≤ ⊥", " (↑e).symm x✝¹ ∉ Finset.map (↑e).symm.toEmbedding u", " e.symm x✝ ≤ (Finset.map (↑e).symm.toEmbedding u).sup id", " (Finset.map (↑e).symm.toEmbedding u).sup id = e.symm (u.sup id)", " u.sup (id ∘ ⇑(↑e).symm.toEmbedding) = u.sup (⇑e.symm ∘ id)", " (Finset.map (↑e).toEmbedding P.parts).sup id = ...
[ " x✝ ≤ ⊥", " (↑e).symm x✝¹ ∉ Finset.map (↑e).symm.toEmbedding u", " e.symm x✝ ≤ (Finset.map (↑e).symm.toEmbedding u).sup id", " (Finset.map (↑e).symm.toEmbedding u).sup id = e.symm (u.sup id)", " u.sup (id ∘ ⇑(↑e).symm.toEmbedding) = u.sup (⇑e.symm ∘ id)", " (Finset.map (↑e).toEmbedding P.parts).sup id = ...
import Mathlib.Algebra.BigOperators.Fin import Mathlib.Data.Nat.Choose.Sum import Mathlib.Data.Nat.Factorial.BigOperators import Mathlib.Data.Fin.VecNotation import Mathlib.Data.Finset.Sym import Mathlib.Data.Finsupp.Multiset #align_import data.nat.choose.multinomial from "leanprover-community/mathlib"@"2738d2ca56cbc63be80c3bd48e9ed90ad94e947d" open Finset open scoped Nat namespace Nat variable {α : Type*} (s : Finset α) (f : α → ℕ) {a b : α} (n : ℕ) def multinomial : ℕ := (∑ i ∈ s, f i)! / ∏ i ∈ s, (f i)! #align nat.multinomial Nat.multinomial theorem multinomial_pos : 0 < multinomial s f := Nat.div_pos (le_of_dvd (factorial_pos _) (prod_factorial_dvd_factorial_sum s f)) (prod_factorial_pos s f) #align nat.multinomial_pos Nat.multinomial_pos theorem multinomial_spec : (∏ i ∈ s, (f i)!) * multinomial s f = (∑ i ∈ s, f i)! := Nat.mul_div_cancel' (prod_factorial_dvd_factorial_sum s f) #align nat.multinomial_spec Nat.multinomial_spec @[simp] lemma multinomial_empty : multinomial ∅ f = 1 := by simp [multinomial] #align nat.multinomial_nil Nat.multinomial_empty @[deprecated (since := "2024-06-01")] alias multinomial_nil := multinomial_empty variable {s f} lemma multinomial_cons (ha : a ∉ s) (f : α → ℕ) : multinomial (s.cons a ha) f = (f a + ∑ i ∈ s, f i).choose (f a) * multinomial s f := by rw [multinomial, Nat.div_eq_iff_eq_mul_left _ (prod_factorial_dvd_factorial_sum _ _), prod_cons, multinomial, mul_assoc, mul_left_comm _ (f a)!, Nat.div_mul_cancel (prod_factorial_dvd_factorial_sum _ _), ← mul_assoc, Nat.choose_symm_add, Nat.add_choose_mul_factorial_mul_factorial, Finset.sum_cons] positivity lemma multinomial_insert [DecidableEq α] (ha : a ∉ s) (f : α → ℕ) : multinomial (insert a s) f = (f a + ∑ i ∈ s, f i).choose (f a) * multinomial s f := by rw [← cons_eq_insert _ _ ha, multinomial_cons] #align nat.multinomial_insert Nat.multinomial_insert @[simp] lemma multinomial_singleton (a : α) (f : α → ℕ) : multinomial {a} f = 1 := by rw [← cons_empty, multinomial_cons]; simp #align nat.multinomial_singleton Nat.multinomial_singleton @[simp] theorem multinomial_insert_one [DecidableEq α] (h : a ∉ s) (h₁ : f a = 1) : multinomial (insert a s) f = (s.sum f).succ * multinomial s f := by simp only [multinomial, one_mul, factorial] rw [Finset.sum_insert h, Finset.prod_insert h, h₁, add_comm, ← succ_eq_add_one, factorial_succ] simp only [factorial_one, one_mul, Function.comp_apply, factorial, mul_one, ← one_eq_succ_zero] rw [Nat.mul_div_assoc _ (prod_factorial_dvd_factorial_sum _ _)] #align nat.multinomial_insert_one Nat.multinomial_insert_one theorem multinomial_congr {f g : α → ℕ} (h : ∀ a ∈ s, f a = g a) : multinomial s f = multinomial s g := by simp only [multinomial]; congr 1 · rw [Finset.sum_congr rfl h] · exact Finset.prod_congr rfl fun a ha => by rw [h a ha] #align nat.multinomial_congr Nat.multinomial_congr theorem binomial_eq [DecidableEq α] (h : a ≠ b) : multinomial {a, b} f = (f a + f b)! / ((f a)! * (f b)!) := by simp [multinomial, Finset.sum_pair h, Finset.prod_pair h] #align nat.binomial_eq Nat.binomial_eq theorem binomial_eq_choose [DecidableEq α] (h : a ≠ b) : multinomial {a, b} f = (f a + f b).choose (f a) := by simp [binomial_eq h, choose_eq_factorial_div_factorial (Nat.le_add_right _ _)] #align nat.binomial_eq_choose Nat.binomial_eq_choose theorem binomial_spec [DecidableEq α] (hab : a ≠ b) : (f a)! * (f b)! * multinomial {a, b} f = (f a + f b)! := by simpa [Finset.sum_pair hab, Finset.prod_pair hab] using multinomial_spec {a, b} f #align nat.binomial_spec Nat.binomial_spec @[simp] theorem binomial_one [DecidableEq α] (h : a ≠ b) (h₁ : f a = 1) : multinomial {a, b} f = (f b).succ := by simp [multinomial_insert_one (Finset.not_mem_singleton.mpr h) h₁] #align nat.binomial_one Nat.binomial_one
Mathlib/Data/Nat/Choose/Multinomial.lean
123
131
theorem binomial_succ_succ [DecidableEq α] (h : a ≠ b) : multinomial {a, b} (Function.update (Function.update f a (f a).succ) b (f b).succ) = multinomial {a, b} (Function.update f a (f a).succ) + multinomial {a, b} (Function.update f b (f b).succ) := by
simp only [binomial_eq_choose, Function.update_apply, h, Ne, ite_true, ite_false, not_false_eq_true] rw [if_neg h.symm] rw [add_succ, choose_succ_succ, succ_add_eq_add_succ] ring
[ " multinomial ∅ f = 1", " multinomial (cons a s ha) f = (f a + ∑ i ∈ s, f i).choose (f a) * multinomial s f", " 0 < ∏ i ∈ cons a s ha, (f i)!", " multinomial (insert a s) f = (f a + ∑ i ∈ s, f i).choose (f a) * multinomial s f", " multinomial {a} f = 1", " (f a + ∑ i ∈ ∅, f i).choose (f a) * multinomial ∅...
[ " multinomial ∅ f = 1", " multinomial (cons a s ha) f = (f a + ∑ i ∈ s, f i).choose (f a) * multinomial s f", " 0 < ∏ i ∈ cons a s ha, (f i)!", " multinomial (insert a s) f = (f a + ∑ i ∈ s, f i).choose (f a) * multinomial s f", " multinomial {a} f = 1", " (f a + ∑ i ∈ ∅, f i).choose (f a) * multinomial ∅...
import Mathlib.Algebra.BigOperators.WithTop import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.ENNReal.Basic #align_import data.real.ennreal from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520" open Set NNReal ENNReal namespace ENNReal variable {a b c d : ℝ≥0∞} {r p q : ℝ≥0} section OperationsAndInfty variable {α : Type*} @[simp] theorem add_eq_top : a + b = ∞ ↔ a = ∞ ∨ b = ∞ := WithTop.add_eq_top #align ennreal.add_eq_top ENNReal.add_eq_top @[simp] theorem add_lt_top : a + b < ∞ ↔ a < ∞ ∧ b < ∞ := WithTop.add_lt_top #align ennreal.add_lt_top ENNReal.add_lt_top theorem toNNReal_add {r₁ r₂ : ℝ≥0∞} (h₁ : r₁ ≠ ∞) (h₂ : r₂ ≠ ∞) : (r₁ + r₂).toNNReal = r₁.toNNReal + r₂.toNNReal := by lift r₁ to ℝ≥0 using h₁ lift r₂ to ℝ≥0 using h₂ rfl #align ennreal.to_nnreal_add ENNReal.toNNReal_add theorem not_lt_top {x : ℝ≥0∞} : ¬x < ∞ ↔ x = ∞ := by rw [lt_top_iff_ne_top, Classical.not_not] #align ennreal.not_lt_top ENNReal.not_lt_top theorem add_ne_top : a + b ≠ ∞ ↔ a ≠ ∞ ∧ b ≠ ∞ := by simpa only [lt_top_iff_ne_top] using add_lt_top #align ennreal.add_ne_top ENNReal.add_ne_top
Mathlib/Data/ENNReal/Operations.lean
206
206
theorem mul_top' : a * ∞ = if a = 0 then 0 else ∞ := by
convert WithTop.mul_top' a
[ " (r₁ + r₂).toNNReal = r₁.toNNReal + r₂.toNNReal", " (↑r₁ + r₂).toNNReal = (↑r₁).toNNReal + r₂.toNNReal", " (↑r₁ + ↑r₂).toNNReal = (↑r₁).toNNReal + (↑r₂).toNNReal", " ¬x < ⊤ ↔ x = ⊤", " a + b ≠ ⊤ ↔ a ≠ ⊤ ∧ b ≠ ⊤", " a * ⊤ = if a = 0 then 0 else ⊤" ]
[ " (r₁ + r₂).toNNReal = r₁.toNNReal + r₂.toNNReal", " (↑r₁ + r₂).toNNReal = (↑r₁).toNNReal + r₂.toNNReal", " (↑r₁ + ↑r₂).toNNReal = (↑r₁).toNNReal + (↑r₂).toNNReal", " ¬x < ⊤ ↔ x = ⊤", " a + b ≠ ⊤ ↔ a ≠ ⊤ ∧ b ≠ ⊤" ]
import Mathlib.Algebra.BigOperators.Ring import Mathlib.Combinatorics.SimpleGraph.Density import Mathlib.Data.Nat.Cast.Field import Mathlib.Order.Partition.Equipartition import Mathlib.SetTheory.Ordinal.Basic #align_import combinatorics.simple_graph.regularity.uniform from "leanprover-community/mathlib"@"bf7ef0e83e5b7e6c1169e97f055e58a2e4e9d52d" open Finset variable {α 𝕜 : Type*} [LinearOrderedField 𝕜] namespace SimpleGraph variable (G : SimpleGraph α) [DecidableRel G.Adj] (ε : 𝕜) {s t : Finset α} {a b : α} def IsUniform (s t : Finset α) : Prop := ∀ ⦃s'⦄, s' ⊆ s → ∀ ⦃t'⦄, t' ⊆ t → (s.card : 𝕜) * ε ≤ s'.card → (t.card : 𝕜) * ε ≤ t'.card → |(G.edgeDensity s' t' : 𝕜) - (G.edgeDensity s t : 𝕜)| < ε #align simple_graph.is_uniform SimpleGraph.IsUniform variable {G ε} instance IsUniform.instDecidableRel : DecidableRel (G.IsUniform ε) := by unfold IsUniform; infer_instance theorem IsUniform.mono {ε' : 𝕜} (h : ε ≤ ε') (hε : IsUniform G ε s t) : IsUniform G ε' s t := fun s' hs' t' ht' hs ht => by refine (hε hs' ht' (le_trans ?_ hs) (le_trans ?_ ht)).trans_le h <;> gcongr #align simple_graph.is_uniform.mono SimpleGraph.IsUniform.mono theorem IsUniform.symm : Symmetric (IsUniform G ε) := fun s t h t' ht' s' hs' ht hs => by rw [edgeDensity_comm _ t', edgeDensity_comm _ t] exact h hs' ht' hs ht #align simple_graph.is_uniform.symm SimpleGraph.IsUniform.symm variable (G) theorem isUniform_comm : IsUniform G ε s t ↔ IsUniform G ε t s := ⟨fun h => h.symm, fun h => h.symm⟩ #align simple_graph.is_uniform_comm SimpleGraph.isUniform_comm lemma isUniform_one : G.IsUniform (1 : 𝕜) s t := by intro s' hs' t' ht' hs ht rw [mul_one] at hs ht rw [eq_of_subset_of_card_le hs' (Nat.cast_le.1 hs), eq_of_subset_of_card_le ht' (Nat.cast_le.1 ht), sub_self, abs_zero] exact zero_lt_one #align simple_graph.is_uniform_one SimpleGraph.isUniform_one variable {G} lemma IsUniform.pos (hG : G.IsUniform ε s t) : 0 < ε := not_le.1 fun hε ↦ (hε.trans $ abs_nonneg _).not_lt $ hG (empty_subset _) (empty_subset _) (by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hε) (by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hε) @[simp] lemma isUniform_singleton : G.IsUniform ε {a} {b} ↔ 0 < ε := by refine ⟨IsUniform.pos, fun hε s' hs' t' ht' hs ht ↦ ?_⟩ rw [card_singleton, Nat.cast_one, one_mul] at hs ht obtain rfl | rfl := Finset.subset_singleton_iff.1 hs' · replace hs : ε ≤ 0 := by simpa using hs exact (hε.not_le hs).elim obtain rfl | rfl := Finset.subset_singleton_iff.1 ht' · replace ht : ε ≤ 0 := by simpa using ht exact (hε.not_le ht).elim · rwa [sub_self, abs_zero] #align simple_graph.is_uniform_singleton SimpleGraph.isUniform_singleton theorem not_isUniform_zero : ¬G.IsUniform (0 : 𝕜) s t := fun h => (abs_nonneg _).not_lt <| h (empty_subset _) (empty_subset _) (by simp) (by simp) #align simple_graph.not_is_uniform_zero SimpleGraph.not_isUniform_zero theorem not_isUniform_iff : ¬G.IsUniform ε s t ↔ ∃ s', s' ⊆ s ∧ ∃ t', t' ⊆ t ∧ ↑s.card * ε ≤ s'.card ∧ ↑t.card * ε ≤ t'.card ∧ ε ≤ |G.edgeDensity s' t' - G.edgeDensity s t| := by unfold IsUniform simp only [not_forall, not_lt, exists_prop, exists_and_left, Rat.cast_abs, Rat.cast_sub] #align simple_graph.not_is_uniform_iff SimpleGraph.not_isUniform_iff open scoped Classical variable (G) noncomputable def nonuniformWitnesses (ε : 𝕜) (s t : Finset α) : Finset α × Finset α := if h : ¬G.IsUniform ε s t then ((not_isUniform_iff.1 h).choose, (not_isUniform_iff.1 h).choose_spec.2.choose) else (s, t) #align simple_graph.nonuniform_witnesses SimpleGraph.nonuniformWitnesses theorem left_nonuniformWitnesses_subset (h : ¬G.IsUniform ε s t) : (G.nonuniformWitnesses ε s t).1 ⊆ s := by rw [nonuniformWitnesses, dif_pos h] exact (not_isUniform_iff.1 h).choose_spec.1 #align simple_graph.left_nonuniform_witnesses_subset SimpleGraph.left_nonuniformWitnesses_subset
Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean
142
145
theorem left_nonuniformWitnesses_card (h : ¬G.IsUniform ε s t) : (s.card : 𝕜) * ε ≤ (G.nonuniformWitnesses ε s t).1.card := by
rw [nonuniformWitnesses, dif_pos h] exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.2.1
[ " DecidableRel (G.IsUniform ε)", " DecidableRel fun s t =>\n ∀ ⦃s' : Finset α⦄,\n s' ⊆ s →\n ∀ ⦃t' : Finset α⦄,\n t' ⊆ t → ↑s.card * ε ≤ ↑s'.card → ↑t.card * ε ≤ ↑t'.card → |↑(G.edgeDensity s' t') - ↑(G.edgeDensity s t)| < ε", " |↑(G.edgeDensity s' t') - ↑(G.edgeDensity s t)| < ε'", " ...
[ " DecidableRel (G.IsUniform ε)", " DecidableRel fun s t =>\n ∀ ⦃s' : Finset α⦄,\n s' ⊆ s →\n ∀ ⦃t' : Finset α⦄,\n t' ⊆ t → ↑s.card * ε ≤ ↑s'.card → ↑t.card * ε ≤ ↑t'.card → |↑(G.edgeDensity s' t') - ↑(G.edgeDensity s t)| < ε", " |↑(G.edgeDensity s' t') - ↑(G.edgeDensity s t)| < ε'", " ...
import Mathlib.Topology.FiberBundle.Trivialization import Mathlib.Topology.Order.LeftRightNhds #align_import topology.fiber_bundle.basic from "leanprover-community/mathlib"@"e473c3198bb41f68560cab68a0529c854b618833" variable {ι B F X : Type*} [TopologicalSpace X] open TopologicalSpace Filter Set Bundle Topology -- Porting note(#5171): was @[nolint has_nonempty_instance] structure FiberBundleCore (ι : Type*) (B : Type*) [TopologicalSpace B] (F : Type*) [TopologicalSpace F] where baseSet : ι → Set B isOpen_baseSet : ∀ i, IsOpen (baseSet i) indexAt : B → ι mem_baseSet_at : ∀ x, x ∈ baseSet (indexAt x) coordChange : ι → ι → B → F → F coordChange_self : ∀ i, ∀ x ∈ baseSet i, ∀ v, coordChange i i x v = v continuousOn_coordChange : ∀ i j, ContinuousOn (fun p : B × F => coordChange i j p.1 p.2) ((baseSet i ∩ baseSet j) ×ˢ univ) coordChange_comp : ∀ i j k, ∀ x ∈ baseSet i ∩ baseSet j ∩ baseSet k, ∀ v, (coordChange j k x) (coordChange i j x v) = coordChange i k x v #align fiber_bundle_core FiberBundleCore namespace FiberBundleCore variable [TopologicalSpace B] [TopologicalSpace F] (Z : FiberBundleCore ι B F) @[nolint unusedArguments] -- Porting note(#5171): was has_nonempty_instance def Index (_Z : FiberBundleCore ι B F) := ι #align fiber_bundle_core.index FiberBundleCore.Index @[nolint unusedArguments, reducible] def Base (_Z : FiberBundleCore ι B F) := B #align fiber_bundle_core.base FiberBundleCore.Base @[nolint unusedArguments] -- Porting note(#5171): was has_nonempty_instance def Fiber (_ : FiberBundleCore ι B F) (_x : B) := F #align fiber_bundle_core.fiber FiberBundleCore.Fiber instance topologicalSpaceFiber (x : B) : TopologicalSpace (Z.Fiber x) := ‹_› #align fiber_bundle_core.topological_space_fiber FiberBundleCore.topologicalSpaceFiber abbrev TotalSpace := Bundle.TotalSpace F Z.Fiber #align fiber_bundle_core.total_space FiberBundleCore.TotalSpace @[reducible, simp, mfld_simps] def proj : Z.TotalSpace → B := Bundle.TotalSpace.proj #align fiber_bundle_core.proj FiberBundleCore.proj def trivChange (i j : ι) : PartialHomeomorph (B × F) (B × F) where source := (Z.baseSet i ∩ Z.baseSet j) ×ˢ univ target := (Z.baseSet i ∩ Z.baseSet j) ×ˢ univ toFun p := ⟨p.1, Z.coordChange i j p.1 p.2⟩ invFun p := ⟨p.1, Z.coordChange j i p.1 p.2⟩ map_source' p hp := by simpa using hp map_target' p hp := by simpa using hp left_inv' := by rintro ⟨x, v⟩ hx simp only [prod_mk_mem_set_prod_eq, mem_inter_iff, and_true, mem_univ] at hx dsimp only rw [coordChange_comp, Z.coordChange_self] exacts [hx.1, ⟨⟨hx.1, hx.2⟩, hx.1⟩] right_inv' := by rintro ⟨x, v⟩ hx simp only [prod_mk_mem_set_prod_eq, mem_inter_iff, and_true_iff, mem_univ] at hx dsimp only rw [Z.coordChange_comp, Z.coordChange_self] · exact hx.2 · simp [hx] open_source := ((Z.isOpen_baseSet i).inter (Z.isOpen_baseSet j)).prod isOpen_univ open_target := ((Z.isOpen_baseSet i).inter (Z.isOpen_baseSet j)).prod isOpen_univ continuousOn_toFun := continuous_fst.continuousOn.prod (Z.continuousOn_coordChange i j) continuousOn_invFun := by simpa [inter_comm] using continuous_fst.continuousOn.prod (Z.continuousOn_coordChange j i) #align fiber_bundle_core.triv_change FiberBundleCore.trivChange @[simp, mfld_simps]
Mathlib/Topology/FiberBundle/Basic.lean
474
477
theorem mem_trivChange_source (i j : ι) (p : B × F) : p ∈ (Z.trivChange i j).source ↔ p.1 ∈ Z.baseSet i ∩ Z.baseSet j := by
erw [mem_prod] simp
[ " (fun p => (p.1, Z.coordChange i j p.1 p.2)) p ∈ (Z.baseSet i ∩ Z.baseSet j) ×ˢ univ", " (fun p => (p.1, Z.coordChange j i p.1 p.2)) p ∈ (Z.baseSet i ∩ Z.baseSet j) ×ˢ univ", " ∀ ⦃x : B × F⦄,\n x ∈ (Z.baseSet i ∩ Z.baseSet j) ×ˢ univ →\n (fun p => (p.1, Z.coordChange j i p.1 p.2)) ((fun p => (p.1, Z.co...
[ " (fun p => (p.1, Z.coordChange i j p.1 p.2)) p ∈ (Z.baseSet i ∩ Z.baseSet j) ×ˢ univ", " (fun p => (p.1, Z.coordChange j i p.1 p.2)) p ∈ (Z.baseSet i ∩ Z.baseSet j) ×ˢ univ", " ∀ ⦃x : B × F⦄,\n x ∈ (Z.baseSet i ∩ Z.baseSet j) ×ˢ univ →\n (fun p => (p.1, Z.coordChange j i p.1 p.2)) ((fun p => (p.1, Z.co...
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
Mathlib/Geometry/Euclidean/Angle/Oriented/RightAngle.lean
601
606
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))]
[ " ∡ p₂ p₃ p₁ = ↑(dist p₃ p₂ / dist p₁ p₃).arccos", " (∡ p₂ p₃ p₁).sign = 1", " ∡ p₃ p₁ p₂ = ↑(dist p₁ p₂ / dist p₁ p₃).arccos", " (∡ p₃ p₁ p₂).sign = 1", " ∡ p₂ p₃ p₁ = ↑(dist p₁ p₂ / dist p₁ p₃).arcsin" ]
[ " ∡ p₂ p₃ p₁ = ↑(dist p₃ p₂ / dist p₁ p₃).arccos", " (∡ p₂ p₃ p₁).sign = 1", " ∡ p₃ p₁ p₂ = ↑(dist p₁ p₂ / dist p₁ p₃).arccos", " (∡ p₃ p₁ p₂).sign = 1" ]
import Mathlib.Algebra.Polynomial.BigOperators import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Cast import Mathlib.Data.Nat.Choose.Vandermonde import Mathlib.Tactic.FieldSimp #align_import data.polynomial.hasse_deriv from "leanprover-community/mathlib"@"a148d797a1094ab554ad4183a4ad6f130358ef64" noncomputable section namespace Polynomial open Nat Polynomial open Function variable {R : Type*} [Semiring R] (k : ℕ) (f : R[X]) def hasseDeriv (k : ℕ) : R[X] →ₗ[R] R[X] := lsum fun i => monomial (i - k) ∘ₗ DistribMulAction.toLinearMap R R (i.choose k) #align polynomial.hasse_deriv Polynomial.hasseDeriv theorem hasseDeriv_apply : hasseDeriv k f = f.sum fun i r => monomial (i - k) (↑(i.choose k) * r) := by dsimp [hasseDeriv] congr; ext; congr apply nsmul_eq_mul #align polynomial.hasse_deriv_apply Polynomial.hasseDeriv_apply theorem hasseDeriv_coeff (n : ℕ) : (hasseDeriv k f).coeff n = (n + k).choose k * f.coeff (n + k) := by rw [hasseDeriv_apply, coeff_sum, sum_def, Finset.sum_eq_single (n + k), coeff_monomial] · simp only [if_true, add_tsub_cancel_right, eq_self_iff_true] · intro i _hi hink rw [coeff_monomial] by_cases hik : i < k · simp only [Nat.choose_eq_zero_of_lt hik, ite_self, Nat.cast_zero, zero_mul] · push_neg at hik rw [if_neg] contrapose! hink exact (tsub_eq_iff_eq_add_of_le hik).mp hink · intro h simp only [not_mem_support_iff.mp h, monomial_zero_right, mul_zero, coeff_zero] #align polynomial.hasse_deriv_coeff Polynomial.hasseDeriv_coeff theorem hasseDeriv_zero' : hasseDeriv 0 f = f := by simp only [hasseDeriv_apply, tsub_zero, Nat.choose_zero_right, Nat.cast_one, one_mul, sum_monomial_eq] #align polynomial.hasse_deriv_zero' Polynomial.hasseDeriv_zero' @[simp] theorem hasseDeriv_zero : @hasseDeriv R _ 0 = LinearMap.id := LinearMap.ext <| hasseDeriv_zero' #align polynomial.hasse_deriv_zero Polynomial.hasseDeriv_zero theorem hasseDeriv_eq_zero_of_lt_natDegree (p : R[X]) (n : ℕ) (h : p.natDegree < n) : hasseDeriv n p = 0 := by rw [hasseDeriv_apply, sum_def] refine Finset.sum_eq_zero fun x hx => ?_ simp [Nat.choose_eq_zero_of_lt ((le_natDegree_of_mem_supp _ hx).trans_lt h)] #align polynomial.hasse_deriv_eq_zero_of_lt_nat_degree Polynomial.hasseDeriv_eq_zero_of_lt_natDegree theorem hasseDeriv_one' : hasseDeriv 1 f = derivative f := by simp only [hasseDeriv_apply, derivative_apply, ← C_mul_X_pow_eq_monomial, Nat.choose_one_right, (Nat.cast_commute _ _).eq] #align polynomial.hasse_deriv_one' Polynomial.hasseDeriv_one' @[simp] theorem hasseDeriv_one : @hasseDeriv R _ 1 = derivative := LinearMap.ext <| hasseDeriv_one' #align polynomial.hasse_deriv_one Polynomial.hasseDeriv_one @[simp]
Mathlib/Algebra/Polynomial/HasseDeriv.lean
111
124
theorem hasseDeriv_monomial (n : ℕ) (r : R) : hasseDeriv k (monomial n r) = monomial (n - k) (↑(n.choose k) * r) := by
ext i simp only [hasseDeriv_coeff, coeff_monomial] by_cases hnik : n = i + k · rw [if_pos hnik, if_pos, ← hnik] apply tsub_eq_of_eq_add_rev rwa [add_comm] · rw [if_neg hnik, mul_zero] by_cases hkn : k ≤ n · rw [← tsub_eq_iff_eq_add_of_le hkn] at hnik rw [if_neg hnik] · push_neg at hkn rw [Nat.choose_eq_zero_of_lt hkn, Nat.cast_zero, zero_mul, ite_self]
[ " (hasseDeriv k) f = f.sum fun i r => (monomial (i - k)) (↑(i.choose k) * r)", " (f.sum fun x x_1 => (monomial (x - k)) (x.choose k • x_1)) = f.sum fun i r => (monomial (i - k)) (↑(i.choose k) * r)", " (fun x x_1 => (monomial (x - k)) (x.choose k • x_1)) = fun i r => (monomial (i - k)) (↑(i.choose k) * r)", "...
[ " (hasseDeriv k) f = f.sum fun i r => (monomial (i - k)) (↑(i.choose k) * r)", " (f.sum fun x x_1 => (monomial (x - k)) (x.choose k • x_1)) = f.sum fun i r => (monomial (i - k)) (↑(i.choose k) * r)", " (fun x x_1 => (monomial (x - k)) (x.choose k • x_1)) = fun i r => (monomial (i - k)) (↑(i.choose k) * r)", "...
import Mathlib.Data.List.Defs import Mathlib.Data.Option.Basic import Mathlib.Data.Nat.Defs import Mathlib.Init.Data.List.Basic import Mathlib.Util.AssertExists -- Make sure we haven't imported `Data.Nat.Order.Basic` assert_not_exists OrderedSub namespace List universe u v variable {α : Type u} {β : Type v} (l : List α) (x : α) (xs : List α) (n : ℕ) section getD variable (d : α) #align list.nthd_nil List.getD_nilₓ -- argument order #align list.nthd_cons_zero List.getD_cons_zeroₓ -- argument order #align list.nthd_cons_succ List.getD_cons_succₓ -- argument order theorem getD_eq_get {n : ℕ} (hn : n < l.length) : l.getD n d = l.get ⟨n, hn⟩ := by induction l generalizing n with | nil => simp at hn | cons head tail ih => cases n · exact getD_cons_zero · exact ih _ @[simp] theorem getD_map {n : ℕ} (f : α → β) : (map f l).getD n (f d) = f (l.getD n d) := by induction l generalizing n with | nil => rfl | cons head tail ih => cases n · rfl · simp [ih] #align list.nthd_eq_nth_le List.getD_eq_get theorem getD_eq_default {n : ℕ} (hn : l.length ≤ n) : l.getD n d = d := by induction l generalizing n with | nil => exact getD_nil | cons head tail ih => cases n · simp at hn · exact ih (Nat.le_of_succ_le_succ hn) #align list.nthd_eq_default List.getD_eq_defaultₓ -- argument order def decidableGetDNilNe (a : α) : DecidablePred fun i : ℕ => getD ([] : List α) i a ≠ a := fun _ => isFalse fun H => H getD_nil #align list.decidable_nthd_nil_ne List.decidableGetDNilNeₓ -- argument order @[simp]
Mathlib/Data/List/GetD.lean
73
73
theorem getD_singleton_default_eq (n : ℕ) : [d].getD n d = d := by
cases n <;> simp
[ " l.getD n d = l.get ⟨n, hn⟩", " [].getD n d = [].get ⟨n, hn⟩", " (head :: tail).getD n d = (head :: tail).get ⟨n, hn⟩", " (head :: tail).getD 0 d = (head :: tail).get ⟨0, hn⟩", " (head :: tail).getD (n✝ + 1) d = (head :: tail).get ⟨n✝ + 1, hn⟩", " (map f l).getD n (f d) = f (l.getD n d)", " (map f [])....
[ " l.getD n d = l.get ⟨n, hn⟩", " [].getD n d = [].get ⟨n, hn⟩", " (head :: tail).getD n d = (head :: tail).get ⟨n, hn⟩", " (head :: tail).getD 0 d = (head :: tail).get ⟨0, hn⟩", " (head :: tail).getD (n✝ + 1) d = (head :: tail).get ⟨n✝ + 1, hn⟩", " (map f l).getD n (f d) = f (l.getD n d)", " (map f [])....
import Mathlib.Analysis.NormedSpace.Multilinear.Basic import Mathlib.Analysis.NormedSpace.Units import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul #align_import analysis.normed_space.bounded_linear_maps from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" noncomputable section open Topology open Filter (Tendsto) open Metric ContinuousLinearMap variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] structure IsBoundedLinearMap (𝕜 : Type*) [NormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] (f : E → F) extends IsLinearMap 𝕜 f : Prop where bound : ∃ M, 0 < M ∧ ∀ x : E, ‖f x‖ ≤ M * ‖x‖ #align is_bounded_linear_map IsBoundedLinearMap theorem IsLinearMap.with_bound {f : E → F} (hf : IsLinearMap 𝕜 f) (M : ℝ) (h : ∀ x : E, ‖f x‖ ≤ M * ‖x‖) : IsBoundedLinearMap 𝕜 f := ⟨hf, by_cases (fun (this : M ≤ 0) => ⟨1, zero_lt_one, fun x => (h x).trans <| mul_le_mul_of_nonneg_right (this.trans zero_le_one) (norm_nonneg x)⟩) fun (this : ¬M ≤ 0) => ⟨M, lt_of_not_ge this, h⟩⟩ #align is_linear_map.with_bound IsLinearMap.with_bound theorem ContinuousLinearMap.isBoundedLinearMap (f : E →L[𝕜] F) : IsBoundedLinearMap 𝕜 f := { f.toLinearMap.isLinear with bound := f.bound } #align continuous_linear_map.is_bounded_linear_map ContinuousLinearMap.isBoundedLinearMap section variable {ι : Type*} [Fintype ι] theorem isBoundedLinearMap_prod_multilinear {E : ι → Type*} [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] : IsBoundedLinearMap 𝕜 fun p : ContinuousMultilinearMap 𝕜 E F × ContinuousMultilinearMap 𝕜 E G => p.1.prod p.2 where map_add p₁ p₂ := by ext : 1; rfl map_smul c p := by ext : 1; rfl bound := by refine ⟨1, zero_lt_one, fun p ↦ ?_⟩ rw [one_mul] apply ContinuousMultilinearMap.opNorm_le_bound _ (norm_nonneg _) _ intro m rw [ContinuousMultilinearMap.prod_apply, norm_prod_le_iff] constructor · exact (p.1.le_opNorm m).trans (mul_le_mul_of_nonneg_right (norm_fst_le p) <| by positivity) · exact (p.2.le_opNorm m).trans (mul_le_mul_of_nonneg_right (norm_snd_le p) <| by positivity) #align is_bounded_linear_map_prod_multilinear isBoundedLinearMap_prod_multilinear theorem isBoundedLinearMap_continuousMultilinearMap_comp_linear (g : G →L[𝕜] E) : IsBoundedLinearMap 𝕜 fun f : ContinuousMultilinearMap 𝕜 (fun _ : ι => E) F => f.compContinuousLinearMap fun _ => g := by refine IsLinearMap.with_bound ⟨fun f₁ f₂ => by ext; rfl, fun c f => by ext; rfl⟩ (‖g‖ ^ Fintype.card ι) fun f => ?_ apply ContinuousMultilinearMap.opNorm_le_bound _ _ _ · apply_rules [mul_nonneg, pow_nonneg, norm_nonneg] intro m calc ‖f (g ∘ m)‖ ≤ ‖f‖ * ∏ i, ‖g (m i)‖ := f.le_opNorm _ _ ≤ ‖f‖ * ∏ i, ‖g‖ * ‖m i‖ := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) exact Finset.prod_le_prod (fun i _ => norm_nonneg _) fun i _ => g.le_opNorm _ _ = ‖g‖ ^ Fintype.card ι * ‖f‖ * ∏ i, ‖m i‖ := by simp only [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_univ] ring #align is_bounded_linear_map_continuous_multilinear_map_comp_linear isBoundedLinearMap_continuousMultilinearMap_comp_linear end section BilinearMap namespace ContinuousLinearMap variable {R : Type*} variable {𝕜₂ 𝕜' : Type*} [NontriviallyNormedField 𝕜'] [NontriviallyNormedField 𝕜₂] variable {M : Type*} [TopologicalSpace M] variable {σ₁₂ : 𝕜 →+* 𝕜₂} variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace 𝕜₂ G'] [NormedSpace 𝕜' G'] variable [SMulCommClass 𝕜₂ 𝕜' G'] section Ring variable [Ring R] [AddCommGroup M] [Module R M] {ρ₁₂ : R →+* 𝕜'}
Mathlib/Analysis/NormedSpace/BoundedLinearMaps.lean
303
304
theorem map_sub₂ (f : M →SL[ρ₁₂] F →SL[σ₁₂] G') (x x' : M) (y : F) : f (x - x') y = f x y - f x' y := by
rw [f.map_sub, sub_apply]
[ " (p₁ + p₂).1.prod (p₁ + p₂).2 = p₁.1.prod p₁.2 + p₂.1.prod p₂.2", " ((p₁ + p₂).1.prod (p₁ + p₂).2) x✝ = (p₁.1.prod p₁.2 + p₂.1.prod p₂.2) x✝", " (c • p).1.prod (c • p).2 = c • p.1.prod p.2", " ((c • p).1.prod (c • p).2) x✝ = (c • p.1.prod p.2) x✝", " ∃ M, 0 < M ∧ ∀ (x : ContinuousMultilinearMap 𝕜 E F × Co...
[ " (p₁ + p₂).1.prod (p₁ + p₂).2 = p₁.1.prod p₁.2 + p₂.1.prod p₂.2", " ((p₁ + p₂).1.prod (p₁ + p₂).2) x✝ = (p₁.1.prod p₁.2 + p₂.1.prod p₂.2) x✝", " (c • p).1.prod (c • p).2 = c • p.1.prod p.2", " ((c • p).1.prod (c • p).2) x✝ = (c • p.1.prod p.2) x✝", " ∃ M, 0 < M ∧ ∀ (x : ContinuousMultilinearMap 𝕜 E F × Co...
import Mathlib.Algebra.Associated import Mathlib.Algebra.Order.Monoid.Unbundled.Pow import Mathlib.Algebra.Ring.Int import Mathlib.Data.Nat.Factorial.Basic import Mathlib.Data.Nat.GCD.Basic import Mathlib.Order.Bounds.Basic #align_import data.nat.prime from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1" open Bool Subtype open Nat namespace Nat variable {n : ℕ} -- Porting note (#11180): removed @[pp_nodot] def Prime (p : ℕ) := Irreducible p #align nat.prime Nat.Prime theorem irreducible_iff_nat_prime (a : ℕ) : Irreducible a ↔ Nat.Prime a := Iff.rfl #align irreducible_iff_nat_prime Nat.irreducible_iff_nat_prime @[aesop safe destruct] theorem not_prime_zero : ¬Prime 0 | h => h.ne_zero rfl #align nat.not_prime_zero Nat.not_prime_zero @[aesop safe destruct] theorem not_prime_one : ¬Prime 1 | h => h.ne_one rfl #align nat.not_prime_one Nat.not_prime_one theorem Prime.ne_zero {n : ℕ} (h : Prime n) : n ≠ 0 := Irreducible.ne_zero h #align nat.prime.ne_zero Nat.Prime.ne_zero theorem Prime.pos {p : ℕ} (pp : Prime p) : 0 < p := Nat.pos_of_ne_zero pp.ne_zero #align nat.prime.pos Nat.Prime.pos theorem Prime.two_le : ∀ {p : ℕ}, Prime p → 2 ≤ p | 0, h => (not_prime_zero h).elim | 1, h => (not_prime_one h).elim | _ + 2, _ => le_add_self #align nat.prime.two_le Nat.Prime.two_le theorem Prime.one_lt {p : ℕ} : Prime p → 1 < p := Prime.two_le #align nat.prime.one_lt Nat.Prime.one_lt lemma Prime.one_le {p : ℕ} (hp : p.Prime) : 1 ≤ p := hp.one_lt.le instance Prime.one_lt' (p : ℕ) [hp : Fact p.Prime] : Fact (1 < p) := ⟨hp.1.one_lt⟩ #align nat.prime.one_lt' Nat.Prime.one_lt' theorem Prime.ne_one {p : ℕ} (hp : p.Prime) : p ≠ 1 := hp.one_lt.ne' #align nat.prime.ne_one Nat.Prime.ne_one
Mathlib/Data/Nat/Prime.lean
89
96
theorem Prime.eq_one_or_self_of_dvd {p : ℕ} (pp : p.Prime) (m : ℕ) (hm : m ∣ p) : m = 1 ∨ m = p := by
obtain ⟨n, hn⟩ := hm have := pp.isUnit_or_isUnit hn rw [Nat.isUnit_iff, Nat.isUnit_iff] at this apply Or.imp_right _ this rintro rfl rw [hn, mul_one]
[ " m = 1 ∨ m = p", " n = 1 → m = p", " m = p" ]
[]
import Mathlib.Topology.Order.IsLUB open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {α β γ : Type*} section ConditionallyCompleteLinearOrder variable [ConditionallyCompleteLinearOrder α] [TopologicalSpace α] [OrderTopology α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderClosedTopology β] [Nonempty γ] theorem csSup_mem_closure {s : Set α} (hs : s.Nonempty) (B : BddAbove s) : sSup s ∈ closure s := (isLUB_csSup hs B).mem_closure hs #align cSup_mem_closure csSup_mem_closure theorem csInf_mem_closure {s : Set α} (hs : s.Nonempty) (B : BddBelow s) : sInf s ∈ closure s := (isGLB_csInf hs B).mem_closure hs #align cInf_mem_closure csInf_mem_closure theorem IsClosed.csSup_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) : sSup s ∈ s := (isLUB_csSup hs B).mem_of_isClosed hs hc #align is_closed.cSup_mem IsClosed.csSup_mem theorem IsClosed.csInf_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) : sInf s ∈ s := (isGLB_csInf hs B).mem_of_isClosed hs hc #align is_closed.cInf_mem IsClosed.csInf_mem theorem IsClosed.isLeast_csInf {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) : IsLeast s (sInf s) := ⟨hc.csInf_mem hs B, (isGLB_csInf hs B).1⟩ theorem IsClosed.isGreatest_csSup {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) : IsGreatest s (sSup s) := IsClosed.isLeast_csInf (α := αᵒᵈ) hc hs B
Mathlib/Topology/Order/Monotone.lean
221
225
theorem Monotone.map_csSup_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sSup s)) (Mf : Monotone f) (ne : s.Nonempty) (H : BddAbove s) : f (sSup s) = sSup (f '' s) := by
refine ((isLUB_csSup (ne.image f) (Mf.map_bddAbove H)).unique ?_).symm refine (isLUB_csSup ne H).isLUB_of_tendsto (fun x _ y _ xy => Mf xy) ne ?_ exact Cf.mono_left inf_le_left
[ " f (sSup s) = sSup (f '' s)", " IsLUB (f '' s) (f (sSup s))", " Tendsto f (𝓝[s] sSup s) (𝓝 (f (sSup s)))" ]
[]
import Mathlib.Algebra.GeomSum import Mathlib.Order.Filter.Archimedean import Mathlib.Order.Iterate import Mathlib.Topology.Algebra.Algebra import Mathlib.Topology.Algebra.InfiniteSum.Real #align_import analysis.specific_limits.basic from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2" noncomputable section open scoped Classical open Set Function Filter Finset Metric open scoped Classical open Topology Nat uniformity NNReal ENNReal variable {α : Type*} {β : Type*} {ι : Type*} theorem tendsto_inverse_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ (n : ℝ)⁻¹) atTop (𝓝 0) := tendsto_inv_atTop_zero.comp tendsto_natCast_atTop_atTop #align tendsto_inverse_at_top_nhds_0_nat tendsto_inverse_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias tendsto_inverse_atTop_nhds_0_nat := tendsto_inverse_atTop_nhds_zero_nat theorem tendsto_const_div_atTop_nhds_zero_nat (C : ℝ) : Tendsto (fun n : ℕ ↦ C / n) atTop (𝓝 0) := by simpa only [mul_zero] using tendsto_const_nhds.mul tendsto_inverse_atTop_nhds_zero_nat #align tendsto_const_div_at_top_nhds_0_nat tendsto_const_div_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias tendsto_const_div_atTop_nhds_0_nat := tendsto_const_div_atTop_nhds_zero_nat theorem tendsto_one_div_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ 1/(n : ℝ)) atTop (𝓝 0) := tendsto_const_div_atTop_nhds_zero_nat 1 @[deprecated (since := "2024-01-31")] alias tendsto_one_div_atTop_nhds_0_nat := tendsto_one_div_atTop_nhds_zero_nat
Mathlib/Analysis/SpecificLimits/Basic.lean
51
54
theorem NNReal.tendsto_inverse_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ (n : ℝ≥0)⁻¹) atTop (𝓝 0) := by
rw [← NNReal.tendsto_coe] exact _root_.tendsto_inverse_atTop_nhds_zero_nat
[ " Tendsto (fun n => C / ↑n) atTop (𝓝 0)", " Tendsto (fun n => (↑n)⁻¹) atTop (𝓝 0)", " Tendsto (fun a => ↑(↑a)⁻¹) atTop (𝓝 ↑0)" ]
[ " Tendsto (fun n => C / ↑n) atTop (𝓝 0)" ]
import Mathlib.RingTheory.DedekindDomain.Dvr import Mathlib.RingTheory.DedekindDomain.Ideal #align_import ring_theory.dedekind_domain.pid from "leanprover-community/mathlib"@"6010cf523816335f7bae7f8584cb2edaace73940" variable {R : Type*} [CommRing R] open Ideal open UniqueFactorizationMonoid open scoped nonZeroDivisors open UniqueFactorizationMonoid theorem Ideal.eq_span_singleton_of_mem_of_not_mem_sq_of_not_mem_prime_ne {P : Ideal R} (hP : P.IsPrime) [IsDedekindDomain R] {x : R} (x_mem : x ∈ P) (hxP2 : x ∉ P ^ 2) (hxQ : ∀ Q : Ideal R, IsPrime Q → Q ≠ P → x ∉ Q) : P = Ideal.span {x} := by letI := Classical.decEq (Ideal R) have hx0 : x ≠ 0 := by rintro rfl exact hxP2 (zero_mem _) by_cases hP0 : P = ⊥ · subst hP0 -- Porting note: was `simpa using hxP2` but that hypothesis didn't even seem relevant in Lean 3 rwa [eq_comm, span_singleton_eq_bot, ← mem_bot] have hspan0 : span ({x} : Set R) ≠ ⊥ := mt Ideal.span_singleton_eq_bot.mp hx0 have span_le := (Ideal.span_singleton_le_iff_mem _).mpr x_mem refine associated_iff_eq.mp ((associated_iff_normalizedFactors_eq_normalizedFactors hP0 hspan0).mpr (le_antisymm ((dvd_iff_normalizedFactors_le_normalizedFactors hP0 hspan0).mp ?_) ?_)) · rwa [Ideal.dvd_iff_le, Ideal.span_singleton_le_iff_mem] simp only [normalizedFactors_irreducible (Ideal.prime_of_isPrime hP0 hP).irreducible, normalize_eq, Multiset.le_iff_count, Multiset.count_singleton] intro Q split_ifs with hQ · subst hQ refine (Ideal.count_normalizedFactors_eq ?_ ?_).le <;> simp only [Ideal.span_singleton_le_iff_mem, pow_one] <;> assumption by_cases hQp : IsPrime Q · refine (Ideal.count_normalizedFactors_eq ?_ ?_).le <;> -- Porting note: included `zero_add` in the simp arguments simp only [Ideal.span_singleton_le_iff_mem, zero_add, pow_one, pow_zero, one_eq_top, Submodule.mem_top] exact hxQ _ hQp hQ · exact (Multiset.count_eq_zero.mpr fun hQi => hQp (isPrime_of_prime (irreducible_iff_prime.mp (irreducible_of_normalized_factor _ hQi)))).le #align ideal.eq_span_singleton_of_mem_of_not_mem_sq_of_not_mem_prime_ne Ideal.eq_span_singleton_of_mem_of_not_mem_sq_of_not_mem_prime_ne -- Porting note: replaced three implicit coercions of `I` with explicit `(I : Submodule R A)`
Mathlib/RingTheory/DedekindDomain/PID.lean
78
102
theorem FractionalIdeal.isPrincipal_of_unit_of_comap_mul_span_singleton_eq_top {R A : Type*} [CommRing R] [CommRing A] [Algebra R A] {S : Submonoid R} [IsLocalization S A] (I : (FractionalIdeal S A)ˣ) {v : A} (hv : v ∈ (↑I⁻¹ : FractionalIdeal S A)) (h : Submodule.comap (Algebra.linearMap R A) ((I : Submodule R A) * Submodule.span R {v}) = ⊤) : Submodule.IsPrincipal (I : Submodule R A) := by
have hinv := I.mul_inv set J := Submodule.comap (Algebra.linearMap R A) ((I : Submodule R A) * Submodule.span R {v}) have hJ : IsLocalization.coeSubmodule A J = ↑I * Submodule.span R {v} := by -- Porting note: had to insert `val_eq_coe` into this rewrite. -- Arguably this is because `Subtype.ext_iff` is breaking the `FractionalIdeal` API. rw [Subtype.ext_iff, val_eq_coe, coe_mul, val_eq_coe, coe_one] at hinv apply Submodule.map_comap_eq_self rw [← Submodule.one_eq_range, ← hinv] exact Submodule.mul_le_mul_right ((Submodule.span_singleton_le_iff_mem _ _).2 hv) have : (1 : A) ∈ ↑I * Submodule.span R {v} := by rw [← hJ, h, IsLocalization.coeSubmodule_top, Submodule.mem_one] exact ⟨1, (algebraMap R _).map_one⟩ obtain ⟨w, hw, hvw⟩ := Submodule.mem_mul_span_singleton.1 this refine ⟨⟨w, ?_⟩⟩ rw [← FractionalIdeal.coe_spanSingleton S, ← inv_inv I, eq_comm] refine congr_arg coeToSubmodule (Units.eq_inv_of_mul_eq_one_left (le_antisymm ?_ ?_)) · conv_rhs => rw [← hinv, mul_comm] apply FractionalIdeal.mul_le_mul_left (FractionalIdeal.spanSingleton_le_iff_mem.mpr hw) · rw [FractionalIdeal.one_le, ← hvw, mul_comm] exact FractionalIdeal.mul_mem_mul hv (FractionalIdeal.mem_spanSingleton_self _ _)
[ " P = span {x}", " x ≠ 0", " False", " ⊥ = span {x}", " P ∣ span {x}", " normalizedFactors (span {x}) ≤ normalizedFactors P", " ∀ (a : Ideal R), Multiset.count a (normalizedFactors (span {x})) ≤ if a = P then 1 else 0", " Multiset.count Q (normalizedFactors (span {x})) ≤ if Q = P then 1 else 0", " M...
[ " P = span {x}", " x ≠ 0", " False", " ⊥ = span {x}", " P ∣ span {x}", " normalizedFactors (span {x}) ≤ normalizedFactors P", " ∀ (a : Ideal R), Multiset.count a (normalizedFactors (span {x})) ≤ if a = P then 1 else 0", " Multiset.count Q (normalizedFactors (span {x})) ≤ if Q = P then 1 else 0", " M...
import Mathlib.MeasureTheory.Measure.Typeclasses open scoped ENNReal namespace MeasureTheory variable {α : Type*} noncomputable def Measure.trim {m m0 : MeasurableSpace α} (μ : @Measure α m0) (hm : m ≤ m0) : @Measure α m := @OuterMeasure.toMeasure α m μ.toOuterMeasure (hm.trans (le_toOuterMeasure_caratheodory μ)) #align measure_theory.measure.trim MeasureTheory.Measure.trim @[simp]
Mathlib/MeasureTheory/Measure/Trim.lean
37
38
theorem trim_eq_self [MeasurableSpace α] {μ : Measure α} : μ.trim le_rfl = μ := by
simp [Measure.trim]
[ " μ.trim ⋯ = μ" ]
[]
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv import Mathlib.Analysis.SpecialFunctions.Log.Basic #align_import analysis.special_functions.arsinh from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open Function Filter Set open scoped Topology namespace Real variable {x y : ℝ} -- @[pp_nodot] is no longer needed def arsinh (x : ℝ) := log (x + √(1 + x ^ 2)) #align real.arsinh Real.arsinh theorem exp_arsinh (x : ℝ) : exp (arsinh x) = x + √(1 + x ^ 2) := by apply exp_log rw [← neg_lt_iff_pos_add'] apply lt_sqrt_of_sq_lt simp #align real.exp_arsinh Real.exp_arsinh @[simp] theorem arsinh_zero : arsinh 0 = 0 := by simp [arsinh] #align real.arsinh_zero Real.arsinh_zero @[simp] theorem arsinh_neg (x : ℝ) : arsinh (-x) = -arsinh x := by rw [← exp_eq_exp, exp_arsinh, exp_neg, exp_arsinh] apply eq_inv_of_mul_eq_one_left rw [neg_sq, neg_add_eq_sub, add_comm x, mul_comm, ← sq_sub_sq, sq_sqrt, add_sub_cancel_right] exact add_nonneg zero_le_one (sq_nonneg _) #align real.arsinh_neg Real.arsinh_neg @[simp] theorem sinh_arsinh (x : ℝ) : sinh (arsinh x) = x := by rw [sinh_eq, ← arsinh_neg, exp_arsinh, exp_arsinh, neg_sq]; field_simp #align real.sinh_arsinh Real.sinh_arsinh @[simp]
Mathlib/Analysis/SpecialFunctions/Arsinh.lean
83
84
theorem cosh_arsinh (x : ℝ) : cosh (arsinh x) = √(1 + x ^ 2) := by
rw [← sqrt_sq (cosh_pos _).le, cosh_sq', sinh_arsinh]
[ " rexp x.arsinh = x + √(1 + x ^ 2)", " 0 < x + √(1 + x ^ 2)", " -x < √(1 + x ^ 2)", " (-x) ^ 2 < 1 + x ^ 2", " arsinh 0 = 0", " (-x).arsinh = -x.arsinh", " -x + √(1 + (-x) ^ 2) = (x + √(1 + x ^ 2))⁻¹", " (-x + √(1 + (-x) ^ 2)) * (x + √(1 + x ^ 2)) = 1", " 0 ≤ 1 + x ^ 2", " x.arsinh.sinh = x", " ...
[ " rexp x.arsinh = x + √(1 + x ^ 2)", " 0 < x + √(1 + x ^ 2)", " -x < √(1 + x ^ 2)", " (-x) ^ 2 < 1 + x ^ 2", " arsinh 0 = 0", " (-x).arsinh = -x.arsinh", " -x + √(1 + (-x) ^ 2) = (x + √(1 + x ^ 2))⁻¹", " (-x + √(1 + (-x) ^ 2)) * (x + √(1 + x ^ 2)) = 1", " 0 ≤ 1 + x ^ 2", " x.arsinh.sinh = x", " ...
import Mathlib.Analysis.InnerProductSpace.Projection import Mathlib.Analysis.NormedSpace.PiLp import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.UnitaryGroup #align_import analysis.inner_product_space.pi_L2 from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" set_option linter.uppercaseLean3 false open Real Set Filter RCLike Submodule Function Uniformity Topology NNReal ENNReal ComplexConjugate DirectSum noncomputable section variable {ι ι' 𝕜 : Type*} [RCLike 𝕜] variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] variable {E' : Type*} [NormedAddCommGroup E'] [InnerProductSpace 𝕜 E'] variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F] variable {F' : Type*} [NormedAddCommGroup F'] [InnerProductSpace ℝ F'] local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y instance PiLp.innerProductSpace {ι : Type*} [Fintype ι] (f : ι → Type*) [∀ i, NormedAddCommGroup (f i)] [∀ i, InnerProductSpace 𝕜 (f i)] : InnerProductSpace 𝕜 (PiLp 2 f) where inner x y := ∑ i, inner (x i) (y i) norm_sq_eq_inner x := by simp only [PiLp.norm_sq_eq_of_L2, map_sum, ← norm_sq_eq_inner, one_div] conj_symm := by intro x y unfold inner rw [map_sum] apply Finset.sum_congr rfl rintro z - apply inner_conj_symm add_left x y z := show (∑ i, inner (x i + y i) (z i)) = (∑ i, inner (x i) (z i)) + ∑ i, inner (y i) (z i) by simp only [inner_add_left, Finset.sum_add_distrib] smul_left x y r := show (∑ i : ι, inner (r • x i) (y i)) = conj r * ∑ i, inner (x i) (y i) by simp only [Finset.mul_sum, inner_smul_left] #align pi_Lp.inner_product_space PiLp.innerProductSpace @[simp] theorem PiLp.inner_apply {ι : Type*} [Fintype ι] {f : ι → Type*} [∀ i, NormedAddCommGroup (f i)] [∀ i, InnerProductSpace 𝕜 (f i)] (x y : PiLp 2 f) : ⟪x, y⟫ = ∑ i, ⟪x i, y i⟫ := rfl #align pi_Lp.inner_apply PiLp.inner_apply abbrev EuclideanSpace (𝕜 : Type*) (n : Type*) : Type _ := PiLp 2 fun _ : n => 𝕜 #align euclidean_space EuclideanSpace theorem EuclideanSpace.nnnorm_eq {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n] (x : EuclideanSpace 𝕜 n) : ‖x‖₊ = NNReal.sqrt (∑ i, ‖x i‖₊ ^ 2) := PiLp.nnnorm_eq_of_L2 x #align euclidean_space.nnnorm_eq EuclideanSpace.nnnorm_eq theorem EuclideanSpace.norm_eq {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n] (x : EuclideanSpace 𝕜 n) : ‖x‖ = √(∑ i, ‖x i‖ ^ 2) := by simpa only [Real.coe_sqrt, NNReal.coe_sum] using congr_arg ((↑) : ℝ≥0 → ℝ) x.nnnorm_eq #align euclidean_space.norm_eq EuclideanSpace.norm_eq theorem EuclideanSpace.dist_eq {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n] (x y : EuclideanSpace 𝕜 n) : dist x y = √(∑ i, dist (x i) (y i) ^ 2) := PiLp.dist_eq_of_L2 x y #align euclidean_space.dist_eq EuclideanSpace.dist_eq theorem EuclideanSpace.nndist_eq {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n] (x y : EuclideanSpace 𝕜 n) : nndist x y = NNReal.sqrt (∑ i, nndist (x i) (y i) ^ 2) := PiLp.nndist_eq_of_L2 x y #align euclidean_space.nndist_eq EuclideanSpace.nndist_eq theorem EuclideanSpace.edist_eq {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n] (x y : EuclideanSpace 𝕜 n) : edist x y = (∑ i, edist (x i) (y i) ^ 2) ^ (1 / 2 : ℝ) := PiLp.edist_eq_of_L2 x y #align euclidean_space.edist_eq EuclideanSpace.edist_eq
Mathlib/Analysis/InnerProductSpace/PiL2.lean
134
138
theorem EuclideanSpace.ball_zero_eq {n : Type*} [Fintype n] (r : ℝ) (hr : 0 ≤ r) : Metric.ball (0 : EuclideanSpace ℝ n) r = {x | ∑ i, x i ^ 2 < r ^ 2} := by
ext x have : (0 : ℝ) ≤ ∑ i, x i ^ 2 := Finset.sum_nonneg fun _ _ => sq_nonneg _ simp_rw [mem_setOf, mem_ball_zero_iff, norm_eq, norm_eq_abs, sq_abs, sqrt_lt this hr]
[ " ‖x‖ ^ 2 = re ⟪x, x⟫_𝕜", " ∀ (x y : PiLp 2 f), (starRingEnd 𝕜) ⟪y, x⟫_𝕜 = ⟪x, y⟫_𝕜", " (starRingEnd 𝕜) ⟪y, x⟫_𝕜 = ⟪x, y⟫_𝕜", " (starRingEnd 𝕜) ({ inner := fun x y => ∑ i : ι, InnerProductSpace.toInner.1 (x i) (y i) }.1 y x) =\n { inner := fun x y => ∑ i : ι, InnerProductSpace.toInner.1 (x i) (y i)...
[ " ‖x‖ ^ 2 = re ⟪x, x⟫_𝕜", " ∀ (x y : PiLp 2 f), (starRingEnd 𝕜) ⟪y, x⟫_𝕜 = ⟪x, y⟫_𝕜", " (starRingEnd 𝕜) ⟪y, x⟫_𝕜 = ⟪x, y⟫_𝕜", " (starRingEnd 𝕜) ({ inner := fun x y => ∑ i : ι, InnerProductSpace.toInner.1 (x i) (y i) }.1 y x) =\n { inner := fun x y => ∑ i : ι, InnerProductSpace.toInner.1 (x i) (y i)...
import Mathlib.Logic.Function.Basic import Mathlib.Logic.Relator import Mathlib.Init.Data.Quot import Mathlib.Tactic.Cases import Mathlib.Tactic.Use import Mathlib.Tactic.MkIffOfInductiveProp import Mathlib.Tactic.SimpRw #align_import logic.relation from "leanprover-community/mathlib"@"3365b20c2ffa7c35e47e5209b89ba9abdddf3ffe" open Function variable {α β γ δ ε ζ : Type*} namespace Relation section Fibration variable (rα : α → α → Prop) (rβ : β → β → Prop) (f : α → β) def Fibration := ∀ ⦃a b⦄, rβ b (f a) → ∃ a', rα a' a ∧ f a' = b #align relation.fibration Relation.Fibration variable {rα rβ}
Mathlib/Logic/Relation.lean
192
196
theorem _root_.Acc.of_fibration (fib : Fibration rα rβ f) {a} (ha : Acc rα a) : Acc rβ (f a) := by
induction' ha with a _ ih refine Acc.intro (f a) fun b hr ↦ ?_ obtain ⟨a', hr', rfl⟩ := fib hr exact ih a' hr'
[ " Acc rβ (f a)", " Acc rβ b", " Acc rβ (f a')" ]
[]
import Mathlib.Topology.Order.LeftRightNhds open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {α β γ : Type*} section OrderTopology variable [TopologicalSpace α] [TopologicalSpace β] [LinearOrder α] [LinearOrder β] [OrderTopology α] [OrderTopology β]
Mathlib/Topology/Order/IsLUB.lean
24
32
theorem IsLUB.frequently_mem {a : α} {s : Set α} (ha : IsLUB s a) (hs : s.Nonempty) : ∃ᶠ x in 𝓝[≤] a, x ∈ s := by
rcases hs with ⟨a', ha'⟩ intro h rcases (ha.1 ha').eq_or_lt with (rfl | ha'a) · exact h.self_of_nhdsWithin le_rfl ha' · rcases (mem_nhdsWithin_Iic_iff_exists_Ioc_subset' ha'a).1 h with ⟨b, hba, hb⟩ rcases ha.exists_between hba with ⟨b', hb's, hb'⟩ exact hb hb' hb's
[ " ∃ᶠ (x : α) in 𝓝[≤] a, x ∈ s", " False" ]
[]
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Limits.Preserves.Basic #align_import category_theory.limits.preserves.shapes.pullbacks from "leanprover-community/mathlib"@"f11e306adb9f2a393539d2bb4293bf1b42caa7ac" noncomputable section universe v₁ v₂ u₁ u₂ -- Porting note: need Functor namespace for mapCone open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Functor namespace CategoryTheory.Limits section Pushout variable {C : Type u₁} [Category.{v₁} C] variable {D : Type u₂} [Category.{v₂} D] variable (G : C ⥤ D) variable {W X Y Z : C} {h : X ⟶ Z} {k : Y ⟶ Z} {f : W ⟶ X} {g : W ⟶ Y} (comm : f ≫ h = g ≫ k) def isColimitMapCoconePushoutCoconeEquiv : IsColimit (mapCocone G (PushoutCocone.mk h k comm)) ≃ IsColimit (PushoutCocone.mk (G.map h) (G.map k) (by simp only [← G.map_comp, comm]) : PushoutCocone (G.map f) (G.map g)) := (IsColimit.precomposeHomEquiv (diagramIsoSpan.{v₂} _).symm _).symm.trans <| IsColimit.equivIsoColimit <| Cocones.ext (Iso.refl _) <| by rintro (_ | _ | _) <;> dsimp <;> simp only [Category.comp_id, Category.id_comp, ← G.map_comp] #align category_theory.limits.is_colimit_map_cocone_pushout_cocone_equiv CategoryTheory.Limits.isColimitMapCoconePushoutCoconeEquiv def isColimitPushoutCoconeMapOfIsColimit [PreservesColimit (span f g) G] (l : IsColimit (PushoutCocone.mk h k comm)) : IsColimit (PushoutCocone.mk (G.map h) (G.map k) (show G.map f ≫ G.map h = G.map g ≫ G.map k from by simp only [← G.map_comp,comm] )) := isColimitMapCoconePushoutCoconeEquiv G comm (PreservesColimit.preserves l) #align category_theory.limits.is_colimit_pushout_cocone_map_of_is_colimit CategoryTheory.Limits.isColimitPushoutCoconeMapOfIsColimit def isColimitOfIsColimitPushoutCoconeMap [ReflectsColimit (span f g) G] (l : IsColimit (PushoutCocone.mk (G.map h) (G.map k) (show G.map f ≫ G.map h = G.map g ≫ G.map k from by simp only [← G.map_comp,comm]))) : IsColimit (PushoutCocone.mk h k comm) := ReflectsColimit.reflects ((isColimitMapCoconePushoutCoconeEquiv G comm).symm l) #align category_theory.limits.is_colimit_of_is_colimit_pushout_cocone_map CategoryTheory.Limits.isColimitOfIsColimitPushoutCoconeMap variable (f g) [PreservesColimit (span f g) G] def isColimitOfHasPushoutOfPreservesColimit [i : HasPushout f g] : IsColimit (PushoutCocone.mk (G.map pushout.inl) (G.map (@pushout.inr _ _ _ _ _ f g i)) (show G.map f ≫ G.map pushout.inl = G.map g ≫ G.map pushout.inr from by simp only [← G.map_comp, pushout.condition])) := isColimitPushoutCoconeMapOfIsColimit G _ (pushoutIsPushout f g) #align category_theory.limits.is_colimit_of_has_pushout_of_preserves_colimit CategoryTheory.Limits.isColimitOfHasPushoutOfPreservesColimit def preservesPushoutSymmetry : PreservesColimit (span g f) G where preserves {c} hc := by apply (IsColimit.precomposeHomEquiv (diagramIsoSpan.{v₂} _).symm _).toFun apply IsColimit.ofIsoColimit _ (PushoutCocone.isoMk _).symm apply PushoutCocone.isColimitOfFlip apply (isColimitMapCoconePushoutCoconeEquiv _ _).toFun · refine @PreservesColimit.preserves _ _ _ _ _ _ _ _ ?_ _ ?_ -- Porting note: more TC coddling · dsimp infer_instance · exact PushoutCocone.flipIsColimit hc #align category_theory.limits.preserves_pushout_symmetry CategoryTheory.Limits.preservesPushoutSymmetry theorem hasPushout_of_preservesPushout [HasPushout f g] : HasPushout (G.map f) (G.map g) := ⟨⟨⟨_, isColimitPushoutCoconeMapOfIsColimit G _ (pushoutIsPushout _ _)⟩⟩⟩ #align category_theory.limits.has_pushout_of_preserves_pushout CategoryTheory.Limits.hasPushout_of_preservesPushout variable [HasPushout f g] [HasPushout (G.map f) (G.map g)] def PreservesPushout.iso : pushout (G.map f) (G.map g) ≅ G.obj (pushout f g) := IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) (isColimitOfHasPushoutOfPreservesColimit G f g) #align category_theory.limits.preserves_pushout.iso CategoryTheory.Limits.PreservesPushout.iso @[simp] theorem PreservesPushout.iso_hom : (PreservesPushout.iso G f g).hom = pushoutComparison G f g := rfl #align category_theory.limits.preserves_pushout.iso_hom CategoryTheory.Limits.PreservesPushout.iso_hom @[reassoc] theorem PreservesPushout.inl_iso_hom : pushout.inl ≫ (PreservesPushout.iso G f g).hom = G.map pushout.inl := by delta PreservesPushout.iso simp #align category_theory.limits.preserves_pushout.inl_iso_hom CategoryTheory.Limits.PreservesPushout.inl_iso_hom @[reassoc] theorem PreservesPushout.inr_iso_hom : pushout.inr ≫ (PreservesPushout.iso G f g).hom = G.map pushout.inr := by delta PreservesPushout.iso simp #align category_theory.limits.preserves_pushout.inr_iso_hom CategoryTheory.Limits.PreservesPushout.inr_iso_hom @[reassoc (attr := simp)] theorem PreservesPushout.inl_iso_inv : G.map pushout.inl ≫ (PreservesPushout.iso G f g).inv = pushout.inl := by simp [PreservesPushout.iso, Iso.comp_inv_eq] #align category_theory.limits.preserves_pushout.inl_iso_inv CategoryTheory.Limits.PreservesPushout.inl_iso_inv @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean
245
247
theorem PreservesPushout.inr_iso_inv : G.map pushout.inr ≫ (PreservesPushout.iso G f g).inv = pushout.inr := by
simp [PreservesPushout.iso, Iso.comp_inv_eq]
[ " G.map f ≫ G.map h = G.map g ≫ G.map k", " ∀ (j : WalkingSpan),\n ((Cocones.precompose (diagramIsoSpan (span f g ⋙ G)).symm.hom).obj (G.mapCocone (PushoutCocone.mk h k comm))).ι.app\n j ≫\n (Iso.refl\n ((Cocones.precompose (diagramIsoSpan (span f g ⋙ G)).symm.hom).obj\n ...
[ " G.map f ≫ G.map h = G.map g ≫ G.map k", " ∀ (j : WalkingSpan),\n ((Cocones.precompose (diagramIsoSpan (span f g ⋙ G)).symm.hom).obj (G.mapCocone (PushoutCocone.mk h k comm))).ι.app\n j ≫\n (Iso.refl\n ((Cocones.precompose (diagramIsoSpan (span f g ⋙ G)).symm.hom).obj\n ...
import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Option #align_import data.fintype.option from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226" assert_not_exists MonoidWithZero assert_not_exists MulAction open Function open Nat universe u v variable {α β γ : Type*} open Finset Function instance {α : Type*} [Fintype α] : Fintype (Option α) := ⟨Finset.insertNone univ, fun a => by simp⟩ theorem univ_option (α : Type*) [Fintype α] : (univ : Finset (Option α)) = insertNone univ := rfl #align univ_option univ_option @[simp] theorem Fintype.card_option {α : Type*} [Fintype α] : Fintype.card (Option α) = Fintype.card α + 1 := (Finset.card_cons (by simp)).trans <| congr_arg₂ _ (card_map _) rfl #align fintype.card_option Fintype.card_option def fintypeOfOption {α : Type*} [Fintype (Option α)] : Fintype α := ⟨Finset.eraseNone (Fintype.elems (α := Option α)), fun x => mem_eraseNone.mpr (Fintype.complete (some x))⟩ #align fintype_of_option fintypeOfOption def fintypeOfOptionEquiv [Fintype α] (f : α ≃ Option β) : Fintype β := haveI := Fintype.ofEquiv _ f fintypeOfOption #align fintype_of_option_equiv fintypeOfOptionEquiv namespace Fintype def truncRecEmptyOption {P : Type u → Sort v} (of_equiv : ∀ {α β}, α ≃ β → P α → P β) (h_empty : P PEmpty) (h_option : ∀ {α} [Fintype α] [DecidableEq α], P α → P (Option α)) (α : Type u) [Fintype α] [DecidableEq α] : Trunc (P α) := by suffices ∀ n : ℕ, Trunc (P (ULift <| Fin n)) by apply Trunc.bind (this (Fintype.card α)) intro h apply Trunc.map _ (Fintype.truncEquivFin α) intro e exact of_equiv (Equiv.ulift.trans e.symm) h apply ind where -- Porting note: do a manual recursion, instead of `induction` tactic, -- to ensure the result is computable ind : ∀ n : ℕ, Trunc (P (ULift <| Fin n)) | Nat.zero => by have : card PEmpty = card (ULift (Fin 0)) := by simp only [card_fin, card_pempty, card_ulift] apply Trunc.bind (truncEquivOfCardEq this) intro e apply Trunc.mk exact of_equiv e h_empty | Nat.succ n => by have : card (Option (ULift (Fin n))) = card (ULift (Fin n.succ)) := by simp only [card_fin, card_option, card_ulift] apply Trunc.bind (truncEquivOfCardEq this) intro e apply Trunc.map _ (ind n) intro ih exact of_equiv e (h_option ih) #align fintype.trunc_rec_empty_option Fintype.truncRecEmptyOption -- Porting note: due to instance inference issues in `SetTheory.Cardinal.Basic` -- I had to explicitly name `h_fintype` in order to access it manually. -- was `[Fintype α]` @[elab_as_elim]
Mathlib/Data/Fintype/Option.lean
94
106
theorem induction_empty_option {P : ∀ (α : Type u) [Fintype α], Prop} (of_equiv : ∀ (α β) [Fintype β] (e : α ≃ β), @P α (@Fintype.ofEquiv α β ‹_› e.symm) → @P β ‹_›) (h_empty : P PEmpty) (h_option : ∀ (α) [Fintype α], P α → P (Option α)) (α : Type u) [h_fintype : Fintype α] : P α := by
obtain ⟨p⟩ := let f_empty := fun i => by convert h_empty let h_option : ∀ {α : Type u} [Fintype α] [DecidableEq α], (∀ (h : Fintype α), P α) → ∀ (h : Fintype (Option α)), P (Option α) := by rintro α hα - Pα hα' convert h_option α (Pα _) @truncRecEmptyOption (fun α => ∀ h, @P α h) (@fun α β e hα hβ => @of_equiv α β hβ e (hα _)) f_empty h_option α _ (Classical.decEq α) exact p _
[ " a ∈ insertNone univ", " none ∉ map Embedding.some univ", " Trunc (P (ULift.{u, 0} (Fin zero)))", " card PEmpty.{?u.2644 + 1} = card (ULift.{?u.2654, 0} (Fin 0))", " PEmpty.{?u.2644 + 1} ≃ ULift.{?u.2654, 0} (Fin 0) → Trunc (P (ULift.{u, 0} (Fin zero)))", " P (ULift.{u, 0} (Fin zero))", " Trunc (P (ULi...
[ " a ∈ insertNone univ", " none ∉ map Embedding.some univ", " Trunc (P (ULift.{u, 0} (Fin zero)))", " card PEmpty.{?u.2644 + 1} = card (ULift.{?u.2654, 0} (Fin 0))", " PEmpty.{?u.2644 + 1} ≃ ULift.{?u.2654, 0} (Fin 0) → Trunc (P (ULift.{u, 0} (Fin zero)))", " P (ULift.{u, 0} (Fin zero))", " Trunc (P (ULi...
import Mathlib.Algebra.Group.Subgroup.Finite import Mathlib.Algebra.Group.Subgroup.Pointwise import Mathlib.GroupTheory.Congruence.Basic import Mathlib.GroupTheory.Coset #align_import group_theory.quotient_group from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf" open Function open scoped Pointwise universe u v w x namespace QuotientGroup variable {G : Type u} [Group G] (N : Subgroup G) [nN : N.Normal] {H : Type v} [Group H] {M : Type x} [Monoid M] @[to_additive "The additive congruence relation generated by a normal additive subgroup."] protected def con : Con G where toSetoid := leftRel N mul' := @fun a b c d hab hcd => by rw [leftRel_eq] at hab hcd ⊢ dsimp only calc (a * c)⁻¹ * (b * d) = c⁻¹ * (a⁻¹ * b) * c⁻¹⁻¹ * (c⁻¹ * d) := by simp only [mul_inv_rev, mul_assoc, inv_mul_cancel_left] _ ∈ N := N.mul_mem (nN.conj_mem _ hab _) hcd #align quotient_group.con QuotientGroup.con #align quotient_add_group.con QuotientAddGroup.con @[to_additive] instance Quotient.group : Group (G ⧸ N) := (QuotientGroup.con N).group #align quotient_group.quotient.group QuotientGroup.Quotient.group #align quotient_add_group.quotient.add_group QuotientAddGroup.Quotient.addGroup @[to_additive "The additive group homomorphism from `G` to `G/N`."] def mk' : G →* G ⧸ N := MonoidHom.mk' QuotientGroup.mk fun _ _ => rfl #align quotient_group.mk' QuotientGroup.mk' #align quotient_add_group.mk' QuotientAddGroup.mk' @[to_additive (attr := simp)] theorem coe_mk' : (mk' N : G → G ⧸ N) = mk := rfl #align quotient_group.coe_mk' QuotientGroup.coe_mk' #align quotient_add_group.coe_mk' QuotientAddGroup.coe_mk' @[to_additive (attr := simp)] theorem mk'_apply (x : G) : mk' N x = x := rfl #align quotient_group.mk'_apply QuotientGroup.mk'_apply #align quotient_add_group.mk'_apply QuotientAddGroup.mk'_apply @[to_additive] theorem mk'_surjective : Surjective <| mk' N := @mk_surjective _ _ N #align quotient_group.mk'_surjective QuotientGroup.mk'_surjective #align quotient_add_group.mk'_surjective QuotientAddGroup.mk'_surjective @[to_additive] theorem mk'_eq_mk' {x y : G} : mk' N x = mk' N y ↔ ∃ z ∈ N, x * z = y := QuotientGroup.eq'.trans <| by simp only [← _root_.eq_inv_mul_iff_mul_eq, exists_prop, exists_eq_right] #align quotient_group.mk'_eq_mk' QuotientGroup.mk'_eq_mk' #align quotient_add_group.mk'_eq_mk' QuotientAddGroup.mk'_eq_mk' open scoped Pointwise in @[to_additive]
Mathlib/GroupTheory/QuotientGroup.lean
108
113
theorem sound (U : Set (G ⧸ N)) (g : N.op) : g • (mk' N) ⁻¹' U = (mk' N) ⁻¹' U := by
ext x simp only [Set.mem_preimage, Set.mem_smul_set_iff_inv_smul_mem] congr! 1 exact Quotient.sound ⟨g⁻¹, rfl⟩
[ " Setoid.r (a * c) (b * d)", " (fun x y => x⁻¹ * y ∈ N) (a * c) (b * d)", " (a * c)⁻¹ * (b * d) ∈ N", " (a * c)⁻¹ * (b * d) = c⁻¹ * (a⁻¹ * b) * c⁻¹⁻¹ * (c⁻¹ * d)", " x⁻¹ * y ∈ N ↔ ∃ z ∈ N, x * z = y", " g • ⇑(mk' N) ⁻¹' U = ⇑(mk' N) ⁻¹' U", " x ∈ g • ⇑(mk' N) ⁻¹' U ↔ x ∈ ⇑(mk' N) ⁻¹' U", " (mk' N) (g⁻...
[ " Setoid.r (a * c) (b * d)", " (fun x y => x⁻¹ * y ∈ N) (a * c) (b * d)", " (a * c)⁻¹ * (b * d) ∈ N", " (a * c)⁻¹ * (b * d) = c⁻¹ * (a⁻¹ * b) * c⁻¹⁻¹ * (c⁻¹ * d)", " x⁻¹ * y ∈ N ↔ ∃ z ∈ N, x * z = y" ]
import Mathlib.GroupTheory.Coprod.Basic import Mathlib.GroupTheory.Complement open Monoid Coprod Multiplicative Subgroup Function def HNNExtension.con (G : Type*) [Group G] (A B : Subgroup G) (φ : A ≃* B) : Con (G ∗ Multiplicative ℤ) := conGen (fun x y => ∃ (a : A), x = inr (ofAdd 1) * inl (a : G) ∧ y = inl (φ a : G) * inr (ofAdd 1)) def HNNExtension (G : Type*) [Group G] (A B : Subgroup G) (φ : A ≃* B) : Type _ := (HNNExtension.con G A B φ).Quotient variable {G : Type*} [Group G] {A B : Subgroup G} {φ : A ≃* B} {H : Type*} [Group H] {M : Type*} [Monoid M] instance : Group (HNNExtension G A B φ) := by delta HNNExtension; infer_instance namespace HNNExtension def of : G →* HNNExtension G A B φ := (HNNExtension.con G A B φ).mk'.comp inl def t : HNNExtension G A B φ := (HNNExtension.con G A B φ).mk'.comp inr (ofAdd 1) theorem t_mul_of (a : A) : t * (of (a : G) : HNNExtension G A B φ) = of (φ a : G) * t := (Con.eq _).2 <| ConGen.Rel.of _ _ <| ⟨a, by simp⟩ theorem of_mul_t (b : B) : (of (b : G) : HNNExtension G A B φ) * t = t * of (φ.symm b : G) := by rw [t_mul_of]; simp theorem equiv_eq_conj (a : A) : (of (φ a : G) : HNNExtension G A B φ) = t * of (a : G) * t⁻¹ := by rw [t_mul_of]; simp theorem equiv_symm_eq_conj (b : B) : (of (φ.symm b : G) : HNNExtension G A B φ) = t⁻¹ * of (b : G) * t := by rw [mul_assoc, of_mul_t]; simp theorem inv_t_mul_of (b : B) : t⁻¹ * (of (b : G) : HNNExtension G A B φ) = of (φ.symm b : G) * t⁻¹ := by rw [equiv_symm_eq_conj]; simp theorem of_mul_inv_t (a : A) : (of (a : G) : HNNExtension G A B φ) * t⁻¹ = t⁻¹ * of (φ a : G) := by rw [equiv_eq_conj]; simp [mul_assoc] def lift (f : G →* H) (x : H) (hx : ∀ a : A, x * f ↑a = f (φ a : G) * x) : HNNExtension G A B φ →* H := Con.lift _ (Coprod.lift f (zpowersHom H x)) (Con.conGen_le <| by rintro _ _ ⟨a, rfl, rfl⟩ simp [hx]) @[simp] theorem lift_t (f : G →* H) (x : H) (hx : ∀ a : A, x * f ↑a = f (φ a : G) * x) : lift f x hx t = x := by delta HNNExtension; simp [lift, t] @[simp] theorem lift_of (f : G →* H) (x : H) (hx : ∀ a : A, x * f ↑a = f (φ a : G) * x) (g : G) : lift f x hx (of g) = f g := by delta HNNExtension; simp [lift, of] @[ext high] theorem hom_ext {f g : HNNExtension G A B φ →* M} (hg : f.comp of = g.comp of) (ht : f t = g t) : f = g := (MonoidHom.cancel_right Con.mk'_surjective).mp <| Coprod.hom_ext hg (MonoidHom.ext_mint ht) @[elab_as_elim] theorem induction_on {motive : HNNExtension G A B φ → Prop} (x : HNNExtension G A B φ) (of : ∀ g, motive (of g)) (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y)) (inv : ∀ x, motive x → motive x⁻¹) : motive x := by let S : Subgroup (HNNExtension G A B φ) := { carrier := setOf motive one_mem' := by simpa using of 1 mul_mem' := mul _ _ inv_mem' := inv _ } let f : HNNExtension G A B φ →* S := lift (HNNExtension.of.codRestrict S of) ⟨HNNExtension.t, t⟩ (by intro a; ext; simp [equiv_eq_conj, mul_assoc]) have hf : S.subtype.comp f = MonoidHom.id _ := hom_ext (by ext; simp [f]) (by simp [f]) show motive (MonoidHom.id _ x) rw [← hf] exact (f x).2 variable (A B φ) def toSubgroup (u : ℤˣ) : Subgroup G := if u = 1 then A else B @[simp] theorem toSubgroup_one : toSubgroup A B 1 = A := rfl @[simp] theorem toSubgroup_neg_one : toSubgroup A B (-1) = B := rfl variable {A B} def toSubgroupEquiv (u : ℤˣ) : toSubgroup A B u ≃* toSubgroup A B (-u) := if hu : u = 1 then hu ▸ φ else by convert φ.symm <;> cases Int.units_eq_one_or u <;> simp_all @[simp] theorem toSubgroupEquiv_one : toSubgroupEquiv φ 1 = φ := rfl @[simp] theorem toSubgroupEquiv_neg_one : toSubgroupEquiv φ (-1) = φ.symm := rfl @[simp]
Mathlib/GroupTheory/HNNExtension.lean
164
170
theorem toSubgroupEquiv_neg_apply (u : ℤˣ) (a : toSubgroup A B u) : (toSubgroupEquiv φ (-u) (toSubgroupEquiv φ u a) : G) = a := by
rcases Int.units_eq_one_or u with rfl | rfl · -- This used to be `simp` before leanprover/lean4#2644 simp; erw [MulEquiv.symm_apply_apply] · simp only [toSubgroup_neg_one, toSubgroupEquiv_neg_one, SetLike.coe_eq_coe] exact φ.apply_symm_apply a
[ " Group (HNNExtension G A B φ)", " Group (HNNExtension.con G A B φ).Quotient", " (fun x x_1 => x * x_1) (inr (ofAdd 1)) (inl ↑a) = inr (ofAdd 1) * inl ↑a ∧\n (fun x x_1 => x * x_1) (inl ↑(φ a)) (inr (ofAdd 1)) = inl ↑(φ a) * inr (ofAdd 1)", " of ↑b * t = t * of ↑(φ.symm b)", " of ↑b * t = of ↑(φ (φ.symm ...
[ " Group (HNNExtension G A B φ)", " Group (HNNExtension.con G A B φ).Quotient", " (fun x x_1 => x * x_1) (inr (ofAdd 1)) (inl ↑a) = inr (ofAdd 1) * inl ↑a ∧\n (fun x x_1 => x * x_1) (inl ↑(φ a)) (inr (ofAdd 1)) = inl ↑(φ a) * inr (ofAdd 1)", " of ↑b * t = t * of ↑(φ.symm b)", " of ↑b * t = of ↑(φ (φ.symm ...
import Mathlib.Data.Set.Function import Mathlib.Order.Interval.Set.OrdConnected #align_import data.set.intervals.proj_Icc from "leanprover-community/mathlib"@"4e24c4bfcff371c71f7ba22050308aa17815626c" variable {α β : Type*} [LinearOrder α] open Function namespace Set def projIci (a x : α) : Ici a := ⟨max a x, le_max_left _ _⟩ #align set.proj_Ici Set.projIci def projIic (b x : α) : Iic b := ⟨min b x, min_le_left _ _⟩ #align set.proj_Iic Set.projIic def projIcc (a b : α) (h : a ≤ b) (x : α) : Icc a b := ⟨max a (min b x), le_max_left _ _, max_le h (min_le_left _ _)⟩ #align set.proj_Icc Set.projIcc variable {a b : α} (h : a ≤ b) {x : α} @[norm_cast] theorem coe_projIci (a x : α) : (projIci a x : α) = max a x := rfl #align set.coe_proj_Ici Set.coe_projIci @[norm_cast] theorem coe_projIic (b x : α) : (projIic b x : α) = min b x := rfl #align set.coe_proj_Iic Set.coe_projIic @[norm_cast] theorem coe_projIcc (a b : α) (h : a ≤ b) (x : α) : (projIcc a b h x : α) = max a (min b x) := rfl #align set.coe_proj_Icc Set.coe_projIcc theorem projIci_of_le (hx : x ≤ a) : projIci a x = ⟨a, le_rfl⟩ := Subtype.ext <| max_eq_left hx #align set.proj_Ici_of_le Set.projIci_of_le theorem projIic_of_le (hx : b ≤ x) : projIic b x = ⟨b, le_rfl⟩ := Subtype.ext <| min_eq_left hx #align set.proj_Iic_of_le Set.projIic_of_le theorem projIcc_of_le_left (hx : x ≤ a) : projIcc a b h x = ⟨a, left_mem_Icc.2 h⟩ := by simp [projIcc, hx, hx.trans h] #align set.proj_Icc_of_le_left Set.projIcc_of_le_left theorem projIcc_of_right_le (hx : b ≤ x) : projIcc a b h x = ⟨b, right_mem_Icc.2 h⟩ := by simp [projIcc, hx, h] #align set.proj_Icc_of_right_le Set.projIcc_of_right_le @[simp] theorem projIci_self (a : α) : projIci a a = ⟨a, le_rfl⟩ := projIci_of_le le_rfl #align set.proj_Ici_self Set.projIci_self @[simp] theorem projIic_self (b : α) : projIic b b = ⟨b, le_rfl⟩ := projIic_of_le le_rfl #align set.proj_Iic_self Set.projIic_self @[simp] theorem projIcc_left : projIcc a b h a = ⟨a, left_mem_Icc.2 h⟩ := projIcc_of_le_left h le_rfl #align set.proj_Icc_left Set.projIcc_left @[simp] theorem projIcc_right : projIcc a b h b = ⟨b, right_mem_Icc.2 h⟩ := projIcc_of_right_le h le_rfl #align set.proj_Icc_right Set.projIcc_right theorem projIci_eq_self : projIci a x = ⟨a, le_rfl⟩ ↔ x ≤ a := by simp [projIci, Subtype.ext_iff] #align set.proj_Ici_eq_self Set.projIci_eq_self theorem projIic_eq_self : projIic b x = ⟨b, le_rfl⟩ ↔ b ≤ x := by simp [projIic, Subtype.ext_iff] #align set.proj_Iic_eq_self Set.projIic_eq_self theorem projIcc_eq_left (h : a < b) : projIcc a b h.le x = ⟨a, left_mem_Icc.mpr h.le⟩ ↔ x ≤ a := by simp [projIcc, Subtype.ext_iff, h.not_le] #align set.proj_Icc_eq_left Set.projIcc_eq_left theorem projIcc_eq_right (h : a < b) : projIcc a b h.le x = ⟨b, right_mem_Icc.2 h.le⟩ ↔ b ≤ x := by simp [projIcc, Subtype.ext_iff, max_min_distrib_left, h.le, h.not_le] #align set.proj_Icc_eq_right Set.projIcc_eq_right theorem projIci_of_mem (hx : x ∈ Ici a) : projIci a x = ⟨x, hx⟩ := by simpa [projIci] #align set.proj_Ici_of_mem Set.projIci_of_mem
Mathlib/Order/Interval/Set/ProjIcc.lean
116
116
theorem projIic_of_mem (hx : x ∈ Iic b) : projIic b x = ⟨x, hx⟩ := by
simpa [projIic]
[ " projIcc a b h x = ⟨a, ⋯⟩", " projIcc a b h x = ⟨b, ⋯⟩", " projIci a x = ⟨a, ⋯⟩ ↔ x ≤ a", " projIic b x = ⟨b, ⋯⟩ ↔ b ≤ x", " projIcc a b ⋯ x = ⟨a, ⋯⟩ ↔ x ≤ a", " projIcc a b ⋯ x = ⟨b, ⋯⟩ ↔ b ≤ x", " projIci a x = ⟨x, hx⟩", " projIic b x = ⟨x, hx⟩" ]
[ " projIcc a b h x = ⟨a, ⋯⟩", " projIcc a b h x = ⟨b, ⋯⟩", " projIci a x = ⟨a, ⋯⟩ ↔ x ≤ a", " projIic b x = ⟨b, ⋯⟩ ↔ b ≤ x", " projIcc a b ⋯ x = ⟨a, ⋯⟩ ↔ x ≤ a", " projIcc a b ⋯ x = ⟨b, ⋯⟩ ↔ b ≤ x", " projIci a x = ⟨x, hx⟩" ]
import Mathlib.MeasureTheory.Function.SimpleFunc import Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable #align_import measure_theory.function.simple_func_dense from "leanprover-community/mathlib"@"7317149f12f55affbc900fc873d0d422485122b9" open Set Function Filter TopologicalSpace ENNReal EMetric Finset open scoped Classical open Topology ENNReal MeasureTheory variable {α β ι E F 𝕜 : Type*} noncomputable section namespace MeasureTheory local infixr:25 " →ₛ " => SimpleFunc namespace SimpleFunc variable [MeasurableSpace α] [PseudoEMetricSpace α] [OpensMeasurableSpace α] noncomputable def nearestPtInd (e : ℕ → α) : ℕ → α →ₛ ℕ | 0 => const α 0 | N + 1 => piecewise (⋂ k ≤ N, { x | edist (e (N + 1)) x < edist (e k) x }) (MeasurableSet.iInter fun _ => MeasurableSet.iInter fun _ => measurableSet_lt measurable_edist_right measurable_edist_right) (const α <| N + 1) (nearestPtInd e N) #align measure_theory.simple_func.nearest_pt_ind MeasureTheory.SimpleFunc.nearestPtInd noncomputable def nearestPt (e : ℕ → α) (N : ℕ) : α →ₛ α := (nearestPtInd e N).map e #align measure_theory.simple_func.nearest_pt MeasureTheory.SimpleFunc.nearestPt @[simp] theorem nearestPtInd_zero (e : ℕ → α) : nearestPtInd e 0 = const α 0 := rfl #align measure_theory.simple_func.nearest_pt_ind_zero MeasureTheory.SimpleFunc.nearestPtInd_zero @[simp] theorem nearestPt_zero (e : ℕ → α) : nearestPt e 0 = const α (e 0) := rfl #align measure_theory.simple_func.nearest_pt_zero MeasureTheory.SimpleFunc.nearestPt_zero theorem nearestPtInd_succ (e : ℕ → α) (N : ℕ) (x : α) : nearestPtInd e (N + 1) x = if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else nearestPtInd e N x := by simp only [nearestPtInd, coe_piecewise, Set.piecewise] congr simp #align measure_theory.simple_func.nearest_pt_ind_succ MeasureTheory.SimpleFunc.nearestPtInd_succ theorem nearestPtInd_le (e : ℕ → α) (N : ℕ) (x : α) : nearestPtInd e N x ≤ N := by induction' N with N ihN; · simp simp only [nearestPtInd_succ] split_ifs exacts [le_rfl, ihN.trans N.le_succ] #align measure_theory.simple_func.nearest_pt_ind_le MeasureTheory.SimpleFunc.nearestPtInd_le
Mathlib/MeasureTheory/Function/SimpleFuncDense.lean
102
113
theorem edist_nearestPt_le (e : ℕ → α) (x : α) {k N : ℕ} (hk : k ≤ N) : edist (nearestPt e N x) x ≤ edist (e k) x := by
induction' N with N ihN generalizing k · simp [nonpos_iff_eq_zero.1 hk, le_refl] · simp only [nearestPt, nearestPtInd_succ, map_apply] split_ifs with h · rcases hk.eq_or_lt with (rfl | hk) exacts [le_rfl, (h k (Nat.lt_succ_iff.1 hk)).le] · push_neg at h rcases h with ⟨l, hlN, hxl⟩ rcases hk.eq_or_lt with (rfl | hk) exacts [(ihN hlN).trans hxl, ihN (Nat.lt_succ_iff.1 hk)]
[ " ↑(nearestPtInd e (N + 1)) x = if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else ↑(nearestPtInd e N) x", " (if x ∈ ⋂ k, ⋂ (_ : k ≤ N), {x | edist (e (N + 1)) x < edist (e k) x} then ↑(const α (N + 1)) x\n else ↑(nearestPtInd e N) x) =\n if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N +...
[ " ↑(nearestPtInd e (N + 1)) x = if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else ↑(nearestPtInd e N) x", " (if x ∈ ⋂ k, ⋂ (_ : k ≤ N), {x | edist (e (N + 1)) x < edist (e k) x} then ↑(const α (N + 1)) x\n else ↑(nearestPtInd e N) x) =\n if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N +...
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : ℕ} [hp_prime : Fact p.Prime] section RingHoms variable (p) (r : ℚ) def modPart : ℤ := r.num * gcdA r.den p % p #align padic_int.mod_part PadicInt.modPart variable {p} theorem modPart_lt_p : modPart p r < p := by convert Int.emod_lt _ _ · simp · exact mod_cast hp_prime.1.ne_zero #align padic_int.mod_part_lt_p PadicInt.modPart_lt_p theorem modPart_nonneg : 0 ≤ modPart p r := Int.emod_nonneg _ <| mod_cast hp_prime.1.ne_zero #align padic_int.mod_part_nonneg PadicInt.modPart_nonneg theorem isUnit_den (r : ℚ) (h : ‖(r : ℚ_[p])‖ ≤ 1) : IsUnit (r.den : ℤ_[p]) := by rw [isUnit_iff] apply le_antisymm (r.den : ℤ_[p]).2 rw [← not_lt, coe_natCast] intro norm_denom_lt have hr : ‖(r * r.den : ℚ_[p])‖ = ‖(r.num : ℚ_[p])‖ := by congr rw_mod_cast [@Rat.mul_den_eq_num r] rw [padicNormE.mul] at hr have key : ‖(r.num : ℚ_[p])‖ < 1 := by calc _ = _ := hr.symm _ < 1 * 1 := mul_lt_mul' h norm_denom_lt (norm_nonneg _) zero_lt_one _ = 1 := mul_one 1 have : ↑p ∣ r.num ∧ (p : ℤ) ∣ r.den := by simp only [← norm_int_lt_one_iff_dvd, ← padic_norm_e_of_padicInt] exact ⟨key, norm_denom_lt⟩ apply hp_prime.1.not_dvd_one rwa [← r.reduced.gcd_eq_one, Nat.dvd_gcd_iff, ← Int.natCast_dvd, ← Int.natCast_dvd_natCast] #align padic_int.is_unit_denom PadicInt.isUnit_den theorem norm_sub_modPart_aux (r : ℚ) (h : ‖(r : ℚ_[p])‖ ≤ 1) : ↑p ∣ r.num - r.num * r.den.gcdA p % p * ↑r.den := by rw [← ZMod.intCast_zmod_eq_zero_iff_dvd] simp only [Int.cast_natCast, ZMod.natCast_mod, Int.cast_mul, Int.cast_sub] have := congr_arg (fun x => x % p : ℤ → ZMod p) (gcd_eq_gcd_ab r.den p) simp only [Int.cast_natCast, CharP.cast_eq_zero, EuclideanDomain.mod_zero, Int.cast_add, Int.cast_mul, zero_mul, add_zero] at this push_cast rw [mul_right_comm, mul_assoc, ← this] suffices rdcp : r.den.Coprime p by rw [rdcp.gcd_eq_one] simp only [mul_one, cast_one, sub_self] apply Coprime.symm apply (coprime_or_dvd_of_prime hp_prime.1 _).resolve_right rw [← Int.natCast_dvd_natCast, ← norm_int_lt_one_iff_dvd, not_lt] apply ge_of_eq rw [← isUnit_iff] exact isUnit_den r h #align padic_int.norm_sub_mod_part_aux PadicInt.norm_sub_modPart_aux
Mathlib/NumberTheory/Padics/RingHoms.lean
124
134
theorem norm_sub_modPart (h : ‖(r : ℚ_[p])‖ ≤ 1) : ‖(⟨r, h⟩ - modPart p r : ℤ_[p])‖ < 1 := by
let n := modPart p r rw [norm_lt_one_iff_dvd, ← (isUnit_den r h).dvd_mul_right] suffices ↑p ∣ r.num - n * r.den by convert (Int.castRingHom ℤ_[p]).map_dvd this simp only [sub_mul, Int.cast_natCast, eq_intCast, Int.cast_mul, sub_left_inj, Int.cast_sub] apply Subtype.coe_injective simp only [coe_mul, Subtype.coe_mk, coe_natCast] rw_mod_cast [@Rat.mul_den_eq_num r] rfl exact norm_sub_modPart_aux r h
[ " modPart p r < ↑p", " ↑p = |↑p|", " ↑p ≠ 0", " IsUnit ↑r.den", " ‖↑r.den‖ = 1", " 1 ≤ ‖↑↑r.den‖", " ¬‖↑r.den‖ < 1", " False", " ‖↑r * ↑r.den‖ = ‖↑r.num‖", " ↑r * ↑r.den = ↑r.num", " ‖↑r.num‖ < 1", " ↑p ∣ r.num ∧ ↑p ∣ ↑r.den", " ‖↑↑r.num‖ < 1 ∧ ‖↑↑↑r.den‖ < 1", " p ∣ 1", " ↑p ∣ r.num - r...
[ " modPart p r < ↑p", " ↑p = |↑p|", " ↑p ≠ 0", " IsUnit ↑r.den", " ‖↑r.den‖ = 1", " 1 ≤ ‖↑↑r.den‖", " ¬‖↑r.den‖ < 1", " False", " ‖↑r * ↑r.den‖ = ‖↑r.num‖", " ↑r * ↑r.den = ↑r.num", " ‖↑r.num‖ < 1", " ↑p ∣ r.num ∧ ↑p ∣ ↑r.den", " ‖↑↑r.num‖ < 1 ∧ ‖↑↑↑r.den‖ < 1", " p ∣ 1", " ↑p ∣ r.num - r...
import Mathlib.Analysis.Calculus.TangentCone import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics #align_import analysis.calculus.fderiv.basic from "leanprover-community/mathlib"@"41bef4ae1254365bc190aee63b947674d2977f01" open Filter Asymptotics ContinuousLinearMap Set Metric open scoped Classical open Topology NNReal Filter Asymptotics ENNReal noncomputable section section variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace 𝕜 G'] @[mk_iff hasFDerivAtFilter_iff_isLittleO] structure HasFDerivAtFilter (f : E → F) (f' : E →L[𝕜] F) (x : E) (L : Filter E) : Prop where of_isLittleO :: isLittleO : (fun x' => f x' - f x - f' (x' - x)) =o[L] fun x' => x' - x #align has_fderiv_at_filter HasFDerivAtFilter @[fun_prop] def HasFDerivWithinAt (f : E → F) (f' : E →L[𝕜] F) (s : Set E) (x : E) := HasFDerivAtFilter f f' x (𝓝[s] x) #align has_fderiv_within_at HasFDerivWithinAt @[fun_prop] def HasFDerivAt (f : E → F) (f' : E →L[𝕜] F) (x : E) := HasFDerivAtFilter f f' x (𝓝 x) #align has_fderiv_at HasFDerivAt @[fun_prop] def HasStrictFDerivAt (f : E → F) (f' : E →L[𝕜] F) (x : E) := (fun p : E × E => f p.1 - f p.2 - f' (p.1 - p.2)) =o[𝓝 (x, x)] fun p : E × E => p.1 - p.2 #align has_strict_fderiv_at HasStrictFDerivAt variable (𝕜) @[fun_prop] def DifferentiableWithinAt (f : E → F) (s : Set E) (x : E) := ∃ f' : E →L[𝕜] F, HasFDerivWithinAt f f' s x #align differentiable_within_at DifferentiableWithinAt @[fun_prop] def DifferentiableAt (f : E → F) (x : E) := ∃ f' : E →L[𝕜] F, HasFDerivAt f f' x #align differentiable_at DifferentiableAt irreducible_def fderivWithin (f : E → F) (s : Set E) (x : E) : E →L[𝕜] F := if 𝓝[s \ {x}] x = ⊥ then 0 else if h : ∃ f', HasFDerivWithinAt f f' s x then Classical.choose h else 0 #align fderiv_within fderivWithin irreducible_def fderiv (f : E → F) (x : E) : E →L[𝕜] F := if h : ∃ f', HasFDerivAt f f' x then Classical.choose h else 0 #align fderiv fderiv @[fun_prop] def DifferentiableOn (f : E → F) (s : Set E) := ∀ x ∈ s, DifferentiableWithinAt 𝕜 f s x #align differentiable_on DifferentiableOn @[fun_prop] def Differentiable (f : E → F) := ∀ x, DifferentiableAt 𝕜 f x #align differentiable Differentiable variable {𝕜} variable {f f₀ f₁ g : E → F} variable {f' f₀' f₁' g' : E →L[𝕜] F} variable (e : E →L[𝕜] F) variable {x : E} variable {s t : Set E} variable {L L₁ L₂ : Filter E} theorem fderivWithin_zero_of_isolated (h : 𝓝[s \ {x}] x = ⊥) : fderivWithin 𝕜 f s x = 0 := by rw [fderivWithin, if_pos h] theorem fderivWithin_zero_of_nmem_closure (h : x ∉ closure s) : fderivWithin 𝕜 f s x = 0 := by apply fderivWithin_zero_of_isolated simp only [mem_closure_iff_nhdsWithin_neBot, neBot_iff, Ne, Classical.not_not] at h rw [eq_bot_iff, ← h] exact nhdsWithin_mono _ diff_subset
Mathlib/Analysis/Calculus/FDeriv/Basic.lean
225
228
theorem fderivWithin_zero_of_not_differentiableWithinAt (h : ¬DifferentiableWithinAt 𝕜 f s x) : fderivWithin 𝕜 f s x = 0 := by
have : ¬∃ f', HasFDerivWithinAt f f' s x := h simp [fderivWithin, this]
[ " fderivWithin 𝕜 f s x = 0", " 𝓝[s \\ {x}] x = ⊥", " 𝓝[s \\ {x}] x ≤ 𝓝[s] x" ]
[ " fderivWithin 𝕜 f s x = 0", " 𝓝[s \\ {x}] x = ⊥", " 𝓝[s \\ {x}] x ≤ 𝓝[s] x" ]
import Mathlib.Algebra.Module.Submodule.Lattice import Mathlib.Data.ZMod.Basic import Mathlib.Order.OmegaCompletePartialOrder variable {n : ℕ} {M M₁ : Type*} abbrev AddCommMonoid.zmodModule [NeZero n] [AddCommMonoid M] (h : ∀ (x : M), n • x = 0) : Module (ZMod n) M := by have h_mod (c : ℕ) (x : M) : (c % n) • x = c • x := by suffices (c % n + c / n * n) • x = c • x by rwa [add_nsmul, mul_nsmul, h, add_zero] at this rw [Nat.mod_add_div'] have := NeZero.ne n match n with | n + 1 => exact { smul := fun (c : Fin _) x ↦ c.val • x smul_zero := fun _ ↦ nsmul_zero _ zero_smul := fun _ ↦ zero_nsmul _ smul_add := fun _ _ _ ↦ nsmul_add _ _ _ one_smul := fun _ ↦ (h_mod _ _).trans <| one_nsmul _ add_smul := fun _ _ _ ↦ (h_mod _ _).trans <| add_nsmul _ _ _ mul_smul := fun _ _ _ ↦ (h_mod _ _).trans <| mul_nsmul' _ _ _ } abbrev AddCommGroup.zmodModule {G : Type*} [AddCommGroup G] (h : ∀ (x : G), n • x = 0) : Module (ZMod n) G := match n with | 0 => AddCommGroup.intModule G | _ + 1 => AddCommMonoid.zmodModule h variable {F S : Type*} [AddCommGroup M] [AddCommGroup M₁] [FunLike F M M₁] [AddMonoidHomClass F M M₁] [Module (ZMod n) M] [Module (ZMod n) M₁] [SetLike S M] [AddSubgroupClass S M] {x : M} {K : S} namespace ZMod theorem map_smul (f : F) (c : ZMod n) (x : M) : f (c • x) = c • f x := by rw [← ZMod.intCast_zmod_cast c] exact map_intCast_smul f _ _ (cast c) x
Mathlib/Data/ZMod/Module.lean
54
56
theorem smul_mem (hx : x ∈ K) (c : ZMod n) : c • x ∈ K := by
rw [← ZMod.intCast_zmod_cast c, ← zsmul_eq_smul_cast] exact zsmul_mem hx (cast c)
[ " Module (ZMod n) M", " (c % n) • x = c • x", " (c % n + c / n * n) • x = c • x", " Module (ZMod (n + 1)) M", " f (c • x) = c • f x", " f (↑c.cast • x) = ↑c.cast • f x", " c • x ∈ K", " c.cast • x ∈ K" ]
[ " Module (ZMod n) M", " (c % n) • x = c • x", " (c % n + c / n * n) • x = c • x", " Module (ZMod (n + 1)) M", " f (c • x) = c • f x", " f (↑c.cast • x) = ↑c.cast • f x" ]
import Mathlib.MeasureTheory.Measure.MeasureSpace import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic #align_import measure_theory.measure.open_pos from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Topology ENNReal MeasureTheory open Set Function Filter namespace MeasureTheory namespace Measure section Basic variable {X Y : Type*} [TopologicalSpace X] {m : MeasurableSpace X} [TopologicalSpace Y] [T2Space Y] (μ ν : Measure X) class IsOpenPosMeasure : Prop where open_pos : ∀ U : Set X, IsOpen U → U.Nonempty → μ U ≠ 0 #align measure_theory.measure.is_open_pos_measure MeasureTheory.Measure.IsOpenPosMeasure variable [IsOpenPosMeasure μ] {s U F : Set X} {x : X} theorem _root_.IsOpen.measure_ne_zero (hU : IsOpen U) (hne : U.Nonempty) : μ U ≠ 0 := IsOpenPosMeasure.open_pos U hU hne #align is_open.measure_ne_zero IsOpen.measure_ne_zero theorem _root_.IsOpen.measure_pos (hU : IsOpen U) (hne : U.Nonempty) : 0 < μ U := (hU.measure_ne_zero μ hne).bot_lt #align is_open.measure_pos IsOpen.measure_pos instance (priority := 100) [Nonempty X] : NeZero μ := ⟨measure_univ_pos.mp <| isOpen_univ.measure_pos μ univ_nonempty⟩ theorem _root_.IsOpen.measure_pos_iff (hU : IsOpen U) : 0 < μ U ↔ U.Nonempty := ⟨fun h => nonempty_iff_ne_empty.2 fun he => h.ne' <| he.symm ▸ measure_empty, hU.measure_pos μ⟩ #align is_open.measure_pos_iff IsOpen.measure_pos_iff
Mathlib/MeasureTheory/Measure/OpenPos.lean
57
59
theorem _root_.IsOpen.measure_eq_zero_iff (hU : IsOpen U) : μ U = 0 ↔ U = ∅ := by
simpa only [not_lt, nonpos_iff_eq_zero, not_nonempty_iff_eq_empty] using not_congr (hU.measure_pos_iff μ)
[ " μ U = 0 ↔ U = ∅" ]
[]
import Mathlib.Analysis.Calculus.Deriv.Pow import Mathlib.Analysis.Calculus.Deriv.Inv #align_import analysis.calculus.deriv.zpow from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" universe u v w open scoped Classical open Topology Filter open Filter Asymptotics Set variable {𝕜 : Type u} [NontriviallyNormedField 𝕜] variable {E : Type v} [NormedAddCommGroup E] [NormedSpace 𝕜 E] variable {x : 𝕜} variable {s : Set 𝕜} variable {m : ℤ} theorem hasStrictDerivAt_zpow (m : ℤ) (x : 𝕜) (h : x ≠ 0 ∨ 0 ≤ m) : HasStrictDerivAt (fun x => x ^ m) ((m : 𝕜) * x ^ (m - 1)) x := by have : ∀ m : ℤ, 0 < m → HasStrictDerivAt (· ^ m) ((m : 𝕜) * x ^ (m - 1)) x := fun m hm ↦ by lift m to ℕ using hm.le simp only [zpow_natCast, Int.cast_natCast] convert hasStrictDerivAt_pow m x using 2 rw [← Int.ofNat_one, ← Int.ofNat_sub, zpow_natCast] norm_cast at hm rcases lt_trichotomy m 0 with (hm | hm | hm) · have hx : x ≠ 0 := h.resolve_right hm.not_le have := (hasStrictDerivAt_inv ?_).scomp _ (this (-m) (neg_pos.2 hm)) <;> [skip; exact zpow_ne_zero _ hx] simp only [(· ∘ ·), zpow_neg, one_div, inv_inv, smul_eq_mul] at this convert this using 1 rw [sq, mul_inv, inv_inv, Int.cast_neg, neg_mul, neg_mul_neg, ← zpow_add₀ hx, mul_assoc, ← zpow_add₀ hx] congr abel · simp only [hm, zpow_zero, Int.cast_zero, zero_mul, hasStrictDerivAt_const] · exact this m hm #align has_strict_deriv_at_zpow hasStrictDerivAt_zpow theorem hasDerivAt_zpow (m : ℤ) (x : 𝕜) (h : x ≠ 0 ∨ 0 ≤ m) : HasDerivAt (fun x => x ^ m) ((m : 𝕜) * x ^ (m - 1)) x := (hasStrictDerivAt_zpow m x h).hasDerivAt #align has_deriv_at_zpow hasDerivAt_zpow theorem hasDerivWithinAt_zpow (m : ℤ) (x : 𝕜) (h : x ≠ 0 ∨ 0 ≤ m) (s : Set 𝕜) : HasDerivWithinAt (fun x => x ^ m) ((m : 𝕜) * x ^ (m - 1)) s x := (hasDerivAt_zpow m x h).hasDerivWithinAt #align has_deriv_within_at_zpow hasDerivWithinAt_zpow theorem differentiableAt_zpow : DifferentiableAt 𝕜 (fun x => x ^ m) x ↔ x ≠ 0 ∨ 0 ≤ m := ⟨fun H => NormedField.continuousAt_zpow.1 H.continuousAt, fun H => (hasDerivAt_zpow m x H).differentiableAt⟩ #align differentiable_at_zpow differentiableAt_zpow theorem differentiableWithinAt_zpow (m : ℤ) (x : 𝕜) (h : x ≠ 0 ∨ 0 ≤ m) : DifferentiableWithinAt 𝕜 (fun x => x ^ m) s x := (differentiableAt_zpow.mpr h).differentiableWithinAt #align differentiable_within_at_zpow differentiableWithinAt_zpow theorem differentiableOn_zpow (m : ℤ) (s : Set 𝕜) (h : (0 : 𝕜) ∉ s ∨ 0 ≤ m) : DifferentiableOn 𝕜 (fun x => x ^ m) s := fun x hxs => differentiableWithinAt_zpow m x <| h.imp_left <| ne_of_mem_of_not_mem hxs #align differentiable_on_zpow differentiableOn_zpow
Mathlib/Analysis/Calculus/Deriv/ZPow.lean
86
92
theorem deriv_zpow (m : ℤ) (x : 𝕜) : deriv (fun x => x ^ m) x = m * x ^ (m - 1) := by
by_cases H : x ≠ 0 ∨ 0 ≤ m · exact (hasDerivAt_zpow m x H).deriv · rw [deriv_zero_of_not_differentiableAt (mt differentiableAt_zpow.1 H)] push_neg at H rcases H with ⟨rfl, hm⟩ rw [zero_zpow _ ((sub_one_lt _).trans hm).ne, mul_zero]
[ " HasStrictDerivAt (fun x => x ^ m) (↑m * x ^ (m - 1)) x", " HasStrictDerivAt (fun x => x ^ ↑m) (↑↑m * x ^ (↑m - 1)) x", " HasStrictDerivAt (fun x => x ^ m) (↑m * x ^ (↑m - 1)) x", " x ^ (↑m - 1) = x ^ (m - 1)", " 1 ≤ m", " x ^ (-m) ≠ 0", " ↑m * x ^ (m - 1) = ↑(-m) * x ^ (-m - 1) * -((x ^ m)⁻¹ ^ 2)⁻¹", ...
[ " HasStrictDerivAt (fun x => x ^ m) (↑m * x ^ (m - 1)) x", " HasStrictDerivAt (fun x => x ^ ↑m) (↑↑m * x ^ (↑m - 1)) x", " HasStrictDerivAt (fun x => x ^ m) (↑m * x ^ (↑m - 1)) x", " x ^ (↑m - 1) = x ^ (m - 1)", " 1 ≤ m", " x ^ (-m) ≠ 0", " ↑m * x ^ (m - 1) = ↑(-m) * x ^ (-m - 1) * -((x ^ m)⁻¹ ^ 2)⁻¹", ...
import Batteries.Classes.Order namespace Batteries.PairingHeapImp inductive Heap (α : Type u) where | nil : Heap α | node (a : α) (child sibling : Heap α) : Heap α deriving Repr def Heap.size : Heap α → Nat | .nil => 0 | .node _ c s => c.size + 1 + s.size def Heap.singleton (a : α) : Heap α := .node a .nil .nil def Heap.isEmpty : Heap α → Bool | .nil => true | _ => false @[specialize] def Heap.merge (le : α → α → Bool) : Heap α → Heap α → Heap α | .nil, .nil => .nil | .nil, .node a₂ c₂ _ => .node a₂ c₂ .nil | .node a₁ c₁ _, .nil => .node a₁ c₁ .nil | .node a₁ c₁ _, .node a₂ c₂ _ => if le a₁ a₂ then .node a₁ (.node a₂ c₂ c₁) .nil else .node a₂ (.node a₁ c₁ c₂) .nil @[specialize] def Heap.combine (le : α → α → Bool) : Heap α → Heap α | h₁@(.node _ _ h₂@(.node _ _ s)) => merge le (merge le h₁ h₂) (s.combine le) | h => h @[inline] def Heap.headD (a : α) : Heap α → α | .nil => a | .node a _ _ => a @[inline] def Heap.head? : Heap α → Option α | .nil => none | .node a _ _ => some a @[inline] def Heap.deleteMin (le : α → α → Bool) : Heap α → Option (α × Heap α) | .nil => none | .node a c _ => (a, combine le c) @[inline] def Heap.tail? (le : α → α → Bool) (h : Heap α) : Option (Heap α) := deleteMin le h |>.map (·.snd) @[inline] def Heap.tail (le : α → α → Bool) (h : Heap α) : Heap α := tail? le h |>.getD .nil inductive Heap.NoSibling : Heap α → Prop | nil : NoSibling .nil | node (a c) : NoSibling (.node a c .nil) instance : Decidable (Heap.NoSibling s) := match s with | .nil => isTrue .nil | .node a c .nil => isTrue (.node a c) | .node _ _ (.node _ _ _) => isFalse nofun
.lake/packages/batteries/Batteries/Data/PairingHeap.lean
90
93
theorem Heap.noSibling_merge (le) (s₁ s₂ : Heap α) : (s₁.merge le s₂).NoSibling := by
unfold merge (split <;> try split) <;> constructor
[ " (merge le s₁ s₂).NoSibling", " (match s₁, s₂ with\n | nil, nil => nil\n | nil, node a₂ c₂ sibling => node a₂ c₂ nil\n | node a₁ c₁ sibling, nil => node a₁ c₁ nil\n | node a₁ c₁ sibling, node a₂ c₂ sibling_1 =>\n if le a₁ a₂ = true then node a₁ (node a₂ c₂ c₁) nil else node a₂ (node a₁ c₁ c₂) ni...
[]
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] 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 #align add_tsub_cancel_of_le add_tsub_cancel_of_le theorem tsub_add_cancel_of_le (h : a ≤ b) : b - a + a = b := by rw [add_comm] exact add_tsub_cancel_of_le h #align tsub_add_cancel_of_le tsub_add_cancel_of_le theorem add_le_of_le_tsub_right_of_le (h : b ≤ c) (h2 : a ≤ c - b) : a + b ≤ c := (add_le_add_right h2 b).trans_eq <| tsub_add_cancel_of_le h #align add_le_of_le_tsub_right_of_le add_le_of_le_tsub_right_of_le theorem add_le_of_le_tsub_left_of_le (h : a ≤ c) (h2 : b ≤ c - a) : a + b ≤ c := (add_le_add_left h2 a).trans_eq <| add_tsub_cancel_of_le h #align add_le_of_le_tsub_left_of_le add_le_of_le_tsub_left_of_le theorem tsub_le_tsub_iff_right (h : c ≤ b) : a - c ≤ b - c ↔ a ≤ b := by rw [tsub_le_iff_right, tsub_add_cancel_of_le h] #align tsub_le_tsub_iff_right tsub_le_tsub_iff_right theorem tsub_left_inj (h1 : c ≤ a) (h2 : c ≤ b) : a - c = b - c ↔ a = b := by simp_rw [le_antisymm_iff, tsub_le_tsub_iff_right h1, tsub_le_tsub_iff_right h2] #align tsub_left_inj tsub_left_inj theorem tsub_inj_left (h₁ : a ≤ b) (h₂ : a ≤ c) : b - a = c - a → b = c := (tsub_left_inj h₁ h₂).1 #align tsub_inj_left tsub_inj_left
Mathlib/Algebra/Order/Sub/Canonical.lean
57
60
theorem lt_of_tsub_lt_tsub_right_of_le (h : c ≤ b) (h2 : a - c < b - c) : a < b := by
refine ((tsub_le_tsub_iff_right h).mp h2.le).lt_of_ne ?_ rintro rfl exact h2.false
[ " a + (b - a) = b", " a + (b - a) ≤ b", " a + (a + c - a) ≤ a + c", " b - a + a = b", " a - c ≤ b - c ↔ a ≤ b", " a - c = b - c ↔ a = b", " a < b", " a ≠ b", " False" ]
[ " a + (b - a) = b", " a + (b - a) ≤ b", " a + (a + c - a) ≤ a + c", " b - a + a = b", " a - c ≤ b - c ↔ a ≤ b", " a - c = b - c ↔ a = b" ]
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]
Mathlib/NumberTheory/BernoulliPolynomials.lean
76
82
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]
[ " bernoulli n = ∑ i ∈ range (n + 1), (monomial i) (_root_.bernoulli (n - i) * ↑(n.choose i))", " ∑ i ∈ range (n + 1), (monomial (n - i)) (_root_.bernoulli i * ↑(n.choose i)) =\n ∑ j ∈ range (n + 1), (monomial (n - j)) (_root_.bernoulli (n - (n - j)) * ↑(n.choose (n - j)))", " ∀ x ∈ range (n + 1),\n (monom...
[ " bernoulli n = ∑ i ∈ range (n + 1), (monomial i) (_root_.bernoulli (n - i) * ↑(n.choose i))", " ∑ i ∈ range (n + 1), (monomial (n - i)) (_root_.bernoulli i * ↑(n.choose i)) =\n ∑ j ∈ range (n + 1), (monomial (n - j)) (_root_.bernoulli (n - (n - j)) * ↑(n.choose (n - j)))", " ∀ x ∈ range (n + 1),\n (monom...
import Mathlib.Data.Fintype.Basic import Mathlib.GroupTheory.Perm.Sign import Mathlib.Logic.Equiv.Defs #align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f" namespace Equiv variable {α β : Type*} [Finite α] noncomputable def toCompl {p q : α → Prop} (e : { x // p x } ≃ { x // q x }) : { x // ¬p x } ≃ { x // ¬q x } := by apply Classical.choice cases nonempty_fintype α classical exact Fintype.card_eq.mp <| Fintype.card_compl_eq_card_compl _ _ <| Fintype.card_congr e #align equiv.to_compl Equiv.toCompl variable {p q : α → Prop} [DecidablePred p] [DecidablePred q] noncomputable abbrev extendSubtype (e : { x // p x } ≃ { x // q x }) : Perm α := subtypeCongr e e.toCompl #align equiv.extend_subtype Equiv.extendSubtype theorem extendSubtype_apply_of_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : p x) : e.extendSubtype x = e ⟨x, hx⟩ := by dsimp only [extendSubtype] simp only [subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply] rw [sumCompl_apply_symm_of_pos _ _ hx, Sum.map_inl, sumCompl_apply_inl] #align equiv.extend_subtype_apply_of_mem Equiv.extendSubtype_apply_of_mem
Mathlib/Logic/Equiv/Fintype.lean
132
135
theorem extendSubtype_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : p x) : q (e.extendSubtype x) := by
convert (e ⟨x, hx⟩).2 rw [e.extendSubtype_apply_of_mem _ hx]
[ " { x // ¬p x } ≃ { x // ¬q x }", " Nonempty ({ x // ¬p x } ≃ { x // ¬q x })", " e.extendSubtype x = ↑(e ⟨x, hx⟩)", " (e.subtypeCongr e.toCompl) x = ↑(e ⟨x, hx⟩)", " (sumCompl fun x => q x) (Sum.map (⇑e) (⇑e.toCompl) ((sumCompl fun x => p x).symm x)) = ↑(e ⟨x, hx⟩)", " q (e.extendSubtype x)" ]
[ " { x // ¬p x } ≃ { x // ¬q x }", " Nonempty ({ x // ¬p x } ≃ { x // ¬q x })", " e.extendSubtype x = ↑(e ⟨x, hx⟩)", " (e.subtypeCongr e.toCompl) x = ↑(e ⟨x, hx⟩)", " (sumCompl fun x => q x) (Sum.map (⇑e) (⇑e.toCompl) ((sumCompl fun x => p x).symm x)) = ↑(e ⟨x, hx⟩)" ]
import Mathlib.Algebra.Order.Ring.Nat import Mathlib.Data.List.Chain #align_import data.bool.count from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1" namespace List @[simp] theorem count_not_add_count (l : List Bool) (b : Bool) : count (!b) l + count b l = length l := by -- Porting note: Proof re-written -- Old proof: simp only [length_eq_countP_add_countP (Eq (!b)), Bool.not_not_eq, count] simp only [length_eq_countP_add_countP (· == !b), count, add_right_inj] suffices (fun x => x == b) = (fun a => decide ¬(a == !b) = true) by rw [this] ext x; cases x <;> cases b <;> rfl #align list.count_bnot_add_count List.count_not_add_count @[simp] theorem count_add_count_not (l : List Bool) (b : Bool) : count b l + count (!b) l = length l := by rw [add_comm, count_not_add_count] #align list.count_add_count_bnot List.count_add_count_not @[simp] theorem count_false_add_count_true (l : List Bool) : count false l + count true l = length l := count_not_add_count l true #align list.count_ff_add_count_tt List.count_false_add_count_true @[simp] theorem count_true_add_count_false (l : List Bool) : count true l + count false l = length l := count_not_add_count l false #align list.count_tt_add_count_ff List.count_true_add_count_false theorem Chain.count_not : ∀ {b : Bool} {l : List Bool}, Chain (· ≠ ·) b l → count (!b) l = count b l + length l % 2 | b, [], _h => rfl | b, x :: l, h => by obtain rfl : b = !x := Bool.eq_not_iff.2 (rel_of_chain_cons h) rw [Bool.not_not, count_cons_self, count_cons_of_ne x.not_ne_self, Chain.count_not (chain_of_chain_cons h), length, add_assoc, Nat.mod_two_add_succ_mod_two] #align list.chain.count_bnot List.Chain.count_not namespace Chain' variable {l : List Bool} theorem count_not_eq_count (hl : Chain' (· ≠ ·) l) (h2 : Even (length l)) (b : Bool) : count (!b) l = count b l := by cases' l with x l · rfl rw [length_cons, Nat.even_add_one, Nat.not_even_iff] at h2 suffices count (!x) (x :: l) = count x (x :: l) by -- Porting note: old proof is -- cases b <;> cases x <;> try exact this; cases b <;> cases x <;> revert this <;> simp only [Bool.not_false, Bool.not_true] <;> intro this <;> (try exact this) <;> exact this.symm rw [count_cons_of_ne x.not_ne_self, hl.count_not, h2, count_cons_self] #align list.chain'.count_bnot_eq_count List.Chain'.count_not_eq_count theorem count_false_eq_count_true (hl : Chain' (· ≠ ·) l) (h2 : Even (length l)) : count false l = count true l := hl.count_not_eq_count h2 true #align list.chain'.count_ff_eq_count_tt List.Chain'.count_false_eq_count_true
Mathlib/Data/Bool/Count.lean
79
87
theorem count_not_le_count_add_one (hl : Chain' (· ≠ ·) l) (b : Bool) : count (!b) l ≤ count b l + 1 := by
cases' l with x l · exact zero_le _ obtain rfl | rfl : b = x ∨ b = !x := by simp only [Bool.eq_not_iff, em] · rw [count_cons_of_ne b.not_ne_self, count_cons_self, hl.count_not, add_assoc] exact add_le_add_left (Nat.mod_lt _ two_pos).le _ · rw [Bool.not_not, count_cons_self, count_cons_of_ne x.not_ne_self, hl.count_not] exact add_le_add_right (le_add_right le_rfl) _
[ " count (!b) l + count b l = l.length", " countP (fun x => x == b) l = countP (fun a => decide ¬(a == !b) = true) l", " (fun x => x == b) = fun a => decide ¬(a == !b) = true", " (x == b) = decide ¬(x == !b) = true", " (false == b) = decide ¬(false == !b) = true", " (true == b) = decide ¬(true == !b) = tru...
[ " count (!b) l + count b l = l.length", " countP (fun x => x == b) l = countP (fun a => decide ¬(a == !b) = true) l", " (fun x => x == b) = fun a => decide ¬(a == !b) = true", " (x == b) = decide ¬(x == !b) = true", " (false == b) = decide ¬(false == !b) = true", " (true == b) = decide ¬(true == !b) = tru...
import Mathlib.Algebra.Group.Commute.Basic import Mathlib.Data.Fintype.Card import Mathlib.GroupTheory.Perm.Basic #align_import group_theory.perm.support from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Equiv Finset namespace Equiv.Perm variable {α : Type*} section support variable [DecidableEq α] [Fintype α] {f g : Perm α} def support (f : Perm α) : Finset α := univ.filter fun x => f x ≠ x #align equiv.perm.support Equiv.Perm.support @[simp] theorem mem_support {x : α} : x ∈ f.support ↔ f x ≠ x := by rw [support, mem_filter, and_iff_right (mem_univ x)] #align equiv.perm.mem_support Equiv.Perm.mem_support theorem not_mem_support {x : α} : x ∉ f.support ↔ f x = x := by simp #align equiv.perm.not_mem_support Equiv.Perm.not_mem_support
Mathlib/GroupTheory/Perm/Support.lean
304
306
theorem coe_support_eq_set_support (f : Perm α) : (f.support : Set α) = { x | f x ≠ x } := by
ext simp
[ " x ∈ f.support ↔ f x ≠ x", " x ∉ f.support ↔ f x = x", " ↑f.support = {x | f x ≠ x}", " x✝ ∈ ↑f.support ↔ x✝ ∈ {x | f x ≠ x}" ]
[ " x ∈ f.support ↔ f x ≠ x", " x ∉ f.support ↔ f x = x" ]
import Mathlib.Analysis.Convex.Hull import Mathlib.LinearAlgebra.AffineSpace.Independent #align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Finset Set variable (𝕜 E : Type*) {ι : Type*} [OrderedRing 𝕜] [AddCommGroup E] [Module 𝕜 E] namespace Geometry -- TODO: update to new binder order? not sure what binder order is correct for `down_closed`. @[ext] structure SimplicialComplex where faces : Set (Finset E) not_empty_mem : ∅ ∉ faces indep : ∀ {s}, s ∈ faces → AffineIndependent 𝕜 ((↑) : s → E) down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ≠ ∅ → t ∈ faces inter_subset_convexHull : ∀ {s t}, s ∈ faces → t ∈ faces → convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E) #align geometry.simplicial_complex Geometry.SimplicialComplex namespace SimplicialComplex variable {𝕜 E} variable {K : SimplicialComplex 𝕜 E} {s t : Finset E} {x : E} instance : Membership (Finset E) (SimplicialComplex 𝕜 E) := ⟨fun s K => s ∈ K.faces⟩ def space (K : SimplicialComplex 𝕜 E) : Set E := ⋃ s ∈ K.faces, convexHull 𝕜 (s : Set E) #align geometry.simplicial_complex.space Geometry.SimplicialComplex.space -- Porting note: Expanded `∃ s ∈ K.faces` to get the type to match more closely with Lean 3 theorem mem_space_iff : x ∈ K.space ↔ ∃ s ∈ K.faces, x ∈ convexHull 𝕜 (s : Set E) := by simp [space] #align geometry.simplicial_complex.mem_space_iff Geometry.SimplicialComplex.mem_space_iff -- Porting note: Original proof was `:= subset_biUnion_of_mem hs` theorem convexHull_subset_space (hs : s ∈ K.faces) : convexHull 𝕜 ↑s ⊆ K.space := by convert subset_biUnion_of_mem hs rfl #align geometry.simplicial_complex.convex_hull_subset_space Geometry.SimplicialComplex.convexHull_subset_space protected theorem subset_space (hs : s ∈ K.faces) : (s : Set E) ⊆ K.space := (subset_convexHull 𝕜 _).trans <| convexHull_subset_space hs #align geometry.simplicial_complex.subset_space Geometry.SimplicialComplex.subset_space theorem convexHull_inter_convexHull (hs : s ∈ K.faces) (ht : t ∈ K.faces) : convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t = convexHull 𝕜 (s ∩ t : Set E) := (K.inter_subset_convexHull hs ht).antisymm <| subset_inter (convexHull_mono Set.inter_subset_left) <| convexHull_mono Set.inter_subset_right #align geometry.simplicial_complex.convex_hull_inter_convex_hull Geometry.SimplicialComplex.convexHull_inter_convexHull theorem disjoint_or_exists_inter_eq_convexHull (hs : s ∈ K.faces) (ht : t ∈ K.faces) : Disjoint (convexHull 𝕜 (s : Set E)) (convexHull 𝕜 ↑t) ∨ ∃ u ∈ K.faces, convexHull 𝕜 (s : Set E) ∩ convexHull 𝕜 ↑t = convexHull 𝕜 ↑u := by classical by_contra! h refine h.2 (s ∩ t) (K.down_closed hs inter_subset_left fun hst => h.1 <| disjoint_iff_inf_le.mpr <| (K.inter_subset_convexHull hs ht).trans ?_) ?_ · rw [← coe_inter, hst, coe_empty, convexHull_empty] rfl · rw [coe_inter, convexHull_inter_convexHull hs ht] #align geometry.simplicial_complex.disjoint_or_exists_inter_eq_convex_hull Geometry.SimplicialComplex.disjoint_or_exists_inter_eq_convexHull @[simps] def ofErase (faces : Set (Finset E)) (indep : ∀ s ∈ faces, AffineIndependent 𝕜 ((↑) : s → E)) (down_closed : ∀ s ∈ faces, ∀ t ⊆ s, t ∈ faces) (inter_subset_convexHull : ∀ᵉ (s ∈ faces) (t ∈ faces), convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E)) : SimplicialComplex 𝕜 E where faces := faces \ {∅} not_empty_mem h := h.2 (mem_singleton _) indep hs := indep _ hs.1 down_closed hs hts ht := ⟨down_closed _ hs.1 _ hts, ht⟩ inter_subset_convexHull hs ht := inter_subset_convexHull _ hs.1 _ ht.1 #align geometry.simplicial_complex.of_erase Geometry.SimplicialComplex.ofErase @[simps] def ofSubcomplex (K : SimplicialComplex 𝕜 E) (faces : Set (Finset E)) (subset : faces ⊆ K.faces) (down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ∈ faces) : SimplicialComplex 𝕜 E := { faces not_empty_mem := fun h => K.not_empty_mem (subset h) indep := fun hs => K.indep (subset hs) down_closed := fun hs hts _ => down_closed hs hts inter_subset_convexHull := fun hs ht => K.inter_subset_convexHull (subset hs) (subset ht) } #align geometry.simplicial_complex.of_subcomplex Geometry.SimplicialComplex.ofSubcomplex def vertices (K : SimplicialComplex 𝕜 E) : Set E := { x | {x} ∈ K.faces } #align geometry.simplicial_complex.vertices Geometry.SimplicialComplex.vertices theorem mem_vertices : x ∈ K.vertices ↔ {x} ∈ K.faces := Iff.rfl #align geometry.simplicial_complex.mem_vertices Geometry.SimplicialComplex.mem_vertices
Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean
158
162
theorem vertices_eq : K.vertices = ⋃ k ∈ K.faces, (k : Set E) := by
ext x refine ⟨fun h => mem_biUnion h <| mem_coe.2 <| mem_singleton_self x, fun h => ?_⟩ obtain ⟨s, hs, hx⟩ := mem_iUnion₂.1 h exact K.down_closed hs (Finset.singleton_subset_iff.2 <| mem_coe.1 hx) (singleton_ne_empty _)
[ " x ∈ K.space ↔ ∃ s ∈ K.faces, x ∈ (convexHull 𝕜) ↑s", " (convexHull 𝕜) ↑s ⊆ K.space", " (convexHull 𝕜) ↑s = (convexHull 𝕜) ↑s", " Disjoint ((convexHull 𝕜) ↑s) ((convexHull 𝕜) ↑t) ∨\n ∃ u ∈ K.faces, (convexHull 𝕜) ↑s ∩ (convexHull 𝕜) ↑t = (convexHull 𝕜) ↑u", " False", " (convexHull 𝕜) (↑s ∩ ↑...
[ " x ∈ K.space ↔ ∃ s ∈ K.faces, x ∈ (convexHull 𝕜) ↑s", " (convexHull 𝕜) ↑s ⊆ K.space", " (convexHull 𝕜) ↑s = (convexHull 𝕜) ↑s", " Disjoint ((convexHull 𝕜) ↑s) ((convexHull 𝕜) ↑t) ∨\n ∃ u ∈ K.faces, (convexHull 𝕜) ↑s ∩ (convexHull 𝕜) ↑t = (convexHull 𝕜) ↑u", " False", " (convexHull 𝕜) (↑s ∩ ↑...
import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Algebra.Group.ConjFinite import Mathlib.Algebra.Group.Subgroup.Finite import Mathlib.Data.Set.Card import Mathlib.GroupTheory.Subgroup.Center open MulAction ConjClasses variable (G : Type*) [Group G] theorem sum_conjClasses_card_eq_card [Fintype <| ConjClasses G] [Fintype G] [∀ x : ConjClasses G, Fintype x.carrier] : ∑ x : ConjClasses G, x.carrier.toFinset.card = Fintype.card G := by suffices (Σ x : ConjClasses G, x.carrier) ≃ G by simpa using (Fintype.card_congr this) simpa [carrier_eq_preimage_mk] using Equiv.sigmaFiberEquiv ConjClasses.mk theorem Group.sum_card_conj_classes_eq_card [Finite G] : ∑ᶠ x : ConjClasses G, x.carrier.ncard = Nat.card G := by classical cases nonempty_fintype G rw [Nat.card_eq_fintype_card, ← sum_conjClasses_card_eq_card, finsum_eq_sum_of_fintype] simp [Set.ncard_eq_toFinset_card'] theorem Group.nat_card_center_add_sum_card_noncenter_eq_card [Finite G] : Nat.card (Subgroup.center G) + ∑ᶠ x ∈ noncenter G, Nat.card x.carrier = Nat.card G := by classical cases nonempty_fintype G rw [@Nat.card_eq_fintype_card G, ← sum_conjClasses_card_eq_card, ← Finset.sum_sdiff (ConjClasses.noncenter G).toFinset.subset_univ] simp only [Nat.card_eq_fintype_card, Set.toFinset_card] congr 1 swap · convert finsum_cond_eq_sum_of_cond_iff _ _ simp [Set.mem_toFinset] calc Fintype.card (Subgroup.center G) = Fintype.card ((noncenter G)ᶜ : Set _) := Fintype.card_congr ((mk_bijOn G).equiv _) _ = Finset.card (Finset.univ \ (noncenter G).toFinset) := by rw [← Set.toFinset_card, Set.toFinset_compl, Finset.compl_eq_univ_sdiff] _ = _ := ?_ rw [Finset.card_eq_sum_ones] refine Finset.sum_congr rfl ?_ rintro ⟨g⟩ hg simp only [noncenter, Set.not_subsingleton_iff, Set.toFinset_setOf, Finset.mem_univ, true_and, forall_true_left, Finset.mem_sdiff, Finset.mem_filter, Set.not_nontrivial_iff] at hg rw [eq_comm, ← Set.toFinset_card, Finset.card_eq_one] exact ⟨g, Finset.coe_injective <| by simpa using hg.eq_singleton_of_mem mem_carrier_mk⟩
Mathlib/GroupTheory/ClassEquation.lean
72
81
theorem Group.card_center_add_sum_card_noncenter_eq_card (G) [Group G] [∀ x : ConjClasses G, Fintype x.carrier] [Fintype G] [Fintype <| Subgroup.center G] [Fintype <| noncenter G] : Fintype.card (Subgroup.center G) + ∑ x ∈ (noncenter G).toFinset, x.carrier.toFinset.card = Fintype.card G := by
convert Group.nat_card_center_add_sum_card_noncenter_eq_card G using 2 · simp · rw [← finsum_set_coe_eq_finsum_mem (noncenter G), finsum_eq_sum_of_fintype, ← Finset.sum_set_coe] simp · simp
[ " ∑ x : ConjClasses G, x.carrier.toFinset.card = Fintype.card G", " (x : ConjClasses G) × ↑x.carrier ≃ G", " ∑ᶠ (x : ConjClasses G), x.carrier.ncard = Nat.card G", " ∑ i : ConjClasses G, i.carrier.ncard = ∑ x : ConjClasses G, x.carrier.toFinset.card", " Nat.card ↥(Subgroup.center G) + ∑ᶠ (x : ConjClasses G)...
[ " ∑ x : ConjClasses G, x.carrier.toFinset.card = Fintype.card G", " (x : ConjClasses G) × ↑x.carrier ≃ G", " ∑ᶠ (x : ConjClasses G), x.carrier.ncard = Nat.card G", " ∑ i : ConjClasses G, i.carrier.ncard = ∑ x : ConjClasses G, x.carrier.toFinset.card", " Nat.card ↥(Subgroup.center G) + ∑ᶠ (x : ConjClasses G)...
import Mathlib.Analysis.NormedSpace.PiLp import Mathlib.Analysis.InnerProductSpace.PiL2 #align_import analysis.matrix from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section open scoped NNReal Matrix namespace Matrix variable {R l m n α β : Type*} [Fintype l] [Fintype m] [Fintype n] section LinfLinf protected def normedAddCommGroup [NormedAddCommGroup α] : NormedAddCommGroup (Matrix m n α) := Pi.normedAddCommGroup #align matrix.normed_add_comm_group Matrix.normedAddCommGroup section LinftyOp @[local instance] protected def linftyOpSeminormedAddCommGroup [SeminormedAddCommGroup α] : SeminormedAddCommGroup (Matrix m n α) := (by infer_instance : SeminormedAddCommGroup (m → PiLp 1 fun j : n => α)) #align matrix.linfty_op_seminormed_add_comm_group Matrix.linftyOpSeminormedAddCommGroup @[local instance] protected def linftyOpNormedAddCommGroup [NormedAddCommGroup α] : NormedAddCommGroup (Matrix m n α) := (by infer_instance : NormedAddCommGroup (m → PiLp 1 fun j : n => α)) #align matrix.linfty_op_normed_add_comm_group Matrix.linftyOpNormedAddCommGroup @[local instance] protected theorem linftyOpBoundedSMul [SeminormedRing R] [SeminormedAddCommGroup α] [Module R α] [BoundedSMul R α] : BoundedSMul R (Matrix m n α) := (by infer_instance : BoundedSMul R (m → PiLp 1 fun j : n => α)) @[local instance] protected def linftyOpNormedSpace [NormedField R] [SeminormedAddCommGroup α] [NormedSpace R α] : NormedSpace R (Matrix m n α) := (by infer_instance : NormedSpace R (m → PiLp 1 fun j : n => α)) #align matrix.linfty_op_normed_space Matrix.linftyOpNormedSpace section SeminormedAddCommGroup variable [SeminormedAddCommGroup α] theorem linfty_opNorm_def (A : Matrix m n α) : ‖A‖ = ((Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ : ℝ≥0) := by -- Porting note: added change ‖fun i => (WithLp.equiv 1 _).symm (A i)‖ = _ simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top] #align matrix.linfty_op_norm_def Matrix.linfty_opNorm_def @[deprecated (since := "2024-02-02")] alias linfty_op_norm_def := linfty_opNorm_def theorem linfty_opNNNorm_def (A : Matrix m n α) : ‖A‖₊ = (Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ := Subtype.ext <| linfty_opNorm_def A #align matrix.linfty_op_nnnorm_def Matrix.linfty_opNNNorm_def @[deprecated (since := "2024-02-02")] alias linfty_op_nnnorm_def := linfty_opNNNorm_def @[simp, nolint simpNF] -- Porting note: linter times out
Mathlib/Analysis/Matrix.lean
290
292
theorem linfty_opNNNorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ := by
rw [linfty_opNNNorm_def, Pi.nnnorm_def] simp
[ " SeminormedAddCommGroup (m → PiLp 1 fun j => α)", " NormedAddCommGroup (m → PiLp 1 fun j => α)", " BoundedSMul R (m → PiLp 1 fun j => α)", " NormedSpace R (m → PiLp 1 fun j => α)", " ‖A‖ = ↑(Finset.univ.sup fun i => ∑ j : n, ‖A i j‖₊)", " ‖fun i => (WithLp.equiv 1 (n → α)).symm (A i)‖ = ↑(Finset.univ.sup...
[ " SeminormedAddCommGroup (m → PiLp 1 fun j => α)", " NormedAddCommGroup (m → PiLp 1 fun j => α)", " BoundedSMul R (m → PiLp 1 fun j => α)", " NormedSpace R (m → PiLp 1 fun j => α)", " ‖A‖ = ↑(Finset.univ.sup fun i => ∑ j : n, ‖A i j‖₊)", " ‖fun i => (WithLp.equiv 1 (n → α)).symm (A i)‖ = ↑(Finset.univ.sup...
import Mathlib.Analysis.NormedSpace.Multilinear.Curry #align_import analysis.calculus.formal_multilinear_series from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open Set Fin Topology -- Porting note: added explicit universes to fix compile universe u u' v w x variable {𝕜 : Type u} {𝕜' : Type u'} {E : Type v} {F : Type w} {G : Type x} section variable [Ring 𝕜] [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E] [TopologicalAddGroup E] [ContinuousConstSMul 𝕜 E] [AddCommGroup F] [Module 𝕜 F] [TopologicalSpace F] [TopologicalAddGroup F] [ContinuousConstSMul 𝕜 F] [AddCommGroup G] [Module 𝕜 G] [TopologicalSpace G] [TopologicalAddGroup G] [ContinuousConstSMul 𝕜 G] @[nolint unusedArguments] def FormalMultilinearSeries (𝕜 : Type*) (E : Type*) (F : Type*) [Ring 𝕜] [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E] [TopologicalAddGroup E] [ContinuousConstSMul 𝕜 E] [AddCommGroup F] [Module 𝕜 F] [TopologicalSpace F] [TopologicalAddGroup F] [ContinuousConstSMul 𝕜 F] := ∀ n : ℕ, E[×n]→L[𝕜] F #align formal_multilinear_series FormalMultilinearSeries -- Porting note: was `deriving` instance : AddCommGroup (FormalMultilinearSeries 𝕜 E F) := inferInstanceAs <| AddCommGroup <| ∀ n : ℕ, E[×n]→L[𝕜] F instance : Inhabited (FormalMultilinearSeries 𝕜 E F) := ⟨0⟩ namespace FormalMultilinearSeries @[simp] -- Porting note (#10756): new theorem; was not needed in Lean 3 theorem zero_apply (n : ℕ) : (0 : FormalMultilinearSeries 𝕜 E F) n = 0 := rfl @[simp] -- Porting note (#10756): new theorem; was not needed in Lean 3 theorem neg_apply (f : FormalMultilinearSeries 𝕜 E F) (n : ℕ) : (-f) n = - f n := rfl @[ext] -- Porting note (#10756): new theorem protected theorem ext {p q : FormalMultilinearSeries 𝕜 E F} (h : ∀ n, p n = q n) : p = q := funext h protected theorem ext_iff {p q : FormalMultilinearSeries 𝕜 E F} : p = q ↔ ∀ n, p n = q n := Function.funext_iff #align formal_multilinear_series.ext_iff FormalMultilinearSeries.ext_iff protected theorem ne_iff {p q : FormalMultilinearSeries 𝕜 E F} : p ≠ q ↔ ∃ n, p n ≠ q n := Function.ne_iff #align formal_multilinear_series.ne_iff FormalMultilinearSeries.ne_iff def prod (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) : FormalMultilinearSeries 𝕜 E (F × G) | n => (p n).prod (q n) def removeZero (p : FormalMultilinearSeries 𝕜 E F) : FormalMultilinearSeries 𝕜 E F | 0 => 0 | n + 1 => p (n + 1) #align formal_multilinear_series.remove_zero FormalMultilinearSeries.removeZero @[simp] theorem removeZero_coeff_zero (p : FormalMultilinearSeries 𝕜 E F) : p.removeZero 0 = 0 := rfl #align formal_multilinear_series.remove_zero_coeff_zero FormalMultilinearSeries.removeZero_coeff_zero @[simp] theorem removeZero_coeff_succ (p : FormalMultilinearSeries 𝕜 E F) (n : ℕ) : p.removeZero (n + 1) = p (n + 1) := rfl #align formal_multilinear_series.remove_zero_coeff_succ FormalMultilinearSeries.removeZero_coeff_succ
Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean
111
114
theorem removeZero_of_pos (p : FormalMultilinearSeries 𝕜 E F) {n : ℕ} (h : 0 < n) : p.removeZero n = p n := by
rw [← Nat.succ_pred_eq_of_pos h] rfl
[ " p.removeZero n = p n", " p.removeZero n.pred.succ = p n.pred.succ" ]
[]
import Batteries.Data.UInt @[ext] theorem Char.ext : {a b : Char} → a.val = b.val → a = b | ⟨_,_⟩, ⟨_,_⟩, rfl => rfl theorem Char.ext_iff {x y : Char} : x = y ↔ x.val = y.val := ⟨congrArg _, Char.ext⟩ theorem Char.le_antisymm_iff {x y : Char} : x = y ↔ x ≤ y ∧ y ≤ x := Char.ext_iff.trans UInt32.le_antisymm_iff theorem Char.le_antisymm {x y : Char} (h1 : x ≤ y) (h2 : y ≤ x) : x = y := Char.le_antisymm_iff.2 ⟨h1, h2⟩ instance : Batteries.LawfulOrd Char := .compareOfLessAndEq (fun _ => Nat.lt_irrefl _) Nat.lt_trans Nat.not_lt Char.le_antisymm namespace String private theorem csize_eq (c) : csize c = 1 ∨ csize c = 2 ∨ csize c = 3 ∨ csize c = 4 := by simp only [csize, Char.utf8Size] repeat (first | split | (solve | simp (config := {decide := true}))) theorem csize_pos (c) : 0 < csize c := by rcases csize_eq c with _|_|_|_ <;> simp_all (config := {decide := true})
.lake/packages/batteries/Batteries/Data/Char.lean
33
34
theorem csize_le_4 (c) : csize c ≤ 4 := by
rcases csize_eq c with _|_|_|_ <;> simp_all (config := {decide := true})
[]
[]
import Mathlib.MeasureTheory.Measure.Restrict open scoped ENNReal NNReal Topology open Set MeasureTheory Measure Filter Function MeasurableSpace ENNReal variable {α β δ ι : Type*} namespace MeasureTheory variable {m0 : MeasurableSpace α} [MeasurableSpace β] {μ ν ν₁ ν₂: Measure α} {s t : Set α} theorem ite_ae_eq_of_measure_zero {γ} (f : α → γ) (g : α → γ) (s : Set α) [DecidablePred (· ∈ s)] (hs_zero : μ s = 0) : (fun x => ite (x ∈ s) (f x) (g x)) =ᵐ[μ] g := by have h_ss : sᶜ ⊆ { a : α | ite (a ∈ s) (f a) (g a) = g a } := fun x hx => by simp [(Set.mem_compl_iff _ _).mp hx] refine measure_mono_null ?_ hs_zero conv_rhs => rw [← compl_compl s] rwa [Set.compl_subset_compl] #align measure_theory.ite_ae_eq_of_measure_zero MeasureTheory.ite_ae_eq_of_measure_zero
Mathlib/MeasureTheory/Measure/Typeclasses.lean
501
508
theorem ite_ae_eq_of_measure_compl_zero {γ} (f : α → γ) (g : α → γ) (s : Set α) [DecidablePred (· ∈ s)] (hs_zero : μ sᶜ = 0) : (fun x => ite (x ∈ s) (f x) (g x)) =ᵐ[μ] f := by
rw [← mem_ae_iff] at hs_zero filter_upwards [hs_zero] intros split_ifs rfl
[ " (fun x => if x ∈ s then f x else g x) =ᶠ[ae μ] g", " x ∈ {a | (if a ∈ s then f a else g a) = g a}", " {x | (fun x => (fun x => if x ∈ s then f x else g x) x = g x) x}ᶜ ⊆ s", "α : Type u_1\nβ : Type u_2\nδ : Type u_3\nι : Type u_4\nm0 : MeasurableSpace α\ninst✝¹ : MeasurableSpace β\nμ ν ν₁ ν₂ : Measure α\ns✝...
[ " (fun x => if x ∈ s then f x else g x) =ᶠ[ae μ] g", " x ∈ {a | (if a ∈ s then f a else g a) = g a}", " {x | (fun x => (fun x => if x ∈ s then f x else g x) x = g x) x}ᶜ ⊆ s", "α : Type u_1\nβ : Type u_2\nδ : Type u_3\nι : Type u_4\nm0 : MeasurableSpace α\ninst✝¹ : MeasurableSpace β\nμ ν ν₁ ν₂ : Measure α\ns✝...
import Mathlib.Order.BoundedOrder #align_import data.prod.lex from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025" variable {α β γ : Type*} namespace Prod.Lex @[inherit_doc] notation:35 α " ×ₗ " β:34 => Lex (Prod α β) instance decidableEq (α β : Type*) [DecidableEq α] [DecidableEq β] : DecidableEq (α ×ₗ β) := instDecidableEqProd #align prod.lex.decidable_eq Prod.Lex.decidableEq instance inhabited (α β : Type*) [Inhabited α] [Inhabited β] : Inhabited (α ×ₗ β) := instInhabitedProd #align prod.lex.inhabited Prod.Lex.inhabited instance instLE (α β : Type*) [LT α] [LE β] : LE (α ×ₗ β) where le := Prod.Lex (· < ·) (· ≤ ·) #align prod.lex.has_le Prod.Lex.instLE instance instLT (α β : Type*) [LT α] [LT β] : LT (α ×ₗ β) where lt := Prod.Lex (· < ·) (· < ·) #align prod.lex.has_lt Prod.Lex.instLT theorem le_iff [LT α] [LE β] (a b : α × β) : toLex a ≤ toLex b ↔ a.1 < b.1 ∨ a.1 = b.1 ∧ a.2 ≤ b.2 := Prod.lex_def (· < ·) (· ≤ ·) #align prod.lex.le_iff Prod.Lex.le_iff theorem lt_iff [LT α] [LT β] (a b : α × β) : toLex a < toLex b ↔ a.1 < b.1 ∨ a.1 = b.1 ∧ a.2 < b.2 := Prod.lex_def (· < ·) (· < ·) #align prod.lex.lt_iff Prod.Lex.lt_iff example (x : α) (y : β) : toLex (x, y) = toLex (x, y) := rfl instance preorder (α β : Type*) [Preorder α] [Preorder β] : Preorder (α ×ₗ β) := { Prod.Lex.instLE α β, Prod.Lex.instLT α β with le_refl := refl_of <| Prod.Lex _ _, le_trans := fun _ _ _ => trans_of <| Prod.Lex _ _, lt_iff_le_not_le := fun x₁ x₂ => match x₁, x₂ with | (a₁, b₁), (a₂, b₂) => by constructor · rintro (⟨_, _, hlt⟩ | ⟨_, hlt⟩) · constructor · exact left _ _ hlt · rintro ⟨⟩ · apply lt_asymm hlt; assumption · exact lt_irrefl _ hlt · constructor · right rw [lt_iff_le_not_le] at hlt exact hlt.1 · rintro ⟨⟩ · apply lt_irrefl a₁ assumption · rw [lt_iff_le_not_le] at hlt apply hlt.2 assumption · rintro ⟨⟨⟩, h₂r⟩ · left assumption · right rw [lt_iff_le_not_le] constructor · assumption · intro h apply h₂r right exact h } #align prod.lex.preorder Prod.Lex.preorder theorem monotone_fst [Preorder α] [LE β] (t c : α ×ₗ β) (h : t ≤ c) : (ofLex t).1 ≤ (ofLex c).1 := by cases (Prod.Lex.le_iff t c).mp h with | inl h' => exact h'.le | inr h' => exact h'.1.le section Preorder variable [PartialOrder α] [Preorder β] theorem toLex_mono : Monotone (toLex : α × β → α ×ₗ β) := by rintro ⟨a₁, b₁⟩ ⟨a₂, b₂⟩ ⟨ha, hb⟩ obtain rfl | ha : a₁ = a₂ ∨ _ := ha.eq_or_lt · exact right _ hb · exact left _ _ ha #align prod.lex.to_lex_mono Prod.Lex.toLex_mono
Mathlib/Data/Prod/Lex.lean
122
126
theorem toLex_strictMono : StrictMono (toLex : α × β → α ×ₗ β) := by
rintro ⟨a₁, b₁⟩ ⟨a₂, b₂⟩ h obtain rfl | ha : a₁ = a₂ ∨ _ := h.le.1.eq_or_lt · exact right _ (Prod.mk_lt_mk_iff_right.1 h) · exact left _ _ ha
[ " (a₁, b₁) < (a₂, b₂) ↔ (a₁, b₁) ≤ (a₂, b₂) ∧ ¬(a₂, b₂) ≤ (a₁, b₁)", " (a₁, b₁) < (a₂, b₂) → (a₁, b₁) ≤ (a₂, b₂) ∧ ¬(a₂, b₂) ≤ (a₁, b₁)", " (a₁, b₁) ≤ (a₂, b₂) ∧ ¬(a₂, b₂) ≤ (a₁, b₁)", " (a₁, b₁) ≤ (a₂, b₂)", " ¬(a₂, b₂) ≤ (a₁, b₁)", " False", " a₂ < a₁", " (a₁, b₁) ≤ (a₁, b₂) ∧ ¬(a₁, b₂) ≤ (a₁, b₁)",...
[ " (a₁, b₁) < (a₂, b₂) ↔ (a₁, b₁) ≤ (a₂, b₂) ∧ ¬(a₂, b₂) ≤ (a₁, b₁)", " (a₁, b₁) < (a₂, b₂) → (a₁, b₁) ≤ (a₂, b₂) ∧ ¬(a₂, b₂) ≤ (a₁, b₁)", " (a₁, b₁) ≤ (a₂, b₂) ∧ ¬(a₂, b₂) ≤ (a₁, b₁)", " (a₁, b₁) ≤ (a₂, b₂)", " ¬(a₂, b₂) ≤ (a₁, b₁)", " False", " a₂ < a₁", " (a₁, b₁) ≤ (a₁, b₂) ∧ ¬(a₁, b₂) ≤ (a₁, b₁)",...
import Mathlib.Algebra.Order.ToIntervalMod import Mathlib.Algebra.Ring.AddAut import Mathlib.Data.Nat.Totient import Mathlib.GroupTheory.Divisible import Mathlib.Topology.Connected.PathConnected import Mathlib.Topology.IsLocalHomeomorph #align_import topology.instances.add_circle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" noncomputable section open AddCommGroup Set Function AddSubgroup TopologicalSpace open Topology variable {𝕜 B : Type*} @[nolint unusedArguments] abbrev AddCircle [LinearOrderedAddCommGroup 𝕜] [TopologicalSpace 𝕜] [OrderTopology 𝕜] (p : 𝕜) := 𝕜 ⧸ zmultiples p #align add_circle AddCircle namespace AddCircle section LinearOrderedAddCommGroup variable [LinearOrderedAddCommGroup 𝕜] [TopologicalSpace 𝕜] [OrderTopology 𝕜] (p : 𝕜) theorem coe_nsmul {n : ℕ} {x : 𝕜} : (↑(n • x) : AddCircle p) = n • (x : AddCircle p) := rfl #align add_circle.coe_nsmul AddCircle.coe_nsmul theorem coe_zsmul {n : ℤ} {x : 𝕜} : (↑(n • x) : AddCircle p) = n • (x : AddCircle p) := rfl #align add_circle.coe_zsmul AddCircle.coe_zsmul theorem coe_add (x y : 𝕜) : (↑(x + y) : AddCircle p) = (x : AddCircle p) + (y : AddCircle p) := rfl #align add_circle.coe_add AddCircle.coe_add theorem coe_sub (x y : 𝕜) : (↑(x - y) : AddCircle p) = (x : AddCircle p) - (y : AddCircle p) := rfl #align add_circle.coe_sub AddCircle.coe_sub theorem coe_neg {x : 𝕜} : (↑(-x) : AddCircle p) = -(x : AddCircle p) := rfl #align add_circle.coe_neg AddCircle.coe_neg theorem coe_eq_zero_iff {x : 𝕜} : (x : AddCircle p) = 0 ↔ ∃ n : ℤ, n • p = x := by simp [AddSubgroup.mem_zmultiples_iff] #align add_circle.coe_eq_zero_iff AddCircle.coe_eq_zero_iff theorem coe_eq_zero_of_pos_iff (hp : 0 < p) {x : 𝕜} (hx : 0 < x) : (x : AddCircle p) = 0 ↔ ∃ n : ℕ, n • p = x := by rw [coe_eq_zero_iff] constructor <;> rintro ⟨n, rfl⟩ · replace hx : 0 < n := by contrapose! hx simpa only [← neg_nonneg, ← zsmul_neg, zsmul_neg'] using zsmul_nonneg hp.le (neg_nonneg.2 hx) exact ⟨n.toNat, by rw [← natCast_zsmul, Int.toNat_of_nonneg hx.le]⟩ · exact ⟨(n : ℤ), by simp⟩ #align add_circle.coe_eq_zero_of_pos_iff AddCircle.coe_eq_zero_of_pos_iff theorem coe_period : (p : AddCircle p) = 0 := (QuotientAddGroup.eq_zero_iff p).2 <| mem_zmultiples p #align add_circle.coe_period AddCircle.coe_period theorem coe_add_period (x : 𝕜) : ((x + p : 𝕜) : AddCircle p) = x := by rw [coe_add, ← eq_sub_iff_add_eq', sub_self, coe_period] #align add_circle.coe_add_period AddCircle.coe_add_period @[continuity, nolint unusedArguments] protected theorem continuous_mk' : Continuous (QuotientAddGroup.mk' (zmultiples p) : 𝕜 → AddCircle p) := continuous_coinduced_rng #align add_circle.continuous_mk' AddCircle.continuous_mk' variable [hp : Fact (0 < p)] (a : 𝕜) [Archimedean 𝕜] def equivIco : AddCircle p ≃ Ico a (a + p) := QuotientAddGroup.equivIcoMod hp.out a #align add_circle.equiv_Ico AddCircle.equivIco def equivIoc : AddCircle p ≃ Ioc a (a + p) := QuotientAddGroup.equivIocMod hp.out a #align add_circle.equiv_Ioc AddCircle.equivIoc def liftIco (f : 𝕜 → B) : AddCircle p → B := restrict _ f ∘ AddCircle.equivIco p a #align add_circle.lift_Ico AddCircle.liftIco def liftIoc (f : 𝕜 → B) : AddCircle p → B := restrict _ f ∘ AddCircle.equivIoc p a #align add_circle.lift_Ioc AddCircle.liftIoc variable {p a} theorem coe_eq_coe_iff_of_mem_Ico {x y : 𝕜} (hx : x ∈ Ico a (a + p)) (hy : y ∈ Ico a (a + p)) : (x : AddCircle p) = y ↔ x = y := by refine ⟨fun h => ?_, by tauto⟩ suffices (⟨x, hx⟩ : Ico a (a + p)) = ⟨y, hy⟩ by exact Subtype.mk.inj this apply_fun equivIco p a at h rw [← (equivIco p a).right_inv ⟨x, hx⟩, ← (equivIco p a).right_inv ⟨y, hy⟩] exact h #align add_circle.coe_eq_coe_iff_of_mem_Ico AddCircle.coe_eq_coe_iff_of_mem_Ico theorem liftIco_coe_apply {f : 𝕜 → B} {x : 𝕜} (hx : x ∈ Ico a (a + p)) : liftIco p a f ↑x = f x := by have : (equivIco p a) x = ⟨x, hx⟩ := by rw [Equiv.apply_eq_iff_eq_symm_apply] rfl rw [liftIco, comp_apply, this] rfl #align add_circle.lift_Ico_coe_apply AddCircle.liftIco_coe_apply
Mathlib/Topology/Instances/AddCircle.lean
231
237
theorem liftIoc_coe_apply {f : 𝕜 → B} {x : 𝕜} (hx : x ∈ Ioc a (a + p)) : liftIoc p a f ↑x = f x := by
have : (equivIoc p a) x = ⟨x, hx⟩ := by rw [Equiv.apply_eq_iff_eq_symm_apply] rfl rw [liftIoc, comp_apply, this] rfl
[ " ↑x = 0 ↔ ∃ n, n • p = x", " (∃ n, n • p = x) ↔ ∃ n, n • p = x", " (∃ n, n • p = x) → ∃ n, n • p = x", " ∃ n_1, n_1 • p = n • p", " 0 < n", " n • p ≤ 0", " n.toNat • p = n • p", " ↑n • p = n • p", " ↑(x + p) = ↑x", " ↑x = ↑y ↔ x = y", " x = y → ↑x = ↑y", " x = y", " ⟨x, hx⟩ = ⟨y, hy⟩", " ...
[ " ↑x = 0 ↔ ∃ n, n • p = x", " (∃ n, n • p = x) ↔ ∃ n, n • p = x", " (∃ n, n • p = x) → ∃ n, n • p = x", " ∃ n_1, n_1 • p = n • p", " 0 < n", " n • p ≤ 0", " n.toNat • p = n • p", " ↑n • p = n • p", " ↑(x + p) = ↑x", " ↑x = ↑y ↔ x = y", " x = y → ↑x = ↑y", " x = y", " ⟨x, hx⟩ = ⟨y, hy⟩", " ...
import Mathlib.RingTheory.Ideal.QuotientOperations import Mathlib.RingTheory.Localization.Basic #align_import ring_theory.localization.ideal from "leanprover-community/mathlib"@"e7f0ddbf65bd7181a85edb74b64bdc35ba4bdc74" namespace IsLocalization section CommSemiring variable {R : Type*} [CommSemiring R] (M : Submonoid R) (S : Type*) [CommSemiring S] variable [Algebra R S] [IsLocalization M S] private def map_ideal (I : Ideal R) : Ideal S where carrier := { z : S | ∃ x : I × M, z * algebraMap R S x.2 = algebraMap R S x.1 } zero_mem' := ⟨⟨0, 1⟩, by simp⟩ add_mem' := by rintro a b ⟨a', ha⟩ ⟨b', hb⟩ let Z : { x // x ∈ I } := ⟨(a'.2 : R) * (b'.1 : R) + (b'.2 : R) * (a'.1 : R), I.add_mem (I.mul_mem_left _ b'.1.2) (I.mul_mem_left _ a'.1.2)⟩ use ⟨Z, a'.2 * b'.2⟩ simp only [RingHom.map_add, Submodule.coe_mk, Submonoid.coe_mul, RingHom.map_mul] rw [add_mul, ← mul_assoc a, ha, mul_comm (algebraMap R S a'.2) (algebraMap R S b'.2), ← mul_assoc b, hb] ring smul_mem' := by rintro c x ⟨x', hx⟩ obtain ⟨c', hc⟩ := IsLocalization.surj M c let Z : { x // x ∈ I } := ⟨c'.1 * x'.1, I.mul_mem_left c'.1 x'.1.2⟩ use ⟨Z, c'.2 * x'.2⟩ simp only [← hx, ← hc, smul_eq_mul, Submodule.coe_mk, Submonoid.coe_mul, RingHom.map_mul] ring -- Porting note: removed #align declaration since it is a private def theorem mem_map_algebraMap_iff {I : Ideal R} {z} : z ∈ Ideal.map (algebraMap R S) I ↔ ∃ x : I × M, z * algebraMap R S x.2 = algebraMap R S x.1 := by constructor · change _ → z ∈ map_ideal M S I refine fun h => Ideal.mem_sInf.1 h fun z hz => ?_ obtain ⟨y, hy⟩ := hz let Z : { x // x ∈ I } := ⟨y, hy.left⟩ use ⟨Z, 1⟩ simp [hy.right] · rintro ⟨⟨a, s⟩, h⟩ rw [← Ideal.unit_mul_mem_iff_mem _ (map_units S s), mul_comm] exact h.symm ▸ Ideal.mem_map_of_mem _ a.2 #align is_localization.mem_map_algebra_map_iff IsLocalization.mem_map_algebraMap_iff theorem map_comap (J : Ideal S) : Ideal.map (algebraMap R S) (Ideal.comap (algebraMap R S) J) = J := le_antisymm (Ideal.map_le_iff_le_comap.2 le_rfl) fun x hJ => by obtain ⟨r, s, hx⟩ := mk'_surjective M x rw [← hx] at hJ ⊢ exact Ideal.mul_mem_right _ _ (Ideal.mem_map_of_mem _ (show (algebraMap R S) r ∈ J from mk'_spec S r s ▸ J.mul_mem_right ((algebraMap R S) s) hJ)) #align is_localization.map_comap IsLocalization.map_comap theorem comap_map_of_isPrime_disjoint (I : Ideal R) (hI : I.IsPrime) (hM : Disjoint (M : Set R) I) : Ideal.comap (algebraMap R S) (Ideal.map (algebraMap R S) I) = I := by refine le_antisymm ?_ Ideal.le_comap_map refine (fun a ha => ?_) obtain ⟨⟨b, s⟩, h⟩ := (mem_map_algebraMap_iff M S).1 (Ideal.mem_comap.1 ha) replace h : algebraMap R S (s * a) = algebraMap R S b := by simpa only [← map_mul, mul_comm] using h obtain ⟨c, hc⟩ := (eq_iff_exists M S).1 h have : ↑c * ↑s * a ∈ I := by rw [mul_assoc, hc] exact I.mul_mem_left c b.2 exact (hI.mem_or_mem this).resolve_left fun hsc => hM.le_bot ⟨(c * s).2, hsc⟩ #align is_localization.comap_map_of_is_prime_disjoint IsLocalization.comap_map_of_isPrime_disjoint def orderEmbedding : Ideal S ↪o Ideal R where toFun J := Ideal.comap (algebraMap R S) J inj' := Function.LeftInverse.injective (map_comap M S) map_rel_iff' := by rintro J₁ J₂ constructor · exact fun hJ => (map_comap M S) J₁ ▸ (map_comap M S) J₂ ▸ Ideal.map_mono hJ · exact fun hJ => Ideal.comap_mono hJ #align is_localization.order_embedding IsLocalization.orderEmbedding
Mathlib/RingTheory/Localization/Ideal.lean
108
132
theorem isPrime_iff_isPrime_disjoint (J : Ideal S) : J.IsPrime ↔ (Ideal.comap (algebraMap R S) J).IsPrime ∧ Disjoint (M : Set R) ↑(Ideal.comap (algebraMap R S) J) := by
constructor · refine fun h => ⟨⟨?_, ?_⟩, Set.disjoint_left.mpr fun m hm1 hm2 => h.ne_top (Ideal.eq_top_of_isUnit_mem _ hm2 (map_units S ⟨m, hm1⟩))⟩ · refine fun hJ => h.ne_top ?_ rw [eq_top_iff, ← (orderEmbedding M S).le_iff_le] exact le_of_eq hJ.symm · intro x y hxy rw [Ideal.mem_comap, RingHom.map_mul] at hxy exact h.mem_or_mem hxy · refine fun h => ⟨fun hJ => h.left.ne_top (eq_top_iff.2 ?_), ?_⟩ · rwa [eq_top_iff, ← (orderEmbedding M S).le_iff_le] at hJ · intro x y hxy obtain ⟨a, s, ha⟩ := mk'_surjective M x obtain ⟨b, t, hb⟩ := mk'_surjective M y have : mk' S (a * b) (s * t) ∈ J := by rwa [mk'_mul, ha, hb] rw [mk'_mem_iff, ← Ideal.mem_comap] at this have this₂ := (h.1).mul_mem_iff_mem_or_mem.1 this rw [Ideal.mem_comap, Ideal.mem_comap] at this₂ rwa [← ha, ← hb, mk'_mem_iff, mk'_mem_iff]
[ " ∀ {a b : S},\n a ∈ {z | ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1} →\n b ∈ {z | ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1} →\n a + b ∈ {z | ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1}", " a + b ∈ {z | ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1}", ...
[ " ∀ {a b : S},\n a ∈ {z | ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1} →\n b ∈ {z | ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1} →\n a + b ∈ {z | ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1}", " a + b ∈ {z | ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1}", ...
import Mathlib.Order.Interval.Set.ProjIcc import Mathlib.Topology.Algebra.Order.Field import Mathlib.Topology.Bornology.Hom import Mathlib.Topology.EMetricSpace.Lipschitz import Mathlib.Topology.MetricSpace.Basic import Mathlib.Topology.MetricSpace.Bounded #align_import topology.metric_space.lipschitz from "leanprover-community/mathlib"@"c8f305514e0d47dfaa710f5a52f0d21b588e6328" universe u v w x open Filter Function Set Topology NNReal ENNReal Bornology variable {α : Type u} {β : Type v} {γ : Type w} {ι : Type x} theorem lipschitzWith_iff_dist_le_mul [PseudoMetricSpace α] [PseudoMetricSpace β] {K : ℝ≥0} {f : α → β} : LipschitzWith K f ↔ ∀ x y, dist (f x) (f y) ≤ K * dist x y := by simp only [LipschitzWith, edist_nndist, dist_nndist] norm_cast #align lipschitz_with_iff_dist_le_mul lipschitzWith_iff_dist_le_mul alias ⟨LipschitzWith.dist_le_mul, LipschitzWith.of_dist_le_mul⟩ := lipschitzWith_iff_dist_le_mul #align lipschitz_with.dist_le_mul LipschitzWith.dist_le_mul #align lipschitz_with.of_dist_le_mul LipschitzWith.of_dist_le_mul
Mathlib/Topology/MetricSpace/Lipschitz.lean
51
55
theorem lipschitzOnWith_iff_dist_le_mul [PseudoMetricSpace α] [PseudoMetricSpace β] {K : ℝ≥0} {s : Set α} {f : α → β} : LipschitzOnWith K f s ↔ ∀ x ∈ s, ∀ y ∈ s, dist (f x) (f y) ≤ K * dist x y := by
simp only [LipschitzOnWith, edist_nndist, dist_nndist] norm_cast
[ " LipschitzWith K f ↔ ∀ (x y : α), dist (f x) (f y) ≤ ↑K * dist x y", " (∀ (x y : α), ↑(nndist (f x) (f y)) ≤ ↑K * ↑(nndist x y)) ↔ ∀ (x y : α), ↑(nndist (f x) (f y)) ≤ ↑K * ↑(nndist x y)", " LipschitzOnWith K f s ↔ ∀ x ∈ s, ∀ y ∈ s, dist (f x) (f y) ≤ ↑K * dist x y", " (∀ ⦃x : α⦄, x ∈ s → ∀ ⦃y : α⦄, y ∈ s → ...
[ " LipschitzWith K f ↔ ∀ (x y : α), dist (f x) (f y) ≤ ↑K * dist x y", " (∀ (x y : α), ↑(nndist (f x) (f y)) ≤ ↑K * ↑(nndist x y)) ↔ ∀ (x y : α), ↑(nndist (f x) (f y)) ≤ ↑K * ↑(nndist x y)" ]
import Mathlib.RingTheory.DedekindDomain.Ideal #align_import ring_theory.dedekind_domain.factorization from "leanprover-community/mathlib"@"2f588be38bb5bec02f218ba14f82fc82eb663f87" noncomputable section open scoped Classical nonZeroDivisors open Set Function UniqueFactorizationMonoid IsDedekindDomain IsDedekindDomain.HeightOneSpectrum Classical variable {R : Type*} [CommRing R] {K : Type*} [Field K] [Algebra R K] [IsFractionRing R K] variable [IsDedekindDomain R] (v : HeightOneSpectrum R) def IsDedekindDomain.HeightOneSpectrum.maxPowDividing (I : Ideal R) : Ideal R := v.asIdeal ^ (Associates.mk v.asIdeal).count (Associates.mk I).factors #align is_dedekind_domain.height_one_spectrum.max_pow_dividing IsDedekindDomain.HeightOneSpectrum.maxPowDividing theorem Ideal.finite_factors {I : Ideal R} (hI : I ≠ 0) : {v : HeightOneSpectrum R | v.asIdeal ∣ I}.Finite := by rw [← Set.finite_coe_iff, Set.coe_setOf] haveI h_fin := fintypeSubtypeDvd I hI refine Finite.of_injective (fun v => (⟨(v : HeightOneSpectrum R).asIdeal, v.2⟩ : { x // x ∣ I })) ?_ intro v w hvw simp? at hvw says simp only [Subtype.mk.injEq] at hvw exact Subtype.coe_injective ((HeightOneSpectrum.ext_iff (R := R) ↑v ↑w).mpr hvw) #align ideal.finite_factors Ideal.finite_factors theorem Associates.finite_factors {I : Ideal R} (hI : I ≠ 0) : ∀ᶠ v : HeightOneSpectrum R in Filter.cofinite, ((Associates.mk v.asIdeal).count (Associates.mk I).factors : ℤ) = 0 := by have h_supp : {v : HeightOneSpectrum R | ¬((Associates.mk v.asIdeal).count (Associates.mk I).factors : ℤ) = 0} = {v : HeightOneSpectrum R | v.asIdeal ∣ I} := by ext v simp_rw [Int.natCast_eq_zero] exact Associates.count_ne_zero_iff_dvd hI v.irreducible rw [Filter.eventually_cofinite, h_supp] exact Ideal.finite_factors hI #align associates.finite_factors Associates.finite_factors namespace Ideal theorem finite_mulSupport {I : Ideal R} (hI : I ≠ 0) : (mulSupport fun v : HeightOneSpectrum R => v.maxPowDividing I).Finite := haveI h_subset : {v : HeightOneSpectrum R | v.maxPowDividing I ≠ 1} ⊆ {v : HeightOneSpectrum R | ((Associates.mk v.asIdeal).count (Associates.mk I).factors : ℤ) ≠ 0} := by intro v hv h_zero have hv' : v.maxPowDividing I = 1 := by rw [IsDedekindDomain.HeightOneSpectrum.maxPowDividing, Int.natCast_eq_zero.mp h_zero, pow_zero _] exact hv hv' Finite.subset (Filter.eventually_cofinite.mp (Associates.finite_factors hI)) h_subset #align ideal.finite_mul_support Ideal.finite_mulSupport theorem finite_mulSupport_coe {I : Ideal R} (hI : I ≠ 0) : (mulSupport fun v : HeightOneSpectrum R => (v.asIdeal : FractionalIdeal R⁰ K) ^ ((Associates.mk v.asIdeal).count (Associates.mk I).factors : ℤ)).Finite := by rw [mulSupport] simp_rw [Ne, zpow_natCast, ← FractionalIdeal.coeIdeal_pow, FractionalIdeal.coeIdeal_eq_one] exact finite_mulSupport hI #align ideal.finite_mul_support_coe Ideal.finite_mulSupport_coe
Mathlib/RingTheory/DedekindDomain/Factorization.lean
122
127
theorem finite_mulSupport_inv {I : Ideal R} (hI : I ≠ 0) : (mulSupport fun v : HeightOneSpectrum R => (v.asIdeal : FractionalIdeal R⁰ K) ^ (-((Associates.mk v.asIdeal).count (Associates.mk I).factors : ℤ))).Finite := by
rw [mulSupport] simp_rw [zpow_neg, Ne, inv_eq_one] exact finite_mulSupport_coe hI
[ " {v | v.asIdeal ∣ I}.Finite", " Finite { x // x.asIdeal ∣ I }", " Injective fun v => ⟨(↑v).asIdeal, ⋯⟩", " v = w", " ∀ᶠ (v : HeightOneSpectrum R) in Filter.cofinite, ↑((Associates.mk v.asIdeal).count (Associates.mk I).factors) = 0", " {v | ¬↑((Associates.mk v.asIdeal).count (Associates.mk I).factors) = 0...
[ " {v | v.asIdeal ∣ I}.Finite", " Finite { x // x.asIdeal ∣ I }", " Injective fun v => ⟨(↑v).asIdeal, ⋯⟩", " v = w", " ∀ᶠ (v : HeightOneSpectrum R) in Filter.cofinite, ↑((Associates.mk v.asIdeal).count (Associates.mk I).factors) = 0", " {v | ¬↑((Associates.mk v.asIdeal).count (Associates.mk I).factors) = 0...
import Mathlib.Algebra.BigOperators.Fin import Mathlib.Algebra.Polynomial.Degree.Lemmas #align_import data.polynomial.erase_lead from "leanprover-community/mathlib"@"fa256f00ce018e7b40e1dc756e403c86680bf448" noncomputable section open Polynomial open Polynomial Finset namespace Polynomial variable {R : Type*} [Semiring R] {f : R[X]} def eraseLead (f : R[X]) : R[X] := Polynomial.erase f.natDegree f #align polynomial.erase_lead Polynomial.eraseLead section EraseLead theorem eraseLead_support (f : R[X]) : f.eraseLead.support = f.support.erase f.natDegree := by simp only [eraseLead, support_erase] #align polynomial.erase_lead_support Polynomial.eraseLead_support theorem eraseLead_coeff (i : ℕ) : f.eraseLead.coeff i = if i = f.natDegree then 0 else f.coeff i := by simp only [eraseLead, coeff_erase] #align polynomial.erase_lead_coeff Polynomial.eraseLead_coeff @[simp]
Mathlib/Algebra/Polynomial/EraseLead.lean
52
52
theorem eraseLead_coeff_natDegree : f.eraseLead.coeff f.natDegree = 0 := by
simp [eraseLead_coeff]
[ " f.eraseLead.support = f.support.erase f.natDegree", " f.eraseLead.coeff i = if i = f.natDegree then 0 else f.coeff i", " f.eraseLead.coeff f.natDegree = 0" ]
[ " f.eraseLead.support = f.support.erase f.natDegree", " f.eraseLead.coeff i = if i = f.natDegree then 0 else f.coeff i" ]