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" ]
[]