Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Finset.Image import Mathlib.Data.Multiset.Fold #align_import data.finset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" -- TODO: -- assert_not_exists OrderedComm...
Mathlib/Data/Finset/Fold.lean
116
120
theorem fold_union_inter [DecidableEq Ξ±] {s₁ sβ‚‚ : Finset Ξ±} {b₁ bβ‚‚ : Ξ²} : ((s₁ βˆͺ sβ‚‚).fold op b₁ f * (s₁ ∩ sβ‚‚).fold op bβ‚‚ f) = s₁.fold op bβ‚‚ f * sβ‚‚.fold op b₁ f := by
unfold fold rw [← fold_add op, ← Multiset.map_add, union_val, inter_val, union_add_inter, Multiset.map_add, hc.comm, fold_add]
import Mathlib.CategoryTheory.Adjunction.FullyFaithful import Mathlib.CategoryTheory.Conj import Mathlib.CategoryTheory.Functor.ReflectsIso #align_import category_theory.adjunction.reflective from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ noncomputable s...
Mathlib/CategoryTheory/Adjunction/Reflective.lean
87
89
theorem Functor.essImage.unit_isIso [Reflective i] {A : C} (h : A ∈ i.essImage) : IsIso ((reflectorAdjunction i).unit.app A) := by
rwa [isIso_unit_app_iff_mem_essImage]
import Mathlib.LinearAlgebra.TensorProduct.Graded.External import Mathlib.RingTheory.GradedAlgebra.Basic import Mathlib.GroupTheory.GroupAction.Ring suppress_compilation open scoped TensorProduct variable {R ΞΉ A B : Type*} variable [CommSemiring ΞΉ] [Module ΞΉ (Additive β„€Λ£)] [DecidableEq ΞΉ] variable [CommRing R] [R...
Mathlib/LinearAlgebra/TensorProduct/Graded/Internal.lean
133
135
theorem auxEquiv_one : auxEquiv R π’œ ℬ 1 = 1 := by
rw [← of_one, Algebra.TensorProduct.one_def, auxEquiv_tmul π’œ ℬ, DirectSum.decompose_one, DirectSum.decompose_one, Algebra.TensorProduct.one_def]
import Mathlib.RingTheory.Finiteness import Mathlib.Logic.Equiv.TransferInstance universe u v w open Function variable (R : Type u) [Semiring R] @[mk_iff] class OrzechProperty : Prop where injective_of_surjective_of_submodule' : βˆ€ {M : Type u} [AddCommMonoid M] [Module R M] [Module.Finite R M] {N : Submod...
Mathlib/RingTheory/OrzechProperty.lean
69
82
theorem injective_of_surjective_of_injective {N : Type w} [AddCommMonoid N] [Module R N] (i f : N β†’β‚—[R] M) (hi : Injective i) (hf : Surjective f) : Injective f := by
obtain ⟨n, g, hg⟩ := Module.Finite.exists_fin' R M haveI := small_of_surjective hg letI := Equiv.addCommMonoid (equivShrink M).symm letI := Equiv.module R (equivShrink M).symm let j : Shrink.{u} M ≃ₗ[R] M := Equiv.linearEquiv R (equivShrink M).symm haveI := Module.Finite.equiv j.symm let i' := j.symm.toL...
import Mathlib.LinearAlgebra.Dual open Function Module variable (R M N : Type*) [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] structure PerfectPairing := toLin : M β†’β‚—[R] N β†’β‚—[R] R bijectiveLeft : Bijective toLin bijectiveRight : Bijective toLin.flip attribute [nolint docBlame] P...
Mathlib/LinearAlgebra/PerfectPairing.lean
102
105
theorem toDualRight_symm_comp_toDualLeft : p.toDualRight.symm.dualMap βˆ˜β‚— (p.toDualLeft : M β†’β‚—[R] Dual R N) = Dual.eval R M := by
ext1 x exact p.toDualRight_symm_toDualLeft x
import Mathlib.Algebra.Polynomial.Module.Basic import Mathlib.Analysis.Calculus.Deriv.Pow import Mathlib.Analysis.Calculus.IteratedDeriv.Defs import Mathlib.Analysis.Calculus.MeanValue #align_import analysis.calculus.taylor from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14" open scoped...
Mathlib/Analysis/Calculus/Taylor.lean
141
146
theorem monomial_has_deriv_aux (t x : ℝ) (n : β„•) : HasDerivAt (fun y => (x - y) ^ (n + 1)) (-(n + 1) * (x - t) ^ n) t := by
simp_rw [sub_eq_neg_add] rw [← neg_one_mul, mul_comm (-1 : ℝ), mul_assoc, mul_comm (-1 : ℝ), ← mul_assoc] convert HasDerivAt.pow (n + 1) ((hasDerivAt_id t).neg.add_const x) simp only [Nat.cast_add, Nat.cast_one]
import Mathlib.CategoryTheory.NatIso import Mathlib.CategoryTheory.EqToHom #align_import category_theory.quotient from "leanprover-community/mathlib"@"740acc0e6f9adf4423f92a485d0456fc271482da" def HomRel (C) [Quiver C] := βˆ€ ⦃X Y : C⦄, (X ⟢ Y) β†’ (X ⟢ Y) β†’ Prop #align hom_rel HomRel -- Porting Note: `deriving I...
Mathlib/CategoryTheory/Quotient.lean
65
66
theorem CompClosure.of {a b : C} (m₁ mβ‚‚ : a ⟢ b) (h : r m₁ mβ‚‚) : CompClosure r m₁ mβ‚‚ := by
simpa using CompClosure.intro (πŸ™ _) m₁ mβ‚‚ (πŸ™ _) h
import Mathlib.Combinatorics.SimpleGraph.DegreeSum import Mathlib.Combinatorics.SimpleGraph.Subgraph #align_import combinatorics.simple_graph.matching from "leanprover-community/mathlib"@"138448ae98f529ef34eeb61114191975ee2ca508" universe u namespace SimpleGraph variable {V : Type u} {G : SimpleGraph V} (M : Su...
Mathlib/Combinatorics/SimpleGraph/Matching.lean
63
67
theorem IsMatching.toEdge_eq_of_adj {M : Subgraph G} (h : M.IsMatching) {v w : V} (hv : v ∈ M.verts) (hvw : M.Adj v w) : h.toEdge ⟨v, hv⟩ = ⟨s(v, w), hvw⟩ := by
simp only [IsMatching.toEdge, Subtype.mk_eq_mk] congr exact ((h (M.edge_vert hvw)).choose_spec.2 w hvw).symm
import Mathlib.NumberTheory.BernoulliPolynomials import Mathlib.MeasureTheory.Integral.IntervalIntegral import Mathlib.Analysis.Calculus.Deriv.Polynomial import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.PSeries #align_import number_theory.zeta_values from "leanprover-community/mathlib"@"f0c8bf9245297...
Mathlib/NumberTheory/ZetaValues.lean
80
87
theorem integral_bernoulliFun_eq_zero {k : β„•} (hk : k β‰  0) : ∫ x : ℝ in (0)..1, bernoulliFun k x = 0 := by
rw [integral_eq_sub_of_hasDerivAt (fun x _ => antideriv_bernoulliFun k x) ((Polynomial.continuous _).intervalIntegrable _ _)] rw [bernoulliFun_eval_one] split_ifs with h Β· exfalso; exact hk (Nat.succ_inj'.mp h) Β· simp
import Mathlib.NumberTheory.Cyclotomic.Discriminant import Mathlib.RingTheory.Polynomial.Eisenstein.IsIntegral import Mathlib.RingTheory.Ideal.Norm #align_import number_theory.cyclotomic.rat from "leanprover-community/mathlib"@"b353176c24d96c23f0ce1cc63efc3f55019702d9" universe u open Algebra IsCyclotomicExtensio...
Mathlib/NumberTheory/Cyclotomic/Rat.lean
65
69
theorem discr_prime_pow_eq_unit_mul_pow' [IsCyclotomicExtension {p ^ k} β„š K] (hΞΆ : IsPrimitiveRoot ΞΆ ↑(p ^ k)) : βˆƒ (u : β„€Λ£) (n : β„•), discr β„š (hΞΆ.subOnePowerBasis β„š).basis = u * p ^ n := by
rw [hΞΆ.discr_zeta_eq_discr_zeta_sub_one.symm] exact discr_prime_pow_eq_unit_mul_pow hΞΆ (cyclotomic.irreducible_rat (p ^ k).pos)
import Mathlib.Analysis.Calculus.FDeriv.Equiv import Mathlib.Analysis.Calculus.FormalMultilinearSeries #align_import analysis.calculus.cont_diff_def from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14" noncomputable section open scoped Classical open NNReal Topology Filter local notatio...
Mathlib/Analysis/Calculus/ContDiff/Defs.lean
204
208
theorem HasFTaylorSeriesUpToOn.congr (h : HasFTaylorSeriesUpToOn n f p s) (h₁ : βˆ€ x ∈ s, f₁ x = f x) : HasFTaylorSeriesUpToOn n f₁ p s := by
refine ⟨fun x hx => ?_, h.fderivWithin, h.cont⟩ rw [h₁ x hx] exact h.zero_eq x hx
import Mathlib.Algebra.Group.Even import Mathlib.Algebra.Order.Monoid.Canonical.Defs import Mathlib.Algebra.Order.Sub.Defs #align_import algebra.order.sub.canonical from "leanprover-community/mathlib"@"62a5626868683c104774de8d85b9855234ac807c" variable {Ξ± : Type*} section ExistsAddOfLE variable [AddCommSemigrou...
Mathlib/Algebra/Order/Sub/Canonical.lean
44
45
theorem tsub_le_tsub_iff_right (h : c ≀ b) : a - c ≀ b - c ↔ a ≀ b := by
rw [tsub_le_iff_right, tsub_add_cancel_of_le h]
import Mathlib.Algebra.Order.Ring.Defs import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Sym.Card open Finset Function namespace SimpleGraph variable {V : Type*} (G : SimpleGraph V) {e : Sym2 V} section EdgeFinset variable {G₁ Gβ‚‚ : SimpleGraph V} [Fintype G.edgeSet] [Fintype G₁.edgeSet] [Finty...
Mathlib/Combinatorics/SimpleGraph/Finite.lean
94
95
theorem edgeFinset_sup [Fintype (edgeSet (G₁ βŠ” Gβ‚‚))] [DecidableEq V] : (G₁ βŠ” Gβ‚‚).edgeFinset = G₁.edgeFinset βˆͺ Gβ‚‚.edgeFinset := by
simp [edgeFinset]
import Mathlib.Order.Bounds.Basic import Mathlib.Order.WellFounded import Mathlib.Data.Set.Image import Mathlib.Order.Interval.Set.Basic import Mathlib.Data.Set.Lattice #align_import order.conditionally_complete_lattice.basic from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1" open Func...
Mathlib/Order/ConditionallyCompleteLattice/Basic.lean
110
113
theorem WithTop.coe_iInf [Nonempty ΞΉ] [InfSet Ξ±] {f : ΞΉ β†’ Ξ±} (hf : BddBelow (range f)) : ↑(β¨… i, f i) = (β¨… i, f i : WithTop Ξ±) := by
rw [iInf, iInf, WithTop.coe_sInf' (range_nonempty f) hf, ← range_comp] rfl
import Mathlib.NumberTheory.Liouville.Basic #align_import number_theory.liouville.liouville_number from "leanprover-community/mathlib"@"04e80bb7e8510958cd9aacd32fe2dc147af0b9f1" noncomputable section open scoped Nat open Real Finset def liouvilleNumber (m : ℝ) : ℝ := βˆ‘' i : β„•, 1 / m ^ i ! #align liouville_n...
Mathlib/NumberTheory/Liouville/LiouvilleNumber.lean
110
134
theorem remainder_lt' (n : β„•) {m : ℝ} (m1 : 1 < m) : remainder m n < (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) := -- two useful inequalities have m0 : 0 < m := zero_lt_one.trans m1 have mi : 1 / m < 1 := (div_lt_one m0).mpr m1 -- to show the strict inequality between these series, we prove that: calc (βˆ‘' i, ...
simp only [pow_add, one_div, mul_inv, inv_pow] -- factor the constant `(1 / m ^ (n + 1)!)` out of the series _ = (βˆ‘' i, (1 / m) ^ i) * (1 / m ^ (n + 1)!) := tsum_mul_right -- the series is the geometric series _ = (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) := by rw [tsum_geometric_of_lt_one (by positivit...
import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.BilinearMap #align_import linear_algebra.basis.bilinear from "leanprover-community/mathlib"@"87c54600fe3cdc7d32ff5b50873ac724d86aef8d" namespace LinearMap variable {ι₁ ΞΉβ‚‚ : Type*} variable {R Rβ‚‚ S Sβ‚‚ M N P Rβ‚— : Type*} variable {Mβ‚— Nβ‚— Pβ‚— : Type*} --...
Mathlib/LinearAlgebra/Basis/Bilinear.lean
44
49
theorem sum_repr_mul_repr_mulβ‚›β‚— {B : M β†’β‚›β‚—[ρ₁₂] N β†’β‚›β‚—[σ₁₂] P} (x y) : ((b₁.repr x).sum fun i xi => (bβ‚‚.repr y).sum fun j yj => ρ₁₂ xi β€’ σ₁₂ yj β€’ B (b₁ i) (bβ‚‚ j)) = B x y := by
conv_rhs => rw [← b₁.total_repr x, ← bβ‚‚.total_repr y] simp_rw [Finsupp.total_apply, Finsupp.sum, map_sumβ‚‚, map_sum, LinearMap.map_smulβ‚›β‚—β‚‚, LinearMap.map_smulβ‚›β‚—]
import Mathlib.Algebra.Group.Hom.Defs #align_import algebra.group.ext from "leanprover-community/mathlib"@"e574b1a4e891376b0ef974b926da39e05da12a06" assert_not_exists MonoidWithZero assert_not_exists DenselyOrdered open Function universe u @[to_additive (attr := ext)] theorem Monoid.ext {M : Type u} ⦃m₁ mβ‚‚ : Mo...
Mathlib/Algebra/Group/Ext.lean
103
106
theorem CancelMonoid.toLeftCancelMonoid_injective {M : Type u} : Function.Injective (@CancelMonoid.toLeftCancelMonoid M) := by
rintro ⟨⟩ ⟨⟩ h congr
import Mathlib.MeasureTheory.Integral.IntervalIntegral import Mathlib.Analysis.Calculus.Deriv.ZPow import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.SpecialFunctions.NonIntegrable import Mathlib.Analysis.Analytic.Basic #align_import measure_theory.integral.circle_integral from "leanprover-communit...
Mathlib/MeasureTheory/Integral/CircleIntegral.lean
130
131
theorem circleMap_not_mem_ball (c : β„‚) (R : ℝ) (ΞΈ : ℝ) : circleMap c R ΞΈ βˆ‰ ball c R := by
simp [dist_eq, le_abs_self]
import Mathlib.Analysis.SpecialFunctions.Complex.Arg import Mathlib.Analysis.SpecialFunctions.Log.Basic #align_import analysis.special_functions.complex.log from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section namespace Complex open Set Filter Bornology open scop...
Mathlib/Analysis/SpecialFunctions/Complex/Log.lean
124
128
theorem log_conj_eq_ite (x : β„‚) : log (conj x) = if x.arg = Ο€ then log x else conj (log x) := by
simp_rw [log, abs_conj, arg_conj, map_add, map_mul, conj_ofReal] split_ifs with hx Β· rw [hx] simp_rw [ofReal_neg, conj_I, mul_neg, neg_mul]
import Mathlib.NumberTheory.FLT.Basic import Mathlib.NumberTheory.PythagoreanTriples import Mathlib.RingTheory.Coprime.Lemmas import Mathlib.Tactic.LinearCombination #align_import number_theory.fermat4 from "leanprover-community/mathlib"@"10b4e499f43088dd3bb7b5796184ad5216648ab1" noncomputable section open scope...
Mathlib/NumberTheory/FLT/Four.lean
114
120
theorem neg_of_minimal {a b c : β„€} : Minimal a b c β†’ Minimal a b (-c) := by
rintro ⟨⟨ha, hb, heq⟩, h2⟩ constructor · apply And.intro ha (And.intro hb _) rw [heq] exact (neg_sq c).symm rwa [Int.natAbs_neg c]
import Mathlib.Analysis.Calculus.LineDeriv.Basic import Mathlib.MeasureTheory.Integral.IntegralEqImproper open MeasureTheory Measure FiniteDimensional variable {E F G W : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] [NormedAddCo...
Mathlib/Analysis/Calculus/LineDeriv/IntegrationByParts.lean
101
151
theorem integral_bilinear_hasLineDerivAt_right_eq_neg_left_of_integrable {f f' : E β†’ F} {g g' : E β†’ G} {v : E} {B : F β†’L[ℝ] G β†’L[ℝ] W} (hf'g : Integrable (fun x ↦ B (f' x) (g x)) ΞΌ) (hfg' : Integrable (fun x ↦ B (f x) (g' x)) ΞΌ) (hfg : Integrable (fun x ↦ B (f x) (g x)) ΞΌ) (hf : βˆ€ x, HasLineDerivAt ℝ f ...
by_cases hW : CompleteSpace W; swap Β· simp [integral, hW] rcases eq_or_ne v 0 with rfl|hv Β· have Hf' x : f' x = 0 := by simpa [(hasLineDerivAt_zero (f := f) (x := x)).lineDeriv] using (hf x).lineDeriv.symm have Hg' x : g' x = 0 := by simpa [(hasLineDerivAt_zero (f := g) (x := x)).lineDeriv] usi...
import Mathlib.GroupTheory.CoprodI import Mathlib.GroupTheory.Coprod.Basic import Mathlib.GroupTheory.QuotientGroup import Mathlib.GroupTheory.Complement namespace Monoid open CoprodI Subgroup Coprod Function List variable {ΞΉ : Type*} {G : ΞΉ β†’ Type*} {H : Type*} {K : Type*} [Monoid K] def PushoutI.con [βˆ€ i, Mo...
Mathlib/GroupTheory/PushoutI.lean
88
93
theorem of_comp_eq_base (i : ΞΉ) : (of i).comp (Ο† i) = (base Ο†) := by
ext x apply (Con.eq _).2 refine ConGen.Rel.of _ _ ?_ simp only [MonoidHom.comp_apply, Set.mem_iUnion, Set.mem_range] exact ⟨_, _, rfl, rfl⟩
import Mathlib.Dynamics.BirkhoffSum.Basic import Mathlib.Algebra.Module.Basic open Finset section birkhoffAverage variable (R : Type*) {Ξ± M : Type*} [DivisionSemiring R] [AddCommMonoid M] [Module R M] def birkhoffAverage (f : Ξ± β†’ Ξ±) (g : Ξ± β†’ M) (n : β„•) (x : Ξ±) : M := (n : R)⁻¹ β€’ birkhoffSum f g n x theorem bir...
Mathlib/Dynamics/BirkhoffSum/Average.lean
68
70
theorem birkhoffAverage_congr_ring' (S : Type*) [DivisionSemiring S] [Module S M] : birkhoffAverage (Ξ± := Ξ±) (M := M) R = birkhoffAverage S := by
ext; apply birkhoffAverage_congr_ring
import Mathlib.Algebra.MvPolynomial.Counit import Mathlib.Algebra.MvPolynomial.Invertible import Mathlib.RingTheory.WittVector.Defs #align_import ring_theory.witt_vector.basic from "leanprover-community/mathlib"@"9556784a5b84697562e9c6acb40500d4a82e675a" noncomputable section open MvPolynomial Function variable...
Mathlib/RingTheory/WittVector/Basic.lean
126
126
theorem pow (n : β„•) : mapFun f (x ^ n) = mapFun f x ^ n := by
map_fun_tac
import Mathlib.Probability.IdentDistrib import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Analysis.SpecificLimits.FloorPow import Mathlib.Analysis.PSeries import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import probability.strong_law from "leanprover-community/mathlib"@"f2ce60867...
Mathlib/Probability/StrongLaw.lean
114
123
theorem truncation_eq_of_nonneg {f : Ξ± β†’ ℝ} {A : ℝ} (h : βˆ€ x, 0 ≀ f x) : truncation f A = indicator (Set.Ioc 0 A) id ∘ f := by
ext x rcases (h x).lt_or_eq with (hx | hx) Β· simp only [truncation, indicator, hx, Set.mem_Ioc, id, Function.comp_apply, true_and_iff] by_cases h'x : f x ≀ A Β· have : -A < f x := by linarith [h x] simp only [this, true_and_iff] Β· simp only [h'x, and_false_iff] Β· simp only [truncation, indicat...
import Mathlib.Algebra.Module.Defs import Mathlib.SetTheory.Cardinal.Basic open Function universe u v namespace Cardinal
Mathlib/Algebra/Module/Card.lean
24
29
theorem mk_le_of_module (R : Type u) (E : Type v) [AddCommGroup E] [Ring R] [Module R E] [Nontrivial E] [NoZeroSMulDivisors R E] : Cardinal.lift.{v} (#R) ≀ Cardinal.lift.{u} (#E) := by
obtain ⟨x, hx⟩ : βˆƒ (x : E), x β‰  0 := exists_ne 0 have : Injective (fun k ↦ k β€’ x) := smul_left_injective R hx exact lift_mk_le_lift_mk_of_injective this
import Mathlib.Topology.Basic #align_import topology.nhds_set from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set Filter Topology variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] {f : Filter X} {s t s₁ sβ‚‚ t₁ tβ‚‚ : Set X} {x : X} theorem nhdsSet_diagonal (X) [T...
Mathlib/Topology/NhdsSet.lean
56
58
theorem disjoint_principal_nhdsSet : Disjoint (π“Ÿ s) (𝓝˒ t) ↔ Disjoint (closure s) t := by
rw [disjoint_principal_left, ← subset_interior_iff_mem_nhdsSet, interior_compl, subset_compl_iff_disjoint_left]
import Mathlib.Combinatorics.SimpleGraph.Connectivity import Mathlib.Tactic.Linarith #align_import combinatorics.simple_graph.acyclic from "leanprover-community/mathlib"@"b07688016d62f81d14508ff339ea3415558d6353" universe u v namespace SimpleGraph open Walk variable {V : Type u} (G : SimpleGraph V) def IsAcy...
Mathlib/Combinatorics/SimpleGraph/Acyclic.lean
68
80
theorem isAcyclic_iff_forall_adj_isBridge : G.IsAcyclic ↔ βˆ€ ⦃v w : V⦄, G.Adj v w β†’ G.IsBridge s(v, w) := by
simp_rw [isBridge_iff_adj_and_forall_cycle_not_mem] constructor · intro ha v w hvw apply And.intro hvw intro u p hp cases ha p hp · rintro hb v (_ | ⟨ha, p⟩) hp · exact hp.not_of_nil · apply (hb ha).2 _ hp rw [Walk.edges_cons] apply List.mem_cons_self
import Mathlib.Data.ENNReal.Real #align_import data.real.conjugate_exponents from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" noncomputable section open scoped ENNReal namespace Real @[mk_iff] structure IsConjExponent (p q : ℝ) : Prop where one_lt : 1 < p inv_add_inv_conj : p⁻...
Mathlib/Data/Real/ConjExponents.lean
101
102
theorem mul_eq_add : p * q = p + q := by
simpa only [sub_mul, sub_eq_iff_eq_add, one_mul] using h.sub_one_mul_conj
import Mathlib.SetTheory.Ordinal.Arithmetic import Mathlib.Tactic.TFAE import Mathlib.Topology.Order.Monotone #align_import set_theory.ordinal.topology from "leanprover-community/mathlib"@"740acc0e6f9adf4423f92a485d0456fc271482da" noncomputable section universe u v open Cardinal Order Topology namespace Ordina...
Mathlib/SetTheory/Ordinal/Topology.lean
76
82
theorem isOpen_iff : IsOpen s ↔ βˆ€ o ∈ s, IsLimit o β†’ βˆƒ a < o, Set.Ioo a o βŠ† s := by
refine isOpen_iff_mem_nhds.trans <| forallβ‚‚_congr fun o ho => ?_ by_cases ho' : IsLimit o Β· simp only [(nhdsBasis_Ioc ho'.1).mem_iff, ho', true_implies] refine exists_congr fun a => and_congr_right fun ha => ?_ simp only [← Set.Ioo_insert_right ha, Set.insert_subset_iff, ho, true_and] Β· simp [nhds_eq_p...
import Mathlib.Data.Real.Basic #align_import data.real.sign from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" namespace Real noncomputable def sign (r : ℝ) : ℝ := if r < 0 then -1 else if 0 < r then 1 else 0 #align real.sign Real.sign theorem sign_of_neg {r : ℝ} (hr : r < 0) : si...
Mathlib/Data/Real/Sign.lean
119
123
theorem sign_inv (r : ℝ) : sign r⁻¹ = sign r := by
obtain hn | rfl | hp := lt_trichotomy r (0 : ℝ) Β· rw [sign_of_neg hn, sign_of_neg (inv_lt_zero.mpr hn)] Β· rw [sign_zero, inv_zero, sign_zero] Β· rw [sign_of_pos hp, sign_of_pos (inv_pos.mpr hp)]
import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.FDeriv.Comp import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars #align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" universe u v w open scoped Classical open Top...
Mathlib/Analysis/Calculus/Deriv/Comp.lean
368
371
theorem HasFDerivAt.comp_hasDerivWithinAt_of_eq (hl : HasFDerivAt l l' y) (hf : HasDerivWithinAt f f' s x) (hy : y = f x) : HasDerivWithinAt (l ∘ f) (l' f') s x := by
rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf
import Mathlib.SetTheory.Ordinal.Arithmetic #align_import set_theory.ordinal.exponential from "leanprover-community/mathlib"@"b67044ba53af18680e1dd246861d9584e968495d" noncomputable section open Function Cardinal Set Equiv Order open scoped Classical open Cardinal Ordinal universe u v w namespace Ordinal in...
Mathlib/SetTheory/Ordinal/Exponential.lean
94
102
theorem opow_pos {a : Ordinal} (b : Ordinal) (a0 : 0 < a) : 0 < a ^ b := by
have h0 : 0 < a ^ (0 : Ordinal) := by simp only [opow_zero, zero_lt_one] induction b using limitRecOn with | H₁ => exact h0 | Hβ‚‚ b IH => rw [opow_succ] exact mul_pos IH a0 | H₃ b l _ => exact (lt_opow_of_limit (Ordinal.pos_iff_ne_zero.1 a0) l).2 ⟨0, l.pos, h0⟩
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"@"3f655f5297b030...
Mathlib/Analysis/InnerProductSpace/Basic.lean
239
241
theorem inner_smul_right (x y : F) {r : π•œ} : βŸͺx, r β€’ y⟫ = r * βŸͺx, y⟫ := by
rw [← inner_conj_symm, inner_smul_left]; simp only [conj_conj, inner_conj_symm, RingHom.map_mul]
import Mathlib.Data.Set.Function import Mathlib.Order.Interval.Set.OrdConnected #align_import data.set.intervals.proj_Icc from "leanprover-community/mathlib"@"4e24c4bfcff371c71f7ba22050308aa17815626c" variable {α β : Type*} [LinearOrder α] open Function namespace Set def projIci (a x : α) : Ici a := ⟨max a x,...
Mathlib/Order/Interval/Set/ProjIcc.lean
132
134
theorem projIcc_val (x : Icc a b) : projIcc a b h x = x := by
cases x apply projIcc_of_mem
import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" noncomputable section open RCLike Real ...
Mathlib/Analysis/InnerProductSpace/Calculus.lean
359
362
theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffOn_iff, contDiffOn_pi] rfl
import Mathlib.Algebra.Order.Group.OrderIso import Mathlib.Algebra.Order.Monoid.OrderDual import Mathlib.Data.Set.Pointwise.Basic import Mathlib.Order.Bounds.OrderIso import Mathlib.Order.ConditionallyCompleteLattice.Basic #align_import algebra.bounds from "leanprover-community/mathlib"@"dd71334db81d0bd444af1ee339a29...
Mathlib/Algebra/Bounds.lean
175
176
theorem ciSup_div (hf : BddAbove (range f)) (a : G) : (⨆ i, f i) / a = ⨆ i, f i / a := by
simp only [div_eq_mul_inv, ciSup_mul hf]
import Mathlib.AlgebraicTopology.SimplexCategory import Mathlib.CategoryTheory.Comma.Arrow import Mathlib.CategoryTheory.Limits.FunctorCategory import Mathlib.CategoryTheory.Opposites #align_import algebraic_topology.simplicial_object from "leanprover-community/mathlib"@"5ed51dc37c6b891b79314ee11a50adc2b1df6fd6" o...
Mathlib/AlgebraicTopology/SimplicialObject.lean
154
156
theorem Ξ΄_comp_Οƒ_self {n} {i : Fin (n + 1)} : X.Οƒ i ≫ X.Ξ΄ (Fin.castSucc i) = πŸ™ _ := by
dsimp [Ξ΄, Οƒ] simp only [← X.map_comp, ← op_comp, SimplexCategory.Ξ΄_comp_Οƒ_self, op_id, X.map_id]
import Mathlib.Algebra.Module.DedekindDomain import Mathlib.LinearAlgebra.FreeModule.PID import Mathlib.Algebra.Module.Projective import Mathlib.Algebra.Category.ModuleCat.Biproducts import Mathlib.RingTheory.SimpleModule #align_import algebra.module.pid from "leanprover-community/mathlib"@"cdc34484a07418af43daf8198b...
Mathlib/Algebra/Module/PID.lean
75
84
theorem Submodule.isInternal_prime_power_torsion_of_pid [Module.Finite R M] (hM : Module.IsTorsion R M) : DirectSum.IsInternal fun p : (factors (⊀ : Submodule R M).annihilator).toFinset => torsionBy R M (IsPrincipal.generator (p : Ideal R) ^ (factors (⊀ : Submodule R M).annihilator).coun...
convert isInternal_prime_power_torsion hM ext p : 1 rw [← torsionBySet_span_singleton_eq, Ideal.submodule_span_eq, ← Ideal.span_singleton_pow, Ideal.span_singleton_generator]
import Mathlib.Algebra.Polynomial.Splits import Mathlib.RingTheory.MvPolynomial.Symmetric #align_import ring_theory.polynomial.vieta from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" open Polynomial namespace Multiset open Polynomial section Semiring variable {R : Type*} [CommSemi...
Mathlib/RingTheory/Polynomial/Vieta.lean
75
77
theorem prod_X_add_C_coeff' {Οƒ} (s : Multiset Οƒ) (r : Οƒ β†’ R) {k : β„•} (h : k ≀ Multiset.card s) : (s.map fun i => X + C (r i)).prod.coeff k = (s.map r).esymm (Multiset.card s - k) := by
erw [← map_map (fun r => X + C r) r, prod_X_add_C_coeff] <;> rw [s.card_map r]; assumption
import Mathlib.Analysis.Convex.Between import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import Mathlib.MeasureTheory.Measure.Lebesgue.Basic import Mathlib.Topology.MetricSpace.Holder import Mathlib.Topology.MetricSpace.MetricSeparated #align_import measure_theory.measure.hausdorff from "leanprover-communit...
Mathlib/MeasureTheory/Measure/Hausdorff.lean
309
315
theorem trim_pre [MeasurableSpace X] [OpensMeasurableSpace X] (m : Set X β†’ ℝβ‰₯0∞) (hcl : βˆ€ s, m (closure s) = m s) (r : ℝβ‰₯0∞) : (pre m r).trim = pre m r := by
refine le_antisymm (le_pre.2 fun s hs => ?_) (le_trim _) rw [trim_eq_iInf] refine iInf_le_of_le (closure s) <| iInf_le_of_le subset_closure <| iInf_le_of_le measurableSet_closure ((pre_le ?_).trans_eq (hcl _)) rwa [diam_closure]
import Mathlib.Algebra.GroupPower.IterateHom import Mathlib.Algebra.Ring.Divisibility.Basic import Mathlib.Data.List.Cycle import Mathlib.Data.Nat.Prime import Mathlib.Data.PNat.Basic import Mathlib.Dynamics.FixedPoints.Basic import Mathlib.GroupTheory.GroupAction.Group #align_import dynamics.periodic_pts from "leanp...
Mathlib/Dynamics/PeriodicPts.lean
595
596
theorem iterate_prod_map (f : Ξ± β†’ Ξ±) (g : Ξ² β†’ Ξ²) (n : β„•) : (Prod.map f g)^[n] = Prod.map (f^[n]) (g^[n]) := by
induction n <;> simp [*, Prod.map_comp_map]
import Mathlib.Algebra.Ring.Int import Mathlib.GroupTheory.PresentedGroup import Mathlib.GroupTheory.Coxeter.Matrix open Function Set List namespace CoxeterMatrix variable {B B' : Type*} (M : CoxeterMatrix B) (e : B ≃ B') def relation (i i' : B) : FreeGroup B := (FreeGroup.of i * FreeGroup.of i') ^ M i i' d...
Mathlib/GroupTheory/Coxeter/Basic.lean
110
119
theorem reindex_relationsSet : (M.reindex e).relationsSet = FreeGroup.freeGroupCongr e '' M.relationsSet := let M' := M.reindex e; calc Set.range (uncurry M'.relation) _ = Set.range (uncurry M'.relation ∘ Prod.map e e) := by
simp [Set.range_comp] _ = Set.range (FreeGroup.freeGroupCongr e ∘ uncurry M.relation) := by apply congrArg Set.range ext ⟨i, i'⟩ simp [relation, reindex_apply, M'] _ = _ := by simp [Set.range_comp, relationsSet]
import Mathlib.Data.Int.Bitwise import Mathlib.Data.Int.Order.Lemmas import Mathlib.Data.Set.Function import Mathlib.Order.Interval.Set.Basic #align_import data.int.lemmas from "leanprover-community/mathlib"@"09597669f02422ed388036273d8848119699c22f" open Nat namespace Int theorem le_natCast_sub (m n : β„•) : (m ...
Mathlib/Data/Int/Lemmas.lean
55
57
theorem natAbs_le_iff_sq_le {a b : β„€} : a.natAbs ≀ b.natAbs ↔ a ^ 2 ≀ b ^ 2 := by
rw [sq, sq] exact natAbs_le_iff_mul_self_le
import Mathlib.CategoryTheory.Category.Basic import Mathlib.CategoryTheory.Functor.Basic import Mathlib.CategoryTheory.Groupoid import Mathlib.Tactic.NthRewrite import Mathlib.CategoryTheory.PathCategory import Mathlib.CategoryTheory.Quotient import Mathlib.Combinatorics.Quiver.Symmetric #align_import category_theory...
Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean
93
117
theorem congr_comp_reverse {X Y : Paths <| Quiver.Symmetrify V} (p : X ⟢ Y) : Quot.mk (@Quotient.CompClosure _ _ redStep _ _) (p ≫ p.reverse) = Quot.mk (@Quotient.CompClosure _ _ redStep _ _) (πŸ™ X) := by
apply Quot.EqvGen_sound induction' p with a b q f ih Β· apply EqvGen.refl Β· simp only [Quiver.Path.reverse] fapply EqvGen.trans -- Porting note: `Quiver.Path.*` and `Quiver.Hom.*` notation not working Β· exact q ≫ Quiver.Path.reverse q Β· apply EqvGen.symm apply EqvGen.rel have : Quoti...
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial varia...
Mathlib/Algebra/MvPolynomial/Variables.lean
161
168
theorem vars_C_mul (a : A) (ha : a β‰  0) (Ο† : MvPolynomial Οƒ A) : (C a * Ο† : MvPolynomial Οƒ A).vars = Ο†.vars := by
ext1 i simp only [mem_vars, exists_prop, mem_support_iff] apply exists_congr intro d apply and_congr _ Iff.rfl rw [coeff_C_mul, mul_ne_zero_iff, eq_true ha, true_and_iff]
import Mathlib.Analysis.NormedSpace.Banach import Mathlib.Topology.Algebra.Module.FiniteDimension #align_import analysis.normed_space.complemented from "leanprover-community/mathlib"@"3397560e65278e5f31acefcdea63138bd53d1cd4" variable {π•œ E F G : Type*} [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedS...
Mathlib/Analysis/NormedSpace/Complemented.lean
139
143
theorem ClosedComplemented.of_quotient_finiteDimensional [CompleteSpace π•œ] [FiniteDimensional π•œ (E β§Έ p)] (hp : IsClosed (p : Set E)) : p.ClosedComplemented := by
obtain ⟨q, hq⟩ : βˆƒ q, IsCompl p q := p.exists_isCompl haveI : FiniteDimensional π•œ q := (p.quotientEquivOfIsCompl q hq).finiteDimensional exact .of_isCompl_isClosed hq hp q.closed_of_finiteDimensional
import Mathlib.Data.Real.Irrational import Mathlib.Data.Nat.Fib.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Algebra.LinearRecurrence import Mathlib.Tactic.NormNum.NatFib import Mathlib.Tactic.NormNum.Prime #align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d449712...
Mathlib/Data/Real/GoldenRatio.lean
150
156
theorem goldConj_irrational : Irrational ψ := by
have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num) have := this.rat_sub 1 have := this.rat_mul (show (0.5 : β„š) β‰  0 by norm_num) convert this norm_num field_simp
import Mathlib.Algebra.Star.Subalgebra import Mathlib.Topology.Algebra.Algebra import Mathlib.Topology.Algebra.Star #align_import topology.algebra.star_subalgebra from "leanprover-community/mathlib"@"b7f5a77fa29ad9a3ccc484109b0d7534178e7ecd" open scoped Classical open Set TopologicalSpace open scoped Classical ...
Mathlib/Topology/Algebra/StarSubalgebra.lean
146
163
theorem _root_.StarAlgHom.ext_topologicalClosure [T2Space B] {S : StarSubalgebra R A} {Ο† ψ : S.topologicalClosure →⋆ₐ[R] B} (hΟ† : Continuous Ο†) (hψ : Continuous ψ) (h : Ο†.comp (inclusion (le_topologicalClosure S)) = ψ.comp (inclusion (le_topologicalClosure S))) : Ο† = ψ := by
rw [DFunLike.ext'_iff] have : Dense (Set.range <| inclusion (le_topologicalClosure S)) := by refine embedding_subtype_val.toInducing.dense_iff.2 fun x => ?_ convert show ↑x ∈ closure (S : Set A) from x.prop rw [← Set.range_comp] exact Set.ext fun y => ⟨by rintro ⟨y, rfl⟩ ...
import Mathlib.MeasureTheory.Measure.MeasureSpace import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic #align_import measure_theory.measure.open_pos from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Topology ENNReal MeasureTheory open Set Function Filter namespace Measur...
Mathlib/MeasureTheory/Measure/OpenPos.lean
102
105
theorem _root_.IsClosed.measure_eq_univ_iff_eq [OpensMeasurableSpace X] [IsFiniteMeasure ΞΌ] (hF : IsClosed F) : ΞΌ F = ΞΌ univ ↔ F = univ := by
rw [← ae_eq_univ_iff_measure_eq hF.measurableSet.nullMeasurableSet, hF.ae_eq_univ_iff_eq]
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.BigOperators import Mathlib.Algebra.Polynomial.Degree.Lemmas import Mathlib.Algebra.Polynomial.Div #align_import data.polynomial.ring_division from "leanprover-community/mathlib"@"8efcf8022aac8e01df8d302dcebdbc25d6a886c8" noncomputable ...
Mathlib/Algebra/Polynomial/RingDivision.lean
129
136
theorem trailingDegree_mul : (p * q).trailingDegree = p.trailingDegree + q.trailingDegree := by
by_cases hp : p = 0 Β· rw [hp, zero_mul, trailingDegree_zero, top_add] by_cases hq : q = 0 Β· rw [hq, mul_zero, trailingDegree_zero, add_top] Β· rw [trailingDegree_eq_natTrailingDegree hp, trailingDegree_eq_natTrailingDegree hq, trailingDegree_eq_natTrailingDegree (mul_ne_zero hp hq), natTrailingDegree_mul ...
import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Fintype.BigOperators import Mathlib.Data.Fintype.Fin import Mathlib.GroupTheory.GroupAction.Pi import Mathlib.Logic.Equiv.Fin #align_import algebra.big_operators.fin from "leanprover-community/mathlib"@"cc5dd6244981976cc9da7afc4eee5682b037a013" open Fins...
Mathlib/Algebra/BigOperators/Fin.lean
143
146
theorem prod_univ_five [CommMonoid Ξ²] (f : Fin 5 β†’ Ξ²) : ∏ i, f i = f 0 * f 1 * f 2 * f 3 * f 4 := by
rw [prod_univ_castSucc, prod_univ_four] rfl
import Mathlib.Computability.NFA #align_import computability.epsilon_NFA from "leanprover-community/mathlib"@"28aa996fc6fb4317f0083c4e6daf79878d81be33" open Set open Computability -- "Ξ΅_NFA" set_option linter.uppercaseLean3 false universe u v structure Ξ΅NFA (Ξ± : Type u) (Οƒ : Type v) where step : Οƒ β†’ Opt...
Mathlib/Computability/EpsilonNFA.lean
87
88
theorem stepSet_empty (a : Ξ±) : M.stepSet βˆ… a = βˆ… := by
simp_rw [stepSet, mem_empty_iff_false, iUnion_false, iUnion_empty]
import Mathlib.Data.Finset.Pointwise #align_import combinatorics.additive.e_transform from "leanprover-community/mathlib"@"207c92594599a06e7c134f8d00a030a83e6c7259" open MulOpposite open Pointwise variable {Ξ± : Type*} [DecidableEq Ξ±] namespace Finset section Group variable [Group Ξ±] (e : Ξ±) (x : Finset...
Mathlib/Combinatorics/Additive/ETransform.lean
150
153
theorem mulETransformRight.fst_mul_snd_subset : (mulETransformRight e x).1 * (mulETransformRight e x).2 βŠ† x.1 * x.2 := by
refine union_mul_inter_subset_union.trans (union_subset Subset.rfl ?_) rw [op_smul_finset_mul_eq_mul_smul_finset, smul_inv_smul]
import Mathlib.Data.List.Basic namespace List variable {Ξ± Ξ² : Type*} @[simp] theorem reduceOption_cons_of_some (x : Ξ±) (l : List (Option Ξ±)) : reduceOption (some x :: l) = x :: l.reduceOption := by simp only [reduceOption, filterMap, id, eq_self_iff_true, and_self_iff] #align list.reduce_option_cons_of_some...
Mathlib/Data/List/ReduceOption.lean
80
85
theorem reduceOption_concat (l : List (Option Ξ±)) (x : Option Ξ±) : (l.concat x).reduceOption = l.reduceOption ++ x.toList := by
induction' l with hd tl hl generalizing x Β· cases x <;> simp [Option.toList] Β· simp only [concat_eq_append, reduceOption_append] at hl cases hd <;> simp [hl, reduceOption_append]
import Mathlib.Analysis.Convex.Gauge import Mathlib.Analysis.Convex.Normed open Metric Bornology Filter Set open scoped NNReal Topology Pointwise noncomputable section section Module variable {E : Type*} [AddCommGroup E] [Module ℝ E] def gaugeRescale (s t : Set E) (x : E) : E := (gauge s x / gauge t x) β€’ x the...
Mathlib/Analysis/Convex/GaugeRescale.lean
58
61
theorem gauge_gaugeRescale' (s : Set E) {t : Set E} {x : E} (hx : gauge t x β‰  0) : gauge t (gaugeRescale s t x) = gauge s x := by
rw [gaugeRescale, gauge_smul_of_nonneg (div_nonneg (gauge_nonneg _) (gauge_nonneg _)), smul_eq_mul, div_mul_cancelβ‚€ _ hx]
import Mathlib.Data.Nat.Factorial.Basic import Mathlib.Order.Monotone.Basic #align_import data.nat.choose.basic from "leanprover-community/mathlib"@"2f3994e1b117b1e1da49bcfb67334f33460c3ce4" open Nat namespace Nat def choose : β„• β†’ β„• β†’ β„• | _, 0 => 1 | 0, _ + 1 => 0 | n + 1, k + 1 => choose n k + choose n ...
Mathlib/Data/Nat/Choose/Basic.lean
99
103
theorem choose_two_right (n : β„•) : choose n 2 = n * (n - 1) / 2 := by
induction' n with n ih Β· simp Β· rw [triangle_succ n, choose, ih] simp [Nat.add_comm]
import Mathlib.Algebra.Group.Subgroup.Basic import Mathlib.Algebra.Module.Defs import Mathlib.Algebra.Star.Pi #align_import algebra.star.self_adjoint from "leanprover-community/mathlib"@"a6ece35404f60597c651689c1b46ead86de5ac1b" open Function variable {R A : Type*} def IsSelfAdjoint [Star R] (x : R) : Prop := ...
Mathlib/Algebra/Star/SelfAdjoint.lean
87
88
theorem star_mul_self [Mul R] [StarMul R] (x : R) : IsSelfAdjoint (star x * x) := by
simp only [IsSelfAdjoint, star_mul, star_star]
import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Combinatorics.Additive.AP.Three.Defs import Mathlib.Combinatorics.Pigeonhole import Mathlib.Data.Complex.ExponentialBounds #align_import combinatorics.additive.behrend from "leanprover-community/mathlib"@"4fa54b337f7d52805480306db1b1439c741848c8" open N...
Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean
150
152
theorem map_succ (a : Fin (n + 1) β†’ β„•) : map d a = a 0 + (βˆ‘ x : Fin n, a x.succ * d ^ (x : β„•)) * d := by
simp [map, Fin.sum_univ_succ, _root_.pow_succ, ← mul_assoc, ← sum_mul]
import Mathlib.LinearAlgebra.CliffordAlgebra.Basic import Mathlib.Data.ZMod.Basic import Mathlib.RingTheory.GradedAlgebra.Basic #align_import linear_algebra.clifford_algebra.grading from "leanprover-community/mathlib"@"34020e531ebc4e8aac6d449d9eecbcd1508ea8d0" namespace CliffordAlgebra variable {R M : Type*} [Co...
Mathlib/LinearAlgebra/CliffordAlgebra/Grading.lean
91
122
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') : -- Porting note: added a second `by apply` lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' = DirectSum.of (fun i => evenOdd Q i) i' x' := by
cases' x' with x' hx' dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of] induction hx' using Submodule.iSup_induction' with | mem i x hx => obtain ⟨i, rfl⟩ := i -- Porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead change x ∈ LinearMap.range (ι Q) ^ i at hx induc...
import Mathlib.Topology.Compactness.SigmaCompact import Mathlib.Topology.Connected.TotallyDisconnected import Mathlib.Topology.Inseparable #align_import topology.separation from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Function Set Filter Topology TopologicalSpace open scoped...
Mathlib/Topology/Separation.lean
125
127
theorem separatedNhds_iff_disjoint {s t : Set X} : SeparatedNhds s t ↔ Disjoint (𝓝˒ s) (𝓝˒ t) := by
simp only [(hasBasis_nhdsSet s).disjoint_iff (hasBasis_nhdsSet t), SeparatedNhds, exists_prop, ← exists_and_left, and_assoc, and_comm, and_left_comm]
import Mathlib.Analysis.SpecialFunctions.Integrals #align_import data.real.pi.wallis from "leanprover-community/mathlib"@"980755c33b9168bc82f774f665eaa27878140fac" open scoped Real Topology Nat open Filter Finset intervalIntegral namespace Real namespace Wallis set_option linter.uppercaseLean3 false noncomp...
Mathlib/Data/Real/Pi/Wallis.lean
101
114
theorem tendsto_W_nhds_pi_div_two : Tendsto W atTop (𝓝 <| Ο€ / 2) := by
refine tendsto_of_tendsto_of_tendsto_of_le_of_le ?_ tendsto_const_nhds le_W W_le have : 𝓝 (Ο€ / 2) = 𝓝 ((1 - 0) * (Ο€ / 2)) := by rw [sub_zero, one_mul] rw [this] refine Tendsto.mul ?_ tendsto_const_nhds have h : βˆ€ n : β„•, ((2 : ℝ) * n + 1) / (2 * n + 2) = 1 - 1 / (2 * n + 2) := by intro n rw [sub_div...
import Mathlib.Algebra.Field.Basic import Mathlib.Algebra.GroupWithZero.Units.Equiv import Mathlib.Algebra.Order.Field.Defs import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Order.Bounds.OrderIso import Mathlib.Tactic.Positivity.Core #align_import algebra.order.field.basic from "leanprover-community/mathlib"@"8477...
Mathlib/Algebra/Order/Field/Basic.lean
61
73
theorem div_le_iff (hb : 0 < b) : a / b ≀ c ↔ a ≀ c * b := ⟨fun h => calc a = a / b * b := by
rw [div_mul_cancelβ‚€ _ (ne_of_lt hb).symm] _ ≀ c * b := mul_le_mul_of_nonneg_right h hb.le , fun h => calc a / b = a * (1 / b) := div_eq_mul_one_div a b _ ≀ c * b * (1 / b) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hb).le _ = c * b / b := (div_eq_mul_one_div (c * b) b).symm ...
import Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol #align_import number_theory.legendre_symbol.norm_num from "leanprover-community/mathlib"@"e2621d935895abe70071ab828a4ee6e26a52afe4" section Lemmas namespace Mathlib.Meta.NormNum def jacobiSymNat (a b : β„•) : β„€ := jacobiSym a b #align norm_num.jacobi_sym_...
Mathlib/Tactic/NormNum/LegendreSymbol.lean
109
117
theorem jacobiSymNat.even_even (a b : β„•) (hbβ‚€ : Nat.beq (b / 2) 0 = false) (ha : a % 2 = 0) (hb₁ : b % 2 = 0) : jacobiSymNat a b = 0 := by
refine jacobiSym.eq_zero_iff.mpr ⟨ne_of_gt ((Nat.pos_of_ne_zero (Nat.ne_of_beq_eq_false hbβ‚€)).trans_le (Nat.div_le_self b 2)), fun hf => ?_⟩ have h : 2 ∣ a.gcd b := Nat.dvd_gcd (Nat.dvd_of_mod_eq_zero ha) (Nat.dvd_of_mod_eq_zero hb₁) change 2 ∣ (a : β„€).gcd b at h rw [hf, ← even_iff_two_dvd] at h ex...
import Mathlib.Topology.Algebra.InfiniteSum.Group import Mathlib.Topology.Algebra.Star noncomputable section open Filter Finset Function open scoped Topology variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} section ProdDomain variable [CommMonoid Ξ±] [TopologicalSpace Ξ±] @[to_additive] theorem hasProd_pi_single [DecidableEq Ξ²] (...
Mathlib/Topology/Algebra/InfiniteSum/Constructions.lean
39
42
theorem tprod_pi_single [DecidableEq β] (b : β) (a : α) : ∏' b', Pi.mulSingle b a b' = a := by
rw [tprod_eq_mulSingle b] Β· simp Β· intro b' hb'; simp [hb']
import Mathlib.RingTheory.WittVector.Basic import Mathlib.RingTheory.WittVector.IsPoly #align_import ring_theory.witt_vector.verschiebung from "leanprover-community/mathlib"@"32b08ef840dd25ca2e47e035c5da03ce16d2dc3c" namespace WittVector open MvPolynomial variable {p : β„•} {R S : Type*} [hp : Fact p.Prime] [Comm...
Mathlib/RingTheory/WittVector/Verschiebung.lean
86
92
theorem aeval_verschiebung_poly' (x : π•Ž R) (n : β„•) : aeval x.coeff (verschiebungPoly n) = (verschiebungFun x).coeff n := by
cases' n with n Β· simp only [verschiebungPoly, Nat.zero_eq, ge_iff_le, tsub_eq_zero_of_le, ite_true, map_zero, verschiebungFun_coeff_zero] Β· rw [verschiebungPoly, verschiebungFun_coeff_succ, if_neg n.succ_ne_zero, aeval_X, add_tsub_cancel_right]
import Mathlib.Data.Matrix.Invertible import Mathlib.LinearAlgebra.Matrix.Adjugate import Mathlib.LinearAlgebra.FiniteDimensional #align_import linear_algebra.matrix.nonsingular_inverse from "leanprover-community/mathlib"@"722b3b152ddd5e0cf21c0a29787c76596cb6b422" namespace Matrix universe u u' v variable {l : ...
Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean
385
392
theorem vecMul_surjective_iff_exists_left_inverse [Fintype m] [Finite n] {A : Matrix m n R} : Function.Surjective A.vecMul ↔ βˆƒ B : Matrix n m R, B * A = 1 := by
cases nonempty_fintype n refine ⟨fun h ↦ ?_, fun ⟨B, hBA⟩ y ↦ ⟨y α΅₯* B, by simp [hBA]⟩⟩ choose rows hrows using (h <| Pi.single Β· 1) refine ⟨Matrix.of rows, Matrix.ext fun i j => ?_⟩ rw [mul_apply_eq_vecMul, one_eq_pi_single, ← hrows] rfl
import Mathlib.Algebra.EuclideanDomain.Defs import Mathlib.Algebra.Ring.Divisibility.Basic import Mathlib.Algebra.Ring.Regular import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Algebra.Ring.Basic #align_import algebra.euclidean_domain.basic from "leanprover-community/mathlib"@"bf9bbbcf0c1c1ead18280b0d0...
Mathlib/Algebra/EuclideanDomain/Basic.lean
136
138
theorem gcd_zero_right (a : R) : gcd a 0 = a := by
rw [gcd] split_ifs with h <;> simp only [h, zero_mod, gcd_zero_left]
import Mathlib.Analysis.InnerProductSpace.TwoDim import Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic #align_import geometry.euclidean.angle.oriented.basic from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" noncomputable section open FiniteDimensional Complex open scoped Real Rea...
Mathlib/Geometry/Euclidean/Angle/Oriented/Basic.lean
91
92
theorem right_ne_zero_of_oangle_ne_zero {x y : V} (h : o.oangle x y β‰  0) : y β‰  0 := by
rintro rfl; simp at h
import Mathlib.Algebra.Order.Field.Basic import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Rat.Cast.Order import Mathlib.Order.Partition.Finpartition import Mathlib.Tactic.GCongr import Mathlib.Tactic.NormNum import Mathlib.Tactic.Positivity import Mathlib.Tactic.Ring #align_import combinatorics.simp...
Mathlib/Combinatorics/SimpleGraph/Density.lean
78
82
theorem card_interedges_add_card_interedges_compl (s : Finset Ξ±) (t : Finset Ξ²) : (interedges r s t).card + (interedges (fun x y ↦ Β¬r x y) s t).card = s.card * t.card := by
classical rw [← card_product, interedges, interedges, ← card_union_of_disjoint, filter_union_filter_neg_eq] exact disjoint_filter.2 fun _ _ ↦ Classical.not_not.2
import Mathlib.Data.Finset.Lattice import Mathlib.Data.Set.Sigma #align_import data.finset.sigma from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Function Multiset variable {ΞΉ : Type*} namespace Finset section SigmaLift variable {Ξ± Ξ² Ξ³ : ΞΉ β†’ Type*} [DecidableEq ΞΉ] def sigm...
Mathlib/Data/Finset/Sigma.lean
190
193
theorem not_mem_sigmaLift_of_ne_right (f : βˆ€ ⦃i⦄, Ξ± i β†’ Ξ² i β†’ Finset (Ξ³ i)) {a : Sigma Ξ±} (b : Sigma Ξ²) {x : Sigma Ξ³} (h : b.1 β‰  x.1) : x βˆ‰ sigmaLift f a b := by
rw [mem_sigmaLift] exact fun H => h H.snd.fst
import Mathlib.RingTheory.Polynomial.Cyclotomic.Basic import Mathlib.RingTheory.RootsOfUnity.Minpoly #align_import ring_theory.polynomial.cyclotomic.roots from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f" namespace Polynomial variable {R : Type*} [CommRing R] {n : β„•} theorem isRoot_...
Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean
63
67
theorem _root_.IsPrimitiveRoot.isRoot_cyclotomic (hpos : 0 < n) {ΞΌ : R} (h : IsPrimitiveRoot ΞΌ n) : IsRoot (cyclotomic n R) ΞΌ := by
rw [← mem_roots (cyclotomic_ne_zero n R), cyclotomic_eq_prod_X_sub_primitiveRoots h, roots_prod_X_sub_C, ← Finset.mem_def] rwa [← mem_primitiveRoots hpos] at h
import Mathlib.CategoryTheory.Category.Basic import Mathlib.CategoryTheory.Functor.Basic import Mathlib.CategoryTheory.Groupoid import Mathlib.Tactic.NthRewrite import Mathlib.CategoryTheory.PathCategory import Mathlib.CategoryTheory.Quotient import Mathlib.Combinatorics.Quiver.Symmetric #align_import category_theory...
Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean
81
90
theorem congr_reverse {X Y : Paths <| Quiver.Symmetrify V} (p q : X ⟢ Y) : Quotient.CompClosure redStep p q β†’ Quotient.CompClosure redStep p.reverse q.reverse := by
rintro ⟨XW, pp, qq, WY, _, Z, f⟩ have : Quotient.CompClosure redStep (WY.reverse ≫ πŸ™ _ ≫ XW.reverse) (WY.reverse ≫ (f.toPath ≫ (Quiver.reverse f).toPath) ≫ XW.reverse) := by constructor constructor simpa only [CategoryStruct.comp, CategoryStruct.id, Quiver.Path.reverse, Quiver.Path.nil_comp, Q...
import Mathlib.Data.Matrix.Block import Mathlib.Data.Matrix.Notation import Mathlib.Data.Matrix.RowCol import Mathlib.GroupTheory.GroupAction.Ring import Mathlib.GroupTheory.Perm.Fin import Mathlib.LinearAlgebra.Alternating.Basic #align_import linear_algebra.matrix.determinant from "leanprover-community/mathlib"@"c30...
Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean
145
178
theorem det_mul (M N : Matrix n n R) : det (M * N) = det M * det N := calc det (M * N) = βˆ‘ p : n β†’ n, βˆ‘ Οƒ : Perm n, Ξ΅ Οƒ * ∏ i, M (Οƒ i) (p i) * N (p i) i := by
simp only [det_apply', mul_apply, prod_univ_sum, mul_sum, Fintype.piFinset_univ] rw [Finset.sum_comm] _ = βˆ‘ p ∈ (@univ (n β†’ n) _).filter Bijective, βˆ‘ Οƒ : Perm n, Ξ΅ Οƒ * ∏ i, M (Οƒ i) (p i) * N (p i) i := (Eq.symm <| sum_subset (filter_subset _ _) fun f _ hbij => ...
import Mathlib.Data.List.Basic namespace List variable {Ξ± Ξ² : Type*} #align list.length_enum_from List.enumFrom_length #align list.length_enum List.enum_length @[simp] theorem get?_enumFrom : βˆ€ n (l : List Ξ±) m, get? (enumFrom n l) m = (get? l m).map fun a => (n + m, a) | n, [], m => rfl | n, a :: l, 0 =...
Mathlib/Data/List/Enum.lean
124
129
theorem enumFrom_append (xs ys : List Ξ±) (n : β„•) : enumFrom n (xs ++ ys) = enumFrom n xs ++ enumFrom (n + xs.length) ys := by
induction' xs with x xs IH generalizing ys n Β· simp Β· rw [cons_append, enumFrom_cons, IH, ← cons_append, ← enumFrom_cons, length, Nat.add_right_comm, Nat.add_assoc]
import Mathlib.Data.Multiset.Bind #align_import data.multiset.sections from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" assert_not_exists Ring namespace Multiset variable {Ξ± : Type*} section Sections def Sections (s : Multiset (Multiset Ξ±)) : Multiset (Multiset Ξ±) := Multiset....
Mathlib/Data/Multiset/Sections.lean
60
64
theorem mem_sections {s : Multiset (Multiset Ξ±)} : βˆ€ {a}, a ∈ Sections s ↔ s.Rel (fun s a => a ∈ s) a := by
induction s using Multiset.induction_on with | empty => simp | cons _ _ ih => simp [ih, rel_cons_left, eq_comm]
import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.Nondegenerate import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.RingTheory.Localization.FractionRing import Mathlib.Rin...
Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean
135
167
theorem exists_mulVec_eq_zero_iff' {A : Type*} (K : Type*) [DecidableEq n] [CommRing A] [Nontrivial A] [Field K] [Algebra A K] [IsFractionRing A K] {M : Matrix n n A} : (βˆƒ v β‰  0, M *α΅₯ v = 0) ↔ M.det = 0 := by
have : (βˆƒ v β‰  0, (algebraMap A K).mapMatrix M *α΅₯ v = 0) ↔ _ := exists_mulVec_eq_zero_iff_aux rw [← RingHom.map_det, IsFractionRing.to_map_eq_zero_iff] at this refine Iff.trans ?_ this; constructor <;> rintro ⟨v, hv, mul_eq⟩ Β· refine ⟨fun i => algebraMap _ _ (v i), mt (fun h => funext fun i => ?_) hv, ?_⟩ ...
import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1" universe u v variable {Ξ± Ξ² : Type*} open Finset instance (Ξ± : Type u) (Ξ² : Type v) [Fintype Ξ±] [Fintyp...
Mathlib/Data/Fintype/Sum.lean
79
100
theorem Finset.exists_equiv_extend_of_card_eq [Fintype Ξ±] [DecidableEq Ξ²] {t : Finset Ξ²} (hΞ±t : Fintype.card Ξ± = t.card) {s : Finset Ξ±} {f : Ξ± β†’ Ξ²} (hfst : Finset.image f s βŠ† t) (hfs : Set.InjOn f s) : βˆƒ g : Ξ± ≃ t, βˆ€ i ∈ s, (g i : Ξ²) = f i := by
classical induction' s using Finset.induction with a s has H generalizing f Β· obtain ⟨e⟩ : Nonempty (Ξ± ≃ β†₯t) := by rwa [← Fintype.card_eq, Fintype.card_coe] use e simp have hfst' : Finset.image f s βŠ† t := (Finset.image_mono _ (s.subset_insert a)).trans hfst have hfs' : Set.InjOn f s := hf...
import Mathlib.Algebra.MonoidAlgebra.Degree import Mathlib.Algebra.MvPolynomial.Rename import Mathlib.Algebra.Order.BigOperators.Ring.Finset #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp Ad...
Mathlib/Algebra/MvPolynomial/Degrees.lean
95
98
theorem degrees_monomial_eq (s : Οƒ β†’β‚€ β„•) (a : R) (ha : a β‰  0) : degrees (monomial s a) = toMultiset s := by
classical exact (supDegree_single s a).trans (if_neg ha)
import Mathlib.Algebra.Order.Monoid.Defs import Mathlib.Algebra.Order.Sub.Defs import Mathlib.Util.AssertExists #align_import algebra.order.group.defs from "leanprover-community/mathlib"@"b599f4e4e5cf1fbcb4194503671d3d9e569c1fce" open Function universe u variable {Ξ± : Type u} class OrderedAddCommGroup (Ξ± : Ty...
Mathlib/Algebra/Order/Group/Defs.lean
158
159
theorem Left.one_lt_inv_iff : 1 < a⁻¹ ↔ a < 1 := by
rw [← mul_lt_mul_iff_left a, mul_inv_self, mul_one]
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp import Mathlib.MeasureTheory.Integral.Bochner import Mathlib.Order.Filter.IndicatorFunction import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner import Mathlib.MeasureTheory.Function.LpSeminorm.Trim #align_import measure_theory.function.conditional...
Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean
136
139
theorem aeStronglyMeasurable'_of_aeStronglyMeasurable'_trim {Ξ± Ξ²} {m m0 m0' : MeasurableSpace Ξ±} [TopologicalSpace Ξ²] (hm0 : m0 ≀ m0') {ΞΌ : Measure Ξ±} {f : Ξ± β†’ Ξ²} (hf : AEStronglyMeasurable' m f (ΞΌ.trim hm0)) : AEStronglyMeasurable' m f ΞΌ := by
obtain ⟨g, hg_meas, hfg⟩ := hf; exact ⟨g, hg_meas, ae_eq_of_ae_eq_trim hfg⟩
import Mathlib.Topology.Homeomorph import Mathlib.Topology.Order.LeftRightNhds #align_import topology.algebra.order.monotone_continuity from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514" open Set Filter open Topology section LinearOrder variable {Ξ± Ξ² : Type*} [LinearOrder Ξ±] [Topolo...
Mathlib/Topology/Order/MonotoneContinuity.lean
81
89
theorem continuousWithinAt_right_of_monotoneOn_of_closure_image_mem_nhdsWithin [DenselyOrdered Ξ²] {f : Ξ± β†’ Ξ²} {s : Set Ξ±} {a : Ξ±} (h_mono : MonotoneOn f s) (hs : s ∈ 𝓝[β‰₯] a) (hfs : closure (f '' s) ∈ 𝓝[β‰₯] f a) : ContinuousWithinAt f (Ici a) a := by
refine continuousWithinAt_right_of_monotoneOn_of_exists_between h_mono hs fun b hb => ?_ rcases (mem_nhdsWithin_Ici_iff_exists_mem_Ioc_Ico_subset hb).1 hfs with ⟨b', ⟨hab', hbb'⟩, hb'⟩ rcases exists_between hab' with ⟨c', hc'⟩ rcases mem_closure_iff.1 (hb' ⟨hc'.1.le, hc'.2⟩) (Ioo (f a) b') isOpen_Ioo hc' with ...
import Mathlib.FieldTheory.SeparableClosure import Mathlib.Algebra.CharP.IntermediateField open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] section IsP...
Mathlib/FieldTheory/PurelyInseparable.lean
169
174
theorem AlgEquiv.isPurelyInseparable (e : K ≃ₐ[F] E) [IsPurelyInseparable F K] : IsPurelyInseparable F E := by
refine ⟨⟨fun _ ↦ by rw [← isIntegral_algEquiv e.symm]; exact IsPurelyInseparable.isIntegral' F _⟩, fun x h ↦ ?_⟩ rw [← minpoly.algEquiv_eq e.symm] at h simpa only [RingHom.mem_range, algebraMap_eq_apply] using IsPurelyInseparable.inseparable F _ h
import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Inv #align_import analysis.calculus.dslope from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" open scoped Classical Topology Filter open Function Set Filter variable {π•œ E : Type*} [NontriviallyNormed...
Mathlib/Analysis/Calculus/Dslope.lean
68
69
theorem sub_smul_dslope (f : π•œ β†’ E) (a b : π•œ) : (b - a) β€’ dslope f a b = f b - f a := by
rcases eq_or_ne b a with (rfl | hne) <;> simp [dslope_of_ne, *]
import Mathlib.Algebra.Polynomial.Splits import Mathlib.RingTheory.MvPolynomial.Symmetric #align_import ring_theory.polynomial.vieta from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" open Polynomial namespace Multiset open Polynomial section Semiring variable {R : Type*} [CommSemi...
Mathlib/RingTheory/Polynomial/Vieta.lean
41
53
theorem prod_X_add_C_eq_sum_esymm (s : Multiset R) : (s.map fun r => X + C r).prod = βˆ‘ j ∈ Finset.range (Multiset.card s + 1), (C (s.esymm j) * X ^ (Multiset.card s - j)) := by
classical rw [prod_map_add, antidiagonal_eq_map_powerset, map_map, ← bind_powerset_len, map_bind, sum_bind, Finset.sum_eq_multiset_sum, Finset.range_val, map_congr (Eq.refl _)] intro _ _ rw [esymm, ← sum_hom', ← sum_map_mul_right, map_congr (Eq.refl _)] intro s ht rw [mem_powersetCard] at h...
import Mathlib.Data.Set.Subsingleton import Mathlib.Order.WithBot #align_import data.set.image from "leanprover-community/mathlib"@"001ffdc42920050657fd45bd2b8bfbec8eaaeb29" universe u v open Function Set namespace Set variable {Ξ± Ξ² Ξ³ : Type*} {ΞΉ ΞΉ' : Sort*} section Image variable {f : Ξ± β†’ Ξ²} {s t : Set...
Mathlib/Data/Set/Image.lean
266
266
theorem image_comp_eq {g : Ξ² β†’ Ξ³} : image (g ∘ f) = image g ∘ image f := by
ext; simp
import Mathlib.Data.Matrix.Basic import Mathlib.Data.PEquiv #align_import data.matrix.pequiv from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" namespace PEquiv open Matrix universe u v variable {k l m n : Type*} variable {Ξ± : Type v} open Matrix def toMatrix [DecidableEq n] [Zer...
Mathlib/Data/Matrix/PEquiv.lean
70
74
theorem toMatrix_symm [DecidableEq m] [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m ≃. n) : (f.symm.toMatrix : Matrix n m Ξ±) = f.toMatrixα΅€ := by
ext simp only [transpose, mem_iff_mem f, toMatrix_apply] congr
import Mathlib.LinearAlgebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.FinsuppVectorSpace #align_import linear_algebra.tensor_product_basis from "leanprover-community/mathlib"@"f784cc6142443d9ee623a20788c282112c322081" noncomputable section open Set LinearMap Submodule section CommSemiring variable {R : T...
Mathlib/LinearAlgebra/TensorProduct/Basis.lean
50
53
theorem Basis.tensorProduct_repr_tmul_apply (b : Basis ΞΉ R M) (c : Basis ΞΊ R N) (m : M) (n : N) (i : ΞΉ) (j : ΞΊ) : (Basis.tensorProduct b c).repr (m βŠ—β‚œ n) (i, j) = b.repr m i * c.repr n j := by
simp [Basis.tensorProduct, mul_comm]
import Mathlib.Analysis.NormedSpace.Exponential import Mathlib.Analysis.Calculus.FDeriv.Analytic import Mathlib.Topology.MetricSpace.CauSeqFilter #align_import analysis.special_functions.exponential from "leanprover-community/mathlib"@"e1a18cad9cd462973d760af7de36b05776b8811c" open Filter RCLike ContinuousMultili...
Mathlib/Analysis/SpecialFunctions/Exponential.lean
227
228
theorem Real.exp_eq_exp_ℝ : Real.exp = NormedSpace.exp ℝ := by
ext x; exact mod_cast congr_fun Complex.exp_eq_exp_β„‚ x
import Mathlib.MeasureTheory.Measure.FiniteMeasure import Mathlib.MeasureTheory.Integral.Average #align_import measure_theory.measure.probability_measure from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" noncomputable section open MeasureTheory open Set open Filter open BoundedCon...
Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean
163
164
theorem coeFn_univ_ne_zero (Ξ½ : ProbabilityMeasure Ξ©) : Ξ½ univ β‰  0 := by
simp only [coeFn_univ, Ne, one_ne_zero, not_false_iff]
import Batteries.Data.Array.Lemmas namespace ByteArray @[ext] theorem ext : {a b : ByteArray} β†’ a.data = b.data β†’ a = b | ⟨_⟩, ⟨_⟩, rfl => rfl theorem getElem_eq_data_getElem (a : ByteArray) (h : i < a.size) : a[i] = a.data[i] := rfl @[simp] theorem uset_eq_set (a : ByteArray) {i : USize} (h : i.toNat < a.size...
.lake/packages/batteries/Batteries/Data/ByteArray.lean
76
77
theorem size_append (a b : ByteArray) : (a ++ b).size = a.size + b.size := by
simp only [size, append_eq, append_data]; exact Array.size_append ..
import Mathlib.Algebra.Order.Pointwise import Mathlib.Analysis.NormedSpace.SphereNormEquiv import Mathlib.Analysis.SpecialFunctions.Integrals import Mathlib.MeasureTheory.Constructions.Prod.Integral import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar open Set Function Metric MeasurableSpace intervalIntegral open s...
Mathlib/MeasureTheory/Constructions/HaarToSphere.lean
55
60
theorem toSphere_apply' {s : Set (sphere (0 : E) 1)} (hs : MeasurableSet s) : ΞΌ.toSphere s = dim E * ΞΌ (Ioo (0 : ℝ) 1 β€’ ((↑) '' s)) := by
rw [toSphere, smul_apply, fst_apply hs, restrict_apply (measurable_fst hs), ((MeasurableEmbedding.subtype_coe (measurableSet_singleton _).compl).comp (Homeomorph.measurableEmbedding _)).comap_apply, image_comp, Homeomorph.image_symm, univ_prod, ← Set.prod_eq, nsmul_eq_mul, toSphere_apply_aux]
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial Intermedi...
Mathlib/FieldTheory/AbelRuffini.lean
42
42
theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by
infer_instance
import Mathlib.Probability.Notation import Mathlib.Probability.Density import Mathlib.Probability.ConditionalProbability import Mathlib.Probability.ProbabilityMassFunction.Constructions open scoped Classical MeasureTheory NNReal ENNReal -- TODO: We can't `open ProbabilityTheory` without opening the `ProbabilityThe...
Mathlib/Probability/Distributions/Uniform.lean
77
78
theorem absolutelyContinuous {X : Ξ© β†’ E} {s : Set E} (hu : IsUniform X s β„™ ΞΌ) : map X β„™ β‰ͺ ΞΌ := by
rw [hu]; exact ProbabilityTheory.cond_absolutelyContinuous
import Mathlib.Order.Ideal import Mathlib.Order.PFilter #align_import order.prime_ideal from "leanprover-community/mathlib"@"740acc0e6f9adf4423f92a485d0456fc271482da" open Order.PFilter namespace Order variable {P : Type*} namespace Ideal -- Porting note(#5171): this linter isn't ported yet. -- @[nolint has_...
Mathlib/Order/PrimeIdeal.lean
68
71
theorem I_isProper : IsProper IF.I := by
cases' IF.F.nonempty with w h apply isProper_of_not_mem (_ : w βˆ‰ IF.I) rwa [← IF.compl_I_eq_F] at h
import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Data.Int.LeastGreatest #align_import data.int.conditionally_complete_order from "leanprover-community/mathlib"@"1e05171a5e8cf18d98d9cf7b207540acb044acae" open Int noncomputable section open scoped Classical instance instConditionallyComplet...
Mathlib/Data/Int/ConditionallyCompleteOrder.lean
94
96
theorem csSup_mem {s : Set β„€} (h1 : s.Nonempty) (h2 : BddAbove s) : sSup s ∈ s := by
convert (greatestOfBdd _ (Classical.choose_spec h2) h1).2.1 exact dif_pos ⟨h1, h2⟩
import Mathlib.RingTheory.RingHomProperties #align_import ring_theory.ring_hom.finite from "leanprover-community/mathlib"@"b5aecf07a179c60b6b37c1ac9da952f3b565c785" namespace RingHom open scoped TensorProduct open TensorProduct Algebra.TensorProduct theorem finite_stableUnderComposition : StableUnderCompositio...
Mathlib/RingTheory/RingHom/Finite.lean
34
42
theorem finite_stableUnderBaseChange : StableUnderBaseChange @Finite := by
refine StableUnderBaseChange.mk _ finite_respectsIso ?_ classical introv h replace h : Module.Finite R T := by rw [RingHom.Finite] at h; convert h; ext; simp_rw [Algebra.smul_def]; rfl suffices Module.Finite S (S βŠ—[R] T) by rw [RingHom.Finite]; convert this; congr; ext; simp_rw [Algebra.smul_def]; rf...
import Mathlib.Order.Interval.Set.Disjoint import Mathlib.Order.SuccPred.Basic #align_import data.set.intervals.monotone from "leanprover-community/mathlib"@"4d06b17aea8cf2e220f0b0aa46cd0231593c5c97" open Set section SuccOrder open Order variable {Ξ± Ξ² : Type*} [PartialOrder Ξ±]
Mathlib/Order/Interval/Set/Monotone.lean
203
218
theorem StrictMonoOn.Iic_id_le [SuccOrder Ξ±] [IsSuccArchimedean Ξ±] [OrderBot Ξ±] {n : Ξ±} {Ο† : Ξ± β†’ Ξ±} (hΟ† : StrictMonoOn Ο† (Set.Iic n)) : βˆ€ m ≀ n, m ≀ Ο† m := by
revert hΟ† refine Succ.rec_bot (fun n => StrictMonoOn Ο† (Set.Iic n) β†’ βˆ€ m ≀ n, m ≀ Ο† m) (fun _ _ hm => hm.trans bot_le) ?_ _ rintro k ih hΟ† m hm by_cases hk : IsMax k Β· rw [succ_eq_iff_isMax.2 hk] at hm exact ih (hΟ†.mono <| Iic_subset_Iic.2 (le_succ _)) _ hm obtain rfl | h := le_succ_iff_eq_or...
import Mathlib.Topology.Basic import Mathlib.Order.UpperLower.Basic import Mathlib.Order.OmegaCompletePartialOrder #align_import topology.omega_complete_partial_order from "leanprover-community/mathlib"@"2705404e701abc6b3127da906f40bae062a169c9" open Set OmegaCompletePartialOrder open scoped Classical universe ...
Mathlib/Topology/OmegaCompletePartialOrder.lean
62
66
theorem isOpen_sUnion (s : Set (Set Ξ±)) (hs : βˆ€ t ∈ s, IsOpen Ξ± t) : IsOpen Ξ± (⋃₀ s) := by
simp only [IsOpen] at hs ⊒ convert CompleteLattice.sSup_continuous' (setOf ⁻¹' s) hs simp only [sSup_apply, setOf_bijective.surjective.exists, exists_prop, mem_preimage, SetCoe.exists, iSup_Prop_eq, mem_setOf_eq, mem_sUnion]
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine #align_import geometry.euclidean.angle.unoriented.right_angle from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section open scoped EuclideanGeometry ...
Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean
105
112
theorem angle_add_pos_of_inner_eq_zero {x y : V} (h : βŸͺx, y⟫ = 0) (h0 : x = 0 ∨ y β‰  0) : 0 < angle x (x + y) := by
rw [angle_add_eq_arccos_of_inner_eq_zero h, Real.arccos_pos, norm_add_eq_sqrt_iff_real_inner_eq_zero.2 h] by_cases hx : x = 0; Β· simp [hx] rw [div_lt_one (Real.sqrt_pos.2 (Left.add_pos_of_pos_of_nonneg (mul_self_pos.2 (norm_ne_zero_iff.2 hx)) (mul_self_nonneg _))), Real.lt_sqrt (norm_nonneg _), pow_two] ...