Context
stringlengths
227
76.5k
target
stringlengths
0
11.6k
file_name
stringlengths
21
79
start
int64
14
3.67k
end
int64
16
3.69k
/- Copyright (c) 2022 Xavier Roblot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Xavier Roblot -/ import Mathlib.MeasureTheory.Group.GeometryOfNumbers import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls import Mathlib.NumberTheory.NumberField.CanonicalEmbedd...
obtain hB | hB := le_or_lt B 0 · rw [convexBodySum_volume_eq_zero_of_le_zero K hB, ofReal_eq_zero.mpr hB, zero_pow, mul_zero] exact finrank_pos.ne' · suffices volume (convexBodySum K 1) = (convexBodySumFactor K) by rw [mul_comm]
Mathlib/NumberTheory/NumberField/CanonicalEmbedding/ConvexBody.lean
378
382
/- Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel, Rémy Degenne, David Loeffler -/ import Mathlib.Analysis.SpecialFunctions.Complex.Log /-! # Power funct...
split_ifs with hx hn ha ha <;> rfl theorem inv_cpow (x : ℂ) (n : ℂ) (hx : x.arg ≠ π) : x⁻¹ ^ n = (x ^ n)⁻¹ := by rw [inv_cpow_eq_ite, if_neg hx] /-- `Complex.inv_cpow_eq_ite` with the `ite` on the other side. -/ theorem inv_cpow_eq_ite' (x : ℂ) (n : ℂ) : (x ^ n)⁻¹ = if x.arg = π then conj (x⁻¹ ^ conj n) else ...
Mathlib/Analysis/SpecialFunctions/Pow/Complex.lean
213
224
/- Copyright (c) 2019 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ import Mathlib.Algebra.Regular.Basic import Mathlib.GroupTheory.MonoidLocalization.Basic import Mathlib.LinearAlgebra.Matrix.MvPolynomial import Mathlib.LinearAlgebra.Matri...
· -- i ≠ j: this entry should be 0 rw [updateCol_transpose, det_transpose] apply det_zero_of_row_eq h rw [updateRow_self, updateRow_ne (Ne.symm h)] theorem cramer_row_self (i : n) (h : ∀ j, b j = A j i) : A.cramer b = Pi.single i A.det := by rw [← transpose_transpose A, det_transpose] convert cramer_...
Mathlib/LinearAlgebra/Matrix/Adjugate.lean
106
116
/- Copyright (c) 2024 Brendan Murphy. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Brendan Murphy -/ import Mathlib.Algebra.Module.Torsion import Mathlib.RingTheory.Flat.Basic import Mathlib.RingTheory.Ideal.AssociatedPrime.Basic import Mathlib.RingTheory.QuotSMulTop...
variable (R) in lemma biUnion_associatedPrimes_eq_compl_regular [IsNoetherianRing R] : ⋃ p ∈ associatedPrimes R M, p = { r : R | IsSMulRegular M r }ᶜ := Eq.trans (biUnion_associatedPrimes_eq_zero_divisors R M) <| by simp_rw [Set.compl_setOf, isSMulRegular_iff_smul_eq_zero_imp_eq_zero,
Mathlib/RingTheory/Regular/IsSMulRegular.lean
141
145
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Analysis.Filter import Mathlib.Topology.Bases import Mathlib.Topology.LocallyFinite /-! # Computational realization of topological spaces (experi...
theorem ext' [T : TopologicalSpace α] {σ : Type*} {F : Ctop α σ} (H : ∀ a s, s ∈ 𝓝 a ↔ ∃ b, a ∈ F b ∧ F b ⊆ s) : F.toTopsp = T := by refine TopologicalSpace.ext_nhds fun x ↦ ?_ ext s rw [mem_nhds_toTopsp, H] theorem ext [T : TopologicalSpace α] {σ : Type*} {F : Ctop α σ} (H₁ : ∀ a, IsOpen (F a))
Mathlib/Data/Analysis/Topology.lean
142
149
/- Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir -/ import Mathlib.LinearAlgebra.DirectSum.Finsupp import Mathlib.Algebra.MvPolynomial.Eval import Mathlib.RingTheory.TensorProduct.Basic import Mathlib.Al...
LinearMap.coe_restrictScalars, AlgHom.toLinearMap_apply] rw [coeff_rTensorAlgHom_tmul] simp only [coeff] exact (finsuppLeft_apply_tmul_apply _ _ _).symm
Mathlib/RingTheory/TensorProduct/MvPolynomial.lean
163
166
/- Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel, Rémy Degenne, David Loeffler -/ import Mathlib.Analysis.SpecialFunctions.Pow.Real /-! # Power function...
rw [← coe_rpow_of_ne_zero, coe_inj, Real.toNNReal_rpow_of_nonneg hx_pos.le] simp [hx_pos] theorem ofReal_rpow_of_nonneg {x p : ℝ} (hx_nonneg : 0 ≤ x) (hp_nonneg : 0 ≤ p) : ENNReal.ofReal x ^ p = ENNReal.ofReal (x ^ p) := by
Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean
889
893
/- Copyright (c) 2023 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ import Mathlib.Algebra.Ring.CharZero import Mathlib.Algebra.Ring.Int.Units import Mathlib.GroupTheory.Coprod.Basic import Mathlib.GroupTheory.Complement /-! ## HNN Exte...
simpa using h2 (-u) rfl hw theorem unitsSMul_cancels_iff (u : ℤˣ) (w : NormalWord d) : Cancels (-u) (unitsSMul φ u w) ↔ ¬ Cancels u w := by by_cases h : Cancels u w · simp only [unitsSMul, h, dite_true, not_true_eq_false, iff_false] induction w using consRecOn with | ofGroup => simp [Cancels, unitsSM...
Mathlib/GroupTheory/HNNExtension.lean
395
410
/- Copyright (c) 2017 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Keeley Hoek -/ import Mathlib.Algebra.NeZero import Mathlib.Data.Int.DivMod import Mathlib.Logic.Embedding.Basic import Mathlib.Logic.Equiv.Set import Mathlib.Tactic....
Mathlib/Data/Fin/Basic.lean
1,627
1,629
/- Copyright (c) 2022 Yaël Dillies, Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Bhavik Mehta -/ import Mathlib.Combinatorics.Additive.AP.Three.Defs import Mathlib.Combinatorics.Additive.Corner.Defs import Mathlib.Combinatorics.SimpleGraph...
The maximum density of a 3AP-free set in `G` goes to zero as `|G|` tends to infinity. -/ theorem roth_3ap_theorem (ε : ℝ) (hε : 0 < ε) (hG : cornersTheoremBound ε ≤ card G) (A : Finset G) (hAε : ε * card G ≤ #A) : ¬ ThreeAPFree (A : Set G) := by rintro hA classical let B : Finset (G × G) := univ.filter fun (...
Mathlib/Combinatorics/Additive/Corner/Roth.lean
138
158
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Algebra.Group.Indicator import Mathlib.Order.ConditionallyCompleteLattice.Indexed import Mathlib.Algebra.Order.Group.Synonym import Mathlib.Algebra.O...
· rw [mulIndicator_of_mem hx] rw [mem_iUnion] at hx refine le_antisymm ?_ (iSup_le fun i ↦ mulIndicator_le_self' (fun x _ ↦ h1 ▸ bot_le) x) rcases hx with ⟨i, hi⟩ exact le_iSup_of_le i (ge_of_eq <| mulIndicator_of_mem hi _) · rw [mulIndicator_of_not_mem hx] simp only [mem_iUnion, not_exists] at ...
Mathlib/Algebra/Order/Group/Indicator.lean
158
164
/- Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.CategoryTheory.MorphismProperty.Concrete import Mathlib.CategoryTheory.Sites.LocallyBijective /-! # Morphisms of sheaves factor as a locally surjective followed...
· intro infer_instance · intro let data := (locallySurjective J A).factorizationData (locallyInjective J A) φ have : IsLocallySurjective data.i := data.hi have : IsLocallyInjective data.p := data.hp have : Epi data.p := epi_of_epi_fac data.fac have := mono_of_isLocallyInjective data.p ha...
Mathlib/CategoryTheory/Sites/EpiMono.lean
121
134
/- Copyright (c) 2020 Kexing Ying. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kexing Ying -/ import Mathlib.Algebra.Group.Subgroup.Basic import Mathlib.Algebra.Group.Submonoid.BigOperators import Mathlib.Data.Finite.Card import Mathlib.Data.Set.Finite.Range /-! # ...
section Normalizer theorem mem_normalizer_fintype {S : Set G} [Finite S] {x : G} (h : ∀ n, n ∈ S → x * n * x⁻¹ ∈ S) : x ∈ Subgroup.setNormalizer S := by
Mathlib/Algebra/Group/Subgroup/Finite.lean
231
234
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.CategoryTheory.Sites.CoverLifting import Mathlib.CategoryTheory.Sites.CoverPreserving /-! Localization In this file, given a Grothendieck topology `J` on a cat...
(overEquiv Y).symm S f ↔ S f.left := by rfl lemma overEquiv_iff {X : C} {Y : Over X} (S : Sieve Y) {Z : C} (f : Z ⟶ Y.left) : overEquiv Y S f ↔ S (Over.homMk f : Over.mk (f ≫ Y.hom) ⟶ Y) := by obtain ⟨S, rfl⟩ := (overEquiv Y).symm.surjective S simp @[simp] lemma functorPushforward_over_map {X Y : C} (f ...
Mathlib/CategoryTheory/Sites/Over.lean
93
103
/- Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ import Mathlib.Algebra.Ring.Divisibility.Lemmas import Mathlib.Algebra.Lie.Nilpotent import Mathlib.Algebra.Lie.Engel import Mathlib.LinearAlgebra.Eigenspace.Pi import Math...
/-- The family of eigenvalues corresponding to a weight. -/ toFun : L → R
Mathlib/Algebra/Lie/Weights/Basic.lean
210
211
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Gabriel Ebner -/ import Mathlib.Data.Int.Cast.Defs import Mathlib.Algebra.Group.Basic import Mathlib.Data.Nat.Basic /-! # Cast of integers (additional theorems) This ...
-- type had `HasLiftT` @[simp, norm_cast]
Mathlib/Data/Int/Cast/Basic.lean
74
76
/- Copyright (c) 2022 Yaël Dillies, Sara Rousta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies, Sara Rousta -/ import Mathlib.Logic.Equiv.Set import Mathlib.Order.Interval.Set.OrderEmbedding import Mathlib.Order.SetNotation /-! # Properties of unbundled ...
Mathlib/Order/UpperLower/Basic.lean
920
921
/- Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ import Mathlib.MeasureTheory.Constructions.BorelSpace.Order import Mathlib.MeasureTheory.Measure.Count import Mathlib.Order.Filter.ENNReal import Mathlib.Probability.Unif...
essSup (s.piecewise f g) μ = max (essSup f (μ.restrict s)) (essSup g (μ.restrict sᶜ)) := by simp only [essSup, limsup_piecewise, blimsup_eq_limsup, ae_restrict_eq, hs, hs.compl]; rfl theorem essSup_indicator_eq_essSup_restrict {s : Set α} {f : α → ℝ≥0∞} (hs : MeasurableSet s) : essSup (s.indicator f) μ = ess...
Mathlib/MeasureTheory/Function/EssSup.lean
266
270
/- Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker -/ import Mathlib.Algebra.Order.Group.Finset import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Algebra.Polynomial.Eva...
theorem modByMonic_eq_mod (p : R[X]) (hq : Monic q) : p %ₘ q = p % q := show p %ₘ q = p %ₘ (q * C (leadingCoeff q)⁻¹) by simp only [Monic.def.1 hq, inv_one, mul_one, C_1]
Mathlib/Algebra/Polynomial/FieldDivision.lean
326
328
/- Copyright (c) 2023 Peter Nelson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Nelson -/ import Mathlib.Data.Finite.Prod import Mathlib.Data.Matroid.Init import Mathlib.Data.Set.Card import Mathlib.Data.Set.Finite.Powerset import Mathlib.Order.UpperLower.Clos...
simp_rw [hE, show Indep = M.Indep from funext (by simp [hI])] exact M.maximality subset_ground := by simp_rw [hE, hB] exact M.subset_ground
Mathlib/Data/Matroid/Basic.lean
787
791
/- Copyright (c) 2019 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ import Mathlib.Control.Monad.Basic import Mathlib.Control.Monad.Writer import Mathlib.Control.Lawful import Batteries.Tactic.Congr import Batteries.Lean.Except import Batte...
simp only [callCC, StateT.callCC, StateT.run_bind, callCC_bind_right]; ext; rfl callCC_bind_left := by
Mathlib/Control/Monad/Cont.lean
220
221
/- Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ import Mathlib.Data.Sum.Basic import Mathlib.Logic.Equiv.Option import Mathlib.Logic.Equiv.Sum import Mathlib.Logic.Function.Conjugate impor...
Mathlib/Logic/Equiv/Basic.lean
1,675
1,678
/- Copyright (c) 2022 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ import Mathlib.Analysis.Calculus.ContDiff.Operations import Mathlib.Analysis.Calculus.UniformLimitsDeriv import Mathlib.Topology.Algebra.InfiniteSum.Module impo...
exact (continuousMultilinearCurryFin0 𝕜 E F).symm.toContinuousLinearEquiv.map_tsum · have h'k : (k : ℕ∞) < N := lt_of_lt_of_le (WithTop.coe_lt_coe.2 (Nat.lt_succ_self _)) hk have A : Summable fun n => iteratedFDeriv 𝕜 k (f n) 0 := .of_norm_bounded (v k) (hv k h'k.le) fun n => h'f k n 0 h'k.le simp...
Mathlib/Analysis/Calculus/SmoothSeries.lean
195
214
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.CategoryTheory.Localization.LocalizerMorphism import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic /-! # Composition of localization functors Given two comp...
lemma of_comp (W₃ : MorphismProperty C₁) [L₁.IsLocalization W₁] [(L₁ ⋙ L₂).IsLocalization W₃] (hW₁₃ : W₁ ≤ W₃) (hW₂₃ : W₂ = W₃.map L₁) : L₂.IsLocalization W₂ := by have : (L₁ ⋙ W₂.Q).IsLocalization W₃ := comp L₁ W₂.Q W₁ W₂ W₃ (fun X Y f hf => Localization.inverts W₂.Q W₂ _ (by simpa only [...
Mathlib/CategoryTheory/Localization/Composition.lean
110
122
/- Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Simon Hudon, Mario Carneiro -/ import Mathlib.Algebra.Notation.Defs import Mathlib.Data.Int.Notation import Mathlib.Data.Nat.BinaryRec import Mathlib.L...
Main examples are `ℕ` and groups. This is the right typeclass for many sum lemmas, as having a zero is useful to define the sum over the empty set, so `AddLeftCancelSemigroup` is not enough. -/
Mathlib/Algebra/Group/Defs.lean
662
663
/- Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Kenny Lau -/ import Mathlib.Algebra.CharP.Defs import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Basic import Mathlib.RingTheory.MvPowerSer...
rw [monomial, Finsupp.single_zero, MvPowerSeries.monomial_zero_eq_C] rfl
Mathlib/RingTheory/PowerSeries/Basic.lean
234
235
/- Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ import Mathlib.Topology.PartialHomeomorph import Mathlib.Topology.Connected.LocPathConnected /-! # Charted spaces A smooth manifold is a topological space `M`...
apply t1Space_iff_exists_open.2 (fun x y hxy ↦ ?_) by_cases hy : y ∈ (chartAt H x).source · refine ⟨(chartAt H x).source ∩ (chartAt H x)⁻¹' ({chartAt H x y}ᶜ), ?_, ?_, by simp⟩ · exact PartialHomeomorph.isOpen_inter_preimage _ isOpen_compl_singleton · simp only [preimage_compl, mem_inter_iff, mem_chart_so...
Mathlib/Geometry/Manifold/ChartedSpace.lean
714
723
/- Copyright (c) 2020 Anne Baanen. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Anne Baanen -/ import Mathlib.FieldTheory.Minpoly.Field import Mathlib.LinearAlgebra.SModEq import Mathlib.RingTheory.Ideal.BigOperators /-! # Power basis This file defines a structure ...
nontriviality A refine minpoly.unique' A _ pb.minpolyGen_monic pb.aeval_minpolyGen fun q hq => or_iff_not_imp_left.2 fun hn0 h0 => ?_ exact (pb.dim_le_degree_of_root hn0 h0).not_lt (pb.degree_minpolyGen ▸ hq)
Mathlib/RingTheory/PowerBasis.lean
199
203
/- Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Eric Wieser -/ import Mathlib.Algebra.DirectSum.Internal import Mathlib.Algebra.GradedMonoid import Mathlib.Algebra.MvPolynomial.CommRing import Mathlib.Algebra.MvPolyn...
-/ abbrev gradedAlgebra : GradedAlgebra (homogeneousSubmodule σ R) := weightedGradedAlgebra R (1 : σ → ℕ) theorem decomposition.decompose'_apply (φ : MvPolynomial σ R) (i : ℕ) : (decomposition.decompose' φ i : MvPolynomial σ R) = homogeneousComponent i φ :=
Mathlib/RingTheory/MvPolynomial/Homogeneous.lean
527
532
/- Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson -/ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle import Mathlib.Analysis.SpecialFunctions.T...
· refine (Real.continuousAt_arcsin.comp_continuousWithinAt ((continuous_im.continuousAt.comp_continuousWithinAt continuousWithinAt_neg).div continuous_norm.continuousWithinAt ?_)).add tendsto_const_nhds lift z to ℝ using him simpa using hre.ne
Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean
608
614
/- Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Multiset.FinsetOps import Mathlib.Data.Multiset.Fold /-! # Lattice operations on multisets -/ namespace Multiset variable {α : Type*} /-! ###...
section Inf
Mathlib/Data/Multiset/Lattice.lean
89
90
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Gabriel Ebner -/ import Mathlib.Data.Int.Cast.Defs import Mathlib.Algebra.Group.Basic import Mathlib.Data.Nat.Basic /-! # Cast of integers (additional theorems) This ...
end Nat
Mathlib/Data/Int/Cast/Basic.lean
39
41
/- Copyright (c) 2018 Andreas Swerdlow. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andreas Swerdlow -/ import Mathlib.LinearAlgebra.Basis.Basic import Mathlib.LinearAlgebra.BilinearMap import Mathlib.LinearAlgebra.LinearIndependent.Lemmas /-! # Sesquilinear maps ...
refine hW.le_bot ⟨hx, fun y hy ↦ ?_⟩ specialize b₁ ⟨y, hy⟩ simp_rw [domRestrict₁₂_apply] at b₁ rw [hB.ortho_comm] exact b₁ /-- An orthogonal basis with respect to a left-separating bilinear map has no self-orthogonal elements. -/ theorem IsOrthoᵢ.not_isOrtho_basis_self_of_separatingLeft [Nontrivial R] {B...
Mathlib/LinearAlgebra/SesquilinearForm.lean
759
769
/- Copyright (c) 2024 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ import Mathlib.Algebra.Order.Disjointed import Mathlib.Algebra.Order.Ring.Prod import Mathlib.Data.Int.Interval import Mathlib.Tactic.Ring import Mathlib.Tactic.Zify /-!...
lemma card_box : ∀ {n}, n ≠ 0 → #(box n : Finset (ℤ × ℤ)) = 8 * n | n + 1, _ => by simp_rw [Prod.card_box_succ, card_Icc, sub_neg_eq_add] norm_cast refine tsub_eq_of_eq_add ?_ zify ring @[simp] lemma mem_box : ∀ {n}, x ∈ box n ↔ max x.1.natAbs x.2.natAbs = n | 0 => by simp [Prod.ext_iff]
Mathlib/Order/Interval/Finset/Box.lean
88
97
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Algebra.Ring.Int.Units import Mathlib.Data.Fintype.Prod import Mathlib.Data.Fintype.Sum import Mathlib.SetTheory.Cardinal.Finite /-! # fintype instanc...
theorem Nat.card_eq_card_units_add_one [GroupWithZero α] [Finite α] : Nat.card α = Nat.card αˣ + 1 := by rw [Nat.card_units, tsub_add_cancel_of_le Nat.card_pos]
Mathlib/Data/Fintype/Units.lean
42
46
/- Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots import Mathlib.FieldTheory.Finite.Trace import Mathlib.Algebra.Group.AddChar import Mathlib.Data.ZMod.Units import...
end ZMod section ZModChar variable {C : Type v} [CommMonoid C] section ZModCharDef /-- We can define an additive character on `ZMod n` when we have an `n`th root of unity `ζ : C`. -/ def zmodChar (n : ℕ) [NeZero n] {ζ : C} (hζ : ζ ^ n = 1) : AddChar (ZMod n) C where
Mathlib/NumberTheory/LegendreSymbol/AddCharacter.lean
123
134
/- Copyright (c) 2023 Dagur Asgeirsson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dagur Asgeirsson -/ import Mathlib.Topology.Category.Profinite.Nobeling.Basic import Mathlib.Topology.Category.Profinite.Nobeling.Induction import Mathlib.Topology.Category.Profinite...
Mathlib/Topology/Category/Profinite/Nobeling.lean
379
393
/- Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Probability.Kernel.MeasurableLIntegral /-! # Measurability of the integral against a kernel Th...
Mathlib/Probability/Kernel/MeasurableIntegral.lean
239
243
/- Copyright (c) 2019 Calle Sönne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Calle Sönne -/ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic import Mathlib.Analysis.Normed.Group.AddCircle import Mathlib.Algebra.CharZero.Quotient import Mathlib.Topology...
@[simp] theorem sign_neg (θ : Angle) : (-θ).sign = -θ.sign := by simp_rw [sign, sin_neg, Left.sign_neg] theorem sign_antiperiodic : Function.Antiperiodic sign (π : Angle) := fun θ => by rw [sign, sign, sin_add_pi, Left.sign_neg]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean
712
718
/- Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Julian Kuelshammer -/ import Mathlib.Algebra.CharP.Defs import Mathlib.Algebra.Group.Commute.Basic import Mathlib.Algebra.Group.Pointwise.Set.Finite import Mathlib.Alge...
@[to_additive (attr := simp) mod_card_zsmul] theorem zpow_mod_card (a : G) (n : ℤ) : a ^ (n % Fintype.card G : ℤ) = a ^ n := by rw [eq_comm, ← zpow_mod_orderOf, ← Int.emod_emod_of_dvd n (Int.natCast_dvd_natCast.2 orderOf_dvd_card), zpow_mod_orderOf]
Mathlib/GroupTheory/OrderOfElement.lean
927
931
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Group.Nat.Defs import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.EqToHom import Mathlib.CategoryTheory.Functor.Const import M...
obtain ⟨_|_, hi⟩ := i <;> simp lemma map_comp {i j k : Fin (n + 1 + 1)} (hij : i ≤ j) (hjk : j ≤ k) :
Mathlib/CategoryTheory/ComposableArrows.lean
339
341
/- Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Sébastien Gouëzel -/ import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric import Mathlib.MeasureTheory...
rw [zero_smul_set hs, ← singleton_zero] by_cases h : finrank ℝ E = 0 · haveI : Subsingleton E := finrank_zero_iff.1 h simp only [h, one_mul, ENNReal.ofReal_one, abs_one, Subsingleton.eq_univ_of_nonempty hs, pow_zero, Subsingleton.eq_univ_of_nonempty (singleton_nonempty (0 : E))]
Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean
368
372
/- Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta, Kim Morrison -/ import Mathlib.CategoryTheory.Subobject.Lattice /-! # Specific subobjects We define `equalizerSubobject`, `kernelSubobject` and `imageSubobject`, which ar...
@[simp] theorem kernelSubobjectIsoComp_hom_arrow {X' : C} (f : X' ⟶ X) [IsIso f] (g : X ⟶ Y) [HasKernel g] : (kernelSubobjectIsoComp f g).hom ≫ (kernelSubobject g).arrow = (kernelSubobject (f ≫ g)).arrow ≫ f := by
Mathlib/CategoryTheory/Subobject/Limits.lean
181
184
/- Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ import Mathlib.Analysis.Calculus.ContDiff.Operations import Mathlib.Data.Finset.Sym import Mathlib.Data.Nat.Choose.Cast import Mathlib.Data.Na...
exact B.norm_iteratedFDerivWithin_le_of_bilinear_of_le_one hf.contDiffOn hg.contDiffOn uniqueDiffOn_univ (mem_univ x) hn hB section variable {𝕜' : Type*} [NormedField 𝕜'] [NormedAlgebra 𝕜 𝕜'] [NormedSpace 𝕜' F] [IsScalarTower 𝕜 𝕜' F]
Mathlib/Analysis/Calculus/ContDiff/Bounds.lean
237
244
/- Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ import Mathlib.Control.Basic import Mathlib.Data.Nat.Basic import Mathlib.Data.Option.Basic im...
Mathlib/Data/List/Basic.lean
3,485
3,486
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Yury Kudryashov -/ import Mathlib.Data.Set.SymmDiff import Mathlib.Order.SuccPred.Relation import Mathlib.Topology.Irreducible /-! # Connected subsets ...
reflTransGen_of_succ _ (fun i _ => K i) fun i _ => by rw [inter_comm] exact K i /-- The iUnion of connected sets indexed by a type with an archimedean successor (like `ℕ` or `ℤ`) such that any two neighboring sets meet is connected. -/ theorem IsConnected.iUnion_of_chain [Nonempty β] {s : β → Set α} ...
Mathlib/Topology/Connected/Basic.lean
211
217
/- Copyright (c) 2018 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Johannes Hölzl, Rémy Degenne -/ import Mathlib.Order.ConditionallyCompleteLattice.Indexed import Mathlib.Order.Filter.IsBounded import Mathlib.Order.Hom.CompleteL...
Mathlib/Order/LiminfLimsup.lean
1,247
1,251
/- Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro -/ import Mathlib.Algebra.Order.GroupWithZero.Synonym import Mathlib.Algebra.Order.Ring.Canonical import Mathlib.Algebra.Ring.Hom.Defs i...
cases a <;> cases b <;> aesop
Mathlib/Algebra/Order/Ring/WithTop.lean
57
57
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.ShortComplex.Homology import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor import Mathlib.CategoryTheory.Preadditive.Opposite /-! # Homolo...
@[simp] lemma opcyclesMap'_sub : opcyclesMap' (φ - φ') h₁ h₂ = opcyclesMap' φ h₁ h₂ - opcyclesMap' φ' h₁ h₂ := by simp only [sub_eq_add_neg, opcyclesMap'_add, opcyclesMap'_neg]
Mathlib/Algebra/Homology/ShortComplex/Preadditive.lean
241
245
/- Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ import Mathlib.Data.Finset.Lattice.Prod import Mathlib.Data.Finite.Prod import Mathlib.Data.Set.Lattice.Image /-! # N-ary images of finsets This file defines `Finset.im...
exact image2_union_right
Mathlib/Data/Finset/NAry.lean
155
156
/- Copyright (c) 2021 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ import Mathlib.LinearAlgebra.Basis.Basic import Mathlib.LinearAlgebra.Basis.Submodule import Mathlib.LinearAlgebra.Dimension.Finrank import Mathlib.LinearAlgebra.Invarian...
exact i h /-- Let `R` satisfy the strong rank condition. If `m` elements of a free rank `n` `R`-module are linearly independent, then `m ≤ n`. -/ theorem Basis.card_le_card_of_linearIndependent_aux {R : Type*} [Semiring R] [StrongRankCondition R] (n : ℕ) {m : ℕ} (v : Fin m → Fin n → R) : LinearIndependent R v ...
Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean
294
299
/- Copyright (c) 2024 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.MellinTransform /-! # Abstract functional equations for Mellin transforms This file formalises a general version of an argument used to pro...
namespace WeakFEPair /-! ## Auxiliary results I: lemmas on asymptotics -/ /-- As `x → 0`, we have `f x = x ^ (-P.k) • constant` up to a rapidly decaying error. -/ lemma hf_zero (P : WeakFEPair E) (r : ℝ) : (fun x ↦ P.f x - (P.ε * ↑(x ^ (-P.k))) • P.g₀) =O[𝓝[>] 0] (· ^ r) := by have := (P.hg_top (-(r + P.k))).c...
Mathlib/NumberTheory/LSeries/AbstractFuncEq.lean
135
156
/- Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhouhang Zhou, Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne -/ import Mathlib.MeasureTheory.Integral.FinMeasAdditive /-! # Extension of a linear function from indicators to L1 Give...
end L1 section Function variable [CompleteSpace F] {T T' T'' : Set α → E →L[ℝ] F} {C C' C'' : ℝ} {f g : α → E} variable (μ T) open Classical in /-- Extend `T : Set α → E →L[ℝ] F` to `(α → E) → F` (for integrable functions `α → E`). We set it to 0 if the function is not integrable. -/ def setToFun (hT : DominatedFinM...
Mathlib/MeasureTheory/Integral/SetToL1.lean
606
631
/- Copyright (c) 2022 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion import Mathlib.AlgebraicGeometry.PullbackCarrier import Mathlib.Topology.LocalAtTarget /-! # Universally closed ...
instance universallyClosed_snd {X Y Z : Scheme} (f : X ⟶ Z) (g : Y ⟶ Z) [hf : UniversallyClosed f] : UniversallyClosed (pullback.snd f g) := MorphismProperty.pullback_snd f g hf instance universallyClosed_isLocalAtTarget : IsLocalAtTarget @UniversallyClosed := by rw [universallyClosed_eq]
Mathlib/AlgebraicGeometry/Morphisms/UniversallyClosed.lean
88
94
/- Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin, Julian Kuelshammer, Heather Macbeth, Mitchell Lee -/ import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Algebra.Ri...
theorem U_eval_neg_one (n : ℤ) : (U R n).eval (-1) = n.negOnePow * (n + 1) := by induction n using Polynomial.Chebyshev.induct with | zero => simp | one => simp; norm_num | add_two n ih1 ih2 => simp only [U_add_two, eval_sub, eval_mul, eval_ofNat, eval_X, mul_neg, mul_one, ih1, Int.cast_add, Int.cast_...
Mathlib/RingTheory/Polynomial/Chebyshev.lean
241
250
/- Copyright (c) 2021 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne -/ import Mathlib.Probability.Independence.Kernel import Mathlib.MeasureTheory.Constructions.Pi /-! # Independence of sets of sets and measure spaces (σ-algebras) * A fami...
alias ⟨IndepFun.measure_inter_preimage_eq_mul, _⟩ := indepFun_iff_measure_inter_preimage_eq_mul theorem iIndepFun_iff_measure_inter_preimage_eq_mul {ι : Type*} {β : ι → Type*}
Mathlib/Probability/Independence/Basic.lean
567
570
/- Copyright (c) 2022 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Floris van Doorn, Yury Kudryashov -/ import Mathlib.Order.Filter.Lift import Mathlib.Order.Filter.AtTopBot.Basic /-! # The filter of small sets This file defines the ...
(comap f l).smallSets = comap (image f) l.smallSets := by refine (gc_map_comap _).u_comm_of_l_comm (gc_map_comap _) bind_smallSets_gc bind_smallSets_gc ?_ simp [Function.comp_def, map_bind, bind_map]
Mathlib/Order/Filter/SmallSets.lean
125
128
/- Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Finset.Card import Mathlib.Data.Finset.Lattice.Union import Mathlib.Data.Multiset.Powerset import Mathlib.Data.Set.Pairwise.Lattice /-! # The pow...
rw [← hu.2] exact Subset.trans (erase_insert_subset a u) hu.1 · have : ¬∃ u : Finset α, u ⊆ s ∧ insert a u = t := by simp [Ne.symm (ne_insert_of_not_mem _ _ h)] simp [Finset.erase_eq_of_not_mem h, this]
Mathlib/Data/Finset/Powerset.lean
93
96
/- Copyright (c) 2020 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ import Mathlib.Algebra.BigOperators.Group.Finset.Powerset import Mathlib.Algebra.NoZeroSMulDivisors.Pi import Mathlib.Data.Finset.Sort import Mathlib.Data.Finty...
theorem compLinearMap_apply (g : MultilinearMap R M₁' M₂) (f : ∀ i, M₁ i →ₗ[R] M₁' i) (m : ∀ i, M₁ i) : g.compLinearMap f m = g fun i => f i (m i) := rfl
Mathlib/LinearAlgebra/Multilinear/Basic.lean
359
362
/- Copyright (c) 2021 Aaron Anderson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Aaron Anderson -/ import Mathlib.ModelTheory.Ultraproducts import Mathlib.ModelTheory.Bundled import Mathlib.ModelTheory.Skolem import Mathlib.Order.Filter.AtTopBot.Basic /-! # First-...
end completeTheory end Language
Mathlib/ModelTheory/Satisfiability.lean
453
456
/- Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Kim Morrison, Jens Wagemaker, Johan Commelin -/ import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory...
theorem mem_nonZeroDivisors_of_leadingCoeff {p : R[X]} (h : p.leadingCoeff ∈ R⁰) : p ∈ R[X]⁰ := mem_nonzeroDivisors_of_coeff_mem _ h
Mathlib/Algebra/Polynomial/RingDivision.lean
124
126
/- Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Joey van Langen, Casper Putz -/ import Mathlib.Algebra.CharP.Algebra import Mathlib.Algebra.CharP.Reduced import Mathlib.Algebra.Field.ZMod import Mathlib.Data.Nat.Prime.In...
{G : Subgroup Kˣ} [Fintype G] [Decidable (G = ⊥)] : ∑ x : G, (x.val : K) = if G = ⊥ then 1 else 0 := by by_cases G_bot : G = ⊥ · subst G_bot simp only [univ_unique, sum_singleton, ↓reduceIte, Units.val_eq_one, OneMemClass.coe_eq_one] rw [Set.default_coe_singleton] rfl · simp only [G_bot, ite_f...
Mathlib/FieldTheory/Finite/Basic.lean
167
175
/- Copyright (c) 2024 Raghuram Sundararajan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Raghuram Sundararajan -/ import Mathlib.Algebra.Ring.Defs import Mathlib.Algebra.Group.Ext /-! # Extensionality lemmas for rings and similar structures In this file we prove e...
· exact congrArg (·.toAdd.add x y) h · exact congrArg (·.toMul.mul x y) h end NonUnitalNonAssocRing
Mathlib/Algebra/Ring/Ext.lean
176
180
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Nat.Lattice import Mathlib.Logic.Denumerable import Mathlib.Logic.Function.Iterate import Mathlib.Order.Hom.Basic import Mathlib.Data.Set.Subsing...
refine ⟨fun a => ?_⟩ obtain ⟨n, hn⟩ := h (a.swap : _ →r _).toOrderHom exact hn n.succ n.lt_succ_self.le ((RelEmbedding.map_rel_iff _).2 n.lt_succ_self) theorem WellFoundedGT.monotone_chain_condition' [Preorder α] [h : WellFoundedGT α] (a : ℕ →o α) : ∃ n, ∀ m, n ≤ m → ¬a n < a m := wellFoundedGT_iff_m...
Mathlib/Order/OrderIsoNat.lean
216
224
/- Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomotopyCategory.HomologicalFunctor import Mathlib.Algebra.Homology.HomotopyCategory.ShiftSequence import Mathlib.Algebra.Homology.HomologySeque...
simp [descShortComplex] @[reassoc (attr := simp)] lemma inl_v_descShortComplex_f (i j : ℤ) (h : i + (-1) = j) :
Mathlib/Algebra/Homology/HomotopyCategory/ShortExact.lean
56
59
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Eric Wieser -/ import Mathlib.Algebra.Group.Fin.Tuple import Mathlib.Algebra.BigOperators.GroupWithZero.Action import Ma...
def piCurry {ι : Type*} {κ : ι → Type*} (α : ∀ i, κ i → Type*) [∀ i k, AddCommMonoid (α i k)] [∀ i k, Module R (α i k)] :
Mathlib/LinearAlgebra/Pi.lean
458
459
/- Copyright (c) 2023 Antoine Chambert-Loir and María Inés de Frutos-Fernández. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine Chambert-Loir, María Inés de Frutos-Fernández, Bhavik Mehta, Eric Wieser -/ import Mathlib.Algebra.Order.Monoid.Canonical.Defs import ...
See also `Finset.antidiagonal_congr`. -/ lemma antidiagonal_congr' (hp : p ∈ antidiagonal n) (hq : q ∈ antidiagonal n) : p = q ↔ p.2 = q.2 := by rw [← Prod.swap_inj] exact antidiagonal_congr (swap_mem_antidiagonal.2 hp) (swap_mem_antidiagonal.2 hq)
Mathlib/Algebra/Order/Antidiag/Prod.lean
116
122
/- Copyright (c) 2018 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Computability.Primrec import Mathlib.Data.Nat.PSub import Mathlib.Data.PFun /-! # The partial recursive functions The partial recursive functions are...
(Option.casesOn (Sum.casesOn (f a) (fun _ => Option.none) Option.some : Option γ) (some (Sum.casesOn (f a) (fun b => some (g a b)) fun _ => Option.none)) fun c => (h a c).map Option.some : Part (Option σ)) :=
Mathlib/Computability/Partrec.lean
700
703
/- Copyright (c) 2019 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ import Mathlib.Data.List.Nodup /-! # Antidiagonals in ℕ × ℕ as lists This file defines the antidiagonals of ℕ × ℕ as lists: the `n`-th antidiagonal is the list of p...
antidiagonal (n + 1) = (antidiagonal n).map (Prod.map id Nat.succ) ++ [(n + 1, 0)] := by simp only [antidiagonal, range_succ, Nat.add_sub_cancel_left, map_append, append_assoc, Nat.sub_self, singleton_append, map_map, map] congr 1 apply map_congr_left simp +contextual [le_of_lt, Nat.sub_add_comm]
Mathlib/Data/List/NatAntidiagonal.lean
68
73
/- Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes -/ import Mathlib.Algebra.CharP.Two import Mathlib.Data.Nat.Cast.Field import Mathlib.Data.Nat.Factorization.Basic import Mathlib.Data.Nat.Factorization.Induction import Mat...
rw [totient_prime_pow (prime_of_mem_primeFactors hp) h] /-- Euler's product formula for the totient function. -/ theorem totient_mul_prod_primeFactors (n : ℕ) : (φ n * ∏ p ∈ n.primeFactors, p) = n * ∏ p ∈ n.primeFactors, (p - 1) := by by_cases hn : n = 0; · simp [hn] rw [totient_eq_prod_factorization hn] n...
Mathlib/Data/Nat/Totient.lean
265
272
/- Copyright (c) 2022 Eric Wieser. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Eric Wieser -/ import Mathlib.Algebra.BigOperators.Fin import Mathlib.Algebra.Group.Fin.Tuple import Mathlib.Data.Finset.NatAntidiagonal import Mathlib.Order.Fin.Tuple /-! # Collections ...
@[simp] theorem antidiagonalTuple_one (n : ℕ) : antidiagonalTuple 1 n = [![n]] := by simp_rw [antidiagonalTuple, antidiagonal, List.range_succ, List.map_append, List.map_singleton, Nat.sub_self, List.flatMap_append, List.flatMap_singleton, List.flatMap_map] conv_rhs => rw [← List.nil_append [![n]]] congr 1
Mathlib/Data/Fin/Tuple/NatAntidiagonal.lean
120
125
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.CategoryTheory.Shift.Adjunction import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor /-! # The pullback of a shift by a monoid morphism Given a shift by a...
lemma pullbackShiftFunctorZero'_inv_app : (shiftFunctorZero _ A).inv.app X = (shiftFunctorZero' C (φ 0) (by rw [map_zero])).inv.app X ≫ (pullbackShiftIso C φ 0 (φ 0) rfl).inv.app X := by rw [pullbackShiftFunctorZero_inv_app] simp only [Functor.id_obj, pullbackShiftIso, eqToIso.inv, eqToHom_app, shiftFunct...
Mathlib/CategoryTheory/Shift/Pullback.lean
93
103
/- Copyright (c) 2021 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ import Mathlib.Algebra.Order.Ring.Rat import Mathlib.Data.Multiset.Sort import Mathlib.Data.PNat.Basic import Mathlib.Data.PNat.Interval import Mathlib.Tactic.NormNum...
Mathlib/NumberTheory/ADEInequality.lean
259
268
/- Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Abhimanyu Pallavi Sudhir -/ import Mathlib.Algebra.CharP.Defs import Mathlib.Algebra.Order.CauSeq.BigOperators import Mathlib.Algebra.Order.Star.Basic import Mathlib.Data.C...
Mathlib/Data/Complex/Exponential.lean
1,038
1,039
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro, Patrick Massot -/ import Mathlib.Order.Filter.SmallSets import Mathlib.Topology.UniformSpace.Defs import Mathlib.Topology.ContinuousOn /-! # Basic resu...
Mathlib/Topology/UniformSpace/Basic.lean
1,318
1,321
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.MeasureTheory.Measure.Comap import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving /-! # Restricting a measure to a subset or a s...
theorem restrict_union₀ (h : AEDisjoint μ s t) (ht : NullMeasurableSet t μ) : μ.restrict (s ∪ t) = μ.restrict s + μ.restrict t := by simp [← restrict_union_add_inter₀ s ht, restrict_zero_set h]
Mathlib/MeasureTheory/Measure/Restrict.lean
243
247
/- Copyright (c) 2018 Patrick Massot. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Johannes Hölzl -/ import Mathlib.Topology.UniformSpace.AbstractCompletion /-! # Hausdorff completions of uniform spaces The goal is to construct a left-adjoint to the...
instance [h : Nonempty α] : Nonempty (CauchyFilter α) := h.recOn fun a => Nonempty.intro <| CauchyFilter.pureCauchy a section Extend open Classical in
Mathlib/Topology/UniformSpace/Completion.lean
215
220
/- Copyright (c) 2024 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Category.ModuleCat.Sheaf.ChangeOfRings import Mathlib.CategoryTheory.Sites.LocallySurjective /-! # The associated sheaf of a presheaf of modules In thi...
protected lemma smul_add : smul α φ r (m + m') = smul α φ r m + smul α φ r m' := by let S := Presheaf.imageSieve α r ⊓ Presheaf.imageSieve φ m ⊓ Presheaf.imageSieve φ m' have hS : S ∈ J X.unop := by refine J.intersection_covering (J.intersection_covering ?_ ?_) ?_ all_goals apply Presheaf.imageSieve_mem a...
Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafify.lean
238
249
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Sébastien Gouëzel, Yury Kudryashov -/ import Mathlib.Dynamics.Ergodic.MeasurePreserving import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Dia...
intro xs by_cases Hx : x ∈ ⋃ i : ↥s × ↥s, T i · rw [← hA] at Hx obtain ⟨p, pA, xp⟩ : ∃ p : ↥s × ↥s, p ∈ A ∧ x ∈ T p := by simpa only [mem_iUnion, exists_prop, SetCoe.exists, exists_and_right] using Hx apply h'x p pA ⟨xs, xp⟩ · exact False.elim (hx ⟨xs, Hx⟩)
Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean
659
686
/- Copyright (c) 2021 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ import Mathlib.Order.Interval.Finset.Basic /-! # Intervals as multisets This file defines intervals as multisets. ## Main declarations In a `LocallyFiniteOrder`, * `M...
rfl
Mathlib/Order/Interval/Multiset.lean
194
194
/- Copyright (c) 2020 Johan Commelin. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johan Commelin -/ import Mathlib.Algebra.Group.Basic import Mathlib.Algebra.GroupWithZero.NeZero import Mathlib.Logic.Unique import Mathlib.Tactic.Conv /-! # Groups with an adjoined z...
@[simp]
Mathlib/Algebra/GroupWithZero/Basic.lean
226
227
/- Copyright (c) 2022 Bhavik Mehta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bhavik Mehta -/ import Mathlib.Algebra.IsPrimePow import Mathlib.Data.Nat.Factorization.Basic import Mathlib.Data.Nat.Prime.Pow import Mathlib.NumberTheory.Divisors /-! # Prime powers a...
· rintro ⟨p, k, hp, hk, rfl⟩ refine ⟨p, ⟨hp, dvd_pow_self _ hk.ne'⟩, ?_⟩ rintro q ⟨hq, hq'⟩ exact (Nat.prime_dvd_prime_iff_eq hq hp).1 (hq.dvd_of_dvd_pow hq') rintro ⟨p, ⟨hp, hn⟩, hq⟩ rcases eq_or_ne n 0 with (rfl | hn₀) · cases (hq 2 ⟨Nat.prime_two, dvd_zero 2⟩).trans (hq 3 ⟨Nat.prime_three, dvd_ze...
Mathlib/Data/Nat/Factorization/PrimePow.lean
89
108
/- Copyright (c) 2021 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ import Mathlib.Topology.MetricSpace.HausdorffDistance /-! # Thickenings in pseudo-metric spaces ## Main definitions * `Metric.thickening δ s`, the open thickening by ra...
exact mem_iUnion₂.mpr ⟨y, hy₁, hy₂.le⟩ /-- The closed thickening of a compact set `E` is the union of the balls `Metric.closedBall x δ` over `x ∈ E`.
Mathlib/Topology/MetricSpace/Thickening.lean
528
532
/- Copyright (c) 2020 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kim Morrison, Ainsley Pahljina -/ import Mathlib.RingTheory.Fintype import Mathlib.Tactic.NormNum import Mathlib.Tactic.Ring import Mathlib.Tactic.Zify /-! # The Lucas-L...
end norm_num_ext end LucasLehmer /-! This implementation works successfully to prove `(2^4423 - 1).Prime`, and all the Mersenne primes up to this point appear in [Archive/Examples/MersennePrimes.lean]. These can be calculated nearly instantly, and `(2^9689 - 1).Prime` only fails due to deep recursion. (Note by kmil...
Mathlib/NumberTheory/LucasLehmer.lean
599
617
/- Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn -/ import Mathlib.Analysis.Calculus.ContDiff.Defs import Mathlib.Analysis.Calculus.ContDiff.FaaDiBruno import Mathlib.Analysis.Calculus.FDeriv.Ad...
Mathlib/Analysis/Calculus/ContDiff/Basic.lean
1,646
1,648
/- Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Minchao Wu, Mario Carneiro -/ import Mathlib.Data.Finset.Attach import Mathlib.Data.Finset.Disjoint import Mathlib.Data.Finset.Erase import Mat...
Mathlib/Data/Finset/Basic.lean
2,405
2,406
/- Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen -/ import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Integer import Mathli...
@[simp] lemma num_eq_zero (x : K) : IsFractionRing.num A x = 0 ↔ x = 0 :=
Mathlib/RingTheory/Localization/NumDen.lean
93
94
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov, Kexing Ying -/ import Mathlib.Topology.Semicontinuous import Mathlib.MeasureTheory.Function.AEMeasurableSequence import Mathlib.MeasureTheory.Order.Lat...
/-- Two measures which are finite on closed-open intervals are equal if they agree on all open-closed intervals. -/ theorem ext_of_Ioc {α : Type*} [TopologicalSpace α] {_m : MeasurableSpace α} [SecondCountableTopology α] [ConditionallyCompleteLinearOrder α] [OrderTopology α] [BorelSpace α] [NoMinOrder α] (μ ν :...
Mathlib/MeasureTheory/Constructions/BorelSpace/Order.lean
408
413
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Johan Commelin, Mario Carneiro -/ import Mathlib.Algebra.Algebra.Subalgebra.Lattice import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.GroupWithZero.Divisibili...
split_ifs with h · conv_rhs => rw [← coeff_mul_monomial _ s] congr with t
Mathlib/Algebra/MvPolynomial/Basic.lean
703
705
/- Copyright (c) 2019 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel -/ import Mathlib.Topology.ContinuousMap.Bounded.ArzelaAscoli import Mathlib.Topology.ContinuousMap.Bounded.Normed import Mathlib.Topology.MetricSpace.Gluing impor...
∀ x y : Y, f (Sum.inr x, Sum.inr y) = dist x y) ∧ ∀ x y, f (x, y) = f (y, x)) ∧ ∀ x y z, f (x, z) ≤ f (x, y) + f (y, z)) ∧ ∀ x, f (x, x) = 0) ∧
Mathlib/Topology/MetricSpace/GromovHausdorffRealized.lean
76
79
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Kim Morrison -/ import Mathlib.Algebra.Group.Indicator import Mathlib.Algebra.Group.InjSurj import Mathlib.Data.Set.Finite.Basic import Mathlib.Tactic.FastInstance impo...
Mathlib/Data/Finsupp/Defs.lean
807
808
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Ordmap.Invariants /-! # Verification of `Ordnode` This file uses the invariants defined in `Mathlib.Data.Ordmap.Invariants` to construct `Ordset...
rcases H2 with (⟨hl, rfl⟩ | ⟨hr, rfl⟩) <;> rcases H1 with (h | ⟨_, h₂⟩) · exact le_trans (Nat.le_add_left _ _) (le_trans h (Nat.le_add_left _ _)) · exact
Mathlib/Data/Ordmap/Ordset.lean
316
318
/- Copyright (c) 2023 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ import Mathlib.Algebra.Order.Module.OrderedSMul import Mathlib.Algebra.Order.Module.Synonym import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax import Mathlib.Order.Mono...
AntivaryOn (f ^ n) g s := fun _i hi _j hj hij ↦ pow_le_pow_left' (hfg hi hj hij) _
Mathlib/Algebra/Order/Monovary.lean
62
62
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Floris van Doorn, Violeta Hernández Palacios -/ import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Nat.SuccPred import Mathlib.Order.SuccPred.Initial...
/-! ### Normal ordinal functions -/
Mathlib/SetTheory/Ordinal/Arithmetic.lean
359
360
/- Copyright (c) 2015, 2017 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Robert Y. Lewis, Johannes Hölzl, Mario Carneiro, Sébastien Gouëzel -/ import Mathlib.Data.ENNReal.Real import Mathlib.Tactic.Bound.Attribute import Mathlib.Topology...
Mathlib/Topology/MetricSpace/Pseudo/Defs.lean
1,476
1,477
/- Copyright (c) 2021 Oliver Nash. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Oliver Nash -/ import Mathlib.Algebra.Lie.Subalgebra import Mathlib.LinearAlgebra.Finsupp.Span /-! # Lie submodules of a Lie algebra In this file we define Lie submodules, we construct ...
Mathlib/Algebra/Lie/Submodule.lean
1,174
1,176
/- Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies -/ import Mathlib.Algebra.Group.Action.Pointwise.Finset import Mathlib.Data.Real.Basic import Mathlib.SetTheory.Cardinal.Finite import Mathlib.Tactic.Positivity.Finset /-! ...
variable {A B : Set G} /-- **Ruzsa's covering lemma** for sets. See also `Finset.ruzsa_covering_mul`. -/ @[to_additive "**Ruzsa's covering lemma** for sets. See also `Finset.ruzsa_covering_add`."] lemma ruzsa_covering_mul (hA : A.Finite) (hB : B.Finite) (hB₀ : B.Nonempty) (hK : Nat.card (A * B) ≤ K * Nat.card B) :...
Mathlib/Combinatorics/Additive/RuzsaCovering.lean
62
75
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Yury Kudryashov -/ import Mathlib.Data.ENNReal.Basic /-! # Maps between real and extended non-negative real numbers This file focuses on the functions `ENNReal.toReal...
(tsub_le_iff_right.1 <| le_iInf fun _ => tsub_le_iff_right.2 <| iInf_le _ _)
Mathlib/Data/ENNReal/Real.lean
429
429
/- Copyright (c) 2022 Michael Stoll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Michael Stoll -/ import Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol /-! # A `norm_num` extension for Jacobi and Legendre symbols We extend the `norm_num` tactic so that it can be...
change 2 ∣ (a : ℤ).gcd b at h rw [hf, ← even_iff_two_dvd] at h exact Nat.not_even_one h
Mathlib/Tactic/NormNum/LegendreSymbol.lean
103
105
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Jeremy Avigad, Simon Hudon -/ import Mathlib.Algebra.Notation.Defs import Mathlib.Data.Set.Subsingleton import Mathlib.Logic.Equiv.Defs /-! # Partial values of a type ...
| _, ⟨_, rfl⟩ => ⟨_, ⟨_, rfl⟩, rfl⟩,
Mathlib/Data/Part.lean
379
379