Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k |
|---|---|---|---|---|---|
import Mathlib.LinearAlgebra.Matrix.DotProduct
import Mathlib.LinearAlgebra.Determinant
import Mathlib.LinearAlgebra.Matrix.Diagonal
#align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7"
open Matrix
namespace Matrix
open FiniteDimensional
variable {l m n o R : Type*} [Fintype n] [Fintype o]
section CommRing
variable [CommRing R]
noncomputable def rank (A : Matrix m n R) : ℕ :=
finrank R <| LinearMap.range A.mulVecLin
#align matrix.rank Matrix.rank
@[simp]
| Mathlib/Data/Matrix/Rank.lean | 49 | 51 | theorem rank_one [StrongRankCondition R] [DecidableEq n] :
rank (1 : Matrix n n R) = Fintype.card n := by |
rw [rank, mulVecLin_one, LinearMap.range_id, finrank_top, finrank_pi]
|
import Mathlib.Algebra.GroupWithZero.Units.Basic
import Mathlib.Algebra.Group.Semiconj.Units
import Mathlib.Init.Classical
#align_import algebra.group_with_zero.semiconj from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
assert_not_exists DenselyOrdered
variable {α M₀ G₀ M₀' G₀' F F' : Type*}
namespace SemiconjBy
@[simp]
theorem zero_right [MulZeroClass G₀] (a : G₀) : SemiconjBy a 0 0 := by
simp only [SemiconjBy, mul_zero, zero_mul]
#align semiconj_by.zero_right SemiconjBy.zero_right
@[simp]
| Mathlib/Algebra/GroupWithZero/Semiconj.lean | 29 | 30 | theorem zero_left [MulZeroClass G₀] (x y : G₀) : SemiconjBy 0 x y := by |
simp only [SemiconjBy, mul_zero, zero_mul]
|
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] {f : α → β}
variable {s : Set β} {ι : Type*} {U : ι → Opens β} (hU : iSup U = ⊤)
theorem Set.restrictPreimage_inducing (s : Set β) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by
simp_rw [← inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, ← @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h ⊢
intro a
rw [← h, ← inducing_subtype_val.nhds_eq_comap]
#align set.restrict_preimage_inducing Set.restrictPreimage_inducing
alias Inducing.restrictPreimage := Set.restrictPreimage_inducing
#align inducing.restrict_preimage Inducing.restrictPreimage
theorem Set.restrictPreimage_embedding (s : Set β) (h : Embedding f) :
Embedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s, h.2.restrictPreimage s⟩
#align set.restrict_preimage_embedding Set.restrictPreimage_embedding
alias Embedding.restrictPreimage := Set.restrictPreimage_embedding
#align embedding.restrict_preimage Embedding.restrictPreimage
theorem Set.restrictPreimage_openEmbedding (s : Set β) (h : OpenEmbedding f) :
OpenEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ continuous_subtype_val.isOpen_preimage _ h.isOpen_range⟩
#align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding
alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding
#align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage
theorem Set.restrictPreimage_closedEmbedding (s : Set β) (h : ClosedEmbedding f) :
ClosedEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ inducing_subtype_val.isClosed_preimage _ h.isClosed_range⟩
#align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding
alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding
#align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage
theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set β) :
IsClosedMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsClosed u → Subtype.val ⁻¹' u = t →
∃ v, IsClosed v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isClosed_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set β) (H : IsClosedMap f) :
IsClosedMap (s.restrictPreimage f) := H.restrictPreimage s
theorem IsOpenMap.restrictPreimage (H : IsOpenMap f) (s : Set β) :
IsOpenMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsOpen u → Subtype.val ⁻¹' u = t →
∃ v, IsOpen v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isOpen_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isOpenMap (s : Set β) (H : IsOpenMap f) :
IsOpenMap (s.restrictPreimage f) := H.restrictPreimage s
theorem isOpen_iff_inter_of_iSup_eq_top (s : Set β) : IsOpen s ↔ ∀ i, IsOpen (s ∩ U i) := by
constructor
· exact fun H i => H.inter (U i).2
· intro H
have : ⋃ i, (U i : Set β) = Set.univ := by
convert congr_arg (SetLike.coe) hU
simp
rw [← s.inter_univ, ← this, Set.inter_iUnion]
exact isOpen_iUnion H
#align is_open_iff_inter_of_supr_eq_top isOpen_iff_inter_of_iSup_eq_top
theorem isOpen_iff_coe_preimage_of_iSup_eq_top (s : Set β) :
IsOpen s ↔ ∀ i, IsOpen ((↑) ⁻¹' s : Set (U i)) := by
-- Porting note: rewrote to avoid ´simp´ issues
rw [isOpen_iff_inter_of_iSup_eq_top hU s]
refine forall_congr' fun i => ?_
rw [(U _).2.openEmbedding_subtype_val.open_iff_image_open]
erw [Set.image_preimage_eq_inter_range]
rw [Subtype.range_coe, Opens.carrier_eq_coe]
#align is_open_iff_coe_preimage_of_supr_eq_top isOpen_iff_coe_preimage_of_iSup_eq_top
| Mathlib/Topology/LocalAtTarget.lean | 111 | 113 | theorem isClosed_iff_coe_preimage_of_iSup_eq_top (s : Set β) :
IsClosed s ↔ ∀ i, IsClosed ((↑) ⁻¹' s : Set (U i)) := by |
simpa using isOpen_iff_coe_preimage_of_iSup_eq_top hU sᶜ
|
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
namespace IsBoundedLinearMap
def toLinearMap (f : E → F) (h : IsBoundedLinearMap 𝕜 f) : E →ₗ[𝕜] F :=
IsLinearMap.mk' _ h.toIsLinearMap
#align is_bounded_linear_map.to_linear_map IsBoundedLinearMap.toLinearMap
def toContinuousLinearMap {f : E → F} (hf : IsBoundedLinearMap 𝕜 f) : E →L[𝕜] F :=
{ toLinearMap f hf with
cont :=
let ⟨C, _, hC⟩ := hf.bound
AddMonoidHomClass.continuous_of_bound (toLinearMap f hf) C hC }
#align is_bounded_linear_map.to_continuous_linear_map IsBoundedLinearMap.toContinuousLinearMap
theorem zero : IsBoundedLinearMap 𝕜 fun _ : E => (0 : F) :=
(0 : E →ₗ[𝕜] F).isLinear.with_bound 0 <| by simp [le_refl]
#align is_bounded_linear_map.zero IsBoundedLinearMap.zero
theorem id : IsBoundedLinearMap 𝕜 fun x : E => x :=
LinearMap.id.isLinear.with_bound 1 <| by simp [le_refl]
#align is_bounded_linear_map.id IsBoundedLinearMap.id
theorem fst : IsBoundedLinearMap 𝕜 fun x : E × F => x.1 := by
refine (LinearMap.fst 𝕜 E F).isLinear.with_bound 1 fun x => ?_
rw [one_mul]
exact le_max_left _ _
#align is_bounded_linear_map.fst IsBoundedLinearMap.fst
theorem snd : IsBoundedLinearMap 𝕜 fun x : E × F => x.2 := by
refine (LinearMap.snd 𝕜 E F).isLinear.with_bound 1 fun x => ?_
rw [one_mul]
exact le_max_right _ _
#align is_bounded_linear_map.snd IsBoundedLinearMap.snd
variable {f g : E → F}
theorem smul (c : 𝕜) (hf : IsBoundedLinearMap 𝕜 f) : IsBoundedLinearMap 𝕜 (c • f) :=
let ⟨hlf, M, _, hM⟩ := hf
(c • hlf.mk' f).isLinear.with_bound (‖c‖ * M) fun x =>
calc
‖c • f x‖ = ‖c‖ * ‖f x‖ := norm_smul c (f x)
_ ≤ ‖c‖ * (M * ‖x‖) := mul_le_mul_of_nonneg_left (hM _) (norm_nonneg _)
_ = ‖c‖ * M * ‖x‖ := (mul_assoc _ _ _).symm
#align is_bounded_linear_map.smul IsBoundedLinearMap.smul
theorem neg (hf : IsBoundedLinearMap 𝕜 f) : IsBoundedLinearMap 𝕜 fun e => -f e := by
rw [show (fun e => -f e) = fun e => (-1 : 𝕜) • f e by funext; simp]
exact smul (-1) hf
#align is_bounded_linear_map.neg IsBoundedLinearMap.neg
theorem add (hf : IsBoundedLinearMap 𝕜 f) (hg : IsBoundedLinearMap 𝕜 g) :
IsBoundedLinearMap 𝕜 fun e => f e + g e :=
let ⟨hlf, Mf, _, hMf⟩ := hf
let ⟨hlg, Mg, _, hMg⟩ := hg
(hlf.mk' _ + hlg.mk' _).isLinear.with_bound (Mf + Mg) fun x =>
calc
‖f x + g x‖ ≤ Mf * ‖x‖ + Mg * ‖x‖ := norm_add_le_of_le (hMf x) (hMg x)
_ ≤ (Mf + Mg) * ‖x‖ := by rw [add_mul]
#align is_bounded_linear_map.add IsBoundedLinearMap.add
| Mathlib/Analysis/NormedSpace/BoundedLinearMaps.lean | 155 | 156 | theorem sub (hf : IsBoundedLinearMap 𝕜 f) (hg : IsBoundedLinearMap 𝕜 g) :
IsBoundedLinearMap 𝕜 fun e => f e - g e := by | simpa [sub_eq_add_neg] using add hf (neg hg)
|
import Mathlib.Data.Finsupp.Multiset
import Mathlib.Data.Nat.GCD.BigOperators
import Mathlib.Data.Nat.PrimeFin
import Mathlib.NumberTheory.Padics.PadicVal
import Mathlib.Order.Interval.Finset.Nat
#align_import data.nat.factorization.basic from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
-- Workaround for lean4#2038
attribute [-instance] instBEqNat
open Nat Finset List Finsupp
namespace Nat
variable {a b m n p : ℕ}
def factorization (n : ℕ) : ℕ →₀ ℕ where
support := n.primeFactors
toFun p := if p.Prime then padicValNat p n else 0
mem_support_toFun := by simp [not_or]; aesop
#align nat.factorization Nat.factorization
@[simp] lemma support_factorization (n : ℕ) : (factorization n).support = n.primeFactors := rfl
theorem factorization_def (n : ℕ) {p : ℕ} (pp : p.Prime) : n.factorization p = padicValNat p n := by
simpa [factorization] using absurd pp
#align nat.factorization_def Nat.factorization_def
@[simp]
theorem factors_count_eq {n p : ℕ} : n.factors.count p = n.factorization p := by
rcases n.eq_zero_or_pos with (rfl | hn0)
· simp [factorization, count]
if pp : p.Prime then ?_ else
rw [count_eq_zero_of_not_mem (mt prime_of_mem_factors pp)]
simp [factorization, pp]
simp only [factorization_def _ pp]
apply _root_.le_antisymm
· rw [le_padicValNat_iff_replicate_subperm_factors pp hn0.ne']
exact List.le_count_iff_replicate_sublist.mp le_rfl |>.subperm
· rw [← lt_add_one_iff, lt_iff_not_ge, ge_iff_le,
le_padicValNat_iff_replicate_subperm_factors pp hn0.ne']
intro h
have := h.count_le p
simp at this
#align nat.factors_count_eq Nat.factors_count_eq
theorem factorization_eq_factors_multiset (n : ℕ) :
n.factorization = Multiset.toFinsupp (n.factors : Multiset ℕ) := by
ext p
simp
#align nat.factorization_eq_factors_multiset Nat.factorization_eq_factors_multiset
theorem multiplicity_eq_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
multiplicity p n = n.factorization p := by
simp [factorization, pp, padicValNat_def' pp.ne_one hn.bot_lt]
#align nat.multiplicity_eq_factorization Nat.multiplicity_eq_factorization
@[simp]
| Mathlib/Data/Nat/Factorization/Basic.lean | 99 | 102 | theorem factorization_prod_pow_eq_self {n : ℕ} (hn : n ≠ 0) : n.factorization.prod (· ^ ·) = n := by |
rw [factorization_eq_factors_multiset n]
simp only [← prod_toMultiset, factorization, Multiset.prod_coe, Multiset.toFinsupp_toMultiset]
exact prod_factors hn
|
import Mathlib.AlgebraicTopology.DoldKan.FunctorN
#align_import algebraic_topology.dold_kan.normalized from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504"
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits
CategoryTheory.Subobject CategoryTheory.Idempotents DoldKan
noncomputable section
namespace AlgebraicTopology
namespace DoldKan
universe v
variable {A : Type*} [Category A] [Abelian A] {X : SimplicialObject A}
theorem HigherFacesVanish.inclusionOfMooreComplexMap (n : ℕ) :
HigherFacesVanish (n + 1) ((inclusionOfMooreComplexMap X).f (n + 1)) := fun j _ => by
dsimp [AlgebraicTopology.inclusionOfMooreComplexMap, NormalizedMooreComplex.objX]
rw [← factorThru_arrow _ _ (finset_inf_arrow_factors Finset.univ _ j
(by simp only [Finset.mem_univ])), assoc, kernelSubobject_arrow_comp, comp_zero]
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.higher_faces_vanish.inclusion_of_Moore_complex_map AlgebraicTopology.DoldKan.HigherFacesVanish.inclusionOfMooreComplexMap
theorem factors_normalizedMooreComplex_PInfty (n : ℕ) :
Subobject.Factors (NormalizedMooreComplex.objX X n) (PInfty.f n) := by
rcases n with _|n
· apply top_factors
· rw [PInfty_f, NormalizedMooreComplex.objX, finset_inf_factors]
intro i _
apply kernelSubobject_factors
exact (HigherFacesVanish.of_P (n + 1) n) i le_add_self
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.factors_normalized_Moore_complex_P_infty AlgebraicTopology.DoldKan.factors_normalizedMooreComplex_PInfty
@[simps!]
def PInftyToNormalizedMooreComplex (X : SimplicialObject A) : K[X] ⟶ N[X] :=
ChainComplex.ofHom _ _ _ _ _ _
(fun n => factorThru _ _ (factors_normalizedMooreComplex_PInfty n)) fun n => by
rw [← cancel_mono (NormalizedMooreComplex.objX X n).arrow, assoc, assoc, factorThru_arrow,
← inclusionOfMooreComplexMap_f, ← normalizedMooreComplex_objD,
← (inclusionOfMooreComplexMap X).comm (n + 1) n, inclusionOfMooreComplexMap_f,
factorThru_arrow_assoc, ← alternatingFaceMapComplex_obj_d]
exact PInfty.comm (n + 1) n
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.P_infty_to_normalized_Moore_complex AlgebraicTopology.DoldKan.PInftyToNormalizedMooreComplex
@[reassoc (attr := simp)]
theorem PInftyToNormalizedMooreComplex_comp_inclusionOfMooreComplexMap (X : SimplicialObject A) :
PInftyToNormalizedMooreComplex X ≫ inclusionOfMooreComplexMap X = PInfty := by aesop_cat
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.P_infty_to_normalized_Moore_complex_comp_inclusion_of_Moore_complex_map AlgebraicTopology.DoldKan.PInftyToNormalizedMooreComplex_comp_inclusionOfMooreComplexMap
@[reassoc (attr := simp)]
theorem PInftyToNormalizedMooreComplex_naturality {X Y : SimplicialObject A} (f : X ⟶ Y) :
AlternatingFaceMapComplex.map f ≫ PInftyToNormalizedMooreComplex Y =
PInftyToNormalizedMooreComplex X ≫ NormalizedMooreComplex.map f := by
aesop_cat
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.P_infty_to_normalized_Moore_complex_naturality AlgebraicTopology.DoldKan.PInftyToNormalizedMooreComplex_naturality
@[reassoc (attr := simp)]
| Mathlib/AlgebraicTopology/DoldKan/Normalized.lean | 91 | 92 | theorem PInfty_comp_PInftyToNormalizedMooreComplex (X : SimplicialObject A) :
PInfty ≫ PInftyToNormalizedMooreComplex X = PInftyToNormalizedMooreComplex X := by | aesop_cat
|
import Mathlib.Algebra.GeomSum
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.Algebra.Ring.Int
import Mathlib.NumberTheory.Padics.PadicVal
import Mathlib.RingTheory.Ideal.Quotient
#align_import number_theory.multiplicity from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Ideal Ideal.Quotient Finset
variable {R : Type*} {n : ℕ}
section CommRing
variable [CommRing R] {a b x y : R}
theorem dvd_geom_sum₂_iff_of_dvd_sub {x y p : R} (h : p ∣ x - y) :
(p ∣ ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i)) ↔ p ∣ n * y ^ (n - 1) := by
rw [← mem_span_singleton, ← Ideal.Quotient.eq] at h
simp only [← mem_span_singleton, ← eq_zero_iff_mem, RingHom.map_geom_sum₂, h, geom_sum₂_self,
_root_.map_mul, map_pow, map_natCast]
#align dvd_geom_sum₂_iff_of_dvd_sub dvd_geom_sum₂_iff_of_dvd_sub
| Mathlib/NumberTheory/Multiplicity.lean | 46 | 48 | theorem dvd_geom_sum₂_iff_of_dvd_sub' {x y p : R} (h : p ∣ x - y) :
(p ∣ ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i)) ↔ p ∣ n * x ^ (n - 1) := by |
rw [geom_sum₂_comm, dvd_geom_sum₂_iff_of_dvd_sub]; simpa using h.neg_right
|
import Mathlib.Algebra.GeomSum
import Mathlib.Algebra.Order.Archimedean
import Mathlib.Algebra.Order.CauSeq.Basic
#align_import data.real.cau_seq from "leanprover-community/mathlib"@"9116dd6709f303dcf781632e15fdef382b0fc579"
open Finset IsAbsoluteValue
namespace IsCauSeq
variable {α β : Type*} [LinearOrderedField α] [Ring β] {abv : β → α} [IsAbsoluteValue abv]
{f g : ℕ → β} {a : ℕ → α}
lemma of_abv_le (n : ℕ) (hm : ∀ m, n ≤ m → abv (f m) ≤ a m) :
IsCauSeq abs (fun n ↦ ∑ i ∈ range n, a i) → IsCauSeq abv fun n ↦ ∑ i ∈ range n, f i := by
intro hg ε ε0
cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
exists max n i
intro j ji
have hi₁ := hi j (le_trans (le_max_right n i) ji)
have hi₂ := hi (max n i) (le_max_right n i)
have sub_le :=
abs_sub_le (∑ k ∈ range j, a k) (∑ k ∈ range i, a k) (∑ k ∈ range (max n i), a k)
have := add_lt_add hi₁ hi₂
rw [abs_sub_comm (∑ k ∈ range (max n i), a k), add_halves ε] at this
refine lt_of_le_of_lt (le_trans (le_trans ?_ (le_abs_self _)) sub_le) this
generalize hk : j - max n i = k
clear this hi₂ hi₁ hi ε0 ε hg sub_le
rw [tsub_eq_iff_eq_add_of_le ji] at hk
rw [hk]
dsimp only
clear hk ji j
induction' k with k' hi
· simp [abv_zero abv]
simp only [Nat.succ_add, Nat.succ_eq_add_one, Finset.sum_range_succ_comm]
simp only [add_assoc, sub_eq_add_neg]
refine le_trans (abv_add _ _ _) ?_
simp only [sub_eq_add_neg] at hi
exact add_le_add (hm _ (le_add_of_nonneg_of_le (Nat.zero_le _) (le_max_left _ _))) hi
#align is_cau_series_of_abv_le_cau IsCauSeq.of_abv_le
lemma of_abv (hf : IsCauSeq abs fun m ↦ ∑ n ∈ range m, abv (f n)) :
IsCauSeq abv fun m ↦ ∑ n ∈ range m, f n :=
hf.of_abv_le 0 fun _ _ ↦ le_rfl
#align is_cau_series_of_abv_cau IsCauSeq.of_abv
| Mathlib/Algebra/Order/CauSeq/BigOperators.lean | 57 | 141 | theorem _root_.cauchy_product (ha : IsCauSeq abs fun m ↦ ∑ n ∈ range m, abv (f n))
(hb : IsCauSeq abv fun m ↦ ∑ n ∈ range m, g n) (ε : α) (ε0 : 0 < ε) :
∃ i : ℕ, ∀ j ≥ i,
abv ((∑ k ∈ range j, f k) * ∑ k ∈ range j, g k -
∑ n ∈ range j, ∑ m ∈ range (n + 1), f m * g (n - m)) < ε := by |
let ⟨P, hP⟩ := ha.bounded
let ⟨Q, hQ⟩ := hb.bounded
have hP0 : 0 < P := lt_of_le_of_lt (abs_nonneg _) (hP 0)
have hPε0 : 0 < ε / (2 * P) := div_pos ε0 (mul_pos (show (2 : α) > 0 by norm_num) hP0)
let ⟨N, hN⟩ := hb.cauchy₂ hPε0
have hQε0 : 0 < ε / (4 * Q) :=
div_pos ε0 (mul_pos (show (0 : α) < 4 by norm_num) (lt_of_le_of_lt (abv_nonneg _ _) (hQ 0)))
let ⟨M, hM⟩ := ha.cauchy₂ hQε0
refine ⟨2 * (max N M + 1), fun K hK ↦ ?_⟩
have h₁ :
(∑ m ∈ range K, ∑ k ∈ range (m + 1), f k * g (m - k)) =
∑ m ∈ range K, ∑ n ∈ range (K - m), f m * g n := by
simpa using sum_range_diag_flip K fun m n ↦ f m * g n
have h₂ :
(fun i ↦ ∑ k ∈ range (K - i), f i * g k) = fun i ↦ f i * ∑ k ∈ range (K - i), g k := by
simp [Finset.mul_sum]
have h₃ :
∑ i ∈ range K, f i * ∑ k ∈ range (K - i), g k =
∑ i ∈ range K, f i * (∑ k ∈ range (K - i), g k - ∑ k ∈ range K, g k) +
∑ i ∈ range K, f i * ∑ k ∈ range K, g k := by
rw [← sum_add_distrib]; simp [(mul_add _ _ _).symm]
have two_mul_two : (4 : α) = 2 * 2 := by norm_num
have hQ0 : Q ≠ 0 := fun h ↦ by simp [h, lt_irrefl] at hQε0
have h2Q0 : 2 * Q ≠ 0 := mul_ne_zero two_ne_zero hQ0
have hε : ε / (2 * P) * P + ε / (4 * Q) * (2 * Q) = ε := by
rw [← div_div, div_mul_cancel₀ _ (Ne.symm (ne_of_lt hP0)), two_mul_two, mul_assoc, ← div_div,
div_mul_cancel₀ _ h2Q0, add_halves]
have hNMK : max N M + 1 < K :=
lt_of_lt_of_le (by rw [two_mul]; exact lt_add_of_pos_left _ (Nat.succ_pos _)) hK
have hKN : N < K :=
calc
N ≤ max N M := le_max_left _ _
_ < max N M + 1 := Nat.lt_succ_self _
_ < K := hNMK
have hsumlesum :
(∑ i ∈ range (max N M + 1),
abv (f i) * abv ((∑ k ∈ range (K - i), g k) - ∑ k ∈ range K, g k)) ≤
∑ i ∈ range (max N M + 1), abv (f i) * (ε / (2 * P)) := by
gcongr with m hmJ
refine le_of_lt $ hN (K - m) (le_tsub_of_add_le_left $ hK.trans' ?_) K hKN.le
rw [two_mul]
gcongr
· exact (mem_range.1 hmJ).le
· exact Nat.le_succ_of_le (le_max_left _ _)
have hsumltP : (∑ n ∈ range (max N M + 1), abv (f n)) < P :=
calc
(∑ n ∈ range (max N M + 1), abv (f n)) = |∑ n ∈ range (max N M + 1), abv (f n)| :=
Eq.symm (abs_of_nonneg (sum_nonneg fun x _ ↦ abv_nonneg abv (f x)))
_ < P := hP (max N M + 1)
rw [h₁, h₂, h₃, sum_mul, ← sub_sub, sub_right_comm, sub_self, zero_sub, abv_neg abv]
refine lt_of_le_of_lt (IsAbsoluteValue.abv_sum _ _ _) ?_
suffices
(∑ i ∈ range (max N M + 1),
abv (f i) * abv ((∑ k ∈ range (K - i), g k) - ∑ k ∈ range K, g k)) +
((∑ i ∈ range K, abv (f i) * abv ((∑ k ∈ range (K - i), g k) - ∑ k ∈ range K, g k)) -
∑ i ∈ range (max N M + 1),
abv (f i) * abv ((∑ k ∈ range (K - i), g k) - ∑ k ∈ range K, g k)) <
ε / (2 * P) * P + ε / (4 * Q) * (2 * Q) by
rw [hε] at this
simpa [abv_mul abv] using this
gcongr
· exact lt_of_le_of_lt hsumlesum
(by rw [← sum_mul, mul_comm]; gcongr)
rw [sum_range_sub_sum_range (le_of_lt hNMK)]
calc
(∑ i ∈ (range K).filter fun k ↦ max N M + 1 ≤ k,
abv (f i) * abv ((∑ k ∈ range (K - i), g k) - ∑ k ∈ range K, g k)) ≤
∑ i ∈ (range K).filter fun k ↦ max N M + 1 ≤ k, abv (f i) * (2 * Q) := by
gcongr
rw [sub_eq_add_neg]
refine le_trans (abv_add _ _ _) ?_
rw [two_mul, abv_neg abv]
gcongr <;> exact le_of_lt (hQ _)
_ < ε / (4 * Q) * (2 * Q) := by
rw [← sum_mul, ← sum_range_sub_sum_range (le_of_lt hNMK)]
have := lt_of_le_of_lt (abv_nonneg _ _) (hQ 0)
gcongr
exact (le_abs_self _).trans_lt $ hM _ ((Nat.le_succ_of_le (le_max_right _ _)).trans hNMK.le)
_ $ Nat.le_succ_of_le $ le_max_right _ _
|
import Mathlib.Computability.DFA
import Mathlib.Data.Fintype.Powerset
#align_import computability.NFA from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514"
open Set
open Computability
universe u v
-- Porting note: Required as `NFA` is used in mathlib3
set_option linter.uppercaseLean3 false
structure NFA (α : Type u) (σ : Type v) where
step : σ → α → Set σ
start : Set σ
accept : Set σ
#align NFA NFA
variable {α : Type u} {σ σ' : Type v} (M : NFA α σ)
namespace NFA
instance : Inhabited (NFA α σ) :=
⟨NFA.mk (fun _ _ => ∅) ∅ ∅⟩
def stepSet (S : Set σ) (a : α) : Set σ :=
⋃ s ∈ S, M.step s a
#align NFA.step_set NFA.stepSet
| Mathlib/Computability/NFA.lean | 53 | 54 | theorem mem_stepSet (s : σ) (S : Set σ) (a : α) : s ∈ M.stepSet S a ↔ ∃ t ∈ S, s ∈ M.step t a := by |
simp [stepSet]
|
import Mathlib.Combinatorics.Quiver.Path
import Mathlib.Combinatorics.Quiver.Push
#align_import combinatorics.quiver.symmetric from "leanprover-community/mathlib"@"706d88f2b8fdfeb0b22796433d7a6c1a010af9f2"
universe v u w v'
namespace Quiver
-- Porting note: no hasNonemptyInstance linter yet
def Symmetrify (V : Type*) := V
#align quiver.symmetrify Quiver.Symmetrify
instance symmetrifyQuiver (V : Type u) [Quiver V] : Quiver (Symmetrify V) :=
⟨fun a b : V ↦ Sum (a ⟶ b) (b ⟶ a)⟩
variable (U V W : Type*) [Quiver.{u + 1} U] [Quiver.{v + 1} V] [Quiver.{w + 1} W]
class HasReverse where
reverse' : ∀ {a b : V}, (a ⟶ b) → (b ⟶ a)
#align quiver.has_reverse Quiver.HasReverse
def reverse {V} [Quiver.{v + 1} V] [HasReverse V] {a b : V} : (a ⟶ b) → (b ⟶ a) :=
HasReverse.reverse'
#align quiver.reverse Quiver.reverse
class HasInvolutiveReverse extends HasReverse V where
inv' : ∀ {a b : V} (f : a ⟶ b), reverse (reverse f) = f
#align quiver.has_involutive_reverse Quiver.HasInvolutiveReverse
variable {U V W}
@[simp]
theorem reverse_reverse [h : HasInvolutiveReverse V] {a b : V} (f : a ⟶ b) :
reverse (reverse f) = f := by apply h.inv'
#align quiver.reverse_reverse Quiver.reverse_reverse
@[simp]
theorem reverse_inj [h : HasInvolutiveReverse V] {a b : V}
(f g : a ⟶ b) : reverse f = reverse g ↔ f = g := by
constructor
· rintro h
simpa using congr_arg Quiver.reverse h
· rintro h
congr
#align quiver.reverse_inj Quiver.reverse_inj
theorem eq_reverse_iff [h : HasInvolutiveReverse V] {a b : V} (f : a ⟶ b)
(g : b ⟶ a) : f = reverse g ↔ reverse f = g := by
rw [← reverse_inj, reverse_reverse]
#align quiver.eq_reverse_iff Quiver.eq_reverse_iff
instance : HasReverse (Symmetrify V) :=
⟨fun e => e.swap⟩
instance :
HasInvolutiveReverse
(Symmetrify V) where
toHasReverse := ⟨fun e ↦ e.swap⟩
inv' e := congr_fun Sum.swap_swap_eq e
@[simp]
theorem symmetrify_reverse {a b : Symmetrify V} (e : a ⟶ b) : reverse e = e.swap :=
rfl
#align quiver.symmetrify_reverse Quiver.symmetrify_reverse
section Paths
abbrev Hom.toPos {X Y : V} (f : X ⟶ Y) : (Quiver.symmetrifyQuiver V).Hom X Y :=
Sum.inl f
#align quiver.hom.to_pos Quiver.Hom.toPos
abbrev Hom.toNeg {X Y : V} (f : X ⟶ Y) : (Quiver.symmetrifyQuiver V).Hom Y X :=
Sum.inr f
#align quiver.hom.to_neg Quiver.Hom.toNeg
@[simp]
def Path.reverse [HasReverse V] {a : V} : ∀ {b}, Path a b → Path b a
| _, Path.nil => Path.nil
| _, Path.cons p e => (Quiver.reverse e).toPath.comp p.reverse
#align quiver.path.reverse Quiver.Path.reverse
@[simp]
theorem Path.reverse_toPath [HasReverse V] {a b : V} (f : a ⟶ b) :
f.toPath.reverse = (Quiver.reverse f).toPath :=
rfl
#align quiver.path.reverse_to_path Quiver.Path.reverse_toPath
@[simp]
theorem Path.reverse_comp [HasReverse V] {a b c : V} (p : Path a b) (q : Path b c) :
(p.comp q).reverse = q.reverse.comp p.reverse := by
induction' q with _ _ _ _ h
· simp
· simp [h]
#align quiver.path.reverse_comp Quiver.Path.reverse_comp
@[simp]
| Mathlib/Combinatorics/Quiver/Symmetric.lean | 158 | 163 | theorem Path.reverse_reverse [h : HasInvolutiveReverse V] {a b : V} (p : Path a b) :
p.reverse.reverse = p := by |
induction' p with _ _ _ _ h
· simp
· rw [Path.reverse, Path.reverse_comp, h, Path.reverse_toPath, Quiver.reverse_reverse]
rfl
|
import Mathlib.Topology.EMetricSpace.Basic
#align_import topology.metric_space.metric_separated from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2"
open EMetric Set
noncomputable section
def IsMetricSeparated {X : Type*} [EMetricSpace X] (s t : Set X) :=
∃ r, r ≠ 0 ∧ ∀ x ∈ s, ∀ y ∈ t, r ≤ edist x y
#align is_metric_separated IsMetricSeparated
namespace IsMetricSeparated
variable {X : Type*} [EMetricSpace X] {s t : Set X} {x y : X}
@[symm]
theorem symm (h : IsMetricSeparated s t) : IsMetricSeparated t s :=
let ⟨r, r0, hr⟩ := h
⟨r, r0, fun y hy x hx => edist_comm x y ▸ hr x hx y hy⟩
#align is_metric_separated.symm IsMetricSeparated.symm
theorem comm : IsMetricSeparated s t ↔ IsMetricSeparated t s :=
⟨symm, symm⟩
#align is_metric_separated.comm IsMetricSeparated.comm
@[simp]
theorem empty_left (s : Set X) : IsMetricSeparated ∅ s :=
⟨1, one_ne_zero, fun _x => False.elim⟩
#align is_metric_separated.empty_left IsMetricSeparated.empty_left
@[simp]
theorem empty_right (s : Set X) : IsMetricSeparated s ∅ :=
(empty_left s).symm
#align is_metric_separated.empty_right IsMetricSeparated.empty_right
protected theorem disjoint (h : IsMetricSeparated s t) : Disjoint s t :=
let ⟨r, r0, hr⟩ := h
Set.disjoint_left.mpr fun x hx1 hx2 => r0 <| by simpa using hr x hx1 x hx2
#align is_metric_separated.disjoint IsMetricSeparated.disjoint
theorem subset_compl_right (h : IsMetricSeparated s t) : s ⊆ tᶜ := fun _ hs ht =>
h.disjoint.le_bot ⟨hs, ht⟩
#align is_metric_separated.subset_compl_right IsMetricSeparated.subset_compl_right
@[mono]
theorem mono {s' t'} (hs : s ⊆ s') (ht : t ⊆ t') :
IsMetricSeparated s' t' → IsMetricSeparated s t := fun ⟨r, r0, hr⟩ =>
⟨r, r0, fun x hx y hy => hr x (hs hx) y (ht hy)⟩
#align is_metric_separated.mono IsMetricSeparated.mono
theorem mono_left {s'} (h' : IsMetricSeparated s' t) (hs : s ⊆ s') : IsMetricSeparated s t :=
h'.mono hs Subset.rfl
#align is_metric_separated.mono_left IsMetricSeparated.mono_left
theorem mono_right {t'} (h' : IsMetricSeparated s t') (ht : t ⊆ t') : IsMetricSeparated s t :=
h'.mono Subset.rfl ht
#align is_metric_separated.mono_right IsMetricSeparated.mono_right
theorem union_left {s'} (h : IsMetricSeparated s t) (h' : IsMetricSeparated s' t) :
IsMetricSeparated (s ∪ s') t := by
rcases h, h' with ⟨⟨r, r0, hr⟩, ⟨r', r0', hr'⟩⟩
refine ⟨min r r', ?_, fun x hx y hy => hx.elim ?_ ?_⟩
· rw [← pos_iff_ne_zero] at r0 r0' ⊢
exact lt_min r0 r0'
· exact fun hx => (min_le_left _ _).trans (hr _ hx _ hy)
· exact fun hx => (min_le_right _ _).trans (hr' _ hx _ hy)
#align is_metric_separated.union_left IsMetricSeparated.union_left
@[simp]
theorem union_left_iff {s'} :
IsMetricSeparated (s ∪ s') t ↔ IsMetricSeparated s t ∧ IsMetricSeparated s' t :=
⟨fun h => ⟨h.mono_left subset_union_left, h.mono_left subset_union_right⟩, fun h =>
h.1.union_left h.2⟩
#align is_metric_separated.union_left_iff IsMetricSeparated.union_left_iff
theorem union_right {t'} (h : IsMetricSeparated s t) (h' : IsMetricSeparated s t') :
IsMetricSeparated s (t ∪ t') :=
(h.symm.union_left h'.symm).symm
#align is_metric_separated.union_right IsMetricSeparated.union_right
@[simp]
theorem union_right_iff {t'} :
IsMetricSeparated s (t ∪ t') ↔ IsMetricSeparated s t ∧ IsMetricSeparated s t' :=
comm.trans <| union_left_iff.trans <| and_congr comm comm
#align is_metric_separated.union_right_iff IsMetricSeparated.union_right_iff
| Mathlib/Topology/MetricSpace/MetricSeparated.lean | 106 | 109 | theorem finite_iUnion_left_iff {ι : Type*} {I : Set ι} (hI : I.Finite) {s : ι → Set X}
{t : Set X} : IsMetricSeparated (⋃ i ∈ I, s i) t ↔ ∀ i ∈ I, IsMetricSeparated (s i) t := by |
refine Finite.induction_on hI (by simp) @fun i I _ _ hI => ?_
rw [biUnion_insert, forall_mem_insert, union_left_iff, hI]
|
import Mathlib.Analysis.Convolution
import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd
import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup
import Mathlib.Analysis.Analytic.IsolatedZeros
import Mathlib.Analysis.Complex.CauchyIntegral
#align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090"
noncomputable section
set_option linter.uppercaseLean3 false
open Filter intervalIntegral Set Real MeasureTheory
open scoped Nat Topology Real
section BetaIntegral
namespace Complex
noncomputable def betaIntegral (u v : ℂ) : ℂ :=
∫ x : ℝ in (0)..1, (x : ℂ) ^ (u - 1) * (1 - (x : ℂ)) ^ (v - 1)
#align complex.beta_integral Complex.betaIntegral
theorem betaIntegral_convergent_left {u : ℂ} (hu : 0 < re u) (v : ℂ) :
IntervalIntegrable (fun x =>
(x : ℂ) ^ (u - 1) * (1 - (x : ℂ)) ^ (v - 1) : ℝ → ℂ) volume 0 (1 / 2) := by
apply IntervalIntegrable.mul_continuousOn
· refine intervalIntegral.intervalIntegrable_cpow' ?_
rwa [sub_re, one_re, ← zero_sub, sub_lt_sub_iff_right]
· apply ContinuousAt.continuousOn
intro x hx
rw [uIcc_of_le (by positivity : (0 : ℝ) ≤ 1 / 2)] at hx
apply ContinuousAt.cpow
· exact (continuous_const.sub continuous_ofReal).continuousAt
· exact continuousAt_const
· norm_cast
exact ofReal_mem_slitPlane.2 <| by linarith only [hx.2]
#align complex.beta_integral_convergent_left Complex.betaIntegral_convergent_left
| Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean | 80 | 90 | theorem betaIntegral_convergent {u v : ℂ} (hu : 0 < re u) (hv : 0 < re v) :
IntervalIntegrable (fun x =>
(x : ℂ) ^ (u - 1) * (1 - (x : ℂ)) ^ (v - 1) : ℝ → ℂ) volume 0 1 := by |
refine (betaIntegral_convergent_left hu v).trans ?_
rw [IntervalIntegrable.iff_comp_neg]
convert ((betaIntegral_convergent_left hv u).comp_add_right 1).symm using 1
· ext1 x
conv_lhs => rw [mul_comm]
congr 2 <;> · push_cast; ring
· norm_num
· norm_num
|
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Algebra.Order.Archimedean
import Mathlib.Data.Set.Lattice
#align_import group_theory.archimedean from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6"
open Set
variable {G : Type*} [LinearOrderedAddCommGroup G] [Archimedean G]
| Mathlib/GroupTheory/Archimedean.lean | 40 | 54 | theorem AddSubgroup.cyclic_of_min {H : AddSubgroup G} {a : G}
(ha : IsLeast { g : G | g ∈ H ∧ 0 < g } a) : H = AddSubgroup.closure {a} := by |
obtain ⟨⟨a_in, a_pos⟩, a_min⟩ := ha
refine le_antisymm ?_ (H.closure_le.mpr <| by simp [a_in])
intro g g_in
obtain ⟨k, ⟨nonneg, lt⟩, _⟩ := existsUnique_zsmul_near_of_pos' a_pos g
have h_zero : g - k • a = 0 := by
by_contra h
have h : a ≤ g - k • a := by
refine a_min ⟨?_, ?_⟩
· exact AddSubgroup.sub_mem H g_in (AddSubgroup.zsmul_mem H a_in k)
· exact lt_of_le_of_ne nonneg (Ne.symm h)
have h' : ¬a ≤ g - k • a := not_le.mpr lt
contradiction
simp [sub_eq_zero.mp h_zero, AddSubgroup.mem_closure_singleton]
|
import Mathlib.Analysis.NormedSpace.FiniteDimension
import Mathlib.Analysis.RCLike.Basic
#align_import data.is_R_or_C.lemmas from "leanprover-community/mathlib"@"468b141b14016d54b479eb7a0fff1e360b7e3cf6"
variable {K E : Type*} [RCLike K]
namespace RCLike
@[simp, rclike_simps]
| Mathlib/Analysis/RCLike/Lemmas.lean | 71 | 74 | theorem reCLM_norm : ‖(reCLM : K →L[ℝ] ℝ)‖ = 1 := by |
apply le_antisymm (LinearMap.mkContinuous_norm_le _ zero_le_one _)
convert ContinuousLinearMap.ratio_le_opNorm (reCLM : K →L[ℝ] ℝ) (1 : K)
simp
|
import Mathlib.Order.Interval.Finset.Nat
#align_import data.fin.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
assert_not_exists MonoidWithZero
open Finset Fin Function
namespace Fin
variable (n : ℕ)
instance instLocallyFiniteOrder : LocallyFiniteOrder (Fin n) :=
OrderIso.locallyFiniteOrder Fin.orderIsoSubtype
instance instLocallyFiniteOrderBot : LocallyFiniteOrderBot (Fin n) :=
OrderIso.locallyFiniteOrderBot Fin.orderIsoSubtype
instance instLocallyFiniteOrderTop : ∀ n, LocallyFiniteOrderTop (Fin n)
| 0 => IsEmpty.toLocallyFiniteOrderTop
| _ + 1 => inferInstance
variable {n} (a b : Fin n)
theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : ℕ) b).fin n :=
rfl
#align fin.Icc_eq_finset_subtype Fin.Icc_eq_finset_subtype
theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : ℕ) b).fin n :=
rfl
#align fin.Ico_eq_finset_subtype Fin.Ico_eq_finset_subtype
theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : ℕ) b).fin n :=
rfl
#align fin.Ioc_eq_finset_subtype Fin.Ioc_eq_finset_subtype
theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : ℕ) b).fin n :=
rfl
#align fin.Ioo_eq_finset_subtype Fin.Ioo_eq_finset_subtype
theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : ℕ) b).fin n := rfl
#align fin.uIcc_eq_finset_subtype Fin.uIcc_eq_finset_subtype
@[simp]
theorem map_valEmbedding_Icc : (Icc a b).map Fin.valEmbedding = Icc ↑a ↑b := by
simp [Icc_eq_finset_subtype, Finset.fin, Finset.map_map, Icc_filter_lt_of_lt_right]
#align fin.map_subtype_embedding_Icc Fin.map_valEmbedding_Icc
@[simp]
theorem map_valEmbedding_Ico : (Ico a b).map Fin.valEmbedding = Ico ↑a ↑b := by
simp [Ico_eq_finset_subtype, Finset.fin, Finset.map_map]
#align fin.map_subtype_embedding_Ico Fin.map_valEmbedding_Ico
@[simp]
| Mathlib/Order/Interval/Finset/Fin.lean | 89 | 90 | theorem map_valEmbedding_Ioc : (Ioc a b).map Fin.valEmbedding = Ioc ↑a ↑b := by |
simp [Ioc_eq_finset_subtype, Finset.fin, Finset.map_map, Ioc_filter_lt_of_lt_right]
|
import Mathlib.Data.Finset.Image
#align_import data.finset.card from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
assert_not_exists MonoidWithZero
-- TODO: After a lot more work,
-- assert_not_exists OrderedCommMonoid
open Function Multiset Nat
variable {α β R : Type*}
namespace Finset
variable {s t : Finset α} {a b : α}
def card (s : Finset α) : ℕ :=
Multiset.card s.1
#align finset.card Finset.card
theorem card_def (s : Finset α) : s.card = Multiset.card s.1 :=
rfl
#align finset.card_def Finset.card_def
@[simp] lemma card_val (s : Finset α) : Multiset.card s.1 = s.card := rfl
#align finset.card_val Finset.card_val
@[simp]
theorem card_mk {m nodup} : (⟨m, nodup⟩ : Finset α).card = Multiset.card m :=
rfl
#align finset.card_mk Finset.card_mk
@[simp]
theorem card_empty : card (∅ : Finset α) = 0 :=
rfl
#align finset.card_empty Finset.card_empty
@[gcongr]
theorem card_le_card : s ⊆ t → s.card ≤ t.card :=
Multiset.card_le_card ∘ val_le_iff.mpr
#align finset.card_le_of_subset Finset.card_le_card
@[mono]
theorem card_mono : Monotone (@card α) := by apply card_le_card
#align finset.card_mono Finset.card_mono
@[simp] lemma card_eq_zero : s.card = 0 ↔ s = ∅ := card_eq_zero.trans val_eq_zero
lemma card_ne_zero : s.card ≠ 0 ↔ s.Nonempty := card_eq_zero.ne.trans nonempty_iff_ne_empty.symm
lemma card_pos : 0 < s.card ↔ s.Nonempty := Nat.pos_iff_ne_zero.trans card_ne_zero
#align finset.card_eq_zero Finset.card_eq_zero
#align finset.card_pos Finset.card_pos
alias ⟨_, Nonempty.card_pos⟩ := card_pos
alias ⟨_, Nonempty.card_ne_zero⟩ := card_ne_zero
#align finset.nonempty.card_pos Finset.Nonempty.card_pos
theorem card_ne_zero_of_mem (h : a ∈ s) : s.card ≠ 0 :=
(not_congr card_eq_zero).2 <| ne_empty_of_mem h
#align finset.card_ne_zero_of_mem Finset.card_ne_zero_of_mem
@[simp]
theorem card_singleton (a : α) : card ({a} : Finset α) = 1 :=
Multiset.card_singleton _
#align finset.card_singleton Finset.card_singleton
theorem card_singleton_inter [DecidableEq α] : ({a} ∩ s).card ≤ 1 := by
cases' Finset.decidableMem a s with h h
· simp [Finset.singleton_inter_of_not_mem h]
· simp [Finset.singleton_inter_of_mem h]
#align finset.card_singleton_inter Finset.card_singleton_inter
@[simp]
theorem card_cons (h : a ∉ s) : (s.cons a h).card = s.card + 1 :=
Multiset.card_cons _ _
#align finset.card_cons Finset.card_cons
section InsertErase
variable [DecidableEq α]
@[simp]
theorem card_insert_of_not_mem (h : a ∉ s) : (insert a s).card = s.card + 1 := by
rw [← cons_eq_insert _ _ h, card_cons]
#align finset.card_insert_of_not_mem Finset.card_insert_of_not_mem
| Mathlib/Data/Finset/Card.lean | 111 | 111 | theorem card_insert_of_mem (h : a ∈ s) : card (insert a s) = s.card := by | rw [insert_eq_of_mem h]
|
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {α : Type u} [Preorder α] {a : α} : ¬a < a := _root_.lt_irrefl a
| Mathlib/Tactic/Linarith/Lemmas.lean | 27 | 28 | theorem eq_of_eq_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0 := by |
simp [*]
|
import Mathlib.Combinatorics.Enumerative.DoubleCounting
import Mathlib.Combinatorics.SimpleGraph.AdjMatrix
import Mathlib.Combinatorics.SimpleGraph.Basic
import Mathlib.Data.Set.Finite
#align_import combinatorics.simple_graph.strongly_regular from "leanprover-community/mathlib"@"2b35fc7bea4640cb75e477e83f32fbd538920822"
open Finset
universe u
namespace SimpleGraph
variable {V : Type u} [Fintype V] [DecidableEq V]
variable (G : SimpleGraph V) [DecidableRel G.Adj]
structure IsSRGWith (n k ℓ μ : ℕ) : Prop where
card : Fintype.card V = n
regular : G.IsRegularOfDegree k
of_adj : ∀ v w : V, G.Adj v w → Fintype.card (G.commonNeighbors v w) = ℓ
of_not_adj : Pairwise fun v w => ¬G.Adj v w → Fintype.card (G.commonNeighbors v w) = μ
set_option linter.uppercaseLean3 false in
#align simple_graph.is_SRG_with SimpleGraph.IsSRGWith
variable {G} {n k ℓ μ : ℕ}
theorem bot_strongly_regular : (⊥ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 ℓ 0 where
card := rfl
regular := bot_degree
of_adj := fun v w h => h.elim
of_not_adj := fun v w _h => by
simp only [card_eq_zero, Fintype.card_ofFinset, forall_true_left, not_false_iff, bot_adj]
ext
simp [mem_commonNeighbors]
#align simple_graph.bot_strongly_regular SimpleGraph.bot_strongly_regular
theorem IsSRGWith.top :
(⊤ : SimpleGraph V).IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) μ where
card := rfl
regular := IsRegularOfDegree.top
of_adj := fun v w h => by
rw [card_commonNeighbors_top]
exact h
of_not_adj := fun v w h h' => False.elim (h' ((top_adj v w).2 h))
set_option linter.uppercaseLean3 false in
#align simple_graph.is_SRG_with.top SimpleGraph.IsSRGWith.top
theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k ℓ μ) :
(G.neighborFinset v ∪ G.neighborFinset w).card =
2 * k - Fintype.card (G.commonNeighbors v w) := by
apply Nat.add_right_cancel (m := Fintype.card (G.commonNeighbors v w))
rw [Nat.sub_add_cancel, ← Set.toFinset_card]
-- Porting note: Set.toFinset_inter needs workaround to use unification to solve for one of the
-- instance arguments:
· simp [commonNeighbors, @Set.toFinset_inter _ _ _ _ _ _ (_),
← neighborFinset_def, Finset.card_union_add_card_inter, card_neighborFinset_eq_degree,
h.regular.degree_eq, two_mul]
· apply le_trans (card_commonNeighbors_le_degree_left _ _ _)
simp [h.regular.degree_eq, two_mul]
set_option linter.uppercaseLean3 false in
#align simple_graph.is_SRG_with.card_neighbor_finset_union_eq SimpleGraph.IsSRGWith.card_neighborFinset_union_eq
| Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean | 102 | 106 | theorem IsSRGWith.card_neighborFinset_union_of_not_adj {v w : V} (h : G.IsSRGWith n k ℓ μ)
(hne : v ≠ w) (ha : ¬G.Adj v w) :
(G.neighborFinset v ∪ G.neighborFinset w).card = 2 * k - μ := by |
rw [← h.of_not_adj hne ha]
apply h.card_neighborFinset_union_eq
|
import Mathlib.Analysis.SpecialFunctions.Exp
import Mathlib.Data.Nat.Factorization.Basic
import Mathlib.Analysis.NormedSpace.Real
#align_import analysis.special_functions.log.basic from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690"
open Set Filter Function
open Topology
noncomputable section
namespace Real
variable {x y : ℝ}
-- @[pp_nodot] -- Porting note: removed
noncomputable def log (x : ℝ) : ℝ :=
if hx : x = 0 then 0 else expOrderIso.symm ⟨|x|, abs_pos.2 hx⟩
#align real.log Real.log
theorem log_of_ne_zero (hx : x ≠ 0) : log x = expOrderIso.symm ⟨|x|, abs_pos.2 hx⟩ :=
dif_neg hx
#align real.log_of_ne_zero Real.log_of_ne_zero
theorem log_of_pos (hx : 0 < x) : log x = expOrderIso.symm ⟨x, hx⟩ := by
rw [log_of_ne_zero hx.ne']
congr
exact abs_of_pos hx
#align real.log_of_pos Real.log_of_pos
theorem exp_log_eq_abs (hx : x ≠ 0) : exp (log x) = |x| := by
rw [log_of_ne_zero hx, ← coe_expOrderIso_apply, OrderIso.apply_symm_apply, Subtype.coe_mk]
#align real.exp_log_eq_abs Real.exp_log_eq_abs
theorem exp_log (hx : 0 < x) : exp (log x) = x := by
rw [exp_log_eq_abs hx.ne']
exact abs_of_pos hx
#align real.exp_log Real.exp_log
theorem exp_log_of_neg (hx : x < 0) : exp (log x) = -x := by
rw [exp_log_eq_abs (ne_of_lt hx)]
exact abs_of_neg hx
#align real.exp_log_of_neg Real.exp_log_of_neg
theorem le_exp_log (x : ℝ) : x ≤ exp (log x) := by
by_cases h_zero : x = 0
· rw [h_zero, log, dif_pos rfl, exp_zero]
exact zero_le_one
· rw [exp_log_eq_abs h_zero]
exact le_abs_self _
#align real.le_exp_log Real.le_exp_log
@[simp]
theorem log_exp (x : ℝ) : log (exp x) = x :=
exp_injective <| exp_log (exp_pos x)
#align real.log_exp Real.log_exp
theorem surjOn_log : SurjOn log (Ioi 0) univ := fun x _ => ⟨exp x, exp_pos x, log_exp x⟩
#align real.surj_on_log Real.surjOn_log
theorem log_surjective : Surjective log := fun x => ⟨exp x, log_exp x⟩
#align real.log_surjective Real.log_surjective
@[simp]
theorem range_log : range log = univ :=
log_surjective.range_eq
#align real.range_log Real.range_log
@[simp]
theorem log_zero : log 0 = 0 :=
dif_pos rfl
#align real.log_zero Real.log_zero
@[simp]
theorem log_one : log 1 = 0 :=
exp_injective <| by rw [exp_log zero_lt_one, exp_zero]
#align real.log_one Real.log_one
@[simp]
theorem log_abs (x : ℝ) : log |x| = log x := by
by_cases h : x = 0
· simp [h]
· rw [← exp_eq_exp, exp_log_eq_abs h, exp_log_eq_abs (abs_pos.2 h).ne', abs_abs]
#align real.log_abs Real.log_abs
@[simp]
theorem log_neg_eq_log (x : ℝ) : log (-x) = log x := by rw [← log_abs x, ← log_abs (-x), abs_neg]
#align real.log_neg_eq_log Real.log_neg_eq_log
theorem sinh_log {x : ℝ} (hx : 0 < x) : sinh (log x) = (x - x⁻¹) / 2 := by
rw [sinh_eq, exp_neg, exp_log hx]
#align real.sinh_log Real.sinh_log
| Mathlib/Analysis/SpecialFunctions/Log/Basic.lean | 118 | 119 | theorem cosh_log {x : ℝ} (hx : 0 < x) : cosh (log x) = (x + x⁻¹) / 2 := by |
rw [cosh_eq, exp_neg, exp_log hx]
|
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
| Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean | 110 | 119 | 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]
|
import Mathlib.Analysis.Convex.Between
import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic
import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
import Mathlib.Topology.MetricSpace.Holder
import Mathlib.Topology.MetricSpace.MetricSeparated
#align_import measure_theory.measure.hausdorff from "leanprover-community/mathlib"@"3d5c4a7a5fb0d982f97ed953161264f1dbd90ead"
open scoped NNReal ENNReal Topology
open EMetric Set Function Filter Encodable FiniteDimensional TopologicalSpace
noncomputable section
variable {ι X Y : Type*} [EMetricSpace X] [EMetricSpace Y]
namespace MeasureTheory
namespace OuterMeasure
def IsMetric (μ : OuterMeasure X) : Prop :=
∀ s t : Set X, IsMetricSeparated s t → μ (s ∪ t) = μ s + μ t
#align measure_theory.outer_measure.is_metric MeasureTheory.OuterMeasure.IsMetric
def mkMetric'.pre (m : Set X → ℝ≥0∞) (r : ℝ≥0∞) : OuterMeasure X :=
boundedBy <| extend fun s (_ : diam s ≤ r) => m s
#align measure_theory.outer_measure.mk_metric'.pre MeasureTheory.OuterMeasure.mkMetric'.pre
def mkMetric' (m : Set X → ℝ≥0∞) : OuterMeasure X :=
⨆ r > 0, mkMetric'.pre m r
#align measure_theory.outer_measure.mk_metric' MeasureTheory.OuterMeasure.mkMetric'
def mkMetric (m : ℝ≥0∞ → ℝ≥0∞) : OuterMeasure X :=
mkMetric' fun s => m (diam s)
#align measure_theory.outer_measure.mk_metric MeasureTheory.OuterMeasure.mkMetric
namespace mkMetric'
variable {m : Set X → ℝ≥0∞} {r : ℝ≥0∞} {μ : OuterMeasure X} {s : Set X}
| Mathlib/MeasureTheory/Measure/Hausdorff.lean | 270 | 271 | theorem le_pre : μ ≤ pre m r ↔ ∀ s : Set X, diam s ≤ r → μ s ≤ m s := by |
simp only [pre, le_boundedBy, extend, le_iInf_iff]
|
import Mathlib.Algebra.Algebra.Subalgebra.Operations
import Mathlib.Algebra.Ring.Fin
import Mathlib.RingTheory.Ideal.Quotient
#align_import ring_theory.ideal.quotient_operations from "leanprover-community/mathlib"@"b88d81c84530450a8989e918608e5960f015e6c8"
universe u v w
namespace Ideal
open Function RingHom
variable {R : Type u} {S : Type v} {F : Type w} [CommRing R] [Semiring S]
@[simp]
theorem map_quotient_self (I : Ideal R) : map (Quotient.mk I) I = ⊥ :=
eq_bot_iff.2 <|
Ideal.map_le_iff_le_comap.2 fun _ hx =>
(Submodule.mem_bot (R ⧸ I)).2 <| Ideal.Quotient.eq_zero_iff_mem.2 hx
#align ideal.map_quotient_self Ideal.map_quotient_self
@[simp]
theorem mk_ker {I : Ideal R} : ker (Quotient.mk I) = I := by
ext
rw [ker, mem_comap, Submodule.mem_bot, Quotient.eq_zero_iff_mem]
#align ideal.mk_ker Ideal.mk_ker
| Mathlib/RingTheory/Ideal/QuotientOperations.lean | 136 | 138 | theorem map_mk_eq_bot_of_le {I J : Ideal R} (h : I ≤ J) : I.map (Quotient.mk J) = ⊥ := by |
rw [map_eq_bot_iff_le_ker, mk_ker]
exact h
|
import Mathlib.MeasureTheory.Covering.VitaliFamily
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.MeasureTheory.Function.AEMeasurableOrder
import Mathlib.MeasureTheory.Integral.Lebesgue
import Mathlib.MeasureTheory.Integral.Average
import Mathlib.MeasureTheory.Decomposition.Lebesgue
#align_import measure_theory.covering.differentiation from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2"
open MeasureTheory Metric Set Filter TopologicalSpace MeasureTheory.Measure
open scoped Filter ENNReal MeasureTheory NNReal Topology
variable {α : Type*} [MetricSpace α] {m0 : MeasurableSpace α} {μ : Measure α} (v : VitaliFamily μ)
{E : Type*} [NormedAddCommGroup E]
namespace VitaliFamily
noncomputable def limRatio (ρ : Measure α) (x : α) : ℝ≥0∞ :=
limUnder (v.filterAt x) fun a => ρ a / μ a
#align vitali_family.lim_ratio VitaliFamily.limRatio
theorem ae_eventually_measure_pos [SecondCountableTopology α] :
∀ᵐ x ∂μ, ∀ᶠ a in v.filterAt x, 0 < μ a := by
set s := {x | ¬∀ᶠ a in v.filterAt x, 0 < μ a} with hs
simp (config := { zeta := false }) only [not_lt, not_eventually, nonpos_iff_eq_zero] at hs
change μ s = 0
let f : α → Set (Set α) := fun _ => {a | μ a = 0}
have h : v.FineSubfamilyOn f s := by
intro x hx ε εpos
rw [hs] at hx
simp only [frequently_filterAt_iff, exists_prop, gt_iff_lt, mem_setOf_eq] at hx
rcases hx ε εpos with ⟨a, a_sets, ax, μa⟩
exact ⟨a, ⟨a_sets, μa⟩, ax⟩
refine le_antisymm ?_ bot_le
calc
μ s ≤ ∑' x : h.index, μ (h.covering x) := h.measure_le_tsum
_ = ∑' x : h.index, 0 := by congr; ext1 x; exact h.covering_mem x.2
_ = 0 := by simp only [tsum_zero, add_zero]
#align vitali_family.ae_eventually_measure_pos VitaliFamily.ae_eventually_measure_pos
theorem eventually_measure_lt_top [IsLocallyFiniteMeasure μ] (x : α) :
∀ᶠ a in v.filterAt x, μ a < ∞ :=
(μ.finiteAt_nhds x).eventually.filter_mono inf_le_left
#align vitali_family.eventually_measure_lt_top VitaliFamily.eventually_measure_lt_top
| Mathlib/MeasureTheory/Covering/Differentiation.lean | 125 | 149 | theorem measure_le_of_frequently_le [SecondCountableTopology α] [BorelSpace α] {ρ : Measure α}
(ν : Measure α) [IsLocallyFiniteMeasure ν] (hρ : ρ ≪ μ) (s : Set α)
(hs : ∀ x ∈ s, ∃ᶠ a in v.filterAt x, ρ a ≤ ν a) : ρ s ≤ ν s := by |
-- this follows from a covering argument using the sets satisfying `ρ a ≤ ν a`.
apply ENNReal.le_of_forall_pos_le_add fun ε εpos _ => ?_
obtain ⟨U, sU, U_open, νU⟩ : ∃ (U : Set α), s ⊆ U ∧ IsOpen U ∧ ν U ≤ ν s + ε :=
exists_isOpen_le_add s ν (ENNReal.coe_pos.2 εpos).ne'
let f : α → Set (Set α) := fun _ => {a | ρ a ≤ ν a ∧ a ⊆ U}
have h : v.FineSubfamilyOn f s := by
apply v.fineSubfamilyOn_of_frequently f s fun x hx => ?_
have :=
(hs x hx).and_eventually
((v.eventually_filterAt_mem_setsAt x).and
(v.eventually_filterAt_subset_of_nhds (U_open.mem_nhds (sU hx))))
apply Frequently.mono this
rintro a ⟨ρa, _, aU⟩
exact ⟨ρa, aU⟩
haveI : Encodable h.index := h.index_countable.toEncodable
calc
ρ s ≤ ∑' x : h.index, ρ (h.covering x) := h.measure_le_tsum_of_absolutelyContinuous hρ
_ ≤ ∑' x : h.index, ν (h.covering x) := ENNReal.tsum_le_tsum fun x => (h.covering_mem x.2).1
_ = ν (⋃ x : h.index, h.covering x) := by
rw [measure_iUnion h.covering_disjoint_subtype fun i => h.measurableSet_u i.2]
_ ≤ ν U := (measure_mono (iUnion_subset fun i => (h.covering_mem i.2).2))
_ ≤ ν s + ε := νU
|
import Mathlib.Algebra.Field.Defs
import Mathlib.Algebra.GroupWithZero.Units.Lemmas
import Mathlib.Algebra.Ring.Commute
import Mathlib.Algebra.Ring.Invertible
import Mathlib.Order.Synonym
#align_import algebra.field.basic from "leanprover-community/mathlib"@"05101c3df9d9cfe9430edc205860c79b6d660102"
open Function OrderDual Set
universe u
variable {α β K : Type*}
section DivisionMonoid
variable [DivisionMonoid K] [HasDistribNeg K] {a b : K}
theorem one_div_neg_one_eq_neg_one : (1 : K) / -1 = -1 :=
have : -1 * -1 = (1 : K) := by rw [neg_mul_neg, one_mul]
Eq.symm (eq_one_div_of_mul_eq_one_right this)
#align one_div_neg_one_eq_neg_one one_div_neg_one_eq_neg_one
theorem one_div_neg_eq_neg_one_div (a : K) : 1 / -a = -(1 / a) :=
calc
1 / -a = 1 / (-1 * a) := by rw [neg_eq_neg_one_mul]
_ = 1 / a * (1 / -1) := by rw [one_div_mul_one_div_rev]
_ = 1 / a * -1 := by rw [one_div_neg_one_eq_neg_one]
_ = -(1 / a) := by rw [mul_neg, mul_one]
#align one_div_neg_eq_neg_one_div one_div_neg_eq_neg_one_div
theorem div_neg_eq_neg_div (a b : K) : b / -a = -(b / a) :=
calc
b / -a = b * (1 / -a) := by rw [← inv_eq_one_div, division_def]
_ = b * -(1 / a) := by rw [one_div_neg_eq_neg_one_div]
_ = -(b * (1 / a)) := by rw [neg_mul_eq_mul_neg]
_ = -(b / a) := by rw [mul_one_div]
#align div_neg_eq_neg_div div_neg_eq_neg_div
theorem neg_div (a b : K) : -b / a = -(b / a) := by
rw [neg_eq_neg_one_mul, mul_div_assoc, ← neg_eq_neg_one_mul]
#align neg_div neg_div
@[field_simps]
theorem neg_div' (a b : K) : -(b / a) = -b / a := by simp [neg_div]
#align neg_div' neg_div'
@[simp]
theorem neg_div_neg_eq (a b : K) : -a / -b = a / b := by rw [div_neg_eq_neg_div, neg_div, neg_neg]
#align neg_div_neg_eq neg_div_neg_eq
theorem neg_inv : -a⁻¹ = (-a)⁻¹ := by rw [inv_eq_one_div, inv_eq_one_div, div_neg_eq_neg_div]
#align neg_inv neg_inv
theorem div_neg (a : K) : a / -b = -(a / b) := by rw [← div_neg_eq_neg_div]
#align div_neg div_neg
| Mathlib/Algebra/Field/Basic.lean | 135 | 135 | theorem inv_neg : (-a)⁻¹ = -a⁻¹ := by | rw [neg_inv]
|
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order
#align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce"
open Set Filter MeasureTheory MeasurableSpace
open scoped Classical Topology NNReal ENNReal MeasureTheory
universe u v w x y
variable {α β γ δ : Type*} {ι : Sort y} {s t u : Set α}
namespace Real
theorem borel_eq_generateFrom_Ioo_rat :
borel ℝ = .generateFrom (⋃ (a : ℚ) (b : ℚ) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) :=
isTopologicalBasis_Ioo_rat.borel_eq_generateFrom
#align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat
theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Iio (a : ℝ)}) := by
rw [borel_eq_generateFrom_Iio]
refine le_antisymm
(generateFrom_le ?_)
(generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _)
rintro _ ⟨a, rfl⟩
have : IsLUB (range ((↑) : ℚ → ℝ) ∩ Iio a) a := by
simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le]
rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image]
exact MeasurableSet.biUnion (to_countable _)
fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp)
theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Ioi (a : ℝ)}) := by
rw [borel_eq_generateFrom_Ioi]
refine le_antisymm
(generateFrom_le ?_)
(generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _)
rintro _ ⟨a, rfl⟩
have : IsGLB (range ((↑) : ℚ → ℝ) ∩ Ioi a) a := by
simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le]
rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image]
exact MeasurableSet.biUnion (to_countable _)
fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp)
theorem borel_eq_generateFrom_Iic_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Iic (a : ℝ)}) := by
rw [borel_eq_generateFrom_Ioi_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range]
refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;>
rintro _ ⟨q, rfl⟩ <;>
dsimp only <;>
[rw [← compl_Iic]; rw [← compl_Ioi]] <;>
exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q))
theorem borel_eq_generateFrom_Ici_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Ici (a : ℝ)}) := by
rw [borel_eq_generateFrom_Iio_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range]
refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;>
rintro _ ⟨q, rfl⟩ <;>
dsimp only <;>
[rw [← compl_Ici]; rw [← compl_Iio]] <;>
exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q))
theorem isPiSystem_Ioo_rat :
IsPiSystem (⋃ (a : ℚ) (b : ℚ) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := by
convert isPiSystem_Ioo ((↑) : ℚ → ℝ) ((↑) : ℚ → ℝ)
ext x
simp [eq_comm]
#align real.is_pi_system_Ioo_rat Real.isPiSystem_Ioo_rat
theorem isPiSystem_Iio_rat : IsPiSystem (⋃ a : ℚ, {Iio (a : ℝ)}) := by
convert isPiSystem_image_Iio (((↑) : ℚ → ℝ) '' univ)
ext x
simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
theorem isPiSystem_Ioi_rat : IsPiSystem (⋃ a : ℚ, {Ioi (a : ℝ)}) := by
convert isPiSystem_image_Ioi (((↑) : ℚ → ℝ) '' univ)
ext x
simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
| Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean | 101 | 104 | theorem isPiSystem_Iic_rat : IsPiSystem (⋃ a : ℚ, {Iic (a : ℝ)}) := by |
convert isPiSystem_image_Iic (((↑) : ℚ → ℝ) '' univ)
ext x
simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
|
import Mathlib.Algebra.Order.CauSeq.Basic
#align_import data.real.cau_seq_completion from "leanprover-community/mathlib"@"cf4c49c445991489058260d75dae0ff2b1abca28"
variable {α : Type*} [LinearOrderedField α]
namespace CauSeq
section
variable (β : Type*) [Ring β] (abv : β → α) [IsAbsoluteValue abv]
class IsComplete : Prop where
isComplete : ∀ s : CauSeq β abv, ∃ b : β, s ≈ const abv b
#align cau_seq.is_complete CauSeq.IsComplete
#align cau_seq.is_complete.is_complete CauSeq.IsComplete.isComplete
end
section
variable {β : Type*} [Ring β] {abv : β → α} [IsAbsoluteValue abv]
variable [IsComplete β abv]
theorem complete : ∀ s : CauSeq β abv, ∃ b : β, s ≈ const abv b :=
IsComplete.isComplete
#align cau_seq.complete CauSeq.complete
noncomputable def lim (s : CauSeq β abv) : β :=
Classical.choose (complete s)
#align cau_seq.lim CauSeq.lim
theorem equiv_lim (s : CauSeq β abv) : s ≈ const abv (lim s) :=
Classical.choose_spec (complete s)
#align cau_seq.equiv_lim CauSeq.equiv_lim
theorem eq_lim_of_const_equiv {f : CauSeq β abv} {x : β} (h : CauSeq.const abv x ≈ f) : x = lim f :=
const_equiv.mp <| Setoid.trans h <| equiv_lim f
#align cau_seq.eq_lim_of_const_equiv CauSeq.eq_lim_of_const_equiv
theorem lim_eq_of_equiv_const {f : CauSeq β abv} {x : β} (h : f ≈ CauSeq.const abv x) : lim f = x :=
(eq_lim_of_const_equiv <| Setoid.symm h).symm
#align cau_seq.lim_eq_of_equiv_const CauSeq.lim_eq_of_equiv_const
theorem lim_eq_lim_of_equiv {f g : CauSeq β abv} (h : f ≈ g) : lim f = lim g :=
lim_eq_of_equiv_const <| Setoid.trans h <| equiv_lim g
#align cau_seq.lim_eq_lim_of_equiv CauSeq.lim_eq_lim_of_equiv
@[simp]
theorem lim_const (x : β) : lim (const abv x) = x :=
lim_eq_of_equiv_const <| Setoid.refl _
#align cau_seq.lim_const CauSeq.lim_const
theorem lim_add (f g : CauSeq β abv) : lim f + lim g = lim (f + g) :=
eq_lim_of_const_equiv <|
show LimZero (const abv (lim f + lim g) - (f + g)) by
rw [const_add, add_sub_add_comm]
exact add_limZero (Setoid.symm (equiv_lim f)) (Setoid.symm (equiv_lim g))
#align cau_seq.lim_add CauSeq.lim_add
theorem lim_mul_lim (f g : CauSeq β abv) : lim f * lim g = lim (f * g) :=
eq_lim_of_const_equiv <|
show LimZero (const abv (lim f * lim g) - f * g) by
have h :
const abv (lim f * lim g) - f * g =
(const abv (lim f) - f) * g + const abv (lim f) * (const abv (lim g) - g) := by
apply Subtype.ext
rw [coe_add]
simp [sub_mul, mul_sub]
rw [h]
exact
add_limZero (mul_limZero_left _ (Setoid.symm (equiv_lim _)))
(mul_limZero_right _ (Setoid.symm (equiv_lim _)))
#align cau_seq.lim_mul_lim CauSeq.lim_mul_lim
theorem lim_mul (f : CauSeq β abv) (x : β) : lim f * x = lim (f * const abv x) := by
rw [← lim_mul_lim, lim_const]
#align cau_seq.lim_mul CauSeq.lim_mul
theorem lim_neg (f : CauSeq β abv) : lim (-f) = -lim f :=
lim_eq_of_equiv_const
(show LimZero (-f - const abv (-lim f)) by
rw [const_neg, sub_neg_eq_add, add_comm, ← sub_eq_add_neg]
exact Setoid.symm (equiv_lim f))
#align cau_seq.lim_neg CauSeq.lim_neg
theorem lim_eq_zero_iff (f : CauSeq β abv) : lim f = 0 ↔ LimZero f :=
⟨fun h => by
have hf := equiv_lim f
rw [h] at hf
exact (limZero_congr hf).mpr (const_limZero.mpr rfl),
fun h => by
have h₁ : f = f - const abv 0 := ext fun n => by simp [sub_apply, const_apply]
rw [h₁] at h
exact lim_eq_of_equiv_const h⟩
#align cau_seq.lim_eq_zero_iff CauSeq.lim_eq_zero_iff
end
section
variable {β : Type*} [Field β] {abv : β → α} [IsAbsoluteValue abv] [IsComplete β abv]
| Mathlib/Algebra/Order/CauSeq/Completion.lean | 413 | 436 | theorem lim_inv {f : CauSeq β abv} (hf : ¬LimZero f) : lim (inv f hf) = (lim f)⁻¹ :=
have hl : lim f ≠ 0 := by | rwa [← lim_eq_zero_iff] at hf
lim_eq_of_equiv_const <|
show LimZero (inv f hf - const abv (lim f)⁻¹) from
have h₁ : ∀ (g f : CauSeq β abv) (hf : ¬LimZero f), LimZero (g - f * inv f hf * g) :=
fun g f hf => by
have h₂ : g - f * inv f hf * g = 1 * g - f * inv f hf * g := by rw [one_mul g]
have h₃ : f * inv f hf * g = (f * inv f hf) * g := by simp [mul_assoc]
have h₄ : g - f * inv f hf * g = (1 - f * inv f hf) * g := by rw [h₂, h₃, ← sub_mul]
have h₅ : g - f * inv f hf * g = g * (1 - f * inv f hf) := by rw [h₄, mul_comm]
have h₆ : g - f * inv f hf * g = g * (1 - inv f hf * f) := by rw [h₅, mul_comm f]
rw [h₆]; exact mul_limZero_right _ (Setoid.symm (CauSeq.inv_mul_cancel _))
have h₂ :
LimZero
(inv f hf - const abv (lim f)⁻¹ -
(const abv (lim f) - f) * (inv f hf * const abv (lim f)⁻¹)) := by
rw [sub_mul, ← sub_add, sub_sub, sub_add_eq_sub_sub, sub_right_comm, sub_add]
show LimZero
(inv f hf - const abv (lim f) * (inv f hf * const abv (lim f)⁻¹) -
(const abv (lim f)⁻¹ - f * (inv f hf * const abv (lim f)⁻¹)))
exact sub_limZero
(by rw [← mul_assoc, mul_right_comm, const_inv hl]; exact h₁ _ _ _)
(by rw [← mul_assoc]; exact h₁ _ _ _)
(limZero_congr h₂).mpr <| mul_limZero_left _ (Setoid.symm (equiv_lim f))
|
import Mathlib.Algebra.Homology.ShortComplex.ModuleCat
import Mathlib.RepresentationTheory.GroupCohomology.Basic
import Mathlib.RepresentationTheory.Invariants
universe v u
noncomputable section
open CategoryTheory Limits Representation
variable {k G : Type u} [CommRing k] [Group G] (A : Rep k G)
namespace groupCohomology
section IsMulCocycle
section
variable {G M : Type*} [Mul G] [CommGroup M] [SMul G M]
def IsMulOneCocycle (f : G → M) : Prop := ∀ g h : G, f (g * h) = g • f h * f g
def IsMulTwoCocycle (f : G × G → M) : Prop :=
∀ g h j : G, f (g * h, j) * f (g, h) = g • (f (h, j)) * f (g, h * j)
end
section
variable {G M : Type*} [Monoid G] [CommGroup M] [MulAction G M]
theorem map_one_of_isMulOneCocycle {f : G → M} (hf : IsMulOneCocycle f) :
f 1 = 1 := by
simpa only [mul_one, one_smul, self_eq_mul_right] using hf 1 1
theorem map_one_fst_of_isMulTwoCocycle {f : G × G → M} (hf : IsMulTwoCocycle f) (g : G) :
f (1, g) = f (1, 1) := by
simpa only [one_smul, one_mul, mul_one, mul_right_inj] using (hf 1 1 g).symm
theorem map_one_snd_of_isMulTwoCocycle {f : G × G → M} (hf : IsMulTwoCocycle f) (g : G) :
f (g, 1) = g • f (1, 1) := by
simpa only [mul_one, mul_left_inj] using hf g 1 1
end
section
variable {G M : Type*} [Group G] [CommGroup M] [MulAction G M]
@[simp] theorem map_inv_of_isMulOneCocycle {f : G → M} (hf : IsMulOneCocycle f) (g : G) :
g • f g⁻¹ = (f g)⁻¹ := by
rw [← mul_eq_one_iff_eq_inv, ← map_one_of_isMulOneCocycle hf, ← mul_inv_self g, hf g g⁻¹]
| Mathlib/RepresentationTheory/GroupCohomology/LowDegree.lean | 546 | 551 | theorem smul_map_inv_div_map_inv_of_isMulTwoCocycle
{f : G × G → M} (hf : IsMulTwoCocycle f) (g : G) :
g • f (g⁻¹, g) / f (g, g⁻¹) = f (1, 1) / f (g, 1) := by |
have := hf g g⁻¹ g
simp only [mul_right_inv, mul_left_inv, map_one_fst_of_isMulTwoCocycle hf g] at this
exact div_eq_div_iff_mul_eq_mul.2 this.symm
|
import Mathlib.CategoryTheory.Functor.Flat
import Mathlib.CategoryTheory.Sites.Sheaf
import Mathlib.Tactic.ApplyFun
#align_import category_theory.sites.cover_preserving from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
universe w v₁ v₂ v₃ u₁ u₂ u₃
noncomputable section
open CategoryTheory Opposite CategoryTheory.Presieve.FamilyOfElements CategoryTheory.Presieve
CategoryTheory.Limits
namespace CategoryTheory
variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (F : C ⥤ D)
variable {A : Type u₃} [Category.{v₃} A]
variable (J : GrothendieckTopology C) (K : GrothendieckTopology D)
variable {L : GrothendieckTopology A}
-- Porting note(#5171): removed `@[nolint has_nonempty_instance]`
structure CoverPreserving (G : C ⥤ D) : Prop where
cover_preserve : ∀ {U : C} {S : Sieve U} (_ : S ∈ J U), S.functorPushforward G ∈ K (G.obj U)
#align category_theory.cover_preserving CategoryTheory.CoverPreserving
theorem idCoverPreserving : CoverPreserving J J (𝟭 _) :=
⟨fun hS => by simpa using hS⟩
#align category_theory.id_cover_preserving CategoryTheory.idCoverPreserving
theorem CoverPreserving.comp {F} (hF : CoverPreserving J K F) {G} (hG : CoverPreserving K L G) :
CoverPreserving J L (F ⋙ G) :=
⟨fun hS => by
rw [Sieve.functorPushforward_comp]
exact hG.cover_preserve (hF.cover_preserve hS)⟩
#align category_theory.cover_preserving.comp CategoryTheory.CoverPreserving.comp
-- Porting note(#5171): linter not ported yet @[nolint has_nonempty_instance]
structure CompatiblePreserving (K : GrothendieckTopology D) (G : C ⥤ D) : Prop where
compatible :
∀ (ℱ : SheafOfTypes.{w} K) {Z} {T : Presieve Z} {x : FamilyOfElements (G.op ⋙ ℱ.val) T}
(_ : x.Compatible) {Y₁ Y₂} {X} (f₁ : X ⟶ G.obj Y₁) (f₂ : X ⟶ G.obj Y₂) {g₁ : Y₁ ⟶ Z}
{g₂ : Y₂ ⟶ Z} (hg₁ : T g₁) (hg₂ : T g₂) (_ : f₁ ≫ G.map g₁ = f₂ ≫ G.map g₂),
ℱ.val.map f₁.op (x g₁ hg₁) = ℱ.val.map f₂.op (x g₂ hg₂)
#align category_theory.compatible_preserving CategoryTheory.CompatiblePreserving
variable {J K} {G : C ⥤ D} (hG : CompatiblePreserving.{w} K G) (ℱ : SheafOfTypes.{w} K) {Z : C}
variable {T : Presieve Z} {x : FamilyOfElements (G.op ⋙ ℱ.val) T} (h : x.Compatible)
theorem Presieve.FamilyOfElements.Compatible.functorPushforward :
(x.functorPushforward G).Compatible := by
rintro Z₁ Z₂ W g₁ g₂ f₁' f₂' H₁ H₂ eq
unfold FamilyOfElements.functorPushforward
rcases getFunctorPushforwardStructure H₁ with ⟨X₁, f₁, h₁, hf₁, rfl⟩
rcases getFunctorPushforwardStructure H₂ with ⟨X₂, f₂, h₂, hf₂, rfl⟩
suffices ℱ.val.map (g₁ ≫ h₁).op (x f₁ hf₁) = ℱ.val.map (g₂ ≫ h₂).op (x f₂ hf₂) by
simpa using this
apply hG.compatible ℱ h _ _ hf₁ hf₂
simpa using eq
#align category_theory.presieve.family_of_elements.compatible.functor_pushforward CategoryTheory.Presieve.FamilyOfElements.Compatible.functorPushforward
@[simp]
theorem CompatiblePreserving.apply_map {Y : C} {f : Y ⟶ Z} (hf : T f) :
x.functorPushforward G (G.map f) (image_mem_functorPushforward G T hf) = x f hf := by
unfold FamilyOfElements.functorPushforward
rcases getFunctorPushforwardStructure (image_mem_functorPushforward G T hf) with
⟨X, g, f', hg, eq⟩
simpa using hG.compatible ℱ h f' (𝟙 _) hg hf (by simp [eq])
#align category_theory.compatible_preserving.apply_map CategoryTheory.CompatiblePreserving.apply_map
open Limits.WalkingCospan
| Mathlib/CategoryTheory/Sites/CoverPreserving.lean | 126 | 158 | theorem compatiblePreservingOfFlat {C : Type u₁} [Category.{v₁} C] {D : Type u₁} [Category.{v₁} D]
(K : GrothendieckTopology D) (G : C ⥤ D) [RepresentablyFlat G] : CompatiblePreserving K G := by |
constructor
intro ℱ Z T x hx Y₁ Y₂ X f₁ f₂ g₁ g₂ hg₁ hg₂ e
-- First, `f₁` and `f₂` form a cone over `cospan g₁ g₂ ⋙ u`.
let c : Cone (cospan g₁ g₂ ⋙ G) :=
(Cones.postcompose (diagramIsoCospan (cospan g₁ g₂ ⋙ G)).inv).obj (PullbackCone.mk f₁ f₂ e)
/-
This can then be viewed as a cospan of structured arrows, and we may obtain an arbitrary cone
over it since `StructuredArrow W u` is cofiltered.
Then, it suffices to prove that it is compatible when restricted onto `u(c'.X.right)`.
-/
let c' := IsCofiltered.cone (c.toStructuredArrow ⋙ StructuredArrow.pre _ _ _)
have eq₁ : f₁ = (c'.pt.hom ≫ G.map (c'.π.app left).right) ≫ eqToHom (by simp) := by
erw [← (c'.π.app left).w]
dsimp [c]
simp
have eq₂ : f₂ = (c'.pt.hom ≫ G.map (c'.π.app right).right) ≫ eqToHom (by simp) := by
erw [← (c'.π.app right).w]
dsimp [c]
simp
conv_lhs => rw [eq₁]
conv_rhs => rw [eq₂]
simp only [op_comp, Functor.map_comp, types_comp_apply, eqToHom_op, eqToHom_map]
apply congr_arg -- Porting note: was `congr 1` which for some reason doesn't do anything here
-- despite goal being of the form f a = f b, with f=`ℱ.val.map (Quiver.Hom.op c'.pt.hom)`
/-
Since everything now falls in the image of `u`,
the result follows from the compatibility of `x` in the image of `u`.
-/
injection c'.π.naturality WalkingCospan.Hom.inl with _ e₁
injection c'.π.naturality WalkingCospan.Hom.inr with _ e₂
exact hx (c'.π.app left).right (c'.π.app right).right hg₁ hg₂ (e₁.symm.trans e₂)
|
import Mathlib.Algebra.Order.Ring.Int
#align_import data.int.least_greatest from "leanprover-community/mathlib"@"3342d1b2178381196f818146ff79bc0e7ccd9e2d"
namespace Int
def leastOfBdd {P : ℤ → Prop} [DecidablePred P] (b : ℤ) (Hb : ∀ z : ℤ, P z → b ≤ z)
(Hinh : ∃ z : ℤ, P z) : { lb : ℤ // P lb ∧ ∀ z : ℤ, P z → lb ≤ z } :=
have EX : ∃ n : ℕ, P (b + n) :=
let ⟨elt, Helt⟩ := Hinh
match elt, le.dest (Hb _ Helt), Helt with
| _, ⟨n, rfl⟩, Hn => ⟨n, Hn⟩
⟨b + (Nat.find EX : ℤ), Nat.find_spec EX, fun z h =>
match z, le.dest (Hb _ h), h with
| _, ⟨_, rfl⟩, h => add_le_add_left (Int.ofNat_le.2 <| Nat.find_min' _ h) _⟩
#align int.least_of_bdd Int.leastOfBdd
| Mathlib/Data/Int/LeastGreatest.lean | 61 | 68 | theorem exists_least_of_bdd
{P : ℤ → Prop}
(Hbdd : ∃ b : ℤ , ∀ z : ℤ , P z → b ≤ z)
(Hinh : ∃ z : ℤ , P z) : ∃ lb : ℤ , P lb ∧ ∀ z : ℤ , P z → lb ≤ z := by |
classical
let ⟨b , Hb⟩ := Hbdd
let ⟨lb , H⟩ := leastOfBdd b Hb Hinh
exact ⟨lb , H⟩
|
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]
theorem gcdA_zero_left {s : ℕ} : gcdA 0 s = 0 := by
unfold gcdA
rw [xgcd, xgcd_zero_left]
#align nat.gcd_a_zero_left Nat.gcdA_zero_left
@[simp]
theorem gcdB_zero_left {s : ℕ} : gcdB 0 s = 1 := by
unfold gcdB
rw [xgcd, xgcd_zero_left]
#align nat.gcd_b_zero_left Nat.gcdB_zero_left
@[simp]
theorem gcdA_zero_right {s : ℕ} (h : s ≠ 0) : gcdA s 0 = 1 := by
unfold gcdA xgcd
obtain ⟨s, rfl⟩ := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_a_zero_right Nat.gcdA_zero_right
@[simp]
theorem gcdB_zero_right {s : ℕ} (h : s ≠ 0) : gcdB s 0 = 0 := by
unfold gcdB xgcd
obtain ⟨s, rfl⟩ := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_b_zero_right Nat.gcdB_zero_right
@[simp]
theorem xgcdAux_fst (x y) : ∀ s t s' t', (xgcdAux x s t y s' t').1 = gcd x y :=
gcd.induction x y (by simp) fun x y h IH s t s' t' => by
simp only [h, xgcdAux_rec, IH]
rw [← gcd_rec]
#align nat.xgcd_aux_fst Nat.xgcdAux_fst
theorem xgcdAux_val (x y) : xgcdAux x 1 0 y 0 1 = (gcd x y, xgcd x y) := by
rw [xgcd, ← xgcdAux_fst x y 1 0 0 1]
#align nat.xgcd_aux_val Nat.xgcdAux_val
theorem xgcd_val (x y) : xgcd x y = (gcdA x y, gcdB x y) := by
unfold gcdA gcdB; cases xgcd x y; rfl
#align nat.xgcd_val Nat.xgcd_val
section
variable (x y : ℕ)
private def P : ℕ × ℤ × ℤ → Prop
| (r, s, t) => (r : ℤ) = x * s + y * t
theorem xgcdAux_P {r r'} :
∀ {s t s' t'}, P x y (r, s, t) → P x y (r', s', t') → P x y (xgcdAux r s t r' s' t') := by
induction r, r' using gcd.induction with
| H0 => simp
| H1 a b h IH =>
intro s t s' t' p p'
rw [xgcdAux_rec h]; refine IH ?_ p; dsimp [P] at *
rw [Int.emod_def]; generalize (b / a : ℤ) = k
rw [p, p', Int.mul_sub, sub_add_eq_add_sub, Int.mul_sub, Int.add_mul, mul_comm k t,
mul_comm k s, ← mul_assoc, ← mul_assoc, add_comm (x * s * k), ← add_sub_assoc, sub_sub]
set_option linter.uppercaseLean3 false in
#align nat.xgcd_aux_P Nat.xgcdAux_P
theorem gcd_eq_gcd_ab : (gcd x y : ℤ) = x * gcdA x y + y * gcdB x y := by
have := @xgcdAux_P x y x y 1 0 0 1 (by simp [P]) (by simp [P])
rwa [xgcdAux_val, xgcd_val] at this
#align nat.gcd_eq_gcd_ab Nat.gcd_eq_gcd_ab
end
| Mathlib/Data/Int/GCD.lean | 146 | 154 | theorem exists_mul_emod_eq_gcd {k n : ℕ} (hk : gcd n k < k) : ∃ m, n * m % k = gcd n k := by |
have hk' := Int.ofNat_ne_zero.2 (ne_of_gt (lt_of_le_of_lt (zero_le (gcd n k)) hk))
have key := congr_arg (fun (m : ℤ) => (m % k).toNat) (gcd_eq_gcd_ab n k)
simp only at key
rw [Int.add_mul_emod_self_left, ← Int.natCast_mod, Int.toNat_natCast, mod_eq_of_lt hk] at key
refine ⟨(n.gcdA k % k).toNat, Eq.trans (Int.ofNat.inj ?_) key.symm⟩
rw [Int.ofNat_eq_coe, Int.natCast_mod, Int.ofNat_mul, Int.toNat_of_nonneg (Int.emod_nonneg _ hk'),
Int.ofNat_eq_coe, Int.toNat_of_nonneg (Int.emod_nonneg _ hk'), Int.mul_emod, Int.emod_emod,
← Int.mul_emod]
|
import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties
import Mathlib.RingTheory.RingHom.FiniteType
#align_import algebraic_geometry.morphisms.finite_type from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe v u
namespace AlgebraicGeometry
variable {X Y : Scheme.{u}} (f : X ⟶ Y)
@[mk_iff]
class LocallyOfFiniteType (f : X ⟶ Y) : Prop where
finiteType_of_affine_subset :
∀ (U : Y.affineOpens) (V : X.affineOpens) (e : V.1 ≤ (Opens.map f.1.base).obj U.1),
(Scheme.Hom.appLe f e).FiniteType
#align algebraic_geometry.locally_of_finite_type AlgebraicGeometry.LocallyOfFiniteType
theorem locallyOfFiniteType_eq : @LocallyOfFiniteType = affineLocally @RingHom.FiniteType := by
ext X Y f
rw [locallyOfFiniteType_iff, affineLocally_iff_affineOpens_le]
exact RingHom.finiteType_respectsIso
#align algebraic_geometry.locally_of_finite_type_eq AlgebraicGeometry.locallyOfFiniteType_eq
instance (priority := 900) locallyOfFiniteTypeOfIsOpenImmersion {X Y : Scheme} (f : X ⟶ Y)
[IsOpenImmersion f] : LocallyOfFiniteType f :=
locallyOfFiniteType_eq.symm ▸ RingHom.finiteType_is_local.affineLocally_of_isOpenImmersion f
#align algebraic_geometry.locally_of_finite_type_of_is_open_immersion AlgebraicGeometry.locallyOfFiniteTypeOfIsOpenImmersion
instance locallyOfFiniteType_isStableUnderComposition :
MorphismProperty.IsStableUnderComposition @LocallyOfFiniteType :=
locallyOfFiniteType_eq.symm ▸ RingHom.finiteType_is_local.affineLocally_isStableUnderComposition
#align algebraic_geometry.locally_of_finite_type_stable_under_composition AlgebraicGeometry.locallyOfFiniteType_isStableUnderComposition
instance locallyOfFiniteTypeComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z)
[hf : LocallyOfFiniteType f] [hg : LocallyOfFiniteType g] : LocallyOfFiniteType (f ≫ g) :=
MorphismProperty.comp_mem _ f g hf hg
#align algebraic_geometry.locally_of_finite_type_comp AlgebraicGeometry.locallyOfFiniteTypeComp
| Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean | 65 | 71 | theorem locallyOfFiniteTypeOfComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z)
[hf : LocallyOfFiniteType (f ≫ g)] : LocallyOfFiniteType f := by |
revert hf
rw [locallyOfFiniteType_eq]
apply RingHom.finiteType_is_local.affineLocally_of_comp
introv H
exact RingHom.FiniteType.of_comp_finiteType H
|
import Mathlib.GroupTheory.Abelianization
import Mathlib.GroupTheory.Exponent
import Mathlib.GroupTheory.Transfer
#align_import group_theory.schreier from "leanprover-community/mathlib"@"8350c34a64b9bc3fc64335df8006bffcadc7baa6"
open scoped Pointwise
namespace Subgroup
open MemRightTransversals
variable {G : Type*} [Group G] {H : Subgroup G} {R S : Set G}
theorem closure_mul_image_mul_eq_top
(hR : R ∈ rightTransversals (H : Set G)) (hR1 : (1 : G) ∈ R) (hS : closure S = ⊤) :
(closure ((R * S).image fun g => g * (toFun hR g : G)⁻¹)) * R = ⊤ := by
let f : G → R := fun g => toFun hR g
let U : Set G := (R * S).image fun g => g * (f g : G)⁻¹
change (closure U : Set G) * R = ⊤
refine top_le_iff.mp fun g _ => ?_
refine closure_induction_right ?_ ?_ ?_ (eq_top_iff.mp hS (mem_top g))
· exact ⟨1, (closure U).one_mem, 1, hR1, one_mul 1⟩
· rintro - - s hs ⟨u, hu, r, hr, rfl⟩
rw [show u * r * s = u * (r * s * (f (r * s) : G)⁻¹) * f (r * s) by group]
refine Set.mul_mem_mul ((closure U).mul_mem hu ?_) (f (r * s)).coe_prop
exact subset_closure ⟨r * s, Set.mul_mem_mul hr hs, rfl⟩
· rintro - - s hs ⟨u, hu, r, hr, rfl⟩
rw [show u * r * s⁻¹ = u * (f (r * s⁻¹) * s * r⁻¹)⁻¹ * f (r * s⁻¹) by group]
refine Set.mul_mem_mul ((closure U).mul_mem hu ((closure U).inv_mem ?_)) (f (r * s⁻¹)).2
refine subset_closure ⟨f (r * s⁻¹) * s, Set.mul_mem_mul (f (r * s⁻¹)).2 hs, ?_⟩
rw [mul_right_inj, inv_inj, ← Subtype.coe_mk r hr, ← Subtype.ext_iff, Subtype.coe_mk]
apply (mem_rightTransversals_iff_existsUnique_mul_inv_mem.mp hR (f (r * s⁻¹) * s)).unique
(mul_inv_toFun_mem hR (f (r * s⁻¹) * s))
rw [mul_assoc, ← inv_inv s, ← mul_inv_rev, inv_inv]
exact toFun_mul_inv_mem hR (r * s⁻¹)
#align subgroup.closure_mul_image_mul_eq_top Subgroup.closure_mul_image_mul_eq_top
| Mathlib/GroupTheory/Schreier.lean | 64 | 79 | theorem closure_mul_image_eq (hR : R ∈ rightTransversals (H : Set G)) (hR1 : (1 : G) ∈ R)
(hS : closure S = ⊤) : closure ((R * S).image fun g => g * (toFun hR g : G)⁻¹) = H := by |
have hU : closure ((R * S).image fun g => g * (toFun hR g : G)⁻¹) ≤ H := by
rw [closure_le]
rintro - ⟨g, -, rfl⟩
exact mul_inv_toFun_mem hR g
refine le_antisymm hU fun h hh => ?_
obtain ⟨g, hg, r, hr, rfl⟩ :=
show h ∈ _ from eq_top_iff.mp (closure_mul_image_mul_eq_top hR hR1 hS) (mem_top h)
suffices (⟨r, hr⟩ : R) = (⟨1, hR1⟩ : R) by
simpa only [show r = 1 from Subtype.ext_iff.mp this, mul_one]
apply (mem_rightTransversals_iff_existsUnique_mul_inv_mem.mp hR r).unique
· rw [Subtype.coe_mk, mul_inv_self]
exact H.one_mem
· rw [Subtype.coe_mk, inv_one, mul_one]
exact (H.mul_mem_cancel_left (hU hg)).mp hh
|
import Mathlib.Analysis.Convolution
import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd
import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup
import Mathlib.Analysis.Analytic.IsolatedZeros
import Mathlib.Analysis.Complex.CauchyIntegral
#align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090"
noncomputable section
set_option linter.uppercaseLean3 false
open Filter intervalIntegral Set Real MeasureTheory
open scoped Nat Topology Real
section BetaIntegral
namespace Complex
noncomputable def betaIntegral (u v : ℂ) : ℂ :=
∫ x : ℝ in (0)..1, (x : ℂ) ^ (u - 1) * (1 - (x : ℂ)) ^ (v - 1)
#align complex.beta_integral Complex.betaIntegral
| Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean | 63 | 76 | theorem betaIntegral_convergent_left {u : ℂ} (hu : 0 < re u) (v : ℂ) :
IntervalIntegrable (fun x =>
(x : ℂ) ^ (u - 1) * (1 - (x : ℂ)) ^ (v - 1) : ℝ → ℂ) volume 0 (1 / 2) := by |
apply IntervalIntegrable.mul_continuousOn
· refine intervalIntegral.intervalIntegrable_cpow' ?_
rwa [sub_re, one_re, ← zero_sub, sub_lt_sub_iff_right]
· apply ContinuousAt.continuousOn
intro x hx
rw [uIcc_of_le (by positivity : (0 : ℝ) ≤ 1 / 2)] at hx
apply ContinuousAt.cpow
· exact (continuous_const.sub continuous_ofReal).continuousAt
· exact continuousAt_const
· norm_cast
exact ofReal_mem_slitPlane.2 <| by linarith only [hx.2]
|
import Mathlib.Topology.Homotopy.Basic
import Mathlib.Topology.Connected.PathConnected
import Mathlib.Analysis.Convex.Basic
#align_import topology.homotopy.path from "leanprover-community/mathlib"@"bb9d1c5085e0b7ea619806a68c5021927cecb2a6"
universe u v
variable {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y]
variable {x₀ x₁ x₂ x₃ : X}
noncomputable section
open unitInterval
namespace Path
abbrev Homotopy (p₀ p₁ : Path x₀ x₁) :=
ContinuousMap.HomotopyRel p₀.toContinuousMap p₁.toContinuousMap {0, 1}
#align path.homotopy Path.Homotopy
namespace Homotopy
section
variable {p₀ p₁ : Path x₀ x₁}
theorem coeFn_injective : @Function.Injective (Homotopy p₀ p₁) (I × I → X) (⇑) :=
DFunLike.coe_injective
#align path.homotopy.coe_fn_injective Path.Homotopy.coeFn_injective
@[simp]
theorem source (F : Homotopy p₀ p₁) (t : I) : F (t, 0) = x₀ :=
calc F (t, 0) = p₀ 0 := ContinuousMap.HomotopyRel.eq_fst _ _ (.inl rfl)
_ = x₀ := p₀.source
#align path.homotopy.source Path.Homotopy.source
@[simp]
theorem target (F : Homotopy p₀ p₁) (t : I) : F (t, 1) = x₁ :=
calc F (t, 1) = p₀ 1 := ContinuousMap.HomotopyRel.eq_fst _ _ (.inr rfl)
_ = x₁ := p₀.target
#align path.homotopy.target Path.Homotopy.target
def eval (F : Homotopy p₀ p₁) (t : I) : Path x₀ x₁ where
toFun := F.toHomotopy.curry t
source' := by simp
target' := by simp
#align path.homotopy.eval Path.Homotopy.eval
@[simp]
theorem eval_zero (F : Homotopy p₀ p₁) : F.eval 0 = p₀ := by
ext t
simp [eval]
#align path.homotopy.eval_zero Path.Homotopy.eval_zero
@[simp]
| Mathlib/Topology/Homotopy/Path.lean | 89 | 91 | theorem eval_one (F : Homotopy p₀ p₁) : F.eval 1 = p₁ := by |
ext t
simp [eval]
|
import Mathlib.Analysis.Convex.Hull
#align_import analysis.convex.extreme from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963"
open Function Set
open scoped Classical
open Affine
variable {𝕜 E F ι : Type*} {π : ι → Type*}
section SMul
variable (𝕜) [OrderedSemiring 𝕜] [AddCommMonoid E] [SMul 𝕜 E]
def IsExtreme (A B : Set E) : Prop :=
B ⊆ A ∧ ∀ ⦃x₁⦄, x₁ ∈ A → ∀ ⦃x₂⦄, x₂ ∈ A → ∀ ⦃x⦄, x ∈ B → x ∈ openSegment 𝕜 x₁ x₂ → x₁ ∈ B ∧ x₂ ∈ B
#align is_extreme IsExtreme
def Set.extremePoints (A : Set E) : Set E :=
{ x ∈ A | ∀ ⦃x₁⦄, x₁ ∈ A → ∀ ⦃x₂⦄, x₂ ∈ A → x ∈ openSegment 𝕜 x₁ x₂ → x₁ = x ∧ x₂ = x }
#align set.extreme_points Set.extremePoints
@[refl]
protected theorem IsExtreme.refl (A : Set E) : IsExtreme 𝕜 A A :=
⟨Subset.rfl, fun _ hx₁A _ hx₂A _ _ _ ↦ ⟨hx₁A, hx₂A⟩⟩
#align is_extreme.refl IsExtreme.refl
variable {𝕜} {A B C : Set E} {x : E}
protected theorem IsExtreme.rfl : IsExtreme 𝕜 A A :=
IsExtreme.refl 𝕜 A
#align is_extreme.rfl IsExtreme.rfl
@[trans]
protected theorem IsExtreme.trans (hAB : IsExtreme 𝕜 A B) (hBC : IsExtreme 𝕜 B C) :
IsExtreme 𝕜 A C := by
refine ⟨Subset.trans hBC.1 hAB.1, fun x₁ hx₁A x₂ hx₂A x hxC hx ↦ ?_⟩
obtain ⟨hx₁B, hx₂B⟩ := hAB.2 hx₁A hx₂A (hBC.1 hxC) hx
exact hBC.2 hx₁B hx₂B hxC hx
#align is_extreme.trans IsExtreme.trans
protected theorem IsExtreme.antisymm : AntiSymmetric (IsExtreme 𝕜 : Set E → Set E → Prop) :=
fun _ _ hAB hBA ↦ Subset.antisymm hBA.1 hAB.1
#align is_extreme.antisymm IsExtreme.antisymm
instance : IsPartialOrder (Set E) (IsExtreme 𝕜) where
refl := IsExtreme.refl 𝕜
trans _ _ _ := IsExtreme.trans
antisymm := IsExtreme.antisymm
| Mathlib/Analysis/Convex/Extreme.lean | 97 | 103 | theorem IsExtreme.inter (hAB : IsExtreme 𝕜 A B) (hAC : IsExtreme 𝕜 A C) :
IsExtreme 𝕜 A (B ∩ C) := by |
use Subset.trans inter_subset_left hAB.1
rintro x₁ hx₁A x₂ hx₂A x ⟨hxB, hxC⟩ hx
obtain ⟨hx₁B, hx₂B⟩ := hAB.2 hx₁A hx₂A hxB hx
obtain ⟨hx₁C, hx₂C⟩ := hAC.2 hx₁A hx₂A hxC hx
exact ⟨⟨hx₁B, hx₁C⟩, hx₂B, hx₂C⟩
|
import Mathlib.Algebra.BigOperators.Group.List
import Mathlib.Algebra.Group.Prod
import Mathlib.Data.Multiset.Basic
#align_import algebra.big_operators.multiset.basic from "leanprover-community/mathlib"@"6c5f73fd6f6cc83122788a80a27cdd54663609f4"
assert_not_exists MonoidWithZero
variable {F ι α β γ : Type*}
namespace Multiset
section CommMonoid
variable [CommMonoid α] [CommMonoid β] {s t : Multiset α} {a : α} {m : Multiset ι} {f g : ι → α}
@[to_additive
"Sum of a multiset given a commutative additive monoid structure on `α`.
`sum {a, b, c} = a + b + c`"]
def prod : Multiset α → α :=
foldr (· * ·) (fun x y z => by simp [mul_left_comm]) 1
#align multiset.prod Multiset.prod
#align multiset.sum Multiset.sum
@[to_additive]
theorem prod_eq_foldr (s : Multiset α) :
prod s = foldr (· * ·) (fun x y z => by simp [mul_left_comm]) 1 s :=
rfl
#align multiset.prod_eq_foldr Multiset.prod_eq_foldr
#align multiset.sum_eq_foldr Multiset.sum_eq_foldr
@[to_additive]
theorem prod_eq_foldl (s : Multiset α) :
prod s = foldl (· * ·) (fun x y z => by simp [mul_right_comm]) 1 s :=
(foldr_swap _ _ _ _).trans (by simp [mul_comm])
#align multiset.prod_eq_foldl Multiset.prod_eq_foldl
#align multiset.sum_eq_foldl Multiset.sum_eq_foldl
@[to_additive (attr := simp, norm_cast)]
theorem prod_coe (l : List α) : prod ↑l = l.prod :=
prod_eq_foldl _
#align multiset.coe_prod Multiset.prod_coe
#align multiset.coe_sum Multiset.sum_coe
@[to_additive (attr := simp)]
theorem prod_toList (s : Multiset α) : s.toList.prod = s.prod := by
conv_rhs => rw [← coe_toList s]
rw [prod_coe]
#align multiset.prod_to_list Multiset.prod_toList
#align multiset.sum_to_list Multiset.sum_toList
@[to_additive (attr := simp)]
theorem prod_zero : @prod α _ 0 = 1 :=
rfl
#align multiset.prod_zero Multiset.prod_zero
#align multiset.sum_zero Multiset.sum_zero
@[to_additive (attr := simp)]
theorem prod_cons (a : α) (s) : prod (a ::ₘ s) = a * prod s :=
foldr_cons _ _ _ _ _
#align multiset.prod_cons Multiset.prod_cons
#align multiset.sum_cons Multiset.sum_cons
@[to_additive (attr := simp)]
theorem prod_erase [DecidableEq α] (h : a ∈ s) : a * (s.erase a).prod = s.prod := by
rw [← s.coe_toList, coe_erase, prod_coe, prod_coe, List.prod_erase (mem_toList.2 h)]
#align multiset.prod_erase Multiset.prod_erase
#align multiset.sum_erase Multiset.sum_erase
@[to_additive (attr := simp)]
theorem prod_map_erase [DecidableEq ι] {a : ι} (h : a ∈ m) :
f a * ((m.erase a).map f).prod = (m.map f).prod := by
rw [← m.coe_toList, coe_erase, map_coe, map_coe, prod_coe, prod_coe,
List.prod_map_erase f (mem_toList.2 h)]
#align multiset.prod_map_erase Multiset.prod_map_erase
#align multiset.sum_map_erase Multiset.sum_map_erase
@[to_additive (attr := simp)]
| Mathlib/Algebra/BigOperators/Group/Multiset.lean | 99 | 100 | theorem prod_singleton (a : α) : prod {a} = a := by |
simp only [mul_one, prod_cons, ← cons_zero, eq_self_iff_true, prod_zero]
|
import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv
import Mathlib.Topology.Algebra.Module.Basic
open Function
structure ContinuousAffineEquiv (k P₁ P₂ : Type*) {V₁ V₂ : Type*} [Ring k]
[AddCommGroup V₁] [Module k V₁] [AddTorsor V₁ P₁] [TopologicalSpace P₁]
[AddCommGroup V₂] [Module k V₂] [AddTorsor V₂ P₂] [TopologicalSpace P₂]
extends P₁ ≃ᵃ[k] P₂ where
continuous_toFun : Continuous toFun := by continuity
continuous_invFun : Continuous invFun := by continuity
@[inherit_doc]
notation:25 P₁ " ≃ᵃL[" k:25 "] " P₂:0 => ContinuousAffineEquiv k P₁ P₂
variable {k P₁ P₂ P₃ P₄ V₁ V₂ V₃ V₄ : Type*} [Ring k]
[AddCommGroup V₁] [Module k V₁] [AddTorsor V₁ P₁]
[AddCommGroup V₂] [Module k V₂] [AddTorsor V₂ P₂]
[AddCommGroup V₃] [Module k V₃] [AddTorsor V₃ P₃]
[AddCommGroup V₄] [Module k V₄] [AddTorsor V₄ P₄]
[TopologicalSpace P₁] [AddCommMonoid P₁] [Module k P₁]
[TopologicalSpace P₂] [AddCommMonoid P₂] [Module k P₂]
[TopologicalSpace P₃] [TopologicalSpace P₄]
namespace ContinuousAffineEquiv
-- Basic set-up: standard fields, coercions and ext lemmas
section Basic
def toHomeomorph (e : P₁ ≃ᵃL[k] P₂) : P₁ ≃ₜ P₂ where
__ := e
| Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean | 65 | 67 | theorem toAffineEquiv_injective : Injective (toAffineEquiv : (P₁ ≃ᵃL[k] P₂) → P₁ ≃ᵃ[k] P₂) := by |
rintro ⟨e, econt, einv_cont⟩ ⟨e', e'cont, e'inv_cont⟩ H
congr
|
import Mathlib.LinearAlgebra.FiniteDimensional
import Mathlib.LinearAlgebra.FreeModule.Finite.Basic
import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition
import Mathlib.LinearAlgebra.Projection
import Mathlib.LinearAlgebra.SesquilinearForm
import Mathlib.RingTheory.TensorProduct.Basic
import Mathlib.RingTheory.Ideal.LocalRing
#align_import linear_algebra.dual from "leanprover-community/mathlib"@"b1c017582e9f18d8494e5c18602a8cb4a6f843ac"
noncomputable section
namespace Module
-- Porting note: max u v universe issues so name and specific below
universe uR uA uM uM' uM''
variable (R : Type uR) (A : Type uA) (M : Type uM)
variable [CommSemiring R] [AddCommMonoid M] [Module R M]
abbrev Dual :=
M →ₗ[R] R
#align module.dual Module.Dual
def dualPairing (R M) [CommSemiring R] [AddCommMonoid M] [Module R M] :
Module.Dual R M →ₗ[R] M →ₗ[R] R :=
LinearMap.id
#align module.dual_pairing Module.dualPairing
@[simp]
theorem dualPairing_apply (v x) : dualPairing R M v x = v x :=
rfl
#align module.dual_pairing_apply Module.dualPairing_apply
namespace Dual
instance : Inhabited (Dual R M) := ⟨0⟩
def eval : M →ₗ[R] Dual R (Dual R M) :=
LinearMap.flip LinearMap.id
#align module.dual.eval Module.Dual.eval
@[simp]
theorem eval_apply (v : M) (a : Dual R M) : eval R M v a = a v :=
rfl
#align module.dual.eval_apply Module.Dual.eval_apply
variable {R M} {M' : Type uM'}
variable [AddCommMonoid M'] [Module R M']
def transpose : (M →ₗ[R] M') →ₗ[R] Dual R M' →ₗ[R] Dual R M :=
(LinearMap.llcomp R M M' R).flip
#align module.dual.transpose Module.Dual.transpose
-- Porting note: with reducible def need to specify some parameters to transpose explicitly
theorem transpose_apply (u : M →ₗ[R] M') (l : Dual R M') : transpose (R := R) u l = l.comp u :=
rfl
#align module.dual.transpose_apply Module.Dual.transpose_apply
variable {M'' : Type uM''} [AddCommMonoid M''] [Module R M'']
-- Porting note: with reducible def need to specify some parameters to transpose explicitly
theorem transpose_comp (u : M' →ₗ[R] M'') (v : M →ₗ[R] M') :
transpose (R := R) (u.comp v) = (transpose (R := R) v).comp (transpose (R := R) u) :=
rfl
#align module.dual.transpose_comp Module.Dual.transpose_comp
end Dual
section Prod
variable (M' : Type uM') [AddCommMonoid M'] [Module R M']
@[simps!]
def dualProdDualEquivDual : (Module.Dual R M × Module.Dual R M') ≃ₗ[R] Module.Dual R (M × M') :=
LinearMap.coprodEquiv R
#align module.dual_prod_dual_equiv_dual Module.dualProdDualEquivDual
@[simp]
theorem dualProdDualEquivDual_apply (φ : Module.Dual R M) (ψ : Module.Dual R M') :
dualProdDualEquivDual R M M' (φ, ψ) = φ.coprod ψ :=
rfl
#align module.dual_prod_dual_equiv_dual_apply Module.dualProdDualEquivDual_apply
end Prod
end Module
namespace Basis
universe u v w
open Module Module.Dual Submodule LinearMap Cardinal Function
universe uR uM uK uV uι
variable {R : Type uR} {M : Type uM} {K : Type uK} {V : Type uV} {ι : Type uι}
section
variable [CommSemiring R] [AddCommMonoid M] [Module R M] [Fintype ι]
variable (b : Basis ι R M)
@[simp]
| Mathlib/LinearAlgebra/Dual.lean | 388 | 392 | theorem sum_dual_apply_smul_coord (f : Module.Dual R M) :
(∑ x, f (b x) • b.coord x) = f := by |
ext m
simp_rw [LinearMap.sum_apply, LinearMap.smul_apply, smul_eq_mul, mul_comm (f _), ← smul_eq_mul, ←
f.map_smul, ← _root_.map_sum, Basis.coord_apply, Basis.sum_repr]
|
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.Basic
import Mathlib.RingTheory.Ideal.Maps
import Mathlib.RingTheory.MvPowerSeries.Basic
#align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60"
noncomputable section
open Finset (antidiagonal mem_antidiagonal)
def PowerSeries (R : Type*) :=
MvPowerSeries Unit R
#align power_series PowerSeries
namespace PowerSeries
open Finsupp (single)
variable {R : Type*}
section
-- Porting note: not available in Lean 4
-- local reducible PowerSeries
scoped notation:9000 R "⟦X⟧" => PowerSeries R
instance [Inhabited R] : Inhabited R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance [Zero R] : Zero R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance [AddMonoid R] : AddMonoid R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance [AddGroup R] : AddGroup R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance [AddCommMonoid R] : AddCommMonoid R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance [AddCommGroup R] : AddCommGroup R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance [Semiring R] : Semiring R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance [CommSemiring R] : CommSemiring R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance [Ring R] : Ring R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance [CommRing R] : CommRing R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance [Nontrivial R] : Nontrivial R⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R A⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S]
[IsScalarTower R S A] : IsScalarTower R S A⟦X⟧ :=
Pi.isScalarTower
instance {A} [Semiring A] [CommSemiring R] [Algebra R A] : Algebra R A⟦X⟧ := by
dsimp only [PowerSeries]
infer_instance
end
section Semiring
variable (R) [Semiring R]
def coeff (n : ℕ) : R⟦X⟧ →ₗ[R] R :=
MvPowerSeries.coeff R (single () n)
#align power_series.coeff PowerSeries.coeff
def monomial (n : ℕ) : R →ₗ[R] R⟦X⟧ :=
MvPowerSeries.monomial R (single () n)
#align power_series.monomial PowerSeries.monomial
variable {R}
theorem coeff_def {s : Unit →₀ ℕ} {n : ℕ} (h : s () = n) : coeff R n = MvPowerSeries.coeff R s := by
erw [coeff, ← h, ← Finsupp.unique_single s]
#align power_series.coeff_def PowerSeries.coeff_def
@[ext]
theorem ext {φ ψ : R⟦X⟧} (h : ∀ n, coeff R n φ = coeff R n ψ) : φ = ψ :=
MvPowerSeries.ext fun n => by
rw [← coeff_def]
· apply h
rfl
#align power_series.ext PowerSeries.ext
theorem ext_iff {φ ψ : R⟦X⟧} : φ = ψ ↔ ∀ n, coeff R n φ = coeff R n ψ :=
⟨fun h n => congr_arg (coeff R n) h, ext⟩
#align power_series.ext_iff PowerSeries.ext_iff
instance [Subsingleton R] : Subsingleton R⟦X⟧ := by
simp only [subsingleton_iff, ext_iff]
exact fun _ _ _ ↦ (subsingleton_iff).mp (by infer_instance) _ _
def mk {R} (f : ℕ → R) : R⟦X⟧ := fun s => f (s ())
#align power_series.mk PowerSeries.mk
@[simp]
theorem coeff_mk (n : ℕ) (f : ℕ → R) : coeff R n (mk f) = f n :=
congr_arg f Finsupp.single_eq_same
#align power_series.coeff_mk PowerSeries.coeff_mk
theorem coeff_monomial (m n : ℕ) (a : R) : coeff R m (monomial R n a) = if m = n then a else 0 :=
calc
coeff R m (monomial R n a) = _ := MvPowerSeries.coeff_monomial _ _ _
_ = if m = n then a else 0 := by simp only [Finsupp.unique_single_eq_iff]
#align power_series.coeff_monomial PowerSeries.coeff_monomial
theorem monomial_eq_mk (n : ℕ) (a : R) : monomial R n a = mk fun m => if m = n then a else 0 :=
ext fun m => by rw [coeff_monomial, coeff_mk]
#align power_series.monomial_eq_mk PowerSeries.monomial_eq_mk
@[simp]
theorem coeff_monomial_same (n : ℕ) (a : R) : coeff R n (monomial R n a) = a :=
MvPowerSeries.coeff_monomial_same _ _
#align power_series.coeff_monomial_same PowerSeries.coeff_monomial_same
@[simp]
theorem coeff_comp_monomial (n : ℕ) : (coeff R n).comp (monomial R n) = LinearMap.id :=
LinearMap.ext <| coeff_monomial_same n
#align power_series.coeff_comp_monomial PowerSeries.coeff_comp_monomial
variable (R)
def constantCoeff : R⟦X⟧ →+* R :=
MvPowerSeries.constantCoeff Unit R
#align power_series.constant_coeff PowerSeries.constantCoeff
def C : R →+* R⟦X⟧ :=
MvPowerSeries.C Unit R
set_option linter.uppercaseLean3 false in
#align power_series.C PowerSeries.C
variable {R}
def X : R⟦X⟧ :=
MvPowerSeries.X ()
set_option linter.uppercaseLean3 false in
#align power_series.X PowerSeries.X
theorem commute_X (φ : R⟦X⟧) : Commute φ X :=
MvPowerSeries.commute_X _ _
set_option linter.uppercaseLean3 false in
#align power_series.commute_X PowerSeries.commute_X
@[simp]
| Mathlib/RingTheory/PowerSeries/Basic.lean | 229 | 231 | theorem coeff_zero_eq_constantCoeff : ⇑(coeff R 0) = constantCoeff R := by |
rw [coeff, Finsupp.single_zero]
rfl
|
import Mathlib.Topology.Algebra.Module.Basic
import Mathlib.LinearAlgebra.Multilinear.Basic
#align_import topology.algebra.module.multilinear from "leanprover-community/mathlib"@"f40476639bac089693a489c9e354ebd75dc0f886"
open Function Fin Set
universe u v w w₁ w₁' w₂ w₃ w₄
variable {R : Type u} {ι : Type v} {n : ℕ} {M : Fin n.succ → Type w} {M₁ : ι → Type w₁}
{M₁' : ι → Type w₁'} {M₂ : Type w₂} {M₃ : Type w₃} {M₄ : Type w₄}
structure ContinuousMultilinearMap (R : Type u) {ι : Type v} (M₁ : ι → Type w₁) (M₂ : Type w₂)
[Semiring R] [∀ i, AddCommMonoid (M₁ i)] [AddCommMonoid M₂] [∀ i, Module R (M₁ i)] [Module R M₂]
[∀ i, TopologicalSpace (M₁ i)] [TopologicalSpace M₂] extends MultilinearMap R M₁ M₂ where
cont : Continuous toFun
#align continuous_multilinear_map ContinuousMultilinearMap
attribute [inherit_doc ContinuousMultilinearMap] ContinuousMultilinearMap.cont
@[inherit_doc]
notation:25 M "[×" n "]→L[" R "] " M' => ContinuousMultilinearMap R (fun i : Fin n => M) M'
namespace ContinuousMultilinearMap
section Semiring
variable [Semiring R] [∀ i, AddCommMonoid (M i)] [∀ i, AddCommMonoid (M₁ i)]
[∀ i, AddCommMonoid (M₁' i)] [AddCommMonoid M₂] [AddCommMonoid M₃] [AddCommMonoid M₄]
[∀ i, Module R (M i)] [∀ i, Module R (M₁ i)] [∀ i, Module R (M₁' i)] [Module R M₂] [Module R M₃]
[Module R M₄] [∀ i, TopologicalSpace (M i)] [∀ i, TopologicalSpace (M₁ i)]
[∀ i, TopologicalSpace (M₁' i)] [TopologicalSpace M₂] [TopologicalSpace M₃] [TopologicalSpace M₄]
(f f' : ContinuousMultilinearMap R M₁ M₂)
theorem toMultilinearMap_injective :
Function.Injective
(ContinuousMultilinearMap.toMultilinearMap :
ContinuousMultilinearMap R M₁ M₂ → MultilinearMap R M₁ M₂)
| ⟨f, hf⟩, ⟨g, hg⟩, h => by subst h; rfl
#align continuous_multilinear_map.to_multilinear_map_injective ContinuousMultilinearMap.toMultilinearMap_injective
instance funLike : FunLike (ContinuousMultilinearMap R M₁ M₂) (∀ i, M₁ i) M₂ where
coe f := f.toFun
coe_injective' _ _ h := toMultilinearMap_injective <| MultilinearMap.coe_injective h
instance continuousMapClass :
ContinuousMapClass (ContinuousMultilinearMap R M₁ M₂) (∀ i, M₁ i) M₂ where
map_continuous := ContinuousMultilinearMap.cont
#align continuous_multilinear_map.continuous_map_class ContinuousMultilinearMap.continuousMapClass
instance : CoeFun (ContinuousMultilinearMap R M₁ M₂) fun _ => (∀ i, M₁ i) → M₂ :=
⟨fun f => f⟩
def Simps.apply (L₁ : ContinuousMultilinearMap R M₁ M₂) (v : ∀ i, M₁ i) : M₂ :=
L₁ v
#align continuous_multilinear_map.simps.apply ContinuousMultilinearMap.Simps.apply
initialize_simps_projections ContinuousMultilinearMap (-toMultilinearMap,
toMultilinearMap_toFun → apply)
@[continuity]
theorem coe_continuous : Continuous (f : (∀ i, M₁ i) → M₂) :=
f.cont
#align continuous_multilinear_map.coe_continuous ContinuousMultilinearMap.coe_continuous
@[simp]
theorem coe_coe : (f.toMultilinearMap : (∀ i, M₁ i) → M₂) = f :=
rfl
#align continuous_multilinear_map.coe_coe ContinuousMultilinearMap.coe_coe
@[ext]
theorem ext {f f' : ContinuousMultilinearMap R M₁ M₂} (H : ∀ x, f x = f' x) : f = f' :=
DFunLike.ext _ _ H
#align continuous_multilinear_map.ext ContinuousMultilinearMap.ext
| Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean | 113 | 114 | theorem ext_iff {f f' : ContinuousMultilinearMap R M₁ M₂} : f = f' ↔ ∀ x, f x = f' x := by |
rw [← toMultilinearMap_injective.eq_iff, MultilinearMap.ext_iff]; rfl
|
import Mathlib.NumberTheory.ZetaValues
import Mathlib.NumberTheory.LSeries.RiemannZeta
open Complex Real Set
open scoped Nat
namespace HurwitzZeta
variable {k : ℕ} {x : ℝ}
theorem cosZeta_two_mul_nat (hk : k ≠ 0) (hx : x ∈ Icc 0 1) :
cosZeta x (2 * k) = (-1) ^ (k + 1) * (2 * π) ^ (2 * k) / 2 / (2 * k)! *
((Polynomial.bernoulli (2 * k)).map (algebraMap ℚ ℂ)).eval (x : ℂ) := by
rw [← (hasSum_nat_cosZeta x (?_ : 1 < re (2 * k))).tsum_eq]
refine Eq.trans ?_ <| (congr_arg ofReal' (hasSum_one_div_nat_pow_mul_cos hk hx).tsum_eq).trans ?_
· rw [ofReal_tsum]
refine tsum_congr fun n ↦ ?_
rw [mul_comm (1 / _), mul_one_div, ofReal_div, mul_assoc (2 * π), mul_comm x n, ← mul_assoc,
← Nat.cast_ofNat (R := ℂ), ← Nat.cast_mul, cpow_natCast, ofReal_pow, ofReal_natCast]
· simp only [ofReal_mul, ofReal_div, ofReal_pow, ofReal_natCast, ofReal_ofNat,
ofReal_neg, ofReal_one]
congr 1
have : (Polynomial.bernoulli (2 * k)).map (algebraMap ℚ ℂ) = _ :=
(Polynomial.map_map (algebraMap ℚ ℝ) ofReal _).symm
rw [this, ← ofReal_eq_coe, ← ofReal_eq_coe]
apply Polynomial.map_aeval_eq_aeval_map
simp only [Algebra.id.map_eq_id, RingHomCompTriple.comp_eq]
· rw [← Nat.cast_ofNat, ← Nat.cast_one, ← Nat.cast_mul, natCast_re, Nat.cast_lt]
omega
theorem sinZeta_two_mul_nat_add_one (hk : k ≠ 0) (hx : x ∈ Icc 0 1) :
sinZeta x (2 * k + 1) = (-1) ^ (k + 1) * (2 * π) ^ (2 * k + 1) / 2 / (2 * k + 1)! *
((Polynomial.bernoulli (2 * k + 1)).map (algebraMap ℚ ℂ)).eval (x : ℂ) := by
rw [← (hasSum_nat_sinZeta x (?_ : 1 < re (2 * k + 1))).tsum_eq]
refine Eq.trans ?_ <| (congr_arg ofReal' (hasSum_one_div_nat_pow_mul_sin hk hx).tsum_eq).trans ?_
· rw [ofReal_tsum]
refine tsum_congr fun n ↦ ?_
rw [mul_comm (1 / _), mul_one_div, ofReal_div, mul_assoc (2 * π), mul_comm x n, ← mul_assoc]
congr 1
rw [← Nat.cast_ofNat, ← Nat.cast_mul, ← Nat.cast_add_one, cpow_natCast, ofReal_pow,
ofReal_natCast]
· simp only [ofReal_mul, ofReal_div, ofReal_pow, ofReal_natCast, ofReal_ofNat,
ofReal_neg, ofReal_one]
congr 1
have : (Polynomial.bernoulli (2 * k + 1)).map (algebraMap ℚ ℂ) = _ :=
(Polynomial.map_map (algebraMap ℚ ℝ) ofReal _).symm
rw [this, ← ofReal_eq_coe, ← ofReal_eq_coe]
apply Polynomial.map_aeval_eq_aeval_map
simp only [Algebra.id.map_eq_id, RingHomCompTriple.comp_eq]
· rw [← Nat.cast_ofNat, ← Nat.cast_one, ← Nat.cast_mul, ← Nat.cast_add_one, natCast_re,
Nat.cast_lt, lt_add_iff_pos_left]
exact mul_pos two_pos (Nat.pos_of_ne_zero hk)
theorem cosZeta_two_mul_nat' (hk : k ≠ 0) (hx : x ∈ Icc (0 : ℝ) 1) :
cosZeta x (2 * k) = (-1) ^ (k + 1) / (2 * k) / Gammaℂ (2 * k) *
((Polynomial.bernoulli (2 * k)).map (algebraMap ℚ ℂ)).eval (x : ℂ) := by
rw [cosZeta_two_mul_nat hk hx]
congr 1
have : (2 * k)! = (2 * k) * Complex.Gamma (2 * k) := by
rw [(by { norm_cast; omega } : 2 * (k : ℂ) = ↑(2 * k - 1) + 1), Complex.Gamma_nat_eq_factorial,
← Nat.cast_add_one, ← Nat.cast_mul, ← Nat.factorial_succ, Nat.sub_add_cancel (by omega)]
simp_rw [this, Gammaℂ, cpow_neg, ← div_div, div_inv_eq_mul, div_mul_eq_mul_div, div_div,
mul_right_comm (2 : ℂ) (k : ℂ)]
norm_cast
theorem sinZeta_two_mul_nat_add_one' (hk : k ≠ 0) (hx : x ∈ Icc (0 : ℝ) 1) :
sinZeta x (2 * k + 1) = (-1) ^ (k + 1) / (2 * k + 1) / Gammaℂ (2 * k + 1) *
((Polynomial.bernoulli (2 * k + 1)).map (algebraMap ℚ ℂ)).eval (x : ℂ) := by
rw [sinZeta_two_mul_nat_add_one hk hx]
congr 1
have : (2 * k + 1)! = (2 * k + 1) * Complex.Gamma (2 * k + 1) := by
rw [(by simp : Complex.Gamma (2 * k + 1) = Complex.Gamma (↑(2 * k) + 1)),
Complex.Gamma_nat_eq_factorial, ← Nat.cast_ofNat (R := ℂ), ← Nat.cast_mul,
← Nat.cast_add_one, ← Nat.cast_mul, ← Nat.factorial_succ]
simp_rw [this, Gammaℂ, cpow_neg, ← div_div, div_inv_eq_mul, div_mul_eq_mul_div, div_div]
rw [(by simp : 2 * (k : ℂ) + 1 = ↑(2 * k + 1)), cpow_natCast]
ring
| Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean | 126 | 146 | theorem hurwitzZetaEven_one_sub_two_mul_nat (hk : k ≠ 0) (hx : x ∈ Icc (0 : ℝ) 1) :
hurwitzZetaEven x (1 - 2 * k) =
-1 / (2 * k) * ((Polynomial.bernoulli (2 * k)).map (algebraMap ℚ ℂ)).eval (x : ℂ) := by |
have h1 (n : ℕ) : (2 * k : ℂ) ≠ -n := by
rw [← Int.cast_ofNat, ← Int.cast_natCast, ← Int.cast_mul, ← Int.cast_natCast n, ← Int.cast_neg,
Ne, Int.cast_inj, ← Ne]
refine ne_of_gt ((neg_nonpos_of_nonneg n.cast_nonneg).trans_lt (mul_pos two_pos ?_))
exact Nat.cast_pos.mpr (Nat.pos_of_ne_zero hk)
have h2 : (2 * k : ℂ) ≠ 1 := by norm_cast; simp only [mul_eq_one, OfNat.ofNat_ne_one,
false_and, not_false_eq_true]
have h3 : Gammaℂ (2 * k) ≠ 0 := by
refine mul_ne_zero (mul_ne_zero two_ne_zero ?_) (Gamma_ne_zero h1)
simp only [ne_eq, cpow_eq_zero_iff, mul_eq_zero, OfNat.ofNat_ne_zero, ofReal_eq_zero,
pi_ne_zero, Nat.cast_eq_zero, false_or, false_and, not_false_eq_true]
rw [hurwitzZetaEven_one_sub _ h1 (Or.inr h2), ← Gammaℂ, cosZeta_two_mul_nat' hk hx, ← mul_assoc,
← mul_div_assoc, mul_assoc, mul_div_cancel_left₀ _ h3, ← mul_div_assoc]
congr 2
rw [mul_div_assoc, mul_div_cancel_left₀ _ two_ne_zero, ← ofReal_natCast, ← ofReal_mul,
← ofReal_cos, mul_comm π, ← sub_zero (k * π), cos_nat_mul_pi_sub, Real.cos_zero, mul_one,
ofReal_pow, ofReal_neg, ofReal_one, pow_succ, mul_neg_one, mul_neg, ← mul_pow, neg_one_mul,
neg_neg, one_pow]
|
import Mathlib.Data.Set.Function
import Mathlib.Logic.Relation
import Mathlib.Logic.Pairwise
#align_import data.set.pairwise.basic from "leanprover-community/mathlib"@"c4c2ed622f43768eff32608d4a0f8a6cec1c047d"
open Function Order Set
variable {α β γ ι ι' : Type*} {r p q : α → α → Prop}
section Pairwise
variable {f g : ι → α} {s t u : Set α} {a b : α}
theorem pairwise_on_bool (hr : Symmetric r) {a b : α} :
Pairwise (r on fun c => cond c a b) ↔ r a b := by simpa [Pairwise, Function.onFun] using @hr a b
#align pairwise_on_bool pairwise_on_bool
theorem pairwise_disjoint_on_bool [SemilatticeInf α] [OrderBot α] {a b : α} :
Pairwise (Disjoint on fun c => cond c a b) ↔ Disjoint a b :=
pairwise_on_bool Disjoint.symm
#align pairwise_disjoint_on_bool pairwise_disjoint_on_bool
theorem Symmetric.pairwise_on [LinearOrder ι] (hr : Symmetric r) (f : ι → α) :
Pairwise (r on f) ↔ ∀ ⦃m n⦄, m < n → r (f m) (f n) :=
⟨fun h _m _n hmn => h hmn.ne, fun h _m _n hmn => hmn.lt_or_lt.elim (@h _ _) fun h' => hr (h h')⟩
#align symmetric.pairwise_on Symmetric.pairwise_on
theorem pairwise_disjoint_on [SemilatticeInf α] [OrderBot α] [LinearOrder ι] (f : ι → α) :
Pairwise (Disjoint on f) ↔ ∀ ⦃m n⦄, m < n → Disjoint (f m) (f n) :=
Symmetric.pairwise_on Disjoint.symm f
#align pairwise_disjoint_on pairwise_disjoint_on
theorem pairwise_disjoint_mono [SemilatticeInf α] [OrderBot α] (hs : Pairwise (Disjoint on f))
(h : g ≤ f) : Pairwise (Disjoint on g) :=
hs.mono fun i j hij => Disjoint.mono (h i) (h j) hij
#align pairwise_disjoint.mono pairwise_disjoint_mono
namespace Set
theorem Pairwise.mono (h : t ⊆ s) (hs : s.Pairwise r) : t.Pairwise r :=
fun _x xt _y yt => hs (h xt) (h yt)
#align set.pairwise.mono Set.Pairwise.mono
theorem Pairwise.mono' (H : r ≤ p) (hr : s.Pairwise r) : s.Pairwise p :=
hr.imp H
#align set.pairwise.mono' Set.Pairwise.mono'
theorem pairwise_top (s : Set α) : s.Pairwise ⊤ :=
pairwise_of_forall s _ fun _ _ => trivial
#align set.pairwise_top Set.pairwise_top
protected theorem Subsingleton.pairwise (h : s.Subsingleton) (r : α → α → Prop) : s.Pairwise r :=
fun _x hx _y hy hne => (hne (h hx hy)).elim
#align set.subsingleton.pairwise Set.Subsingleton.pairwise
@[simp]
theorem pairwise_empty (r : α → α → Prop) : (∅ : Set α).Pairwise r :=
subsingleton_empty.pairwise r
#align set.pairwise_empty Set.pairwise_empty
@[simp]
theorem pairwise_singleton (a : α) (r : α → α → Prop) : Set.Pairwise {a} r :=
subsingleton_singleton.pairwise r
#align set.pairwise_singleton Set.pairwise_singleton
theorem pairwise_iff_of_refl [IsRefl α r] : s.Pairwise r ↔ ∀ ⦃a⦄, a ∈ s → ∀ ⦃b⦄, b ∈ s → r a b :=
forall₄_congr fun _ _ _ _ => or_iff_not_imp_left.symm.trans <| or_iff_right_of_imp of_eq
#align set.pairwise_iff_of_refl Set.pairwise_iff_of_refl
alias ⟨Pairwise.of_refl, _⟩ := pairwise_iff_of_refl
#align set.pairwise.of_refl Set.Pairwise.of_refl
theorem Nonempty.pairwise_iff_exists_forall [IsEquiv α r] {s : Set ι} (hs : s.Nonempty) :
s.Pairwise (r on f) ↔ ∃ z, ∀ x ∈ s, r (f x) z := by
constructor
· rcases hs with ⟨y, hy⟩
refine fun H => ⟨f y, fun x hx => ?_⟩
rcases eq_or_ne x y with (rfl | hne)
· apply IsRefl.refl
· exact H hx hy hne
· rintro ⟨z, hz⟩ x hx y hy _
exact @IsTrans.trans α r _ (f x) z (f y) (hz _ hx) (IsSymm.symm _ _ <| hz _ hy)
#align set.nonempty.pairwise_iff_exists_forall Set.Nonempty.pairwise_iff_exists_forall
theorem Nonempty.pairwise_eq_iff_exists_eq {s : Set α} (hs : s.Nonempty) {f : α → ι} :
(s.Pairwise fun x y => f x = f y) ↔ ∃ z, ∀ x ∈ s, f x = z :=
hs.pairwise_iff_exists_forall
#align set.nonempty.pairwise_eq_iff_exists_eq Set.Nonempty.pairwise_eq_iff_exists_eq
theorem pairwise_iff_exists_forall [Nonempty ι] (s : Set α) (f : α → ι) {r : ι → ι → Prop}
[IsEquiv ι r] : s.Pairwise (r on f) ↔ ∃ z, ∀ x ∈ s, r (f x) z := by
rcases s.eq_empty_or_nonempty with (rfl | hne)
· simp
· exact hne.pairwise_iff_exists_forall
#align set.pairwise_iff_exists_forall Set.pairwise_iff_exists_forall
theorem pairwise_eq_iff_exists_eq [Nonempty ι] (s : Set α) (f : α → ι) :
(s.Pairwise fun x y => f x = f y) ↔ ∃ z, ∀ x ∈ s, f x = z :=
pairwise_iff_exists_forall s f
#align set.pairwise_eq_iff_exists_eq Set.pairwise_eq_iff_exists_eq
| Mathlib/Data/Set/Pairwise/Basic.lean | 137 | 143 | theorem pairwise_union :
(s ∪ t).Pairwise r ↔
s.Pairwise r ∧ t.Pairwise r ∧ ∀ a ∈ s, ∀ b ∈ t, a ≠ b → r a b ∧ r b a := by |
simp only [Set.Pairwise, mem_union, or_imp, forall_and]
exact
⟨fun H => ⟨H.1.1, H.2.2, H.1.2, fun x hx y hy hne => H.2.1 y hy x hx hne.symm⟩,
fun H => ⟨⟨H.1, H.2.2.1⟩, fun x hx y hy hne => H.2.2.2 y hy x hx hne.symm, H.2.1⟩⟩
|
import Mathlib.LinearAlgebra.Matrix.DotProduct
import Mathlib.LinearAlgebra.Determinant
import Mathlib.LinearAlgebra.Matrix.Diagonal
#align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7"
open Matrix
namespace Matrix
open FiniteDimensional
variable {l m n o R : Type*} [Fintype n] [Fintype o]
section CommRing
variable [CommRing R]
noncomputable def rank (A : Matrix m n R) : ℕ :=
finrank R <| LinearMap.range A.mulVecLin
#align matrix.rank Matrix.rank
@[simp]
theorem rank_one [StrongRankCondition R] [DecidableEq n] :
rank (1 : Matrix n n R) = Fintype.card n := by
rw [rank, mulVecLin_one, LinearMap.range_id, finrank_top, finrank_pi]
#align matrix.rank_one Matrix.rank_one
@[simp]
theorem rank_zero [Nontrivial R] : rank (0 : Matrix m n R) = 0 := by
rw [rank, mulVecLin_zero, LinearMap.range_zero, finrank_bot]
#align matrix.rank_zero Matrix.rank_zero
theorem rank_le_card_width [StrongRankCondition R] (A : Matrix m n R) :
A.rank ≤ Fintype.card n := by
haveI : Module.Finite R (n → R) := Module.Finite.pi
haveI : Module.Free R (n → R) := Module.Free.pi _ _
exact A.mulVecLin.finrank_range_le.trans_eq (finrank_pi _)
#align matrix.rank_le_card_width Matrix.rank_le_card_width
theorem rank_le_width [StrongRankCondition R] {m n : ℕ} (A : Matrix (Fin m) (Fin n) R) :
A.rank ≤ n :=
A.rank_le_card_width.trans <| (Fintype.card_fin n).le
#align matrix.rank_le_width Matrix.rank_le_width
| Mathlib/Data/Matrix/Rank.lean | 71 | 74 | theorem rank_mul_le_left [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) :
(A * B).rank ≤ A.rank := by |
rw [rank, rank, mulVecLin_mul]
exact Cardinal.toNat_le_toNat (LinearMap.rank_comp_le_left _ _) (rank_lt_aleph0 _ _)
|
import Mathlib.Order.Filter.AtTopBot
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.LinearCombination
import Mathlib.Tactic.Linarith.Frontend
#align_import algebra.quadratic_discriminant from "leanprover-community/mathlib"@"e085d1df33274f4b32f611f483aae678ba0b42df"
open Filter
section Ring
variable {R : Type*}
def discrim [Ring R] (a b c : R) : R :=
b ^ 2 - 4 * a * c
#align discrim discrim
@[simp] lemma discrim_neg [Ring R] (a b c : R) : discrim (-a) (-b) (-c) = discrim a b c := by
simp [discrim]
#align discrim_neg discrim_neg
variable [CommRing R] {a b c : R}
lemma discrim_eq_sq_of_quadratic_eq_zero {x : R} (h : a * x * x + b * x + c = 0) :
discrim a b c = (2 * a * x + b) ^ 2 := by
rw [discrim]
linear_combination -4 * a * h
#align discrim_eq_sq_of_quadratic_eq_zero discrim_eq_sq_of_quadratic_eq_zero
| Mathlib/Algebra/QuadraticDiscriminant.lean | 63 | 70 | theorem quadratic_eq_zero_iff_discrim_eq_sq [NeZero (2 : R)] [NoZeroDivisors R]
(ha : a ≠ 0) (x : R) :
a * x * x + b * x + c = 0 ↔ discrim a b c = (2 * a * x + b) ^ 2 := by |
refine ⟨discrim_eq_sq_of_quadratic_eq_zero, fun h ↦ ?_⟩
rw [discrim] at h
have ha : 2 * 2 * a ≠ 0 := mul_ne_zero (mul_ne_zero (NeZero.ne _) (NeZero.ne _)) ha
apply mul_left_cancel₀ ha
linear_combination -h
|
import Mathlib.Analysis.Calculus.Deriv.Mul
import Mathlib.Analysis.Calculus.Deriv.Comp
#align_import analysis.calculus.deriv.pow from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
open scoped Classical
open Topology Filter ENNReal
open Filter Asymptotics Set
variable {𝕜 : Type u} [NontriviallyNormedField 𝕜]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
variable {f f₀ f₁ g : 𝕜 → F}
variable {f' f₀' f₁' g' : F}
variable {x : 𝕜}
variable {s t : Set 𝕜}
variable {L L₁ L₂ : Filter 𝕜}
variable {c : 𝕜 → 𝕜} {c' : 𝕜}
variable (n : ℕ)
theorem hasStrictDerivAt_pow :
∀ (n : ℕ) (x : 𝕜), HasStrictDerivAt (fun x : 𝕜 ↦ x ^ n) ((n : 𝕜) * x ^ (n - 1)) x
| 0, x => by simp [hasStrictDerivAt_const]
| 1, x => by simpa using hasStrictDerivAt_id x
| n + 1 + 1, x => by
simpa [pow_succ, add_mul, mul_assoc] using
(hasStrictDerivAt_pow (n + 1) x).mul (hasStrictDerivAt_id x)
#align has_strict_deriv_at_pow hasStrictDerivAt_pow
theorem hasDerivAt_pow (n : ℕ) (x : 𝕜) :
HasDerivAt (fun x : 𝕜 => x ^ n) ((n : 𝕜) * x ^ (n - 1)) x :=
(hasStrictDerivAt_pow n x).hasDerivAt
#align has_deriv_at_pow hasDerivAt_pow
theorem hasDerivWithinAt_pow (n : ℕ) (x : 𝕜) (s : Set 𝕜) :
HasDerivWithinAt (fun x : 𝕜 => x ^ n) ((n : 𝕜) * x ^ (n - 1)) s x :=
(hasDerivAt_pow n x).hasDerivWithinAt
#align has_deriv_within_at_pow hasDerivWithinAt_pow
theorem differentiableAt_pow : DifferentiableAt 𝕜 (fun x : 𝕜 => x ^ n) x :=
(hasDerivAt_pow n x).differentiableAt
#align differentiable_at_pow differentiableAt_pow
theorem differentiableWithinAt_pow :
DifferentiableWithinAt 𝕜 (fun x : 𝕜 => x ^ n) s x :=
(differentiableAt_pow n).differentiableWithinAt
#align differentiable_within_at_pow differentiableWithinAt_pow
theorem differentiable_pow : Differentiable 𝕜 fun x : 𝕜 => x ^ n := fun _ => differentiableAt_pow n
#align differentiable_pow differentiable_pow
theorem differentiableOn_pow : DifferentiableOn 𝕜 (fun x : 𝕜 => x ^ n) s :=
(differentiable_pow n).differentiableOn
#align differentiable_on_pow differentiableOn_pow
theorem deriv_pow : deriv (fun x : 𝕜 => x ^ n) x = (n : 𝕜) * x ^ (n - 1) :=
(hasDerivAt_pow n x).deriv
#align deriv_pow deriv_pow
@[simp]
theorem deriv_pow' : (deriv fun x : 𝕜 => x ^ n) = fun x => (n : 𝕜) * x ^ (n - 1) :=
funext fun _ => deriv_pow n
#align deriv_pow' deriv_pow'
theorem derivWithin_pow (hxs : UniqueDiffWithinAt 𝕜 s x) :
derivWithin (fun x : 𝕜 => x ^ n) s x = (n : 𝕜) * x ^ (n - 1) :=
(hasDerivWithinAt_pow n x s).derivWithin hxs
#align deriv_within_pow derivWithin_pow
theorem HasDerivWithinAt.pow (hc : HasDerivWithinAt c c' s x) :
HasDerivWithinAt (fun y => c y ^ n) ((n : 𝕜) * c x ^ (n - 1) * c') s x :=
(hasDerivAt_pow n (c x)).comp_hasDerivWithinAt x hc
#align has_deriv_within_at.pow HasDerivWithinAt.pow
| Mathlib/Analysis/Calculus/Deriv/Pow.lean | 99 | 102 | theorem HasDerivAt.pow (hc : HasDerivAt c c' x) :
HasDerivAt (fun y => c y ^ n) ((n : 𝕜) * c x ^ (n - 1) * c') x := by |
rw [← hasDerivWithinAt_univ] at *
exact hc.pow n
|
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Module.LinearMap.Basic
import Mathlib.Data.Finset.Preimage
import Mathlib.Data.Set.Finite
import Mathlib.GroupTheory.GroupAction.BigOperators
#align_import data.dfinsupp.basic from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
universe u u₁ u₂ v v₁ v₂ v₃ w x y l
variable {ι : Type u} {γ : Type w} {β : ι → Type v} {β₁ : ι → Type v₁} {β₂ : ι → Type v₂}
variable (β)
structure DFinsupp [∀ i, Zero (β i)] : Type max u v where mk' ::
toFun : ∀ i, β i
support' : Trunc { s : Multiset ι // ∀ i, i ∈ s ∨ toFun i = 0 }
#align dfinsupp DFinsupp
variable {β}
notation3 "Π₀ "(...)", "r:(scoped f => DFinsupp f) => r
namespace DFinsupp
section Basic
variable [∀ i, Zero (β i)] [∀ i, Zero (β₁ i)] [∀ i, Zero (β₂ i)]
instance instDFunLike : DFunLike (Π₀ i, β i) ι β :=
⟨fun f => f.toFun, fun ⟨f₁, s₁⟩ ⟨f₂, s₁⟩ ↦ fun (h : f₁ = f₂) ↦ by
subst h
congr
apply Subsingleton.elim ⟩
#align dfinsupp.fun_like DFinsupp.instDFunLike
instance : CoeFun (Π₀ i, β i) fun _ => ∀ i, β i :=
inferInstance
@[simp]
theorem toFun_eq_coe (f : Π₀ i, β i) : f.toFun = f :=
rfl
#align dfinsupp.to_fun_eq_coe DFinsupp.toFun_eq_coe
@[ext]
theorem ext {f g : Π₀ i, β i} (h : ∀ i, f i = g i) : f = g :=
DFunLike.ext _ _ h
#align dfinsupp.ext DFinsupp.ext
#align dfinsupp.ext_iff DFunLike.ext_iff
#align dfinsupp.coe_fn_injective DFunLike.coe_injective
lemma ne_iff {f g : Π₀ i, β i} : f ≠ g ↔ ∃ i, f i ≠ g i := DFunLike.ne_iff
instance : Zero (Π₀ i, β i) :=
⟨⟨0, Trunc.mk <| ⟨∅, fun _ => Or.inr rfl⟩⟩⟩
instance : Inhabited (Π₀ i, β i) :=
⟨0⟩
@[simp, norm_cast] lemma coe_mk' (f : ∀ i, β i) (s) : ⇑(⟨f, s⟩ : Π₀ i, β i) = f := rfl
#align dfinsupp.coe_mk' DFinsupp.coe_mk'
@[simp, norm_cast] lemma coe_zero : ⇑(0 : Π₀ i, β i) = 0 := rfl
#align dfinsupp.coe_zero DFinsupp.coe_zero
theorem zero_apply (i : ι) : (0 : Π₀ i, β i) i = 0 :=
rfl
#align dfinsupp.zero_apply DFinsupp.zero_apply
def mapRange (f : ∀ i, β₁ i → β₂ i) (hf : ∀ i, f i 0 = 0) (x : Π₀ i, β₁ i) : Π₀ i, β₂ i :=
⟨fun i => f i (x i),
x.support'.map fun s => ⟨s.1, fun i => (s.2 i).imp_right fun h : x i = 0 => by
rw [← hf i, ← h]⟩⟩
#align dfinsupp.map_range DFinsupp.mapRange
@[simp]
theorem mapRange_apply (f : ∀ i, β₁ i → β₂ i) (hf : ∀ i, f i 0 = 0) (g : Π₀ i, β₁ i) (i : ι) :
mapRange f hf g i = f i (g i) :=
rfl
#align dfinsupp.map_range_apply DFinsupp.mapRange_apply
@[simp]
theorem mapRange_id (h : ∀ i, id (0 : β₁ i) = 0 := fun i => rfl) (g : Π₀ i : ι, β₁ i) :
mapRange (fun i => (id : β₁ i → β₁ i)) h g = g := by
ext
rfl
#align dfinsupp.map_range_id DFinsupp.mapRange_id
theorem mapRange_comp (f : ∀ i, β₁ i → β₂ i) (f₂ : ∀ i, β i → β₁ i) (hf : ∀ i, f i 0 = 0)
(hf₂ : ∀ i, f₂ i 0 = 0) (h : ∀ i, (f i ∘ f₂ i) 0 = 0) (g : Π₀ i : ι, β i) :
mapRange (fun i => f i ∘ f₂ i) h g = mapRange f hf (mapRange f₂ hf₂ g) := by
ext
simp only [mapRange_apply]; rfl
#align dfinsupp.map_range_comp DFinsupp.mapRange_comp
@[simp]
| Mathlib/Data/DFinsupp/Basic.lean | 158 | 161 | theorem mapRange_zero (f : ∀ i, β₁ i → β₂ i) (hf : ∀ i, f i 0 = 0) :
mapRange f hf (0 : Π₀ i, β₁ i) = 0 := by |
ext
simp only [mapRange_apply, coe_zero, Pi.zero_apply, hf]
|
import Mathlib.Algebra.Order.Interval.Set.Instances
import Mathlib.Order.Interval.Set.ProjIcc
import Mathlib.Topology.Instances.Real
#align_import topology.unit_interval from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open scoped Classical
open Topology Filter
open Set Int Set.Icc
abbrev unitInterval : Set ℝ :=
Set.Icc 0 1
#align unit_interval unitInterval
@[inherit_doc]
scoped[unitInterval] notation "I" => unitInterval
section partition
@[simp]
theorem projIcc_eq_zero {x : ℝ} : projIcc (0 : ℝ) 1 zero_le_one x = 0 ↔ x ≤ 0 :=
projIcc_eq_left zero_lt_one
#align proj_Icc_eq_zero projIcc_eq_zero
@[simp]
theorem projIcc_eq_one {x : ℝ} : projIcc (0 : ℝ) 1 zero_le_one x = 1 ↔ 1 ≤ x :=
projIcc_eq_right zero_lt_one
#align proj_Icc_eq_one projIcc_eq_one
section
variable {𝕜 : Type*} [LinearOrderedField 𝕜] [TopologicalSpace 𝕜] [TopologicalRing 𝕜]
-- We only need the ordering on `𝕜` here to avoid talking about flipping the interval over.
-- At the end of the day I only care about `ℝ`, so I'm hesitant to put work into generalizing.
| Mathlib/Topology/UnitInterval.lean | 323 | 324 | theorem affineHomeomorph_image_I (a b : 𝕜) (h : 0 < a) :
affineHomeomorph a b h.ne.symm '' Set.Icc 0 1 = Set.Icc b (a + b) := by | simp [h]
|
import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv
#align_import linear_algebra.quadratic_form.prod from "leanprover-community/mathlib"@"9b2755b951bc323c962bd072cd447b375cf58101"
universe u v w
variable {ι : Type*} {R : Type*} {M₁ M₂ N₁ N₂ : Type*} {Mᵢ Nᵢ : ι → Type*}
namespace QuadraticForm
section Prod
section Semiring
variable [CommSemiring R]
variable [AddCommMonoid M₁] [AddCommMonoid M₂] [AddCommMonoid N₁] [AddCommMonoid N₂]
variable [Module R M₁] [Module R M₂] [Module R N₁] [Module R N₂]
@[simps!]
def prod (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) : QuadraticForm R (M₁ × M₂) :=
Q₁.comp (LinearMap.fst _ _ _) + Q₂.comp (LinearMap.snd _ _ _)
#align quadratic_form.prod QuadraticForm.prod
@[simps toLinearEquiv]
def IsometryEquiv.prod
{Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂}
{Q₁' : QuadraticForm R N₁} {Q₂' : QuadraticForm R N₂}
(e₁ : Q₁.IsometryEquiv Q₁') (e₂ : Q₂.IsometryEquiv Q₂') :
(Q₁.prod Q₂).IsometryEquiv (Q₁'.prod Q₂') where
map_app' x := congr_arg₂ (· + ·) (e₁.map_app x.1) (e₂.map_app x.2)
toLinearEquiv := LinearEquiv.prod e₁.toLinearEquiv e₂.toLinearEquiv
#align quadratic_form.isometry.prod QuadraticForm.IsometryEquiv.prod
@[simps!]
def Isometry.inl (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) : Q₁ →qᵢ (Q₁.prod Q₂) where
toLinearMap := LinearMap.inl R _ _
map_app' m₁ := by simp
@[simps!]
def Isometry.inr (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) : Q₂ →qᵢ (Q₁.prod Q₂) where
toLinearMap := LinearMap.inr R _ _
map_app' m₁ := by simp
variable (M₂) in
@[simps!]
def Isometry.fst (Q₁ : QuadraticForm R M₁) : (Q₁.prod (0 : QuadraticForm R M₂)) →qᵢ Q₁ where
toLinearMap := LinearMap.fst R _ _
map_app' m₁ := by simp
variable (M₁) in
@[simps!]
def Isometry.snd (Q₂ : QuadraticForm R M₂) : ((0 : QuadraticForm R M₁).prod Q₂) →qᵢ Q₂ where
toLinearMap := LinearMap.snd R _ _
map_app' m₁ := by simp
@[simp]
lemma Isometry.fst_comp_inl (Q₁ : QuadraticForm R M₁) :
(fst M₂ Q₁).comp (inl Q₁ (0 : QuadraticForm R M₂)) = .id _ :=
ext fun _ => rfl
@[simp]
lemma Isometry.snd_comp_inr (Q₂ : QuadraticForm R M₂) :
(snd M₁ Q₂).comp (inr (0 : QuadraticForm R M₁) Q₂) = .id _ :=
ext fun _ => rfl
@[simp]
lemma Isometry.snd_comp_inl (Q₂ : QuadraticForm R M₂) :
(snd M₁ Q₂).comp (inl (0 : QuadraticForm R M₁) Q₂) = 0 :=
ext fun _ => rfl
@[simp]
lemma Isometry.fst_comp_inr (Q₁ : QuadraticForm R M₁) :
(fst M₂ Q₁).comp (inr Q₁ (0 : QuadraticForm R M₂)) = 0 :=
ext fun _ => rfl
theorem Equivalent.prod {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂}
{Q₁' : QuadraticForm R N₁} {Q₂' : QuadraticForm R N₂} (e₁ : Q₁.Equivalent Q₁')
(e₂ : Q₂.Equivalent Q₂') : (Q₁.prod Q₂).Equivalent (Q₁'.prod Q₂') :=
Nonempty.map2 IsometryEquiv.prod e₁ e₂
#align quadratic_form.equivalent.prod QuadraticForm.Equivalent.prod
@[simps!]
def IsometryEquiv.prodComm (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) :
(Q₁.prod Q₂).IsometryEquiv (Q₂.prod Q₁) where
toLinearEquiv := LinearEquiv.prodComm _ _ _
map_app' _ := add_comm _ _
@[simps!]
def IsometryEquiv.prodProdProdComm
(Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂)
(Q₃ : QuadraticForm R N₁) (Q₄ : QuadraticForm R N₂) :
((Q₁.prod Q₂).prod (Q₃.prod Q₄)).IsometryEquiv ((Q₁.prod Q₃).prod (Q₂.prod Q₄)) where
toLinearEquiv := LinearEquiv.prodProdProdComm _ _ _ _ _
map_app' _ := add_add_add_comm _ _ _ _
theorem anisotropic_of_prod {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
{Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} (h : (Q₁.prod Q₂).Anisotropic) :
Q₁.Anisotropic ∧ Q₂.Anisotropic := by
simp_rw [Anisotropic, prod_apply, Prod.forall, Prod.mk_eq_zero] at h
constructor
· intro x hx
refine (h x 0 ?_).1
rw [hx, zero_add, map_zero]
· intro x hx
refine (h 0 x ?_).2
rw [hx, add_zero, map_zero]
#align quadratic_form.anisotropic_of_prod QuadraticForm.anisotropic_of_prod
| Mathlib/LinearAlgebra/QuadraticForm/Prod.lean | 150 | 160 | theorem nonneg_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
{Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
(∀ x, 0 ≤ (Q₁.prod Q₂) x) ↔ (∀ x, 0 ≤ Q₁ x) ∧ ∀ x, 0 ≤ Q₂ x := by |
simp_rw [Prod.forall, prod_apply]
constructor
· intro h
constructor
· intro x; simpa only [add_zero, map_zero] using h x 0
· intro x; simpa only [zero_add, map_zero] using h 0 x
· rintro ⟨h₁, h₂⟩ x₁ x₂
exact add_nonneg (h₁ x₁) (h₂ x₂)
|
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.Algebra.Polynomial.HasseDeriv
#align_import data.polynomial.taylor from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
namespace Polynomial
open Polynomial
variable {R : Type*} [Semiring R] (r : R) (f : R[X])
def taylor (r : R) : R[X] →ₗ[R] R[X] where
toFun f := f.comp (X + C r)
map_add' f g := add_comp
map_smul' c f := by simp only [smul_eq_C_mul, C_mul_comp, RingHom.id_apply]
#align polynomial.taylor Polynomial.taylor
theorem taylor_apply : taylor r f = f.comp (X + C r) :=
rfl
#align polynomial.taylor_apply Polynomial.taylor_apply
@[simp]
| Mathlib/Algebra/Polynomial/Taylor.lean | 46 | 46 | theorem taylor_X : taylor r X = X + C r := by | simp only [taylor_apply, X_comp]
|
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
| Mathlib/NumberTheory/Padics/RingHoms.lean | 82 | 101 | 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]
|
import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf
import Mathlib.AlgebraicGeometry.GammaSpecAdjunction
import Mathlib.RingTheory.GradedAlgebra.Radical
#align_import algebraic_geometry.projective_spectrum.scheme from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc"
noncomputable section
set_option linter.uppercaseLean3 false
namespace AlgebraicGeometry
open scoped DirectSum Pointwise
open DirectSum SetLike.GradedMonoid Localization
open Finset hiding mk_zero
variable {R A : Type*}
variable [CommRing R] [CommRing A] [Algebra R A]
variable (𝒜 : ℕ → Submodule R A)
variable [GradedAlgebra 𝒜]
open TopCat TopologicalSpace
open CategoryTheory Opposite
open ProjectiveSpectrum.StructureSheaf
-- Porting note: currently require lack of hygiene to use in variable declarations
-- maybe all make into notation3?
set_option hygiene false
local notation3 "Proj" => Proj.toLocallyRingedSpace 𝒜
local notation3 "Proj.T" => PresheafedSpace.carrier <| SheafedSpace.toPresheafedSpace
<| LocallyRingedSpace.toSheafedSpace <| Proj.toLocallyRingedSpace 𝒜
macro "Proj| " U:term : term =>
`((Proj.toLocallyRingedSpace 𝒜).restrict (Opens.openEmbedding (X := Proj.T) ($U : Opens Proj.T)))
local notation "Proj.T| " U => PresheafedSpace.carrier <| SheafedSpace.toPresheafedSpace
<| LocallyRingedSpace.toSheafedSpace
<| (LocallyRingedSpace.restrict Proj (Opens.openEmbedding (X := Proj.T) (U : Opens Proj.T)))
local notation "pbo " x => ProjectiveSpectrum.basicOpen 𝒜 x
local notation "sbo " f => PrimeSpectrum.basicOpen f
local notation3 "Spec " ring => Spec.locallyRingedSpaceObj (CommRingCat.of ring)
local notation "Spec.T " ring =>
(Spec.locallyRingedSpaceObj (CommRingCat.of ring)).toSheafedSpace.toPresheafedSpace.1
local notation3 "A⁰_ " f => HomogeneousLocalization.Away 𝒜 f
namespace ProjIsoSpecTopComponent
namespace ToSpec
open Ideal
-- This section is to construct the forward direction :
-- So for any `x` in `Proj| (pbo f)`, we need some point in `Spec A⁰_f`, i.e. a prime ideal,
-- and we need this correspondence to be continuous in their Zariski topology.
variable {𝒜} {f : A} {m : ℕ} (f_deg : f ∈ 𝒜 m) (x : Proj| (pbo f))
def carrier : Ideal (A⁰_ f) :=
Ideal.comap (algebraMap (A⁰_ f) (Away f))
(x.val.asHomogeneousIdeal.toIdeal.map (algebraMap A (Away f)))
#align algebraic_geometry.Proj_iso_Spec_Top_component.to_Spec.carrier AlgebraicGeometry.ProjIsoSpecTopComponent.ToSpec.carrier
@[simp]
| Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean | 172 | 181 | theorem mk_mem_carrier (z : HomogeneousLocalization.NumDenSameDeg 𝒜 (.powers f)) :
HomogeneousLocalization.mk z ∈ carrier x ↔ z.num.1 ∈ x.1.asHomogeneousIdeal := by |
rw [carrier, Ideal.mem_comap, HomogeneousLocalization.algebraMap_apply,
HomogeneousLocalization.val_mk, Localization.mk_eq_mk', IsLocalization.mk'_eq_mul_mk'_one,
mul_comm, Ideal.unit_mul_mem_iff_mem, ← Ideal.mem_comap,
IsLocalization.comap_map_of_isPrime_disjoint (.powers f)]
· rfl
· infer_instance
· exact (disjoint_powers_iff_not_mem _ (Ideal.IsPrime.isRadical inferInstance)).mpr x.2
· exact isUnit_of_invertible _
|
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.RingTheory.Ideal.LocalRing
import Mathlib.RingTheory.Valuation.PrimeMultiplicity
import Mathlib.RingTheory.AdicCompletion.Basic
#align_import ring_theory.discrete_valuation_ring.basic from "leanprover-community/mathlib"@"c163ec99dfc664628ca15d215fce0a5b9c265b68"
open scoped Classical
universe u
open Ideal LocalRing
class DiscreteValuationRing (R : Type u) [CommRing R] [IsDomain R]
extends IsPrincipalIdealRing R, LocalRing R : Prop where
not_a_field' : maximalIdeal R ≠ ⊥
#align discrete_valuation_ring DiscreteValuationRing
namespace DiscreteValuationRing
variable (R : Type*)
def HasUnitMulPowIrreducibleFactorization [CommRing R] : Prop :=
∃ p : R, Irreducible p ∧ ∀ {x : R}, x ≠ 0 → ∃ n : ℕ, Associated (p ^ n) x
#align discrete_valuation_ring.has_unit_mul_pow_irreducible_factorization DiscreteValuationRing.HasUnitMulPowIrreducibleFactorization
namespace HasUnitMulPowIrreducibleFactorization
variable {R} [CommRing R] (hR : HasUnitMulPowIrreducibleFactorization R)
theorem unique_irreducible ⦃p q : R⦄ (hp : Irreducible p) (hq : Irreducible q) :
Associated p q := by
rcases hR with ⟨ϖ, hϖ, hR⟩
suffices ∀ {p : R} (_ : Irreducible p), Associated p ϖ by
apply Associated.trans (this hp) (this hq).symm
clear hp hq p q
intro p hp
obtain ⟨n, hn⟩ := hR hp.ne_zero
have : Irreducible (ϖ ^ n) := hn.symm.irreducible hp
rcases lt_trichotomy n 1 with (H | rfl | H)
· obtain rfl : n = 0 := by
clear hn this
revert H n
decide
simp [not_irreducible_one, pow_zero] at this
· simpa only [pow_one] using hn.symm
· obtain ⟨n, rfl⟩ : ∃ k, n = 1 + k + 1 := Nat.exists_eq_add_of_lt H
rw [pow_succ'] at this
rcases this.isUnit_or_isUnit rfl with (H0 | H0)
· exact (hϖ.not_unit H0).elim
· rw [add_comm, pow_succ'] at H0
exact (hϖ.not_unit (isUnit_of_mul_isUnit_left H0)).elim
#align discrete_valuation_ring.has_unit_mul_pow_irreducible_factorization.unique_irreducible DiscreteValuationRing.HasUnitMulPowIrreducibleFactorization.unique_irreducible
variable [IsDomain R]
theorem toUniqueFactorizationMonoid : UniqueFactorizationMonoid R :=
let p := Classical.choose hR
let spec := Classical.choose_spec hR
UniqueFactorizationMonoid.of_exists_prime_factors fun x hx => by
use Multiset.replicate (Classical.choose (spec.2 hx)) p
constructor
· intro q hq
have hpq := Multiset.eq_of_mem_replicate hq
rw [hpq]
refine ⟨spec.1.ne_zero, spec.1.not_unit, ?_⟩
intro a b h
by_cases ha : a = 0
· rw [ha]
simp only [true_or_iff, dvd_zero]
obtain ⟨m, u, rfl⟩ := spec.2 ha
rw [mul_assoc, mul_left_comm, Units.dvd_mul_left] at h
rw [Units.dvd_mul_right]
by_cases hm : m = 0
· simp only [hm, one_mul, pow_zero] at h ⊢
right
exact h
left
obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hm
rw [pow_succ']
apply dvd_mul_of_dvd_left dvd_rfl _
· rw [Multiset.prod_replicate]
exact Classical.choose_spec (spec.2 hx)
#align discrete_valuation_ring.has_unit_mul_pow_irreducible_factorization.to_unique_factorization_monoid DiscreteValuationRing.HasUnitMulPowIrreducibleFactorization.toUniqueFactorizationMonoid
| Mathlib/RingTheory/DiscreteValuationRing/Basic.lean | 227 | 245 | theorem of_ufd_of_unique_irreducible [UniqueFactorizationMonoid R] (h₁ : ∃ p : R, Irreducible p)
(h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q) :
HasUnitMulPowIrreducibleFactorization R := by |
obtain ⟨p, hp⟩ := h₁
refine ⟨p, hp, ?_⟩
intro x hx
cases' WfDvdMonoid.exists_factors x hx with fx hfx
refine ⟨Multiset.card fx, ?_⟩
have H := hfx.2
rw [← Associates.mk_eq_mk_iff_associated] at H ⊢
rw [← H, ← Associates.prod_mk, Associates.mk_pow, ← Multiset.prod_replicate]
congr 1
symm
rw [Multiset.eq_replicate]
simp only [true_and_iff, and_imp, Multiset.card_map, eq_self_iff_true, Multiset.mem_map,
exists_imp]
rintro _ q hq rfl
rw [Associates.mk_eq_mk_iff_associated]
apply h₂ (hfx.1 _ hq) hp
|
import Mathlib.Topology.Separation
import Mathlib.Algebra.Group.Defs
#align_import topology.algebra.semigroup from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514"
@[to_additive
"Any nonempty compact Hausdorff additive semigroup where right-addition is continuous
contains an idempotent, i.e. an `m` such that `m + m = m`"]
theorem exists_idempotent_of_compact_t2_of_continuous_mul_left {M} [Nonempty M] [Semigroup M]
[TopologicalSpace M] [CompactSpace M] [T2Space M]
(continuous_mul_left : ∀ r : M, Continuous (· * r)) : ∃ m : M, m * m = m := by
let S : Set (Set M) :=
{ N | IsClosed N ∧ N.Nonempty ∧ ∀ (m) (_ : m ∈ N) (m') (_ : m' ∈ N), m * m' ∈ N }
rsuffices ⟨N, ⟨N_closed, ⟨m, hm⟩, N_mul⟩, N_minimal⟩ : ∃ N ∈ S, ∀ N' ∈ S, N' ⊆ N → N' = N
· use m
have scaling_eq_self : (· * m) '' N = N := by
apply N_minimal
· refine ⟨(continuous_mul_left m).isClosedMap _ N_closed, ⟨_, ⟨m, hm, rfl⟩⟩, ?_⟩
rintro _ ⟨m'', hm'', rfl⟩ _ ⟨m', hm', rfl⟩
exact ⟨m'' * m * m', N_mul _ (N_mul _ hm'' _ hm) _ hm', mul_assoc _ _ _⟩
· rintro _ ⟨m', hm', rfl⟩
exact N_mul _ hm' _ hm
have absorbing_eq_self : N ∩ { m' | m' * m = m } = N := by
apply N_minimal
· refine ⟨N_closed.inter ((T1Space.t1 m).preimage (continuous_mul_left m)), ?_, ?_⟩
· rwa [← scaling_eq_self] at hm
· rintro m'' ⟨mem'', eq'' : _ = m⟩ m' ⟨mem', eq' : _ = m⟩
refine ⟨N_mul _ mem'' _ mem', ?_⟩
rw [Set.mem_setOf_eq, mul_assoc, eq', eq'']
apply Set.inter_subset_left
-- Thus `m * m = m` as desired.
rw [← absorbing_eq_self] at hm
exact hm.2
refine zorn_superset _ fun c hcs hc => ?_
refine
⟨⋂₀ c, ⟨isClosed_sInter fun t ht => (hcs ht).1, ?_, fun m hm m' hm' => ?_⟩, fun s hs =>
Set.sInter_subset_of_mem hs⟩
· obtain rfl | hcnemp := c.eq_empty_or_nonempty
· rw [Set.sInter_empty]
apply Set.univ_nonempty
convert
@IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed _ _ _ hcnemp.coe_sort
((↑) : c → Set M) ?_ ?_ ?_ ?_
· exact Set.sInter_eq_iInter
· refine DirectedOn.directed_val (IsChain.directedOn hc.symm)
exacts [fun i => (hcs i.prop).2.1, fun i => (hcs i.prop).1.isCompact, fun i => (hcs i.prop).1]
· rw [Set.mem_sInter]
exact fun t ht => (hcs ht).2.2 m (Set.mem_sInter.mp hm t ht) m' (Set.mem_sInter.mp hm' t ht)
#align exists_idempotent_of_compact_t2_of_continuous_mul_left exists_idempotent_of_compact_t2_of_continuous_mul_left
#align exists_idempotent_of_compact_t2_of_continuous_add_left exists_idempotent_of_compact_t2_of_continuous_add_left
@[to_additive exists_idempotent_in_compact_add_subsemigroup
"A version of
`exists_idempotent_of_compact_t2_of_continuous_add_left` where the idempotent lies in
some specified nonempty compact additive subsemigroup."]
| Mathlib/Topology/Algebra/Semigroup.lean | 82 | 95 | theorem exists_idempotent_in_compact_subsemigroup {M} [Semigroup M] [TopologicalSpace M] [T2Space M]
(continuous_mul_left : ∀ r : M, Continuous (· * r)) (s : Set M) (snemp : s.Nonempty)
(s_compact : IsCompact s) (s_add : ∀ᵉ (x ∈ s) (y ∈ s), x * y ∈ s) :
∃ m ∈ s, m * m = m := by |
let M' := { m // m ∈ s }
letI : Semigroup M' :=
{ mul := fun p q => ⟨p.1 * q.1, s_add _ p.2 _ q.2⟩
mul_assoc := fun p q r => Subtype.eq (mul_assoc _ _ _) }
haveI : CompactSpace M' := isCompact_iff_compactSpace.mp s_compact
haveI : Nonempty M' := nonempty_subtype.mpr snemp
have : ∀ p : M', Continuous (· * p) := fun p =>
((continuous_mul_left p.1).comp continuous_subtype_val).subtype_mk _
obtain ⟨⟨m, hm⟩, idem⟩ := exists_idempotent_of_compact_t2_of_continuous_mul_left this
exact ⟨m, hm, Subtype.ext_iff.mp idem⟩
|
import Mathlib.Probability.ProbabilityMassFunction.Basic
import Mathlib.Probability.ProbabilityMassFunction.Constructions
import Mathlib.MeasureTheory.Integral.Bochner
namespace PMF
open MeasureTheory ENNReal TopologicalSpace
section General
variable {α : Type*} [MeasurableSpace α] [MeasurableSingletonClass α]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
theorem integral_eq_tsum (p : PMF α) (f : α → E) (hf : Integrable f p.toMeasure) :
∫ a, f a ∂(p.toMeasure) = ∑' a, (p a).toReal • f a := calc
_ = ∫ a in p.support, f a ∂(p.toMeasure) := by rw [restrict_toMeasure_support p]
_ = ∑' (a : support p), (p.toMeasure {a.val}).toReal • f a := by
apply integral_countable f p.support_countable
rwa [restrict_toMeasure_support p]
_ = ∑' (a : support p), (p a).toReal • f a := by
congr with x; congr 2
apply PMF.toMeasure_apply_singleton p x (MeasurableSet.singleton _)
_ = ∑' a, (p a).toReal • f a :=
tsum_subtype_eq_of_support_subset <| by calc
(fun a ↦ (p a).toReal • f a).support ⊆ (fun a ↦ (p a).toReal).support :=
Function.support_smul_subset_left _ _
_ ⊆ support p := fun x h1 h2 => h1 (by simp [h2])
| Mathlib/Probability/ProbabilityMassFunction/Integrals.lean | 43 | 47 | theorem integral_eq_sum [Fintype α] (p : PMF α) (f : α → E) :
∫ a, f a ∂(p.toMeasure) = ∑ a, (p a).toReal • f a := by |
rw [integral_fintype _ (.of_finite _ f)]
congr with x; congr 2
exact PMF.toMeasure_apply_singleton p x (MeasurableSet.singleton _)
|
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
#align symm_diff_eq_bot symmDiff_eq_bot
theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
#align symm_diff_of_le symmDiff_of_le
theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq]
#align symm_diff_of_ge symmDiff_of_ge
theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c :=
sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb
#align symm_diff_le symmDiff_le
theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by
simp_rw [symmDiff, sup_le_iff, sdiff_le_iff]
#align symm_diff_le_iff symmDiff_le_iff
@[simp]
theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b :=
sup_le_sup sdiff_le sdiff_le
#align symm_diff_le_sup symmDiff_le_sup
theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by simp [sup_sdiff, symmDiff]
#align symm_diff_eq_sup_sdiff_inf symmDiff_eq_sup_sdiff_inf
| Mathlib/Order/SymmDiff.lean | 161 | 162 | theorem Disjoint.symmDiff_eq_sup {a b : α} (h : Disjoint a b) : a ∆ b = a ⊔ b := by |
rw [symmDiff, h.sdiff_eq_left, h.sdiff_eq_right]
|
import Mathlib.Probability.Kernel.Disintegration.Unique
import Mathlib.Probability.Notation
#align_import probability.kernel.cond_distrib from "leanprover-community/mathlib"@"00abe0695d8767201e6d008afa22393978bb324d"
open MeasureTheory Set Filter TopologicalSpace
open scoped ENNReal MeasureTheory ProbabilityTheory
namespace ProbabilityTheory
variable {α β Ω F : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω]
[Nonempty Ω] [NormedAddCommGroup F] {mα : MeasurableSpace α} {μ : Measure α} [IsFiniteMeasure μ]
{X : α → β} {Y : α → Ω}
noncomputable irreducible_def condDistrib {_ : MeasurableSpace α} [MeasurableSpace β] (Y : α → Ω)
(X : α → β) (μ : Measure α) [IsFiniteMeasure μ] : kernel β Ω :=
(μ.map fun a => (X a, Y a)).condKernel
#align probability_theory.cond_distrib ProbabilityTheory.condDistrib
instance [MeasurableSpace β] : IsMarkovKernel (condDistrib Y X μ) := by
rw [condDistrib]; infer_instance
variable {mβ : MeasurableSpace β} {s : Set Ω} {t : Set β} {f : β × Ω → F}
lemma condDistrib_apply_of_ne_zero [MeasurableSingletonClass β]
(hY : Measurable Y) (x : β) (hX : μ.map X {x} ≠ 0) (s : Set Ω) :
condDistrib Y X μ x s = (μ.map X {x})⁻¹ * μ.map (fun a => (X a, Y a)) ({x} ×ˢ s) := by
rw [condDistrib, Measure.condKernel_apply_of_ne_zero _ s]
· rw [Measure.fst_map_prod_mk hY]
· rwa [Measure.fst_map_prod_mk hY]
theorem condDistrib_ae_eq_of_measure_eq_compProd (hX : Measurable X) (hY : Measurable Y)
(κ : kernel β Ω) [IsFiniteKernel κ] (hκ : μ.map (fun x => (X x, Y x)) = μ.map X ⊗ₘ κ) :
∀ᵐ x ∂μ.map X, κ x = condDistrib Y X μ x := by
have heq : μ.map X = (μ.map (fun x ↦ (X x, Y x))).fst := by
ext s hs
rw [Measure.map_apply hX hs, Measure.fst_apply hs, Measure.map_apply]
exacts [rfl, Measurable.prod hX hY, measurable_fst hs]
rw [heq, condDistrib]
refine eq_condKernel_of_measure_eq_compProd _ ?_
convert hκ
exact heq.symm
section Integrability
theorem integrable_toReal_condDistrib (hX : AEMeasurable X μ) (hs : MeasurableSet s) :
Integrable (fun a => (condDistrib Y X μ (X a) s).toReal) μ := by
refine integrable_toReal_of_lintegral_ne_top ?_ ?_
· exact Measurable.comp_aemeasurable (kernel.measurable_coe _ hs) hX
· refine ne_of_lt ?_
calc
∫⁻ a, condDistrib Y X μ (X a) s ∂μ ≤ ∫⁻ _, 1 ∂μ := lintegral_mono fun a => prob_le_one
_ = μ univ := lintegral_one
_ < ∞ := measure_lt_top _ _
#align probability_theory.integrable_to_real_cond_distrib ProbabilityTheory.integrable_toReal_condDistrib
| Mathlib/Probability/Kernel/CondDistrib.lean | 145 | 148 | theorem _root_.MeasureTheory.Integrable.condDistrib_ae_map
(hY : AEMeasurable Y μ) (hf_int : Integrable f (μ.map fun a => (X a, Y a))) :
∀ᵐ b ∂μ.map X, Integrable (fun ω => f (b, ω)) (condDistrib Y X μ b) := by |
rw [condDistrib, ← Measure.fst_map_prod_mk₀ (X := X) hY]; exact hf_int.condKernel_ae
|
import Mathlib.Topology.Algebra.InfiniteSum.Basic
import Mathlib.Topology.Algebra.UniformGroup
noncomputable section
open Filter Finset Function
open scoped Topology
variable {α β γ δ : Type*}
section TopologicalGroup
variable [CommGroup α] [TopologicalSpace α] [TopologicalGroup α]
variable {f g : β → α} {a a₁ a₂ : α}
-- `by simpa using` speeds up elaboration. Why?
@[to_additive]
theorem HasProd.inv (h : HasProd f a) : HasProd (fun b ↦ (f b)⁻¹) a⁻¹ := by
simpa only using h.map (MonoidHom.id α)⁻¹ continuous_inv
#align has_sum.neg HasSum.neg
@[to_additive]
theorem Multipliable.inv (hf : Multipliable f) : Multipliable fun b ↦ (f b)⁻¹ :=
hf.hasProd.inv.multipliable
#align summable.neg Summable.neg
@[to_additive]
theorem Multipliable.of_inv (hf : Multipliable fun b ↦ (f b)⁻¹) : Multipliable f := by
simpa only [inv_inv] using hf.inv
#align summable.of_neg Summable.of_neg
@[to_additive]
theorem multipliable_inv_iff : (Multipliable fun b ↦ (f b)⁻¹) ↔ Multipliable f :=
⟨Multipliable.of_inv, Multipliable.inv⟩
#align summable_neg_iff summable_neg_iff
@[to_additive]
theorem HasProd.div (hf : HasProd f a₁) (hg : HasProd g a₂) :
HasProd (fun b ↦ f b / g b) (a₁ / a₂) := by
simp only [div_eq_mul_inv]
exact hf.mul hg.inv
#align has_sum.sub HasSum.sub
@[to_additive]
theorem Multipliable.div (hf : Multipliable f) (hg : Multipliable g) :
Multipliable fun b ↦ f b / g b :=
(hf.hasProd.div hg.hasProd).multipliable
#align summable.sub Summable.sub
@[to_additive]
| Mathlib/Topology/Algebra/InfiniteSum/Group.lean | 63 | 65 | theorem Multipliable.trans_div (hg : Multipliable g) (hfg : Multipliable fun b ↦ f b / g b) :
Multipliable f := by |
simpa only [div_mul_cancel] using hfg.mul hg
|
import Mathlib.Analysis.NormedSpace.Exponential
#align_import analysis.normed_space.star.exponential from "leanprover-community/mathlib"@"1e3201306d4d9eb1fd54c60d7c4510ad5126f6f9"
open NormedSpace -- For `NormedSpace.exp`.
section Star
variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] [StarRing A] [ContinuousStar A]
[CompleteSpace A] [StarModule ℂ A]
open Complex
@[simps]
noncomputable def selfAdjoint.expUnitary (a : selfAdjoint A) : unitary A :=
⟨exp ℂ ((I • a.val) : A),
exp_mem_unitary_of_mem_skewAdjoint _ (a.prop.smul_mem_skewAdjoint conj_I)⟩
#align self_adjoint.exp_unitary selfAdjoint.expUnitary
open selfAdjoint
theorem Commute.expUnitary_add {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) :
expUnitary (a + b) = expUnitary a * expUnitary b := by
ext
have hcomm : Commute (I • (a : A)) (I • (b : A)) := by
unfold Commute SemiconjBy
simp only [h.eq, Algebra.smul_mul_assoc, Algebra.mul_smul_comm]
simpa only [expUnitary_coe, AddSubgroup.coe_add, smul_add] using exp_add_of_commute hcomm
#align commute.exp_unitary_add Commute.expUnitary_add
| Mathlib/Analysis/NormedSpace/Star/Exponential.lean | 51 | 56 | theorem Commute.expUnitary {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) :
Commute (expUnitary a) (expUnitary b) :=
calc
selfAdjoint.expUnitary a * selfAdjoint.expUnitary b =
selfAdjoint.expUnitary b * selfAdjoint.expUnitary a := by |
rw [← h.expUnitary_add, ← h.symm.expUnitary_add, add_comm]
|
import Mathlib.Algebra.Polynomial.Degree.Lemmas
open Polynomial
namespace Mathlib.Tactic.ComputeDegree
section recursion_lemmas
variable {R : Type*}
section semiring
variable [Semiring R]
theorem natDegree_C_le (a : R) : natDegree (C a) ≤ 0 := (natDegree_C a).le
theorem natDegree_natCast_le (n : ℕ) : natDegree (n : R[X]) ≤ 0 := (natDegree_natCast _).le
theorem natDegree_zero_le : natDegree (0 : R[X]) ≤ 0 := natDegree_zero.le
theorem natDegree_one_le : natDegree (1 : R[X]) ≤ 0 := natDegree_one.le
@[deprecated (since := "2024-04-17")]
alias natDegree_nat_cast_le := natDegree_natCast_le
theorem coeff_add_of_eq {n : ℕ} {a b : R} {f g : R[X]}
(h_add_left : f.coeff n = a) (h_add_right : g.coeff n = b) :
(f + g).coeff n = a + b := by subst ‹_› ‹_›; apply coeff_add
theorem coeff_mul_add_of_le_natDegree_of_eq_ite {d df dg : ℕ} {a b : R} {f g : R[X]}
(h_mul_left : natDegree f ≤ df) (h_mul_right : natDegree g ≤ dg)
(h_mul_left : f.coeff df = a) (h_mul_right : g.coeff dg = b) (ddf : df + dg ≤ d) :
(f * g).coeff d = if d = df + dg then a * b else 0 := by
split_ifs with h
· subst h_mul_left h_mul_right h
exact coeff_mul_of_natDegree_le ‹_› ‹_›
· apply coeff_eq_zero_of_natDegree_lt
apply lt_of_le_of_lt ?_ (lt_of_le_of_ne ddf ?_)
· exact natDegree_mul_le_of_le ‹_› ‹_›
· exact ne_comm.mp h
theorem coeff_pow_of_natDegree_le_of_eq_ite' {m n o : ℕ} {a : R} {p : R[X]}
(h_pow : natDegree p ≤ n) (h_exp : m * n ≤ o) (h_pow_bas : coeff p n = a) :
coeff (p ^ m) o = if o = m * n then a ^ m else 0 := by
split_ifs with h
· subst h h_pow_bas
exact coeff_pow_of_natDegree_le ‹_›
· apply coeff_eq_zero_of_natDegree_lt
apply lt_of_le_of_lt ?_ (lt_of_le_of_ne ‹_› ?_)
· exact natDegree_pow_le_of_le m ‹_›
· exact Iff.mp ne_comm h
theorem natDegree_smul_le_of_le {n : ℕ} {a : R} {f : R[X]} (hf : natDegree f ≤ n) :
natDegree (a • f) ≤ n :=
(natDegree_smul_le a f).trans hf
theorem degree_smul_le_of_le {n : ℕ} {a : R} {f : R[X]} (hf : degree f ≤ n) :
degree (a • f) ≤ n :=
(degree_smul_le a f).trans hf
theorem coeff_smul {n : ℕ} {a : R} {f : R[X]} : (a • f).coeff n = a * f.coeff n := rfl
section congr_lemmas
| Mathlib/Tactic/ComputeDegree.lean | 150 | 155 | theorem natDegree_eq_of_le_of_coeff_ne_zero' {deg m o : ℕ} {c : R} {p : R[X]}
(h_natDeg_le : natDegree p ≤ m) (coeff_eq : coeff p o = c)
(coeff_ne_zero : c ≠ 0) (deg_eq_deg : m = deg) (coeff_eq_deg : o = deg) :
natDegree p = deg := by |
subst coeff_eq deg_eq_deg coeff_eq_deg
exact natDegree_eq_of_le_of_coeff_ne_zero ‹_› ‹_›
|
import Mathlib.Analysis.Complex.Basic
import Mathlib.FieldTheory.IntermediateField
import Mathlib.Topology.Algebra.Field
import Mathlib.Topology.Algebra.UniformRing
#align_import topology.instances.complex from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
section ComplexSubfield
open Complex Set
open ComplexConjugate
| Mathlib/Topology/Instances/Complex.lean | 25 | 44 | theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
K = ofReal.fieldRange ∨ K = ⊤ := by |
suffices range (ofReal' : ℝ → ℂ) ⊆ K by
rw [range_subset_iff, ← coe_algebraMap] at this
have :=
(Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
(Subfield.toIntermediateField K this).toSubalgebra
simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
exact this
suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
refine subset_trans this ?_
rw [← IsClosed.closure_eq hc]
apply closure_mono
rintro _ ⟨_, rfl⟩
simp only [Function.comp_apply, ofReal_ratCast, SetLike.mem_coe, SubfieldClass.ratCast_mem]
nth_rw 1 [range_comp]
refine subset_trans ?_ (image_closure_subset_closure_image continuous_ofReal)
rw [DenseRange.closure_range Rat.denseEmbedding_coe_real.dense]
simp only [image_univ]
rfl
|
import Mathlib.RingTheory.Ideal.Maps
import Mathlib.Topology.Algebra.Nonarchimedean.Bases
import Mathlib.Topology.Algebra.UniformRing
#align_import topology.algebra.nonarchimedean.adic_topology from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
variable {R : Type*} [CommRing R]
open Set TopologicalAddGroup Submodule Filter
open Topology Pointwise
namespace Ideal
theorem adic_basis (I : Ideal R) : SubmodulesRingBasis fun n : ℕ => (I ^ n • ⊤ : Ideal R) :=
{ inter := by
suffices ∀ i j : ℕ, ∃ k, I ^ k ≤ I ^ i ∧ I ^ k ≤ I ^ j by
simpa only [smul_eq_mul, mul_top, Algebra.id.map_eq_id, map_id, le_inf_iff] using this
intro i j
exact ⟨max i j, pow_le_pow_right (le_max_left i j), pow_le_pow_right (le_max_right i j)⟩
leftMul := by
suffices ∀ (a : R) (i : ℕ), ∃ j : ℕ, a • I ^ j ≤ I ^ i by
simpa only [smul_top_eq_map, Algebra.id.map_eq_id, map_id] using this
intro r n
use n
rintro a ⟨x, hx, rfl⟩
exact (I ^ n).smul_mem r hx
mul := by
suffices ∀ i : ℕ, ∃ j : ℕ, (↑(I ^ j) * ↑(I ^ j) : Set R) ⊆ (↑(I ^ i) : Set R) by
simpa only [smul_top_eq_map, Algebra.id.map_eq_id, map_id] using this
intro n
use n
rintro a ⟨x, _hx, b, hb, rfl⟩
exact (I ^ n).smul_mem x hb }
#align ideal.adic_basis Ideal.adic_basis
def ringFilterBasis (I : Ideal R) :=
I.adic_basis.toRing_subgroups_basis.toRingFilterBasis
#align ideal.ring_filter_basis Ideal.ringFilterBasis
def adicTopology (I : Ideal R) : TopologicalSpace R :=
(adic_basis I).topology
#align ideal.adic_topology Ideal.adicTopology
theorem nonarchimedean (I : Ideal R) : @NonarchimedeanRing R _ I.adicTopology :=
I.adic_basis.toRing_subgroups_basis.nonarchimedean
#align ideal.nonarchimedean Ideal.nonarchimedean
| Mathlib/Topology/Algebra/Nonarchimedean/AdicTopology.lean | 92 | 103 | theorem hasBasis_nhds_zero_adic (I : Ideal R) :
HasBasis (@nhds R I.adicTopology (0 : R)) (fun _n : ℕ => True) fun n =>
((I ^ n : Ideal R) : Set R) :=
⟨by
intro U
rw [I.ringFilterBasis.toAddGroupFilterBasis.nhds_zero_hasBasis.mem_iff]
constructor
· rintro ⟨-, ⟨i, rfl⟩, h⟩
replace h : ↑(I ^ i) ⊆ U := by | simpa using h
exact ⟨i, trivial, h⟩
· rintro ⟨i, -, h⟩
exact ⟨(I ^ i : Ideal R), ⟨i, by simp⟩, h⟩⟩
|
import Batteries.Data.RBMap.Alter
import Batteries.Data.List.Lemmas
namespace Batteries
namespace RBNode
open RBColor
attribute [simp] fold foldl foldr Any forM foldlM Ordered
@[simp] theorem min?_reverse (t : RBNode α) : t.reverse.min? = t.max? := by
unfold RBNode.max?; split <;> simp [RBNode.min?]
unfold RBNode.min?; rw [min?.match_1.eq_3]
· apply min?_reverse
· simpa [reverse_eq_iff]
@[simp] theorem max?_reverse (t : RBNode α) : t.reverse.max? = t.min? := by
rw [← min?_reverse, reverse_reverse]
@[simp] theorem mem_nil {x} : ¬x ∈ (.nil : RBNode α) := by simp [(·∈·), EMem]
@[simp] theorem mem_node {y c a x b} :
y ∈ (.node c a x b : RBNode α) ↔ y = x ∨ y ∈ a ∨ y ∈ b := by simp [(·∈·), EMem]
| .lake/packages/batteries/Batteries/Data/RBMap/Lemmas.lean | 32 | 33 | theorem All_def {t : RBNode α} : t.All p ↔ ∀ x ∈ t, p x := by |
induction t <;> simp [or_imp, forall_and, *]
|
import Mathlib.Algebra.CharZero.Defs
import Mathlib.Algebra.Group.Hom.Defs
import Mathlib.Algebra.Order.Monoid.Canonical.Defs
import Mathlib.Algebra.Order.Monoid.OrderDual
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Defs
import Mathlib.Order.WithBot
#align_import algebra.order.monoid.with_top from "leanprover-community/mathlib"@"0111834459f5d7400215223ea95ae38a1265a907"
universe u v
variable {α : Type u} {β : Type v}
open Function
namespace WithTop
section Add
variable [Add α] {a b c d : WithTop α} {x y : α}
instance add : Add (WithTop α) :=
⟨Option.map₂ (· + ·)⟩
#align with_top.has_add WithTop.add
@[simp, norm_cast] lemma coe_add (a b : α) : ↑(a + b) = (a + b : WithTop α) := rfl
#align with_top.coe_add WithTop.coe_add
#noalign with_top.coe_bit0
#noalign with_top.coe_bit1
@[simp]
theorem top_add (a : WithTop α) : ⊤ + a = ⊤ :=
rfl
#align with_top.top_add WithTop.top_add
@[simp]
| Mathlib/Algebra/Order/Monoid/WithTop.lean | 128 | 128 | theorem add_top (a : WithTop α) : a + ⊤ = ⊤ := by | cases a <;> rfl
|
import Mathlib.RingTheory.RootsOfUnity.Basic
import Mathlib.RingTheory.AdjoinRoot
import Mathlib.FieldTheory.Galois
import Mathlib.LinearAlgebra.Eigenspace.Minpoly
import Mathlib.RingTheory.Norm
universe u
variable {K : Type u} [Field K]
open Polynomial IntermediateField AdjoinRoot
section Splits
lemma root_X_pow_sub_C_pow (n : ℕ) (a : K) :
(AdjoinRoot.root (X ^ n - C a)) ^ n = AdjoinRoot.of _ a := by
rw [← sub_eq_zero, ← AdjoinRoot.eval₂_root, eval₂_sub, eval₂_C, eval₂_pow, eval₂_X]
lemma root_X_pow_sub_C_ne_zero {n : ℕ} (hn : 1 < n) (a : K) :
(AdjoinRoot.root (X ^ n - C a)) ≠ 0 :=
mk_ne_zero_of_natDegree_lt (monic_X_pow_sub_C _ (Nat.not_eq_zero_of_lt hn))
X_ne_zero <| by rwa [natDegree_X_pow_sub_C, natDegree_X]
lemma root_X_pow_sub_C_ne_zero' {n : ℕ} {a : K} (hn : 0 < n) (ha : a ≠ 0) :
(AdjoinRoot.root (X ^ n - C a)) ≠ 0 := by
obtain (rfl|hn) := (Nat.succ_le_iff.mpr hn).eq_or_lt
· rw [← Nat.one_eq_succ_zero, pow_one]
intro e
refine mk_ne_zero_of_natDegree_lt (monic_X_sub_C a) (C_ne_zero.mpr ha) (by simp) ?_
trans AdjoinRoot.mk (X - C a) (X - (X - C a))
· rw [sub_sub_cancel]
· rw [map_sub, mk_self, sub_zero, mk_X, e]
· exact root_X_pow_sub_C_ne_zero hn a
| Mathlib/FieldTheory/KummerExtension.lean | 74 | 82 | theorem X_pow_sub_C_splits_of_isPrimitiveRoot
{n : ℕ} {ζ : K} (hζ : IsPrimitiveRoot ζ n) {α a : K} (e : α ^ n = a) :
(X ^ n - C a).Splits (RingHom.id _) := by |
cases n.eq_zero_or_pos with
| inl hn =>
rw [hn, pow_zero, ← C.map_one, ← map_sub]
exact splits_C _ _
| inr hn =>
rw [splits_iff_card_roots, ← nthRoots, hζ.card_nthRoots, natDegree_X_pow_sub_C, if_pos ⟨α, e⟩]
|
import Mathlib.ModelTheory.Ultraproducts
import Mathlib.ModelTheory.Bundled
import Mathlib.ModelTheory.Skolem
#align_import model_theory.satisfiability from "leanprover-community/mathlib"@"d565b3df44619c1498326936be16f1a935df0728"
set_option linter.uppercaseLean3 false
universe u v w w'
open Cardinal CategoryTheory
open Cardinal FirstOrder
namespace FirstOrder
namespace Language
variable {L : Language.{u, v}} {T : L.Theory} {α : Type w} {n : ℕ}
namespace Theory
variable (T)
def IsSatisfiable : Prop :=
Nonempty (ModelType.{u, v, max u v} T)
#align first_order.language.Theory.is_satisfiable FirstOrder.Language.Theory.IsSatisfiable
def IsFinitelySatisfiable : Prop :=
∀ T0 : Finset L.Sentence, (T0 : L.Theory) ⊆ T → IsSatisfiable (T0 : L.Theory)
#align first_order.language.Theory.is_finitely_satisfiable FirstOrder.Language.Theory.IsFinitelySatisfiable
variable {T} {T' : L.Theory}
theorem Model.isSatisfiable (M : Type w) [Nonempty M] [L.Structure M] [M ⊨ T] :
T.IsSatisfiable :=
⟨((⊥ : Substructure _ (ModelType.of T M)).elementarySkolem₁Reduct.toModel T).shrink⟩
#align first_order.language.Theory.model.is_satisfiable FirstOrder.Language.Theory.Model.isSatisfiable
theorem IsSatisfiable.mono (h : T'.IsSatisfiable) (hs : T ⊆ T') : T.IsSatisfiable :=
⟨(Theory.Model.mono (ModelType.is_model h.some) hs).bundled⟩
#align first_order.language.Theory.is_satisfiable.mono FirstOrder.Language.Theory.IsSatisfiable.mono
theorem isSatisfiable_empty (L : Language.{u, v}) : IsSatisfiable (∅ : L.Theory) :=
⟨default⟩
#align first_order.language.Theory.is_satisfiable_empty FirstOrder.Language.Theory.isSatisfiable_empty
theorem isSatisfiable_of_isSatisfiable_onTheory {L' : Language.{w, w'}} (φ : L →ᴸ L')
(h : (φ.onTheory T).IsSatisfiable) : T.IsSatisfiable :=
Model.isSatisfiable (h.some.reduct φ)
#align first_order.language.Theory.is_satisfiable_of_is_satisfiable_on_Theory FirstOrder.Language.Theory.isSatisfiable_of_isSatisfiable_onTheory
theorem isSatisfiable_onTheory_iff {L' : Language.{w, w'}} {φ : L →ᴸ L'} (h : φ.Injective) :
(φ.onTheory T).IsSatisfiable ↔ T.IsSatisfiable := by
classical
refine ⟨isSatisfiable_of_isSatisfiable_onTheory φ, fun h' => ?_⟩
haveI : Inhabited h'.some := Classical.inhabited_of_nonempty'
exact Model.isSatisfiable (h'.some.defaultExpansion h)
#align first_order.language.Theory.is_satisfiable_on_Theory_iff FirstOrder.Language.Theory.isSatisfiable_onTheory_iff
theorem IsSatisfiable.isFinitelySatisfiable (h : T.IsSatisfiable) : T.IsFinitelySatisfiable :=
fun _ => h.mono
#align first_order.language.Theory.is_satisfiable.is_finitely_satisfiable FirstOrder.Language.Theory.IsSatisfiable.isFinitelySatisfiable
theorem isSatisfiable_iff_isFinitelySatisfiable {T : L.Theory} :
T.IsSatisfiable ↔ T.IsFinitelySatisfiable :=
⟨Theory.IsSatisfiable.isFinitelySatisfiable, fun h => by
classical
set M : Finset T → Type max u v := fun T0 : Finset T =>
(h (T0.map (Function.Embedding.subtype fun x => x ∈ T)) T0.map_subtype_subset).some.Carrier
let M' := Filter.Product (Ultrafilter.of (Filter.atTop : Filter (Finset T))) M
have h' : M' ⊨ T := by
refine ⟨fun φ hφ => ?_⟩
rw [Ultraproduct.sentence_realize]
refine
Filter.Eventually.filter_mono (Ultrafilter.of_le _)
(Filter.eventually_atTop.2
⟨{⟨φ, hφ⟩}, fun s h' =>
Theory.realize_sentence_of_mem (s.map (Function.Embedding.subtype fun x => x ∈ T))
?_⟩)
simp only [Finset.coe_map, Function.Embedding.coe_subtype, Set.mem_image, Finset.mem_coe,
Subtype.exists, Subtype.coe_mk, exists_and_right, exists_eq_right]
exact ⟨hφ, h' (Finset.mem_singleton_self _)⟩
exact ⟨ModelType.of T M'⟩⟩
#align first_order.language.Theory.is_satisfiable_iff_is_finitely_satisfiable FirstOrder.Language.Theory.isSatisfiable_iff_isFinitelySatisfiable
| Mathlib/ModelTheory/Satisfiability.lean | 129 | 135 | theorem isSatisfiable_directed_union_iff {ι : Type*} [Nonempty ι] {T : ι → L.Theory}
(h : Directed (· ⊆ ·) T) : Theory.IsSatisfiable (⋃ i, T i) ↔ ∀ i, (T i).IsSatisfiable := by |
refine ⟨fun h' i => h'.mono (Set.subset_iUnion _ _), fun h' => ?_⟩
rw [isSatisfiable_iff_isFinitelySatisfiable, IsFinitelySatisfiable]
intro T0 hT0
obtain ⟨i, hi⟩ := h.exists_mem_subset_of_finset_subset_biUnion hT0
exact (h' i).mono hi
|
import Mathlib.Combinatorics.SetFamily.HarrisKleitman
import Mathlib.Combinatorics.SetFamily.Intersecting
#align_import combinatorics.set_family.kleitman from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514"
open Finset
open Fintype (card)
variable {ι α : Type*} [Fintype α] [DecidableEq α] [Nonempty α]
| Mathlib/Combinatorics/SetFamily/Kleitman.lean | 37 | 85 | theorem Finset.card_biUnion_le_of_intersecting (s : Finset ι) (f : ι → Finset (Finset α))
(hf : ∀ i ∈ s, (f i : Set (Finset α)).Intersecting) :
(s.biUnion f).card ≤ 2 ^ Fintype.card α - 2 ^ (Fintype.card α - s.card) := by |
have : DecidableEq ι := by
classical
infer_instance
obtain hs | hs := le_total (Fintype.card α) s.card
· rw [tsub_eq_zero_of_le hs, pow_zero]
refine (card_le_card <| biUnion_subset.2 fun i hi a ha ↦
mem_compl.2 <| not_mem_singleton.2 <| (hf _ hi).ne_bot ha).trans_eq ?_
rw [card_compl, Fintype.card_finset, card_singleton]
induction' s using Finset.cons_induction with i s hi ih generalizing f
· simp
set f' : ι → Finset (Finset α) :=
fun j ↦ if hj : j ∈ cons i s hi then (hf j hj).exists_card_eq.choose else ∅
have hf₁ : ∀ j, j ∈ cons i s hi → f j ⊆ f' j ∧ 2 * (f' j).card =
2 ^ Fintype.card α ∧ (f' j : Set (Finset α)).Intersecting := by
rintro j hj
simp_rw [f', dif_pos hj, ← Fintype.card_finset]
exact Classical.choose_spec (hf j hj).exists_card_eq
have hf₂ : ∀ j, j ∈ cons i s hi → IsUpperSet (f' j : Set (Finset α)) := by
refine fun j hj ↦ (hf₁ _ hj).2.2.isUpperSet' ((hf₁ _ hj).2.2.is_max_iff_card_eq.2 ?_)
rw [Fintype.card_finset]
exact (hf₁ _ hj).2.1
refine (card_le_card <| biUnion_mono fun j hj ↦ (hf₁ _ hj).1).trans ?_
nth_rw 1 [cons_eq_insert i]
rw [biUnion_insert]
refine (card_mono <| @le_sup_sdiff _ _ _ <| f' i).trans ((card_union_le _ _).trans ?_)
rw [union_sdiff_left, sdiff_eq_inter_compl]
refine le_of_mul_le_mul_left ?_ (pow_pos (zero_lt_two' ℕ) <| Fintype.card α + 1)
rw [pow_succ, mul_add, mul_assoc, mul_comm _ 2, mul_assoc]
refine (add_le_add
((mul_le_mul_left <| pow_pos (zero_lt_two' ℕ) _).2
(hf₁ _ <| mem_cons_self _ _).2.2.card_le) <|
(mul_le_mul_left <| zero_lt_two' ℕ).2 <| IsUpperSet.card_inter_le_finset ?_ ?_).trans ?_
· rw [coe_biUnion]
exact isUpperSet_iUnion₂ fun i hi ↦ hf₂ _ <| subset_cons _ hi
· rw [coe_compl]
exact (hf₂ _ <| mem_cons_self _ _).compl
rw [mul_tsub, card_compl, Fintype.card_finset, mul_left_comm, mul_tsub,
(hf₁ _ <| mem_cons_self _ _).2.1, two_mul, add_tsub_cancel_left, ← mul_tsub, ← mul_two,
mul_assoc, ← add_mul, mul_comm]
refine mul_le_mul_left' ?_ _
refine (add_le_add_left
(ih _ (fun i hi ↦ (hf₁ _ <| subset_cons _ hi).2.2)
((card_le_card <| subset_cons _).trans hs)) _).trans ?_
rw [mul_tsub, two_mul, ← pow_succ',
← add_tsub_assoc_of_le (pow_le_pow_right' (one_le_two : (1 : ℕ) ≤ 2) tsub_le_self),
tsub_add_eq_add_tsub hs, card_cons, add_tsub_add_eq_tsub_right]
|
import Mathlib.Data.Set.Lattice
#align_import data.set.intervals.disjoint from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432"
universe u v w
variable {ι : Sort u} {α : Type v} {β : Type w}
open Set
open OrderDual (toDual)
namespace Set
section LinearOrder
variable [LinearOrder α] {a₁ a₂ b₁ b₂ : α}
@[simp]
theorem Ico_disjoint_Ico : Disjoint (Ico a₁ a₂) (Ico b₁ b₂) ↔ min a₂ b₂ ≤ max a₁ b₁ := by
simp_rw [Set.disjoint_iff_inter_eq_empty, Ico_inter_Ico, Ico_eq_empty_iff, inf_eq_min, sup_eq_max,
not_lt]
#align set.Ico_disjoint_Ico Set.Ico_disjoint_Ico
@[simp]
theorem Ioc_disjoint_Ioc : Disjoint (Ioc a₁ a₂) (Ioc b₁ b₂) ↔ min a₂ b₂ ≤ max a₁ b₁ := by
have h : _ ↔ min (toDual a₁) (toDual b₁) ≤ max (toDual a₂) (toDual b₂) := Ico_disjoint_Ico
simpa only [dual_Ico] using h
#align set.Ioc_disjoint_Ioc Set.Ioc_disjoint_Ioc
@[simp]
theorem Ioo_disjoint_Ioo [DenselyOrdered α] :
Disjoint (Set.Ioo a₁ a₂) (Set.Ioo b₁ b₂) ↔ min a₂ b₂ ≤ max a₁ b₁ := by
simp_rw [Set.disjoint_iff_inter_eq_empty, Ioo_inter_Ioo, Ioo_eq_empty_iff, inf_eq_min, sup_eq_max,
not_lt]
theorem eq_of_Ico_disjoint {x₁ x₂ y₁ y₂ : α} (h : Disjoint (Ico x₁ x₂) (Ico y₁ y₂)) (hx : x₁ < x₂)
(h2 : x₂ ∈ Ico y₁ y₂) : y₁ = x₂ := by
rw [Ico_disjoint_Ico, min_eq_left (le_of_lt h2.2), le_max_iff] at h
apply le_antisymm h2.1
exact h.elim (fun h => absurd hx (not_lt_of_le h)) id
#align set.eq_of_Ico_disjoint Set.eq_of_Ico_disjoint
@[simp]
theorem iUnion_Ico_eq_Iio_self_iff {f : ι → α} {a : α} :
⋃ i, Ico (f i) a = Iio a ↔ ∀ x < a, ∃ i, f i ≤ x := by
simp [← Ici_inter_Iio, ← iUnion_inter, subset_def]
#align set.Union_Ico_eq_Iio_self_iff Set.iUnion_Ico_eq_Iio_self_iff
@[simp]
| Mathlib/Order/Interval/Set/Disjoint.lean | 176 | 178 | theorem iUnion_Ioc_eq_Ioi_self_iff {f : ι → α} {a : α} :
⋃ i, Ioc a (f i) = Ioi a ↔ ∀ x, a < x → ∃ i, x ≤ f i := by |
simp [← Ioi_inter_Iic, ← inter_iUnion, subset_def]
|
import Mathlib.Data.Finset.Basic
variable {ι : Sort _} {π : ι → Sort _} {x : ∀ i, π i} [DecidableEq ι]
namespace Function
def updateFinset (x : ∀ i, π i) (s : Finset ι) (y : ∀ i : ↥s, π i) (i : ι) : π i :=
if hi : i ∈ s then y ⟨i, hi⟩ else x i
open Finset Equiv
theorem updateFinset_def {s : Finset ι} {y} :
updateFinset x s y = fun i ↦ if hi : i ∈ s then y ⟨i, hi⟩ else x i :=
rfl
@[simp] theorem updateFinset_empty {y} : updateFinset x ∅ y = x :=
rfl
theorem updateFinset_singleton {i y} :
updateFinset x {i} y = Function.update x i (y ⟨i, mem_singleton_self i⟩) := by
congr with j
by_cases hj : j = i
· cases hj
simp only [dif_pos, Finset.mem_singleton, update_same, updateFinset]
· simp [hj, updateFinset]
| Mathlib/Data/Finset/Update.lean | 43 | 50 | theorem update_eq_updateFinset {i y} :
Function.update x i y = updateFinset x {i} (uniqueElim y) := by |
congr with j
by_cases hj : j = i
· cases hj
simp only [dif_pos, Finset.mem_singleton, update_same, updateFinset]
exact uniqueElim_default (α := fun j : ({i} : Finset ι) => π j) y
· simp [hj, updateFinset]
|
import Mathlib.Algebra.Lie.OfAssociative
import Mathlib.Algebra.Lie.IdealOperations
#align_import algebra.lie.abelian from "leanprover-community/mathlib"@"8983bec7cdf6cb2dd1f21315c8a34ab00d7b2f6d"
universe u v w w₁ w₂
class LieModule.IsTrivial (L : Type v) (M : Type w) [Bracket L M] [Zero M] : Prop where
trivial : ∀ (x : L) (m : M), ⁅x, m⁆ = 0
#align lie_module.is_trivial LieModule.IsTrivial
@[simp]
theorem trivial_lie_zero (L : Type v) (M : Type w) [Bracket L M] [Zero M] [LieModule.IsTrivial L M]
(x : L) (m : M) : ⁅x, m⁆ = 0 :=
LieModule.IsTrivial.trivial x m
#align trivial_lie_zero trivial_lie_zero
instance LieModule.instIsTrivialOfSubsingleton {L M : Type*}
[LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton L] : LieModule.IsTrivial L M :=
⟨fun x m ↦ by rw [Subsingleton.eq_zero x, zero_lie]⟩
instance LieModule.instIsTrivialOfSubsingleton' {L M : Type*}
[LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton M] : LieModule.IsTrivial L M :=
⟨fun x m ↦ by simp_rw [Subsingleton.eq_zero m, lie_zero]⟩
abbrev IsLieAbelian (L : Type v) [Bracket L L] [Zero L] : Prop :=
LieModule.IsTrivial L L
#align is_lie_abelian IsLieAbelian
instance LieIdeal.isLieAbelian_of_trivial (R : Type u) (L : Type v) [CommRing R] [LieRing L]
[LieAlgebra R L] (I : LieIdeal R L) [h : LieModule.IsTrivial L I] : IsLieAbelian I where
trivial x y := by apply h.trivial
#align lie_ideal.is_lie_abelian_of_trivial LieIdeal.isLieAbelian_of_trivial
theorem Function.Injective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
[LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂}
(h₁ : Function.Injective f) (_ : IsLieAbelian L₂) : IsLieAbelian L₁ :=
{ trivial := fun x y => h₁ <|
calc
f ⁅x, y⁆ = ⁅f x, f y⁆ := LieHom.map_lie f x y
_ = 0 := trivial_lie_zero _ _ _ _
_ = f 0 := f.map_zero.symm}
#align function.injective.is_lie_abelian Function.Injective.isLieAbelian
theorem Function.Surjective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
[LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂}
(h₁ : Function.Surjective f) (h₂ : IsLieAbelian L₁) : IsLieAbelian L₂ :=
{ trivial := fun x y => by
obtain ⟨u, rfl⟩ := h₁ x
obtain ⟨v, rfl⟩ := h₁ y
rw [← LieHom.map_lie, trivial_lie_zero, LieHom.map_zero] }
#align function.surjective.is_lie_abelian Function.Surjective.isLieAbelian
theorem lie_abelian_iff_equiv_lie_abelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
[LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] (e : L₁ ≃ₗ⁅R⁆ L₂) :
IsLieAbelian L₁ ↔ IsLieAbelian L₂ :=
⟨e.symm.injective.isLieAbelian, e.injective.isLieAbelian⟩
#align lie_abelian_iff_equiv_lie_abelian lie_abelian_iff_equiv_lie_abelian
theorem commutative_ring_iff_abelian_lie_ring {A : Type v} [Ring A] :
Std.Commutative (α := A) (· * ·) ↔ IsLieAbelian A := by
have h₁ : Std.Commutative (α := A) (· * ·) ↔ ∀ a b : A, a * b = b * a :=
⟨fun h => h.1, fun h => ⟨h⟩⟩
have h₂ : IsLieAbelian A ↔ ∀ a b : A, ⁅a, b⁆ = 0 := ⟨fun h => h.1, fun h => ⟨h⟩⟩
simp only [h₁, h₂, LieRing.of_associative_ring_bracket, sub_eq_zero]
#align commutative_ring_iff_abelian_lie_ring commutative_ring_iff_abelian_lie_ring
section Center
variable (R : Type u) (L : Type v) (M : Type w) (N : Type w₁)
variable [CommRing R] [LieRing L] [LieAlgebra R L]
variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
variable [AddCommGroup N] [Module R N] [LieRingModule L N] [LieModule R L N]
namespace LieModule
protected def ker : LieIdeal R L :=
(toEnd R L M).ker
#align lie_module.ker LieModule.ker
@[simp]
protected theorem mem_ker (x : L) : x ∈ LieModule.ker R L M ↔ ∀ m : M, ⁅x, m⁆ = 0 := by
simp only [LieModule.ker, LieHom.mem_ker, LinearMap.ext_iff, LinearMap.zero_apply,
toEnd_apply_apply]
#align lie_module.mem_ker LieModule.mem_ker
def maxTrivSubmodule : LieSubmodule R L M where
carrier := { m | ∀ x : L, ⁅x, m⁆ = 0 }
zero_mem' x := lie_zero x
add_mem' {x y} hx hy z := by rw [lie_add, hx, hy, add_zero]
smul_mem' c x hx y := by rw [lie_smul, hx, smul_zero]
lie_mem {x m} hm y := by rw [hm, lie_zero]
#align lie_module.max_triv_submodule LieModule.maxTrivSubmodule
@[simp]
theorem mem_maxTrivSubmodule (m : M) : m ∈ maxTrivSubmodule R L M ↔ ∀ x : L, ⁅x, m⁆ = 0 :=
Iff.rfl
#align lie_module.mem_max_triv_submodule LieModule.mem_maxTrivSubmodule
instance : IsTrivial L (maxTrivSubmodule R L M) where trivial x m := Subtype.ext (m.property x)
@[simp]
| Mathlib/Algebra/Lie/Abelian.lean | 136 | 141 | theorem ideal_oper_maxTrivSubmodule_eq_bot (I : LieIdeal R L) :
⁅I, maxTrivSubmodule R L M⁆ = ⊥ := by |
rw [← LieSubmodule.coe_toSubmodule_eq_iff, LieSubmodule.lieIdeal_oper_eq_linear_span,
LieSubmodule.bot_coeSubmodule, Submodule.span_eq_bot]
rintro m ⟨⟨x, hx⟩, ⟨⟨m, hm⟩, rfl⟩⟩
exact hm x
|
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
theorem log_ofReal_re (x : ℝ) : (log (x : ℂ)).re = Real.log x := by simp [log_re]
#align complex.log_of_real_re Complex.log_ofReal_re
theorem log_ofReal_mul {r : ℝ} (hr : 0 < r) {x : ℂ} (hx : x ≠ 0) :
log (r * x) = Real.log r + log x := by
replace hx := Complex.abs.ne_zero_iff.mpr hx
simp_rw [log, map_mul, abs_ofReal, arg_real_mul _ hr, abs_of_pos hr, Real.log_mul hr.ne' hx,
ofReal_add, add_assoc]
#align complex.log_of_real_mul Complex.log_ofReal_mul
theorem log_mul_ofReal (r : ℝ) (hr : 0 < r) (x : ℂ) (hx : x ≠ 0) :
log (x * r) = Real.log r + log x := by rw [mul_comm, log_ofReal_mul hr hx]
#align complex.log_mul_of_real Complex.log_mul_ofReal
lemma log_mul_eq_add_log_iff {x y : ℂ} (hx₀ : x ≠ 0) (hy₀ : y ≠ 0) :
log (x * y) = log x + log y ↔ arg x + arg y ∈ Set.Ioc (-π) π := by
refine ext_iff.trans <| Iff.trans ?_ <| arg_mul_eq_add_arg_iff hx₀ hy₀
simp_rw [add_re, add_im, log_re, log_im, AbsoluteValue.map_mul,
Real.log_mul (abs.ne_zero hx₀) (abs.ne_zero hy₀), true_and]
alias ⟨_, log_mul⟩ := log_mul_eq_add_log_iff
@[simp]
| Mathlib/Analysis/SpecialFunctions/Complex/Log.lean | 106 | 106 | theorem log_zero : log 0 = 0 := by | simp [log]
|
import Mathlib.Topology.Algebra.Module.Basic
import Mathlib.Analysis.Normed.MulAction
#align_import analysis.normed_space.continuous_linear_map from "leanprover-community/mathlib"@"fe18deda804e30c594e75a6e5fe0f7d14695289f"
open Metric ContinuousLinearMap
open Set Real
open NNReal
variable {𝕜 𝕜₂ E F G : Type*}
section SeminormedAddCommGroup
variable [Ring 𝕜] [Ring 𝕜₂]
variable [SeminormedAddCommGroup E] [SeminormedAddCommGroup F] [SeminormedAddCommGroup G]
variable [Module 𝕜 E] [Module 𝕜₂ F] [Module 𝕜 G]
variable {σ : 𝕜 →+* 𝕜₂} (f : E →ₛₗ[σ] F)
def LinearMap.mkContinuous (C : ℝ) (h : ∀ x, ‖f x‖ ≤ C * ‖x‖) : E →SL[σ] F :=
⟨f, AddMonoidHomClass.continuous_of_bound f C h⟩
#align linear_map.mk_continuous LinearMap.mkContinuous
def LinearMap.mkContinuousOfExistsBound (h : ∃ C, ∀ x, ‖f x‖ ≤ C * ‖x‖) : E →SL[σ] F :=
⟨f,
let ⟨C, hC⟩ := h
AddMonoidHomClass.continuous_of_bound f C hC⟩
#align linear_map.mk_continuous_of_exists_bound LinearMap.mkContinuousOfExistsBound
theorem continuous_of_linear_of_boundₛₗ {f : E → F} (h_add : ∀ x y, f (x + y) = f x + f y)
(h_smul : ∀ (c : 𝕜) (x), f (c • x) = σ c • f x) {C : ℝ} (h_bound : ∀ x, ‖f x‖ ≤ C * ‖x‖) :
Continuous f :=
let φ : E →ₛₗ[σ] F :=
{ toFun := f
map_add' := h_add
map_smul' := h_smul }
AddMonoidHomClass.continuous_of_bound φ C h_bound
#align continuous_of_linear_of_boundₛₗ continuous_of_linear_of_boundₛₗ
theorem continuous_of_linear_of_bound {f : E → G} (h_add : ∀ x y, f (x + y) = f x + f y)
(h_smul : ∀ (c : 𝕜) (x), f (c • x) = c • f x) {C : ℝ} (h_bound : ∀ x, ‖f x‖ ≤ C * ‖x‖) :
Continuous f :=
let φ : E →ₗ[𝕜] G :=
{ toFun := f
map_add' := h_add
map_smul' := h_smul }
AddMonoidHomClass.continuous_of_bound φ C h_bound
#align continuous_of_linear_of_bound continuous_of_linear_of_bound
@[simp, norm_cast]
theorem LinearMap.mkContinuous_coe (C : ℝ) (h : ∀ x, ‖f x‖ ≤ C * ‖x‖) :
(f.mkContinuous C h : E →ₛₗ[σ] F) = f :=
rfl
#align linear_map.mk_continuous_coe LinearMap.mkContinuous_coe
@[simp]
theorem LinearMap.mkContinuous_apply (C : ℝ) (h : ∀ x, ‖f x‖ ≤ C * ‖x‖) (x : E) :
f.mkContinuous C h x = f x :=
rfl
#align linear_map.mk_continuous_apply LinearMap.mkContinuous_apply
@[simp, norm_cast]
theorem LinearMap.mkContinuousOfExistsBound_coe (h : ∃ C, ∀ x, ‖f x‖ ≤ C * ‖x‖) :
(f.mkContinuousOfExistsBound h : E →ₛₗ[σ] F) = f :=
rfl
#align linear_map.mk_continuous_of_exists_bound_coe LinearMap.mkContinuousOfExistsBound_coe
@[simp]
theorem LinearMap.mkContinuousOfExistsBound_apply (h : ∃ C, ∀ x, ‖f x‖ ≤ C * ‖x‖) (x : E) :
f.mkContinuousOfExistsBound h x = f x :=
rfl
#align linear_map.mk_continuous_of_exists_bound_apply LinearMap.mkContinuousOfExistsBound_apply
section Seminormed
variable [Ring 𝕜] [Ring 𝕜₂]
variable [SeminormedAddCommGroup E] [SeminormedAddCommGroup F]
variable [Module 𝕜 E] [Module 𝕜₂ F]
variable {σ : 𝕜 →+* 𝕜₂} (f : E →ₛₗ[σ] F)
def ContinuousLinearMap.ofHomothety (f : E →ₛₗ[σ] F) (a : ℝ) (hf : ∀ x, ‖f x‖ = a * ‖x‖) :
E →SL[σ] F :=
f.mkContinuous a fun x => le_of_eq (hf x)
#align continuous_linear_map.of_homothety ContinuousLinearMap.ofHomothety
variable {σ₂₁ : 𝕜₂ →+* 𝕜} [RingHomInvPair σ σ₂₁] [RingHomInvPair σ₂₁ σ]
| Mathlib/Analysis/NormedSpace/ContinuousLinearMap.lean | 198 | 205 | theorem ContinuousLinearEquiv.homothety_inverse (a : ℝ) (ha : 0 < a) (f : E ≃ₛₗ[σ] F) :
(∀ x : E, ‖f x‖ = a * ‖x‖) → ∀ y : F, ‖f.symm y‖ = a⁻¹ * ‖y‖ := by |
intro hf y
calc
‖f.symm y‖ = a⁻¹ * (a * ‖f.symm y‖) := by
rw [← mul_assoc, inv_mul_cancel (ne_of_lt ha).symm, one_mul]
_ = a⁻¹ * ‖f (f.symm y)‖ := by rw [hf]
_ = a⁻¹ * ‖y‖ := by simp
|
import Mathlib.Computability.Halting
import Mathlib.Computability.TuringMachine
import Mathlib.Data.Num.Lemmas
import Mathlib.Tactic.DeriveFintype
#align_import computability.tm_to_partrec from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
open Function (update)
open Relation
namespace Turing
namespace ToPartrec
inductive Code
| zero'
| succ
| tail
| cons : Code → Code → Code
| comp : Code → Code → Code
| case : Code → Code → Code
| fix : Code → Code
deriving DecidableEq, Inhabited
#align turing.to_partrec.code Turing.ToPartrec.Code
#align turing.to_partrec.code.zero' Turing.ToPartrec.Code.zero'
#align turing.to_partrec.code.succ Turing.ToPartrec.Code.succ
#align turing.to_partrec.code.tail Turing.ToPartrec.Code.tail
#align turing.to_partrec.code.cons Turing.ToPartrec.Code.cons
#align turing.to_partrec.code.comp Turing.ToPartrec.Code.comp
#align turing.to_partrec.code.case Turing.ToPartrec.Code.case
#align turing.to_partrec.code.fix Turing.ToPartrec.Code.fix
def Code.eval : Code → List ℕ →. List ℕ
| Code.zero' => fun v => pure (0 :: v)
| Code.succ => fun v => pure [v.headI.succ]
| Code.tail => fun v => pure v.tail
| Code.cons f fs => fun v => do
let n ← Code.eval f v
let ns ← Code.eval fs v
pure (n.headI :: ns)
| Code.comp f g => fun v => g.eval v >>= f.eval
| Code.case f g => fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail)
| Code.fix f =>
PFun.fix fun v => (f.eval v).map fun v => if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail
#align turing.to_partrec.code.eval Turing.ToPartrec.Code.eval
namespace Code
@[simp]
theorem zero'_eval : zero'.eval = fun v => pure (0 :: v) := by simp [eval]
@[simp]
theorem succ_eval : succ.eval = fun v => pure [v.headI.succ] := by simp [eval]
@[simp]
theorem tail_eval : tail.eval = fun v => pure v.tail := by simp [eval]
@[simp]
theorem cons_eval (f fs) : (cons f fs).eval = fun v => do {
let n ← Code.eval f v
let ns ← Code.eval fs v
pure (n.headI :: ns) } := by simp [eval]
@[simp]
theorem comp_eval (f g) : (comp f g).eval = fun v => g.eval v >>= f.eval := by simp [eval]
@[simp]
theorem case_eval (f g) :
(case f g).eval = fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail) := by
simp [eval]
@[simp]
theorem fix_eval (f) : (fix f).eval =
PFun.fix fun v => (f.eval v).map fun v =>
if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail := by
simp [eval]
def nil : Code :=
tail.comp succ
#align turing.to_partrec.code.nil Turing.ToPartrec.Code.nil
@[simp]
theorem nil_eval (v) : nil.eval v = pure [] := by simp [nil]
#align turing.to_partrec.code.nil_eval Turing.ToPartrec.Code.nil_eval
def id : Code :=
tail.comp zero'
#align turing.to_partrec.code.id Turing.ToPartrec.Code.id
@[simp]
theorem id_eval (v) : id.eval v = pure v := by simp [id]
#align turing.to_partrec.code.id_eval Turing.ToPartrec.Code.id_eval
def head : Code :=
cons id nil
#align turing.to_partrec.code.head Turing.ToPartrec.Code.head
@[simp]
theorem head_eval (v) : head.eval v = pure [v.headI] := by simp [head]
#align turing.to_partrec.code.head_eval Turing.ToPartrec.Code.head_eval
def zero : Code :=
cons zero' nil
#align turing.to_partrec.code.zero Turing.ToPartrec.Code.zero
@[simp]
| Mathlib/Computability/TMToPartrec.lean | 201 | 201 | theorem zero_eval (v) : zero.eval v = pure [0] := by | simp [zero]
|
import Mathlib.Topology.Instances.Irrational
import Mathlib.Topology.Instances.Rat
import Mathlib.Topology.Compactification.OnePoint
#align_import topology.instances.rat_lemmas from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
open Set Metric Filter TopologicalSpace
open Topology OnePoint
local notation "ℚ∞" => OnePoint ℚ
namespace Rat
variable {p q : ℚ} {s t : Set ℚ}
theorem interior_compact_eq_empty (hs : IsCompact s) : interior s = ∅ :=
denseEmbedding_coe_real.toDenseInducing.interior_compact_eq_empty dense_irrational hs
#align rat.interior_compact_eq_empty Rat.interior_compact_eq_empty
theorem dense_compl_compact (hs : IsCompact s) : Dense sᶜ :=
interior_eq_empty_iff_dense_compl.1 (interior_compact_eq_empty hs)
#align rat.dense_compl_compact Rat.dense_compl_compact
instance cocompact_inf_nhds_neBot : NeBot (cocompact ℚ ⊓ 𝓝 p) := by
refine (hasBasis_cocompact.inf (nhds_basis_opens _)).neBot_iff.2 ?_
rintro ⟨s, o⟩ ⟨hs, hpo, ho⟩; rw [inter_comm]
exact (dense_compl_compact hs).inter_open_nonempty _ ho ⟨p, hpo⟩
#align rat.cocompact_inf_nhds_ne_bot Rat.cocompact_inf_nhds_neBot
| Mathlib/Topology/Instances/RatLemmas.lean | 56 | 62 | theorem not_countably_generated_cocompact : ¬IsCountablyGenerated (cocompact ℚ) := by |
intro H
rcases exists_seq_tendsto (cocompact ℚ ⊓ 𝓝 0) with ⟨x, hx⟩
rw [tendsto_inf] at hx; rcases hx with ⟨hxc, hx0⟩
obtain ⟨n, hn⟩ : ∃ n : ℕ, x n ∉ insert (0 : ℚ) (range x) :=
(hxc.eventually hx0.isCompact_insert_range.compl_mem_cocompact).exists
exact hn (Or.inr ⟨n, rfl⟩)
|
import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1
#align_import measure_theory.function.conditional_expectation.basic from "leanprover-community/mathlib"@"d8bbb04e2d2a44596798a9207ceefc0fb236e41e"
open TopologicalSpace MeasureTheory.Lp Filter
open scoped ENNReal Topology MeasureTheory
namespace MeasureTheory
variable {α F F' 𝕜 : Type*} {p : ℝ≥0∞} [RCLike 𝕜]
-- 𝕜 for ℝ or ℂ
-- F for a Lp submodule
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
-- F' for integrals on a Lp submodule
[NormedAddCommGroup F']
[NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F']
open scoped Classical
variable {m m0 : MeasurableSpace α} {μ : Measure α} {f g : α → F'} {s : Set α}
noncomputable irreducible_def condexp (m : MeasurableSpace α) {m0 : MeasurableSpace α}
(μ : Measure α) (f : α → F') : α → F' :=
if hm : m ≤ m0 then
if h : SigmaFinite (μ.trim hm) ∧ Integrable f μ then
if StronglyMeasurable[m] f then f
else (@aestronglyMeasurable'_condexpL1 _ _ _ _ _ m m0 μ hm h.1 _).mk
(@condexpL1 _ _ _ _ _ _ _ hm μ h.1 f)
else 0
else 0
#align measure_theory.condexp MeasureTheory.condexp
-- We define notation `μ[f|m]` for the conditional expectation of `f` with respect to `m`.
scoped notation μ "[" f "|" m "]" => MeasureTheory.condexp m μ f
theorem condexp_of_not_le (hm_not : ¬m ≤ m0) : μ[f|m] = 0 := by rw [condexp, dif_neg hm_not]
#align measure_theory.condexp_of_not_le MeasureTheory.condexp_of_not_le
theorem condexp_of_not_sigmaFinite (hm : m ≤ m0) (hμm_not : ¬SigmaFinite (μ.trim hm)) :
μ[f|m] = 0 := by rw [condexp, dif_pos hm, dif_neg]; push_neg; exact fun h => absurd h hμm_not
#align measure_theory.condexp_of_not_sigma_finite MeasureTheory.condexp_of_not_sigmaFinite
theorem condexp_of_sigmaFinite (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] :
μ[f|m] =
if Integrable f μ then
if StronglyMeasurable[m] f then f
else aestronglyMeasurable'_condexpL1.mk (condexpL1 hm μ f)
else 0 := by
rw [condexp, dif_pos hm]
simp only [hμm, Ne, true_and_iff]
by_cases hf : Integrable f μ
· rw [dif_pos hf, if_pos hf]
· rw [dif_neg hf, if_neg hf]
#align measure_theory.condexp_of_sigma_finite MeasureTheory.condexp_of_sigmaFinite
theorem condexp_of_stronglyMeasurable (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] {f : α → F'}
(hf : StronglyMeasurable[m] f) (hfi : Integrable f μ) : μ[f|m] = f := by
rw [condexp_of_sigmaFinite hm, if_pos hfi, if_pos hf]
#align measure_theory.condexp_of_strongly_measurable MeasureTheory.condexp_of_stronglyMeasurable
theorem condexp_const (hm : m ≤ m0) (c : F') [IsFiniteMeasure μ] :
μ[fun _ : α => c|m] = fun _ => c :=
condexp_of_stronglyMeasurable hm (@stronglyMeasurable_const _ _ m _ _) (integrable_const c)
#align measure_theory.condexp_const MeasureTheory.condexp_const
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
rw [condexp_of_sigmaFinite hm]
by_cases hfi : Integrable f μ
· rw [if_pos hfi]
by_cases hfm : StronglyMeasurable[m] f
· rw [if_pos hfm]
exact (condexpL1_of_aestronglyMeasurable' (StronglyMeasurable.aeStronglyMeasurable' hfm)
hfi).symm
· rw [if_neg hfm]
exact (AEStronglyMeasurable'.ae_eq_mk aestronglyMeasurable'_condexpL1).symm
rw [if_neg hfi, condexpL1_undef hfi]
exact (coeFn_zero _ _ _).symm
set_option linter.uppercaseLean3 false in
#align measure_theory.condexp_ae_eq_condexp_L1 MeasureTheory.condexp_ae_eq_condexpL1
| Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean | 152 | 155 | theorem condexp_ae_eq_condexpL1CLM (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ) :
μ[f|m] =ᵐ[μ] condexpL1CLM F' hm μ (hf.toL1 f) := by |
refine (condexp_ae_eq_condexpL1 hm f).trans (eventually_of_forall fun x => ?_)
rw [condexpL1_eq hf]
|
import Mathlib.Algebra.Polynomial.Expand
import Mathlib.Algebra.Polynomial.Laurent
import Mathlib.LinearAlgebra.Matrix.Charpoly.Basic
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.RingTheory.Polynomial.Nilpotent
#align_import linear_algebra.matrix.charpoly.coeff from "leanprover-community/mathlib"@"9745b093210e9dac443af24da9dba0f9e2b6c912"
noncomputable section
-- porting note: whenever there was `∏ i : n, X - C (M i i)`, I replaced it with
-- `∏ i : n, (X - C (M i i))`, since otherwise Lean would parse as `(∏ i : n, X) - C (M i i)`
universe u v w z
open Finset Matrix Polynomial
variable {R : Type u} [CommRing R]
variable {n G : Type v} [DecidableEq n] [Fintype n]
variable {α β : Type v} [DecidableEq α]
variable {M : Matrix n n R}
namespace Matrix
theorem charmatrix_apply_natDegree [Nontrivial R] (i j : n) :
(charmatrix M i j).natDegree = ite (i = j) 1 0 := by
by_cases h : i = j <;> simp [h, ← degree_eq_iff_natDegree_eq_of_pos (Nat.succ_pos 0)]
#align charmatrix_apply_nat_degree Matrix.charmatrix_apply_natDegree
theorem charmatrix_apply_natDegree_le (i j : n) :
(charmatrix M i j).natDegree ≤ ite (i = j) 1 0 := by
split_ifs with h <;> simp [h, natDegree_X_le]
#align charmatrix_apply_nat_degree_le Matrix.charmatrix_apply_natDegree_le
variable (M)
| Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean | 61 | 78 | theorem charpoly_sub_diagonal_degree_lt :
(M.charpoly - ∏ i : n, (X - C (M i i))).degree < ↑(Fintype.card n - 1) := by |
rw [charpoly, det_apply', ← insert_erase (mem_univ (Equiv.refl n)),
sum_insert (not_mem_erase (Equiv.refl n) univ), add_comm]
simp only [charmatrix_apply_eq, one_mul, Equiv.Perm.sign_refl, id, Int.cast_one,
Units.val_one, add_sub_cancel_right, Equiv.coe_refl]
rw [← mem_degreeLT]
apply Submodule.sum_mem (degreeLT R (Fintype.card n - 1))
intro c hc; rw [← C_eq_intCast, C_mul']
apply Submodule.smul_mem (degreeLT R (Fintype.card n - 1)) ↑↑(Equiv.Perm.sign c)
rw [mem_degreeLT]
apply lt_of_le_of_lt degree_le_natDegree _
rw [Nat.cast_lt]
apply lt_of_le_of_lt _ (Equiv.Perm.fixed_point_card_lt_of_ne_one (ne_of_mem_erase hc))
apply le_trans (Polynomial.natDegree_prod_le univ fun i : n => charmatrix M (c i) i) _
rw [card_eq_sum_ones]; rw [sum_filter]; apply sum_le_sum
intros
apply charmatrix_apply_natDegree_le
|
import Mathlib.FieldTheory.Galois
#align_import field_theory.polynomial_galois_group from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a"
noncomputable section
open scoped Polynomial
open FiniteDimensional
namespace Polynomial
variable {F : Type*} [Field F] (p q : F[X]) (E : Type*) [Field E] [Algebra F E]
def Gal :=
p.SplittingField ≃ₐ[F] p.SplittingField
-- Porting note(https://github.com/leanprover-community/mathlib4/issues/5020):
-- deriving Group, Fintype
#align polynomial.gal Polynomial.Gal
namespace Gal
instance instGroup : Group (Gal p) :=
inferInstanceAs (Group (p.SplittingField ≃ₐ[F] p.SplittingField))
instance instFintype : Fintype (Gal p) :=
inferInstanceAs (Fintype (p.SplittingField ≃ₐ[F] p.SplittingField))
instance : CoeFun p.Gal fun _ => p.SplittingField → p.SplittingField :=
-- Porting note: was AlgEquiv.hasCoeToFun
inferInstanceAs (CoeFun (p.SplittingField ≃ₐ[F] p.SplittingField) _)
instance applyMulSemiringAction : MulSemiringAction p.Gal p.SplittingField :=
AlgEquiv.applyMulSemiringAction
#align polynomial.gal.apply_mul_semiring_action Polynomial.Gal.applyMulSemiringAction
@[ext]
| Mathlib/FieldTheory/PolynomialGaloisGroup.lean | 74 | 79 | theorem ext {σ τ : p.Gal} (h : ∀ x ∈ p.rootSet p.SplittingField, σ x = τ x) : σ = τ := by |
refine
AlgEquiv.ext fun x =>
(AlgHom.mem_equalizer σ.toAlgHom τ.toAlgHom x).mp
((SetLike.ext_iff.mp ?_ x).mpr Algebra.mem_top)
rwa [eq_top_iff, ← SplittingField.adjoin_rootSet, Algebra.adjoin_le_iff]
|
import Mathlib.Algebra.Regular.Basic
import Mathlib.LinearAlgebra.Matrix.MvPolynomial
import Mathlib.LinearAlgebra.Matrix.Polynomial
import Mathlib.RingTheory.Polynomial.Basic
#align_import linear_algebra.matrix.adjugate from "leanprover-community/mathlib"@"a99f85220eaf38f14f94e04699943e185a5e1d1a"
namespace Matrix
universe u v w
variable {m : Type u} {n : Type v} {α : Type w}
variable [DecidableEq n] [Fintype n] [DecidableEq m] [Fintype m] [CommRing α]
open Matrix Polynomial Equiv Equiv.Perm Finset
section Cramer
variable (A : Matrix n n α) (b : n → α)
def cramerMap (i : n) : α :=
(A.updateColumn i b).det
#align matrix.cramer_map Matrix.cramerMap
theorem cramerMap_is_linear (i : n) : IsLinearMap α fun b => cramerMap A b i :=
{ map_add := det_updateColumn_add _ _
map_smul := det_updateColumn_smul _ _ }
#align matrix.cramer_map_is_linear Matrix.cramerMap_is_linear
theorem cramer_is_linear : IsLinearMap α (cramerMap A) := by
constructor <;> intros <;> ext i
· apply (cramerMap_is_linear A i).1
· apply (cramerMap_is_linear A i).2
#align matrix.cramer_is_linear Matrix.cramer_is_linear
def cramer (A : Matrix n n α) : (n → α) →ₗ[α] (n → α) :=
IsLinearMap.mk' (cramerMap A) (cramer_is_linear A)
#align matrix.cramer Matrix.cramer
theorem cramer_apply (i : n) : cramer A b i = (A.updateColumn i b).det :=
rfl
#align matrix.cramer_apply Matrix.cramer_apply
theorem cramer_transpose_apply (i : n) : cramer Aᵀ b i = (A.updateRow i b).det := by
rw [cramer_apply, updateColumn_transpose, det_transpose]
#align matrix.cramer_transpose_apply Matrix.cramer_transpose_apply
theorem cramer_transpose_row_self (i : n) : Aᵀ.cramer (A i) = Pi.single i A.det := by
ext j
rw [cramer_apply, Pi.single_apply]
split_ifs with h
· -- i = j: this entry should be `A.det`
subst h
simp only [updateColumn_transpose, det_transpose, updateRow_eq_self]
· -- i ≠ j: this entry should be 0
rw [updateColumn_transpose, det_transpose]
apply det_zero_of_row_eq h
rw [updateRow_self, updateRow_ne (Ne.symm h)]
#align matrix.cramer_transpose_row_self Matrix.cramer_transpose_row_self
theorem cramer_row_self (i : n) (h : ∀ j, b j = A j i) : A.cramer b = Pi.single i A.det := by
rw [← transpose_transpose A, det_transpose]
convert cramer_transpose_row_self Aᵀ i
exact funext h
#align matrix.cramer_row_self Matrix.cramer_row_self
@[simp]
theorem cramer_one : cramer (1 : Matrix n n α) = 1 := by
-- Porting note: was `ext i j`
refine LinearMap.pi_ext' (fun (i : n) => LinearMap.ext_ring (funext (fun (j : n) => ?_)))
convert congr_fun (cramer_row_self (1 : Matrix n n α) (Pi.single i 1) i _) j
· simp
· intro j
rw [Matrix.one_eq_pi_single, Pi.single_comm]
#align matrix.cramer_one Matrix.cramer_one
theorem cramer_smul (r : α) (A : Matrix n n α) :
cramer (r • A) = r ^ (Fintype.card n - 1) • cramer A :=
LinearMap.ext fun _ => funext fun _ => det_updateColumn_smul' _ _ _ _
#align matrix.cramer_smul Matrix.cramer_smul
@[simp]
theorem cramer_subsingleton_apply [Subsingleton n] (A : Matrix n n α) (b : n → α) (i : n) :
cramer A b i = b i := by rw [cramer_apply, det_eq_elem_of_subsingleton _ i, updateColumn_self]
#align matrix.cramer_subsingleton_apply Matrix.cramer_subsingleton_apply
theorem cramer_zero [Nontrivial n] : cramer (0 : Matrix n n α) = 0 := by
ext i j
obtain ⟨j', hj'⟩ : ∃ j', j' ≠ j := exists_ne j
apply det_eq_zero_of_column_eq_zero j'
intro j''
simp [updateColumn_ne hj']
#align matrix.cramer_zero Matrix.cramer_zero
theorem sum_cramer {β} (s : Finset β) (f : β → n → α) :
(∑ x ∈ s, cramer A (f x)) = cramer A (∑ x ∈ s, f x) :=
(map_sum (cramer A) ..).symm
#align matrix.sum_cramer Matrix.sum_cramer
| Mathlib/LinearAlgebra/Matrix/Adjugate.lean | 160 | 170 | theorem sum_cramer_apply {β} (s : Finset β) (f : n → β → α) (i : n) :
(∑ x ∈ s, cramer A (fun j => f j x) i) = cramer A (fun j : n => ∑ x ∈ s, f j x) i :=
calc
(∑ x ∈ s, cramer A (fun j => f j x) i) = (∑ x ∈ s, cramer A fun j => f j x) i :=
(Finset.sum_apply i s _).symm
_ = cramer A (fun j : n => ∑ x ∈ s, f j x) i := by |
rw [sum_cramer, cramer_apply, cramer_apply]
simp only [updateColumn]
congr with j
congr
apply Finset.sum_apply
|
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Comp
import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars
#align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
open scoped Classical
open Topology Filter ENNReal
open Filter Asymptotics Set
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)
variable {𝕜 : Type u} [NontriviallyNormedField 𝕜]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
variable {f f₀ f₁ g : 𝕜 → F}
variable {f' f₀' f₁' g' : F}
variable {x : 𝕜}
variable {s t : Set 𝕜}
variable {L L₁ L₂ : Filter 𝕜}
section CompositionVector
open ContinuousLinearMap
variable {l : F → E} {l' : F →L[𝕜] E} {y : F}
variable (x)
theorem HasFDerivWithinAt.comp_hasDerivWithinAt {t : Set F} (hl : HasFDerivWithinAt l l' t (f x))
(hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) :
HasDerivWithinAt (l ∘ f) (l' f') s x := by
simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (· ∘ ·)] using
(hl.comp x hf.hasFDerivWithinAt hst).hasDerivWithinAt
#align has_fderiv_within_at.comp_has_deriv_within_at HasFDerivWithinAt.comp_hasDerivWithinAt
theorem HasFDerivWithinAt.comp_hasDerivWithinAt_of_eq {t : Set F}
(hl : HasFDerivWithinAt l l' t y)
(hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) (hy : y = f x) :
HasDerivWithinAt (l ∘ f) (l' f') s x := by
rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf hst
theorem HasFDerivAt.comp_hasDerivWithinAt (hl : HasFDerivAt l l' (f x))
(hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (l ∘ f) (l' f') s x :=
hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf (mapsTo_univ _ _)
#align has_fderiv_at.comp_has_deriv_within_at HasFDerivAt.comp_hasDerivWithinAt
theorem HasFDerivAt.comp_hasDerivWithinAt_of_eq (hl : HasFDerivAt l l' y)
(hf : HasDerivWithinAt f f' s x) (hy : y = f x) :
HasDerivWithinAt (l ∘ f) (l' f') s x := by
rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf
theorem HasFDerivAt.comp_hasDerivAt (hl : HasFDerivAt l l' (f x)) (hf : HasDerivAt f f' x) :
HasDerivAt (l ∘ f) (l' f') x :=
hasDerivWithinAt_univ.mp <| hl.comp_hasDerivWithinAt x hf.hasDerivWithinAt
#align has_fderiv_at.comp_has_deriv_at HasFDerivAt.comp_hasDerivAt
theorem HasFDerivAt.comp_hasDerivAt_of_eq
(hl : HasFDerivAt l l' y) (hf : HasDerivAt f f' x) (hy : y = f x) :
HasDerivAt (l ∘ f) (l' f') x := by
rw [hy] at hl; exact hl.comp_hasDerivAt x hf
theorem HasStrictFDerivAt.comp_hasStrictDerivAt (hl : HasStrictFDerivAt l l' (f x))
(hf : HasStrictDerivAt f f' x) : HasStrictDerivAt (l ∘ f) (l' f') x := by
simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (· ∘ ·)] using
(hl.comp x hf.hasStrictFDerivAt).hasStrictDerivAt
#align has_strict_fderiv_at.comp_has_strict_deriv_at HasStrictFDerivAt.comp_hasStrictDerivAt
theorem HasStrictFDerivAt.comp_hasStrictDerivAt_of_eq (hl : HasStrictFDerivAt l l' y)
(hf : HasStrictDerivAt f f' x) (hy : y = f x) :
HasStrictDerivAt (l ∘ f) (l' f') x := by
rw [hy] at hl; exact hl.comp_hasStrictDerivAt x hf
theorem fderivWithin.comp_derivWithin {t : Set F} (hl : DifferentiableWithinAt 𝕜 l t (f x))
(hf : DifferentiableWithinAt 𝕜 f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt 𝕜 s x) :
derivWithin (l ∘ f) s x = (fderivWithin 𝕜 l t (f x) : F → E) (derivWithin f s x) :=
(hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf.hasDerivWithinAt hs).derivWithin hxs
#align fderiv_within.comp_deriv_within fderivWithin.comp_derivWithin
| Mathlib/Analysis/Calculus/Deriv/Comp.lean | 404 | 408 | theorem fderivWithin.comp_derivWithin_of_eq {t : Set F} (hl : DifferentiableWithinAt 𝕜 l t y)
(hf : DifferentiableWithinAt 𝕜 f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt 𝕜 s x)
(hy : y = f x) :
derivWithin (l ∘ f) s x = (fderivWithin 𝕜 l t (f x) : F → E) (derivWithin f s x) := by |
rw [hy] at hl; exact fderivWithin.comp_derivWithin x hl hf hs hxs
|
import Mathlib.Dynamics.Ergodic.MeasurePreserving
import Mathlib.LinearAlgebra.Determinant
import Mathlib.LinearAlgebra.Matrix.Diagonal
import Mathlib.LinearAlgebra.Matrix.Transvection
import Mathlib.MeasureTheory.Group.LIntegral
import Mathlib.MeasureTheory.Integral.Marginal
import Mathlib.MeasureTheory.Measure.Stieltjes
import Mathlib.MeasureTheory.Measure.Haar.OfBasis
#align_import measure_theory.measure.lebesgue.basic from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
assert_not_exists MeasureTheory.integral
noncomputable section
open scoped Classical
open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace
open ENNReal (ofReal)
open scoped ENNReal NNReal Topology
section regionBetween
variable {α : Type*}
def regionBetween (f g : α → ℝ) (s : Set α) : Set (α × ℝ) :=
{ p : α × ℝ | p.1 ∈ s ∧ p.2 ∈ Ioo (f p.1) (g p.1) }
#align region_between regionBetween
theorem regionBetween_subset (f g : α → ℝ) (s : Set α) : regionBetween f g s ⊆ s ×ˢ univ := by
simpa only [prod_univ, regionBetween, Set.preimage, setOf_subset_setOf] using fun a => And.left
#align region_between_subset regionBetween_subset
variable [MeasurableSpace α] {μ : Measure α} {f g : α → ℝ} {s : Set α}
theorem measurableSet_regionBetween (hf : Measurable f) (hg : Measurable g) (hs : MeasurableSet s) :
MeasurableSet (regionBetween f g s) := by
dsimp only [regionBetween, Ioo, mem_setOf_eq, setOf_and]
refine
MeasurableSet.inter ?_
((measurableSet_lt (hf.comp measurable_fst) measurable_snd).inter
(measurableSet_lt measurable_snd (hg.comp measurable_fst)))
exact measurable_fst hs
#align measurable_set_region_between measurableSet_regionBetween
theorem measurableSet_region_between_oc (hf : Measurable f) (hg : Measurable g)
(hs : MeasurableSet s) :
MeasurableSet { p : α × ℝ | p.fst ∈ s ∧ p.snd ∈ Ioc (f p.fst) (g p.fst) } := by
dsimp only [regionBetween, Ioc, mem_setOf_eq, setOf_and]
refine
MeasurableSet.inter ?_
((measurableSet_lt (hf.comp measurable_fst) measurable_snd).inter
(measurableSet_le measurable_snd (hg.comp measurable_fst)))
exact measurable_fst hs
#align measurable_set_region_between_oc measurableSet_region_between_oc
theorem measurableSet_region_between_co (hf : Measurable f) (hg : Measurable g)
(hs : MeasurableSet s) :
MeasurableSet { p : α × ℝ | p.fst ∈ s ∧ p.snd ∈ Ico (f p.fst) (g p.fst) } := by
dsimp only [regionBetween, Ico, mem_setOf_eq, setOf_and]
refine
MeasurableSet.inter ?_
((measurableSet_le (hf.comp measurable_fst) measurable_snd).inter
(measurableSet_lt measurable_snd (hg.comp measurable_fst)))
exact measurable_fst hs
#align measurable_set_region_between_co measurableSet_region_between_co
theorem measurableSet_region_between_cc (hf : Measurable f) (hg : Measurable g)
(hs : MeasurableSet s) :
MeasurableSet { p : α × ℝ | p.fst ∈ s ∧ p.snd ∈ Icc (f p.fst) (g p.fst) } := by
dsimp only [regionBetween, Icc, mem_setOf_eq, setOf_and]
refine
MeasurableSet.inter ?_
((measurableSet_le (hf.comp measurable_fst) measurable_snd).inter
(measurableSet_le measurable_snd (hg.comp measurable_fst)))
exact measurable_fst hs
#align measurable_set_region_between_cc measurableSet_region_between_cc
| Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean | 506 | 508 | theorem measurableSet_graph (hf : Measurable f) :
MeasurableSet { p : α × ℝ | p.snd = f p.fst } := by |
simpa using measurableSet_region_between_cc hf hf MeasurableSet.univ
|
import Mathlib.Logic.Function.Iterate
import Mathlib.Init.Data.Int.Order
import Mathlib.Order.Compare
import Mathlib.Order.Max
import Mathlib.Order.RelClasses
import Mathlib.Tactic.Choose
#align_import order.monotone.basic from "leanprover-community/mathlib"@"554bb38de8ded0dafe93b7f18f0bfee6ef77dc5d"
open Function OrderDual
universe u v w
variable {ι : Type*} {α : Type u} {β : Type v} {γ : Type w} {δ : Type*} {π : ι → Type*}
{r : α → α → Prop}
namespace List
section Preorder
variable [Preorder α]
| Mathlib/Order/Monotone/Basic.lean | 1,014 | 1,018 | theorem Nat.rel_of_forall_rel_succ_of_le_of_lt (r : β → β → Prop) [IsTrans β r] {f : ℕ → β} {a : ℕ}
(h : ∀ n, a ≤ n → r (f n) (f (n + 1))) ⦃b c : ℕ⦄ (hab : a ≤ b) (hbc : b < c) :
r (f b) (f c) := by |
induction' hbc with k b_lt_k r_b_k
exacts [h _ hab, _root_.trans r_b_k (h _ (hab.trans_lt b_lt_k).le)]
|
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks
import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks
#align_import category_theory.limits.constructions.epi_mono from "leanprover-community/mathlib"@"f7baecbb54bd0f24f228576f97b1752fc3c9b318"
universe v₁ v₂ u₁ u₂
namespace CategoryTheory
open Category Limits
variable {C : Type u₁} {D : Type u₂} [Category.{v₁} C] [Category.{v₂} D]
variable (F : C ⥤ D)
theorem preserves_mono_of_preservesLimit {X Y : C} (f : X ⟶ Y) [PreservesLimit (cospan f f) F]
[Mono f] : Mono (F.map f) := by
have := isLimitPullbackConeMapOfIsLimit F _ (PullbackCone.isLimitMkIdId f)
simp_rw [F.map_id] at this
apply PullbackCone.mono_of_isLimitMkIdId _ this
#align category_theory.preserves_mono_of_preserves_limit CategoryTheory.preserves_mono_of_preservesLimit
instance (priority := 100) preservesMonomorphisms_of_preservesLimitsOfShape
[PreservesLimitsOfShape WalkingCospan F] : F.PreservesMonomorphisms where
preserves f _ := preserves_mono_of_preservesLimit F f
#align category_theory.preserves_monomorphisms_of_preserves_limits_of_shape CategoryTheory.preservesMonomorphisms_of_preservesLimitsOfShape
theorem reflects_mono_of_reflectsLimit {X Y : C} (f : X ⟶ Y) [ReflectsLimit (cospan f f) F]
[Mono (F.map f)] : Mono f := by
have := PullbackCone.isLimitMkIdId (F.map f)
simp_rw [← F.map_id] at this
apply PullbackCone.mono_of_isLimitMkIdId _ (isLimitOfIsLimitPullbackConeMap F _ this)
#align category_theory.reflects_mono_of_reflects_limit CategoryTheory.reflects_mono_of_reflectsLimit
instance (priority := 100) reflectsMonomorphisms_of_reflectsLimitsOfShape
[ReflectsLimitsOfShape WalkingCospan F] : F.ReflectsMonomorphisms where
reflects f _ := reflects_mono_of_reflectsLimit F f
#align category_theory.reflects_monomorphisms_of_reflects_limits_of_shape CategoryTheory.reflectsMonomorphisms_of_reflectsLimitsOfShape
| Mathlib/CategoryTheory/Limits/Constructions/EpiMono.lean | 58 | 62 | theorem preserves_epi_of_preservesColimit {X Y : C} (f : X ⟶ Y) [PreservesColimit (span f f) F]
[Epi f] : Epi (F.map f) := by |
have := isColimitPushoutCoconeMapOfIsColimit F _ (PushoutCocone.isColimitMkIdId f)
simp_rw [F.map_id] at this
apply PushoutCocone.epi_of_isColimitMkIdId _ this
|
import Mathlib.Data.Int.Interval
import Mathlib.Data.Int.SuccPred
import Mathlib.Data.Int.ConditionallyCompleteOrder
import Mathlib.Topology.Instances.Discrete
import Mathlib.Topology.MetricSpace.Bounded
import Mathlib.Order.Filter.Archimedean
#align_import topology.instances.int from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
open Metric Set Filter
namespace Int
instance : Dist ℤ :=
⟨fun x y => dist (x : ℝ) y⟩
theorem dist_eq (x y : ℤ) : dist x y = |(x : ℝ) - y| := rfl
#align int.dist_eq Int.dist_eq
theorem dist_eq' (m n : ℤ) : dist m n = |m - n| := by rw [dist_eq]; norm_cast
@[norm_cast, simp]
theorem dist_cast_real (x y : ℤ) : dist (x : ℝ) y = dist x y :=
rfl
#align int.dist_cast_real Int.dist_cast_real
theorem pairwise_one_le_dist : Pairwise fun m n : ℤ => 1 ≤ dist m n := by
intro m n hne
rw [dist_eq]; norm_cast; rwa [← zero_add (1 : ℤ), Int.add_one_le_iff, abs_pos, sub_ne_zero]
#align int.pairwise_one_le_dist Int.pairwise_one_le_dist
theorem uniformEmbedding_coe_real : UniformEmbedding ((↑) : ℤ → ℝ) :=
uniformEmbedding_bot_of_pairwise_le_dist zero_lt_one pairwise_one_le_dist
#align int.uniform_embedding_coe_real Int.uniformEmbedding_coe_real
theorem closedEmbedding_coe_real : ClosedEmbedding ((↑) : ℤ → ℝ) :=
closedEmbedding_of_pairwise_le_dist zero_lt_one pairwise_one_le_dist
#align int.closed_embedding_coe_real Int.closedEmbedding_coe_real
instance : MetricSpace ℤ := Int.uniformEmbedding_coe_real.comapMetricSpace _
theorem preimage_ball (x : ℤ) (r : ℝ) : (↑) ⁻¹' ball (x : ℝ) r = ball x r := rfl
#align int.preimage_ball Int.preimage_ball
theorem preimage_closedBall (x : ℤ) (r : ℝ) : (↑) ⁻¹' closedBall (x : ℝ) r = closedBall x r := rfl
#align int.preimage_closed_ball Int.preimage_closedBall
theorem ball_eq_Ioo (x : ℤ) (r : ℝ) : ball x r = Ioo ⌊↑x - r⌋ ⌈↑x + r⌉ := by
rw [← preimage_ball, Real.ball_eq_Ioo, preimage_Ioo]
#align int.ball_eq_Ioo Int.ball_eq_Ioo
theorem closedBall_eq_Icc (x : ℤ) (r : ℝ) : closedBall x r = Icc ⌈↑x - r⌉ ⌊↑x + r⌋ := by
rw [← preimage_closedBall, Real.closedBall_eq_Icc, preimage_Icc]
#align int.closed_ball_eq_Icc Int.closedBall_eq_Icc
instance : ProperSpace ℤ :=
⟨fun x r => by
rw [closedBall_eq_Icc]
exact (Set.finite_Icc _ _).isCompact⟩
@[simp]
theorem cobounded_eq : Bornology.cobounded ℤ = atBot ⊔ atTop := by
simp_rw [← comap_dist_right_atTop (0 : ℤ), dist_eq', sub_zero,
← comap_abs_atTop, ← @Int.comap_cast_atTop ℝ, comap_comap]; rfl
@[deprecated (since := "2024-02-07")] alias cocompact_eq := cocompact_eq_atBot_atTop
#align int.cocompact_eq Int.cocompact_eq
@[simp]
| Mathlib/Topology/Instances/Int.lean | 84 | 85 | theorem cofinite_eq : (cofinite : Filter ℤ) = atBot ⊔ atTop := by |
rw [← cocompact_eq_cofinite, cocompact_eq_atBot_atTop]
|
import Mathlib.AlgebraicTopology.DoldKan.PInfty
#align_import algebraic_topology.dold_kan.decomposition from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504"
open CategoryTheory CategoryTheory.Category CategoryTheory.Preadditive
Opposite Simplicial
noncomputable section
namespace AlgebraicTopology
namespace DoldKan
variable {C : Type*} [Category C] [Preadditive C] {X X' : SimplicialObject C}
theorem decomposition_Q (n q : ℕ) :
((Q q).f (n + 1) : X _[n + 1] ⟶ X _[n + 1]) =
∑ i ∈ Finset.filter (fun i : Fin (n + 1) => (i : ℕ) < q) Finset.univ,
(P i).f (n + 1) ≫ X.δ i.rev.succ ≫ X.σ (Fin.rev i) := by
induction' q with q hq
· simp only [Nat.zero_eq, Q_zero, HomologicalComplex.zero_f_apply, Nat.not_lt_zero,
Finset.filter_False, Finset.sum_empty]
· by_cases hqn : q + 1 ≤ n + 1
swap
· rw [Q_is_eventually_constant (show n + 1 ≤ q by omega), hq]
congr 1
ext ⟨x, hx⟩
simp only [Nat.succ_eq_add_one, Finset.mem_filter, Finset.mem_univ, true_and]
omega
· cases' Nat.le.dest (Nat.succ_le_succ_iff.mp hqn) with a ha
rw [Q_succ, HomologicalComplex.sub_f_apply, HomologicalComplex.comp_f, hq]
symm
conv_rhs => rw [sub_eq_add_neg, add_comm]
let q' : Fin (n + 1) := ⟨q, Nat.succ_le_iff.mp hqn⟩
rw [← @Finset.add_sum_erase _ _ _ _ _ _ q' (by simp)]
congr
· have hnaq' : n = a + q := by omega
simp only [Fin.val_mk, (HigherFacesVanish.of_P q n).comp_Hσ_eq hnaq',
q'.rev_eq hnaq', neg_neg]
rfl
· ext ⟨i, hi⟩
simp only [q', Nat.succ_eq_add_one, Nat.lt_succ_iff_lt_or_eq, Finset.mem_univ,
forall_true_left, Finset.mem_filter, lt_self_iff_false, or_true, and_self, not_true,
Finset.mem_erase, ne_eq, Fin.mk.injEq, true_and]
aesop
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.decomposition_Q AlgebraicTopology.DoldKan.decomposition_Q
variable (X)
-- porting note (#5171): removed @[nolint has_nonempty_instance]
@[ext]
structure MorphComponents (n : ℕ) (Z : C) where
a : X _[n + 1] ⟶ Z
b : Fin (n + 1) → (X _[n] ⟶ Z)
#align algebraic_topology.dold_kan.morph_components AlgebraicTopology.DoldKan.MorphComponents
namespace MorphComponents
variable {X} {n : ℕ} {Z Z' : C} (f : MorphComponents X n Z) (g : X' ⟶ X) (h : Z ⟶ Z')
def φ {Z : C} (f : MorphComponents X n Z) : X _[n + 1] ⟶ Z :=
PInfty.f (n + 1) ≫ f.a + ∑ i : Fin (n + 1), (P i).f (n + 1) ≫ X.δ i.rev.succ ≫
f.b (Fin.rev i)
#align algebraic_topology.dold_kan.morph_components.φ AlgebraicTopology.DoldKan.MorphComponents.φ
variable (X n)
@[simps]
def id : MorphComponents X n (X _[n + 1]) where
a := PInfty.f (n + 1)
b i := X.σ i
#align algebraic_topology.dold_kan.morph_components.id AlgebraicTopology.DoldKan.MorphComponents.id
@[simp]
| Mathlib/AlgebraicTopology/DoldKan/Decomposition.lean | 120 | 124 | theorem id_φ : (id X n).φ = 𝟙 _ := by |
simp only [← P_add_Q_f (n + 1) (n + 1), φ]
congr 1
· simp only [id, PInfty_f, P_f_idem]
· exact Eq.trans (by congr; simp) (decomposition_Q n (n + 1)).symm
|
import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPreregular
import Mathlib.Topology.Category.CompHaus.EffectiveEpi
import Mathlib.Topology.Category.Stonean.Limits
import Mathlib.Topology.Category.CompHaus.EffectiveEpi
universe u
open CategoryTheory Limits
namespace Stonean
noncomputable
def struct {B X : Stonean.{u}} (π : X ⟶ B) (hπ : Function.Surjective π) : EffectiveEpiStruct π where
desc e h := (QuotientMap.of_surjective_continuous hπ π.continuous).lift e fun a b hab ↦
DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
(by ext; exact hab)) a
fac e h := ((QuotientMap.of_surjective_continuous hπ π.continuous).lift_comp e
fun a b hab ↦ DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
(by ext; exact hab)) a)
uniq e h g hm := by
suffices g = (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv ⟨e,
fun a b hab ↦ DFunLike.congr_fun
(h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩ (by ext; exact hab))
a⟩ by assumption
rw [← Equiv.symm_apply_eq (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv]
ext
simp only [QuotientMap.liftEquiv_symm_apply_coe, ContinuousMap.comp_apply, ← hm]
rfl
open List in
theorem effectiveEpi_tfae
{B X : Stonean.{u}} (π : X ⟶ B) :
TFAE
[ EffectiveEpi π
, Epi π
, Function.Surjective π
] := by
tfae_have 1 → 2
· intro; infer_instance
tfae_have 2 ↔ 3
· exact epi_iff_surjective π
tfae_have 3 → 1
· exact fun hπ ↦ ⟨⟨struct π hπ⟩⟩
tfae_finish
instance : Stonean.toCompHaus.PreservesEffectiveEpis where
preserves f h :=
((CompHaus.effectiveEpi_tfae f).out 0 2).mpr (((Stonean.effectiveEpi_tfae f).out 0 2).mp h)
instance : Stonean.toCompHaus.ReflectsEffectiveEpis where
reflects f h :=
((Stonean.effectiveEpi_tfae f).out 0 2).mpr (((CompHaus.effectiveEpi_tfae f).out 0 2).mp h)
noncomputable def stoneanToCompHausEffectivePresentation (X : CompHaus) :
Stonean.toCompHaus.EffectivePresentation X where
p := X.presentation
f := CompHaus.presentation.π X
effectiveEpi := ((CompHaus.effectiveEpi_tfae _).out 0 1).mpr (inferInstance : Epi _)
instance : Stonean.toCompHaus.EffectivelyEnough where
presentation X := ⟨stoneanToCompHausEffectivePresentation X⟩
instance : Preregular Stonean := Stonean.toCompHaus.reflects_preregular
example : Precoherent Stonean.{u} := inferInstance
-- TODO: prove this for `Type*`
open List in
| Mathlib/Topology/Category/Stonean/EffectiveEpi.lean | 103 | 121 | theorem effectiveEpiFamily_tfae
{α : Type} [Finite α] {B : Stonean.{u}}
(X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
TFAE
[ EffectiveEpiFamily X π
, Epi (Sigma.desc π)
, ∀ b : B, ∃ (a : α) (x : X a), π a x = b
] := by |
tfae_have 2 → 1
· intro
simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
tfae_have 1 → 2
· intro; infer_instance
tfae_have 3 ↔ 1
· erw [((CompHaus.effectiveEpiFamily_tfae
(fun a ↦ Stonean.toCompHaus.obj (X a)) (fun a ↦ Stonean.toCompHaus.map (π a))).out 2 0 : )]
exact ⟨fun h ↦ Stonean.toCompHaus.finite_effectiveEpiFamily_of_map _ _ h,
fun _ ↦ inferInstance⟩
tfae_finish
|
import Mathlib.Probability.Variance
#align_import probability.moments from "leanprover-community/mathlib"@"85453a2a14be8da64caf15ca50930cf4c6e5d8de"
open MeasureTheory Filter Finset Real
noncomputable section
open scoped MeasureTheory ProbabilityTheory ENNReal NNReal
namespace ProbabilityTheory
variable {Ω ι : Type*} {m : MeasurableSpace Ω} {X : Ω → ℝ} {p : ℕ} {μ : Measure Ω}
def moment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ :=
μ[X ^ p]
#align probability_theory.moment ProbabilityTheory.moment
def centralMoment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ := by
have m := fun (x : Ω) => μ[X] -- Porting note: Lean deems `μ[(X - fun x => μ[X]) ^ p]` ambiguous
exact μ[(X - m) ^ p]
#align probability_theory.central_moment ProbabilityTheory.centralMoment
@[simp]
theorem moment_zero (hp : p ≠ 0) : moment 0 p μ = 0 := by
simp only [moment, hp, zero_pow, Ne, not_false_iff, Pi.zero_apply, integral_const,
smul_eq_mul, mul_zero, integral_zero]
#align probability_theory.moment_zero ProbabilityTheory.moment_zero
@[simp]
theorem centralMoment_zero (hp : p ≠ 0) : centralMoment 0 p μ = 0 := by
simp only [centralMoment, hp, Pi.zero_apply, integral_const, smul_eq_mul,
mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow, Ne, not_false_iff]
#align probability_theory.central_moment_zero ProbabilityTheory.centralMoment_zero
| Mathlib/Probability/Moments.lean | 73 | 77 | theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * μ[X] := by |
simp only [centralMoment, Pi.sub_apply, pow_one]
rw [integral_sub h_int (integrable_const _)]
simp only [sub_mul, integral_const, smul_eq_mul, one_mul]
|
import Mathlib.Algebra.BigOperators.Intervals
import Mathlib.Algebra.BigOperators.Ring.List
import Mathlib.Data.Int.ModEq
import Mathlib.Data.Nat.Bits
import Mathlib.Data.Nat.Log
import Mathlib.Data.List.Indexes
import Mathlib.Data.List.Palindrome
import Mathlib.Tactic.IntervalCases
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Ring
#align_import data.nat.digits from "leanprover-community/mathlib"@"369525b73f229ccd76a6ec0e0e0bf2be57599768"
namespace Nat
variable {n : ℕ}
def digitsAux0 : ℕ → List ℕ
| 0 => []
| n + 1 => [n + 1]
#align nat.digits_aux_0 Nat.digitsAux0
def digitsAux1 (n : ℕ) : List ℕ :=
List.replicate n 1
#align nat.digits_aux_1 Nat.digitsAux1
def digitsAux (b : ℕ) (h : 2 ≤ b) : ℕ → List ℕ
| 0 => []
| n + 1 =>
((n + 1) % b) :: digitsAux b h ((n + 1) / b)
decreasing_by exact Nat.div_lt_self (Nat.succ_pos _) h
#align nat.digits_aux Nat.digitsAux
@[simp]
theorem digitsAux_zero (b : ℕ) (h : 2 ≤ b) : digitsAux b h 0 = [] := by rw [digitsAux]
#align nat.digits_aux_zero Nat.digitsAux_zero
| Mathlib/Data/Nat/Digits.lean | 63 | 67 | theorem digitsAux_def (b : ℕ) (h : 2 ≤ b) (n : ℕ) (w : 0 < n) :
digitsAux b h n = (n % b) :: digitsAux b h (n / b) := by |
cases n
· cases w
· rw [digitsAux]
|
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ι α β γ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero α] [NormalizedGCDMonoid α]
section lcm
def lcm (s : Finset β) (f : β → α) : α :=
s.fold GCDMonoid.lcm 1 f
#align finset.lcm Finset.lcm
variable {s s₁ s₂ : Finset β} {f : β → α}
theorem lcm_def : s.lcm f = (s.1.map f).lcm :=
rfl
#align finset.lcm_def Finset.lcm_def
@[simp]
theorem lcm_empty : (∅ : Finset β).lcm f = 1 :=
fold_empty
#align finset.lcm_empty Finset.lcm_empty
@[simp]
theorem lcm_dvd_iff {a : α} : s.lcm f ∣ a ↔ ∀ b ∈ s, f b ∣ a := by
apply Iff.trans Multiset.lcm_dvd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact ⟨fun k b hb ↦ k _ _ hb rfl, fun k a' b hb h ↦ h ▸ k _ hb⟩
#align finset.lcm_dvd_iff Finset.lcm_dvd_iff
theorem lcm_dvd {a : α} : (∀ b ∈ s, f b ∣ a) → s.lcm f ∣ a :=
lcm_dvd_iff.2
#align finset.lcm_dvd Finset.lcm_dvd
theorem dvd_lcm {b : β} (hb : b ∈ s) : f b ∣ s.lcm f :=
lcm_dvd_iff.1 dvd_rfl _ hb
#align finset.dvd_lcm Finset.dvd_lcm
@[simp]
theorem lcm_insert [DecidableEq β] {b : β} :
(insert b s : Finset β).lcm f = GCDMonoid.lcm (f b) (s.lcm f) := by
by_cases h : b ∈ s
· rw [insert_eq_of_mem h,
(lcm_eq_right_iff (f b) (s.lcm f) (Multiset.normalize_lcm (s.1.map f))).2 (dvd_lcm h)]
apply fold_insert h
#align finset.lcm_insert Finset.lcm_insert
@[simp]
theorem lcm_singleton {b : β} : ({b} : Finset β).lcm f = normalize (f b) :=
Multiset.lcm_singleton
#align finset.lcm_singleton Finset.lcm_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
theorem normalize_lcm : normalize (s.lcm f) = s.lcm f := by simp [lcm_def]
#align finset.normalize_lcm Finset.normalize_lcm
theorem lcm_union [DecidableEq β] : (s₁ ∪ s₂).lcm f = GCDMonoid.lcm (s₁.lcm f) (s₂.lcm f) :=
Finset.induction_on s₁ (by rw [empty_union, lcm_empty, lcm_one_left, normalize_lcm])
fun a s _ ih ↦ by rw [insert_union, lcm_insert, lcm_insert, ih, lcm_assoc]
#align finset.lcm_union Finset.lcm_union
| Mathlib/Algebra/GCDMonoid/Finset.lean | 100 | 103 | theorem lcm_congr {f g : β → α} (hs : s₁ = s₂) (hfg : ∀ a ∈ s₂, f a = g a) :
s₁.lcm f = s₂.lcm g := by |
subst hs
exact Finset.fold_congr hfg
|
import Mathlib.Order.MinMax
import Mathlib.Data.Set.Subsingleton
import Mathlib.Tactic.Says
#align_import data.set.intervals.basic from "leanprover-community/mathlib"@"3ba15165bd6927679be7c22d6091a87337e3cd0c"
open Function
open OrderDual (toDual ofDual)
variable {α β : Type*}
namespace Set
section Preorder
variable [Preorder α] {a a₁ a₂ b b₁ b₂ c x : α}
def Ioo (a b : α) :=
{ x | a < x ∧ x < b }
#align set.Ioo Set.Ioo
def Ico (a b : α) :=
{ x | a ≤ x ∧ x < b }
#align set.Ico Set.Ico
def Iio (a : α) :=
{ x | x < a }
#align set.Iio Set.Iio
def Icc (a b : α) :=
{ x | a ≤ x ∧ x ≤ b }
#align set.Icc Set.Icc
def Iic (b : α) :=
{ x | x ≤ b }
#align set.Iic Set.Iic
def Ioc (a b : α) :=
{ x | a < x ∧ x ≤ b }
#align set.Ioc Set.Ioc
def Ici (a : α) :=
{ x | a ≤ x }
#align set.Ici Set.Ici
def Ioi (a : α) :=
{ x | a < x }
#align set.Ioi Set.Ioi
theorem Ioo_def (a b : α) : { x | a < x ∧ x < b } = Ioo a b :=
rfl
#align set.Ioo_def Set.Ioo_def
theorem Ico_def (a b : α) : { x | a ≤ x ∧ x < b } = Ico a b :=
rfl
#align set.Ico_def Set.Ico_def
theorem Iio_def (a : α) : { x | x < a } = Iio a :=
rfl
#align set.Iio_def Set.Iio_def
theorem Icc_def (a b : α) : { x | a ≤ x ∧ x ≤ b } = Icc a b :=
rfl
#align set.Icc_def Set.Icc_def
theorem Iic_def (b : α) : { x | x ≤ b } = Iic b :=
rfl
#align set.Iic_def Set.Iic_def
theorem Ioc_def (a b : α) : { x | a < x ∧ x ≤ b } = Ioc a b :=
rfl
#align set.Ioc_def Set.Ioc_def
theorem Ici_def (a : α) : { x | a ≤ x } = Ici a :=
rfl
#align set.Ici_def Set.Ici_def
theorem Ioi_def (a : α) : { x | a < x } = Ioi a :=
rfl
#align set.Ioi_def Set.Ioi_def
@[simp]
theorem mem_Ioo : x ∈ Ioo a b ↔ a < x ∧ x < b :=
Iff.rfl
#align set.mem_Ioo Set.mem_Ioo
@[simp]
theorem mem_Ico : x ∈ Ico a b ↔ a ≤ x ∧ x < b :=
Iff.rfl
#align set.mem_Ico Set.mem_Ico
@[simp]
theorem mem_Iio : x ∈ Iio b ↔ x < b :=
Iff.rfl
#align set.mem_Iio Set.mem_Iio
@[simp]
theorem mem_Icc : x ∈ Icc a b ↔ a ≤ x ∧ x ≤ b :=
Iff.rfl
#align set.mem_Icc Set.mem_Icc
@[simp]
theorem mem_Iic : x ∈ Iic b ↔ x ≤ b :=
Iff.rfl
#align set.mem_Iic Set.mem_Iic
@[simp]
theorem mem_Ioc : x ∈ Ioc a b ↔ a < x ∧ x ≤ b :=
Iff.rfl
#align set.mem_Ioc Set.mem_Ioc
@[simp]
theorem mem_Ici : x ∈ Ici a ↔ a ≤ x :=
Iff.rfl
#align set.mem_Ici Set.mem_Ici
@[simp]
theorem mem_Ioi : x ∈ Ioi a ↔ a < x :=
Iff.rfl
#align set.mem_Ioi Set.mem_Ioi
instance decidableMemIoo [Decidable (a < x ∧ x < b)] : Decidable (x ∈ Ioo a b) := by assumption
#align set.decidable_mem_Ioo Set.decidableMemIoo
instance decidableMemIco [Decidable (a ≤ x ∧ x < b)] : Decidable (x ∈ Ico a b) := by assumption
#align set.decidable_mem_Ico Set.decidableMemIco
instance decidableMemIio [Decidable (x < b)] : Decidable (x ∈ Iio b) := by assumption
#align set.decidable_mem_Iio Set.decidableMemIio
instance decidableMemIcc [Decidable (a ≤ x ∧ x ≤ b)] : Decidable (x ∈ Icc a b) := by assumption
#align set.decidable_mem_Icc Set.decidableMemIcc
instance decidableMemIic [Decidable (x ≤ b)] : Decidable (x ∈ Iic b) := by assumption
#align set.decidable_mem_Iic Set.decidableMemIic
instance decidableMemIoc [Decidable (a < x ∧ x ≤ b)] : Decidable (x ∈ Ioc a b) := by assumption
#align set.decidable_mem_Ioc Set.decidableMemIoc
instance decidableMemIci [Decidable (a ≤ x)] : Decidable (x ∈ Ici a) := by assumption
#align set.decidable_mem_Ici Set.decidableMemIci
instance decidableMemIoi [Decidable (a < x)] : Decidable (x ∈ Ioi a) := by assumption
#align set.decidable_mem_Ioi Set.decidableMemIoi
-- Porting note (#10618): `simp` can prove this
-- @[simp]
| Mathlib/Order/Interval/Set/Basic.lean | 181 | 181 | theorem left_mem_Ioo : a ∈ Ioo a b ↔ False := by | simp [lt_irrefl]
|
import Mathlib.CategoryTheory.Comma.StructuredArrow
import Mathlib.CategoryTheory.PUnit
import Mathlib.CategoryTheory.Functor.ReflectsIso
import Mathlib.CategoryTheory.Functor.EpiMono
#align_import category_theory.over from "leanprover-community/mathlib"@"8a318021995877a44630c898d0b2bc376fceef3b"
namespace CategoryTheory
universe v₁ v₂ u₁ u₂
-- morphism levels before object levels. See note [CategoryTheory universes].
variable {T : Type u₁} [Category.{v₁} T]
def Over (X : T) :=
CostructuredArrow (𝟭 T) X
#align category_theory.over CategoryTheory.Over
instance (X : T) : Category (Over X) := commaCategory
-- Satisfying the inhabited linter
instance Over.inhabited [Inhabited T] : Inhabited (Over (default : T)) where
default :=
{ left := default
right := default
hom := 𝟙 _ }
#align category_theory.over.inhabited CategoryTheory.Over.inhabited
namespace Over
variable {X : T}
@[ext]
| Mathlib/CategoryTheory/Comma/Over.lean | 59 | 63 | theorem OverMorphism.ext {X : T} {U V : Over X} {f g : U ⟶ V} (h : f.left = g.left) : f = g := by |
let ⟨_,b,_⟩ := f
let ⟨_,e,_⟩ := g
congr
simp only [eq_iff_true_of_subsingleton]
|
import Mathlib.NumberTheory.ZetaValues
import Mathlib.NumberTheory.LSeries.RiemannZeta
open Complex Real Set
open scoped Nat
open HurwitzZeta
theorem riemannZeta_two_mul_nat {k : ℕ} (hk : k ≠ 0) :
riemannZeta (2 * k) = (-1) ^ (k + 1) * (2 : ℂ) ^ (2 * k - 1)
* (π : ℂ) ^ (2 * k) * bernoulli (2 * k) / (2 * k)! := by
convert congr_arg ((↑) : ℝ → ℂ) (hasSum_zeta_nat hk).tsum_eq
· rw [← Nat.cast_two, ← Nat.cast_mul, zeta_nat_eq_tsum_of_gt_one (by omega)]
simp only [push_cast]
· norm_cast
#align riemann_zeta_two_mul_nat riemannZeta_two_mul_nat
| Mathlib/NumberTheory/LSeries/HurwitzZetaValues.lean | 220 | 224 | theorem riemannZeta_two : riemannZeta 2 = (π : ℂ) ^ 2 / 6 := by |
convert congr_arg ((↑) : ℝ → ℂ) hasSum_zeta_two.tsum_eq
· rw [← Nat.cast_two, zeta_nat_eq_tsum_of_gt_one one_lt_two]
simp only [push_cast]
· norm_cast
|
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Ideal.Over
import Mathlib.RingTheory.JacobsonIdeal
#align_import ring_theory.jacobson from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
set_option autoImplicit true
universe u
namespace Ideal
open Polynomial
open Polynomial
section IsJacobson
variable {R S : Type*} [CommRing R] [CommRing S] {I : Ideal R}
class IsJacobson (R : Type*) [CommRing R] : Prop where
out' : ∀ I : Ideal R, I.IsRadical → I.jacobson = I
#align ideal.is_jacobson Ideal.IsJacobson
theorem isJacobson_iff {R} [CommRing R] :
IsJacobson R ↔ ∀ I : Ideal R, I.IsRadical → I.jacobson = I :=
⟨fun h => h.1, fun h => ⟨h⟩⟩
#align ideal.is_jacobson_iff Ideal.isJacobson_iff
theorem IsJacobson.out {R} [CommRing R] :
IsJacobson R → ∀ {I : Ideal R}, I.IsRadical → I.jacobson = I :=
isJacobson_iff.1
#align ideal.is_jacobson.out Ideal.IsJacobson.out
theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P := by
refine isJacobson_iff.trans ⟨fun h I hI => h I hI.isRadical, ?_⟩
refine fun h I hI ↦ le_antisymm (fun x hx ↦ ?_) (fun x hx ↦ mem_sInf.mpr fun _ hJ ↦ hJ.left hx)
rw [← hI.radical, radical_eq_sInf I, mem_sInf]
intro P hP
rw [Set.mem_setOf_eq] at hP
erw [mem_sInf] at hx
erw [← h P hP.right, mem_sInf]
exact fun J hJ => hx ⟨le_trans hP.left hJ.left, hJ.right⟩
#align ideal.is_jacobson_iff_prime_eq Ideal.isJacobson_iff_prime_eq
theorem isJacobson_iff_sInf_maximal : IsJacobson R ↔ ∀ {I : Ideal R}, I.IsPrime →
∃ M : Set (Ideal R), (∀ J ∈ M, IsMaximal J ∨ J = ⊤) ∧ I = sInf M :=
⟨fun H _I h => eq_jacobson_iff_sInf_maximal.1 (H.out h.isRadical), fun H =>
isJacobson_iff_prime_eq.2 fun _P hP => eq_jacobson_iff_sInf_maximal.2 (H hP)⟩
#align ideal.is_jacobson_iff_Inf_maximal Ideal.isJacobson_iff_sInf_maximal
theorem isJacobson_iff_sInf_maximal' : IsJacobson R ↔ ∀ {I : Ideal R}, I.IsPrime →
∃ M : Set (Ideal R), (∀ J ∈ M, ∀ (K : Ideal R), J < K → K = ⊤) ∧ I = sInf M :=
⟨fun H _I h => eq_jacobson_iff_sInf_maximal'.1 (H.out h.isRadical), fun H =>
isJacobson_iff_prime_eq.2 fun _P hP => eq_jacobson_iff_sInf_maximal'.2 (H hP)⟩
#align ideal.is_jacobson_iff_Inf_maximal' Ideal.isJacobson_iff_sInf_maximal'
theorem radical_eq_jacobson [H : IsJacobson R] (I : Ideal R) : I.radical = I.jacobson :=
le_antisymm (le_sInf fun _J ⟨hJ, hJ_max⟩ => (IsPrime.radical_le_iff hJ_max.isPrime).mpr hJ)
(H.out (radical_isRadical I) ▸ jacobson_mono le_radical)
#align ideal.radical_eq_jacobson Ideal.radical_eq_jacobson
instance (priority := 100) isJacobson_field {K : Type*} [Field K] : IsJacobson K :=
⟨fun I _ => Or.recOn (eq_bot_or_top I)
(fun h => le_antisymm (sInf_le ⟨le_rfl, h.symm ▸ bot_isMaximal⟩) (h.symm ▸ bot_le)) fun h =>
by rw [h, jacobson_eq_top_iff]⟩
#align ideal.is_jacobson_field Ideal.isJacobson_field
| Mathlib/RingTheory/Jacobson.lean | 108 | 117 | theorem isJacobson_of_surjective [H : IsJacobson R] :
(∃ f : R →+* S, Function.Surjective ↑f) → IsJacobson S := by |
rintro ⟨f, hf⟩
rw [isJacobson_iff_sInf_maximal]
intro p hp
use map f '' { J : Ideal R | comap f p ≤ J ∧ J.IsMaximal }
use fun j ⟨J, hJ, hmap⟩ => hmap ▸ (map_eq_top_or_isMaximal_of_surjective f hf hJ.right).symm
have : p = map f (comap f p).jacobson :=
(IsJacobson.out' _ <| hp.isRadical.comap f).symm ▸ (map_comap_of_surjective f hf p).symm
exact this.trans (map_sInf hf fun J ⟨hJ, _⟩ => le_trans (Ideal.ker_le_comap f) hJ)
|
import Mathlib.GroupTheory.Subgroup.Center
import Mathlib.GroupTheory.Submonoid.Centralizer
#align_import group_theory.subgroup.basic from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef"
open Function
open Int
variable {G : Type*} [Group G]
namespace Subgroup
variable {H K : Subgroup G}
@[to_additive
"The `centralizer` of `H` is the additive subgroup of `g : G` commuting with every `h : H`."]
def centralizer (s : Set G) : Subgroup G :=
{ Submonoid.centralizer s with
carrier := Set.centralizer s
inv_mem' := Set.inv_mem_centralizer }
#align subgroup.centralizer Subgroup.centralizer
#align add_subgroup.centralizer AddSubgroup.centralizer
@[to_additive]
theorem mem_centralizer_iff {g : G} {s : Set G} : g ∈ centralizer s ↔ ∀ h ∈ s, h * g = g * h :=
Iff.rfl
#align subgroup.mem_centralizer_iff Subgroup.mem_centralizer_iff
#align add_subgroup.mem_centralizer_iff AddSubgroup.mem_centralizer_iff
@[to_additive]
| Mathlib/GroupTheory/Subgroup/Centralizer.lean | 42 | 44 | theorem mem_centralizer_iff_commutator_eq_one {g : G} {s : Set G} :
g ∈ centralizer s ↔ ∀ h ∈ s, h * g * h⁻¹ * g⁻¹ = 1 := by |
simp only [mem_centralizer_iff, mul_inv_eq_iff_eq_mul, one_mul]
|
import Mathlib.AlgebraicTopology.DoldKan.FunctorGamma
import Mathlib.AlgebraicTopology.DoldKan.SplitSimplicialObject
import Mathlib.CategoryTheory.Idempotents.HomologicalComplex
#align_import algebraic_topology.dold_kan.gamma_comp_n from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504"
noncomputable section
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits
CategoryTheory.Idempotents Opposite SimplicialObject Simplicial
namespace AlgebraicTopology
namespace DoldKan
variable {C : Type*} [Category C] [Preadditive C] [HasFiniteCoproducts C]
@[simps!]
def Γ₀NondegComplexIso (K : ChainComplex C ℕ) : (Γ₀.splitting K).nondegComplex ≅ K :=
HomologicalComplex.Hom.isoOfComponents (fun n => Iso.refl _)
(by
rintro _ n (rfl : n + 1 = _)
dsimp
simp only [id_comp, comp_id, AlternatingFaceMapComplex.obj_d_eq, Preadditive.sum_comp,
Preadditive.comp_sum]
rw [Fintype.sum_eq_single (0 : Fin (n + 2))]
· simp only [Fin.val_zero, pow_zero, one_zsmul]
erw [Γ₀.Obj.mapMono_on_summand_id_assoc, Γ₀.Obj.Termwise.mapMono_δ₀,
Splitting.cofan_inj_πSummand_eq_id, comp_id]
· intro i hi
dsimp
simp only [Preadditive.zsmul_comp, Preadditive.comp_zsmul, assoc]
erw [Γ₀.Obj.mapMono_on_summand_id_assoc, Γ₀.Obj.Termwise.mapMono_eq_zero, zero_comp,
zsmul_zero]
· intro h
replace h := congr_arg SimplexCategory.len h
change n + 1 = n at h
omega
· simpa only [Isδ₀.iff] using hi)
#align algebraic_topology.dold_kan.Γ₀_nondeg_complex_iso AlgebraicTopology.DoldKan.Γ₀NondegComplexIso
def Γ₀'CompNondegComplexFunctor : Γ₀' ⋙ Split.nondegComplexFunctor ≅ 𝟭 (ChainComplex C ℕ) :=
NatIso.ofComponents Γ₀NondegComplexIso
#align algebraic_topology.dold_kan.Γ₀'_comp_nondeg_complex_functor AlgebraicTopology.DoldKan.Γ₀'CompNondegComplexFunctor
def N₁Γ₀ : Γ₀ ⋙ N₁ ≅ toKaroubi (ChainComplex C ℕ) :=
calc
Γ₀ ⋙ N₁ ≅ Γ₀' ⋙ Split.forget C ⋙ N₁ := Functor.associator _ _ _
_ ≅ Γ₀' ⋙ Split.nondegComplexFunctor ⋙ toKaroubi _ :=
(isoWhiskerLeft Γ₀' Split.toKaroubiNondegComplexFunctorIsoN₁.symm)
_ ≅ (Γ₀' ⋙ Split.nondegComplexFunctor) ⋙ toKaroubi _ := (Functor.associator _ _ _).symm
_ ≅ 𝟭 _ ⋙ toKaroubi (ChainComplex C ℕ) := isoWhiskerRight Γ₀'CompNondegComplexFunctor _
_ ≅ toKaroubi (ChainComplex C ℕ) := Functor.leftUnitor _
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.N₁Γ₀ AlgebraicTopology.DoldKan.N₁Γ₀
theorem N₁Γ₀_app (K : ChainComplex C ℕ) :
N₁Γ₀.app K = (Γ₀.splitting K).toKaroubiNondegComplexIsoN₁.symm ≪≫
(toKaroubi _).mapIso (Γ₀NondegComplexIso K) := by
ext1
dsimp [N₁Γ₀]
erw [id_comp, comp_id, comp_id]
rfl
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.N₁Γ₀_app AlgebraicTopology.DoldKan.N₁Γ₀_app
theorem N₁Γ₀_hom_app (K : ChainComplex C ℕ) :
N₁Γ₀.hom.app K = (Γ₀.splitting K).toKaroubiNondegComplexIsoN₁.inv ≫
(toKaroubi _).map (Γ₀NondegComplexIso K).hom := by
change (N₁Γ₀.app K).hom = _
simp only [N₁Γ₀_app]
rfl
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.N₁Γ₀_hom_app AlgebraicTopology.DoldKan.N₁Γ₀_hom_app
theorem N₁Γ₀_inv_app (K : ChainComplex C ℕ) :
N₁Γ₀.inv.app K = (toKaroubi _).map (Γ₀NondegComplexIso K).inv ≫
(Γ₀.splitting K).toKaroubiNondegComplexIsoN₁.hom := by
change (N₁Γ₀.app K).inv = _
simp only [N₁Γ₀_app]
rfl
set_option linter.uppercaseLean3 false in
#align algebraic_topology.dold_kan.N₁Γ₀_inv_app AlgebraicTopology.DoldKan.N₁Γ₀_inv_app
@[simp]
| Mathlib/AlgebraicTopology/DoldKan/GammaCompN.lean | 105 | 108 | theorem N₁Γ₀_hom_app_f_f (K : ChainComplex C ℕ) (n : ℕ) :
(N₁Γ₀.hom.app K).f.f n = (Γ₀.splitting K).toKaroubiNondegComplexIsoN₁.inv.f.f n := by |
rw [N₁Γ₀_hom_app]
apply comp_id
|
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 Pullback
variable {C : Type u₁} [Category.{v₁} C]
variable {D : Type u₂} [Category.{v₂} D]
variable (G : C ⥤ D)
variable {W X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} {h : W ⟶ X} {k : W ⟶ Y} (comm : h ≫ f = k ≫ g)
def isLimitMapConePullbackConeEquiv :
IsLimit (mapCone G (PullbackCone.mk h k comm)) ≃
IsLimit
(PullbackCone.mk (G.map h) (G.map k) (by simp only [← G.map_comp, comm]) :
PullbackCone (G.map f) (G.map g)) :=
(IsLimit.postcomposeHomEquiv (diagramIsoCospan.{v₂} _) _).symm.trans <|
IsLimit.equivIsoLimit <|
Cones.ext (Iso.refl _) <| by
rintro (_ | _ | _) <;> dsimp <;> simp only [comp_id, id_comp, G.map_comp]
#align category_theory.limits.is_limit_map_cone_pullback_cone_equiv CategoryTheory.Limits.isLimitMapConePullbackConeEquiv
def isLimitPullbackConeMapOfIsLimit [PreservesLimit (cospan f g) G]
(l : IsLimit (PullbackCone.mk h k comm)) :
have : G.map h ≫ G.map f = G.map k ≫ G.map g := by rw [← G.map_comp, ← G.map_comp,comm]
IsLimit (PullbackCone.mk (G.map h) (G.map k) this) :=
isLimitMapConePullbackConeEquiv G comm (PreservesLimit.preserves l)
#align category_theory.limits.is_limit_pullback_cone_map_of_is_limit CategoryTheory.Limits.isLimitPullbackConeMapOfIsLimit
def isLimitOfIsLimitPullbackConeMap [ReflectsLimit (cospan f g) G]
(l : IsLimit (PullbackCone.mk (G.map h) (G.map k) (show G.map h ≫ G.map f = G.map k ≫ G.map g
from by simp only [← G.map_comp,comm]))) : IsLimit (PullbackCone.mk h k comm) :=
ReflectsLimit.reflects ((isLimitMapConePullbackConeEquiv G comm).symm l)
#align category_theory.limits.is_limit_of_is_limit_pullback_cone_map CategoryTheory.Limits.isLimitOfIsLimitPullbackConeMap
variable (f g) [PreservesLimit (cospan f g) G]
def isLimitOfHasPullbackOfPreservesLimit [i : HasPullback f g] :
have : G.map pullback.fst ≫ G.map f = G.map pullback.snd ≫ G.map g := by
simp only [← G.map_comp, pullback.condition];
IsLimit (PullbackCone.mk (G.map (@pullback.fst _ _ _ _ _ f g i)) (G.map pullback.snd) this) :=
isLimitPullbackConeMapOfIsLimit G _ (pullbackIsPullback f g)
#align category_theory.limits.is_limit_of_has_pullback_of_preserves_limit CategoryTheory.Limits.isLimitOfHasPullbackOfPreservesLimit
def preservesPullbackSymmetry : PreservesLimit (cospan g f) G where
preserves {c} hc := by
apply (IsLimit.postcomposeHomEquiv (diagramIsoCospan.{v₂} _) _).toFun
apply IsLimit.ofIsoLimit _ (PullbackCone.isoMk _).symm
apply PullbackCone.isLimitOfFlip
apply (isLimitMapConePullbackConeEquiv _ _).toFun
· refine @PreservesLimit.preserves _ _ _ _ _ _ _ _ ?_ _ ?_
· dsimp
infer_instance
apply PullbackCone.isLimitOfFlip
apply IsLimit.ofIsoLimit _ (PullbackCone.isoMk _)
exact (IsLimit.postcomposeHomEquiv (diagramIsoCospan.{v₁} _) _).invFun hc
· exact
(c.π.naturality WalkingCospan.Hom.inr).symm.trans
(c.π.naturality WalkingCospan.Hom.inl : _)
#align category_theory.limits.preserves_pullback_symmetry CategoryTheory.Limits.preservesPullbackSymmetry
theorem hasPullback_of_preservesPullback [HasPullback f g] : HasPullback (G.map f) (G.map g) :=
⟨⟨⟨_, isLimitPullbackConeMapOfIsLimit G _ (pullbackIsPullback _ _)⟩⟩⟩
#align category_theory.limits.has_pullback_of_preserves_pullback CategoryTheory.Limits.hasPullback_of_preservesPullback
variable [HasPullback f g] [HasPullback (G.map f) (G.map g)]
def PreservesPullback.iso : G.obj (pullback f g) ≅ pullback (G.map f) (G.map g) :=
IsLimit.conePointUniqueUpToIso (isLimitOfHasPullbackOfPreservesLimit G f g) (limit.isLimit _)
#align category_theory.limits.preserves_pullback.iso CategoryTheory.Limits.PreservesPullback.iso
@[simp]
theorem PreservesPullback.iso_hom : (PreservesPullback.iso G f g).hom = pullbackComparison G f g :=
rfl
#align category_theory.limits.preserves_pullback.iso_hom CategoryTheory.Limits.PreservesPullback.iso_hom
@[reassoc]
theorem PreservesPullback.iso_hom_fst :
(PreservesPullback.iso G f g).hom ≫ pullback.fst = G.map pullback.fst := by
simp [PreservesPullback.iso]
#align category_theory.limits.preserves_pullback.iso_hom_fst CategoryTheory.Limits.PreservesPullback.iso_hom_fst
@[reassoc]
theorem PreservesPullback.iso_hom_snd :
(PreservesPullback.iso G f g).hom ≫ pullback.snd = G.map pullback.snd := by
simp [PreservesPullback.iso]
#align category_theory.limits.preserves_pullback.iso_hom_snd CategoryTheory.Limits.PreservesPullback.iso_hom_snd
@[reassoc (attr := simp)]
| Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean | 132 | 134 | theorem PreservesPullback.iso_inv_fst :
(PreservesPullback.iso G f g).inv ≫ G.map pullback.fst = pullback.fst := by |
simp [PreservesPullback.iso, Iso.inv_comp_eq]
|
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] {f : α → β}
variable {s : Set β} {ι : Type*} {U : ι → Opens β} (hU : iSup U = ⊤)
theorem Set.restrictPreimage_inducing (s : Set β) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by
simp_rw [← inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, ← @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h ⊢
intro a
rw [← h, ← inducing_subtype_val.nhds_eq_comap]
#align set.restrict_preimage_inducing Set.restrictPreimage_inducing
alias Inducing.restrictPreimage := Set.restrictPreimage_inducing
#align inducing.restrict_preimage Inducing.restrictPreimage
theorem Set.restrictPreimage_embedding (s : Set β) (h : Embedding f) :
Embedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s, h.2.restrictPreimage s⟩
#align set.restrict_preimage_embedding Set.restrictPreimage_embedding
alias Embedding.restrictPreimage := Set.restrictPreimage_embedding
#align embedding.restrict_preimage Embedding.restrictPreimage
theorem Set.restrictPreimage_openEmbedding (s : Set β) (h : OpenEmbedding f) :
OpenEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ continuous_subtype_val.isOpen_preimage _ h.isOpen_range⟩
#align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding
alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding
#align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage
theorem Set.restrictPreimage_closedEmbedding (s : Set β) (h : ClosedEmbedding f) :
ClosedEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ inducing_subtype_val.isClosed_preimage _ h.isClosed_range⟩
#align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding
alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding
#align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage
theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set β) :
IsClosedMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsClosed u → Subtype.val ⁻¹' u = t →
∃ v, IsClosed v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isClosed_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set β) (H : IsClosedMap f) :
IsClosedMap (s.restrictPreimage f) := H.restrictPreimage s
| Mathlib/Topology/LocalAtTarget.lean | 78 | 84 | theorem IsOpenMap.restrictPreimage (H : IsOpenMap f) (s : Set β) :
IsOpenMap (s.restrictPreimage f) := by |
intro t
suffices ∀ u, IsOpen u → Subtype.val ⁻¹' u = t →
∃ v, IsOpen v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isOpen_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
|
import Mathlib.Data.Real.Irrational
import Mathlib.Data.Rat.Encodable
import Mathlib.Topology.GDelta
#align_import topology.instances.irrational from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Set Filter Metric
open Filter Topology
protected theorem IsGδ.setOf_irrational : IsGδ { x | Irrational x } :=
(countable_range _).isGδ_compl
set_option linter.uppercaseLean3 false in
#align is_Gδ_irrational IsGδ.setOf_irrational
@[deprecated (since := "2024-02-15")] alias isGδ_irrational := IsGδ.setOf_irrational
theorem dense_irrational : Dense { x : ℝ | Irrational x } := by
refine Real.isTopologicalBasis_Ioo_rat.dense_iff.2 ?_
simp only [gt_iff_lt, Rat.cast_lt, not_lt, ge_iff_le, Rat.cast_le, mem_iUnion, mem_singleton_iff,
exists_prop, forall_exists_index, and_imp]
rintro _ a b hlt rfl _
rw [inter_comm]
exact exists_irrational_btwn (Rat.cast_lt.2 hlt)
#align dense_irrational dense_irrational
theorem eventually_residual_irrational : ∀ᶠ x in residual ℝ, Irrational x :=
residual_of_dense_Gδ .setOf_irrational dense_irrational
#align eventually_residual_irrational eventually_residual_irrational
namespace Irrational
variable {x : ℝ}
instance : OrderTopology { x // Irrational x } :=
induced_orderTopology _ Iff.rfl <| @fun _ _ hlt =>
let ⟨z, hz, hxz, hzy⟩ := exists_irrational_btwn hlt
⟨⟨z, hz⟩, hxz, hzy⟩
instance : NoMaxOrder { x // Irrational x } :=
⟨fun ⟨x, hx⟩ => ⟨⟨x + (1 : ℕ), hx.add_nat 1⟩, by simp⟩⟩
instance : NoMinOrder { x // Irrational x } :=
⟨fun ⟨x, hx⟩ => ⟨⟨x - (1 : ℕ), hx.sub_nat 1⟩, by simp⟩⟩
instance : DenselyOrdered { x // Irrational x } :=
⟨fun _ _ hlt =>
let ⟨z, hz, hxz, hzy⟩ := exists_irrational_btwn hlt
⟨⟨z, hz⟩, hxz, hzy⟩⟩
| Mathlib/Topology/Instances/Irrational.lean | 78 | 89 | theorem eventually_forall_le_dist_cast_div (hx : Irrational x) (n : ℕ) :
∀ᶠ ε : ℝ in 𝓝 0, ∀ m : ℤ, ε ≤ dist x (m / n) := by |
have A : IsClosed (range (fun m => (n : ℝ)⁻¹ * m : ℤ → ℝ)) :=
((isClosedMap_smul₀ (n⁻¹ : ℝ)).comp Int.closedEmbedding_coe_real.isClosedMap).isClosed_range
have B : x ∉ range (fun m => (n : ℝ)⁻¹ * m : ℤ → ℝ) := by
rintro ⟨m, rfl⟩
simp at hx
rcases Metric.mem_nhds_iff.1 (A.isOpen_compl.mem_nhds B) with ⟨ε, ε0, hε⟩
refine (ge_mem_nhds ε0).mono fun δ hδ m => not_lt.1 fun hlt => ?_
rw [dist_comm] at hlt
refine hε (ball_subset_ball hδ hlt) ⟨m, ?_⟩
simp [div_eq_inv_mul]
|
import Mathlib.Analysis.Analytic.Linear
import Mathlib.Analysis.Analytic.Composition
import Mathlib.Analysis.NormedSpace.Completion
#align_import analysis.analytic.uniqueness from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090"
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E]
[NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
open Set
open scoped Topology ENNReal
namespace AnalyticOn
| Mathlib/Analysis/Analytic/Uniqueness.lean | 32 | 70 | theorem eqOn_zero_of_preconnected_of_eventuallyEq_zero_aux [CompleteSpace F] {f : E → F} {U : Set E}
(hf : AnalyticOn 𝕜 f U) (hU : IsPreconnected U) {z₀ : E} (h₀ : z₀ ∈ U) (hfz₀ : f =ᶠ[𝓝 z₀] 0) :
EqOn f 0 U := by |
/- Let `u` be the set of points around which `f` vanishes. It is clearly open. We have to show
that its limit points in `U` still belong to it, from which the inclusion `U ⊆ u` will follow
by connectedness. -/
let u := {x | f =ᶠ[𝓝 x] 0}
suffices main : closure u ∩ U ⊆ u by
have Uu : U ⊆ u :=
hU.subset_of_closure_inter_subset isOpen_setOf_eventually_nhds ⟨z₀, h₀, hfz₀⟩ main
intro z hz
simpa using mem_of_mem_nhds (Uu hz)
/- Take a limit point `x`, then a ball `B (x, r)` on which it has a power series expansion, and
then `y ∈ B (x, r/2) ∩ u`. Then `f` has a power series expansion on `B (y, r/2)` as it is
contained in `B (x, r)`. All the coefficients in this series expansion vanish, as `f` is zero
on a neighborhood of `y`. Therefore, `f` is zero on `B (y, r/2)`. As this ball contains `x`,
it follows that `f` vanishes on a neighborhood of `x`, proving the claim. -/
rintro x ⟨xu, xU⟩
rcases hf x xU with ⟨p, r, hp⟩
obtain ⟨y, yu, hxy⟩ : ∃ y ∈ u, edist x y < r / 2 :=
EMetric.mem_closure_iff.1 xu (r / 2) (ENNReal.half_pos hp.r_pos.ne')
let q := p.changeOrigin (y - x)
have has_series : HasFPowerSeriesOnBall f q y (r / 2) := by
have A : (‖y - x‖₊ : ℝ≥0∞) < r / 2 := by rwa [edist_comm, edist_eq_coe_nnnorm_sub] at hxy
have := hp.changeOrigin (A.trans_le ENNReal.half_le_self)
simp only [add_sub_cancel] at this
apply this.mono (ENNReal.half_pos hp.r_pos.ne')
apply ENNReal.le_sub_of_add_le_left ENNReal.coe_ne_top
apply (add_le_add A.le (le_refl (r / 2))).trans (le_of_eq _)
exact ENNReal.add_halves _
have M : EMetric.ball y (r / 2) ∈ 𝓝 x := EMetric.isOpen_ball.mem_nhds hxy
filter_upwards [M] with z hz
have A : HasSum (fun n : ℕ => q n fun _ : Fin n => z - y) (f z) := has_series.hasSum_sub hz
have B : HasSum (fun n : ℕ => q n fun _ : Fin n => z - y) 0 := by
have : HasFPowerSeriesAt 0 q y := has_series.hasFPowerSeriesAt.congr yu
convert hasSum_zero (α := F) using 2
ext n
exact this.apply_eq_zero n _
exact HasSum.unique A B
|
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {α : Type*}
namespace Coheyting
variable [CoheytingAlgebra α] {a b : α}
def boundary (a : α) : α :=
a ⊓ ¬a
#align coheyting.boundary Coheyting.boundary
scoped[Heyting] prefix:120 "∂ " => Coheyting.boundary
-- Porting note: Should the notation be automatically included in the current scope?
open Heyting
-- Porting note: Should hnot be named hNot?
theorem inf_hnot_self (a : α) : a ⊓ ¬a = ∂ a :=
rfl
#align coheyting.inf_hnot_self Coheyting.inf_hnot_self
theorem boundary_le : ∂ a ≤ a :=
inf_le_left
#align coheyting.boundary_le Coheyting.boundary_le
theorem boundary_le_hnot : ∂ a ≤ ¬a :=
inf_le_right
#align coheyting.boundary_le_hnot Coheyting.boundary_le_hnot
@[simp]
theorem boundary_bot : ∂ (⊥ : α) = ⊥ := bot_inf_eq _
#align coheyting.boundary_bot Coheyting.boundary_bot
@[simp]
theorem boundary_top : ∂ (⊤ : α) = ⊥ := by rw [boundary, hnot_top, inf_bot_eq]
#align coheyting.boundary_top Coheyting.boundary_top
theorem boundary_hnot_le (a : α) : ∂ (¬a) ≤ ∂ a :=
(inf_comm _ _).trans_le <| inf_le_inf_right _ hnot_hnot_le
#align coheyting.boundary_hnot_le Coheyting.boundary_hnot_le
@[simp]
theorem boundary_hnot_hnot (a : α) : ∂ (¬¬a) = ∂ (¬a) := by
simp_rw [boundary, hnot_hnot_hnot, inf_comm]
#align coheyting.boundary_hnot_hnot Coheyting.boundary_hnot_hnot
@[simp]
theorem hnot_boundary (a : α) : ¬∂ a = ⊤ := by rw [boundary, hnot_inf_distrib, sup_hnot_self]
#align coheyting.hnot_boundary Coheyting.hnot_boundary
theorem boundary_inf (a b : α) : ∂ (a ⊓ b) = ∂ a ⊓ b ⊔ a ⊓ ∂ b := by
unfold boundary
rw [hnot_inf_distrib, inf_sup_left, inf_right_comm, ← inf_assoc]
#align coheyting.boundary_inf Coheyting.boundary_inf
theorem boundary_inf_le : ∂ (a ⊓ b) ≤ ∂ a ⊔ ∂ b :=
(boundary_inf _ _).trans_le <| sup_le_sup inf_le_left inf_le_right
#align coheyting.boundary_inf_le Coheyting.boundary_inf_le
theorem boundary_sup_le : ∂ (a ⊔ b) ≤ ∂ a ⊔ ∂ b := by
rw [boundary, inf_sup_right]
exact
sup_le_sup (inf_le_inf_left _ <| hnot_anti le_sup_left)
(inf_le_inf_left _ <| hnot_anti le_sup_right)
#align coheyting.boundary_sup_le Coheyting.boundary_sup_le
example (a b : Prop) : (a ∧ b ∨ ¬(a ∧ b)) ∧ ((a ∨ b) ∨ ¬(a ∨ b)) → a ∨ ¬a := by
rintro ⟨⟨ha, _⟩ | hnab, (ha | hb) | hnab⟩ <;> try exact Or.inl ha
· exact Or.inr fun ha => hnab ⟨ha, hb⟩
· exact Or.inr fun ha => hnab <| Or.inl ha
theorem boundary_le_boundary_sup_sup_boundary_inf_left : ∂ a ≤ ∂ (a ⊔ b) ⊔ ∂ (a ⊓ b) := by
-- Porting note: the following simp generates the same term as mathlib3 if you remove
-- sup_inf_right from both. With sup_inf_right included, mathlib4 and mathlib3 generate
-- different terms
simp only [boundary, sup_inf_left, sup_inf_right, sup_right_idem, le_inf_iff, sup_assoc,
sup_comm _ a]
refine ⟨⟨⟨?_, ?_⟩, ⟨?_, ?_⟩⟩, ?_, ?_⟩ <;> try { exact le_sup_of_le_left inf_le_left } <;>
refine inf_le_of_right_le ?_
· rw [hnot_le_iff_codisjoint_right, codisjoint_left_comm]
exact codisjoint_hnot_left
· refine le_sup_of_le_right ?_
rw [hnot_le_iff_codisjoint_right]
exact codisjoint_hnot_right.mono_right (hnot_anti inf_le_left)
#align coheyting.boundary_le_boundary_sup_sup_boundary_inf_left Coheyting.boundary_le_boundary_sup_sup_boundary_inf_left
| Mathlib/Order/Heyting/Boundary.lean | 120 | 122 | theorem boundary_le_boundary_sup_sup_boundary_inf_right : ∂ b ≤ ∂ (a ⊔ b) ⊔ ∂ (a ⊓ b) := by |
rw [sup_comm a, inf_comm]
exact boundary_le_boundary_sup_sup_boundary_inf_left
|
import Mathlib.Analysis.SpecialFunctions.Integrals
import Mathlib.Analysis.SumIntegralComparisons
import Mathlib.NumberTheory.Harmonic.Defs
| Mathlib/NumberTheory/Harmonic/Bounds.lean | 17 | 24 | theorem log_add_one_le_harmonic (n : ℕ) :
Real.log ↑(n+1) ≤ harmonic n := by |
calc _ = ∫ x in (1:ℕ)..↑(n+1), x⁻¹ := ?_
_ ≤ ∑ d ∈ Finset.Icc 1 n, (d:ℝ)⁻¹ := ?_
_ = harmonic n := ?_
· rw [Nat.cast_one, integral_inv (by simp [(show ¬ (1 : ℝ) ≤ 0 by norm_num)]), div_one]
· exact (inv_antitoneOn_Icc_right <| by norm_num).integral_le_sum_Ico (Nat.le_add_left 1 n)
· simp only [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast]
|
import Mathlib.Algebra.Group.Defs
import Mathlib.Logic.Relation
#align_import algebra.homology.complex_shape from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23"
noncomputable section
open scoped Classical
@[ext]
structure ComplexShape (ι : Type*) where
Rel : ι → ι → Prop
next_eq : ∀ {i j j'}, Rel i j → Rel i j' → j = j'
prev_eq : ∀ {i i' j}, Rel i j → Rel i' j → i = i'
#align complex_shape ComplexShape
#align complex_shape.ext ComplexShape.ext
#align complex_shape.ext_iff ComplexShape.ext_iff
namespace ComplexShape
variable {ι : Type*}
@[simps]
def refl (ι : Type*) : ComplexShape ι where
Rel i j := i = j
next_eq w w' := w.symm.trans w'
prev_eq w w' := w.trans w'.symm
#align complex_shape.refl ComplexShape.refl
#align complex_shape.refl_rel ComplexShape.refl_Rel
@[simps]
def symm (c : ComplexShape ι) : ComplexShape ι where
Rel i j := c.Rel j i
next_eq w w' := c.prev_eq w w'
prev_eq w w' := c.next_eq w w'
#align complex_shape.symm ComplexShape.symm
#align complex_shape.symm_rel ComplexShape.symm_Rel
@[simp]
| Mathlib/Algebra/Homology/ComplexShape.lean | 100 | 102 | theorem symm_symm (c : ComplexShape ι) : c.symm.symm = c := by |
ext
simp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.