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 | eval_complexity float64 0 1 |
|---|---|---|---|---|---|---|
import Mathlib.Analysis.Convex.Cone.Basic
import Mathlib.Analysis.InnerProductSpace.Projection
#align_import analysis.convex.cone.dual from "leanprover-community/mathlib"@"915591b2bb3ea303648db07284a161a7f2a9e3d4"
open Set LinearMap
open scoped Classical
open Pointwise
variable {𝕜 E F G : Type*}
section Dual
variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] (s t : Set H)
open RealInnerProductSpace
def Set.innerDualCone (s : Set H) : ConvexCone ℝ H where
carrier := { y | ∀ x ∈ s, 0 ≤ ⟪x, y⟫ }
smul_mem' c hc y hy x hx := by
rw [real_inner_smul_right]
exact mul_nonneg hc.le (hy x hx)
add_mem' u hu v hv x hx := by
rw [inner_add_right]
exact add_nonneg (hu x hx) (hv x hx)
#align set.inner_dual_cone Set.innerDualCone
@[simp]
theorem mem_innerDualCone (y : H) (s : Set H) : y ∈ s.innerDualCone ↔ ∀ x ∈ s, 0 ≤ ⟪x, y⟫ :=
Iff.rfl
#align mem_inner_dual_cone mem_innerDualCone
@[simp]
theorem innerDualCone_empty : (∅ : Set H).innerDualCone = ⊤ :=
eq_top_iff.mpr fun _ _ _ => False.elim
#align inner_dual_cone_empty innerDualCone_empty
@[simp]
theorem innerDualCone_zero : (0 : Set H).innerDualCone = ⊤ :=
eq_top_iff.mpr fun _ _ y (hy : y = 0) => hy.symm ▸ (inner_zero_left _).ge
#align inner_dual_cone_zero innerDualCone_zero
@[simp]
theorem innerDualCone_univ : (univ : Set H).innerDualCone = 0 := by
suffices ∀ x : H, x ∈ (univ : Set H).innerDualCone → x = 0 by
apply SetLike.coe_injective
exact eq_singleton_iff_unique_mem.mpr ⟨fun x _ => (inner_zero_right _).ge, this⟩
exact fun x hx => by simpa [← real_inner_self_nonpos] using hx (-x) (mem_univ _)
#align inner_dual_cone_univ innerDualCone_univ
theorem innerDualCone_le_innerDualCone (h : t ⊆ s) : s.innerDualCone ≤ t.innerDualCone :=
fun _ hy x hx => hy x (h hx)
#align inner_dual_cone_le_inner_dual_cone innerDualCone_le_innerDualCone
theorem pointed_innerDualCone : s.innerDualCone.Pointed := fun x _ => by rw [inner_zero_right]
#align pointed_inner_dual_cone pointed_innerDualCone
theorem innerDualCone_singleton (x : H) :
({x} : Set H).innerDualCone = (ConvexCone.positive ℝ ℝ).comap (innerₛₗ ℝ x) :=
ConvexCone.ext fun _ => forall_eq
#align inner_dual_cone_singleton innerDualCone_singleton
theorem innerDualCone_union (s t : Set H) :
(s ∪ t).innerDualCone = s.innerDualCone ⊓ t.innerDualCone :=
le_antisymm (le_inf (fun _ hx _ hy => hx _ <| Or.inl hy) fun _ hx _ hy => hx _ <| Or.inr hy)
fun _ hx _ => Or.rec (hx.1 _) (hx.2 _)
#align inner_dual_cone_union innerDualCone_union
| Mathlib/Analysis/Convex/Cone/InnerDual.lean | 105 | 107 | theorem innerDualCone_insert (x : H) (s : Set H) :
(insert x s).innerDualCone = Set.innerDualCone {x} ⊓ s.innerDualCone := by |
rw [insert_eq, innerDualCone_union]
| 0.9375 |
import Mathlib.Analysis.Convex.Basic
import Mathlib.Order.Closure
#align_import analysis.convex.hull from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d"
open Set
open Pointwise
variable {𝕜 E F : Type*}
section convexHull
section OrderedSemiring
variable [OrderedSemiring 𝕜]
section AddCommMonoid
variable (𝕜)
variable [AddCommMonoid E] [AddCommMonoid F] [Module 𝕜 E] [Module 𝕜 F]
@[simps! isClosed]
def convexHull : ClosureOperator (Set E) := .ofCompletePred (Convex 𝕜) fun _ ↦ convex_sInter
#align convex_hull convexHull
variable (s : Set E)
theorem subset_convexHull : s ⊆ convexHull 𝕜 s :=
(convexHull 𝕜).le_closure s
#align subset_convex_hull subset_convexHull
theorem convex_convexHull : Convex 𝕜 (convexHull 𝕜 s) := (convexHull 𝕜).isClosed_closure s
#align convex_convex_hull convex_convexHull
theorem convexHull_eq_iInter : convexHull 𝕜 s = ⋂ (t : Set E) (_ : s ⊆ t) (_ : Convex 𝕜 t), t := by
simp [convexHull, iInter_subtype, iInter_and]
#align convex_hull_eq_Inter convexHull_eq_iInter
variable {𝕜 s} {t : Set E} {x y : E}
| Mathlib/Analysis/Convex/Hull.lean | 62 | 63 | theorem mem_convexHull_iff : x ∈ convexHull 𝕜 s ↔ ∀ t, s ⊆ t → Convex 𝕜 t → x ∈ t := by |
simp_rw [convexHull_eq_iInter, mem_iInter]
| 0.9375 |
import Mathlib.Logic.Equiv.Defs
import Mathlib.Tactic.MkIffOfInductiveProp
import Mathlib.Tactic.PPWithUniv
#align_import logic.small.basic from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
universe u w v v'
@[mk_iff, pp_with_univ]
class Small (α : Type v) : Prop where
equiv_small : ∃ S : Type w, Nonempty (α ≃ S)
#align small Small
theorem Small.mk' {α : Type v} {S : Type w} (e : α ≃ S) : Small.{w} α :=
⟨⟨S, ⟨e⟩⟩⟩
#align small.mk' Small.mk'
@[pp_with_univ]
def Shrink (α : Type v) [Small.{w} α] : Type w :=
Classical.choose (@Small.equiv_small α _)
#align shrink Shrink
noncomputable def equivShrink (α : Type v) [Small.{w} α] : α ≃ Shrink α :=
Nonempty.some (Classical.choose_spec (@Small.equiv_small α _))
#align equiv_shrink equivShrink
@[ext]
| Mathlib/Logic/Small/Defs.lean | 56 | 58 | theorem Shrink.ext {α : Type v} [Small.{w} α] {x y : Shrink α}
(w : (equivShrink _).symm x = (equivShrink _).symm y) : x = y := by |
simpa using w
| 0.9375 |
import Mathlib.Algebra.Homology.ComplexShape
import Mathlib.CategoryTheory.Subobject.Limits
import Mathlib.CategoryTheory.GradedObject
import Mathlib.Algebra.Homology.ShortComplex.Basic
#align_import algebra.homology.homological_complex from "leanprover-community/mathlib"@"88bca0ce5d22ebfd9e73e682e51d60ea13b48347"
universe v u
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits
variable {ι : Type*}
variable (V : Type u) [Category.{v} V] [HasZeroMorphisms V]
structure HomologicalComplex (c : ComplexShape ι) where
X : ι → V
d : ∀ i j, X i ⟶ X j
shape : ∀ i j, ¬c.Rel i j → d i j = 0 := by aesop_cat
d_comp_d' : ∀ i j k, c.Rel i j → c.Rel j k → d i j ≫ d j k = 0 := by aesop_cat
#align homological_complex HomologicalComplex
abbrev ChainComplex (α : Type*) [AddRightCancelSemigroup α] [One α] : Type _ :=
HomologicalComplex V (ComplexShape.down α)
#align chain_complex ChainComplex
abbrev CochainComplex (α : Type*) [AddRightCancelSemigroup α] [One α] : Type _ :=
HomologicalComplex V (ComplexShape.up α)
#align cochain_complex CochainComplex
namespace HomologicalComplex
variable {V}
variable {c : ComplexShape ι} (C : HomologicalComplex V c)
@[ext]
structure Hom (A B : HomologicalComplex V c) where
f : ∀ i, A.X i ⟶ B.X i
comm' : ∀ i j, c.Rel i j → f i ≫ B.d i j = A.d i j ≫ f j := by aesop_cat
#align homological_complex.hom HomologicalComplex.Hom
@[reassoc (attr := simp)]
| Mathlib/Algebra/Homology/HomologicalComplex.lean | 236 | 240 | theorem Hom.comm {A B : HomologicalComplex V c} (f : A.Hom B) (i j : ι) :
f.f i ≫ B.d i j = A.d i j ≫ f.f j := by |
by_cases hij : c.Rel i j
· exact f.comm' i j hij
· rw [A.shape i j hij, B.shape i j hij, comp_zero, zero_comp]
| 0.9375 |
import Mathlib.Algebra.Group.Commute.Basic
import Mathlib.Data.Fintype.Card
import Mathlib.GroupTheory.Perm.Basic
#align_import group_theory.perm.support from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Equiv Finset
namespace Equiv.Perm
variable {α : Type*}
section support
variable [DecidableEq α] [Fintype α] {f g : Perm α}
def support (f : Perm α) : Finset α :=
univ.filter fun x => f x ≠ x
#align equiv.perm.support Equiv.Perm.support
@[simp]
| Mathlib/GroupTheory/Perm/Support.lean | 297 | 298 | theorem mem_support {x : α} : x ∈ f.support ↔ f x ≠ x := by |
rw [support, mem_filter, and_iff_right (mem_univ x)]
| 0.9375 |
import Mathlib.Algebra.GroupWithZero.Divisibility
import Mathlib.Algebra.Ring.Divisibility.Basic
import Mathlib.Algebra.Ring.Hom.Defs
import Mathlib.GroupTheory.GroupAction.Units
import Mathlib.Logic.Basic
import Mathlib.Tactic.Ring
#align_import ring_theory.coprime.basic from "leanprover-community/mathlib"@"a95b16cbade0f938fc24abd05412bde1e84bab9b"
universe u v
section CommSemiring
variable {R : Type u} [CommSemiring R] (x y z : R)
def IsCoprime : Prop :=
∃ a b, a * x + b * y = 1
#align is_coprime IsCoprime
variable {x y z}
@[symm]
theorem IsCoprime.symm (H : IsCoprime x y) : IsCoprime y x :=
let ⟨a, b, H⟩ := H
⟨b, a, by rw [add_comm, H]⟩
#align is_coprime.symm IsCoprime.symm
theorem isCoprime_comm : IsCoprime x y ↔ IsCoprime y x :=
⟨IsCoprime.symm, IsCoprime.symm⟩
#align is_coprime_comm isCoprime_comm
theorem isCoprime_self : IsCoprime x x ↔ IsUnit x :=
⟨fun ⟨a, b, h⟩ => isUnit_of_mul_eq_one x (a + b) <| by rwa [mul_comm, add_mul], fun h =>
let ⟨b, hb⟩ := isUnit_iff_exists_inv'.1 h
⟨b, 0, by rwa [zero_mul, add_zero]⟩⟩
#align is_coprime_self isCoprime_self
theorem isCoprime_zero_left : IsCoprime 0 x ↔ IsUnit x :=
⟨fun ⟨a, b, H⟩ => isUnit_of_mul_eq_one x b <| by rwa [mul_zero, zero_add, mul_comm] at H, fun H =>
let ⟨b, hb⟩ := isUnit_iff_exists_inv'.1 H
⟨1, b, by rwa [one_mul, zero_add]⟩⟩
#align is_coprime_zero_left isCoprime_zero_left
theorem isCoprime_zero_right : IsCoprime x 0 ↔ IsUnit x :=
isCoprime_comm.trans isCoprime_zero_left
#align is_coprime_zero_right isCoprime_zero_right
theorem not_isCoprime_zero_zero [Nontrivial R] : ¬IsCoprime (0 : R) 0 :=
mt isCoprime_zero_right.mp not_isUnit_zero
#align not_coprime_zero_zero not_isCoprime_zero_zero
lemma IsCoprime.intCast {R : Type*} [CommRing R] {a b : ℤ} (h : IsCoprime a b) :
IsCoprime (a : R) (b : R) := by
rcases h with ⟨u, v, H⟩
use u, v
rw_mod_cast [H]
exact Int.cast_one
theorem IsCoprime.ne_zero [Nontrivial R] {p : Fin 2 → R} (h : IsCoprime (p 0) (p 1)) : p ≠ 0 := by
rintro rfl
exact not_isCoprime_zero_zero h
#align is_coprime.ne_zero IsCoprime.ne_zero
theorem IsCoprime.ne_zero_or_ne_zero [Nontrivial R] (h : IsCoprime x y) : x ≠ 0 ∨ y ≠ 0 := by
apply not_or_of_imp
rintro rfl rfl
exact not_isCoprime_zero_zero h
theorem isCoprime_one_left : IsCoprime 1 x :=
⟨1, 0, by rw [one_mul, zero_mul, add_zero]⟩
#align is_coprime_one_left isCoprime_one_left
theorem isCoprime_one_right : IsCoprime x 1 :=
⟨0, 1, by rw [one_mul, zero_mul, zero_add]⟩
#align is_coprime_one_right isCoprime_one_right
theorem IsCoprime.dvd_of_dvd_mul_right (H1 : IsCoprime x z) (H2 : x ∣ y * z) : x ∣ y := by
let ⟨a, b, H⟩ := H1
rw [← mul_one y, ← H, mul_add, ← mul_assoc, mul_left_comm]
exact dvd_add (dvd_mul_left _ _) (H2.mul_left _)
#align is_coprime.dvd_of_dvd_mul_right IsCoprime.dvd_of_dvd_mul_right
theorem IsCoprime.dvd_of_dvd_mul_left (H1 : IsCoprime x y) (H2 : x ∣ y * z) : x ∣ z := by
let ⟨a, b, H⟩ := H1
rw [← one_mul z, ← H, add_mul, mul_right_comm, mul_assoc b]
exact dvd_add (dvd_mul_left _ _) (H2.mul_left _)
#align is_coprime.dvd_of_dvd_mul_left IsCoprime.dvd_of_dvd_mul_left
| Mathlib/RingTheory/Coprime/Basic.lean | 114 | 121 | theorem IsCoprime.mul_left (H1 : IsCoprime x z) (H2 : IsCoprime y z) : IsCoprime (x * y) z :=
let ⟨a, b, h1⟩ := H1
let ⟨c, d, h2⟩ := H2
⟨a * c, a * x * d + b * c * y + b * d * z,
calc a * c * (x * y) + (a * x * d + b * c * y + b * d * z) * z
_ = (a * x + b * z) * (c * y + d * z) := by | ring
_ = 1 := by rw [h1, h2, mul_one]
⟩
| 0.9375 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Analysis.NormedSpace.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace
import Mathlib.Topology.Instances.RealVectorSpace
#align_import analysis.normed_space.add_torsor from "leanprover-community/mathlib"@"837f72de63ad6cd96519cde5f1ffd5ed8d280ad0"
noncomputable section
open NNReal Topology
open Filter
variable {α V P W Q : Type*} [SeminormedAddCommGroup V] [PseudoMetricSpace P] [NormedAddTorsor V P]
[NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q]
section NormedSpace
variable {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] [NormedSpace 𝕜 W]
open AffineMap
theorem AffineSubspace.isClosed_direction_iff (s : AffineSubspace 𝕜 Q) :
IsClosed (s.direction : Set W) ↔ IsClosed (s : Set Q) := by
rcases s.eq_bot_or_nonempty with (rfl | ⟨x, hx⟩); · simp [isClosed_singleton]
rw [← (IsometryEquiv.vaddConst x).toHomeomorph.symm.isClosed_image,
AffineSubspace.coe_direction_eq_vsub_set_right hx]
rfl
#align affine_subspace.is_closed_direction_iff AffineSubspace.isClosed_direction_iff
@[simp]
theorem dist_center_homothety (p₁ p₂ : P) (c : 𝕜) :
dist p₁ (homothety p₁ c p₂) = ‖c‖ * dist p₁ p₂ := by
simp [homothety_def, norm_smul, ← dist_eq_norm_vsub, dist_comm]
#align dist_center_homothety dist_center_homothety
@[simp]
theorem nndist_center_homothety (p₁ p₂ : P) (c : 𝕜) :
nndist p₁ (homothety p₁ c p₂) = ‖c‖₊ * nndist p₁ p₂ :=
NNReal.eq <| dist_center_homothety _ _ _
#align nndist_center_homothety nndist_center_homothety
@[simp]
| Mathlib/Analysis/NormedSpace/AddTorsor.lean | 57 | 58 | theorem dist_homothety_center (p₁ p₂ : P) (c : 𝕜) :
dist (homothety p₁ c p₂) p₁ = ‖c‖ * dist p₁ p₂ := by | rw [dist_comm, dist_center_homothety]
| 0.9375 |
import Mathlib.Order.Interval.Set.UnorderedInterval
import Mathlib.Algebra.Order.Interval.Set.Monoid
import Mathlib.Data.Set.Pointwise.Basic
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
#align_import data.set.pointwise.interval from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Interval Pointwise
variable {α : Type*}
namespace Set
section ContravariantLT
variable [Mul α] [PartialOrder α]
variable [CovariantClass α α (· * ·) (· < ·)] [CovariantClass α α (Function.swap HMul.hMul) LT.lt]
@[to_additive Icc_add_Ico_subset]
theorem Icc_mul_Ico_subset' (a b c d : α) : Icc a b * Ico c d ⊆ Ico (a * c) (b * d) := by
haveI := covariantClass_le_of_lt
rintro x ⟨y, ⟨hya, hyb⟩, z, ⟨hzc, hzd⟩, rfl⟩
exact ⟨mul_le_mul' hya hzc, mul_lt_mul_of_le_of_lt hyb hzd⟩
@[to_additive Ico_add_Icc_subset]
theorem Ico_mul_Icc_subset' (a b c d : α) : Ico a b * Icc c d ⊆ Ico (a * c) (b * d) := by
haveI := covariantClass_le_of_lt
rintro x ⟨y, ⟨hya, hyb⟩, z, ⟨hzc, hzd⟩, rfl⟩
exact ⟨mul_le_mul' hya hzc, mul_lt_mul_of_lt_of_le hyb hzd⟩
@[to_additive Ioc_add_Ico_subset]
theorem Ioc_mul_Ico_subset' (a b c d : α) : Ioc a b * Ico c d ⊆ Ioo (a * c) (b * d) := by
haveI := covariantClass_le_of_lt
rintro x ⟨y, ⟨hya, hyb⟩, z, ⟨hzc, hzd⟩, rfl⟩
exact ⟨mul_lt_mul_of_lt_of_le hya hzc, mul_lt_mul_of_le_of_lt hyb hzd⟩
@[to_additive Ico_add_Ioc_subset]
theorem Ico_mul_Ioc_subset' (a b c d : α) : Ico a b * Ioc c d ⊆ Ioo (a * c) (b * d) := by
haveI := covariantClass_le_of_lt
rintro x ⟨y, ⟨hya, hyb⟩, z, ⟨hzc, hzd⟩, rfl⟩
exact ⟨mul_lt_mul_of_le_of_lt hya hzc, mul_lt_mul_of_lt_of_le hyb hzd⟩
@[to_additive Iic_add_Iio_subset]
theorem Iic_mul_Iio_subset' (a b : α) : Iic a * Iio b ⊆ Iio (a * b) := by
haveI := covariantClass_le_of_lt
rintro x ⟨y, hya, z, hzb, rfl⟩
exact mul_lt_mul_of_le_of_lt hya hzb
@[to_additive Iio_add_Iic_subset]
theorem Iio_mul_Iic_subset' (a b : α) : Iio a * Iic b ⊆ Iio (a * b) := by
haveI := covariantClass_le_of_lt
rintro x ⟨y, hya, z, hzb, rfl⟩
exact mul_lt_mul_of_lt_of_le hya hzb
@[to_additive Ioi_add_Ici_subset]
theorem Ioi_mul_Ici_subset' (a b : α) : Ioi a * Ici b ⊆ Ioi (a * b) := by
haveI := covariantClass_le_of_lt
rintro x ⟨y, hya, z, hzb, rfl⟩
exact mul_lt_mul_of_lt_of_le hya hzb
@[to_additive Ici_add_Ioi_subset]
| Mathlib/Data/Set/Pointwise/Interval.lean | 110 | 113 | theorem Ici_mul_Ioi_subset' (a b : α) : Ici a * Ioi b ⊆ Ioi (a * b) := by |
haveI := covariantClass_le_of_lt
rintro x ⟨y, hya, z, hzb, rfl⟩
exact mul_lt_mul_of_le_of_lt hya hzb
| 0.9375 |
import Mathlib.CategoryTheory.Limits.Types
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
import Mathlib.CategoryTheory.ConcreteCategory.Basic
import Mathlib.Tactic.CategoryTheory.Elementwise
import Mathlib.Data.Set.Subsingleton
#align_import category_theory.limits.shapes.types from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8"
universe v u
open CategoryTheory Limits
namespace CategoryTheory.Limits.Types
example : HasProducts.{v} (Type v) := inferInstance
example [UnivLE.{v, u}] : HasProducts.{v} (Type u) := inferInstance
-- This shortcut instance is required in `Mathlib.CategoryTheory.Closed.Types`,
-- although I don't understand why, and wish it wasn't.
instance : HasProducts.{v} (Type v) := inferInstance
@[simp 1001]
theorem pi_lift_π_apply {β : Type v} [Small.{u} β] (f : β → Type u) {P : Type u}
(s : ∀ b, P ⟶ f b) (b : β) (x : P) :
(Pi.π f b : (piObj f) → f b) (@Pi.lift β _ _ f _ P s x) = s b x :=
congr_fun (limit.lift_π (Fan.mk P s) ⟨b⟩) x
#align category_theory.limits.types.pi_lift_π_apply CategoryTheory.Limits.Types.pi_lift_π_apply
| Mathlib/CategoryTheory/Limits/Shapes/Types.lean | 66 | 69 | theorem pi_lift_π_apply' {β : Type v} (f : β → Type v) {P : Type v}
(s : ∀ b, P ⟶ f b) (b : β) (x : P) :
(Pi.π f b : (piObj f) → f b) (@Pi.lift β _ _ f _ P s x) = s b x := by |
simp
| 0.9375 |
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {α : Type u} [Preorder α] {a : α} : ¬a < a := _root_.lt_irrefl a
| Mathlib/Tactic/Linarith/Lemmas.lean | 27 | 28 | theorem eq_of_eq_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0 := by |
simp [*]
| 0.9375 |
import Mathlib.Algebra.Order.Ring.Abs
#align_import data.int.order.units from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
namespace Int
theorem isUnit_iff_abs_eq {x : ℤ} : IsUnit x ↔ abs x = 1 := by
rw [isUnit_iff_natAbs_eq, abs_eq_natAbs, ← Int.ofNat_one, natCast_inj]
#align int.is_unit_iff_abs_eq Int.isUnit_iff_abs_eq
theorem isUnit_sq {a : ℤ} (ha : IsUnit a) : a ^ 2 = 1 := by rw [sq, isUnit_mul_self ha]
#align int.is_unit_sq Int.isUnit_sq
@[simp]
theorem units_sq (u : ℤˣ) : u ^ 2 = 1 := by
rw [Units.ext_iff, Units.val_pow_eq_pow_val, Units.val_one, isUnit_sq u.isUnit]
#align int.units_sq Int.units_sq
alias units_pow_two := units_sq
#align int.units_pow_two Int.units_pow_two
@[simp]
| Mathlib/Data/Int/Order/Units.lean | 33 | 33 | theorem units_mul_self (u : ℤˣ) : u * u = 1 := by | rw [← sq, units_sq]
| 0.9375 |
import Mathlib.Data.Opposite
import Mathlib.Tactic.Cases
#align_import combinatorics.quiver.basic from "leanprover-community/mathlib"@"56adee5b5eef9e734d82272918300fca4f3e7cef"
open Opposite
-- We use the same universe order as in category theory.
-- See note [CategoryTheory universes]
universe v v₁ v₂ u u₁ u₂
class Quiver (V : Type u) where
Hom : V → V → Sort v
#align quiver Quiver
#align quiver.hom Quiver.Hom
infixr:10 " ⟶ " => Quiver.Hom
structure Prefunctor (V : Type u₁) [Quiver.{v₁} V] (W : Type u₂) [Quiver.{v₂} W] where
obj : V → W
map : ∀ {X Y : V}, (X ⟶ Y) → (obj X ⟶ obj Y)
#align prefunctor Prefunctor
namespace Prefunctor
-- Porting note: added during port.
-- These lemmas can not be `@[simp]` because after `whnfR` they have a variable on the LHS.
-- Nevertheless they are sometimes useful when building functors.
lemma mk_obj {V W : Type*} [Quiver V] [Quiver W] {obj : V → W} {map} {X : V} :
(Prefunctor.mk obj map).obj X = obj X := rfl
lemma mk_map {V W : Type*} [Quiver V] [Quiver W] {obj : V → W} {map} {X Y : V} {f : X ⟶ Y} :
(Prefunctor.mk obj map).map f = map f := rfl
@[ext]
theorem ext {V : Type u} [Quiver.{v₁} V] {W : Type u₂} [Quiver.{v₂} W] {F G : Prefunctor V W}
(h_obj : ∀ X, F.obj X = G.obj X)
(h_map : ∀ (X Y : V) (f : X ⟶ Y),
F.map f = Eq.recOn (h_obj Y).symm (Eq.recOn (h_obj X).symm (G.map f))) : F = G := by
cases' F with F_obj _
cases' G with G_obj _
obtain rfl : F_obj = G_obj := by
ext X
apply h_obj
congr
funext X Y f
simpa using h_map X Y f
#align prefunctor.ext Prefunctor.ext
@[simps]
def id (V : Type*) [Quiver V] : Prefunctor V V where
obj := fun X => X
map f := f
#align prefunctor.id Prefunctor.id
#align prefunctor.id_obj Prefunctor.id_obj
#align prefunctor.id_map Prefunctor.id_map
instance (V : Type*) [Quiver V] : Inhabited (Prefunctor V V) :=
⟨id V⟩
@[simps]
def comp {U : Type*} [Quiver U] {V : Type*} [Quiver V] {W : Type*} [Quiver W]
(F : Prefunctor U V) (G : Prefunctor V W) : Prefunctor U W where
obj X := G.obj (F.obj X)
map f := G.map (F.map f)
#align prefunctor.comp Prefunctor.comp
#align prefunctor.comp_obj Prefunctor.comp_obj
#align prefunctor.comp_map Prefunctor.comp_map
@[simp]
theorem comp_id {U V : Type*} [Quiver U] [Quiver V] (F : Prefunctor U V) :
F.comp (id _) = F := rfl
#align prefunctor.comp_id Prefunctor.comp_id
@[simp]
theorem id_comp {U V : Type*} [Quiver U] [Quiver V] (F : Prefunctor U V) :
(id _).comp F = F := rfl
#align prefunctor.id_comp Prefunctor.id_comp
@[simp]
theorem comp_assoc {U V W Z : Type*} [Quiver U] [Quiver V] [Quiver W] [Quiver Z]
(F : Prefunctor U V) (G : Prefunctor V W) (H : Prefunctor W Z) :
(F.comp G).comp H = F.comp (G.comp H) :=
rfl
#align prefunctor.comp_assoc Prefunctor.comp_assoc
infixl:50 " ⥤q " => Prefunctor
infixl:60 " ⋙q " => Prefunctor.comp
notation "𝟭q" => id
| Mathlib/Combinatorics/Quiver/Basic.lean | 138 | 140 | theorem congr_map {U V : Type*} [Quiver U] [Quiver V] (F : U ⥤q V) {X Y : U} {f g : X ⟶ Y}
(h : f = g) : F.map f = F.map g := by |
rw [h]
| 0.9375 |
import Mathlib.MeasureTheory.Group.Arithmetic
#align_import measure_theory.group.pointwise from "leanprover-community/mathlib"@"66f7114a1d5cba41c47d417a034bbb2e96cf564a"
open Pointwise
open Set
@[to_additive]
theorem MeasurableSet.const_smul {G α : Type*} [Group G] [MulAction G α] [MeasurableSpace G]
[MeasurableSpace α] [MeasurableSMul G α] {s : Set α} (hs : MeasurableSet s) (a : G) :
MeasurableSet (a • s) := by
rw [← preimage_smul_inv]
exact measurable_const_smul _ hs
#align measurable_set.const_smul MeasurableSet.const_smul
#align measurable_set.const_vadd MeasurableSet.const_vadd
| Mathlib/MeasureTheory/Group/Pointwise.lean | 32 | 36 | theorem MeasurableSet.const_smul_of_ne_zero {G₀ α : Type*} [GroupWithZero G₀] [MulAction G₀ α]
[MeasurableSpace G₀] [MeasurableSpace α] [MeasurableSMul G₀ α] {s : Set α}
(hs : MeasurableSet s) {a : G₀} (ha : a ≠ 0) : MeasurableSet (a • s) := by |
rw [← preimage_smul_inv₀ ha]
exact measurable_const_smul _ hs
| 0.9375 |
import Mathlib.Algebra.GroupWithZero.NonZeroDivisors
import Mathlib.Algebra.Polynomial.Lifts
import Mathlib.GroupTheory.MonoidLocalization
import Mathlib.RingTheory.Algebraic
import Mathlib.RingTheory.Ideal.LocalRing
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Integer
#align_import ring_theory.localization.integral from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86"
variable {R : Type*} [CommRing R] (M : Submonoid R) {S : Type*} [CommRing S]
variable [Algebra R S] {P : Type*} [CommRing P]
open Polynomial
namespace IsLocalization
section IntegerNormalization
open Polynomial
variable [IsLocalization M S]
open scoped Classical
noncomputable def coeffIntegerNormalization (p : S[X]) (i : ℕ) : R :=
if hi : i ∈ p.support then
Classical.choose
(Classical.choose_spec (exist_integer_multiples_of_finset M (p.support.image p.coeff))
(p.coeff i) (Finset.mem_image.mpr ⟨i, hi, rfl⟩))
else 0
#align is_localization.coeff_integer_normalization IsLocalization.coeffIntegerNormalization
| Mathlib/RingTheory/Localization/Integral.lean | 55 | 58 | theorem coeffIntegerNormalization_of_not_mem_support (p : S[X]) (i : ℕ) (h : coeff p i = 0) :
coeffIntegerNormalization M p i = 0 := by |
simp only [coeffIntegerNormalization, h, mem_support_iff, eq_self_iff_true, not_true, Ne,
dif_neg, not_false_iff]
| 0.9375 |
import Mathlib.Init.Logic
import Mathlib.Tactic.AdaptationNote
import Mathlib.Tactic.Coe
set_option autoImplicit true
-- We align Lean 3 lemmas with lemmas in `Init.SimpLemmas` in Lean 4.
#align band_self Bool.and_self
#align band_tt Bool.and_true
#align band_ff Bool.and_false
#align tt_band Bool.true_and
#align ff_band Bool.false_and
#align bor_self Bool.or_self
#align bor_tt Bool.or_true
#align bor_ff Bool.or_false
#align tt_bor Bool.true_or
#align ff_bor Bool.false_or
#align bnot_bnot Bool.not_not
namespace Bool
#align bool.cond_tt Bool.cond_true
#align bool.cond_ff Bool.cond_false
#align cond_a_a Bool.cond_self
attribute [simp] xor_self
#align bxor_self Bool.xor_self
#align bxor_tt Bool.xor_true
#align bxor_ff Bool.xor_false
#align tt_bxor Bool.true_xor
#align ff_bxor Bool.false_xor
theorem true_eq_false_eq_False : ¬true = false := by decide
#align tt_eq_ff_eq_false Bool.true_eq_false_eq_False
theorem false_eq_true_eq_False : ¬false = true := by decide
#align ff_eq_tt_eq_false Bool.false_eq_true_eq_False
| Mathlib/Init/Data/Bool/Lemmas.lean | 54 | 54 | theorem eq_false_eq_not_eq_true (b : Bool) : (¬b = true) = (b = false) := by | simp
| 0.9375 |
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 IntermediateField
open Polynomial IntermediateField
section AbelRuffini
variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E]
| Mathlib/FieldTheory/AbelRuffini.lean | 39 | 39 | theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by | infer_instance
| 0.9375 |
import Mathlib.CategoryTheory.EpiMono
import Mathlib.CategoryTheory.Limits.HasLimits
#align_import category_theory.limits.shapes.equalizers from "leanprover-community/mathlib"@"4698e35ca56a0d4fa53aa5639c3364e0a77f4eba"
section
open CategoryTheory Opposite
namespace CategoryTheory.Limits
-- attribute [local tidy] tactic.case_bash -- Porting note: no tidy nor cases_bash
universe v v₂ u u₂
inductive WalkingParallelPair : Type
| zero
| one
deriving DecidableEq, Inhabited
#align category_theory.limits.walking_parallel_pair CategoryTheory.Limits.WalkingParallelPair
open WalkingParallelPair
inductive WalkingParallelPairHom : WalkingParallelPair → WalkingParallelPair → Type
| left : WalkingParallelPairHom zero one
| right : WalkingParallelPairHom zero one
| id (X : WalkingParallelPair) : WalkingParallelPairHom X X
deriving DecidableEq
#align category_theory.limits.walking_parallel_pair_hom CategoryTheory.Limits.WalkingParallelPairHom
attribute [-simp, nolint simpNF] WalkingParallelPairHom.id.sizeOf_spec
instance : Inhabited (WalkingParallelPairHom zero one) where default := WalkingParallelPairHom.left
open WalkingParallelPairHom
def WalkingParallelPairHom.comp :
-- Porting note: changed X Y Z to implicit to match comp fields in precategory
∀ { X Y Z : WalkingParallelPair } (_ : WalkingParallelPairHom X Y)
(_ : WalkingParallelPairHom Y Z), WalkingParallelPairHom X Z
| _, _, _, id _, h => h
| _, _, _, left, id one => left
| _, _, _, right, id one => right
#align category_theory.limits.walking_parallel_pair_hom.comp CategoryTheory.Limits.WalkingParallelPairHom.comp
-- Porting note: adding these since they are simple and aesop couldn't directly prove them
theorem WalkingParallelPairHom.id_comp
{X Y : WalkingParallelPair} (g : WalkingParallelPairHom X Y) : comp (id X) g = g :=
rfl
| Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean | 101 | 103 | theorem WalkingParallelPairHom.comp_id
{X Y : WalkingParallelPair} (f : WalkingParallelPairHom X Y) : comp f (id Y) = f := by |
cases f <;> rfl
| 0.9375 |
import Mathlib.Analysis.SpecialFunctions.Pow.Real
#align_import analysis.special_functions.pow.nnreal from "leanprover-community/mathlib"@"4fa54b337f7d52805480306db1b1439c741848c8"
noncomputable section
open scoped Classical
open Real NNReal ENNReal ComplexConjugate
open Finset Function Set
namespace NNReal
variable {w x y z : ℝ}
noncomputable def rpow (x : ℝ≥0) (y : ℝ) : ℝ≥0 :=
⟨(x : ℝ) ^ y, Real.rpow_nonneg x.2 y⟩
#align nnreal.rpow NNReal.rpow
noncomputable instance : Pow ℝ≥0 ℝ :=
⟨rpow⟩
@[simp]
theorem rpow_eq_pow (x : ℝ≥0) (y : ℝ) : rpow x y = x ^ y :=
rfl
#align nnreal.rpow_eq_pow NNReal.rpow_eq_pow
@[simp, norm_cast]
theorem coe_rpow (x : ℝ≥0) (y : ℝ) : ((x ^ y : ℝ≥0) : ℝ) = (x : ℝ) ^ y :=
rfl
#align nnreal.coe_rpow NNReal.coe_rpow
@[simp]
theorem rpow_zero (x : ℝ≥0) : x ^ (0 : ℝ) = 1 :=
NNReal.eq <| Real.rpow_zero _
#align nnreal.rpow_zero NNReal.rpow_zero
@[simp]
theorem rpow_eq_zero_iff {x : ℝ≥0} {y : ℝ} : x ^ y = 0 ↔ x = 0 ∧ y ≠ 0 := by
rw [← NNReal.coe_inj, coe_rpow, ← NNReal.coe_eq_zero]
exact Real.rpow_eq_zero_iff_of_nonneg x.2
#align nnreal.rpow_eq_zero_iff NNReal.rpow_eq_zero_iff
@[simp]
theorem zero_rpow {x : ℝ} (h : x ≠ 0) : (0 : ℝ≥0) ^ x = 0 :=
NNReal.eq <| Real.zero_rpow h
#align nnreal.zero_rpow NNReal.zero_rpow
@[simp]
theorem rpow_one (x : ℝ≥0) : x ^ (1 : ℝ) = x :=
NNReal.eq <| Real.rpow_one _
#align nnreal.rpow_one NNReal.rpow_one
@[simp]
theorem one_rpow (x : ℝ) : (1 : ℝ≥0) ^ x = 1 :=
NNReal.eq <| Real.one_rpow _
#align nnreal.one_rpow NNReal.one_rpow
theorem rpow_add {x : ℝ≥0} (hx : x ≠ 0) (y z : ℝ) : x ^ (y + z) = x ^ y * x ^ z :=
NNReal.eq <| Real.rpow_add (pos_iff_ne_zero.2 hx) _ _
#align nnreal.rpow_add NNReal.rpow_add
theorem rpow_add' (x : ℝ≥0) {y z : ℝ} (h : y + z ≠ 0) : x ^ (y + z) = x ^ y * x ^ z :=
NNReal.eq <| Real.rpow_add' x.2 h
#align nnreal.rpow_add' NNReal.rpow_add'
lemma rpow_of_add_eq (x : ℝ≥0) (hw : w ≠ 0) (h : y + z = w) : x ^ w = x ^ y * x ^ z := by
rw [← h, rpow_add']; rwa [h]
theorem rpow_mul (x : ℝ≥0) (y z : ℝ) : x ^ (y * z) = (x ^ y) ^ z :=
NNReal.eq <| Real.rpow_mul x.2 y z
#align nnreal.rpow_mul NNReal.rpow_mul
theorem rpow_neg (x : ℝ≥0) (y : ℝ) : x ^ (-y) = (x ^ y)⁻¹ :=
NNReal.eq <| Real.rpow_neg x.2 _
#align nnreal.rpow_neg NNReal.rpow_neg
| Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean | 97 | 97 | theorem rpow_neg_one (x : ℝ≥0) : x ^ (-1 : ℝ) = x⁻¹ := by | simp [rpow_neg]
| 0.9375 |
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {α : Type u} [Preorder α] {a : α} : ¬a < a := _root_.lt_irrefl a
theorem eq_of_eq_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0 := by
simp [*]
theorem le_of_eq_of_le {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b ≤ 0) : a + b ≤ 0 := by
simp [*]
| Mathlib/Tactic/Linarith/Lemmas.lean | 33 | 34 | theorem lt_of_eq_of_lt {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b < 0) : a + b < 0 := by |
simp [*]
| 0.9375 |
import Mathlib.MeasureTheory.Measure.Restrict
open scoped ENNReal NNReal Topology
open Set MeasureTheory Measure Filter Function MeasurableSpace ENNReal
variable {α β δ ι : Type*}
namespace MeasureTheory
variable {m0 : MeasurableSpace α} [MeasurableSpace β] {μ ν ν₁ ν₂: Measure α}
{s t : Set α}
section NoAtoms
class NoAtoms {m0 : MeasurableSpace α} (μ : Measure α) : Prop where
measure_singleton : ∀ x, μ {x} = 0
#align measure_theory.has_no_atoms MeasureTheory.NoAtoms
#align measure_theory.has_no_atoms.measure_singleton MeasureTheory.NoAtoms.measure_singleton
export MeasureTheory.NoAtoms (measure_singleton)
attribute [simp] measure_singleton
variable [NoAtoms μ]
theorem _root_.Set.Subsingleton.measure_zero (hs : s.Subsingleton) (μ : Measure α) [NoAtoms μ] :
μ s = 0 :=
hs.induction_on (p := fun s => μ s = 0) measure_empty measure_singleton
#align set.subsingleton.measure_zero Set.Subsingleton.measure_zero
theorem Measure.restrict_singleton' {a : α} : μ.restrict {a} = 0 := by
simp only [measure_singleton, Measure.restrict_eq_zero]
#align measure_theory.measure.restrict_singleton' MeasureTheory.Measure.restrict_singleton'
instance Measure.restrict.instNoAtoms (s : Set α) : NoAtoms (μ.restrict s) := by
refine ⟨fun x => ?_⟩
obtain ⟨t, hxt, ht1, ht2⟩ := exists_measurable_superset_of_null (measure_singleton x : μ {x} = 0)
apply measure_mono_null hxt
rw [Measure.restrict_apply ht1]
apply measure_mono_null inter_subset_left ht2
#align measure_theory.measure.restrict.has_no_atoms MeasureTheory.Measure.restrict.instNoAtoms
| Mathlib/MeasureTheory/Measure/Typeclasses.lean | 390 | 393 | theorem _root_.Set.Countable.measure_zero (h : s.Countable) (μ : Measure α) [NoAtoms μ] :
μ s = 0 := by |
rw [← biUnion_of_singleton s, measure_biUnion_null_iff h]
simp
| 0.9375 |
import Mathlib.Order.Interval.Set.UnorderedInterval
import Mathlib.Algebra.Order.Interval.Set.Monoid
import Mathlib.Data.Set.Pointwise.Basic
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
#align_import data.set.pointwise.interval from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Interval Pointwise
variable {α : Type*}
namespace Set
section ContravariantLE
variable [Mul α] [Preorder α]
variable [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (Function.swap HMul.hMul) LE.le]
@[to_additive Icc_add_Icc_subset]
theorem Icc_mul_Icc_subset' (a b c d : α) : Icc a b * Icc c d ⊆ Icc (a * c) (b * d) := by
rintro x ⟨y, ⟨hya, hyb⟩, z, ⟨hzc, hzd⟩, rfl⟩
exact ⟨mul_le_mul' hya hzc, mul_le_mul' hyb hzd⟩
@[to_additive Iic_add_Iic_subset]
| Mathlib/Data/Set/Pointwise/Interval.lean | 51 | 53 | theorem Iic_mul_Iic_subset' (a b : α) : Iic a * Iic b ⊆ Iic (a * b) := by |
rintro x ⟨y, hya, z, hzb, rfl⟩
exact mul_le_mul' hya hzb
| 0.9375 |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Algebra.Polynomial.Degree.Lemmas
#align_import data.polynomial.erase_lead from "leanprover-community/mathlib"@"fa256f00ce018e7b40e1dc756e403c86680bf448"
noncomputable section
open Polynomial
open Polynomial Finset
namespace Polynomial
variable {R : Type*} [Semiring R] {f : R[X]}
def eraseLead (f : R[X]) : R[X] :=
Polynomial.erase f.natDegree f
#align polynomial.erase_lead Polynomial.eraseLead
section EraseLead
theorem eraseLead_support (f : R[X]) : f.eraseLead.support = f.support.erase f.natDegree := by
simp only [eraseLead, support_erase]
#align polynomial.erase_lead_support Polynomial.eraseLead_support
theorem eraseLead_coeff (i : ℕ) :
f.eraseLead.coeff i = if i = f.natDegree then 0 else f.coeff i := by
simp only [eraseLead, coeff_erase]
#align polynomial.erase_lead_coeff Polynomial.eraseLead_coeff
@[simp]
theorem eraseLead_coeff_natDegree : f.eraseLead.coeff f.natDegree = 0 := by simp [eraseLead_coeff]
#align polynomial.erase_lead_coeff_nat_degree Polynomial.eraseLead_coeff_natDegree
theorem eraseLead_coeff_of_ne (i : ℕ) (hi : i ≠ f.natDegree) : f.eraseLead.coeff i = f.coeff i := by
simp [eraseLead_coeff, hi]
#align polynomial.erase_lead_coeff_of_ne Polynomial.eraseLead_coeff_of_ne
@[simp]
theorem eraseLead_zero : eraseLead (0 : R[X]) = 0 := by simp only [eraseLead, erase_zero]
#align polynomial.erase_lead_zero Polynomial.eraseLead_zero
@[simp]
theorem eraseLead_add_monomial_natDegree_leadingCoeff (f : R[X]) :
f.eraseLead + monomial f.natDegree f.leadingCoeff = f :=
(add_comm _ _).trans (f.monomial_add_erase _)
#align polynomial.erase_lead_add_monomial_nat_degree_leading_coeff Polynomial.eraseLead_add_monomial_natDegree_leadingCoeff
@[simp]
theorem eraseLead_add_C_mul_X_pow (f : R[X]) :
f.eraseLead + C f.leadingCoeff * X ^ f.natDegree = f := by
rw [C_mul_X_pow_eq_monomial, eraseLead_add_monomial_natDegree_leadingCoeff]
set_option linter.uppercaseLean3 false in
#align polynomial.erase_lead_add_C_mul_X_pow Polynomial.eraseLead_add_C_mul_X_pow
@[simp]
theorem self_sub_monomial_natDegree_leadingCoeff {R : Type*} [Ring R] (f : R[X]) :
f - monomial f.natDegree f.leadingCoeff = f.eraseLead :=
(eq_sub_iff_add_eq.mpr (eraseLead_add_monomial_natDegree_leadingCoeff f)).symm
#align polynomial.self_sub_monomial_nat_degree_leading_coeff Polynomial.self_sub_monomial_natDegree_leadingCoeff
@[simp]
| Mathlib/Algebra/Polynomial/EraseLead.lean | 83 | 85 | theorem self_sub_C_mul_X_pow {R : Type*} [Ring R] (f : R[X]) :
f - C f.leadingCoeff * X ^ f.natDegree = f.eraseLead := by |
rw [C_mul_X_pow_eq_monomial, self_sub_monomial_natDegree_leadingCoeff]
| 0.9375 |
import Mathlib.Data.Finsupp.Defs
#align_import data.finsupp.ne_locus from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
variable {α M N P : Type*}
namespace Finsupp
variable [DecidableEq α]
section NHasZero
variable [DecidableEq N] [Zero N] (f g : α →₀ N)
def neLocus (f g : α →₀ N) : Finset α :=
(f.support ∪ g.support).filter fun x => f x ≠ g x
#align finsupp.ne_locus Finsupp.neLocus
@[simp]
theorem mem_neLocus {f g : α →₀ N} {a : α} : a ∈ f.neLocus g ↔ f a ≠ g a := by
simpa only [neLocus, Finset.mem_filter, Finset.mem_union, mem_support_iff,
and_iff_right_iff_imp] using Ne.ne_or_ne _
#align finsupp.mem_ne_locus Finsupp.mem_neLocus
theorem not_mem_neLocus {f g : α →₀ N} {a : α} : a ∉ f.neLocus g ↔ f a = g a :=
mem_neLocus.not.trans not_ne_iff
#align finsupp.not_mem_ne_locus Finsupp.not_mem_neLocus
@[simp]
| Mathlib/Data/Finsupp/NeLocus.lean | 52 | 54 | theorem coe_neLocus : ↑(f.neLocus g) = { x | f x ≠ g x } := by |
ext
exact mem_neLocus
| 0.9375 |
import Mathlib.Data.Set.Basic
#align_import data.bundle from "leanprover-community/mathlib"@"e473c3198bb41f68560cab68a0529c854b618833"
open Function Set
namespace Bundle
variable {B F : Type*} (E : B → Type*)
@[ext]
structure TotalSpace (F : Type*) (E : B → Type*) where
proj : B
snd : E proj
#align bundle.total_space Bundle.TotalSpace
instance [Inhabited B] [Inhabited (E default)] : Inhabited (TotalSpace F E) :=
⟨⟨default, default⟩⟩
variable {E}
@[inherit_doc]
scoped notation:max "π" F':max E':max => Bundle.TotalSpace.proj (F := F') (E := E')
abbrev TotalSpace.mk' (F : Type*) (x : B) (y : E x) : TotalSpace F E := ⟨x, y⟩
theorem TotalSpace.mk_cast {x x' : B} (h : x = x') (b : E x) :
.mk' F x' (cast (congr_arg E h) b) = TotalSpace.mk x b := by subst h; rfl
#align bundle.total_space.mk_cast Bundle.TotalSpace.mk_cast
@[simp 1001, mfld_simps 1001]
| Mathlib/Data/Bundle.lean | 74 | 75 | theorem TotalSpace.mk_inj {b : B} {y y' : E b} : mk' F b y = mk' F b y' ↔ y = y' := by |
simp [TotalSpace.ext_iff]
| 0.9375 |
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics
import Mathlib.NumberTheory.Liouville.Basic
import Mathlib.Topology.Instances.Irrational
#align_import number_theory.liouville.liouville_with from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8"
open Filter Metric Real Set
open scoped Filter Topology
def LiouvilleWith (p x : ℝ) : Prop :=
∃ C, ∃ᶠ n : ℕ in atTop, ∃ m : ℤ, x ≠ m / n ∧ |x - m / n| < C / n ^ p
#align liouville_with LiouvilleWith
theorem liouvilleWith_one (x : ℝ) : LiouvilleWith 1 x := by
use 2
refine ((eventually_gt_atTop 0).mono fun n hn => ?_).frequently
have hn' : (0 : ℝ) < n := by simpa
have : x < ↑(⌊x * ↑n⌋ + 1) / ↑n := by
rw [lt_div_iff hn', Int.cast_add, Int.cast_one];
exact Int.lt_floor_add_one _
refine ⟨⌊x * n⌋ + 1, this.ne, ?_⟩
rw [abs_sub_comm, abs_of_pos (sub_pos.2 this), rpow_one, sub_lt_iff_lt_add',
add_div_eq_mul_add_div _ _ hn'.ne']
gcongr
calc _ ≤ x * n + 1 := by push_cast; gcongr; apply Int.floor_le
_ < x * n + 2 := by linarith
#align liouville_with_one liouvilleWith_one
namespace LiouvilleWith
variable {p q x y : ℝ} {r : ℚ} {m : ℤ} {n : ℕ}
theorem exists_pos (h : LiouvilleWith p x) :
∃ (C : ℝ) (_h₀ : 0 < C),
∃ᶠ n : ℕ in atTop, 1 ≤ n ∧ ∃ m : ℤ, x ≠ m / n ∧ |x - m / n| < C / n ^ p := by
rcases h with ⟨C, hC⟩
refine ⟨max C 1, zero_lt_one.trans_le <| le_max_right _ _, ?_⟩
refine ((eventually_ge_atTop 1).and_frequently hC).mono ?_
rintro n ⟨hle, m, hne, hlt⟩
refine ⟨hle, m, hne, hlt.trans_le ?_⟩
gcongr
apply le_max_left
#align liouville_with.exists_pos LiouvilleWith.exists_pos
theorem mono (h : LiouvilleWith p x) (hle : q ≤ p) : LiouvilleWith q x := by
rcases h.exists_pos with ⟨C, hC₀, hC⟩
refine ⟨C, hC.mono ?_⟩; rintro n ⟨hn, m, hne, hlt⟩
refine ⟨m, hne, hlt.trans_le <| ?_⟩
gcongr
exact_mod_cast hn
#align liouville_with.mono LiouvilleWith.mono
theorem frequently_lt_rpow_neg (h : LiouvilleWith p x) (hlt : q < p) :
∃ᶠ n : ℕ in atTop, ∃ m : ℤ, x ≠ m / n ∧ |x - m / n| < n ^ (-q) := by
rcases h.exists_pos with ⟨C, _hC₀, hC⟩
have : ∀ᶠ n : ℕ in atTop, C < n ^ (p - q) := by
simpa only [(· ∘ ·), neg_sub, one_div] using
((tendsto_rpow_atTop (sub_pos.2 hlt)).comp tendsto_natCast_atTop_atTop).eventually
(eventually_gt_atTop C)
refine (this.and_frequently hC).mono ?_
rintro n ⟨hnC, hn, m, hne, hlt⟩
replace hn : (0 : ℝ) < n := Nat.cast_pos.2 hn
refine ⟨m, hne, hlt.trans <| (div_lt_iff <| rpow_pos_of_pos hn _).2 ?_⟩
rwa [mul_comm, ← rpow_add hn, ← sub_eq_add_neg]
#align liouville_with.frequently_lt_rpow_neg LiouvilleWith.frequently_lt_rpow_neg
theorem mul_rat (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (x * r) := by
rcases h.exists_pos with ⟨C, _hC₀, hC⟩
refine ⟨r.den ^ p * (|r| * C), (tendsto_id.nsmul_atTop r.pos).frequently (hC.mono ?_)⟩
rintro n ⟨_hn, m, hne, hlt⟩
have A : (↑(r.num * m) : ℝ) / ↑(r.den • id n) = m / n * r := by
simp [← div_mul_div_comm, ← r.cast_def, mul_comm]
refine ⟨r.num * m, ?_, ?_⟩
· rw [A]; simp [hne, hr]
· rw [A, ← sub_mul, abs_mul]
simp only [smul_eq_mul, id, Nat.cast_mul]
calc _ < C / ↑n ^ p * |↑r| := by gcongr
_ = ↑r.den ^ p * (↑|r| * C) / (↑r.den * ↑n) ^ p := ?_
rw [mul_rpow, mul_div_mul_left, mul_comm, mul_div_assoc]
· simp only [Rat.cast_abs, le_refl]
all_goals positivity
#align liouville_with.mul_rat LiouvilleWith.mul_rat
theorem mul_rat_iff (hr : r ≠ 0) : LiouvilleWith p (x * r) ↔ LiouvilleWith p x :=
⟨fun h => by
simpa only [mul_assoc, ← Rat.cast_mul, mul_inv_cancel hr, Rat.cast_one, mul_one] using
h.mul_rat (inv_ne_zero hr),
fun h => h.mul_rat hr⟩
#align liouville_with.mul_rat_iff LiouvilleWith.mul_rat_iff
theorem rat_mul_iff (hr : r ≠ 0) : LiouvilleWith p (r * x) ↔ LiouvilleWith p x := by
rw [mul_comm, mul_rat_iff hr]
#align liouville_with.rat_mul_iff LiouvilleWith.rat_mul_iff
theorem rat_mul (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (r * x) :=
(rat_mul_iff hr).2 h
#align liouville_with.rat_mul LiouvilleWith.rat_mul
| Mathlib/NumberTheory/Liouville/LiouvilleWith.lean | 150 | 151 | theorem mul_int_iff (hm : m ≠ 0) : LiouvilleWith p (x * m) ↔ LiouvilleWith p x := by |
rw [← Rat.cast_intCast, mul_rat_iff (Int.cast_ne_zero.2 hm)]
| 0.9375 |
import Mathlib.Algebra.Order.Group.Abs
import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax
#align_import algebra.order.group.min_max from "leanprover-community/mathlib"@"10b4e499f43088dd3bb7b5796184ad5216648ab1"
section
variable {α : Type*} [Group α] [LinearOrder α] [CovariantClass α α (· * ·) (· ≤ ·)]
-- TODO: This duplicates `oneLePart_div_leOnePart`
@[to_additive (attr := simp)]
theorem max_one_div_max_inv_one_eq_self (a : α) : max a 1 / max a⁻¹ 1 = a := by
rcases le_total a 1 with (h | h) <;> simp [h]
#align max_one_div_max_inv_one_eq_self max_one_div_max_inv_one_eq_self
#align max_zero_sub_max_neg_zero_eq_self max_zero_sub_max_neg_zero_eq_self
alias max_zero_sub_eq_self := max_zero_sub_max_neg_zero_eq_self
#align max_zero_sub_eq_self max_zero_sub_eq_self
@[to_additive]
lemma max_inv_one (a : α) : max a⁻¹ 1 = a⁻¹ * max a 1 := by
rw [eq_inv_mul_iff_mul_eq, ← eq_div_iff_mul_eq', max_one_div_max_inv_one_eq_self]
end
section LinearOrderedCommGroup
variable {α : Type*} [LinearOrderedCommGroup α] {a b c : α}
@[to_additive min_neg_neg]
theorem min_inv_inv' (a b : α) : min a⁻¹ b⁻¹ = (max a b)⁻¹ :=
Eq.symm <| (@Monotone.map_max α αᵒᵈ _ _ Inv.inv a b) fun _ _ =>
-- Porting note: Explicit `α` necessary to infer `CovariantClass` instance
(@inv_le_inv_iff α _ _ _).mpr
#align min_inv_inv' min_inv_inv'
#align min_neg_neg min_neg_neg
@[to_additive max_neg_neg]
theorem max_inv_inv' (a b : α) : max a⁻¹ b⁻¹ = (min a b)⁻¹ :=
Eq.symm <| (@Monotone.map_min α αᵒᵈ _ _ Inv.inv a b) fun _ _ =>
-- Porting note: Explicit `α` necessary to infer `CovariantClass` instance
(@inv_le_inv_iff α _ _ _).mpr
#align max_inv_inv' max_inv_inv'
#align max_neg_neg max_neg_neg
@[to_additive min_sub_sub_right]
theorem min_div_div_right' (a b c : α) : min (a / c) (b / c) = min a b / c := by
simpa only [div_eq_mul_inv] using min_mul_mul_right a b c⁻¹
#align min_div_div_right' min_div_div_right'
#align min_sub_sub_right min_sub_sub_right
@[to_additive max_sub_sub_right]
| Mathlib/Algebra/Order/Group/MinMax.lean | 63 | 64 | theorem max_div_div_right' (a b c : α) : max (a / c) (b / c) = max a b / c := by |
simpa only [div_eq_mul_inv] using max_mul_mul_right a b c⁻¹
| 0.9375 |
import Mathlib.Algebra.Algebra.Equiv
import Mathlib.LinearAlgebra.Span
#align_import algebra.algebra.tower from "leanprover-community/mathlib"@"71150516f28d9826c7341f8815b31f7d8770c212"
open Pointwise
universe u v w u₁ v₁
variable (R : Type u) (S : Type v) (A : Type w) (B : Type u₁) (M : Type v₁)
namespace IsScalarTower
section Semiring
variable [CommSemiring R] [CommSemiring S] [Semiring A] [Semiring B]
variable [Algebra R S] [Algebra S A] [Algebra S B]
variable {R S A}
theorem of_algebraMap_eq [Algebra R A]
(h : ∀ x, algebraMap R A x = algebraMap S A (algebraMap R S x)) : IsScalarTower R S A :=
⟨fun x y z => by simp_rw [Algebra.smul_def, RingHom.map_mul, mul_assoc, h]⟩
#align is_scalar_tower.of_algebra_map_eq IsScalarTower.of_algebraMap_eq
theorem of_algebraMap_eq' [Algebra R A]
(h : algebraMap R A = (algebraMap S A).comp (algebraMap R S)) : IsScalarTower R S A :=
of_algebraMap_eq <| RingHom.ext_iff.1 h
#align is_scalar_tower.of_algebra_map_eq' IsScalarTower.of_algebraMap_eq'
variable (R S A)
variable [Algebra R A] [Algebra R B]
variable [IsScalarTower R S A] [IsScalarTower R S B]
theorem algebraMap_eq : algebraMap R A = (algebraMap S A).comp (algebraMap R S) :=
RingHom.ext fun x => by
simp_rw [RingHom.comp_apply, Algebra.algebraMap_eq_smul_one, smul_assoc, one_smul]
#align is_scalar_tower.algebra_map_eq IsScalarTower.algebraMap_eq
| Mathlib/Algebra/Algebra/Tower.lean | 130 | 131 | theorem algebraMap_apply (x : R) : algebraMap R A x = algebraMap S A (algebraMap R S x) := by |
rw [algebraMap_eq R S A, RingHom.comp_apply]
| 0.9375 |
import Mathlib.Analysis.Complex.UpperHalfPlane.Topology
import Mathlib.Analysis.SpecialFunctions.Arsinh
import Mathlib.Geometry.Euclidean.Inversion.Basic
#align_import analysis.complex.upper_half_plane.metric from "leanprover-community/mathlib"@"caa58cbf5bfb7f81ccbaca4e8b8ac4bc2b39cc1c"
noncomputable section
open scoped UpperHalfPlane ComplexConjugate NNReal Topology MatrixGroups
open Set Metric Filter Real
variable {z w : ℍ} {r R : ℝ}
namespace UpperHalfPlane
instance : Dist ℍ :=
⟨fun z w => 2 * arsinh (dist (z : ℂ) w / (2 * √(z.im * w.im)))⟩
theorem dist_eq (z w : ℍ) : dist z w = 2 * arsinh (dist (z : ℂ) w / (2 * √(z.im * w.im))) :=
rfl
#align upper_half_plane.dist_eq UpperHalfPlane.dist_eq
theorem sinh_half_dist (z w : ℍ) :
sinh (dist z w / 2) = dist (z : ℂ) w / (2 * √(z.im * w.im)) := by
rw [dist_eq, mul_div_cancel_left₀ (arsinh _) two_ne_zero, sinh_arsinh]
#align upper_half_plane.sinh_half_dist UpperHalfPlane.sinh_half_dist
theorem cosh_half_dist (z w : ℍ) :
cosh (dist z w / 2) = dist (z : ℂ) (conj (w : ℂ)) / (2 * √(z.im * w.im)) := by
rw [← sq_eq_sq, cosh_sq', sinh_half_dist, div_pow, div_pow, one_add_div, mul_pow, sq_sqrt]
· congr 1
simp only [Complex.dist_eq, Complex.sq_abs, Complex.normSq_sub, Complex.normSq_conj,
Complex.conj_conj, Complex.mul_re, Complex.conj_re, Complex.conj_im, coe_im]
ring
all_goals positivity
#align upper_half_plane.cosh_half_dist UpperHalfPlane.cosh_half_dist
| Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean | 60 | 63 | theorem tanh_half_dist (z w : ℍ) :
tanh (dist z w / 2) = dist (z : ℂ) w / dist (z : ℂ) (conj ↑w) := by |
rw [tanh_eq_sinh_div_cosh, sinh_half_dist, cosh_half_dist, div_div_div_comm, div_self, div_one]
positivity
| 0.9375 |
import Mathlib.Algebra.Polynomial.Eval
#align_import data.polynomial.degree.lemmas from "leanprover-community/mathlib"@"728baa2f54e6062c5879a3e397ac6bac323e506f"
noncomputable section
open Polynomial
open Finsupp Finset
namespace Polynomial
universe u v w
variable {R : Type u} {S : Type v} {ι : Type w} {a b : R} {m n : ℕ}
section Semiring
variable [Semiring R] {p q r : R[X]}
section Degree
theorem natDegree_comp_le : natDegree (p.comp q) ≤ natDegree p * natDegree q :=
letI := Classical.decEq R
if h0 : p.comp q = 0 then by rw [h0, natDegree_zero]; exact Nat.zero_le _
else
WithBot.coe_le_coe.1 <|
calc
↑(natDegree (p.comp q)) = degree (p.comp q) := (degree_eq_natDegree h0).symm
_ = _ := congr_arg degree comp_eq_sum_left
_ ≤ _ := degree_sum_le _ _
_ ≤ _ :=
Finset.sup_le fun n hn =>
calc
degree (C (coeff p n) * q ^ n) ≤ degree (C (coeff p n)) + degree (q ^ n) :=
degree_mul_le _ _
_ ≤ natDegree (C (coeff p n)) + n • degree q :=
(add_le_add degree_le_natDegree (degree_pow_le _ _))
_ ≤ natDegree (C (coeff p n)) + n • ↑(natDegree q) :=
(add_le_add_left (nsmul_le_nsmul_right (@degree_le_natDegree _ _ q) n) _)
_ = (n * natDegree q : ℕ) := by
rw [natDegree_C, Nat.cast_zero, zero_add, nsmul_eq_mul];
simp
_ ≤ (natDegree p * natDegree q : ℕ) :=
WithBot.coe_le_coe.2 <|
mul_le_mul_of_nonneg_right (le_natDegree_of_ne_zero (mem_support_iff.1 hn))
(Nat.zero_le _)
#align polynomial.nat_degree_comp_le Polynomial.natDegree_comp_le
theorem degree_pos_of_root {p : R[X]} (hp : p ≠ 0) (h : IsRoot p a) : 0 < degree p :=
lt_of_not_ge fun hlt => by
have := eq_C_of_degree_le_zero hlt
rw [IsRoot, this, eval_C] at h
simp only [h, RingHom.map_zero] at this
exact hp this
#align polynomial.degree_pos_of_root Polynomial.degree_pos_of_root
theorem natDegree_le_iff_coeff_eq_zero : p.natDegree ≤ n ↔ ∀ N : ℕ, n < N → p.coeff N = 0 := by
simp_rw [natDegree_le_iff_degree_le, degree_le_iff_coeff_zero, Nat.cast_lt]
#align polynomial.nat_degree_le_iff_coeff_eq_zero Polynomial.natDegree_le_iff_coeff_eq_zero
theorem natDegree_add_le_iff_left {n : ℕ} (p q : R[X]) (qn : q.natDegree ≤ n) :
(p + q).natDegree ≤ n ↔ p.natDegree ≤ n := by
refine ⟨fun h => ?_, fun h => natDegree_add_le_of_degree_le h qn⟩
refine natDegree_le_iff_coeff_eq_zero.mpr fun m hm => ?_
convert natDegree_le_iff_coeff_eq_zero.mp h m hm using 1
rw [coeff_add, natDegree_le_iff_coeff_eq_zero.mp qn _ hm, add_zero]
#align polynomial.nat_degree_add_le_iff_left Polynomial.natDegree_add_le_iff_left
theorem natDegree_add_le_iff_right {n : ℕ} (p q : R[X]) (pn : p.natDegree ≤ n) :
(p + q).natDegree ≤ n ↔ q.natDegree ≤ n := by
rw [add_comm]
exact natDegree_add_le_iff_left _ _ pn
#align polynomial.nat_degree_add_le_iff_right Polynomial.natDegree_add_le_iff_right
theorem natDegree_C_mul_le (a : R) (f : R[X]) : (C a * f).natDegree ≤ f.natDegree :=
calc
(C a * f).natDegree ≤ (C a).natDegree + f.natDegree := natDegree_mul_le
_ = 0 + f.natDegree := by rw [natDegree_C a]
_ = f.natDegree := zero_add _
set_option linter.uppercaseLean3 false in
#align polynomial.nat_degree_C_mul_le Polynomial.natDegree_C_mul_le
theorem natDegree_mul_C_le (f : R[X]) (a : R) : (f * C a).natDegree ≤ f.natDegree :=
calc
(f * C a).natDegree ≤ f.natDegree + (C a).natDegree := natDegree_mul_le
_ = f.natDegree + 0 := by rw [natDegree_C a]
_ = f.natDegree := add_zero _
set_option linter.uppercaseLean3 false in
#align polynomial.nat_degree_mul_C_le Polynomial.natDegree_mul_C_le
theorem eq_natDegree_of_le_mem_support (pn : p.natDegree ≤ n) (ns : n ∈ p.support) :
p.natDegree = n :=
le_antisymm pn (le_natDegree_of_mem_supp _ ns)
#align polynomial.eq_nat_degree_of_le_mem_support Polynomial.eq_natDegree_of_le_mem_support
theorem natDegree_C_mul_eq_of_mul_eq_one {ai : R} (au : ai * a = 1) :
(C a * p).natDegree = p.natDegree :=
le_antisymm (natDegree_C_mul_le a p)
(calc
p.natDegree = (1 * p).natDegree := by nth_rw 1 [← one_mul p]
_ = (C ai * (C a * p)).natDegree := by rw [← C_1, ← au, RingHom.map_mul, ← mul_assoc]
_ ≤ (C a * p).natDegree := natDegree_C_mul_le ai (C a * p))
set_option linter.uppercaseLean3 false in
#align polynomial.nat_degree_C_mul_eq_of_mul_eq_one Polynomial.natDegree_C_mul_eq_of_mul_eq_one
| Mathlib/Algebra/Polynomial/Degree/Lemmas.lean | 121 | 127 | theorem natDegree_mul_C_eq_of_mul_eq_one {ai : R} (au : a * ai = 1) :
(p * C a).natDegree = p.natDegree :=
le_antisymm (natDegree_mul_C_le p a)
(calc
p.natDegree = (p * 1).natDegree := by | nth_rw 1 [← mul_one p]
_ = (p * C a * C ai).natDegree := by rw [← C_1, ← au, RingHom.map_mul, ← mul_assoc]
_ ≤ (p * C a).natDegree := natDegree_mul_C_le (p * C a) ai)
| 0.9375 |
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.Algebra.Polynomial.HasseDeriv
#align_import data.polynomial.taylor from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
namespace Polynomial
open Polynomial
variable {R : Type*} [Semiring R] (r : R) (f : R[X])
def taylor (r : R) : R[X] →ₗ[R] R[X] where
toFun f := f.comp (X + C r)
map_add' f g := add_comp
map_smul' c f := by simp only [smul_eq_C_mul, C_mul_comp, RingHom.id_apply]
#align polynomial.taylor Polynomial.taylor
theorem taylor_apply : taylor r f = f.comp (X + C r) :=
rfl
#align polynomial.taylor_apply Polynomial.taylor_apply
@[simp]
theorem taylor_X : taylor r X = X + C r := by simp only [taylor_apply, X_comp]
set_option linter.uppercaseLean3 false in
#align polynomial.taylor_X Polynomial.taylor_X
@[simp]
theorem taylor_C (x : R) : taylor r (C x) = C x := by simp only [taylor_apply, C_comp]
set_option linter.uppercaseLean3 false in
#align polynomial.taylor_C Polynomial.taylor_C
@[simp]
| Mathlib/Algebra/Polynomial/Taylor.lean | 56 | 59 | theorem taylor_zero' : taylor (0 : R) = LinearMap.id := by |
ext
simp only [taylor_apply, add_zero, comp_X, _root_.map_zero, LinearMap.id_comp,
Function.comp_apply, LinearMap.coe_comp]
| 0.9375 |
import Mathlib.Analysis.InnerProductSpace.PiL2
import Mathlib.LinearAlgebra.Matrix.Block
#align_import analysis.inner_product_space.gram_schmidt_ortho from "leanprover-community/mathlib"@"1a4df69ca1a9a0e5e26bfe12e2b92814216016d0"
open Finset Submodule FiniteDimensional
variable (𝕜 : Type*) {E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E]
variable {ι : Type*} [LinearOrder ι] [LocallyFiniteOrderBot ι] [IsWellOrder ι (· < ·)]
attribute [local instance] IsWellOrder.toHasWellFounded
local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y
noncomputable def gramSchmidt [IsWellOrder ι (· < ·)] (f : ι → E) (n : ι) : E :=
f n - ∑ i : Iio n, orthogonalProjection (𝕜 ∙ gramSchmidt f i) (f n)
termination_by n
decreasing_by exact mem_Iio.1 i.2
#align gram_schmidt gramSchmidt
theorem gramSchmidt_def (f : ι → E) (n : ι) :
gramSchmidt 𝕜 f n = f n - ∑ i ∈ Iio n, orthogonalProjection (𝕜 ∙ gramSchmidt 𝕜 f i) (f n) := by
rw [← sum_attach, attach_eq_univ, gramSchmidt]
#align gram_schmidt_def gramSchmidt_def
| Mathlib/Analysis/InnerProductSpace/GramSchmidtOrtho.lean | 63 | 65 | theorem gramSchmidt_def' (f : ι → E) (n : ι) :
f n = gramSchmidt 𝕜 f n + ∑ i ∈ Iio n, orthogonalProjection (𝕜 ∙ gramSchmidt 𝕜 f i) (f n) := by |
rw [gramSchmidt_def, sub_add_cancel]
| 0.9375 |
import Mathlib.Order.Sublattice
import Mathlib.Order.Hom.CompleteLattice
open Function Set
variable (α β : Type*) [CompleteLattice α] [CompleteLattice β] (f : CompleteLatticeHom α β)
structure CompleteSublattice extends Sublattice α where
sSupClosed' : ∀ ⦃s : Set α⦄, s ⊆ carrier → sSup s ∈ carrier
sInfClosed' : ∀ ⦃s : Set α⦄, s ⊆ carrier → sInf s ∈ carrier
variable {α β}
namespace CompleteSublattice
@[simps] def mk' (carrier : Set α)
(sSupClosed' : ∀ ⦃s : Set α⦄, s ⊆ carrier → sSup s ∈ carrier)
(sInfClosed' : ∀ ⦃s : Set α⦄, s ⊆ carrier → sInf s ∈ carrier) :
CompleteSublattice α where
carrier := carrier
sSupClosed' := sSupClosed'
sInfClosed' := sInfClosed'
supClosed' := fun x hx y hy ↦ by
suffices x ⊔ y = sSup {x, y} by exact this ▸ sSupClosed' (fun z hz ↦ by aesop)
simp [sSup_singleton]
infClosed' := fun x hx y hy ↦ by
suffices x ⊓ y = sInf {x, y} by exact this ▸ sInfClosed' (fun z hz ↦ by aesop)
simp [sInf_singleton]
variable {L : CompleteSublattice α}
instance instSetLike : SetLike (CompleteSublattice α) α where
coe L := L.carrier
coe_injective' L M h := by cases L; cases M; congr; exact SetLike.coe_injective' h
instance instBot : Bot L where
bot := ⟨⊥, by simpa using L.sSupClosed' <| empty_subset _⟩
instance instTop : Top L where
top := ⟨⊤, by simpa using L.sInfClosed' <| empty_subset _⟩
instance instSupSet : SupSet L where
sSup s := ⟨sSup s, L.sSupClosed' image_val_subset⟩
instance instInfSet : InfSet L where
sInf s := ⟨sInf s, L.sInfClosed' image_val_subset⟩
theorem sSupClosed {s : Set α} (h : s ⊆ L) : sSup s ∈ L := L.sSupClosed' h
theorem sInfClosed {s : Set α} (h : s ⊆ L) : sInf s ∈ L := L.sInfClosed' h
@[simp] theorem coe_bot : (↑(⊥ : L) : α) = ⊥ := rfl
@[simp] theorem coe_top : (↑(⊤ : L) : α) = ⊤ := rfl
@[simp] theorem coe_sSup (S : Set L) : (↑(sSup S) : α) = sSup {(s : α) | s ∈ S} := rfl
| Mathlib/Order/CompleteSublattice.lean | 84 | 85 | theorem coe_sSup' (S : Set L) : (↑(sSup S) : α) = ⨆ N ∈ S, (N : α) := by |
rw [coe_sSup, ← Set.image, sSup_image]
| 0.9375 |
import Mathlib.Algebra.Order.BigOperators.Ring.Finset
import Mathlib.Analysis.Convex.Hull
import Mathlib.LinearAlgebra.AffineSpace.Basis
#align_import analysis.convex.combination from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d"
open Set Function
open scoped Classical
open Pointwise
universe u u'
variable {R R' E F ι ι' α : Type*} [LinearOrderedField R] [LinearOrderedField R'] [AddCommGroup E]
[AddCommGroup F] [LinearOrderedAddCommGroup α] [Module R E] [Module R F] [Module R α]
[OrderedSMul R α] {s : Set E}
def Finset.centerMass (t : Finset ι) (w : ι → R) (z : ι → E) : E :=
(∑ i ∈ t, w i)⁻¹ • ∑ i ∈ t, w i • z i
#align finset.center_mass Finset.centerMass
variable (i j : ι) (c : R) (t : Finset ι) (w : ι → R) (z : ι → E)
open Finset
| Mathlib/Analysis/Convex/Combination.lean | 50 | 51 | theorem Finset.centerMass_empty : (∅ : Finset ι).centerMass w z = 0 := by |
simp only [centerMass, sum_empty, smul_zero]
| 0.9375 |
import Mathlib.Order.Interval.Set.UnorderedInterval
import Mathlib.Algebra.Order.Interval.Set.Monoid
import Mathlib.Data.Set.Pointwise.Basic
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
#align_import data.set.pointwise.interval from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Interval Pointwise
variable {α : Type*}
namespace Set
section ContravariantLE
variable [Mul α] [Preorder α]
variable [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (Function.swap HMul.hMul) LE.le]
@[to_additive Icc_add_Icc_subset]
| Mathlib/Data/Set/Pointwise/Interval.lean | 46 | 48 | theorem Icc_mul_Icc_subset' (a b c d : α) : Icc a b * Icc c d ⊆ Icc (a * c) (b * d) := by |
rintro x ⟨y, ⟨hya, hyb⟩, z, ⟨hzc, hzd⟩, rfl⟩
exact ⟨mul_le_mul' hya hzc, mul_le_mul' hyb hzd⟩
| 0.9375 |
import Mathlib.Probability.ProbabilityMassFunction.Monad
#align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d"
universe u
namespace PMF
noncomputable section
variable {α β γ : Type*}
open scoped Classical
open NNReal ENNReal
section Map
def map (f : α → β) (p : PMF α) : PMF β :=
bind p (pure ∘ f)
#align pmf.map PMF.map
variable (f : α → β) (p : PMF α) (b : β)
theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f := rfl
#align pmf.monad_map_eq_map PMF.monad_map_eq_map
@[simp]
| Mathlib/Probability/ProbabilityMassFunction/Constructions.lean | 52 | 52 | theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by | simp [map]
| 0.9375 |
import Mathlib.Combinatorics.SimpleGraph.Connectivity
import Mathlib.Data.Nat.Lattice
#align_import combinatorics.simple_graph.metric from "leanprover-community/mathlib"@"352ecfe114946c903338006dd3287cb5a9955ff2"
namespace SimpleGraph
variable {V : Type*} (G : SimpleGraph V)
noncomputable def dist (u v : V) : ℕ :=
sInf (Set.range (Walk.length : G.Walk u v → ℕ))
#align simple_graph.dist SimpleGraph.dist
variable {G}
protected theorem Reachable.exists_walk_of_dist {u v : V} (hr : G.Reachable u v) :
∃ p : G.Walk u v, p.length = G.dist u v :=
Nat.sInf_mem (Set.range_nonempty_iff_nonempty.mpr hr)
#align simple_graph.reachable.exists_walk_of_dist SimpleGraph.Reachable.exists_walk_of_dist
protected theorem Connected.exists_walk_of_dist (hconn : G.Connected) (u v : V) :
∃ p : G.Walk u v, p.length = G.dist u v :=
(hconn u v).exists_walk_of_dist
#align simple_graph.connected.exists_walk_of_dist SimpleGraph.Connected.exists_walk_of_dist
theorem dist_le {u v : V} (p : G.Walk u v) : G.dist u v ≤ p.length :=
Nat.sInf_le ⟨p, rfl⟩
#align simple_graph.dist_le SimpleGraph.dist_le
@[simp]
theorem dist_eq_zero_iff_eq_or_not_reachable {u v : V} :
G.dist u v = 0 ↔ u = v ∨ ¬G.Reachable u v := by simp [dist, Nat.sInf_eq_zero, Reachable]
#align simple_graph.dist_eq_zero_iff_eq_or_not_reachable SimpleGraph.dist_eq_zero_iff_eq_or_not_reachable
| Mathlib/Combinatorics/SimpleGraph/Metric.lean | 74 | 74 | theorem dist_self {v : V} : dist G v v = 0 := by | simp
| 0.9375 |
import Mathlib.Order.Filter.Prod
#align_import order.filter.n_ary from "leanprover-community/mathlib"@"78f647f8517f021d839a7553d5dc97e79b508dea"
open Function Set
open Filter
namespace Filter
variable {α α' β β' γ γ' δ δ' ε ε' : Type*} {m : α → β → γ} {f f₁ f₂ : Filter α}
{g g₁ g₂ : Filter β} {h h₁ h₂ : Filter γ} {s s₁ s₂ : Set α} {t t₁ t₂ : Set β} {u : Set γ}
{v : Set δ} {a : α} {b : β} {c : γ}
def map₂ (m : α → β → γ) (f : Filter α) (g : Filter β) : Filter γ :=
((f ×ˢ g).map (uncurry m)).copy { s | ∃ u ∈ f, ∃ v ∈ g, image2 m u v ⊆ s } fun _ ↦ by
simp only [mem_map, mem_prod_iff, image2_subset_iff, prod_subset_iff]; rfl
#align filter.map₂ Filter.map₂
@[simp 900]
theorem mem_map₂_iff : u ∈ map₂ m f g ↔ ∃ s ∈ f, ∃ t ∈ g, image2 m s t ⊆ u :=
Iff.rfl
#align filter.mem_map₂_iff Filter.mem_map₂_iff
theorem image2_mem_map₂ (hs : s ∈ f) (ht : t ∈ g) : image2 m s t ∈ map₂ m f g :=
⟨_, hs, _, ht, Subset.rfl⟩
#align filter.image2_mem_map₂ Filter.image2_mem_map₂
theorem map_prod_eq_map₂ (m : α → β → γ) (f : Filter α) (g : Filter β) :
Filter.map (fun p : α × β => m p.1 p.2) (f ×ˢ g) = map₂ m f g := by
rw [map₂, copy_eq, uncurry_def]
#align filter.map_prod_eq_map₂ Filter.map_prod_eq_map₂
theorem map_prod_eq_map₂' (m : α × β → γ) (f : Filter α) (g : Filter β) :
Filter.map m (f ×ˢ g) = map₂ (fun a b => m (a, b)) f g :=
map_prod_eq_map₂ (curry m) f g
#align filter.map_prod_eq_map₂' Filter.map_prod_eq_map₂'
@[simp]
| Mathlib/Order/Filter/NAry.lean | 64 | 65 | theorem map₂_mk_eq_prod (f : Filter α) (g : Filter β) : map₂ Prod.mk f g = f ×ˢ g := by |
simp only [← map_prod_eq_map₂, map_id']
| 0.9375 |
import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv
#align_import linear_algebra.affine_space.midpoint from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open AffineMap AffineEquiv
section
variable (R : Type*) {V V' P P' : Type*} [Ring R] [Invertible (2 : R)] [AddCommGroup V]
[Module R V] [AddTorsor V P] [AddCommGroup V'] [Module R V'] [AddTorsor V' P']
def midpoint (x y : P) : P :=
lineMap x y (⅟ 2 : R)
#align midpoint midpoint
variable {R} {x y z : P}
@[simp]
theorem AffineMap.map_midpoint (f : P →ᵃ[R] P') (a b : P) :
f (midpoint R a b) = midpoint R (f a) (f b) :=
f.apply_lineMap a b _
#align affine_map.map_midpoint AffineMap.map_midpoint
@[simp]
theorem AffineEquiv.map_midpoint (f : P ≃ᵃ[R] P') (a b : P) :
f (midpoint R a b) = midpoint R (f a) (f b) :=
f.apply_lineMap a b _
#align affine_equiv.map_midpoint AffineEquiv.map_midpoint
theorem AffineEquiv.pointReflection_midpoint_left (x y : P) :
pointReflection R (midpoint R x y) x = y := by
rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
mul_invOf_self, one_smul, vsub_vadd]
#align affine_equiv.point_reflection_midpoint_left AffineEquiv.pointReflection_midpoint_left
@[simp] -- Porting note: added variant with `Equiv.pointReflection` for `simp`
theorem Equiv.pointReflection_midpoint_left (x y : P) :
(Equiv.pointReflection (midpoint R x y)) x = y := by
rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
mul_invOf_self, one_smul, vsub_vadd]
theorem midpoint_comm (x y : P) : midpoint R x y = midpoint R y x := by
rw [midpoint, ← lineMap_apply_one_sub, one_sub_invOf_two, midpoint]
#align midpoint_comm midpoint_comm
| Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean | 77 | 79 | theorem AffineEquiv.pointReflection_midpoint_right (x y : P) :
pointReflection R (midpoint R x y) y = x := by |
rw [midpoint_comm, AffineEquiv.pointReflection_midpoint_left]
| 0.9375 |
import Mathlib.MeasureTheory.PiSystem
import Mathlib.Order.OmegaCompletePartialOrder
import Mathlib.Topology.Constructions
import Mathlib.MeasureTheory.MeasurableSpace.Basic
open Set
namespace MeasureTheory
variable {ι : Type _} {α : ι → Type _}
section cylinder
def cylinder (s : Finset ι) (S : Set (∀ i : s, α i)) : Set (∀ i, α i) :=
(fun (f : ∀ i, α i) (i : s) ↦ f i) ⁻¹' S
@[simp]
theorem mem_cylinder (s : Finset ι) (S : Set (∀ i : s, α i)) (f : ∀ i, α i) :
f ∈ cylinder s S ↔ (fun i : s ↦ f i) ∈ S :=
mem_preimage
@[simp]
theorem cylinder_empty (s : Finset ι) : cylinder s (∅ : Set (∀ i : s, α i)) = ∅ := by
rw [cylinder, preimage_empty]
@[simp]
theorem cylinder_univ (s : Finset ι) : cylinder s (univ : Set (∀ i : s, α i)) = univ := by
rw [cylinder, preimage_univ]
@[simp]
theorem cylinder_eq_empty_iff [h_nonempty : Nonempty (∀ i, α i)] (s : Finset ι)
(S : Set (∀ i : s, α i)) :
cylinder s S = ∅ ↔ S = ∅ := by
refine ⟨fun h ↦ ?_, fun h ↦ by (rw [h]; exact cylinder_empty _)⟩
by_contra hS
rw [← Ne, ← nonempty_iff_ne_empty] at hS
let f := hS.some
have hf : f ∈ S := hS.choose_spec
classical
let f' : ∀ i, α i := fun i ↦ if hi : i ∈ s then f ⟨i, hi⟩ else h_nonempty.some i
have hf' : f' ∈ cylinder s S := by
rw [mem_cylinder]
simpa only [f', Finset.coe_mem, dif_pos]
rw [h] at hf'
exact not_mem_empty _ hf'
theorem inter_cylinder (s₁ s₂ : Finset ι) (S₁ : Set (∀ i : s₁, α i)) (S₂ : Set (∀ i : s₂, α i))
[DecidableEq ι] :
cylinder s₁ S₁ ∩ cylinder s₂ S₂ =
cylinder (s₁ ∪ s₂)
((fun f ↦ fun j : s₁ ↦ f ⟨j, Finset.mem_union_left s₂ j.prop⟩) ⁻¹' S₁ ∩
(fun f ↦ fun j : s₂ ↦ f ⟨j, Finset.mem_union_right s₁ j.prop⟩) ⁻¹' S₂) := by
ext1 f; simp only [mem_inter_iff, mem_cylinder, mem_setOf_eq]; rfl
theorem inter_cylinder_same (s : Finset ι) (S₁ : Set (∀ i : s, α i)) (S₂ : Set (∀ i : s, α i)) :
cylinder s S₁ ∩ cylinder s S₂ = cylinder s (S₁ ∩ S₂) := by
classical rw [inter_cylinder]; rfl
theorem union_cylinder (s₁ s₂ : Finset ι) (S₁ : Set (∀ i : s₁, α i)) (S₂ : Set (∀ i : s₂, α i))
[DecidableEq ι] :
cylinder s₁ S₁ ∪ cylinder s₂ S₂ =
cylinder (s₁ ∪ s₂)
((fun f ↦ fun j : s₁ ↦ f ⟨j, Finset.mem_union_left s₂ j.prop⟩) ⁻¹' S₁ ∪
(fun f ↦ fun j : s₂ ↦ f ⟨j, Finset.mem_union_right s₁ j.prop⟩) ⁻¹' S₂) := by
ext1 f; simp only [mem_union, mem_cylinder, mem_setOf_eq]; rfl
| Mathlib/MeasureTheory/Constructions/Cylinders.lean | 205 | 207 | theorem union_cylinder_same (s : Finset ι) (S₁ : Set (∀ i : s, α i)) (S₂ : Set (∀ i : s, α i)) :
cylinder s S₁ ∪ cylinder s S₂ = cylinder s (S₁ ∪ S₂) := by |
classical rw [union_cylinder]; rfl
| 0.9375 |
import Mathlib.RepresentationTheory.Action.Limits
import Mathlib.RepresentationTheory.Action.Concrete
import Mathlib.CategoryTheory.Monoidal.FunctorCategory
import Mathlib.CategoryTheory.Monoidal.Transport
import Mathlib.CategoryTheory.Monoidal.Rigid.OfEquivalence
import Mathlib.CategoryTheory.Monoidal.Rigid.FunctorCategory
import Mathlib.CategoryTheory.Monoidal.Linear
import Mathlib.CategoryTheory.Monoidal.Braided.Basic
import Mathlib.CategoryTheory.Monoidal.Types.Basic
universe u v
open CategoryTheory Limits
variable {V : Type (u + 1)} [LargeCategory V] {G : MonCat.{u}}
namespace Action
section Monoidal
open MonoidalCategory
variable [MonoidalCategory V]
instance instMonoidalCategory : MonoidalCategory (Action V G) :=
Monoidal.transport (Action.functorCategoryEquivalence _ _).symm
@[simp]
theorem tensorUnit_v : (𝟙_ (Action V G)).V = 𝟙_ V :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_unit_V Action.tensorUnit_v
-- Porting note: removed @[simp] as the simpNF linter complains
theorem tensorUnit_rho {g : G} : (𝟙_ (Action V G)).ρ g = 𝟙 (𝟙_ V) :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_unit_rho Action.tensorUnit_rho
@[simp]
theorem tensor_v {X Y : Action V G} : (X ⊗ Y).V = X.V ⊗ Y.V :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_V Action.tensor_v
-- Porting note: removed @[simp] as the simpNF linter complains
theorem tensor_rho {X Y : Action V G} {g : G} : (X ⊗ Y).ρ g = X.ρ g ⊗ Y.ρ g :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_rho Action.tensor_rho
@[simp]
theorem tensor_hom {W X Y Z : Action V G} (f : W ⟶ X) (g : Y ⟶ Z) : (f ⊗ g).hom = f.hom ⊗ g.hom :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_hom Action.tensor_hom
@[simp]
theorem whiskerLeft_hom (X : Action V G) {Y Z : Action V G} (f : Y ⟶ Z) :
(X ◁ f).hom = X.V ◁ f.hom :=
rfl
@[simp]
theorem whiskerRight_hom {X Y : Action V G} (f : X ⟶ Y) (Z : Action V G) :
(f ▷ Z).hom = f.hom ▷ Z.V :=
rfl
-- Porting note: removed @[simp] as the simpNF linter complains
theorem associator_hom_hom {X Y Z : Action V G} :
Hom.hom (α_ X Y Z).hom = (α_ X.V Y.V Z.V).hom := by
dsimp
simp
set_option linter.uppercaseLean3 false in
#align Action.associator_hom_hom Action.associator_hom_hom
-- Porting note: removed @[simp] as the simpNF linter complains
| Mathlib/RepresentationTheory/Action/Monoidal.lean | 90 | 93 | theorem associator_inv_hom {X Y Z : Action V G} :
Hom.hom (α_ X Y Z).inv = (α_ X.V Y.V Z.V).inv := by |
dsimp
simp
| 0.9375 |
import Mathlib.Algebra.Polynomial.Degree.Definitions
import Mathlib.Algebra.Polynomial.Induction
#align_import data.polynomial.eval from "leanprover-community/mathlib"@"728baa2f54e6062c5879a3e397ac6bac323e506f"
set_option linter.uppercaseLean3 false
noncomputable section
open Finset AddMonoidAlgebra
open Polynomial
namespace Polynomial
universe u v w y
variable {R : Type u} {S : Type v} {T : Type w} {ι : Type y} {a b : R} {m n : ℕ}
section Semiring
variable [Semiring R] {p q r : R[X]}
section
variable [Semiring S]
variable (f : R →+* S) (x : S)
irreducible_def eval₂ (p : R[X]) : S :=
p.sum fun e a => f a * x ^ e
#align polynomial.eval₂ Polynomial.eval₂
| Mathlib/Algebra/Polynomial/Eval.lean | 48 | 49 | theorem eval₂_eq_sum {f : R →+* S} {x : S} : p.eval₂ f x = p.sum fun e a => f a * x ^ e := by |
rw [eval₂_def]
| 0.9375 |
import Mathlib.Data.List.Basic
#align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
-- Make sure we don't import algebra
assert_not_exists Monoid
variable {α β : Type*}
namespace List
attribute [simp] join
-- Porting note (#10618): simp can prove this
-- @[simp]
theorem join_singleton (l : List α) : [l].join = l := by rw [join, join, append_nil]
#align list.join_singleton List.join_singleton
@[simp]
theorem join_eq_nil : ∀ {L : List (List α)}, join L = [] ↔ ∀ l ∈ L, l = []
| [] => iff_of_true rfl (forall_mem_nil _)
| l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons]
#align list.join_eq_nil List.join_eq_nil
@[simp]
theorem join_append (L₁ L₂ : List (List α)) : join (L₁ ++ L₂) = join L₁ ++ join L₂ := by
induction L₁
· rfl
· simp [*]
#align list.join_append List.join_append
| Mathlib/Data/List/Join.lean | 44 | 44 | theorem join_concat (L : List (List α)) (l : List α) : join (L.concat l) = join L ++ l := by | simp
| 0.9375 |
import Mathlib.Analysis.SpecialFunctions.Complex.Arg
import Mathlib.Analysis.SpecialFunctions.Log.Basic
#align_import analysis.special_functions.complex.log from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
namespace Complex
open Set Filter Bornology
open scoped Real Topology ComplexConjugate
-- Porting note: @[pp_nodot] does not exist in mathlib4
noncomputable def log (x : ℂ) : ℂ :=
x.abs.log + arg x * I
#align complex.log Complex.log
theorem log_re (x : ℂ) : x.log.re = x.abs.log := by simp [log]
#align complex.log_re Complex.log_re
theorem log_im (x : ℂ) : x.log.im = x.arg := by simp [log]
#align complex.log_im Complex.log_im
theorem neg_pi_lt_log_im (x : ℂ) : -π < (log x).im := by simp only [log_im, neg_pi_lt_arg]
#align complex.neg_pi_lt_log_im Complex.neg_pi_lt_log_im
theorem log_im_le_pi (x : ℂ) : (log x).im ≤ π := by simp only [log_im, arg_le_pi]
#align complex.log_im_le_pi Complex.log_im_le_pi
theorem exp_log {x : ℂ} (hx : x ≠ 0) : exp (log x) = x := by
rw [log, exp_add_mul_I, ← ofReal_sin, sin_arg, ← ofReal_cos, cos_arg hx, ← ofReal_exp,
Real.exp_log (abs.pos hx), mul_add, ofReal_div, ofReal_div,
mul_div_cancel₀ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), ← mul_assoc,
mul_div_cancel₀ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), re_add_im]
#align complex.exp_log Complex.exp_log
@[simp]
theorem range_exp : Set.range exp = {0}ᶜ :=
Set.ext fun x =>
⟨by
rintro ⟨x, rfl⟩
exact exp_ne_zero x, fun hx => ⟨log x, exp_log hx⟩⟩
#align complex.range_exp Complex.range_exp
theorem log_exp {x : ℂ} (hx₁ : -π < x.im) (hx₂ : x.im ≤ π) : log (exp x) = x := by
rw [log, abs_exp, Real.log_exp, exp_eq_exp_re_mul_sin_add_cos, ← ofReal_exp,
arg_mul_cos_add_sin_mul_I (Real.exp_pos _) ⟨hx₁, hx₂⟩, re_add_im]
#align complex.log_exp Complex.log_exp
theorem exp_inj_of_neg_pi_lt_of_le_pi {x y : ℂ} (hx₁ : -π < x.im) (hx₂ : x.im ≤ π) (hy₁ : -π < y.im)
(hy₂ : y.im ≤ π) (hxy : exp x = exp y) : x = y := by
rw [← log_exp hx₁ hx₂, ← log_exp hy₁ hy₂, hxy]
#align complex.exp_inj_of_neg_pi_lt_of_le_pi Complex.exp_inj_of_neg_pi_lt_of_le_pi
theorem ofReal_log {x : ℝ} (hx : 0 ≤ x) : (x.log : ℂ) = log x :=
Complex.ext (by rw [log_re, ofReal_re, abs_of_nonneg hx])
(by rw [ofReal_im, log_im, arg_ofReal_of_nonneg hx])
#align complex.of_real_log Complex.ofReal_log
@[simp, norm_cast]
lemma natCast_log {n : ℕ} : Real.log n = log n := ofReal_natCast n ▸ ofReal_log n.cast_nonneg
@[simp]
lemma ofNat_log {n : ℕ} [n.AtLeastTwo] :
Real.log (no_index (OfNat.ofNat n)) = log (OfNat.ofNat n) :=
natCast_log
theorem log_ofReal_re (x : ℝ) : (log (x : ℂ)).re = Real.log x := by simp [log_re]
#align complex.log_of_real_re Complex.log_ofReal_re
theorem log_ofReal_mul {r : ℝ} (hr : 0 < r) {x : ℂ} (hx : x ≠ 0) :
log (r * x) = Real.log r + log x := by
replace hx := Complex.abs.ne_zero_iff.mpr hx
simp_rw [log, map_mul, abs_ofReal, arg_real_mul _ hr, abs_of_pos hr, Real.log_mul hr.ne' hx,
ofReal_add, add_assoc]
#align complex.log_of_real_mul Complex.log_ofReal_mul
| Mathlib/Analysis/SpecialFunctions/Complex/Log.lean | 93 | 94 | theorem log_mul_ofReal (r : ℝ) (hr : 0 < r) (x : ℂ) (hx : x ≠ 0) :
log (x * r) = Real.log r + log x := by | rw [mul_comm, log_ofReal_mul hr hx]
| 0.9375 |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Mul
import Mathlib.Analysis.Calculus.FDeriv.Add
#align_import analysis.calculus.deriv.mul from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
noncomputable section
open scoped Classical Topology Filter ENNReal
open Filter Asymptotics Set
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)
variable {𝕜 : Type u} [NontriviallyNormedField 𝕜]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G]
variable {f f₀ f₁ g : 𝕜 → F}
variable {f' f₀' f₁' g' : F}
variable {x : 𝕜}
variable {s t : Set 𝕜}
variable {L L₁ L₂ : Filter 𝕜}
section Prod
section HasDeriv
variable {ι : Type*} [DecidableEq ι] {𝔸' : Type*} [NormedCommRing 𝔸'] [NormedAlgebra 𝕜 𝔸']
{u : Finset ι} {f : ι → 𝕜 → 𝔸'} {f' : ι → 𝔸'}
theorem HasDerivAt.finset_prod (hf : ∀ i ∈ u, HasDerivAt (f i) (f' i) x) :
HasDerivAt (∏ i ∈ u, f i ·) (∑ i ∈ u, (∏ j ∈ u.erase i, f j x) • f' i) x := by
simpa [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] using
(HasFDerivAt.finset_prod (fun i hi ↦ (hf i hi).hasFDerivAt)).hasDerivAt
theorem HasDerivWithinAt.finset_prod (hf : ∀ i ∈ u, HasDerivWithinAt (f i) (f' i) s x) :
HasDerivWithinAt (∏ i ∈ u, f i ·) (∑ i ∈ u, (∏ j ∈ u.erase i, f j x) • f' i) s x := by
simpa [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] using
(HasFDerivWithinAt.finset_prod (fun i hi ↦ (hf i hi).hasFDerivWithinAt)).hasDerivWithinAt
| Mathlib/Analysis/Calculus/Deriv/Mul.lean | 346 | 349 | theorem HasStrictDerivAt.finset_prod (hf : ∀ i ∈ u, HasStrictDerivAt (f i) (f' i) x) :
HasStrictDerivAt (∏ i ∈ u, f i ·) (∑ i ∈ u, (∏ j ∈ u.erase i, f j x) • f' i) x := by |
simpa [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] using
(HasStrictFDerivAt.finset_prod (fun i hi ↦ (hf i hi).hasStrictFDerivAt)).hasStrictDerivAt
| 0.9375 |
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 - n : ℤ) ≤ ↑(m - n : ℕ) := by
by_cases h : m ≥ n
· exact le_of_eq (Int.ofNat_sub h).symm
· simp [le_of_not_ge h, ofNat_le]
#align int.le_coe_nat_sub Int.le_natCast_sub
-- Porting note (#10618): simp can prove this @[simp]
theorem succ_natCast_pos (n : ℕ) : 0 < (n : ℤ) + 1 :=
lt_add_one_iff.mpr (by simp)
#align int.succ_coe_nat_pos Int.succ_natCast_pos
variable {a b : ℤ} {n : ℕ}
theorem natAbs_eq_iff_sq_eq {a b : ℤ} : a.natAbs = b.natAbs ↔ a ^ 2 = b ^ 2 := by
rw [sq, sq]
exact natAbs_eq_iff_mul_self_eq
#align int.nat_abs_eq_iff_sq_eq Int.natAbs_eq_iff_sq_eq
theorem natAbs_lt_iff_sq_lt {a b : ℤ} : a.natAbs < b.natAbs ↔ a ^ 2 < b ^ 2 := by
rw [sq, sq]
exact natAbs_lt_iff_mul_self_lt
#align int.nat_abs_lt_iff_sq_lt Int.natAbs_lt_iff_sq_lt
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
#align int.nat_abs_le_iff_sq_le Int.natAbs_le_iff_sq_le
theorem natAbs_inj_of_nonneg_of_nonneg {a b : ℤ} (ha : 0 ≤ a) (hb : 0 ≤ b) :
natAbs a = natAbs b ↔ a = b := by rw [← sq_eq_sq ha hb, ← natAbs_eq_iff_sq_eq]
#align int.nat_abs_inj_of_nonneg_of_nonneg Int.natAbs_inj_of_nonneg_of_nonneg
theorem natAbs_inj_of_nonpos_of_nonpos {a b : ℤ} (ha : a ≤ 0) (hb : b ≤ 0) :
natAbs a = natAbs b ↔ a = b := by
simpa only [Int.natAbs_neg, neg_inj] using
natAbs_inj_of_nonneg_of_nonneg (neg_nonneg_of_nonpos ha) (neg_nonneg_of_nonpos hb)
#align int.nat_abs_inj_of_nonpos_of_nonpos Int.natAbs_inj_of_nonpos_of_nonpos
theorem natAbs_inj_of_nonneg_of_nonpos {a b : ℤ} (ha : 0 ≤ a) (hb : b ≤ 0) :
natAbs a = natAbs b ↔ a = -b := by
simpa only [Int.natAbs_neg] using natAbs_inj_of_nonneg_of_nonneg ha (neg_nonneg_of_nonpos hb)
#align int.nat_abs_inj_of_nonneg_of_nonpos Int.natAbs_inj_of_nonneg_of_nonpos
| Mathlib/Data/Int/Lemmas.lean | 75 | 77 | theorem natAbs_inj_of_nonpos_of_nonneg {a b : ℤ} (ha : a ≤ 0) (hb : 0 ≤ b) :
natAbs a = natAbs b ↔ -a = b := by |
simpa only [Int.natAbs_neg] using natAbs_inj_of_nonneg_of_nonneg (neg_nonneg_of_nonpos ha) hb
| 0.9375 |
import Mathlib.Data.Set.Prod
import Mathlib.Logic.Function.Conjugate
#align_import data.set.function from "leanprover-community/mathlib"@"996b0ff959da753a555053a480f36e5f264d4207"
variable {α β γ : Type*} {ι : Sort*} {π : α → Type*}
open Equiv Equiv.Perm Function
namespace Set
section Order
variable {s : Set α} {f₁ f₂ : α → β} [Preorder α] [Preorder β]
| Mathlib/Data/Set/Function.lean | 264 | 267 | theorem _root_.MonotoneOn.congr (h₁ : MonotoneOn f₁ s) (h : s.EqOn f₁ f₂) : MonotoneOn f₂ s := by |
intro a ha b hb hab
rw [← h ha, ← h hb]
exact h₁ ha hb hab
| 0.9375 |
import Mathlib.LinearAlgebra.Dimension.Constructions
import Mathlib.LinearAlgebra.Dimension.Finite
universe u v
open Function Set Cardinal
variable {R} {M M₁ M₂ M₃ : Type u} {M' : Type v} [Ring R]
variable [AddCommGroup M] [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃] [AddCommGroup M']
variable [Module R M] [Module R M₁] [Module R M₂] [Module R M₃] [Module R M']
@[pp_with_univ]
class HasRankNullity (R : Type v) [inst : Ring R] : Prop where
exists_set_linearIndependent : ∀ (M : Type u) [AddCommGroup M] [Module R M],
∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val
rank_quotient_add_rank : ∀ {M : Type u} [AddCommGroup M] [Module R M] (N : Submodule R M),
Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M
variable [HasRankNullity.{u} R]
lemma rank_quotient_add_rank (N : Submodule R M) :
Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M :=
HasRankNullity.rank_quotient_add_rank N
#align rank_quotient_add_rank rank_quotient_add_rank
variable (R M) in
lemma exists_set_linearIndependent :
∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val :=
HasRankNullity.exists_set_linearIndependent M
variable (R) in
instance (priority := 100) : Nontrivial R := by
refine (subsingleton_or_nontrivial R).resolve_left fun H ↦ ?_
have := rank_quotient_add_rank (R := R) (M := PUnit) ⊥
simp [one_add_one_eq_two] at this
theorem lift_rank_range_add_rank_ker (f : M →ₗ[R] M') :
lift.{u} (Module.rank R (LinearMap.range f)) + lift.{v} (Module.rank R (LinearMap.ker f)) =
lift.{v} (Module.rank R M) := by
haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p)
rw [← f.quotKerEquivRange.lift_rank_eq, ← lift_add, rank_quotient_add_rank]
theorem rank_range_add_rank_ker (f : M →ₗ[R] M₁) :
Module.rank R (LinearMap.range f) + Module.rank R (LinearMap.ker f) = Module.rank R M := by
haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p)
rw [← f.quotKerEquivRange.rank_eq, rank_quotient_add_rank]
#align rank_range_add_rank_ker rank_range_add_rank_ker
theorem lift_rank_eq_of_surjective {f : M →ₗ[R] M'} (h : Surjective f) :
lift.{v} (Module.rank R M) =
lift.{u} (Module.rank R M') + lift.{v} (Module.rank R (LinearMap.ker f)) := by
rw [← lift_rank_range_add_rank_ker f, ← rank_range_of_surjective f h]
| Mathlib/LinearAlgebra/Dimension/RankNullity.lean | 86 | 88 | theorem rank_eq_of_surjective {f : M →ₗ[R] M₁} (h : Surjective f) :
Module.rank R M = Module.rank R M₁ + Module.rank R (LinearMap.ker f) := by |
rw [← rank_range_add_rank_ker f, ← rank_range_of_surjective f h]
| 0.9375 |
import Mathlib.Algebra.Group.Units.Equiv
import Mathlib.CategoryTheory.Endomorphism
#align_import category_theory.conj from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514"
universe v u
namespace CategoryTheory
namespace Iso
variable {C : Type u} [Category.{v} C]
def homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) : (X ⟶ Y) ≃ (X₁ ⟶ Y₁) where
toFun f := α.inv ≫ f ≫ β.hom
invFun f := α.hom ≫ f ≫ β.inv
left_inv f :=
show α.hom ≫ (α.inv ≫ f ≫ β.hom) ≫ β.inv = f by
rw [Category.assoc, Category.assoc, β.hom_inv_id, α.hom_inv_id_assoc, Category.comp_id]
right_inv f :=
show α.inv ≫ (α.hom ≫ f ≫ β.inv) ≫ β.hom = f by
rw [Category.assoc, Category.assoc, β.inv_hom_id, α.inv_hom_id_assoc, Category.comp_id]
#align category_theory.iso.hom_congr CategoryTheory.Iso.homCongr
-- @[simp, nolint simpNF] Porting note (#10675): dsimp can not prove this
@[simp]
theorem homCongr_apply {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (f : X ⟶ Y) :
α.homCongr β f = α.inv ≫ f ≫ β.hom := by
rfl
#align category_theory.iso.hom_congr_apply CategoryTheory.Iso.homCongr_apply
theorem homCongr_comp {X Y Z X₁ Y₁ Z₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (γ : Z ≅ Z₁) (f : X ⟶ Y)
(g : Y ⟶ Z) : α.homCongr γ (f ≫ g) = α.homCongr β f ≫ β.homCongr γ g := by simp
#align category_theory.iso.hom_congr_comp CategoryTheory.Iso.homCongr_comp
| Mathlib/CategoryTheory/Conj.lean | 60 | 60 | theorem homCongr_refl {X Y : C} (f : X ⟶ Y) : (Iso.refl X).homCongr (Iso.refl Y) f = f := by | simp
| 0.9375 |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.ContDiff.Defs
#align_import analysis.calculus.iterated_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
noncomputable section
open scoped Classical Topology
open Filter Asymptotics Set
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
def iteratedDeriv (n : ℕ) (f : 𝕜 → F) (x : 𝕜) : F :=
(iteratedFDeriv 𝕜 n f x : (Fin n → 𝕜) → F) fun _ : Fin n => 1
#align iterated_deriv iteratedDeriv
def iteratedDerivWithin (n : ℕ) (f : 𝕜 → F) (s : Set 𝕜) (x : 𝕜) : F :=
(iteratedFDerivWithin 𝕜 n f s x : (Fin n → 𝕜) → F) fun _ : Fin n => 1
#align iterated_deriv_within iteratedDerivWithin
variable {n : ℕ} {f : 𝕜 → F} {s : Set 𝕜} {x : 𝕜}
theorem iteratedDerivWithin_univ : iteratedDerivWithin n f univ = iteratedDeriv n f := by
ext x
rw [iteratedDerivWithin, iteratedDeriv, iteratedFDerivWithin_univ]
#align iterated_deriv_within_univ iteratedDerivWithin_univ
theorem iteratedDerivWithin_eq_iteratedFDerivWithin : iteratedDerivWithin n f s x =
(iteratedFDerivWithin 𝕜 n f s x : (Fin n → 𝕜) → F) fun _ : Fin n => 1 :=
rfl
#align iterated_deriv_within_eq_iterated_fderiv_within iteratedDerivWithin_eq_iteratedFDerivWithin
| Mathlib/Analysis/Calculus/IteratedDeriv/Defs.lean | 84 | 86 | theorem iteratedDerivWithin_eq_equiv_comp : iteratedDerivWithin n f s =
(ContinuousMultilinearMap.piFieldEquiv 𝕜 (Fin n) F).symm ∘ iteratedFDerivWithin 𝕜 n f s := by |
ext x; rfl
| 0.9375 |
import Mathlib.Algebra.Group.Units
import Mathlib.Algebra.GroupWithZero.Basic
import Mathlib.Logic.Equiv.Defs
import Mathlib.Tactic.Contrapose
import Mathlib.Tactic.Nontriviality
import Mathlib.Tactic.Spread
import Mathlib.Util.AssertExists
#align_import algebra.group_with_zero.units.basic from "leanprover-community/mathlib"@"df5e9937a06fdd349fc60106f54b84d47b1434f0"
-- Guard against import creep
assert_not_exists Multiplicative
assert_not_exists DenselyOrdered
variable {α M₀ G₀ M₀' G₀' F F' : Type*}
variable [MonoidWithZero M₀]
@[simp]
theorem isUnit_zero_iff : IsUnit (0 : M₀) ↔ (0 : M₀) = 1 :=
⟨fun ⟨⟨_, a, (a0 : 0 * a = 1), _⟩, rfl⟩ => by rwa [zero_mul] at a0, fun h =>
@isUnit_of_subsingleton _ _ (subsingleton_of_zero_eq_one h) 0⟩
#align is_unit_zero_iff isUnit_zero_iff
-- Porting note: removed `simp` tag because `simpNF` says it's redundant
theorem not_isUnit_zero [Nontrivial M₀] : ¬IsUnit (0 : M₀) :=
mt isUnit_zero_iff.1 zero_ne_one
#align not_is_unit_zero not_isUnit_zero
namespace Ring
open scoped Classical
noncomputable def inverse : M₀ → M₀ := fun x => if h : IsUnit x then ((h.unit⁻¹ : M₀ˣ) : M₀) else 0
#align ring.inverse Ring.inverse
@[simp]
theorem inverse_unit (u : M₀ˣ) : inverse (u : M₀) = (u⁻¹ : M₀ˣ) := by
rw [inverse, dif_pos u.isUnit, IsUnit.unit_of_val_units]
#align ring.inverse_unit Ring.inverse_unit
@[simp]
theorem inverse_non_unit (x : M₀) (h : ¬IsUnit x) : inverse x = 0 :=
dif_neg h
#align ring.inverse_non_unit Ring.inverse_non_unit
theorem mul_inverse_cancel (x : M₀) (h : IsUnit x) : x * inverse x = 1 := by
rcases h with ⟨u, rfl⟩
rw [inverse_unit, Units.mul_inv]
#align ring.mul_inverse_cancel Ring.mul_inverse_cancel
theorem inverse_mul_cancel (x : M₀) (h : IsUnit x) : inverse x * x = 1 := by
rcases h with ⟨u, rfl⟩
rw [inverse_unit, Units.inv_mul]
#align ring.inverse_mul_cancel Ring.inverse_mul_cancel
| Mathlib/Algebra/GroupWithZero/Units/Basic.lean | 118 | 119 | theorem mul_inverse_cancel_right (x y : M₀) (h : IsUnit x) : y * x * inverse x = y := by |
rw [mul_assoc, mul_inverse_cancel x h, mul_one]
| 0.9375 |
import Mathlib.Algebra.Polynomial.Eval
import Mathlib.RingTheory.Ideal.Quotient
#align_import linear_algebra.smodeq from "leanprover-community/mathlib"@"146d3d1fa59c091fedaad8a4afa09d6802886d24"
open Submodule
open Polynomial
variable {R : Type*} [Ring R]
variable {A : Type*} [CommRing A]
variable {M : Type*} [AddCommGroup M] [Module R M] (U U₁ U₂ : Submodule R M)
variable {x x₁ x₂ y y₁ y₂ z z₁ z₂ : M}
variable {N : Type*} [AddCommGroup N] [Module R N] (V V₁ V₂ : Submodule R N)
set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534
def SModEq (x y : M) : Prop :=
(Submodule.Quotient.mk x : M ⧸ U) = Submodule.Quotient.mk y
#align smodeq SModEq
notation:50 x " ≡ " y " [SMOD " N "]" => SModEq N x y
variable {U U₁ U₂}
set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534
protected theorem SModEq.def :
x ≡ y [SMOD U] ↔ (Submodule.Quotient.mk x : M ⧸ U) = Submodule.Quotient.mk y :=
Iff.rfl
#align smodeq.def SModEq.def
namespace SModEq
theorem sub_mem : x ≡ y [SMOD U] ↔ x - y ∈ U := by rw [SModEq.def, Submodule.Quotient.eq]
#align smodeq.sub_mem SModEq.sub_mem
@[simp]
theorem top : x ≡ y [SMOD (⊤ : Submodule R M)] :=
(Submodule.Quotient.eq ⊤).2 mem_top
#align smodeq.top SModEq.top
@[simp]
| Mathlib/LinearAlgebra/SModEq.lean | 53 | 54 | theorem bot : x ≡ y [SMOD (⊥ : Submodule R M)] ↔ x = y := by |
rw [SModEq.def, Submodule.Quotient.eq, mem_bot, sub_eq_zero]
| 0.9375 |
import Mathlib.Order.Interval.Finset.Nat
#align_import data.fin.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
assert_not_exists MonoidWithZero
open Finset Fin Function
namespace Fin
variable (n : ℕ)
instance instLocallyFiniteOrder : LocallyFiniteOrder (Fin n) :=
OrderIso.locallyFiniteOrder Fin.orderIsoSubtype
instance instLocallyFiniteOrderBot : LocallyFiniteOrderBot (Fin n) :=
OrderIso.locallyFiniteOrderBot Fin.orderIsoSubtype
instance instLocallyFiniteOrderTop : ∀ n, LocallyFiniteOrderTop (Fin n)
| 0 => IsEmpty.toLocallyFiniteOrderTop
| _ + 1 => inferInstance
variable {n} (a b : Fin n)
theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : ℕ) b).fin n :=
rfl
#align fin.Icc_eq_finset_subtype Fin.Icc_eq_finset_subtype
theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : ℕ) b).fin n :=
rfl
#align fin.Ico_eq_finset_subtype Fin.Ico_eq_finset_subtype
theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : ℕ) b).fin n :=
rfl
#align fin.Ioc_eq_finset_subtype Fin.Ioc_eq_finset_subtype
theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : ℕ) b).fin n :=
rfl
#align fin.Ioo_eq_finset_subtype Fin.Ioo_eq_finset_subtype
theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : ℕ) b).fin n := rfl
#align fin.uIcc_eq_finset_subtype Fin.uIcc_eq_finset_subtype
@[simp]
theorem map_valEmbedding_Icc : (Icc a b).map Fin.valEmbedding = Icc ↑a ↑b := by
simp [Icc_eq_finset_subtype, Finset.fin, Finset.map_map, Icc_filter_lt_of_lt_right]
#align fin.map_subtype_embedding_Icc Fin.map_valEmbedding_Icc
@[simp]
theorem map_valEmbedding_Ico : (Ico a b).map Fin.valEmbedding = Ico ↑a ↑b := by
simp [Ico_eq_finset_subtype, Finset.fin, Finset.map_map]
#align fin.map_subtype_embedding_Ico Fin.map_valEmbedding_Ico
@[simp]
theorem map_valEmbedding_Ioc : (Ioc a b).map Fin.valEmbedding = Ioc ↑a ↑b := by
simp [Ioc_eq_finset_subtype, Finset.fin, Finset.map_map, Ioc_filter_lt_of_lt_right]
#align fin.map_subtype_embedding_Ioc Fin.map_valEmbedding_Ioc
@[simp]
theorem map_valEmbedding_Ioo : (Ioo a b).map Fin.valEmbedding = Ioo ↑a ↑b := by
simp [Ioo_eq_finset_subtype, Finset.fin, Finset.map_map]
#align fin.map_subtype_embedding_Ioo Fin.map_valEmbedding_Ioo
@[simp]
theorem map_subtype_embedding_uIcc : (uIcc a b).map valEmbedding = uIcc ↑a ↑b :=
map_valEmbedding_Icc _ _
#align fin.map_subtype_embedding_uIcc Fin.map_subtype_embedding_uIcc
@[simp]
theorem card_Icc : (Icc a b).card = b + 1 - a := by
rw [← Nat.card_Icc, ← map_valEmbedding_Icc, card_map]
#align fin.card_Icc Fin.card_Icc
@[simp]
theorem card_Ico : (Ico a b).card = b - a := by
rw [← Nat.card_Ico, ← map_valEmbedding_Ico, card_map]
#align fin.card_Ico Fin.card_Ico
@[simp]
theorem card_Ioc : (Ioc a b).card = b - a := by
rw [← Nat.card_Ioc, ← map_valEmbedding_Ioc, card_map]
#align fin.card_Ioc Fin.card_Ioc
@[simp]
theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
rw [← Nat.card_Ioo, ← map_valEmbedding_Ioo, card_map]
#align fin.card_Ioo Fin.card_Ioo
@[simp]
theorem card_uIcc : (uIcc a b).card = (b - a : ℤ).natAbs + 1 := by
rw [← Nat.card_uIcc, ← map_subtype_embedding_uIcc, card_map]
#align fin.card_uIcc Fin.card_uIcc
-- Porting note (#10618): simp can prove this
-- @[simp]
theorem card_fintypeIcc : Fintype.card (Set.Icc a b) = b + 1 - a := by
rw [← card_Icc, Fintype.card_ofFinset]
#align fin.card_fintype_Icc Fin.card_fintypeIcc
-- Porting note (#10618): simp can prove this
-- @[simp]
| Mathlib/Order/Interval/Finset/Fin.lean | 136 | 137 | theorem card_fintypeIco : Fintype.card (Set.Ico a b) = b - a := by |
rw [← card_Ico, Fintype.card_ofFinset]
| 0.9375 |
import Mathlib.Data.List.Chain
import Mathlib.Data.List.Enum
import Mathlib.Data.List.Nodup
import Mathlib.Data.List.Pairwise
import Mathlib.Data.List.Zip
#align_import data.list.range from "leanprover-community/mathlib"@"7b78d1776212a91ecc94cf601f83bdcc46b04213"
set_option autoImplicit true
universe u
open Nat
namespace List
variable {α : Type u}
@[simp] theorem range'_one {step} : range' s 1 step = [s] := rfl
#align list.length_range' List.length_range'
#align list.range'_eq_nil List.range'_eq_nil
#align list.mem_range' List.mem_range'_1
#align list.map_add_range' List.map_add_range'
#align list.map_sub_range' List.map_sub_range'
#align list.chain_succ_range' List.chain_succ_range'
#align list.chain_lt_range' List.chain_lt_range'
theorem pairwise_lt_range' : ∀ s n (step := 1) (_ : 0 < step := by simp),
Pairwise (· < ·) (range' s n step)
| _, 0, _, _ => Pairwise.nil
| s, n + 1, _, h => chain_iff_pairwise.1 (chain_lt_range' s n h)
#align list.pairwise_lt_range' List.pairwise_lt_range'
theorem nodup_range' (s n : ℕ) (step := 1) (h : 0 < step := by simp) : Nodup (range' s n step) :=
(pairwise_lt_range' s n step h).imp _root_.ne_of_lt
#align list.nodup_range' List.nodup_range'
#align list.range'_append List.range'_append
#align list.range'_sublist_right List.range'_sublist_right
#align list.range'_subset_right List.range'_subset_right
#align list.nth_range' List.get?_range'
set_option linter.deprecated false in
@[simp]
theorem nthLe_range' {n m step} (i) (H : i < (range' n m step).length) :
nthLe (range' n m step) i H = n + step * i := get_range' i H
set_option linter.deprecated false in
| Mathlib/Data/List/Range.lean | 66 | 67 | theorem nthLe_range'_1 {n m} (i) (H : i < (range' n m).length) :
nthLe (range' n m) i H = n + i := by | simp
| 0.9375 |
import Mathlib.SetTheory.Ordinal.Arithmetic
import Mathlib.SetTheory.Ordinal.Exponential
#align_import set_theory.ordinal.cantor_normal_form from "leanprover-community/mathlib"@"991ff3b5269848f6dd942ae8e9dd3c946035dc8b"
noncomputable section
universe u
open List
namespace Ordinal
@[elab_as_elim]
noncomputable def CNFRec (b : Ordinal) {C : Ordinal → Sort*} (H0 : C 0)
(H : ∀ o, o ≠ 0 → C (o % b ^ log b o) → C o) : ∀ o, C o := fun o ↦ by
by_cases h : o = 0
· rw [h]; exact H0
· exact H o h (CNFRec _ H0 H (o % b ^ log b o))
termination_by o => o
decreasing_by exact mod_opow_log_lt_self b h
set_option linter.uppercaseLean3 false in
#align ordinal.CNF_rec Ordinal.CNFRec
@[simp]
theorem CNFRec_zero {C : Ordinal → Sort*} (b : Ordinal) (H0 : C 0)
(H : ∀ o, o ≠ 0 → C (o % b ^ log b o) → C o) : @CNFRec b C H0 H 0 = H0 := by
rw [CNFRec, dif_pos rfl]
rfl
set_option linter.uppercaseLean3 false in
#align ordinal.CNF_rec_zero Ordinal.CNFRec_zero
theorem CNFRec_pos (b : Ordinal) {o : Ordinal} {C : Ordinal → Sort*} (ho : o ≠ 0) (H0 : C 0)
(H : ∀ o, o ≠ 0 → C (o % b ^ log b o) → C o) :
@CNFRec b C H0 H o = H o ho (@CNFRec b C H0 H _) := by rw [CNFRec, dif_neg ho]
set_option linter.uppercaseLean3 false in
#align ordinal.CNF_rec_pos Ordinal.CNFRec_pos
-- Porting note: unknown attribute @[pp_nodot]
def CNF (b o : Ordinal) : List (Ordinal × Ordinal) :=
CNFRec b [] (fun o _ho IH ↦ (log b o, o / b ^ log b o)::IH) o
set_option linter.uppercaseLean3 false in
#align ordinal.CNF Ordinal.CNF
@[simp]
theorem CNF_zero (b : Ordinal) : CNF b 0 = [] :=
CNFRec_zero b _ _
set_option linter.uppercaseLean3 false in
#align ordinal.CNF_zero Ordinal.CNF_zero
theorem CNF_ne_zero {b o : Ordinal} (ho : o ≠ 0) :
CNF b o = (log b o, o / b ^ log b o)::CNF b (o % b ^ log b o) :=
CNFRec_pos b ho _ _
set_option linter.uppercaseLean3 false in
#align ordinal.CNF_ne_zero Ordinal.CNF_ne_zero
| Mathlib/SetTheory/Ordinal/CantorNormalForm.lean | 93 | 93 | theorem zero_CNF {o : Ordinal} (ho : o ≠ 0) : CNF 0 o = [⟨0, o⟩] := by | simp [CNF_ne_zero ho]
| 0.9375 |
import Mathlib.Data.Finset.Prod
import Mathlib.Data.Set.Finite
#align_import data.finset.n_ary from "leanprover-community/mathlib"@"eba7871095e834365616b5e43c8c7bb0b37058d0"
open Function Set
variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type*}
namespace Finset
variable [DecidableEq α'] [DecidableEq β'] [DecidableEq γ] [DecidableEq γ'] [DecidableEq δ]
[DecidableEq δ'] [DecidableEq ε] [DecidableEq ε'] {f f' : α → β → γ} {g g' : α → β → γ → δ}
{s s' : Finset α} {t t' : Finset β} {u u' : Finset γ} {a a' : α} {b b' : β} {c : γ}
def image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) : Finset γ :=
(s ×ˢ t).image <| uncurry f
#align finset.image₂ Finset.image₂
@[simp]
theorem mem_image₂ : c ∈ image₂ f s t ↔ ∃ a ∈ s, ∃ b ∈ t, f a b = c := by
simp [image₂, and_assoc]
#align finset.mem_image₂ Finset.mem_image₂
@[simp, norm_cast]
theorem coe_image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) :
(image₂ f s t : Set γ) = Set.image2 f s t :=
Set.ext fun _ => mem_image₂
#align finset.coe_image₂ Finset.coe_image₂
theorem card_image₂_le (f : α → β → γ) (s : Finset α) (t : Finset β) :
(image₂ f s t).card ≤ s.card * t.card :=
card_image_le.trans_eq <| card_product _ _
#align finset.card_image₂_le Finset.card_image₂_le
| Mathlib/Data/Finset/NAry.lean | 58 | 61 | theorem card_image₂_iff :
(image₂ f s t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × β)).InjOn fun x => f x.1 x.2 := by |
rw [← card_product, ← coe_product]
exact card_image_iff
| 0.9375 |
import Mathlib.Algebra.BigOperators.Group.Multiset
import Mathlib.Data.Multiset.Dedup
#align_import data.multiset.bind from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
assert_not_exists MonoidWithZero
assert_not_exists MulAction
universe v
variable {α : Type*} {β : Type v} {γ δ : Type*}
namespace Multiset
def join : Multiset (Multiset α) → Multiset α :=
sum
#align multiset.join Multiset.join
theorem coe_join :
∀ L : List (List α), join (L.map ((↑) : List α → Multiset α) : Multiset (Multiset α)) = L.join
| [] => rfl
| l :: L => by
exact congr_arg (fun s : Multiset α => ↑l + s) (coe_join L)
#align multiset.coe_join Multiset.coe_join
@[simp]
theorem join_zero : @join α 0 = 0 :=
rfl
#align multiset.join_zero Multiset.join_zero
@[simp]
theorem join_cons (s S) : @join α (s ::ₘ S) = s + join S :=
sum_cons _ _
#align multiset.join_cons Multiset.join_cons
@[simp]
theorem join_add (S T) : @join α (S + T) = join S + join T :=
sum_add _ _
#align multiset.join_add Multiset.join_add
@[simp]
theorem singleton_join (a) : join ({a} : Multiset (Multiset α)) = a :=
sum_singleton _
#align multiset.singleton_join Multiset.singleton_join
@[simp]
theorem mem_join {a S} : a ∈ @join α S ↔ ∃ s ∈ S, a ∈ s :=
Multiset.induction_on S (by simp) <| by
simp (config := { contextual := true }) [or_and_right, exists_or]
#align multiset.mem_join Multiset.mem_join
@[simp]
theorem card_join (S) : card (@join α S) = sum (map card S) :=
Multiset.induction_on S (by simp) (by simp)
#align multiset.card_join Multiset.card_join
@[simp]
theorem map_join (f : α → β) (S : Multiset (Multiset α)) :
map f (join S) = join (map (map f) S) := by
induction S using Multiset.induction with
| empty => simp
| cons _ _ ih => simp [ih]
@[to_additive (attr := simp)]
| Mathlib/Data/Multiset/Bind.lean | 89 | 93 | theorem prod_join [CommMonoid α] {S : Multiset (Multiset α)} :
prod (join S) = prod (map prod S) := by |
induction S using Multiset.induction with
| empty => simp
| cons _ _ ih => simp [ih]
| 0.9375 |
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.Algebra.Polynomial.HasseDeriv
#align_import data.polynomial.taylor from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
namespace Polynomial
open Polynomial
variable {R : Type*} [Semiring R] (r : R) (f : R[X])
def taylor (r : R) : R[X] →ₗ[R] R[X] where
toFun f := f.comp (X + C r)
map_add' f g := add_comp
map_smul' c f := by simp only [smul_eq_C_mul, C_mul_comp, RingHom.id_apply]
#align polynomial.taylor Polynomial.taylor
theorem taylor_apply : taylor r f = f.comp (X + C r) :=
rfl
#align polynomial.taylor_apply Polynomial.taylor_apply
@[simp]
theorem taylor_X : taylor r X = X + C r := by simp only [taylor_apply, X_comp]
set_option linter.uppercaseLean3 false in
#align polynomial.taylor_X Polynomial.taylor_X
@[simp]
theorem taylor_C (x : R) : taylor r (C x) = C x := by simp only [taylor_apply, C_comp]
set_option linter.uppercaseLean3 false in
#align polynomial.taylor_C Polynomial.taylor_C
@[simp]
theorem taylor_zero' : taylor (0 : R) = LinearMap.id := by
ext
simp only [taylor_apply, add_zero, comp_X, _root_.map_zero, LinearMap.id_comp,
Function.comp_apply, LinearMap.coe_comp]
#align polynomial.taylor_zero' Polynomial.taylor_zero'
theorem taylor_zero (f : R[X]) : taylor 0 f = f := by rw [taylor_zero', LinearMap.id_apply]
#align polynomial.taylor_zero Polynomial.taylor_zero
@[simp]
| Mathlib/Algebra/Polynomial/Taylor.lean | 66 | 66 | theorem taylor_one : taylor r (1 : R[X]) = C 1 := by | rw [← C_1, taylor_C]
| 0.9375 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Algebra.GroupPower.IterateHom
import Mathlib.Algebra.Regular.Basic
#align_import algebra.regular.pow from "leanprover-community/mathlib"@"46a64b5b4268c594af770c44d9e502afc6a515cb"
variable {R : Type*} {a b : R}
section Monoid
variable [Monoid R]
theorem IsLeftRegular.pow (n : ℕ) (rla : IsLeftRegular a) : IsLeftRegular (a ^ n) := by
simp only [IsLeftRegular, ← mul_left_iterate, rla.iterate n]
#align is_left_regular.pow IsLeftRegular.pow
| Mathlib/Algebra/Regular/Pow.lean | 36 | 38 | theorem IsRightRegular.pow (n : ℕ) (rra : IsRightRegular a) : IsRightRegular (a ^ n) := by |
rw [IsRightRegular, ← mul_right_iterate]
exact rra.iterate n
| 0.9375 |
import Mathlib.Analysis.InnerProductSpace.Dual
import Mathlib.Analysis.InnerProductSpace.PiL2
#align_import analysis.inner_product_space.adjoint from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open RCLike
open scoped ComplexConjugate
variable {𝕜 E F G : Type*} [RCLike 𝕜]
variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
variable [InnerProductSpace 𝕜 E] [InnerProductSpace 𝕜 F] [InnerProductSpace 𝕜 G]
local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y
open InnerProductSpace
namespace ContinuousLinearMap
variable [CompleteSpace E] [CompleteSpace G]
-- Note: made noncomputable to stop excess compilation
-- leanprover-community/mathlib4#7103
noncomputable def adjointAux : (E →L[𝕜] F) →L⋆[𝕜] F →L[𝕜] E :=
(ContinuousLinearMap.compSL _ _ _ _ _ ((toDual 𝕜 E).symm : NormedSpace.Dual 𝕜 E →L⋆[𝕜] E)).comp
(toSesqForm : (E →L[𝕜] F) →L[𝕜] F →L⋆[𝕜] NormedSpace.Dual 𝕜 E)
#align continuous_linear_map.adjoint_aux ContinuousLinearMap.adjointAux
@[simp]
theorem adjointAux_apply (A : E →L[𝕜] F) (x : F) :
adjointAux A x = ((toDual 𝕜 E).symm : NormedSpace.Dual 𝕜 E → E) ((toSesqForm A) x) :=
rfl
#align continuous_linear_map.adjoint_aux_apply ContinuousLinearMap.adjointAux_apply
theorem adjointAux_inner_left (A : E →L[𝕜] F) (x : E) (y : F) : ⟪adjointAux A y, x⟫ = ⟪y, A x⟫ := by
rw [adjointAux_apply, toDual_symm_apply, toSesqForm_apply_coe, coe_comp', innerSL_apply_coe,
Function.comp_apply]
#align continuous_linear_map.adjoint_aux_inner_left ContinuousLinearMap.adjointAux_inner_left
theorem adjointAux_inner_right (A : E →L[𝕜] F) (x : E) (y : F) :
⟪x, adjointAux A y⟫ = ⟪A x, y⟫ := by
rw [← inner_conj_symm, adjointAux_inner_left, inner_conj_symm]
#align continuous_linear_map.adjoint_aux_inner_right ContinuousLinearMap.adjointAux_inner_right
variable [CompleteSpace F]
theorem adjointAux_adjointAux (A : E →L[𝕜] F) : adjointAux (adjointAux A) = A := by
ext v
refine ext_inner_left 𝕜 fun w => ?_
rw [adjointAux_inner_right, adjointAux_inner_left]
#align continuous_linear_map.adjoint_aux_adjoint_aux ContinuousLinearMap.adjointAux_adjointAux
@[simp]
theorem adjointAux_norm (A : E →L[𝕜] F) : ‖adjointAux A‖ = ‖A‖ := by
refine le_antisymm ?_ ?_
· refine ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) fun x => ?_
rw [adjointAux_apply, LinearIsometryEquiv.norm_map]
exact toSesqForm_apply_norm_le
· nth_rw 1 [← adjointAux_adjointAux A]
refine ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) fun x => ?_
rw [adjointAux_apply, LinearIsometryEquiv.norm_map]
exact toSesqForm_apply_norm_le
#align continuous_linear_map.adjoint_aux_norm ContinuousLinearMap.adjointAux_norm
def adjoint : (E →L[𝕜] F) ≃ₗᵢ⋆[𝕜] F →L[𝕜] E :=
LinearIsometryEquiv.ofSurjective { adjointAux with norm_map' := adjointAux_norm } fun A =>
⟨adjointAux A, adjointAux_adjointAux A⟩
#align continuous_linear_map.adjoint ContinuousLinearMap.adjoint
scoped[InnerProduct] postfix:1000 "†" => ContinuousLinearMap.adjoint
open InnerProduct
theorem adjoint_inner_left (A : E →L[𝕜] F) (x : E) (y : F) : ⟪(A†) y, x⟫ = ⟪y, A x⟫ :=
adjointAux_inner_left A x y
#align continuous_linear_map.adjoint_inner_left ContinuousLinearMap.adjoint_inner_left
theorem adjoint_inner_right (A : E →L[𝕜] F) (x : E) (y : F) : ⟪x, (A†) y⟫ = ⟪A x, y⟫ :=
adjointAux_inner_right A x y
#align continuous_linear_map.adjoint_inner_right ContinuousLinearMap.adjoint_inner_right
@[simp]
theorem adjoint_adjoint (A : E →L[𝕜] F) : A†† = A :=
adjointAux_adjointAux A
#align continuous_linear_map.adjoint_adjoint ContinuousLinearMap.adjoint_adjoint
@[simp]
theorem adjoint_comp (A : F →L[𝕜] G) (B : E →L[𝕜] F) : (A ∘L B)† = B† ∘L A† := by
ext v
refine ext_inner_left 𝕜 fun w => ?_
simp only [adjoint_inner_right, ContinuousLinearMap.coe_comp', Function.comp_apply]
#align continuous_linear_map.adjoint_comp ContinuousLinearMap.adjoint_comp
theorem apply_norm_sq_eq_inner_adjoint_left (A : E →L[𝕜] F) (x : E) :
‖A x‖ ^ 2 = re ⟪(A† ∘L A) x, x⟫ := by
have h : ⟪(A† ∘L A) x, x⟫ = ⟪A x, A x⟫ := by rw [← adjoint_inner_left]; rfl
rw [h, ← inner_self_eq_norm_sq (𝕜 := 𝕜) _]
#align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_left ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_left
| Mathlib/Analysis/InnerProductSpace/Adjoint.lean | 150 | 152 | theorem apply_norm_eq_sqrt_inner_adjoint_left (A : E →L[𝕜] F) (x : E) :
‖A x‖ = √(re ⟪(A† ∘L A) x, x⟫) := by |
rw [← apply_norm_sq_eq_inner_adjoint_left, Real.sqrt_sq (norm_nonneg _)]
| 0.9375 |
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Data.Complex.Exponential
import Mathlib.Data.Complex.Module
import Mathlib.RingTheory.Polynomial.Chebyshev
#align_import analysis.special_functions.trigonometric.chebyshev from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
set_option linter.uppercaseLean3 false
namespace Polynomial.Chebyshev
open Polynomial
variable {R A : Type*} [CommRing R] [CommRing A] [Algebra R A]
@[simp]
theorem aeval_T (x : A) (n : ℤ) : aeval x (T R n) = (T A n).eval x := by
rw [aeval_def, eval₂_eq_eval_map, map_T]
#align polynomial.chebyshev.aeval_T Polynomial.Chebyshev.aeval_T
@[simp]
theorem aeval_U (x : A) (n : ℤ) : aeval x (U R n) = (U A n).eval x := by
rw [aeval_def, eval₂_eq_eval_map, map_U]
#align polynomial.chebyshev.aeval_U Polynomial.Chebyshev.aeval_U
@[simp]
theorem algebraMap_eval_T (x : R) (n : ℤ) :
algebraMap R A ((T R n).eval x) = (T A n).eval (algebraMap R A x) := by
rw [← aeval_algebraMap_apply_eq_algebraMap_eval, aeval_T]
#align polynomial.chebyshev.algebra_map_eval_T Polynomial.Chebyshev.algebraMap_eval_T
@[simp]
| Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean | 45 | 47 | theorem algebraMap_eval_U (x : R) (n : ℤ) :
algebraMap R A ((U R n).eval x) = (U A n).eval (algebraMap R A x) := by |
rw [← aeval_algebraMap_apply_eq_algebraMap_eval, aeval_U]
| 0.9375 |
import Mathlib.Analysis.SpecialFunctions.Exp
import Mathlib.Tactic.Positivity.Core
import Mathlib.Algebra.Ring.NegOnePow
#align_import analysis.special_functions.trigonometric.basic from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
noncomputable section
open scoped Classical
open Topology Filter Set
namespace Complex
@[continuity, fun_prop]
| Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean | 54 | 56 | theorem continuous_sin : Continuous sin := by |
change Continuous fun z => (exp (-z * I) - exp (z * I)) * I / 2
continuity
| 0.9375 |
import Mathlib.Algebra.Group.Defs
#align_import algebra.invertible from "leanprover-community/mathlib"@"722b3b152ddd5e0cf21c0a29787c76596cb6b422"
assert_not_exists MonoidWithZero
assert_not_exists DenselyOrdered
universe u
variable {α : Type u}
class Invertible [Mul α] [One α] (a : α) : Type u where
invOf : α
invOf_mul_self : invOf * a = 1
mul_invOf_self : a * invOf = 1
#align invertible Invertible
prefix:max
"⅟" =>-- This notation has the same precedence as `Inv.inv`.
Invertible.invOf
@[simp]
theorem invOf_mul_self' [Mul α] [One α] (a : α) {_ : Invertible a} : ⅟ a * a = 1 :=
Invertible.invOf_mul_self
theorem invOf_mul_self [Mul α] [One α] (a : α) [Invertible a] : ⅟ a * a = 1 :=
Invertible.invOf_mul_self
#align inv_of_mul_self invOf_mul_self
@[simp]
theorem mul_invOf_self' [Mul α] [One α] (a : α) {_ : Invertible a} : a * ⅟ a = 1 :=
Invertible.mul_invOf_self
theorem mul_invOf_self [Mul α] [One α] (a : α) [Invertible a] : a * ⅟ a = 1 :=
Invertible.mul_invOf_self
#align mul_inv_of_self mul_invOf_self
@[simp]
| Mathlib/Algebra/Group/Invertible/Defs.lean | 117 | 118 | theorem invOf_mul_self_assoc' [Monoid α] (a b : α) {_ : Invertible a} : ⅟ a * (a * b) = b := by |
rw [← mul_assoc, invOf_mul_self, one_mul]
| 0.9375 |
import Mathlib.Data.Set.Image
import Mathlib.Data.SProd
#align_import data.set.prod from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4"
open Function
namespace Set
section Prod
variable {α β γ δ : Type*} {s s₁ s₂ : Set α} {t t₁ t₂ : Set β} {a : α} {b : β}
theorem Subsingleton.prod (hs : s.Subsingleton) (ht : t.Subsingleton) :
(s ×ˢ t).Subsingleton := fun _x hx _y hy ↦
Prod.ext (hs hx.1 hy.1) (ht hx.2 hy.2)
noncomputable instance decidableMemProd [DecidablePred (· ∈ s)] [DecidablePred (· ∈ t)] :
DecidablePred (· ∈ s ×ˢ t) := fun _ => And.decidable
#align set.decidable_mem_prod Set.decidableMemProd
@[gcongr]
theorem prod_mono (hs : s₁ ⊆ s₂) (ht : t₁ ⊆ t₂) : s₁ ×ˢ t₁ ⊆ s₂ ×ˢ t₂ :=
fun _ ⟨h₁, h₂⟩ => ⟨hs h₁, ht h₂⟩
#align set.prod_mono Set.prod_mono
@[gcongr]
theorem prod_mono_left (hs : s₁ ⊆ s₂) : s₁ ×ˢ t ⊆ s₂ ×ˢ t :=
prod_mono hs Subset.rfl
#align set.prod_mono_left Set.prod_mono_left
@[gcongr]
theorem prod_mono_right (ht : t₁ ⊆ t₂) : s ×ˢ t₁ ⊆ s ×ˢ t₂ :=
prod_mono Subset.rfl ht
#align set.prod_mono_right Set.prod_mono_right
@[simp]
theorem prod_self_subset_prod_self : s₁ ×ˢ s₁ ⊆ s₂ ×ˢ s₂ ↔ s₁ ⊆ s₂ :=
⟨fun h _ hx => (h (mk_mem_prod hx hx)).1, fun h _ hx => ⟨h hx.1, h hx.2⟩⟩
#align set.prod_self_subset_prod_self Set.prod_self_subset_prod_self
@[simp]
theorem prod_self_ssubset_prod_self : s₁ ×ˢ s₁ ⊂ s₂ ×ˢ s₂ ↔ s₁ ⊂ s₂ :=
and_congr prod_self_subset_prod_self <| not_congr prod_self_subset_prod_self
#align set.prod_self_ssubset_prod_self Set.prod_self_ssubset_prod_self
theorem prod_subset_iff {P : Set (α × β)} : s ×ˢ t ⊆ P ↔ ∀ x ∈ s, ∀ y ∈ t, (x, y) ∈ P :=
⟨fun h _ hx _ hy => h (mk_mem_prod hx hy), fun h ⟨_, _⟩ hp => h _ hp.1 _ hp.2⟩
#align set.prod_subset_iff Set.prod_subset_iff
theorem forall_prod_set {p : α × β → Prop} : (∀ x ∈ s ×ˢ t, p x) ↔ ∀ x ∈ s, ∀ y ∈ t, p (x, y) :=
prod_subset_iff
#align set.forall_prod_set Set.forall_prod_set
theorem exists_prod_set {p : α × β → Prop} : (∃ x ∈ s ×ˢ t, p x) ↔ ∃ x ∈ s, ∃ y ∈ t, p (x, y) := by
simp [and_assoc]
#align set.exists_prod_set Set.exists_prod_set
@[simp]
| Mathlib/Data/Set/Prod.lean | 84 | 86 | theorem prod_empty : s ×ˢ (∅ : Set β) = ∅ := by |
ext
exact and_false_iff _
| 0.9375 |
import Mathlib.Algebra.DirectSum.Finsupp
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.DirectSum.TensorProduct
#align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d"
noncomputable section
open DirectSum TensorProduct
open Set LinearMap Submodule
variable (R S M N ι κ : Type*)
[CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N]
[Semiring S] [Algebra R S] [Module S M] [IsScalarTower R S M]
open scoped Classical in
def finsuppTensorFinsupp : (ι →₀ M) ⊗[R] (κ →₀ N) ≃ₗ[S] ι × κ →₀ M ⊗[R] N :=
TensorProduct.AlgebraTensorModule.congr
(finsuppLEquivDirectSum S M ι) (finsuppLEquivDirectSum R N κ) ≪≫ₗ
((TensorProduct.directSum R S (fun _ : ι => M) fun _ : κ => N) ≪≫ₗ
(finsuppLEquivDirectSum S (M ⊗[R] N) (ι × κ)).symm)
#align finsupp_tensor_finsupp finsuppTensorFinsupp
@[simp]
theorem finsuppTensorFinsupp_single (i : ι) (m : M) (k : κ) (n : N) :
finsuppTensorFinsupp R S M N ι κ (Finsupp.single i m ⊗ₜ Finsupp.single k n) =
Finsupp.single (i, k) (m ⊗ₜ n) := by
simp [finsuppTensorFinsupp]
#align finsupp_tensor_finsupp_single finsuppTensorFinsupp_single
@[simp]
theorem finsuppTensorFinsupp_apply (f : ι →₀ M) (g : κ →₀ N) (i : ι) (k : κ) :
finsuppTensorFinsupp R S M N ι κ (f ⊗ₜ g) (i, k) = f i ⊗ₜ g k := by
apply Finsupp.induction_linear f
· simp
· intro f₁ f₂ hf₁ hf₂
simp [add_tmul, hf₁, hf₂]
intro i' m
apply Finsupp.induction_linear g
· simp
· intro g₁ g₂ hg₁ hg₂
simp [tmul_add, hg₁, hg₂]
intro k' n
classical
simp_rw [finsuppTensorFinsupp_single, Finsupp.single_apply, Prod.mk.inj_iff, ite_and]
split_ifs <;> simp
#align finsupp_tensor_finsupp_apply finsuppTensorFinsupp_apply
@[simp]
theorem finsuppTensorFinsupp_symm_single (i : ι × κ) (m : M) (n : N) :
(finsuppTensorFinsupp R S M N ι κ).symm (Finsupp.single i (m ⊗ₜ n)) =
Finsupp.single i.1 m ⊗ₜ Finsupp.single i.2 n :=
Prod.casesOn i fun _ _ =>
(LinearEquiv.symm_apply_eq _).2 (finsuppTensorFinsupp_single _ _ _ _ _ _ _ _ _ _).symm
#align finsupp_tensor_finsupp_symm_single finsuppTensorFinsupp_symm_single
def finsuppTensorFinsuppLid : (ι →₀ R) ⊗[R] (κ →₀ N) ≃ₗ[R] ι × κ →₀ N :=
finsuppTensorFinsupp R R R N ι κ ≪≫ₗ Finsupp.lcongr (Equiv.refl _) (TensorProduct.lid R N)
@[simp]
theorem finsuppTensorFinsuppLid_apply_apply (f : ι →₀ R) (g : κ →₀ N) (a : ι) (b : κ) :
finsuppTensorFinsuppLid R N ι κ (f ⊗ₜ[R] g) (a, b) = f a • g b := by
simp [finsuppTensorFinsuppLid]
@[simp]
| Mathlib/LinearAlgebra/DirectSum/Finsupp.lean | 298 | 301 | theorem finsuppTensorFinsuppLid_single_tmul_single (a : ι) (b : κ) (r : R) (n : N) :
finsuppTensorFinsuppLid R N ι κ (Finsupp.single a r ⊗ₜ[R] Finsupp.single b n) =
Finsupp.single (a, b) (r • n) := by |
simp [finsuppTensorFinsuppLid]
| 0.9375 |
import Mathlib.CategoryTheory.Types
import Mathlib.CategoryTheory.Functor.EpiMono
import Mathlib.CategoryTheory.Limits.Constructions.EpiMono
#align_import category_theory.concrete_category.basic from "leanprover-community/mathlib"@"311ef8c4b4ae2804ea76b8a611bc5ea1d9c16872"
universe w w' v v' v'' u u' u''
namespace CategoryTheory
open CategoryTheory.Limits
class ConcreteCategory (C : Type u) [Category.{v} C] where
protected forget : C ⥤ Type w
[forget_faithful : forget.Faithful]
#align category_theory.concrete_category CategoryTheory.ConcreteCategory
#align category_theory.concrete_category.forget CategoryTheory.ConcreteCategory.forget
attribute [reducible] ConcreteCategory.forget
attribute [instance] ConcreteCategory.forget_faithful
abbrev forget (C : Type u) [Category.{v} C] [ConcreteCategory.{w} C] : C ⥤ Type w :=
ConcreteCategory.forget
#align category_theory.forget CategoryTheory.forget
-- this is reducible because we want `forget (Type u)` to unfold to `𝟭 _`
@[instance] abbrev ConcreteCategory.types : ConcreteCategory.{u, u, u+1} (Type u) where
forget := 𝟭 _
#align category_theory.concrete_category.types CategoryTheory.ConcreteCategory.types
def ConcreteCategory.hasCoeToSort (C : Type u) [Category.{v} C] [ConcreteCategory.{w} C] :
CoeSort C (Type w) where
coe := fun X => (forget C).obj X
#align category_theory.concrete_category.has_coe_to_sort CategoryTheory.ConcreteCategory.hasCoeToSort
section
attribute [local instance] ConcreteCategory.hasCoeToSort
variable {C : Type u} [Category.{v} C] [ConcreteCategory.{w} C]
-- Porting note: forget_obj_eq_coe has become a syntactic tautology.
#noalign category_theory.forget_obj_eq_coe
abbrev ConcreteCategory.instFunLike {X Y : C} : FunLike (X ⟶ Y) X Y where
coe f := (forget C).map f
coe_injective' _ _ h := (forget C).map_injective h
attribute [local instance] ConcreteCategory.instFunLike
@[ext low] -- Porting note: lowered priority
| Mathlib/CategoryTheory/ConcreteCategory/Basic.lean | 106 | 110 | theorem ConcreteCategory.hom_ext {X Y : C} (f g : X ⟶ Y) (w : ∀ x : X, f x = g x) : f = g := by |
apply (forget C).map_injective
dsimp [forget]
funext x
exact w x
| 0.9375 |
import Mathlib.Topology.PartialHomeomorph
import Mathlib.Analysis.Normed.Group.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Data.Real.Sqrt
#align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
open Set Metric Pointwise
variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E]
noncomputable section
@[simps (config := .lemmasOnly)]
def PartialHomeomorph.univUnitBall : PartialHomeomorph E E where
toFun x := (√(1 + ‖x‖ ^ 2))⁻¹ • x
invFun y := (√(1 - ‖(y : E)‖ ^ 2))⁻¹ • (y : E)
source := univ
target := ball 0 1
map_source' x _ := by
have : 0 < 1 + ‖x‖ ^ 2 := by positivity
rw [mem_ball_zero_iff, norm_smul, Real.norm_eq_abs, abs_inv, ← _root_.div_eq_inv_mul,
div_lt_one (abs_pos.mpr <| Real.sqrt_ne_zero'.mpr this), ← abs_norm x, ← sq_lt_sq,
abs_norm, Real.sq_sqrt this.le]
exact lt_one_add _
map_target' _ _ := trivial
left_inv' x _ := by
field_simp [norm_smul, smul_smul, (zero_lt_one_add_norm_sq x).ne', sq_abs,
Real.sq_sqrt (zero_lt_one_add_norm_sq x).le, ← Real.sqrt_div (zero_lt_one_add_norm_sq x).le]
right_inv' y hy := by
have : 0 < 1 - ‖y‖ ^ 2 := by nlinarith [norm_nonneg y, mem_ball_zero_iff.1 hy]
field_simp [norm_smul, smul_smul, this.ne', sq_abs, Real.sq_sqrt this.le,
← Real.sqrt_div this.le]
open_source := isOpen_univ
open_target := isOpen_ball
continuousOn_toFun := by
suffices Continuous fun (x:E) => (√(1 + ‖x‖ ^ 2))⁻¹
from (this.smul continuous_id).continuousOn
refine Continuous.inv₀ ?_ fun x => Real.sqrt_ne_zero'.mpr (by positivity)
continuity
continuousOn_invFun := by
have : ∀ y ∈ ball (0 : E) 1, √(1 - ‖(y : E)‖ ^ 2) ≠ 0 := fun y hy ↦ by
rw [Real.sqrt_ne_zero']
nlinarith [norm_nonneg y, mem_ball_zero_iff.1 hy]
exact ContinuousOn.smul (ContinuousOn.inv₀
(continuousOn_const.sub (continuous_norm.continuousOn.pow _)).sqrt this) continuousOn_id
@[simp]
theorem PartialHomeomorph.univUnitBall_apply_zero : univUnitBall (0 : E) = 0 := by
simp [PartialHomeomorph.univUnitBall_apply]
@[simp]
| Mathlib/Analysis/NormedSpace/HomeomorphBall.lean | 81 | 82 | theorem PartialHomeomorph.univUnitBall_symm_apply_zero : univUnitBall.symm (0 : E) = 0 := by |
simp [PartialHomeomorph.univUnitBall_symm_apply]
| 0.9375 |
import Mathlib.MeasureTheory.Integral.Lebesgue
open Set hiding restrict restrict_apply
open Filter ENNReal NNReal MeasureTheory.Measure
namespace MeasureTheory
variable {α : Type*} {m0 : MeasurableSpace α} {μ : Measure α}
noncomputable
def Measure.withDensity {m : MeasurableSpace α} (μ : Measure α) (f : α → ℝ≥0∞) : Measure α :=
Measure.ofMeasurable (fun s _ => ∫⁻ a in s, f a ∂μ) (by simp) fun s hs hd =>
lintegral_iUnion hs hd _
#align measure_theory.measure.with_density MeasureTheory.Measure.withDensity
@[simp]
theorem withDensity_apply (f : α → ℝ≥0∞) {s : Set α} (hs : MeasurableSet s) :
μ.withDensity f s = ∫⁻ a in s, f a ∂μ :=
Measure.ofMeasurable_apply s hs
#align measure_theory.with_density_apply MeasureTheory.withDensity_apply
theorem withDensity_apply_le (f : α → ℝ≥0∞) (s : Set α) :
∫⁻ a in s, f a ∂μ ≤ μ.withDensity f s := by
let t := toMeasurable (μ.withDensity f) s
calc
∫⁻ a in s, f a ∂μ ≤ ∫⁻ a in t, f a ∂μ :=
lintegral_mono_set (subset_toMeasurable (withDensity μ f) s)
_ = μ.withDensity f t :=
(withDensity_apply f (measurableSet_toMeasurable (withDensity μ f) s)).symm
_ = μ.withDensity f s := measure_toMeasurable s
theorem withDensity_apply' [SFinite μ] (f : α → ℝ≥0∞) (s : Set α) :
μ.withDensity f s = ∫⁻ a in s, f a ∂μ := by
apply le_antisymm ?_ (withDensity_apply_le f s)
let t := toMeasurable μ s
calc
μ.withDensity f s ≤ μ.withDensity f t := measure_mono (subset_toMeasurable μ s)
_ = ∫⁻ a in t, f a ∂μ := withDensity_apply f (measurableSet_toMeasurable μ s)
_ = ∫⁻ a in s, f a ∂μ := by congr 1; exact restrict_toMeasurable_of_sFinite s
@[simp]
lemma withDensity_zero_left (f : α → ℝ≥0∞) : (0 : Measure α).withDensity f = 0 := by
ext s hs
rw [withDensity_apply _ hs]
simp
theorem withDensity_congr_ae {f g : α → ℝ≥0∞} (h : f =ᵐ[μ] g) :
μ.withDensity f = μ.withDensity g := by
refine Measure.ext fun s hs => ?_
rw [withDensity_apply _ hs, withDensity_apply _ hs]
exact lintegral_congr_ae (ae_restrict_of_ae h)
#align measure_theory.with_density_congr_ae MeasureTheory.withDensity_congr_ae
lemma withDensity_mono {f g : α → ℝ≥0∞} (hfg : f ≤ᵐ[μ] g) :
μ.withDensity f ≤ μ.withDensity g := by
refine le_iff.2 fun s hs ↦ ?_
rw [withDensity_apply _ hs, withDensity_apply _ hs]
refine set_lintegral_mono_ae' hs ?_
filter_upwards [hfg] with x h_le using fun _ ↦ h_le
theorem withDensity_add_left {f : α → ℝ≥0∞} (hf : Measurable f) (g : α → ℝ≥0∞) :
μ.withDensity (f + g) = μ.withDensity f + μ.withDensity g := by
refine Measure.ext fun s hs => ?_
rw [withDensity_apply _ hs, Measure.add_apply, withDensity_apply _ hs, withDensity_apply _ hs,
← lintegral_add_left hf]
simp only [Pi.add_apply]
#align measure_theory.with_density_add_left MeasureTheory.withDensity_add_left
theorem withDensity_add_right (f : α → ℝ≥0∞) {g : α → ℝ≥0∞} (hg : Measurable g) :
μ.withDensity (f + g) = μ.withDensity f + μ.withDensity g := by
simpa only [add_comm] using withDensity_add_left hg f
#align measure_theory.with_density_add_right MeasureTheory.withDensity_add_right
| Mathlib/MeasureTheory/Measure/WithDensity.lean | 110 | 113 | theorem withDensity_add_measure {m : MeasurableSpace α} (μ ν : Measure α) (f : α → ℝ≥0∞) :
(μ + ν).withDensity f = μ.withDensity f + ν.withDensity f := by |
ext1 s hs
simp only [withDensity_apply f hs, restrict_add, lintegral_add_measure, Measure.add_apply]
| 0.9375 |
import Mathlib.Analysis.InnerProductSpace.Orthogonal
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
open Set
open scoped RealInnerProductSpace
variable {V P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
variable [NormedAddTorsor V P]
noncomputable section
namespace AffineSubspace
variable {c c₁ c₂ p₁ p₂ : P}
def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P :=
.comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <|
(LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace
theorem mem_perpBisector_iff_inner_eq_zero' :
c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 :=
Iff.rfl
theorem mem_perpBisector_iff_inner_eq_zero :
c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 :=
inner_eq_zero_symm
theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero :
c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by
rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply,
vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc]
simp
theorem mem_perpBisector_pointReflection_iff_inner_eq_zero :
c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by
rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right,
Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero,
← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev]
| Mathlib/Geometry/Euclidean/PerpBisector.lean | 65 | 67 | theorem midpoint_mem_perpBisector (p₁ p₂ : P) :
midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by |
simp [mem_perpBisector_iff_inner_eq_zero]
| 0.9375 |
import Mathlib.Tactic.Ring
#align_import algebra.group_power.identities from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23"
variable {R : Type*} [CommRing R] {a b x₁ x₂ x₃ x₄ x₅ x₆ x₇ x₈ y₁ y₂ y₃ y₄ y₅ y₆ y₇ y₈ n : R}
theorem sq_add_sq_mul_sq_add_sq :
(x₁ ^ 2 + x₂ ^ 2) * (y₁ ^ 2 + y₂ ^ 2) = (x₁ * y₁ - x₂ * y₂) ^ 2 + (x₁ * y₂ + x₂ * y₁) ^ 2 := by
ring
#align sq_add_sq_mul_sq_add_sq sq_add_sq_mul_sq_add_sq
theorem sq_add_mul_sq_mul_sq_add_mul_sq :
(x₁ ^ 2 + n * x₂ ^ 2) * (y₁ ^ 2 + n * y₂ ^ 2) =
(x₁ * y₁ - n * x₂ * y₂) ^ 2 + n * (x₁ * y₂ + x₂ * y₁) ^ 2 := by
ring
#align sq_add_mul_sq_mul_sq_add_mul_sq sq_add_mul_sq_mul_sq_add_mul_sq
| Mathlib/Algebra/Ring/Identities.lean | 39 | 41 | theorem pow_four_add_four_mul_pow_four :
a ^ 4 + 4 * b ^ 4 = ((a - b) ^ 2 + b ^ 2) * ((a + b) ^ 2 + b ^ 2) := by |
ring
| 0.9375 |
import Mathlib.Algebra.Group.Units.Equiv
import Mathlib.CategoryTheory.Endomorphism
#align_import category_theory.conj from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514"
universe v u
namespace CategoryTheory
namespace Iso
variable {C : Type u} [Category.{v} C]
def homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) : (X ⟶ Y) ≃ (X₁ ⟶ Y₁) where
toFun f := α.inv ≫ f ≫ β.hom
invFun f := α.hom ≫ f ≫ β.inv
left_inv f :=
show α.hom ≫ (α.inv ≫ f ≫ β.hom) ≫ β.inv = f by
rw [Category.assoc, Category.assoc, β.hom_inv_id, α.hom_inv_id_assoc, Category.comp_id]
right_inv f :=
show α.inv ≫ (α.hom ≫ f ≫ β.inv) ≫ β.hom = f by
rw [Category.assoc, Category.assoc, β.inv_hom_id, α.inv_hom_id_assoc, Category.comp_id]
#align category_theory.iso.hom_congr CategoryTheory.Iso.homCongr
-- @[simp, nolint simpNF] Porting note (#10675): dsimp can not prove this
@[simp]
theorem homCongr_apply {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (f : X ⟶ Y) :
α.homCongr β f = α.inv ≫ f ≫ β.hom := by
rfl
#align category_theory.iso.hom_congr_apply CategoryTheory.Iso.homCongr_apply
| Mathlib/CategoryTheory/Conj.lean | 55 | 56 | theorem homCongr_comp {X Y Z X₁ Y₁ Z₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (γ : Z ≅ Z₁) (f : X ⟶ Y)
(g : Y ⟶ Z) : α.homCongr γ (f ≫ g) = α.homCongr β f ≫ β.homCongr γ g := by | simp
| 0.9375 |
import Mathlib.Analysis.Convex.Between
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Normed.Group.AddTorsor
#align_import analysis.convex.side from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
variable {R V V' P P' : Type*}
open AffineEquiv AffineMap
namespace AffineSubspace
section StrictOrderedCommRing
variable [StrictOrderedCommRing R] [AddCommGroup V] [Module R V] [AddTorsor V P]
variable [AddCommGroup V'] [Module R V'] [AddTorsor V' P']
def WSameSide (s : AffineSubspace R P) (x y : P) : Prop :=
∃ᵉ (p₁ ∈ s) (p₂ ∈ s), SameRay R (x -ᵥ p₁) (y -ᵥ p₂)
#align affine_subspace.w_same_side AffineSubspace.WSameSide
def SSameSide (s : AffineSubspace R P) (x y : P) : Prop :=
s.WSameSide x y ∧ x ∉ s ∧ y ∉ s
#align affine_subspace.s_same_side AffineSubspace.SSameSide
def WOppSide (s : AffineSubspace R P) (x y : P) : Prop :=
∃ᵉ (p₁ ∈ s) (p₂ ∈ s), SameRay R (x -ᵥ p₁) (p₂ -ᵥ y)
#align affine_subspace.w_opp_side AffineSubspace.WOppSide
def SOppSide (s : AffineSubspace R P) (x y : P) : Prop :=
s.WOppSide x y ∧ x ∉ s ∧ y ∉ s
#align affine_subspace.s_opp_side AffineSubspace.SOppSide
theorem WSameSide.map {s : AffineSubspace R P} {x y : P} (h : s.WSameSide x y) (f : P →ᵃ[R] P') :
(s.map f).WSameSide (f x) (f y) := by
rcases h with ⟨p₁, hp₁, p₂, hp₂, h⟩
refine ⟨f p₁, mem_map_of_mem f hp₁, f p₂, mem_map_of_mem f hp₂, ?_⟩
simp_rw [← linearMap_vsub]
exact h.map f.linear
#align affine_subspace.w_same_side.map AffineSubspace.WSameSide.map
theorem _root_.Function.Injective.wSameSide_map_iff {s : AffineSubspace R P} {x y : P}
{f : P →ᵃ[R] P'} (hf : Function.Injective f) :
(s.map f).WSameSide (f x) (f y) ↔ s.WSameSide x y := by
refine ⟨fun h => ?_, fun h => h.map _⟩
rcases h with ⟨fp₁, hfp₁, fp₂, hfp₂, h⟩
rw [mem_map] at hfp₁ hfp₂
rcases hfp₁ with ⟨p₁, hp₁, rfl⟩
rcases hfp₂ with ⟨p₂, hp₂, rfl⟩
refine ⟨p₁, hp₁, p₂, hp₂, ?_⟩
simp_rw [← linearMap_vsub, (f.linear_injective_iff.2 hf).sameRay_map_iff] at h
exact h
#align function.injective.w_same_side_map_iff Function.Injective.wSameSide_map_iff
theorem _root_.Function.Injective.sSameSide_map_iff {s : AffineSubspace R P} {x y : P}
{f : P →ᵃ[R] P'} (hf : Function.Injective f) :
(s.map f).SSameSide (f x) (f y) ↔ s.SSameSide x y := by
simp_rw [SSameSide, hf.wSameSide_map_iff, mem_map_iff_mem_of_injective hf]
#align function.injective.s_same_side_map_iff Function.Injective.sSameSide_map_iff
@[simp]
theorem _root_.AffineEquiv.wSameSide_map_iff {s : AffineSubspace R P} {x y : P} (f : P ≃ᵃ[R] P') :
(s.map ↑f).WSameSide (f x) (f y) ↔ s.WSameSide x y :=
(show Function.Injective f.toAffineMap from f.injective).wSameSide_map_iff
#align affine_equiv.w_same_side_map_iff AffineEquiv.wSameSide_map_iff
@[simp]
theorem _root_.AffineEquiv.sSameSide_map_iff {s : AffineSubspace R P} {x y : P} (f : P ≃ᵃ[R] P') :
(s.map ↑f).SSameSide (f x) (f y) ↔ s.SSameSide x y :=
(show Function.Injective f.toAffineMap from f.injective).sSameSide_map_iff
#align affine_equiv.s_same_side_map_iff AffineEquiv.sSameSide_map_iff
| Mathlib/Analysis/Convex/Side.lean | 101 | 106 | theorem WOppSide.map {s : AffineSubspace R P} {x y : P} (h : s.WOppSide x y) (f : P →ᵃ[R] P') :
(s.map f).WOppSide (f x) (f y) := by |
rcases h with ⟨p₁, hp₁, p₂, hp₂, h⟩
refine ⟨f p₁, mem_map_of_mem f hp₁, f p₂, mem_map_of_mem f hp₂, ?_⟩
simp_rw [← linearMap_vsub]
exact h.map f.linear
| 0.9375 |
import Mathlib.Data.Multiset.Nodup
#align_import data.multiset.dedup from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
namespace Multiset
open List
variable {α β : Type*} [DecidableEq α]
def dedup (s : Multiset α) : Multiset α :=
Quot.liftOn s (fun l => (l.dedup : Multiset α)) fun _ _ p => Quot.sound p.dedup
#align multiset.dedup Multiset.dedup
@[simp]
theorem coe_dedup (l : List α) : @dedup α _ l = l.dedup :=
rfl
#align multiset.coe_dedup Multiset.coe_dedup
@[simp]
theorem dedup_zero : @dedup α _ 0 = 0 :=
rfl
#align multiset.dedup_zero Multiset.dedup_zero
@[simp]
theorem mem_dedup {a : α} {s : Multiset α} : a ∈ dedup s ↔ a ∈ s :=
Quot.induction_on s fun _ => List.mem_dedup
#align multiset.mem_dedup Multiset.mem_dedup
@[simp]
theorem dedup_cons_of_mem {a : α} {s : Multiset α} : a ∈ s → dedup (a ::ₘ s) = dedup s :=
Quot.induction_on s fun _ m => @congr_arg _ _ _ _ ofList <| List.dedup_cons_of_mem m
#align multiset.dedup_cons_of_mem Multiset.dedup_cons_of_mem
@[simp]
theorem dedup_cons_of_not_mem {a : α} {s : Multiset α} : a ∉ s → dedup (a ::ₘ s) = a ::ₘ dedup s :=
Quot.induction_on s fun _ m => congr_arg ofList <| List.dedup_cons_of_not_mem m
#align multiset.dedup_cons_of_not_mem Multiset.dedup_cons_of_not_mem
theorem dedup_le (s : Multiset α) : dedup s ≤ s :=
Quot.induction_on s fun _ => (dedup_sublist _).subperm
#align multiset.dedup_le Multiset.dedup_le
theorem dedup_subset (s : Multiset α) : dedup s ⊆ s :=
subset_of_le <| dedup_le _
#align multiset.dedup_subset Multiset.dedup_subset
theorem subset_dedup (s : Multiset α) : s ⊆ dedup s := fun _ => mem_dedup.2
#align multiset.subset_dedup Multiset.subset_dedup
@[simp]
theorem dedup_subset' {s t : Multiset α} : dedup s ⊆ t ↔ s ⊆ t :=
⟨Subset.trans (subset_dedup _), Subset.trans (dedup_subset _)⟩
#align multiset.dedup_subset' Multiset.dedup_subset'
@[simp]
theorem subset_dedup' {s t : Multiset α} : s ⊆ dedup t ↔ s ⊆ t :=
⟨fun h => Subset.trans h (dedup_subset _), fun h => Subset.trans h (subset_dedup _)⟩
#align multiset.subset_dedup' Multiset.subset_dedup'
@[simp]
theorem nodup_dedup (s : Multiset α) : Nodup (dedup s) :=
Quot.induction_on s List.nodup_dedup
#align multiset.nodup_dedup Multiset.nodup_dedup
theorem dedup_eq_self {s : Multiset α} : dedup s = s ↔ Nodup s :=
⟨fun e => e ▸ nodup_dedup s, Quot.induction_on s fun _ h => congr_arg ofList h.dedup⟩
#align multiset.dedup_eq_self Multiset.dedup_eq_self
alias ⟨_, Nodup.dedup⟩ := dedup_eq_self
#align multiset.nodup.dedup Multiset.Nodup.dedup
theorem count_dedup (m : Multiset α) (a : α) : m.dedup.count a = if a ∈ m then 1 else 0 :=
Quot.induction_on m fun _ => by
simp only [quot_mk_to_coe'', coe_dedup, mem_coe, List.mem_dedup, coe_nodup, coe_count]
apply List.count_dedup _ _
#align multiset.count_dedup Multiset.count_dedup
@[simp]
theorem dedup_idem {m : Multiset α} : m.dedup.dedup = m.dedup :=
Quot.induction_on m fun _ => @congr_arg _ _ _ _ ofList List.dedup_idem
#align multiset.dedup_idempotent Multiset.dedup_idem
theorem dedup_eq_zero {s : Multiset α} : dedup s = 0 ↔ s = 0 :=
⟨fun h => eq_zero_of_subset_zero <| h ▸ subset_dedup _, fun h => h.symm ▸ dedup_zero⟩
#align multiset.dedup_eq_zero Multiset.dedup_eq_zero
@[simp]
theorem dedup_singleton {a : α} : dedup ({a} : Multiset α) = {a} :=
(nodup_singleton _).dedup
#align multiset.dedup_singleton Multiset.dedup_singleton
theorem le_dedup {s t : Multiset α} : s ≤ dedup t ↔ s ≤ t ∧ Nodup s :=
⟨fun h => ⟨le_trans h (dedup_le _), nodup_of_le h (nodup_dedup _)⟩,
fun ⟨l, d⟩ => (le_iff_subset d).2 <| Subset.trans (subset_of_le l) (subset_dedup _)⟩
#align multiset.le_dedup Multiset.le_dedup
| Mathlib/Data/Multiset/Dedup.lean | 112 | 113 | theorem le_dedup_self {s : Multiset α} : s ≤ dedup s ↔ Nodup s := by |
rw [le_dedup, and_iff_right le_rfl]
| 0.9375 |
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Nat.Factors
import Mathlib.Order.Interval.Finset.Nat
#align_import number_theory.divisors from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open scoped Classical
open Finset
namespace Nat
variable (n : ℕ)
def divisors : Finset ℕ :=
Finset.filter (fun x : ℕ => x ∣ n) (Finset.Ico 1 (n + 1))
#align nat.divisors Nat.divisors
def properDivisors : Finset ℕ :=
Finset.filter (fun x : ℕ => x ∣ n) (Finset.Ico 1 n)
#align nat.proper_divisors Nat.properDivisors
def divisorsAntidiagonal : Finset (ℕ × ℕ) :=
Finset.filter (fun x => x.fst * x.snd = n) (Ico 1 (n + 1) ×ˢ Ico 1 (n + 1))
#align nat.divisors_antidiagonal Nat.divisorsAntidiagonal
variable {n}
@[simp]
theorem filter_dvd_eq_divisors (h : n ≠ 0) : (Finset.range n.succ).filter (· ∣ n) = n.divisors := by
ext
simp only [divisors, mem_filter, mem_range, mem_Ico, and_congr_left_iff, iff_and_self]
exact fun ha _ => succ_le_iff.mpr (pos_of_dvd_of_pos ha h.bot_lt)
#align nat.filter_dvd_eq_divisors Nat.filter_dvd_eq_divisors
@[simp]
theorem filter_dvd_eq_properDivisors (h : n ≠ 0) :
(Finset.range n).filter (· ∣ n) = n.properDivisors := by
ext
simp only [properDivisors, mem_filter, mem_range, mem_Ico, and_congr_left_iff, iff_and_self]
exact fun ha _ => succ_le_iff.mpr (pos_of_dvd_of_pos ha h.bot_lt)
#align nat.filter_dvd_eq_proper_divisors Nat.filter_dvd_eq_properDivisors
| Mathlib/NumberTheory/Divisors.lean | 75 | 75 | theorem properDivisors.not_self_mem : ¬n ∈ properDivisors n := by | simp [properDivisors]
| 0.9375 |
import Mathlib.Analysis.NormedSpace.PiLp
import Mathlib.Analysis.InnerProductSpace.PiL2
#align_import analysis.matrix from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open scoped NNReal Matrix
namespace Matrix
variable {R l m n α β : Type*} [Fintype l] [Fintype m] [Fintype n]
section LinfLinf
section SeminormedAddCommGroup
variable [SeminormedAddCommGroup α] [SeminormedAddCommGroup β]
protected def seminormedAddCommGroup : SeminormedAddCommGroup (Matrix m n α) :=
Pi.seminormedAddCommGroup
#align matrix.seminormed_add_comm_group Matrix.seminormedAddCommGroup
attribute [local instance] Matrix.seminormedAddCommGroup
-- Porting note (#10756): new theorem (along with all the uses of this lemma below)
theorem norm_def (A : Matrix m n α) : ‖A‖ = ‖fun i j => A i j‖ := rfl
lemma norm_eq_sup_sup_nnnorm (A : Matrix m n α) :
‖A‖ = Finset.sup Finset.univ fun i ↦ Finset.sup Finset.univ fun j ↦ ‖A i j‖₊ := by
simp_rw [Matrix.norm_def, Pi.norm_def, Pi.nnnorm_def]
-- Porting note (#10756): new theorem (along with all the uses of this lemma below)
theorem nnnorm_def (A : Matrix m n α) : ‖A‖₊ = ‖fun i j => A i j‖₊ := rfl
theorem norm_le_iff {r : ℝ} (hr : 0 ≤ r) {A : Matrix m n α} : ‖A‖ ≤ r ↔ ∀ i j, ‖A i j‖ ≤ r := by
simp_rw [norm_def, pi_norm_le_iff_of_nonneg hr]
#align matrix.norm_le_iff Matrix.norm_le_iff
theorem nnnorm_le_iff {r : ℝ≥0} {A : Matrix m n α} : ‖A‖₊ ≤ r ↔ ∀ i j, ‖A i j‖₊ ≤ r := by
simp_rw [nnnorm_def, pi_nnnorm_le_iff]
#align matrix.nnnorm_le_iff Matrix.nnnorm_le_iff
theorem norm_lt_iff {r : ℝ} (hr : 0 < r) {A : Matrix m n α} : ‖A‖ < r ↔ ∀ i j, ‖A i j‖ < r := by
simp_rw [norm_def, pi_norm_lt_iff hr]
#align matrix.norm_lt_iff Matrix.norm_lt_iff
theorem nnnorm_lt_iff {r : ℝ≥0} (hr : 0 < r) {A : Matrix m n α} :
‖A‖₊ < r ↔ ∀ i j, ‖A i j‖₊ < r := by
simp_rw [nnnorm_def, pi_nnnorm_lt_iff hr]
#align matrix.nnnorm_lt_iff Matrix.nnnorm_lt_iff
theorem norm_entry_le_entrywise_sup_norm (A : Matrix m n α) {i : m} {j : n} : ‖A i j‖ ≤ ‖A‖ :=
(norm_le_pi_norm (A i) j).trans (norm_le_pi_norm A i)
#align matrix.norm_entry_le_entrywise_sup_norm Matrix.norm_entry_le_entrywise_sup_norm
theorem nnnorm_entry_le_entrywise_sup_nnnorm (A : Matrix m n α) {i : m} {j : n} : ‖A i j‖₊ ≤ ‖A‖₊ :=
(nnnorm_le_pi_nnnorm (A i) j).trans (nnnorm_le_pi_nnnorm A i)
#align matrix.nnnorm_entry_le_entrywise_sup_nnnorm Matrix.nnnorm_entry_le_entrywise_sup_nnnorm
@[simp]
theorem nnnorm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖₊ = ‖a‖₊) :
‖A.map f‖₊ = ‖A‖₊ := by
simp only [nnnorm_def, Pi.nnnorm_def, Matrix.map_apply, hf]
#align matrix.nnnorm_map_eq Matrix.nnnorm_map_eq
@[simp]
theorem norm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖ = ‖a‖) : ‖A.map f‖ = ‖A‖ :=
(congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_map_eq A f fun a => Subtype.ext <| hf a : _)
#align matrix.norm_map_eq Matrix.norm_map_eq
@[simp]
theorem nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ :=
Finset.sup_comm _ _ _
#align matrix.nnnorm_transpose Matrix.nnnorm_transpose
@[simp]
theorem norm_transpose (A : Matrix m n α) : ‖Aᵀ‖ = ‖A‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_transpose A
#align matrix.norm_transpose Matrix.norm_transpose
@[simp]
theorem nnnorm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) :
‖Aᴴ‖₊ = ‖A‖₊ :=
(nnnorm_map_eq _ _ nnnorm_star).trans A.nnnorm_transpose
#align matrix.nnnorm_conj_transpose Matrix.nnnorm_conjTranspose
@[simp]
theorem norm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) : ‖Aᴴ‖ = ‖A‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_conjTranspose A
#align matrix.norm_conj_transpose Matrix.norm_conjTranspose
instance [StarAddMonoid α] [NormedStarGroup α] : NormedStarGroup (Matrix m m α) :=
⟨norm_conjTranspose⟩
@[simp]
| Mathlib/Analysis/Matrix.lean | 151 | 152 | theorem nnnorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ := by |
simp [nnnorm_def, Pi.nnnorm_def]
| 0.9375 |
import Mathlib.Data.Matrix.Basic
variable {l m n o : Type*}
universe u v w
variable {R : Type*} {α : Type v} {β : Type w}
namespace Matrix
def col (w : m → α) : Matrix m Unit α :=
of fun x _ => w x
#align matrix.col Matrix.col
-- TODO: set as an equation lemma for `col`, see mathlib4#3024
@[simp]
theorem col_apply (w : m → α) (i j) : col w i j = w i :=
rfl
#align matrix.col_apply Matrix.col_apply
def row (v : n → α) : Matrix Unit n α :=
of fun _ y => v y
#align matrix.row Matrix.row
-- TODO: set as an equation lemma for `row`, see mathlib4#3024
@[simp]
theorem row_apply (v : n → α) (i j) : row v i j = v j :=
rfl
#align matrix.row_apply Matrix.row_apply
theorem col_injective : Function.Injective (col : (m → α) → _) :=
fun _x _y h => funext fun i => congr_fun₂ h i ()
@[simp] theorem col_inj {v w : m → α} : col v = col w ↔ v = w := col_injective.eq_iff
@[simp] theorem col_zero [Zero α] : col (0 : m → α) = 0 := rfl
@[simp] theorem col_eq_zero [Zero α] (v : m → α) : col v = 0 ↔ v = 0 := col_inj
@[simp]
theorem col_add [Add α] (v w : m → α) : col (v + w) = col v + col w := by
ext
rfl
#align matrix.col_add Matrix.col_add
@[simp]
theorem col_smul [SMul R α] (x : R) (v : m → α) : col (x • v) = x • col v := by
ext
rfl
#align matrix.col_smul Matrix.col_smul
theorem row_injective : Function.Injective (row : (n → α) → _) :=
fun _x _y h => funext fun j => congr_fun₂ h () j
@[simp] theorem row_inj {v w : n → α} : row v = row w ↔ v = w := row_injective.eq_iff
@[simp] theorem row_zero [Zero α] : row (0 : n → α) = 0 := rfl
@[simp] theorem row_eq_zero [Zero α] (v : n → α) : row v = 0 ↔ v = 0 := row_inj
@[simp]
theorem row_add [Add α] (v w : m → α) : row (v + w) = row v + row w := by
ext
rfl
#align matrix.row_add Matrix.row_add
@[simp]
theorem row_smul [SMul R α] (x : R) (v : m → α) : row (x • v) = x • row v := by
ext
rfl
#align matrix.row_smul Matrix.row_smul
@[simp]
theorem transpose_col (v : m → α) : (Matrix.col v)ᵀ = Matrix.row v := by
ext
rfl
#align matrix.transpose_col Matrix.transpose_col
@[simp]
theorem transpose_row (v : m → α) : (Matrix.row v)ᵀ = Matrix.col v := by
ext
rfl
#align matrix.transpose_row Matrix.transpose_row
@[simp]
theorem conjTranspose_col [Star α] (v : m → α) : (col v)ᴴ = row (star v) := by
ext
rfl
#align matrix.conj_transpose_col Matrix.conjTranspose_col
@[simp]
theorem conjTranspose_row [Star α] (v : m → α) : (row v)ᴴ = col (star v) := by
ext
rfl
#align matrix.conj_transpose_row Matrix.conjTranspose_row
theorem row_vecMul [Fintype m] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : m → α) :
Matrix.row (v ᵥ* M) = Matrix.row v * M := by
ext
rfl
#align matrix.row_vec_mul Matrix.row_vecMul
theorem col_vecMul [Fintype m] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : m → α) :
Matrix.col (v ᵥ* M) = (Matrix.row v * M)ᵀ := by
ext
rfl
#align matrix.col_vec_mul Matrix.col_vecMul
theorem col_mulVec [Fintype n] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : n → α) :
Matrix.col (M *ᵥ v) = M * Matrix.col v := by
ext
rfl
#align matrix.col_mul_vec Matrix.col_mulVec
| Mathlib/Data/Matrix/RowCol.lean | 135 | 138 | theorem row_mulVec [Fintype n] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : n → α) :
Matrix.row (M *ᵥ v) = (M * Matrix.col v)ᵀ := by |
ext
rfl
| 0.9375 |
import Mathlib.SetTheory.Cardinal.ToNat
import Mathlib.Data.Nat.PartENat
#align_import set_theory.cardinal.basic from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
universe u v
open Function
variable {α : Type u}
namespace Cardinal
noncomputable def toPartENat : Cardinal →+o PartENat :=
.comp
{ (PartENat.withTopAddEquiv.symm : ℕ∞ →+ PartENat),
(PartENat.withTopOrderIso.symm : ℕ∞ →o PartENat) with }
toENat
#align cardinal.to_part_enat Cardinal.toPartENat
@[simp]
theorem partENatOfENat_toENat (c : Cardinal) : (toENat c : PartENat) = toPartENat c := rfl
@[simp]
theorem toPartENat_natCast (n : ℕ) : toPartENat n = n := by
simp only [← partENatOfENat_toENat, toENat_nat, PartENat.ofENat_coe]
#align cardinal.to_part_enat_cast Cardinal.toPartENat_natCast
| Mathlib/SetTheory/Cardinal/PartENat.lean | 43 | 44 | theorem toPartENat_apply_of_lt_aleph0 {c : Cardinal} (h : c < ℵ₀) : toPartENat c = toNat c := by |
lift c to ℕ using h; simp
| 0.9375 |
import Mathlib.Algebra.Group.Hom.End
import Mathlib.Algebra.Ring.Invertible
import Mathlib.Algebra.SMulWithZero
import Mathlib.Data.Int.Cast.Lemmas
import Mathlib.GroupTheory.GroupAction.Units
#align_import algebra.module.basic from "leanprover-community/mathlib"@"30413fc89f202a090a54d78e540963ed3de0056e"
assert_not_exists Multiset
assert_not_exists Set.indicator
assert_not_exists Pi.single_smul₀
open Function Set
universe u v
variable {α R k S M M₂ M₃ ι : Type*}
@[ext]
class Module (R : Type u) (M : Type v) [Semiring R] [AddCommMonoid M] extends
DistribMulAction R M where
protected add_smul : ∀ (r s : R) (x : M), (r + s) • x = r • x + s • x
protected zero_smul : ∀ x : M, (0 : R) • x = 0
#align module Module
#align module.ext Module.ext
#align module.ext_iff Module.ext_iff
section AddCommMonoid
variable [Semiring R] [AddCommMonoid M] [Module R M] (r s : R) (x y : M)
-- see Note [lower instance priority]
instance (priority := 100) Module.toMulActionWithZero : MulActionWithZero R M :=
{ (inferInstance : MulAction R M) with
smul_zero := smul_zero
zero_smul := Module.zero_smul }
#align module.to_mul_action_with_zero Module.toMulActionWithZero
instance AddCommMonoid.natModule : Module ℕ M where
one_smul := one_nsmul
mul_smul m n a := mul_nsmul' a m n
smul_add n a b := nsmul_add a b n
smul_zero := nsmul_zero
zero_smul := zero_nsmul
add_smul r s x := add_nsmul x r s
#align add_comm_monoid.nat_module AddCommMonoid.natModule
theorem AddMonoid.End.natCast_def (n : ℕ) :
(↑n : AddMonoid.End M) = DistribMulAction.toAddMonoidEnd ℕ M n :=
rfl
#align add_monoid.End.nat_cast_def AddMonoid.End.natCast_def
theorem add_smul : (r + s) • x = r • x + s • x :=
Module.add_smul r s x
#align add_smul add_smul
theorem Convex.combo_self {a b : R} (h : a + b = 1) (x : M) : a • x + b • x = x := by
rw [← add_smul, h, one_smul]
#align convex.combo_self Convex.combo_self
variable (R)
-- Porting note: this is the letter of the mathlib3 version, but not really the spirit
| Mathlib/Algebra/Module/Defs.lean | 104 | 104 | theorem two_smul : (2 : R) • x = x + x := by | rw [← one_add_one_eq_two, add_smul, one_smul]
| 0.9375 |
import Mathlib.MeasureTheory.PiSystem
import Mathlib.Order.OmegaCompletePartialOrder
import Mathlib.Topology.Constructions
import Mathlib.MeasureTheory.MeasurableSpace.Basic
open Set
namespace MeasureTheory
variable {ι : Type _} {α : ι → Type _}
section cylinder
def cylinder (s : Finset ι) (S : Set (∀ i : s, α i)) : Set (∀ i, α i) :=
(fun (f : ∀ i, α i) (i : s) ↦ f i) ⁻¹' S
@[simp]
theorem mem_cylinder (s : Finset ι) (S : Set (∀ i : s, α i)) (f : ∀ i, α i) :
f ∈ cylinder s S ↔ (fun i : s ↦ f i) ∈ S :=
mem_preimage
@[simp]
theorem cylinder_empty (s : Finset ι) : cylinder s (∅ : Set (∀ i : s, α i)) = ∅ := by
rw [cylinder, preimage_empty]
@[simp]
theorem cylinder_univ (s : Finset ι) : cylinder s (univ : Set (∀ i : s, α i)) = univ := by
rw [cylinder, preimage_univ]
@[simp]
theorem cylinder_eq_empty_iff [h_nonempty : Nonempty (∀ i, α i)] (s : Finset ι)
(S : Set (∀ i : s, α i)) :
cylinder s S = ∅ ↔ S = ∅ := by
refine ⟨fun h ↦ ?_, fun h ↦ by (rw [h]; exact cylinder_empty _)⟩
by_contra hS
rw [← Ne, ← nonempty_iff_ne_empty] at hS
let f := hS.some
have hf : f ∈ S := hS.choose_spec
classical
let f' : ∀ i, α i := fun i ↦ if hi : i ∈ s then f ⟨i, hi⟩ else h_nonempty.some i
have hf' : f' ∈ cylinder s S := by
rw [mem_cylinder]
simpa only [f', Finset.coe_mem, dif_pos]
rw [h] at hf'
exact not_mem_empty _ hf'
theorem inter_cylinder (s₁ s₂ : Finset ι) (S₁ : Set (∀ i : s₁, α i)) (S₂ : Set (∀ i : s₂, α i))
[DecidableEq ι] :
cylinder s₁ S₁ ∩ cylinder s₂ S₂ =
cylinder (s₁ ∪ s₂)
((fun f ↦ fun j : s₁ ↦ f ⟨j, Finset.mem_union_left s₂ j.prop⟩) ⁻¹' S₁ ∩
(fun f ↦ fun j : s₂ ↦ f ⟨j, Finset.mem_union_right s₁ j.prop⟩) ⁻¹' S₂) := by
ext1 f; simp only [mem_inter_iff, mem_cylinder, mem_setOf_eq]; rfl
theorem inter_cylinder_same (s : Finset ι) (S₁ : Set (∀ i : s, α i)) (S₂ : Set (∀ i : s, α i)) :
cylinder s S₁ ∩ cylinder s S₂ = cylinder s (S₁ ∩ S₂) := by
classical rw [inter_cylinder]; rfl
| Mathlib/MeasureTheory/Constructions/Cylinders.lean | 197 | 203 | theorem union_cylinder (s₁ s₂ : Finset ι) (S₁ : Set (∀ i : s₁, α i)) (S₂ : Set (∀ i : s₂, α i))
[DecidableEq ι] :
cylinder s₁ S₁ ∪ cylinder s₂ S₂ =
cylinder (s₁ ∪ s₂)
((fun f ↦ fun j : s₁ ↦ f ⟨j, Finset.mem_union_left s₂ j.prop⟩) ⁻¹' S₁ ∪
(fun f ↦ fun j : s₂ ↦ f ⟨j, Finset.mem_union_right s₁ j.prop⟩) ⁻¹' S₂) := by |
ext1 f; simp only [mem_union, mem_cylinder, mem_setOf_eq]; rfl
| 0.9375 |
import Mathlib.Order.Filter.Basic
import Mathlib.Data.Set.Countable
#align_import order.filter.countable_Inter from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a"
open Set Filter
open Filter
variable {ι : Sort*} {α β : Type*}
class CountableInterFilter (l : Filter α) : Prop where
countable_sInter_mem : ∀ S : Set (Set α), S.Countable → (∀ s ∈ S, s ∈ l) → ⋂₀ S ∈ l
#align countable_Inter_filter CountableInterFilter
variable {l : Filter α} [CountableInterFilter l]
theorem countable_sInter_mem {S : Set (Set α)} (hSc : S.Countable) : ⋂₀ S ∈ l ↔ ∀ s ∈ S, s ∈ l :=
⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs),
CountableInterFilter.countable_sInter_mem _ hSc⟩
#align countable_sInter_mem countable_sInter_mem
theorem countable_iInter_mem [Countable ι] {s : ι → Set α} : (⋂ i, s i) ∈ l ↔ ∀ i, s i ∈ l :=
sInter_range s ▸ (countable_sInter_mem (countable_range _)).trans forall_mem_range
#align countable_Inter_mem countable_iInter_mem
theorem countable_bInter_mem {ι : Type*} {S : Set ι} (hS : S.Countable) {s : ∀ i ∈ S, Set α} :
(⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by
rw [biInter_eq_iInter]
haveI := hS.toEncodable
exact countable_iInter_mem.trans Subtype.forall
#align countable_bInter_mem countable_bInter_mem
theorem eventually_countable_forall [Countable ι] {p : α → ι → Prop} :
(∀ᶠ x in l, ∀ i, p x i) ↔ ∀ i, ∀ᶠ x in l, p x i := by
simpa only [Filter.Eventually, setOf_forall] using
@countable_iInter_mem _ _ l _ _ fun i => { x | p x i }
#align eventually_countable_forall eventually_countable_forall
theorem eventually_countable_ball {ι : Type*} {S : Set ι} (hS : S.Countable)
{p : α → ∀ i ∈ S, Prop} :
(∀ᶠ x in l, ∀ i hi, p x i hi) ↔ ∀ i hi, ∀ᶠ x in l, p x i hi := by
simpa only [Filter.Eventually, setOf_forall] using
@countable_bInter_mem _ l _ _ _ hS fun i hi => { x | p x i hi }
#align eventually_countable_ball eventually_countable_ball
theorem EventuallyLE.countable_iUnion [Countable ι] {s t : ι → Set α} (h : ∀ i, s i ≤ᶠ[l] t i) :
⋃ i, s i ≤ᶠ[l] ⋃ i, t i :=
(eventually_countable_forall.2 h).mono fun _ hst hs => mem_iUnion.2 <| (mem_iUnion.1 hs).imp hst
#align eventually_le.countable_Union EventuallyLE.countable_iUnion
theorem EventuallyEq.countable_iUnion [Countable ι] {s t : ι → Set α} (h : ∀ i, s i =ᶠ[l] t i) :
⋃ i, s i =ᶠ[l] ⋃ i, t i :=
(EventuallyLE.countable_iUnion fun i => (h i).le).antisymm
(EventuallyLE.countable_iUnion fun i => (h i).symm.le)
#align eventually_eq.countable_Union EventuallyEq.countable_iUnion
| Mathlib/Order/Filter/CountableInter.lean | 89 | 94 | theorem EventuallyLE.countable_bUnion {ι : Type*} {S : Set ι} (hS : S.Countable)
{s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
⋃ i ∈ S, s i ‹_› ≤ᶠ[l] ⋃ i ∈ S, t i ‹_› := by |
simp only [biUnion_eq_iUnion]
haveI := hS.toEncodable
exact EventuallyLE.countable_iUnion fun i => h i i.2
| 0.9375 |
import Mathlib.Algebra.Group.Defs
import Mathlib.Algebra.Group.Prod
import Mathlib.Data.PNat.Basic
import Mathlib.GroupTheory.GroupAction.Prod
variable {M : Type*}
class PNatPowAssoc (M : Type*) [Mul M] [Pow M ℕ+] : Prop where
protected ppow_add : ∀ (k n : ℕ+) (x : M), x ^ (k + n) = x ^ k * x ^ n
protected ppow_one : ∀ (x : M), x ^ (1 : ℕ+) = x
section Mul
variable [Mul M] [Pow M ℕ+] [PNatPowAssoc M]
theorem ppow_add (k n : ℕ+) (x : M) : x ^ (k + n) = x ^ k * x ^ n :=
PNatPowAssoc.ppow_add k n x
@[simp]
theorem ppow_one (x : M) : x ^ (1 : ℕ+) = x :=
PNatPowAssoc.ppow_one x
theorem ppow_mul_assoc (k m n : ℕ+) (x : M) :
(x ^ k * x ^ m) * x ^ n = x ^ k * (x ^ m * x ^ n) := by
simp only [← ppow_add, add_assoc]
| Mathlib/Algebra/Group/PNatPowAssoc.lean | 64 | 65 | theorem ppow_mul_comm (m n : ℕ+) (x : M) :
x ^ m * x ^ n = x ^ n * x ^ m := by | simp only [← ppow_add, add_comm]
| 0.9375 |
import Mathlib.Analysis.NormedSpace.Exponential
import Mathlib.Analysis.Matrix
import Mathlib.LinearAlgebra.Matrix.ZPow
import Mathlib.LinearAlgebra.Matrix.Hermitian
import Mathlib.LinearAlgebra.Matrix.Symmetric
import Mathlib.Topology.UniformSpace.Matrix
#align_import analysis.normed_space.matrix_exponential from "leanprover-community/mathlib"@"1e3201306d4d9eb1fd54c60d7c4510ad5126f6f9"
open scoped Matrix
open NormedSpace -- For `exp`.
variable (𝕂 : Type*) {m n p : Type*} {n' : m → Type*} {𝔸 : Type*}
namespace Matrix
section Topological
section Ring
variable [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n] [∀ i, Fintype (n' i)]
[∀ i, DecidableEq (n' i)] [Field 𝕂] [Ring 𝔸] [TopologicalSpace 𝔸] [TopologicalRing 𝔸]
[Algebra 𝕂 𝔸] [T2Space 𝔸]
theorem exp_diagonal (v : m → 𝔸) : exp 𝕂 (diagonal v) = diagonal (exp 𝕂 v) := by
simp_rw [exp_eq_tsum, diagonal_pow, ← diagonal_smul, ← diagonal_tsum]
#align matrix.exp_diagonal Matrix.exp_diagonal
theorem exp_blockDiagonal (v : m → Matrix n n 𝔸) :
exp 𝕂 (blockDiagonal v) = blockDiagonal (exp 𝕂 v) := by
simp_rw [exp_eq_tsum, ← blockDiagonal_pow, ← blockDiagonal_smul, ← blockDiagonal_tsum]
#align matrix.exp_block_diagonal Matrix.exp_blockDiagonal
| Mathlib/Analysis/NormedSpace/MatrixExponential.lean | 89 | 91 | theorem exp_blockDiagonal' (v : ∀ i, Matrix (n' i) (n' i) 𝔸) :
exp 𝕂 (blockDiagonal' v) = blockDiagonal' (exp 𝕂 v) := by |
simp_rw [exp_eq_tsum, ← blockDiagonal'_pow, ← blockDiagonal'_smul, ← blockDiagonal'_tsum]
| 0.9375 |
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.Asymptotics.Asymptotics
import Mathlib.Analysis.NormedSpace.Basic
#align_import analysis.asymptotics.specific_asymptotics from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Filter Asymptotics
open Topology
section LinearOrderedField
variable {𝕜 : Type*} [LinearOrderedField 𝕜]
theorem pow_div_pow_eventuallyEq_atTop {p q : ℕ} :
(fun x : 𝕜 => x ^ p / x ^ q) =ᶠ[atTop] fun x => x ^ ((p : ℤ) - q) := by
apply (eventually_gt_atTop (0 : 𝕜)).mono fun x hx => _
intro x hx
simp [zpow_sub₀ hx.ne']
#align pow_div_pow_eventually_eq_at_top pow_div_pow_eventuallyEq_atTop
| Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean | 49 | 53 | theorem pow_div_pow_eventuallyEq_atBot {p q : ℕ} :
(fun x : 𝕜 => x ^ p / x ^ q) =ᶠ[atBot] fun x => x ^ ((p : ℤ) - q) := by |
apply (eventually_lt_atBot (0 : 𝕜)).mono fun x hx => _
intro x hx
simp [zpow_sub₀ hx.ne]
| 0.9375 |
import Mathlib.Algebra.Polynomial.Eval
#align_import data.polynomial.degree.lemmas from "leanprover-community/mathlib"@"728baa2f54e6062c5879a3e397ac6bac323e506f"
noncomputable section
open Polynomial
open Finsupp Finset
namespace Polynomial
universe u v w
variable {R : Type u} {S : Type v} {ι : Type w} {a b : R} {m n : ℕ}
section Semiring
variable [Semiring R] {p q r : R[X]}
section Degree
theorem natDegree_comp_le : natDegree (p.comp q) ≤ natDegree p * natDegree q :=
letI := Classical.decEq R
if h0 : p.comp q = 0 then by rw [h0, natDegree_zero]; exact Nat.zero_le _
else
WithBot.coe_le_coe.1 <|
calc
↑(natDegree (p.comp q)) = degree (p.comp q) := (degree_eq_natDegree h0).symm
_ = _ := congr_arg degree comp_eq_sum_left
_ ≤ _ := degree_sum_le _ _
_ ≤ _ :=
Finset.sup_le fun n hn =>
calc
degree (C (coeff p n) * q ^ n) ≤ degree (C (coeff p n)) + degree (q ^ n) :=
degree_mul_le _ _
_ ≤ natDegree (C (coeff p n)) + n • degree q :=
(add_le_add degree_le_natDegree (degree_pow_le _ _))
_ ≤ natDegree (C (coeff p n)) + n • ↑(natDegree q) :=
(add_le_add_left (nsmul_le_nsmul_right (@degree_le_natDegree _ _ q) n) _)
_ = (n * natDegree q : ℕ) := by
rw [natDegree_C, Nat.cast_zero, zero_add, nsmul_eq_mul];
simp
_ ≤ (natDegree p * natDegree q : ℕ) :=
WithBot.coe_le_coe.2 <|
mul_le_mul_of_nonneg_right (le_natDegree_of_ne_zero (mem_support_iff.1 hn))
(Nat.zero_le _)
#align polynomial.nat_degree_comp_le Polynomial.natDegree_comp_le
theorem degree_pos_of_root {p : R[X]} (hp : p ≠ 0) (h : IsRoot p a) : 0 < degree p :=
lt_of_not_ge fun hlt => by
have := eq_C_of_degree_le_zero hlt
rw [IsRoot, this, eval_C] at h
simp only [h, RingHom.map_zero] at this
exact hp this
#align polynomial.degree_pos_of_root Polynomial.degree_pos_of_root
| Mathlib/Algebra/Polynomial/Degree/Lemmas.lean | 72 | 73 | theorem natDegree_le_iff_coeff_eq_zero : p.natDegree ≤ n ↔ ∀ N : ℕ, n < N → p.coeff N = 0 := by |
simp_rw [natDegree_le_iff_degree_le, degree_le_iff_coeff_zero, Nat.cast_lt]
| 0.9375 |
import Mathlib.MeasureTheory.Measure.Typeclasses
open scoped ENNReal
namespace MeasureTheory
variable {α : Type*}
noncomputable
def Measure.trim {m m0 : MeasurableSpace α} (μ : @Measure α m0) (hm : m ≤ m0) : @Measure α m :=
@OuterMeasure.toMeasure α m μ.toOuterMeasure (hm.trans (le_toOuterMeasure_caratheodory μ))
#align measure_theory.measure.trim MeasureTheory.Measure.trim
@[simp]
theorem trim_eq_self [MeasurableSpace α] {μ : Measure α} : μ.trim le_rfl = μ := by
simp [Measure.trim]
#align measure_theory.trim_eq_self MeasureTheory.trim_eq_self
variable {m m0 : MeasurableSpace α} {μ : Measure α} {s : Set α}
theorem toOuterMeasure_trim_eq_trim_toOuterMeasure (μ : Measure α) (hm : m ≤ m0) :
@Measure.toOuterMeasure _ m (μ.trim hm) = @OuterMeasure.trim _ m μ.toOuterMeasure := by
rw [Measure.trim, toMeasure_toOuterMeasure (ms := m)]
#align measure_theory.to_outer_measure_trim_eq_trim_to_outer_measure MeasureTheory.toOuterMeasure_trim_eq_trim_toOuterMeasure
@[simp]
| Mathlib/MeasureTheory/Measure/Trim.lean | 49 | 50 | theorem zero_trim (hm : m ≤ m0) : (0 : Measure α).trim hm = (0 : @Measure α m) := by |
simp [Measure.trim, @OuterMeasure.toMeasure_zero _ m]
| 0.9375 |
import Mathlib.Algebra.MvPolynomial.Derivation
import Mathlib.Algebra.MvPolynomial.Variables
#align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
noncomputable section
universe u v
namespace MvPolynomial
open Set Function Finsupp
variable {R : Type u} {σ : Type v} {a a' a₁ a₂ : R} {s : σ →₀ ℕ}
section PDeriv
variable [CommSemiring R]
def pderiv (i : σ) : Derivation R (MvPolynomial σ R) (MvPolynomial σ R) :=
letI := Classical.decEq σ
mkDerivation R <| Pi.single i 1
#align mv_polynomial.pderiv MvPolynomial.pderiv
theorem pderiv_def [DecidableEq σ] (i : σ) : pderiv i = mkDerivation R (Pi.single i 1) := by
unfold pderiv; congr!
#align mv_polynomial.pderiv_def MvPolynomial.pderiv_def
@[simp]
theorem pderiv_monomial {i : σ} :
pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) := by
classical
simp only [pderiv_def, mkDerivation_monomial, Finsupp.smul_sum, smul_eq_mul, ← smul_mul_assoc,
← (monomial _).map_smul]
refine (Finset.sum_eq_single i (fun j _ hne => ?_) fun hi => ?_).trans ?_
· simp [Pi.single_eq_of_ne hne]
· rw [Finsupp.not_mem_support_iff] at hi; simp [hi]
· simp
#align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
theorem pderiv_C {i : σ} : pderiv i (C a) = 0 :=
derivation_C _ _
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_C MvPolynomial.pderiv_C
theorem pderiv_one {i : σ} : pderiv i (1 : MvPolynomial σ R) = 0 := pderiv_C
#align mv_polynomial.pderiv_one MvPolynomial.pderiv_one
@[simp]
theorem pderiv_X [DecidableEq σ] (i j : σ) :
pderiv i (X j : MvPolynomial σ R) = Pi.single (f := fun j => _) i 1 j := by
rw [pderiv_def, mkDerivation_X]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X MvPolynomial.pderiv_X
@[simp]
theorem pderiv_X_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by classical simp
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_X_self
@[simp]
| Mathlib/Algebra/MvPolynomial/PDeriv.lean | 101 | 102 | theorem pderiv_X_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by |
classical simp [h]
| 0.9375 |
import Mathlib.Algebra.Group.Subsemigroup.Basic
#align_import group_theory.subsemigroup.membership from "leanprover-community/mathlib"@"6cb77a8eaff0ddd100e87b1591c6d3ad319514ff"
assert_not_exists MonoidWithZero
variable {ι : Sort*} {M A B : Type*}
section NonAssoc
variable [Mul M]
open Set
namespace Subsemigroup
-- TODO: this section can be generalized to `[MulMemClass B M] [CompleteLattice B]`
-- such that `complete_lattice.le` coincides with `set_like.le`
@[to_additive]
theorem mem_iSup_of_directed {S : ι → Subsemigroup M} (hS : Directed (· ≤ ·) S) {x : M} :
(x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i := by
refine ⟨?_, fun ⟨i, hi⟩ ↦ le_iSup S i hi⟩
suffices x ∈ closure (⋃ i, (S i : Set M)) → ∃ i, x ∈ S i by
simpa only [closure_iUnion, closure_eq (S _)] using this
refine fun hx ↦ closure_induction hx (fun y hy ↦ mem_iUnion.mp hy) ?_
rintro x y ⟨i, hi⟩ ⟨j, hj⟩
rcases hS i j with ⟨k, hki, hkj⟩
exact ⟨k, (S k).mul_mem (hki hi) (hkj hj)⟩
#align subsemigroup.mem_supr_of_directed Subsemigroup.mem_iSup_of_directed
#align add_subsemigroup.mem_supr_of_directed AddSubsemigroup.mem_iSup_of_directed
@[to_additive]
theorem coe_iSup_of_directed {S : ι → Subsemigroup M} (hS : Directed (· ≤ ·) S) :
((⨆ i, S i : Subsemigroup M) : Set M) = ⋃ i, S i :=
Set.ext fun x => by simp [mem_iSup_of_directed hS]
#align subsemigroup.coe_supr_of_directed Subsemigroup.coe_iSup_of_directed
#align add_subsemigroup.coe_supr_of_directed AddSubsemigroup.coe_iSup_of_directed
@[to_additive]
theorem mem_sSup_of_directed_on {S : Set (Subsemigroup M)} (hS : DirectedOn (· ≤ ·) S) {x : M} :
x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by
simp only [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, Subtype.coe_mk,
exists_prop]
#align subsemigroup.mem_Sup_of_directed_on Subsemigroup.mem_sSup_of_directed_on
#align add_subsemigroup.mem_Sup_of_directed_on AddSubsemigroup.mem_sSup_of_directed_on
@[to_additive]
theorem coe_sSup_of_directed_on {S : Set (Subsemigroup M)} (hS : DirectedOn (· ≤ ·) S) :
(↑(sSup S) : Set M) = ⋃ s ∈ S, ↑s :=
Set.ext fun x => by simp [mem_sSup_of_directed_on hS]
#align subsemigroup.coe_Sup_of_directed_on Subsemigroup.coe_sSup_of_directed_on
#align add_subsemigroup.coe_Sup_of_directed_on AddSubsemigroup.coe_sSup_of_directed_on
@[to_additive]
| Mathlib/Algebra/Group/Subsemigroup/Membership.lean | 82 | 84 | theorem mem_sup_left {S T : Subsemigroup M} : ∀ {x : M}, x ∈ S → x ∈ S ⊔ T := by |
have : S ≤ S ⊔ T := le_sup_left
tauto
| 0.9375 |
import Mathlib.Algebra.Group.Semiconj.Defs
import Mathlib.Algebra.Ring.Defs
#align_import algebra.ring.semiconj from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
universe u v w x
variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x}
open Function
namespace SemiconjBy
@[simp]
theorem add_right [Distrib R] {a x y x' y' : R} (h : SemiconjBy a x y) (h' : SemiconjBy a x' y') :
SemiconjBy a (x + x') (y + y') := by
simp only [SemiconjBy, left_distrib, right_distrib, h.eq, h'.eq]
#align semiconj_by.add_right SemiconjBy.add_right
@[simp]
theorem add_left [Distrib R] {a b x y : R} (ha : SemiconjBy a x y) (hb : SemiconjBy b x y) :
SemiconjBy (a + b) x y := by
simp only [SemiconjBy, left_distrib, right_distrib, ha.eq, hb.eq]
#align semiconj_by.add_left SemiconjBy.add_left
section
variable [Mul R] [HasDistribNeg R] {a x y : R}
theorem neg_right (h : SemiconjBy a x y) : SemiconjBy a (-x) (-y) := by
simp only [SemiconjBy, h.eq, neg_mul, mul_neg]
#align semiconj_by.neg_right SemiconjBy.neg_right
@[simp]
theorem neg_right_iff : SemiconjBy a (-x) (-y) ↔ SemiconjBy a x y :=
⟨fun h => neg_neg x ▸ neg_neg y ▸ h.neg_right, SemiconjBy.neg_right⟩
#align semiconj_by.neg_right_iff SemiconjBy.neg_right_iff
| Mathlib/Algebra/Ring/Semiconj.lean | 57 | 58 | theorem neg_left (h : SemiconjBy a x y) : SemiconjBy (-a) x y := by |
simp only [SemiconjBy, h.eq, neg_mul, mul_neg]
| 0.9375 |
import Mathlib.Algebra.BigOperators.Group.Finset
#align_import data.nat.gcd.big_operators from "leanprover-community/mathlib"@"008205aa645b3f194c1da47025c5f110c8406eab"
namespace Nat
variable {ι : Type*}
theorem coprime_list_prod_left_iff {l : List ℕ} {k : ℕ} :
Coprime l.prod k ↔ ∀ n ∈ l, Coprime n k := by
induction l <;> simp [Nat.coprime_mul_iff_left, *]
theorem coprime_list_prod_right_iff {k : ℕ} {l : List ℕ} :
Coprime k l.prod ↔ ∀ n ∈ l, Coprime k n := by
simp_rw [coprime_comm (n := k), coprime_list_prod_left_iff]
theorem coprime_multiset_prod_left_iff {m : Multiset ℕ} {k : ℕ} :
Coprime m.prod k ↔ ∀ n ∈ m, Coprime n k := by
induction m using Quotient.inductionOn; simpa using coprime_list_prod_left_iff
| Mathlib/Data/Nat/GCD/BigOperators.lean | 32 | 34 | theorem coprime_multiset_prod_right_iff {k : ℕ} {m : Multiset ℕ} :
Coprime k m.prod ↔ ∀ n ∈ m, Coprime k n := by |
induction m using Quotient.inductionOn; simpa using coprime_list_prod_right_iff
| 0.9375 |
import Mathlib.Combinatorics.SimpleGraph.Basic
import Mathlib.Combinatorics.SimpleGraph.Connectivity
import Mathlib.LinearAlgebra.Matrix.Trace
import Mathlib.LinearAlgebra.Matrix.Symmetric
#align_import combinatorics.simple_graph.adj_matrix from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1"
open Matrix
open Finset Matrix SimpleGraph
variable {V α β : Type*}
namespace Matrix
structure IsAdjMatrix [Zero α] [One α] (A : Matrix V V α) : Prop where
zero_or_one : ∀ i j, A i j = 0 ∨ A i j = 1 := by aesop
symm : A.IsSymm := by aesop
apply_diag : ∀ i, A i i = 0 := by aesop
#align matrix.is_adj_matrix Matrix.IsAdjMatrix
namespace IsAdjMatrix
variable {A : Matrix V V α}
@[simp]
theorem apply_diag_ne [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i : V) :
¬A i i = 1 := by simp [h.apply_diag i]
#align matrix.is_adj_matrix.apply_diag_ne Matrix.IsAdjMatrix.apply_diag_ne
@[simp]
| Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean | 69 | 70 | theorem apply_ne_one_iff [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i j : V) :
¬A i j = 1 ↔ A i j = 0 := by | obtain h | h := h.zero_or_one i j <;> simp [h]
| 0.9375 |
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 section
open Polynomial
open Finset
namespace Polynomial
universe u v w z
variable {R : Type u} {S : Type v} {T : Type w} {a b : R} {n : ℕ}
section NoZeroDivisors
variable [Semiring R] [NoZeroDivisors R] {p q : R[X]}
instance : NoZeroDivisors R[X] where
eq_zero_or_eq_zero_of_mul_eq_zero h := by
rw [← leadingCoeff_eq_zero, ← leadingCoeff_eq_zero]
refine eq_zero_or_eq_zero_of_mul_eq_zero ?_
rw [← leadingCoeff_zero, ← leadingCoeff_mul, h]
theorem natDegree_mul (hp : p ≠ 0) (hq : q ≠ 0) : (p*q).natDegree = p.natDegree + q.natDegree := by
rw [← Nat.cast_inj (R := WithBot ℕ), ← degree_eq_natDegree (mul_ne_zero hp hq),
Nat.cast_add, ← degree_eq_natDegree hp, ← degree_eq_natDegree hq, degree_mul]
#align polynomial.nat_degree_mul Polynomial.natDegree_mul
| 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 hp hq]
apply WithTop.coe_add
| 0.9375 |
import Mathlib.Analysis.Analytic.Composition
#align_import analysis.analytic.inverse from "leanprover-community/mathlib"@"284fdd2962e67d2932fa3a79ce19fcf92d38e228"
open scoped Classical Topology
open Finset Filter
namespace FormalMultilinearSeries
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E]
[NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
noncomputable def leftInv (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
FormalMultilinearSeries 𝕜 F E
| 0 => 0
| 1 => (continuousMultilinearCurryFin1 𝕜 F E).symm i.symm
| n + 2 =>
-∑ c : { c : Composition (n + 2) // c.length < n + 2 },
(leftInv p i (c : Composition (n + 2)).length).compAlongComposition
(p.compContinuousLinearMap i.symm) c
#align formal_multilinear_series.left_inv FormalMultilinearSeries.leftInv
@[simp]
| Mathlib/Analysis/Analytic/Inverse.lean | 68 | 69 | theorem leftInv_coeff_zero (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
p.leftInv i 0 = 0 := by | rw [leftInv]
| 0.9375 |
import Mathlib.Algebra.Order.Module.OrderedSMul
import Mathlib.Algebra.Order.Module.Pointwise
import Mathlib.Data.Real.Archimedean
#align_import data.real.pointwise from "leanprover-community/mathlib"@"dde670c9a3f503647fd5bfdf1037bad526d3397a"
open Set
open Pointwise
variable {ι : Sort*} {α : Type*} [LinearOrderedField α]
section Module
variable [Module α ℝ] [OrderedSMul α ℝ] {a : α}
theorem Real.sInf_smul_of_nonpos (ha : a ≤ 0) (s : Set ℝ) : sInf (a • s) = a • sSup s := by
obtain rfl | hs := s.eq_empty_or_nonempty
· rw [smul_set_empty, Real.sInf_empty, Real.sSup_empty, smul_zero]
obtain rfl | ha' := ha.eq_or_lt
· rw [zero_smul_set hs, zero_smul]
exact csInf_singleton 0
by_cases h : BddAbove s
· exact ((OrderIso.smulRightDual ℝ ha').map_csSup' hs h).symm
· rw [Real.sInf_of_not_bddBelow (mt (bddBelow_smul_iff_of_neg ha').1 h),
Real.sSup_of_not_bddAbove h, smul_zero]
#align real.Inf_smul_of_nonpos Real.sInf_smul_of_nonpos
theorem Real.smul_iSup_of_nonpos (ha : a ≤ 0) (f : ι → ℝ) : (a • ⨆ i, f i) = ⨅ i, a • f i :=
(Real.sInf_smul_of_nonpos ha _).symm.trans <| congr_arg sInf <| (range_comp _ _).symm
#align real.smul_supr_of_nonpos Real.smul_iSup_of_nonpos
| Mathlib/Data/Real/Pointwise.lean | 91 | 100 | theorem Real.sSup_smul_of_nonpos (ha : a ≤ 0) (s : Set ℝ) : sSup (a • s) = a • sInf s := by |
obtain rfl | hs := s.eq_empty_or_nonempty
· rw [smul_set_empty, Real.sSup_empty, Real.sInf_empty, smul_zero]
obtain rfl | ha' := ha.eq_or_lt
· rw [zero_smul_set hs, zero_smul]
exact csSup_singleton 0
by_cases h : BddBelow s
· exact ((OrderIso.smulRightDual ℝ ha').map_csInf' hs h).symm
· rw [Real.sSup_of_not_bddAbove (mt (bddAbove_smul_iff_of_neg ha').1 h),
Real.sInf_of_not_bddBelow h, smul_zero]
| 0.9375 |
import Mathlib.CategoryTheory.NatTrans
import Mathlib.CategoryTheory.Iso
#align_import category_theory.functor.category from "leanprover-community/mathlib"@"63721b2c3eba6c325ecf8ae8cca27155a4f6306f"
namespace CategoryTheory
-- declare the `v`'s first; see note [CategoryTheory universes].
universe v₁ v₂ v₃ u₁ u₂ u₃
open NatTrans Category CategoryTheory.Functor
variable (C : Type u₁) [Category.{v₁} C] (D : Type u₂) [Category.{v₂} D]
attribute [local simp] vcomp_app
variable {C D} {E : Type u₃} [Category.{v₃} E]
variable {F G H I : C ⥤ D}
instance Functor.category : Category.{max u₁ v₂} (C ⥤ D) where
Hom F G := NatTrans F G
id F := NatTrans.id F
comp α β := vcomp α β
#align category_theory.functor.category CategoryTheory.Functor.category
namespace NatTrans
-- Porting note: the behaviour of `ext` has changed here.
-- We need to provide a copy of the `NatTrans.ext` lemma,
-- written in terms of `F ⟶ G` rather than `NatTrans F G`,
-- or `ext` will not retrieve it from the cache.
@[ext]
theorem ext' {α β : F ⟶ G} (w : α.app = β.app) : α = β := NatTrans.ext _ _ w
@[simp]
theorem vcomp_eq_comp (α : F ⟶ G) (β : G ⟶ H) : vcomp α β = α ≫ β := rfl
#align category_theory.nat_trans.vcomp_eq_comp CategoryTheory.NatTrans.vcomp_eq_comp
theorem vcomp_app' (α : F ⟶ G) (β : G ⟶ H) (X : C) : (α ≫ β).app X = α.app X ≫ β.app X := rfl
#align category_theory.nat_trans.vcomp_app' CategoryTheory.NatTrans.vcomp_app'
| Mathlib/CategoryTheory/Functor/Category.lean | 68 | 68 | theorem congr_app {α β : F ⟶ G} (h : α = β) (X : C) : α.app X = β.app X := by | rw [h]
| 0.9375 |
import Batteries.Data.List.Lemmas
import Batteries.Tactic.Classical
import Mathlib.Tactic.TypeStar
import Mathlib.Mathport.Rename
#align_import data.list.tfae from "leanprover-community/mathlib"@"5a3e819569b0f12cbec59d740a2613018e7b8eec"
namespace List
def TFAE (l : List Prop) : Prop :=
∀ x ∈ l, ∀ y ∈ l, x ↔ y
#align list.tfae List.TFAE
theorem tfae_nil : TFAE [] :=
forall_mem_nil _
#align list.tfae_nil List.tfae_nil
@[simp]
theorem tfae_singleton (p) : TFAE [p] := by simp [TFAE, -eq_iff_iff]
#align list.tfae_singleton List.tfae_singleton
theorem tfae_cons_of_mem {a b} {l : List Prop} (h : b ∈ l) : TFAE (a :: l) ↔ (a ↔ b) ∧ TFAE l :=
⟨fun H => ⟨H a (by simp) b (Mem.tail a h),
fun p hp q hq => H _ (Mem.tail a hp) _ (Mem.tail a hq)⟩,
by
rintro ⟨ab, H⟩ p (_ | ⟨_, hp⟩) q (_ | ⟨_, hq⟩)
· rfl
· exact ab.trans (H _ h _ hq)
· exact (ab.trans (H _ h _ hp)).symm
· exact H _ hp _ hq⟩
#align list.tfae_cons_of_mem List.tfae_cons_of_mem
theorem tfae_cons_cons {a b} {l : List Prop} : TFAE (a :: b :: l) ↔ (a ↔ b) ∧ TFAE (b :: l) :=
tfae_cons_of_mem (Mem.head _)
#align list.tfae_cons_cons List.tfae_cons_cons
@[simp]
| Mathlib/Data/List/TFAE.lean | 56 | 57 | theorem tfae_cons_self {a} {l : List Prop} : TFAE (a :: a :: l) ↔ TFAE (a :: l) := by |
simp [tfae_cons_cons]
| 0.9375 |
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 {p : ℕ} {R S T : Type*} [hp : Fact p.Prime] [CommRing R] [CommRing S] [CommRing T]
variable {α : Type*} {β : Type*}
local notation "𝕎" => WittVector p
local notation "W_" => wittPolynomial p
-- type as `\bbW`
open scoped Witt
namespace WittVector
def mapFun (f : α → β) : 𝕎 α → 𝕎 β := fun x => mk _ (f ∘ x.coeff)
#align witt_vector.map_fun WittVector.mapFun
namespace mapFun
-- Porting note: switched the proof to tactic mode. I think that `ext` was the issue.
theorem injective (f : α → β) (hf : Injective f) : Injective (mapFun f : 𝕎 α → 𝕎 β) := by
intros _ _ h
ext p
exact hf (congr_arg (fun x => coeff x p) h : _)
#align witt_vector.map_fun.injective WittVector.mapFun.injective
theorem surjective (f : α → β) (hf : Surjective f) : Surjective (mapFun f : 𝕎 α → 𝕎 β) := fun x =>
⟨mk _ fun n => Classical.choose <| hf <| x.coeff n,
by ext n; simp only [mapFun, coeff_mk, comp_apply, Classical.choose_spec (hf (x.coeff n))]⟩
#align witt_vector.map_fun.surjective WittVector.mapFun.surjective
-- Porting note: using `(x y : 𝕎 R)` instead of `(x y : WittVector p R)` produced sorries.
variable (f : R →+* S) (x y : WittVector p R)
-- porting note: a very crude port.
macro "map_fun_tac" : tactic => `(tactic| (
ext n
simp only [mapFun, mk, comp_apply, zero_coeff, map_zero,
-- Porting note: the lemmas on the next line do not have the `simp` tag in mathlib4
add_coeff, sub_coeff, mul_coeff, neg_coeff, nsmul_coeff, zsmul_coeff, pow_coeff,
peval, map_aeval, algebraMap_int_eq, coe_eval₂Hom] <;>
try { cases n <;> simp <;> done } <;> -- Porting note: this line solves `one`
apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl <;>
ext ⟨i, k⟩ <;>
fin_cases i <;> rfl))
-- and until `pow`.
-- We do not tag these lemmas as `@[simp]` because they will be bundled in `map` later on.
theorem zero : mapFun f (0 : 𝕎 R) = 0 := by map_fun_tac
#align witt_vector.map_fun.zero WittVector.mapFun.zero
| Mathlib/RingTheory/WittVector/Basic.lean | 105 | 105 | theorem one : mapFun f (1 : 𝕎 R) = 1 := by | map_fun_tac
| 0.9375 |
import Mathlib.Algebra.Polynomial.Degree.Definitions
import Mathlib.Algebra.Polynomial.Eval
import Mathlib.Algebra.Polynomial.Monic
import Mathlib.Algebra.Polynomial.RingDivision
import Mathlib.Tactic.Abel
#align_import ring_theory.polynomial.pochhammer from "leanprover-community/mathlib"@"53b216bcc1146df1c4a0a86877890ea9f1f01589"
universe u v
open Polynomial
open Polynomial
section Ring
variable (R : Type u) [Ring R]
noncomputable def descPochhammer : ℕ → R[X]
| 0 => 1
| n + 1 => X * (descPochhammer n).comp (X - 1)
@[simp]
theorem descPochhammer_zero : descPochhammer R 0 = 1 :=
rfl
@[simp]
theorem descPochhammer_one : descPochhammer R 1 = X := by simp [descPochhammer]
theorem descPochhammer_succ_left (n : ℕ) :
descPochhammer R (n + 1) = X * (descPochhammer R n).comp (X - 1) := by
rw [descPochhammer]
theorem monic_descPochhammer (n : ℕ) [Nontrivial R] [NoZeroDivisors R] :
Monic <| descPochhammer R n := by
induction' n with n hn
· simp
· have h : leadingCoeff (X - 1 : R[X]) = 1 := leadingCoeff_X_sub_C 1
have : natDegree (X - (1 : R[X])) ≠ 0 := ne_zero_of_eq_one <| natDegree_X_sub_C (1 : R)
rw [descPochhammer_succ_left, Monic.def, leadingCoeff_mul, leadingCoeff_comp this, hn, monic_X,
one_mul, one_mul, h, one_pow]
section
variable {R} {T : Type v} [Ring T]
@[simp]
theorem descPochhammer_map (f : R →+* T) (n : ℕ) :
(descPochhammer R n).map f = descPochhammer T n := by
induction' n with n ih
· simp
· simp [ih, descPochhammer_succ_left, map_comp]
end
@[simp, norm_cast]
theorem descPochhammer_eval_cast (n : ℕ) (k : ℤ) :
(((descPochhammer ℤ n).eval k : ℤ) : R) = ((descPochhammer R n).eval k : R) := by
rw [← descPochhammer_map (algebraMap ℤ R), eval_map, ← eq_intCast (algebraMap ℤ R)]
simp only [algebraMap_int_eq, eq_intCast, eval₂_at_intCast, Nat.cast_id, eq_natCast, Int.cast_id]
theorem descPochhammer_eval_zero {n : ℕ} :
(descPochhammer R n).eval 0 = if n = 0 then 1 else 0 := by
cases n
· simp
· simp [X_mul, Nat.succ_ne_zero, descPochhammer_succ_left]
theorem descPochhammer_zero_eval_zero : (descPochhammer R 0).eval 0 = 1 := by simp
@[simp]
| Mathlib/RingTheory/Polynomial/Pochhammer.lean | 298 | 299 | theorem descPochhammer_ne_zero_eval_zero {n : ℕ} (h : n ≠ 0) : (descPochhammer R n).eval 0 = 0 := by |
simp [descPochhammer_eval_zero, h]
| 0.9375 |
import Mathlib.Topology.MetricSpace.HausdorffDistance
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order
#align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf"
open Set Filter ENNReal Topology NNReal TopologicalSpace
namespace MeasureTheory
namespace Measure
def InnerRegularWRT {α} {_ : MeasurableSpace α} (μ : Measure α) (p q : Set α → Prop) :=
∀ ⦃U⦄, q U → ∀ r < μ U, ∃ K, K ⊆ U ∧ p K ∧ r < μ K
#align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT
variable {α β : Type*} [MeasurableSpace α] [TopologicalSpace α] {μ : Measure α}
class OuterRegular (μ : Measure α) : Prop where
protected outerRegular :
∀ ⦃A : Set α⦄, MeasurableSet A → ∀ r > μ A, ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < r
#align measure_theory.measure.outer_regular MeasureTheory.Measure.OuterRegular
#align measure_theory.measure.outer_regular.outer_regular MeasureTheory.Measure.OuterRegular.outerRegular
class Regular (μ : Measure α) extends IsFiniteMeasureOnCompacts μ, OuterRegular μ : Prop where
innerRegular : InnerRegularWRT μ IsCompact IsOpen
#align measure_theory.measure.regular MeasureTheory.Measure.Regular
class WeaklyRegular (μ : Measure α) extends OuterRegular μ : Prop where
protected innerRegular : InnerRegularWRT μ IsClosed IsOpen
#align measure_theory.measure.weakly_regular MeasureTheory.Measure.WeaklyRegular
#align measure_theory.measure.weakly_regular.inner_regular MeasureTheory.Measure.WeaklyRegular.innerRegular
class InnerRegular (μ : Measure α) : Prop where
protected innerRegular : InnerRegularWRT μ IsCompact (fun s ↦ MeasurableSet s)
class InnerRegularCompactLTTop (μ : Measure α) : Prop where
protected innerRegular : InnerRegularWRT μ IsCompact (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞)
-- see Note [lower instance priority]
instance (priority := 100) Regular.weaklyRegular [R1Space α] [Regular μ] :
WeaklyRegular μ where
innerRegular := fun _U hU r hr ↦
let ⟨K, KU, K_comp, hK⟩ := Regular.innerRegular hU r hr
⟨closure K, K_comp.closure_subset_of_isOpen hU KU, isClosed_closure,
hK.trans_le (measure_mono subset_closure)⟩
#align measure_theory.measure.regular.weakly_regular MeasureTheory.Measure.Regular.weaklyRegular
namespace OuterRegular
instance zero : OuterRegular (0 : Measure α) :=
⟨fun A _ _r hr => ⟨univ, subset_univ A, isOpen_univ, hr⟩⟩
#align measure_theory.measure.outer_regular.zero MeasureTheory.Measure.OuterRegular.zero
theorem _root_.Set.exists_isOpen_lt_of_lt [OuterRegular μ] (A : Set α) (r : ℝ≥0∞) (hr : μ A < r) :
∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < r := by
rcases OuterRegular.outerRegular (measurableSet_toMeasurable μ A) r
(by rwa [measure_toMeasurable]) with
⟨U, hAU, hUo, hU⟩
exact ⟨U, (subset_toMeasurable _ _).trans hAU, hUo, hU⟩
#align set.exists_is_open_lt_of_lt Set.exists_isOpen_lt_of_lt
theorem _root_.Set.measure_eq_iInf_isOpen (A : Set α) (μ : Measure α) [OuterRegular μ] :
μ A = ⨅ (U : Set α) (_ : A ⊆ U) (_ : IsOpen U), μ U := by
refine le_antisymm (le_iInf₂ fun s hs => le_iInf fun _ => μ.mono hs) ?_
refine le_of_forall_lt' fun r hr => ?_
simpa only [iInf_lt_iff, exists_prop] using A.exists_isOpen_lt_of_lt r hr
#align set.measure_eq_infi_is_open Set.measure_eq_iInf_isOpen
theorem _root_.Set.exists_isOpen_lt_add [OuterRegular μ] (A : Set α) (hA : μ A ≠ ∞) {ε : ℝ≥0∞}
(hε : ε ≠ 0) : ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < μ A + ε :=
A.exists_isOpen_lt_of_lt _ (ENNReal.lt_add_right hA hε)
#align set.exists_is_open_lt_add Set.exists_isOpen_lt_add
| Mathlib/MeasureTheory/Measure/Regular.lean | 361 | 366 | theorem _root_.Set.exists_isOpen_le_add (A : Set α) (μ : Measure α) [OuterRegular μ] {ε : ℝ≥0∞}
(hε : ε ≠ 0) : ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U ≤ μ A + ε := by |
rcases eq_or_ne (μ A) ∞ with (H | H)
· exact ⟨univ, subset_univ _, isOpen_univ, by simp only [H, _root_.top_add, le_top]⟩
· rcases A.exists_isOpen_lt_add H hε with ⟨U, AU, U_open, hU⟩
exact ⟨U, AU, U_open, hU.le⟩
| 0.9375 |
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 Preimage
variable {f : α → β} {g : β → γ}
@[simp]
theorem preimage_empty : f ⁻¹' ∅ = ∅ :=
rfl
#align set.preimage_empty Set.preimage_empty
| Mathlib/Data/Set/Image.lean | 53 | 55 | theorem preimage_congr {f g : α → β} {s : Set β} (h : ∀ x : α, f x = g x) : f ⁻¹' s = g ⁻¹' s := by |
congr with x
simp [h]
| 0.9375 |
import Mathlib.Algebra.DirectSum.Finsupp
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.DirectSum.TensorProduct
#align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d"
noncomputable section
open DirectSum TensorProduct
open Set LinearMap Submodule
variable (R S M N ι κ : Type*)
[CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N]
[Semiring S] [Algebra R S] [Module S M] [IsScalarTower R S M]
open scoped Classical in
def finsuppTensorFinsupp : (ι →₀ M) ⊗[R] (κ →₀ N) ≃ₗ[S] ι × κ →₀ M ⊗[R] N :=
TensorProduct.AlgebraTensorModule.congr
(finsuppLEquivDirectSum S M ι) (finsuppLEquivDirectSum R N κ) ≪≫ₗ
((TensorProduct.directSum R S (fun _ : ι => M) fun _ : κ => N) ≪≫ₗ
(finsuppLEquivDirectSum S (M ⊗[R] N) (ι × κ)).symm)
#align finsupp_tensor_finsupp finsuppTensorFinsupp
@[simp]
theorem finsuppTensorFinsupp_single (i : ι) (m : M) (k : κ) (n : N) :
finsuppTensorFinsupp R S M N ι κ (Finsupp.single i m ⊗ₜ Finsupp.single k n) =
Finsupp.single (i, k) (m ⊗ₜ n) := by
simp [finsuppTensorFinsupp]
#align finsupp_tensor_finsupp_single finsuppTensorFinsupp_single
@[simp]
theorem finsuppTensorFinsupp_apply (f : ι →₀ M) (g : κ →₀ N) (i : ι) (k : κ) :
finsuppTensorFinsupp R S M N ι κ (f ⊗ₜ g) (i, k) = f i ⊗ₜ g k := by
apply Finsupp.induction_linear f
· simp
· intro f₁ f₂ hf₁ hf₂
simp [add_tmul, hf₁, hf₂]
intro i' m
apply Finsupp.induction_linear g
· simp
· intro g₁ g₂ hg₁ hg₂
simp [tmul_add, hg₁, hg₂]
intro k' n
classical
simp_rw [finsuppTensorFinsupp_single, Finsupp.single_apply, Prod.mk.inj_iff, ite_and]
split_ifs <;> simp
#align finsupp_tensor_finsupp_apply finsuppTensorFinsupp_apply
@[simp]
theorem finsuppTensorFinsupp_symm_single (i : ι × κ) (m : M) (n : N) :
(finsuppTensorFinsupp R S M N ι κ).symm (Finsupp.single i (m ⊗ₜ n)) =
Finsupp.single i.1 m ⊗ₜ Finsupp.single i.2 n :=
Prod.casesOn i fun _ _ =>
(LinearEquiv.symm_apply_eq _).2 (finsuppTensorFinsupp_single _ _ _ _ _ _ _ _ _ _).symm
#align finsupp_tensor_finsupp_symm_single finsuppTensorFinsupp_symm_single
def finsuppTensorFinsuppLid : (ι →₀ R) ⊗[R] (κ →₀ N) ≃ₗ[R] ι × κ →₀ N :=
finsuppTensorFinsupp R R R N ι κ ≪≫ₗ Finsupp.lcongr (Equiv.refl _) (TensorProduct.lid R N)
@[simp]
theorem finsuppTensorFinsuppLid_apply_apply (f : ι →₀ R) (g : κ →₀ N) (a : ι) (b : κ) :
finsuppTensorFinsuppLid R N ι κ (f ⊗ₜ[R] g) (a, b) = f a • g b := by
simp [finsuppTensorFinsuppLid]
@[simp]
theorem finsuppTensorFinsuppLid_single_tmul_single (a : ι) (b : κ) (r : R) (n : N) :
finsuppTensorFinsuppLid R N ι κ (Finsupp.single a r ⊗ₜ[R] Finsupp.single b n) =
Finsupp.single (a, b) (r • n) := by
simp [finsuppTensorFinsuppLid]
@[simp]
theorem finsuppTensorFinsuppLid_symm_single_smul (i : ι × κ) (r : R) (n : N) :
(finsuppTensorFinsuppLid R N ι κ).symm (Finsupp.single i (r • n)) =
Finsupp.single i.1 r ⊗ₜ Finsupp.single i.2 n :=
Prod.casesOn i fun _ _ =>
(LinearEquiv.symm_apply_eq _).2 (finsuppTensorFinsuppLid_single_tmul_single ..).symm
def finsuppTensorFinsuppRid : (ι →₀ M) ⊗[R] (κ →₀ R) ≃ₗ[R] ι × κ →₀ M :=
finsuppTensorFinsupp R R M R ι κ ≪≫ₗ Finsupp.lcongr (Equiv.refl _) (TensorProduct.rid R M)
@[simp]
| Mathlib/LinearAlgebra/DirectSum/Finsupp.lean | 315 | 317 | theorem finsuppTensorFinsuppRid_apply_apply (f : ι →₀ M) (g : κ →₀ R) (a : ι) (b : κ) :
finsuppTensorFinsuppRid R M ι κ (f ⊗ₜ[R] g) (a, b) = g b • f a := by |
simp [finsuppTensorFinsuppRid]
| 0.9375 |
import Mathlib.Analysis.SpecialFunctions.Exp
import Mathlib.Tactic.Positivity.Core
import Mathlib.Algebra.Ring.NegOnePow
#align_import analysis.special_functions.trigonometric.basic from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
noncomputable section
open scoped Classical
open Topology Filter Set
namespace Complex
@[continuity, fun_prop]
theorem continuous_sin : Continuous sin := by
change Continuous fun z => (exp (-z * I) - exp (z * I)) * I / 2
continuity
#align complex.continuous_sin Complex.continuous_sin
@[fun_prop]
theorem continuousOn_sin {s : Set ℂ} : ContinuousOn sin s :=
continuous_sin.continuousOn
#align complex.continuous_on_sin Complex.continuousOn_sin
@[continuity, fun_prop]
| Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean | 65 | 67 | theorem continuous_cos : Continuous cos := by |
change Continuous fun z => (exp (z * I) + exp (-z * I)) / 2
continuity
| 0.9375 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.