Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k | goals listlengths 0 224 | goals_before listlengths 0 220 |
|---|---|---|---|---|---|---|---|
import Mathlib.Data.Set.Pointwise.Basic
import Mathlib.Data.Set.MulAntidiagonal
#align_import data.finset.mul_antidiagonal from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
namespace Finset
open Pointwise
variable {Ξ± : Type*}
variable [OrderedCancelCommMonoid Ξ±] {s t : Set Ξ±} (hs : s.IsPWO) (ht : t.IsPWO) (a : Ξ±)
@[to_additive "`Finset.addAntidiagonal hs ht a` is the set of all pairs of an element in
`s` and an element in `t` that add to `a`, but its construction requires proofs that `s` and `t` are
well-ordered."]
noncomputable def mulAntidiagonal : Finset (Ξ± Γ Ξ±) :=
(Set.MulAntidiagonal.finite_of_isPWO hs ht a).toFinset
#align finset.mul_antidiagonal Finset.mulAntidiagonal
#align finset.add_antidiagonal Finset.addAntidiagonal
variable {hs ht a} {u : Set Ξ±} {hu : u.IsPWO} {x : Ξ± Γ Ξ±}
@[to_additive (attr := simp)]
| Mathlib/Data/Finset/MulAntidiagonal.lean | 72 | 73 | theorem mem_mulAntidiagonal : x β mulAntidiagonal hs ht a β x.1 β s β§ x.2 β t β§ x.1 * x.2 = a := by |
simp only [mulAntidiagonal, Set.Finite.mem_toFinset, Set.mem_mulAntidiagonal]
| [
" x β mulAntidiagonal hs ht a β x.1 β s β§ x.2 β t β§ x.1 * x.2 = a"
] | [] |
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals
import Mathlib.Analysis.Calculus.ParametricIntegral
import Mathlib.MeasureTheory.Measure.Haar.NormedSpace
#align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb"
open MeasureTheory Set Filter Asymptotics TopologicalSpace
open Real
open Complex hiding exp log abs_of_nonneg
open scoped Topology
noncomputable section
section Defs
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E]
def MellinConvergent (f : β β E) (s : β) : Prop :=
IntegrableOn (fun t : β => (t : β) ^ (s - 1) β’ f t) (Ioi 0)
#align mellin_convergent MellinConvergent
theorem MellinConvergent.const_smul {f : β β E} {s : β} (hf : MellinConvergent f s) {π : Type*}
[NontriviallyNormedField π] [NormedSpace π E] [SMulCommClass β π E] (c : π) :
MellinConvergent (fun t => c β’ f t) s := by
simpa only [MellinConvergent, smul_comm] using hf.smul c
#align mellin_convergent.const_smul MellinConvergent.const_smul
theorem MellinConvergent.cpow_smul {f : β β E} {s a : β} :
MellinConvergent (fun t => (t : β) ^ a β’ f t) s β MellinConvergent f (s + a) := by
refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi
simp_rw [β sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul]
#align mellin_convergent.cpow_smul MellinConvergent.cpow_smul
nonrec theorem MellinConvergent.div_const {f : β β β} {s : β} (hf : MellinConvergent f s) (a : β) :
MellinConvergent (fun t => f t / a) s := by
simpa only [MellinConvergent, smul_eq_mul, β mul_div_assoc] using hf.div_const a
#align mellin_convergent.div_const MellinConvergent.div_const
| Mathlib/Analysis/MellinTransform.lean | 64 | 75 | theorem MellinConvergent.comp_mul_left {f : β β E} {s : β} {a : β} (ha : 0 < a) :
MellinConvergent (fun t => f (a * t)) s β MellinConvergent f s := by |
have := integrableOn_Ioi_comp_mul_left_iff (fun t : β => (t : β) ^ (s - 1) β’ f t) 0 ha
rw [mul_zero] at this
have h1 : EqOn (fun t : β => (β(a * t) : β) ^ (s - 1) β’ f (a * t))
((a : β) ^ (s - 1) β’ fun t : β => (t : β) ^ (s - 1) β’ f (a * t)) (Ioi 0) := fun t ht β¦ by
simp only [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), mul_smul, Pi.smul_apply]
have h2 : (a : β) ^ (s - 1) β 0 := by
rw [Ne, cpow_eq_zero_iff, not_and_or, ofReal_eq_zero]
exact Or.inl ha.ne'
rw [MellinConvergent, MellinConvergent, β this, integrableOn_congr_fun h1 measurableSet_Ioi,
IntegrableOn, IntegrableOn, integrable_smul_iff h2]
| [
" MellinConvergent (fun t => c β’ f t) s",
" MellinConvergent (fun t => βt ^ a β’ f t) s β MellinConvergent f (s + a)",
" βt ^ (s - 1) β’ (fun t => βt ^ a β’ f t) t = βt ^ (s + a - 1) β’ f t",
" MellinConvergent (fun t => f t / a) s",
" MellinConvergent (fun t => f (a * t)) s β MellinConvergent f s",
" (fun t ... | [
" MellinConvergent (fun t => c β’ f t) s",
" MellinConvergent (fun t => βt ^ a β’ f t) s β MellinConvergent f (s + a)",
" βt ^ (s - 1) β’ (fun t => βt ^ a β’ f t) t = βt ^ (s + a - 1) β’ f t",
" MellinConvergent (fun t => f t / a) s"
] |
import Mathlib.RingTheory.HahnSeries.Multiplication
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.Data.Finsupp.PWO
#align_import ring_theory.hahn_series from "leanprover-community/mathlib"@"a484a7d0eade4e1268f4fb402859b6686037f965"
set_option linter.uppercaseLean3 false
open Finset Function
open scoped Classical
open Pointwise Polynomial
noncomputable section
variable {Ξ : Type*} {R : Type*}
namespace HahnSeries
section Semiring
variable [Semiring R]
@[simps]
def toPowerSeries : HahnSeries β R β+* PowerSeries R where
toFun f := PowerSeries.mk f.coeff
invFun f := β¨fun n => PowerSeries.coeff R n f, (Nat.lt_wfRel.wf.isWF _).isPWOβ©
left_inv f := by
ext
simp
right_inv f := by
ext
simp
map_add' f g := by
ext
simp
map_mul' f g := by
ext n
simp only [PowerSeries.coeff_mul, PowerSeries.coeff_mk, mul_coeff, isPWO_support]
classical
refine (sum_filter_ne_zero _).symm.trans <| (sum_congr ?_ fun _ _ β¦ rfl).trans <|
sum_filter_ne_zero _
ext m
simp only [mem_antidiagonal, mem_addAntidiagonal, and_congr_left_iff, mem_filter,
mem_support]
rintro h
rw [and_iff_right (left_ne_zero_of_mul h), and_iff_right (right_ne_zero_of_mul h)]
#align hahn_series.to_power_series HahnSeries.toPowerSeries
theorem coeff_toPowerSeries {f : HahnSeries β R} {n : β} :
PowerSeries.coeff R n (toPowerSeries f) = f.coeff n :=
PowerSeries.coeff_mk _ _
#align hahn_series.coeff_to_power_series HahnSeries.coeff_toPowerSeries
theorem coeff_toPowerSeries_symm {f : PowerSeries R} {n : β} :
(HahnSeries.toPowerSeries.symm f).coeff n = PowerSeries.coeff R n f :=
rfl
#align hahn_series.coeff_to_power_series_symm HahnSeries.coeff_toPowerSeries_symm
variable (Ξ R) [StrictOrderedSemiring Ξ]
def ofPowerSeries : PowerSeries R β+* HahnSeries Ξ R :=
(HahnSeries.embDomainRingHom (Nat.castAddMonoidHom Ξ) Nat.strictMono_cast.injective fun _ _ =>
Nat.cast_le).comp
(RingEquiv.toRingHom toPowerSeries.symm)
#align hahn_series.of_power_series HahnSeries.ofPowerSeries
variable {Ξ} {R}
theorem ofPowerSeries_injective : Function.Injective (ofPowerSeries Ξ R) :=
embDomain_injective.comp toPowerSeries.symm.injective
#align hahn_series.of_power_series_injective HahnSeries.ofPowerSeries_injective
theorem ofPowerSeries_apply (x : PowerSeries R) :
ofPowerSeries Ξ R x =
HahnSeries.embDomain
β¨β¨((β) : β β Ξ), Nat.strictMono_cast.injectiveβ©, by
simp only [Function.Embedding.coeFn_mk]
exact Nat.cast_leβ©
(toPowerSeries.symm x) :=
rfl
#align hahn_series.of_power_series_apply HahnSeries.ofPowerSeries_apply
theorem ofPowerSeries_apply_coeff (x : PowerSeries R) (n : β) :
(ofPowerSeries Ξ R x).coeff n = PowerSeries.coeff R n x := by simp [ofPowerSeries_apply]
#align hahn_series.of_power_series_apply_coeff HahnSeries.ofPowerSeries_apply_coeff
@[simp]
theorem ofPowerSeries_C (r : R) : ofPowerSeries Ξ R (PowerSeries.C R r) = HahnSeries.C r := by
ext n
simp only [ofPowerSeries_apply, C, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk, ne_eq,
single_coeff]
split_ifs with hn
Β· subst hn
convert @embDomain_coeff β R _ _ Ξ _ _ _ 0 <;> simp
Β· rw [embDomain_notin_image_support]
simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support,
PowerSeries.coeff_C]
intro
simp (config := { contextual := true }) [Ne.symm hn]
#align hahn_series.of_power_series_C HahnSeries.ofPowerSeries_C
@[simp]
| Mathlib/RingTheory/HahnSeries/PowerSeries.lean | 132 | 142 | theorem ofPowerSeries_X : ofPowerSeries Ξ R PowerSeries.X = single 1 1 := by |
ext n
simp only [single_coeff, ofPowerSeries_apply, RingHom.coe_mk]
split_ifs with hn
Β· rw [hn]
convert @embDomain_coeff β R _ _ Ξ _ _ _ 1 <;> simp
Β· rw [embDomain_notin_image_support]
simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support,
PowerSeries.coeff_X]
intro
simp (config := { contextual := true }) [Ne.symm hn]
| [
" (fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := β― })\n ((fun f => PowerSeries.mk f.coeff) f) =\n f",
" ((fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := β― })\n ((fun f => PowerSeries.mk f.coeff) f)).coeff\n xβ =\n f.coeff xβ",
" (fu... | [
" (fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := β― })\n ((fun f => PowerSeries.mk f.coeff) f) =\n f",
" ((fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := β― })\n ((fun f => PowerSeries.mk f.coeff) f)).coeff\n xβ =\n f.coeff xβ",
" (fu... |
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
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
#align complex.subfield_eq_of_closed Complex.subfield_eq_of_closed
| Mathlib/Topology/Instances/Complex.lean | 50 | 116 | theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield β) {Ο : K β+* β}
(hc : UniformContinuous Ο) : Ο.toFun = K.subtype β¨ Ο.toFun = conj β K.subtype := by |
letI : TopologicalDivisionRing β := TopologicalDivisionRing.mk
letI : TopologicalRing K.topologicalClosure :=
Subring.instTopologicalRing K.topologicalClosure.toSubring
set ΞΉ : K β K.topologicalClosure := β(Subfield.inclusion K.le_topologicalClosure)
have ui : UniformInducing ΞΉ :=
β¨by
erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
congr β©
let di := ui.denseInducing (?_ : DenseRange ΞΉ)
Β· -- extΟ : closure(K) β+* β is the extension of Ο : K β+* β
let extΟ := DenseInducing.extendRingHom ui di.dense hc
haveI hΟ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
Β· left
let j := RingEquiv.subfieldCongr h
-- Οβ is the continuous ring hom `β β+* β` constructed from `j : closure (K) β+* β`
-- and `extΟ : closure (K) β+* β`
let Οβ := RingHom.comp extΟ (RingHom.comp j.symm.toRingHom ofReal.rangeRestrict)
-- Porting note: was `by continuity!` and was used inline
have hΟβ : Continuous Οβ := by
simpa only [RingHom.coe_comp] using hΟ.comp ((continuous_algebraMap β β).subtype_mk _)
ext1 x
rsuffices β¨r, hrβ© : β r : β, ofReal.rangeRestrict r = j (ΞΉ x)
Β· have :=
RingHom.congr_fun (ringHom_eq_ofReal_of_continuous hΟβ) r
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [RingHom.comp_apply, RingHom.comp_apply, hr, RingEquiv.toRingHom_eq_coe] at this
convert this using 1
Β· exact (DenseInducing.extend_eq di hc.continuous _).symm
Β· rw [β ofReal.coe_rangeRestrict, hr]
rfl
obtain β¨r, hrβ© := SetLike.coe_mem (j (ΞΉ x))
exact β¨r, Subtype.ext hrβ©
Β· -- Οβ is the continuous ring hom `β β+* β` constructed from `closure (K) β+* β`
-- and `extΟ : closure (K) β+* β`
let Οβ :=
RingHom.comp extΟ
(RingHom.comp (RingEquiv.subfieldCongr h).symm.toRingHom
(@Subfield.topEquiv β _).symm.toRingHom)
-- Porting note: was `by continuity!` and was used inline
have hΟβ : Continuous Οβ := by
simpa only [RingHom.coe_comp] using hΟ.comp (continuous_id.subtype_mk _)
cases' ringHom_eq_id_or_conj_of_continuous hΟβ with h h
Β· left
ext1 z
convert RingHom.congr_fun h z using 1
exact (DenseInducing.extend_eq di hc.continuous z).symm
Β· right
ext1 z
convert RingHom.congr_fun h z using 1
exact (DenseInducing.extend_eq di hc.continuous z).symm
Β· let j : { x // x β closure (id '' { x | (K : Set β) x }) } β (K.topologicalClosure : Set β) :=
fun x =>
β¨x, by
convert x.prop
simp only [id, Set.image_id']
rfl β©
convert DenseRange.comp (Function.Surjective.denseRange _)
(DenseEmbedding.subtype denseEmbedding_id (K : Set β)).dense (by continuity : Continuous j)
rintro β¨y, hyβ©
use
β¨y, by
convert hy
simp only [id, Set.image_id']
rfl β©
| [
" K = ofReal.fieldRange β¨ K = β€",
" βK = βofReal.fieldRange β¨ βK = ββ€",
" range ofReal' β βK",
" closure (range (ofReal' β Rat.cast)) β βK",
" closure (range (ofReal' β Rat.cast)) β closure βK",
" range (ofReal' β Rat.cast) β βK",
" (ofReal' β Rat.cast) wβ β βK",
" range ofReal' β closure (range (ofRe... | [
" K = ofReal.fieldRange β¨ K = β€",
" βK = βofReal.fieldRange β¨ βK = ββ€",
" range ofReal' β βK",
" closure (range (ofReal' β Rat.cast)) β βK",
" closure (range (ofReal' β Rat.cast)) β closure βK",
" range (ofReal' β Rat.cast) β βK",
" (ofReal' β Rat.cast) wβ β βK",
" range ofReal' β closure (range (ofRe... |
import Mathlib.Analysis.Convex.Side
import Mathlib.Geometry.Euclidean.Angle.Oriented.Rotation
import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine
#align_import geometry.euclidean.angle.oriented.affine from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open FiniteDimensional Complex
open scoped Affine EuclideanGeometry Real RealInnerProductSpace ComplexConjugate
namespace EuclideanGeometry
variable {V : Type*} {P : Type*} [NormedAddCommGroup V] [InnerProductSpace β V] [MetricSpace P]
[NormedAddTorsor V P] [hd2 : Fact (finrank β V = 2)] [Module.Oriented β V (Fin 2)]
abbrev o := @Module.Oriented.positiveOrientation
def oangle (pβ pβ pβ : P) : Real.Angle :=
o.oangle (pβ -α΅₯ pβ) (pβ -α΅₯ pβ)
#align euclidean_geometry.oangle EuclideanGeometry.oangle
@[inherit_doc] scoped notation "β‘" => EuclideanGeometry.oangle
theorem continuousAt_oangle {x : P Γ P Γ P} (hx12 : x.1 β x.2.1) (hx32 : x.2.2 β x.2.1) :
ContinuousAt (fun y : P Γ P Γ P => β‘ y.1 y.2.1 y.2.2) x := by
let f : P Γ P Γ P β V Γ V := fun y => (y.1 -α΅₯ y.2.1, y.2.2 -α΅₯ y.2.1)
have hf1 : (f x).1 β 0 := by simp [hx12]
have hf2 : (f x).2 β 0 := by simp [hx32]
exact (o.continuousAt_oangle hf1 hf2).comp ((continuous_fst.vsub continuous_snd.fst).prod_mk
(continuous_snd.snd.vsub continuous_snd.fst)).continuousAt
#align euclidean_geometry.continuous_at_oangle EuclideanGeometry.continuousAt_oangle
@[simp]
theorem oangle_self_left (pβ pβ : P) : β‘ pβ pβ pβ = 0 := by simp [oangle]
#align euclidean_geometry.oangle_self_left EuclideanGeometry.oangle_self_left
@[simp]
| Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean | 65 | 65 | theorem oangle_self_right (pβ pβ : P) : β‘ pβ pβ pβ = 0 := by | simp [oangle]
| [
" ContinuousAt (fun y => β‘ y.1 y.2.1 y.2.2) x",
" (f x).1 β 0",
" (f x).2 β 0",
" β‘ pβ pβ pβ = 0",
" β‘ pβ pβ pβ = 0"
] | [
" ContinuousAt (fun y => β‘ y.1 y.2.1 y.2.2) x",
" (f x).1 β 0",
" (f x).2 β 0",
" β‘ pβ pβ pβ = 0"
] |
import Mathlib.Algebra.MvPolynomial.Derivation
import Mathlib.Algebra.MvPolynomial.Variables
#align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
noncomputable section
universe u v
namespace MvPolynomial
open Set Function Finsupp
variable {R : Type u} {Ο : Type v} {a a' aβ aβ : R} {s : Ο ββ β}
section PDeriv
variable [CommSemiring R]
def pderiv (i : Ο) : Derivation R (MvPolynomial Ο R) (MvPolynomial Ο R) :=
letI := Classical.decEq Ο
mkDerivation R <| Pi.single i 1
#align mv_polynomial.pderiv MvPolynomial.pderiv
theorem pderiv_def [DecidableEq Ο] (i : Ο) : pderiv i = mkDerivation R (Pi.single i 1) := by
unfold pderiv; congr!
#align mv_polynomial.pderiv_def MvPolynomial.pderiv_def
@[simp]
theorem pderiv_monomial {i : Ο} :
pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) := by
classical
simp only [pderiv_def, mkDerivation_monomial, Finsupp.smul_sum, smul_eq_mul, β smul_mul_assoc,
β (monomial _).map_smul]
refine (Finset.sum_eq_single i (fun j _ hne => ?_) fun hi => ?_).trans ?_
Β· simp [Pi.single_eq_of_ne hne]
Β· rw [Finsupp.not_mem_support_iff] at hi; simp [hi]
Β· simp
#align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
theorem pderiv_C {i : Ο} : pderiv i (C a) = 0 :=
derivation_C _ _
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_C MvPolynomial.pderiv_C
theorem pderiv_one {i : Ο} : pderiv i (1 : MvPolynomial Ο R) = 0 := pderiv_C
#align mv_polynomial.pderiv_one MvPolynomial.pderiv_one
@[simp]
theorem pderiv_X [DecidableEq Ο] (i j : Ο) :
pderiv i (X j : MvPolynomial Ο R) = Pi.single (f := fun j => _) i 1 j := by
rw [pderiv_def, mkDerivation_X]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X MvPolynomial.pderiv_X
@[simp]
theorem pderiv_X_self (i : Ο) : pderiv i (X i : MvPolynomial Ο R) = 1 := by classical simp
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_X_self
@[simp]
theorem pderiv_X_of_ne {i j : Ο} (h : j β i) : pderiv i (X j : MvPolynomial Ο R) = 0 := by
classical simp [h]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_X_of_ne
theorem pderiv_eq_zero_of_not_mem_vars {i : Ο} {f : MvPolynomial Ο R} (h : i β f.vars) :
pderiv i f = 0 :=
derivation_eq_zero_of_forall_mem_vars fun _ hj => pderiv_X_of_ne <| ne_of_mem_of_not_mem hj h
#align mv_polynomial.pderiv_eq_zero_of_not_mem_vars MvPolynomial.pderiv_eq_zero_of_not_mem_vars
| Mathlib/Algebra/MvPolynomial/PDeriv.lean | 111 | 112 | theorem pderiv_monomial_single {i : Ο} {n : β} : pderiv i (monomial (single i n) a) =
monomial (single i (n - 1)) (a * n) := by | simp
| [
" pderiv i = mkDerivation R (Pi.single i 1)",
" mkDerivation R (Pi.single i 1) = mkDerivation R (Pi.single i 1)",
" (pderiv i) ((monomial s) a) = (monomial (s - single i 1)) (a * β(s i))",
" (s.sum fun a_1 b => (monomial (s - single a_1 1)) (a * βb) * Pi.single i 1 a_1) =\n (monomial (s - single i 1)) (a *... | [
" pderiv i = mkDerivation R (Pi.single i 1)",
" mkDerivation R (Pi.single i 1) = mkDerivation R (Pi.single i 1)",
" (pderiv i) ((monomial s) a) = (monomial (s - single i 1)) (a * β(s i))",
" (s.sum fun a_1 b => (monomial (s - single a_1 1)) (a * βb) * Pi.single i 1 a_1) =\n (monomial (s - single i 1)) (a *... |
import Mathlib.Data.Set.Prod
import Mathlib.Logic.Function.Conjugate
#align_import data.set.function from "leanprover-community/mathlib"@"996b0ff959da753a555053a480f36e5f264d4207"
variable {Ξ± Ξ² Ξ³ : Type*} {ΞΉ : Sort*} {Ο : Ξ± β Type*}
open Equiv Equiv.Perm Function
namespace Set
section Order
variable {s : Set Ξ±} {fβ fβ : Ξ± β Ξ²} [Preorder Ξ±] [Preorder Ξ²]
| Mathlib/Data/Set/Function.lean | 264 | 267 | theorem _root_.MonotoneOn.congr (hβ : MonotoneOn fβ s) (h : s.EqOn fβ fβ) : MonotoneOn fβ s := by |
intro a ha b hb hab
rw [β h ha, β h hb]
exact hβ ha hb hab
| [
" MonotoneOn fβ s",
" fβ a β€ fβ b",
" fβ a β€ fβ b"
] | [] |
import Mathlib.Data.Finset.Fin
import Mathlib.Data.Int.Order.Units
import Mathlib.GroupTheory.OrderOfElement
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Logic.Equiv.Fintype
#align_import group_theory.perm.sign from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u v
open Equiv Function Fintype Finset
variable {Ξ± : Type u} {Ξ² : Type v}
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
namespace Equiv.Perm
theorem perm_inv_on_of_perm_on_finset {s : Finset Ξ±} {f : Perm Ξ±} (h : β x β s, f x β s) {y : Ξ±}
(hy : y β s) : fβ»ΒΉ y β s := by
have h0 : β y β s, β (x : _) (hx : x β s), y = (fun i (_ : i β s) => f i) x hx :=
Finset.surj_on_of_inj_on_of_card_le (fun x hx => (fun i _ => f i) x hx) (fun a ha => h a ha)
(fun aβ aβ haβ haβ heq => (Equiv.apply_eq_iff_eq f).mp heq) rfl.ge
obtain β¨y2, hy2, heqβ© := h0 y hy
convert hy2
rw [heq]
simp only [inv_apply_self]
#align equiv.perm.perm_inv_on_of_perm_on_finset Equiv.Perm.perm_inv_on_of_perm_on_finset
theorem perm_inv_mapsTo_of_mapsTo (f : Perm Ξ±) {s : Set Ξ±} [Finite s] (h : Set.MapsTo f s s) :
Set.MapsTo (fβ»ΒΉ : _) s s := by
cases nonempty_fintype s
exact fun x hx =>
Set.mem_toFinset.mp <|
perm_inv_on_of_perm_on_finset
(fun a ha => Set.mem_toFinset.mpr (h (Set.mem_toFinset.mp ha)))
(Set.mem_toFinset.mpr hx)
#align equiv.perm.perm_inv_maps_to_of_maps_to Equiv.Perm.perm_inv_mapsTo_of_mapsTo
@[simp]
theorem perm_inv_mapsTo_iff_mapsTo {f : Perm Ξ±} {s : Set Ξ±} [Finite s] :
Set.MapsTo (fβ»ΒΉ : _) s s β Set.MapsTo f s s :=
β¨perm_inv_mapsTo_of_mapsTo fβ»ΒΉ, perm_inv_mapsTo_of_mapsTo fβ©
#align equiv.perm.perm_inv_maps_to_iff_maps_to Equiv.Perm.perm_inv_mapsTo_iff_mapsTo
theorem perm_inv_on_of_perm_on_finite {f : Perm Ξ±} {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) {x : Ξ±} (hx : p x) : p (fβ»ΒΉ x) :=
-- Porting note: relies heavily on the definitions of `Subtype` and `setOf` unfolding to their
-- underlying predicate.
have : Finite { x | p x } := βΉ_βΊ
perm_inv_mapsTo_of_mapsTo (s := {x | p x}) f h hx
#align equiv.perm.perm_inv_on_of_perm_on_finite Equiv.Perm.perm_inv_on_of_perm_on_finite
abbrev subtypePermOfFintype (f : Perm Ξ±) {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) : Perm { x // p x } :=
f.subtypePerm fun x => β¨h x, fun hβ => f.inv_apply_self x βΈ perm_inv_on_of_perm_on_finite h hββ©
#align equiv.perm.subtype_perm_of_fintype Equiv.Perm.subtypePermOfFintype
@[simp]
theorem subtypePermOfFintype_apply (f : Perm Ξ±) {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) (x : { x // p x }) : subtypePermOfFintype f h x = β¨f x, h x x.2β© :=
rfl
#align equiv.perm.subtype_perm_of_fintype_apply Equiv.Perm.subtypePermOfFintype_apply
theorem subtypePermOfFintype_one (p : Ξ± β Prop) [Finite { x // p x }]
(h : β x, p x β p ((1 : Perm Ξ±) x)) : @subtypePermOfFintype Ξ± 1 p _ h = 1 :=
rfl
#align equiv.perm.subtype_perm_of_fintype_one Equiv.Perm.subtypePermOfFintype_one
| Mathlib/GroupTheory/Perm/Finite.lean | 111 | 129 | theorem perm_mapsTo_inl_iff_mapsTo_inr {m n : Type*} [Finite m] [Finite n] (Ο : Perm (Sum m n)) :
Set.MapsTo Ο (Set.range Sum.inl) (Set.range Sum.inl) β
Set.MapsTo Ο (Set.range Sum.inr) (Set.range Sum.inr) := by |
constructor <;>
( intro h
classical
rw [β perm_inv_mapsTo_iff_mapsTo] at h
intro x
cases' hx : Ο x with l r)
Β· rintro β¨a, rflβ©
obtain β¨y, hyβ© := h β¨l, rflβ©
rw [β hx, Ο.inv_apply_self] at hy
exact absurd hy Sum.inl_ne_inr
Β· rintro _; exact β¨r, rflβ©
Β· rintro _; exact β¨l, rflβ©
Β· rintro β¨a, rflβ©
obtain β¨y, hyβ© := h β¨r, rflβ©
rw [β hx, Ο.inv_apply_self] at hy
exact absurd hy Sum.inr_ne_inl
| [
" -1 β 1",
" fβ»ΒΉ y β s",
" fβ»ΒΉ y = y2",
" fβ»ΒΉ ((fun i x => f i) y2 hy2) = y2",
" Set.MapsTo (βfβ»ΒΉ) s s",
" Set.MapsTo (βΟ) (Set.range Sum.inl) (Set.range Sum.inl) β Set.MapsTo (βΟ) (Set.range Sum.inr) (Set.range Sum.inr)",
" Set.MapsTo (βΟ) (Set.range Sum.inl) (Set.range Sum.inl) β Set.MapsTo (βΟ) (Set.... | [
" -1 β 1",
" fβ»ΒΉ y β s",
" fβ»ΒΉ y = y2",
" fβ»ΒΉ ((fun i x => f i) y2 hy2) = y2",
" Set.MapsTo (βfβ»ΒΉ) s s"
] |
import Mathlib.Analysis.InnerProductSpace.Projection
import Mathlib.Geometry.Euclidean.PerpBisector
import Mathlib.Algebra.QuadraticDiscriminant
#align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
noncomputable section
open scoped Classical
open RealInnerProductSpace
namespace EuclideanGeometry
variable {V : Type*} {P : Type*}
variable [NormedAddCommGroup V] [InnerProductSpace β V] [MetricSpace P]
variable [NormedAddTorsor V P]
theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) :
dist p1 (midpoint β p1 p2) = dist p2 (midpoint β p1 p2) := by
rw [dist_left_midpoint (π := β) p1 p2, dist_right_midpoint (π := β) p1 p2]
#align euclidean_geometry.dist_left_midpoint_eq_dist_right_midpoint EuclideanGeometry.dist_left_midpoint_eq_dist_right_midpoint
theorem inner_weightedVSub {ΞΉβ : Type*} {sβ : Finset ΞΉβ} {wβ : ΞΉβ β β} (pβ : ΞΉβ β P)
(hβ : β i β sβ, wβ i = 0) {ΞΉβ : Type*} {sβ : Finset ΞΉβ} {wβ : ΞΉβ β β} (pβ : ΞΉβ β P)
(hβ : β i β sβ, wβ i = 0) :
βͺsβ.weightedVSub pβ wβ, sβ.weightedVSub pβ wββ« =
(-β iβ β sβ, β iβ β sβ, wβ iβ * wβ iβ * (dist (pβ iβ) (pβ iβ) * dist (pβ iβ) (pβ iβ))) /
2 := by
rw [Finset.weightedVSub_apply, Finset.weightedVSub_apply,
inner_sum_smul_sum_smul_of_sum_eq_zero _ hβ _ hβ]
simp_rw [vsub_sub_vsub_cancel_right]
rcongr (iβ iβ) <;> rw [dist_eq_norm_vsub V (pβ iβ) (pβ iβ)]
#align euclidean_geometry.inner_weighted_vsub EuclideanGeometry.inner_weightedVSub
theorem dist_affineCombination {ΞΉ : Type*} {s : Finset ΞΉ} {wβ wβ : ΞΉ β β} (p : ΞΉ β P)
(hβ : β i β s, wβ i = 1) (hβ : β i β s, wβ i = 1) : by
have aβ := s.affineCombination β p wβ
have aβ := s.affineCombination β p wβ
exact dist aβ aβ * dist aβ aβ = (-β iβ β s, β iβ β s,
(wβ - wβ) iβ * (wβ - wβ) iβ * (dist (p iβ) (p iβ) * dist (p iβ) (p iβ))) / 2 := by
dsimp only
rw [dist_eq_norm_vsub V (s.affineCombination β p wβ) (s.affineCombination β p wβ), β
@inner_self_eq_norm_mul_norm β, Finset.affineCombination_vsub]
have h : (β i β s, (wβ - wβ) i) = 0 := by
simp_rw [Pi.sub_apply, Finset.sum_sub_distrib, hβ, hβ, sub_self]
exact inner_weightedVSub p h p h
#align euclidean_geometry.dist_affine_combination EuclideanGeometry.dist_affineCombination
-- Porting note: `inner_vsub_vsub_of_dist_eq_of_dist_eq` moved to `PerpendicularBisector`
theorem dist_smul_vadd_sq (r : β) (v : V) (pβ pβ : P) :
dist (r β’ v +α΅₯ pβ) pβ * dist (r β’ v +α΅₯ pβ) pβ =
βͺv, vβ« * r * r + 2 * βͺv, pβ -α΅₯ pββ« * r + βͺpβ -α΅₯ pβ, pβ -α΅₯ pββ« := by
rw [dist_eq_norm_vsub V _ pβ, β real_inner_self_eq_norm_mul_norm, vadd_vsub_assoc,
real_inner_add_add_self, real_inner_smul_left, real_inner_smul_left, real_inner_smul_right]
ring
#align euclidean_geometry.dist_smul_vadd_sq EuclideanGeometry.dist_smul_vadd_sq
| Mathlib/Geometry/Euclidean/Basic.lean | 122 | 134 | theorem dist_smul_vadd_eq_dist {v : V} (pβ pβ : P) (hv : v β 0) (r : β) :
dist (r β’ v +α΅₯ pβ) pβ = dist pβ pβ β r = 0 β¨ r = -2 * βͺv, pβ -α΅₯ pββ« / βͺv, vβ« := by |
conv_lhs =>
rw [β mul_self_inj_of_nonneg dist_nonneg dist_nonneg, dist_smul_vadd_sq, β sub_eq_zero,
add_sub_assoc, dist_eq_norm_vsub V pβ pβ, β real_inner_self_eq_norm_mul_norm, sub_self]
have hvi : βͺv, vβ« β 0 := by simpa using hv
have hd : discrim βͺv, vβ« (2 * βͺv, pβ -α΅₯ pββ«) 0 = 2 * βͺv, pβ -α΅₯ pββ« * (2 * βͺv, pβ -α΅₯ pββ«) := by
rw [discrim]
ring
rw [quadratic_eq_zero_iff hvi hd, add_left_neg, zero_div, neg_mul_eq_neg_mul, β
mul_sub_right_distrib, sub_eq_add_neg, β mul_two, mul_assoc, mul_div_assoc, mul_div_mul_left,
mul_div_assoc]
norm_num
| [
" dist p1 (midpoint β p1 p2) = dist p2 (midpoint β p1 p2)",
" βͺ(sβ.weightedVSub pβ) wβ, (sβ.weightedVSub pβ) wββ«_β =\n (-β iβ β sβ, β iβ β sβ, wβ iβ * wβ iβ * (dist (pβ iβ) (pβ iβ) * dist (pβ iβ) (pβ iβ))) / 2",
" (-β iβ β sβ,\n β iβ β sβ,\n wβ iβ * wβ iβ *\n (βpβ iβ -α΅₯ Class... | [
" dist p1 (midpoint β p1 p2) = dist p2 (midpoint β p1 p2)",
" βͺ(sβ.weightedVSub pβ) wβ, (sβ.weightedVSub pβ) wββ«_β =\n (-β iβ β sβ, β iβ β sβ, wβ iβ * wβ iβ * (dist (pβ iβ) (pβ iβ) * dist (pβ iβ) (pβ iβ))) / 2",
" (-β iβ β sβ,\n β iβ β sβ,\n wβ iβ * wβ iβ *\n (βpβ iβ -α΅₯ Class... |
import Mathlib.Analysis.Calculus.Deriv.Inv
import Mathlib.Analysis.Calculus.Deriv.Polynomial
import Mathlib.Analysis.SpecialFunctions.ExpDeriv
import Mathlib.Analysis.SpecialFunctions.PolynomialExp
#align_import analysis.calculus.bump_function_inner from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
noncomputable section
open scoped Classical Topology
open Polynomial Real Filter Set Function
open scoped Polynomial
def expNegInvGlue (x : β) : β :=
if x β€ 0 then 0 else exp (-xβ»ΒΉ)
#align exp_neg_inv_glue expNegInvGlue
namespace expNegInvGlue
theorem zero_of_nonpos {x : β} (hx : x β€ 0) : expNegInvGlue x = 0 := by simp [expNegInvGlue, hx]
#align exp_neg_inv_glue.zero_of_nonpos expNegInvGlue.zero_of_nonpos
@[simp] -- Porting note (#10756): new lemma
protected theorem zero : expNegInvGlue 0 = 0 := zero_of_nonpos le_rfl
theorem pos_of_pos {x : β} (hx : 0 < x) : 0 < expNegInvGlue x := by
simp [expNegInvGlue, not_le.2 hx, exp_pos]
#align exp_neg_inv_glue.pos_of_pos expNegInvGlue.pos_of_pos
| Mathlib/Analysis/SpecialFunctions/SmoothTransition.lean | 58 | 61 | theorem nonneg (x : β) : 0 β€ expNegInvGlue x := by |
cases le_or_gt x 0 with
| inl h => exact ge_of_eq (zero_of_nonpos h)
| inr h => exact le_of_lt (pos_of_pos h)
| [
" expNegInvGlue x = 0",
" 0 < expNegInvGlue x",
" 0 β€ expNegInvGlue x"
] | [
" expNegInvGlue x = 0",
" 0 < expNegInvGlue x"
] |
import Mathlib.Analysis.InnerProductSpace.Dual
import Mathlib.Analysis.InnerProductSpace.Orientation
import Mathlib.Data.Complex.Orientation
import Mathlib.Tactic.LinearCombination
#align_import analysis.inner_product_space.two_dim from "leanprover-community/mathlib"@"cd8fafa2fac98e1a67097e8a91ad9901cfde48af"
noncomputable section
open scoped RealInnerProductSpace ComplexConjugate
open FiniteDimensional
lemma FiniteDimensional.of_fact_finrank_eq_two {K V : Type*} [DivisionRing K]
[AddCommGroup V] [Module K V] [Fact (finrank K V = 2)] : FiniteDimensional K V :=
.of_fact_finrank_eq_succ 1
attribute [local instance] FiniteDimensional.of_fact_finrank_eq_two
@[deprecated (since := "2024-02-02")]
alias FiniteDimensional.finiteDimensional_of_fact_finrank_eq_two :=
FiniteDimensional.of_fact_finrank_eq_two
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] [Fact (finrank β E = 2)]
(o : Orientation β E (Fin 2))
namespace Orientation
irreducible_def areaForm : E ββ[β] E ββ[β] β := by
let z : E [β^Fin 0]ββ[β] β ββ[β] β :=
AlternatingMap.constLinearEquivOfIsEmpty.symm
let y : E [β^Fin 1]ββ[β] β ββ[β] E ββ[β] β :=
LinearMap.llcomp β E (E [β^Fin 0]ββ[β] β) β z ββ AlternatingMap.curryLeftLinearMap
exact y ββ AlternatingMap.curryLeftLinearMap (R' := β) o.volumeForm
#align orientation.area_form Orientation.areaForm
local notation "Ο" => o.areaForm
| Mathlib/Analysis/InnerProductSpace/TwoDim.lean | 105 | 105 | theorem areaForm_to_volumeForm (x y : E) : Ο x y = o.volumeForm ![x, y] := by | simp [areaForm]
| [
" E ββ[β] E ββ[β] β",
" (o.areaForm x) y = o.volumeForm ![x, y]"
] | [
" E ββ[β] E ββ[β] β"
] |
import Mathlib.Algebra.Polynomial.Roots
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent
import Mathlib.Analysis.Asymptotics.SpecificAsymptotics
#align_import analysis.special_functions.polynomials from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Filter Finset Asymptotics
open Asymptotics Polynomial Topology
namespace Polynomial
variable {π : Type*} [NormedLinearOrderedField π] (P Q : π[X])
theorem eventually_no_roots (hP : P β 0) : βαΆ x in atTop, Β¬P.IsRoot x :=
atTop_le_cofinite <| (finite_setOf_isRoot hP).compl_mem_cofinite
#align polynomial.eventually_no_roots Polynomial.eventually_no_roots
variable [OrderTopology π]
section PolynomialAtTop
theorem isEquivalent_atTop_lead :
(fun x => eval x P) ~[atTop] fun x => P.leadingCoeff * x ^ P.natDegree := by
by_cases h : P = 0
Β· simp [h, IsEquivalent.refl]
Β· simp only [Polynomial.eval_eq_sum_range, sum_range_succ]
exact
IsLittleO.add_isEquivalent
(IsLittleO.sum fun i hi =>
IsLittleO.const_mul_left
((IsLittleO.const_mul_right fun hz => h <| leadingCoeff_eq_zero.mp hz) <|
isLittleO_pow_pow_atTop_of_lt (mem_range.mp hi))
_)
IsEquivalent.refl
#align polynomial.is_equivalent_at_top_lead Polynomial.isEquivalent_atTop_lead
theorem tendsto_atTop_of_leadingCoeff_nonneg (hdeg : 0 < P.degree) (hnng : 0 β€ P.leadingCoeff) :
Tendsto (fun x => eval x P) atTop atTop :=
P.isEquivalent_atTop_lead.symm.tendsto_atTop <|
tendsto_const_mul_pow_atTop (natDegree_pos_iff_degree_pos.2 hdeg).ne' <|
hnng.lt_of_ne' <| leadingCoeff_ne_zero.mpr <| ne_zero_of_degree_gt hdeg
#align polynomial.tendsto_at_top_of_leading_coeff_nonneg Polynomial.tendsto_atTop_of_leadingCoeff_nonneg
theorem tendsto_atTop_iff_leadingCoeff_nonneg :
Tendsto (fun x => eval x P) atTop atTop β 0 < P.degree β§ 0 β€ P.leadingCoeff := by
refine β¨fun h => ?_, fun h => tendsto_atTop_of_leadingCoeff_nonneg P h.1 h.2β©
have : Tendsto (fun x => P.leadingCoeff * x ^ P.natDegree) atTop atTop :=
(isEquivalent_atTop_lead P).tendsto_atTop h
rw [tendsto_const_mul_pow_atTop_iff, β pos_iff_ne_zero, natDegree_pos_iff_degree_pos] at this
exact β¨this.1, this.2.leβ©
#align polynomial.tendsto_at_top_iff_leading_coeff_nonneg Polynomial.tendsto_atTop_iff_leadingCoeff_nonneg
theorem tendsto_atBot_iff_leadingCoeff_nonpos :
Tendsto (fun x => eval x P) atTop atBot β 0 < P.degree β§ P.leadingCoeff β€ 0 := by
simp only [β tendsto_neg_atTop_iff, β eval_neg, tendsto_atTop_iff_leadingCoeff_nonneg,
degree_neg, leadingCoeff_neg, neg_nonneg]
#align polynomial.tendsto_at_bot_iff_leading_coeff_nonpos Polynomial.tendsto_atBot_iff_leadingCoeff_nonpos
theorem tendsto_atBot_of_leadingCoeff_nonpos (hdeg : 0 < P.degree) (hnps : P.leadingCoeff β€ 0) :
Tendsto (fun x => eval x P) atTop atBot :=
P.tendsto_atBot_iff_leadingCoeff_nonpos.2 β¨hdeg, hnpsβ©
#align polynomial.tendsto_at_bot_of_leading_coeff_nonpos Polynomial.tendsto_atBot_of_leadingCoeff_nonpos
| Mathlib/Analysis/SpecialFunctions/Polynomials.lean | 84 | 88 | theorem abs_tendsto_atTop (hdeg : 0 < P.degree) :
Tendsto (fun x => abs <| eval x P) atTop atTop := by |
rcases le_total 0 P.leadingCoeff with hP | hP
Β· exact tendsto_abs_atTop_atTop.comp (P.tendsto_atTop_of_leadingCoeff_nonneg hdeg hP)
Β· exact tendsto_abs_atBot_atTop.comp (P.tendsto_atBot_of_leadingCoeff_nonpos hdeg hP)
| [
" (fun x => eval x P) ~[atTop] fun x => P.leadingCoeff * x ^ P.natDegree",
" (fun x => β i β range P.natDegree, P.coeff i * x ^ i + P.coeff P.natDegree * x ^ P.natDegree) ~[atTop] fun x =>\n P.leadingCoeff * x ^ P.natDegree",
" Tendsto (fun x => eval x P) atTop atTop β 0 < P.degree β§ 0 β€ P.leadingCoeff",
"... | [
" (fun x => eval x P) ~[atTop] fun x => P.leadingCoeff * x ^ P.natDegree",
" (fun x => β i β range P.natDegree, P.coeff i * x ^ i + P.coeff P.natDegree * x ^ P.natDegree) ~[atTop] fun x =>\n P.leadingCoeff * x ^ P.natDegree",
" Tendsto (fun x => eval x P) atTop atTop β 0 < P.degree β§ 0 β€ P.leadingCoeff",
"... |
import Mathlib.RingTheory.Valuation.Basic
import Mathlib.NumberTheory.Padics.PadicNorm
import Mathlib.Analysis.Normed.Field.Basic
#align_import number_theory.padics.padic_numbers from "leanprover-community/mathlib"@"b9b2114f7711fec1c1e055d507f082f8ceb2c3b7"
noncomputable section
open scoped Classical
open Nat multiplicity padicNorm CauSeq CauSeq.Completion Metric
abbrev PadicSeq (p : β) :=
CauSeq _ (padicNorm p)
#align padic_seq PadicSeq
namespace PadicSeq
section
variable {p : β} [Fact p.Prime]
theorem stationary {f : CauSeq β (padicNorm p)} (hf : Β¬f β 0) :
β N, β m n, N β€ m β N β€ n β padicNorm p (f n) = padicNorm p (f m) :=
have : β Ξ΅ > 0, β N1, β j β₯ N1, Ξ΅ β€ padicNorm p (f j) :=
CauSeq.abv_pos_of_not_limZero <| not_limZero_of_not_congr_zero hf
let β¨Ξ΅, hΞ΅, N1, hN1β© := this
let β¨N2, hN2β© := CauSeq.cauchyβ f hΞ΅
β¨max N1 N2, fun n m hn hm β¦ by
have : padicNorm p (f n - f m) < Ξ΅ := hN2 _ (max_le_iff.1 hn).2 _ (max_le_iff.1 hm).2
have : padicNorm p (f n - f m) < padicNorm p (f n) :=
lt_of_lt_of_le this <| hN1 _ (max_le_iff.1 hn).1
have : padicNorm p (f n - f m) < max (padicNorm p (f n)) (padicNorm p (f m)) :=
lt_max_iff.2 (Or.inl this)
by_contra hne
rw [β padicNorm.neg (f m)] at hne
have hnam := add_eq_max_of_ne hne
rw [padicNorm.neg, max_comm] at hnam
rw [β hnam, sub_eq_add_neg, add_comm] at this
apply _root_.lt_irrefl _ thisβ©
#align padic_seq.stationary PadicSeq.stationary
def stationaryPoint {f : PadicSeq p} (hf : Β¬f β 0) : β :=
Classical.choose <| stationary hf
#align padic_seq.stationary_point PadicSeq.stationaryPoint
theorem stationaryPoint_spec {f : PadicSeq p} (hf : Β¬f β 0) :
β {m n},
stationaryPoint hf β€ m β stationaryPoint hf β€ n β padicNorm p (f n) = padicNorm p (f m) :=
@(Classical.choose_spec <| stationary hf)
#align padic_seq.stationary_point_spec PadicSeq.stationaryPoint_spec
def norm (f : PadicSeq p) : β :=
if hf : f β 0 then 0 else padicNorm p (f (stationaryPoint hf))
#align padic_seq.norm PadicSeq.norm
theorem norm_zero_iff (f : PadicSeq p) : f.norm = 0 β f β 0 := by
constructor
Β· intro h
by_contra hf
unfold norm at h
split_ifs at h
Β· contradiction
apply hf
intro Ξ΅ hΞ΅
exists stationaryPoint hf
intro j hj
have heq := stationaryPoint_spec hf le_rfl hj
simpa [h, heq]
Β· intro h
simp [norm, h]
#align padic_seq.norm_zero_iff PadicSeq.norm_zero_iff
end
section Embedding
open CauSeq
variable {p : β} [Fact p.Prime]
theorem equiv_zero_of_val_eq_of_equiv_zero {f g : PadicSeq p}
(h : β k, padicNorm p (f k) = padicNorm p (g k)) (hf : f β 0) : g β 0 := fun Ξ΅ hΞ΅ β¦
let β¨i, hiβ© := hf _ hΞ΅
β¨i, fun j hj β¦ by simpa [h] using hi _ hjβ©
#align padic_seq.equiv_zero_of_val_eq_of_equiv_zero PadicSeq.equiv_zero_of_val_eq_of_equiv_zero
theorem norm_nonzero_of_not_equiv_zero {f : PadicSeq p} (hf : Β¬f β 0) : f.norm β 0 :=
hf β f.norm_zero_iff.1
#align padic_seq.norm_nonzero_of_not_equiv_zero PadicSeq.norm_nonzero_of_not_equiv_zero
theorem norm_eq_norm_app_of_nonzero {f : PadicSeq p} (hf : Β¬f β 0) :
β k, f.norm = padicNorm p k β§ k β 0 :=
have heq : f.norm = padicNorm p (f <| stationaryPoint hf) := by simp [norm, hf]
β¨f <| stationaryPoint hf, heq, fun h β¦
norm_nonzero_of_not_equiv_zero hf (by simpa [h] using heq)β©
#align padic_seq.norm_eq_norm_app_of_nonzero PadicSeq.norm_eq_norm_app_of_nonzero
theorem not_limZero_const_of_nonzero {q : β} (hq : q β 0) : Β¬LimZero (const (padicNorm p) q) :=
fun h' β¦ hq <| const_limZero.1 h'
#align padic_seq.not_lim_zero_const_of_nonzero PadicSeq.not_limZero_const_of_nonzero
theorem not_equiv_zero_const_of_nonzero {q : β} (hq : q β 0) : Β¬const (padicNorm p) q β 0 :=
fun h : LimZero (const (padicNorm p) q - 0) β¦ not_limZero_const_of_nonzero hq <| by simpa using h
#align padic_seq.not_equiv_zero_const_of_nonzero PadicSeq.not_equiv_zero_const_of_nonzero
theorem norm_nonneg (f : PadicSeq p) : 0 β€ f.norm :=
if hf : f β 0 then by simp [hf, norm] else by simp [norm, hf, padicNorm.nonneg]
#align padic_seq.norm_nonneg PadicSeq.norm_nonneg
| Mathlib/NumberTheory/Padics/PadicNumbers.lean | 176 | 181 | theorem lift_index_left_left {f : PadicSeq p} (hf : Β¬f β 0) (v2 v3 : β) :
padicNorm p (f (stationaryPoint hf)) =
padicNorm p (f (max (stationaryPoint hf) (max v2 v3))) := by |
apply stationaryPoint_spec hf
Β· apply le_max_left
Β· exact le_rfl
| [
" padicNorm p (βf m) = padicNorm p (βf n)",
" False",
" f.norm = 0 β f β 0",
" f.norm = 0 β f β 0",
" f β 0",
" β i, β j β₯ i, padicNorm p (β(f - 0) j) < Ξ΅",
" β j β₯ stationaryPoint hf, padicNorm p (β(f - 0) j) < Ξ΅",
" padicNorm p (β(f - 0) j) < Ξ΅",
" f β 0 β f.norm = 0",
" f.norm = 0",
" padicNo... | [
" padicNorm p (βf m) = padicNorm p (βf n)",
" False",
" f.norm = 0 β f β 0",
" f.norm = 0 β f β 0",
" f β 0",
" β i, β j β₯ i, padicNorm p (β(f - 0) j) < Ξ΅",
" β j β₯ stationaryPoint hf, padicNorm p (β(f - 0) j) < Ξ΅",
" padicNorm p (β(f - 0) j) < Ξ΅",
" f β 0 β f.norm = 0",
" f.norm = 0",
" padicNo... |
import Mathlib.Algebra.Order.Floor
import Mathlib.Algebra.Order.Field.Power
import Mathlib.Data.Nat.Log
#align_import data.int.log from "leanprover-community/mathlib"@"1f0096e6caa61e9c849ec2adbd227e960e9dff58"
variable {R : Type*} [LinearOrderedSemifield R] [FloorSemiring R]
namespace Int
def log (b : β) (r : R) : β€ :=
if 1 β€ r then Nat.log b βrββ else -Nat.clog b βrβ»ΒΉββ
#align int.log Int.log
theorem log_of_one_le_right (b : β) {r : R} (hr : 1 β€ r) : log b r = Nat.log b βrββ :=
if_pos hr
#align int.log_of_one_le_right Int.log_of_one_le_right
theorem log_of_right_le_one (b : β) {r : R} (hr : r β€ 1) : log b r = -Nat.clog b βrβ»ΒΉββ := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [log, if_pos hr, inv_one, Nat.ceil_one, Nat.floor_one, Nat.log_one_right, Nat.clog_one_right,
Int.ofNat_zero, neg_zero]
Β· exact if_neg hr.not_le
#align int.log_of_right_le_one Int.log_of_right_le_one
@[simp, norm_cast]
theorem log_natCast (b : β) (n : β) : log b (n : R) = Nat.log b n := by
cases n
Β· simp [log_of_right_le_one]
Β· rw [log_of_one_le_right, Nat.floor_natCast]
simp
#align int.log_nat_cast Int.log_natCast
-- See note [no_index around OfNat.ofNat]
@[simp]
theorem log_ofNat (b : β) (n : β) [n.AtLeastTwo] :
log b (no_index (OfNat.ofNat n : R)) = Nat.log b (OfNat.ofNat n) :=
log_natCast b n
theorem log_of_left_le_one {b : β} (hb : b β€ 1) (r : R) : log b r = 0 := by
rcases le_total 1 r with h | h
Β· rw [log_of_one_le_right _ h, Nat.log_of_left_le_one hb, Int.ofNat_zero]
Β· rw [log_of_right_le_one _ h, Nat.clog_of_left_le_one hb, Int.ofNat_zero, neg_zero]
#align int.log_of_left_le_one Int.log_of_left_le_one
theorem log_of_right_le_zero (b : β) {r : R} (hr : r β€ 0) : log b r = 0 := by
rw [log_of_right_le_one _ (hr.trans zero_le_one),
Nat.clog_of_right_le_one ((Nat.ceil_eq_zero.mpr <| inv_nonpos.2 hr).trans_le zero_le_one),
Int.ofNat_zero, neg_zero]
#align int.log_of_right_le_zero Int.log_of_right_le_zero
theorem zpow_log_le_self {b : β} {r : R} (hb : 1 < b) (hr : 0 < r) : (b : R) ^ log b r β€ r := by
rcases le_total 1 r with hr1 | hr1
Β· rw [log_of_one_le_right _ hr1]
rw [zpow_natCast, β Nat.cast_pow, β Nat.le_floor_iff hr.le]
exact Nat.pow_log_le_self b (Nat.floor_pos.mpr hr1).ne'
Β· rw [log_of_right_le_one _ hr1, zpow_neg, zpow_natCast, β Nat.cast_pow]
exact inv_le_of_inv_le hr (Nat.ceil_le.1 <| Nat.le_pow_clog hb _)
#align int.zpow_log_le_self Int.zpow_log_le_self
theorem lt_zpow_succ_log_self {b : β} (hb : 1 < b) (r : R) : r < (b : R) ^ (log b r + 1) := by
rcases le_or_lt r 0 with hr | hr
Β· rw [log_of_right_le_zero _ hr, zero_add, zpow_one]
exact hr.trans_lt (zero_lt_one.trans_le <| mod_cast hb.le)
rcases le_or_lt 1 r with hr1 | hr1
Β· rw [log_of_one_le_right _ hr1]
rw [Int.ofNat_add_one_out, zpow_natCast, β Nat.cast_pow]
apply Nat.lt_of_floor_lt
exact Nat.lt_pow_succ_log_self hb _
Β· rw [log_of_right_le_one _ hr1.le]
have hcri : 1 < rβ»ΒΉ := one_lt_inv hr hr1
have : 1 β€ Nat.clog b βrβ»ΒΉββ :=
Nat.succ_le_of_lt (Nat.clog_pos hb <| Nat.one_lt_cast.1 <| hcri.trans_le (Nat.le_ceil _))
rw [neg_add_eq_sub, β neg_sub, β Int.ofNat_one, β Int.ofNat_sub this, zpow_neg, zpow_natCast,
lt_inv hr (pow_pos (Nat.cast_pos.mpr <| zero_lt_one.trans hb) _), β Nat.cast_pow]
refine Nat.lt_ceil.1 ?_
exact Nat.pow_pred_clog_lt_self hb <| Nat.one_lt_cast.1 <| hcri.trans_le <| Nat.le_ceil _
#align int.lt_zpow_succ_log_self Int.lt_zpow_succ_log_self
@[simp]
theorem log_zero_right (b : β) : log b (0 : R) = 0 :=
log_of_right_le_zero b le_rfl
#align int.log_zero_right Int.log_zero_right
@[simp]
theorem log_one_right (b : β) : log b (1 : R) = 0 := by
rw [log_of_one_le_right _ le_rfl, Nat.floor_one, Nat.log_one_right, Int.ofNat_zero]
#align int.log_one_right Int.log_one_right
-- Porting note: needed to replace b ^ z with (b : R) ^ z in the below
| Mathlib/Data/Int/Log.lean | 138 | 145 | theorem log_zpow {b : β} (hb : 1 < b) (z : β€) : log b ((b : R) ^ z : R) = z := by |
obtain β¨n, rfl | rflβ© := Int.eq_nat_or_neg z
Β· rw [log_of_one_le_right _ (one_le_zpow_of_nonneg _ <| Int.natCast_nonneg _), zpow_natCast, β
Nat.cast_pow, Nat.floor_natCast, Nat.log_pow hb]
exact mod_cast hb.le
Β· rw [log_of_right_le_one _ (zpow_le_one_of_nonpos _ <| neg_nonpos.mpr (Int.natCast_nonneg _)),
zpow_neg, inv_inv, zpow_natCast, β Nat.cast_pow, Nat.ceil_natCast, Nat.clog_pow _ _ hb]
exact mod_cast hb.le
| [
" log b r = -β(b.clog βrβ»ΒΉββ)",
" log b 1 = -β(b.clog β1β»ΒΉββ)",
" log b βn = β(b.log n)",
" log b β0 = β(b.log 0)",
" log b β(nβ + 1) = β(b.log (nβ + 1))",
" 1 β€ β(nβ + 1)",
" log b r = 0",
" βb ^ log b r β€ r",
" βb ^ β(b.log βrββ) β€ r",
" b ^ b.log βrββ β€ βrββ",
" (β(b ^ b.clog βrβ»ΒΉββ))β»ΒΉ β€ r",... | [
" log b r = -β(b.clog βrβ»ΒΉββ)",
" log b 1 = -β(b.clog β1β»ΒΉββ)",
" log b βn = β(b.log n)",
" log b β0 = β(b.log 0)",
" log b β(nβ + 1) = β(b.log (nβ + 1))",
" 1 β€ β(nβ + 1)",
" log b r = 0",
" βb ^ log b r β€ r",
" βb ^ β(b.log βrββ) β€ r",
" b ^ b.log βrββ β€ βrββ",
" (β(b ^ b.clog βrβ»ΒΉββ))β»ΒΉ β€ r",... |
import Mathlib.NumberTheory.NumberField.Basic
import Mathlib.RingTheory.FractionalIdeal.Norm
import Mathlib.RingTheory.FractionalIdeal.Operations
variable (K : Type*) [Field K] [NumberField K]
namespace NumberField
open scoped nonZeroDivisors
section Basis
open Module
-- This is necessary to avoid several timeouts
attribute [local instance 2000] Submodule.module
instance (I : FractionalIdeal (π K)β° K) : Module.Free β€ I := by
refine Free.of_equiv (LinearEquiv.restrictScalars β€ (I.equivNum ?_)).symm
exact nonZeroDivisors.coe_ne_zero I.den
instance (I : FractionalIdeal (π K)β° K) : Module.Finite β€ I := by
refine Module.Finite.of_surjective
(LinearEquiv.restrictScalars β€ (I.equivNum ?_)).symm.toLinearMap (LinearEquiv.surjective _)
exact nonZeroDivisors.coe_ne_zero I.den
instance (I : (FractionalIdeal (π K)β° K)Λ£) :
IsLocalizedModule β€β° ((Submodule.subtype (I : Submodule (π K) K)).restrictScalars β€) where
map_units x := by
rw [β (Algebra.lmul _ _).commutes, Algebra.lmul_isUnit_iff, isUnit_iff_ne_zero, eq_intCast,
Int.cast_ne_zero]
exact nonZeroDivisors.coe_ne_zero x
surj' x := by
obtain β¨β¨a, _, d, hd, rflβ©, hβ© := IsLocalization.surj (Algebra.algebraMapSubmonoid (π K) β€β°) x
refine β¨β¨β¨Ideal.absNorm I.1.num * (algebraMap _ K a), I.1.num_le ?_β©, d * Ideal.absNorm I.1.num,
?_β© , ?_β©
Β· simp_rw [FractionalIdeal.val_eq_coe, FractionalIdeal.coe_coeIdeal]
refine (IsLocalization.mem_coeSubmodule _ _).mpr β¨Ideal.absNorm I.1.num * a, ?_, ?_β©
Β· exact Ideal.mul_mem_right _ _ I.1.num.absNorm_mem
Β· rw [map_mul, map_natCast]
Β· refine Submonoid.mul_mem _ hd (mem_nonZeroDivisors_of_ne_zero ?_)
rw [Nat.cast_ne_zero, ne_eq, Ideal.absNorm_eq_zero_iff]
exact FractionalIdeal.num_eq_zero_iff.not.mpr <| Units.ne_zero I
Β· simp_rw [LinearMap.coe_restrictScalars, Submodule.coeSubtype] at h β’
rw [β h]
simp only [Submonoid.mk_smul, zsmul_eq_mul, Int.cast_mul, Int.cast_natCast, algebraMap_int_eq,
eq_intCast, map_intCast]
ring
exists_of_eq h :=
β¨1, by rwa [one_smul, one_smul, β (Submodule.injective_subtype I.1.coeToSubmodule).eq_iff]β©
noncomputable def fractionalIdealBasis (I : FractionalIdeal (π K)β° K) :
Basis (Free.ChooseBasisIndex β€ I) β€ I := Free.chooseBasis β€ I
noncomputable def basisOfFractionalIdeal (I : (FractionalIdeal (π K)β° K)Λ£) :
Basis (Free.ChooseBasisIndex β€ I) β K :=
(fractionalIdealBasis K I.1).ofIsLocalizedModule β β€β°
((Submodule.subtype (I : Submodule (π K) K)).restrictScalars β€)
theorem basisOfFractionalIdeal_apply (I : (FractionalIdeal (π K)β° K)Λ£)
(i : Free.ChooseBasisIndex β€ I) :
basisOfFractionalIdeal K I i = fractionalIdealBasis K I.1 i :=
(fractionalIdealBasis K I.1).ofIsLocalizedModule_apply β β€β° _ i
| Mathlib/NumberTheory/NumberField/FractionalIdeal.lean | 87 | 90 | theorem mem_span_basisOfFractionalIdeal {I : (FractionalIdeal (π K)β° K)Λ£} {x : K} :
x β Submodule.span β€ (Set.range (basisOfFractionalIdeal K I)) β x β (I : Set K) := by |
rw [basisOfFractionalIdeal, (fractionalIdealBasis K I.1).ofIsLocalizedModule_span β β€β° _]
simp
| [
" Free β€ β₯βI",
" βI.den β 0",
" Module.Finite β€ β₯βI",
" IsUnit ((algebraMap β€ (End β€ K)) βx)",
" βx β 0",
" β x_1, x_1.2 β’ x = (ββ€ (ββI).subtype) x_1.1",
" β(Ideal.absNorm (βI).num) * (algebraMap (π K) K) a β (fun a => βa) β(βI).num",
" β(Ideal.absNorm (βI).num) * (algebraMap (π K) K) a β IsLocaliza... | [
" Free β€ β₯βI",
" βI.den β 0",
" Module.Finite β€ β₯βI",
" IsUnit ((algebraMap β€ (End β€ K)) βx)",
" βx β 0",
" β x_1, x_1.2 β’ x = (ββ€ (ββI).subtype) x_1.1",
" β(Ideal.absNorm (βI).num) * (algebraMap (π K) K) a β (fun a => βa) β(βI).num",
" β(Ideal.absNorm (βI).num) * (algebraMap (π K) K) a β IsLocaliza... |
import Mathlib.Algebra.Homology.ComplexShape
import Mathlib.CategoryTheory.Subobject.Limits
import Mathlib.CategoryTheory.GradedObject
import Mathlib.Algebra.Homology.ShortComplex.Basic
#align_import algebra.homology.homological_complex from "leanprover-community/mathlib"@"88bca0ce5d22ebfd9e73e682e51d60ea13b48347"
universe v u
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits
variable {ΞΉ : Type*}
variable (V : Type u) [Category.{v} V] [HasZeroMorphisms V]
structure HomologicalComplex (c : ComplexShape ΞΉ) where
X : ΞΉ β V
d : β i j, X i βΆ X j
shape : β i j, Β¬c.Rel i j β d i j = 0 := by aesop_cat
d_comp_d' : β i j k, c.Rel i j β c.Rel j k β d i j β« d j k = 0 := by aesop_cat
#align homological_complex HomologicalComplex
abbrev ChainComplex (Ξ± : Type*) [AddRightCancelSemigroup Ξ±] [One Ξ±] : Type _ :=
HomologicalComplex V (ComplexShape.down Ξ±)
#align chain_complex ChainComplex
abbrev CochainComplex (Ξ± : Type*) [AddRightCancelSemigroup Ξ±] [One Ξ±] : Type _ :=
HomologicalComplex V (ComplexShape.up Ξ±)
#align cochain_complex CochainComplex
namespace CochainComplex
@[simp]
theorem prev (Ξ± : Type*) [AddGroup Ξ±] [One Ξ±] (i : Ξ±) : (ComplexShape.up Ξ±).prev i = i - 1 :=
(ComplexShape.up Ξ±).prev_eq' <| sub_add_cancel _ _
#align cochain_complex.prev CochainComplex.prev
@[simp]
theorem next (Ξ± : Type*) [AddRightCancelSemigroup Ξ±] [One Ξ±] (i : Ξ±) :
(ComplexShape.up Ξ±).next i = i + 1 :=
(ComplexShape.up Ξ±).next_eq' rfl
#align cochain_complex.next CochainComplex.next
@[simp]
| Mathlib/Algebra/Homology/HomologicalComplex.lean | 206 | 211 | theorem prev_nat_zero : (ComplexShape.up β).prev 0 = 0 := by |
classical
refine dif_neg ?_
push_neg
intro
apply Nat.noConfusion
| [
" (ComplexShape.up β).prev 0 = 0",
" Β¬β i, (ComplexShape.up β).Rel i 0",
" β (i : β), Β¬(ComplexShape.up β).Rel i 0",
" Β¬(ComplexShape.up β).Rel iβ 0"
] | [] |
import Mathlib.LinearAlgebra.Contraction
#align_import linear_algebra.coevaluation from "leanprover-community/mathlib"@"d6814c584384ddf2825ff038e868451a7c956f31"
noncomputable section
section coevaluation
open TensorProduct FiniteDimensional
open TensorProduct
universe u v
variable (K : Type u) [Field K]
variable (V : Type v) [AddCommGroup V] [Module K V] [FiniteDimensional K V]
def coevaluation : K ββ[K] V β[K] Module.Dual K V :=
let bV := Basis.ofVectorSpace K V
(Basis.singleton Unit K).constr K fun _ =>
β i : Basis.ofVectorSpaceIndex K V, bV i ββ[K] bV.coord i
#align coevaluation coevaluation
| Mathlib/LinearAlgebra/Coevaluation.lean | 47 | 54 | theorem coevaluation_apply_one :
(coevaluation K V) (1 : K) =
let bV := Basis.ofVectorSpace K V
β i : Basis.ofVectorSpaceIndex K V, bV i ββ[K] bV.coord i := by |
simp only [coevaluation, id]
rw [(Basis.singleton Unit K).constr_apply_fintype K]
simp only [Fintype.univ_punit, Finset.sum_const, one_smul, Basis.singleton_repr,
Basis.equivFun_apply, Basis.coe_ofVectorSpace, one_nsmul, Finset.card_singleton]
| [
" (coevaluation K V) 1 =\n let bV := Basis.ofVectorSpace K V;\n β i : β(Basis.ofVectorSpaceIndex K V), bV i ββ[K] bV.coord i",
" (((Basis.singleton Unit K).constr K) fun x =>\n β i : β(Basis.ofVectorSpaceIndex K V), (Basis.ofVectorSpace K V) i ββ[K] (Basis.ofVectorSpace K V).coord i)\n 1 =\n ... | [] |
import Mathlib.Order.Cover
import Mathlib.Order.Interval.Finset.Defs
#align_import data.finset.locally_finite from "leanprover-community/mathlib"@"442a83d738cb208d3600056c489be16900ba701d"
assert_not_exists MonoidWithZero
assert_not_exists Finset.sum
open Function OrderDual
open FinsetInterval
variable {ΞΉ Ξ± : Type*}
namespace Finset
section Preorder
variable [Preorder Ξ±]
section LocallyFiniteOrder
variable [LocallyFiniteOrder Ξ±] {a aβ aβ b bβ bβ c x : Ξ±}
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_Icc : (Icc a b).Nonempty β a β€ b := by
rw [β coe_nonempty, coe_Icc, Set.nonempty_Icc]
#align finset.nonempty_Icc Finset.nonempty_Icc
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_Ico : (Ico a b).Nonempty β a < b := by
rw [β coe_nonempty, coe_Ico, Set.nonempty_Ico]
#align finset.nonempty_Ico Finset.nonempty_Ico
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
| Mathlib/Order/Interval/Finset/Basic.lean | 67 | 68 | theorem nonempty_Ioc : (Ioc a b).Nonempty β a < b := by |
rw [β coe_nonempty, coe_Ioc, Set.nonempty_Ioc]
| [
" (Icc a b).Nonempty β a β€ b",
" (Ico a b).Nonempty β a < b",
" (Ioc a b).Nonempty β a < b"
] | [
" (Icc a b).Nonempty β a β€ b",
" (Ico a b).Nonempty β a < b"
] |
import Mathlib.Algebra.Order.ToIntervalMod
import Mathlib.Algebra.Ring.AddAut
import Mathlib.Data.Nat.Totient
import Mathlib.GroupTheory.Divisible
import Mathlib.Topology.Connected.PathConnected
import Mathlib.Topology.IsLocalHomeomorph
#align_import topology.instances.add_circle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec"
noncomputable section
open AddCommGroup Set Function AddSubgroup TopologicalSpace
open Topology
variable {π B : Type*}
@[nolint unusedArguments]
abbrev AddCircle [LinearOrderedAddCommGroup π] [TopologicalSpace π] [OrderTopology π] (p : π) :=
π β§Έ zmultiples p
#align add_circle AddCircle
namespace AddCircle
section LinearOrderedAddCommGroup
variable [LinearOrderedAddCommGroup π] [TopologicalSpace π] [OrderTopology π] (p : π)
theorem coe_nsmul {n : β} {x : π} : (β(n β’ x) : AddCircle p) = n β’ (x : AddCircle p) :=
rfl
#align add_circle.coe_nsmul AddCircle.coe_nsmul
theorem coe_zsmul {n : β€} {x : π} : (β(n β’ x) : AddCircle p) = n β’ (x : AddCircle p) :=
rfl
#align add_circle.coe_zsmul AddCircle.coe_zsmul
theorem coe_add (x y : π) : (β(x + y) : AddCircle p) = (x : AddCircle p) + (y : AddCircle p) :=
rfl
#align add_circle.coe_add AddCircle.coe_add
theorem coe_sub (x y : π) : (β(x - y) : AddCircle p) = (x : AddCircle p) - (y : AddCircle p) :=
rfl
#align add_circle.coe_sub AddCircle.coe_sub
theorem coe_neg {x : π} : (β(-x) : AddCircle p) = -(x : AddCircle p) :=
rfl
#align add_circle.coe_neg AddCircle.coe_neg
| Mathlib/Topology/Instances/AddCircle.lean | 152 | 153 | theorem coe_eq_zero_iff {x : π} : (x : AddCircle p) = 0 β β n : β€, n β’ p = x := by |
simp [AddSubgroup.mem_zmultiples_iff]
| [
" βx = 0 β β n, n β’ p = x"
] | [] |
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals
import Mathlib.Analysis.Calculus.ParametricIntegral
import Mathlib.MeasureTheory.Measure.Haar.NormedSpace
#align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb"
open MeasureTheory Set Filter Asymptotics TopologicalSpace
open Real
open Complex hiding exp log abs_of_nonneg
open scoped Topology
noncomputable section
variable {E : Type*} [NormedAddCommGroup E]
section MellinConvergent
theorem mellin_convergent_iff_norm [NormedSpace β E] {f : β β E} {T : Set β} (hT : T β Ioi 0)
(hT' : MeasurableSet T) (hfc : AEStronglyMeasurable f <| volume.restrict <| Ioi 0) {s : β} :
IntegrableOn (fun t : β => (t : β) ^ (s - 1) β’ f t) T β
IntegrableOn (fun t : β => t ^ (s.re - 1) * βf tβ) T := by
have : AEStronglyMeasurable (fun t : β => (t : β) ^ (s - 1) β’ f t) (volume.restrict T) := by
refine ((ContinuousAt.continuousOn ?_).aestronglyMeasurable hT').smul (hfc.mono_set hT)
exact fun t ht => continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt (hT ht))
rw [IntegrableOn, β integrable_norm_iff this, β IntegrableOn]
refine integrableOn_congr_fun (fun t ht => ?_) hT'
simp_rw [norm_smul, Complex.norm_eq_abs, abs_cpow_eq_rpow_re_of_pos (hT ht), sub_re, one_re]
#align mellin_convergent_iff_norm mellin_convergent_iff_norm
theorem mellin_convergent_top_of_isBigO {f : β β β}
(hfc : AEStronglyMeasurable f <| volume.restrict (Ioi 0)) {a s : β}
(hf : f =O[atTop] (Β· ^ (-a))) (hs : s < a) :
β c : β, 0 < c β§ IntegrableOn (fun t : β => t ^ (s - 1) * f t) (Ioi c) := by
obtain β¨d, hd'β© := hf.isBigOWith
simp_rw [IsBigOWith, eventually_atTop] at hd'
obtain β¨e, heβ© := hd'
have he' : 0 < max e 1 := zero_lt_one.trans_le (le_max_right _ _)
refine β¨max e 1, he', ?_, ?_β©
Β· refine AEStronglyMeasurable.mul ?_ (hfc.mono_set (Ioi_subset_Ioi he'.le))
refine (ContinuousAt.continuousOn fun t ht => ?_).aestronglyMeasurable measurableSet_Ioi
exact continuousAt_rpow_const _ _ (Or.inl <| (he'.trans ht).ne')
Β· have : βα΅ t : β βvolume.restrict (Ioi <| max e 1),
βt ^ (s - 1) * f tβ β€ t ^ (s - 1 + -a) * d := by
refine (ae_restrict_mem measurableSet_Ioi).mono fun t ht => ?_
have ht' : 0 < t := he'.trans ht
rw [norm_mul, rpow_add ht', β norm_of_nonneg (rpow_nonneg ht'.le (-a)), mul_assoc,
mul_comm _ d, norm_of_nonneg (rpow_nonneg ht'.le _)]
gcongr
exact he t ((le_max_left e 1).trans_lt ht).le
refine (HasFiniteIntegral.mul_const ?_ _).mono' this
exact (integrableOn_Ioi_rpow_of_lt (by linarith) he').hasFiniteIntegral
set_option linter.uppercaseLean3 false in
#align mellin_convergent_top_of_is_O mellin_convergent_top_of_isBigO
| Mathlib/Analysis/MellinTransform.lean | 237 | 264 | theorem mellin_convergent_zero_of_isBigO {b : β} {f : β β β}
(hfc : AEStronglyMeasurable f <| volume.restrict (Ioi 0))
(hf : f =O[π[>] 0] (Β· ^ (-b))) {s : β} (hs : b < s) :
β c : β, 0 < c β§ IntegrableOn (fun t : β => t ^ (s - 1) * f t) (Ioc 0 c) := by |
obtain β¨d, _, hd'β© := hf.exists_pos
simp_rw [IsBigOWith, eventually_nhdsWithin_iff, Metric.eventually_nhds_iff, gt_iff_lt] at hd'
obtain β¨Ξ΅, hΞ΅, hΞ΅'β© := hd'
refine β¨Ξ΅, hΞ΅, integrableOn_Ioc_iff_integrableOn_Ioo.mpr β¨?_, ?_β©β©
Β· refine AEStronglyMeasurable.mul ?_ (hfc.mono_set Ioo_subset_Ioi_self)
refine (ContinuousAt.continuousOn fun t ht => ?_).aestronglyMeasurable measurableSet_Ioo
exact continuousAt_rpow_const _ _ (Or.inl ht.1.ne')
Β· apply HasFiniteIntegral.mono'
Β· show HasFiniteIntegral (fun t => d * t ^ (s - b - 1)) _
refine (Integrable.hasFiniteIntegral ?_).const_mul _
rw [β IntegrableOn, β integrableOn_Ioc_iff_integrableOn_Ioo, β
intervalIntegrable_iff_integrableOn_Ioc_of_le hΞ΅.le]
exact intervalIntegral.intervalIntegrable_rpow' (by linarith)
Β· refine (ae_restrict_iff' measurableSet_Ioo).mpr (eventually_of_forall fun t ht => ?_)
rw [mul_comm, norm_mul]
specialize hΞ΅' _ ht.1
Β· rw [dist_eq_norm, sub_zero, norm_of_nonneg (le_of_lt ht.1)]
exact ht.2
Β· calc _ β€ d * βt ^ (-b)β * βt ^ (s - 1)β := by gcongr
_ = d * t ^ (s - b - 1) := ?_
simp_rw [norm_of_nonneg (rpow_nonneg (le_of_lt ht.1) _), mul_assoc]
rw [β rpow_add ht.1]
congr 2
abel
| [
" IntegrableOn (fun t => βt ^ (s - 1) β’ f t) T volume β IntegrableOn (fun t => t ^ (s.re - 1) * βf tβ) T volume",
" AEStronglyMeasurable (fun t => βt ^ (s - 1) β’ f t) (volume.restrict T)",
" β x β T, ContinuousAt (fun t => βt ^ (s - 1)) x",
" IntegrableOn (fun a => ββa ^ (s - 1) β’ f aβ) T volume β IntegrableO... | [
" IntegrableOn (fun t => βt ^ (s - 1) β’ f t) T volume β IntegrableOn (fun t => t ^ (s.re - 1) * βf tβ) T volume",
" AEStronglyMeasurable (fun t => βt ^ (s - 1) β’ f t) (volume.restrict T)",
" β x β T, ContinuousAt (fun t => βt ^ (s - 1)) x",
" IntegrableOn (fun a => ββa ^ (s - 1) β’ f aβ) T volume β IntegrableO... |
import Mathlib.Probability.Kernel.MeasurableIntegral
#align_import probability.kernel.composition from "leanprover-community/mathlib"@"3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b"
open MeasureTheory
open scoped ENNReal
namespace ProbabilityTheory
namespace kernel
variable {Ξ± Ξ² ΞΉ : Type*} {mΞ± : MeasurableSpace Ξ±} {mΞ² : MeasurableSpace Ξ²}
section CompositionProduct
variable {Ξ³ : Type*} {mΞ³ : MeasurableSpace Ξ³} {s : Set (Ξ² Γ Ξ³)}
noncomputable def compProdFun (ΞΊ : kernel Ξ± Ξ²) (Ξ· : kernel (Ξ± Γ Ξ²) Ξ³) (a : Ξ±) (s : Set (Ξ² Γ Ξ³)) :
ββ₯0β :=
β«β» b, Ξ· (a, b) {c | (b, c) β s} βΞΊ a
#align probability_theory.kernel.comp_prod_fun ProbabilityTheory.kernel.compProdFun
| Mathlib/Probability/Kernel/Composition.lean | 93 | 96 | theorem compProdFun_empty (ΞΊ : kernel Ξ± Ξ²) (Ξ· : kernel (Ξ± Γ Ξ²) Ξ³) (a : Ξ±) :
compProdFun ΞΊ Ξ· a β
= 0 := by |
simp only [compProdFun, Set.mem_empty_iff_false, Set.setOf_false, measure_empty,
MeasureTheory.lintegral_const, zero_mul]
| [
" compProdFun ΞΊ Ξ· a β
= 0"
] | [] |
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]
theorem add_top (a : WithTop Ξ±) : a + β€ = β€ := by cases a <;> rfl
#align with_top.add_top WithTop.add_top
@[simp]
theorem add_eq_top : a + b = β€ β a = β€ β¨ b = β€ := by
match a, b with
| β€, _ => simp
| _, β€ => simp
| (a : Ξ±), (b : Ξ±) => simp only [β coe_add, coe_ne_top, or_false]
#align with_top.add_eq_top WithTop.add_eq_top
theorem add_ne_top : a + b β β€ β a β β€ β§ b β β€ :=
add_eq_top.not.trans not_or
#align with_top.add_ne_top WithTop.add_ne_top
theorem add_lt_top [LT Ξ±] {a b : WithTop Ξ±} : a + b < β€ β a < β€ β§ b < β€ := by
simp_rw [WithTop.lt_top_iff_ne_top, add_ne_top]
#align with_top.add_lt_top WithTop.add_lt_top
theorem add_eq_coe :
β {a b : WithTop Ξ±} {c : Ξ±}, a + b = c β β a' b' : Ξ±, βa' = a β§ βb' = b β§ a' + b' = c
| β€, b, c => by simp
| some a, β€, c => by simp
| some a, some b, c => by norm_cast; simp
#align with_top.add_eq_coe WithTop.add_eq_coe
-- Porting note (#10618): simp can already prove this.
-- @[simp]
| Mathlib/Algebra/Order/Monoid/WithTop.lean | 156 | 156 | theorem add_coe_eq_top_iff {x : WithTop Ξ±} {y : Ξ±} : x + y = β€ β x = β€ := by | simp
| [
" a + β€ = β€",
" β€ + β€ = β€",
" βaβ + β€ = β€",
" a + b = β€ β a = β€ β¨ b = β€",
" β€ + xβ = β€ β β€ = β€ β¨ xβ = β€",
" xβ + β€ = β€ β xβ = β€ β¨ β€ = β€",
" βa + βb = β€ β βa = β€ β¨ βb = β€",
" a + b < β€ β a < β€ β§ b < β€",
" β€ + b = βc β β a' b', βa' = β€ β§ βb' = b β§ a' + b' = c",
" βa + β€ = βc β β a' b', βa' = βa β§ βb... | [
" a + β€ = β€",
" β€ + β€ = β€",
" βaβ + β€ = β€",
" a + b = β€ β a = β€ β¨ b = β€",
" β€ + xβ = β€ β β€ = β€ β¨ xβ = β€",
" xβ + β€ = β€ β xβ = β€ β¨ β€ = β€",
" βa + βb = β€ β βa = β€ β¨ βb = β€",
" a + b < β€ β a < β€ β§ b < β€",
" β€ + b = βc β β a' b', βa' = β€ β§ βb' = b β§ a' + b' = c",
" βa + β€ = βc β β a' b', βa' = βa β§ βb... |
import Mathlib.CategoryTheory.Sites.Grothendieck
import Mathlib.CategoryTheory.Sites.Pretopology
import Mathlib.CategoryTheory.Limits.Lattice
import Mathlib.Topology.Sets.Opens
#align_import category_theory.sites.spaces from "leanprover-community/mathlib"@"b6fa3beb29f035598cf0434d919694c5e98091eb"
universe u
namespace Opens
variable (T : Type u) [TopologicalSpace T]
open CategoryTheory TopologicalSpace CategoryTheory.Limits
def grothendieckTopology : GrothendieckTopology (Opens T) where
sieves X S := β x β X, β (U : _) (f : U βΆ X), S f β§ x β U
top_mem' X x hx := β¨_, π _, trivial, hxβ©
pullback_stable' X Y S f hf y hy := by
rcases hf y (f.le hy) with β¨U, g, hg, hUβ©
refine β¨U β Y, homOfLE inf_le_right, ?_, hU, hyβ©
apply S.downward_closed hg (homOfLE inf_le_left)
transitive' X S hS R hR x hx := by
rcases hS x hx with β¨U, f, hf, hUβ©
rcases hR hf _ hU with β¨V, g, hg, hVβ©
exact β¨_, g β« f, hg, hVβ©
#align opens.grothendieck_topology Opens.grothendieckTopology
def pretopology : Pretopology (Opens T) where
coverings X R := β x β X, β (U : _) (f : U βΆ X), R f β§ x β U
has_isos X Y f i x hx := β¨_, _, Presieve.singleton_self _, (inv f).le hxβ©
pullbacks X Y f S hS x hx := by
rcases hS _ (f.le hx) with β¨U, g, hg, hUβ©
refine β¨_, _, Presieve.pullbackArrows.mk _ _ hg, ?_β©
have : U β Y β€ pullback g f :=
leOfHom (pullback.lift (homOfLE inf_le_left) (homOfLE inf_le_right) rfl)
apply this β¨hU, hxβ©
transitive X S Ti hS hTi x hx := by
rcases hS x hx with β¨U, f, hf, hUβ©
rcases hTi f hf x hU with β¨V, g, hg, hVβ©
exact β¨_, _, β¨_, g, f, hf, hg, rflβ©, hVβ©
#align opens.pretopology Opens.pretopology
@[simp]
theorem pretopology_ofGrothendieck :
Pretopology.ofGrothendieck _ (Opens.grothendieckTopology T) = Opens.pretopology T := by
apply le_antisymm
Β· intro X R hR x hx
rcases hR x hx with β¨U, f, β¨V, gβ, gβ, hgβ, _β©, hUβ©
exact β¨V, gβ, hgβ, gβ.le hUβ©
Β· intro X R hR x hx
rcases hR x hx with β¨U, f, hf, hUβ©
exact β¨U, f, Sieve.le_generate R U hf, hUβ©
#align opens.pretopology_of_grothendieck Opens.pretopology_ofGrothendieck
@[simp]
| Mathlib/CategoryTheory/Sites/Spaces.lean | 92 | 95 | theorem pretopology_toGrothendieck :
Pretopology.toGrothendieck _ (Opens.pretopology T) = Opens.grothendieckTopology T := by |
rw [β pretopology_ofGrothendieck]
apply (Pretopology.gi (Opens T)).l_u_eq
| [
" β U f_1, (Sieve.pullback f S).arrows f_1 β§ y β U",
" (Sieve.pullback f S).arrows (homOfLE β―)",
" β U f, R.arrows f β§ x β U",
" β U f_1, Presieve.pullbackArrows f S f_1 β§ x β U",
" x β pullback g f",
" β U f, S.bind Ti f β§ x β U",
" Pretopology.ofGrothendieck (Opens T) (grothendieckTopology T) = pretop... | [
" β U f_1, (Sieve.pullback f S).arrows f_1 β§ y β U",
" (Sieve.pullback f S).arrows (homOfLE β―)",
" β U f, R.arrows f β§ x β U",
" β U f_1, Presieve.pullbackArrows f S f_1 β§ x β U",
" x β pullback g f",
" β U f, S.bind Ti f β§ x β U",
" Pretopology.ofGrothendieck (Opens T) (grothendieckTopology T) = pretop... |
import Mathlib.Data.Set.Image
import Mathlib.Order.Interval.Set.Basic
#align_import data.set.intervals.with_bot_top from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
open Set
variable {Ξ± : Type*}
namespace WithTop
@[simp]
theorem preimage_coe_top : (some : Ξ± β WithTop Ξ±) β»ΒΉ' {β€} = (β
: Set Ξ±) :=
eq_empty_of_subset_empty fun _ => coe_ne_top
#align with_top.preimage_coe_top WithTop.preimage_coe_top
variable [Preorder Ξ±] {a b : Ξ±}
| Mathlib/Order/Interval/Set/WithBotTop.lean | 33 | 35 | theorem range_coe : range (some : Ξ± β WithTop Ξ±) = Iio β€ := by |
ext x
rw [mem_Iio, WithTop.lt_top_iff_ne_top, mem_range, ne_top_iff_exists]
| [
" range some = Iio β€",
" x β range some β x β Iio β€"
] | [] |
import Mathlib.Algebra.Polynomial.Eval
#align_import data.polynomial.degree.lemmas from "leanprover-community/mathlib"@"728baa2f54e6062c5879a3e397ac6bac323e506f"
noncomputable section
open Polynomial
open Finsupp Finset
namespace Polynomial
universe u v w
variable {R : Type u} {S : Type v} {ΞΉ : Type w} {a b : R} {m n : β}
section Semiring
variable [Semiring R] {p q r : R[X]}
section NoZeroDivisors
variable [Semiring R] [NoZeroDivisors R] {p q : R[X]} {a : R}
theorem degree_mul_C (a0 : a β 0) : (p * C a).degree = p.degree := by
rw [degree_mul, degree_C a0, add_zero]
set_option linter.uppercaseLean3 false in
#align polynomial.degree_mul_C Polynomial.degree_mul_C
theorem degree_C_mul (a0 : a β 0) : (C a * p).degree = p.degree := by
rw [degree_mul, degree_C a0, zero_add]
set_option linter.uppercaseLean3 false in
#align polynomial.degree_C_mul Polynomial.degree_C_mul
| Mathlib/Algebra/Polynomial/Degree/Lemmas.lean | 366 | 367 | theorem natDegree_mul_C (a0 : a β 0) : (p * C a).natDegree = p.natDegree := by |
simp only [natDegree, degree_mul_C a0]
| [
" (p * C a).degree = p.degree",
" (C a * p).degree = p.degree",
" (p * C a).natDegree = p.natDegree"
] | [
" (p * C a).degree = p.degree",
" (C a * p).degree = p.degree"
] |
import Mathlib.LinearAlgebra.Eigenspace.Basic
import Mathlib.FieldTheory.Minpoly.Field
#align_import linear_algebra.eigenspace.minpoly from "leanprover-community/mathlib"@"c3216069e5f9369e6be586ccbfcde2592b3cec92"
universe u v w
namespace Module
namespace End
open Polynomial FiniteDimensional
open scoped Polynomial
variable {K : Type v} {V : Type w} [Field K] [AddCommGroup V] [Module K V]
theorem eigenspace_aeval_polynomial_degree_1 (f : End K V) (q : K[X]) (hq : degree q = 1) :
eigenspace f (-q.coeff 0 / q.leadingCoeff) = LinearMap.ker (aeval f q) :=
calc
eigenspace f (-q.coeff 0 / q.leadingCoeff)
_ = LinearMap.ker (q.leadingCoeff β’ f - algebraMap K (End K V) (-q.coeff 0)) := by
rw [eigenspace_div]
intro h
rw [leadingCoeff_eq_zero_iff_deg_eq_bot.1 h] at hq
cases hq
_ = LinearMap.ker (aeval f (C q.leadingCoeff * X + C (q.coeff 0))) := by
rw [C_mul', aeval_def]; simp [algebraMap, Algebra.toRingHom]
_ = LinearMap.ker (aeval f q) := by rwa [β eq_X_add_C_of_degree_eq_one]
#align module.End.eigenspace_aeval_polynomial_degree_1 Module.End.eigenspace_aeval_polynomial_degree_1
| Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean | 46 | 51 | theorem ker_aeval_ring_hom'_unit_polynomial (f : End K V) (c : K[X]Λ£) :
LinearMap.ker (aeval f (c : K[X])) = β₯ := by |
rw [Polynomial.eq_C_of_degree_eq_zero (degree_coe_units c)]
simp only [aeval_def, evalβ_C]
apply ker_algebraMap_end
apply coeff_coe_units_zero_ne_zero c
| [
" f.eigenspace (-q.coeff 0 / q.leadingCoeff) =\n LinearMap.ker (q.leadingCoeff β’ f - (algebraMap K (End K V)) (-q.coeff 0))",
" q.leadingCoeff β 0",
" False",
" LinearMap.ker (q.leadingCoeff β’ f - (algebraMap K (End K V)) (-q.coeff 0)) =\n LinearMap.ker ((aeval f) (C q.leadingCoeff * X + C (q.coeff 0)))... | [
" f.eigenspace (-q.coeff 0 / q.leadingCoeff) =\n LinearMap.ker (q.leadingCoeff β’ f - (algebraMap K (End K V)) (-q.coeff 0))",
" q.leadingCoeff β 0",
" False",
" LinearMap.ker (q.leadingCoeff β’ f - (algebraMap K (End K V)) (-q.coeff 0)) =\n LinearMap.ker ((aeval f) (C q.leadingCoeff * X + C (q.coeff 0)))... |
import Mathlib.Algebra.Group.Hom.Defs
import Mathlib.Algebra.Group.Units
#align_import algebra.hom.units from "leanprover-community/mathlib"@"a07d750983b94c530ab69a726862c2ab6802b38c"
assert_not_exists MonoidWithZero
assert_not_exists DenselyOrdered
open Function
universe u v w
namespace Units
variable {Ξ± : Type*} {M : Type u} {N : Type v} {P : Type w} [Monoid M] [Monoid N] [Monoid P]
@[to_additive "The additive homomorphism on `AddUnit`s induced by an `AddMonoidHom`."]
def map (f : M β* N) : MΛ£ β* NΛ£ :=
MonoidHom.mk'
(fun u => β¨f u.val, f u.inv,
by rw [β f.map_mul, u.val_inv, f.map_one],
by rw [β f.map_mul, u.inv_val, f.map_one]β©)
fun x y => ext (f.map_mul x y)
#align units.map Units.map
#align add_units.map AddUnits.map
@[to_additive (attr := simp)]
theorem coe_map (f : M β* N) (x : MΛ£) : β(map f x) = f x := rfl
#align units.coe_map Units.coe_map
#align add_units.coe_map AddUnits.coe_map
@[to_additive (attr := simp)]
theorem coe_map_inv (f : M β* N) (u : MΛ£) : β(map f u)β»ΒΉ = f βuβ»ΒΉ := rfl
#align units.coe_map_inv Units.coe_map_inv
#align add_units.coe_map_neg AddUnits.coe_map_neg
@[to_additive (attr := simp)]
theorem map_comp (f : M β* N) (g : N β* P) : map (g.comp f) = (map g).comp (map f) := rfl
#align units.map_comp Units.map_comp
#align add_units.map_comp AddUnits.map_comp
@[to_additive]
lemma map_injective {f : M β* N} (hf : Function.Injective f) :
Function.Injective (map f) := fun _ _ e => ext (hf (congr_arg val e))
variable (M)
@[to_additive (attr := simp)]
| Mathlib/Algebra/Group/Units/Hom.lean | 94 | 94 | theorem map_id : map (MonoidHom.id M) = MonoidHom.id MΛ£ := by | ext; rfl
| [
" f βu * f u.inv = 1",
" f u.inv * f βu = 1",
" map (MonoidHom.id M) = MonoidHom.id MΛ£",
" β((map (MonoidHom.id M)) xβ) = β((MonoidHom.id MΛ£) xβ)"
] | [
" f βu * f u.inv = 1",
" f u.inv * f βu = 1"
] |
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic
#align_import measure_theory.function.egorov from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open scoped Classical
open MeasureTheory NNReal ENNReal Topology
namespace MeasureTheory
open Set Filter TopologicalSpace
variable {Ξ± Ξ² ΞΉ : Type*} {m : MeasurableSpace Ξ±} [MetricSpace Ξ²] {ΞΌ : Measure Ξ±}
namespace Egorov
def notConvergentSeq [Preorder ΞΉ] (f : ΞΉ β Ξ± β Ξ²) (g : Ξ± β Ξ²) (n : β) (j : ΞΉ) : Set Ξ± :=
β (k) (_ : j β€ k), { x | 1 / (n + 1 : β) < dist (f k x) (g x) }
#align measure_theory.egorov.not_convergent_seq MeasureTheory.Egorov.notConvergentSeq
variable {n : β} {i j : ΞΉ} {s : Set Ξ±} {Ξ΅ : β} {f : ΞΉ β Ξ± β Ξ²} {g : Ξ± β Ξ²}
| Mathlib/MeasureTheory/Function/Egorov.lean | 50 | 52 | theorem mem_notConvergentSeq_iff [Preorder ΞΉ] {x : Ξ±} :
x β notConvergentSeq f g n j β β k β₯ j, 1 / (n + 1 : β) < dist (f k x) (g x) := by |
simp_rw [notConvergentSeq, Set.mem_iUnion, exists_prop, mem_setOf]
| [
" x β notConvergentSeq f g n j β β k β₯ j, 1 / (βn + 1) < dist (f k x) (g x)"
] | [] |
import Mathlib.MeasureTheory.Integral.SetToL1
#align_import measure_theory.integral.bochner from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4"
assert_not_exists Differentiable
noncomputable section
open scoped Topology NNReal ENNReal MeasureTheory
open Set Filter TopologicalSpace ENNReal EMetric
namespace MeasureTheory
variable {Ξ± E F π : Type*}
section WeightedSMul
open ContinuousLinearMap
variable [NormedAddCommGroup F] [NormedSpace β F] {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±}
def weightedSMul {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (s : Set Ξ±) : F βL[β] F :=
(ΞΌ s).toReal β’ ContinuousLinearMap.id β F
#align measure_theory.weighted_smul MeasureTheory.weightedSMul
theorem weightedSMul_apply {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (s : Set Ξ±) (x : F) :
weightedSMul ΞΌ s x = (ΞΌ s).toReal β’ x := by simp [weightedSMul]
#align measure_theory.weighted_smul_apply MeasureTheory.weightedSMul_apply
@[simp]
theorem weightedSMul_zero_measure {m : MeasurableSpace Ξ±} :
weightedSMul (0 : Measure Ξ±) = (0 : Set Ξ± β F βL[β] F) := by ext1; simp [weightedSMul]
#align measure_theory.weighted_smul_zero_measure MeasureTheory.weightedSMul_zero_measure
@[simp]
| Mathlib/MeasureTheory/Integral/Bochner.lean | 181 | 182 | theorem weightedSMul_empty {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) :
weightedSMul ΞΌ β
= (0 : F βL[β] F) := by | ext1 x; rw [weightedSMul_apply]; simp
| [
" (weightedSMul ΞΌ s) x = (ΞΌ s).toReal β’ x",
" weightedSMul 0 = 0",
" weightedSMul 0 xβ = 0 xβ",
" weightedSMul ΞΌ β
= 0",
" (weightedSMul ΞΌ β
) x = 0 x",
" (ΞΌ β
).toReal β’ x = 0 x"
] | [
" (weightedSMul ΞΌ s) x = (ΞΌ s).toReal β’ x",
" weightedSMul 0 = 0",
" weightedSMul 0 xβ = 0 xβ"
] |
import Mathlib.Algebra.Group.Commute.Basic
import Mathlib.Data.Fintype.Card
import Mathlib.GroupTheory.Perm.Basic
#align_import group_theory.perm.support from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Equiv Finset
namespace Equiv.Perm
variable {Ξ± : Type*}
section IsSwap
variable [DecidableEq Ξ±]
def IsSwap (f : Perm Ξ±) : Prop :=
β x y, x β y β§ f = swap x y
#align equiv.perm.is_swap Equiv.Perm.IsSwap
@[simp]
theorem ofSubtype_swap_eq {p : Ξ± β Prop} [DecidablePred p] (x y : Subtype p) :
ofSubtype (Equiv.swap x y) = Equiv.swap βx βy :=
Equiv.ext fun z => by
by_cases hz : p z
Β· rw [swap_apply_def, ofSubtype_apply_of_mem _ hz]
split_ifs with hzx hzy
Β· simp_rw [hzx, Subtype.coe_eta, swap_apply_left]
Β· simp_rw [hzy, Subtype.coe_eta, swap_apply_right]
Β· rw [swap_apply_of_ne_of_ne] <;>
simp [Subtype.ext_iff, *]
Β· rw [ofSubtype_apply_of_not_mem _ hz, swap_apply_of_ne_of_ne]
Β· intro h
apply hz
rw [h]
exact Subtype.prop x
intro h
apply hz
rw [h]
exact Subtype.prop y
#align equiv.perm.of_subtype_swap_eq Equiv.Perm.ofSubtype_swap_eq
theorem IsSwap.of_subtype_isSwap {p : Ξ± β Prop} [DecidablePred p] {f : Perm (Subtype p)}
(h : f.IsSwap) : (ofSubtype f).IsSwap :=
let β¨β¨x, hxβ©, β¨y, hyβ©, hxyβ© := h
β¨x, y, by
simp only [Ne, Subtype.ext_iff] at hxy
exact hxy.1, by
rw [hxy.2, ofSubtype_swap_eq]β©
#align equiv.perm.is_swap.of_subtype_is_swap Equiv.Perm.IsSwap.of_subtype_isSwap
| Mathlib/GroupTheory/Perm/Support.lean | 248 | 253 | theorem ne_and_ne_of_swap_mul_apply_ne_self {f : Perm Ξ±} {x y : Ξ±} (hy : (swap x (f x) * f) y β y) :
f y β y β§ y β x := by |
simp only [swap_apply_def, mul_apply, f.injective.eq_iff] at *
by_cases h : f y = x
Β· constructor <;> intro <;> simp_all only [if_true, eq_self_iff_true, not_true, Ne]
Β· split_ifs at hy with h h <;> try { simp [*] at * }
| [
" (ofSubtype (swap x y)) z = (swap βx βy) z",
" β((swap x y) β¨z, hzβ©) = if z = βx then βy else if z = βy then βx else z",
" β((swap x y) β¨z, hzβ©) = βy",
" β((swap x y) β¨z, hzβ©) = βx",
" β((swap x y) β¨z, hzβ©) = z",
" β¨z, hzβ© β x",
" β¨z, hzβ© β y",
" z β βx",
" False",
" p z",
" p βx",
" z β βy",... | [
" (ofSubtype (swap x y)) z = (swap βx βy) z",
" β((swap x y) β¨z, hzβ©) = if z = βx then βy else if z = βy then βx else z",
" β((swap x y) β¨z, hzβ©) = βy",
" β((swap x y) β¨z, hzβ©) = βx",
" β((swap x y) β¨z, hzβ©) = z",
" β¨z, hzβ© β x",
" β¨z, hzβ© β y",
" z β βx",
" False",
" p z",
" p βx",
" z β βy",... |
import Mathlib.Data.Rat.Cast.Defs
import Mathlib.Algebra.Field.Basic
#align_import data.rat.cast from "leanprover-community/mathlib"@"acebd8d49928f6ed8920e502a6c90674e75bd441"
namespace Rat
variable {Ξ± : Type*} [DivisionRing Ξ±]
-- Porting note: rewrote proof
@[simp]
theorem cast_inv_nat (n : β) : ((nβ»ΒΉ : β) : Ξ±) = (n : Ξ±)β»ΒΉ := by
cases' n with n
Β· simp
rw [cast_def, inv_natCast_num, inv_natCast_den, if_neg n.succ_ne_zero,
Int.sign_eq_one_of_pos (Nat.cast_pos.mpr n.succ_pos), Int.cast_one, one_div]
#align rat.cast_inv_nat Rat.cast_inv_nat
-- Porting note: proof got a lot easier - is this still the intended statement?
@[simp]
theorem cast_inv_int (n : β€) : ((nβ»ΒΉ : β) : Ξ±) = (n : Ξ±)β»ΒΉ := by
cases' n with n n
Β· simp [ofInt_eq_cast, cast_inv_nat]
Β· simp only [ofInt_eq_cast, Int.cast_negSucc, β Nat.cast_succ, cast_neg, inv_neg, cast_inv_nat]
#align rat.cast_inv_int Rat.cast_inv_int
@[simp, norm_cast]
theorem cast_nnratCast {K} [DivisionRing K] (q : ββ₯0) :
((q : β) : K) = (q : K) := by
rw [Rat.cast_def, NNRat.cast_def, NNRat.cast_def]
have hn := @num_div_eq_of_coprime q.num q.den ?hdp q.coprime_num_den
on_goal 1 => have hd := @den_div_eq_of_coprime q.num q.den ?hdp q.coprime_num_den
case hdp => simpa only [Nat.cast_pos] using q.den_pos
simp only [Int.cast_natCast, Nat.cast_inj] at hn hd
rw [hn, hd, Int.cast_natCast]
@[simp, norm_cast]
| Mathlib/Data/Rat/Cast/Lemmas.lean | 55 | 57 | theorem cast_ofScientific {K} [DivisionRing K] (m : β) (s : Bool) (e : β) :
(OfScientific.ofScientific m s e : β) = (OfScientific.ofScientific m s e : K) := by |
rw [β NNRat.cast_ofScientific (K := K), β NNRat.cast_ofScientific, cast_nnratCast]
| [
" β(βn)β»ΒΉ = (βn)β»ΒΉ",
" β(β0)β»ΒΉ = (β0)β»ΒΉ",
" β(β(n + 1))β»ΒΉ = (β(n + 1))β»ΒΉ",
" β(β(Int.ofNat n))β»ΒΉ = (β(Int.ofNat n))β»ΒΉ",
" β(β(Int.negSucc n))β»ΒΉ = (β(Int.negSucc n))β»ΒΉ",
" ββq = βq",
" β(βq.num / βq.den).num / β(βq.num / βq.den).den = βq.num / βq.den",
" 0 < βq.den",
" β(OfScientific.ofScientific m s... | [
" β(βn)β»ΒΉ = (βn)β»ΒΉ",
" β(β0)β»ΒΉ = (β0)β»ΒΉ",
" β(β(n + 1))β»ΒΉ = (β(n + 1))β»ΒΉ",
" β(β(Int.ofNat n))β»ΒΉ = (β(Int.ofNat n))β»ΒΉ",
" β(β(Int.negSucc n))β»ΒΉ = (β(Int.negSucc n))β»ΒΉ",
" ββq = βq",
" β(βq.num / βq.den).num / β(βq.num / βq.den).den = βq.num / βq.den",
" 0 < βq.den"
] |
import Mathlib.Analysis.Calculus.BumpFunction.Basic
import Mathlib.MeasureTheory.Integral.SetIntegral
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
#align_import analysis.calculus.bump_function_inner from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
noncomputable section
open Function Filter Set Metric MeasureTheory FiniteDimensional Measure
open scoped Topology
namespace ContDiffBump
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [HasContDiffBump E]
[MeasurableSpace E] {c : E} (f : ContDiffBump c) {x : E} {n : ββ} {ΞΌ : Measure E}
protected def normed (ΞΌ : Measure E) : E β β := fun x => f x / β« x, f x βΞΌ
#align cont_diff_bump.normed ContDiffBump.normed
theorem normed_def {ΞΌ : Measure E} (x : E) : f.normed ΞΌ x = f x / β« x, f x βΞΌ :=
rfl
#align cont_diff_bump.normed_def ContDiffBump.normed_def
theorem nonneg_normed (x : E) : 0 β€ f.normed ΞΌ x :=
div_nonneg f.nonneg <| integral_nonneg f.nonneg'
#align cont_diff_bump.nonneg_normed ContDiffBump.nonneg_normed
theorem contDiff_normed {n : ββ} : ContDiff β n (f.normed ΞΌ) :=
f.contDiff.div_const _
#align cont_diff_bump.cont_diff_normed ContDiffBump.contDiff_normed
theorem continuous_normed : Continuous (f.normed ΞΌ) :=
f.continuous.div_const _
#align cont_diff_bump.continuous_normed ContDiffBump.continuous_normed
theorem normed_sub (x : E) : f.normed ΞΌ (c - x) = f.normed ΞΌ (c + x) := by
simp_rw [f.normed_def, f.sub]
#align cont_diff_bump.normed_sub ContDiffBump.normed_sub
theorem normed_neg (f : ContDiffBump (0 : E)) (x : E) : f.normed ΞΌ (-x) = f.normed ΞΌ x := by
simp_rw [f.normed_def, f.neg]
#align cont_diff_bump.normed_neg ContDiffBump.normed_neg
variable [BorelSpace E] [FiniteDimensional β E] [IsLocallyFiniteMeasure ΞΌ]
protected theorem integrable : Integrable f ΞΌ :=
f.continuous.integrable_of_hasCompactSupport f.hasCompactSupport
#align cont_diff_bump.integrable ContDiffBump.integrable
protected theorem integrable_normed : Integrable (f.normed ΞΌ) ΞΌ :=
f.integrable.div_const _
#align cont_diff_bump.integrable_normed ContDiffBump.integrable_normed
variable [ΞΌ.IsOpenPosMeasure]
theorem integral_pos : 0 < β« x, f x βΞΌ := by
refine (integral_pos_iff_support_of_nonneg f.nonneg' f.integrable).mpr ?_
rw [f.support_eq]
exact measure_ball_pos ΞΌ c f.rOut_pos
#align cont_diff_bump.integral_pos ContDiffBump.integral_pos
theorem integral_normed : β« x, f.normed ΞΌ x βΞΌ = 1 := by
simp_rw [ContDiffBump.normed, div_eq_mul_inv, mul_comm (f _), β smul_eq_mul, integral_smul]
exact inv_mul_cancel f.integral_pos.ne'
#align cont_diff_bump.integral_normed ContDiffBump.integral_normed
theorem support_normed_eq : Function.support (f.normed ΞΌ) = Metric.ball c f.rOut := by
unfold ContDiffBump.normed
rw [support_div, f.support_eq, support_const f.integral_pos.ne', inter_univ]
#align cont_diff_bump.support_normed_eq ContDiffBump.support_normed_eq
theorem tsupport_normed_eq : tsupport (f.normed ΞΌ) = Metric.closedBall c f.rOut := by
rw [tsupport, f.support_normed_eq, closure_ball _ f.rOut_pos.ne']
#align cont_diff_bump.tsupport_normed_eq ContDiffBump.tsupport_normed_eq
theorem hasCompactSupport_normed : HasCompactSupport (f.normed ΞΌ) := by
simp only [HasCompactSupport, f.tsupport_normed_eq (ΞΌ := ΞΌ), isCompact_closedBall]
#align cont_diff_bump.has_compact_support_normed ContDiffBump.hasCompactSupport_normed
theorem tendsto_support_normed_smallSets {ΞΉ} {Ο : ΞΉ β ContDiffBump c} {l : Filter ΞΉ}
(hΟ : Tendsto (fun i => (Ο i).rOut) l (π 0)) :
Tendsto (fun i => Function.support fun x => (Ο i).normed ΞΌ x) l (π c).smallSets := by
simp_rw [NormedAddCommGroup.tendsto_nhds_zero, Real.norm_eq_abs,
abs_eq_self.mpr (Ο _).rOut_pos.le] at hΟ
rw [nhds_basis_ball.smallSets.tendsto_right_iff]
refine fun Ξ΅ hΞ΅ β¦ (hΟ Ξ΅ hΞ΅).mono fun i hi β¦ ?_
rw [(Ο i).support_normed_eq]
exact ball_subset_ball hi.le
#align cont_diff_bump.tendsto_support_normed_small_sets ContDiffBump.tendsto_support_normed_smallSets
variable (ΞΌ)
theorem integral_normed_smul {X} [NormedAddCommGroup X] [NormedSpace β X]
[CompleteSpace X] (z : X) : β« x, f.normed ΞΌ x β’ z βΞΌ = z := by
simp_rw [integral_smul_const, f.integral_normed (ΞΌ := ΞΌ), one_smul]
#align cont_diff_bump.integral_normed_smul ContDiffBump.integral_normed_smul
theorem measure_closedBall_le_integral : (ΞΌ (closedBall c f.rIn)).toReal β€ β« x, f x βΞΌ := by calc
(ΞΌ (closedBall c f.rIn)).toReal = β« x in closedBall c f.rIn, 1 βΞΌ := by simp
_ = β« x in closedBall c f.rIn, f x βΞΌ := setIntegral_congr measurableSet_closedBall
(fun x hx β¦ (one_of_mem_closedBall f hx).symm)
_ β€ β« x, f x βΞΌ := setIntegral_le_integral f.integrable (eventually_of_forall (fun x β¦ f.nonneg))
| Mathlib/Analysis/Calculus/BumpFunction/Normed.lean | 117 | 123 | theorem normed_le_div_measure_closedBall_rIn (x : E) :
f.normed ΞΌ x β€ 1 / (ΞΌ (closedBall c f.rIn)).toReal := by |
rw [normed_def]
gcongr
Β· exact ENNReal.toReal_pos (measure_closedBall_pos _ _ f.rIn_pos).ne' measure_closedBall_lt_top.ne
Β· exact f.le_one
Β· exact f.measure_closedBall_le_integral ΞΌ
| [
" f.normed ΞΌ (c - x) = f.normed ΞΌ (c + x)",
" f.normed ΞΌ (-x) = f.normed ΞΌ x",
" 0 < β« (x : E), βf x βΞΌ",
" 0 < ΞΌ (support fun i => βf i)",
" 0 < ΞΌ (ball c f.rOut)",
" β« (x : E), f.normed ΞΌ x βΞΌ = 1",
" (β« (x : E), βf x βΞΌ)β»ΒΉ β’ β« (x : E), βf x βΞΌ = 1",
" support (f.normed ΞΌ) = ball c f.rOut",
" (sup... | [
" f.normed ΞΌ (c - x) = f.normed ΞΌ (c + x)",
" f.normed ΞΌ (-x) = f.normed ΞΌ x",
" 0 < β« (x : E), βf x βΞΌ",
" 0 < ΞΌ (support fun i => βf i)",
" 0 < ΞΌ (ball c f.rOut)",
" β« (x : E), f.normed ΞΌ x βΞΌ = 1",
" (β« (x : E), βf x βΞΌ)β»ΒΉ β’ β« (x : E), βf x βΞΌ = 1",
" support (f.normed ΞΌ) = ball c f.rOut",
" (sup... |
import Mathlib.Data.Fintype.Option
import Mathlib.Data.Fintype.Perm
import Mathlib.Data.Fintype.Prod
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Option
#align_import group_theory.perm.option from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open Equiv
@[simp]
theorem Equiv.optionCongr_one {Ξ± : Type*} : (1 : Perm Ξ±).optionCongr = 1 :=
Equiv.optionCongr_refl
#align equiv.option_congr_one Equiv.optionCongr_one
@[simp]
theorem Equiv.optionCongr_swap {Ξ± : Type*} [DecidableEq Ξ±] (x y : Ξ±) :
optionCongr (swap x y) = swap (some x) (some y) := by
ext (_ | i)
Β· simp [swap_apply_of_ne_of_ne]
Β· by_cases hx : i = x
Β· simp only [hx, optionCongr_apply, Option.map_some', swap_apply_left, Option.mem_def,
Option.some.injEq]
by_cases hy : i = y <;> simp [hx, hy, swap_apply_of_ne_of_ne]
#align equiv.option_congr_swap Equiv.optionCongr_swap
@[simp]
theorem Equiv.optionCongr_sign {Ξ± : Type*} [DecidableEq Ξ±] [Fintype Ξ±] (e : Perm Ξ±) :
Perm.sign e.optionCongr = Perm.sign e := by
refine Perm.swap_induction_on e ?_ ?_
Β· simp [Perm.one_def]
Β· intro f x y hne h
simp [h, hne, Perm.mul_def, β Equiv.optionCongr_trans]
#align equiv.option_congr_sign Equiv.optionCongr_sign
@[simp]
theorem map_equiv_removeNone {Ξ± : Type*} [DecidableEq Ξ±] (Ο : Perm (Option Ξ±)) :
(removeNone Ο).optionCongr = swap none (Ο none) * Ο := by
ext1 x
have : Option.map (β(removeNone Ο)) x = (swap none (Ο none)) (Ο x) := by
cases' x with x
Β· simp
Β· cases h : Ο (some _)
Β· simp [removeNone_none _ h]
Β· have hn : Ο (some x) β none := by simp [h]
have hΟn : Ο (some x) β Ο none := Ο.injective.ne (by simp)
simp [removeNone_some _ β¨_, hβ©, β h, swap_apply_of_ne_of_ne hn hΟn]
simpa using this
#align map_equiv_remove_none map_equiv_removeNone
@[simps]
def Equiv.Perm.decomposeOption {Ξ± : Type*} [DecidableEq Ξ±] :
Perm (Option Ξ±) β Option Ξ± Γ Perm Ξ± where
toFun Ο := (Ο none, removeNone Ο)
invFun i := swap none i.1 * i.2.optionCongr
left_inv Ο := by simp
right_inv := fun β¨x, Οβ© => by
have : removeNone (swap none x * Ο.optionCongr) = Ο :=
Equiv.optionCongr_injective (by simp [β mul_assoc])
simp [β Perm.eq_inv_iff_eq, this]
#align equiv.perm.decompose_option Equiv.Perm.decomposeOption
| Mathlib/GroupTheory/Perm/Option.lean | 76 | 77 | theorem Equiv.Perm.decomposeOption_symm_of_none_apply {Ξ± : Type*} [DecidableEq Ξ±] (e : Perm Ξ±)
(i : Option Ξ±) : Equiv.Perm.decomposeOption.symm (none, e) i = i.map e := by | simp
| [
" optionCongr (swap x y) = swap (some x) (some y)",
" aβ β (optionCongr (swap x y)) none β aβ β (swap (some x) (some y)) none",
" aβ β (optionCongr (swap x y)) (some i) β aβ β (swap (some x) (some y)) (some i)",
" Perm.sign (optionCongr e) = Perm.sign e",
" Perm.sign (optionCongr 1) = Perm.sign 1",
" β (f... | [
" optionCongr (swap x y) = swap (some x) (some y)",
" aβ β (optionCongr (swap x y)) none β aβ β (swap (some x) (some y)) none",
" aβ β (optionCongr (swap x y)) (some i) β aβ β (swap (some x) (some y)) (some i)",
" Perm.sign (optionCongr e) = Perm.sign e",
" Perm.sign (optionCongr 1) = Perm.sign 1",
" β (f... |
import Mathlib.Topology.Category.TopCat.Limits.Products
#align_import topology.category.Top.limits.pullbacks from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
-- Porting note: every ML3 decl has an uppercase letter
set_option linter.uppercaseLean3 false
open TopologicalSpace
open CategoryTheory
open CategoryTheory.Limits
universe v u w
noncomputable section
namespace TopCat
variable {J : Type v} [SmallCategory J]
section Pullback
variable {X Y Z : TopCat.{u}}
abbrev pullbackFst (f : X βΆ Z) (g : Y βΆ Z) : TopCat.of { p : X Γ Y // f p.1 = g p.2 } βΆ X :=
β¨Prod.fst β Subtype.val, by
apply Continuous.comp <;> set_option tactic.skipAssignedInstances false in continuityβ©
#align Top.pullback_fst TopCat.pullbackFst
lemma pullbackFst_apply (f : X βΆ Z) (g : Y βΆ Z) (x) : pullbackFst f g x = x.1.1 := rfl
abbrev pullbackSnd (f : X βΆ Z) (g : Y βΆ Z) : TopCat.of { p : X Γ Y // f p.1 = g p.2 } βΆ Y :=
β¨Prod.snd β Subtype.val, by
apply Continuous.comp <;> set_option tactic.skipAssignedInstances false in continuityβ©
#align Top.pullback_snd TopCat.pullbackSnd
lemma pullbackSnd_apply (f : X βΆ Z) (g : Y βΆ Z) (x) : pullbackSnd f g x = x.1.2 := rfl
def pullbackCone (f : X βΆ Z) (g : Y βΆ Z) : PullbackCone f g :=
PullbackCone.mk (pullbackFst f g) (pullbackSnd f g)
(by
dsimp [pullbackFst, pullbackSnd, Function.comp_def]
ext β¨x, hβ©
-- Next 2 lines were
-- `rw [comp_apply, ContinuousMap.coe_mk, comp_apply, ContinuousMap.coe_mk]`
-- `exact h` before leanprover/lean4#2644
rw [comp_apply, comp_apply]
congr!)
#align Top.pullback_cone TopCat.pullbackCone
def pullbackConeIsLimit (f : X βΆ Z) (g : Y βΆ Z) : IsLimit (pullbackCone f g) :=
PullbackCone.isLimitAux' _
(by
intro S
constructor; swap
Β· exact
{ toFun := fun x =>
β¨β¨S.fst x, S.snd xβ©, by simpa using ConcreteCategory.congr_hom S.condition xβ©
continuous_toFun := by
apply Continuous.subtype_mk <| Continuous.prod_mk ?_ ?_
Β· exact (PullbackCone.fst S)|>.continuous_toFun
Β· exact (PullbackCone.snd S)|>.continuous_toFun
}
refine β¨?_, ?_, ?_β©
Β· delta pullbackCone
ext a
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [comp_apply, ContinuousMap.coe_mk]
Β· delta pullbackCone
ext a
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [comp_apply, ContinuousMap.coe_mk]
Β· intro m hβ hβ
-- Porting note: used to be ext x
apply ContinuousMap.ext; intro x
apply Subtype.ext
apply Prod.ext
Β· simpa using ConcreteCategory.congr_hom hβ x
Β· simpa using ConcreteCategory.congr_hom hβ x)
#align Top.pullback_cone_is_limit TopCat.pullbackConeIsLimit
def pullbackIsoProdSubtype (f : X βΆ Z) (g : Y βΆ Z) :
pullback f g β
TopCat.of { p : X Γ Y // f p.1 = g p.2 } :=
(limit.isLimit _).conePointUniqueUpToIso (pullbackConeIsLimit f g)
#align Top.pullback_iso_prod_subtype TopCat.pullbackIsoProdSubtype
@[reassoc (attr := simp)]
| Mathlib/Topology/Category/TopCat/Limits/Pullbacks.lean | 103 | 105 | theorem pullbackIsoProdSubtype_inv_fst (f : X βΆ Z) (g : Y βΆ Z) :
(pullbackIsoProdSubtype f g).inv β« pullback.fst = pullbackFst f g := by |
simp [pullbackCone, pullbackIsoProdSubtype]
| [
" Continuous (Prod.fst β Subtype.val)",
" Continuous Prod.fst",
" Continuous Subtype.val",
" Continuous (Prod.snd β Subtype.val)",
" Continuous Prod.snd",
" pullbackFst f g β« f = pullbackSnd f g β« g",
" { toFun := fun x => (βx).1, continuous_toFun := β― } β« f = { toFun := fun x => (βx).2, continuous_toFu... | [
" Continuous (Prod.fst β Subtype.val)",
" Continuous Prod.fst",
" Continuous Subtype.val",
" Continuous (Prod.snd β Subtype.val)",
" Continuous Prod.snd",
" pullbackFst f g β« f = pullbackSnd f g β« g",
" { toFun := fun x => (βx).1, continuous_toFun := β― } β« f = { toFun := fun x => (βx).2, continuous_toFu... |
import Mathlib.Data.Finsupp.Basic
import Mathlib.Data.Finsupp.Order
#align_import data.finsupp.multiset from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf"
open Finset
variable {Ξ± Ξ² ΞΉ : Type*}
namespace Finsupp
def toMultiset : (Ξ± ββ β) β+ Multiset Ξ± where
toFun f := Finsupp.sum f fun a n => n β’ {a}
-- Porting note: times out if h is not specified
map_add' _f _g := sum_add_index' (h := fun a n => n β’ ({a} : Multiset Ξ±))
(fun _ β¦ zero_nsmul _) (fun _ β¦ add_nsmul _)
map_zero' := sum_zero_index
theorem toMultiset_zero : toMultiset (0 : Ξ± ββ β) = 0 :=
rfl
#align finsupp.to_multiset_zero Finsupp.toMultiset_zero
theorem toMultiset_add (m n : Ξ± ββ β) : toMultiset (m + n) = toMultiset m + toMultiset n :=
toMultiset.map_add m n
#align finsupp.to_multiset_add Finsupp.toMultiset_add
theorem toMultiset_apply (f : Ξ± ββ β) : toMultiset f = f.sum fun a n => n β’ {a} :=
rfl
#align finsupp.to_multiset_apply Finsupp.toMultiset_apply
@[simp]
theorem toMultiset_single (a : Ξ±) (n : β) : toMultiset (single a n) = n β’ {a} := by
rw [toMultiset_apply, sum_single_index]; apply zero_nsmul
#align finsupp.to_multiset_single Finsupp.toMultiset_single
theorem toMultiset_sum {f : ΞΉ β Ξ± ββ β} (s : Finset ΞΉ) :
Finsupp.toMultiset (β i β s, f i) = β i β s, Finsupp.toMultiset (f i) :=
map_sum Finsupp.toMultiset _ _
#align finsupp.to_multiset_sum Finsupp.toMultiset_sum
theorem toMultiset_sum_single (s : Finset ΞΉ) (n : β) :
Finsupp.toMultiset (β i β s, single i n) = n β’ s.val := by
simp_rw [toMultiset_sum, Finsupp.toMultiset_single, sum_nsmul, sum_multiset_singleton]
#align finsupp.to_multiset_sum_single Finsupp.toMultiset_sum_single
@[simp]
theorem card_toMultiset (f : Ξ± ββ β) : Multiset.card (toMultiset f) = f.sum fun _ => id := by
simp [toMultiset_apply, map_finsupp_sum, Function.id_def]
#align finsupp.card_to_multiset Finsupp.card_toMultiset
| Mathlib/Data/Finsupp/Multiset.lean | 71 | 79 | theorem toMultiset_map (f : Ξ± ββ β) (g : Ξ± β Ξ²) :
f.toMultiset.map g = toMultiset (f.mapDomain g) := by |
refine f.induction ?_ ?_
Β· rw [toMultiset_zero, Multiset.map_zero, mapDomain_zero, toMultiset_zero]
Β· intro a n f _ _ ih
rw [toMultiset_add, Multiset.map_add, ih, mapDomain_add, mapDomain_single,
toMultiset_single, toMultiset_add, toMultiset_single, β Multiset.coe_mapAddMonoidHom,
(Multiset.mapAddMonoidHom g).map_nsmul]
rfl
| [
" toMultiset (single a n) = n β’ {a}",
" 0 β’ {a} = 0",
" toMultiset (β i β s, single i n) = n β’ s.val",
" Multiset.card (toMultiset f) = f.sum fun x => id",
" Multiset.map g (toMultiset f) = toMultiset (mapDomain g f)",
" Multiset.map g (toMultiset 0) = toMultiset (mapDomain g 0)",
" β (a : Ξ±) (b : β) (f... | [
" toMultiset (single a n) = n β’ {a}",
" 0 β’ {a} = 0",
" toMultiset (β i β s, single i n) = n β’ s.val",
" Multiset.card (toMultiset f) = f.sum fun x => id"
] |
import Mathlib.Data.Real.NNReal
import Mathlib.Tactic.GCongr.Core
#align_import analysis.normed.group.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
open Set
open NNReal
variable {ΞΉ R R' E F G : Type*}
structure AddGroupSeminorm (G : Type*) [AddGroup G] where
-- Porting note: can't extend `ZeroHom G β` because otherwise `to_additive` won't work since
-- we aren't using old structures
protected toFun : G β β
protected map_zero' : toFun 0 = 0
protected add_le' : β r s, toFun (r + s) β€ toFun r + toFun s
protected neg' : β r, toFun (-r) = toFun r
#align add_group_seminorm AddGroupSeminorm
@[to_additive]
structure GroupSeminorm (G : Type*) [Group G] where
protected toFun : G β β
protected map_one' : toFun 1 = 0
protected mul_le' : β x y, toFun (x * y) β€ toFun x + toFun y
protected inv' : β x, toFun xβ»ΒΉ = toFun x
#align group_seminorm GroupSeminorm
structure NonarchAddGroupSeminorm (G : Type*) [AddGroup G] extends ZeroHom G β where
protected add_le_max' : β r s, toFun (r + s) β€ max (toFun r) (toFun s)
protected neg' : β r, toFun (-r) = toFun r
#align nonarch_add_group_seminorm NonarchAddGroupSeminorm
structure AddGroupNorm (G : Type*) [AddGroup G] extends AddGroupSeminorm G where
protected eq_zero_of_map_eq_zero' : β x, toFun x = 0 β x = 0
#align add_group_norm AddGroupNorm
@[to_additive]
structure GroupNorm (G : Type*) [Group G] extends GroupSeminorm G where
protected eq_one_of_map_eq_zero' : β x, toFun x = 0 β x = 1
#align group_norm GroupNorm
structure NonarchAddGroupNorm (G : Type*) [AddGroup G] extends NonarchAddGroupSeminorm G where
protected eq_zero_of_map_eq_zero' : β x, toFun x = 0 β x = 0
#align nonarch_add_group_norm NonarchAddGroupNorm
class NonarchAddGroupSeminormClass (F : Type*) (Ξ± : outParam Type*) [AddGroup Ξ±] [FunLike F Ξ± β]
extends NonarchimedeanHomClass F Ξ± β : Prop where
protected map_zero (f : F) : f 0 = 0
protected map_neg_eq_map' (f : F) (a : Ξ±) : f (-a) = f a
#align nonarch_add_group_seminorm_class NonarchAddGroupSeminormClass
class NonarchAddGroupNormClass (F : Type*) (Ξ± : outParam Type*) [AddGroup Ξ±] [FunLike F Ξ± β]
extends NonarchAddGroupSeminormClass F Ξ± : Prop where
protected eq_zero_of_map_eq_zero (f : F) {a : Ξ±} : f a = 0 β a = 0
#align nonarch_add_group_norm_class NonarchAddGroupNormClass
section NonarchAddGroupSeminormClass
variable [AddGroup E] [FunLike F E β] [NonarchAddGroupSeminormClass F E] (f : F) (x y : E)
| Mathlib/Analysis/Normed/Group/Seminorm.lean | 148 | 150 | theorem map_sub_le_max : f (x - y) β€ max (f x) (f y) := by |
rw [sub_eq_add_neg, β NonarchAddGroupSeminormClass.map_neg_eq_map' f y]
exact map_add_le_max _ _ _
| [
" f (x - y) β€ max (f x) (f y)",
" f (x + -y) β€ max (f x) (f (-y))"
] | [] |
import Mathlib.Data.Complex.Module
import Mathlib.LinearAlgebra.Determinant
#align_import data.complex.determinant from "leanprover-community/mathlib"@"65ec59902eb17e4ab7da8d7e3d0bd9774d1b8b99"
namespace Complex
@[simp]
| Mathlib/Data/Complex/Determinant.lean | 24 | 26 | theorem det_conjAe : LinearMap.det conjAe.toLinearMap = -1 := by |
rw [β LinearMap.det_toMatrix basisOneI, toMatrix_conjAe, Matrix.det_fin_two_of]
simp
| [
" LinearMap.det conjAe.toLinearMap = -1",
" 1 * -1 - 0 * 0 = -1"
] | [] |
import Mathlib.Algebra.Associated
import Mathlib.Algebra.Order.Monoid.Unbundled.Pow
import Mathlib.Algebra.Ring.Int
import Mathlib.Data.Nat.Factorial.Basic
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.nat.prime from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1"
open Bool Subtype
open Nat
namespace Nat
variable {n : β}
-- Porting note (#11180): removed @[pp_nodot]
def Prime (p : β) :=
Irreducible p
#align nat.prime Nat.Prime
theorem irreducible_iff_nat_prime (a : β) : Irreducible a β Nat.Prime a :=
Iff.rfl
#align irreducible_iff_nat_prime Nat.irreducible_iff_nat_prime
@[aesop safe destruct] theorem not_prime_zero : Β¬Prime 0
| h => h.ne_zero rfl
#align nat.not_prime_zero Nat.not_prime_zero
@[aesop safe destruct] theorem not_prime_one : Β¬Prime 1
| h => h.ne_one rfl
#align nat.not_prime_one Nat.not_prime_one
theorem Prime.ne_zero {n : β} (h : Prime n) : n β 0 :=
Irreducible.ne_zero h
#align nat.prime.ne_zero Nat.Prime.ne_zero
theorem Prime.pos {p : β} (pp : Prime p) : 0 < p :=
Nat.pos_of_ne_zero pp.ne_zero
#align nat.prime.pos Nat.Prime.pos
theorem Prime.two_le : β {p : β}, Prime p β 2 β€ p
| 0, h => (not_prime_zero h).elim
| 1, h => (not_prime_one h).elim
| _ + 2, _ => le_add_self
#align nat.prime.two_le Nat.Prime.two_le
theorem Prime.one_lt {p : β} : Prime p β 1 < p :=
Prime.two_le
#align nat.prime.one_lt Nat.Prime.one_lt
lemma Prime.one_le {p : β} (hp : p.Prime) : 1 β€ p := hp.one_lt.le
instance Prime.one_lt' (p : β) [hp : Fact p.Prime] : Fact (1 < p) :=
β¨hp.1.one_ltβ©
#align nat.prime.one_lt' Nat.Prime.one_lt'
theorem Prime.ne_one {p : β} (hp : p.Prime) : p β 1 :=
hp.one_lt.ne'
#align nat.prime.ne_one Nat.Prime.ne_one
theorem Prime.eq_one_or_self_of_dvd {p : β} (pp : p.Prime) (m : β) (hm : m β£ p) :
m = 1 β¨ m = p := by
obtain β¨n, hnβ© := hm
have := pp.isUnit_or_isUnit hn
rw [Nat.isUnit_iff, Nat.isUnit_iff] at this
apply Or.imp_right _ this
rintro rfl
rw [hn, mul_one]
#align nat.prime.eq_one_or_self_of_dvd Nat.Prime.eq_one_or_self_of_dvd
theorem prime_def_lt'' {p : β} : Prime p β 2 β€ p β§ β m, m β£ p β m = 1 β¨ m = p := by
refine β¨fun h => β¨h.two_le, h.eq_one_or_self_of_dvdβ©, fun h => ?_β©
-- Porting note: needed to make β explicit
have h1 := (@one_lt_two β ..).trans_le h.1
refine β¨mt Nat.isUnit_iff.mp h1.ne', fun a b hab => ?_β©
simp only [Nat.isUnit_iff]
apply Or.imp_right _ (h.2 a _)
Β· rintro rfl
rw [β mul_right_inj' (pos_of_gt h1).ne', β hab, mul_one]
Β· rw [hab]
exact dvd_mul_right _ _
#align nat.prime_def_lt'' Nat.prime_def_lt''
theorem prime_def_lt {p : β} : Prime p β 2 β€ p β§ β m < p, m β£ p β m = 1 :=
prime_def_lt''.trans <|
and_congr_right fun p2 =>
forall_congr' fun _ =>
β¨fun h l d => (h d).resolve_right (ne_of_lt l), fun h d =>
(le_of_dvd (le_of_succ_le p2) d).lt_or_eq_dec.imp_left fun l => h l dβ©
#align nat.prime_def_lt Nat.prime_def_lt
theorem prime_def_lt' {p : β} : Prime p β 2 β€ p β§ β m, 2 β€ m β m < p β Β¬m β£ p :=
prime_def_lt.trans <|
and_congr_right fun p2 =>
forall_congr' fun m =>
β¨fun h m2 l d => not_lt_of_ge m2 ((h l d).symm βΈ by decide), fun h l d => by
rcases m with (_ | _ | m)
Β· rw [eq_zero_of_zero_dvd d] at p2
revert p2
decide
Β· rfl
Β· exact (h le_add_self l).elim dβ©
#align nat.prime_def_lt' Nat.prime_def_lt'
theorem prime_def_le_sqrt {p : β} : Prime p β 2 β€ p β§ β m, 2 β€ m β m β€ sqrt p β Β¬m β£ p :=
prime_def_lt'.trans <|
and_congr_right fun p2 =>
β¨fun a m m2 l => a m m2 <| lt_of_le_of_lt l <| sqrt_lt_self p2, fun a =>
have : β {m k : β}, m β€ k β 1 < m β p β m * k := fun {m k} mk m1 e =>
a m m1 (le_sqrt.2 (e.symm βΈ Nat.mul_le_mul_left m mk)) β¨k, eβ©
fun m m2 l β¨k, eβ© => by
rcases le_total m k with mk | km
Β· exact this mk m2 e
Β· rw [mul_comm] at e
refine this km (lt_of_mul_lt_mul_right ?_ (zero_le m)) e
rwa [one_mul, β e]β©
#align nat.prime_def_le_sqrt Nat.prime_def_le_sqrt
| Mathlib/Data/Nat/Prime.lean | 147 | 153 | theorem prime_of_coprime (n : β) (h1 : 1 < n) (h : β m < n, m β 0 β n.Coprime m) : Prime n := by |
refine prime_def_lt.mpr β¨h1, fun m mlt mdvd => ?_β©
have hm : m β 0 := by
rintro rfl
rw [zero_dvd_iff] at mdvd
exact mlt.ne' mdvd
exact (h m mlt hm).symm.eq_one_of_dvd mdvd
| [
" m = 1 β¨ m = p",
" n = 1 β m = p",
" m = p",
" p.Prime β 2 β€ p β§ β (m : β), m β£ p β m = 1 β¨ m = p",
" p.Prime",
" IsUnit a β¨ IsUnit b",
" a = 1 β¨ b = 1",
" a = p β b = 1",
" b = 1",
" a β£ p",
" a β£ a * b",
" 1 < 2",
" m = 1",
" 0 = 1",
" 2 β€ 0 β 0 = 1",
" 0 + 1 = 1",
" m + 1 + 1 = 1... | [
" m = 1 β¨ m = p",
" n = 1 β m = p",
" m = p",
" p.Prime β 2 β€ p β§ β (m : β), m β£ p β m = 1 β¨ m = p",
" p.Prime",
" IsUnit a β¨ IsUnit b",
" a = 1 β¨ b = 1",
" a = p β b = 1",
" b = 1",
" a β£ p",
" a β£ a * b",
" 1 < 2",
" m = 1",
" 0 = 1",
" 2 β€ 0 β 0 = 1",
" 0 + 1 = 1",
" m + 1 + 1 = 1... |
import Mathlib.Analysis.Analytic.Basic
import Mathlib.Analysis.Complex.Basic
import Mathlib.Analysis.Normed.Field.InfiniteSum
import Mathlib.Data.Nat.Choose.Cast
import Mathlib.Data.Finset.NoncommProd
import Mathlib.Topology.Algebra.Algebra
#align_import analysis.normed_space.exponential from "leanprover-community/mathlib"@"62748956a1ece9b26b33243e2e3a2852176666f5"
namespace NormedSpace
open Filter RCLike ContinuousMultilinearMap NormedField Asymptotics
open scoped Nat Topology ENNReal
section TopologicalAlgebra
variable (π πΈ : Type*) [Field π] [Ring πΈ] [Algebra π πΈ] [TopologicalSpace πΈ] [TopologicalRing πΈ]
def expSeries : FormalMultilinearSeries π πΈ πΈ := fun n =>
(n !β»ΒΉ : π) β’ ContinuousMultilinearMap.mkPiAlgebraFin π n πΈ
#align exp_series NormedSpace.expSeries
variable {πΈ}
noncomputable def exp (x : πΈ) : πΈ :=
(expSeries π πΈ).sum x
#align exp NormedSpace.exp
variable {π}
theorem expSeries_apply_eq (x : πΈ) (n : β) :
(expSeries π πΈ n fun _ => x) = (n !β»ΒΉ : π) β’ x ^ n := by simp [expSeries]
#align exp_series_apply_eq NormedSpace.expSeries_apply_eq
theorem expSeries_apply_eq' (x : πΈ) :
(fun n => expSeries π πΈ n fun _ => x) = fun n => (n !β»ΒΉ : π) β’ x ^ n :=
funext (expSeries_apply_eq x)
#align exp_series_apply_eq' NormedSpace.expSeries_apply_eq'
theorem expSeries_sum_eq (x : πΈ) : (expSeries π πΈ).sum x = β' n : β, (n !β»ΒΉ : π) β’ x ^ n :=
tsum_congr fun n => expSeries_apply_eq x n
#align exp_series_sum_eq NormedSpace.expSeries_sum_eq
theorem exp_eq_tsum : exp π = fun x : πΈ => β' n : β, (n !β»ΒΉ : π) β’ x ^ n :=
funext expSeries_sum_eq
#align exp_eq_tsum NormedSpace.exp_eq_tsum
theorem expSeries_apply_zero (n : β) :
(expSeries π πΈ n fun _ => (0 : πΈ)) = Pi.single (f := fun _ => πΈ) 0 1 n := by
rw [expSeries_apply_eq]
cases' n with n
Β· rw [pow_zero, Nat.factorial_zero, Nat.cast_one, inv_one, one_smul, Pi.single_eq_same]
Β· rw [zero_pow (Nat.succ_ne_zero _), smul_zero, Pi.single_eq_of_ne n.succ_ne_zero]
#align exp_series_apply_zero NormedSpace.expSeries_apply_zero
@[simp]
theorem exp_zero : exp π (0 : πΈ) = 1 := by
simp_rw [exp_eq_tsum, β expSeries_apply_eq, expSeries_apply_zero, tsum_pi_single]
#align exp_zero NormedSpace.exp_zero
@[simp]
theorem exp_op [T2Space πΈ] (x : πΈ) : exp π (MulOpposite.op x) = MulOpposite.op (exp π x) := by
simp_rw [exp, expSeries_sum_eq, β MulOpposite.op_pow, β MulOpposite.op_smul, tsum_op]
#align exp_op NormedSpace.exp_op
@[simp]
| Mathlib/Analysis/NormedSpace/Exponential.lean | 155 | 157 | theorem exp_unop [T2Space πΈ] (x : πΈα΅α΅α΅) :
exp π (MulOpposite.unop x) = MulOpposite.unop (exp π x) := by |
simp_rw [exp, expSeries_sum_eq, β MulOpposite.unop_pow, β MulOpposite.unop_smul, tsum_unop]
| [
" ((expSeries π πΈ n) fun x_1 => x) = (βn !)β»ΒΉ β’ x ^ n",
" ((expSeries π πΈ n) fun x => 0) = Pi.single 0 1 n",
" (βn !)β»ΒΉ β’ 0 ^ n = Pi.single 0 1 n",
" (β0!)β»ΒΉ β’ 0 ^ 0 = Pi.single 0 1 0",
" (β(n + 1)!)β»ΒΉ β’ 0 ^ (n + 1) = Pi.single 0 1 (n + 1)",
" exp π 0 = 1",
" exp π (MulOpposite.op x) = MulOpposite... | [
" ((expSeries π πΈ n) fun x_1 => x) = (βn !)β»ΒΉ β’ x ^ n",
" ((expSeries π πΈ n) fun x => 0) = Pi.single 0 1 n",
" (βn !)β»ΒΉ β’ 0 ^ n = Pi.single 0 1 n",
" (β0!)β»ΒΉ β’ 0 ^ 0 = Pi.single 0 1 0",
" (β(n + 1)!)β»ΒΉ β’ 0 ^ (n + 1) = Pi.single 0 1 (n + 1)",
" exp π 0 = 1",
" exp π (MulOpposite.op x) = MulOpposite... |
import Mathlib.LinearAlgebra.TensorProduct.Basic
import Mathlib.RingTheory.Finiteness
open scoped TensorProduct
open Submodule
variable {R M N : Type*}
variable [CommSemiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N]
variable {Mβ Mβ : Submodule R M} {Nβ Nβ : Submodule R N}
namespace TensorProduct
| Mathlib/LinearAlgebra/TensorProduct/Finiteness.lean | 52 | 60 | theorem exists_multiset (x : M β[R] N) :
β S : Multiset (M Γ N), x = (S.map fun i β¦ i.1 ββ[R] i.2).sum := by |
induction x using TensorProduct.induction_on with
| zero => exact β¨0, by simpβ©
| tmul x y => exact β¨{(x, y)}, by simpβ©
| add x y hx hy =>
obtain β¨Sx, hxβ© := hx
obtain β¨Sy, hyβ© := hy
exact β¨Sx + Sy, by rw [Multiset.map_add, Multiset.sum_add, hx, hy]β©
| [
" β S, x = (Multiset.map (fun i => i.1 ββ[R] i.2) S).sum",
" β S, 0 = (Multiset.map (fun i => i.1 ββ[R] i.2) S).sum",
" 0 = (Multiset.map (fun i => i.1 ββ[R] i.2) 0).sum",
" β S, x ββ[R] y = (Multiset.map (fun i => i.1 ββ[R] i.2) S).sum",
" x ββ[R] y = (Multiset.map (fun i => i.1 ββ[R] i.2) {(x, y)}).sum",
... | [] |
import Mathlib.Topology.Separation
open Topology Filter Set TopologicalSpace
section Basic
variable {Ξ± : Type*} [TopologicalSpace Ξ±] {C : Set Ξ±}
theorem AccPt.nhds_inter {x : Ξ±} {U : Set Ξ±} (h_acc : AccPt x (π C)) (hU : U β π x) :
AccPt x (π (U β© C)) := by
have : π[β ] x β€ π U := by
rw [le_principal_iff]
exact mem_nhdsWithin_of_mem_nhds hU
rw [AccPt, β inf_principal, β inf_assoc, inf_of_le_left this]
exact h_acc
#align acc_pt.nhds_inter AccPt.nhds_inter
def Preperfect (C : Set Ξ±) : Prop :=
β x β C, AccPt x (π C)
#align preperfect Preperfect
@[mk_iff perfect_def]
structure Perfect (C : Set Ξ±) : Prop where
closed : IsClosed C
acc : Preperfect C
#align perfect Perfect
theorem preperfect_iff_nhds : Preperfect C β β x β C, β U β π x, β y β U β© C, y β x := by
simp only [Preperfect, accPt_iff_nhds]
#align preperfect_iff_nhds preperfect_iff_nhds
section Preperfect
theorem Preperfect.open_inter {U : Set Ξ±} (hC : Preperfect C) (hU : IsOpen U) :
Preperfect (U β© C) := by
rintro x β¨xU, xCβ©
apply (hC _ xC).nhds_inter
exact hU.mem_nhds xU
#align preperfect.open_inter Preperfect.open_inter
theorem Preperfect.perfect_closure (hC : Preperfect C) : Perfect (closure C) := by
constructor; Β· exact isClosed_closure
intro x hx
by_cases h : x β C <;> apply AccPt.mono _ (principal_mono.mpr subset_closure)
Β· exact hC _ h
have : {x}αΆ β© C = C := by simp [h]
rw [AccPt, nhdsWithin, inf_assoc, inf_principal, this]
rw [closure_eq_cluster_pts] at hx
exact hx
#align preperfect.perfect_closure Preperfect.perfect_closure
| Mathlib/Topology/Perfect.lean | 132 | 144 | theorem preperfect_iff_perfect_closure [T1Space Ξ±] : Preperfect C β Perfect (closure C) := by |
constructor <;> intro h
Β· exact h.perfect_closure
intro x xC
have H : AccPt x (π (closure C)) := h.acc _ (subset_closure xC)
rw [accPt_iff_frequently] at *
have : β y, y β x β§ y β closure C β βαΆ z in π y, z β x β§ z β C := by
rintro y β¨hyx, yCβ©
simp only [β mem_compl_singleton_iff, and_comm, β frequently_nhdsWithin_iff,
hyx.nhdsWithin_compl_singleton, β mem_closure_iff_frequently]
exact yC
rw [β frequently_frequently_nhds]
exact H.mono this
| [
" AccPt x (π (U β© C))",
" π[β ] x β€ π U",
" U β π[β ] x",
" (π[β ] x β π C).NeBot",
" Preperfect C β β x β C, β U β π x, β y β U β© C, y β x",
" Preperfect (U β© C)",
" U β π x",
" Perfect (closure C)",
" IsClosed (closure C)",
" Preperfect (closure C)",
" AccPt x (π (closure C))",
" AccPt... | [
" AccPt x (π (U β© C))",
" π[β ] x β€ π U",
" U β π[β ] x",
" (π[β ] x β π C).NeBot",
" Preperfect C β β x β C, β U β π x, β y β U β© C, y β x",
" Preperfect (U β© C)",
" U β π x",
" Perfect (closure C)",
" IsClosed (closure C)",
" Preperfect (closure C)",
" AccPt x (π (closure C))",
" AccPt... |
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
| Mathlib/Tactic/ComputeDegree.lean | 101 | 103 | 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
| [
" (f + g).coeff n = a + b",
" (f + g).coeff n = f.coeff n + g.coeff n"
] | [] |
import Mathlib.MeasureTheory.Constructions.Pi
import Mathlib.MeasureTheory.Constructions.Prod.Integral
open Fintype MeasureTheory MeasureTheory.Measure
variable {π : Type*} [RCLike π]
namespace MeasureTheory
theorem Integrable.fin_nat_prod {n : β} {E : Fin n β Type*}
[β i, MeasureSpace (E i)] [β i, SigmaFinite (volume : Measure (E i))]
{f : (i : Fin n) β E i β π} (hf : β i, Integrable (f i)) :
Integrable (fun (x : (i : Fin n) β E i) β¦ β i, f i (x i)) := by
induction n with
| zero => simp only [Nat.zero_eq, Finset.univ_eq_empty, Finset.prod_empty, volume_pi,
integrable_const_iff, one_ne_zero, pi_empty_univ, ENNReal.one_lt_top, or_true]
| succ n n_ih =>
have := ((measurePreserving_piFinSuccAbove (fun i => (volume : Measure (E i))) 0).symm)
rw [volume_pi, β this.integrable_comp_emb (MeasurableEquiv.measurableEmbedding _)]
simp_rw [MeasurableEquiv.piFinSuccAbove_symm_apply,
Fin.prod_univ_succ, Fin.insertNth_zero]
simp only [Fin.zero_succAbove, cast_eq, Function.comp_def, Fin.cons_zero, Fin.cons_succ]
have : Integrable (fun (x : (j : Fin n) β E (Fin.succ j)) β¦ β j, f (Fin.succ j) (x j)) :=
n_ih (fun i β¦ hf _)
exact Integrable.prod_mul (hf 0) this
theorem Integrable.fintype_prod_dep {ΞΉ : Type*} [Fintype ΞΉ] {E : ΞΉ β Type*}
{f : (i : ΞΉ) β E i β π} [β i, MeasureSpace (E i)] [β i, SigmaFinite (volume : Measure (E i))]
(hf : β i, Integrable (f i)) :
Integrable (fun (x : (i : ΞΉ) β E i) β¦ β i, f i (x i)) := by
let e := (equivFin ΞΉ).symm
simp_rw [β (volume_measurePreserving_piCongrLeft _ e).integrable_comp_emb
(MeasurableEquiv.measurableEmbedding _),
β e.prod_comp, MeasurableEquiv.coe_piCongrLeft, Function.comp_def,
Equiv.piCongrLeft_apply_apply]
exact .fin_nat_prod (fun i β¦ hf _)
theorem Integrable.fintype_prod {ΞΉ : Type*} [Fintype ΞΉ] {E : Type*}
{f : ΞΉ β E β π} [MeasureSpace E] [SigmaFinite (volume : Measure E)]
(hf : β i, Integrable (f i)) :
Integrable (fun (x : ΞΉ β E) β¦ β i, f i (x i)) :=
Integrable.fintype_prod_dep hf
theorem integral_fin_nat_prod_eq_prod {n : β} {E : Fin n β Type*}
[β i, MeasureSpace (E i)] [β i, SigmaFinite (volume : Measure (E i))]
(f : (i : Fin n) β E i β π) :
β« x : (i : Fin n) β E i, β i, f i (x i) = β i, β« x, f i x := by
induction n with
| zero =>
simp only [Nat.zero_eq, volume_pi, Finset.univ_eq_empty, Finset.prod_empty, integral_const,
pi_empty_univ, ENNReal.one_toReal, smul_eq_mul, mul_one, pow_zero, one_smul]
| succ n n_ih =>
calc
_ = β« x : E 0 Γ ((i : Fin n) β E (Fin.succ i)),
f 0 x.1 * β i : Fin n, f (Fin.succ i) (x.2 i) := by
rw [volume_pi, β ((measurePreserving_piFinSuccAbove
(fun i => (volume : Measure (E i))) 0).symm).integral_comp']
simp_rw [MeasurableEquiv.piFinSuccAbove_symm_apply,
Fin.prod_univ_succ, Fin.insertNth_zero, Fin.cons_succ, volume_eq_prod, volume_pi,
Fin.zero_succAbove, cast_eq, Fin.cons_zero]
_ = (β« x, f 0 x) * β i : Fin n, β« (x : E (Fin.succ i)), f (Fin.succ i) x := by
rw [β n_ih, β integral_prod_mul, volume_eq_prod]
_ = β i, β« x, f i x := by rw [Fin.prod_univ_succ]
theorem integral_fintype_prod_eq_prod (ΞΉ : Type*) [Fintype ΞΉ] {E : ΞΉ β Type*}
(f : (i : ΞΉ) β E i β π) [β i, MeasureSpace (E i)] [β i, SigmaFinite (volume : Measure (E i))] :
β« x : (i : ΞΉ) β E i, β i, f i (x i) = β i, β« x, f i x := by
let e := (equivFin ΞΉ).symm
rw [β (volume_measurePreserving_piCongrLeft _ e).integral_comp']
simp_rw [β e.prod_comp, MeasurableEquiv.coe_piCongrLeft, Equiv.piCongrLeft_apply_apply,
MeasureTheory.integral_fin_nat_prod_eq_prod]
| Mathlib/MeasureTheory/Integral/Pi.lean | 95 | 98 | theorem integral_fintype_prod_eq_pow {E : Type*} (ΞΉ : Type*) [Fintype ΞΉ] (f : E β π)
[MeasureSpace E] [SigmaFinite (volume : Measure E)] :
β« x : ΞΉ β E, β i, f (x i) = (β« x, f x) ^ (card ΞΉ) := by |
rw [integral_fintype_prod_eq_prod, Finset.prod_const, card]
| [
" Integrable (fun x => β i : Fin n, f i (x i)) volume",
" Integrable (fun x => β i : Fin 0, f i (x i)) volume",
" Integrable (fun x => β i : Fin (n + 1), f i (x i)) volume",
" Integrable ((fun x => β i : Fin (n + 1), f i (x i)) β β(MeasurableEquiv.piFinSuccAbove (fun i => E i) 0).symm)\n (volume.prod (Meas... | [
" Integrable (fun x => β i : Fin n, f i (x i)) volume",
" Integrable (fun x => β i : Fin 0, f i (x i)) volume",
" Integrable (fun x => β i : Fin (n + 1), f i (x i)) volume",
" Integrable ((fun x => β i : Fin (n + 1), f i (x i)) β β(MeasurableEquiv.piFinSuccAbove (fun i => E i) 0).symm)\n (volume.prod (Meas... |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.Deriv.Slope
import Mathlib.Analysis.NormedSpace.FiniteDimension
import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic
#align_import analysis.calculus.fderiv_measurable from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
set_option linter.uppercaseLean3 false -- A B D
noncomputable section
open Set Metric Asymptotics Filter ContinuousLinearMap MeasureTheory TopologicalSpace
open scoped Topology
section fderiv
variable {π : Type*} [NontriviallyNormedField π]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π F]
variable {f : E β F} (K : Set (E βL[π] F))
namespace FDerivMeasurableAux
def A (f : E β F) (L : E βL[π] F) (r Ξ΅ : β) : Set E :=
{ x | β r' β Ioc (r / 2) r, β y β ball x r', β z β ball x r', βf z - f y - L (z - y)β < Ξ΅ * r }
#align fderiv_measurable_aux.A FDerivMeasurableAux.A
def B (f : E β F) (K : Set (E βL[π] F)) (r s Ξ΅ : β) : Set E :=
β L β K, A f L r Ξ΅ β© A f L s Ξ΅
#align fderiv_measurable_aux.B FDerivMeasurableAux.B
def D (f : E β F) (K : Set (E βL[π] F)) : Set E :=
β e : β, β n : β, β (p β₯ n) (q β₯ n), B f K ((1 / 2) ^ p) ((1 / 2) ^ q) ((1 / 2) ^ e)
#align fderiv_measurable_aux.D FDerivMeasurableAux.D
theorem isOpen_A (L : E βL[π] F) (r Ξ΅ : β) : IsOpen (A f L r Ξ΅) := by
rw [Metric.isOpen_iff]
rintro x β¨r', r'_mem, hr'β©
obtain β¨s, s_gt, s_ltβ© : β s : β, r / 2 < s β§ s < r' := exists_between r'_mem.1
have : s β Ioc (r / 2) r := β¨s_gt, le_of_lt (s_lt.trans_le r'_mem.2)β©
refine β¨r' - s, by linarith, fun x' hx' => β¨s, this, ?_β©β©
have B : ball x' s β ball x r' := ball_subset (le_of_lt hx')
intro y hy z hz
exact hr' y (B hy) z (B hz)
#align fderiv_measurable_aux.is_open_A FDerivMeasurableAux.isOpen_A
| Mathlib/Analysis/Calculus/FDeriv/Measurable.lean | 144 | 145 | theorem isOpen_B {K : Set (E βL[π] F)} {r s Ξ΅ : β} : IsOpen (B f K r s Ξ΅) := by |
simp [B, isOpen_biUnion, IsOpen.inter, isOpen_A]
| [
" IsOpen (A f L r Ξ΅)",
" β x β A f L r Ξ΅, β Ξ΅_1 > 0, ball x Ξ΅_1 β A f L r Ξ΅",
" β Ξ΅_1 > 0, ball x Ξ΅_1 β A f L r Ξ΅",
" r' - s > 0",
" β y β ball x' s, β z β ball x' s, βf z - f y - L (z - y)β < Ξ΅ * r",
" βf z - f y - L (z - y)β < Ξ΅ * r",
" IsOpen (B f K r s Ξ΅)"
] | [
" IsOpen (A f L r Ξ΅)",
" β x β A f L r Ξ΅, β Ξ΅_1 > 0, ball x Ξ΅_1 β A f L r Ξ΅",
" β Ξ΅_1 > 0, ball x Ξ΅_1 β A f L r Ξ΅",
" r' - s > 0",
" β y β ball x' s, β z β ball x' s, βf z - f y - L (z - y)β < Ξ΅ * r",
" βf z - f y - L (z - y)β < Ξ΅ * r"
] |
import Mathlib.Algebra.Polynomial.Degree.Definitions
import Mathlib.Algebra.Polynomial.Eval
import Mathlib.Algebra.Polynomial.Monic
import Mathlib.Algebra.Polynomial.RingDivision
import Mathlib.Tactic.Abel
#align_import ring_theory.polynomial.pochhammer from "leanprover-community/mathlib"@"53b216bcc1146df1c4a0a86877890ea9f1f01589"
universe u v
open Polynomial
open Polynomial
section Ring
variable (R : Type u) [Ring R]
noncomputable def descPochhammer : β β R[X]
| 0 => 1
| n + 1 => X * (descPochhammer n).comp (X - 1)
@[simp]
theorem descPochhammer_zero : descPochhammer R 0 = 1 :=
rfl
@[simp]
theorem descPochhammer_one : descPochhammer R 1 = X := by simp [descPochhammer]
theorem descPochhammer_succ_left (n : β) :
descPochhammer R (n + 1) = X * (descPochhammer R n).comp (X - 1) := by
rw [descPochhammer]
theorem monic_descPochhammer (n : β) [Nontrivial R] [NoZeroDivisors R] :
Monic <| descPochhammer R n := by
induction' n with n hn
Β· simp
Β· have h : leadingCoeff (X - 1 : R[X]) = 1 := leadingCoeff_X_sub_C 1
have : natDegree (X - (1 : R[X])) β 0 := ne_zero_of_eq_one <| natDegree_X_sub_C (1 : R)
rw [descPochhammer_succ_left, Monic.def, leadingCoeff_mul, leadingCoeff_comp this, hn, monic_X,
one_mul, one_mul, h, one_pow]
section
variable {R} {T : Type v} [Ring T]
@[simp]
theorem descPochhammer_map (f : R β+* T) (n : β) :
(descPochhammer R n).map f = descPochhammer T n := by
induction' n with n ih
Β· simp
Β· simp [ih, descPochhammer_succ_left, map_comp]
end
@[simp, norm_cast]
theorem descPochhammer_eval_cast (n : β) (k : β€) :
(((descPochhammer β€ n).eval k : β€) : R) = ((descPochhammer R n).eval k : R) := by
rw [β descPochhammer_map (algebraMap β€ R), eval_map, β eq_intCast (algebraMap β€ R)]
simp only [algebraMap_int_eq, eq_intCast, evalβ_at_intCast, Nat.cast_id, eq_natCast, Int.cast_id]
theorem descPochhammer_eval_zero {n : β} :
(descPochhammer R n).eval 0 = if n = 0 then 1 else 0 := by
cases n
Β· simp
Β· simp [X_mul, Nat.succ_ne_zero, descPochhammer_succ_left]
theorem descPochhammer_zero_eval_zero : (descPochhammer R 0).eval 0 = 1 := by simp
@[simp]
theorem descPochhammer_ne_zero_eval_zero {n : β} (h : n β 0) : (descPochhammer R n).eval 0 = 0 := by
simp [descPochhammer_eval_zero, h]
theorem descPochhammer_succ_right (n : β) :
descPochhammer R (n + 1) = descPochhammer R n * (X - (n : R[X])) := by
suffices h : descPochhammer β€ (n + 1) = descPochhammer β€ n * (X - (n : β€[X])) by
apply_fun Polynomial.map (algebraMap β€ R) at h
simpa [descPochhammer_map, Polynomial.map_mul, Polynomial.map_add, map_X,
Polynomial.map_intCast] using h
induction' n with n ih
Β· simp [descPochhammer]
Β· conv_lhs =>
rw [descPochhammer_succ_left, ih, mul_comp, β mul_assoc, β descPochhammer_succ_left, sub_comp,
X_comp, natCast_comp]
rw [Nat.cast_add, Nat.cast_one, sub_add_eq_sub_sub_swap]
@[simp]
theorem descPochhammer_natDegree (n : β) [NoZeroDivisors R] [Nontrivial R] :
(descPochhammer R n).natDegree = n := by
induction' n with n hn
Β· simp
Β· have : natDegree (X - (n : R[X])) = 1 := natDegree_X_sub_C (n : R)
rw [descPochhammer_succ_right,
natDegree_mul _ (ne_zero_of_natDegree_gt <| this.symm βΈ Nat.zero_lt_one), hn, this]
cases n
Β· simp
Β· refine ne_zero_of_natDegree_gt <| hn.symm βΈ Nat.add_one_pos _
| Mathlib/RingTheory/Polynomial/Pochhammer.lean | 326 | 329 | theorem descPochhammer_succ_eval {S : Type*} [Ring S] (n : β) (k : S) :
(descPochhammer S (n + 1)).eval k = (descPochhammer S n).eval k * (k - n) := by |
rw [descPochhammer_succ_right, mul_sub, eval_sub, eval_mul_X, β Nat.cast_comm, β C_eq_natCast,
eval_C_mul, Nat.cast_comm, β mul_sub]
| [
" descPochhammer R 1 = X",
" descPochhammer R (n + 1) = X * (descPochhammer R n).comp (X - 1)",
" (descPochhammer R n).Monic",
" (descPochhammer R 0).Monic",
" (descPochhammer R (n + 1)).Monic",
" map f (descPochhammer R n) = descPochhammer T n",
" map f (descPochhammer R 0) = descPochhammer T 0",
" m... | [
" descPochhammer R 1 = X",
" descPochhammer R (n + 1) = X * (descPochhammer R n).comp (X - 1)",
" (descPochhammer R n).Monic",
" (descPochhammer R 0).Monic",
" (descPochhammer R (n + 1)).Monic",
" map f (descPochhammer R n) = descPochhammer T n",
" map f (descPochhammer R 0) = descPochhammer T 0",
" m... |
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Finset.Card
import Mathlib.Data.List.NodupEquivFin
import Mathlib.Data.Set.Image
#align_import data.fintype.card from "leanprover-community/mathlib"@"bf2428c9486c407ca38b5b3fb10b87dad0bc99fa"
assert_not_exists MonoidWithZero
assert_not_exists MulAction
open Function
open Nat
universe u v
variable {Ξ± Ξ² Ξ³ : Type*}
open Finset Function
namespace Fintype
def card (Ξ±) [Fintype Ξ±] : β :=
(@univ Ξ± _).card
#align fintype.card Fintype.card
def truncEquivFin (Ξ±) [DecidableEq Ξ±] [Fintype Ξ±] : Trunc (Ξ± β Fin (card Ξ±)) := by
unfold card Finset.card
exact
Quot.recOnSubsingleton'
(motive := fun s : Multiset Ξ± =>
(β x : Ξ±, x β s) β s.Nodup β Trunc (Ξ± β Fin (Multiset.card s)))
univ.val
(fun l (h : β x : Ξ±, x β l) (nd : l.Nodup) => Trunc.mk (nd.getEquivOfForallMemList _ h).symm)
mem_univ_val univ.2
#align fintype.trunc_equiv_fin Fintype.truncEquivFin
noncomputable def equivFin (Ξ±) [Fintype Ξ±] : Ξ± β Fin (card Ξ±) :=
letI := Classical.decEq Ξ±
(truncEquivFin Ξ±).out
#align fintype.equiv_fin Fintype.equivFin
def truncFinBijection (Ξ±) [Fintype Ξ±] : Trunc { f : Fin (card Ξ±) β Ξ± // Bijective f } := by
unfold card Finset.card
refine
Quot.recOnSubsingleton'
(motive := fun s : Multiset Ξ± =>
(β x : Ξ±, x β s) β s.Nodup β Trunc {f : Fin (Multiset.card s) β Ξ± // Bijective f})
univ.val
(fun l (h : β x : Ξ±, x β l) (nd : l.Nodup) => Trunc.mk (nd.getBijectionOfForallMemList _ h))
mem_univ_val univ.2
#align fintype.trunc_fin_bijection Fintype.truncFinBijection
theorem subtype_card {p : Ξ± β Prop} (s : Finset Ξ±) (H : β x : Ξ±, x β s β p x) :
@card { x // p x } (Fintype.subtype s H) = s.card :=
Multiset.card_pmap _ _ _
#align fintype.subtype_card Fintype.subtype_card
| Mathlib/Data/Fintype/Card.lean | 126 | 130 | theorem card_of_subtype {p : Ξ± β Prop} (s : Finset Ξ±) (H : β x : Ξ±, x β s β p x)
[Fintype { x // p x }] : card { x // p x } = s.card := by |
rw [β subtype_card s H]
congr
apply Subsingleton.elim
| [
" Trunc (Ξ± β Fin (card Ξ±))",
" Trunc (Ξ± β Fin (Multiset.card univ.val))",
" Trunc { f // Bijective f }",
" card { x // p x } = s.card",
" card { x // p x } = card { x // p x }",
" instβ = Fintype.subtype s H"
] | [
" Trunc (Ξ± β Fin (card Ξ±))",
" Trunc (Ξ± β Fin (Multiset.card univ.val))",
" Trunc { f // Bijective f }"
] |
import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic
import Mathlib.NumberTheory.GaussSum
#align_import number_theory.legendre_symbol.quadratic_char.gauss_sum from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9"
section SpecialValues
open ZMod MulChar
variable {F : Type*} [Field F] [Fintype F]
theorem quadraticChar_two [DecidableEq F] (hF : ringChar F β 2) :
quadraticChar F 2 = Οβ (Fintype.card F) :=
IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F) isQuadratic_Οβ hF
((quadraticChar_eq_pow_of_char_ne_two' hF 2).trans (FiniteField.two_pow_card hF))
#align quadratic_char_two quadraticChar_two
theorem FiniteField.isSquare_two_iff :
IsSquare (2 : F) β Fintype.card F % 8 β 3 β§ Fintype.card F % 8 β 5 := by
classical
by_cases hF : ringChar F = 2
focus
have h := FiniteField.even_card_of_char_two hF
simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff]
rotate_left
focus
have h := FiniteField.odd_card_of_char_ne_two hF
rw [β quadraticChar_one_iff_isSquare (Ring.two_ne_zero hF), quadraticChar_two hF,
Οβ_nat_eq_if_mod_eight]
simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β€) β 1),
imp_false, Classical.not_not]
all_goals
rw [β Nat.mod_mod_of_dvd _ (by decide : 2 β£ 8)] at h
have hβ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8)
revert hβ h
generalize Fintype.card F % 8 = n
intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!`
#align finite_field.is_square_two_iff FiniteField.isSquare_two_iff
theorem quadraticChar_neg_two [DecidableEq F] (hF : ringChar F β 2) :
quadraticChar F (-2) = Οβ' (Fintype.card F) := by
rw [(by norm_num : (-2 : F) = -1 * 2), map_mul, Οβ'_eq_Οβ_mul_Οβ, quadraticChar_neg_one hF,
quadraticChar_two hF, @cast_natCast _ (ZMod 4) _ _ _ (by decide : 4 β£ 8)]
#align quadratic_char_neg_two quadraticChar_neg_two
theorem FiniteField.isSquare_neg_two_iff :
IsSquare (-2 : F) β Fintype.card F % 8 β 5 β§ Fintype.card F % 8 β 7 := by
classical
by_cases hF : ringChar F = 2
focus
have h := FiniteField.even_card_of_char_two hF
simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff]
rotate_left
focus
have h := FiniteField.odd_card_of_char_ne_two hF
rw [β quadraticChar_one_iff_isSquare (neg_ne_zero.mpr (Ring.two_ne_zero hF)),
quadraticChar_neg_two hF, Οβ'_nat_eq_if_mod_eight]
simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β€) β 1),
imp_false, Classical.not_not]
all_goals
rw [β Nat.mod_mod_of_dvd _ (by decide : 2 β£ 8)] at h
have hβ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8)
revert hβ h
generalize Fintype.card F % 8 = n
intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!`
#align finite_field.is_square_neg_two_iff FiniteField.isSquare_neg_two_iff
theorem quadraticChar_card_card [DecidableEq F] (hF : ringChar F β 2) {F' : Type*} [Field F']
[Fintype F'] [DecidableEq F'] (hF' : ringChar F' β 2) (h : ringChar F' β ringChar F) :
quadraticChar F (Fintype.card F') =
quadraticChar F' (quadraticChar F (-1) * Fintype.card F) := by
let Ο := (quadraticChar F).ringHomComp (algebraMap β€ F')
have hΟβ : Ο.IsNontrivial := by
obtain β¨a, haβ© := quadraticChar_exists_neg_one hF
have hu : IsUnit a := by
contrapose ha
exact ne_of_eq_of_ne (map_nonunit (quadraticChar F) ha) (mt zero_eq_neg.mp one_ne_zero)
use hu.unit
simp only [Ο, IsUnit.unit_spec, ringHomComp_apply, eq_intCast, Ne, ha]
rw [Int.cast_neg, Int.cast_one]
exact Ring.neg_one_ne_one_of_char_ne_two hF'
have hΟβ : Ο.IsQuadratic := IsQuadratic.comp (quadraticChar_isQuadratic F) _
have h := Char.card_pow_card hΟβ hΟβ h hF'
rw [β quadraticChar_eq_pow_of_char_ne_two' hF'] at h
exact (IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F')
(quadraticChar_isQuadratic F) hF' h).symm
#align quadratic_char_card_card quadraticChar_card_card
| Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean | 119 | 125 | theorem quadraticChar_odd_prime [DecidableEq F] (hF : ringChar F β 2) {p : β} [Fact p.Prime]
(hpβ : p β 2) (hpβ : ringChar F β p) :
quadraticChar F p = quadraticChar (ZMod p) (Οβ (Fintype.card F) * Fintype.card F) := by |
rw [β quadraticChar_neg_one hF]
have h := quadraticChar_card_card hF (ne_of_eq_of_ne (ringChar_zmod_n p) hpβ)
(ne_of_eq_of_ne (ringChar_zmod_n p) hpβ.symm)
rwa [card p] at h
| [
" IsSquare 2 β Fintype.card F % 8 β 3 β§ Fintype.card F % 8 β 5",
" Fintype.card F % 8 β 3 β§ Fintype.card F % 8 β 5",
" (if Fintype.card F % 2 = 0 then 0 else if Fintype.card F % 8 = 1 β¨ Fintype.card F % 8 = 7 then 1 else -1) = 1 β\n Fintype.card F % 8 β 3 β§ Fintype.card F % 8 β 5",
" -1 β 1",
" Fintype.c... | [
" IsSquare 2 β Fintype.card F % 8 β 3 β§ Fintype.card F % 8 β 5",
" Fintype.card F % 8 β 3 β§ Fintype.card F % 8 β 5",
" (if Fintype.card F % 2 = 0 then 0 else if Fintype.card F % 8 = 1 β¨ Fintype.card F % 8 = 7 then 1 else -1) = 1 β\n Fintype.card F % 8 β 3 β§ Fintype.card F % 8 β 5",
" -1 β 1",
" Fintype.c... |
import Mathlib.MeasureTheory.Integral.Lebesgue
import Mathlib.Topology.MetricSpace.ThickenedIndicator
open MeasureTheory Topology Metric Filter Set ENNReal NNReal
open scoped Topology ENNReal NNReal BoundedContinuousFunction
section auxiliary
namespace MeasureTheory
variable {Ξ© : Type*} [TopologicalSpace Ξ©] [MeasurableSpace Ξ©] [OpensMeasurableSpace Ξ©]
theorem tendsto_lintegral_nn_filter_of_le_const {ΞΉ : Type*} {L : Filter ΞΉ} [L.IsCountablyGenerated]
(ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] {fs : ΞΉ β Ξ© βα΅ ββ₯0} {c : ββ₯0}
(fs_le_const : βαΆ i in L, βα΅ Ο : Ξ© βΞΌ, fs i Ο β€ c) {f : Ξ© β ββ₯0}
(fs_lim : βα΅ Ο : Ξ© βΞΌ, Tendsto (fun i β¦ fs i Ο) L (π (f Ο))) :
Tendsto (fun i β¦ β«β» Ο, fs i Ο βΞΌ) L (π (β«β» Ο, f Ο βΞΌ)) := by
refine tendsto_lintegral_filter_of_dominated_convergence (fun _ β¦ c)
(eventually_of_forall fun i β¦ (ENNReal.continuous_coe.comp (fs i).continuous).measurable) ?_
(@lintegral_const_lt_top _ _ ΞΌ _ _ (@ENNReal.coe_ne_top c)).ne ?_
Β· simpa only [Function.comp_apply, ENNReal.coe_le_coe] using fs_le_const
Β· simpa only [Function.comp_apply, ENNReal.tendsto_coe] using fs_lim
#align measure_theory.finite_measure.tendsto_lintegral_nn_filter_of_le_const MeasureTheory.tendsto_lintegral_nn_filter_of_le_const
theorem measure_of_cont_bdd_of_tendsto_filter_indicator {ΞΉ : Type*} {L : Filter ΞΉ}
[L.IsCountablyGenerated] [TopologicalSpace Ξ©] [OpensMeasurableSpace Ξ©] (ΞΌ : Measure Ξ©)
[IsFiniteMeasure ΞΌ] {c : ββ₯0} {E : Set Ξ©} (E_mble : MeasurableSet E) (fs : ΞΉ β Ξ© βα΅ ββ₯0)
(fs_bdd : βαΆ i in L, βα΅ Ο : Ξ© βΞΌ, fs i Ο β€ c)
(fs_lim : βα΅ Ο βΞΌ, Tendsto (fun i β¦ fs i Ο) L (π (indicator E (fun _ β¦ (1 : ββ₯0)) Ο))) :
Tendsto (fun n β¦ lintegral ΞΌ fun Ο β¦ fs n Ο) L (π (ΞΌ E)) := by
convert tendsto_lintegral_nn_filter_of_le_const ΞΌ fs_bdd fs_lim
have aux : β Ο, indicator E (fun _ β¦ (1 : ββ₯0β)) Ο = β(indicator E (fun _ β¦ (1 : ββ₯0)) Ο) :=
fun Ο β¦ by simp only [ENNReal.coe_indicator, ENNReal.coe_one]
simp_rw [β aux, lintegral_indicator _ E_mble]
simp only [lintegral_one, Measure.restrict_apply, MeasurableSet.univ, univ_inter]
#align measure_theory.measure_of_cont_bdd_of_tendsto_filter_indicator MeasureTheory.measure_of_cont_bdd_of_tendsto_filter_indicator
| Mathlib/MeasureTheory/Measure/HasOuterApproxClosed.lean | 95 | 105 | theorem measure_of_cont_bdd_of_tendsto_indicator [OpensMeasurableSpace Ξ©]
(ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] {c : ββ₯0} {E : Set Ξ©} (E_mble : MeasurableSet E)
(fs : β β Ξ© βα΅ ββ₯0) (fs_bdd : β n Ο, fs n Ο β€ c)
(fs_lim : Tendsto (fun n Ο β¦ fs n Ο) atTop (π (indicator E fun _ β¦ (1 : ββ₯0)))) :
Tendsto (fun n β¦ lintegral ΞΌ fun Ο β¦ fs n Ο) atTop (π (ΞΌ E)) := by |
have fs_lim' :
β Ο, Tendsto (fun n : β β¦ (fs n Ο : ββ₯0)) atTop (π (indicator E (fun _ β¦ (1 : ββ₯0)) Ο)) := by
rw [tendsto_pi_nhds] at fs_lim
exact fun Ο β¦ fs_lim Ο
apply measure_of_cont_bdd_of_tendsto_filter_indicator ΞΌ E_mble fs
(eventually_of_forall fun n β¦ eventually_of_forall (fs_bdd n)) (eventually_of_forall fs_lim')
| [
" Tendsto (fun i => β«β» (Ο : Ξ©), β((fs i) Ο) βΞΌ) L (π (β«β» (Ο : Ξ©), β(f Ο) βΞΌ))",
" βαΆ (n : ΞΉ) in L, βα΅ (a : Ξ©) βΞΌ, β((fs n) a) β€ (fun x => βc) a",
" βα΅ (a : Ξ©) βΞΌ, Tendsto (fun n => β((fs n) a)) L (π β(f a))",
" Tendsto (fun n => β«β» (Ο : Ξ©), β((fs n) Ο) βΞΌ) L (π (ΞΌ E))",
" ΞΌ E = β«β» (Ο : Ξ©), β(E.indicator ... | [
" Tendsto (fun i => β«β» (Ο : Ξ©), β((fs i) Ο) βΞΌ) L (π (β«β» (Ο : Ξ©), β(f Ο) βΞΌ))",
" βαΆ (n : ΞΉ) in L, βα΅ (a : Ξ©) βΞΌ, β((fs n) a) β€ (fun x => βc) a",
" βα΅ (a : Ξ©) βΞΌ, Tendsto (fun n => β((fs n) a)) L (π β(f a))",
" Tendsto (fun n => β«β» (Ο : Ξ©), β((fs n) Ο) βΞΌ) L (π (ΞΌ E))",
" ΞΌ E = β«β» (Ο : Ξ©), β(E.indicator ... |
import Mathlib.Order.Interval.Finset.Nat
import Mathlib.Data.PNat.Defs
#align_import data.pnat.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
open Finset Function PNat
namespace PNat
variable (a b : β+)
instance instLocallyFiniteOrder : LocallyFiniteOrder β+ := Subtype.instLocallyFiniteOrder _
theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Icc_eq_finset_subtype PNat.Icc_eq_finset_subtype
theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Ico_eq_finset_subtype PNat.Ico_eq_finset_subtype
theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Ioc_eq_finset_subtype PNat.Ioc_eq_finset_subtype
theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Ioo_eq_finset_subtype PNat.Ioo_eq_finset_subtype
theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : β) b).subtype fun n : β => 0 < n := rfl
#align pnat.uIcc_eq_finset_subtype PNat.uIcc_eq_finset_subtype
theorem map_subtype_embedding_Icc : (Icc a b).map (Embedding.subtype _) = Icc βa βb :=
Finset.map_subtype_embedding_Icc _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Icc PNat.map_subtype_embedding_Icc
theorem map_subtype_embedding_Ico : (Ico a b).map (Embedding.subtype _) = Ico βa βb :=
Finset.map_subtype_embedding_Ico _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Ico PNat.map_subtype_embedding_Ico
theorem map_subtype_embedding_Ioc : (Ioc a b).map (Embedding.subtype _) = Ioc βa βb :=
Finset.map_subtype_embedding_Ioc _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Ioc PNat.map_subtype_embedding_Ioc
theorem map_subtype_embedding_Ioo : (Ioo a b).map (Embedding.subtype _) = Ioo βa βb :=
Finset.map_subtype_embedding_Ioo _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Ioo PNat.map_subtype_embedding_Ioo
theorem map_subtype_embedding_uIcc : (uIcc a b).map (Embedding.subtype _) = uIcc βa βb :=
map_subtype_embedding_Icc _ _
#align pnat.map_subtype_embedding_uIcc PNat.map_subtype_embedding_uIcc
@[simp]
theorem card_Icc : (Icc a b).card = b + 1 - a := by
rw [β Nat.card_Icc]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Icc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
#align pnat.card_Icc PNat.card_Icc
@[simp]
theorem card_Ico : (Ico a b).card = b - a := by
rw [β Nat.card_Ico]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Ico _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
#align pnat.card_Ico PNat.card_Ico
@[simp]
theorem card_Ioc : (Ioc a b).card = b - a := by
rw [β Nat.card_Ioc]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Ioc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
#align pnat.card_Ioc PNat.card_Ioc
@[simp]
| Mathlib/Data/PNat/Interval.lean | 94 | 99 | theorem card_Ioo : (Ioo a b).card = b - a - 1 := by |
rw [β Nat.card_Ioo]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Ioo _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
| [
" (Icc a b).card = βb + 1 - βa",
" (Icc a b).card = (Icc βa βb).card",
" (Icc a b).card = (map (Embedding.subtype fun n => 0 < n) (Icc a b)).card",
" (Ico a b).card = βb - βa",
" (Ico a b).card = (Ico βa βb).card",
" (Ico a b).card = (map (Embedding.subtype fun n => 0 < n) (Ico a b)).card",
" (Ioc a b).... | [
" (Icc a b).card = βb + 1 - βa",
" (Icc a b).card = (Icc βa βb).card",
" (Icc a b).card = (map (Embedding.subtype fun n => 0 < n) (Icc a b)).card",
" (Ico a b).card = βb - βa",
" (Ico a b).card = (Ico βa βb).card",
" (Ico a b).card = (map (Embedding.subtype fun n => 0 < n) (Ico a b)).card",
" (Ioc a b).... |
import Mathlib.RepresentationTheory.Action.Limits
import Mathlib.RepresentationTheory.Action.Concrete
import Mathlib.CategoryTheory.Monoidal.FunctorCategory
import Mathlib.CategoryTheory.Monoidal.Transport
import Mathlib.CategoryTheory.Monoidal.Rigid.OfEquivalence
import Mathlib.CategoryTheory.Monoidal.Rigid.FunctorCategory
import Mathlib.CategoryTheory.Monoidal.Linear
import Mathlib.CategoryTheory.Monoidal.Braided.Basic
import Mathlib.CategoryTheory.Monoidal.Types.Basic
universe u v
open CategoryTheory Limits
variable {V : Type (u + 1)} [LargeCategory V] {G : MonCat.{u}}
namespace Action
section Monoidal
open MonoidalCategory
variable [MonoidalCategory V]
instance instMonoidalCategory : MonoidalCategory (Action V G) :=
Monoidal.transport (Action.functorCategoryEquivalence _ _).symm
@[simp]
theorem tensorUnit_v : (π_ (Action V G)).V = π_ V :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_unit_V Action.tensorUnit_v
-- Porting note: removed @[simp] as the simpNF linter complains
theorem tensorUnit_rho {g : G} : (π_ (Action V G)).Ο g = π (π_ V) :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_unit_rho Action.tensorUnit_rho
@[simp]
theorem tensor_v {X Y : Action V G} : (X β Y).V = X.V β Y.V :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_V Action.tensor_v
-- Porting note: removed @[simp] as the simpNF linter complains
theorem tensor_rho {X Y : Action V G} {g : G} : (X β Y).Ο g = X.Ο g β Y.Ο g :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_rho Action.tensor_rho
@[simp]
theorem tensor_hom {W X Y Z : Action V G} (f : W βΆ X) (g : Y βΆ Z) : (f β g).hom = f.hom β g.hom :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_hom Action.tensor_hom
@[simp]
theorem whiskerLeft_hom (X : Action V G) {Y Z : Action V G} (f : Y βΆ Z) :
(X β f).hom = X.V β f.hom :=
rfl
@[simp]
theorem whiskerRight_hom {X Y : Action V G} (f : X βΆ Y) (Z : Action V G) :
(f β· Z).hom = f.hom β· Z.V :=
rfl
-- Porting note: removed @[simp] as the simpNF linter complains
| Mathlib/RepresentationTheory/Action/Monoidal.lean | 82 | 85 | theorem associator_hom_hom {X Y Z : Action V G} :
Hom.hom (Ξ±_ X Y Z).hom = (Ξ±_ X.V Y.V Z.V).hom := by |
dsimp
simp
| [
" (Ξ±_ X Y Z).hom.hom = (Ξ±_ X.V Y.V Z.V).hom",
" (π (X.V β Y.V) β π Z.V) β« (Ξ±_ X.V Y.V Z.V).hom β« (π X.V β π (Y.V β Z.V)) = (Ξ±_ X.V Y.V Z.V).hom"
] | [] |
import Mathlib.Data.Bundle
import Mathlib.Data.Set.Image
import Mathlib.Topology.PartialHomeomorph
import Mathlib.Topology.Order.Basic
#align_import topology.fiber_bundle.trivialization from "leanprover-community/mathlib"@"e473c3198bb41f68560cab68a0529c854b618833"
open TopologicalSpace Filter Set Bundle Function
open scoped Topology Classical Bundle
variable {ΞΉ : Type*} {B : Type*} {F : Type*} {E : B β Type*}
variable (F) {Z : Type*} [TopologicalSpace B] [TopologicalSpace F] {proj : Z β B}
structure Pretrivialization (proj : Z β B) extends PartialEquiv Z (B Γ F) where
open_target : IsOpen target
baseSet : Set B
open_baseSet : IsOpen baseSet
source_eq : source = proj β»ΒΉ' baseSet
target_eq : target = baseSet ΓΛ’ univ
proj_toFun : β p β source, (toFun p).1 = proj p
#align pretrivialization Pretrivialization
namespace Pretrivialization
variable {F}
variable (e : Pretrivialization F proj) {x : Z}
@[coe] def toFun' : Z β (B Γ F) := e.toFun
instance : CoeFun (Pretrivialization F proj) fun _ => Z β B Γ F := β¨toFun'β©
@[ext]
lemma ext' (e e' : Pretrivialization F proj) (hβ : e.toPartialEquiv = e'.toPartialEquiv)
(hβ : e.baseSet = e'.baseSet) : e = e' := by
cases e; cases e'; congr
#align pretrivialization.ext Pretrivialization.ext'
-- Porting note (#11215): TODO: move `ext` here?
lemma ext {e e' : Pretrivialization F proj} (hβ : β x, e x = e' x)
(hβ : β x, e.toPartialEquiv.symm x = e'.toPartialEquiv.symm x) (hβ : e.baseSet = e'.baseSet) :
e = e' := by
ext1 <;> [ext1; exact hβ]
Β· apply hβ
Β· apply hβ
Β· rw [e.source_eq, e'.source_eq, hβ]
lemma toPartialEquiv_injective [Nonempty F] :
Injective (toPartialEquiv : Pretrivialization F proj β PartialEquiv Z (B Γ F)) := by
refine fun e e' h β¦ ext' _ _ h ?_
simpa only [fst_image_prod, univ_nonempty, target_eq]
using congr_arg (Prod.fst '' PartialEquiv.target Β·) h
@[simp, mfld_simps]
theorem coe_coe : βe.toPartialEquiv = e :=
rfl
#align pretrivialization.coe_coe Pretrivialization.coe_coe
@[simp, mfld_simps]
theorem coe_fst (ex : x β e.source) : (e x).1 = proj x :=
e.proj_toFun x ex
#align pretrivialization.coe_fst Pretrivialization.coe_fst
theorem mem_source : x β e.source β proj x β e.baseSet := by rw [e.source_eq, mem_preimage]
#align pretrivialization.mem_source Pretrivialization.mem_source
theorem coe_fst' (ex : proj x β e.baseSet) : (e x).1 = proj x :=
e.coe_fst (e.mem_source.2 ex)
#align pretrivialization.coe_fst' Pretrivialization.coe_fst'
protected theorem eqOn : EqOn (Prod.fst β e) proj e.source := fun _ hx => e.coe_fst hx
#align pretrivialization.eq_on Pretrivialization.eqOn
theorem mk_proj_snd (ex : x β e.source) : (proj x, (e x).2) = e x :=
Prod.ext (e.coe_fst ex).symm rfl
#align pretrivialization.mk_proj_snd Pretrivialization.mk_proj_snd
theorem mk_proj_snd' (ex : proj x β e.baseSet) : (proj x, (e x).2) = e x :=
Prod.ext (e.coe_fst' ex).symm rfl
#align pretrivialization.mk_proj_snd' Pretrivialization.mk_proj_snd'
def setSymm : e.target β Z :=
e.target.restrict e.toPartialEquiv.symm
#align pretrivialization.set_symm Pretrivialization.setSymm
| Mathlib/Topology/FiberBundle/Trivialization.lean | 141 | 142 | theorem mem_target {x : B Γ F} : x β e.target β x.1 β e.baseSet := by |
rw [e.target_eq, prod_univ, mem_preimage]
| [
" e = e'",
" { toPartialEquiv := toPartialEquivβ, open_target := open_targetβ, baseSet := baseSetβ, open_baseSet := open_baseSetβ,\n source_eq := source_eqβ, target_eq := target_eqβ, proj_toFun := proj_toFunβ } =\n e'",
" { toPartialEquiv := toPartialEquivβΒΉ, open_target := open_targetβΒΉ, baseSet := bas... | [
" e = e'",
" { toPartialEquiv := toPartialEquivβ, open_target := open_targetβ, baseSet := baseSetβ, open_baseSet := open_baseSetβ,\n source_eq := source_eqβ, target_eq := target_eqβ, proj_toFun := proj_toFunβ } =\n e'",
" { toPartialEquiv := toPartialEquivβΒΉ, open_target := open_targetβΒΉ, baseSet := bas... |
import Mathlib.Algebra.Polynomial.Splits
#align_import algebra.cubic_discriminant from "leanprover-community/mathlib"@"930133160e24036d5242039fe4972407cd4f1222"
noncomputable section
@[ext]
structure Cubic (R : Type*) where
(a b c d : R)
#align cubic Cubic
namespace Cubic
open Cubic Polynomial
open Polynomial
variable {R S F K : Type*}
instance [Inhabited R] : Inhabited (Cubic R) :=
β¨β¨default, default, default, defaultβ©β©
instance [Zero R] : Zero (Cubic R) :=
β¨β¨0, 0, 0, 0β©β©
section Basic
variable {P Q : Cubic R} {a b c d a' b' c' d' : R} [Semiring R]
def toPoly (P : Cubic R) : R[X] :=
C P.a * X ^ 3 + C P.b * X ^ 2 + C P.c * X + C P.d
#align cubic.to_poly Cubic.toPoly
theorem C_mul_prod_X_sub_C_eq [CommRing S] {w x y z : S} :
C w * (X - C x) * (X - C y) * (X - C z) =
toPoly β¨w, w * -(x + y + z), w * (x * y + x * z + y * z), w * -(x * y * z)β© := by
simp only [toPoly, C_neg, C_add, C_mul]
ring1
set_option linter.uppercaseLean3 false in
#align cubic.C_mul_prod_X_sub_C_eq Cubic.C_mul_prod_X_sub_C_eq
theorem prod_X_sub_C_eq [CommRing S] {x y z : S} :
(X - C x) * (X - C y) * (X - C z) =
toPoly β¨1, -(x + y + z), x * y + x * z + y * z, -(x * y * z)β© := by
rw [β one_mul <| X - C x, β C_1, C_mul_prod_X_sub_C_eq, one_mul, one_mul, one_mul]
set_option linter.uppercaseLean3 false in
#align cubic.prod_X_sub_C_eq Cubic.prod_X_sub_C_eq
section Map
variable [Semiring S] {Ο : R β+* S}
def map (Ο : R β+* S) (P : Cubic R) : Cubic S :=
β¨Ο P.a, Ο P.b, Ο P.c, Ο P.dβ©
#align cubic.map Cubic.map
| Mathlib/Algebra/CubicDiscriminant.lean | 458 | 459 | theorem map_toPoly : (map Ο P).toPoly = Polynomial.map Ο P.toPoly := by |
simp only [map, toPoly, map_C, map_X, Polynomial.map_add, Polynomial.map_mul, Polynomial.map_pow]
| [
" C w * (X - C x) * (X - C y) * (X - C z) =\n { a := w, b := w * -(x + y + z), c := w * (x * y + x * z + y * z), d := w * -(x * y * z) }.toPoly",
" C w * (X - C x) * (X - C y) * (X - C z) =\n C w * X ^ 3 + C w * -(C x + C y + C z) * X ^ 2 + C w * (C x * C y + C x * C z + C y * C z) * X +\n C w * -(C x ... | [
" C w * (X - C x) * (X - C y) * (X - C z) =\n { a := w, b := w * -(x + y + z), c := w * (x * y + x * z + y * z), d := w * -(x * y * z) }.toPoly",
" C w * (X - C x) * (X - C y) * (X - C z) =\n C w * X ^ 3 + C w * -(C x + C y + C z) * X ^ 2 + C w * (C x * C y + C x * C z + C y * C z) * X +\n C w * -(C x ... |
import Mathlib.Algebra.Algebra.Spectrum
import Mathlib.LinearAlgebra.GeneralLinearGroup
import Mathlib.LinearAlgebra.FiniteDimensional
import Mathlib.RingTheory.Nilpotent.Basic
#align_import linear_algebra.eigenspace.basic from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
universe u v w
namespace Module
namespace End
open FiniteDimensional Set
variable {K R : Type v} {V M : Type w} [CommRing R] [AddCommGroup M] [Module R M] [Field K]
[AddCommGroup V] [Module K V]
def eigenspace (f : End R M) (ΞΌ : R) : Submodule R M :=
LinearMap.ker (f - algebraMap R (End R M) ΞΌ)
#align module.End.eigenspace Module.End.eigenspace
@[simp]
| Mathlib/LinearAlgebra/Eigenspace/Basic.lean | 69 | 69 | theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f := by | simp [eigenspace]
| [
" f.eigenspace 0 = LinearMap.ker f"
] | [] |
import Mathlib.Algebra.Polynomial.Monic
#align_import algebra.polynomial.big_operators from "leanprover-community/mathlib"@"47adfab39a11a072db552f47594bf8ed2cf8a722"
open Finset
open Multiset
open Polynomial
universe u w
variable {R : Type u} {ΞΉ : Type w}
namespace Polynomial
variable (s : Finset ΞΉ)
section Semiring
variable {S : Type*} [Semiring S]
set_option backward.isDefEq.lazyProjDelta false in -- See https://github.com/leanprover-community/mathlib4/issues/12535
theorem natDegree_list_sum_le (l : List S[X]) : natDegree l.sum β€ (l.map natDegree).foldr max 0 :=
List.sum_le_foldr_max natDegree (by simp) natDegree_add_le _
#align polynomial.nat_degree_list_sum_le Polynomial.natDegree_list_sum_le
theorem natDegree_multiset_sum_le (l : Multiset S[X]) :
natDegree l.sum β€ (l.map natDegree).foldr max max_left_comm 0 :=
Quotient.inductionOn l (by simpa using natDegree_list_sum_le)
#align polynomial.nat_degree_multiset_sum_le Polynomial.natDegree_multiset_sum_le
theorem natDegree_sum_le (f : ΞΉ β S[X]) :
natDegree (β i β s, f i) β€ s.fold max 0 (natDegree β f) := by
simpa using natDegree_multiset_sum_le (s.val.map f)
#align polynomial.nat_degree_sum_le Polynomial.natDegree_sum_le
lemma natDegree_sum_le_of_forall_le {n : β} (f : ΞΉ β S[X]) (h : β i β s, natDegree (f i) β€ n) :
natDegree (β i β s, f i) β€ n :=
le_trans (natDegree_sum_le s f) <| (Finset.fold_max_le n).mpr <| by simpa
theorem degree_list_sum_le (l : List S[X]) : degree l.sum β€ (l.map natDegree).maximum := by
by_cases h : l.sum = 0
Β· simp [h]
Β· rw [degree_eq_natDegree h]
suffices (l.map natDegree).maximum = ((l.map natDegree).foldr max 0 : β) by
rw [this]
simpa using natDegree_list_sum_le l
rw [β List.foldr_max_of_ne_nil]
Β· congr
contrapose! h
rw [List.map_eq_nil] at h
simp [h]
#align polynomial.degree_list_sum_le Polynomial.degree_list_sum_le
theorem natDegree_list_prod_le (l : List S[X]) : natDegree l.prod β€ (l.map natDegree).sum := by
induction' l with hd tl IH
Β· simp
Β· simpa using natDegree_mul_le.trans (add_le_add_left IH _)
#align polynomial.nat_degree_list_prod_le Polynomial.natDegree_list_prod_le
theorem degree_list_prod_le (l : List S[X]) : degree l.prod β€ (l.map degree).sum := by
induction' l with hd tl IH
Β· simp
Β· simpa using (degree_mul_le _ _).trans (add_le_add_left IH _)
#align polynomial.degree_list_prod_le Polynomial.degree_list_prod_le
| Mathlib/Algebra/Polynomial/BigOperators.lean | 92 | 111 | theorem coeff_list_prod_of_natDegree_le (l : List S[X]) (n : β) (hl : β p β l, natDegree p β€ n) :
coeff (List.prod l) (l.length * n) = (l.map fun p => coeff p n).prod := by |
induction' l with hd tl IH
Β· simp
Β· have hl' : β p β tl, natDegree p β€ n := fun p hp => hl p (List.mem_cons_of_mem _ hp)
simp only [List.prod_cons, List.map, List.length]
rw [add_mul, one_mul, add_comm, β IH hl', mul_comm tl.length]
have h : natDegree tl.prod β€ n * tl.length := by
refine (natDegree_list_prod_le _).trans ?_
rw [β tl.length_map natDegree, mul_comm]
refine List.sum_le_card_nsmul _ _ ?_
simpa using hl'
have hdn : natDegree hd β€ n := hl _ (List.mem_cons_self _ _)
rcases hdn.eq_or_lt with (rfl | hdn')
Β· rcases h.eq_or_lt with h' | h'
Β· rw [β h', coeff_mul_degree_add_degree, leadingCoeff, leadingCoeff]
Β· rw [coeff_eq_zero_of_natDegree_lt, coeff_eq_zero_of_natDegree_lt h', mul_zero]
exact natDegree_mul_le.trans_lt (add_lt_add_left h' _)
Β· rw [coeff_eq_zero_of_natDegree_lt hdn', coeff_eq_zero_of_natDegree_lt, zero_mul]
exact natDegree_mul_le.trans_lt (add_lt_add_of_lt_of_le hdn' h)
| [
" natDegree 0 β€ 0",
" β (a : List S[X]), (Multiset.sum β¦aβ§).natDegree β€ foldr max β― 0 (Multiset.map natDegree β¦aβ§)",
" (β i β s, f i).natDegree β€ Finset.fold max 0 (natDegree β f) s",
" 0 β€ n β§ β x β s, (natDegree β f) x β€ n",
" l.sum.degree β€ (List.map natDegree l).maximum",
" βl.sum.natDegree β€ (List.ma... | [
" natDegree 0 β€ 0",
" β (a : List S[X]), (Multiset.sum β¦aβ§).natDegree β€ foldr max β― 0 (Multiset.map natDegree β¦aβ§)",
" (β i β s, f i).natDegree β€ Finset.fold max 0 (natDegree β f) s",
" 0 β€ n β§ β x β s, (natDegree β f) x β€ n",
" l.sum.degree β€ (List.map natDegree l).maximum",
" βl.sum.natDegree β€ (List.ma... |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Set.Subsingleton
#align_import combinatorics.composition from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
open List
variable {n : β}
@[ext]
structure Composition (n : β) where
blocks : List β
blocks_pos : β {i}, i β blocks β 0 < i
blocks_sum : blocks.sum = n
#align composition Composition
@[ext]
structure CompositionAsSet (n : β) where
boundaries : Finset (Fin n.succ)
zero_mem : (0 : Fin n.succ) β boundaries
getLast_mem : Fin.last n β boundaries
#align composition_as_set CompositionAsSet
instance {n : β} : Inhabited (CompositionAsSet n) :=
β¨β¨Finset.univ, Finset.mem_univ _, Finset.mem_univ _β©β©
namespace Composition
variable (c : Composition n)
instance (n : β) : ToString (Composition n) :=
β¨fun c => toString c.blocksβ©
abbrev length : β :=
c.blocks.length
#align composition.length Composition.length
theorem blocks_length : c.blocks.length = c.length :=
rfl
#align composition.blocks_length Composition.blocks_length
def blocksFun : Fin c.length β β := c.blocks.get
#align composition.blocks_fun Composition.blocksFun
theorem ofFn_blocksFun : ofFn c.blocksFun = c.blocks :=
ofFn_get _
#align composition.of_fn_blocks_fun Composition.ofFn_blocksFun
theorem sum_blocksFun : β i, c.blocksFun i = n := by
conv_rhs => rw [β c.blocks_sum, β ofFn_blocksFun, sum_ofFn]
#align composition.sum_blocks_fun Composition.sum_blocksFun
theorem blocksFun_mem_blocks (i : Fin c.length) : c.blocksFun i β c.blocks :=
get_mem _ _ _
#align composition.blocks_fun_mem_blocks Composition.blocksFun_mem_blocks
@[simp]
theorem one_le_blocks {i : β} (h : i β c.blocks) : 1 β€ i :=
c.blocks_pos h
#align composition.one_le_blocks Composition.one_le_blocks
@[simp]
theorem one_le_blocks' {i : β} (h : i < c.length) : 1 β€ c.blocks.get β¨i, hβ© :=
c.one_le_blocks (get_mem (blocks c) i h)
#align composition.one_le_blocks' Composition.one_le_blocks'
@[simp]
theorem blocks_pos' (i : β) (h : i < c.length) : 0 < c.blocks.get β¨i, hβ© :=
c.one_le_blocks' h
#align composition.blocks_pos' Composition.blocks_pos'
theorem one_le_blocksFun (i : Fin c.length) : 1 β€ c.blocksFun i :=
c.one_le_blocks (c.blocksFun_mem_blocks i)
#align composition.one_le_blocks_fun Composition.one_le_blocksFun
theorem length_le : c.length β€ n := by
conv_rhs => rw [β c.blocks_sum]
exact length_le_sum_of_one_le _ fun i hi => c.one_le_blocks hi
#align composition.length_le Composition.length_le
theorem length_pos_of_pos (h : 0 < n) : 0 < c.length := by
apply length_pos_of_sum_pos
convert h
exact c.blocks_sum
#align composition.length_pos_of_pos Composition.length_pos_of_pos
def sizeUpTo (i : β) : β :=
(c.blocks.take i).sum
#align composition.size_up_to Composition.sizeUpTo
@[simp]
theorem sizeUpTo_zero : c.sizeUpTo 0 = 0 := by simp [sizeUpTo]
#align composition.size_up_to_zero Composition.sizeUpTo_zero
theorem sizeUpTo_ofLength_le (i : β) (h : c.length β€ i) : c.sizeUpTo i = n := by
dsimp [sizeUpTo]
convert c.blocks_sum
exact take_all_of_le h
#align composition.size_up_to_of_length_le Composition.sizeUpTo_ofLength_le
@[simp]
theorem sizeUpTo_length : c.sizeUpTo c.length = n :=
c.sizeUpTo_ofLength_le c.length le_rfl
#align composition.size_up_to_length Composition.sizeUpTo_length
theorem sizeUpTo_le (i : β) : c.sizeUpTo i β€ n := by
conv_rhs => rw [β c.blocks_sum, β sum_take_add_sum_drop _ i]
exact Nat.le_add_right _ _
#align composition.size_up_to_le Composition.sizeUpTo_le
theorem sizeUpTo_succ {i : β} (h : i < c.length) :
c.sizeUpTo (i + 1) = c.sizeUpTo i + c.blocks.get β¨i, hβ© := by
simp only [sizeUpTo]
rw [sum_take_succ _ _ h]
#align composition.size_up_to_succ Composition.sizeUpTo_succ
theorem sizeUpTo_succ' (i : Fin c.length) :
c.sizeUpTo ((i : β) + 1) = c.sizeUpTo i + c.blocksFun i :=
c.sizeUpTo_succ i.2
#align composition.size_up_to_succ' Composition.sizeUpTo_succ'
theorem sizeUpTo_strict_mono {i : β} (h : i < c.length) : c.sizeUpTo i < c.sizeUpTo (i + 1) := by
rw [c.sizeUpTo_succ h]
simp
#align composition.size_up_to_strict_mono Composition.sizeUpTo_strict_mono
theorem monotone_sizeUpTo : Monotone c.sizeUpTo :=
monotone_sum_take _
#align composition.monotone_size_up_to Composition.monotone_sizeUpTo
def boundary : Fin (c.length + 1) βͺo Fin (n + 1) :=
(OrderEmbedding.ofStrictMono fun i => β¨c.sizeUpTo i, Nat.lt_succ_of_le (c.sizeUpTo_le i)β©) <|
Fin.strictMono_iff_lt_succ.2 fun β¨_, hiβ© => c.sizeUpTo_strict_mono hi
#align composition.boundary Composition.boundary
@[simp]
| Mathlib/Combinatorics/Enumerative/Composition.lean | 252 | 252 | theorem boundary_zero : c.boundary 0 = 0 := by | simp [boundary, Fin.ext_iff]
| [
" β i : Fin c.length, c.blocksFun i = n",
"n : β c : Composition n | n",
" c.length β€ n",
" c.length β€ c.blocks.sum",
" 0 < c.length",
" 0 < c.blocks.sum",
" c.blocks.sum = n",
" c.sizeUpTo 0 = 0",
" c.sizeUpTo i = n",
" (take i c.blocks).sum = n",
" take i c.blocks = c.blocks",
" c.sizeUpTo i... | [
" β i : Fin c.length, c.blocksFun i = n",
"n : β c : Composition n | n",
" c.length β€ n",
" c.length β€ c.blocks.sum",
" 0 < c.length",
" 0 < c.blocks.sum",
" c.blocks.sum = n",
" c.sizeUpTo 0 = 0",
" c.sizeUpTo i = n",
" (take i c.blocks).sum = n",
" take i c.blocks = c.blocks",
" c.sizeUpTo i... |
import Mathlib.Algebra.Polynomial.Degree.Definitions
#align_import ring_theory.polynomial.opposites from "leanprover-community/mathlib"@"63417e01fbc711beaf25fa73b6edb395c0cfddd0"
open Polynomial
open Polynomial MulOpposite
variable {R : Type*} [Semiring R]
noncomputable section
namespace Polynomial
def opRingEquiv (R : Type*) [Semiring R] : R[X]α΅α΅α΅ β+* Rα΅α΅α΅[X] :=
((toFinsuppIso R).op.trans AddMonoidAlgebra.opRingEquiv).trans (toFinsuppIso _).symm
#align polynomial.op_ring_equiv Polynomial.opRingEquiv
@[simp]
theorem opRingEquiv_op_monomial (n : β) (r : R) :
opRingEquiv R (op (monomial n r : R[X])) = monomial n (op r) := by
simp only [opRingEquiv, RingEquiv.coe_trans, Function.comp_apply,
AddMonoidAlgebra.opRingEquiv_apply, RingEquiv.op_apply_apply, toFinsuppIso_apply, unop_op,
toFinsupp_monomial, Finsupp.mapRange_single, toFinsuppIso_symm_apply, ofFinsupp_single]
#align polynomial.op_ring_equiv_op_monomial Polynomial.opRingEquiv_op_monomial
@[simp]
theorem opRingEquiv_op_C (a : R) : opRingEquiv R (op (C a)) = C (op a) :=
opRingEquiv_op_monomial 0 a
set_option linter.uppercaseLean3 false in
#align polynomial.op_ring_equiv_op_C Polynomial.opRingEquiv_op_C
@[simp]
theorem opRingEquiv_op_X : opRingEquiv R (op (X : R[X])) = X :=
opRingEquiv_op_monomial 1 1
set_option linter.uppercaseLean3 false in
#align polynomial.op_ring_equiv_op_X Polynomial.opRingEquiv_op_X
| Mathlib/RingTheory/Polynomial/Opposites.lean | 57 | 59 | theorem opRingEquiv_op_C_mul_X_pow (r : R) (n : β) :
opRingEquiv R (op (C r * X ^ n : R[X])) = C (op r) * X ^ n := by |
simp only [X_pow_mul, op_mul, op_pow, map_mul, map_pow, opRingEquiv_op_X, opRingEquiv_op_C]
| [
" (opRingEquiv R) (op ((monomial n) r)) = (monomial n) (op r)",
" (opRingEquiv R) (op (C r * X ^ n)) = C (op r) * X ^ n"
] | [
" (opRingEquiv R) (op ((monomial n) r)) = (monomial n) (op r)"
] |
import Mathlib.Analysis.Analytic.Basic
import Mathlib.Combinatorics.Enumerative.Composition
#align_import analysis.analytic.composition from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a"
noncomputable section
variable {π : Type*} {E F G H : Type*}
open Filter List
open scoped Topology Classical NNReal ENNReal
section Topological
variable [CommRing π] [AddCommGroup E] [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module π F] [Module π G]
variable [TopologicalSpace E] [TopologicalSpace F] [TopologicalSpace G]
namespace FormalMultilinearSeries
variable [TopologicalAddGroup E] [ContinuousConstSMul π E]
variable [TopologicalAddGroup F] [ContinuousConstSMul π F]
variable [TopologicalAddGroup G] [ContinuousConstSMul π G]
def applyComposition (p : FormalMultilinearSeries π E F) {n : β} (c : Composition n) :
(Fin n β E) β Fin c.length β F := fun v i => p (c.blocksFun i) (v β c.embedding i)
#align formal_multilinear_series.apply_composition FormalMultilinearSeries.applyComposition
theorem applyComposition_ones (p : FormalMultilinearSeries π E F) (n : β) :
p.applyComposition (Composition.ones n) = fun v i =>
p 1 fun _ => v (Fin.castLE (Composition.length_le _) i) := by
funext v i
apply p.congr (Composition.ones_blocksFun _ _)
intro j hjn hj1
obtain rfl : j = 0 := by omega
refine congr_arg v ?_
rw [Fin.ext_iff, Fin.coe_castLE, Composition.ones_embedding, Fin.val_mk]
#align formal_multilinear_series.apply_composition_ones FormalMultilinearSeries.applyComposition_ones
theorem applyComposition_single (p : FormalMultilinearSeries π E F) {n : β} (hn : 0 < n)
(v : Fin n β E) : p.applyComposition (Composition.single n hn) v = fun _j => p n v := by
ext j
refine p.congr (by simp) fun i hi1 hi2 => ?_
dsimp
congr 1
convert Composition.single_embedding hn β¨i, hi2β© using 1
cases' j with j_val j_property
have : j_val = 0 := le_bot_iff.1 (Nat.lt_succ_iff.1 j_property)
congr!
simp
#align formal_multilinear_series.apply_composition_single FormalMultilinearSeries.applyComposition_single
@[simp]
| Mathlib/Analysis/Analytic/Composition.lean | 131 | 134 | theorem removeZero_applyComposition (p : FormalMultilinearSeries π E F) {n : β}
(c : Composition n) : p.removeZero.applyComposition c = p.applyComposition c := by |
ext v i
simp [applyComposition, zero_lt_one.trans_le (c.one_le_blocksFun i), removeZero_of_pos]
| [
" p.applyComposition (Composition.ones n) = fun v i => (p 1) fun x => v (Fin.castLE β― i)",
" p.applyComposition (Composition.ones n) v i = (p 1) fun x => v (Fin.castLE β― i)",
" β (i_1 : β) (him : i_1 < (Composition.ones n).blocksFun i),\n i_1 < 1 β (v β β((Composition.ones n).embedding i)) β¨i_1, himβ© = v (Fi... | [
" p.applyComposition (Composition.ones n) = fun v i => (p 1) fun x => v (Fin.castLE β― i)",
" p.applyComposition (Composition.ones n) v i = (p 1) fun x => v (Fin.castLE β― i)",
" β (i_1 : β) (him : i_1 < (Composition.ones n).blocksFun i),\n i_1 < 1 β (v β β((Composition.ones n).embedding i)) β¨i_1, himβ© = v (Fi... |
import Mathlib.CategoryTheory.Sites.Sheaf
#align_import category_theory.sites.canonical from "leanprover-community/mathlib"@"9e7c80f638149bfb3504ba8ff48dfdbfc949fb1a"
universe v u
namespace CategoryTheory
open scoped Classical
open CategoryTheory Category Limits Sieve
variable {C : Type u} [Category.{v} C]
namespace Sheaf
variable {P : Cα΅α΅ β₯€ Type v}
variable {X Y : C} {S : Sieve X} {R : Presieve X}
variable (J Jβ : GrothendieckTopology C)
theorem isSheafFor_bind (P : Cα΅α΅ β₯€ Type v) (U : Sieve X) (B : β β¦Yβ¦ β¦f : Y βΆ Xβ¦, U f β Sieve Y)
(hU : Presieve.IsSheafFor P (U : Presieve X))
(hB : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (hf : U f), Presieve.IsSheafFor P (B hf : Presieve Y))
(hB' : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (h : U f) β¦Zβ¦ (g : Z βΆ Y),
Presieve.IsSeparatedFor P (((B h).pullback g) : Presieve Z)) :
Presieve.IsSheafFor P (Sieve.bind (U : Presieve X) B : Presieve X) := by
intro s hs
let y : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (hf : U f), Presieve.FamilyOfElements P (B hf : Presieve Y) :=
fun Y f hf Z g hg => s _ (Presieve.bind_comp _ _ hg)
have hy : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (hf : U f), (y hf).Compatible := by
intro Y f H Yβ Yβ Z gβ gβ fβ fβ hfβ hfβ comm
apply hs
apply reassoc_of% comm
let t : Presieve.FamilyOfElements P (U : Presieve X) :=
fun Y f hf => (hB hf).amalgamate (y hf) (hy hf)
have ht : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (hf : U f), (y hf).IsAmalgamation (t f hf) := fun Y f hf =>
(hB hf).isAmalgamation _
have hT : t.Compatible := by
rw [Presieve.compatible_iff_sieveCompatible]
intro Z W f h hf
apply (hB (U.downward_closed hf h)).isSeparatedFor.ext
intro Y l hl
apply (hB' hf (l β« h)).ext
intro M m hm
have : bind U B (m β« l β« h β« f) := by
-- Porting note: had to make explicit the parameter `((m β« l β« h) β« f)` and
-- using `by exact`
have : bind U B ((m β« l β« h) β« f) := by exact Presieve.bind_comp f hf hm
simpa using this
trans s (m β« l β« h β« f) this
Β· have := ht (U.downward_closed hf h) _ ((B _).downward_closed hl m)
rw [op_comp, FunctorToTypes.map_comp_apply] at this
rw [this]
change s _ _ = s _ _
-- Porting note: the proof was `by simp`
congr 1
simp only [assoc]
Β· have h : s _ _ = _ := (ht hf _ hm).symm
-- Porting note: this was done by `simp only [assoc] at`
conv_lhs at h => congr; rw [assoc, assoc]
rw [h]
simp only [op_comp, assoc, FunctorToTypes.map_comp_apply]
refine β¨hU.amalgamate t hT, ?_, ?_β©
Β· rintro Z _ β¨Y, f, g, hg, hf, rflβ©
rw [op_comp, FunctorToTypes.map_comp_apply, Presieve.IsSheafFor.valid_glue _ _ _ hg]
apply ht hg _ hf
Β· intro y hy
apply hU.isSeparatedFor.ext
intro Y f hf
apply (hB hf).isSeparatedFor.ext
intro Z g hg
rw [β FunctorToTypes.map_comp_apply, β op_comp, hy _ (Presieve.bind_comp _ _ hg),
hU.valid_glue _ _ hf, ht hf _ hg]
#align category_theory.sheaf.is_sheaf_for_bind CategoryTheory.Sheaf.isSheafFor_bind
| Mathlib/CategoryTheory/Sites/Canonical.lean | 125 | 150 | theorem isSheafFor_trans (P : Cα΅α΅ β₯€ Type v) (R S : Sieve X)
(hR : Presieve.IsSheafFor P (R : Presieve X))
(hR' : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (_ : S f), Presieve.IsSeparatedFor P (R.pullback f : Presieve Y))
(hS : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (_ : R f), Presieve.IsSheafFor P (S.pullback f : Presieve Y)) :
Presieve.IsSheafFor P (S : Presieve X) := by |
have : (bind R fun Y f _ => S.pullback f : Presieve X) β€ S := by
rintro Z f β¨W, f, g, hg, hf : S _, rflβ©
apply hf
apply Presieve.isSheafFor_subsieve_aux P this
Β· apply isSheafFor_bind _ _ _ hR hS
intro Y f hf Z g
rw [β pullback_comp]
apply (hS (R.downward_closed hf _)).isSeparatedFor
Β· intro Y f hf
have : Sieve.pullback f (bind R fun T (k : T βΆ X) (_ : R k) => pullback k S) =
R.pullback f := by
ext Z g
constructor
Β· rintro β¨W, k, l, hl, _, commβ©
rw [pullback_apply, β comm]
simp [hl]
Β· intro a
refine β¨Z, π Z, _, a, ?_β©
simp [hf]
rw [this]
apply hR' hf
| [
" Presieve.IsSheafFor P (Sieve.bind U.arrows B).arrows",
" β! t, s.IsAmalgamation t",
" β β¦Y : Cβ¦ β¦f : Y βΆ Xβ¦ (hf : U.arrows f), (y hf).Compatible",
" P.map gβ.op (y H fβ hfβ) = P.map gβ.op (y H fβ hfβ)",
" gβ β« fβ β« f = gβ β« fβ β« f",
" t.Compatible",
" t.SieveCompatible",
" t (h β« f) β― = P.map h.op (... | [
" Presieve.IsSheafFor P (Sieve.bind U.arrows B).arrows",
" β! t, s.IsAmalgamation t",
" β β¦Y : Cβ¦ β¦f : Y βΆ Xβ¦ (hf : U.arrows f), (y hf).Compatible",
" P.map gβ.op (y H fβ hfβ) = P.map gβ.op (y H fβ hfβ)",
" gβ β« fβ β« f = gβ β« fβ β« f",
" t.Compatible",
" t.SieveCompatible",
" t (h β« f) β― = P.map h.op (... |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
normAtPlace w (x + y) β€ normAtPlace w x + normAtPlace w y := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_add_le _ _
theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : β) :
normAtPlace w (c β’ x) = |c| * normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs
Β· rw [Prod.smul_fst, Pi.smul_apply, norm_smul, Real.norm_eq_abs]
Β· rw [Prod.smul_snd, Pi.smul_apply, norm_smul, Real.norm_eq_abs, Complex.norm_eq_abs]
theorem normAtPlace_real (w : InfinitePlace K) (c : β) :
normAtPlace w ((fun _ β¦ c, fun _ β¦ c) : (E K)) = |c| := by
rw [show ((fun _ β¦ c, fun _ β¦ c) : (E K)) = c β’ 1 by ext <;> simp, normAtPlace_smul, map_one,
mul_one]
theorem normAtPlace_apply_isReal {w : InfinitePlace K} (hw : IsReal w) (x : E K):
normAtPlace w x = βx.1 β¨w, hwβ©β := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, dif_pos]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 290 | 293 | theorem normAtPlace_apply_isComplex {w : InfinitePlace K} (hw : IsComplex w) (x : E K) :
normAtPlace w x = βx.2 β¨w, hwβ©β := by |
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk,
dif_neg (not_isReal_iff_isComplex.mpr hw)]
| [
" Nontrivial (({ w // w.IsReal } β β) Γ ({ w // w.IsComplex } β β))",
" finrank β (({ w // w.IsReal } β β) Γ ({ w // w.IsComplex } β β)) = finrank β K",
" Function.Injective β(mixedEmbedding K)",
" (fun x => if hw : w.IsReal then βx.1 β¨w, hwβ©β else βx.2 β¨w, β―β©β) 0 = 0",
" { toFun := fun x => if hw : w.IsRea... | [
" Nontrivial (({ w // w.IsReal } β β) Γ ({ w // w.IsComplex } β β))",
" finrank β (({ w // w.IsReal } β β) Γ ({ w // w.IsComplex } β β)) = finrank β K",
" Function.Injective β(mixedEmbedding K)",
" (fun x => if hw : w.IsReal then βx.1 β¨w, hwβ©β else βx.2 β¨w, β―β©β) 0 = 0",
" { toFun := fun x => if hw : w.IsRea... |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.Finset.NatAntidiagonal
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Init.Data.Nat.Lemmas
import Mathlib.Logic.Function.Iterate
import Mathlib.Tactic.Ring
import Mathlib.Tactic.Zify
#align_import data.nat.fib from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
namespace Nat
-- Porting note: Lean cannot find pp_nodot at the time of this port.
-- @[pp_nodot]
def fib (n : β) : β :=
((fun p : β Γ β => (p.snd, p.fst + p.snd))^[n] (0, 1)).fst
#align nat.fib Nat.fib
@[simp]
theorem fib_zero : fib 0 = 0 :=
rfl
#align nat.fib_zero Nat.fib_zero
@[simp]
theorem fib_one : fib 1 = 1 :=
rfl
#align nat.fib_one Nat.fib_one
@[simp]
theorem fib_two : fib 2 = 1 :=
rfl
#align nat.fib_two Nat.fib_two
theorem fib_add_two {n : β} : fib (n + 2) = fib n + fib (n + 1) := by
simp [fib, Function.iterate_succ_apply']
#align nat.fib_add_two Nat.fib_add_two
lemma fib_add_one : β {n}, n β 0 β fib (n + 1) = fib (n - 1) + fib n
| _n + 1, _ => fib_add_two
theorem fib_le_fib_succ {n : β} : fib n β€ fib (n + 1) := by cases n <;> simp [fib_add_two]
#align nat.fib_le_fib_succ Nat.fib_le_fib_succ
@[mono]
theorem fib_mono : Monotone fib :=
monotone_nat_of_le_succ fun _ => fib_le_fib_succ
#align nat.fib_mono Nat.fib_mono
@[simp] lemma fib_eq_zero : β {n}, fib n = 0 β n = 0
| 0 => Iff.rfl
| 1 => Iff.rfl
| n + 2 => by simp [fib_add_two, fib_eq_zero]
@[simp] lemma fib_pos {n : β} : 0 < fib n β 0 < n := by simp [pos_iff_ne_zero]
#align nat.fib_pos Nat.fib_pos
theorem fib_add_two_sub_fib_add_one {n : β} : fib (n + 2) - fib (n + 1) = fib n := by
rw [fib_add_two, add_tsub_cancel_right]
#align nat.fib_add_two_sub_fib_add_one Nat.fib_add_two_sub_fib_add_one
theorem fib_lt_fib_succ {n : β} (hn : 2 β€ n) : fib n < fib (n + 1) := by
rcases exists_add_of_le hn with β¨n, rflβ©
rw [β tsub_pos_iff_lt, add_comm 2, add_right_comm, fib_add_two, add_tsub_cancel_right, fib_pos]
exact succ_pos n
#align nat.fib_lt_fib_succ Nat.fib_lt_fib_succ
| Mathlib/Data/Nat/Fib/Basic.lean | 121 | 124 | theorem fib_add_two_strictMono : StrictMono fun n => fib (n + 2) := by |
refine strictMono_nat_of_lt_succ fun n => ?_
rw [add_right_comm]
exact fib_lt_fib_succ (self_le_add_left _ _)
| [
" (n + 2).fib = n.fib + (n + 1).fib",
" n.fib β€ (n + 1).fib",
" fib 0 β€ (0 + 1).fib",
" (nβ + 1).fib β€ (nβ + 1 + 1).fib",
" (n + 2).fib = 0 β n + 2 = 0",
" 0 < n.fib β 0 < n",
" (n + 2).fib - (n + 1).fib = n.fib",
" n.fib < (n + 1).fib",
" (2 + n).fib < (2 + n + 1).fib",
" 0 < n + 1",
" StrictMo... | [
" (n + 2).fib = n.fib + (n + 1).fib",
" n.fib β€ (n + 1).fib",
" fib 0 β€ (0 + 1).fib",
" (nβ + 1).fib β€ (nβ + 1 + 1).fib",
" (n + 2).fib = 0 β n + 2 = 0",
" 0 < n.fib β 0 < n",
" (n + 2).fib - (n + 1).fib = n.fib",
" n.fib < (n + 1).fib",
" (2 + n).fib < (2 + n + 1).fib",
" 0 < n + 1"
] |
import Mathlib.Computability.Halting
#align_import computability.reduce from "leanprover-community/mathlib"@"d13b3a4a392ea7273dfa4727dbd1892e26cfd518"
universe u v w
open Function
def ManyOneReducible {Ξ± Ξ²} [Primcodable Ξ±] [Primcodable Ξ²] (p : Ξ± β Prop) (q : Ξ² β Prop) :=
β f, Computable f β§ β a, p a β q (f a)
#align many_one_reducible ManyOneReducible
@[inherit_doc ManyOneReducible]
infixl:1000 " β€β " => ManyOneReducible
theorem ManyOneReducible.mk {Ξ± Ξ²} [Primcodable Ξ±] [Primcodable Ξ²] {f : Ξ± β Ξ²} (q : Ξ² β Prop)
(h : Computable f) : (fun a => q (f a)) β€β q :=
β¨f, h, fun _ => Iff.rflβ©
#align many_one_reducible.mk ManyOneReducible.mk
@[refl]
theorem manyOneReducible_refl {Ξ±} [Primcodable Ξ±] (p : Ξ± β Prop) : p β€β p :=
β¨id, Computable.id, by simpβ©
#align many_one_reducible_refl manyOneReducible_refl
@[trans]
theorem ManyOneReducible.trans {Ξ± Ξ² Ξ³} [Primcodable Ξ±] [Primcodable Ξ²] [Primcodable Ξ³]
{p : Ξ± β Prop} {q : Ξ² β Prop} {r : Ξ³ β Prop} : p β€β q β q β€β r β p β€β r
| β¨f, cβ, hββ©, β¨g, cβ, hββ© =>
β¨g β f, cβ.comp cβ,
fun a => β¨fun h => by erw [β hβ, β hβ]; assumption, fun h => by rwa [hβ, hβ]β©β©
#align many_one_reducible.trans ManyOneReducible.trans
theorem reflexive_manyOneReducible {Ξ±} [Primcodable Ξ±] : Reflexive (@ManyOneReducible Ξ± Ξ± _ _) :=
manyOneReducible_refl
#align reflexive_many_one_reducible reflexive_manyOneReducible
theorem transitive_manyOneReducible {Ξ±} [Primcodable Ξ±] : Transitive (@ManyOneReducible Ξ± Ξ± _ _) :=
fun _ _ _ => ManyOneReducible.trans
#align transitive_many_one_reducible transitive_manyOneReducible
def OneOneReducible {Ξ± Ξ²} [Primcodable Ξ±] [Primcodable Ξ²] (p : Ξ± β Prop) (q : Ξ² β Prop) :=
β f, Computable f β§ Injective f β§ β a, p a β q (f a)
#align one_one_reducible OneOneReducible
@[inherit_doc OneOneReducible]
infixl:1000 " β€β " => OneOneReducible
theorem OneOneReducible.mk {Ξ± Ξ²} [Primcodable Ξ±] [Primcodable Ξ²] {f : Ξ± β Ξ²} (q : Ξ² β Prop)
(h : Computable f) (i : Injective f) : (fun a => q (f a)) β€β q :=
β¨f, h, i, fun _ => Iff.rflβ©
#align one_one_reducible.mk OneOneReducible.mk
@[refl]
theorem oneOneReducible_refl {Ξ±} [Primcodable Ξ±] (p : Ξ± β Prop) : p β€β p :=
β¨id, Computable.id, injective_id, by simpβ©
#align one_one_reducible_refl oneOneReducible_refl
@[trans]
theorem OneOneReducible.trans {Ξ± Ξ² Ξ³} [Primcodable Ξ±] [Primcodable Ξ²] [Primcodable Ξ³] {p : Ξ± β Prop}
{q : Ξ² β Prop} {r : Ξ³ β Prop} : p β€β q β q β€β r β p β€β r
| β¨f, cβ, iβ, hββ©, β¨g, cβ, iβ, hββ© =>
β¨g β f, cβ.comp cβ, iβ.comp iβ, fun a =>
β¨fun h => by erw [β hβ, β hβ]; assumption, fun h => by rwa [hβ, hβ]β©β©
#align one_one_reducible.trans OneOneReducible.trans
theorem OneOneReducible.to_many_one {Ξ± Ξ²} [Primcodable Ξ±] [Primcodable Ξ²] {p : Ξ± β Prop}
{q : Ξ² β Prop} : p β€β q β p β€β q
| β¨f, c, _, hβ© => β¨f, c, hβ©
#align one_one_reducible.to_many_one OneOneReducible.to_many_one
theorem OneOneReducible.of_equiv {Ξ± Ξ²} [Primcodable Ξ±] [Primcodable Ξ²] {e : Ξ± β Ξ²} (q : Ξ² β Prop)
(h : Computable e) : (q β e) β€β q :=
OneOneReducible.mk _ h e.injective
#align one_one_reducible.of_equiv OneOneReducible.of_equiv
theorem OneOneReducible.of_equiv_symm {Ξ± Ξ²} [Primcodable Ξ±] [Primcodable Ξ²] {e : Ξ± β Ξ²}
(q : Ξ² β Prop) (h : Computable e.symm) : q β€β (q β e) := by
convert OneOneReducible.of_equiv _ h; funext; simp
#align one_one_reducible.of_equiv_symm OneOneReducible.of_equiv_symm
theorem reflexive_oneOneReducible {Ξ±} [Primcodable Ξ±] : Reflexive (@OneOneReducible Ξ± Ξ± _ _) :=
oneOneReducible_refl
#align reflexive_one_one_reducible reflexive_oneOneReducible
theorem transitive_oneOneReducible {Ξ±} [Primcodable Ξ±] : Transitive (@OneOneReducible Ξ± Ξ± _ _) :=
fun _ _ _ => OneOneReducible.trans
#align transitive_one_one_reducible transitive_oneOneReducible
namespace ComputablePred
variable {Ξ± : Type*} {Ξ² : Type*} {Ο : Type*}
variable [Primcodable Ξ±] [Primcodable Ξ²] [Primcodable Ο]
open Computable
| Mathlib/Computability/Reduce.lean | 131 | 136 | theorem computable_of_manyOneReducible {p : Ξ± β Prop} {q : Ξ² β Prop} (hβ : p β€β q)
(hβ : ComputablePred q) : ComputablePred p := by |
rcases hβ with β¨f, c, hfβ©
rw [show p = fun a => q (f a) from Set.ext hf]
rcases computable_iff.1 hβ with β¨g, hg, rflβ©
exact β¨by infer_instance, by simpa using hg.comp cβ©
| [
" β (a : Ξ±), p a β p (id a)",
" r ((g β f) a)",
" p a",
" q β€β (q β βe)",
" q = (q β βe) β βe.symm",
" q xβ = ((q β βe) β βe.symm) xβ",
" ComputablePred p",
" ComputablePred fun a => q (f a)",
" ComputablePred fun a => (fun a => g a = true) (f a)",
" DecidablePred fun a => (fun a => g a = true) (f... | [
" β (a : Ξ±), p a β p (id a)",
" r ((g β f) a)",
" p a",
" q β€β (q β βe)",
" q = (q β βe) β βe.symm",
" q xβ = ((q β βe) β βe.symm) xβ"
] |
import Mathlib.Algebra.MvPolynomial.Equiv
import Mathlib.Algebra.MvPolynomial.Supported
import Mathlib.LinearAlgebra.LinearIndependent
import Mathlib.RingTheory.Adjoin.Basic
import Mathlib.RingTheory.Algebraic
import Mathlib.RingTheory.MvPolynomial.Basic
#align_import ring_theory.algebraic_independent from "leanprover-community/mathlib"@"949dc57e616a621462062668c9f39e4e17b64b69"
noncomputable section
open Function Set Subalgebra MvPolynomial Algebra
open scoped Classical
universe x u v w
variable {ΞΉ : Type*} {ΞΉ' : Type*} (R : Type*) {K : Type*}
variable {A : Type*} {A' A'' : Type*} {V : Type u} {V' : Type*}
variable (x : ΞΉ β A)
variable [CommRing R] [CommRing A] [CommRing A'] [CommRing A'']
variable [Algebra R A] [Algebra R A'] [Algebra R A'']
variable {a b : R}
def AlgebraicIndependent : Prop :=
Injective (MvPolynomial.aeval x : MvPolynomial ΞΉ R ββ[R] A)
#align algebraic_independent AlgebraicIndependent
variable {R} {x}
theorem algebraicIndependent_iff_ker_eq_bot :
AlgebraicIndependent R x β
RingHom.ker (MvPolynomial.aeval x : MvPolynomial ΞΉ R ββ[R] A).toRingHom = β₯ :=
RingHom.injective_iff_ker_eq_bot _
#align algebraic_independent_iff_ker_eq_bot algebraicIndependent_iff_ker_eq_bot
theorem algebraicIndependent_iff :
AlgebraicIndependent R x β
β p : MvPolynomial ΞΉ R, MvPolynomial.aeval (x : ΞΉ β A) p = 0 β p = 0 :=
injective_iff_map_eq_zero _
#align algebraic_independent_iff algebraicIndependent_iff
theorem AlgebraicIndependent.eq_zero_of_aeval_eq_zero (h : AlgebraicIndependent R x) :
β p : MvPolynomial ΞΉ R, MvPolynomial.aeval (x : ΞΉ β A) p = 0 β p = 0 :=
algebraicIndependent_iff.1 h
#align algebraic_independent.eq_zero_of_aeval_eq_zero AlgebraicIndependent.eq_zero_of_aeval_eq_zero
theorem algebraicIndependent_iff_injective_aeval :
AlgebraicIndependent R x β Injective (MvPolynomial.aeval x : MvPolynomial ΞΉ R ββ[R] A) :=
Iff.rfl
#align algebraic_independent_iff_injective_aeval algebraicIndependent_iff_injective_aeval
@[simp]
theorem algebraicIndependent_empty_type_iff [IsEmpty ΞΉ] :
AlgebraicIndependent R x β Injective (algebraMap R A) := by
have : aeval x = (Algebra.ofId R A).comp (@isEmptyAlgEquiv R ΞΉ _ _).toAlgHom := by
ext i
exact IsEmpty.elim' βΉIsEmpty ΞΉβΊ i
rw [AlgebraicIndependent, this, β Injective.of_comp_iff' _ (@isEmptyAlgEquiv R ΞΉ _ _).bijective]
rfl
#align algebraic_independent_empty_type_iff algebraicIndependent_empty_type_iff
namespace AlgebraicIndependent
variable (hx : AlgebraicIndependent R x)
| Mathlib/RingTheory/AlgebraicIndependent.lean | 103 | 106 | theorem algebraMap_injective : Injective (algebraMap R A) := by |
simpa [Function.comp] using
(Injective.of_comp_iff (algebraicIndependent_iff_injective_aeval.1 hx) MvPolynomial.C).2
(MvPolynomial.C_injective _ _)
| [
" AlgebraicIndependent R x β Injective β(algebraMap R A)",
" aeval x = (ofId R A).comp β(isEmptyAlgEquiv R ΞΉ)",
" (aeval x) (X i) = ((ofId R A).comp β(isEmptyAlgEquiv R ΞΉ)) (X i)",
" Injective β((ofId R A).comp β(isEmptyAlgEquiv R ΞΉ)) β Injective (β(algebraMap R A) β β(isEmptyAlgEquiv R ΞΉ))",
" Injective β(... | [
" AlgebraicIndependent R x β Injective β(algebraMap R A)",
" aeval x = (ofId R A).comp β(isEmptyAlgEquiv R ΞΉ)",
" (aeval x) (X i) = ((ofId R A).comp β(isEmptyAlgEquiv R ΞΉ)) (X i)",
" Injective β((ofId R A).comp β(isEmptyAlgEquiv R ΞΉ)) β Injective (β(algebraMap R A) β β(isEmptyAlgEquiv R ΞΉ))"
] |
import Mathlib.CategoryTheory.Limits.Shapes.Biproducts
import Mathlib.GroupTheory.EckmannHilton
import Mathlib.Tactic.CategoryTheory.Reassoc
#align_import category_theory.preadditive.of_biproducts from "leanprover-community/mathlib"@"061ea99a5610cfc72c286aa930d3c1f47f74f3d0"
noncomputable section
universe v u
open CategoryTheory
open CategoryTheory.Limits
namespace CategoryTheory.SemiadditiveOfBinaryBiproducts
variable {C : Type u} [Category.{v} C] [HasZeroMorphisms C] [HasBinaryBiproducts C]
section
variable (X Y : C)
@[simp]
def leftAdd (f g : X βΆ Y) : X βΆ Y :=
biprod.lift f g β« biprod.desc (π Y) (π Y)
#align category_theory.semiadditive_of_binary_biproducts.left_add CategoryTheory.SemiadditiveOfBinaryBiproducts.leftAdd
@[simp]
def rightAdd (f g : X βΆ Y) : X βΆ Y :=
biprod.lift (π X) (π X) β« biprod.desc f g
#align category_theory.semiadditive_of_binary_biproducts.right_add CategoryTheory.SemiadditiveOfBinaryBiproducts.rightAdd
local infixr:65 " +β " => leftAdd X Y
local infixr:65 " +α΅£ " => rightAdd X Y
theorem isUnital_leftAdd : EckmannHilton.IsUnital (Β· +β Β·) 0 := by
have hr : β f : X βΆ Y, biprod.lift (0 : X βΆ Y) f = f β« biprod.inr := by
intro f
ext
Β· aesop_cat
Β· simp [biprod.lift_fst, Category.assoc, biprod.inr_fst, comp_zero]
have hl : β f : X βΆ Y, biprod.lift f (0 : X βΆ Y) = f β« biprod.inl := by
intro f
ext
Β· aesop_cat
Β· simp [biprod.lift_snd, Category.assoc, biprod.inl_snd, comp_zero]
exact {
left_id := fun f => by simp [hr f, leftAdd, Category.assoc, Category.comp_id, biprod.inr_desc],
right_id := fun f => by simp [hl f, leftAdd, Category.assoc, Category.comp_id, biprod.inl_desc]
}
#align category_theory.semiadditive_of_binary_biproducts.is_unital_left_add CategoryTheory.SemiadditiveOfBinaryBiproducts.isUnital_leftAdd
| Mathlib/CategoryTheory/Preadditive/OfBiproducts.lean | 71 | 85 | theorem isUnital_rightAdd : EckmannHilton.IsUnital (Β· +α΅£ Β·) 0 := by |
have hβ : β f : X βΆ Y, biprod.desc (0 : X βΆ Y) f = biprod.snd β« f := by
intro f
ext
Β· aesop_cat
Β· simp only [biprod.inr_desc, BinaryBicone.inr_snd_assoc]
have hβ : β f : X βΆ Y, biprod.desc f (0 : X βΆ Y) = biprod.fst β« f := by
intro f
ext
Β· aesop_cat
Β· simp only [biprod.inr_desc, BinaryBicone.inr_fst_assoc, zero_comp]
exact {
left_id := fun f => by simp [hβ f, rightAdd, biprod.lift_snd_assoc, Category.id_comp],
right_id := fun f => by simp [hβ f, rightAdd, biprod.lift_fst_assoc, Category.id_comp]
}
| [
" EckmannHilton.IsUnital (fun x x_1 => leftAdd X Y x x_1) 0",
" β (f : X βΆ Y), biprod.lift 0 f = f β« biprod.inr",
" biprod.lift 0 f = f β« biprod.inr",
" biprod.lift 0 f β« biprod.fst = (f β« biprod.inr) β« biprod.fst",
" biprod.lift 0 f β« biprod.snd = (f β« biprod.inr) β« biprod.snd",
" β (f : X βΆ Y), biprod.l... | [
" EckmannHilton.IsUnital (fun x x_1 => leftAdd X Y x x_1) 0",
" β (f : X βΆ Y), biprod.lift 0 f = f β« biprod.inr",
" biprod.lift 0 f = f β« biprod.inr",
" biprod.lift 0 f β« biprod.fst = (f β« biprod.inr) β« biprod.fst",
" biprod.lift 0 f β« biprod.snd = (f β« biprod.inr) β« biprod.snd",
" β (f : X βΆ Y), biprod.l... |
import Mathlib.MeasureTheory.Measure.Dirac
set_option autoImplicit true
open Set
open scoped ENNReal Classical
variable [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {s : Set Ξ±}
noncomputable section
namespace MeasureTheory.Measure
def count : Measure Ξ± :=
sum dirac
#align measure_theory.measure.count MeasureTheory.Measure.count
theorem le_count_apply : β' _ : s, (1 : ββ₯0β) β€ count s :=
calc
(β' _ : s, 1 : ββ₯0β) = β' i, indicator s 1 i := tsum_subtype s 1
_ β€ β' i, dirac i s := ENNReal.tsum_le_tsum fun _ => le_dirac_apply
_ β€ count s := le_sum_apply _ _
#align measure_theory.measure.le_count_apply MeasureTheory.Measure.le_count_apply
theorem count_apply (hs : MeasurableSet s) : count s = β' i : s, 1 := by
simp only [count, sum_apply, hs, dirac_apply', β tsum_subtype s (1 : Ξ± β ββ₯0β), Pi.one_apply]
#align measure_theory.measure.count_apply MeasureTheory.Measure.count_apply
-- @[simp] -- Porting note (#10618): simp can prove this
theorem count_empty : count (β
: Set Ξ±) = 0 := by rw [count_apply MeasurableSet.empty, tsum_empty]
#align measure_theory.measure.count_empty MeasureTheory.Measure.count_empty
@[simp]
theorem count_apply_finset' {s : Finset Ξ±} (s_mble : MeasurableSet (s : Set Ξ±)) :
count (βs : Set Ξ±) = s.card :=
calc
count (βs : Set Ξ±) = β' i : (βs : Set Ξ±), 1 := count_apply s_mble
_ = β i β s, 1 := s.tsum_subtype 1
_ = s.card := by simp
#align measure_theory.measure.count_apply_finset' MeasureTheory.Measure.count_apply_finset'
@[simp]
theorem count_apply_finset [MeasurableSingletonClass Ξ±] (s : Finset Ξ±) :
count (βs : Set Ξ±) = s.card :=
count_apply_finset' s.measurableSet
#align measure_theory.measure.count_apply_finset MeasureTheory.Measure.count_apply_finset
| Mathlib/MeasureTheory/Measure/Count.lean | 62 | 65 | theorem count_apply_finite' {s : Set Ξ±} (s_fin : s.Finite) (s_mble : MeasurableSet s) :
count s = s_fin.toFinset.card := by |
simp [β
@count_apply_finset' _ _ s_fin.toFinset (by simpa only [Finite.coe_toFinset] using s_mble)]
| [
" count s = β' (i : βs), 1",
" count β
= 0",
" β i β s, 1 = βs.card",
" count s = βs_fin.toFinset.card",
" MeasurableSet βs_fin.toFinset"
] | [
" count s = β' (i : βs), 1",
" count β
= 0",
" β i β s, 1 = βs.card"
] |
import Mathlib.Algebra.Order.Invertible
import Mathlib.Algebra.Order.Module.OrderedSMul
import Mathlib.LinearAlgebra.AffineSpace.Midpoint
import Mathlib.LinearAlgebra.Ray
import Mathlib.Tactic.GCongr
#align_import analysis.convex.segment from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963"
variable {π E F G ΞΉ : Type*} {Ο : ΞΉ β Type*}
open Function Set
open Pointwise Convex
section OrderedSemiring
variable [OrderedSemiring π] [AddCommMonoid E]
section SMul
variable (π) [SMul π E] {s : Set E} {x y : E}
def segment (x y : E) : Set E :=
{ z : E | β a b : π, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ a β’ x + b β’ y = z }
#align segment segment
def openSegment (x y : E) : Set E :=
{ z : E | β a b : π, 0 < a β§ 0 < b β§ a + b = 1 β§ a β’ x + b β’ y = z }
#align open_segment openSegment
@[inherit_doc] scoped[Convex] notation (priority := high) "[" x "-[" π "]" y "]" => segment π x y
theorem segment_eq_imageβ (x y : E) :
[x -[π] y] =
(fun p : π Γ π => p.1 β’ x + p.2 β’ y) '' { p | 0 β€ p.1 β§ 0 β€ p.2 β§ p.1 + p.2 = 1 } := by
simp only [segment, image, Prod.exists, mem_setOf_eq, exists_prop, and_assoc]
#align segment_eq_imageβ segment_eq_imageβ
| Mathlib/Analysis/Convex/Segment.lean | 68 | 71 | theorem openSegment_eq_imageβ (x y : E) :
openSegment π x y =
(fun p : π Γ π => p.1 β’ x + p.2 β’ y) '' { p | 0 < p.1 β§ 0 < p.2 β§ p.1 + p.2 = 1 } := by |
simp only [openSegment, image, Prod.exists, mem_setOf_eq, exists_prop, and_assoc]
| [
" [x-[π]y] = (fun p => p.1 β’ x + p.2 β’ y) '' {p | 0 β€ p.1 β§ 0 β€ p.2 β§ p.1 + p.2 = 1}",
" openSegment π x y = (fun p => p.1 β’ x + p.2 β’ y) '' {p | 0 < p.1 β§ 0 < p.2 β§ p.1 + p.2 = 1}"
] | [
" [x-[π]y] = (fun p => p.1 β’ x + p.2 β’ y) '' {p | 0 β€ p.1 β§ 0 β€ p.2 β§ p.1 + p.2 = 1}"
] |
import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine
import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine
import Mathlib.Tactic.IntervalCases
#align_import geometry.euclidean.triangle from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open scoped Classical
open scoped Real
open scoped RealInnerProductSpace
namespace InnerProductGeometry
variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace β V]
theorem norm_sub_sq_eq_norm_sq_add_norm_sq_sub_two_mul_norm_mul_norm_mul_cos_angle (x y : V) :
βx - yβ * βx - yβ = βxβ * βxβ + βyβ * βyβ - 2 * βxβ * βyβ * Real.cos (angle x y) := by
rw [show 2 * βxβ * βyβ * Real.cos (angle x y) = 2 * (Real.cos (angle x y) * (βxβ * βyβ)) by ring,
cos_angle_mul_norm_mul_norm, β real_inner_self_eq_norm_mul_norm, β
real_inner_self_eq_norm_mul_norm, β real_inner_self_eq_norm_mul_norm, real_inner_sub_sub_self,
sub_add_eq_add_sub]
#align inner_product_geometry.norm_sub_sq_eq_norm_sq_add_norm_sq_sub_two_mul_norm_mul_norm_mul_cos_angle InnerProductGeometry.norm_sub_sq_eq_norm_sq_add_norm_sq_sub_two_mul_norm_mul_norm_mul_cos_angle
| Mathlib/Geometry/Euclidean/Triangle.lean | 71 | 75 | theorem angle_sub_eq_angle_sub_rev_of_norm_eq {x y : V} (h : βxβ = βyβ) :
angle x (x - y) = angle y (y - x) := by |
refine Real.injOn_cos β¨angle_nonneg _ _, angle_le_pi _ _β© β¨angle_nonneg _ _, angle_le_pi _ _β© ?_
rw [cos_angle, cos_angle, h, β neg_sub, norm_neg, neg_sub, inner_sub_right, inner_sub_right,
real_inner_self_eq_norm_mul_norm, real_inner_self_eq_norm_mul_norm, h, real_inner_comm x y]
| [
" βx - yβ * βx - yβ = βxβ * βxβ + βyβ * βyβ - 2 * βxβ * βyβ * (angle x y).cos",
" 2 * βxβ * βyβ * (angle x y).cos = 2 * ((angle x y).cos * (βxβ * βyβ))",
" angle x (x - y) = angle y (y - x)",
" (angle x (x - y)).cos = (angle y (y - x)).cos"
] | [
" βx - yβ * βx - yβ = βxβ * βxβ + βyβ * βyβ - 2 * βxβ * βyβ * (angle x y).cos",
" 2 * βxβ * βyβ * (angle x y).cos = 2 * ((angle x y).cos * (βxβ * βyβ))"
] |
import Mathlib.Geometry.Manifold.MFDeriv.Basic
noncomputable section
open scoped Manifold
variable {π : Type*} [NontriviallyNormedField π] {E : Type*} [NormedAddCommGroup E]
[NormedSpace π E] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace π E'] {f : E β E'}
{s : Set E} {x : E}
section MFDerivFderiv
theorem uniqueMDiffWithinAt_iff_uniqueDiffWithinAt :
UniqueMDiffWithinAt π(π, E) s x β UniqueDiffWithinAt π s x := by
simp only [UniqueMDiffWithinAt, mfld_simps]
#align unique_mdiff_within_at_iff_unique_diff_within_at uniqueMDiffWithinAt_iff_uniqueDiffWithinAt
alias β¨UniqueMDiffWithinAt.uniqueDiffWithinAt, UniqueDiffWithinAt.uniqueMDiffWithinAtβ© :=
uniqueMDiffWithinAt_iff_uniqueDiffWithinAt
#align unique_mdiff_within_at.unique_diff_within_at UniqueMDiffWithinAt.uniqueDiffWithinAt
#align unique_diff_within_at.unique_mdiff_within_at UniqueDiffWithinAt.uniqueMDiffWithinAt
theorem uniqueMDiffOn_iff_uniqueDiffOn : UniqueMDiffOn π(π, E) s β UniqueDiffOn π s := by
simp [UniqueMDiffOn, UniqueDiffOn, uniqueMDiffWithinAt_iff_uniqueDiffWithinAt]
#align unique_mdiff_on_iff_unique_diff_on uniqueMDiffOn_iff_uniqueDiffOn
alias β¨UniqueMDiffOn.uniqueDiffOn, UniqueDiffOn.uniqueMDiffOnβ© := uniqueMDiffOn_iff_uniqueDiffOn
#align unique_mdiff_on.unique_diff_on UniqueMDiffOn.uniqueDiffOn
#align unique_diff_on.unique_mdiff_on UniqueDiffOn.uniqueMDiffOn
-- Porting note (#10618): was `@[simp, mfld_simps]` but `simp` can prove it
theorem writtenInExtChartAt_model_space : writtenInExtChartAt π(π, E) π(π, E') x f = f :=
rfl
#align written_in_ext_chart_model_space writtenInExtChartAt_model_space
theorem hasMFDerivWithinAt_iff_hasFDerivWithinAt {f'} :
HasMFDerivWithinAt π(π, E) π(π, E') f s x f' β HasFDerivWithinAt f f' s x := by
simpa only [HasMFDerivWithinAt, and_iff_right_iff_imp, mfld_simps] using
HasFDerivWithinAt.continuousWithinAt
#align has_mfderiv_within_at_iff_has_fderiv_within_at hasMFDerivWithinAt_iff_hasFDerivWithinAt
alias β¨HasMFDerivWithinAt.hasFDerivWithinAt, HasFDerivWithinAt.hasMFDerivWithinAtβ© :=
hasMFDerivWithinAt_iff_hasFDerivWithinAt
#align has_mfderiv_within_at.has_fderiv_within_at HasMFDerivWithinAt.hasFDerivWithinAt
#align has_fderiv_within_at.has_mfderiv_within_at HasFDerivWithinAt.hasMFDerivWithinAt
theorem hasMFDerivAt_iff_hasFDerivAt {f'} :
HasMFDerivAt π(π, E) π(π, E') f x f' β HasFDerivAt f f' x := by
rw [β hasMFDerivWithinAt_univ, hasMFDerivWithinAt_iff_hasFDerivWithinAt, hasFDerivWithinAt_univ]
#align has_mfderiv_at_iff_has_fderiv_at hasMFDerivAt_iff_hasFDerivAt
alias β¨HasMFDerivAt.hasFDerivAt, HasFDerivAt.hasMFDerivAtβ© := hasMFDerivAt_iff_hasFDerivAt
#align has_mfderiv_at.has_fderiv_at HasMFDerivAt.hasFDerivAt
#align has_fderiv_at.has_mfderiv_at HasFDerivAt.hasMFDerivAt
theorem mdifferentiableWithinAt_iff_differentiableWithinAt :
MDifferentiableWithinAt π(π, E) π(π, E') f s x β DifferentiableWithinAt π f s x := by
simp only [mdifferentiableWithinAt_iff', mfld_simps]
exact β¨fun H => H.2, fun H => β¨H.continuousWithinAt, Hβ©β©
#align mdifferentiable_within_at_iff_differentiable_within_at mdifferentiableWithinAt_iff_differentiableWithinAt
alias β¨MDifferentiableWithinAt.differentiableWithinAt,
DifferentiableWithinAt.mdifferentiableWithinAtβ© :=
mdifferentiableWithinAt_iff_differentiableWithinAt
#align mdifferentiable_within_at.differentiable_within_at MDifferentiableWithinAt.differentiableWithinAt
#align differentiable_within_at.mdifferentiable_within_at DifferentiableWithinAt.mdifferentiableWithinAt
| Mathlib/Geometry/Manifold/MFDeriv/FDeriv.lean | 84 | 87 | theorem mdifferentiableAt_iff_differentiableAt :
MDifferentiableAt π(π, E) π(π, E') f x β DifferentiableAt π f x := by |
simp only [mdifferentiableAt_iff, differentiableWithinAt_univ, mfld_simps]
exact β¨fun H => H.2, fun H => β¨H.continuousAt, Hβ©β©
| [
" UniqueMDiffWithinAt π(π, E) s x β UniqueDiffWithinAt π s x",
" UniqueMDiffOn π(π, E) s β UniqueDiffOn π s",
" HasMFDerivWithinAt π(π, E) π(π, E') f s x f' β HasFDerivWithinAt f f' s x",
" HasMFDerivAt π(π, E) π(π, E') f x f' β HasFDerivAt f f' x",
" MDifferentiableWithinAt π(π, E) π(π, E... | [
" UniqueMDiffWithinAt π(π, E) s x β UniqueDiffWithinAt π s x",
" UniqueMDiffOn π(π, E) s β UniqueDiffOn π s",
" HasMFDerivWithinAt π(π, E) π(π, E') f s x f' β HasFDerivWithinAt f f' s x",
" HasMFDerivAt π(π, E) π(π, E') f x f' β HasFDerivAt f f' x",
" MDifferentiableWithinAt π(π, E) π(π, E... |
import Mathlib.Analysis.NormedSpace.BoundedLinearMaps
import Mathlib.Topology.FiberBundle.Basic
#align_import topology.vector_bundle.basic from "leanprover-community/mathlib"@"e473c3198bb41f68560cab68a0529c854b618833"
noncomputable section
open scoped Classical
open Bundle Set
open scoped Topology
variable (R : Type*) {B : Type*} (F : Type*) (E : B β Type*)
section TopologicalVectorSpace
variable {F E}
variable [Semiring R] [TopologicalSpace F] [TopologicalSpace B]
protected class Pretrivialization.IsLinear [AddCommMonoid F] [Module R F] [β x, AddCommMonoid (E x)]
[β x, Module R (E x)] (e : Pretrivialization F (Ο F E)) : Prop where
linear : β b β e.baseSet, IsLinearMap R fun x : E b => (e β¨b, xβ©).2
#align pretrivialization.is_linear Pretrivialization.IsLinear
namespace Pretrivialization
variable (e : Pretrivialization F (Ο F E)) {x : TotalSpace F E} {b : B} {y : E b}
theorem linear [AddCommMonoid F] [Module R F] [β x, AddCommMonoid (E x)] [β x, Module R (E x)]
[e.IsLinear R] {b : B} (hb : b β e.baseSet) :
IsLinearMap R fun x : E b => (e β¨b, xβ©).2 :=
Pretrivialization.IsLinear.linear b hb
#align pretrivialization.linear Pretrivialization.linear
variable [AddCommMonoid F] [Module R F] [β x, AddCommMonoid (E x)] [β x, Module R (E x)]
@[simps!]
protected def symmβ (e : Pretrivialization F (Ο F E)) [e.IsLinear R] (b : B) : F ββ[R] E b := by
refine IsLinearMap.mk' (e.symm b) ?_
by_cases hb : b β e.baseSet
Β· exact (((e.linear R hb).mk' _).inverse (e.symm b) (e.symm_apply_apply_mk hb) fun v β¦
congr_arg Prod.snd <| e.apply_mk_symm hb v).isLinear
Β· rw [e.coe_symm_of_not_mem hb]
exact (0 : F ββ[R] E b).isLinear
#align pretrivialization.symmβ Pretrivialization.symmβ
@[simps (config := .asFn)]
def linearEquivAt (e : Pretrivialization F (Ο F E)) [e.IsLinear R] (b : B) (hb : b β e.baseSet) :
E b ββ[R] F where
toFun y := (e β¨b, yβ©).2
invFun := e.symm b
left_inv := e.symm_apply_apply_mk hb
right_inv v := by simp_rw [e.apply_mk_symm hb v]
map_add' v w := (e.linear R hb).map_add v w
map_smul' c v := (e.linear R hb).map_smul c v
#align pretrivialization.linear_equiv_at Pretrivialization.linearEquivAt
protected def linearMapAt (e : Pretrivialization F (Ο F E)) [e.IsLinear R] (b : B) : E b ββ[R] F :=
if hb : b β e.baseSet then e.linearEquivAt R b hb else 0
#align pretrivialization.linear_map_at Pretrivialization.linearMapAt
variable {R}
theorem coe_linearMapAt (e : Pretrivialization F (Ο F E)) [e.IsLinear R] (b : B) :
β(e.linearMapAt R b) = fun y => if b β e.baseSet then (e β¨b, yβ©).2 else 0 := by
rw [Pretrivialization.linearMapAt]
split_ifs <;> rfl
#align pretrivialization.coe_linear_map_at Pretrivialization.coe_linearMapAt
| Mathlib/Topology/VectorBundle/Basic.lean | 126 | 128 | theorem coe_linearMapAt_of_mem (e : Pretrivialization F (Ο F E)) [e.IsLinear R] {b : B}
(hb : b β e.baseSet) : β(e.linearMapAt R b) = fun y => (e β¨b, yβ©).2 := by |
simp_rw [coe_linearMapAt, if_pos hb]
| [
" F ββ[R] E b",
" IsLinearMap R (e.symm b)",
" IsLinearMap R 0",
" { toFun := fun y => (βe { proj := b, snd := y }).2, map_add' := β―, map_smul' := β― }.toFun (e.symm b v) = v",
" β(Pretrivialization.linearMapAt R e b) = fun y => if b β e.baseSet then (βe { proj := b, snd := y }).2 else 0",
" β(if hb : b β ... | [
" F ββ[R] E b",
" IsLinearMap R (e.symm b)",
" IsLinearMap R 0",
" { toFun := fun y => (βe { proj := b, snd := y }).2, map_add' := β―, map_smul' := β― }.toFun (e.symm b v) = v",
" β(Pretrivialization.linearMapAt R e b) = fun y => if b β e.baseSet then (βe { proj := b, snd := y }).2 else 0",
" β(if hb : b β ... |
import Mathlib.Analysis.Normed.Group.Basic
import Mathlib.Topology.ContinuousFunction.CocompactMap
open Filter Metric
variable {π E F π : Type*}
variable [NormedAddCommGroup E] [NormedAddCommGroup F] [ProperSpace E] [ProperSpace F]
variable {f : π}
theorem CocompactMapClass.norm_le [FunLike π E F] [CocompactMapClass π E F] (Ξ΅ : β) :
β r : β, β x : E, r < βxβ β Ξ΅ < βf xβ := by
have h := cocompact_tendsto f
rw [tendsto_def] at h
specialize h (Metric.closedBall 0 Ξ΅)αΆ (mem_cocompact_of_closedBall_compl_subset 0 β¨Ξ΅, rfl.subsetβ©)
rcases closedBall_compl_subset_of_mem_cocompact h 0 with β¨r, hrβ©
use r
intro x hx
suffices x β fβ»ΒΉ' (Metric.closedBall 0 Ξ΅)αΆ by aesop
apply hr
simp [hx]
| Mathlib/Analysis/Normed/Group/CocompactMap.lean | 41 | 53 | theorem Filter.tendsto_cocompact_cocompact_of_norm {f : E β F}
(h : β Ξ΅ : β, β r : β, β x : E, r < βxβ β Ξ΅ < βf xβ) :
Tendsto f (cocompact E) (cocompact F) := by |
rw [tendsto_def]
intro s hs
rcases closedBall_compl_subset_of_mem_cocompact hs 0 with β¨Ξ΅, hΞ΅β©
rcases h Ξ΅ with β¨r, hrβ©
apply mem_cocompact_of_closedBall_compl_subset 0
use r
intro x hx
simp only [Set.mem_compl_iff, Metric.mem_closedBall, dist_zero_right, not_le] at hx
apply hΞ΅
simp [hr x hx]
| [
" β r, β (x : E), r < βxβ β Ξ΅ < βf xβ",
" β (x : E), r < βxβ β Ξ΅ < βf xβ",
" Ξ΅ < βf xβ",
" x β βf β»ΒΉ' (closedBall 0 Ξ΅)αΆ",
" x β (closedBall 0 r)αΆ",
" Tendsto f (cocompact E) (cocompact F)",
" β s β cocompact F, f β»ΒΉ' s β cocompact E",
" f β»ΒΉ' s β cocompact E",
" β r, (closedBall 0 r)αΆ β f β»ΒΉ' s",
... | [
" β r, β (x : E), r < βxβ β Ξ΅ < βf xβ",
" β (x : E), r < βxβ β Ξ΅ < βf xβ",
" Ξ΅ < βf xβ",
" x β βf β»ΒΉ' (closedBall 0 Ξ΅)αΆ",
" x β (closedBall 0 r)αΆ"
] |
import Mathlib.Algebra.DirectSum.Module
import Mathlib.Analysis.Complex.Basic
import Mathlib.Analysis.Convex.Uniform
import Mathlib.Analysis.NormedSpace.Completion
import Mathlib.Analysis.NormedSpace.BoundedLinearMaps
#align_import analysis.inner_product_space.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b"
noncomputable section
open RCLike Real Filter
open Topology ComplexConjugate
open LinearMap (BilinForm)
variable {π E F : Type*} [RCLike π]
class Inner (π E : Type*) where
inner : E β E β π
#align has_inner Inner
export Inner (inner)
notation3:max "βͺ" x ", " y "β«_" π:max => @inner π _ _ x y
class InnerProductSpace (π : Type*) (E : Type*) [RCLike π] [NormedAddCommGroup E] extends
NormedSpace π E, Inner π E where
norm_sq_eq_inner : β x : E, βxβ ^ 2 = re (inner x x)
conj_symm : β x y, conj (inner y x) = inner x y
add_left : β x y z, inner (x + y) z = inner x z + inner y z
smul_left : β x y r, inner (r β’ x) y = conj r * inner x y
#align inner_product_space InnerProductSpace
-- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore
structure InnerProductSpace.Core (π : Type*) (F : Type*) [RCLike π] [AddCommGroup F]
[Module π F] extends Inner π F where
conj_symm : β x y, conj (inner y x) = inner x y
nonneg_re : β x, 0 β€ re (inner x x)
definite : β x, inner x x = 0 β x = 0
add_left : β x y z, inner (x + y) z = inner x z + inner y z
smul_left : β x y r, inner (r β’ x) y = conj r * inner x y
#align inner_product_space.core InnerProductSpace.Core
attribute [class] InnerProductSpace.Core
def InnerProductSpace.toCore [NormedAddCommGroup E] [c : InnerProductSpace π E] :
InnerProductSpace.Core π E :=
{ c with
nonneg_re := fun x => by
rw [β InnerProductSpace.norm_sq_eq_inner]
apply sq_nonneg
definite := fun x hx =>
norm_eq_zero.1 <| pow_eq_zero (n := 2) <| by
rw [InnerProductSpace.norm_sq_eq_inner (π := π) x, hx, map_zero] }
#align inner_product_space.to_core InnerProductSpace.toCore
namespace InnerProductSpace.Core
variable [AddCommGroup F] [Module π F] [c : InnerProductSpace.Core π F]
local notation "βͺ" x ", " y "β«" => @inner π F _ x y
local notation "normSqK" => @RCLike.normSq π _
local notation "reK" => @RCLike.re π _
local notation "ext_iff" => @RCLike.ext_iff π _
local postfix:90 "β " => starRingEnd _
def toInner' : Inner π F :=
c.toInner
#align inner_product_space.core.to_has_inner' InnerProductSpace.Core.toInner'
attribute [local instance] toInner'
def normSq (x : F) :=
reK βͺx, xβ«
#align inner_product_space.core.norm_sq InnerProductSpace.Core.normSq
local notation "normSqF" => @normSq π F _ _ _ _
theorem inner_conj_symm (x y : F) : βͺy, xβ«β = βͺx, yβ« :=
c.conj_symm x y
#align inner_product_space.core.inner_conj_symm InnerProductSpace.Core.inner_conj_symm
theorem inner_self_nonneg {x : F} : 0 β€ re βͺx, xβ« :=
c.nonneg_re _
#align inner_product_space.core.inner_self_nonneg InnerProductSpace.Core.inner_self_nonneg
theorem inner_self_im (x : F) : im βͺx, xβ« = 0 := by
rw [β @ofReal_inj π, im_eq_conj_sub]
simp [inner_conj_symm]
#align inner_product_space.core.inner_self_im InnerProductSpace.Core.inner_self_im
theorem inner_add_left (x y z : F) : βͺx + y, zβ« = βͺx, zβ« + βͺy, zβ« :=
c.add_left _ _ _
#align inner_product_space.core.inner_add_left InnerProductSpace.Core.inner_add_left
| Mathlib/Analysis/InnerProductSpace/Basic.lean | 220 | 221 | theorem inner_add_right (x y z : F) : βͺx, y + zβ« = βͺx, yβ« + βͺx, zβ« := by |
rw [β inner_conj_symm, inner_add_left, RingHom.map_add]; simp only [inner_conj_symm]
| [
" 0 β€ re βͺx, xβ«_π",
" 0 β€ βxβ ^ 2",
" βxβ ^ 2 = 0",
" im βͺx, xβ«_π = 0",
" I * ((starRingEnd π) βͺx, xβ«_π - βͺx, xβ«_π) / 2 = β0",
" βͺx, y + zβ«_π = βͺx, yβ«_π + βͺx, zβ«_π",
" (starRingEnd π) βͺy, xβ«_π + (starRingEnd π) βͺz, xβ«_π = βͺx, yβ«_π + βͺx, zβ«_π"
] | [
" 0 β€ re βͺx, xβ«_π",
" 0 β€ βxβ ^ 2",
" βxβ ^ 2 = 0",
" im βͺx, xβ«_π = 0",
" I * ((starRingEnd π) βͺx, xβ«_π - βͺx, xβ«_π) / 2 = β0"
] |
import Mathlib.LinearAlgebra.Dual
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.contraction from "leanprover-community/mathlib"@"657df4339ae6ceada048c8a2980fb10e393143ec"
suppress_compilation
-- Porting note: universe metavariables behave oddly
universe w u vβ vβ vβ vβ
variable {ΞΉ : Type w} (R : Type u) (M : Type vβ) (N : Type vβ)
(P : Type vβ) (Q : Type vβ)
-- Porting note: we need high priority for this to fire first; not the case in ML3
attribute [local ext high] TensorProduct.ext
section Contraction
open TensorProduct LinearMap Matrix Module
open TensorProduct
section CommSemiring
variable [CommSemiring R]
variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] [AddCommMonoid Q]
variable [Module R M] [Module R N] [Module R P] [Module R Q]
variable [DecidableEq ΞΉ] [Fintype ΞΉ] (b : Basis ΞΉ R M)
-- Porting note: doesn't like implicit ring in the tensor product
def contractLeft : Module.Dual R M β[R] M ββ[R] R :=
(uncurry _ _ _ _).toFun LinearMap.id
#align contract_left contractLeft
-- Porting note: doesn't like implicit ring in the tensor product
def contractRight : M β[R] Module.Dual R M ββ[R] R :=
(uncurry _ _ _ _).toFun (LinearMap.flip LinearMap.id)
#align contract_right contractRight
-- Porting note: doesn't like implicit ring in the tensor product
def dualTensorHom : Module.Dual R M β[R] N ββ[R] M ββ[R] N :=
let M' := Module.Dual R M
(uncurry R M' N (M ββ[R] N) : _ β M' β N ββ[R] M ββ[R] N) LinearMap.smulRightβ
#align dual_tensor_hom dualTensorHom
variable {R M N P Q}
@[simp]
theorem contractLeft_apply (f : Module.Dual R M) (m : M) : contractLeft R M (f ββ m) = f m :=
rfl
#align contract_left_apply contractLeft_apply
@[simp]
theorem contractRight_apply (f : Module.Dual R M) (m : M) : contractRight R M (m ββ f) = f m :=
rfl
#align contract_right_apply contractRight_apply
@[simp]
theorem dualTensorHom_apply (f : Module.Dual R M) (m : M) (n : N) :
dualTensorHom R M N (f ββ n) m = f m β’ n :=
rfl
#align dual_tensor_hom_apply dualTensorHom_apply
@[simp]
theorem transpose_dualTensorHom (f : Module.Dual R M) (m : M) :
Dual.transpose (R := R) (dualTensorHom R M M (f ββ m)) =
dualTensorHom R _ _ (Dual.eval R M m ββ f) := by
ext f' m'
simp only [Dual.transpose_apply, coe_comp, Function.comp_apply, dualTensorHom_apply,
LinearMap.map_smulββ, RingHom.id_apply, Algebra.id.smul_eq_mul, Dual.eval_apply,
LinearMap.smul_apply]
exact mul_comm _ _
#align transpose_dual_tensor_hom transpose_dualTensorHom
@[simp]
theorem dualTensorHom_prodMap_zero (f : Module.Dual R M) (p : P) :
((dualTensorHom R M P) (f ββ[R] p)).prodMap (0 : N ββ[R] Q) =
dualTensorHom R (M Γ N) (P Γ Q) ((f ββ fst R M N) ββ inl R P Q p) := by
ext <;>
simp only [coe_comp, coe_inl, Function.comp_apply, prodMap_apply, dualTensorHom_apply,
fst_apply, Prod.smul_mk, LinearMap.zero_apply, smul_zero]
#align dual_tensor_hom_prod_map_zero dualTensorHom_prodMap_zero
@[simp]
theorem zero_prodMap_dualTensorHom (g : Module.Dual R N) (q : Q) :
(0 : M ββ[R] P).prodMap ((dualTensorHom R N Q) (g ββ[R] q)) =
dualTensorHom R (M Γ N) (P Γ Q) ((g ββ snd R M N) ββ inr R P Q q) := by
ext <;>
simp only [coe_comp, coe_inr, Function.comp_apply, prodMap_apply, dualTensorHom_apply,
snd_apply, Prod.smul_mk, LinearMap.zero_apply, smul_zero]
#align zero_prod_map_dual_tensor_hom zero_prodMap_dualTensorHom
theorem map_dualTensorHom (f : Module.Dual R M) (p : P) (g : Module.Dual R N) (q : Q) :
TensorProduct.map (dualTensorHom R M P (f ββ[R] p)) (dualTensorHom R N Q (g ββ[R] q)) =
dualTensorHom R (M β[R] N) (P β[R] Q) (dualDistrib R M N (f ββ g) ββ[R] p ββ[R] q) := by
ext m n
simp only [comprβ_apply, mk_apply, map_tmul, dualTensorHom_apply, dualDistrib_apply, β
smul_tmul_smul]
#align map_dual_tensor_hom map_dualTensorHom
@[simp]
| Mathlib/LinearAlgebra/Contraction.lean | 122 | 128 | theorem comp_dualTensorHom (f : Module.Dual R M) (n : N) (g : Module.Dual R N) (p : P) :
dualTensorHom R N P (g ββ[R] p) ββ dualTensorHom R M N (f ββ[R] n) =
g n β’ dualTensorHom R M P (f ββ p) := by |
ext m
simp only [coe_comp, Function.comp_apply, dualTensorHom_apply, LinearMap.map_smul,
RingHom.id_apply, LinearMap.smul_apply]
rw [smul_comm]
| [
" Dual.transpose ((dualTensorHom R M M) (f ββ[R] m)) =\n (dualTensorHom R (Dual R M) (Dual R M)) ((Dual.eval R M) m ββ[R] f)",
" ((Dual.transpose ((dualTensorHom R M M) (f ββ[R] m))) f') m' =\n (((dualTensorHom R (Dual R M) (Dual R M)) ((Dual.eval R M) m ββ[R] f)) f') m'",
" f m' * f' m = f' m * f m'",
... | [
" Dual.transpose ((dualTensorHom R M M) (f ββ[R] m)) =\n (dualTensorHom R (Dual R M) (Dual R M)) ((Dual.eval R M) m ββ[R] f)",
" ((Dual.transpose ((dualTensorHom R M M) (f ββ[R] m))) f') m' =\n (((dualTensorHom R (Dual R M) (Dual R M)) ((Dual.eval R M) m ββ[R] f)) f') m'",
" f m' * f' m = f' m * f m'",
... |
import Mathlib.AlgebraicTopology.SplitSimplicialObject
import Mathlib.AlgebraicTopology.DoldKan.Degeneracies
import Mathlib.AlgebraicTopology.DoldKan.FunctorN
#align_import algebraic_topology.dold_kan.split_simplicial_object from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504"
open CategoryTheory CategoryTheory.Limits CategoryTheory.Category CategoryTheory.Preadditive
CategoryTheory.Idempotents Opposite AlgebraicTopology AlgebraicTopology.DoldKan
Simplicial DoldKan
namespace SimplicialObject
namespace Splitting
variable {C : Type*} [Category C] {X : SimplicialObject C}
(s : Splitting X)
noncomputable def ΟSummand [HasZeroMorphisms C] {Ξ : SimplexCategoryα΅α΅} (A : IndexSet Ξ) :
X.obj Ξ βΆ s.N A.1.unop.len :=
s.desc Ξ (fun B => by
by_cases h : B = A
Β· exact eqToHom (by subst h; rfl)
Β· exact 0)
#align simplicial_object.splitting.Ο_summand SimplicialObject.Splitting.ΟSummand
@[reassoc (attr := simp)]
theorem cofan_inj_ΟSummand_eq_id [HasZeroMorphisms C] {Ξ : SimplexCategoryα΅α΅} (A : IndexSet Ξ) :
(s.cofan Ξ).inj A β« s.ΟSummand A = π _ := by
simp [ΟSummand]
#align simplicial_object.splitting.ΞΉ_Ο_summand_eq_id SimplicialObject.Splitting.cofan_inj_ΟSummand_eq_id
@[reassoc (attr := simp)]
theorem cofan_inj_ΟSummand_eq_zero [HasZeroMorphisms C] {Ξ : SimplexCategoryα΅α΅} (A B : IndexSet Ξ)
(h : B β A) : (s.cofan Ξ).inj A β« s.ΟSummand B = 0 := by
dsimp [ΟSummand]
rw [ΞΉ_desc, dif_neg h.symm]
#align simplicial_object.splitting.ΞΉ_Ο_summand_eq_zero SimplicialObject.Splitting.cofan_inj_ΟSummand_eq_zero
variable [Preadditive C]
theorem decomposition_id (Ξ : SimplexCategoryα΅α΅) :
π (X.obj Ξ) = β A : IndexSet Ξ, s.ΟSummand A β« (s.cofan Ξ).inj A := by
apply s.hom_ext'
intro A
dsimp
erw [comp_id, comp_sum, Finset.sum_eq_single A, cofan_inj_ΟSummand_eq_id_assoc]
Β· intro B _ hβ
rw [s.cofan_inj_ΟSummand_eq_zero_assoc _ _ hβ, zero_comp]
Β· simp
#align simplicial_object.splitting.decomposition_id SimplicialObject.Splitting.decomposition_id
@[reassoc (attr := simp)]
theorem Ο_comp_ΟSummand_id_eq_zero {n : β} (i : Fin (n + 1)) :
X.Ο i β« s.ΟSummand (IndexSet.id (op [n + 1])) = 0 := by
apply s.hom_ext'
intro A
dsimp only [SimplicialObject.Ο]
rw [comp_zero, s.cofan_inj_epi_naturality_assoc A (SimplexCategory.Ο i).op,
cofan_inj_ΟSummand_eq_zero]
rw [ne_comm]
change Β¬(A.epiComp (SimplexCategory.Ο i).op).EqId
rw [IndexSet.eqId_iff_len_eq]
have h := SimplexCategory.len_le_of_epi (inferInstance : Epi A.e)
dsimp at h β’
omega
#align simplicial_object.splitting.Ο_comp_Ο_summand_id_eq_zero SimplicialObject.Splitting.Ο_comp_ΟSummand_id_eq_zero
| Mathlib/AlgebraicTopology/DoldKan/SplitSimplicialObject.lean | 91 | 95 | theorem cofan_inj_comp_PInfty_eq_zero {X : SimplicialObject C} (s : SimplicialObject.Splitting X)
{n : β} (A : SimplicialObject.Splitting.IndexSet (op [n])) (hA : Β¬A.EqId) :
(s.cofan _).inj A β« PInfty.f n = 0 := by |
rw [SimplicialObject.Splitting.IndexSet.eqId_iff_mono] at hA
rw [SimplicialObject.Splitting.cofan_inj_eq, assoc, degeneracy_comp_PInfty X n A.e hA, comp_zero]
| [
" s.N B.fst.unop.len βΆ s.N A.fst.unop.len",
" s.N B.fst.unop.len = s.N A.fst.unop.len",
" s.N B.fst.unop.len = s.N B.fst.unop.len",
" (s.cofan Ξ).inj A β« s.ΟSummand A = π (summand s.N Ξ A)",
" (s.cofan Ξ).inj A β« s.ΟSummand B = 0",
" ((s.cofan Ξ).inj A β« s.desc Ξ fun B_1 => if h : B_1 = B then eqToHom β― ... | [
" s.N B.fst.unop.len βΆ s.N A.fst.unop.len",
" s.N B.fst.unop.len = s.N A.fst.unop.len",
" s.N B.fst.unop.len = s.N B.fst.unop.len",
" (s.cofan Ξ).inj A β« s.ΟSummand A = π (summand s.N Ξ A)",
" (s.cofan Ξ).inj A β« s.ΟSummand B = 0",
" ((s.cofan Ξ).inj A β« s.desc Ξ fun B_1 => if h : B_1 = B then eqToHom β― ... |
import Mathlib.Algebra.GCDMonoid.Multiset
import Mathlib.Combinatorics.Enumerative.Partition
import Mathlib.Data.List.Rotate
import Mathlib.GroupTheory.Perm.Cycle.Factors
import Mathlib.GroupTheory.Perm.Closure
import Mathlib.Algebra.GCDMonoid.Nat
import Mathlib.Tactic.NormNum.GCD
#align_import group_theory.perm.cycle.type from "leanprover-community/mathlib"@"47adfab39a11a072db552f47594bf8ed2cf8a722"
namespace Equiv.Perm
open Equiv List Multiset
variable {Ξ± : Type*} [Fintype Ξ±]
section CycleType
variable [DecidableEq Ξ±]
def cycleType (Ο : Perm Ξ±) : Multiset β :=
Ο.cycleFactorsFinset.1.map (Finset.card β support)
#align equiv.perm.cycle_type Equiv.Perm.cycleType
theorem cycleType_def (Ο : Perm Ξ±) :
Ο.cycleType = Ο.cycleFactorsFinset.1.map (Finset.card β support) :=
rfl
#align equiv.perm.cycle_type_def Equiv.Perm.cycleType_def
theorem cycleType_eq' {Ο : Perm Ξ±} (s : Finset (Perm Ξ±)) (h1 : β f : Perm Ξ±, f β s β f.IsCycle)
(h2 : (s : Set (Perm Ξ±)).Pairwise Disjoint)
(h0 : s.noncommProd id (h2.imp fun _ _ => Disjoint.commute) = Ο) :
Ο.cycleType = s.1.map (Finset.card β support) := by
rw [cycleType_def]
congr
rw [cycleFactorsFinset_eq_finset]
exact β¨h1, h2, h0β©
#align equiv.perm.cycle_type_eq' Equiv.Perm.cycleType_eq'
| Mathlib/GroupTheory/Perm/Cycle/Type.lean | 67 | 75 | theorem cycleType_eq {Ο : Perm Ξ±} (l : List (Perm Ξ±)) (h0 : l.prod = Ο)
(h1 : β Ο : Perm Ξ±, Ο β l β Ο.IsCycle) (h2 : l.Pairwise Disjoint) :
Ο.cycleType = l.map (Finset.card β support) := by |
have hl : l.Nodup := nodup_of_pairwise_disjoint_cycles h1 h2
rw [cycleType_eq' l.toFinset]
Β· simp [List.dedup_eq_self.mpr hl, (Β· β Β·)]
Β· simpa using h1
Β· simpa [hl] using h2
Β· simp [hl, h0]
| [
" Ο.cycleType = Multiset.map (Finset.card β support) s.val",
" Multiset.map (Finset.card β support) Ο.cycleFactorsFinset.val = Multiset.map (Finset.card β support) s.val",
" Ο.cycleFactorsFinset = s",
" (β f β s, f.IsCycle) β§ β (h : (βs).Pairwise Disjoint), s.noncommProd id β― = Ο",
" Ο.cycleType = β(List.ma... | [
" Ο.cycleType = Multiset.map (Finset.card β support) s.val",
" Multiset.map (Finset.card β support) Ο.cycleFactorsFinset.val = Multiset.map (Finset.card β support) s.val",
" Ο.cycleFactorsFinset = s",
" (β f β s, f.IsCycle) β§ β (h : (βs).Pairwise Disjoint), s.noncommProd id β― = Ο"
] |
import Mathlib.Analysis.InnerProductSpace.Calculus
import Mathlib.Analysis.InnerProductSpace.PiL2
#align_import analysis.inner_product_space.euclidean_dist from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057"
open scoped Topology
open Set
variable {E : Type*} [AddCommGroup E] [TopologicalSpace E] [TopologicalAddGroup E] [T2Space E]
[Module β E] [ContinuousSMul β E] [FiniteDimensional β E]
noncomputable section
open FiniteDimensional
def toEuclidean : E βL[β] EuclideanSpace β (Fin <| finrank β E) :=
ContinuousLinearEquiv.ofFinrankEq finrank_euclideanSpace_fin.symm
#align to_euclidean toEuclidean
namespace Euclidean
nonrec def dist (x y : E) : β :=
dist (toEuclidean x) (toEuclidean y)
#align euclidean.dist Euclidean.dist
def closedBall (x : E) (r : β) : Set E :=
{y | dist y x β€ r}
#align euclidean.closed_ball Euclidean.closedBall
def ball (x : E) (r : β) : Set E :=
{y | dist y x < r}
#align euclidean.ball Euclidean.ball
theorem ball_eq_preimage (x : E) (r : β) :
ball x r = toEuclidean β»ΒΉ' Metric.ball (toEuclidean x) r :=
rfl
#align euclidean.ball_eq_preimage Euclidean.ball_eq_preimage
theorem closedBall_eq_preimage (x : E) (r : β) :
closedBall x r = toEuclidean β»ΒΉ' Metric.closedBall (toEuclidean x) r :=
rfl
#align euclidean.closed_ball_eq_preimage Euclidean.closedBall_eq_preimage
theorem ball_subset_closedBall {x : E} {r : β} : ball x r β closedBall x r := fun _ (hy : _ < r) =>
le_of_lt hy
#align euclidean.ball_subset_closed_ball Euclidean.ball_subset_closedBall
theorem isOpen_ball {x : E} {r : β} : IsOpen (ball x r) :=
Metric.isOpen_ball.preimage toEuclidean.continuous
#align euclidean.is_open_ball Euclidean.isOpen_ball
theorem mem_ball_self {x : E} {r : β} (hr : 0 < r) : x β ball x r :=
Metric.mem_ball_self hr
#align euclidean.mem_ball_self Euclidean.mem_ball_self
theorem closedBall_eq_image (x : E) (r : β) :
closedBall x r = toEuclidean.symm '' Metric.closedBall (toEuclidean x) r := by
rw [toEuclidean.image_symm_eq_preimage, closedBall_eq_preimage]
#align euclidean.closed_ball_eq_image Euclidean.closedBall_eq_image
nonrec theorem isCompact_closedBall {x : E} {r : β} : IsCompact (closedBall x r) := by
rw [closedBall_eq_image]
exact (isCompact_closedBall _ _).image toEuclidean.symm.continuous
#align euclidean.is_compact_closed_ball Euclidean.isCompact_closedBall
theorem isClosed_closedBall {x : E} {r : β} : IsClosed (closedBall x r) :=
isCompact_closedBall.isClosed
#align euclidean.is_closed_closed_ball Euclidean.isClosed_closedBall
nonrec theorem closure_ball (x : E) {r : β} (h : r β 0) : closure (ball x r) = closedBall x r := by
rw [ball_eq_preimage, β toEuclidean.preimage_closure, closure_ball (toEuclidean x) h,
closedBall_eq_preimage]
#align euclidean.closure_ball Euclidean.closure_ball
nonrec theorem exists_pos_lt_subset_ball {R : β} {s : Set E} {x : E} (hR : 0 < R) (hs : IsClosed s)
(h : s β ball x R) : β r β Ioo 0 R, s β ball x r := by
rw [ball_eq_preimage, β image_subset_iff] at h
rcases exists_pos_lt_subset_ball hR (toEuclidean.isClosed_image.2 hs) h with β¨r, hr, hsrβ©
exact β¨r, hr, image_subset_iff.1 hsrβ©
#align euclidean.exists_pos_lt_subset_ball Euclidean.exists_pos_lt_subset_ball
| Mathlib/Analysis/InnerProductSpace/EuclideanDist.lean | 108 | 110 | theorem nhds_basis_closedBall {x : E} : (π x).HasBasis (fun r : β => 0 < r) (closedBall x) := by |
rw [toEuclidean.toHomeomorph.nhds_eq_comap x]
exact Metric.nhds_basis_closedBall.comap _
| [
" closedBall x r = βtoEuclidean.symm '' Metric.closedBall (toEuclidean x) r",
" IsCompact (closedBall x r)",
" IsCompact (βtoEuclidean.symm '' Metric.closedBall (toEuclidean x) r)",
" closure (ball x r) = closedBall x r",
" β r β Ioo 0 R, s β ball x r",
" (π x).HasBasis (fun r => 0 < r) (closedBall x)",
... | [
" closedBall x r = βtoEuclidean.symm '' Metric.closedBall (toEuclidean x) r",
" IsCompact (closedBall x r)",
" IsCompact (βtoEuclidean.symm '' Metric.closedBall (toEuclidean x) r)",
" closure (ball x r) = closedBall x r",
" β r β Ioo 0 R, s β ball x r"
] |
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
| Mathlib/Algebra/Field/Basic.lean | 129 | 129 | theorem neg_inv : -aβ»ΒΉ = (-a)β»ΒΉ := by | rw [inv_eq_one_div, inv_eq_one_div, div_neg_eq_neg_div]
| [
" -1 * -1 = 1",
" 1 / -a = 1 / (-1 * a)",
" 1 / (-1 * a) = 1 / a * (1 / -1)",
" 1 / a * (1 / -1) = 1 / a * -1",
" 1 / a * -1 = -(1 / a)",
" b / -a = b * (1 / -a)",
" b * (1 / -a) = b * -(1 / a)",
" b * -(1 / a) = -(b * (1 / a))",
" -(b * (1 / a)) = -(b / a)",
" -b / a = -(b / a)",
" -(b / a) = -... | [
" -1 * -1 = 1",
" 1 / -a = 1 / (-1 * a)",
" 1 / (-1 * a) = 1 / a * (1 / -1)",
" 1 / a * (1 / -1) = 1 / a * -1",
" 1 / a * -1 = -(1 / a)",
" b / -a = b * (1 / -a)",
" b * (1 / -a) = b * -(1 / a)",
" b * -(1 / a) = -(b * (1 / a))",
" -(b * (1 / a)) = -(b / a)",
" -b / a = -(b / a)",
" -(b / a) = -... |
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.SetTheory.Ordinal.Basic
import Mathlib.Topology.ContinuousFunction.Algebra
import Mathlib.Topology.Compactness.Paracompact
import Mathlib.Topology.ShrinkingLemma
import Mathlib.Topology.UrysohnsLemma
#align_import topology.partition_of_unity from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
universe u v
open Function Set Filter
open scoped Classical
open Topology
noncomputable section
structure PartitionOfUnity (ΞΉ X : Type*) [TopologicalSpace X] (s : Set X := univ) where
toFun : ΞΉ β C(X, β)
locallyFinite' : LocallyFinite fun i => support (toFun i)
nonneg' : 0 β€ toFun
sum_eq_one' : β x β s, βαΆ i, toFun i x = 1
sum_le_one' : β x, βαΆ i, toFun i x β€ 1
#align partition_of_unity PartitionOfUnity
structure BumpCovering (ΞΉ X : Type*) [TopologicalSpace X] (s : Set X := univ) where
toFun : ΞΉ β C(X, β)
locallyFinite' : LocallyFinite fun i => support (toFun i)
nonneg' : 0 β€ toFun
le_one' : toFun β€ 1
eventuallyEq_one' : β x β s, β i, toFun i =αΆ [π x] 1
#align bump_covering BumpCovering
variable {ΞΉ : Type u} {X : Type v} [TopologicalSpace X]
namespace PartitionOfUnity
variable {E : Type*} [AddCommMonoid E] [SMulWithZero β E] [TopologicalSpace E] [ContinuousSMul β E]
{s : Set X} (f : PartitionOfUnity ΞΉ X s)
instance : FunLike (PartitionOfUnity ΞΉ X s) ΞΉ C(X, β) where
coe := toFun
coe_injective' := fun f g h β¦ by cases f; cases g; congr
protected theorem locallyFinite : LocallyFinite fun i => support (f i) :=
f.locallyFinite'
#align partition_of_unity.locally_finite PartitionOfUnity.locallyFinite
theorem locallyFinite_tsupport : LocallyFinite fun i => tsupport (f i) :=
f.locallyFinite.closure
#align partition_of_unity.locally_finite_tsupport PartitionOfUnity.locallyFinite_tsupport
theorem nonneg (i : ΞΉ) (x : X) : 0 β€ f i x :=
f.nonneg' i x
#align partition_of_unity.nonneg PartitionOfUnity.nonneg
theorem sum_eq_one {x : X} (hx : x β s) : βαΆ i, f i x = 1 :=
f.sum_eq_one' x hx
#align partition_of_unity.sum_eq_one PartitionOfUnity.sum_eq_one
theorem exists_pos {x : X} (hx : x β s) : β i, 0 < f i x := by
have H := f.sum_eq_one hx
contrapose! H
simpa only [fun i => (H i).antisymm (f.nonneg i x), finsum_zero] using zero_ne_one
#align partition_of_unity.exists_pos PartitionOfUnity.exists_pos
theorem sum_le_one (x : X) : βαΆ i, f i x β€ 1 :=
f.sum_le_one' x
#align partition_of_unity.sum_le_one PartitionOfUnity.sum_le_one
theorem sum_nonneg (x : X) : 0 β€ βαΆ i, f i x :=
finsum_nonneg fun i => f.nonneg i x
#align partition_of_unity.sum_nonneg PartitionOfUnity.sum_nonneg
theorem le_one (i : ΞΉ) (x : X) : f i x β€ 1 :=
(single_le_finsum i (f.locallyFinite.point_finite x) fun j => f.nonneg j x).trans (f.sum_le_one x)
#align partition_of_unity.le_one PartitionOfUnity.le_one
section finsupport
variable {s : Set X} (Ο : PartitionOfUnity ΞΉ X s) (xβ : X)
def finsupport : Finset ΞΉ := (Ο.locallyFinite.point_finite xβ).toFinset
@[simp]
| Mathlib/Topology/PartitionOfUnity.lean | 188 | 190 | theorem mem_finsupport (xβ : X) {i} :
i β Ο.finsupport xβ β i β support fun i β¦ Ο i xβ := by |
simp only [finsupport, mem_support, Finite.mem_toFinset, mem_setOf_eq]
| [
" f = g",
" { toFun := toFunβ, locallyFinite' := locallyFinite'β, nonneg' := nonneg'β, sum_eq_one' := sum_eq_one'β,\n sum_le_one' := sum_le_one'β } =\n g",
" { toFun := toFunβΒΉ, locallyFinite' := locallyFinite'βΒΉ, nonneg' := nonneg'βΒΉ, sum_eq_one' := sum_eq_one'βΒΉ,\n sum_le_one' := sum_le_one'βΒΉ } ... | [
" f = g",
" { toFun := toFunβ, locallyFinite' := locallyFinite'β, nonneg' := nonneg'β, sum_eq_one' := sum_eq_one'β,\n sum_le_one' := sum_le_one'β } =\n g",
" { toFun := toFunβΒΉ, locallyFinite' := locallyFinite'βΒΉ, nonneg' := nonneg'βΒΉ, sum_eq_one' := sum_eq_one'βΒΉ,\n sum_le_one' := sum_le_one'βΒΉ } ... |
import Mathlib.RingTheory.Algebraic
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.RingTheory.Localization.Integral
#align_import ring_theory.ideal.over from "leanprover-community/mathlib"@"198cb64d5c961e1a8d0d3e219feb7058d5353861"
variable {R : Type*} [CommRing R]
namespace Ideal
open Polynomial
open Polynomial
open Submodule
section CommRing
variable {S : Type*} [CommRing S] {f : R β+* S} {I J : Ideal S}
theorem coeff_zero_mem_comap_of_root_mem_of_eval_mem {r : S} (hr : r β I) {p : R[X]}
(hp : p.evalβ f r β I) : p.coeff 0 β I.comap f := by
rw [β p.divX_mul_X_add, evalβ_add, evalβ_C, evalβ_mul, evalβ_X] at hp
refine mem_comap.mpr ((I.add_mem_iff_right ?_).mp hp)
exact I.mul_mem_left _ hr
#align ideal.coeff_zero_mem_comap_of_root_mem_of_eval_mem Ideal.coeff_zero_mem_comap_of_root_mem_of_eval_mem
theorem coeff_zero_mem_comap_of_root_mem {r : S} (hr : r β I) {p : R[X]} (hp : p.evalβ f r = 0) :
p.coeff 0 β I.comap f :=
coeff_zero_mem_comap_of_root_mem_of_eval_mem hr (hp.symm βΈ I.zero_mem)
#align ideal.coeff_zero_mem_comap_of_root_mem Ideal.coeff_zero_mem_comap_of_root_mem
theorem exists_coeff_ne_zero_mem_comap_of_non_zero_divisor_root_mem {r : S}
(r_non_zero_divisor : β {x}, x * r = 0 β x = 0) (hr : r β I) {p : R[X]} :
p β 0 β p.evalβ f r = 0 β β i, p.coeff i β 0 β§ p.coeff i β I.comap f := by
refine p.recOnHorner ?_ ?_ ?_
Β· intro h
contradiction
Β· intro p a coeff_eq_zero a_ne_zero _ _ hp
refine β¨0, ?_, coeff_zero_mem_comap_of_root_mem hr hpβ©
simp [coeff_eq_zero, a_ne_zero]
Β· intro p p_nonzero ih _ hp
rw [evalβ_mul, evalβ_X] at hp
obtain β¨i, hi, memβ© := ih p_nonzero (r_non_zero_divisor hp)
refine β¨i + 1, ?_, ?_β©
Β· simp [hi, mem]
Β· simpa [hi] using mem
#align ideal.exists_coeff_ne_zero_mem_comap_of_non_zero_divisor_root_mem Ideal.exists_coeff_ne_zero_mem_comap_of_non_zero_divisor_root_mem
theorem injective_quotient_le_comap_map (P : Ideal R[X]) :
Function.Injective <|
Ideal.quotientMap
(Ideal.map (Polynomial.mapRingHom (Quotient.mk (P.comap (C : R β+* R[X])))) P)
(Polynomial.mapRingHom (Ideal.Quotient.mk (P.comap (C : R β+* R[X]))))
le_comap_map := by
refine quotientMap_injective' (le_of_eq ?_)
rw [comap_map_of_surjective (mapRingHom (Ideal.Quotient.mk (P.comap (C : R β+* R[X]))))
(map_surjective (Ideal.Quotient.mk (P.comap (C : R β+* R[X]))) Ideal.Quotient.mk_surjective)]
refine le_antisymm (sup_le le_rfl ?_) (le_sup_of_le_left le_rfl)
refine fun p hp =>
polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Ideal.Quotient.eq_zero_iff_mem.mp ?_
simpa only [coeff_map, coe_mapRingHom] using ext_iff.mp (Ideal.mem_bot.mp (mem_comap.mp hp)) n
#align ideal.injective_quotient_le_comap_map Ideal.injective_quotient_le_comap_map
| Mathlib/RingTheory/Ideal/Over.lean | 101 | 109 | theorem quotient_mk_maps_eq (P : Ideal R[X]) :
((Quotient.mk (map (mapRingHom (Quotient.mk (P.comap (C : R β+* R[X])))) P)).comp C).comp
(Quotient.mk (P.comap (C : R β+* R[X]))) =
(Ideal.quotientMap (map (mapRingHom (Quotient.mk (P.comap (C : R β+* R[X])))) P)
(mapRingHom (Quotient.mk (P.comap (C : R β+* R[X])))) le_comap_map).comp
((Quotient.mk P).comp C) := by |
refine RingHom.ext fun x => ?_
repeat' rw [RingHom.coe_comp, Function.comp_apply]
rw [quotientMap_mk, coe_mapRingHom, map_C]
| [
" p.coeff 0 β comap f I",
" evalβ f r p.divX * r β I",
" p β 0 β evalβ f r p = 0 β β i, p.coeff i β 0 β§ p.coeff i β comap f I",
" 0 β 0 β evalβ f r 0 = 0 β β i, coeff 0 i β 0 β§ coeff 0 i β comap f I",
" evalβ f r 0 = 0 β β i, coeff 0 i β 0 β§ coeff 0 i β comap f I",
" β (p : R[X]) (a : R),\n p.coeff 0 =... | [
" p.coeff 0 β comap f I",
" evalβ f r p.divX * r β I",
" p β 0 β evalβ f r p = 0 β β i, p.coeff i β 0 β§ p.coeff i β comap f I",
" 0 β 0 β evalβ f r 0 = 0 β β i, coeff 0 i β 0 β§ coeff 0 i β comap f I",
" evalβ f r 0 = 0 β β i, coeff 0 i β 0 β§ coeff 0 i β comap f I",
" β (p : R[X]) (a : R),\n p.coeff 0 =... |
import Mathlib.CategoryTheory.Monoidal.Mon_
#align_import category_theory.monoidal.Mod_ from "leanprover-community/mathlib"@"33085c9739c41428651ac461a323fde9a2688d9b"
universe vβ vβ uβ uβ
open CategoryTheory MonoidalCategory
variable (C : Type uβ) [Category.{vβ} C] [MonoidalCategory.{vβ} C]
variable {C}
structure Mod_ (A : Mon_ C) where
X : C
act : A.X β X βΆ X
one_act : (A.one β· X) β« act = (Ξ»_ X).hom := by aesop_cat
assoc : (A.mul β· X) β« act = (Ξ±_ A.X A.X X).hom β« (A.X β act) β« act := by aesop_cat
set_option linter.uppercaseLean3 false in
#align Mod_ Mod_
attribute [reassoc (attr := simp)] Mod_.one_act Mod_.assoc
namespace Mod_
variable {A : Mon_ C} (M : Mod_ A)
theorem assoc_flip :
(A.X β M.act) β« M.act = (Ξ±_ A.X A.X M.X).inv β« (A.mul β· M.X) β« M.act := by simp
set_option linter.uppercaseLean3 false in
#align Mod_.assoc_flip Mod_.assoc_flip
@[ext]
structure Hom (M N : Mod_ A) where
hom : M.X βΆ N.X
act_hom : M.act β« hom = (A.X β hom) β« N.act := by aesop_cat
set_option linter.uppercaseLean3 false in
#align Mod_.hom Mod_.Hom
attribute [reassoc (attr := simp)] Hom.act_hom
@[simps]
def id (M : Mod_ A) : Hom M M where hom := π M.X
set_option linter.uppercaseLean3 false in
#align Mod_.id Mod_.id
instance homInhabited (M : Mod_ A) : Inhabited (Hom M M) :=
β¨id Mβ©
set_option linter.uppercaseLean3 false in
#align Mod_.hom_inhabited Mod_.homInhabited
@[simps]
def comp {M N O : Mod_ A} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom β« g.hom
set_option linter.uppercaseLean3 false in
#align Mod_.comp Mod_.comp
instance : Category (Mod_ A) where
Hom M N := Hom M N
id := id
comp f g := comp f g
-- Porting note: added because `Hom.ext` is not triggered automatically
-- See https://github.com/leanprover-community/mathlib4/issues/5229
@[ext]
lemma hom_ext {M N : Mod_ A} (fβ fβ : M βΆ N) (h : fβ.hom = fβ.hom) : fβ = fβ :=
Hom.ext _ _ h
@[simp]
| Mathlib/CategoryTheory/Monoidal/Mod_.lean | 81 | 82 | theorem id_hom' (M : Mod_ A) : (π M : M βΆ M).hom = π M.X := by |
rfl
| [
" A.X β M.act β« M.act = (Ξ±_ A.X A.X M.X).inv β« A.mul β· M.X β« M.act",
" (π M).hom = π M.X"
] | [
" A.X β M.act β« M.act = (Ξ±_ A.X A.X M.X).inv β« A.mul β· M.X β« M.act"
] |
import Mathlib.Algebra.GradedMonoid
import Mathlib.Algebra.Order.Monoid.Canonical.Defs
import Mathlib.Algebra.MvPolynomial.Basic
#align_import ring_theory.mv_polynomial.weighted_homogeneous from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
noncomputable section
open Set Function Finset Finsupp AddMonoidAlgebra
variable {R M : Type*} [CommSemiring R]
namespace MvPolynomial
variable {Ο : Type*}
section AddCommMonoid
variable [AddCommMonoid M]
def weightedDegree (w : Ο β M) : (Ο ββ β) β+ M :=
(Finsupp.total Ο M β w).toAddMonoidHom
#align mv_polynomial.weighted_degree' MvPolynomial.weightedDegree
theorem weightedDegree_apply (w : Ο β M) (f : Ο ββ β):
weightedDegree w f = Finsupp.sum f (fun i c => c β’ w i) := by
rfl
section SemilatticeSup
variable [SemilatticeSup M]
def weightedTotalDegree' (w : Ο β M) (p : MvPolynomial Ο R) : WithBot M :=
p.support.sup fun s => weightedDegree w s
#align mv_polynomial.weighted_total_degree' MvPolynomial.weightedTotalDegree'
theorem weightedTotalDegree'_eq_bot_iff (w : Ο β M) (p : MvPolynomial Ο R) :
weightedTotalDegree' w p = β₯ β p = 0 := by
simp only [weightedTotalDegree', Finset.sup_eq_bot_iff, mem_support_iff, WithBot.coe_ne_bot,
MvPolynomial.eq_zero_iff]
exact forall_congr' fun _ => Classical.not_not
#align mv_polynomial.weighted_total_degree'_eq_bot_iff MvPolynomial.weightedTotalDegree'_eq_bot_iff
theorem weightedTotalDegree'_zero (w : Ο β M) :
weightedTotalDegree' w (0 : MvPolynomial Ο R) = β₯ := by
simp only [weightedTotalDegree', support_zero, Finset.sup_empty]
#align mv_polynomial.weighted_total_degree'_zero MvPolynomial.weightedTotalDegree'_zero
section OrderBot
variable [OrderBot M]
def weightedTotalDegree (w : Ο β M) (p : MvPolynomial Ο R) : M :=
p.support.sup fun s => weightedDegree w s
#align mv_polynomial.weighted_total_degree MvPolynomial.weightedTotalDegree
| Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean | 105 | 116 | theorem weightedTotalDegree_coe (w : Ο β M) (p : MvPolynomial Ο R) (hp : p β 0) :
weightedTotalDegree' w p = β(weightedTotalDegree w p) := by |
rw [Ne, β weightedTotalDegree'_eq_bot_iff w p, β Ne, WithBot.ne_bot_iff_exists] at hp
obtain β¨m, hmβ© := hp
apply le_antisymm
Β· simp only [weightedTotalDegree, weightedTotalDegree', Finset.sup_le_iff, WithBot.coe_le_coe]
intro b
exact Finset.le_sup
Β· simp only [weightedTotalDegree]
have hm' : weightedTotalDegree' w p β€ m := le_of_eq hm.symm
rw [β hm]
simpa [weightedTotalDegree'] using hm'
| [
" (weightedDegree w) f = f.sum fun i c => c β’ w i",
" weightedTotalDegree' w p = β₯ β p = 0",
" (β (s : Ο ββ β), coeff s p β 0 β False) β β (d : Ο ββ β), coeff d p = 0",
" weightedTotalDegree' w 0 = β₯",
" weightedTotalDegree' w p = β(weightedTotalDegree w p)",
" weightedTotalDegree' w p β€ β(weightedTotalDe... | [
" (weightedDegree w) f = f.sum fun i c => c β’ w i",
" weightedTotalDegree' w p = β₯ β p = 0",
" (β (s : Ο ββ β), coeff s p β 0 β False) β β (d : Ο ββ β), coeff d p = 0",
" weightedTotalDegree' w 0 = β₯"
] |
import Mathlib.Order.Filter.Bases
import Mathlib.Order.ConditionallyCompleteLattice.Basic
#align_import order.filter.lift from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1"
open Set Classical Filter Function
namespace Filter
variable {Ξ± Ξ² Ξ³ : Type*} {ΞΉ : Sort*}
section lift
protected def lift (f : Filter Ξ±) (g : Set Ξ± β Filter Ξ²) :=
β¨
s β f, g s
#align filter.lift Filter.lift
variable {f fβ fβ : Filter Ξ±} {g gβ gβ : Set Ξ± β Filter Ξ²}
@[simp]
theorem lift_top (g : Set Ξ± β Filter Ξ²) : (β€ : Filter Ξ±).lift g = g univ := by simp [Filter.lift]
#align filter.lift_top Filter.lift_top
-- Porting note: use `β i, p i β§ _` instead of `β i (hi : p i), _`
theorem HasBasis.mem_lift_iff {ΞΉ} {p : ΞΉ β Prop} {s : ΞΉ β Set Ξ±} {f : Filter Ξ±}
(hf : f.HasBasis p s) {Ξ² : ΞΉ β Type*} {pg : β i, Ξ² i β Prop} {sg : β i, Ξ² i β Set Ξ³}
{g : Set Ξ± β Filter Ξ³} (hg : β i, (g <| s i).HasBasis (pg i) (sg i)) (gm : Monotone g)
{s : Set Ξ³} : s β f.lift g β β i, p i β§ β x, pg i x β§ sg i x β s := by
refine (mem_biInf_of_directed ?_ β¨univ, univ_sets _β©).trans ?_
Β· intro tβ htβ tβ htβ
exact β¨tβ β© tβ, inter_mem htβ htβ, gm inter_subset_left, gm inter_subset_rightβ©
Β· simp only [β (hg _).mem_iff]
exact hf.exists_iff fun tβ tβ ht H => gm ht H
#align filter.has_basis.mem_lift_iff Filter.HasBasis.mem_lift_iffβ
theorem HasBasis.lift {ΞΉ} {p : ΞΉ β Prop} {s : ΞΉ β Set Ξ±} {f : Filter Ξ±} (hf : f.HasBasis p s)
{Ξ² : ΞΉ β Type*} {pg : β i, Ξ² i β Prop} {sg : β i, Ξ² i β Set Ξ³} {g : Set Ξ± β Filter Ξ³}
(hg : β i, (g (s i)).HasBasis (pg i) (sg i)) (gm : Monotone g) :
(f.lift g).HasBasis (fun i : Ξ£i, Ξ² i => p i.1 β§ pg i.1 i.2) fun i : Ξ£i, Ξ² i => sg i.1 i.2 := by
refine β¨fun t => (hf.mem_lift_iff hg gm).trans ?_β©
simp [Sigma.exists, and_assoc, exists_and_left]
#align filter.has_basis.lift Filter.HasBasis.lift
theorem mem_lift_sets (hg : Monotone g) {s : Set Ξ²} : s β f.lift g β β t β f, s β g t :=
(f.basis_sets.mem_lift_iff (fun s => (g s).basis_sets) hg).trans <| by
simp only [id, exists_mem_subset_iff]
#align filter.mem_lift_sets Filter.mem_lift_sets
theorem sInter_lift_sets (hg : Monotone g) :
ββ { s | s β f.lift g } = β s β f, ββ { t | t β g s } := by
simp only [sInter_eq_biInter, mem_setOf_eq, Filter.mem_sets, mem_lift_sets hg, iInter_exists,
iInter_and, @iInter_comm _ (Set Ξ²)]
#align filter.sInter_lift_sets Filter.sInter_lift_sets
theorem mem_lift {s : Set Ξ²} {t : Set Ξ±} (ht : t β f) (hs : s β g t) : s β f.lift g :=
le_principal_iff.mp <|
show f.lift g β€ π s from iInf_le_of_le t <| iInf_le_of_le ht <| le_principal_iff.mpr hs
#align filter.mem_lift Filter.mem_lift
theorem lift_le {f : Filter Ξ±} {g : Set Ξ± β Filter Ξ²} {h : Filter Ξ²} {s : Set Ξ±} (hs : s β f)
(hg : g s β€ h) : f.lift g β€ h :=
iInfβ_le_of_le s hs hg
#align filter.lift_le Filter.lift_le
theorem le_lift {f : Filter Ξ±} {g : Set Ξ± β Filter Ξ²} {h : Filter Ξ²} :
h β€ f.lift g β β s β f, h β€ g s :=
le_iInfβ_iff
#align filter.le_lift Filter.le_lift
theorem lift_mono (hf : fβ β€ fβ) (hg : gβ β€ gβ) : fβ.lift gβ β€ fβ.lift gβ :=
iInf_mono fun s => iInf_mono' fun hs => β¨hf hs, hg sβ©
#align filter.lift_mono Filter.lift_mono
theorem lift_mono' (hg : β s β f, gβ s β€ gβ s) : f.lift gβ β€ f.lift gβ := iInfβ_mono hg
#align filter.lift_mono' Filter.lift_mono'
| Mathlib/Order/Filter/Lift.lean | 106 | 108 | theorem tendsto_lift {m : Ξ³ β Ξ²} {l : Filter Ξ³} :
Tendsto m l (f.lift g) β β s β f, Tendsto m l (g s) := by |
simp only [Filter.lift, tendsto_iInf]
| [
" β€.lift g = g univ",
" s β f.lift g β β i, p i β§ β x, pg i x β§ sg i x β s",
" DirectedOn ((fun s => g s) β»ΒΉ'o fun x x_1 => x β₯ x_1) f.sets",
" β z β f.sets, ((fun s => g s) β»ΒΉ'o fun x x_1 => x β₯ x_1) tβ z β§ ((fun s => g s) β»ΒΉ'o fun x x_1 => x β₯ x_1) tβ z",
" (β i β f.sets, s β g i) β β i, p i β§ β x, pg i x... | [
" β€.lift g = g univ",
" s β f.lift g β β i, p i β§ β x, pg i x β§ sg i x β s",
" DirectedOn ((fun s => g s) β»ΒΉ'o fun x x_1 => x β₯ x_1) f.sets",
" β z β f.sets, ((fun s => g s) β»ΒΉ'o fun x x_1 => x β₯ x_1) tβ z β§ ((fun s => g s) β»ΒΉ'o fun x x_1 => x β₯ x_1) tβ z",
" (β i β f.sets, s β g i) β β i, p i β§ β x, pg i x... |
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
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]
#align nat.digits_aux_def Nat.digitsAux_def
def digits : β β β β List β
| 0 => digitsAux0
| 1 => digitsAux1
| b + 2 => digitsAux (b + 2) (by norm_num)
#align nat.digits Nat.digits
@[simp]
theorem digits_zero (b : β) : digits b 0 = [] := by
rcases b with (_ | β¨_ | β¨_β©β©) <;> simp [digits, digitsAux0, digitsAux1]
#align nat.digits_zero Nat.digits_zero
-- @[simp] -- Porting note (#10618): simp can prove this
theorem digits_zero_zero : digits 0 0 = [] :=
rfl
#align nat.digits_zero_zero Nat.digits_zero_zero
@[simp]
theorem digits_zero_succ (n : β) : digits 0 n.succ = [n + 1] :=
rfl
#align nat.digits_zero_succ Nat.digits_zero_succ
theorem digits_zero_succ' : β {n : β}, n β 0 β digits 0 n = [n]
| 0, h => (h rfl).elim
| _ + 1, _ => rfl
#align nat.digits_zero_succ' Nat.digits_zero_succ'
@[simp]
theorem digits_one (n : β) : digits 1 n = List.replicate n 1 :=
rfl
#align nat.digits_one Nat.digits_one
-- @[simp] -- Porting note (#10685): dsimp can prove this
theorem digits_one_succ (n : β) : digits 1 (n + 1) = 1 :: digits 1 n :=
rfl
#align nat.digits_one_succ Nat.digits_one_succ
| Mathlib/Data/Nat/Digits.lean | 119 | 121 | theorem digits_add_two_add_one (b n : β) :
digits (b + 2) (n + 1) = ((n + 1) % (b + 2)) :: digits (b + 2) ((n + 1) / (b + 2)) := by |
simp [digits, digitsAux_def]
| [
" (invImage (fun x => x) instWellFoundedRelationOfSizeOf).1 ((n + 1) / b) n.succ",
" b.digitsAux h 0 = []",
" b.digitsAux h n = n % b :: b.digitsAux h (n / b)",
" b.digitsAux h 0 = 0 % b :: b.digitsAux h (0 / b)",
" b.digitsAux h (nβ + 1) = (nβ + 1) % b :: b.digitsAux h ((nβ + 1) / b)",
" 2 β€ b + 2",
" ... | [
" (invImage (fun x => x) instWellFoundedRelationOfSizeOf).1 ((n + 1) / b) n.succ",
" b.digitsAux h 0 = []",
" b.digitsAux h n = n % b :: b.digitsAux h (n / b)",
" b.digitsAux h 0 = 0 % b :: b.digitsAux h (0 / b)",
" b.digitsAux h (nβ + 1) = (nβ + 1) % b :: b.digitsAux h ((nβ + 1) / b)",
" 2 β€ b + 2",
" ... |
import Mathlib.CategoryTheory.EffectiveEpi.Basic
namespace CategoryTheory
open Limits Category
variable {C : Type*} [Category C]
noncomputable
def effectiveEpiFamilyStructCompOfEffectiveEpiSplitEpi' {Ξ± : Type*} {B : C} {X Y : Ξ± β C}
(f : (a : Ξ±) β X a βΆ B) (g : (a : Ξ±) β Y a βΆ X a) (i : (a : Ξ±) β X a βΆ Y a)
(hi : β a, i a β« g a = π _) [EffectiveEpiFamily _ f] :
EffectiveEpiFamilyStruct _ (fun a β¦ g a β« f a) where
desc e w := EffectiveEpiFamily.desc _ f (fun a β¦ i a β« e a) fun aβ aβ gβ gβ _ β¦ (by
simp only [β Category.assoc]
apply w _ _ (gβ β« i aβ) (gβ β« i aβ)
simpa [β Category.assoc, Category.assoc, hi])
fac e w a := by
simp only [Category.assoc, EffectiveEpiFamily.fac]
rw [β Category.id_comp (e a), β Category.assoc, β Category.assoc]
apply w
simp only [Category.comp_id, Category.id_comp, β Category.assoc]
aesop
uniq _ _ _ hm := by
apply EffectiveEpiFamily.uniq _ f
intro a
rw [β hm a, β Category.assoc, β Category.assoc, hi, Category.id_comp]
noncomputable
def effectiveEpiFamilyStructCompOfEffectiveEpiSplitEpi {Ξ± : Type*} {B : C} {X Y : Ξ± β C}
(f : (a : Ξ±) β X a βΆ B) (g : (a : Ξ±) β Y a βΆ X a) [β a, IsSplitEpi (g a)]
[EffectiveEpiFamily _ f] : EffectiveEpiFamilyStruct _ (fun a β¦ g a β« f a) :=
effectiveEpiFamilyStructCompOfEffectiveEpiSplitEpi' f g
(fun a β¦ section_ (g a))
(fun a β¦ IsSplitEpi.id (g a))
instance {Ξ± : Type*} {B : C} {X Y : Ξ± β C}
(f : (a : Ξ±) β X a βΆ B) (g : (a : Ξ±) β Y a βΆ X a) [β a, IsSplitEpi (g a)]
[EffectiveEpiFamily _ f] : EffectiveEpiFamily _ (fun a β¦ g a β« f a) :=
β¨β¨effectiveEpiFamilyStructCompOfEffectiveEpiSplitEpi f gβ©β©
example {B X Y : C} (f : X βΆ B) (g : Y βΆ X) [IsSplitEpi g] [EffectiveEpi f] :
EffectiveEpi (g β« f) := inferInstance
instance IsSplitEpi.EffectiveEpi {B X : C} (f : X βΆ B) [IsSplitEpi f] : EffectiveEpi f := by
rw [β Category.comp_id f]
infer_instance
noncomputable def effectiveEpiFamilyStructOfComp {C : Type*} [Category C]
{I : Type*} {Z Y : I β C} {X : C} (g : β i, Z i βΆ Y i) (f : β i, Y i βΆ X)
[EffectiveEpiFamily _ (fun i => g i β« f i)] [β i, Epi (g i)] :
EffectiveEpiFamilyStruct _ f where
desc {W} Ο h := EffectiveEpiFamily.desc _ (fun i => g i β« f i)
(fun i => g i β« Ο i) (fun {T} iβ iβ gβ gβ eq =>
by simpa [assoc] using h iβ iβ (gβ β« g iβ) (gβ β« g iβ) (by simpa [assoc] using eq))
fac {W} Ο h i := by
dsimp
rw [β cancel_epi (g i), β assoc, EffectiveEpiFamily.fac _ (fun i => g i β« f i)]
uniq {W} Ο h m hm := EffectiveEpiFamily.uniq _ (fun i => g i β« f i) _ _ _
(fun i => by rw [assoc, hm])
lemma effectiveEpiFamily_of_effectiveEpi_epi_comp {Ξ± : Type*} {B : C} {X Y : Ξ± β C}
(f : (a : Ξ±) β X a βΆ B) (g : (a : Ξ±) β Y a βΆ X a) [β a, Epi (g a)]
[EffectiveEpiFamily _ (fun a β¦ g a β« f a)] : EffectiveEpiFamily _ f :=
β¨β¨effectiveEpiFamilyStructOfComp g fβ©β©
lemma effectiveEpi_of_effectiveEpi_epi_comp {B X Y : C} (f : X βΆ B) (g : Y βΆ X)
[Epi g] [EffectiveEpi (g β« f)] : EffectiveEpi f :=
have := (effectiveEpi_iff_effectiveEpiFamily (g β« f)).mp inferInstance
have := effectiveEpiFamily_of_effectiveEpi_epi_comp
(X := fun () β¦ X) (Y := fun () β¦ Y) (fun () β¦ f) (fun () β¦ g)
inferInstance
section CompIso
variable {B B' : C} {Ξ± : Type*} (X : Ξ± β C) (Ο : (a : Ξ±) β (X a βΆ B)) [EffectiveEpiFamily X Ο]
(i : B βΆ B') [IsIso i]
| Mathlib/CategoryTheory/EffectiveEpi/Comp.lean | 104 | 112 | theorem effectiveEpiFamilyStructCompIso_aux
{W : C} (e : (a : Ξ±) β X a βΆ W)
(h : β {Z : C} (aβ aβ : Ξ±) (gβ : Z βΆ X aβ) (gβ : Z βΆ X aβ),
gβ β« Ο aβ β« i = gβ β« Ο aβ β« i β gβ β« e aβ = gβ β« e aβ)
{Z : C} (aβ aβ : Ξ±) (gβ : Z βΆ X aβ) (gβ : Z βΆ X aβ) (hg : gβ β« Ο aβ = gβ β« Ο aβ) :
gβ β« e aβ = gβ β« e aβ := by |
apply h
rw [β Category.assoc, hg]
simp
| [
" gβ β« (fun a => i a β« e a) aβ = gβ β« (fun a => i a β« e a) aβ",
" (gβ β« i aβ) β« e aβ = (gβ β« i aβ) β« e aβ",
" (gβ β« i aβ) β« g aβ β« f aβ = (gβ β« i aβ) β« g aβ β« f aβ",
" (g a β« f a) β« (fun {W} e w => EffectiveEpiFamily.desc (fun a => X a) f (fun a => i a β« e a) β―) e β― = e a",
" g a β« i a β« e a = e a",
" ((g... | [
" gβ β« (fun a => i a β« e a) aβ = gβ β« (fun a => i a β« e a) aβ",
" (gβ β« i aβ) β« e aβ = (gβ β« i aβ) β« e aβ",
" (gβ β« i aβ) β« g aβ β« f aβ = (gβ β« i aβ) β« g aβ β« f aβ",
" (g a β« f a) β« (fun {W} e w => EffectiveEpiFamily.desc (fun a => X a) f (fun a => i a β« e a) β―) e β― = e a",
" g a β« i a β« e a = e a",
" ((g... |
import Mathlib.RingTheory.Noetherian
import Mathlib.Algebra.DirectSum.Module
import Mathlib.Algebra.DirectSum.Finsupp
import Mathlib.Algebra.Module.Projective
import Mathlib.Algebra.Module.Injective
import Mathlib.Algebra.Module.CharacterModule
import Mathlib.LinearAlgebra.DirectSum.TensorProduct
import Mathlib.LinearAlgebra.FreeModule.Basic
import Mathlib.Algebra.Module.Projective
#align_import ring_theory.flat from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c"
universe u v w
namespace Module
open Function (Surjective)
open LinearMap Submodule TensorProduct DirectSum
variable (R : Type u) (M : Type v) [CommRing R] [AddCommGroup M] [Module R M]
@[mk_iff] class Flat : Prop where
out : β β¦I : Ideal Rβ¦ (_ : I.FG),
Function.Injective (TensorProduct.lift ((lsmul R M).comp I.subtype))
#align module.flat Module.Flat
namespace Flat
instance self (R : Type u) [CommRing R] : Flat R R :=
β¨by
intro I _
rw [β Equiv.injective_comp (TensorProduct.rid R I).symm.toEquiv]
convert Subtype.coe_injective using 1
ext x
simp only [Function.comp_apply, LinearEquiv.coe_toEquiv, rid_symm_apply, comp_apply, mul_one,
lift.tmul, Submodule.subtype_apply, Algebra.id.smul_eq_mul, lsmul_apply]β©
#align module.flat.self Module.Flat.self
lemma iff_rTensor_injective :
Flat R M β β β¦I : Ideal Rβ¦ (_ : I.FG), Function.Injective (rTensor M I.subtype) := by
simp [flat_iff, β lid_comp_rTensor]
| Mathlib/RingTheory/Flat/Basic.lean | 98 | 106 | theorem iff_rTensor_injective' :
Flat R M β β I : Ideal R, Function.Injective (rTensor M I.subtype) := by |
rewrite [Flat.iff_rTensor_injective]
refine β¨fun h I => ?_, fun h I _ => h Iβ©
rewrite [injective_iff_map_eq_zero]
intro x hxβ
obtain β¨J, hfg, hle, y, rflβ© := Submodule.exists_fg_le_eq_rTensor_inclusion x
rewrite [β rTensor_comp_apply] at hxβ
rw [(injective_iff_map_eq_zero _).mp (h hfg) y hxβ, LinearMap.map_zero]
| [
" β β¦I : Ideal Rβ¦, I.FG β Function.Injective β(lift (lsmul R R ββ Submodule.subtype I))",
" Function.Injective β(lift (lsmul R R ββ Submodule.subtype I))",
" Function.Injective (β(lift (lsmul R R ββ Submodule.subtype I)) β β(TensorProduct.rid R β₯I).symm.toEquiv)",
" β(lift (lsmul R R ββ Submodule.subtype I)) ... | [
" β β¦I : Ideal Rβ¦, I.FG β Function.Injective β(lift (lsmul R R ββ Submodule.subtype I))",
" Function.Injective β(lift (lsmul R R ββ Submodule.subtype I))",
" Function.Injective (β(lift (lsmul R R ββ Submodule.subtype I)) β β(TensorProduct.rid R β₯I).symm.toEquiv)",
" β(lift (lsmul R R ββ Submodule.subtype I)) ... |
import Mathlib.Topology.Order
#align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d"
open Set Filter Function
open TopologicalSpace Topology Filter
variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β Y} {g : Y β Z}
section Inducing
variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z]
theorem inducing_induced (f : X β Y) : @Inducing X Y (TopologicalSpace.induced f βΉ_βΊ) _ f :=
@Inducing.mk _ _ (TopologicalSpace.induced f βΉ_βΊ) _ _ rfl
theorem inducing_id : Inducing (@id X) :=
β¨induced_id.symmβ©
#align inducing_id inducing_id
protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) :
Inducing (g β f) :=
β¨by rw [hf.induced, hg.induced, induced_compose]β©
#align inducing.comp Inducing.comp
theorem Inducing.of_comp_iff (hg : Inducing g) :
Inducing (g β f) β Inducing f := by
refine β¨fun h β¦ ?_, hg.compβ©
rw [inducing_iff, hg.induced, induced_compose, h.induced]
#align inducing.inducing_iff Inducing.of_comp_iff
theorem inducing_of_inducing_compose
(hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g β f)) : Inducing f :=
β¨le_antisymm (by rwa [β continuous_iff_le_induced])
(by
rw [hgf.induced, β induced_compose]
exact induced_mono hg.le_induced)β©
#align inducing_of_inducing_compose inducing_of_inducing_compose
theorem inducing_iff_nhds : Inducing f β β x, π x = comap f (π (f x)) :=
(inducing_iff _).trans (induced_iff_nhds_eq f)
#align inducing_iff_nhds inducing_iff_nhds
namespace Inducing
theorem nhds_eq_comap (hf : Inducing f) : β x : X, π x = comap f (π <| f x) :=
inducing_iff_nhds.1 hf
#align inducing.nhds_eq_comap Inducing.nhds_eq_comap
theorem basis_nhds {p : ΞΉ β Prop} {s : ΞΉ β Set Y} (hf : Inducing f) {x : X}
(h_basis : (π (f x)).HasBasis p s) : (π x).HasBasis p (preimage f β s) :=
hf.nhds_eq_comap x βΈ h_basis.comap f
theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) :
πΛ’ s = comap f (πΛ’ (f '' s)) := by
simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image]
#align inducing.nhds_set_eq_comap Inducing.nhdsSet_eq_comap
theorem map_nhds_eq (hf : Inducing f) (x : X) : (π x).map f = π[range f] f x :=
hf.induced.symm βΈ map_nhds_induced_eq x
#align inducing.map_nhds_eq Inducing.map_nhds_eq
theorem map_nhds_of_mem (hf : Inducing f) (x : X) (h : range f β π (f x)) :
(π x).map f = π (f x) :=
hf.induced.symm βΈ map_nhds_induced_of_mem h
#align inducing.map_nhds_of_mem Inducing.map_nhds_of_mem
-- Porting note (#10756): new lemma
theorem mapClusterPt_iff (hf : Inducing f) {x : X} {l : Filter X} :
MapClusterPt (f x) l f β ClusterPt x l := by
delta MapClusterPt ClusterPt
rw [β Filter.push_pull', β hf.nhds_eq_comap, map_neBot_iff]
theorem image_mem_nhdsWithin (hf : Inducing f) {x : X} {s : Set X} (hs : s β π x) :
f '' s β π[range f] f x :=
hf.map_nhds_eq x βΈ image_mem_map hs
#align inducing.image_mem_nhds_within Inducing.image_mem_nhdsWithin
theorem tendsto_nhds_iff {f : ΞΉ β Y} {l : Filter ΞΉ} {y : Y} (hg : Inducing g) :
Tendsto f l (π y) β Tendsto (g β f) l (π (g y)) := by
rw [hg.nhds_eq_comap, tendsto_comap_iff]
#align inducing.tendsto_nhds_iff Inducing.tendsto_nhds_iff
theorem continuousAt_iff (hg : Inducing g) {x : X} :
ContinuousAt f x β ContinuousAt (g β f) x :=
hg.tendsto_nhds_iff
#align inducing.continuous_at_iff Inducing.continuousAt_iff
theorem continuous_iff (hg : Inducing g) :
Continuous f β Continuous (g β f) := by
simp_rw [continuous_iff_continuousAt, hg.continuousAt_iff]
#align inducing.continuous_iff Inducing.continuous_iff
theorem continuousAt_iff' (hf : Inducing f) {x : X} (h : range f β π (f x)) :
ContinuousAt (g β f) x β ContinuousAt g (f x) := by
simp_rw [ContinuousAt, Filter.Tendsto, β hf.map_nhds_of_mem _ h, Filter.map_map, comp]
#align inducing.continuous_at_iff' Inducing.continuousAt_iff'
protected theorem continuous (hf : Inducing f) : Continuous f :=
hf.continuous_iff.mp continuous_id
#align inducing.continuous Inducing.continuous
theorem closure_eq_preimage_closure_image (hf : Inducing f) (s : Set X) :
closure s = f β»ΒΉ' closure (f '' s) := by
ext x
rw [Set.mem_preimage, β closure_induced, hf.induced]
#align inducing.closure_eq_preimage_closure_image Inducing.closure_eq_preimage_closure_image
| Mathlib/Topology/Maps.lean | 152 | 153 | theorem isClosed_iff (hf : Inducing f) {s : Set X} :
IsClosed s β β t, IsClosed t β§ f β»ΒΉ' t = s := by | rw [hf.induced, isClosed_induced_iff]
| [
" instβΒ² = TopologicalSpace.induced (g β f) instβ",
" Inducing (g β f) β Inducing f",
" Inducing f",
" instβΒ² β€ induced f instβΒΉ",
" induced f instβΒΉ β€ instβΒ²",
" induced f instβΒΉ β€ induced f (induced g instβ)",
" πΛ’ s = comap f (πΛ’ (f '' s))",
" MapClusterPt (f x) l f β ClusterPt x l",
" (π (f x... | [
" instβΒ² = TopologicalSpace.induced (g β f) instβ",
" Inducing (g β f) β Inducing f",
" Inducing f",
" instβΒ² β€ induced f instβΒΉ",
" induced f instβΒΉ β€ instβΒ²",
" induced f instβΒΉ β€ induced f (induced g instβ)",
" πΛ’ s = comap f (πΛ’ (f '' s))",
" MapClusterPt (f x) l f β ClusterPt x l",
" (π (f x... |
import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic
import Mathlib.LinearAlgebra.CliffordAlgebra.Fold
import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation
import Mathlib.LinearAlgebra.Dual
#align_import linear_algebra.clifford_algebra.contraction from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open LinearMap (BilinForm)
universe u1 u2 u3
variable {R : Type u1} [CommRing R]
variable {M : Type u2} [AddCommGroup M] [Module R M]
variable (Q : QuadraticForm R M)
namespace CliffordAlgebra
section contractLeft
variable (d d' : Module.Dual R M)
@[simps!]
def contractLeftAux (d : Module.Dual R M) :
M ββ[R] CliffordAlgebra Q Γ CliffordAlgebra Q ββ[R] CliffordAlgebra Q :=
haveI v_mul := (Algebra.lmul R (CliffordAlgebra Q)).toLinearMap ββ ΞΉ Q
d.smulRight (LinearMap.fst _ (CliffordAlgebra Q) (CliffordAlgebra Q)) -
v_mul.complβ (LinearMap.snd _ (CliffordAlgebra Q) _)
#align clifford_algebra.contract_left_aux CliffordAlgebra.contractLeftAux
theorem contractLeftAux_contractLeftAux (v : M) (x : CliffordAlgebra Q) (fx : CliffordAlgebra Q) :
contractLeftAux Q d v (ΞΉ Q v * x, contractLeftAux Q d v (x, fx)) = Q v β’ fx := by
simp only [contractLeftAux_apply_apply]
rw [mul_sub, β mul_assoc, ΞΉ_sq_scalar, β Algebra.smul_def, β sub_add, mul_smul_comm, sub_self,
zero_add]
#align clifford_algebra.contract_left_aux_contract_left_aux CliffordAlgebra.contractLeftAux_contractLeftAux
variable {Q}
def contractLeft : Module.Dual R M ββ[R] CliffordAlgebra Q ββ[R] CliffordAlgebra Q where
toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
map_add' dβ dβ :=
LinearMap.ext fun x => by
dsimp only
rw [LinearMap.add_apply]
induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
Β· simp_rw [foldr'_algebraMap, smul_zero, zero_add]
Β· rw [map_add, map_add, map_add, add_add_add_comm, hx, hy]
Β· rw [foldr'_ΞΉ_mul, foldr'_ΞΉ_mul, foldr'_ΞΉ_mul, hx]
dsimp only [contractLeftAux_apply_apply]
rw [sub_add_sub_comm, mul_add, LinearMap.add_apply, add_smul]
map_smul' c d :=
LinearMap.ext fun x => by
dsimp only
rw [LinearMap.smul_apply, RingHom.id_apply]
induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
Β· simp_rw [foldr'_algebraMap, smul_zero]
Β· rw [map_add, map_add, smul_add, hx, hy]
Β· rw [foldr'_ΞΉ_mul, foldr'_ΞΉ_mul, hx]
dsimp only [contractLeftAux_apply_apply]
rw [LinearMap.smul_apply, smul_assoc, mul_smul_comm, smul_sub]
#align clifford_algebra.contract_left CliffordAlgebra.contractLeft
def contractRight : CliffordAlgebra Q ββ[R] Module.Dual R M ββ[R] CliffordAlgebra Q :=
LinearMap.flip (LinearMap.complβ (LinearMap.comprβ contractLeft reverse) reverse)
#align clifford_algebra.contract_right CliffordAlgebra.contractRight
theorem contractRight_eq (x : CliffordAlgebra Q) :
contractRight (Q := Q) x d = reverse (contractLeft (R := R) (M := M) d <| reverse x) :=
rfl
#align clifford_algebra.contract_right_eq CliffordAlgebra.contractRight_eq
local infixl:70 "β" => contractLeft (R := R) (M := M)
local infixl:70 "β" => contractRight (R := R) (M := M) (Q := Q)
-- Porting note: Lean needs to be reminded of this instance otherwise the statement of the
-- next result times out
instance : SMul R (CliffordAlgebra Q) := inferInstance
theorem contractLeft_ΞΉ_mul (a : M) (b : CliffordAlgebra Q) :
dβ(ΞΉ Q a * b) = d a β’ b - ΞΉ Q a * (dβb) := by
-- Porting note: Lean cannot figure out anymore the third argument
refine foldr'_ΞΉ_mul _ _ ?_ _ _ _
exact fun m x fx β¦ contractLeftAux_contractLeftAux Q d m x fx
#align clifford_algebra.contract_left_ΞΉ_mul CliffordAlgebra.contractLeft_ΞΉ_mul
theorem contractRight_mul_ΞΉ (a : M) (b : CliffordAlgebra Q) :
b * ΞΉ Q aβd = d a β’ b - bβd * ΞΉ Q a := by
rw [contractRight_eq, reverse.map_mul, reverse_ΞΉ, contractLeft_ΞΉ_mul, map_sub, map_smul,
reverse_reverse, reverse.map_mul, reverse_ΞΉ, contractRight_eq]
#align clifford_algebra.contract_right_mul_ΞΉ CliffordAlgebra.contractRight_mul_ΞΉ
theorem contractLeft_algebraMap_mul (r : R) (b : CliffordAlgebra Q) :
dβ(algebraMap _ _ r * b) = algebraMap _ _ r * (dβb) := by
rw [β Algebra.smul_def, map_smul, Algebra.smul_def]
#align clifford_algebra.contract_left_algebra_map_mul CliffordAlgebra.contractLeft_algebraMap_mul
| Mathlib/LinearAlgebra/CliffordAlgebra/Contraction.lean | 149 | 151 | theorem contractLeft_mul_algebraMap (a : CliffordAlgebra Q) (r : R) :
dβ(a * algebraMap _ _ r) = dβa * algebraMap _ _ r := by |
rw [β Algebra.commutes, contractLeft_algebraMap_mul, Algebra.commutes]
| [
" ((contractLeftAux Q d) v) ((ΞΉ Q) v * x, ((contractLeftAux Q d) v) (x, fx)) = Q v β’ fx",
" d v β’ ((ΞΉ Q) v * x) - (ΞΉ Q) v * (d v β’ x - (ΞΉ Q) v * fx) = Q v β’ fx",
" ((fun d => foldr' Q (contractLeftAux Q d) β― 0) (dβ + dβ)) x =\n ((fun d => foldr' Q (contractLeftAux Q d) β― 0) dβ + (fun d => foldr' Q (contractL... | [
" ((contractLeftAux Q d) v) ((ΞΉ Q) v * x, ((contractLeftAux Q d) v) (x, fx)) = Q v β’ fx",
" d v β’ ((ΞΉ Q) v * x) - (ΞΉ Q) v * (d v β’ x - (ΞΉ Q) v * fx) = Q v β’ fx",
" ((fun d => foldr' Q (contractLeftAux Q d) β― 0) (dβ + dβ)) x =\n ((fun d => foldr' Q (contractLeftAux Q d) β― 0) dβ + (fun d => foldr' Q (contractL... |
import Mathlib.Topology.Separation
import Mathlib.Algebra.BigOperators.Finprod
#align_import topology.algebra.infinite_sum.basic from "leanprover-community/mathlib"@"3b52265189f3fb43aa631edffce5d060fafaf82f"
noncomputable section
open Filter Function
open scoped Topology
variable {Ξ± Ξ² Ξ³ : Type*}
section HasProd
variable [CommMonoid Ξ±] [TopologicalSpace Ξ±]
@[to_additive "Infinite sum on a topological monoid
The `atTop` filter on `Finset Ξ²` is the limit of all finite sets towards the entire type. So we sum
up bigger and bigger sets. This sum operation is invariant under reordering. In particular,
the function `β β β` sending `n` to `(-1)^n / (n+1)` does not have a
sum for this definition, but a series which is absolutely convergent will have the correct sum.
This is based on Mario Carneiro's
[infinite sum `df-tsms` in Metamath](http://us.metamath.org/mpeuni/df-tsms.html).
For the definition and many statements, `Ξ±` does not need to be a topological monoid. We only add
this assumption later, for the lemmas where it is relevant."]
def HasProd (f : Ξ² β Ξ±) (a : Ξ±) : Prop :=
Tendsto (fun s : Finset Ξ² β¦ β b β s, f b) atTop (π a)
#align has_sum HasSum
@[to_additive "`Summable f` means that `f` has some (infinite) sum. Use `tsum` to get the value."]
def Multipliable (f : Ξ² β Ξ±) : Prop :=
β a, HasProd f a
#align summable Summable
open scoped Classical in
@[to_additive "`β' i, f i` is the sum of `f` it exists, or 0 otherwise."]
noncomputable irreducible_def tprod {Ξ²} (f : Ξ² β Ξ±) :=
if h : Multipliable f then
if (mulSupport f).Finite then finprod f
else h.choose
else 1
#align tsum tsum
-- see Note [operator precedence of big operators]
@[inherit_doc tprod]
notation3 "β' "(...)", "r:67:(scoped f => tprod f) => r
@[inherit_doc tsum]
notation3 "β' "(...)", "r:67:(scoped f => tsum f) => r
variable {f g : Ξ² β Ξ±} {a b : Ξ±} {s : Finset Ξ²}
@[to_additive]
theorem HasProd.multipliable (h : HasProd f a) : Multipliable f :=
β¨a, hβ©
#align has_sum.summable HasSum.summable
@[to_additive]
theorem tprod_eq_one_of_not_multipliable (h : Β¬Multipliable f) : β' b, f b = 1 := by
simp [tprod_def, h]
#align tsum_eq_zero_of_not_summable tsum_eq_zero_of_not_summable
@[to_additive]
theorem Function.Injective.hasProd_iff {g : Ξ³ β Ξ²} (hg : Injective g)
(hf : β x, x β Set.range g β f x = 1) : HasProd (f β g) a β HasProd f a := by
simp only [HasProd, Tendsto, comp_apply, hg.map_atTop_finset_prod_eq hf]
#align function.injective.has_sum_iff Function.Injective.hasSum_iff
@[to_additive]
theorem hasProd_subtype_iff_of_mulSupport_subset {s : Set Ξ²} (hf : mulSupport f β s) :
HasProd (f β (β) : s β Ξ±) a β HasProd f a :=
Subtype.coe_injective.hasProd_iff <| by simpa using mulSupport_subset_iff'.1 hf
#align has_sum_subtype_iff_of_support_subset hasSum_subtype_iff_of_support_subset
@[to_additive]
theorem hasProd_fintype [Fintype Ξ²] (f : Ξ² β Ξ±) : HasProd f (β b, f b) :=
OrderTop.tendsto_atTop_nhds _
#align has_sum_fintype hasSum_fintype
@[to_additive]
protected theorem Finset.hasProd (s : Finset Ξ²) (f : Ξ² β Ξ±) :
HasProd (f β (β) : (βs : Set Ξ²) β Ξ±) (β b β s, f b) := by
rw [β prod_attach]
exact hasProd_fintype _
#align finset.has_sum Finset.hasSum
@[to_additive "If a function `f` vanishes outside of a finite set `s`, then it `HasSum`
`β b β s, f b`."]
theorem hasProd_prod_of_ne_finset_one (hf : β b β s, f b = 1) :
HasProd f (β b β s, f b) :=
(hasProd_subtype_iff_of_mulSupport_subset <| mulSupport_subset_iff'.2 hf).1 <| s.hasProd f
#align has_sum_sum_of_ne_finset_zero hasSum_sum_of_ne_finset_zero
@[to_additive]
theorem multipliable_of_ne_finset_one (hf : β b β s, f b = 1) : Multipliable f :=
(hasProd_prod_of_ne_finset_one hf).multipliable
#align summable_of_ne_finset_zero summable_of_ne_finset_zero
@[to_additive]
| Mathlib/Topology/Algebra/InfiniteSum/Defs.lean | 166 | 170 | theorem Multipliable.hasProd (ha : Multipliable f) : HasProd f (β' b, f b) := by |
simp only [tprod_def, ha, dite_true]
by_cases H : (mulSupport f).Finite
Β· simp [H, hasProd_prod_of_ne_finset_one, finprod_eq_prod]
Β· simpa [H] using ha.choose_spec
| [
" β' (b : Ξ²), f b = 1",
" HasProd (f β g) a β HasProd f a",
" β x β Set.range fun a => βa, f x = 1",
" HasProd (f β Subtype.val) (β b β s, f b)",
" HasProd (f β Subtype.val) (β x β s.attach, f βx)",
" HasProd f (β' (b : Ξ²), f b)",
" HasProd f (if (mulSupport fun b => f b).Finite then βαΆ (b : Ξ²), f b els... | [
" β' (b : Ξ²), f b = 1",
" HasProd (f β g) a β HasProd f a",
" β x β Set.range fun a => βa, f x = 1",
" HasProd (f β Subtype.val) (β b β s, f b)",
" HasProd (f β Subtype.val) (β x β s.attach, f βx)"
] |
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
| Mathlib/Tactic/ComputeDegree.lean | 105 | 115 | 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
| [
" (f + g).coeff n = a + b",
" (f + g).coeff n = f.coeff n + g.coeff n",
" (f * g).coeff d = if d = df + dg then a * b else 0",
" (f * g).coeff d = a * b",
" (f * g).coeff (df + dg) = f.coeff df * g.coeff dg",
" (f * g).coeff d = 0",
" (f * g).natDegree < d",
" (f * g).natDegree β€ df + dg",
" df + dg... | [
" (f + g).coeff n = a + b",
" (f + g).coeff n = f.coeff n + g.coeff n"
] |
import Mathlib.Data.Nat.Count
import Mathlib.Data.Nat.SuccPred
import Mathlib.Order.Interval.Set.Monotone
import Mathlib.Order.OrderIsoNat
#align_import data.nat.nth from "leanprover-community/mathlib"@"7fdd4f3746cb059edfdb5d52cba98f66fce418c0"
open Finset
namespace Nat
variable (p : β β Prop)
noncomputable def nth (p : β β Prop) (n : β) : β := by
classical exact
if h : Set.Finite (setOf p) then (h.toFinset.sort (Β· β€ Β·)).getD n 0
else @Nat.Subtype.orderIsoOfNat (setOf p) (Set.Infinite.to_subtype h) n
#align nat.nth Nat.nth
variable {p}
theorem nth_of_card_le (hf : (setOf p).Finite) {n : β} (hn : hf.toFinset.card β€ n) :
nth p n = 0 := by rw [nth, dif_pos hf, List.getD_eq_default]; rwa [Finset.length_sort]
#align nat.nth_of_card_le Nat.nth_of_card_le
theorem nth_eq_getD_sort (h : (setOf p).Finite) (n : β) :
nth p n = (h.toFinset.sort (Β· β€ Β·)).getD n 0 :=
dif_pos h
#align nat.nth_eq_nthd_sort Nat.nth_eq_getD_sort
| Mathlib/Data/Nat/Nth.lean | 71 | 73 | theorem nth_eq_orderEmbOfFin (hf : (setOf p).Finite) {n : β} (hn : n < hf.toFinset.card) :
nth p n = hf.toFinset.orderEmbOfFin rfl β¨n, hnβ© := by |
rw [nth_eq_getD_sort hf, Finset.orderEmbOfFin_apply, List.getD_eq_get]
| [
" β",
" nth p n = 0",
" (sort (fun x x_1 => x β€ x_1) hf.toFinset).length β€ n",
" nth p n = (hf.toFinset.orderEmbOfFin β―) β¨n, hnβ©"
] | [
" β",
" nth p n = 0",
" (sort (fun x x_1 => x β€ x_1) hf.toFinset).length β€ n"
] |
import Mathlib.Data.List.Cycle
import Mathlib.GroupTheory.Perm.Cycle.Type
import Mathlib.GroupTheory.Perm.List
#align_import group_theory.perm.cycle.concrete from "leanprover-community/mathlib"@"00638177efd1b2534fc5269363ebf42a7871df9a"
open Equiv Equiv.Perm List
variable {Ξ± : Type*}
namespace Equiv.Perm
section Fintype
variable [Fintype Ξ±] [DecidableEq Ξ±] (p : Equiv.Perm Ξ±) (x : Ξ±)
def toList : List Ξ± :=
(List.range (cycleOf p x).support.card).map fun k => (p ^ k) x
#align equiv.perm.to_list Equiv.Perm.toList
@[simp]
theorem toList_one : toList (1 : Perm Ξ±) x = [] := by simp [toList, cycleOf_one]
#align equiv.perm.to_list_one Equiv.Perm.toList_one
@[simp]
theorem toList_eq_nil_iff {p : Perm Ξ±} {x} : toList p x = [] β x β p.support := by simp [toList]
#align equiv.perm.to_list_eq_nil_iff Equiv.Perm.toList_eq_nil_iff
@[simp]
theorem length_toList : length (toList p x) = (cycleOf p x).support.card := by simp [toList]
#align equiv.perm.length_to_list Equiv.Perm.length_toList
theorem toList_ne_singleton (y : Ξ±) : toList p x β [y] := by
intro H
simpa [card_support_ne_one] using congr_arg length H
#align equiv.perm.to_list_ne_singleton Equiv.Perm.toList_ne_singleton
theorem two_le_length_toList_iff_mem_support {p : Perm Ξ±} {x : Ξ±} :
2 β€ length (toList p x) β x β p.support := by simp
#align equiv.perm.two_le_length_to_list_iff_mem_support Equiv.Perm.two_le_length_toList_iff_mem_support
theorem length_toList_pos_of_mem_support (h : x β p.support) : 0 < length (toList p x) :=
zero_lt_two.trans_le (two_le_length_toList_iff_mem_support.mpr h)
#align equiv.perm.length_to_list_pos_of_mem_support Equiv.Perm.length_toList_pos_of_mem_support
theorem get_toList (n : β) (hn : n < length (toList p x)) :
(toList p x).get β¨n, hnβ© = (p ^ n) x := by simp [toList]
theorem toList_get_zero (h : x β p.support) :
(toList p x).get β¨0, (length_toList_pos_of_mem_support _ _ h)β© = x := by simp [toList]
set_option linter.deprecated false in
@[deprecated get_toList (since := "2024-05-08")]
theorem nthLe_toList (n : β) (hn : n < length (toList p x)) :
(toList p x).nthLe n hn = (p ^ n) x := by simp [toList]
#align equiv.perm.nth_le_to_list Equiv.Perm.nthLe_toList
set_option linter.deprecated false in
@[deprecated toList_get_zero (since := "2024-05-08")]
theorem toList_nthLe_zero (h : x β p.support) :
(toList p x).nthLe 0 (length_toList_pos_of_mem_support _ _ h) = x := by simp [toList]
#align equiv.perm.to_list_nth_le_zero Equiv.Perm.toList_nthLe_zero
variable {p} {x}
theorem mem_toList_iff {y : Ξ±} : y β toList p x β SameCycle p x y β§ x β p.support := by
simp only [toList, mem_range, mem_map]
constructor
Β· rintro β¨n, hx, rflβ©
refine β¨β¨n, rflβ©, ?_β©
contrapose! hx
rw [β support_cycleOf_eq_nil_iff] at hx
simp [hx]
Β· rintro β¨h, hxβ©
simpa using h.exists_pow_eq_of_mem_support hx
#align equiv.perm.mem_to_list_iff Equiv.Perm.mem_toList_iff
set_option linter.deprecated false in
| Mathlib/GroupTheory/Perm/Cycle/Concrete.lean | 278 | 308 | theorem nodup_toList (p : Perm Ξ±) (x : Ξ±) : Nodup (toList p x) := by |
by_cases hx : p x = x
Β· rw [β not_mem_support, β toList_eq_nil_iff] at hx
simp [hx]
have hc : IsCycle (cycleOf p x) := isCycle_cycleOf p hx
rw [nodup_iff_nthLe_inj]
rintro n m hn hm
rw [length_toList, β hc.orderOf] at hm hn
rw [β cycleOf_apply_self, β Ne, β mem_support] at hx
rw [nthLe_toList, nthLe_toList, β cycleOf_pow_apply_self p x n, β
cycleOf_pow_apply_self p x m]
cases' n with n <;> cases' m with m
Β· simp
Β· rw [β hc.support_pow_of_pos_of_lt_orderOf m.zero_lt_succ hm, mem_support,
cycleOf_pow_apply_self] at hx
simp [hx.symm]
Β· rw [β hc.support_pow_of_pos_of_lt_orderOf n.zero_lt_succ hn, mem_support,
cycleOf_pow_apply_self] at hx
simp [hx]
intro h
have hn' : Β¬orderOf (p.cycleOf x) β£ n.succ := Nat.not_dvd_of_pos_of_lt n.zero_lt_succ hn
have hm' : Β¬orderOf (p.cycleOf x) β£ m.succ := Nat.not_dvd_of_pos_of_lt m.zero_lt_succ hm
rw [β hc.support_pow_eq_iff] at hn' hm'
rw [β Nat.mod_eq_of_lt hn, β Nat.mod_eq_of_lt hm, β pow_inj_mod]
refine support_congr ?_ ?_
Β· rw [hm', hn']
Β· rw [hm']
intro y hy
obtain β¨k, rflβ© := hc.exists_pow_eq (mem_support.mp hx) (mem_support.mp hy)
rw [β mul_apply, (Commute.pow_pow_self _ _ _).eq, mul_apply, h, β mul_apply, β mul_apply,
(Commute.pow_pow_self _ _ _).eq]
| [
" toList 1 x = []",
" p.toList x = [] β x β p.support",
" (p.toList x).length = (p.cycleOf x).support.card",
" p.toList x β [y]",
" False",
" 2 β€ (p.toList x).length β x β p.support",
" (p.toList x).get β¨n, hnβ© = (p ^ n) x",
" (p.toList x).get β¨0, β―β© = x",
" (p.toList x).nthLe n hn = (p ^ n) x",
"... | [
" toList 1 x = []",
" p.toList x = [] β x β p.support",
" (p.toList x).length = (p.cycleOf x).support.card",
" p.toList x β [y]",
" False",
" 2 β€ (p.toList x).length β x β p.support",
" (p.toList x).get β¨n, hnβ© = (p ^ n) x",
" (p.toList x).get β¨0, β―β© = x",
" (p.toList x).nthLe n hn = (p ^ n) x",
"... |
import Mathlib.Algebra.Algebra.Equiv
import Mathlib.Algebra.Algebra.NonUnitalHom
import Mathlib.Algebra.BigOperators.Finsupp
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Finsupp.Basic
import Mathlib.LinearAlgebra.Finsupp
#align_import algebra.monoid_algebra.basic from "leanprover-community/mathlib"@"949dc57e616a621462062668c9f39e4e17b64b69"
noncomputable section
open Finset
open Finsupp hiding single mapDomain
universe uβ uβ uβ uβ
variable (k : Type uβ) (G : Type uβ) (H : Type*) {R : Type*}
section
variable [Semiring k]
def MonoidAlgebra : Type max uβ uβ :=
G ββ k
#align monoid_algebra MonoidAlgebra
-- Porting note: The compiler couldn't derive this.
instance MonoidAlgebra.inhabited : Inhabited (MonoidAlgebra k G) :=
inferInstanceAs (Inhabited (G ββ k))
#align monoid_algebra.inhabited MonoidAlgebra.inhabited
-- Porting note: The compiler couldn't derive this.
instance MonoidAlgebra.addCommMonoid : AddCommMonoid (MonoidAlgebra k G) :=
inferInstanceAs (AddCommMonoid (G ββ k))
#align monoid_algebra.add_comm_monoid MonoidAlgebra.addCommMonoid
instance MonoidAlgebra.instIsCancelAdd [IsCancelAdd k] : IsCancelAdd (MonoidAlgebra k G) :=
inferInstanceAs (IsCancelAdd (G ββ k))
instance MonoidAlgebra.coeFun : CoeFun (MonoidAlgebra k G) fun _ => G β k :=
Finsupp.instCoeFun
#align monoid_algebra.has_coe_to_fun MonoidAlgebra.coeFun
end
namespace MonoidAlgebra
variable {k G}
section
variable [Semiring k] [NonUnitalNonAssocSemiring R]
-- Porting note: `reducible` cannot be `local`, so we replace some definitions and theorems with
-- new ones which have new types.
abbrev single (a : G) (b : k) : MonoidAlgebra k G := Finsupp.single a b
theorem single_zero (a : G) : (single a 0 : MonoidAlgebra k G) = 0 := Finsupp.single_zero a
theorem single_add (a : G) (bβ bβ : k) : single a (bβ + bβ) = single a bβ + single a bβ :=
Finsupp.single_add a bβ bβ
@[simp]
theorem sum_single_index {N} [AddCommMonoid N] {a : G} {b : k} {h : G β k β N}
(h_zero : h a 0 = 0) :
(single a b).sum h = h a b := Finsupp.sum_single_index h_zero
@[simp]
theorem sum_single (f : MonoidAlgebra k G) : f.sum single = f :=
Finsupp.sum_single f
theorem single_apply {a a' : G} {b : k} [Decidable (a = a')] :
single a b a' = if a = a' then b else 0 :=
Finsupp.single_apply
@[simp]
theorem single_eq_zero {a : G} {b : k} : single a b = 0 β b = 0 := Finsupp.single_eq_zero
abbrev mapDomain {G' : Type*} (f : G β G') (v : MonoidAlgebra k G) : MonoidAlgebra k G' :=
Finsupp.mapDomain f v
theorem mapDomain_sum {k' G' : Type*} [Semiring k'] {f : G β G'} {s : MonoidAlgebra k' G}
{v : G β k' β MonoidAlgebra k G} :
mapDomain f (s.sum v) = s.sum fun a b => mapDomain f (v a b) :=
Finsupp.mapDomain_sum
def liftNC (f : k β+ R) (g : G β R) : MonoidAlgebra k G β+ R :=
liftAddHom fun x : G => (AddMonoidHom.mulRight (g x)).comp f
#align monoid_algebra.lift_nc MonoidAlgebra.liftNC
@[simp]
theorem liftNC_single (f : k β+ R) (g : G β R) (a : G) (b : k) :
liftNC f g (single a b) = f b * g a :=
liftAddHom_apply_single _ _ _
#align monoid_algebra.lift_nc_single MonoidAlgebra.liftNC_single
end
section Mul
variable [Semiring k] [Mul G]
@[irreducible] def mul' (f g : MonoidAlgebra k G) : MonoidAlgebra k G :=
f.sum fun aβ bβ => g.sum fun aβ bβ => single (aβ * aβ) (bβ * bβ)
instance instMul : Mul (MonoidAlgebra k G) := β¨MonoidAlgebra.mul'β©
#align monoid_algebra.has_mul MonoidAlgebra.instMul
theorem mul_def {f g : MonoidAlgebra k G} :
f * g = f.sum fun aβ bβ => g.sum fun aβ bβ => single (aβ * aβ) (bβ * bβ) := by
with_unfolding_all rfl
#align monoid_algebra.mul_def MonoidAlgebra.mul_def
instance nonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
{ Finsupp.instAddCommMonoid with
-- Porting note: `refine` & `exact` are required because `simp` behaves differently.
left_distrib := fun f g h => by
haveI := Classical.decEq G
simp only [mul_def]
refine Eq.trans (congr_arg (sum f) (funextβ fun aβ bβ => sum_add_index ?_ ?_)) ?_ <;>
simp only [mul_add, mul_zero, single_zero, single_add, forall_true_iff, sum_add]
right_distrib := fun f g h => by
haveI := Classical.decEq G
simp only [mul_def]
refine Eq.trans (sum_add_index ?_ ?_) ?_ <;>
simp only [add_mul, zero_mul, single_zero, single_add, forall_true_iff, sum_zero, sum_add]
zero_mul := fun f => by
simp only [mul_def]
exact sum_zero_index
mul_zero := fun f => by
simp only [mul_def]
exact Eq.trans (congr_arg (sum f) (funextβ fun aβ bβ => sum_zero_index)) sum_zero }
#align monoid_algebra.non_unital_non_assoc_semiring MonoidAlgebra.nonUnitalNonAssocSemiring
variable [Semiring R]
| Mathlib/Algebra/MonoidAlgebra/Basic.lean | 202 | 210 | theorem liftNC_mul {g_hom : Type*} [FunLike g_hom G R] [MulHomClass g_hom G R]
(f : k β+* R) (g : g_hom) (a b : MonoidAlgebra k G)
(h_comm : β {x y}, y β a.support β Commute (f (b x)) (g y)) :
liftNC (f : k β+ R) g (a * b) = liftNC (f : k β+ R) g a * liftNC (f : k β+ R) g b := by |
conv_rhs => rw [β sum_single a, β sum_single b]
-- Porting note: `(liftNC _ g).map_finsupp_sum` β `map_finsupp_sum`
simp_rw [mul_def, map_finsupp_sum, liftNC_single, Finsupp.sum_mul, Finsupp.mul_sum]
refine Finset.sum_congr rfl fun y hy => Finset.sum_congr rfl fun x _hx => ?_
simp [mul_assoc, (h_comm hy).left_comm]
| [
" f * g = sum f fun aβ bβ => sum g fun aβ bβ => single (aβ * aβ) (bβ * bβ)",
" f * (g + h) = f * g + f * h",
" (sum f fun aβ bβ => sum (g + h) fun aβ bβ => single (aβ * aβ) (bβ * bβ)) =\n (sum f fun aβ bβ => sum g fun aβ bβ => single (aβ * aβ) (bβ * bβ)) +\n sum f fun aβ bβ => sum h fun aβ bβ => single ... | [
" f * g = sum f fun aβ bβ => sum g fun aβ bβ => single (aβ * aβ) (bβ * bβ)",
" f * (g + h) = f * g + f * h",
" (sum f fun aβ bβ => sum (g + h) fun aβ bβ => single (aβ * aβ) (bβ * bβ)) =\n (sum f fun aβ bβ => sum g fun aβ bβ => single (aβ * aβ) (bβ * bβ)) +\n sum f fun aβ bβ => sum h fun aβ bβ => single ... |
import Mathlib.Analysis.Calculus.FDeriv.Prod
import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv
import Mathlib.LinearAlgebra.Dual
#align_import analysis.calculus.lagrange_multipliers from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Filter Set
open scoped Topology Filter
variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E]
[NormedAddCommGroup F] [NormedSpace β F] [CompleteSpace F] {f : E β F} {Ο : E β β} {xβ : E}
{f' : E βL[β] F} {Ο' : E βL[β] β}
theorem IsLocalExtrOn.range_ne_top_of_hasStrictFDerivAt
(hextr : IsLocalExtrOn Ο {x | f x = f xβ} xβ) (hf' : HasStrictFDerivAt f f' xβ)
(hΟ' : HasStrictFDerivAt Ο Ο' xβ) : LinearMap.range (f'.prod Ο') β β€ := by
intro htop
set fΟ := fun x => (f x, Ο x)
have A : map Ο (π[f β»ΒΉ' {f xβ}] xβ) = π (Ο xβ) := by
change map (Prod.snd β fΟ) (π[fΟ β»ΒΉ' {p | p.1 = f xβ}] xβ) = π (Ο xβ)
rw [β map_map, nhdsWithin, map_inf_principal_preimage, (hf'.prod hΟ').map_nhds_eq_of_surj htop]
exact map_snd_nhdsWithin _
exact hextr.not_nhds_le_map A.ge
#align is_local_extr_on.range_ne_top_of_has_strict_fderiv_at IsLocalExtrOn.range_ne_top_of_hasStrictFDerivAt
theorem IsLocalExtrOn.exists_linear_map_of_hasStrictFDerivAt
(hextr : IsLocalExtrOn Ο {x | f x = f xβ} xβ) (hf' : HasStrictFDerivAt f f' xβ)
(hΟ' : HasStrictFDerivAt Ο Ο' xβ) :
β (Ξ : Module.Dual β F) (Ξβ : β), (Ξ, Ξβ) β 0 β§ β x, Ξ (f' x) + Ξβ β’ Ο' x = 0 := by
rcases Submodule.exists_le_ker_of_lt_top _
(lt_top_iff_ne_top.2 <| hextr.range_ne_top_of_hasStrictFDerivAt hf' hΟ') with
β¨Ξ', h0, hΞ'β©
set e : ((F ββ[β] β) Γ β) ββ[β] F Γ β ββ[β] β :=
((LinearEquiv.refl β (F ββ[β] β)).prod (LinearMap.ringLmapEquivSelf β β β).symm).trans
(LinearMap.coprodEquiv β)
rcases e.surjective Ξ' with β¨β¨Ξ, Ξββ©, rflβ©
refine β¨Ξ, Ξβ, e.map_ne_zero_iff.1 h0, fun x => ?_β©
convert LinearMap.congr_fun (LinearMap.range_le_ker_iff.1 hΞ') x using 1
-- squeezed `simp [mul_comm]` to speed up elaboration
simp only [e, smul_eq_mul, LinearEquiv.trans_apply, LinearEquiv.prod_apply,
LinearEquiv.refl_apply, LinearMap.ringLmapEquivSelf_symm_apply, LinearMap.coprodEquiv_apply,
ContinuousLinearMap.coe_prod, LinearMap.coprod_comp_prod, LinearMap.add_apply,
LinearMap.coe_comp, ContinuousLinearMap.coe_coe, Function.comp_apply, LinearMap.coe_smulRight,
LinearMap.one_apply, mul_comm]
#align is_local_extr_on.exists_linear_map_of_has_strict_fderiv_at IsLocalExtrOn.exists_linear_map_of_hasStrictFDerivAt
| Mathlib/Analysis/Calculus/LagrangeMultipliers.lean | 84 | 97 | theorem IsLocalExtrOn.exists_multipliers_of_hasStrictFDerivAt_1d {f : E β β} {f' : E βL[β] β}
(hextr : IsLocalExtrOn Ο {x | f x = f xβ} xβ) (hf' : HasStrictFDerivAt f f' xβ)
(hΟ' : HasStrictFDerivAt Ο Ο' xβ) : β a b : β, (a, b) β 0 β§ a β’ f' + b β’ Ο' = 0 := by |
obtain β¨Ξ, Ξβ, hΞ, hfΞβ© := hextr.exists_linear_map_of_hasStrictFDerivAt hf' hΟ'
refine β¨Ξ 1, Ξβ, ?_, ?_β©
Β· contrapose! hΞ
simp only [Prod.mk_eq_zero] at hΞ β’
refine β¨LinearMap.ext fun x => ?_, hΞ.2β©
simpa [hΞ.1] using Ξ.map_smul x 1
Β· ext x
have Hβ : Ξ (f' x) = f' x * Ξ 1 := by
simpa only [mul_one, Algebra.id.smul_eq_mul] using Ξ.map_smul (f' x) 1
have Hβ : f' x * Ξ 1 + Ξβ * Ο' x = 0 := by simpa only [Algebra.id.smul_eq_mul, Hβ] using hfΞ x
simpa [mul_comm] using Hβ
| [
" LinearMap.range (f'.prod Ο') β β€",
" False",
" map Ο (π[f β»ΒΉ' {f xβ}] xβ) = π (Ο xβ)",
" map (Prod.snd β fΟ) (π[fΟ β»ΒΉ' {p | p.1 = f xβ}] xβ) = π (Ο xβ)",
" map Prod.snd (π (f xβ, Ο xβ) β π {p | p.1 = f xβ}) = π (Ο xβ)",
" β Ξ Ξβ, (Ξ, Ξβ) β 0 β§ β (x : E), Ξ (f' x) + Ξβ β’ Ο' x = 0",
" Ξ (f' x) + ... | [
" LinearMap.range (f'.prod Ο') β β€",
" False",
" map Ο (π[f β»ΒΉ' {f xβ}] xβ) = π (Ο xβ)",
" map (Prod.snd β fΟ) (π[fΟ β»ΒΉ' {p | p.1 = f xβ}] xβ) = π (Ο xβ)",
" map Prod.snd (π (f xβ, Ο xβ) β π {p | p.1 = f xβ}) = π (Ο xβ)",
" β Ξ Ξβ, (Ξ, Ξβ) β 0 β§ β (x : E), Ξ (f' x) + Ξβ β’ Ο' x = 0",
" Ξ (f' x) + ... |
import Mathlib.Analysis.SpecialFunctions.Log.Base
import Mathlib.MeasureTheory.Measure.MeasureSpaceDef
#align_import measure_theory.measure.doubling from "leanprover-community/mathlib"@"5f6e827d81dfbeb6151d7016586ceeb0099b9655"
noncomputable section
open Set Filter Metric MeasureTheory TopologicalSpace ENNReal NNReal Topology
class IsUnifLocDoublingMeasure {Ξ± : Type*} [MetricSpace Ξ±] [MeasurableSpace Ξ±]
(ΞΌ : Measure Ξ±) : Prop where
exists_measure_closedBall_le_mul'' :
β C : ββ₯0, βαΆ Ξ΅ in π[>] 0, β x, ΞΌ (closedBall x (2 * Ξ΅)) β€ C * ΞΌ (closedBall x Ξ΅)
#align is_unif_loc_doubling_measure IsUnifLocDoublingMeasure
namespace IsUnifLocDoublingMeasure
variable {Ξ± : Type*} [MetricSpace Ξ±] [MeasurableSpace Ξ±] (ΞΌ : Measure Ξ±)
[IsUnifLocDoublingMeasure ΞΌ]
-- Porting note: added for missing infer kinds
theorem exists_measure_closedBall_le_mul :
β C : ββ₯0, βαΆ Ξ΅ in π[>] 0, β x, ΞΌ (closedBall x (2 * Ξ΅)) β€ C * ΞΌ (closedBall x Ξ΅) :=
exists_measure_closedBall_le_mul''
def doublingConstant : ββ₯0 :=
Classical.choose <| exists_measure_closedBall_le_mul ΞΌ
#align is_unif_loc_doubling_measure.doubling_constant IsUnifLocDoublingMeasure.doublingConstant
theorem exists_measure_closedBall_le_mul' :
βαΆ Ξ΅ in π[>] 0, β x, ΞΌ (closedBall x (2 * Ξ΅)) β€ doublingConstant ΞΌ * ΞΌ (closedBall x Ξ΅) :=
Classical.choose_spec <| exists_measure_closedBall_le_mul ΞΌ
#align is_unif_loc_doubling_measure.exists_measure_closed_ball_le_mul' IsUnifLocDoublingMeasure.exists_measure_closedBall_le_mul'
theorem exists_eventually_forall_measure_closedBall_le_mul (K : β) :
β C : ββ₯0, βαΆ Ξ΅ in π[>] 0, β x, β t β€ K, ΞΌ (closedBall x (t * Ξ΅)) β€ C * ΞΌ (closedBall x Ξ΅) := by
let C := doublingConstant ΞΌ
have hΞΌ :
β n : β, βαΆ Ξ΅ in π[>] 0, β x,
ΞΌ (closedBall x ((2 : β) ^ n * Ξ΅)) β€ β(C ^ n) * ΞΌ (closedBall x Ξ΅) := by
intro n
induction' n with n ih
Β· simp
replace ih := eventually_nhdsWithin_pos_mul_left (two_pos : 0 < (2 : β)) ih
refine (ih.and (exists_measure_closedBall_le_mul' ΞΌ)).mono fun Ξ΅ hΞ΅ x => ?_
calc
ΞΌ (closedBall x ((2 : β) ^ (n + 1) * Ξ΅)) = ΞΌ (closedBall x ((2 : β) ^ n * (2 * Ξ΅))) := by
rw [pow_succ, mul_assoc]
_ β€ β(C ^ n) * ΞΌ (closedBall x (2 * Ξ΅)) := hΞ΅.1 x
_ β€ β(C ^ n) * (C * ΞΌ (closedBall x Ξ΅)) := by gcongr; exact hΞ΅.2 x
_ = β(C ^ (n + 1)) * ΞΌ (closedBall x Ξ΅) := by rw [β mul_assoc, pow_succ, ENNReal.coe_mul]
rcases lt_or_le K 1 with (hK | hK)
Β· refine β¨1, ?_β©
simp only [ENNReal.coe_one, one_mul]
refine eventually_mem_nhdsWithin.mono fun Ξ΅ hΞ΅ x t ht β¦ ?_
gcongr
nlinarith [mem_Ioi.mp hΞ΅]
Β· use C ^ βReal.logb 2 Kββ
filter_upwards [hΞΌ βReal.logb 2 Kββ, eventually_mem_nhdsWithin] with Ξ΅ hΞ΅ hΞ΅β x t ht
refine le_trans ?_ (hΞ΅ x)
gcongr
Β· exact (mem_Ioi.mp hΞ΅β).le
Β· refine ht.trans ?_
rw [β Real.rpow_natCast, β Real.logb_le_iff_le_rpow]
exacts [Nat.le_ceil _, by norm_num, by linarith]
#align is_unif_loc_doubling_measure.exists_eventually_forall_measure_closed_ball_le_mul IsUnifLocDoublingMeasure.exists_eventually_forall_measure_closedBall_le_mul
def scalingConstantOf (K : β) : ββ₯0 :=
max (Classical.choose <| exists_eventually_forall_measure_closedBall_le_mul ΞΌ K) 1
#align is_unif_loc_doubling_measure.scaling_constant_of IsUnifLocDoublingMeasure.scalingConstantOf
@[simp]
theorem one_le_scalingConstantOf (K : β) : 1 β€ scalingConstantOf ΞΌ K :=
le_max_of_le_right <| le_refl 1
#align is_unif_loc_doubling_measure.one_le_scaling_constant_of IsUnifLocDoublingMeasure.one_le_scalingConstantOf
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : β) :
β R : β,
0 < R β§
β x t r, t β Ioc 0 K β r β€ R β
ΞΌ (closedBall x (t * r)) β€ scalingConstantOf ΞΌ K * ΞΌ (closedBall x r) := by
have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul ΞΌ K)
rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with β¨R, Rpos, hRβ©
refine β¨R, Rpos, fun x t r ht hr => ?_β©
rcases lt_trichotomy r 0 with (rneg | rfl | rpos)
Β· have : t * r < 0 := mul_neg_of_pos_of_neg ht.1 rneg
simp only [closedBall_eq_empty.2 this, measure_empty, zero_le']
Β· simp only [mul_zero, closedBall_zero]
refine le_mul_of_one_le_of_le ?_ le_rfl
apply ENNReal.one_le_coe_iff.2 (le_max_right _ _)
Β· apply (hR β¨rpos, hrβ© x t ht.2).trans
gcongr
apply le_max_left
#align is_unif_loc_doubling_measure.eventually_measure_mul_le_scaling_constant_of_mul IsUnifLocDoublingMeasure.eventually_measure_mul_le_scalingConstantOf_mul
| Mathlib/MeasureTheory/Measure/Doubling.lean | 132 | 136 | theorem eventually_measure_le_scaling_constant_mul (K : β) :
βαΆ r in π[>] 0, β x, ΞΌ (closedBall x (K * r)) β€ scalingConstantOf ΞΌ K * ΞΌ (closedBall x r) := by |
filter_upwards [Classical.choose_spec
(exists_eventually_forall_measure_closedBall_le_mul ΞΌ K)] with r hr x
exact (hr x K le_rfl).trans (mul_le_mul_right' (ENNReal.coe_le_coe.2 (le_max_left _ _)) _)
| [
" β C, βαΆ (Ξ΅ : β) in π[>] 0, β (x : Ξ±), β t β€ K, ΞΌ (closedBall x (t * Ξ΅)) β€ βC * ΞΌ (closedBall x Ξ΅)",
" β (n : β), βαΆ (Ξ΅ : β) in π[>] 0, β (x : Ξ±), ΞΌ (closedBall x (2 ^ n * Ξ΅)) β€ β(C ^ n) * ΞΌ (closedBall x Ξ΅)",
" βαΆ (Ξ΅ : β) in π[>] 0, β (x : Ξ±), ΞΌ (closedBall x (2 ^ n * Ξ΅)) β€ β(C ^ n) * ΞΌ (closedBall x Ξ΅)",
... | [
" β C, βαΆ (Ξ΅ : β) in π[>] 0, β (x : Ξ±), β t β€ K, ΞΌ (closedBall x (t * Ξ΅)) β€ βC * ΞΌ (closedBall x Ξ΅)",
" β (n : β), βαΆ (Ξ΅ : β) in π[>] 0, β (x : Ξ±), ΞΌ (closedBall x (2 ^ n * Ξ΅)) β€ β(C ^ n) * ΞΌ (closedBall x Ξ΅)",
" βαΆ (Ξ΅ : β) in π[>] 0, β (x : Ξ±), ΞΌ (closedBall x (2 ^ n * Ξ΅)) β€ β(C ^ n) * ΞΌ (closedBall x Ξ΅)",
... |
import Mathlib.Data.List.Nodup
import Mathlib.Data.List.Zip
import Mathlib.Data.Nat.Defs
import Mathlib.Data.List.Infix
#align_import data.list.rotate from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u
variable {Ξ± : Type u}
open Nat Function
namespace List
theorem rotate_mod (l : List Ξ±) (n : β) : l.rotate (n % l.length) = l.rotate n := by simp [rotate]
#align list.rotate_mod List.rotate_mod
@[simp]
theorem rotate_nil (n : β) : ([] : List Ξ±).rotate n = [] := by simp [rotate]
#align list.rotate_nil List.rotate_nil
@[simp]
| Mathlib/Data/List/Rotate.lean | 45 | 45 | theorem rotate_zero (l : List Ξ±) : l.rotate 0 = l := by | simp [rotate]
| [
" l.rotate (n % l.length) = l.rotate n",
" [].rotate n = []",
" l.rotate 0 = l"
] | [
" l.rotate (n % l.length) = l.rotate n",
" [].rotate n = []"
] |
import Mathlib.Analysis.Convex.Hull
#align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8"
open Set
variable {ΞΉ : Sort*} {π E : Type*}
section OrderedSemiring
variable (π) [OrderedSemiring π] [AddCommMonoid E] [Module π E] {s t sβ sβ tβ tβ u : Set E}
{x y : E}
def convexJoin (s t : Set E) : Set E :=
β (x β s) (y β t), segment π x y
#align convex_join convexJoin
variable {π}
theorem mem_convexJoin : x β convexJoin π s t β β a β s, β b β t, x β segment π a b := by
simp [convexJoin]
#align mem_convex_join mem_convexJoin
theorem convexJoin_comm (s t : Set E) : convexJoin π s t = convexJoin π t s :=
(iUnionβ_comm _).trans <| by simp_rw [convexJoin, segment_symm]
#align convex_join_comm convexJoin_comm
theorem convexJoin_mono (hs : sβ β sβ) (ht : tβ β tβ) : convexJoin π sβ tβ β convexJoin π sβ tβ :=
biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht
#align convex_join_mono convexJoin_mono
theorem convexJoin_mono_left (hs : sβ β sβ) : convexJoin π sβ t β convexJoin π sβ t :=
convexJoin_mono hs Subset.rfl
#align convex_join_mono_left convexJoin_mono_left
theorem convexJoin_mono_right (ht : tβ β tβ) : convexJoin π s tβ β convexJoin π s tβ :=
convexJoin_mono Subset.rfl ht
#align convex_join_mono_right convexJoin_mono_right
@[simp]
theorem convexJoin_empty_left (t : Set E) : convexJoin π β
t = β
:= by simp [convexJoin]
#align convex_join_empty_left convexJoin_empty_left
@[simp]
theorem convexJoin_empty_right (s : Set E) : convexJoin π s β
= β
:= by simp [convexJoin]
#align convex_join_empty_right convexJoin_empty_right
@[simp]
theorem convexJoin_singleton_left (t : Set E) (x : E) :
convexJoin π {x} t = β y β t, segment π x y := by simp [convexJoin]
#align convex_join_singleton_left convexJoin_singleton_left
@[simp]
theorem convexJoin_singleton_right (s : Set E) (y : E) :
convexJoin π s {y} = β x β s, segment π x y := by simp [convexJoin]
#align convex_join_singleton_right convexJoin_singleton_right
-- Porting note (#10618): simp can prove it
| Mathlib/Analysis/Convex/Join.lean | 75 | 75 | theorem convexJoin_singletons (x : E) : convexJoin π {x} {y} = segment π x y := by | simp
| [
" x β convexJoin π s t β β a β s, β b β t, x β segment π a b",
" β iβ β t, β iβ β s, segment π iβ iβ = convexJoin π t s",
" convexJoin π β
t = β
",
" convexJoin π s β
= β
",
" convexJoin π {x} t = β y β t, segment π x y",
" convexJoin π s {y} = β x β s, segment π x y",
" convexJoin π {x} {y} = ... | [
" x β convexJoin π s t β β a β s, β b β t, x β segment π a b",
" β iβ β t, β iβ β s, segment π iβ iβ = convexJoin π t s",
" convexJoin π β
t = β
",
" convexJoin π s β
= β
",
" convexJoin π {x} t = β y β t, segment π x y",
" convexJoin π s {y} = β x β s, segment π x y"
] |
import Mathlib.Control.Functor.Multivariate
import Mathlib.Data.PFunctor.Univariate.Basic
#align_import data.pfunctor.multivariate.basic from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
universe u v
open MvFunctor
@[pp_with_univ]
structure MvPFunctor (n : β) where
A : Type u
B : A β TypeVec.{u} n
#align mvpfunctor MvPFunctor
namespace MvPFunctor
open MvFunctor (LiftP LiftR)
variable {n m : β} (P : MvPFunctor.{u} n)
@[coe]
def Obj (Ξ± : TypeVec.{u} n) : Type u :=
Ξ£ a : P.A, P.B a βΉ Ξ±
#align mvpfunctor.obj MvPFunctor.Obj
instance : CoeFun (MvPFunctor.{u} n) (fun _ => TypeVec.{u} n β Type u) where
coe := Obj
def map {Ξ± Ξ² : TypeVec n} (f : Ξ± βΉ Ξ²) : P Ξ± β P Ξ² := fun β¨a, gβ© => β¨a, TypeVec.comp f gβ©
#align mvpfunctor.map MvPFunctor.map
instance : Inhabited (MvPFunctor n) :=
β¨β¨default, defaultβ©β©
instance Obj.inhabited {Ξ± : TypeVec n} [Inhabited P.A] [β i, Inhabited (Ξ± i)] :
Inhabited (P Ξ±) :=
β¨β¨default, fun _ _ => defaultβ©β©
#align mvpfunctor.obj.inhabited MvPFunctor.Obj.inhabited
instance : MvFunctor.{u} P.Obj :=
β¨@MvPFunctor.map n Pβ©
theorem map_eq {Ξ± Ξ² : TypeVec n} (g : Ξ± βΉ Ξ²) (a : P.A) (f : P.B a βΉ Ξ±) :
@MvFunctor.map _ P.Obj _ _ _ g β¨a, fβ© = β¨a, g β fβ© :=
rfl
#align mvpfunctor.map_eq MvPFunctor.map_eq
theorem id_map {Ξ± : TypeVec n} : β x : P Ξ±, TypeVec.id <$$> x = x
| β¨_, _β© => rfl
#align mvpfunctor.id_map MvPFunctor.id_map
theorem comp_map {Ξ± Ξ² Ξ³ : TypeVec n} (f : Ξ± βΉ Ξ²) (g : Ξ² βΉ Ξ³) :
β x : P Ξ±, (g β f) <$$> x = g <$$> f <$$> x
| β¨_, _β© => rfl
#align mvpfunctor.comp_map MvPFunctor.comp_map
instance : LawfulMvFunctor.{u} P.Obj where
id_map := @id_map _ P
comp_map := @comp_map _ P
def const (n : β) (A : Type u) : MvPFunctor n :=
{ A
B := fun _ _ => PEmpty }
#align mvpfunctor.const MvPFunctor.const
def comp (P : MvPFunctor.{u} n) (Q : Fin2 n β MvPFunctor.{u} m) : MvPFunctor m where
A := Ξ£ aβ : P.1, β i, P.2 aβ i β (Q i).1
B a i := Ξ£(j : _) (b : P.2 a.1 j), (Q j).2 (a.snd j b) i
#align mvpfunctor.comp MvPFunctor.comp
variable {P} {Q : Fin2 n β MvPFunctor.{u} m} {Ξ± Ξ² : TypeVec.{u} m}
def comp.mk (x : P (fun i => Q i Ξ±)) : comp P Q Ξ± :=
β¨β¨x.1, fun _ a => (x.2 _ a).1β©, fun i a => (x.snd a.fst a.snd.fst).snd i a.snd.sndβ©
#align mvpfunctor.comp.mk MvPFunctor.comp.mk
def comp.get (x : comp P Q Ξ±) : P (fun i => Q i Ξ±) :=
β¨x.1.1, fun i a => β¨x.fst.snd i a, fun (j : Fin2 m) (b : (Q i).B _ j) => x.snd j β¨i, β¨a, bβ©β©β©β©
#align mvpfunctor.comp.get MvPFunctor.comp.get
theorem comp.get_map (f : Ξ± βΉ Ξ²) (x : comp P Q Ξ±) :
comp.get (f <$$> x) = (fun i (x : Q i Ξ±) => f <$$> x) <$$> comp.get x := by
rfl
#align mvpfunctor.comp.get_map MvPFunctor.comp.get_map
@[simp]
| Mathlib/Data/PFunctor/Multivariate/Basic.lean | 148 | 149 | theorem comp.get_mk (x : P (fun i => Q i Ξ±)) : comp.get (comp.mk x) = x := by |
rfl
| [
" get (f <$$> x) = (fun i x => f <$$> x) <$$> get x",
" get (mk x) = x"
] | [
" get (f <$$> x) = (fun i x => f <$$> x) <$$> get x"
] |
import Mathlib.Geometry.Euclidean.Sphere.Basic
#align_import geometry.euclidean.sphere.second_inter from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open RealInnerProductSpace
namespace EuclideanGeometry
variable {V : Type*} {P : Type*} [NormedAddCommGroup V] [InnerProductSpace β V] [MetricSpace P]
[NormedAddTorsor V P]
def Sphere.secondInter (s : Sphere P) (p : P) (v : V) : P :=
(-2 * βͺv, p -α΅₯ s.centerβ« / βͺv, vβ«) β’ v +α΅₯ p
#align euclidean_geometry.sphere.second_inter EuclideanGeometry.Sphere.secondInter
@[simp]
theorem Sphere.secondInter_dist (s : Sphere P) (p : P) (v : V) :
dist (s.secondInter p v) s.center = dist p s.center := by
rw [Sphere.secondInter]
by_cases hv : v = 0; Β· simp [hv]
rw [dist_smul_vadd_eq_dist _ _ hv]
exact Or.inr rfl
#align euclidean_geometry.sphere.second_inter_dist EuclideanGeometry.Sphere.secondInter_dist
@[simp]
| Mathlib/Geometry/Euclidean/Sphere/SecondInter.lean | 54 | 55 | theorem Sphere.secondInter_mem {s : Sphere P} {p : P} (v : V) : s.secondInter p v β s β p β s := by |
simp_rw [mem_sphere, Sphere.secondInter_dist]
| [
" dist (s.secondInter p v) s.center = dist p s.center",
" dist ((-2 * βͺv, p -α΅₯ s.centerβ«_β / βͺv, vβ«_β) β’ v +α΅₯ p) s.center = dist p s.center",
" -2 * βͺv, p -α΅₯ s.centerβ«_β / βͺv, vβ«_β = 0 β¨ -2 * βͺv, p -α΅₯ s.centerβ«_β / βͺv, vβ«_β = -2 * βͺv, p -α΅₯ s.centerβ«_β / βͺv, vβ«_β",
" s.secondInter p v β s β p β s"
] | [
" dist (s.secondInter p v) s.center = dist p s.center",
" dist ((-2 * βͺv, p -α΅₯ s.centerβ«_β / βͺv, vβ«_β) β’ v +α΅₯ p) s.center = dist p s.center",
" -2 * βͺv, p -α΅₯ s.centerβ«_β / βͺv, vβ«_β = 0 β¨ -2 * βͺv, p -α΅₯ s.centerβ«_β / βͺv, vβ«_β = -2 * βͺv, p -α΅₯ s.centerβ«_β / βͺv, vβ«_β"
] |
import Mathlib.Algebra.Order.Ring.Abs
import Mathlib.Tactic.Ring
#align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
def hyperoperation : β β β β β β β
| 0, _, k => k + 1
| 1, m, 0 => m
| 2, _, 0 => 0
| _ + 3, _, 0 => 1
| n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k)
#align hyperoperation hyperoperation
-- Basic hyperoperation lemmas
@[simp]
theorem hyperoperation_zero (m : β) : hyperoperation 0 m = Nat.succ :=
funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one]
#align hyperoperation_zero hyperoperation_zero
theorem hyperoperation_ge_three_eq_one (n m : β) : hyperoperation (n + 3) m 0 = 1 := by
rw [hyperoperation]
#align hyperoperation_ge_three_eq_one hyperoperation_ge_three_eq_one
theorem hyperoperation_recursion (n m k : β) :
hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k) := by
rw [hyperoperation]
#align hyperoperation_recursion hyperoperation_recursion
-- Interesting hyperoperation lemmas
@[simp]
theorem hyperoperation_one : hyperoperation 1 = (Β· + Β·) := by
ext m k
induction' k with bn bih
Β· rw [Nat.add_zero m, hyperoperation]
Β· rw [hyperoperation_recursion, bih, hyperoperation_zero]
exact Nat.add_assoc m bn 1
#align hyperoperation_one hyperoperation_one
@[simp]
theorem hyperoperation_two : hyperoperation 2 = (Β· * Β·) := by
ext m k
induction' k with bn bih
Β· rw [hyperoperation]
exact (Nat.mul_zero m).symm
Β· rw [hyperoperation_recursion, hyperoperation_one, bih]
-- Porting note: was `ring`
dsimp only
nth_rewrite 1 [β mul_one m]
rw [β mul_add, add_comm]
#align hyperoperation_two hyperoperation_two
@[simp]
theorem hyperoperation_three : hyperoperation 3 = (Β· ^ Β·) := by
ext m k
induction' k with bn bih
Β· rw [hyperoperation_ge_three_eq_one]
exact (pow_zero m).symm
Β· rw [hyperoperation_recursion, hyperoperation_two, bih]
exact (pow_succ' m bn).symm
#align hyperoperation_three hyperoperation_three
theorem hyperoperation_ge_two_eq_self (n m : β) : hyperoperation (n + 2) m 1 = m := by
induction' n with nn nih
Β· rw [hyperoperation_two]
ring
Β· rw [hyperoperation_recursion, hyperoperation_ge_three_eq_one, nih]
#align hyperoperation_ge_two_eq_self hyperoperation_ge_two_eq_self
theorem hyperoperation_two_two_eq_four (n : β) : hyperoperation (n + 1) 2 2 = 4 := by
induction' n with nn nih
Β· rw [hyperoperation_one]
Β· rw [hyperoperation_recursion, hyperoperation_ge_two_eq_self, nih]
#align hyperoperation_two_two_eq_four hyperoperation_two_two_eq_four
theorem hyperoperation_ge_three_one (n : β) : β k : β, hyperoperation (n + 3) 1 k = 1 := by
induction' n with nn nih
Β· intro k
rw [hyperoperation_three]
dsimp
rw [one_pow]
Β· intro k
cases k
Β· rw [hyperoperation_ge_three_eq_one]
Β· rw [hyperoperation_recursion, nih]
#align hyperoperation_ge_three_one hyperoperation_ge_three_one
| Mathlib/Data/Nat/Hyperoperation.lean | 116 | 126 | theorem hyperoperation_ge_four_zero (n k : β) :
hyperoperation (n + 4) 0 k = if Even k then 1 else 0 := by |
induction' k with kk kih
Β· rw [hyperoperation_ge_three_eq_one]
simp only [Nat.zero_eq, even_zero, if_true]
Β· rw [hyperoperation_recursion]
rw [kih]
simp_rw [Nat.even_add_one]
split_ifs
Β· exact hyperoperation_ge_two_eq_self (n + 1) 0
Β· exact hyperoperation_ge_three_eq_one n 0
| [
" hyperoperation 0 m k = k.succ",
" hyperoperation (n + 3) m 0 = 1",
" hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k)",
" hyperoperation 1 = fun x x_1 => x + x_1",
" hyperoperation 1 m k = m + k",
" hyperoperation 1 m 0 = m + 0",
" hyperoperation 1 m (bn + 1) = m + (b... | [
" hyperoperation 0 m k = k.succ",
" hyperoperation (n + 3) m 0 = 1",
" hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k)",
" hyperoperation 1 = fun x x_1 => x + x_1",
" hyperoperation 1 m k = m + k",
" hyperoperation 1 m 0 = m + 0",
" hyperoperation 1 m (bn + 1) = m + (b... |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.Finsupp.Defs
import Mathlib.Data.Finset.Pairwise
#align_import data.finsupp.big_operators from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf"
variable {ΞΉ M : Type*} [DecidableEq ΞΉ]
theorem List.support_sum_subset [AddMonoid M] (l : List (ΞΉ ββ M)) :
l.sum.support β l.foldr (Finsupp.support Β· β Β·) β
:= by
induction' l with hd tl IH
Β· simp
Β· simp only [List.sum_cons, Finset.union_comm]
refine Finsupp.support_add.trans (Finset.union_subset_union ?_ IH)
rfl
#align list.support_sum_subset List.support_sum_subset
theorem Multiset.support_sum_subset [AddCommMonoid M] (s : Multiset (ΞΉ ββ M)) :
s.sum.support β (s.map Finsupp.support).sup := by
induction s using Quot.inductionOn
simpa only [Multiset.quot_mk_to_coe'', Multiset.sum_coe, Multiset.map_coe, Multiset.sup_coe,
List.foldr_map] using List.support_sum_subset _
#align multiset.support_sum_subset Multiset.support_sum_subset
| Mathlib/Data/Finsupp/BigOperators.lean | 55 | 57 | theorem Finset.support_sum_subset [AddCommMonoid M] (s : Finset (ΞΉ ββ M)) :
(s.sum id).support β Finset.sup s Finsupp.support := by |
classical convert Multiset.support_sum_subset s.1; simp
| [
" l.sum.support β foldr (fun x x_1 => x.support β x_1) β
l",
" [].sum.support β foldr (fun x x_1 => x.support β x_1) β
[]",
" (hd :: tl).sum.support β foldr (fun x x_1 => x.support β x_1) β
(hd :: tl)",
" (hd + tl.sum).support β foldr (fun x x_1 => x.support β x_1) β
(hd :: tl)",
" hd.support β hd.support",... | [
" l.sum.support β foldr (fun x x_1 => x.support β x_1) β
l",
" [].sum.support β foldr (fun x x_1 => x.support β x_1) β
[]",
" (hd :: tl).sum.support β foldr (fun x x_1 => x.support β x_1) β
(hd :: tl)",
" (hd + tl.sum).support β foldr (fun x x_1 => x.support β x_1) β
(hd :: tl)",
" hd.support β hd.support",... |
import Mathlib.Analysis.InnerProductSpace.Orientation
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
#align_import measure_theory.measure.haar.inner_product_space from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
open FiniteDimensional MeasureTheory MeasureTheory.Measure Set
variable {ΞΉ E F : Type*}
variable [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace β F] [FiniteDimensional β F]
[MeasurableSpace F] [BorelSpace F]
section
variable {m n : β} [_i : Fact (finrank β F = n)]
theorem Orientation.measure_orthonormalBasis (o : Orientation β F (Fin n))
(b : OrthonormalBasis ΞΉ β F) : o.volumeForm.measure (parallelepiped b) = 1 := by
have e : ΞΉ β Fin n := by
refine Fintype.equivFinOfCardEq ?_
rw [β _i.out, finrank_eq_card_basis b.toBasis]
have A : βb = b.reindex e β e := by
ext x
simp only [OrthonormalBasis.coe_reindex, Function.comp_apply, Equiv.symm_apply_apply]
rw [A, parallelepiped_comp_equiv, AlternatingMap.measure_parallelepiped,
o.abs_volumeForm_apply_of_orthonormal, ENNReal.ofReal_one]
#align orientation.measure_orthonormal_basis Orientation.measure_orthonormalBasis
theorem Orientation.measure_eq_volume (o : Orientation β F (Fin n)) :
o.volumeForm.measure = volume := by
have A : o.volumeForm.measure (stdOrthonormalBasis β F).toBasis.parallelepiped = 1 :=
Orientation.measure_orthonormalBasis o (stdOrthonormalBasis β F)
rw [addHaarMeasure_unique o.volumeForm.measure
(stdOrthonormalBasis β F).toBasis.parallelepiped, A, one_smul]
simp only [volume, Basis.addHaar]
#align orientation.measure_eq_volume Orientation.measure_eq_volume
end
theorem OrthonormalBasis.volume_parallelepiped (b : OrthonormalBasis ΞΉ β F) :
volume (parallelepiped b) = 1 := by
haveI : Fact (finrank β F = finrank β F) := β¨rflβ©
let o := (stdOrthonormalBasis β F).toBasis.orientation
rw [β o.measure_eq_volume]
exact o.measure_orthonormalBasis b
#align orthonormal_basis.volume_parallelepiped OrthonormalBasis.volume_parallelepiped
| Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean | 71 | 76 | theorem OrthonormalBasis.addHaar_eq_volume {ΞΉ F : Type*} [Fintype ΞΉ] [NormedAddCommGroup F]
[InnerProductSpace β F] [FiniteDimensional β F] [MeasurableSpace F] [BorelSpace F]
(b : OrthonormalBasis ΞΉ β F) :
b.toBasis.addHaar = volume := by |
rw [Basis.addHaar_eq_iff]
exact b.volume_parallelepiped
| [
" o.volumeForm.measure (parallelepiped βb) = 1",
" ΞΉ β Fin n",
" Fintype.card ΞΉ = n",
" βb = β(b.reindex e) β βe",
" b x = (β(b.reindex e) β βe) x",
" o.volumeForm.measure = volume",
" addHaarMeasure (stdOrthonormalBasis β F).toBasis.parallelepiped = volume",
" volume (parallelepiped βb) = 1",
" b.t... | [
" o.volumeForm.measure (parallelepiped βb) = 1",
" ΞΉ β Fin n",
" Fintype.card ΞΉ = n",
" βb = β(b.reindex e) β βe",
" b x = (β(b.reindex e) β βe) x",
" o.volumeForm.measure = volume",
" addHaarMeasure (stdOrthonormalBasis β F).toBasis.parallelepiped = volume",
" volume (parallelepiped βb) = 1"
] |
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
| Mathlib/Data/Finset/Update.lean | 35 | 41 | 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]
| [
" updateFinset x {i} y = update x i (y β¨i, β―β©)",
" updateFinset x {i} y j = update x i (y β¨i, β―β©) j",
" updateFinset x {i} y i = update x i (y β¨i, β―β©) i"
] | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.